:root {
  color-scheme: light;
  --surface-0: #f4f3f0;
  --surface-1: #fcfcfb;
  --surface-2: #efeeea;
  --border:     #dedcd6;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #76746e;
  --series-1:  #2a78d6;
  --series-1-soft: #cde2fb;
  --grid:      #e6e4de;
  --good:      #1b7f4b;
  --bad:       #b3261e;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface-1); padding: 8px 12px; z-index: 10; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }

/* ---------- cabecera ---------- */
/* Dos filas con aire: arriba la marca y la firma, abajo el titular con el estado
   y el compartir a su derecha. Antes iba todo apretujado en dos líneas y el
   subtítulo peleaba con el título por el mismo renglón. */
.top { background: var(--surface-1); border-bottom: 1px solid var(--border); padding: 16px 0 24px; }
.fila-marca {
  display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; justify-content: space-between;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.fila-titulo {
  display: flex; flex-wrap: wrap; gap: 18px 36px;
  align-items: flex-end; justify-content: space-between; margin-top: 20px;
}
.titular { flex: 1 1 420px; min-width: 0; }
.creditos { margin: 0; font-size: 12.5px; color: var(--text-muted); }
.creditos a { color: var(--text-secondary); text-decoration: none; border-bottom: 1px solid var(--border); }
.creditos a:hover { color: var(--text-primary); border-bottom-color: currentColor; }
.sep { margin: 0 6px; color: var(--border); }
/* En las fichas la fila de arriba solo lleva la marca y el volver: sin raya, que
   no hay nada debajo de lo que separarla. */
.fila-marca-sola { padding-bottom: 0; border-bottom: 0; }
.marca { display: flex; align-items: center; gap: 7px; text-decoration: none; }
.marca:hover .marca-txt { color: var(--text-primary); }
h1 a { color: inherit; text-decoration: none; }
h1 a:hover .en-x { background: var(--series-1); }
.logo-x { width: 15px; height: 15px; fill: var(--text-primary); flex: none; }
.marca-txt { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); font-weight: 650; }
.marca-sep { font-weight: 400; text-transform: none; letter-spacing: 0; }
h1 { margin: 0; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.1; letter-spacing: -0.028em; }
.en-x { display: inline-block; background: #000; color: #fff; border-radius: 6px; padding: 0 .26em; }
.sub { margin: 10px 0 0; color: var(--text-secondary); font-size: 13.5px; line-height: 1.5; max-width: 62ch; }
.sub br { display: block; }
/* El estado y el compartir, en columna y pegados a la derecha, a la altura de la
   última línea del subtítulo. */
.cabecera-acciones { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.refresh { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.refresh strong { color: var(--text-secondary); }
@media (max-width: 640px) {
  .fila-titulo { align-items: flex-start; }
  .cabecera-acciones { align-items: flex-start; width: 100%; }
}

/* ---------- menú ---------- */
.menu {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--surface-1) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid var(--border);
}
.menu-fila {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding-top: 7px; padding-bottom: 7px;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
@media (min-width: 900px) { .menu-fila { -webkit-mask-image: none; mask-image: none; } }
.menu-fila::-webkit-scrollbar { display: none; }
.menu a {
  flex: none; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 550;
  color: var(--text-muted); text-decoration: none; white-space: nowrap;
  transition: background .12s, color .12s;
}
.menu a:hover { color: var(--text-primary); background: var(--surface-2); }
.menu a[aria-current="true"] { color: var(--surface-1); background: var(--text-primary); font-weight: 600; }
/* Para que el ancla no quede debajo del menú pegajoso. */
.card, .marcador, .tiles, [id^="h-"] { scroll-margin-top: 66px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 color-mix(in oklab, var(--good) 60%, transparent); animation: pulse 2.4s ease-out infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

main { padding: 22px 0 8px; display: grid; gap: 18px; }
main > *, .card, .figure, .table-wrap, .grid > *, .tweets > *, .tweet-head, .tweet-metrics { min-width: 0; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.tile[data-glosario] { cursor: help; }
.tile-k { display: block; font-size: clamp(22px, 3vw, 30px); font-weight: 650; letter-spacing: -0.02em; }
/* Una caja cuyo dato es un nombre y no un número: el tamaño de cifra no cabe. */
.tile-k-txt { font-size: clamp(15px, 1.8vw, 18px); line-height: 1.2; letter-spacing: -0.01em; }
.tile-l { display: block; font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ---------- marcador ---------- */
.marcador { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.caja {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; cursor: help;
}
.caja-tit { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); font-weight: 650; }
.lider { display: flex; align-items: center; gap: 11px; }
.lider-txt { min-width: 0; flex: 1; }
.lider-nombre { display: block; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lider-cargo { display: block; font-size: 12px; color: var(--text-muted); }
.lider-cifra { display: block; font-size: 13px; color: var(--text-secondary); }
.lider-cifra strong { color: var(--text-primary); font-weight: 650; }
.caja-pie { margin: auto 0 0; font-size: 12.5px; color: var(--text-secondary); }
.caja-pie strong { color: var(--good); }
.caja-reloj { cursor: default; }
.reloj { display: flex; align-items: baseline; gap: 8px; }
.reloj-num { font-size: 34px; font-weight: 750; letter-spacing: -0.03em; line-height: 1; }
.reloj-txt { font-size: 13px; color: var(--text-secondary); }
.linea { position: relative; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.linea-campana { position: absolute; top: 0; bottom: 0; background: color-mix(in oklab, var(--series-1) 30%, transparent); }
.linea-hoy { position: absolute; top: -2px; bottom: -2px; width: 3px; border-radius: 2px; background: var(--text-primary); }

/* ---------- movimiento en la clasificación ---------- */
.mov {
  font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px; cursor: help;
  white-space: nowrap; flex: none;
}
.mov-up { color: #0f6b3d; background: #d8f0e2; }
.mov-down { color: #9d1f17; background: #fadedc; }
.mov-flat { color: var(--text-muted); background: var(--surface-2); }
.mov-new { color: #6a4a00; background: #fbecc4; }

/* ---------- tarjetas ---------- */
/* Nada de overflow:hidden aquí: tapaba un desbordamiento real en móvil en vez de
   arreglarlo. Lo que hace falta es que los hijos puedan encogerse. */
.card { position: relative; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card-head { display: flex; flex-wrap: wrap; gap: 12px 16px; justify-content: space-between; align-items: flex-start; }
.controles { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
/* La columna derecha de la cabecera, con los filtros. */
.cabecera-der { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
/* Compartir va clavado en la esquina del marco de la tarjeta, no en la fila de
   filtros: ahí se perdía entre las píldoras y nadie lo encontraba. */
.compartir-esquina { position: absolute; top: 16px; right: 16px; z-index: 3; }
.card:has(.compartir-esquina) .card-head > div:first-child { padding-right: 285px; }
/* Por debajo de 900 no cabe al lado del titular: baja al flujo, encima de los filtros. */
@media (max-width: 900px) {
  .compartir-esquina { position: static; margin-bottom: 12px; }
  .card:has(.compartir-esquina) .card-head > div:first-child { padding-right: 0; }
  .cabecera-der { align-items: flex-start; width: 100%; }
}
h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.015em; }
/* Un enlace discreto al lado del titular, que no compita con él. */
.ver-todos {
  margin-left: 10px; font-size: 13px; font-weight: 600; letter-spacing: 0;
  color: var(--series-1); text-decoration: none; white-space: nowrap; vertical-align: 1px;
}
.ver-todos:hover { text-decoration: underline; }
.sub-h { margin: 20px 0 8px; font-size: 14.5px; letter-spacing: -0.01em; }
.sub-h[data-glosario] { cursor: help; }
.note { margin: 0 0 4px; font-size: 13.5px; color: var(--text-secondary); max-width: 74ch; }
.warn { color: var(--bad); font-size: 13.5px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }

/* ---------- conmutadores ---------- */
.metric-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.metric-switch button {
  background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.metric-switch button:hover { color: var(--text-primary); background: var(--border); }
.metric-switch button[aria-pressed="true"] { background: var(--series-1); border-color: var(--series-1); color: #fff; }
.modo-switch { display: flex; align-items: center; gap: 8px; }
.modo-etq { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }

/* ---------- ayuda ---------- */
.ayuda {
  display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 5px;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
  font-size: 10px; font-weight: 700; font-style: italic; cursor: help; vertical-align: 1px; flex: none;
}
.ayuda:hover, .ayuda:focus-visible { border-color: var(--text-muted); color: var(--text-primary); }
/* El desplegable de "ver como", que antes eran cuatro píldoras. */
.modo-select {
  font: inherit; font-size: 13px; font-weight: 550; color: var(--text-primary);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 28px 5px 13px; cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.modo-select:hover { background-color: var(--border); }

/* ---------- avatares ---------- */
.avatar {
  flex: none; display: inline-grid; place-items: center; overflow: hidden;
  border-radius: 50%; background: var(--surface-2);
  box-shadow: 0 0 0 2px var(--borde, var(--border));
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-sm { width: 22px; height: 22px; }
.avatar-md { width: 42px; height: 42px; }
.avatar-ini { font-size: 9px; font-weight: 700; color: var(--text-secondary); }
.avatar-md .avatar-ini { font-size: 15px; }

/* ---------- barras ---------- */
/* La rejilla vive en la lista, no en cada fila: así todas las filas comparten el
   ancho de columna y los finales de barra quedan rectos. Antes cada fila era su
   propia rejilla y el ancho de la cifra variaba de una a otra. */
.bars {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 7px;
  /* En una variable porque la carrera saca las filas del flujo y pierde el subgrid:
     se la pone a cada fila y así las columnas siguen siendo las mismas y siguen
     siendo fluidas, sin copiar píxeles. Un solo sitio donde cambiarlas. */
  --cols: 20px minmax(100px, 200px) 1fr max-content;
  grid-template-columns: var(--cols);
}
.bar-row { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; gap: 10px; align-items: center; }
@supports not (grid-template-columns: subgrid) {
  .bars { display: block; }
  .bar-row { grid-template-columns: 20px minmax(100px, 200px) 1fr 10ch; margin-bottom: 7px; }
}
/* Todas las posiciones ocupan la misma caja aunque solo las tres primeras lleven
   medalla. Si no, el 4 en adelante bailaba respecto al 1, 2 y 3. */
.bar-pos {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  font-size: 11.5px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.podio .bar-pos { color: #3b2d00; }
.podio-1 .bar-pos { background: #f3cc4d; }
.podio-2 .bar-pos { background: #d8d8d2; }
.podio-3 .bar-pos { background: #e0b183; }
.bar-row:not(.podio) .bar-fill { opacity: .72; }
.bar-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; }
.bar-name-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--surface-2); border-radius: 4px; height: 20px; min-width: 0; }
.bar-fill { display: block; height: 100%; border-radius: 4px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
@media (prefers-reduced-motion: reduce) { .bar-fill { transition: none; } }
.bar-value { font-size: 12.5px; color: var(--text-secondary); min-width: 5ch; text-align: right; }
.bar-row:hover .bar-track { background: var(--border); }
.figure { margin: 18px 0 0; }
.figure + .table-toggle, .figure + .sub-h { margin-top: 30px; }
/* El pie pegado a la última barra se leía como parte del gráfico. Con `.figure`
   delante porque si no gana `.note`, que casi todos los pies la llevan. */
.figure figcaption, figcaption { margin-top: 30px; }

/* ---------- pequeños múltiplos ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; margin-top: 14px; }
.spark { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.spark-head { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.spark-quien { display: flex; gap: 8px; align-items: center; min-width: 0; }
.spark-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spark-party { font-size: 11.5px; color: var(--text-muted); }
.spark-cifra { text-align: right; }
.spark-now { font-size: 15px; font-weight: 650; }
.spark-delta { font-size: 12.5px; }
.up { color: var(--good); } .down { color: var(--bad); } .flat { color: var(--text-muted); }
svg { display: block; max-width: 100%; height: auto; }
.axis-line { stroke: var(--grid); stroke-width: 1; }
.spark-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
/* El tramo anterior a que la cuenta entrara: se dibuja para que la tarjeta no
   quede coja, pero de puntos, porque ahí no hay medición. */
.spark-sindatos { stroke-dasharray: 3 3; opacity: .45; }
.spark-area { fill: var(--series-1-soft); opacity: .5; }
.spark-dot { fill: var(--series-1); stroke: var(--surface-2); stroke-width: 2; }

/* ---------- tweets ---------- */
.tweets { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.tweet {
  position: relative; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px;
  cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s;
}
.tweet:hover { border-color: var(--text-muted); box-shadow: 0 6px 20px rgb(0 0 0 / .07); transform: translateY(-1px); }
.tweet-rank {
  position: absolute; top: -8px; left: -8px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--text-primary); color: var(--surface-1); display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}
.tweet-head { display: flex; align-items: center; gap: 10px; }
.tweet-quien { min-width: 0; flex: 1; }
.tweet-nombre { display: block; font-weight: 650; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tweet-alias { display: block; font-size: 12.5px; color: var(--text-muted); }
.tweet-partido {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 12ch; flex: none;
  background: color-mix(in oklab, var(--c) 14%, transparent);
  color: color-mix(in oklab, var(--c) 72%, #000); border: 1px solid color-mix(in oklab, var(--c) 30%, transparent);
}
.tweet-at { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.tweet-text { margin: 0; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }

.media { border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; gap: 2px; }
.media-2 { grid-template-columns: 1fr 1fr; }
.media-3, .media-4 { grid-template-columns: 1fr 1fr; }
.media-img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.media-2 .media-img, .media-3 .media-img, .media-4 .media-img { max-height: 150px; }
/* X responde 403 a un <video> de otro dominio, así que el vídeo se enseña como
   portada con botón de play y se abre en X. */
.media-v { position: relative; }
.media-v .media-img { max-height: 320px; }
.play {
  position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%;
  background: rgb(0 0 0 / .62); backdrop-filter: blur(2px); border: 2px solid rgb(255 255 255 / .9);
  display: grid; place-items: center; transition: transform .14s, background .14s;
}
.play::after { content: ''; border-left: 17px solid #fff; border-top: 10px solid transparent; border-bottom: 10px solid transparent; margin-left: 5px; }
.tweet:hover .play { transform: scale(1.08); background: rgb(0 0 0 / .78); }
.media-etq {
  position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 600; color: #fff;
  background: rgb(0 0 0 / .66); padding: 2px 7px; border-radius: 5px;
}

.tweet-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.chip-m {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; cursor: help;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 999px; padding: 2px 9px;
  color: var(--text-secondary);
}
.chip-m strong { color: var(--text-primary); font-weight: 650; }
.chip-ico { font-size: 11px; opacity: .75; }
.chip-top { background: color-mix(in oklab, var(--series-1) 12%, transparent); border-color: color-mix(in oklab, var(--series-1) 35%, transparent); }
.chip-eng { margin-left: auto; flex: none; }

/* ---------- tablas ---------- */
.table-toggle { margin-top: 22px; }
.table-toggle summary { cursor: pointer; font-size: 13.5px; color: var(--text-secondary); }
.table-wrap { overflow-x: auto; margin-top: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface-1); }
thead th { color: var(--text-secondary); font-weight: 600; border-bottom: 1px solid var(--grid); cursor: pointer; user-select: none; }
thead th[aria-sort] { color: var(--text-primary); }
tbody tr:hover td, tbody tr:hover td:first-child { background: var(--surface-2); }
.celda-cuenta { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- tooltip ---------- */
.tooltip {
  position: fixed; pointer-events: none; opacity: 0; transform: translate(-50%, -112%);
  background: var(--text-primary); color: var(--surface-1); padding: 8px 11px; border-radius: 7px;
  font-size: 12.5px; line-height: 1.45; max-width: 300px; z-index: 50; transition: opacity .09s;
}
.tooltip[data-show="1"] { opacity: 1; }

.foot { padding: 22px 16px 40px; color: var(--text-muted); font-size: 13px; }
.foot p { margin: 2px 0; }
.firma { font-size: 14.5px; color: var(--text-secondary); margin-bottom: 8px !important; }
.firma a { color: var(--text-primary); font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--series-1); padding-bottom: 1px; }
.firma a:hover { color: var(--series-1); }
.method p { margin: 0 0 10px; font-size: 14px; color: var(--text-secondary); max-width: 80ch; }
.method strong { color: var(--text-primary); }

@media (max-width: 560px) {
  .card { padding: 16px 14px; }
  th, td { padding: 6px 8px; }
  .bars { --cols: 20px minmax(72px, 36%) 1fr max-content; }
  .bar-row { gap: 7px; }
  .bar-name { font-size: 12.5px; }
  .tweets { grid-template-columns: 1fr; }
}

/* ---------- enlaces a las fichas ---------- */
.enlace-ficha { color: inherit; text-decoration: none; }
.enlace-ficha:hover { color: var(--series-1); text-decoration: underline; text-underline-offset: 2px; }
a.lider { display: flex; }
a.spark-quien { text-decoration: none; color: inherit; }
.bar-name-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- ficha individual ---------- */
.volver {
  color: var(--text-secondary); text-decoration: none; font-size: 13px;
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; background: var(--surface-2);
}
.volver:hover { color: var(--text-primary); background: var(--border); }
.volver-pie { max-width: 1120px; margin: 4px auto 0; padding: 0 16px; }
.volver-grande { display: inline-block; font-size: 14px; padding: 9px 18px; }
.tweet-autor { display: inline-flex; text-decoration: none; }
a.tweet-nombre { display: block; }
.ficha { padding-top: 18px; }
.perfil-fila { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.avatar-xl { width: 76px; height: 76px; }
.avatar-xl .avatar-ini { font-size: 26px; }
.perfil-txt { flex: 1; min-width: 0; }
.perfil-nombre { margin: 0 0 4px; font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -0.025em; line-height: 1.1; }
.perfil-sub { margin: 0; font-size: 14px; color: var(--text-secondary); }
.perfil-sub a { color: var(--text-primary); text-decoration: none; border-bottom: 1px solid var(--border); }
.perfil-sub a:hover { color: var(--series-1); }
.perfil-handle { font-weight: 600; }
.perfil-puesto { text-align: center; padding: 8px 18px; border-left: 1px solid var(--border); }
.puesto-num { display: block; font-size: 34px; font-weight: 750; letter-spacing: -0.03em; line-height: 1; }
.puesto-txt { display: block; font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* columnas por día */
.cols { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-end; gap: 4px; min-height: 190px; }
.col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: help; }
.col-marca { font-size: 11px; color: var(--series-1); line-height: 1; }
.col-valor { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }
.col-barra { width: 100%; max-width: 54px; height: 140px; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.col-rell { width: 100%; border-radius: 4px; transition: height .5s cubic-bezier(.2,.8,.2,1); }
@media (prefers-reduced-motion: reduce) { .col-rell { transition: none; } }
.col-dia { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }
.col:hover .col-barra { background: var(--border); }

/* fichas enlazadas dentro de una ficha */
.mini { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: inherit; }
.mini:hover { border-color: var(--text-muted); }
.mini-txt { min-width: 0; }
.mini-nombre { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-dato { display: block; font-size: 11.5px; color: var(--text-muted); }

.tweet-head-solo { gap: 8px; }
.mas { margin: 14px 0 0; text-align: center; }
.boton { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 8px 18px; font-size: 13.5px; font-family: inherit; color: var(--text-secondary); cursor: pointer; }
.boton:hover { background: var(--border); color: var(--text-primary); }
.boton-limpiar { flex: none; }

/* ---------- la carrera de barras ---------- */
/* No es otra vista: es el mismo gráfico del ranking, con sus puestos, sus avatares
   y sus anchos, al que solo se le mueven las filas. Por eso aquí no se pinta nada
   nuevo, solo se saca del flujo lo que ya estaba. */
.carrera-mandos { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 4px 0 14px; }
/* Todo en la misma fila que el botón. Con la barra en su propia línea, la lista
   se iba hacia abajo y quedaba un hueco raro entre los mandos y las barras. */
.nota-carrera { display: flex; align-items: center; gap: 10px 14px; flex: 1 1 320px; margin: 0; min-width: 0; }
.boton-play { font-weight: 650; min-width: 150px; background: var(--text-primary); color: var(--surface-1); border-color: var(--text-primary); }
.boton-play:hover:not(:disabled) { background: #000; color: #fff; }
.boton-play:disabled { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); cursor: not-allowed; }
.carrera-reloj { flex: none; font-size: 14.5px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nota-detalle { flex: none; font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
@media (max-width: 720px) { .nota-detalle { display: none; } }
.carrera-barra { flex: 1 1 110px; min-width: 70px; accent-color: var(--series-1); cursor: pointer; margin: 0; }
.bars.corriendo { position: relative; display: block; }
.bars.corriendo .bar-row { position: absolute; left: 0; right: 0; top: 0; grid-template-columns: var(--cols); will-change: transform; }
/* La columna de la cifra es max-content: sin fijarla, cambiaba de ancho en cada
   fotograma según los dígitos del número y arrastraba a las barras con ella. */
.bars.corriendo .bar-value { width: var(--ancho-cifra); }
/* El tramo que no se midió, sino que se reconstruyó con la hora de los tweets. */
.bars.corriendo .es-simulado .bar-fill {
  background-image: repeating-linear-gradient(135deg, rgb(255 255 255 / .72) 0 4px, transparent 4px 9px);
  opacity: .66;
}
.bars.corriendo .es-simulado .bar-value { color: var(--text-muted); font-style: italic; }
/* Las flechas de sube/baja comparan con hace 24 h: a mitad de carrera no dicen
   nada, así que se ocultan sin mover nada de sitio. */
.bars.corriendo .mov { visibility: hidden; }

/* ---------- filtros de /tweets/ ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.filtros { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 14px; }
/* La búsqueda ocupa toda la fila: es el filtro que más se usa y el que más sitio pide. */
.campo-ancho { grid-column: 1 / -1; }
.campo { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.campo > span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 650; }
.campo input, .campo select {
  font: inherit; font-size: 14px; color: var(--text-primary);
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; width: 100%; min-width: 0;
}
.campo select { cursor: pointer; appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.campo input:focus, .campo select:focus { outline: 2px solid var(--series-1); outline-offset: 1px; }
.filtros-pie { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-top: 14px; }
.filtros-pie .note { margin: 0; }


/* puesto dentro de cada cajita de la ficha */
.tile-pos { position: relative; }
.pos-badge {
  position: absolute; top: 10px; right: 12px; font-size: 11px; font-weight: 700;
  color: var(--text-muted); background: var(--surface-2); border-radius: 999px; padding: 1px 7px;
}
.pos-1 { background: #f3cc4d; color: #3b2d00; }
.pos-2 { background: #d8d8d2; color: #333; }
.pos-3 { background: #e0b183; color: #3b2d00; }
.tile-aviso { display: block; font-size: 10.5px; color: var(--bad); margin-top: 3px; }
.tip-tit { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.bar-sub {
  font-size: 10.5px; color: var(--text-muted); background: var(--surface-2);
  border-radius: 999px; padding: 1px 6px; white-space: nowrap; flex: none; cursor: help;
}
.punto { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.punto-sm { width: 12px; height: 12px; }
.punto-md { width: 20px; height: 20px; }
.noticias { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; }
.noticia { display: grid; grid-template-columns: minmax(90px, 140px) 1fr auto; gap: 12px; align-items: baseline;
  padding: 8px 10px; background: var(--surface-2); border-radius: 7px; text-decoration: none; color: inherit; font-size: 13.5px; }
.noticia:hover { background: var(--border); }
.noticia-medio { font-weight: 600; font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.noticia-txt { min-width: 0; }
.noticia-rt { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.col-marca { cursor: help; }
@media (max-width: 560px) { .noticia { grid-template-columns: 1fr; gap: 2px; } }

/* nube de palabras */
.nube { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-top: 14px; line-height: 1.5; }
.palabra { font-weight: 650; letter-spacing: -0.01em; cursor: help; }

/* desplegable de filtro */
.filtro { display: inline-flex; align-items: center; gap: 7px; }
.filtro-etq { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.filtro select {
  font-family: inherit; font-size: 13px; color: var(--text-primary); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px; cursor: pointer; max-width: 230px;
}
.filtro select:hover { background: var(--border); }

/* compartir */
.compartir { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-compartir {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 15px;
  border-radius: 999px; border: 1px solid transparent; font-size: 13.5px; font-weight: 700;
  letter-spacing: -.01em; white-space: nowrap; text-decoration: none; transition: filter .12s, transform .12s, box-shadow .12s;
}
.btn-compartir svg { width: 15px; height: 15px; }
.btn-x { box-shadow: 0 2px 8px rgb(0 0 0 / .22); }
.btn-wa { box-shadow: 0 2px 8px rgb(37 211 102 / .38); }
.btn-compartir:hover { transform: translateY(-1px); filter: brightness(1.12); box-shadow: 0 3px 10px rgb(0 0 0 / .18); }
.btn-x { background: #000; color: #fff; } .btn-x svg { fill: #fff; }
.btn-wa { background: #25d366; color: #05331a; } .btn-wa svg { fill: #05331a; }

/* línea por día */
.rejilla { stroke: var(--grid); stroke-width: 1; }
.eje { fill: var(--text-muted); font-size: 11px; }
.perfil-compartir { width: 100%; display: flex; justify-content: flex-end; margin-top: -4px; }
@media (max-width: 560px) { .perfil-compartir { justify-content: flex-start; } }
