/* metaWeather — frontend público. Estética Google. */

* { box-sizing: border-box; }

/* El atributo HTML `hidden` debería implicar display:none, pero cualquier
   regla CSS con `display: flex/grid/...` lo pisa por especificidad y
   deja el elemento visible (modal vacío "barra blanca" al cargar, etc.).
   Reset global: si hay `hidden`, oculta sí o sí. */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: #ffffff;
  color: #202124;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body { display: flex; flex-direction: column; min-height: 100vh; }

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 1.5rem 1rem 3rem;
}
#app.state-idle { justify-content: center; }
#app.state-results { justify-content: flex-start; padding-top: 1.5rem; }

.brand h1 {
  margin: 0 0 2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  color: #202124;
  text-align: center;
  transition: font-size 0.25s ease, margin 0.25s ease;
}
#app.state-results .brand h1 { font-size: 1.4rem; margin: 0 0 1rem; }
.brand h1 a {
  color: inherit; text-decoration: none;
  display: inline-block;
}
.brand h1 a:hover { opacity: 0.7; cursor: pointer; }

.brand .tagline {
  margin: -1.2rem auto 1.8rem;
  max-width: 560px;
  text-align: center;
  color: #5f6368;
  font-size: 0.92rem;
  line-height: 1.4;
}
#app.state-results .brand .tagline { display: none; }

.search { position: relative; width: 100%; max-width: 580px; }
.search input {
  width: 100%;
  height: 48px;
  padding: 0 1.25rem;
  font-size: 1.05rem;
  border: 1px solid #dfe1e5;
  border-radius: 24px;
  background: #fff;
  color: #202124;
  outline: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.search input:hover, .search input:focus {
  box-shadow: 0 1px 6px rgba(32,33,36,.12);
  border-color: rgba(223,225,229,0);
}
.search input::placeholder { color: #9aa0a6; }
/* Padding extra a la derecha del input para no chocar con el botón GPS. */
.search input { padding-right: 52px; }
/* Botón GPS sobre el lado derecho del input. */
.locate-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  color: #5f6368;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, color .12s ease;
}
.locate-btn:hover { background: #f1f3f4; color: #1a73e8; }
.locate-btn:focus { outline: 2px solid #1a73e8; outline-offset: 2px; }
.locate-btn[disabled] { opacity: 0.55; cursor: progress; }
.locate-btn svg { width: 20px; height: 20px; }
/* Spinner sutil cuando está cargando: rota el icono. */
.locate-btn.loading svg { animation: locate-spin 0.9s linear infinite; }
@keyframes locate-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  list-style: none; padding: 0.4rem 0; margin: 0;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(32,33,36,0.1);
  max-height: 320px; overflow-y: auto;
  z-index: 10;
}
.suggest li {
  padding: 0.55rem 1.1rem; cursor: pointer; font-size: 0.95rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.suggest li:hover, .suggest li.active { background: #f5f5f5; }
.suggest li .pin { width: 16px; height: 16px; flex: 0 0 16px; color: #9aa0a6; }
.suggest li .country { color: #5f6368; font-size: 0.85rem; margin-left: auto; }

.results { width: 100%; max-width: 760px; margin-top: 1.5rem; }

.block { margin-top: 1.8rem; }
.block-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin: 0 0 0.7rem;
}
.block h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5f6368;
  font-weight: 500;
  margin: 0;
}
.nav-arrows { display: flex; gap: 0.3rem; }
.nav-arrows button {
  width: 32px; height: 32px;
  border: 1px solid #e0e0e0; background: #fff; border-radius: 50%;
  cursor: pointer; color: #5f6368;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; font: inherit;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.nav-arrows button:hover:not(:disabled) { background: #f5f5f5; color: #202124; }
.nav-arrows button:disabled { opacity: 0.35; cursor: default; }
.nav-arrows button svg { width: 16px; height: 16px; }

/* ----- Eventos ----- */
.events { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.4rem; }
.event {
  display: flex; gap: 0.6rem; align-items: flex-start;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font-size: 0.93rem; line-height: 1.35;
  border: 1px solid transparent;
}
.event.rain        { background: #e8f0fe; color: #1967d2; border-color: #d2e3fc; }
.event.heavy_rain  { background: #fce8e6; color: #c5221f; border-color: #f6c2c0; }
.event.wind        { background: #fff8e1; color: #b06000; border-color: #ffe082; }
.event.heat        { background: #fce8e6; color: #c5221f; border-color: #f6c2c0; }
.event.cold        { background: #e8eaf6; color: #3949ab; border-color: #c5cae9; }
.event.swing       { background: #f3e8fd; color: #6a1b9a; border-color: #e0c4f4; }
.event .icon { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }

/* ----- Tarjeta actual ----- */
.current {
  margin-top: 1.4rem;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 16px;
  padding: 1.2rem 1.4rem;
}
.current .line-head {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.current .city {
  font-size: clamp(1.25rem, 4vw, 1.55rem);
  font-weight: 500; color: #202124;
}
.current .country { color: #5f6368; font-size: 0.95rem; }
.icon-btn {
  /* WCAG 2.5.5: 44 px es el AAA, 24 px el AA. Apple HIG y Material
     recomiendan 44. Subimos a 40 (compromiso con el header chico). */
  width: 40px; height: 40px;
  border: 1px solid #e0e0e0;
  background: #fff;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: #5f6368;
  transition: background 0.12s, color 0.12s;
}
.icon-btn:hover { background: #f5f5f5; color: #202124; }
.icon-btn svg { width: 16px; height: 16px; }
.save-btn { margin-left: auto; }
.save-btn[aria-pressed="true"] { color: #f4b400; border-color: #f4b400; }
.save-btn[aria-pressed="true"]:hover { color: #c98e00; }
.share-btn { margin-left: 0; }

/* Chips de ciudades guardadas — visibles sólo en estado idle. */
.saved-cities {
  width: 100%; max-width: 580px;
  margin-top: 0.75rem;
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  justify-content: center;
}
/* En estado de resultados, las ⭐ ciudades guardadas se muestran también
   justo debajo del input de búsqueda, pero compactas para no robar
   espacio al forecast. */
#app.state-results .saved-cities {
  margin-top: 0.5rem;
  margin-bottom: 0.3rem;
}
#app.state-results .saved-chip {
  font-size: 0.82rem;
  padding: 0.25rem 0.3rem 0.25rem 0.6rem;
}

/* "Avanzado" (toggle de detalle por fuente) sólo aplica si la sesión es
   admin. Para visitantes lo escondemos completamente. */
body:not(.is-admin) #toggle-advanced,
body:not(.is-admin) #toggle-advanced + .dot { display: none; }
.saved-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.35rem 0.35rem 0.7rem;
  border: 1px solid #e0e0e0;
  background: #fff;
  border-radius: 999px;
  color: #202124; font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.saved-chip:hover { background: #f5f5f5; border-color: #d0d0d0; }
.saved-chip-name { line-height: 1.2; }
.saved-chip-x {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #9aa0a6;
  border-radius: 50%;
  transition: background 0.12s, color 0.12s;
}
.saved-chip-x:hover { background: #ebebeb; color: #d93025; }
.saved-chip-x svg { width: 12px; height: 12px; }

/* ----- Modal de ayuda ----- */
.modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(32, 33, 36, 0.45);
  backdrop-filter: blur(2px);
}
.modal-body {
  position: relative;
  background: #fff;
  border-radius: 16px;
  /* Una sola columna de texto: 640 px es ancho cómodo para leer. */
  max-width: 640px; width: 100%;
  padding: 2rem 2rem 1.5rem;
  box-shadow: 0 12px 36px rgba(0,0,0,0.18);
}
.modal-close {
  position: absolute; top: 0.5rem; right: 0.8rem;
  width: 36px; height: 36px;
  border: none; background: transparent;
  font-size: 1.6rem; line-height: 1;
  color: #5f6368; cursor: pointer;
  border-radius: 50%;
}
.modal-close:hover { background: #f5f5f5; color: #202124; }
.modal-content {
  /* Una sola columna: el modal de ayuda muestra el contenido en el
     idioma activo (ES o EN según el toggle del footer), no los dos a la
     vez. El media-query antiguo de móvil ya no es necesario. */
  display: block;
}
.help-col { color: #202124; font-size: 0.92rem; line-height: 1.45; }
.help-col h2 { font-size: 1.2rem; margin: 0 0 0.5rem; }
.help-col h3 { font-size: 0.95rem; margin: 1rem 0 0.3rem; color: #5f6368; }
.help-col p { margin: 0.4rem 0; }
.help-col ul { margin: 0.4rem 0 0.6rem; padding-left: 1.2rem; }
.help-col li { margin: 0.2rem 0; }
@media (max-width: 700px) {
  .modal-body { padding: 1.4rem 1.2rem 1rem; }
}

.current .line-forecast {
  display: flex; align-items: center; gap: 1rem;
  margin-top: 0.2rem; margin-bottom: 0.9rem;
}
.current .line-forecast .icon-big { width: 56px; height: 56px; color: #5f6368; flex: 0 0 56px; }
.current .line-forecast .temp {
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  font-weight: 300; letter-spacing: -0.03em; line-height: 1; color: #202124;
}
.current .line-forecast .cond { color: #5f6368; font-size: 1rem; }

.current .meta {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1rem;
  color: #5f6368; font-size: 0.86rem;
  padding-top: 0.7rem; border-top: 1px solid #f1f3f4;
}
.current .meta .item { display: inline-flex; align-items: center; gap: 0.35rem; }
.current .meta .ico { width: 14px; height: 14px; color: #9aa0a6; }

.scores-row, .sources-row {
  margin-top: 0.7rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
}
.sources-row .label {
  font-size: 0.78rem; color: #5f6368; margin-right: 0.2rem;
}
.chip {
  display: inline-block;
  font-size: 0.74rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: #f1f3f4;
  color: #3c4043;
  border: 1px solid transparent;
}
.chip.wscore { background: #e6f4ea; color: #137333; font-weight: 600; }
.chip.wscore.low { background: #fce8e6; color: #c5221f; }
.chip.wscore.mid { background: #fff4d6; color: #b06000; }
.chip.location  { background: #e8f0fe; color: #1967d2; font-weight: 600; }
.chip.location.low { background: #fce8e6; color: #c5221f; }
.chip.location.mid { background: #fff4d6; color: #b06000; }

/* ----- Tarjetas día/hora unificadas -----
   Misma estructura para .day y .hour: cada celda ocupa siempre su hueco;
   si no hay dato la celda queda vacía pero conserva su línea. Esto
   alinea las tarjetas vertical y horizontalmente. */
.daily {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 0.5rem;
}
.hourly {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(0, 1fr);
  gap: 0.4rem;
}
.day, .hour {
  position: relative; overflow: hidden;
  background: #fff;
  border: 1px solid #ececec;        /* borde sutil, siempre gris claro */
  border-radius: 12px;
  padding: 0.65rem 0.4rem 0.55rem;
  display: flex; flex-direction: column; align-items: center;
  gap: 0.15rem;
  font-size: 0.82rem; min-width: 0;
  text-align: center;
}
/* El consenso ahora se indica COLOREANDO el badge ◉ XX% (la propia cifra),
   no el borde. Más elegante: el resto de la tarjeta se queda neutra y
   sólo el dato relevante se tiñe. Verde/ámbar/rojo según banda. */
.day.band-high .rel, .hour.band-high .rel { color: #137333; font-weight: 600; }
.day.band-mid  .rel, .hour.band-mid  .rel { color: #b06000; font-weight: 600; }
.day.band-low  .rel, .hour.band-low  .rel { color: #c5221f; font-weight: 600; }
.day.band-none .rel, .hour.band-none .rel { color: #9aa0a6; }
.day .name, .hour .name { color: #5f6368; font-size: 0.78rem; min-height: 1em; }
.day .name { font-size: 0.85rem; }
.day .date, .hour .date { color: #9aa0a6; font-size: 0.7rem; min-height: 0.9em; }
.day .cond-ico, .hour .cond-ico { display: inline-flex; }
.day .cond-ico .icon { width: 28px; height: 28px; color: #5f6368; }
.hour .cond-ico .icon { width: 22px; height: 22px; color: #5f6368; }
/* Etiqueta textual ("Lluvia", "Sol"...) bajo el icono — refuerza la
   silueta cuando se ve pequeña. */
.day .cond-label, .hour .cond-label {
  font-size: 0.7rem;
  color: #5f6368;
  line-height: 1.1;
  min-height: 0.9em;
  text-align: center;
  padding: 0 0.1rem;
}
.day .temps, .hour .temps {
  font-size: 0.96rem; color: #202124; font-weight: 500;
  min-height: 1.1em;
}
.day .temps .min { color: #9aa0a6; font-weight: 400; margin-left: 0.25rem; }
.day .pbar, .hour .pbar {
  position: relative; width: 80%; height: 4px;
  background: #f1f3f4; border-radius: 2px; overflow: hidden;
  margin-top: 0.1rem;
}
.day .pbar > span, .hour .pbar > span {
  position: absolute; left: 0; top: 0; height: 100%;
  background: #1a73e8;
}
.day .pp, .hour .pp {
  color: #1967d2; font-size: 0.68rem; min-height: 0.85em;
}
.day .mm, .hour .mm   { color: #1967d2; font-size: 0.7rem; min-height: 0.9em; }
.day .wind, .hour .wind { color: #5f6368; font-size: 0.7rem; min-height: 0.9em; }
.day .hum, .hour .hum { color: #9aa0a6; font-size: 0.66rem; min-height: 0.85em; }
.day .sun, .hour .sun { color: #c98e00; font-size: 0.66rem; min-height: 0.85em; }
.day .rel, .hour .rel {
  font-size: 0.66rem;
  color: #5f6368;
  margin-top: 0.05rem;
}

/* Rango P25-P75 al lado de la temperatura grande. */
.current .line-forecast .range {
  font-size: 0.9rem;
  color: #9aa0a6;
  margin-left: -0.2rem;
}

/* Frase corta tipo "abuela" sobre los días. */
.narrative {
  margin: 0 0 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.narrative-line {
  margin: 0;
  padding: 0.55rem 0.8rem;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 0.92rem;
  color: #3c4043;
  line-height: 1.35;
}

/* ----- Status ----- */
.status {
  text-align: center; color: #5f6368;
  margin-top: 2rem; font-size: 0.95rem;
}

/* ----- Footer ----- */
.footer {
  text-align: center;
  padding: 0.8rem 1rem 1rem;
  color: #9aa0a6;
  font-size: 0.78rem;
  background: #fff;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 0.1rem;
}
.footer a, .footer-btn {
  color: #5f6368; text-decoration: none;
  background: none; border: none; font: inherit;
  padding: 0.2rem 0.4rem;
  cursor: pointer; border-radius: 6px;
}
.footer a:hover, .footer-btn:hover { background: #f5f5f5; color: #202124; }
.footer .dot { margin: 0 0.1rem; color: #c0c0c0; }

/* ----- Banner de consentimiento de almacenamiento -----
   Se muestra al cargar si no hay decisión previa (mw_cookies en
   localStorage). Fijo abajo, no bloquea el resto de la UI; el usuario
   puede explorar la página antes de decidir. */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 9000;
  background: #202124;
  color: #f1f3f4;
  padding: 0.9rem 1.2rem 1rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  box-shadow: 0 -4px 14px rgba(0,0,0,0.12);
  font-size: 0.86rem; line-height: 1.45;
}
.cookie-title { font-size: 0.92rem; font-weight: 600; margin: 0; }
.cookie-text  { margin: 0; max-width: 64rem; }
.cookie-text strong { color: #fff; }
.cookie-text em { color: #c8e6c9; font-style: normal; }
.cookie-actions {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  margin-top: 0.3rem;
}
.cookie-btn {
  border: 1px solid transparent; padding: 0.45rem 1rem;
  border-radius: 8px;
  font: inherit; cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.cookie-accept { background: #137333; color: #fff; }
.cookie-accept:hover { background: #1b8c45; }
.cookie-reject {
  background: transparent; color: #f1f3f4;
  border-color: #5f6368;
}
.cookie-reject:hover { border-color: #f1f3f4; background: rgba(255,255,255,0.05); }

@media (min-width: 700px) {
  .cookie-banner {
    flex-direction: row; align-items: center;
    padding: 0.7rem 1.4rem;
    gap: 1rem;
  }
  .cookie-text-wrap { flex: 1; }
  .cookie-actions { margin-top: 0; flex-shrink: 0; }
}

/* ============================================================ */
/*  Responsive                                                  */
/* ============================================================ */
@media (max-width: 700px) {
  #app { padding: 1rem 0.7rem 2rem; }
  .results { margin-top: 1rem; }
  .current { padding: 1rem; border-radius: 14px; }
  .current .line-forecast { gap: 0.7rem; }
  .current .line-forecast .icon-big { width: 44px; height: 44px; flex: 0 0 44px; }
  .hourly { grid-template-columns: repeat(4, 1fr); gap: 0.3rem; }
  .hour { padding: 0.5rem 0.15rem 0.4rem; }
  .daily { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 0.35rem; }
  .day { padding: 0.6rem 0.35rem; }
  /* Touch target: 32 px sigue por debajo de 44 px pero las arrows están
     en una franja densa donde 44 px rompería el layout. Mantenemos 32 con
     icono centrado claramente clicable. */
  .nav-arrows button { width: 36px; height: 36px; }
}

@media (max-width: 380px) {
  .brand h1 { font-size: 2rem; margin: 0 0 1.2rem; }
  .current .meta { font-size: 0.8rem; gap: 0.3rem 0.7rem; }
  .hourly { grid-template-columns: repeat(3, 1fr); gap: 0.25rem; }
  .hour { padding: 0.45rem 0.1rem 0.35rem; }
  .hour .name { font-size: 0.72rem; }
  .hour .cond-ico .icon { width: 18px; height: 18px; }
  .hour .temps { font-size: 0.9rem; }
  .day .cond-ico .icon { width: 24px; height: 24px; }
  .chip { font-size: 0.7rem; padding: 0.15rem 0.45rem; }
  /* En el header de la ciudad las 3 burbujas (⭐ compartir ?) ocupan
     mucho con 40 px. Bajamos a 36 sin pasar de 36 para mantener algo
     usable a una mano. */
  .icon-btn { width: 36px; height: 36px; }
}

@media (prefers-color-scheme: dark) {
  html, body { background: #ffffff; color: #202124; }
}

/* ---------------------------------------------------------------------------
 * v0.9.34 — modal "show your work" (breakdown por fuente)
 *
 * Reutiliza patrón visual del .modal existente (help) pero con tabla densa.
 * Mobile-first: scroll horizontal si el viewport no llega.
 * ------------------------------------------------------------------------ */

/* slot-click: feedback visual (cursor + hover) — no rompe estilo existente */
.slot-click { cursor: pointer; transition: transform .08s ease, box-shadow .12s ease; }
.slot-click:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.slot-click:focus { outline: 2px solid #1a73e8; outline-offset: 2px; }
.slot-click:active { transform: translateY(0); }
/* La tarjeta de previsión actual también clickeable: efecto sutil porque
   es un bloque grande; sin elevación, sólo cambio leve de fondo. */
.line-forecast.current-click { cursor: pointer; border-radius: 12px; }
.line-forecast.current-click:hover { background: #f5f7fa; }
.line-forecast.current-click:focus { outline: 2px solid #1a73e8; outline-offset: 4px; }

#breakdown-modal .modal-body.breakdown-body {
  max-width: 720px;
  width: calc(100vw - 32px);
  /* En iOS Safari `100vh` incluye la URL bar oculta → puede haber salto al
     abrir el modal. `dvh` (dynamic viewport height) refleja el viewport
     real visible y previene desbordes. Fallback a `vh` para navegadores
     antiguos. */
  max-height: calc(100vh - 96px);
  max-height: calc(100dvh - 96px);
  padding: 0;                        /* el padding va por zonas */
  display: flex;
  flex-direction: column;
  overflow: hidden;                  /* el scroll va dentro de .bd-body */
}
#breakdown-modal .bd-partial {
  margin: 0 0 10px;
  padding: 8px 10px;
  background: #fff8e1;
  border-left: 3px solid #f9a825;
  border-radius: 4px;
  font-size: 0.82rem;
  color: #6d4c00;
}
/* Cabecera con título a izq + botón X a der + border-bottom. */
#breakdown-modal .bd-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #e8eaed;
  background: #fafbfc;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  flex: 0 0 auto;
}
#breakdown-modal .bd-header-text { flex: 1; min-width: 0; }
#breakdown-modal .bd-header .modal-close {
  position: static;                  /* anula el absolute heredado del modal */
  flex: 0 0 auto;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #5f6368;
  cursor: pointer;
  padding: 0 4px;
}
#breakdown-modal .bd-header .modal-close:hover { color: #202124; }
.bd-title { margin: 0 0 4px; font-size: 1.15rem; font-weight: 600; color: #202124; }
.bd-subtitle { margin: 0; }
/* Body scrollable entre cabecera y footer. */
#breakdown-modal .bd-body {
  padding: 14px 22px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
/* Footer fijado abajo con border-top. */
#breakdown-modal .bd-footer {
  padding: 12px 22px 16px;
  border-top: 1px solid #e8eaed;
  background: #fafbfc;
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
  flex: 0 0 auto;
}
#breakdown-modal .bd-footer p {
  margin: 0;
  font-size: 0.78rem;
  color: #5f6368;
  line-height: 1.4;
}
.bd-table-wrap { overflow-x: auto; }
.bd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.bd-table th, .bd-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #eee;
  text-align: left;
  vertical-align: middle;
}
.bd-table th {
  font-weight: 600;
  color: #5f6368;
  border-bottom-color: #ddd;
}
.bd-table td.num, .bd-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bd-table .src-name { white-space: nowrap; }
.bd-table .ensemble-row { background: #f1f8ff; }
.bd-table .ensemble-row td { border-bottom: 2px solid #d4e6ff; }
.bd-table .n { opacity: 0.55; font-size: 0.78rem; }
.bd-table .cond-ico-row .icon, .bd-table .cond-ico-row .ico-xs { width: 22px; height: 22px; }
@media (max-width: 480px) {
  .bd-table { font-size: 0.85rem; }
  .bd-table th, .bd-table td { padding: 6px 5px; }
  #breakdown-modal .bd-header,
  #breakdown-modal .bd-footer { padding-left: 16px; padding-right: 16px; }
  #breakdown-modal .bd-body { padding: 12px 14px; }
}
