.viable-project-sheet {
  padding: 0;
  margin-bottom: 2rem;
  margin-left: 2rem;
  background: #fff;
  border: 1px solid #ddd;
  border-left: 6px solid #ccc;
  float: right;
  width: 400px;
  max-width: 100%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Asegurar que las imágenes del contenido respeten el espacio del infobox */
.viable-post-content-wrapper {
  overflow: visible;
  margin-right: 0;
}

@media (max-width: 768px) {
  .viable-post-content-wrapper {
    margin-right: 0;
  }
}

.single-post .entry-content img,
.single-post .post-content img,
.single-post article img,
.single-project .entry-content img,
.single-project .post-content img,
.single-project article img,
.type-post img,
.type-project img,
.viable-post-content-wrapper img {
  max-width: 100%;
  height: auto;
}

.single-post .entry-content,
.single-post .post-content,
.single-post article,
.single-project .entry-content,
.single-project .post-content,
.single-project article {
  overflow: hidden;
}

.single-project .entry-content,
.single-project .post-content,
.single-project article,
.single-project .viable-post-content-wrapper {
  overflow: visible;
}

/* Prevenir que elementos anchos rompan el layout */
.single-post .entry-content > *,
.single-post .post-content > *,
.single-project .entry-content > *,
.single-project .post-content > *,
.viable-post-content-wrapper > * {
  max-width: 100%;
}

/* Asegurar que el contenido del post fluya alrededor del infobox */
.viable-post-content-wrapper {
  display: block;
}

@media (max-width: 768px) {
  .viable-project-sheet {
    float: none;
    width: 100%;
    margin-left: 0;
  }
}

.viable-project-sheet h2 {
  font-size: 1.3rem;
  margin: 0;
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-bottom: 2px solid #e9ecef;
}

.viable-project-sheet h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  padding: 0 1.5rem;
}

.viable-project-sheet img {
  width: 100%;
  height: auto;
  margin: 0;
  display: block;
}

.viable-project-sheet .project-summary {
  margin: 0;
  padding: 1rem 1.5rem;
  font-style: italic;
  color: #555;
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

.project-length {
  margin: 0;
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
  color: #666;
}

.project-info-box {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #eee;
}

.info-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.info-label {
  font-weight: 600;
  color: #666;
  flex-shrink: 0;
  margin-right: 1rem;
}

.info-value {
  color: #333;
  text-align: right;
}

.info-item-parent .info-value a {
  color: #0066cc;
  text-decoration: none;
}

.info-item-parent .info-value a:hover {
  text-decoration: underline;
}

.state-sequence {
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  font-size: 0.85rem;
}

.state-label {
  display: block;
  font-weight: 600;
  color: #666;
  margin-bottom: 0.75rem;
}

.state-current-view {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.state-full-view {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  position: relative;
}

.state-collapse {
  position: absolute;
  right: 0;
  top: -2px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  line-height: 1;
}

.state-collapse:hover {
  color: #666;
}

.state-arrow-left,
.state-arrow-right {
  cursor: pointer;
  color: #999;
  font-size: 1.2rem;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  transition: all 0.2s;
  user-select: none;
}

.state-arrow-left:hover,
.state-arrow-right:hover {
  background: #e9ecef;
  color: #666;
}

.state-step {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  background: #e9ecef;
  color: #999;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s;
}

.state-step-group {
  display: inline-flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.state-step-date {
  color: #5b5d5a;
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

.state-step.active {
  background: #d1e7dd;
  color: #0f5132;
}

.state-step.current {
  background: #198754;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
}

.state-arrow {
  margin: 0 0.3rem;
  color: #ccc;
  font-size: 0.9rem;
}

.state-since {
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #eee;
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

.tender-documents-box {
  padding: 1rem 1.5rem;
  background: #fff;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.tender-documents-box h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
}

.tender-documents-box p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.tender-documents-box a {
  color: #0066cc;
  text-decoration: underline;
}

.state-paralizado-alert {
  padding: 1rem 1.5rem;
  background: #fff3cd;
  border-top: 1px solid #ffecb5;
  border-bottom: 1px solid #ffecb5;
  color: #856404;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-icon {
  font-size: 1.5rem;
}

.state-paralizado-alert strong {
  color: #dc3545;
}

.paralizado-progress {
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
  color: #333;
}

.paralizado-progress-date {
  color: #666;
  font-size: 0.85rem;
}

.progress-bar-container {
  padding: 1rem 1.5rem;
  background: #fff;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.progress-bar-label {
  font-weight: 600;
  color: #198754;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.viable-timeline-rail {
  background: #e9ecef;
  height: 8px;
  border-radius: 4px;
  overflow: visible;
  width: 100%;
  float: none;
  position: relative;
}

.viable-timeline-fill {
  background: linear-gradient(90deg, #198754, #20c997);
  height: 100%;
  transition: width 0.3s ease;
  position: relative;
}

.progress-value-inside {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.progress-timeline-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timeline-bar {
  position: relative;
  height: 14px;
  overflow: visible;
  margin: 2.5rem 0 3.25rem;
}

.timeline-bar-with-dates {
  margin-top: 4.5rem;
}

/* Reserva espacio inferior según el nivel más bajo de etiquetas */
.timeline-bar-with-dates.timeline-bar-bottom-tier-1 {
  margin-bottom: 5.5rem;
}

.timeline-bar-with-dates.timeline-bar-bottom-tier-2 {
  margin-bottom: 7.25rem;
}

.timeline-bar-simple {
  margin: 0.25rem 0;
}

.timeline-point {
  position: absolute;
  top: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

.timeline-point::before {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d1d5db;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(31, 41, 55, 0.08);
}

.timeline-point-start::before,
.timeline-point-updated::before,
.timeline-point-planned::before,
.timeline-point-completion::before {
  background: #1d9e75;
}

.timeline-point-planned::before {
  background: #f59e0b;
}

.timeline-point-completion::before {
  background: #60a5fa;
}

.timeline-point.is-current::before {
  width: 18px;
  height: 18px;
  margin-left: -2px;
  margin-top: -2px;
  box-shadow: 0 0 0 6px rgba(29, 158, 117, 0.18);
}

.timeline-label-top-date,
.timeline-label-top-text,
.timeline-label-bottom-date,
.timeline-label-bottom-text {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  text-align: center;
}

.timeline-label-top-date,
.timeline-label-bottom-date {
  font-size: 0.74rem;
  color: #5b5d5a;
}

.timeline-label-top-text,
.timeline-label-bottom-text {
  font-size: 0.86rem;
  font-weight: 600;
  color: #141413;
}

.timeline-label-top-date {
  bottom: 2.15rem;
}

.timeline-label-top-text {
  bottom: 3.35rem;
}

.timeline-point-updated .timeline-label-top-date {
  bottom: 3.5rem;
}

.timeline-point-updated .timeline-label-top-text {
  bottom: 4.7rem;
}

.timeline-point-updated .timeline-dashed-line {
  height: 3rem;
}

.timeline-point-top.timeline-tier-1 .timeline-label-top-date {
  bottom: 3.2rem;
}

.timeline-point-top.timeline-tier-1 .timeline-label-top-text {
  bottom: 4.4rem;
}

.timeline-point-top.timeline-tier-1 .timeline-dashed-line {
  height: 2.7rem;
}

.timeline-point-top.timeline-tier-2 .timeline-label-top-date {
  bottom: 4.6rem;
}

.timeline-point-top.timeline-tier-2 .timeline-label-top-text {
  bottom: 5.8rem;
}

.timeline-point-top.timeline-tier-2 .timeline-dashed-line {
  height: 4rem;
}

.timeline-point-bottom.timeline-tier-1 .timeline-label-bottom-date {
  top: 2.6rem;
}

.timeline-point-bottom.timeline-tier-1 .timeline-label-bottom-text {
  top: 3.8rem;
}

.timeline-point-bottom.timeline-tier-2 .timeline-label-bottom-date {
  top: 4.4rem;
}

.timeline-point-bottom.timeline-tier-2 .timeline-label-bottom-text {
  top: 5.6rem;
}

.timeline-label-bottom-date {
  top: 1.2rem;
}

.timeline-label-bottom-text {
  top: 2.35rem;
}

.timeline-dashed-line {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  width: 1px;
  height: 1.7rem;
  border-left: 1px dashed rgba(31, 30, 29, 0.3);
  transform: translateX(-50%);
}

.children-projects-box {
  padding: 1rem 1.5rem;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  background: #fff;
}

.children-projects-box h4 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.children-projects-list {
  margin: 0;
  padding-left: 1rem;
}

.children-projects-list li {
  margin-bottom: 0.4rem;
}

.children-projects-list .child-meta {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.78rem;
  color: #6b7280;
}



/* Estados normales */
.state-proyecto {
  border-left-color: #9ca3af;
}

.state-en-licitacion {
  border-left-color: #f59e0b;
}

.state-adjudicado {
  border-left-color: #6366f1;
}

.state-en-obras {
  border-left-color: #10b981;
}

.state-finalizado {
  border-left-color: #3b82f6;
}

/* Estado especial */
.state-paralizado {
  border-left-color: #dc2626;
  background: #fff1f1;
}

.viable-project-description {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e9ecef;
}

.viable-project-description h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #333;
}

.viable-project-description h3 a {
  color: #0066cc;
  text-decoration: none;
}

.viable-project-description h3 a:hover {
  text-decoration: underline;
}

/* Multi-proyecto: secciones colapsables */
.viable-project-collapsible {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
}

.viable-project-collapsible + .viable-project-collapsible {
  border-top: 2px solid #e9ecef;
}

.project-desc-preview p:last-child {
  margin-bottom: 0.5rem;
}

/* Metadata de proyecto en listado multi-proyecto */
.project-collapsible-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0 0.75rem;
  font-size: 0.85rem;
}

.project-type-tag,
.project-length-tag,
.project-state-tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 3px;
  background: #e9ecef;
  color: #555;
  font-weight: 500;
}

.project-state-tag.state-tag-en-obras     { background: #d1ecf1; color: #0c5460; }
.project-state-tag.state-tag-adjudicado   { background: #fff3cd; color: #856404; }
.project-state-tag.state-tag-finalizado   { background: #d4edda; color: #155724; }
.project-state-tag.state-tag-paralizado   { background: #f8d7da; color: #721c24; }
.project-state-tag.state-tag-en-licitacion{ background: #e2d9f3; color: #4a2c7a; }

.viable-ver-mas-btn,
a.viable-ver-mas-btn {
  display: inline-block !important;
  background: none !important;
  border: none !important;
  color: #0066cc !important;
  font-size: 0.95rem !important;
  cursor: pointer !important;
  padding: 0.3rem 0 !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: color 0.15s;
  box-shadow: none !important;
}

.viable-ver-mas-btn:hover,
a.viable-ver-mas-btn:hover {
  color: #004a99 !important;
  text-decoration: underline !important;
}

/* Layout multi-proyecto: sin float lateral */
.viable-multi-project {
  margin-right: 0;
}

/* ── Listado de proyectos (shortcode list="true") ────────── */
.viable-project-list {
  margin-top: 1.5rem;
}

.viable-project-list-item {
  padding: 1rem 0;
  border-top: 1px solid #e9ecef;
}

.viable-project-list-item:first-child {
  border-top: none;
  padding-top: 0;
}

.project-list-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.project-list-title a {
  color: #0066cc;
  text-decoration: none;
}

.project-list-title a:hover {
  text-decoration: underline;
}

.project-list-desc {
  margin: 0 0 0.5rem;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.5;
}

.project-list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.project-list-last-post {
  color: #555;
}

.project-list-last-post a {
  color: #0066cc;
  text-decoration: none;
}

.project-list-last-post a:hover {
  text-decoration: underline;
}

.viable-list-empty {
  color: #999;
  font-style: italic;
  margin: 0.75rem 0;
}

/* ── Tender documents ────────────────────────────────── */
.viable-tender-documents {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e9ecef;
}

.viable-tender-documents h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #333;
}

.viable-map-single {
  border-top: 1px solid #eee;
  position: relative;
}

.viable-map-single .leaflet-popup-content {
  margin: 0.5rem;
  font-size: 0.9rem;
}

/* Botón expandir mapa */
.viable-map-expand-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 30px;
  height: 30px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: background 0.15s;
  color: #1f2937 !important;
  font-weight: 700;
}

.viable-map-expand-btn:hover {
  background: #fff;
  border-color: #999;
}

/* Modal mapa ampliado */
.viable-map-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viable-map-modal {
  position: relative;
  width: 96vw;
  height: 92vh;
  max-width: 1400px;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
}

.viable-map-modal-map {
  flex: 1;
  width: 100%;
}

.viable-map-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  transition: background 0.15s;
  color: #1f2937 !important;
  font-weight: 700;
}

.viable-map-modal-close:hover {
  background: #fff;
  border-color: #999;
}

@media (max-width: 600px) {
  .viable-map-modal {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
}

.related-posts-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 3px solid #e9ecef;
}

.single-project .related-posts-section {
  clear: both;
  width: 100%;
}

.viable-below-sheet-full-width {
  clear: both;
  width: 100%;
  display: block;
  overflow: visible;
}

.single-project .related-posts-list {
  width: 100%;
}

.single-project .viable-post-content-wrapper {
  margin-right: 0;
  width: 100%;
}

.related-posts-section h3 {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  color: #333;
}

.related-posts-list {
  display: grid;
  gap: 1.5rem;
}

.related-post-item {
  padding: 1.5rem;
  background: #f8f9fa;
  border-left: 4px solid #0066cc;
  border-radius: 4px;
  transition: all 0.2s;
}

.related-post-item:hover {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.related-post-item h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
}

.related-post-item h4 a {
  color: #0066cc;
  text-decoration: none;
}

.related-post-item h4 a:hover {
  color: #0052a3;
  text-decoration: underline;
}

.related-post-item .post-date {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.75rem;
  font-style: italic;
}

.related-post-item .post-excerpt {
  color: #555;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Category page layout */
.viable-category-listings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .viable-category-listings {
    grid-template-columns: 1fr;
  }
}

.viable-category-column h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #0073aa;
  color: #333;
}

.viable-category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.viable-category-list li {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.viable-category-list li:last-child {
  border-bottom: none;
}

.viable-category-list a {
  color: #0073aa;
  text-decoration: none;
  font-size: 1rem;
  line-height: 1.5;
  display: block;
}

.viable-category-list a:hover {
  color: #005177;
  text-decoration: underline;
}

.viable-posts-column h3 {
  border-bottom-color: #0073aa;
}

.viable-projects-column h3 {
  border-bottom-color: #00a32a;
}

/* ============================================================
   [viable_map] – Mapa universal (shortcode)
   ============================================================ */

.viable-map-universal {
  position: relative;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.popup-parent-link {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.85rem;
}

.viable-map-universal.viable-map-empty::after {
  content: 'No hay datos de trazado para los filtros seleccionados';
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.85);
  z-index: 800;
  color: #999;
  font-size: 0.95rem;
  pointer-events: none;
}

/* ── Leyenda ──────────────────────────────────────────────── */
.viable-map-legend {
  background: rgba(255,255,255,0.95);
  padding: 0.35rem 0.45rem;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  font-size: 0.74rem;
  line-height: 1.3;
  width: 260px;
  max-width: 60vw;
  color: #1f2937 !important;
  font-family: inherit !important;
}

.viable-map-legend strong {
  display: inline-block;
  font-size: 0.78rem;
  color: #111827 !important;
}

.viable-map-legend * {
  color: #1f2937;
}

.legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.legend-toggle {
  border: 1px solid #ced4da;
  background: #fff;
  border-radius: 3px;
  width: 22px;
  height: 22px;
  line-height: 1;
  cursor: pointer;
  color: #111827 !important;
  font-size: 0.95rem;
  font-weight: 700;
}

.legend-body {
  display: block;
}

.legend-list {
  max-height: 210px;
  overflow-y: auto;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-item-btn {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.15rem 0.2rem;
  text-align: left;
  cursor: pointer;
  border-radius: 3px;
  color: #1f2937 !important;
  font-size: 0.74rem;
}

.legend-item-btn:hover {
  background: #f3f6f9;
}

.legend-item-text {
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1f2937 !important;
}

.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.15);
}

.legend-pager {
  margin-top: 0.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
}

.legend-page-btn {
  border: 1px solid #ced4da;
  background: #fff;
  border-radius: 3px;
  min-width: 24px;
  height: 22px;
  line-height: 1;
  cursor: pointer;
  color: #111827 !important;
  font-size: 0.95rem;
  font-weight: 700;
}

.legend-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.legend-page-status {
  font-size: 0.72rem;
  color: #374151 !important;
}

/* ── Panel de filtros (multi-select dropdown) ────────────── */
.viable-map-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  margin-bottom: 0;
}

.viable-map-filters + .viable-map-universal {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.viable-map-filters .filter-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 220px;
}

.viable-map-filters .filter-group-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.1rem;
}

.multiselect-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  height: 36px;
  padding: 0 0.7rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  color: #333;
  font-size: 0.9rem;
}

.multiselect-trigger:focus,
.multiselect-trigger:focus-visible {
  outline: none;
  border-color: #0073aa;
  box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.multiselect-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.multiselect-arrow {
  font-size: 0.75rem;
  color: #666;
}

.multiselect-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: max(100%, 360px);
  max-width: min(560px, 92vw);
  border: 1px solid #ced4da;
  border-radius: 6px;
  background: #fff;
  z-index: 1001;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}

.multiselect-dropdown.multiselect-open {
  display: block;
}

.multiselect-search {
  width: calc(100% - 1rem);
  margin: 0.45rem;
  padding: 0.32rem 0.45rem;
  border: 1px solid #d8dde3;
  border-radius: 4px;
  font-size: 0.82rem;
}

.multiselect-options {
  max-height: 240px;
  overflow-y: auto;
  padding: 0.1rem 0 0.25rem;
  background: #fff;
}

.multiselect-option {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  line-height: 1.2;
  color: #333;
  cursor: pointer;
  background: #fff;
  white-space: nowrap;
}

.multiselect-option:hover {
  background: #f4f7fa;
}

.multiselect-option input[type=checkbox] {
  margin: 0;
  accent-color: #0073aa;
  flex: 0 0 auto;
}

.multiselect-option-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Filtros dentro del modal */
.viable-map-modal-filters {
  padding: 0.6rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}

.viable-map-modal-filters .viable-map-filters {
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  gap: 1.5rem;
}

@media (max-width: 600px) {
  .viable-map-filters {
    flex-direction: column;
  }
}


/* Control de opacidad de planos (PMTiles) */
.viable-planos-opacity {
  background: rgba(255, 255, 255, 0.92);
  padding: 4px 8px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  font-size: 0.75rem;
  line-height: 1.2;
}
.viable-planos-opacity label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  cursor: default;
}
.viable-planos-opacity input[type="range"] {
  width: 90px;
  margin: 0;
}
.viable-planos-opacity-value {
  min-width: 2.6em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Leyenda de estados de tramo */
.viable-segment-legend {
  background: rgba(255, 255, 255, 0.92);
  padding: 4px 8px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  font-size: 0.72rem;
  line-height: 1.5;
}
.viable-segment-legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
