/* Umbrella Resumen · "Última hora" panel (S36): three small multiples on one time axis, current
   value as the focal point of each row, a shared minute-by-minute crosshair. */
[data-skin='studio'] .lh {
  margin: var(--sp-4) 0;
  padding: var(--sp-3);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--raised);
  color: var(--hud-text);
  outline-offset: 4px;
}
.lh-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  margin-bottom: var(--sp-2);
}
[data-skin='studio'] .view .lh-head h2 {
  margin: 0;
  color: var(--hud-text);
}
.lh-live-badge,
.lh-example {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.lh-live-badge {
  background: #1b1c20;
  color: #fff;
}
.lh-live-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--state-running);
  animation: lh-pulse 1.6s ease-out infinite;
}
.lh-example {
  box-shadow: inset 0 0 0 1px var(--hud-border);
  color: var(--hud-muted);
}
.lh-more {
  margin-left: auto;
  font-weight: 700;
  color: var(--accent-strong);
  text-decoration: none;
}
.lh-more:hover {
  text-decoration: underline;
}

/* Rows: info column (golden split ≈ 1 : 1.618 of the left third) and the plot. */
.lh-rows {
  position: relative;
  --info: 248px;
}
.lh-row {
  display: grid;
  grid-template-columns: var(--info) 1fr;
  gap: var(--sp-3);
  align-items: stretch;
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--hud-border);
}
.lh-row:first-child {
  border-top: 0;
}
.lh-info {
  display: grid;
  gap: 4px;
  align-content: center;
  padding-left: 12px;
  border-left: 4px solid var(--c);
}
.lh-label {
  font-size: var(--fs-1);
  color: var(--hud-muted);
}
.lh-now {
  font-size: var(--fs-3);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.lh-now small {
  font-size: 14px;
  font-weight: 600;
  color: var(--hud-muted);
}
.lh-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lh-delta,
.lh-status {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-sunk);
  color: var(--hud-text);
}
.lh-delta.is-worse {
  background: rgb(201 64 79 / 0.14);
  color: #a3191a;
}
.lh-delta.is-better {
  background: rgb(47 191 122 / 0.16);
  color: #146c43;
}
.lh-status[data-level='normal'] {
  background: rgb(47 191 122 / 0.16);
  color: #146c43;
}
.lh-status[data-level='alerta'] {
  background: rgb(242 194 48 / 0.3);
  color: #6b5000;
}
.lh-status[data-level='critico'] {
  background: rgb(201 64 79 / 0.14);
  color: #a3191a;
}
.lh-status svg {
  width: 12px;
  height: 12px;
}
.lh-stats {
  display: flex;
  gap: var(--sp-2);
  margin: 2px 0 0;
  font-size: 12px;
}
.lh-stats div {
  display: flex;
  gap: 4px;
}
.lh-stats dt {
  color: var(--hud-muted);
}
.lh-stats dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Plot: area + 2px line in the series colour, dashed average, dotted reference. */
.lh-plot {
  position: relative;
  min-height: 92px;
  color: var(--c);
}
.lh-plot svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.lh-plot polyline {
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.lh-avg {
  stroke: var(--hud-muted);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.7;
}
.lh-ref {
  stroke: #a3191a;
  stroke-width: 1.5;
  stroke-dasharray: 2 3;
}
.lh-tag-avg,
.lh-tag-ref {
  position: absolute;
  left: 4px;
  transform: translateY(-120%);
  font-size: 11px;
  color: var(--hud-muted);
  pointer-events: none;
}
.lh-tag-ref {
  left: auto;
  right: 4px;
  color: #a3191a;
  font-weight: 700;
}
.lh-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 2px var(--surface);
  pointer-events: none;
}
.lh-live {
  left: 100%;
}
.lh-live::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--c);
  animation: lh-ring 1.6s ease-out infinite;
}

/* Shared time axis and crosshair (aligned with the plot column). */
.lh-axis {
  position: relative;
  height: 18px;
  margin-left: calc(var(--info) + var(--sp-3));
  font-size: 11px;
  color: var(--hud-muted);
}
.lh-axis span {
  position: absolute;
  transform: translateX(-50%);
}
.lh-axis span:first-child {
  transform: none;
}
.lh-cross {
  position: absolute;
  top: 0;
  bottom: 18px;
  left: calc(var(--info) + var(--sp-3));
  right: 0;
  pointer-events: none;
}
.lh-cross::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--x);
  border-left: 1px dashed var(--hud-text);
  opacity: 0.6;
}
.lh-cross[hidden] {
  display: none;
}
.lh-tip {
  position: absolute;
  top: 6px;
  left: var(--x);
  transform: translateX(12px);
  display: grid;
  gap: 4px;
  min-width: 230px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #1b1c20;
  color: #f3f4f6;
  font-size: 12px;
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.3);
}
.lh-cross.flip .lh-tip {
  transform: translateX(calc(-100% - 12px));
}
.lh-tip span {
  display: flex;
  gap: 8px;
  align-items: center;
}
.lh-tip span b {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.lh-tip i {
  width: 10px;
  height: 3px;
  border-radius: 2px;
  background: var(--c);
}
/* The hover dots sit in each plot; .lh-row positions them through .lh-plot. */
.lh-hover {
  z-index: 1;
}

@keyframes lh-pulse {
  0% {
    box-shadow: 0 0 0 0 rgb(47 191 122 / 0.7);
  }
  100% {
    box-shadow: 0 0 0 8px rgb(47 191 122 / 0);
  }
}
@keyframes lh-ring {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lh-live-badge i,
  .lh-live::after {
    animation: none;
  }
}
@media (max-width: 760px) {
  .lh-rows {
    --info: 100%;
  }
  .lh-row {
    grid-template-columns: 1fr;
    gap: var(--sp-1);
  }
  .lh-axis,
  .lh-cross {
    margin-left: 0;
    left: 0;
  }
  .lh-cross {
    display: none; /* on phones the values sit in each row; the tooltip would cover the plots */
  }
  .lh-more {
    margin-left: 0;
  }
}
