/* ---- charts y visualización ---- */
.chart {
  width: 100%;
  overflow-x: auto;
}

/* ranking desplazable: el eje queda fijo arriba y las barras se desplazan */
.rank-axis {
  background: var(--surface);
  border-bottom: 1px solid var(--grid);
  padding-bottom: 2px;
}

.rank-wrap {
  position: relative;
}

.rank-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 10px;
  bottom: 0;
  height: 26px;
  pointer-events: none;
  opacity: var(--fade, 1);
  transition: opacity 0.15s;
  background: linear-gradient(to bottom, transparent, var(--surface));
}

.rank-body {
  max-height: min(560px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rank-body::-webkit-scrollbar {
  width: 10px;
}

.rank-body::-webkit-scrollbar-thumb {
  background: var(--axis);
  border-radius: 8px;
}

.rank-body::-webkit-scrollbar-track {
  background: transparent;
}

/* tarjetas de operadores de la hora seleccionada */
.hr-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--grid);
}

.hr-head b {
  font-size: 14px;
}

.ops {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
}

.op {
  border: 1px solid var(--ring);
  border-radius: 9px;
  padding: 10px 11px;
  background: var(--plane);
}

.op .n {
  font-size: 11.5px;
  color: var(--ink2);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.op .v {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 3px 0 1px;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.op .d {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.op.corto {
  opacity: 0.62;
}

.op.corto .v {
  color: var(--ink2);
}

svg {
  display: block;
  max-width: 100%;
}

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink2);
  margin: 0 0 8px;
}

.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}

/* ---- tooltip flotante ---- */
.tip {
  position: fixed;
  pointer-events: none;
  z-index: 99;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--axis);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.08s;
  max-width: 280px;
}

.tip b {
  font-weight: 600;
}

.tip .r {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--ink2);
}

.tip .r span:last-child {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
