/* Skin: TRACE, continued. The controls Plate 001 puts around its charts: the zoom bar and minute buttons
   of fig. 1a (brush-to-zoom), the "View as table" disclosures, the brush band, and fig. 1c's empty state.
   Same scope, values and rules as skin-hyperplot.css (no red in the stage; phosphor marks what is active).
   Loaded by Plate 001 only: the hub's Featured slot shows the live chart alone. */
@layer skin {
  @scope ([data-skin="hyperplot"]) {
    /* Zoom bar: what to do (a drag, or a minute button beside it), what the chart shows now (role=status),
       and the way back. hx-plot's brush answers mouse and pen only, so a touch screen is told to tap instead. */
    .ptr-coarse { display: none; }
    @media (hover: none) and (pointer: coarse) {
      .ptr-fine { display: none; }
      .ptr-coarse { display: revert; }
      .zoombar__minutes button { min-block-size: 2.25rem; min-inline-size: 2.75rem; }
    }
    .zoombar {
      display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 1rem;
      margin-block-end: 0.55rem; color: var(--muted);
    }
    .zoombar__how { flex: 1 1 100%; color: var(--skin-ink); }
    /* "Back to live" sits with the minute buttons (both are zoom controls); the status takes what is left
       of their row, or the next one */
    .zoombar__ctl { order: 1; }
    .zoombar__state { order: 2; flex: 1 1 16rem; min-inline-size: 0; }
    .zoombar__ctl:empty { display: none; }
    :is(.zoombar__live, .zoombar__minutes button) {
      font: 500 0.6875rem / 1.2 var(--mono); color: var(--skin-ink); cursor: pointer;
      padding: 0.28rem 0.5rem; border: 1px solid var(--edge); border-radius: 3px;
      background: color-mix(in oklch, var(--rim) 45%, var(--skin-bg));
      &:hover { border-color: var(--phosphor); }
      &:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 2px; }
    }
    .zoombar__ctl .zoombar__live { color: var(--skin-bg); background: var(--phosphor); border-color: var(--phosphor); }
    .zoombar__minutes {
      flex: 0 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem;
      color: var(--muted);
      & > span { margin-inline-end: 0.3rem; }
    }
    .zoombar__snap { margin-block-start: 0.45rem; font-size: 0.6875rem; color: var(--muted); }

    /* The brush band, in phosphor: the range the next request will carry */
    .hp .hp-brush { fill: var(--phosphor); fill-opacity: 0.12; stroke: var(--phosphor); }

    /* "View as table": hx-plot keeps it open (or shut) across morphs and keeps the newest row in view */
    .hp-view {
      margin-block-start: 0.55rem; border-top: 1px dashed var(--rim); padding-block-start: 0.45rem;
      & summary { cursor: pointer; color: var(--skin-ink); inline-size: fit-content; }
      & summary small { margin-inline-start: 0.4rem; font-size: inherit; color: var(--muted); }
      & summary:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 2px; }
    }
    .hp-view__scroll {
      max-block-size: 12.5rem; overflow: auto; margin-block-start: 0.4rem; overscroll-behavior: contain;
      &:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 2px; }
    }
    .hp-table {
      --hp-surface: transparent;
      --hp-text: var(--skin-ink);
      --hp-text-muted: var(--muted);
      --hp-grid: color-mix(in oklch, var(--skin-ink) 13%, transparent);
      --hp-axis: color-mix(in oklch, var(--skin-ink) 34%, transparent);
      inline-size: 100%; font: 400 0.6875rem / 1.3 var(--mono); font-variant-numeric: tabular-nums;
      & caption { color: var(--muted); font-weight: 500; }
      & thead th { position: sticky; top: 0; background: var(--skin-bg); }
      & th, & td { padding: 0.2rem 0.6rem; }
    }

    /* Fig. 1c before any select: say what fills it. Its one render (360 px) is never scaled up. */
    .plotter__chart--detail {
      &:empty { display: grid; place-items: center; aspect-ratio: 36 / 22; max-inline-size: 360px; padding: 1rem; border: 1px dashed var(--rim); border-radius: 3px; }
      &:empty::before { content: attr(data-empty); max-inline-size: 30ch; text-align: center; color: var(--muted); }
      & .hp { max-inline-size: 360px; }
    }
  }
}
