/* Route atlas */
.line-atlas {
  margin-top: clamp(48px, 7vw, 96px);
}
.atlas-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink);
}
.atlas-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--coral-deep);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  line-height: 1.4;
}
.atlas-kicker span {
  display: block;
  width: 7px;
  height: 7px;
  background: var(--coral);
}
.atlas-head h3 {
  margin-top: 10px;
  font-family: var(--font-cn);
  font-size: clamp(2rem, 3.2vw, 3.1rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.atlas-intro {
  max-width: 520px;
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.8;
}
.atlas-hint {
  flex: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.atlas-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: clamp(22px, 3vw, 38px);
  align-items: start;
  margin-top: 24px;
}
.atlas-picker-wrap {
  padding: 14px;
  border: 1px solid var(--ink);
  background: rgba(255, 255, 255, 0.24);
}
.atlas-picker-label {
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(14, 25, 19, 0.16);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}
.atlas-group {
  margin-top: 12px;
}
.atlas-group-title {
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(14, 25, 19, 0.12);
  color: var(--coral-deep);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  line-height: 1.4;
}
.atlas-tab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  margin-top: 4px;
}
.atlas-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.atlas-tab:hover {
  background: rgba(14, 25, 19, 0.06);
}
.atlas-tab.is-active {
  background: var(--ink);
  color: var(--paper);
}
.atlas-tab-swatch {
  flex: none;
  width: 18px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  box-shadow: 0 0 0 1px rgba(14, 25, 19, 0.18);
}
.atlas-tab-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.atlas-tab-copy strong {
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.atlas-tab-copy small {
  flex: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.02em;
  line-height: 1.3;
  white-space: nowrap;
}
.atlas-tab.is-active .atlas-tab-copy small {
  color: rgba(241, 233, 218, 0.52);
}
.atlas-board {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 2.6vw, 32px);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  box-shadow: 10px 10px 0 rgba(255, 91, 53, 0.9);
}
.atlas-board::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 5px;
  background: var(--line);
  content: "";
}
.atlas-loading {
  color: rgba(241, 233, 218, 0.55);
  font-family: var(--font-mono);
  font-size: 9px;
}
.atlas-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-light);
}
.atlas-title-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  min-width: 0;
}
.atlas-board-swatch {
  flex: none;
  width: 6px;
  min-height: 58px;
  border-radius: 3px;
  background: var(--line);
  box-shadow: 0 0 0 1px rgba(241, 233, 218, 0.2);
}
.atlas-title-copy {
  min-width: 0;
}
.atlas-board-kicker {
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  line-height: 1.5;
}
.atlas-board h4 {
  margin-top: 5px;
  font-family: var(--font-sans);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.atlas-board-en {
  margin-top: 5px;
  color: rgba(241, 233, 218, 0.48);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  line-height: 1.5;
}
.atlas-board-meta {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  text-align: right;
}
.atlas-type {
  display: inline-block;
  padding: 4px 7px;
  border: 1px solid rgba(241, 233, 218, 0.28);
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  line-height: 1.3;
  white-space: nowrap;
}
.atlas-board-meta strong {
  color: rgba(241, 233, 218, 0.55);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.06em;
}
.atlas-stops {
  position: relative;
  margin: 10px 0 0;
  padding: 4px 0 0;
  list-style: none;
}
.atlas-stops::before {
  position: absolute;
  top: 18px;
  bottom: 22px;
  left: 7px;
  width: 3px;
  border-radius: 2px;
  background: var(--line);
  box-shadow: 0 0 0 1px rgba(241, 233, 218, 0.18);
  content: "";
  opacity: 0.9;
}
.atlas-stop {
  position: relative;
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 47px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(241, 233, 218, 0.1);
}
.atlas-stop:last-child {
  border-bottom: 0;
}
.atlas-stop-dot {
  position: relative;
  z-index: 1;
  display: block;
  width: 11px;
  height: 11px;
  margin-left: 2px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 3px rgba(241, 233, 218, 0.17);
}
.atlas-stop.is-terminal .atlas-stop-dot {
  background: var(--line);
}
.atlas-stop-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.atlas-stop-copy strong {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.atlas-stop-copy small {
  color: rgba(241, 233, 218, 0.46);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.02em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.atlas-stop-time {
  color: #d7f26a;
  font-family: var(--font-pixel);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.atlas-stop-time--terminal {
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 7px;
}
.atlas-board-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-light);
  color: rgba(241, 233, 218, 0.48);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.7;
}
.atlas-empty {
  margin-top: 20px;
  padding: 24px;
  border: 1px dashed rgba(241, 233, 218, 0.25);
}
.atlas-empty strong {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 500;
}
.atlas-empty p {
  margin-top: 7px;
  color: rgba(241, 233, 218, 0.5);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.7;
}
.atlas-noscript {
  margin-top: 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}
@media (max-width: 1000px) {
  .atlas-head {
    display: block;
  }
  .atlas-hint {
    display: block;
    margin-top: 12px;
  }
  .atlas-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .atlas-tab-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px 10px;
  }
  .atlas-picker-wrap {
    padding: 12px;
  }
}
@media (max-width: 560px) {
  .atlas-head h3 {
    font-size: 2rem;
  }
  .atlas-intro {
    font-size: 0.8rem;
  }
  .atlas-tab {
    padding: 7px 6px;
  }
  .atlas-tab-copy small {
    display: none;
  }
  .atlas-tab-copy strong {
    font-size: 0.8rem;
  }
  .atlas-board {
    padding: 18px 15px;
    box-shadow: 5px 5px 0 rgba(255, 91, 53, 0.9);
  }
  .atlas-board-head {
    display: block;
  }
  .atlas-board-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
  }
  .atlas-board h4 {
    font-size: 2rem;
  }
  .atlas-stop {
    grid-template-columns: 21px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 44px;
  }
  .atlas-stop-copy strong {
    font-size: 0.94rem;
  }
  .atlas-stop-copy small {
    font-size: 7px;
  }
  .atlas-stop-time {
    font-size: 8.5px;
  }
}

/* Live API layer */
.atlas-board-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(241, 233, 218, 0.12);
}
.atlas-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.atlas-view-tab {
  padding: 6px 9px;
  border: 1px solid rgba(241, 233, 218, 0.22);
  background: transparent;
  color: rgba(241, 233, 218, 0.58);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.05em;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.atlas-view-tab:hover {
  border-color: rgba(241, 233, 218, 0.5);
  color: var(--paper);
}
.atlas-view-tab.is-active {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--ink);
}
.atlas-api-state {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  color: rgba(241, 233, 218, 0.5);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.atlas-api-state i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(241, 233, 218, 0.32);
}
.atlas-api-state[data-state="online"] i {
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(215, 242, 106, 0.12);
}
.atlas-api-state[data-state="loading"] i {
  background: var(--coral);
  animation: atlasApiPulse 1.2s ease-in-out infinite;
}
.atlas-api-state[data-state="degraded"] i {
  background: var(--coral);
}
.atlas-api-state[data-state="offline"] i {
  background: var(--coral-deep);
}
@keyframes atlasApiPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
.atlas-board-view {
  min-height: 80px;
}
.atlas-stop.is-clickable {
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.atlas-stop.is-clickable:hover,
.atlas-stop.is-clickable:focus-visible {
  background: rgba(241, 233, 218, 0.055);
  outline: none;
}
.atlas-stop.is-clickable:hover .atlas-stop-copy strong,
.atlas-stop.is-clickable:focus-visible .atlas-stop-copy strong {
  color: var(--coral);
}
.atlas-timetable-panel {
  margin-top: 14px;
}
.atlas-timetable-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(241, 233, 218, 0.12);
}
.atlas-timetable-head span {
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}
.atlas-timetable-head em {
  color: rgba(241, 233, 218, 0.4);
  font-family: var(--font-mono);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.03em;
}
.atlas-train-card {
  padding: 14px 0;
  border-bottom: 1px solid rgba(241, 233, 218, 0.1);
}
.atlas-train-card:last-child {
  border-bottom: 0;
}
.atlas-train-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.atlas-train-title strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
}
.atlas-train-title small {
  display: block;
  margin-top: 3px;
  color: rgba(241, 233, 218, 0.42);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.03em;
}
.atlas-train-status {
  flex: none;
  max-width: 58%;
  color: rgba(241, 233, 218, 0.56);
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 1.5;
  text-align: right;
}
.atlas-train-status em {
  display: block;
  margin-top: 3px;
  color: var(--lime);
  font-family: var(--font-pixel);
  font-size: 9px;
  font-style: normal;
}
.atlas-train-stops {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.atlas-train-stop {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
  border-top: 1px solid rgba(241, 233, 218, 0.07);
}
.atlas-train-stop span {
  color: rgba(241, 233, 218, 0.7);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  line-height: 1.4;
}
.atlas-train-stop em {
  flex: none;
  color: rgba(241, 233, 218, 0.48);
  font-family: var(--font-pixel);
  font-size: 8px;
  font-style: normal;
}
.atlas-train-stop.is-next span,
.atlas-train-stop.is-next em {
  color: var(--coral);
}
.atlas-station-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(241, 233, 218, 0.16);
}
.atlas-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.atlas-panel-copy span {
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}
.atlas-panel-copy strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.25;
}
.atlas-panel-copy em {
  display: block;
  margin-top: 3px;
  color: rgba(241, 233, 218, 0.46);
  font-family: var(--font-mono);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.03em;
}
.atlas-panel-close {
  flex: none;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(241, 233, 218, 0.28);
  background: transparent;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.atlas-panel-close:hover {
  border-color: var(--coral);
  color: var(--coral);
}
.atlas-panel-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin-top: 16px;
  padding: 12px 0;
  border-top: 1px solid rgba(241, 233, 218, 0.1);
  border-bottom: 1px solid rgba(241, 233, 218, 0.1);
}
.atlas-panel-meta span {
  display: block;
  color: rgba(241, 233, 218, 0.4);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.05em;
}
.atlas-panel-meta strong {
  display: block;
  margin-top: 3px;
  color: rgba(241, 233, 218, 0.78);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.atlas-arrivals-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 8px;
}
.atlas-arrivals-head span {
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}
.atlas-arrivals-head em {
  color: rgba(241, 233, 218, 0.4);
  font-family: var(--font-mono);
  font-size: 7px;
  font-style: normal;
}
.atlas-arrivals-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.atlas-arrival {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid rgba(241, 233, 218, 0.08);
}
.atlas-arrival-copy {
  min-width: 0;
}
.atlas-arrival-copy strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.atlas-arrival-copy small {
  display: block;
  margin-top: 2px;
  color: rgba(241, 233, 218, 0.44);
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 1.5;
}
.atlas-arrival > em {
  flex: none;
  color: var(--lime);
  font-family: var(--font-pixel);
  font-size: 9px;
  font-style: normal;
}
.atlas-arrival-empty {
  padding: 12px 0;
  color: rgba(241, 233, 218, 0.42);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.6;
}
@media (max-width: 560px) {
  .atlas-board-tools {
    align-items: flex-start;
  }
  .atlas-api-state {
    margin-top: 6px;
  }
  .atlas-train-head {
    display: block;
  }
  .atlas-train-status {
    max-width: none;
    margin-top: 6px;
    text-align: left;
  }
  .atlas-panel-meta {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Station arrival board: readable two-column rows */
.atlas-arrivals-head span {
  font-size: 9px;
}
.atlas-arrivals-head em {
  font-size: 8px;
}
.atlas-arrival {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid rgba(241, 233, 218, 0.1);
}
.atlas-arrival-swatch {
  display: block;
  width: 4px;
  height: 38px;
  border-radius: 2px;
  background: var(--route-color, var(--coral));
}
.atlas-arrival-main {
  min-width: 0;
}
.atlas-arrival-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.atlas-arrival-title strong {
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.atlas-arrival-title span {
  padding: 3px 5px;
  border: 1px solid rgba(255, 91, 53, 0.42);
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.03em;
  line-height: 1.2;
  white-space: nowrap;
}
.atlas-arrival-en {
  display: block;
  margin-top: 3px;
  color: rgba(241, 233, 218, 0.44);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.atlas-arrival-detail {
  margin-top: 4px;
  color: rgba(241, 233, 218, 0.56);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.atlas-arrival-time {
  flex: none;
  min-width: 56px;
  text-align: right;
}
.atlas-arrival-time strong {
  display: block;
  color: var(--lime);
  font-family: var(--font-pixel);
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
}
.atlas-arrival-time span {
  display: block;
  margin-top: 5px;
  color: rgba(241, 233, 218, 0.42);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.05em;
}
.atlas-arrival.is-now .atlas-arrival-time strong {
  color: var(--coral);
}
.atlas-arrival-empty {
  font-size: 9px;
  line-height: 1.7;
}
.atlas-panel-copy strong {
  font-size: 1.45rem;
}
.atlas-panel-meta span {
  font-size: 8px;
}
.atlas-panel-meta strong {
  font-size: 10px;
}
@media (max-width: 560px) {
  .atlas-arrival {
    grid-template-columns: 3px minmax(0, 1fr) auto;
    gap: 9px;
  }
  .atlas-arrival-title strong {
    font-size: 0.92rem;
  }
  .atlas-arrival-time strong {
    font-size: 11px;
  }
  .atlas-arrival-time {
    min-width: 44px;
  }
}

/* Slightly larger station-list type for readability */
.atlas-stop-copy strong {
  font-size: 1.05rem;
}
.atlas-stop-copy small {
  font-size: 8.5px;
}
.atlas-stop-time {
  font-size: 10.5px;
}
.atlas-board-foot {
  font-size: 9px;
}

/* Readability pass: atlas + arrivals are intentionally oversized here. */
.primary-nav .nav-link,
.nav-link {
  font-size: 15px;
}
.header-live {
  font-size: 9px;
}
.atlas-picker-label {
  font-size: 9.5px;
}
.atlas-group-title {
  font-size: 9px;
}
.atlas-tab {
  padding: 9px 9px;
}
.atlas-tab-copy strong {
  font-size: 1rem;
}
.atlas-tab-copy small {
  font-size: 8px;
}
.atlas-board-kicker {
  font-size: 9.5px;
}
.atlas-board-en {
  font-size: 10px;
}
.atlas-type {
  font-size: 9px;
  padding: 5px 8px;
}
.atlas-board-meta strong {
  font-size: 11px;
}
.atlas-view-tab {
  font-size: 9.5px;
  padding: 7px 11px;
}
.atlas-api-state {
  font-size: 9px;
}
.atlas-stop {
  grid-template-columns: 27px minmax(0, 1fr) auto;
  min-height: 56px;
  padding: 9px 0;
}
.atlas-stops::before {
  left: 9px;
}
.atlas-stop-dot {
  width: 13px;
  height: 13px;
  margin-left: 3px;
}
.atlas-stop-copy strong {
  font-size: 1.2rem;
}
.atlas-stop-copy small {
  font-size: 10px;
}
.atlas-stop-time {
  font-size: 14px;
}
.atlas-stop-time--terminal {
  font-size: 9px;
}
.atlas-board-foot {
  font-size: 10.5px;
}
.atlas-timetable-head span {
  font-size: 10px;
}
.atlas-timetable-head em {
  font-size: 8.5px;
}
.atlas-train-title strong {
  font-size: 1.2rem;
}
.atlas-train-title small {
  font-size: 8.5px;
}
.atlas-train-status {
  font-size: 9px;
}
.atlas-train-status em {
  font-size: 12px;
}
.atlas-train-stop span {
  font-size: 0.95rem;
}
.atlas-train-stop em {
  font-size: 10px;
}
.atlas-panel-copy span {
  font-size: 9px;
}
.atlas-panel-copy strong {
  font-size: 1.75rem;
}
.atlas-panel-copy em {
  font-size: 9px;
}
.atlas-panel-meta span {
  font-size: 9px;
}
.atlas-panel-meta strong {
  font-size: 11.5px;
}
.atlas-arrivals-head span {
  font-size: 11px;
}
.atlas-arrivals-head em {
  font-size: 9px;
}
.atlas-arrival {
  gap: 14px;
  padding: 15px 0;
}
.atlas-arrival-swatch {
  width: 5px;
  height: 46px;
}
.atlas-arrival-title strong {
  font-size: 1.2rem;
}
.atlas-arrival-title span {
  font-size: 8.5px;
  padding: 3px 6px;
}
.atlas-arrival-en {
  font-size: 10px;
}
.atlas-arrival-detail {
  font-size: 10.5px;
}
.atlas-arrival-time {
  min-width: 72px;
}
.atlas-arrival-time strong {
  font-size: 20px;
}
.atlas-arrival-time span {
  font-size: 10px;
  margin-top: 6px;
}
.atlas-arrival-empty {
  font-size: 10px;
}
@media (max-width: 700px) {
  .primary-nav .nav-link,
  .nav-link {
    font-size: 13px;
  }
  .atlas-picker-label,
  .atlas-group-title {
    font-size: 8px;
  }
  .atlas-tab-copy strong {
    font-size: 0.88rem;
  }
  .atlas-tab-copy small {
    display: none;
  }
  .atlas-board-kicker {
    font-size: 8px;
  }
  .atlas-board-en {
    font-size: 8px;
  }
  .atlas-view-tab {
    font-size: 8px;
    padding: 6px 8px;
  }
  .atlas-api-state {
    font-size: 7.5px;
  }
  .atlas-stop {
    grid-template-columns: 23px minmax(0, 1fr) auto;
    min-height: 50px;
    padding: 7px 0;
  }
  .atlas-stop-copy strong {
    font-size: 1.02rem;
  }
  .atlas-stop-copy small {
    font-size: 8.5px;
  }
  .atlas-stop-time {
    font-size: 12px;
  }
  .atlas-board-foot {
    font-size: 9px;
  }
  .atlas-arrival {
    grid-template-columns: 3px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 12px 0;
  }
  .atlas-arrival-swatch {
    width: 3px;
    height: 40px;
  }
  .atlas-arrival-title strong {
    font-size: 1rem;
  }
  .atlas-arrival-title span {
    font-size: 7px;
  }
  .atlas-arrival-en {
    font-size: 8.5px;
  }
  .atlas-arrival-detail {
    font-size: 9px;
  }
  .atlas-arrival-time {
    min-width: 52px;
  }
  .atlas-arrival-time strong {
    font-size: 15px;
  }
  .atlas-arrival-time span {
    font-size: 8px;
  }
  .atlas-panel-copy strong {
    font-size: 1.4rem;
  }
  .atlas-panel-copy em,
  .atlas-panel-meta span {
    font-size: 8px;
  }
  .atlas-panel-meta strong {
    font-size: 10px;
  }
  .atlas-arrivals-head span {
    font-size: 9px;
  }
}

/* Final readability bump for the station board */
.atlas-arrival-title strong {
  font-size: 1.28rem;
}
.atlas-arrival-title span {
  font-size: 9.5px;
  padding: 4px 7px;
}
.atlas-arrival-en {
  font-size: 11px;
}
.atlas-arrival-detail {
  font-size: 12px;
  line-height: 1.55;
}
.atlas-arrival-time {
  min-width: 82px;
}
.atlas-arrival-time strong {
  font-size: 22px;
}
.atlas-arrival-time span {
  font-size: 11px;
  margin-top: 6px;
}
.atlas-panel-meta span {
  font-size: 9.5px;
}
.atlas-panel-meta strong {
  font-size: 12.5px;
}
.atlas-arrivals-head span {
  font-size: 12px;
}
.atlas-arrivals-head em {
  font-size: 9.5px;
}
.atlas-stop-time {
  font-size: 15px;
}
.atlas-board-foot {
  font-size: 11px;
}
@media (max-width: 700px) {
  .atlas-arrival-title strong {
    font-size: 1.05rem;
  }
  .atlas-arrival-title span {
    font-size: 7.5px;
    padding: 3px 5px;
  }
  .atlas-arrival-en {
    font-size: 9px;
  }
  .atlas-arrival-detail {
    font-size: 10px;
  }
  .atlas-arrival-time {
    min-width: 58px;
  }
  .atlas-arrival-time strong {
    font-size: 17px;
  }
  .atlas-arrival-time span {
    font-size: 9px;
  }
  .atlas-panel-meta span {
    font-size: 8.5px;
  }
  .atlas-panel-meta strong {
    font-size: 11px;
  }
  .atlas-arrivals-head span {
    font-size: 10px;
  }
  .atlas-stop-time {
    font-size: 12px;
  }
}

/* Larger line picker without the right-hand type captions. */
.atlas-layout {
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
}
.atlas-picker-wrap {
  padding: 18px;
}
.atlas-picker-label {
  font-size: 10px;
  padding-bottom: 10px;
}
.atlas-group {
  margin-top: 18px;
}
.atlas-group-title {
  font-size: 10px;
  padding-bottom: 8px;
}
.atlas-tab-grid {
  gap: 2px;
  margin-top: 8px;
}
.atlas-tab {
  gap: 11px;
  padding: 12px 11px;
}
.atlas-tab-swatch {
  width: 24px;
  height: 5px;
}
.atlas-tab-copy strong {
  font-size: 1.08rem;
  line-height: 1.35;
}
.atlas-tab-copy small {
  display: none;
}
@media (max-width: 1000px) {
  .atlas-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .atlas-picker-wrap {
    padding: 16px;
  }
  .atlas-tab-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 12px;
  }
}
@media (max-width: 560px) {
  .atlas-tab {
    padding: 10px 8px;
  }
  .atlas-tab-copy strong {
    font-size: 0.98rem;
  }
  .atlas-picker-label,
  .atlas-group-title {
    font-size: 9px;
  }
}

/* Restore line-type captions and make them readable. */
.atlas-tab-copy small {
  display: block;
  flex: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  line-height: 1.3;
  white-space: nowrap;
}
.atlas-tab.is-active .atlas-tab-copy small {
  color: rgba(241, 233, 218, 0.62);
}
.atlas-stop-time.is-offline {
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}
@media (max-width: 700px) {
  .atlas-tab-copy small {
    display: block;
    font-size: 8.5px;
  }
}
@media (max-width: 560px) {
  .atlas-tab-copy small {
    display: block;
    font-size: 8px;
  }
}

/* Picker back to its original footprint; only the type caption is enlarged. */
.atlas-layout {
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: clamp(22px, 3vw, 38px);
}
.atlas-picker-wrap {
  padding: 14px;
}
.atlas-picker-label {
  font-size: 8px;
  padding-bottom: 7px;
}
.atlas-group {
  margin-top: 12px;
}
.atlas-group-title {
  font-size: 7.5px;
  padding-bottom: 5px;
}
.atlas-tab-grid {
  gap: 1px;
  margin-top: 4px;
}
.atlas-tab {
  gap: 8px;
  padding: 7px 8px;
}
.atlas-tab-swatch {
  width: 18px;
  height: 4px;
}
.atlas-tab-copy {
  gap: 8px;
}
.atlas-tab-copy strong {
  font-size: 0.84rem;
}
.atlas-tab-copy small {
  display: block;
  flex: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  line-height: 1.3;
  white-space: nowrap;
}
.atlas-tab.is-active .atlas-tab-copy small {
  color: rgba(241, 233, 218, 0.66);
}
@media (max-width: 1000px) {
  .atlas-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .atlas-picker-wrap {
    padding: 12px;
  }
  .atlas-tab-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px 10px;
  }
}
@media (max-width: 560px) {
  .atlas-tab {
    gap: 7px;
    padding: 7px 6px;
  }
  .atlas-tab-copy {
    gap: 6px;
  }
  .atlas-tab-copy strong {
    font-size: 0.8rem;
  }
  .atlas-tab-copy small {
    font-size: 9px;
  }
}

/* Arrival tabs + six fixed direction slots */
.atlas-arrival-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(241, 233, 218, 0.12);
}
.atlas-arrival-tab {
  padding: 8px 12px;
  border: 1px solid rgba(241, 233, 218, 0.22);
  background: transparent;
  color: rgba(241, 233, 218, 0.66);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.atlas-arrival-tab:hover {
  border-color: var(--paper);
  color: var(--paper);
}
.atlas-arrival-tab.is-active {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--ink);
}
.atlas-arrival-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.atlas-arrival-column {
  min-width: 0;
}
.atlas-direction-head {
  margin: 0;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(241, 233, 218, 0.14);
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}
.atlas-slot {
  display: flex;
  flex-direction: column;
  min-height: 104px;
  padding: 12px 0 12px 11px;
  border-top: 1px solid rgba(241, 233, 218, 0.1);
  border-left: 3px solid var(--slot-color, rgba(241, 233, 218, 0.22));
}
.atlas-slot.is-empty {
  justify-content: center;
  border-left-color: rgba(241, 233, 218, 0.12);
  color: rgba(241, 233, 218, 0.3);
  font-family: var(--font-mono);
  font-size: 9px;
}
.atlas-slot-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.atlas-slot-service {
  max-width: 62%;
  padding: 3px 6px;
  border: 1px solid rgba(255, 91, 53, 0.36);
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.02em;
  line-height: 1.35;
}
.atlas-slot-time {
  flex: none;
  text-align: right;
}
.atlas-slot-time strong {
  display: block;
  color: var(--lime);
  font-family: var(--font-pixel);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}
.atlas-slot-time small {
  display: block;
  margin-top: 5px;
  color: rgba(241, 233, 218, 0.42);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}
.atlas-slot-destination {
  display: block;
  margin-top: 9px;
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.atlas-slot-detail {
  display: block;
  margin-top: 4px;
  color: rgba(241, 233, 218, 0.5);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.5;
}
@media (max-width: 700px) {
  .atlas-arrival-board {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .atlas-arrival-tab {
    padding: 7px 10px;
    font-size: 0.84rem;
  }
  .atlas-slot {
    min-height: 92px;
  }
  .atlas-slot-time strong {
    font-size: 18px;
  }
  .atlas-slot-destination {
    font-size: 1rem;
  }
}

/* Three-column route atlas: picker / line board / station detail */
.atlas-layout.has-station {
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(360px, 0.92fr);
}
.atlas-station-column {
  min-width: 0;
}
.atlas-station-column[hidden] {
  display: none;
}
.atlas-station-column .atlas-station-panel {
  margin: 0;
  padding: clamp(20px, 2.2vw, 30px);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  box-shadow: 10px 10px 0 rgba(255, 91, 53, 0.9);
}
.atlas-station-column .atlas-panel-head {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(241, 233, 218, 0.12);
}
.atlas-station-column .atlas-panel-copy strong {
  font-size: clamp(1.6rem, 2.2vw, 2rem);
}
.atlas-station-column .atlas-panel-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 16px;
  margin-top: 16px;
}
.atlas-station-column .atlas-arrival-board {
  gap: 16px;
}
@media (max-width: 1500px) {
  .atlas-station-column .atlas-panel-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1320px) {
  .atlas-layout.has-station {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  }
  .atlas-station-column {
    grid-column: 1 / -1;
  }
}
@media (max-width: 1000px) {
  .atlas-layout.has-station {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 700px) {
  .atlas-station-column .atlas-station-panel {
    padding: 18px 15px;
    box-shadow: 5px 5px 0 rgba(255, 91, 53, 0.9);
  }
}

.atlas-slot-time small {
  font-size: 9.5px;
}
.atlas-slot-time small.is-imminent {
  color: var(--coral);
}
.atlas-slot-time small.is-arrived {
  color: var(--lime);
  font-weight: 600;
}

.atlas-slot-time small.is-running {
  color: rgba(241, 233, 218, 0.42);
}

/* Direction/service buttons and six focused slots */
.atlas-arrival-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
}
.atlas-arrival-variant {
  padding: 7px 10px;
  border: 1px solid rgba(241, 233, 218, 0.24);
  background: transparent;
  color: rgba(241, 233, 218, 0.72);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.atlas-arrival-variant:hover {
  border-color: var(--paper);
  color: var(--paper);
}
.atlas-arrival-variant.is-active {
  border-color: var(--coral);
  background: rgba(255, 91, 53, 0.12);
  color: var(--coral);
}
.atlas-slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.atlas-slot-grid .atlas-slot {
  min-height: 104px;
}
@media (max-width: 700px) {
  .atlas-arrival-variant {
    font-size: 8.5px;
    padding: 6px 8px;
  }
  .atlas-slot-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.atlas-arrival-variant {
  padding: 8px 12px;
  font-size: 11px;
}
@media (max-width: 700px) {
  .atlas-arrival-variant {
    padding: 7px 9px;
    font-size: 9.5px;
  }
}

/* Station heading: large Chinese + inline English */
.atlas-panel-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}
.atlas-station-column .atlas-panel-copy strong {
  display: inline;
  margin: 0;
  font-size: clamp(2.1rem, 3vw, 2.85rem);
  line-height: 1.15;
}
.atlas-station-column .atlas-panel-copy em {
  display: inline;
  margin: 0;
  color: rgba(241, 233, 218, 0.62);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-style: normal;
  letter-spacing: 0.03em;
  line-height: 1.3;
}
@media (max-width: 700px) {
  .atlas-panel-title {
    gap: 8px;
  }
  .atlas-station-column .atlas-panel-copy strong {
    font-size: 2rem;
  }
  .atlas-station-column .atlas-panel-copy em {
    font-size: 0.85rem;
  }
}

/* Keep the English station name beside the Chinese name. */
.atlas-layout.has-station {
  grid-template-columns: minmax(260px, 320px) minmax(0, 0.95fr) minmax(420px, 1.05fr);
}
.atlas-panel-title {
  flex-wrap: nowrap;
}
.atlas-station-column .atlas-panel-copy strong {
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.atlas-station-column .atlas-panel-copy em {
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .atlas-layout.has-station {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Line-board direction/service switcher and moved timetable button */
.atlas-view-tabs .atlas-view-tab[data-view="timetable"] {
  display: none;
}
.atlas-board-head-side {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.atlas-header-timetable {
  padding: 6px 9px;
  border: 1px solid rgba(241, 233, 218, 0.22);
  background: transparent;
  color: rgba(241, 233, 218, 0.7);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  line-height: 1.3;
  cursor: pointer;
}
.atlas-header-timetable:hover {
  border-color: var(--paper);
  color: var(--paper);
}
.atlas-header-timetable.is-active {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--ink);
}
.atlas-line-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(241, 233, 218, 0.12);
}
.atlas-line-variant {
  padding: 6px 10px;
  border: 1px solid rgba(241, 233, 218, 0.24);
  background: transparent;
  color: rgba(241, 233, 218, 0.7);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
  line-height: 1.4;
  cursor: pointer;
}
.atlas-line-variant:hover {
  border-color: var(--paper);
  color: var(--paper);
}
.atlas-line-variant.is-active {
  border-color: var(--coral);
  background: rgba(255, 91, 53, 0.12);
  color: var(--coral);
}
@media (max-width: 700px) {
  .atlas-header-timetable {
    font-size: 7px;
    padding: 5px 7px;
  }
  .atlas-line-variant {
    font-size: 8.5px;
    padding: 6px 8px;
  }
}

/* Timetable control back in the board toolbar. */
.atlas-view-tabs .atlas-view-tab[data-view="timetable"] {
  display: inline-block;
}
.atlas-header-timetable {
  display: none;
}

/* Keep the Chinese station name on one line; let the English wrap beside it. */
.atlas-panel-title {
  align-items: flex-start;
  gap: 10px;
}
.atlas-station-column .atlas-panel-copy strong {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: clamp(2rem, 2.6vw, 2.6rem);
}
.atlas-station-column .atlas-panel-copy em {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}
.route-board[hidden] {
  display: none !important;
}

.network-index[hidden] {
  display: none !important;
}

/* Mobile station sheet: overlays the line board and slides up/down. */
body.station-sheet-open {
  overflow: hidden;
}
@media (max-width: 768px) {
  .atlas-station-column {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    background: rgba(8, 8, 8, 0.64);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.22s ease;
    pointer-events: none;
    overflow: hidden;
  }
  .atlas-station-column.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .atlas-station-column.is-closing {
    pointer-events: none;
  }
  .atlas-station-column[hidden] {
    display: none;
  }
  .atlas-station-column .atlas-station-panel {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 20px 16px;
  }
}

/* Keep the mobile station sheet below the fixed header. */
@media (max-width: 768px) {
  .atlas-station-column {
    top: calc(var(--header-h, 72px) + 1px);
  }
  .atlas-station-column .atlas-station-panel {
    max-height: calc(100vh - var(--header-h, 72px) - 21px);
    max-height: calc(100dvh - var(--header-h, 72px) - 21px);
  }
}
