/**
 * Pulso de la comunidad — stacked bar + disclaimer.
 */
.mio-bias-pulse {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
  box-sizing: border-box;
}

body.dark-mode .mio-bias-pulse,
body.featured-topic-hub.dark-mode .mio-bias-pulse,
body.country-hub.dark-mode .mio-bias-pulse {
  background: #1a1c20;
  border-color: #3c4043;
}

.mio-bias-pulse__title {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #202124;
  line-height: 1.3;
}

body.dark-mode .mio-bias-pulse__title,
body.featured-topic-hub.dark-mode .mio-bias-pulse__title,
body.country-hub.dark-mode .mio-bias-pulse__title {
  color: #e8eaed;
}

.mio-bias-pulse__bar {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
  margin: 0 0 0.55rem;
}

body.dark-mode .mio-bias-pulse__bar {
  background: #3c4043;
}

.mio-bias-pulse__seg {
  height: 100%;
  min-width: 0;
  flex-shrink: 0;
}

.mio-bias-pulse__seg--izquierda { background: var(--bias-izquierda, #3b82f6); }
.mio-bias-pulse__seg--centro_izquierda { background: var(--bias-centro-izquierda, #6366f1); }
.mio-bias-pulse__seg--centro { background: var(--bias-centro, #8b5cf6); }
.mio-bias-pulse__seg--centro_derecha { background: var(--bias-centro-derecha, #f59e0b); }
.mio-bias-pulse__seg--derecha { background: var(--bias-derecha, #dc2626); }

.mio-bias-pulse__legend {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
}

body.dark-mode .mio-bias-pulse__legend {
  color: #9aa0a6;
}

.mio-bias-pulse__legend-item {
  white-space: nowrap;
}

.mio-bias-pulse__foot {
  margin: 0;
  font-size: 0.75rem;
  color: #5f6368;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

body.dark-mode .mio-bias-pulse__foot {
  color: #9aa0a6;
}

.mio-bias-pulse__how {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: #1565c0;
  font-size: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mio-bias-pulse__how:hover,
.mio-bias-pulse__how:focus-visible {
  color: #0d47a1;
  outline: none;
}

.mio-bias-pulse-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.mio-bias-pulse-modal.is-open {
  display: flex;
}

.mio-bias-pulse-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.mio-bias-pulse-modal__panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(80vh, 560px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

body.dark-mode .mio-bias-pulse-modal__panel {
  background: #202124;
  color: #e8eaed;
}

.mio-bias-pulse-modal__panel h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.mio-bias-pulse-modal__panel p {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #374151;
}

body.dark-mode .mio-bias-pulse-modal__panel p {
  color: #9aa0a6;
}

.mio-bias-pulse-modal__panel a {
  color: #1565c0;
  font-weight: 700;
}

.mio-bias-pulse-modal__close {
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: #1976d2;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}

.mio-bias-pulse-modal__close:hover {
  background: #1565c0;
}

@media (max-width: 640px) {
  .mio-bias-pulse__legend {
    flex-direction: column;
    gap: 0.2rem;
  }
}

/* Compact when nested in hub rails */
.hub-rail .mio-bias-pulse,
.art-rail .mio-bias-pulse {
  margin-bottom: 12px;
  padding: 0.75rem 0.85rem;
}
