/* Measurement detail illustration: the product toolbar, plot and reading table.
   The complete graph is the default; motion only enhances a visible panel. */
.landing-history__unit {
  margin-left: .25rem;
  color: var(--lp-mute);
  font-size: .9375rem;
  font-weight: 400;
}

.landing-history .landing-history__card {
  margin: 1.25rem 0 0;
  overflow: hidden;
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-radius-md);
  background: color-mix(in srgb, var(--lp-current) 7%, var(--lp-panel));
}

.landing-history__toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  min-height: 3.5rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--lp-line-faint);
}

.landing-history__ranges {
  display: flex;
  gap: .375rem;
  font-size: .75rem;
}

.landing-history__ranges > span {
  padding: .25rem .625rem;
  border: 1px solid var(--lp-line);
  border-radius: .375rem;
  color: var(--lp-mute);
}

.landing-history__ranges .landing-history__range-selected {
  border-color: var(--lp-current);
  background: var(--lp-current);
  color: var(--lp-ink-strong);
}

.landing-history__date {
  margin-left: auto;
  color: var(--lp-mute);
  font-size: .6875rem;
}

.landing-history__date i {
  margin-right: .375rem;
}

.landing-history__replay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 2rem;
  padding: .25rem .5rem;
  border: 1px solid var(--lp-line);
  border-radius: .375rem;
  background: transparent;
  color: var(--lp-ink);
  cursor: pointer;
}

.landing .landing-history__replay {
  font-size: .6875rem;
}

.landing-history__replay[hidden] {
  display: none;
}

.landing-history__replay:hover {
  border-color: var(--lp-shoal);
  background: var(--lp-panel-raised);
}

.landing-history__replay:focus-visible {
  outline: 2px solid var(--lp-cyan);
  outline-offset: 3px;
}

.landing-history__chart-body {
  padding: 1rem 1.25rem;
}

.landing-history__legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  font-size: .75rem;
}

.landing-history__legend i {
  margin-right: .4rem;
  color: var(--lp-shoal);
  font-size: .45rem;
  vertical-align: middle;
}

:where(.landing-history__legend) > span:last-child {
  color: var(--lp-mute);
  font-size: .6875rem;
}

.landing-history__plot {
  display: flex;
  gap: .75rem;
  height: clamp(10rem, 18vw, 13.125rem);
}

.landing-history__plot .landing-workspace__axis {
  padding: 0;
  line-height: 1;
}

.landing-history__canvas {
  position: relative;
  flex: 1;
  min-width: 0;
  color: var(--lp-shoal);
}

.landing-history__canvas svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.landing-history__line {
  stroke: currentcolor;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* Inspecting a reading. The crosshair rests on the latest one; while the
   pointer is on the plot it snaps to the reading under it, and a dot per
   reading appears to show that the whole day can be read this way. */
.landing-history__canvas.is-live {
  cursor: crosshair;
}

.landing-history__marks {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--lp-dur-quick) var(--lp-ease-enter);
  pointer-events: none;
}

.landing-history__canvas.is-live .landing-history__marks {
  opacity: 1;
}

.landing-history__mark {
  position: absolute;
  width: 5px;
  height: 5px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: color-mix(in srgb, var(--lp-shoal) 55%, transparent);
}

.landing-history__cursor {
  position: absolute;
  inset-block: 0;
  left: 100%;
  border-left: 1px dashed var(--lp-shoal);
  pointer-events: none;
}

.landing-history__point {
  position: absolute;
  top: 69.4%;    /* the last plotted reading, 14.18 °C */
  left: -.5px;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%);
  border: 2px solid var(--lp-panel);
  border-radius: 50%;
  background: var(--lp-shoal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--lp-shoal) 18%, transparent);
}

.landing-history__tooltip {
  position: absolute;
  top: .5rem;
  right: .75rem;
  min-width: 6.25rem;
  padding: .5rem .625rem;
  border: 1px solid var(--lp-line-strong);
  border-radius: var(--lp-radius-sm);
  background: var(--lp-panel-raised);
  color: var(--lp-mute);
  font-family: var(--lp-mono);
  font-size: .625rem;
  font-variant-numeric: tabular-nums;
}

.landing-history__cursor[data-side="after"] .landing-history__tooltip {
  right: auto;
  left: .75rem;
}

.landing-history__tooltip strong {
  white-space: nowrap;
  display: block;
  margin-top: .15rem;
  color: var(--lp-ink-strong);
  font-size: 1rem;
  font-weight: 500;
}

.landing-history__tooltip small {
  color: var(--lp-mute);
  font-size: .6875rem;
}

.landing-history__stats {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.75rem;
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--lp-line-faint);
  color: var(--lp-mute);
  font-size: .6875rem;
}

.landing-history__stats strong {
  margin-left: .4rem;
  color: var(--lp-ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.landing-history__readings {
  margin-top: 1.25rem;
}

.landing-history__table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .625rem;
}

.landing-history__table-heading h4 {
  margin: 0;
  color: var(--lp-ink);
  font-size: .8125rem;
  font-weight: 500;
}

.landing-history__table-heading > span {
  color: var(--lp-mute);
  font-size: .625rem;
}

.landing-history__table-heading i {
  margin-right: .25rem;
}

.landing-history__readings table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
}

.landing-history__readings th {
  color: var(--lp-mute);
  font-size: .625rem;
  font-weight: 400;
}

.landing-history__readings th, .landing-history__readings td {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--lp-line-faint);
}

.landing-history__readings td:nth-child(2) {
  color: var(--lp-ink-strong);
  font-family: var(--lp-mono);
}

.landing-history__readings td > span, .landing-history__readings td:last-child {
  color: var(--lp-mute);
}

.landing-history__latest {
  background: color-mix(in srgb, var(--lp-shoal) 7%, transparent);
}

.landing-history__latest-label {
  margin-left: .625rem;
  font-family: var(--lp-font);
  font-size: .625rem;
}

/* The dot layer answers a hovering pointer. A finger still gets the crosshair
   and the reading, without a dot per reading crowding a narrow plot. */
@media (hover: none) {
  .landing-history__marks {
    display: none;
  }
}

@media (width < 36rem) {
  .landing-history__toolbar {
    gap: .5rem;
    padding: .625rem .75rem;
  }

  .landing-history__ranges {
    gap: .25rem;
  }

  .landing-history__ranges > span {
    padding-inline: .4rem;
  }

  .landing-history__date, :where(.landing-history__legend) > span:last-child,
  .landing-history__readings th:last-child, .landing-history__readings td:last-child {
    display: none;
  }

  .landing-history__replay {
    margin-left: auto;
  }

  .landing-history__chart-body {
    padding: 1rem .875rem;
  }

  .landing-history__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    padding: .75rem .875rem;
  }

  .landing-history__tooltip {
    right: .5rem;
    min-width: 5.75rem;
    padding: .375rem .5rem;
  }

  .landing-history__readings th:nth-child(2), .landing-history__readings td:nth-child(2) {
    text-align: right;
  }
}
