.report-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  min-inline-size: 0;
}

.report-frame [id] {
  scroll-margin-block-start: 8rem;
}

/* ── Sticky 2-row executive command bar (<= 96px desktop) ─────────────────── */
.report-frame__command-bar {
  position: sticky;
  inset-block-start: var(--safe-top);
  z-index: 25;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--surface-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding-inline: var(--safe-left) var(--safe-right);
  min-inline-size: 0;
}

.report-frame--scoped > .page-header {
  margin-block: 0;
  padding-block: 0 var(--space-2);
  gap: var(--space-1);
}

.report-frame > .page-header .page-header-eyebrow a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--density-chip);
}

.report-frame--scoped > .page-header .page-header-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  color: var(--fg2);
  text-transform: none;
  letter-spacing: normal;
}

.report-frame--scoped > .page-header .page-header-eyebrow > :not(:first-child)::before {
  content: "·";
  margin-inline-end: var(--space-2);
  color: var(--fg3);
}

.report-frame--scoped > .page-header .page-header-title {
  font-size: clamp(var(--text-xl), 2.2vw, var(--text-2xl));
  line-height: 1.2;
}

.report-frame--scoped > .page-header .page-header-sub {
  font-size: var(--text-base);
  margin-block-start: var(--space-1);
}

.report-frame__scopes,
.report-frame__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.report-frame__scopes li,
.report-frame__tabs li {
  min-inline-size: 0;
  max-inline-size: 100%;
}

.report-frame__chip,
.report-frame__tabs a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--density-chip);
  padding-inline: var(--space-3);
  border: 1px solid var(--rule);
  color: var(--fg1);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
  max-inline-size: 100%;
}

.report-frame [aria-current] {
  border-color: var(--accent-text);
  background: var(--accent-soft);
  font-weight: 600;
}

/* Row 2 inside the command bar: crisp hairline tab strip */
.report-frame__command-bar .report-frame__navigation {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: var(--space-2);
  min-inline-size: 0;
  border-block-start: 1px solid var(--rule);
  padding-inline: var(--space-3);
}

.report-frame__tabs-nav {
  position: relative;
  flex: 1 1 auto;
  min-inline-size: 0;
}

.report-frame__command-bar .report-frame__tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: var(--space-1);
  padding-block: 0;
  scrollbar-width: none;
  scroll-padding-inline: var(--space-4);
  --tab-cover: var(--surface-raised);
  --tab-edge: color-mix(in srgb, var(--fg1) 20%, transparent);
  background:
    linear-gradient(to right, var(--tab-cover) 35%, transparent) 0 0 / 2rem 100% no-repeat local,
    linear-gradient(to left, var(--tab-cover) 35%, transparent) 100% 0 / 2rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--tab-edge), transparent) 0 0 / 0.65rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--tab-edge), transparent) 100% 0 / 0.65rem 100% no-repeat scroll;
}

.report-frame__command-bar .report-frame__tabs::-webkit-scrollbar {
  display: none;
}

.report-frame__command-bar .report-frame__tabs > li {
  flex-shrink: 0;
}

.report-frame__command-bar .report-frame__tabs a {
  border: 0;
  border-radius: 0;
  border-block-end: 2px solid transparent;
  min-block-size: 2.4rem;
  padding-inline: var(--space-3);
  color: var(--fg2);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.report-frame__command-bar .report-frame__tabs a:hover {
  color: var(--fg1);
  background: var(--surface-sunken);
}

.report-frame__command-bar .report-frame__tabs a[aria-current="page"] {
  border-block-end-color: var(--accent);
  background: transparent;
  color: var(--accent-text);
  font-weight: 700;
}

.report-frame__utilities {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.report-frame__command-bar :is(.report-frame__about, .report-frame__tools) {
  position: relative;
}

.report-frame__command-bar :is(.report-frame__about, .report-frame__tools) > summary {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.2rem;
  padding: 0 var(--space-2);
  color: var(--fg2);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  list-style: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.report-frame__command-bar :is(.report-frame__about, .report-frame__tools) > summary::-webkit-details-marker {
  display: none;
}

.report-frame__command-bar :is(.report-frame__about, .report-frame__tools) > summary:hover {
  color: var(--fg1);
  background: var(--surface-sunken);
}

.report-frame__popover {
  position: absolute;
  inset-block-start: calc(100% + var(--space-1));
  inset-inline-end: 0;
  z-index: 40;
  inline-size: min(24rem, 90vw);
  max-block-size: 24rem;
  overflow: auto;
  padding: var(--space-3);
  background: var(--surface-raised);
  border: 1px solid var(--control-line);
  border-radius: var(--radius-lg);
}

.report-frame__command-bar .report-frame__tools ul {
  display: grid;
  gap: var(--space-1);
}

.report-frame__command-bar .report-frame__tools a {
  min-block-size: var(--density-chip);
  padding-inline: var(--space-2);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.report-frame__command-bar .report-frame__tools a:hover {
  background: var(--surface-sunken);
}

.report-frame__caveats,
.report-chart__caveats {
  margin: 0;
  padding-inline-start: var(--space-4);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

/* ── Telemetry KPI strip & report numeral unification ─────────────────────── */
.report-frame .figure-value {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}

.figure-strip[data-variant="telemetry"] {
  border: 0;
}

.figure-strip[data-variant="telemetry"] .figure-strip-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-3);
}

.figure-strip[data-variant="telemetry"] .figure {
  display: grid;
  align-content: start;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-raised);
  border: 1px solid var(--rule);
  border-block-start: 2px solid var(--accent-line);
  border-radius: var(--radius-lg);
}

.figure-strip[data-variant="telemetry"] .figure:first-child {
  border-block-start-color: var(--accent);
}

.figure-strip[data-variant="telemetry"] .figure-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg2);
}

.figure-strip[data-variant="telemetry"] .figure-value {
  font-family: var(--font-sans);
  font-size: clamp(1.375rem, 2.2vw, 1.875rem);
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.figure-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin: 0;
  font-size: var(--text-xs);
  color: var(--fg2);
}

.figure-delta {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--tone-mute-bg);
  color: var(--tone-mute-fg);
}

.figure-delta[data-tone="good"] {
  background: var(--tone-good-bg);
  color: var(--tone-good-fg);
}

.figure-delta[data-tone="warn"] {
  background: var(--tone-warn-bg);
  color: var(--tone-warn-fg);
}

.figure-delta[data-tone="bad"] {
  background: var(--tone-bad-bg);
  color: var(--tone-bad-fg);
}

/* ── DataTable numeric & short header wrap prevention + card scroll cover ──── */
table.data.data-table thead th[data-header-nowrap],
table.data.data-table thead th[data-header-nowrap] .data-table-sort,
.report-frame table.data.data-table:not(.report-chart__grid) thead th[data-numeric],
.report-frame table.data.data-table:not(.report-chart__grid) thead th[data-numeric] .data-table-sort {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

@container (max-width: 48rem) {
  table.data.data-table[data-cards] thead th[data-header-nowrap],
  table.data.data-table[data-cards] thead th[data-header-nowrap] .data-table-sort {
    white-space: normal;
    overflow-wrap: break-word;
  }
}

.report-frame .card .data-table-region,
.report-frame .report-chart .data-table-region,
.report-frame .report-events__panel .data-table-region {
  --region-cover: var(--surface-raised);
}

.report-frame table.data.data-table a {
  color: var(--accent-text);
  text-underline-offset: 0.16em;
}

/* ── Shared Report Charts ─────────────────────────────────────────────────── */
.report-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.report-chart__legend li {
  display: inline-flex;
  align-items: center;
  min-inline-size: 0;
}

.report-chart__swatch {
  display: inline-block;
  inline-size: var(--space-5);
  margin-inline-end: var(--space-2);
  border-block-start: 3px solid var(--accent-text);
  vertical-align: middle;
}

.report-chart__swatch[data-pattern="dash"] { border-block-start-style: dashed; }
.report-chart__swatch[data-pattern="dot"] { border-block-start-style: dotted; }

.report-chart__swatch--delta-ahead {
  block-size: 0.75rem;
  border: 1px solid var(--tone-good-fg);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--tone-good-fg) 22%, transparent);
}

.report-chart__swatch--delta-behind {
  block-size: 0.75rem;
  border: 1px solid var(--tone-bad-fg);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--tone-bad-fg) 22%, transparent);
}

.report-chart__line,
.report-chart__bar {
  display: block;
  inline-size: 100%;
  overflow: visible;
  color: var(--accent-text);
}

.report-chart { container: report-chart / inline-size; min-inline-size: 0; }
.report-chart__plot { min-inline-size: 0; max-inline-size: 64rem; }
.report-chart__line { min-inline-size: 0; max-inline-size: 54rem; }
.report-chart__tick { fill: var(--fg2); font: 13px var(--font-sans); font-variant-numeric: tabular-nums; }
.report-chart__gridline { stroke: var(--rule); stroke-dasharray: 3 4; }
.report-chart .page-section__body { display: grid; gap: var(--space-3); }
.report-chart__grid td { background: var(--accent-soft); min-inline-size: 0; }
.report-chart__grid-mark { color: var(--accent-text); }
.report-chart__bar { max-block-size: 10rem; }

.report-chart__velocity-bar {
  fill: var(--accent);
  fill-opacity: 0.2;
}

.report-chart__delta--ahead {
  fill: var(--tone-good-fg);
  fill-opacity: 0.18;
}

.report-chart__delta--behind {
  fill: var(--tone-bad-fg);
  fill-opacity: 0.18;
}

.report-chart__projection-cone {
  fill: var(--accent);
  fill-opacity: 0.12;
}

.report-chart__projection-edge {
  stroke: var(--accent-text);
  stroke-width: 2;
  stroke-dasharray: 4 4;
}

.report-chart__projection-bracket {
  stroke: var(--accent-text);
  stroke-width: 2.5;
}

.report-chart__projection-label {
  fill: var(--accent-text);
  font: 600 13px var(--font-sans);
  font-variant-numeric: tabular-nums;
}

.report-chart__pinned-dot {
  fill: var(--accent);
  stroke: var(--surface-raised);
  stroke-width: 2.5;
}

.report-chart__badge-bg {
  fill: var(--accent);
}

.report-chart__badge-text {
  fill: var(--accent-fg);
  font: 700 12px var(--font-sans);
  font-variant-numeric: tabular-nums;
}

.report-chart__axis { stroke: var(--fg2); }
.report-chart__series path {
  fill: none;
  stroke: var(--accent-text);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}
.report-chart__series[data-pattern="dash"] path { stroke-dasharray: 10 5; }
.report-chart__series[data-pattern="dot"] path { stroke-dasharray: 2 5; }
.report-chart__series circle,
.report-chart__dot { fill: var(--accent-text); }
.report-chart__mark { stroke: var(--accent-text); stroke-width: 2; }
.report-chart__hatch { stroke: var(--accent-text); stroke-width: 2; }

.report-chart__axes {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-sm);
}
.report-chart__axes p,
.report-chart__axis-label,
.report-chart__category { margin: 0; overflow-wrap: anywhere; }
.report-chart__axis-label { font-size: var(--text-sm); color: var(--fg2); }

.report-chart__bars { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.report-chart__bars li { min-inline-size: 0; }
.report-chart__category { font-weight: 600; }
.report-chart__values { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin: 0; font-size: var(--text-sm); }
.report-chart__values div { display: flex; flex-wrap: wrap; gap: var(--space-2); min-inline-size: 0; }
.report-chart__values dt { overflow-wrap: anywhere; }
.report-chart__values dd { margin: 0; font-variant-numeric: tabular-nums; }
.report-chart__grid-value { display: grid; justify-items: end; gap: var(--space-1); min-inline-size: 3rem; padding: 0; }
.report-chart__row-label { display: block; max-inline-size: 8rem; }
.report-chart__grid-mark { inline-size: 4rem; max-inline-size: 100%; block-size: var(--space-2); fill: var(--accent-text); }
.report-chart__grid-value a { display: inline-flex; align-items: center; min-block-size: var(--target-min); }
.report-chart__table { min-inline-size: 0; }
.report-chart__table summary { min-block-size: var(--target-min); padding-block: var(--space-2); cursor: pointer; overflow-wrap: anywhere; }

@media (forced-colors: active) {
  .report-chart__line, .report-chart__bar { color: CanvasText; }
  .report-chart__series path, .report-chart__mark, .report-chart__hatch, .report-chart__axis,
  .report-chart__projection-edge, .report-chart__projection-bracket { stroke: CanvasText; }
  .report-chart__series circle, .report-chart__dot, .report-chart__grid-mark,
  .report-chart__pinned-dot, .report-chart__velocity-bar, .report-chart__projection-label { fill: CanvasText; }
}

.report-frame__about {
  min-inline-size: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
}

.report-frame__about summary {
  min-block-size: var(--target-min);
  padding-block: var(--space-2);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.report-frame__about[open] .report-frame__caveats {
  margin-block: var(--space-2);
}

.report-frame__controls:empty {
  display: none;
}

.report-frame__controls {
  min-inline-size: 0;
  padding-block: var(--space-3);
  border-block: 1px solid var(--rule);
}

.report-frame .page-header-title { font-family: var(--font-sans); font-size: clamp(var(--text-xl), 2.5vw, var(--text-2xl)); font-weight: 700; letter-spacing: -0.025em; }
.report-frame .page-section__title { font-family: var(--font-sans); font-size: var(--text-md); font-weight: 650; }
.report-frame .report-chart { background: var(--surface-raised); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: var(--space-4); }
.report-frame .report-chart .page-section__head { border: 0; padding: 0; }
.report-chart__category-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); align-items: baseline; }
.report-chart__category-head .report-chart__values { margin-inline-start: auto; }
.report-chart__category-head .report-chart__values dt:only-of-type { font-weight: 400; }
.report-chart__scale { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--text-xs); color: var(--fg2); }
.report-chart__grid th, .report-chart__grid td { padding: var(--space-2); }

@media (min-width: 60rem) {
  .report-frame .report-chart { padding: var(--space-5); }
}

table.data.data-table.report-chart__grid { table-layout: auto; min-inline-size: 0; }
table.data.data-table.report-chart__grid th { white-space: normal; letter-spacing: normal; text-transform: none; font-size: var(--text-sm); }
.report-chart__grid .report-chart__row-label { max-inline-size: 10rem; }

.report-chart__line--compact,
.report-chart__number--compact { display: none; }
.report-chart__line--compact[data-compact-line="true"] { display: block; }
.report-chart__line--compact[data-compact-line="true"] .report-chart__tick { font-size: 15px; }
@container report-chart (max-width: 48rem) {
  .report-chart__line--wide, .report-chart__number--wide { display: none; }
  .report-chart__number--compact { display: inline; }
  .report-chart__line--compact { display: block; min-inline-size: 0; }
  .report-chart__line--compact .report-chart__tick { font-size: 15px; }
}

.report-chart__grid td:has(.report-chart__not-applicable) { background: var(--surface-raised); }
.report-chart__not-applicable { color: var(--fg2); }

.report-chart__series path.report-chart__line-halo { stroke: var(--surface-raised); stroke-width: 7; stroke-dasharray: none; }
.report-chart__series circle { stroke: var(--surface-raised); stroke-width: 2; }

.report-chart__today { stroke: var(--fg2); stroke-width: 2; stroke-dasharray: 4 4; }
.report-chart__end-label text { fill: var(--fg1); font: 14px var(--font-sans); font-variant-numeric: tabular-nums; }
.report-chart__end-label text.report-chart__badge-text { fill: var(--accent-fg); font: 700 12px var(--font-sans); }
.report-chart__end-label line { stroke: var(--fg2); }
@container report-chart (max-width: 48rem) {
  .report-chart__end-label text { font-size: 15px; }
  .report-chart__end-label text.report-chart__badge-text { font-size: 13px; }
}
@media (forced-colors: active) {
  .report-chart__today, .report-chart__end-label line { stroke: CanvasText; }
  .report-chart__end-label text { fill: CanvasText; }
}

.report-frame__tabs a { border-radius: var(--radius-md); }
.report-frame__tools summary, .report-frame__controls > summary {
  min-block-size: var(--target-min);
  padding-block: var(--space-3);
  cursor: pointer;
}
.report-frame__tools ul, .report-frame__related {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.report-frame__tools a, .report-frame__related a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
}

/* Keep comparisons distinct in hue and lightness; patterns also survive monochrome. */
.report-chart__swatch[data-series="comparison"] { border-color: var(--spine-amber-line); }
.report-chart__series[data-series="comparison"] path { stroke: var(--spine-amber-line); }
.report-chart__series[data-series="comparison"] circle,
.report-chart__dot { fill: var(--spine-amber-line); }
.report-chart__mark[data-series="comparison"] { color: var(--spine-amber-line); }
.report-chart__mark[data-series="comparison"],
.report-chart__hatch { stroke: var(--spine-amber-line); }
.report-chart__series[data-series="comparison"] path.report-chart__line-halo { stroke: var(--surface-raised); }
.report-chart__end-values {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  color: var(--fg1);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.report-chart__end-values li { min-inline-size: 0; }
.report-chart__more { min-inline-size: 0; }
.report-chart__more summary {
  min-block-size: var(--target-min);
  padding-block: var(--space-2);
  cursor: pointer;
  overflow-wrap: anywhere;
}
.report-chart__more[open] .report-chart__bars { margin-block-start: var(--space-2); }

.report-chart-panels { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }

@media (min-width: 1201px) {
  .report-chart-panels,
  :where(.report-frame, .report-frame *):has(> .report-chart + .report-chart) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
    align-items: start;
  }
  :where(.report-frame, .report-frame *):has(> .report-chart + .report-chart) > :not(.report-chart) { grid-column: 1 / -1; }
}
@media (forced-colors: active) {
  .report-chart__swatch[data-series="comparison"] { border-color: CanvasText; }
  .report-chart__series[data-series="comparison"] path,
  .report-chart__mark[data-series="comparison"], .report-chart__hatch { stroke: CanvasText; color: CanvasText; }
  .report-chart__series[data-series="comparison"] circle, .report-chart__dot { fill: CanvasText; }
}

.report-chart__band { fill: var(--spine-amber-line); fill-opacity: 0.15; }
.report-chart__heatmap td { background: var(--surface-raised); }
.report-chart__heat-cell {
  display: block;
  padding-block: var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--ink-1);
  background: color-mix(in srgb, var(--accent) var(--report-chart-shade, 0%), var(--surface-raised));
  font-weight: 600;
  text-align: center;
}
.report-chart__heat-cell[data-step="0"] { background: var(--accent-soft); }
.report-chart__heat-cell[data-step="1"] {
  background: color-mix(in srgb, var(--accent) 32%, var(--surface-raised));
}
.report-chart__heat-cell[data-step="2"] {
  background: color-mix(in srgb, var(--accent) 88%, var(--accent-fg));
  color: var(--accent-fg);
}
.report-chart__heat-cell[data-step="3"] { background: var(--accent); color: var(--accent-fg); }
.report-chart__heat-cell[data-step="4"] { background: var(--accent-hover); color: var(--accent-fg); }
.report-chart__heat-empty {
  display: block;
  padding: var(--space-2) var(--space-1);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-sm);
  color: var(--fg2);
  text-align: center;
}

@media (pointer: coarse) {
  .report-frame > .page-header .page-header-eyebrow a,
  .report-frame__command-bar .report-frame__tabs a,
  .report-frame__command-bar :is(.report-frame__about, .report-frame__tools) > summary {
    min-block-size: var(--target-min);
  }
}

@media (max-width: 48rem) {
  .report-frame__command-bar {
    position: static;
    border-radius: var(--radius-md);
  }
  .report-frame__command-bar .report-frame__navigation {
    flex-wrap: wrap;
    padding-inline: var(--space-2);
  }
  .report-frame__utilities {
    flex-wrap: wrap;
    flex-basis: 100%;
    max-inline-size: 100%;
  }
  .report-frame__command-bar :is(.report-frame__about, .report-frame__tools)[open] {
    flex-basis: 100%;
  }
  .report-frame__command-bar .report-frame__tabs a {
    padding-inline: var(--space-2);
    font-size: var(--text-xs);
  }
  .report-frame__popover {
    position: static;
    margin-block: var(--space-2);
    inline-size: 100%;
    max-inline-size: 100%;
  }
}

@media print {
  .report-frame__command-bar { position: static; }
}
