/* ====================================================
   MapChrome — modern transit overlay (markers, lines, popups)
   ==================================================== */

.mc-icon {
  background: transparent !important;
  border: none !important;
}

/* ---------- Route stop disc (mid) ---------- */
.mc-stop-disc {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 3px rgba(15, 23, 42, 0.28));
}

.mc-stop-disc-core {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--mc-accent, #2563eb);
  box-sizing: border-box;
}

:root[data-theme="dark"] .mc-stop-disc-core {
  background: #0f172a;
}

/* ---------- Glass droplet / hemisphere stops (ara duraklar) ---------- */
.mc-stop-drop {
  --mc-drop-fill: color-mix(in srgb, var(--mc-accent, #2563eb) 42%, transparent);
  --mc-drop-edge: color-mix(in srgb, var(--mc-accent, #2563eb) 72%, #ffffff 14%);
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  filter: drop-shadow(0 3px 7px rgba(15, 23, 42, 0.34));
  opacity: 0.9;
}

.mc-stop-drop-body {
  position: relative;
  z-index: 2;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.4) 28%, transparent 55%),
    radial-gradient(circle at 50% 70%, var(--mc-drop-fill) 0%, color-mix(in srgb, var(--mc-accent, #2563eb) 58%, transparent) 72%, color-mix(in srgb, var(--mc-accent, #2563eb) 32%, transparent) 100%);
  border: 2px solid var(--mc-drop-edge);
  box-shadow:
    inset 0 -4px 8px color-mix(in srgb, var(--mc-accent, #2563eb) 26%, transparent),
    inset 0 2px 4px rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-stop-drop-shine {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 7px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  filter: blur(0.4px);
  pointer-events: none;
}

.mc-stop-drop-tip {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 10px;
  margin-top: -6px;
  border-radius: 0 0 55% 55%;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--mc-accent, #2563eb) 48%, transparent) 0%,
    color-mix(in srgb, var(--mc-accent, #2563eb) 62%, transparent) 100%
  );
  border: 1.5px solid color-mix(in srgb, var(--mc-accent, #2563eb) 55%, transparent);
  border-top: none;
  transform: perspective(12px) rotateX(18deg);
  opacity: 0.95;
}

.mc-stop-drop-label {
  position: relative;
  z-index: 3;
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.45);
  line-height: 1;
  pointer-events: none;
}

.mc-stop-drop.is-mid {
  opacity: 0.88;
}

.mc-stop-drop.is-mid .mc-stop-drop-body {
  width: 18px;
  height: 18px;
}

.mc-stop-drop.is-board,
.mc-stop-drop.is-alight {
  opacity: 0.95;
}

.mc-stop-drop.is-board .mc-stop-drop-body,
.mc-stop-drop.is-alight .mc-stop-drop-body {
  width: 22px;
  height: 22px;
}

.mc-stop-drop.is-board .mc-stop-drop-tip,
.mc-stop-drop.is-alight .mc-stop-drop-tip {
  width: 12px;
  height: 11px;
  margin-top: -7px;
}

.mc-stop-drop.is-board {
  --mc-accent: #2563eb;
}

.mc-stop-drop.is-alight {
  --mc-accent: #dc2626;
}

.mc-stop-drop-pulse {
  bottom: 2px;
  width: 34px;
  height: 34px;
  margin-left: -17px;
}

.mc-stop-drop.is-active {
  opacity: 1;
}

.mc-stop-drop.is-active .mc-stop-drop-body {
  box-shadow:
    inset 0 -3px 6px color-mix(in srgb, var(--mc-accent, #2563eb) 28%, transparent),
    inset 0 2px 3px rgba(255, 255, 255, 0.5),
    0 0 0 3px #fff,
    0 0 0 5px color-mix(in srgb, var(--mc-accent, #2563eb) 70%, transparent);
}

:root[data-theme="dark"] .mc-stop-drop {
  --mc-drop-fill: color-mix(in srgb, var(--mc-accent, #2563eb) 52%, rgba(15, 23, 42, 0.45));
  --mc-drop-edge: color-mix(in srgb, var(--mc-accent, #2563eb) 78%, #e2e8f0 12%);
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
  opacity: 0.94;
}

:root[data-theme="dark"] .mc-stop-drop-body {
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.14) 30%, transparent 55%),
    radial-gradient(circle at 50% 70%, var(--mc-drop-fill) 0%, color-mix(in srgb, var(--mc-accent, #2563eb) 62%, #0f172a) 100%);
}

:root[data-theme="dark"] .mc-stop-drop.is-mid {
  opacity: 0.9;
}

/* ---------- Baş / Son / Sen — solid yuvarlak rozet ---------- */
.mc-stop-cap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.38));
}

.mc-stop-cap-ring {
  position: relative;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: linear-gradient(155deg, color-mix(in srgb, var(--mc-accent, #64748b) 82%, #fff) 0%, var(--mc-accent, #64748b) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 0 0 1px color-mix(in srgb, var(--mc-accent, #64748b) 35%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.mc-stop-cap-label {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
  line-height: 1;
}

.mc-stop-cap.is-first {
  --mc-accent: #16a34a;
}

.mc-stop-cap.is-last {
  --mc-accent: #dc2626;
}

.mc-stop-cap.is-target {
  --mc-accent: #7c3aed;
}

.mc-stop-cap.is-journey-board {
  --mc-accent: #16a34a;
}

.mc-stop-cap.is-journey-alight {
  --mc-accent: #dc2626;
}

.mc-stop-cap.is-transfer {
  --mc-accent: #d97706;
}

.mc-stop-cap.is-journey-board .mc-stop-cap-ring,
.mc-stop-cap.is-journey-alight .mc-stop-cap-ring {
  width: 36px;
  height: 36px;
}

.mc-stop-cap.is-transfer .mc-stop-cap-ring--transfer {
  width: 38px;
  height: 38px;
  border: 3px solid #fff;
  background: linear-gradient(
    90deg,
    var(--mc-from, #2563eb) 0 50%,
    var(--mc-to, #9333ea) 50% 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 0 0 3px color-mix(in srgb, #d97706 30%, transparent);
}

.mc-stop-cap.is-transfer .mc-stop-cap-label {
  font-size: 0.875rem;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(15, 23, 42, 0.55);
}

.mc-stop-cap.is-target .mc-stop-cap-ring {
  width: 40px;
  height: 40px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 0 4px color-mix(in srgb, #7c3aed 28%, transparent);
}

.mc-stop-cap.is-target .mc-stop-cap-label {
  font-size: 0.75rem;
}

.mc-stop-cap-pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--mc-accent, #7c3aed) 70%, transparent);
  animation: mc-pulse 2.4s ease-out infinite;
  pointer-events: none;
  z-index: 0;
}

.mc-stop-cap.is-active .mc-stop-cap-ring {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 0 3px #fff,
    0 0 0 5px color-mix(in srgb, var(--mc-accent, #2563eb) 70%, transparent);
}

:root[data-theme="dark"] .mc-stop-cap-ring {
  border-color: rgba(255, 255, 255, 0.92);
}

.mc-legend-cap {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-sizing: border-box;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

.mc-legend-cap.is-board {
  background: linear-gradient(155deg, #4ade80, #16a34a);
}

.mc-legend-cap.is-alight {
  background: linear-gradient(155deg, #f87171, #dc2626);
}

.mc-legend-cap.is-transfer {
  background: linear-gradient(90deg, #2563eb 0 50%, #9333ea 50% 100%);
  box-shadow: 0 0 0 2px color-mix(in srgb, #d97706 40%, transparent), 0 1px 2px rgba(15, 23, 42, 0.2);
}

/* ---------- Route stop pin (legacy fallback) ---------- */
.mc-stop-pin {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 3px 8px rgba(15, 23, 42, 0.32));
}

.mc-stop-pin-head {
  position: relative;
  z-index: 2;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  border: 2.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
  background: var(--mc-accent, #64748b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.mc-stop-pin-stem {
  width: 3px;
  height: 8px;
  margin-top: -1px;
  background: var(--mc-accent, #64748b);
  border-radius: 0 0 1px 1px;
}

.mc-stop-pin-point {
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--mc-accent, #64748b);
  border: 2px solid #fff;
  box-sizing: border-box;
}

.mc-stop-pin.is-first {
  --mc-accent: #16a34a;
}

.mc-stop-pin.is-last {
  --mc-accent: #dc2626;
}

.mc-stop-pin.is-target {
  --mc-accent: #7c3aed;
}

.mc-stop-pin.is-target .mc-stop-pin-head {
  min-width: 36px;
  height: 32px;
  font-size: 0.6875rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 0 3px color-mix(in srgb, #7c3aed 28%, transparent);
}

.mc-pulse {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--mc-accent, #7c3aed) 70%, transparent);
  animation: mc-pulse 2.4s ease-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes mc-pulse {
  0% {
    transform: scale(0.45);
    opacity: 0.65;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

/* ---------- Nearby stop ---------- */
.mc-nearby {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-nearby-disc {
  position: relative;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow:
    0 2px 8px rgba(15, 23, 42, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  background: linear-gradient(160deg, #fb923c 0%, #ea580c 100%);
}

.mc-nearby-disc svg {
  width: 16px;
  height: 16px;
  display: block;
}

.mc-nearby.is-nearest .mc-nearby-disc {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

.mc-nearby.is-nearest .mc-nearby-disc svg {
  width: 20px;
  height: 20px;
}

.mc-nearby-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 55%, transparent);
  animation: mc-pulse 2.6s ease-out infinite;
  pointer-events: none;
  color: #ea580c;
}

.mc-nearby.is-bus .mc-nearby-disc {
  background: linear-gradient(160deg, #fb923c 0%, #ea580c 100%);
}
.mc-nearby.is-bus .mc-nearby-ring { color: #ea580c; }

.mc-nearby.is-tram .mc-nearby-disc {
  background: linear-gradient(160deg, #a855f7 0%, #7e22ce 100%);
}
.mc-nearby.is-tram .mc-nearby-ring { color: #7e22ce; }

.mc-nearby.is-metro .mc-nearby-disc {
  background: linear-gradient(160deg, #ef4444 0%, #dc2626 100%);
}
.mc-nearby.is-metro .mc-nearby-ring { color: #dc2626; }

.mc-nearby.is-rail .mc-nearby-disc {
  background: linear-gradient(160deg, #22d3ee 0%, #0891b2 100%);
}
.mc-nearby.is-rail .mc-nearby-ring { color: #0891b2; }

.mc-nearby.is-ferry .mc-nearby-disc {
  background: linear-gradient(160deg, #38bdf8 0%, #0369a1 100%);
}
.mc-nearby.is-ferry .mc-nearby-ring { color: #0369a1; }

.mc-nearby.is-funicular .mc-nearby-disc {
  background: linear-gradient(160deg, #facc15 0%, #ca8a04 100%);
  color: #1f2937;
}
.mc-nearby.is-funicular .mc-nearby-ring { color: #ca8a04; }

.mc-nearby.is-trolleybus .mc-nearby-disc {
  background: linear-gradient(160deg, #34d399 0%, #059669 100%);
}
.mc-nearby.is-trolleybus .mc-nearby-ring { color: #059669; }

/* ---------- User location ---------- */
.mc-user {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-user-halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: color-mix(in srgb, #2563eb 22%, transparent);
  animation: mc-pulse 2.8s ease-out infinite;
}

.mc-user-dot {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.45);
}

/* ---------- Vehicle capsule ---------- */
.mc-vehicle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 2px solid #fff;
  color: #fff;
  background: linear-gradient(160deg, #3b82f6 0%, #1d4ed8 100%);
  box-shadow:
    0 2px 10px rgba(37, 99, 235, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mc-vehicle-label {
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
}

.mc-vehicle.is-tram {
  background: linear-gradient(160deg, #a855f7 0%, #7e22ce 100%);
  box-shadow: 0 2px 10px rgba(147, 51, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.mc-vehicle.is-metro {
  background: linear-gradient(160deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.mc-vehicle.is-rail {
  background: linear-gradient(160deg, #22d3ee 0%, #0891b2 100%);
  box-shadow: 0 2px 10px rgba(8, 145, 178, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.mc-vehicle.is-ferry {
  background: linear-gradient(160deg, #38bdf8 0%, #0369a1 100%);
  box-shadow: 0 2px 10px rgba(3, 105, 161, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.mc-vehicle.is-funicular {
  background: linear-gradient(160deg, #facc15 0%, #ca8a04 100%);
  color: #1f2937;
  box-shadow: 0 2px 10px rgba(202, 138, 4, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.mc-vehicle.is-trolleybus {
  background: linear-gradient(160deg, #34d399 0%, #059669 100%);
  box-shadow: 0 2px 10px rgba(5, 150, 105, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.mc-vehicle.is-focused {
  transform: scale(1.08);
  box-shadow:
    0 0 0 3px color-mix(in srgb, #2563eb 32%, transparent),
    0 4px 14px rgba(37, 99, 235, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mc-vehicle.is-tram.is-focused {
  box-shadow:
    0 0 0 3px color-mix(in srgb, #7e22ce 32%, transparent),
    0 4px 14px rgba(147, 51, 234, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ---------- Planner A/B endpoints ---------- */
.mc-endpoint {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 3px 8px rgba(15, 23, 42, 0.3));
}

.mc-endpoint-head {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.mc-endpoint-stem {
  width: 3px;
  height: 8px;
  margin-top: -1px;
}

.mc-endpoint-point {
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-sizing: border-box;
}

.mc-endpoint.is-from .mc-endpoint-head,
.mc-endpoint.is-from .mc-endpoint-stem,
.mc-endpoint.is-from .mc-endpoint-point {
  background: linear-gradient(145deg, #3b82f6, #2563eb);
}

.mc-endpoint.is-from .mc-endpoint-stem,
.mc-endpoint.is-from .mc-endpoint-point {
  background: #2563eb;
}

.mc-endpoint.is-to .mc-endpoint-head {
  background: linear-gradient(145deg, #f43f5e, #e11d48);
}

.mc-endpoint.is-to .mc-endpoint-stem,
.mc-endpoint.is-to .mc-endpoint-point {
  background: #e11d48;
}

/* ---------- Guide board/alight ---------- */
.mc-guide-dot {
  position: relative;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-guide-dot-core {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.3);
  box-sizing: border-box;
}

.mc-guide-dot.is-board .mc-guide-dot-core {
  background: #2563eb;
}

.mc-guide-dot.is-alight .mc-guide-dot-core {
  background: #dc2626;
}

.mc-guide-dot.is-active .mc-guide-dot-core {
  width: 14px;
  height: 14px;
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 5px currentColor,
    0 2px 8px rgba(15, 23, 42, 0.25);
}

.mc-guide-dot.is-board.is-active {
  color: #2563eb;
}

.mc-guide-dot.is-alight.is-active {
  color: #dc2626;
}

.mc-guide-dot.is-active::before {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.45;
  animation: mc-pulse 2.2s ease-out infinite;
}

/* ---------- Legend (shared glass) ---------- */
.map-route-legend,
.planner-map-legend {
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  background: color-mix(in srgb, var(--surface, #fff) 88%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--border, #e2e8f0) 80%, transparent);
  border-radius: 999px !important;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.1);
  padding: 5px 10px !important;
  gap: 6px 10px !important;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--muted, #64748b);
  row-gap: 4px !important;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: min(420px, calc(100% - 20px));
  line-height: 1.2;
}

.planner-map-legend .planner-legend-item,
.map-route-legend .map-legend-item {
  gap: 4px;
}

.map-legend-line.is-route,
.planner-legend-line.is-route,
.planner-map-legend .planner-legend-line,
.mc-legend-line {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 3px !important;
  border: none !important;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: none !important;
  vertical-align: middle;
}

:root[data-theme="dark"] .map-legend-line.is-route,
:root[data-theme="dark"] .planner-legend-line.is-route,
:root[data-theme="dark"] .mc-legend-line {
  box-shadow: none !important;
}

.map-legend-line.is-walk,
.mc-legend-line.is-walk,
.planner-legend-item.is-walk .planner-legend-line {
  background: #5b8a72 !important;
  box-shadow: none !important;
  border: none !important;
  height: 3px !important;
  width: 14px;
  background-image: linear-gradient(
    90deg,
    #5b8a72 0 2px,
    transparent 2px 5px,
    #5b8a72 5px 7px,
    transparent 7px 10px,
    #5b8a72 10px 12px,
    transparent 12px 14px
  ) !important;
  background-color: transparent !important;
}

.map-legend-dot.is-vehicle,
.mc-legend-vehicle {
  width: 18px;
  height: 10px;
  border-radius: 999px;
  border: 1.5px solid #fff;
  background: linear-gradient(160deg, #3b82f6 0%, #1d4ed8 100%);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.35);
}

.mc-legend-drop {
  --mc-accent: #2563eb;
  position: relative;
  display: inline-block;
  width: 10px;
  height: 13px;
  flex-shrink: 0;
  vertical-align: middle;
}

.mc-legend-drop::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--mc-accent) 65%, #fff);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.9) 0%, transparent 50%),
    color-mix(in srgb, var(--mc-accent) 48%, transparent);
  box-sizing: border-box;
}

.mc-legend-drop::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 6px;
  height: 5px;
  margin-left: -3px;
  border-radius: 0 0 50% 50%;
  background: color-mix(in srgb, var(--mc-accent) 48%, transparent);
  border: 1px solid color-mix(in srgb, var(--mc-accent) 55%, transparent);
  border-top: none;
}

.mc-legend-drop.is-board {
  --mc-accent: #2563eb;
}

.mc-legend-drop.is-alight {
  --mc-accent: #dc2626;
}

.map-route-legend.is-tram .mc-legend-drop { --mc-accent: #9333ea; }
.map-route-legend.is-metro .mc-legend-drop { --mc-accent: #dc2626; }
.map-route-legend.is-rail .mc-legend-drop { --mc-accent: #0891b2; }
.map-route-legend.is-ferry .mc-legend-drop { --mc-accent: #0369a1; }
.map-route-legend.is-funicular .mc-legend-drop { --mc-accent: #ca8a04; }
.map-route-legend.is-trolleybus .mc-legend-drop { --mc-accent: #059669; }

.map-route-legend.is-tram .map-legend-line.is-route { background: #9333ea; }
.map-route-legend.is-metro .map-legend-line.is-route { background: #dc2626; }
.map-route-legend.is-rail .map-legend-line.is-route { background: #0891b2; }
.map-route-legend.is-ferry .map-legend-line.is-route { background: #0369a1; }
.map-route-legend.is-funicular .map-legend-line.is-route { background: #ca8a04; }
.map-route-legend.is-trolleybus .map-legend-line.is-route { background: #059669; }

.map-route-legend.is-tram .map-legend-dot.is-vehicle {
  background: linear-gradient(160deg, #a855f7 0%, #7e22ce 100%);
}
.map-route-legend.is-metro .map-legend-dot.is-vehicle {
  background: linear-gradient(160deg, #ef4444 0%, #dc2626 100%);
}
.map-route-legend.is-rail .map-legend-dot.is-vehicle {
  background: linear-gradient(160deg, #22d3ee 0%, #0891b2 100%);
}
.map-route-legend.is-ferry .map-legend-dot.is-vehicle {
  background: linear-gradient(160deg, #38bdf8 0%, #0369a1 100%);
}
.map-route-legend.is-funicular .map-legend-dot.is-vehicle {
  background: linear-gradient(160deg, #facc15 0%, #ca8a04 100%);
}
.map-route-legend.is-trolleybus .map-legend-dot.is-vehicle {
  background: linear-gradient(160deg, #34d399 0%, #059669 100%);
}

/* ---------- Leaflet popup polish ---------- */
.leaflet-popup-content-wrapper {
  border-radius: 16px !important;
  font-family: inherit;
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  box-shadow:
    0 8px 28px rgba(15, 23, 42, 0.14),
    0 1px 0 rgba(255, 255, 255, 0.4) inset !important;
  border: 1px solid color-mix(in srgb, var(--border, #e2e8f0) 85%, transparent);
  padding: 0;
}

.leaflet-popup-content {
  margin: 12px 14px 14px !important;
  font-size: 0.875rem;
  line-height: 1.4;
  min-width: 180px;
}

.leaflet-popup-tip {
  background: var(--surface, #fff) !important;
  border: none;
  box-shadow: none;
}

.leaflet-container a.leaflet-popup-close-button {
  top: 6px;
  right: 8px;
  color: var(--muted, #64748b);
  font-size: 18px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
}

.leaflet-container a.leaflet-popup-close-button:hover {
  background: var(--surface-2, #f1f5f9);
  color: var(--text, #0f172a);
}

.map-popup-lines {
  margin-top: 8px;
}

.map-popup-lines-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--muted, #64748b);
  margin-bottom: 5px;
}

.map-popup-routes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.map-popup-routes .nearby-route-badge,
.nearby-route-badge {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.nearby-route-badge.is-bus {
  color: #2563eb;
  background: color-mix(in srgb, #2563eb 12%, transparent);
  border: 1px solid color-mix(in srgb, #2563eb 28%, transparent);
}

.nearby-route-badge.is-tram {
  color: #9333ea;
  background: color-mix(in srgb, #9333ea 12%, transparent);
  border: 1px solid color-mix(in srgb, #9333ea 30%, transparent);
}

.nearby-route-badge.is-metro {
  color: #dc2626;
  background: color-mix(in srgb, #dc2626 12%, transparent);
  border: 1px solid color-mix(in srgb, #dc2626 28%, transparent);
}

.nearby-route-badge.is-rail {
  color: #0891b2;
  background: color-mix(in srgb, #0891b2 12%, transparent);
  border: 1px solid color-mix(in srgb, #0891b2 28%, transparent);
}

.nearby-route-badge.is-ferry {
  color: #0369a1;
  background: color-mix(in srgb, #0369a1 12%, transparent);
  border: 1px solid color-mix(in srgb, #0369a1 28%, transparent);
}

.nearby-route-badge.is-funicular {
  color: #ca8a04;
  background: color-mix(in srgb, #ca8a04 14%, transparent);
  border: 1px solid color-mix(in srgb, #ca8a04 30%, transparent);
}

.nearby-route-badge.is-trolleybus {
  color: #059669;
  background: color-mix(in srgb, #059669 12%, transparent);
  border: 1px solid color-mix(in srgb, #059669 28%, transparent);
}

.map-popup-badge-target {
  background: color-mix(in srgb, #7c3aed 14%, transparent);
  color: #6d28d9;
}

.map-popup-badge-start {
  background: color-mix(in srgb, #16a34a 14%, transparent);
  color: #15803d;
}

.map-popup-badge-end {
  background: color-mix(in srgb, #dc2626 14%, transparent);
  color: #b91c1c;
}

:root[data-theme="dark"] .map-popup-badge-target {
  background: color-mix(in srgb, #a78bfa 18%, transparent);
  color: #c4b5fd;
}

:root[data-theme="dark"] .map-popup-badge-start {
  background: color-mix(in srgb, #4ade80 16%, transparent);
  color: #86efac;
}

:root[data-theme="dark"] .map-popup-badge-end {
  background: color-mix(in srgb, #f87171 16%, transparent);
  color: #fca5a5;
}

/* Reduce Leaflet default control clash with glass chrome */
.leaflet-control-zoom a {
  border-radius: 10px !important;
}

@media (prefers-reduced-motion: reduce) {
  .mc-pulse,
  .mc-nearby-ring,
  .mc-user-halo,
  .mc-guide-dot.is-active::before,
  .mc-stop-drop-pulse,
  .mc-stop-cap-pulse,
  .mc-vehicle {
    animation: none !important;
    transition: none !important;
  }
}

/* Dark theme: slightly stronger casing contrast on discs */
:root[data-theme="dark"] .mc-nearby-disc,
:root[data-theme="dark"] .mc-vehicle,
:root[data-theme="dark"] .mc-stop-pin-head,
:root[data-theme="dark"] .mc-endpoint-head {
  border-color: rgba(255, 255, 255, 0.92);
}

:root[data-theme="dark"] .mc-user-dot {
  border-color: #e2e8f0;
}

/* Mobile: keep markers crisp when map is rotated / zoomed */
@media (max-width: 640px) {
  .mc-nearby-disc {
    box-shadow:
      0 2px 6px rgba(15, 23, 42, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }

  .mc-stop-disc-core {
    width: 11px;
    height: 11px;
  }
}
