/* UI only. The parent grid must declare a slope row before boundary. */
#slope-detail {
  --slope-blue: #233dff;
  --slope-ink: #20353e;
  --slope-muted: #687881;
  --slope-line: #d5dcd9;
  --slope-paper: #f4f2ed;
  grid-area: slope;
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: start;
  gap: 12px 32px;
  min-width: 0;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--slope-line);
  color: var(--slope-ink);
  font: 400 15px/1.5 Manrope, Arial, Helvetica, sans-serif;
}
#slope-detail[hidden],
#slope-detail [hidden] { display: none !important; }
#slope-detail .slope-description { grid-column: 1 / -1; margin: 0; color: var(--slope-ink); font-size: inherit; }
#slope-detail .slope-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 14px 18px;
  margin: 5px 0 0;
}
#slope-detail .slope-metrics dt { margin: 0; color: var(--slope-muted); font-weight: 400; }
#slope-detail .slope-metrics dd { margin: 0; color: var(--slope-blue); font-size: 21px; line-height: 1.3; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
#slope-detail .slope-profile { min-width: 0; }
#slope-detail .slope-plot { margin-bottom: 9px; }
#slope-detail #slope-chart { display: block; width: 100%; height: auto; aspect-ratio: 500 / 120; overflow: hidden; }
#slope-detail .slope-baseline { stroke: var(--slope-line); stroke-width: 1px; vector-effect: non-scaling-stroke; }
#slope-detail #slope-path { fill: none; stroke: var(--slope-blue); stroke-width: 2.5px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#slope-detail #slope-cursor { stroke: var(--slope-blue); stroke-width: 1px; stroke-dasharray: 3 4; opacity: .65; vector-effect: non-scaling-stroke; }
#slope-detail #slope-dot { fill: var(--slope-blue); stroke: var(--slope-paper); stroke-width: 2px; vector-effect: non-scaling-stroke; }
#slope-detail .slope-endpoints { display: flex; justify-content: space-between; gap: 16px; margin-top: 2px; padding-inline: 3.2%; color: var(--slope-muted); font-size: 14px; line-height: 1.2; font-weight: 500; }
#slope-detail .slope-scale-note { margin: 7px 0 0; color: var(--slope-muted); font-size: inherit; line-height: 1.45; }
#slope-detail #slope-position-label { display: block; margin: 0; color: var(--slope-ink); font-size: inherit; font-weight: 500; }
#slope-detail .slope-controls { margin-top: 0; }
#slope-detail #slope-position { display: block; width: 100%; min-width: 0; height: 44px; margin: 0; padding: 0; accent-color: var(--slope-blue); cursor: pointer; }
#slope-detail #slope-position:disabled { cursor: default; opacity: .55; }
#slope-detail #slope-position:focus-visible { outline: 2px solid var(--slope-blue); outline-offset: 3px; }
#slope-detail .slope-reading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 18px; margin-top: 5px; color: var(--slope-muted); font-size: inherit; }
#slope-detail .slope-reading p { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; }
#slope-detail .slope-reading output { color: var(--slope-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
#slope-detail .slope-note { grid-column: 1 / -1; margin: 0; color: var(--slope-muted); font-size: inherit; line-height: 1.55; }

@media (max-width: 700px) {
  #slope-detail { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 14px; font-size: 14px; }
  #slope-detail .slope-metrics { gap: 8px 16px; margin-top: 0; }
  #slope-detail .slope-metrics dd { font-size: 19px; }
  #slope-detail .slope-profile { width: 100%; max-width: 500px; }
  #slope-detail .slope-reading { justify-content: flex-start; gap: 4px 16px; }
}
@media (forced-colors: active) {
  #slope-detail #slope-position:focus-visible { outline-color: Highlight; }
  #slope-detail :is(#slope-path, #slope-cursor) { stroke: CanvasText; }
  #slope-detail #slope-dot { fill: Highlight; stroke: Canvas; }
}
