:root{font-family:Inter,Segoe UI,Arial,sans-serif;color:#e9eef5;background:#0b1119;font-synthesis:none}
*{box-sizing:border-box}body{margin:0;height:100vh;overflow:hidden;background:#0b1119}.topbar{height:68px;display:flex;align-items:center;justify-content:space-between;padding:0 24px;background:#101923;border-bottom:1px solid #202d3b;position:relative;z-index:500}.brand{display:flex;align-items:center;gap:12px}.brand-icon{height:37px;width:37px;border-radius:11px;background:#d8f36a;color:#17210a;display:grid;place-items:center;font-weight:900;font-size:14px;letter-spacing:-1px}.brand-name{font-size:17px;font-weight:800;letter-spacing:-.5px}.brand-name span{color:#d8f36a}.brand-sub{font-size:9px;color:#8090a2;letter-spacing:1.7px;margin-top:3px}.top-status{display:flex;align-items:center;gap:9px;font-size:12px;color:#a9b6c5}.status-dot,.feed-indicator{height:8px;width:8px;border-radius:50%;background:#e7b65a;display:inline-block}.status-dot.live,.feed-indicator.live{background:#a9df57;box-shadow:0 0 10px #a9df5770}.status-dot.error,.feed-indicator.error{background:#f07878}.workspace{height:calc(100vh - 68px);display:grid;grid-template-columns:320px 1fr}.sidebar{background:#101923;border-right:1px solid #202d3b;padding:25px 20px 16px;display:flex;flex-direction:column;min-height:0;z-index:400}.eyebrow,.section-heading,.stat-label{font-size:10px;letter-spacing:1.6px;color:#8292a4;font-weight:700}.intro h1{font-size:25px;letter-spacing:-.8px;margin:9px 0 6px}.intro p{font-size:12px;color:#8292a4;margin:0 0 22px}.stat-card,.feed-card{background:#151f2b;border:1px solid #243242;border-radius:12px;padding:16px;margin-bottom:13px}.stat-number{font-size:38px;font-weight:750;letter-spacing:-1.5px;margin:7px 0 0}.stat-foot{font-size:11px;color:#8292a4;margin-top:2px}.section-heading{margin-bottom:13px}.feed-row{display:flex;align-items:center;gap:9px;font-size:12px}.feed-row strong{font-size:12px}.feed-card p{font-size:11px;line-height:1.55;color:#9aa8b7;margin:10px 0}.updated{font-size:10px;color:#738397}.vehicle-section{min-height:0;display:flex;flex-direction:column;flex:1;margin-top:10px}.vehicle-list{overflow:auto;display:flex;flex-direction:column;gap:7px;padding-right:3px}.vehicle-item{border:1px solid #253344;background:#141e29;border-radius:9px;padding:11px 12px;cursor:pointer;transition:.15s}.vehicle-item:hover,.vehicle-item.active{border-color:#b5d95c;background:#1b2930}.vehicle-title{font-size:12px;font-weight:700}.vehicle-meta{font-size:10px;color:#8797a8;margin-top:5px}.empty-list{font-size:11px;color:#8190a0;padding:10px 2px}.sidebar-footer{display:flex;justify-content:space-between;font-size:9px;color:#657587;padding-top:12px;border-top:1px solid #202d3b;margin-top:12px}.map-wrap{position:relative;min-width:0;min-height:0}#map{height:100%;width:100%;background:#dce3e8}.map-controls{position:absolute;right:18px;top:18px;z-index:450;display:flex;flex-direction:column;gap:7px}.map-controls button{width:40px;height:40px;border:1px solid #344453;border-radius:10px;background:#111b26;color:#eaf1f7;font-size:22px;cursor:pointer;box-shadow:0 4px 15px #0003}.map-controls button:hover{background:#243544}.map-legend{position:absolute;bottom:22px;left:18px;z-index:450;background:#111b26eF;border:1px solid #344453;border-radius:8px;padding:10px 12px;font-size:10px;color:#d4dde6;display:flex;align-items:center;gap:8px}.legend-dot{height:9px;width:9px;border-radius:50%;background:#d8f36a;border:2px solid #1c2a1d}.legend-demo{color:#91a0af;margin-left:8px;border-left:1px solid #465462;padding-left:10px}.train-marker{width:28px;height:28px;border-radius:50%;background:#d8f36a;border:3px solid #1b2b1c;display:grid;place-items:center;color:#17210a;font-size:13px;font-weight:900;box-shadow:0 2px 8px #0005}.train-marker.demo{background:#f2c66d}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#111b26;color:#eaf1f7}.leaflet-popup-content{margin:12px 14px;font-size:12px;line-height:1.55}.popup-title{font-weight:800;font-size:13px;margin-bottom:4px}.popup-muted{color:#a0adba}.toast{position:absolute;left:50%;top:18px;transform:translateX(-50%);z-index:500;background:#111b26;color:#eaf1f7;padding:9px 14px;border:1px solid #344453;border-radius:8px;font-size:11px;opacity:0;pointer-events:none;transition:opacity .2s}.toast.show{opacity:1}
@media(max-width:760px){body{height:100dvh}.topbar{height:58px;padding:0 14px}.workspace{height:calc(100dvh - 58px);grid-template-columns:1fr;grid-template-rows:230px 1fr}.sidebar{padding:14px;display:grid;grid-template-columns:1fr 1fr;gap:9px;overflow:auto;border-right:0;border-bottom:1px solid #202d3b}.intro{grid-column:1/-1}.intro h1{font-size:20px;margin:5px 0}.intro p{margin:0}.stat-card,.feed-card{margin:0;padding:11px}.stat-number{font-size:26px}.vehicle-section{display:none}.sidebar-footer{display:none}.map-wrap{min-height:0}.map-controls{top:12px;right:12px}.map-legend{bottom:12px;left:12px}.legend-demo{display:none}}

.train-marker {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 125px;
  height: 42px;
  background: #182b40;
  border: 2px solid #42a5f5;
  border-radius: 8px;
  color: white;
  box-shadow: 0 2px 8px #0008;
  overflow: hidden;
}


.train-marker-route {
  font-size: 10px;
  font-weight: 800;
  line-height: 15px;
  white-space: nowrap;
}

.train-marker-destination {
  font-size: 10px;
  line-height: 13px;
  font-weight: 700;
  color: #8fd3ff;
  white-space: nowrap;
}


.train-marker.demo {
  border-color: #f0ad4e;
}

.class-filter {
  width: 100%;
  padding: 11px;
  margin: 10px 0;
  border: 1px solid #34465c;
  border-radius: 8px;
  background: #182638;
  color: white;
  font-size: 13px;
  outline: none;
}

.class-filter:focus {
  border-color: #42a5f5;
}

.train-filter {
  position: relative;
  margin-bottom: 10px;
}

.filter-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.train-filter-menu {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 420px;
  overflow-y: auto;
  z-index: 1000;
  background: #17243a;
  border: 1px solid #34445e;
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 8px 24px #0008;
}

.train-filter-menu.open {
  display: block;
}

.filter-heading {
  padding: 12px 9px 5px;
  color: #9aabc2;
  font-size: 11px;
  font-style: italic;
}

.filter-option-label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 9px;
  border-radius: 5px;
  color: white;
  font-size: 12px;
  cursor: pointer;
}

.filter-option-label:hover {
  background: #24354c;
}

.filter-option-label input {
  cursor: pointer;
}

.filter-option-label.sub-item {
  padding-left: 24px;
}

.filter-count {
  margin-left: auto;
  color: #8090a2;
  font-size: 11px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  padding: 4px 6px 8px;
  border-bottom: 1px solid #2a3b53;
  margin-bottom: 4px;
}

.filter-action-btn {
  flex: 1;
  padding: 5px;
  background: #21324a;
  border: 1px solid #364b68;
  border-radius: 5px;
  color: #c5d3e4;
  font-size: 11px;
  cursor: pointer;
}

.filter-action-btn:hover {
  background: #293f5e;
  color: #fff;
}

/* ---------- Station search + panel ---------- */

.toast { top: 70px; }

.station-search {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 290px;
  z-index: 460;
}

.station-search input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid #344453;
  border-radius: 10px;
  background: #111b26;
  color: #eaf1f7;
  font-size: 13px;
  outline: none;
  box-shadow: 0 4px 15px #0003;
}

.station-search input:focus { border-color: #42a5f5; }
.station-search input:disabled { opacity: .6; }

.station-results {
  display: none;
  margin-top: 6px;
  background: #111b26;
  border: 1px solid #344453;
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 8px 24px #0008;
  max-height: 320px;
  overflow-y: auto;
}

.station-results.open { display: block; }

.st-result {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #eaf1f7;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.st-result:hover, .st-result:focus { background: #243544; outline: none; }
.st-result small { color: #8292a4; font-size: 10px; white-space: nowrap; }
.st-result-empty { padding: 10px; font-size: 12px; color: #8292a4; }

.station-panel {
  position: absolute;
  top: 18px;
  right: 70px;
  bottom: 30px;
  width: 370px;
  max-width: calc(100% - 100px);
  z-index: 455;
  display: flex;
  flex-direction: column;
  background: #101923;
  border: 1px solid #2b3b4d;
  border-radius: 14px;
  box-shadow: 0 10px 34px #000a;
  overflow: hidden;
}

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

.st-head { padding: 16px 16px 0; border-bottom: 1px solid #202d3b; }
.st-head-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.st-eyebrow { font-size: 10px; letter-spacing: 1.6px; color: #8292a4; font-weight: 700; }
.st-name { margin: 4px 0 0; font-size: 22px; letter-spacing: -.5px; line-height: 1.15; }

.st-close {
  width: 30px;
  height: 30px;
  flex: none;
  border: 1px solid #344453;
  border-radius: 8px;
  background: #151f2b;
  color: #cbd6e1;
  cursor: pointer;
}
.st-close:hover { background: #243544; }

.st-lines { display: flex; flex-wrap: wrap; gap: 5px; margin: 11px 0 12px; min-height: 22px; }

.line-chip {
  display: inline-block;
  min-width: 30px;
  padding: 2px 7px;
  border-radius: 5px;
  background: #34465c;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.st-tabs { display: flex; gap: 2px; }

.st-tab {
  flex: 1;
  padding: 10px 6px 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #8292a4;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.st-tab:hover { color: #d4dde6; }
.st-tab.active { color: #d8f36a; border-bottom-color: #d8f36a; }

.st-badge {
  display: inline-block;
  min-width: 17px;
  padding: 0 5px;
  margin-left: 3px;
  border-radius: 9px;
  background: #e7b65a;
  color: #1c1405;
  font-size: 10px;
  line-height: 17px;
}
.st-badge[hidden] { display: none; }

.st-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px; }
.st-foot { padding: 8px 14px; border-top: 1px solid #202d3b; font-size: 10px; color: #657587; min-height: 31px; }
.st-foot.error { color: #e7b65a; }

.st-empty { padding: 22px 6px; font-size: 12px; color: #8797a8; text-align: center; line-height: 1.5; }
.st-empty.error { color: #f0a0a0; }
.st-empty.small { padding: 4px 0; text-align: left; }

.st-train {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  margin-bottom: 7px;
  background: #141e29;
  border: 1px solid #253344;
  border-radius: 10px;
}
.st-train.cancelled { opacity: .6; }
.st-train.cancelled .st-dest { text-decoration: line-through; }

.st-train-time { flex: none; width: 58px; text-align: center; }
.st-train-time strong { display: block; font-size: 16px; letter-spacing: -.3px; }
.st-train-time span { font-size: 10px; color: #8797a8; }

.st-train-main { flex: 1; min-width: 0; }
.st-train-top { display: flex; align-items: center; gap: 7px; }
.st-dest { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-train-meta { font-size: 10px; color: #8797a8; margin-top: 5px; }
.st-train-status { margin-top: 5px; display: flex; gap: 8px; align-items: center; }
.st-sched { font-size: 10px; color: #657587; }

.st-delay { font-size: 10px; font-weight: 800; }
.st-delay.ontime { color: #a9df57; }
.st-delay.early { color: #6fc3ff; }
.st-delay.late { color: #e7b65a; }
.st-delay.verylate { color: #f07878; }
.st-delay.unknown { color: #8797a8; font-weight: 600; }

.st-track {
  flex: none;
  padding: 6px 9px;
  border: 1px solid #3a4d61;
  border-radius: 7px;
  background: #1b2930;
  color: #d8f36a;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.st-track:hover { border-color: #b5d95c; }

.st-train-wrap { margin-bottom: 7px; }
.st-train-wrap .st-train { margin-bottom: 0; }
.st-train-wrap.open .st-train {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}

.st-train.st-passing {
  cursor: pointer;
  border-style: dashed;
  background: #131b24;
}
.st-train.st-passing:hover { border-color: #4a6076; }

.st-passing-tag {
  margin-left: auto;
  flex: none;
  padding: 2px 7px;
  border: 1px solid rgba(160, 122, 255, .45);
  border-radius: 999px;
  background: rgba(160, 122, 255, .14);
  color: #c9a3ff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.st-service { font-size: 10px; font-weight: 700; color: #9bb7d4; }

.st-expand {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #3a4d61;
  border-radius: 7px;
  background: #1b2930;
  color: #9bb7d4;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s ease;
}
.st-train-wrap.open .st-expand { transform: rotate(180deg); }

.st-train-detail {
  padding: 10px 12px 12px;
  background: #10171f;
  border: 1px solid #253344;
  border-top: 0;
  border-radius: 0 0 10px 10px;
}
.st-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  font-size: 11px;
}
.st-detail-row > span:first-child { color: #8797a8; }
.st-detail-row > span:last-child { text-align: right; color: #d6e2ee; }

.st-detail-title {
  margin: 10px 0 6px;
  color: #657587;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.st-calling {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
}
.st-calling li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #1b2733;
  font-size: 11px;
}
.st-calling li:last-child { border-bottom: 0; }
.st-calling li.current { color: #d8f36a; font-weight: 700; }
.st-calling li.current .cp-name::after {
  content: ' · here';
  color: #a9df57;
  font-weight: 600;
}
.cp-time { flex: none; width: 40px; color: #8797a8; font-variant-numeric: tabular-nums; }
.st-calling li.current .cp-time { color: #d8f36a; }
.cp-name { flex: 1; min-width: 0; }
.cp-plat { flex: none; color: #657587; font-size: 9px; }
.st-track-wide { width: 100%; margin-top: 10px; }

.st-alert {
  padding: 12px;
  margin-bottom: 9px;
  background: #1c1a14;
  border: 1px solid #4a3d1d;
  border-left: 3px solid #e7b65a;
  border-radius: 9px;
}
.st-alert.upcoming { background: #141e29; border-color: #253344; border-left-color: #42a5f5; }
.st-alert h3 { margin: 8px 0 3px; font-size: 13px; line-height: 1.35; }
.st-alert p { margin: 7px 0 8px; font-size: 12px; line-height: 1.5; color: #c3cfdb; white-space: pre-line; }
.st-alert a { font-size: 11px; color: #6fc3ff; text-decoration: none; }
.st-alert a:hover { text-decoration: underline; }
.st-alert-tags { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.st-alert-meta { font-size: 10px; color: #8797a8; }
.st-when { font-size: 10px; color: #8797a8; text-align: right; }

.st-scope {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: #34465c;
  color: #d4dde6;
}
.st-scope.station { background: #e7b65a; color: #1c1405; }
.st-scope.mentioned { background: #5b4a22; color: #f3d99a; }

.st-section { margin-bottom: 18px; }
.st-section-title { font-size: 10px; letter-spacing: 1.6px; color: #8292a4; font-weight: 700; margin-bottom: 9px; }
.st-platform, .st-kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #1d2a38; font-size: 12px; }
.st-kv span:first-child { color: #8797a8; }
.st-line-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 12px; }
.st-access { font-size: 11px; font-weight: 700; }
.st-access.big { font-size: 13px; }
.st-access.ok { color: #a9df57; }
.st-access.no { color: #e7b65a; }
.st-access.unknown { color: #8797a8; font-weight: 600; }

@media (max-width: 760px) {
  .station-search { left: 12px; top: 12px; width: calc(100% - 76px); }
  .station-panel {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 26px;
    width: auto;
    max-width: none;
    max-height: 68%;
  }
  .st-name { font-size: 19px; }
}
