/* Mapa de calor — horas pico (layout horizontal ancho, paleta SIGNO/) */

.panel--rank.panel--peak {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.peak-heat-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.peak-heat__scale {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(to right, #ede9e0, #d4b896, #8c6020);
  max-width: 100%;
}

.peak-heat {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  margin-top: 10px;
  flex: 1;
  min-height: 160px;
  max-height: 260px;
}

.peak-heat__left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.peak-heat__header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 6px 8px;
  align-items: end;
}

.peak-heat__corner {
  grid-column: 1;
}

.peak-heat__hours {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}

.peak-heat__hours span {
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--fg-4);
  font-family: 'Geist Mono', ui-monospace, monospace;
  text-transform: uppercase;
}

.peak-heat__rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
}

.peak-heat__row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.peak-heat__day {
  font-size: 10px;
  font-weight: 500;
  color: var(--fg-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 2px;
}

.peak-heat__cells {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  min-height: 0;
}

.peak-heat__cell {
  border: none;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 4px;
  min-height: 6px;
  min-width: 0;
  opacity: 0;
  transform: scale(0.94);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(28, 18, 8, 0.04);
  cursor: default;
}

.peak-heat--in .peak-heat__cell {
  opacity: 1;
  transform: scale(1);
}

.peak-heat__cell:hover {
  filter: brightness(1.06);
  box-shadow:
    inset 0 0 0 1px rgba(28, 18, 8, 0.08),
    0 0 0 2px rgba(140, 96, 32, 0.2);
  z-index: 2;
}

.peak-heat__cell:focus-visible {
  filter: brightness(1.06);
  box-shadow:
    inset 0 0 0 1px rgba(28, 18, 8, 0.08),
    0 0 0 2px rgba(140, 96, 32, 0.2);
  z-index: 2;
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.peak-heat__legend-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 28px;
  flex-shrink: 0;
  padding-top: 22px;
}

.peak-heat__legend-track {
  flex: 1;
  width: 10px;
  min-height: 72px;
  border-radius: 5px;
  background: linear-gradient(to top, #8c6020, #d4b896, #ede9e0);
  box-shadow: inset 0 0 0 1px rgba(28, 18, 8, 0.08);
}

.peak-heat__legend-cap {
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-4);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  line-height: 1;
}

.panel--peak .panel__foot--legend {
  margin-top: 12px;
}

.peak-heat__tip {
  position: fixed;
  z-index: 100;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: rgba(250, 248, 244, 0.98);
  box-shadow: 0 10px 32px rgba(28, 18, 8, 0.12);
  font-size: 11px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  max-width: 220px;
}

.peak-heat__tip.is-on {
  opacity: 1;
  visibility: visible;
}

.peak-heat__tip strong {
  display: block;
  font-family: 'Geist Mono', ui-monospace, monospace;
  color: var(--fg);
  margin-bottom: 4px;
}

.peak-heat__tip span {
  color: var(--fg-3);
}

@media (max-width: 520px) {
  .peak-heat {
    flex-direction: column;
    max-height: none;
  }

  .peak-heat__legend-col {
    flex-direction: row;
    width: 100%;
    padding-top: 0;
    justify-content: center;
    gap: 12px;
  }

  .peak-heat__legend-track {
    width: min(200px, 60%);
    height: 10px;
    min-height: 0;
    background: linear-gradient(to right, #ede9e0, #d4b896, #8c6020);
  }

  .peak-heat__legend-cap {
    writing-mode: horizontal-tb;
    transform: none;
  }
}
