/* UX-02 — una única superficie de scroll por día, no una por fila.
   Toda la escala temporal usa el mismo ancho de contenido. */
.hourly-timeline-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--brand) transparent;
  container-type: inline-size;
}
.hourly-timeline-scroll:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
.hourly-timeline-content {
  position: relative;
  min-width: 100%;
  width: max(100%, var(--hourly-grid-width));
}
/* Mantener el texto legible dentro del ancho visible y los rieles alineados
   con la misma escala horaria, incluso cuando la grilla se desplaza. */
.hourly-timeline-scroll .lane-label,
.hourly-timeline-scroll .operational-legend,
.hourly-timeline-scroll .wind-pair .pair-key,
.hourly-timeline-scroll .tide-curve h3,
.hourly-timeline-scroll .tide-curve-source {
  position: sticky;
  left: 0;
  width: 100cqw;
  max-width: 100cqw;
  box-sizing: border-box;
  z-index: 1;
}
.hourly-timeline-scroll .tide-curve svg,
.hourly-timeline-scroll .hour-axis,
.hourly-timeline-scroll .bar,
.hourly-timeline-scroll .tide-timeline {
  width: 100%;
}
/* La marca del momento actual sigue en la coordenada temporal del contenido. */
.hourly-timeline-content .today-marker { pointer-events: none; }

/* UX-02B/02L: clima y térmica ganan altura; en UX-02L
   la térmica iguala peso y tamaño de viento sin afectar celdas. */
.hourly-timeline-scroll .weather .bar { height: 32px; }
.hourly-timeline-scroll .weather .segment {
  font-size: 1.3rem;
  line-height: 1;
}
.hourly-timeline-scroll .apparent-temperature .bar { height: 32px; }
.hourly-timeline-scroll .apparent-temperature .segment {
  font-size: .875rem;
  font-weight: 600;
  line-height: 1;
}
.hourly-timeline-scroll .wind .segment,
.hourly-timeline-scroll .gust .segment {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: .82rem;
  line-height: 1;
}

/* UX-02C: una sola regla horaria, incluida la que sigue a la curva de marea.
   Tamaño homogéneo y señal vertical en todas las marcas de hora. */
.hourly-timeline-scroll .hour-axis span {
  font-size: .75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.hourly-timeline-scroll .hour-axis span::after {
  content: "";
  display: block;
  width: 1px;
  height: 8px;
  margin: 3px auto 0;
  background: var(--muted);
}

/* Unificar la altura de cada riel individual. Viento y ráfagas conservan
   dos filas independientes (30px cada una). */
.hourly-timeline-scroll .lane > .bar,
.hourly-timeline-scroll .paired-bars .bar,
.hourly-timeline-scroll .tide-timeline {
  height: 30px;
}
.hourly-timeline-scroll .weather .segment { font-size: 1.25rem; }

/* Separación horaria explícita para oleaje, también en HOY. El estado
   (color) y la duración proporcional de cada celda no se modifican. */
.hourly-timeline-scroll .waves .segment {
  box-shadow: inset -1px 0 0 var(--surface);
}

/* Curva secundaria, con etiquetas legibles pero menos dominantes. */
.hourly-timeline-scroll .today-tide-lane .tide-curve {
  margin-top: 11px;
  padding-top: 9px;
}
.hourly-timeline-scroll .tide-curve .curve-limit {
  font-size: 17px;
  stroke-width: 2px;
}
.hourly-timeline-scroll .tide-curve .curve-grid-label {
  font-size: 15px;
}
.hourly-timeline-scroll .tide-curve .curve-line {
  stroke-width: 2.5;
}

/* UX-02D · Rayado neutro solo donde no hubo evaluación horaria. */
.hourly-timeline-scroll .bar .segment { isolation: isolate; }
.hourly-timeline-scroll .bar .segment::before,
.hourly-timeline-scroll .bar .segment::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    135deg, var(--calm), var(--calm) 4px,
    var(--unknown) 4px, var(--unknown) 8px
  );
}
.hourly-timeline-scroll .bar .segment::before {
  left: 0;
  width: var(--unevaluated-before, 0%);
}
.hourly-timeline-scroll .bar .segment::after {
  right: 0;
  width: var(--unevaluated-after, 0%);
}
.hourly-timeline-scroll .bar .segment > .cell-data {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.hourly-timeline-scroll .tide-timeline { background: var(--line); }
.hourly-timeline-scroll .lane.summary .lane-title {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 6px;
}
.hourly-timeline-scroll .lane.summary .lane-note:empty { display: none; }
.hourly-timeline-scroll .wind-pair .pair-key {
  font-size: .8125rem;
  line-height: 1.3;
  margin: 1px 0 5px 1px;
}

/* UX-02E · separadores horarios sin alterar las transiciones de estado
   calculadas a mayor resolución en la barra de marea. */
.hourly-timeline-scroll .tide-timeline .tide-hour-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--surface);
  z-index: 2;
  pointer-events: none;
}

/* La fuente de la curva comparte renglón con su título; la ayuda mantiene
   el detalle íntegro. El encabezado permanece visible durante el scroll. */
.hourly-timeline-scroll .tide-curve-heading {
  position: sticky;
  left: 0;
  width: 100cqw;
  max-width: 100cqw;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}
.hourly-timeline-scroll .tide-curve-heading h3 {
  position: static;
  width: auto;
  max-width: none;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: .95rem;
  line-height: 1.25;
}
.hourly-timeline-scroll .tide-curve-kind {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  font-size: .8125rem;
  line-height: 1.25;
  color: var(--muted);
  white-space: nowrap;
}

/* El resumen diario gana una línea y prioriza hora/duración. */
.today-window {
  padding: 12px 14px;
}
.today-window strong {
  font-size: 1.4rem;
  line-height: 1.15;
  margin: 0 0 5px;
  font-variant-numeric: tabular-nums;
}
.today-window span {
  font-size: .875rem;
  line-height: 1.4;
}

/* UX-02F: encabezado explicativo de la ventana, sin tercera línea de duración. */
.today-window .today-window-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  margin-bottom: 7px;
}
.today-window .today-window-heading > span {
  display: inline;
  color: var(--text);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.25;
}
.today-window .today-window-heading .info-button {
  flex: 0 0 auto;
}
.today-window .today-window-limitations {
  display: block;
  margin-top: 7px;
  font-size: .875rem;
  line-height: 1.35;
}

/* UX-02G: uno o varios períodos debajo de un único título. */
.today-window-hours {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}
.today-window-hours > strong {
  display: block;
  margin: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* UX-02H: mejorar lectura del viento sin cambiar la escala de 36px/h. */
.hourly-timeline-scroll .wind .segment,
.hourly-timeline-scroll .gust .segment {
  font-size: .875rem;
}
.hourly-timeline-scroll .wind .segment .cell-data {
  gap: 2px;
}

/* UX-02J: el título de Resultado queda arriba de la escala, y AHORA
   se ubica sobre la escala sin cruzar el título ni perder alineación. */
.hourly-timeline-scroll .lane.summary .hour-axis { margin-top: 7px; }
.hourly-timeline-scroll .lane.summary .hour-axis .today-marker {
  top: 20px;
  height: 32px;
}
.hourly-timeline-scroll .lane.summary .hour-axis .today-marker span { top: -22px; }

/* AHORA no es una marca regular: evitar segunda rayita debajo del texto. */
.hourly-timeline-scroll .lane.summary .hour-axis .today-marker span::after { display: none; }
.hourly-timeline-scroll .lane.summary .hour-axis .today-marker span {
  color: var(--bad);
  font-weight: 700;
}

/* UX-02K: compactación moderada manteniendo tamaños de cifras e íconos.
   Un único ancho por hora se define en app.js (34px). Las alturas cambian
   solo en grillas horarias, no en tarjetas de navegación ni otros controles. */
.hourly-timeline-scroll .lane > .bar,
.hourly-timeline-scroll .paired-bars .bar,
.hourly-timeline-scroll .tide-timeline {
  height: 28px;
}
.hourly-timeline-scroll .weather .bar,
.hourly-timeline-scroll .apparent-temperature .bar {
  height: 30px;
}

/* UX-03: detalle horario de HOY y 7 DÍAS (no modifica los rieles).
   Hora permanece fija; Resultado es la segunda columna y se puede tocar. */
.hourly-details .hour-table-shell {
  position: relative;
  max-width: 100%;
}
.hourly-details .hour-table-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 3px 10px;
  min-height: 25px;
  margin: 4px 0 2px;
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.35;
}
.hourly-details .hour-table-swipe-hint {
  color: var(--brand);
  opacity: 0;
  transition: opacity 150ms ease;
}
.hourly-details .hour-table-shell.has-more-right .hour-table-swipe-hint { opacity: 1; }
.hourly-details .hour-table-shell::after {
  content: "";
  position: absolute;
  top: 26px;
  bottom: 0;
  right: 0;
  width: 24px;
  background: linear-gradient(to right, transparent, color-mix(in srgb, var(--surface) 85%, transparent));
  pointer-events: none;
  opacity: 0;
}
.hourly-details .hour-table-shell.has-more-right::after { opacity: 1; }
.hourly-details .hour-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.hourly-details .hour-table-wrap:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.hourly-details .hour-table { table-layout: fixed; min-width: 970px; }
.hourly-details .hour-table th,
.hourly-details .hour-table td {
  padding: 5px 3px;
  white-space: nowrap;
  vertical-align: middle;
}
.hourly-details .hour-table th:nth-child(1),
.hourly-details .hour-table td:nth-child(1) { width: 58px; }
.hourly-details .hour-table th:nth-child(2),
.hourly-details .hour-table td:nth-child(2) { width: 150px; }
.hourly-details .hour-table th:nth-child(3),
.hourly-details .hour-table td:nth-child(3) { width: 68px; }
.hourly-details .hour-table th:nth-child(4),
.hourly-details .hour-table td:nth-child(4) { width: 42px; }
.hourly-details .hour-table th:nth-child(5),
.hourly-details .hour-table td:nth-child(5) { width: 58px; }
.hourly-details .hour-table th:nth-child(6),
.hourly-details .hour-table td:nth-child(6) { width: 54px; }
.hourly-details .hour-table th:nth-child(7),
.hourly-details .hour-table td:nth-child(7) { width: 64px; }
.hourly-details .hour-table th:nth-child(8),
.hourly-details .hour-table td:nth-child(8) { width: 50px; }
.hourly-details .hour-table th:nth-child(9),
.hourly-details .hour-table td:nth-child(9) { width: 58px; }
.hourly-details .hour-table th:nth-child(10),
.hourly-details .hour-table td:nth-child(10) { width: 60px; }
.hourly-details .hour-table th:nth-child(11),
.hourly-details .hour-table td:nth-child(11) { width: 68px; }
.hourly-details .hour-table th:nth-child(12),
.hourly-details .hour-table td:nth-child(12) { width: 70px; }
.hourly-details .hour-table th:nth-child(13),
.hourly-details .hour-table td:nth-child(13) { width: 56px; }
.hourly-details .hour-table th:nth-child(14),
.hourly-details .hour-table td:nth-child(14) {
  width: 114px;
  white-space: nowrap;
  text-align: left;
}
.hourly-details .hour-table thead th:first-child,
.hourly-details .hour-table tbody td:first-child {
  position: sticky;
  left: 0;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line);
}
.hourly-details .hour-table thead th:first-child { z-index: 3; }
.hourly-details .hour-table tbody td:first-child { z-index: 2; }
.hourly-details .hour-table-result {
  white-space: nowrap;
  text-align: left;
}
.hourly-details .table-result-detail {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 3px 1px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.hourly-details .table-result-detail:focus-visible { outline: 2px solid var(--brand); border-radius: 3px; }
.hourly-details .table-result-detail .table-state {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  font-size: .875rem;
}
.hourly-details .table-result-detail .table-reasons {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  margin-top: 2px;
  font-size: .8125rem;
  line-height: 1.25;
  color: var(--muted);
}
.hourly-details .table-result-detail .table-reason-primary {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}
.hourly-details .table-result-detail .table-reason-extra {
  display: block;
  flex: 0 0 auto;
  white-space: nowrap;
  font-weight: 700;
  color: var(--brand);
  border: 1px solid currentColor;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  border-radius: 999px;
  padding: 0 4px;
  line-height: 1.3;
}
.hourly-details .hour-table-condition { font-size: .875rem; }
