/* ==========================================================================
   MODO PRO PARA TODAS LAS LINEAS DE AUTOBUSES DE ELCHE (URBANOS, PEDANIAS E INTERURBANOS)
   Cubre:
   1. Modulo Interactivo PRO (#esm-line-pro-hub: Cabecera + Termometro + Mapa Leaflet)
   2. Clases HTML5 personalizadas de Joomla (.bus-card, .stop, .badge, .parada-box,
      .day-card, .time-slot, .time-row, .destino-255a/b, .tabrow/.tabcol)
   3. Visor ampliable de cuadros horarios (.webp) y Acordeon de Normas del Viajero
   ========================================================================== */

/* --- 1. MODULO INTERACTIVO PRO EN CADA ARTICULO DE LINEA --- */
.esm-lp-wrap {
  margin: 0.4rem 0 2rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.esm-lp-hero {
  border-radius: 20px;
  padding: 1.35rem 1.5rem;
  color: #ffffff !important;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 16px 34px -12px rgba(9, 17, 31, 0.28);
}

.esm-lp-hero-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.esm-lp-code-box {
  min-width: 66px;
  height: 66px;
  padding: 0 0.75rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.esm-lp-code-lbl {
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}
.esm-lp-code-num {
  font-size: 1.65rem;
  font-weight: 950;
  color: #ffffff !important;
  margin-top: 2px;
}

.esm-lp-titles h2 {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: clamp(1.25rem, 2.3vw, 1.6rem) !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  line-height: 1.2 !important;
}
.esm-lp-sub {
  margin: 0.25rem 0 0 !important;
  font-size: 0.86rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9) !important;
}

.esm-lp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.esm-lp-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.44rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #ffffff !important;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.esm-lp-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Rejilla 2 columnas: Termometro de paradas izquierda + Mapa Leaflet derecha */
.esm-lp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.95fr);
  gap: 1.1rem;
  align-items: start;
}

.esm-lp-stops-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 26px -12px rgba(9, 17, 31, 0.1);
}

.esm-lp-toolbar {
  padding: 0.8rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.esm-lp-dir-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}
.esm-lp-dir-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  border-radius: 9px;
  padding: 0.34rem 0.68rem;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}
.esm-lp-dir-btn.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.esm-lp-search-row {
  display: flex;
  gap: 0.45rem;
}
.esm-lp-search-inp {
  flex: 1;
  min-width: 0;
  padding: 0.46rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 0.83rem;
  color: #09111f;
  background: #ffffff;
}
.esm-lp-near-btn {
  border: 1px solid #99f6e4;
  background: #ecfdf5;
  color: #0b6e66;
  border-radius: 10px;
  padding: 0 0.7rem;
  font-size: 0.75rem;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}

/* Termometro vertical estilo plano de metro/autobus */
.esm-lp-thermometer {
  max-height: 430px;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  position: relative;
  scrollbar-width: thin;
}

.esm-lp-stop-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0.55rem;
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.esm-lp-stop-item:hover,
.esm-lp-stop-item.is-highlighted {
  background: #f0fdfa;
}

/* Linea conectora vertical entre paradas */
.esm-lp-stop-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 32px;
  bottom: -10px;
  width: 3px;
  background: var(--lp-color, #0d9488);
  opacity: 0.35;
}

.esm-lp-stop-code {
  min-width: 38px;
  height: 26px;
  padding: 0 0.35rem;
  border-radius: 8px;
  background: var(--lp-color, #0d9488);
  color: #ffffff !important;
  font-size: 0.73rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(9, 17, 31, 0.16);
}

.esm-lp-stop-body {
  min-width: 0;
  flex: 1;
}
.esm-lp-stop-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
  color: #09111f;
  line-height: 1.25;
}
.esm-lp-corresp {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.28rem;
}
.esm-lp-corresp-lbl {
  font-size: 0.68rem;
  font-weight: 750;
  color: #64748b;
  margin-right: 0.15rem;
}
.esm-lp-line-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.08rem 0.4rem;
  border-radius: 5px;
  color: #ffffff !important;
  font-size: 0.66rem;
  font-weight: 850;
  text-decoration: none !important;
  line-height: 1.3;
}
a.esm-lp-line-tag:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.esm-lp-map-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  padding: 0.7rem;
  position: sticky;
  top: 88px;
  box-shadow: 0 10px 26px -12px rgba(9, 17, 31, 0.1);
}
.esm-lp-leaflet {
  width: 100%;
  height: 445px;
  border-radius: 12px;
  background: #e2e8f0;
}

/* Navegador rapido entre todas las lineas al pie del modulo */
.esm-lp-all-lines-bar {
  margin-top: 0.9rem;
  padding: 0.7rem 0.95rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* --- 2. RESCATE NATIVO DE CLASES PERSONALIZADAS DE JOOMLA (.bus-card, .stop, .badge, etc.) --- */
/* Si el modulo interactivo PRO ya renderiza el recorrido arriba, ocultar solo la lista duplicada .route-section */
body.esm-lp-hydrated .prose .bus-card > .route-section,
body.esm-lp-hydrated .prose .bus-card > .bus-header {
  display: none !important;
}
body.esm-lp-hydrated .prose .bus-card:not(:has(.day-card)):not(:has(.time-slot)):not(:has(table)) {
  display: none !important;
}

/* Estilos nativos de .bus-card (para SSR, buscadores o articulos sin equivalente en BD) */
.prose .bus-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  overflow: hidden;
  margin: 1.4rem 0;
  box-shadow: 0 10px 28px -12px rgba(9, 17, 31, 0.1);
}

.prose .bus-header {
  background: linear-gradient(135deg, #0f172a 0%, #0d9488 100%);
  color: #ffffff !important;
  padding: 1.15rem 1.35rem;
}
.prose .bus-header h2,
.prose .bus-header h3 {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  color: #ffffff !important;
  font-size: 1.35rem !important;
}
.prose .bus-header p {
  margin: 0.2rem 0 0 !important;
  color: #ccfbf1 !important;
  font-weight: 700;
  font-size: 0.9rem;
}

.prose .route-section {
  position: relative;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.prose .route-line {
  position: absolute;
  left: 38px;
  top: 24px;
  bottom: 24px;
  width: 3px;
  background: #cbd5e1;
  z-index: 1;
}

.prose .stop,
.prose .parada-box {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.52rem 0.65rem;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 11px;
}

.prose .stop-id,
.prose .num-id {
  min-width: 40px;
  height: 26px;
  padding: 0 0.35rem;
  border-radius: 7px;
  background: #0f172a;
  color: #ffffff !important;
  font-size: 0.75rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prose .stop-info,
.prose .info-parada {
  flex: 1;
  min-width: 0;
}
.prose .stop-name,
.prose .nombre-p {
  display: block;
  font-weight: 800;
  color: #09111f;
  font-size: 0.92rem;
  line-height: 1.25;
}

.prose .badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.3rem;
}

.prose .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.44rem;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 850;
  color: #ffffff !important;
  background: #475569;
  line-height: 1.3;
}
.prose .badge.a { background: #e11d48; }
.prose .badge.b { background: #2563eb; }
.prose .badge.c { background: #16a34a; }
.prose .badge.d { background: #d97706; }
.prose .badge.e { background: #7c3aed; }
.prose .badge.f { background: #0891b2; }
.prose .badge.g { background: #db2777; }
.prose .badge.h { background: #4f46e5; }
.prose .badge.i { background: #059669; }
.prose .badge.j { background: #ea580c; }
.prose .badge.k { background: #0d9488; }
.prose .badge.l { background: #9333ea; }
.prose .badge.m { background: #b45309; }
.prose .badge.r { background: #0f766e; }
.prose .badge.p { background: #0284c7; }
.prose .badge.cn, .prose .badge.nt { background: #1e293b; }

/* Tarjetas de Horarios y Frecuencias (.day-card, .time-slot, .time-row, .destino-255a/b, .tabrow) */
.prose .day-card {
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-left: 5px solid #0d9488;
  border-radius: 14px;
  padding: 1rem 1.15rem;
  margin: 0.9rem 0;
  box-shadow: 0 6px 18px -8px rgba(9, 17, 31, 0.07);
}

.prose .day-label {
  display: inline-block;
  font-size: 0.92rem;
  font-weight: 850;
  color: #09111f;
  margin-bottom: 0.45rem;
}

.prose .freq-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.62rem;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #99f6e4;
  color: #065f46;
  font-size: 0.76rem;
  font-weight: 850;
  margin-left: 0.45rem;
}

.prose .time-slot,
.prose .time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.48rem 0.7rem;
  margin: 0.35rem 0;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 9px;
  font-size: 0.88rem;
}

.prose .time-blue,
.prose .hours {
  font-weight: 850;
  color: #0284c7;
  font-variant-numeric: tabular-nums;
}

.prose .destino-255a,
.prose .destino-255b {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.16rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
}
.prose .destino-255a { background: #dbeafe; color: #1e40af; }
.prose .destino-255b { background: #dcfce7; color: #166534; }

/* Rejillas antiguas .tabrow / .tabcol de horarios */
.prose .tabrow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
  margin: 1rem 0;
}
.prose .tabcol {
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
}

/* --- 3. INFOGRAFIAS HORARIAS AMPLIABLES Y ACORDEON DE NORMAS DEL VIAJERO --- */
.esm-sched-img-card {
  position: relative;
  margin: 1rem 0 1.5rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 0.65rem;
  box-shadow: 0 8px 24px -10px rgba(9, 17, 31, 0.1);
  cursor: zoom-in;
}
.esm-sched-img-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 0 !important;
}
.esm-sched-zoom-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.76rem;
  font-weight: 800;
  color: #0b6e66;
}

.esm-normas-details {
  margin: 2rem 0 1rem;
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  overflow: hidden;
}
.esm-normas-details summary {
  list-style: none;
  cursor: pointer;
  padding: 0.95rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 850;
  color: #09111f;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.esm-normas-details summary::-webkit-details-marker { display: none; }
.esm-normas-body {
  padding: 0.25rem 1.25rem 1.15rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.9rem;
}

/* Lightbox a pantalla completa para horarios en movil/escritorio */
.esm-bus-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(9, 17, 31, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  cursor: zoom-out;
}
.esm-bus-lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 10px;
  background: #ffffff;
}

@media (max-width: 940px) {
  .esm-lp-grid {
    grid-template-columns: 1fr;
  }
  .esm-lp-map-box {
    position: static;
  }
  .esm-lp-leaflet {
    height: 310px;
  }
  .esm-lp-thermometer {
    max-height: 350px;
  }
}

/* === FIX DE CONTRASTE MAXIMO EN CABECERA PRO DE LINEAS (.esm-lp-hero) === */
html body main .prose #esm-line-pro-hub .esm-lp-hero,
html body .prose #esm-line-pro-hub .esm-lp-hero {
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 16px 36px -12px rgba(7, 19, 36, 0.38) !important;
}

html body main .prose #esm-line-pro-hub .esm-lp-titles h2,
html body .prose #esm-line-pro-hub .esm-lp-hero h2 {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.38) !important;
  font-weight: 900 !important;
  letter-spacing: -0.02em !important;
}

html body main .prose #esm-line-pro-hub .esm-lp-sub,
html body .prose #esm-line-pro-hub .esm-lp-hero p.esm-lp-sub,
html body .prose #esm-line-pro-hub .esm-lp-hero .esm-lp-sub span {
  color: #f0fdfa !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.32) !important;
  font-weight: 750 !important;
  opacity: 1 !important;
}

html body main .prose #esm-line-pro-hub .esm-lp-code-box {
  background: rgba(7, 19, 36, 0.42) !important;
  border: 2px solid rgba(255, 255, 255, 0.65) !important;
  color: #ffffff !important;
}

html body main .prose #esm-line-pro-hub .esm-lp-code-lbl,
html body main .prose #esm-line-pro-hub .esm-lp-code-num {
  color: #ffffff !important;
}

html body main .prose #esm-line-pro-hub a.esm-lp-btn {
  background: #ffffff !important;
  border: 1px solid #ffffff !important;
  color: #09111f !important;
  font-weight: 850 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}
html body main .prose #esm-line-pro-hub a.esm-lp-btn:hover {
  background: #f0fdfa !important;
  color: #0b6e66 !important;
}

/* Seguridad extra: no mostrar nunca imagenes residuales dentro del cuerpo de /linea-* */
/* Ocultar imagenes antiguas del cuerpo SIN tocar jamas los mosaicos <img> de Leaflet */
body.esm-lp-hydrated main .prose img:not(.leaflet-tile):not(.leaflet-marker-icon):not(.leaflet-marker-shadow) {
  display: none !important;
}

/* Blindar mosaicos y controles de Leaflet dentro de .prose */
html body main .prose .leaflet-container img,
html body main .prose .leaflet-container img.leaflet-tile {
  display: block !important;
  max-width: none !important;
  max-height: none !important;
  width: 256px !important;
  height: 256px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* ==========================================================================
   TARJETAS COMPACTAS Y PESTAÑAS DE HORARIOS PRO (.esm-sched-pro-box)
   ========================================================================== */

/* 1. Ocultar el 100% de listados de paradas antiguos cuando el Termometro + Mapa PRO esta activo */
body.esm-lp-hydrated main .prose .route-section,
body.esm-lp-hydrated main .prose .route-container,
body.esm-lp-hydrated main .prose .itinerario-grid,
body.esm-lp-hydrated main .prose .bus-header,
body.esm-lp-hydrated main .prose .header-g {
  display: none !important;
}
body.esm-lp-hydrated main .prose .bus-card:not(:has(.day-card)):not(:has(.day-column)):not(:has(.day-box)):not(:has(.grid-container)):not(:has(.nt-grid)):not(:has(table)),
body.esm-lp-hydrated main .prose .blog-bus-container:not(:has(table)) {
  display: none !important;
}

/* 2. Contenedor principal compacto de Horarios PRO */
html body main .prose .esm-sched-pro-box {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 18px !important;
  padding: 1rem 1.15rem !important;
  margin: 1.25rem 0 1.6rem !important;
  box-shadow: 0 10px 26px -12px rgba(9, 17, 31, 0.1) !important;
}

.esm-sp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid #e2e8f0;
}

html body main .prose .esm-sp-title {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 1.08rem !important;
  font-weight: 900 !important;
  color: #09111f !important;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

/* Pestañas de temporada (Septiembre a Junio | Julio | Agosto / Invierno | Verano) */
.esm-sp-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 11px;
}

.esm-sp-tab {
  border: 0;
  background: transparent;
  color: #475569 !important;
  font-size: 0.77rem;
  font-weight: 800;
  padding: 0.36rem 0.76rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  transition: all 0.15s ease;
}
.esm-sp-tab:hover {
  color: #09111f !important;
}
.esm-sp-tab.is-active {
  background: #0f172a !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(9, 17, 31, 0.16);
}
.esm-sp-now-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #10b981;
  display: inline-block;
}

.esm-sp-pane {
  display: none;
}
.esm-sp-pane.is-active {
  display: block;
}

/* Rejilla de tarjetas por tipo de dia (Laborables | Sabados | Dom. y Fest.) */
.esm-sp-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 0.7rem;
  align-items: stretch;
}

.esm-sp-day-card {
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  border-top: 3px solid #0d9488;
  border-radius: 13px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.esm-sp-day-card.is-sat {
  border-top-color: #0284c7;
}
.esm-sp-day-card.is-sun {
  border-top-color: #d97706;
}

.esm-sp-day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding-bottom: 0.38rem;
  border-bottom: 1px dashed #cbd5e1;
}

.esm-sp-day-name {
  font-size: 0.88rem;
  font-weight: 900;
  color: #09111f !important;
}

.esm-sp-freq-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.52rem;
  border-radius: 999px;
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534 !important;
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

/* Filas compactas Cabecera -> Horario */
.esm-sp-rows {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.esm-sp-kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.34rem 0.58rem;
  font-size: 0.81rem;
}

.esm-sp-k {
  color: #334155 !important;
  font-weight: 750;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.esm-sp-v {
  color: #09111f !important;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  background: #f1f5f9;
  padding: 0.1rem 0.42rem;
  border-radius: 6px;
}

/* Pildoras compactas cuando hay listado de salidas puntuales (07:15, 08:30, 09:45...) */
.esm-sp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.1rem;
}

.esm-sp-time-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.46rem;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #09111f !important;
  font-size: 0.76rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.esm-sp-note-line {
  font-size: 0.77rem;
  color: #475569 !important;
  line-height: 1.35;
}

.esm-sp-footer-notes {
  margin-top: 0.75rem;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.77rem;
  color: #475569 !important;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* Tablas compactas limpias en lineas de pedanias (G, R4..R9) dentro de pestañas */
html body main .prose .esm-sched-pro-box .esm-table-scroll,
html body main .prose .esm-sp-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  margin: 0;
}

html body main .prose .esm-sp-table-wrap table {
  width: 100%;
  border-collapse: collapse !important;
  border: 0 !important;
  font-size: 0.81rem !important;
  margin: 0 !important;
}

html body main .prose .esm-sp-table-wrap table tr:first-child td,
html body main .prose .esm-sp-table-wrap table tr:first-child th {
  background: #0f172a !important;
  color: #ffffff !important;
  font-weight: 850 !important;
  font-size: 0.76rem !important;
  padding: 0.5rem 0.55rem !important;
  border: 0 !important;
  text-align: center !important;
}

html body main .prose .esm-sp-table-wrap table tr:first-child td strong {
  color: #ffffff !important;
}

html body main .prose .esm-sp-table-wrap table td,
html body main .prose .esm-sp-table-wrap table th {
  padding: 0.36rem 0.5rem !important;
  border: 1px solid #edf2f7 !important;
  text-align: center !important;
  font-variant-numeric: tabular-nums;
  color: #1e293b !important;
}

html body main .prose .esm-sp-table-wrap table td[colspan] {
  background: #ecfdf5 !important;
  color: #065f46 !important;
  font-weight: 850 !important;
  font-size: 0.78rem !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.42rem !important;
}

/* Rejilla compacta para Linea Nocturna (.nt-grid / .nt-location-box) y clases heredadas sin JS */
html body main .prose .nt-grid,
html body main .prose .grid-container,
html body main .prose .day-group {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.65rem;
  margin: 0.75rem 0;
}

html body main .prose .nt-location-box,
html body main .prose .day-column,
html body main .prose .day-box {
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  border-left: 4px solid #0d9488;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font-size: 0.84rem;
}

html body main .prose .location-name {
  display: block;
  font-weight: 850;
  color: #09111f;
  margin-bottom: 0.25rem;
}

@media (max-width: 640px) {
  html body main .prose .esm-sched-pro-box {
    padding: 0.82rem 0.85rem !important;
    border-radius: 15px !important;
  }
  .esm-sp-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }
  .esm-sp-day-card {
    padding: 0.62rem 0.72rem;
  }
}
