:root {
  --bg: #0a101a;
  --panel: rgba(17, 25, 39, 0.94);
  --text: #eff3f8;
  --muted: #a2afc2;
  --line: rgba(157, 182, 213, 0.19);
  --mint: #a9efd2;
  --shadow: 0 14px 50px #0003;
  --input: #ffffff06;
  --soft: #d4e1f2;
  --active: #bcefd9;
  --active-text: #142a21;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    Inter, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
}
body.light {
  --bg: #e9ece8;
  --panel: rgba(250, 251, 248, 0.96);
  --text: #22312f;
  --muted: #53685f;
  --line: #83968d55;
  --mint: #12694d;
  --shadow: 0 14px 50px #43554816;
  --input: #374c4308;
  --soft: #364e43;
  --active: #254e40;
  --active-text: #fff;
  color-scheme: light;
}
button,
input,
select {
  font: inherit;
}
button,
a,
select,
input {
  touch-action: manipulation;
}
button,
select {
  color: inherit;
  cursor: pointer;
}
button {
  background: none;
  border: 0;
  min-height: 44px;
}
button:hover,
a:hover {
  filter: brightness(1.16);
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
a {
  color: inherit;
}
svg {
  display: block;
}
[hidden] {
  display: none !important;
}
.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
#app {
  height: 100dvh;
  width: 100%;
  min-height: 0;
  position: relative;
}
#map {
  position: absolute;
  inset: 0 0 0 370px;
}
#map canvas {
  display: block;
  outline: 0;
}
#labels {
  position: absolute;
  inset: 0 0 0 370px;
  pointer-events: none;
  overflow: hidden;
}
.station-label {
  position: absolute;
  white-space: nowrap;
  transform: translate(-50%, -120%);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 15px #0002;
  pointer-events: auto;
  min-height: 36px;
}
.station-label small {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-top: 2px;
}
.station-label.selected {
  border-color: var(--mint);
  color: var(--mint);
}
.geo-label {
  background: transparent;
  border: 0;
  box-shadow: none;
  letter-spacing: 0.15em;
  color: var(--muted);
  pointer-events: none;
  font-size: 12px;
  font-weight: 400;
}
.topbar {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 20px;
  display: flex;
  align-items: center;
  gap: 25px;
  z-index: 5;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  text-decoration: none;
  min-height: 48px;
}
.brand-mark {
  position: relative;
  width: 41px;
  height: 41px;
  border: 2px solid var(--text);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 800;
}
.brand-mark span {
  position: absolute;
  background: var(--mint);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  bottom: -3px;
  right: 0;
  border: 2px solid var(--bg);
}
.brand strong {
  display: block;
  font-size: 20px;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.brand small {
  font-size: 9px;
  letter-spacing: 0.19em;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}
.header-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 22px;
}
.header-meta b {
  color: var(--text);
  font-size: 21px;
  font-weight: 500;
  margin-left: 4px;
}
.header-meta span {
  width: 8px;
}
.top-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.seg {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  gap: 2px;
  background: var(--panel);
}
.seg button {
  padding: 7px 14px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  border-radius: 7px;
}
.seg button.active {
  background: var(--active);
  color: var(--active-text);
  font-weight: 700;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  font-size: 22px;
  border-radius: 10px;
  color: var(--soft);
}
.panel-menu {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--mint);
}
#infoBtn {
  font-family: Georgia;
  font-size: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.sidebar {
  position: absolute;
  left: 24px;
  top: 94px;
  bottom: 28px;
  width: 346px;
  border-radius: 18px;
  padding: 18px 18px 0;
  display: flex;
  flex-direction: column;
  z-index: 4;
}
.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 20px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--mint);
}
.main-tabs {
  display: flex;
  gap: 3px;
  margin: 14px 0 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  flex-shrink: 0;
}
.main-tabs button {
  flex: 1;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
}
.main-tabs button.active {
  background: var(--active);
  color: var(--active-text);
  font-weight: 700;
}
.panel-scroll {
  overflow: auto;
  padding: 0 4px 20px 0;
  margin-right: -4px;
  scrollbar-width: thin;
  scrollbar-color: #74829866 transparent;
}
.intro h1 {
  font-size: 25px;
  line-height: 1.55;
  letter-spacing: 0.03em;
  margin: 8px 0 12px;
  font-weight: 600;
}
.intro p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  margin: 0 0 19px;
}
.station-fields {
  position: relative;
}
.station-fields label {
  display: block;
}
.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin: 12px 0 6px;
  color: var(--soft);
}
.field-label i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
}
.field-label .endpoint-b {
  background: #ffb25b;
}
.station-fields input {
  height: 48px;
  width: 100%;
  padding: 0 42px 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--input);
  color: var(--text);
  font-size: 16px;
}
.station-fields input:focus {
  border-color: var(--mint);
}
input::placeholder {
  color: var(--muted);
  font-size: 14px;
}
.swap {
  position: absolute;
  right: 7px;
  top: 62px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 23px;
  z-index: 1;
}
.trip-shortcuts {
  display: flex;
  gap: 8px;
  margin: 5px 0;
}
.trip-shortcuts button {
  font-size: 12px;
  color: var(--mint);
  padding: 0 4px;
  text-align: left;
}
.date-row {
  display: flex;
  gap: 7px;
  align-items: flex-end;
  margin: 12px 0;
}
.date-row label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
  flex: 1.4;
}
.date-row label#timeField {
  flex: 1;
}
.date-row input {
  display: block;
  height: 44px;
  width: 100%;
  min-width: 0;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 6px;
  font-size: 13px;
  margin-top: 7px;
}
.date-row button {
  font-size: 12px;
  color: var(--mint);
  padding: 0 5px;
}
.query-modes {
  border: 0;
  padding: 0;
  margin: 15px 0 8px;
  display: flex;
  gap: 5px;
}
.query-modes legend {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.query-modes label {
  flex: 1;
  position: relative;
  cursor: pointer;
}
.query-modes input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.query-modes span {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
}
.query-modes input:checked + span {
  border-color: var(--mint);
  background: #a9efd213;
  color: var(--mint);
  font-weight: 700;
}
.query-modes input:focus-visible + span {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}
.subtle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  margin: 8px 0 12px;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 12px;
}
.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--mint);
}
.primary {
  width: 100%;
  background: var(--active);
  color: var(--active-text);
  border-radius: 9px;
  min-height: 50px;
  padding: 12px 15px;
  text-align: left;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.external-note {
  font-size: 11px;
  text-align: center;
  color: var(--muted);
  line-height: 1.7;
  margin: 9px 0;
}
.pair-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}
.pair-actions button {
  font-size: 12px;
  color: var(--mint);
  padding: 0 3px;
}
.saved-section h2 {
  font-size: 13px;
  font-weight: 600;
  margin: 20px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.saved-section h2 span {
  color: var(--muted);
  font-weight: 400;
  font-size: 10px;
}
.empty-pairs {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
.saved-pair {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.saved-pair button:first-child {
  flex: 1;
  font-size: 13px;
  text-align: left;
  line-height: 1.8;
  padding: 8px 2px;
  overflow-wrap: anywhere;
}
.saved-pair .remove-pair {
  width: 44px;
  font-size: 20px;
  color: var(--muted);
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 13px 0;
  font-size: 12px;
  color: var(--soft);
}
.text-button {
  font-size: 12px;
  color: var(--muted);
}
.operation-link {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  margin-top: 14px;
  color: var(--soft);
}
#journeyError {
  font-size: 12px;
  color: #ffc5ad;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
#journeyError a {
  display: block;
  padding: 8px 0;
  min-height: 44px;
}
.share-url {
  display: block;
  width: 100%;
  font-size: 12px;
  margin-top: 8px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 9px;
}
.network-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.network-panel h1 {
  font-size: 20px;
  font-weight: 500;
  margin: 3px 0 16px;
}
.searchbox {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--input);
  color: var(--muted);
  min-height: 48px;
  flex-shrink: 0;
}
.searchbox > span {
  font-size: 23px;
}
.searchbox input {
  min-width: 0;
  width: 100%;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 14px;
  height: 26px;
}
.filterbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
}
.filterbar select,
.view-controls select {
  background: var(--bg);
  color: var(--muted);
  border: 0;
  font-size: 12px;
  max-width: 210px;
  min-height: 44px;
  border-radius: 5px;
}
.filterbar select option,
.view-controls select option {
  background: var(--bg);
  color: var(--text);
}
#clearBtn {
  font-size: 12px;
  color: var(--muted);
  padding: 4px;
}
.list-caption {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  padding: 0 2px 10px;
  border-bottom: 1px solid var(--line);
}
#listCount {
  font-size: 11px;
}
.route-list {
  overflow: auto;
  flex: 1;
  min-height: 0;
  margin-right: -8px;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: #74829866 transparent;
}
.route-row {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 15px 5px;
  border-bottom: 1px solid var(--line);
  border-radius: 4px;
}
.route-row:hover,
.route-row.selected {
  background: var(--input);
}
.route-row.selected {
  box-shadow: inset 3px 0 var(--rc);
}
.route-icon {
  width: 34px;
  height: 34px;
  border: 2px solid var(--rc);
  color: var(--text);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.route-desc {
  min-width: 0;
  flex: 1;
}
.route-desc strong {
  font-size: 13px;
  font-weight: 500;
  display: block;
  line-height: 1.5;
}
.route-desc small {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-top: 5px;
}
.route-meta {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  flex-shrink: 0;
}
.route-meta b {
  color: var(--text);
  display: block;
  font-size: 18px;
  font-weight: 500;
}
.route-meta small {
  display: block;
  font-size: 10px;
  margin-top: 4px;
}
.sidebar-foot {
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding: 13px 0;
  line-height: 1.8;
}
.empty {
  color: var(--muted);
  padding: 22px 10px;
  line-height: 2;
  font-size: 13px;
}
.mobile-days {
  margin: 12px 0 0;
}
.mobile-days button {
  flex: 1;
}
.map-title {
  position: absolute;
  top: 116px;
  left: 410px;
  pointer-events: none;
}
.map-title .eyebrow {
  color: var(--muted);
  font-size: 10px;
}
.map-title > div {
  font-size: 25px;
  line-height: 1.7;
  letter-spacing: 0.03em;
  margin-top: 10px;
  font-weight: 500;
}
.map-title em {
  font-style: normal;
  color: var(--muted);
}
.view-controls {
  position: absolute;
  top: 104px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 11px;
}
.view-controls .seg {
  border: 0;
  background: none;
  padding: 0;
}
.view-controls .seg button {
  padding: 7px 12px;
  font-size: 12px;
}
.view-controls select {
  max-width: 170px;
  font-size: 11px;
  background: none;
}
.quality-btn {
  position: absolute;
  right: 24px;
  top: 173px;
  min-height: 44px;
  border-radius: 9px;
  font-size: 12px;
  color: var(--muted);
  padding: 0 13px;
}
.quality-btn.active {
  border-color: var(--mint);
  color: var(--mint);
}
.compass {
  position: absolute;
  right: 43px;
  top: 230px;
  width: 34px;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  pointer-events: none;
}
.compass svg {
  width: 34px;
  height: 34px;
}
.map-actions {
  position: absolute;
  bottom: 90px;
  right: 25px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.map-actions .icon-btn {
  width: 44px;
  height: 44px;
}
.map-legend {
  position: absolute;
  bottom: 52px;
  left: 410px;
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
}
.map-legend > span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.light-line {
  width: 17px;
  height: 2px;
  background: var(--mint);
}
.light-dot {
  width: 5px;
  height: 5px;
  background: var(--text);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--mint);
}
.legend-instruction {
  font-size: 10px;
}
.timeline {
  position: absolute;
  bottom: 26px;
  left: 24px;
  right: 24px;
  height: 125px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  padding: 16px 25px;
  gap: 24px;
  z-index: 6;
}
.time-block {
  width: 116px;
  flex-shrink: 0;
}
.time-block span {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-bottom: 2px;
}
.time-block strong {
  font-size: 42px;
  font-weight: 500;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.timeline-main {
  flex: 1;
  min-width: 0;
}
.timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--soft);
  margin-bottom: 4px;
}
.sample-badge {
  font-size: 11px;
  color: var(--mint);
}
#timeSlider {
  appearance: none;
  width: 100%;
  height: 5px;
  background: var(--line);
  border: 0;
  cursor: pointer;
  display: block;
  margin: 14px 0 12px;
  border-radius: 4px;
  outline-offset: 10px;
}
#timeSlider::-webkit-slider-thumb {
  appearance: none;
  border: 3px solid var(--mint);
  width: 20px;
  height: 20px;
  background: var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 0 10px #ffffff01;
}
#timeSlider::-moz-range-thumb {
  border: 3px solid var(--mint);
  width: 15px;
  height: 15px;
  background: var(--bg);
  border-radius: 50%;
}
.time-ticks {
  position: relative;
  height: 14px;
  font-size: 11px;
  color: var(--muted);
}
.time-ticks span {
  position: absolute;
  transform: translateX(-50%);
}
.time-ticks span:nth-child(1) {
  left: 0;
  transform: none;
}
.time-ticks span:nth-child(2) {
  left: 18.75%;
}
.time-ticks span:nth-child(3) {
  left: 37.5%;
}
.time-ticks span:nth-child(4) {
  left: 56.25%;
}
.time-ticks span:nth-child(5) {
  left: 75%;
}
.time-ticks span:nth-child(6) {
  right: 0;
  transform: none;
}
.timeline-bottom {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  margin-top: 8px;
  gap: 12px;
}
.play-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.play {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--active);
  color: var(--active-text);
  font-size: 16px;
}
#speedBtn {
  width: 44px;
  font-size: 13px;
  color: var(--muted);
}
.attribution {
  position: absolute;
  bottom: 9px;
  right: 27px;
  color: var(--muted);
  font-size: 10px;
}
.detail {
  position: absolute;
  right: 24px;
  top: 288px;
  bottom: 90px;
  width: 320px;
  max-height: 620px;
  overflow: auto;
  border-radius: 15px;
  z-index: 5;
  padding: 19px;
  scrollbar-width: thin;
}
.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.detail h2 {
  font-size: 21px;
  font-weight: 500;
  margin: 12px 0 5px;
}
.detail p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
  margin: 8px 0;
}
.detail .times {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-block: 1px solid var(--line);
  padding: 12px 0;
  margin: 12px 0;
}
.times span {
  font-size: 11px;
  color: var(--muted);
}
.times strong {
  display: block;
  font-size: 30px;
  color: var(--text);
  font-weight: 500;
  margin-top: 3px;
}
.detail a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  padding: 12px;
  margin-top: 12px;
  min-height: 44px;
}
.detail button.jump {
  background: var(--active);
  color: var(--active-text);
  padding: 12px;
  width: 100%;
  border-radius: 7px;
  font-size: 12px;
  margin-top: 9px;
}
.verified {
  font-size: 11px;
  color: var(--mint);
}
.train-status {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--mint);
  font-size: 11px;
  margin-top: 5px;
}
.detail .note {
  font-size: 11px;
  line-height: 1.9;
}
.detail select {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 44px;
  width: 100%;
  font-size: 12px;
  margin-top: 8px;
  padding: 6px;
}
.detail-station-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin: 15px 0;
}
.record-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}
.record-heading small {
  font-size: 10px;
  color: var(--muted);
}
.service-choice {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
}
.stop-details table {
  border-collapse: collapse;
  width: 100%;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.stop-details td,
.stop-details th {
  padding: 7px 3px;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
  text-align: left;
}
#toast {
  position: absolute;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--active);
  color: var(--active-text);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  z-index: 20;
  max-width: 90%;
  width: max-content;
  line-height: 1.7;
}
#toast.visible {
  opacity: 1;
}
dialog {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 20px;
  width: 570px;
  max-width: calc(100% - 30px);
  max-height: 88dvh;
  padding: 24px 30px;
  box-shadow: 0 50px 100px #0006;
  scrollbar-width: thin;
}
dialog::backdrop {
  background: #03070bcc;
  backdrop-filter: blur(7px);
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
dialog h2 {
  font-size: 23px;
  font-weight: 500;
  margin: 15px 0 20px;
}
dialog h3 {
  font-size: 14px;
  margin-top: 22px;
  color: var(--mint);
}
dialog p {
  font-size: 13px;
  line-height: 2;
  color: var(--soft);
}
.help-grid {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 14px;
  font-size: 13px;
}
.help-grid span {
  color: var(--muted);
}
.help-grid b {
  font-weight: 400;
}
.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.source-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 12px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
}
.official-link {
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 16px 5px;
  text-decoration: none;
  font-size: 14px;
}
.station-choice {
  border-top: 1px solid var(--line);
  padding: 6px 0 16px;
}
.station-choice h3 {
  margin: 12px 0 4px;
  color: var(--text);
}
.station-choice p {
  font-size: 12px;
  margin: 4px 0;
}
.station-actions {
  display: flex;
  gap: 9px;
}
.station-actions button {
  flex: 1;
  background: var(--active);
  color: var(--active-text);
  border-radius: 7px;
  padding: 10px;
  font-size: 13px;
}
.station-actions button:last-child {
  background: var(--input);
  border: 1px solid var(--line);
  color: var(--text);
}
.station-routes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 7px;
}
.station-routes button {
  font-size: 12px;
  color: var(--rc);
  padding: 6px;
  border-bottom: 1px solid var(--line);
}
.mobile-only {
  display: none;
}
#loading {
  position: absolute;
  inset: 80px 0 0 390px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 3;
  gap: 20px;
  transition: opacity 0.3s;
}
#loading strong {
  font-weight: 400;
  font-size: 14px;
}
#loading span {
  font-size: 12px;
  color: var(--muted);
}
#loading button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}
.loader-orbit {
  border: 1px solid var(--line);
  border-top-color: var(--mint);
  border-radius: 50%;
  width: 45px;
  height: 45px;
  animation: spin 1.5s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
body[data-pane="replay"] .sidebar {
  bottom: 174px;
}
body[data-pane="replay"] .map-legend {
  bottom: 170px;
}
body[data-pane="replay"] .map-actions {
  bottom: 225px;
}
body[data-pane="replay"] .detail {
  bottom: 178px;
}
body[data-pane="replay"] #toast {
  bottom: 160px;
}
@media (max-width: 1250px) {
  .header-meta {
    display: none;
  }
  .map-title > div {
    font-size: 21px;
  }
  .map-title {
    left: 400px;
    top: 174px;
  }
  .map-title .eyebrow {
    font-size: 9px;
  }
  .legend-instruction {
    display: none;
  }
  .detail {
    width: 290px;
  }
  .sample-badge {
    display: none;
  }
}
@media (max-width: 1000px) and (min-width: 761px) {
  .sidebar {
    width: 320px;
    left: 16px;
  }
  .topbar {
    left: 16px;
    right: 16px;
    gap: 10px;
  }
  .brand strong {
    font-size: 18px;
  }
  .top-controls {
    gap: 4px;
  }
  .top-controls .seg button {
    padding: 7px 9px;
  }
  #map,
  #labels {
    left: 320px;
  }
  .map-title {
    left: 360px;
    top: 174px;
  }
  .map-title > div {
    font-size: 18px;
  }
  .view-controls {
    right: 16px;
  }
  .view-controls select {
    max-width: 130px;
  }
  .map-legend {
    left: 360px;
    font-size: 10px;
  }
  .detail {
    width: 280px;
  }
  #loading {
    left: 340px;
  }
}
@media (max-height: 780px) and (min-width: 761px) {
  .sidebar {
    top: 84px;
  }
  .intro h1 {
    font-size: 22px;
  }
  .intro {
    padding-top: 0;
  }
  .map-title {
    top: 175px;
  }
  .view-controls {
    top: 88px;
  }
  .quality-btn {
    top: 154px;
  }
  .compass {
    top: 210px;
  }
  .detail {
    top: 270px;
  }
  .sidebar-heading {
    display: none;
  }
}
@media (max-width: 760px) {
  #map,
  #labels {
    left: 0;
  }
  .topbar {
    top: 12px;
    left: 14px;
    right: 14px;
    gap: 8px;
  }
  .brand {
    gap: 8px;
  }
  .brand-mark {
    width: 33px;
    height: 33px;
    font-size: 18px;
  }
  .brand strong {
    font-size: 16px;
  }
  .brand small {
    font-size: 8px;
    letter-spacing: 0.1em;
  }
  .top-controls {
    gap: 3px;
  }
  .top-controls .seg,
  .day-picker {
    display: none !important;
  }
  #infoBtn {
    width: 40px;
    height: 40px;
    min-height: 44px;
    border: 0;
  }
  .top-controls #themeBtn {
    width: 40px;
  }
  .sidebar {
    left: 12px;
    right: 12px;
    top: 78px;
    bottom: 78px;
    width: auto;
    max-width: 440px;
    margin: auto;
    transform: translateX(-130%);
    z-index: 10;
    padding: 12px 16px 0;
  }
  .sidebar.open {
    transform: none;
  }
  .sidebar-heading {
    min-height: 34px;
  }
  .sidebar-heading .eyebrow {
    font-size: 9px;
  }
  .main-tabs {
    margin: 7px 0 16px;
  }
  .panel-scroll {
    padding-bottom: 18px;
  }
  .intro h1 {
    font-size: 25px;
    line-height: 1.45;
    margin: 6px 0 8px;
  }
  .intro .eyebrow {
    display: none;
  }
  .intro p {
    font-size: 12px;
    margin-bottom: 16px;
  }
  .mobile-only {
    display: grid;
  }
  .map-title {
    left: 23px;
    top: 165px;
  }
  .map-title > div {
    font-size: 20px;
  }
  .map-title .eyebrow {
    font-size: 9px;
  }
  .view-controls {
    top: 80px;
    left: 16px;
    right: auto;
    padding: 3px 5px;
    gap: 4px;
  }
  .view-controls select {
    display: none;
  }
  .quality-btn {
    right: 16px;
    top: 81px;
    font-size: 11px;
    padding: 0 12px;
  }
  .compass {
    right: 23px;
    top: 145px;
  }
  .map-actions {
    right: 16px;
    bottom: 145px;
    gap: 7px;
  }
  .map-legend {
    left: 20px;
    bottom: 130px;
    font-size: 10px;
    gap: 10px;
  }
  .map-legend .legend-instruction {
    display: none;
  }
  #mobileListBtn {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 30px;
    border-radius: 10px;
    min-height: 48px;
    padding: 12px;
    font-size: 14px;
    z-index: 11;
    color: var(--mint);
    font-weight: 600;
    background: var(--panel);
  }
  .sidebar.open ~ #mobileListBtn {
    z-index: 11;
  }
  .attribution {
    font-size: 9px;
    bottom: 9px;
    right: 16px;
  }
  .timeline {
    left: 12px;
    right: 12px;
    bottom: 86px;
    height: 157px;
    padding: 13px 14px;
    gap: 12px;
    align-items: flex-start;
  }
  .time-block {
    width: 76px;
    padding-top: 9px;
  }
  .time-block strong {
    font-size: 32px;
  }
  .time-block span {
    font-size: 10px;
    white-space: nowrap;
  }
  .timeline-main {
    padding-top: 6px;
  }
  .timeline-top {
    font-size: 11px;
    min-height: 34px;
    line-height: 1.6;
    padding-right: 42px;
  }
  .timeline-bottom {
    margin-top: 8px;
    font-size: 10px;
    line-height: 1.7;
  }
  .time-ticks {
    font-size: 10px;
  }
  .time-ticks span:nth-child(even) {
    display: none;
  }
  .time-ticks span:nth-child(6) {
    display: inline;
  }
  .play-controls {
    position: absolute;
    right: 14px;
    top: 10px;
  }
  .play {
    width: 44px;
    height: 44px;
    font-size: 13px;
  }
  #speedBtn,
  #speedLabel {
    display: none;
  }
  .detail {
    left: 12px;
    right: 12px;
    top: 144px;
    bottom: 143px;
    width: auto;
    max-height: none;
    padding: 16px;
    z-index: 9;
  }
  .detail h2 {
    font-size: 20px;
  }
  .station-label {
    font-size: 11px;
    padding: 5px 8px;
    min-height: 44px;
  }
  .station-label small {
    font-size: 8px;
  }
  .geo-label {
    font-size: 11px;
  }
  #toast {
    bottom: 86px;
    font-size: 12px;
    width: max-content;
    max-width: 90vw;
    text-align: center;
  }
  .help-grid {
    grid-template-columns: 95px 1fr;
    gap: 10px;
    font-size: 12px;
  }
  dialog {
    padding: 18px 21px;
  }
  dialog h2 {
    font-size: 22px;
  }
  #loading {
    inset: 75px 0 85px;
  }
  body[data-pane="replay"] .sidebar {
    bottom: 78px;
  }
  body[data-pane="replay"] .map-legend {
    bottom: 253px;
  }
  body[data-pane="replay"] .map-actions {
    bottom: 290px;
  }
  body[data-pane="replay"] .detail {
    bottom: 254px;
  }
  body[data-pane="replay"] #toast {
    bottom: 250px;
  }
  .network-panel #replayScope {
    font-size: 11px;
  }
  .network-panel h1 {
    font-size: 19px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
  .loader-orbit {
    animation: none;
  }
}
.journey-submit {
  flex-shrink: 0;
  padding: 10px 0 4px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.journey-submit .primary {
  margin-top: 0;
}
.journey-submit .external-note {
  margin: 8px 0;
}
.panel-scroll {
  flex: 1;
  min-height: 0;
}
.intro h1 {
  font-size: 23px;
  line-height: 1.5;
}
.intro p {
  margin-bottom: 12px;
}
.intro .eyebrow {
  display: none;
}
@media (max-width: 760px) {
  .intro h1 {
    font-size: 22px;
    line-height: 1.4;
    margin-top: 3px;
  }
  .intro p {
    font-size: 11px;
    margin-bottom: 12px;
  }
  .sidebar-heading .eyebrow {
    font-size: 8px;
  }
  .station-fields .field-label {
    margin-top: 9px;
  }
  .date-row {
    margin-top: 7px;
  }
}
@media (max-width: 760px) {
  .mobile-area {
    position: absolute;
    left: 16px;
    top: 146px;
    display: flex;
    z-index: 2;
  }
  .mobile-area button {
    font-size: 12px;
    padding: 6px 12px;
  }
  .map-title {
    top: 215px;
  }
  .map-title > div {
    font-size: 18px;
  }
  .compass {
    top: 151px;
  }
}
.resolved-station {
  display: block;
  color: var(--mint);
  font-size: 10px;
  line-height: 1.7;
  margin-top: 3px;
  min-height: 0;
}
.resolved-station:empty {
  display: none;
}
.reference-hint { font-size: 11px; color: var(--muted); line-height: 1.8; margin: 15px 0 8px; }
.reference-hint span { color: var(--mint); font-weight: 700; margin-right: 5px; }
.journey-results { margin: 18px 0 12px; scroll-margin-top: 6px; }
.results-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.results-heading h2 { font-size: 17px; margin: 0; }
.results-heading button { min-height: 44px; padding: 6px 10px; }
.journey-options { display: grid; gap: 9px; }
.journey-option { display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--input); border-radius: 10px; padding: 13px; color: var(--text); }
.journey-option.chosen { border-color: var(--mint); box-shadow: inset 3px 0 var(--mint); background: color-mix(in srgb, var(--mint) 9%, var(--bg)); }
.option-top { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 6px; }
.option-top strong { font-size: 14px; }
.option-count { font-size: 12px; color: var(--mint); }
.option-lines { font-size: 12px; line-height: 1.8; }
.option-note { font-size: 10px; color: var(--muted); }
.itinerary-heading { font-size: 12px; margin: 21px 0 13px; color: var(--soft); }
.itinerary-step { padding: 8px 0 10px 14px; margin-left: 5px; }
.itinerary-step.ride { border-left: 3px solid var(--rc); }
.leg-route { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 7px; }
.leg-route::before { content: ''; width: 8px; height: 8px; background: var(--rc); border-radius: 50%; flex-shrink: 0; }
.leg-stations { font-size: 14px; margin: 7px 0; line-height: 1.8; }
.leg-points { font-size: 11px; color: var(--muted); line-height: 1.9; }
.leg-points summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; text-decoration: underline; text-underline-offset: 3px; }
.leg-points p { margin: 0 0 8px; overflow-wrap: anywhere; }
.itinerary-step.walk, .itinerary-step.transfer { border-left: 2px dashed var(--line); margin-top: 2px; margin-bottom: 2px; }
.itinerary-step.walk strong, .itinerary-step.transfer strong { font-size: 12px; color: var(--soft); }
.itinerary-step.walk p, .itinerary-step.transfer p { font-size: 11px; color: var(--muted); line-height: 1.8; margin: 4px 0; }
.view-journey { width: 100%; min-height: 46px; border: 1px solid var(--mint); border-radius: 8px; color: var(--mint); margin: 12px 0 5px; padding: 10px 13px; display: flex; justify-content: space-between; font-size: 13px; }
.route-disclaimer { font-size: 10px; color: var(--muted); line-height: 1.9; margin: 9px 0 16px; }
.external-search { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 3px 0 10px; margin-top: 16px; }
.external-search summary { cursor: pointer; font-size: 12px; min-height: 44px; padding-top: 13px; }
.external-search p { color: var(--muted); font-size: 11px; line-height: 1.8; }
.external-search a { color: var(--mint); font-size: 12px; display: inline-flex; align-items: center; min-height: 44px; }
.edition-label { display: inline-block; color: var(--mint); font-size: 10px; letter-spacing: .05em; border: 1px solid var(--line); border-radius: 20px; padding: 5px 9px; margin-bottom: 12px; }
.external-search h2 { font-size: 13px; margin: 15px 0 8px; }
.external-search .external-primary { display: flex; justify-content: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; font-weight: 600; }
.external-stations { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 9px; }
.external-stations button { min-height: 38px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--muted); padding: 7px; font-size: 10px; overflow-wrap: anywhere; cursor: pointer; }
.external-stations button:disabled { opacity: .4; cursor: default; }
.journey-map-card { position: absolute; z-index: 4; bottom: 65px; left: calc(50% + 190px); transform: translateX(-50%); width: min(430px, calc(100% - 460px)); border-radius: 13px; padding: 15px 18px 10px; display: flex; flex-direction: column; gap: 8px; }
.journey-map-card .eyebrow { font-size: 9px; color: var(--mint); letter-spacing: .04em; }
.journey-map-card strong { font-size: 17px; line-height: 1.6; }
#journeyMapMeta { font-size: 11px; color: var(--muted); }
#journeyMapConnections { font-size: 11px; color: var(--soft); line-height: 1.7; }
.journey-map-card > div { display: flex; gap: 16px; }
.journey-map-card button { min-height: 44px; font-size: 12px; color: var(--mint); padding: 0 5px; }
.has-journey .map-title { display: none; }
.station-label.journey-station { border-color: var(--mint); color: var(--text); background: var(--panel); }
@media (max-width: 760px) {
  .journey-map-card { left: 12px; right: 12px; width: auto; transform: none; bottom: 79px; padding: 11px 14px 4px; gap: 5px; }
  .journey-map-card strong { font-size: 15px; }
  .journey-map-card .eyebrow { font-size: 9px; }
  .journey-results { margin-top: 12px; }
  .reference-hint { font-size: 11px; }
  .has-journey .map-actions { bottom: 275px; }
}
@media (max-width: 760px) {
  .intro h1 {
    font-size: 16px;
    line-height: 1.7;
    margin: 2px 0 14px;
    font-weight: 600;
    letter-spacing: 0;
  }
  .intro h1 br {
    display: none;
  }
  .intro p {
    display: none;
  }
}

/* Keep navigation usable in narrow browser panels and zoomed/short windows. */
@media (max-height: 640px) {
  .network-panel {
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .network-panel .route-list {
    overflow: visible;
    margin-right: 0;
    padding-right: 0;
  }
}
@media (max-width: 760px) and (max-height: 540px) {
  .sidebar {
    top: 68px;
    padding-top: 8px;
  }
  .sidebar-heading {
    display: none;
  }
  .main-tabs {
    margin: 0 0 8px;
  }
  .journey-submit {
    padding-top: 6px;
  }
  .journey-submit .external-note {
    display: none;
  }
}
@media (max-width: 380px) {
  .brand-mark {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }
  .brand strong {
    font-size: 13px;
    white-space: nowrap;
  }
  .brand small {
    font-size: 7px;
  }
  .top-controls .icon-btn {
    width: 36px;
  }
  .top-controls {
    gap: 1px;
  }
}

/* Timed journey handoff; available only after the provider connection is ready. */
.timetable-fields { display:grid; grid-template-columns:1.4fr 1fr; gap:9px; }
.timetable-fields label, .timetable-mode-row label { display:flex; flex-direction:column; gap:6px; min-width:0; color:var(--muted); font-size:11px; }
.timetable-fields input, .timetable-mode-row select { width:100%; min-width:0; box-sizing:border-box; min-height:42px; padding:8px; border:1px solid var(--line); border-radius:8px; background:var(--panel); color:var(--text); font:inherit; color-scheme:dark; }
body.light .timetable-fields input, body.light .timetable-mode-row select { color-scheme:light; }
.timetable-mode-row { display:flex; align-items:flex-end; gap:9px; margin-top:10px; }
.timetable-mode-row label { flex:1; }
#travelNow { min-height:42px; padding:0 12px; border:1px solid var(--line); border-radius:8px; background:transparent; color:var(--mint); cursor:pointer; }
.external-search .timetable-pair { color:var(--text); font-size:12px; font-weight:600; margin:10px 0; }
.paid-trains { display:flex; align-items:center; gap:8px; min-height:44px; font-size:11px; color:var(--muted); }
.paid-trains input { accent-color:var(--mint); }
.external-search .timed-submit { width:100%; min-height:45px; align-items:center; background:var(--mint); color:#08251e; cursor:pointer; font-size:12px; border:0; }
.external-search .timed-note { font-size:10px; }
#timetableError { color:#ffad9f; font-size:12px; }
