/* ============================================================
   ANALYTICS-VIEW.CSS
   Phase 6 Power Analytics.

   Charts are HTML tables with a coloured span for the bar. That is
   not a shortcut: the number is printed beside every bar, so the
   chart never has to be measured by eye, and a screen reader gets
   real values instead of a picture. No canvas, no library, no
   animation, no gradient, and one accent colour throughout - the
   categories are named in the row header, so colour carries no
   meaning and never needs to be decoded.
   ============================================================ */

.pan-wrap { max-width: 1000px; }

/* The scope note reads before the data because it is what makes the
   data interpretable. Bordered, not tinted, so it reads as a
   statement rather than a warning. */
.pan-scope {
  border: 1px solid var(--hairline-strong); border-left: 3px solid var(--accent);
  padding: 14px 16px; margin: 20px 0 24px;
  font: 400 13.5px/1.6 var(--sans); color: var(--ink-dim); max-width: 78ch;
}
.pan-scope strong { color: var(--ink); font-weight: 600; }

.pan-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  border-bottom: 1px solid var(--hairline); padding-bottom: 12px; margin-bottom: 22px;
}
.pan-tab {
  padding: 6px 12px; border: 1px solid var(--hairline-strong); border-radius: 999px;
  background: var(--bg); color: var(--ink-dim);
  font: 500 12.5px/1 var(--sans); cursor: pointer;
}
.pan-tab:hover { color: var(--ink); border-color: var(--ink-muted); }
.pan-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pan-tab.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }

.pan-h {
  font: 600 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-muted); margin: 0 0 6px;
}
.pan-sub {
  font: 400 14px/1.55 var(--sans); color: var(--ink-dim);
  margin: 0 0 22px; max-width: 70ch;
}

.pan-block { margin-bottom: 34px; }
.pan-block-h {
  font: 600 14.5px/1.3 var(--sans); color: var(--ink);
  margin: 0 0 12px; letter-spacing: -0.005em;
}

.pan-bars { width: 100%; border-collapse: collapse; }
.pan-bars thead th {
  text-align: left; padding: 0 10px 7px 0;
  font: 600 9.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-muted); border-bottom: 1px solid var(--hairline-strong);
}
.pan-bars thead th:last-child { text-align: right; }
.pan-bars tbody tr { border-bottom: 1px solid var(--hairline); }
.pan-bars tbody tr:last-child { border-bottom: 0; }
.pan-bars td, .pan-bars th { padding: 7px 10px 7px 0; vertical-align: middle; }

.pan-bar-label {
  font: 400 13.5px/1.4 var(--sans); color: var(--ink); text-align: left;
  font-weight: 500; width: 30%; max-width: 260px;
}
.pan-bar-cell { width: 55%; }
.pan-bar {
  display: block; height: 9px; background: var(--accent);
  border-radius: 2px; min-width: 2px;
}
.pan-bar-n {
  text-align: right; white-space: nowrap;
  font: 500 12.5px/1.4 var(--mono); color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
/* Secondary to the count, because the count is the checkable fact
   and the percentage is the derived one. */
.pan-pct { margin-left: 10px; color: var(--ink-muted); }

.pan-coverage {
  margin: 10px 0 0; font: 400 12.5px/1.55 var(--sans); color: var(--ink-muted);
  max-width: 76ch;
}
.pan-empty {
  margin: 0; font: 400 13.5px/1.6 var(--sans); color: var(--ink-dim); max-width: 70ch;
}
/* An absence with a reason is content, so it gets body-text weight
   rather than being tucked away. */
.pan-note {
  margin: 16px 0 0; padding-left: 12px; border-left: 2px solid var(--hairline-strong);
  font: 400 13px/1.6 var(--sans); color: var(--ink-dim); max-width: 74ch;
}
.pan-note-strong { border-left-color: var(--accent); color: var(--ink); }

@media (max-width: 640px) {
  .pan-bar-label { width: 40%; font-size: 12.5px; }
  .pan-bar-cell { width: 35%; }
  .pan-pct { display: block; margin: 2px 0 0; }
}
