/* Copyright (c) 2026 Félix De Portu Bravo. Todos los derechos reservados.
   Uso, copia o distribución sin permiso escrito está estrictamente prohibido.
   Ver archivo LICENSE para términos completos. */

/* ===========================
   ACCESO EN TRÁNSITO · STYLES
   Matching: Lente de Densidad visual language
   =========================== */

:root {
  --panel-bg: #ffffff;
  --panel-border: #e8e4dd;
  --surface: #f7f5f2;
  --text-primary: #1a1a1a;
  --text-secondary: #666;
  --text-muted: #aaa;
  --accent: #2d6a00;
  --accent-light: rgba(45, 106, 0, 0.1);
  --accent-ring: rgba(45, 106, 0, 0.18);
  --radius: 16px;
  --panel-width: clamp(300px, 24vw, 380px);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
  --font: "Plus Jakarta Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-size: clamp(13px, 1.35vw + 0.5rem, 16px);
  line-height: 1.5;
  color: var(--text-primary);
}
a {
  color: var(--accent);
}
/* ── MAP ─────────────────────────────────────── */
#map {
  position: fixed;
  inset: 0;
  z-index: 1;
}
#map-legend {
  position: fixed;
  cursor: pointer;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
#legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#legend-header .section-label {
  margin-bottom: 0;
}
#legend-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  opacity: 0.6;
}
#legend-toggle:hover { opacity: 1; }
#legend-chevron {
  transition: transform 0.2s ease;
}
#legend-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 3px;
}
#legend-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
}
.legend-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
@media (max-width: 768px) {
  #map-legend {
    bottom: auto;
    top: 16px;
    right: 16px;
  }
}
/* ── POI MAP LABEL ───────────────────────────────────────────────────────── */
.poi-map-label {
  position: absolute;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font);
  font-size: 0.714rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--panel-bg);
  color: var(--text);
  padding: 1px 4px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  pointer-events: none;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── ROUTE MAP LABEL ─────────────────────────────────────────────────────── */
.route-map-label {
  font-family: var(--font);
  font-size: 0.857rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  border: 2px solid var(--label-color, #333);
  background: var(--panel-bg);
  color: var(--label-color, #333);
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  pointer-events: none;
  letter-spacing: 0.01em;
  transform: translate(-50%, -50%);
  display: inline-block;
}

/* ── PANEL ───────────────────────────────────── */
#panel {
  position: fixed;
  top: 16px;
  right: 16px;
  width: var(--panel-width);
  max-height: calc(100vh - 32px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  z-index: 1000;
  box-shadow: var(--shadow);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-border) transparent;
  /* Block pinch-zoom on the panel; only allow vertical scroll */
  touch-action: pan-y;
}
#panel::-webkit-scrollbar {
  width: 4px;
}
#panel::-webkit-scrollbar-track {
  background: transparent;
}
#panel::-webkit-scrollbar-thumb {
  background: var(--panel-border);
  border-radius: 2px;
}

/* ── HEADER ──────────────────────────────────── */
#panel-header {
  padding: 8px 18px 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: sticky;
  top: 0;
  background: var(--panel-bg);
  z-index: 10;
}
h1 {
  font-family: var(--font);
  font-weight: 800;
  font-size: 1.714rem;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.subtitle {
  font-size: 0.714rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
  font-weight: 500;
}

/* POI status dot */

@keyframes pulse-amber {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 0 5px rgba(245, 158, 11, 0);
  }
}
@keyframes pulse-green {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(45, 106, 0, 0.3);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 0 6px rgba(45, 106, 0, 0);
  }
}

/* ── SECTION LABEL ───────────────────────────── */
.section-label {
  display: block;
  font-size: 0.643rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0;
}

/* ── SEARCH ──────────────────────────────────── */
#search-section {
  padding: 12px 18px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#search-wrap {
  position: relative;
  flex: 1;
}
#info-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1.071rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}
#info-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
#search-icon-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.429rem;
  line-height: 1;
  padding: 2px 5px;
  cursor: pointer;
  transition: color 0.15s;
}
#search-icon-btn:hover {
  color: var(--text-primary);
}
#search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.929rem;
  padding: 9px 36px 9px 12px;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
#search-input::placeholder {
  color: var(--text-muted);
}
#search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 100;
  display: none;
  max-height: 200px;
  overflow-y: auto;
}
.search-result-item {
  padding: 9px 14px;
  font-family: var(--font);
  font-size: 0.857rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 1px solid var(--panel-border);
  transition: background 0.12s;
  line-height: 1.4;
}
.search-result-item:last-child {
  border-bottom: none;
}
.search-result-item:hover {
  background: var(--surface);
  color: var(--text-primary);
}
.search-result-item strong {
  color: var(--text-primary);
  display: block;
  font-size: 0.929rem;
  font-weight: 700;
}

/* ── DAY SELECTOR ────────────────────────────── */
/* ── DAY + LEGEND SIDE BY SIDE ───────────────── */
#day-legend-section {
  border-bottom: 1px solid var(--panel-border);
}
#day-section {
  padding: 10px 18px 12px;
}
#day-selector {
  display: flex;
  flex-direction: row;
  gap: 6px;
  margin-top: 6px;
}
.day-btn {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.857rem;
  font-weight: 600;
  padding: 7px 4px;
  cursor: pointer;
  transition: all 0.12s;
  letter-spacing: -0.01em;
}
@media (hover: hover) {
  .day-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
}
.day-btn.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
#legend-section {
  flex: 1;
  padding: 10px 18px 12px 12px;
}
#legend {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.786rem;
  color: var(--text-secondary);
}
.legend-swatch {
  width: 20px;
  height: 5px;
  border-radius: 3px;
  flex-shrink: 0;
}
.train-swatch {
  background: #111;
  height: 7px;
  border-radius: 4px;
  border: 1.5px solid #555;
}
.terminal-swatch {
  width: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.terminal-swatch::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #000;
  display: block;
}

/* ── RADIUS ──────────────────────────────────── */
#radius-section {
  padding: 10px 18px 12px;
  border-bottom: 1px solid var(--panel-border);
}
#radius-header {
  margin-bottom: 8px;
}
#radius-btns {
  display: flex;
  gap: 6px;
}
.radius-btn {
  flex: 1;
  padding: 7px 0;
  border: 1.5px solid var(--panel-border);
  border-radius: 8px;
  background: transparent;
  font-family: var(--font);
  font-size: 0.786rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.radius-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.radius-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

/* ── POI TOGGLES ─────────────────────────────── */
#poi-section {
  padding: 10px 18px 12px;
  border-bottom: 1px solid var(--panel-border);
}
#poi-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.poi-btn {
  font-family: var(--font);
  font-size: 0.786rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
@media (hover: hover) {
  .poi-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
}
.poi-btn.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.poi-divider {
  width: 100%;
  height: 0;
  border: none;
  border-top: 1px solid var(--panel-border);
  margin: 2px 0;
}

/* ── ROUTES LIST ─────────────────────────────── */
#routes-section {
  padding: 10px 18px 12px;
}
#routes-section .section-label {
  margin-bottom: 8px;
}
#route-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.route-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.12s;
  background: transparent;
}
@media (hover: hover) {
  .route-item:hover {
    background: var(--surface);
    border-color: var(--panel-border);
  }
}
.route-item.active {
  background: var(--accent-light);
  border-color: var(--accent);
}
.route-badge {
  font-family: var(--font);
  font-size: 0.786rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  min-width: 38px;
  text-align: center;
  flex-shrink: 0;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
}
.route-name {
  font-family: var(--font);
  font-size: 0.857rem;
  font-weight: 500;
  color: var(--text-secondary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-hw {
  font-family: var(--font);
  font-size: 0.714rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.route-item.active .route-name {
  color: var(--text-primary);
}
.route-item.active .route-hw {
  color: var(--text-secondary);
}

/* ── FOOTER ──────────────────────────────────── */
#panel-footer {
  display: block;
  padding: 8px 18px;
  background: var(--surface);
  border-top: 1px solid var(--panel-border);
  font-size: 0.714rem;
  color: var(--text-muted);
  text-align: center;
}
#panel-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
#panel-footer a:hover {
  text-decoration: underline;
}

/* ── ROUTE INFO — inline above search ───────────── */
#route-info {
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 10px 18px;
  border-bottom: 1px solid var(--panel-border);
  border-left: 3px solid transparent;
  background: var(--surface);
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#route-info-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}
#route-info-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
#route-info-badge {
  font-family: var(--font);
  font-size: 0.857rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid transparent;
  align-self: center;
}
#route-info-name {
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.929rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#route-info-hw {
  font-size: 0.786rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}
#route-info-hw-text {
  cursor: pointer;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
#route-info-hw-text:hover {
  opacity: 0.75;
}

/* ── TIMETABLE MODAL ─────────────────────────────────────────────────────── */
#timetable-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(2px);
  opacity: 1;
  transition: opacity 0.18s ease;
}
#timetable-overlay.hidden {
  display: none;
}
#timetable-modal {
  background: var(--panel-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 840px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#timetable-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--panel-border);
  flex-shrink: 0;
}
#timetable-title {
  font-size: 0.857rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
#timetable-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.857rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
}
#timetable-close:hover { background: var(--surface); }
#timetable-source {
  font-size: 0.643rem;
  color: var(--text-muted);
  padding: 10px 16px;
  flex-shrink: 0;
}
#timetable-source a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
#timetable-day-selector {
  display: flex;
  gap: 4px;
  padding: 10px 16px 0;
  flex-shrink: 0;
}
.tt-day-btn {
  font-family: inherit;
  font-size: 0.714rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.tt-day-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.tt-day-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
#timetable-tabs {
  display: flex;
  gap: 0;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--panel-border);
  flex-shrink: 0;
}
.tt-dir-btn {
  font-family: inherit;
  font-size: 0.786rem;
  font-weight: 600;
  padding: 6px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
  margin-bottom: -1px;
}
.tt-dir-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tt-dir-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
#timetable-blocks {
  display: flex;
  gap: 4px;
  padding: 10px 16px 0;
  flex-shrink: 0;
}
.tt-block-btn {
  font-family: inherit;
  font-size: 0.714rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tt-block-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.tt-block-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.tt-block-count {
  font-size: 0.643rem;
  opacity: 0.75;
  display: none;
}
#timetable-grid {
  overflow: auto;
  flex: 1;
  padding: 0;
}
.tt-table {
  border-collapse: collapse;
  font-size: 0.714rem;
  font-family: var(--font);
  width: max-content;
  min-width: 100%;
}
.tt-table thead th {
  position: sticky;
  top: 0;
  background: var(--panel-bg);
  z-index: 2;
  padding: 6px 10px;
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--panel-border);
  white-space: nowrap;
}
.tt-stop-col {
  position: sticky !important;
  left: 0;
  z-index: 3 !important;
  text-align: left !important;
  min-width: 180px;
  max-width: 220px;
  background: var(--panel-bg) !important;
}
.tt-trip-col {
  min-width: 72px;
}
.tt-table tbody tr:nth-child(even) {
  background: var(--surface);
}
.tt-table tbody tr:nth-child(odd) {
  background: var(--panel-bg);
}
.tt-table tbody tr:hover {
  background: var(--panel-border);
}
.tt-stop-name {
  position: sticky;
  left: 0;
  background: inherit;
  z-index: 1;
  padding: 5px 10px;
  font-weight: 600;
  color: var(--text-primary);
  border-right: 1px solid var(--panel-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.tt-stop-clickable {
  cursor: pointer;
}
.tt-stop-clickable:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tt-cell {
  padding: 5px 10px;
  text-align: center;
  color: var(--text-secondary);
  white-space: nowrap;
  border-right: 1px solid var(--panel-border);
}
.tt-cell:last-child { border-right: none; }
#timetable-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 0.786rem;
  color: var(--text-muted);
}
#timetable-empty.hidden { display: none; }
#route-info-close {
  background: none;
  border: 1.5px solid var(--panel-border);
  border-radius: 50%;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 0.714rem;
  line-height: 1;
  display: none; /* shown via JS when route selected */
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  transition: color 0.12s, border-color 0.12s;
  padding: 0;
}
#route-info-close:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

/* ── NEXT ARRIVALS PANEL ────────────────────────────────────────────────── */
#route-next-arrivals {
  border-top: 1px solid var(--panel-border);
  padding: 8px 18px 4px;
  margin: 4px -18px -10px;
}
#route-next-arrivals.hidden { display: none; }
#route-next-arrivals-label {
  font-size: 0.643rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  display: none;
}
.next-arr-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}
.next-arr-time {
  font-size: 0.857rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 72px;
  flex-shrink: 0;
}
.next-arr-arrow {
  font-size: 0.714rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.next-arr-dest {
  font-size: 0.786rem;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.next-arr-dest-link {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  color: var(--accent);
}
.next-arr-dest-link:hover {
  opacity: 0.75;
}
.next-arr-diff {
  font-size: 0.714rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.next-arr-empty {
  font-size: 0.714rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── INTRO ───────────────────────────────────── */
#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(20, 30, 15, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#intro-box {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 26px 24px;
  max-width: 400px;
  width: 100%;
  position: relative;
}
#intro-box h2 {
  font-size: 1.286rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.intro-sub {
  font-size: 0.786rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 14px;
}
#intro-box > p:not(.intro-sub):not(.intro-credit) {
  font-size: 0.929rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
  margin-top: 18px;
}
.intro-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
.intro-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.intro-icon {
  font-size: 1.071rem;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1;
  width: 22px;
  text-align: center;
  display: inline-block;
}
.intro-step span:last-child {
  font-size: 0.929rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.intro-step strong {
  color: var(--text-primary);
  font-weight: 600;
}
.intro-credit {
  font-size: 0.714rem;
  color: var(--text-muted);
  /*margin-bottom: 18px;*/
  margin-bottom: 0;
  padding-top: 14px;
  border-top: 1px solid var(--panel-border);
  text-align: center;
  line-height: 1.7;
}
.intro-credit a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.intro-credit a:hover {
  text-decoration: underline;
}
#intro-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, opacity 0.15s;
  z-index: 1;
}
#intro-close:hover:not(:disabled) {
  background: #1f4d00;
}
#intro-close:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.disclaimer {
  font-size: 0.66rem;
  color: var(--text-secondary);
  line-height: 1.6;
  background: #fffbea;
  border: 1px solid #f0e08a;
  border-radius: 10px;
  padding: 10px 13px;
  margin-bottom: 14px;
}
.disclaimer p {
  font-size: 0.66rem;
  margin: 0.33rem 0;
}
.footer-feedback {
  display: inline-block;
  margin-top: 5px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.footer-feedback:hover {
  text-decoration: underline;
}
.leaflet-popup-content-wrapper {
  border-radius: 10px !important;
  box-shadow: var(--shadow) !important;
  border: 1px solid var(--panel-border) !important;
}
.leaflet-popup-content {
  font-family: var(--font) !important;
  font-size: 0.929rem !important;
  color: var(--text-primary) !important;
  margin: 12px 14px !important;
  min-width: 150px;
}
.popup-stop-name {
  font-weight: 800;
  margin-bottom: 3px;
  font-size: 1.0rem;
}
.popup-stop-route {
  font-size: 0.786rem;
  color: var(--text-secondary);
}
.popup-poi-name {
  font-weight: 700;
  margin-bottom: 3px;
}
.popup-poi-cat {
  font-size: 0.714rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
}
.popup-poi-addr {
  font-size: 0.786rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

.leaflet-control-zoom a {
  font-family: var(--font) !important;
  font-weight: 700 !important;
}

/* Geolocation marker (Google Maps style) */
.geo-marker-outer {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.geo-marker-outer::before {
  content: "";
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(66, 133, 244, 0.2);
  animation: geo-pulse 2s ease-out infinite;
}
.geo-marker-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4285f4;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
  position: relative;
  z-index: 1;
}
@keyframes geo-pulse {
  0%   { transform: scale(0.6); opacity: 0.8; }
  70%  { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Home marker */
.home-marker-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid white;
  box-shadow:
    0 0 0 3px var(--accent-ring),
    0 2px 8px rgba(0, 0, 0, 0.2);
  animation: homebeat 2s ease-in-out infinite;
}
@keyframes homebeat {
  0%,
  100% {
    box-shadow:
      0 0 0 3px var(--accent-ring),
      0 2px 8px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow:
      0 0 0 7px rgba(45, 106, 0, 0.06),
      0 2px 8px rgba(0, 0, 0, 0.2);
  }
}

/* Mobile */
@media (max-width: 768px) {
  #panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 75vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition:
      max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
      box-shadow 0.3s ease;
  }
  #panel.panel--collapsed {
    overflow: hidden;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    border-radius: var(--radius) var(--radius) 0 0;
  }
  #panel-drag-handle {
    display: block;
    width: 36px;
    height: 4px;
    background: var(--panel-border);
    border-radius: 2px;
    margin: 0 auto 6px;
    cursor: pointer;
    flex-shrink: 0;
  }
  #panel {
    display: block;
  }
  #panel-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding-top: 6px;
  }
}

/* ── PANEL TABS ──────────────────────────────────────────────────────────── */
#panel-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 18px 12px;
}
.panel-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.857rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  min-height: 34px;
  min-width: 34px;
}
#info-btn.panel-tab,
#tab-config.panel-tab,
#tab-entorno.panel-tab {
  flex: 0 0 auto;
  padding: 7px 10px;
}
#tab-entorno.entorno-hidden {
  color: var(--text-muted);
  opacity: 0.45;
}
#tab-entorno.entorno-hidden:hover {
  opacity: 1;
}
@media (hover: hover) {
  .panel-tab:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
}
.panel-tab.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.panel-tab svg {
  flex-shrink: 0;
}

/* ── PANEL DRAWERS ───────────────────────────────────────────────────────── */
.panel-drawer {
  border-top: 1px solid var(--panel-border);
  overflow: hidden;
}



/* drag handle hidden on desktop */
#panel-drag-handle {
  display: none;
}

/* ── COLLAPSIBLE SECTION ─────────────────────────────────────────────────── */
.collapsible-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: none;
  border: none;
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  font-family: var(--font);
  font-size: 0.643rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.collapsible-header:hover {
  background: var(--surface);
  color: var(--text-secondary);
}
.collapsible-icon {
  font-size: 1.143rem;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.2s ease;
  color: var(--text-muted);
}
.collapsible-icon.open {
  transform: rotate(90deg);
}
.collapsible-body {
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.collapsible-body.collapsed {
  max-height: 0;
}

/* ── INACTIVE ROUTE DIVIDER ──────────────────── */
.route-inactive-label {
  font-size: 0.643rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 10px 10px 4px;
  border-top: 1px solid var(--panel-border);
  margin-top: 4px;
}

/* ── NETWORK GROUPS ──────────────────────────────────────────────────────── */
.network-group {
  display: flex;
  flex-direction: column;
}
.network-group + .network-group {
  border-top: 1px solid var(--panel-border);
  margin-top: 4px;
  padding-top: 4px;
}
.network-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 7px 8px;
  cursor: pointer;
  border-radius: 8px;
  user-select: none;
  transition: background 0.12s;
}
@media (hover: hover) {
  .network-header:hover {
    background: var(--surface);
  }
}

/* Toggle switch */
.network-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 2px;
  margin-right: 2px;
  border-radius: 4px;
  cursor: pointer;
}
.network-toggle-track {
  width: 22px;
  height: 12px;
  border-radius: 6px;
  background: var(--panel-border);
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}
.network-toggle-track::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.network-toggle-track.on {
  background: #22c55e;
}
.network-toggle-track.on::after {
  transform: translateX(10px);
}
.network-header.network-hidden .network-name,
.network-header.network-hidden .network-count {
  opacity: 0.4;
}
.network-name {
  font-family: var(--font);
  font-size: 0.786rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  letter-spacing: -0.01em;
}
.network-count {
  font-family: var(--font);
  font-size: 0.714rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.network-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.network-chevron::before,
.network-chevron::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform 0.18s ease;
}
.network-chevron::before { transform: translateX(-2px) rotate(-45deg); }
.network-chevron::after  { transform: translateX(2px)  rotate(45deg);  }
.network-header.collapsed .network-chevron::before { transform: translateX(-2px) rotate(45deg); }
.network-header.collapsed .network-chevron::after  { transform: translateX(2px)  rotate(-45deg); }

.network-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 4px 0;
}
.network-body.hidden {
  display: none;
}
.route-item--inactive {
  opacity: 0.5;
  pointer-events: none;
}

/* ── POPUP GOOGLE MAPS LINK ─────────────────────────────────────────────── */
.popup-gmaps {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.786rem;
  font-weight: 600;
  color: #1d6030;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.popup-gmaps:hover {
  text-decoration: underline;
}

/* ── POI BULK TOGGLE ─────────────────────────────────────────────────────── */
.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.bulk-btns {
  display: flex;
  gap: 4px;
}
.bulk-btns button {
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid #d1cdc6;
  background: #f5f2ed;
  color: #6b6560;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.bulk-btns button:hover {
  background: #2d6a00;
  color: white;
  border-color: #2d6a00;
}

/* ── ROUTE LINE TOUCH AREA ───────────────────────────────────────────────── */
/* Make SVG paths easier to tap on mobile without duplicating polylines.      */
/* stroke-width on the path element itself is what Leaflet uses for hit area. */
.route-line {
  cursor: pointer;
}
.route-line path {
  /* Invisible thick stroke behind the visible one for touch targeting */
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Leaflet renders polylines as <path> inside an SVG — we can expand the      */
/* pointer hit area using a CSS filter trick on the SVG container             */
.leaflet-overlay-pane svg .route-line {
  pointer-events: stroke;
}

/* ── PANEL CHEVRON (mobile only) ────────────────────────────────────────── */

/* ── POI LOADING TOAST ───────────────────────────── */
#poi-loading-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  background: var(--accent);
  border: none;
  border-radius: 20px;
  padding: 9px 16px 9px 12px;
  font-size: 0.929rem;
  font-family: var(--font);
  font-weight: 600;
  color: white;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
#poi-loading-toast.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-6px);
}
.poi-toast-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── LOCATION POPUP ──────────────────────────────────────────────────────── */

/* ── TUTORIAL TOOLTIPS ───────────────────────────────────────────────────── */
#tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  pointer-events: none;
}
#tutorial-tooltip {
  position: fixed;
  z-index: 1501;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px 12px;
  max-width: 260px;
  width: max-content;
  pointer-events: all;
  animation: tutorial-in 0.2s ease;
}
@keyframes tutorial-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

#tutorial h2 {
  font-size: 1.286rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 2px;
}
#tutorial-tooltip p {
  font-size: 0.857rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 10px;
}
#tutorial-tooltip strong {
  color: var(--text-primary);
  font-weight: 700;
}
#tutorial-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#tutorial-step-dots {
  display: flex;
  gap: 5px;
}
.tutorial-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--panel-border);
  transition: background 0.15s;
}
.tutorial-dot.active {
  background: var(--accent);
}
#tutorial-skip {
  font-family: var(--font);
  font-size: 0.786rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  pointer-events: all;
}
#tutorial-skip:hover {
  color: var(--text-primary);
}
#tutorial-next {
  font-family: var(--font);
  font-size: 0.786rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 10px;
  pointer-events: all;
  white-space: nowrap;
}
#tutorial-next:hover {
  opacity: 0.85;
}
/* Arrow triangle pointing toward the target */
#tutorial-arrow {
  position: fixed;
  z-index: 1501;
  width: 0;
  height: 0;
  pointer-events: none;
}
#tutorial-arrow.arrow-right {
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid var(--panel-bg);
  filter: drop-shadow(1px 0 0 var(--panel-border));
}
#tutorial-arrow.arrow-left {
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 10px solid var(--panel-bg);
  filter: drop-shadow(-1px 0 0 var(--panel-border));
}
#tutorial-arrow.arrow-down {
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 10px solid var(--panel-bg);
  filter: drop-shadow(0 1px 0 var(--panel-border));
}
#tutorial-arrow.arrow-up {
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 10px solid var(--panel-bg);
  filter: drop-shadow(0 -1px 0 var(--panel-border));
}
/* Highlight ring around target button */
#tutorial-highlight {
  position: fixed;
  z-index: 1500;
  border-radius: 12px;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 6px var(--accent-light);
  pointer-events: none;
  transition: all 0.25s ease;
  opacity: 0;
}
#tutorial-highlight.visible {
  opacity: 1;
}

#location-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1100;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 30px 30px;
  max-width: 420px;
  width: calc(100% - 48px);
  max-height: 80vh;
  overflow-y: auto;
  text-align: center;
  opacity: 1;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
#location-popup img {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}
#location-popup p {
  font-size: 0.929rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}
#location-popup strong {
  color: var(--text-primary);
  font-weight: 700;
}
#location-popup .popup-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.857rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  vertical-align: middle;
  margin: 0 1px;
}
#location-popup .popup-route-btn {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.857rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  vertical-align: middle;
  margin: 0 1px;
}
#location-popup.hiding {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.97);
  pointer-events: none;
}
@media (max-width: 768px) {
  
/* ── TUTORIAL TOOLTIPS ───────────────────────────────────────────────────── */
#tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  pointer-events: none;
}
#tutorial-tooltip {
  position: fixed;
  z-index: 1501;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px 12px;
  max-width: 260px;
  width: max-content;
  pointer-events: all;
  animation: tutorial-in 0.2s ease;
}
@keyframes tutorial-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
#tutorial-tooltip p {
  font-size: 0.857rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 10px;
}
#tutorial-tooltip strong {
  color: var(--text-primary);
  font-weight: 700;
}
#tutorial-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#tutorial-step-dots {
  display: flex;
  gap: 5px;
}
.tutorial-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--panel-border);
  transition: background 0.15s;
}
.tutorial-dot.active {
  background: var(--accent);
}
#tutorial-skip {
  font-family: var(--font);
  font-size: 0.786rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  pointer-events: all;
}
#tutorial-skip:hover {
  color: var(--text-primary);
}
#tutorial-next {
  font-family: var(--font);
  font-size: 0.786rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 10px;
  pointer-events: all;
  white-space: nowrap;
}
#tutorial-next:hover {
  opacity: 0.85;
}
/* Arrow triangle pointing toward the target */
#tutorial-arrow {
  position: fixed;
  z-index: 1501;
  width: 0;
  height: 0;
  pointer-events: none;
}
#tutorial-arrow.arrow-right {
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid var(--panel-bg);
  filter: drop-shadow(1px 0 0 var(--panel-border));
}
#tutorial-arrow.arrow-left {
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 10px solid var(--panel-bg);
  filter: drop-shadow(-1px 0 0 var(--panel-border));
}
#tutorial-arrow.arrow-down {
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 10px solid var(--panel-bg);
  filter: drop-shadow(0 1px 0 var(--panel-border));
}
#tutorial-arrow.arrow-up {
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 10px solid var(--panel-bg);
  filter: drop-shadow(0 -1px 0 var(--panel-border));
}
/* Highlight ring around target button */
#tutorial-highlight {
  position: fixed;
  z-index: 1500;
  border-radius: 12px;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 6px var(--accent-light);
  pointer-events: none;
  transition: all 0.25s ease;
  opacity: 0;
}
#tutorial-highlight.visible {
  opacity: 1;
}

#location-popup {
    top: 50%;
    bottom: auto;
    max-height: 70vh;
  }
}


/* ── NEXT ARRIVAL BADGE ──────────────────────────────────────────────────── */
.next-arrival-badge {
  background: var(--panel-bg);
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 4px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  pointer-events: none;
  max-width: 200px;
  width: max-content;
}
.next-arrival-no-service {
  border-color: var(--text-muted);
  opacity: 0.8;
}
.next-arrival-label {
  font-family: var(--font);
  font-size: 0.571rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}
.next-arrival-time {
  font-family: var(--font);
  font-size: 0.857rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.next-arrival-no-service .next-arrival-time {
  color: var(--text-muted);
}
.next-arrival-diff {
  font-family: var(--font);
  font-size: 0.571rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1;
}
.next-arr-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 4px;
  flex-shrink: 0;
}
.dot-running {
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,0.4);
  animation: dot-pulse-green 2s ease-out infinite;
}
.dot-stopped {
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239,68,68,0.4);
  animation: dot-pulse-red 2s ease-out infinite;
}
@keyframes dot-pulse-green {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
@keyframes dot-pulse-red {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

/* ── LANDMARKS ─────────────────────────────────────────────────────────────── */
.landmark-dot {
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2.5px solid #000;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.landmark-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
}
.landmark-icon {
  width: 28px;
  height: 28px;
  background: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  flex-shrink: 0;
}
.landmark-icon svg {
  width: 16px;
  height: 16px;
  fill: #fff;
  color: #fff;
}
.landmark-label {
  margin-top: 3px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: #000;
  white-space: nowrap;
  text-shadow:
    -1px -1px 0 #fff,
     1px -1px 0 #fff,
    -1px  1px 0 #fff,
     1px  1px 0 #fff,
     0    2px 3px rgba(0,0,0,0.15);
  letter-spacing: 0.01em;
  display: none;
}
.landmark-tooltip {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 9px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.landmark-tooltip::before {
  border-top-color: #000 !important;
}
.lm-tt-name {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.lm-tt-routes {
  font-size: 0.679rem;
  font-weight: 500;
  opacity: 0.72;
  margin-top: 2px;
  white-space: nowrap;
}

/* ── POI LIST POPUP ──────────────────────────────────────────────────────────── */
.poi-list-popup .leaflet-popup-content-wrapper {
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.poi-list-popup .leaflet-popup-content {
  margin: 0;
  width: 255px !important;
}
.poi-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px 8px;
  border-bottom: 1px solid #f0ede8;
}
.poi-list-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}
.poi-list-count {
  font-size: 0.71rem;
  font-weight: 700;
  color: #aaa;
  background: #f3f4f6;
  border-radius: 99px;
  padding: 1px 7px;
}
.poi-list-body {
  max-height: 240px;
  overflow-y: auto;
}
.poi-list-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 7px 13px;
  border-bottom: 1px solid #f7f5f2;
}
.poi-list-item:last-child { border-bottom: none; }
.poi-list-item:hover { background: #fafaf9; }
.poi-list-text { flex: 1; min-width: 0; }
.poi-list-name {
  font-size: 0.786rem;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.poi-list-addr {
  font-size: 0.7rem;
  color: #aaa;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.poi-list-gmaps {
  font-size: 0.75rem;
  color: #2d6a00;
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
  opacity: 0.6;
  padding-top: 1px;
  transition: opacity 0.15s;
}
.poi-list-gmaps:hover { opacity: 1; }
.poi-list-more {
  padding: 6px 13px;
  font-size: 0.71rem;
  color: #bbb;
  text-align: center;
  border-top: 1px solid #f0ede8;
}
