html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
}

#map {
  width: 100%;
  height: 100%;
  background: #e9eef3;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  border-radius: 10px;
}

.popup-title {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 14px;
}

.muted {
  color: #666;
}

.leaflet-div-icon {
  background: transparent;
  border: none;
}

.bus-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 220ms ease;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}

.bus-icon.is-entering {
  opacity: 0;
}

.bus-icon.is-visible {
  opacity: 1;
}

.fab {
  position: absolute;
  z-index: 1200;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.96);
  color: #111;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(6px);
}

.fab:hover {
  background: #fff;
}

.fab svg {
  width: 22px;
  height: 22px;
}

.fab-menu {
  left: 12px;
  bottom: 12px;
}

.fab-theme {
  right: 12px;
  bottom: 12px;
}

.flyout {
  position: absolute;
  left: 12px;
  bottom: 72px;
  z-index: 1190;
  width: min(380px, calc(100vw - 24px));
  max-height: min(75vh, 640px);
  overflow: auto;
  background: rgba(255,255,255,0.97);
  color: #111;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.22);
  transform: translateX(-110%);
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.flyout.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.flyout-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 10px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(8px);
  border-top-left-radius: 14px;
  border-top-right-radius: 14px; 
}

.flyout-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.flyout-sub {
  font-size: 14px;
  color: #444;
}

.flyout-close {
  border: 0;
  background: #f1f3f5;
  color: #111;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
}

.flyout-close:hover {
  background: #e9ecef;
}

.flyout-body {
  padding: 12px 14px 14px 14px;
}

.legend {
  margin-top: 4px;
}

.legend-heading {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 13px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
}

.legend-line {
  width: 22px;
  height: 0;
  border-top-width: 4px;
  border-top-style: solid;
  border-radius: 4px;
  flex: 0 0 auto;
}

.legend-bus {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
  background: #666;
}

.mini-note {
  margin-top: 10px;
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

.legend-line-group {
  margin-bottom: 12px;
}

.legend-line-title {
  font-weight: 700;
  margin-top: 10px;
  font-size: 13px;
}

.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
}

.filter-chip input {
  margin: 0;
}

.filter-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.filter-chip.is-off {
  opacity: 0.45;
}

@media (max-width: 640px) {
  .flyout {
    width: calc(100vw - 24px);
    max-height: 70vh;
  }
}
