/* The administrator page. Forma (pinned @echelon-foundry/design-system) owns
   tokens, foundations and components; the Echelon theme (pinned
   @echelon-foundry/echelon-theme, after Forma) supplies Echelon colours,
   then its self-hosted fonts, then its application layer. All from the
   installed packages, never copies. */
@import "../../node_modules/@echelon-foundry/design-system/dist/all.css";
@import "../../node_modules/@echelon-foundry/echelon-theme/dist/echelon.css";
@import "../../node_modules/@echelon-foundry/echelon-theme/dist/echelon-fonts.css";
@import "../../node_modules/@echelon-foundry/echelon-theme/dist/echelon-app.css";
@import "../../node_modules/@echelon-foundry/print-components/src/styles/print.css" print;
@import "../../web-kernel/page.css";

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Focus the page moves itself (limen.focus, `data-focus-target`) after an
   operation answers is shown on :focus, not only :focus-visible: a browser
   may treat programmatic focus after a pointer click as not visible, which
   would leave the person no indicator of where focus went
   (SIG-VIS-PENDING-002). Forma's own focus-ring tokens, in both themes: the
   ring against the page surface is #171a18 on #f2efe7 (light) and #f2efe7 on
   #171a18 (dark), about 15:1 either way; the offset leaves the surface as a
   gap between element and ring. */
[data-focus-target]:focus {
  outline: var(--forma-focus-ring-width, 3px) solid var(--forma-color-focus-ring);
  outline-offset: var(--forma-focus-ring-offset, 2px);
  box-shadow: none;
  scroll-margin: 0.5rem;
}

/* A group's report (WI-0062): a document on screen, and the only thing
   printed while it is shown (Print, or Save as PDF). */
.report-surface { display: block; margin-block-start: 1.5rem; }
@media print {
  .admin:has(> .report-view .report-surface) > :not(.report-view) { display: none !important; }
}

/* ---- "Foundry ledger" page composition (SIG-ECHELON-APP-002) -----------
   Composition only: the app bar, route tabs, panels, chips, figures and
   button emphasis are the Echelon application layer's (echelon-app.css);
   this file places them and defines no forma- or echelon- name. */

/* The application bar: the page's name is its h1, set as the bar's context. */
.admin-bar__title { margin: 0; color: inherit; }
.admin-bar #principal { font-variant-numeric: tabular-nums; }

/* Route tabs: the Forma list markup, laid out as one row of tabs. */
.admin .echelon-nav-tabs {
  margin: 0;
  padding: 0;
  list-style: none;
}
.admin .echelon-nav-tabs li { display: flex; min-inline-size: 0; }
/* A long (translated) area name wraps inside its tab, never off the page. */
.admin .echelon-nav-tabs a { min-inline-size: 0; overflow-wrap: anywhere; }
/* Between a phone and a wide screen the seven areas keep one row by
   tightening each tab's inline padding. */
@media (min-width: 48rem) and (max-width: 63.99rem) {
  .admin .echelon-nav-tabs a { padding-inline: 0.5rem; }
}

/* On a phone the seven areas recompose into a list rather than wrapping
   into ragged rows; the current area keeps its bronze rule, at its start. */
@media (max-width: 47.99rem) {
  .admin-areas .echelon-nav-tabs { flex-direction: column; gap: 0; }
  .admin-areas .echelon-nav-tabs a {
    flex: 1;
    margin-block-end: 0;
    border-block-end: 0;
    border-inline-start: 3px solid transparent;
  }
  .admin-areas .echelon-nav-tabs a[aria-current="page"] { border-inline-start-color: var(--echelon-accent-rule); }
}

/* The dataset's status line: its name as the view's title, then what the
   credential allows, then Refresh and Sign out at the end. */
.admin-status {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
}
.admin-status > p { margin: 0; }
.admin-status > p:not(.admin-status__line) { flex-basis: 100%; max-inline-size: none; }
.admin-status > .admin-status__eyebrow { margin-block-end: -0.25rem; }
.admin-status__line {
  display: grid;
  gap: 0.25rem;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}
.admin-status__dataset { font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.1; }
#credential { color: var(--echelon-text-secondary); }
.admin-status > button:first-of-type { margin-inline-start: auto; }

.admin-title { display: grid; gap: 0.35rem; }
.admin-title > *,
.admin-group-state { margin: 0; }
.admin-title h2 { overflow-wrap: anywhere; }

/* Panels: content spacing comes from the panel body's grid. */
.admin .echelon-panel__body > :is(p, ul, ol, fieldset, h3, h4) { margin: 0; }
.admin .echelon-panel__header > :is(h2, h3) { font-size: 1.375rem; overflow-wrap: anywhere; }
.admin-narrow { max-inline-size: 40rem; }

.admin-plain-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Each unresolved item is marked at its start; the panel's own attention
   border appears only when there are items (hasObligations). */
.admin-obligations li {
  padding-inline-start: 0.75rem;
  border-inline-start: 3px solid var(--forma-color-status-warning);
}

.admin-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
  max-inline-size: 44rem;
}
.admin-figures .echelon-panel__body { gap: 0.35rem; }
.admin-figure-note { color: var(--echelon-text-secondary); font-size: 0.875rem; }

/* Tables on panels: a labelled, scrollable region on narrow screens. */
.admin-table-scroll { overflow-x: auto; }
.admin-table { inline-size: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.admin-table th {
  padding: 0.6rem 0.75rem;
  text-align: start;
  font-size: 0.75rem;
  font-weight: var(--echelon-weight-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--forma-color-text-on-secondary-surface);
  background: var(--echelon-surface-sunken);
  border-block: 1px solid var(--echelon-border-subtle);
  /* Column names stay whole words: the table scrolls in its region rather
     than breaking "Survey" into letters on a phone. */
  overflow-wrap: normal;
  white-space: nowrap;
}
.admin-table td {
  overflow-wrap: normal;
  padding: 0.7rem 0.75rem;
  border-block-end: 1px solid var(--echelon-border-subtle);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-block-end: 0; }
.admin .echelon-panel__body a { overflow-wrap: anywhere; }
.admin .admin-table td :is(a, code) { overflow-wrap: normal; }

/* A destructive confirmation stands apart from the controls around it. */
.admin-confirm {
  padding: 1rem;
  border: 1px solid var(--forma-color-status-danger);
  border-radius: var(--echelon-radius-container);
  background: var(--echelon-surface-raised);
}

/* The group filters: Signal's own fieldset (not Forma's choice group, a
   column it would restyle), the state and identity choices as one wrapping
   row, the survey choice on its own line beneath them. */
.admin .admin-filters {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.admin .admin-filters > legend { flex-basis: 100%; }
.admin .admin-filters > label:has(select) { flex-basis: 100%; max-inline-size: 28rem; }

/* Group tabs bind the engine's view flags, so the current one carries
   aria-current="true" rather than "page"; it is marked the same way. */
.admin-tabs .echelon-nav-tabs a[aria-current="true"] {
  color: var(--forma-color-text-heading);
  font-weight: 800;
  border-block-end-color: var(--echelon-accent-rule);
}
@media (forced-colors: active) {
  .admin-tabs .echelon-nav-tabs a[aria-current="true"] { border-block-end-color: Highlight; border-block-end-style: solid; }
}

/* Actions keep their own width inside panels and confirmations. */
.admin .echelon-panel__body > .forma-button,
.admin .admin-confirm > .forma-button {
  justify-self: start;
  align-self: flex-start;
}

/* Identifiers in code (a group's key, the report state, lineage): Forma
   styles code only inside .forma-site, so the theme's mono face is set here
   rather than left to the browser's default monospace. */
.admin code,
.admin-bar code { font-family: var(--forma-primitive-font-family-mono); font-size: 0.9em; }

/* Reflow at 200% text on a 320 px screen (WCAG 1.4.4/1.4.10; the capture's
   audit on e9eed4e): nothing inside a panel may be wider than the panel.
   Its children may shrink, identifiers (invitation links, the capability
   list) break anywhere, and button labels wrap rather than push the page. */
.admin .echelon-panel__body > *,
.admin .echelon-panel__body .forma-stack > *,
.admin .draft-fields > *,
.admin .admin-confirm > * { min-inline-size: 0; max-inline-size: 100%; }
.admin code { overflow-wrap: anywhere; }
.admin .echelon-panel .forma-button,
.admin .admin-status .forma-button { white-space: normal; max-inline-size: 100%; overflow-wrap: anywhere; }
.admin .admin-plain-list > li { min-inline-size: 0; }
/* On the narrowest screens the panel's inner padding gives way to content. */
@media (max-width: 30rem) {
  .admin .echelon-panel__header,
  .admin .echelon-panel__body { padding-inline: 0.75rem; }
}

/* An unavailable report family is shown as such without fading its text
   below AA (it was opacity: 0.6, 2.42:1): the secondary text colour, and a
   dotted underline instead of a solid one. */
.report-controls a[data-available="false"] {
  color: var(--echelon-text-secondary);
  text-decoration-style: dotted;
}

/* An unresolved item: what is wrong, which group, what resolves it, and the
   page where that happens. */
.admin-obligations li { display: grid; gap: 0.25rem; }
.admin-obligations li > p { margin: 0; }
.admin-obligation__meta { color: var(--echelon-text-secondary); font-size: 0.875rem; }
.admin-obligation__link { justify-self: start; font-weight: 600; }

/* The notice: its sentence, its technical detail and Dismiss share the row
   while there is room and wrap below one another when there is not; each
   keeps a readable width (the detail collapsed into a column of letters at
   834 px when the alert's columns were left to Forma's default). */
.admin .admin-notice__body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem 1rem;
  min-inline-size: 0;
}
.admin .admin-notice__body > #notice-message { flex: 1 1 18rem; margin: 0; min-inline-size: 0; }
.admin .admin-notice__body > details { flex: 1 1 12rem; min-inline-size: 0; }

/* A long view's outcome beside its actions (signal#136 review round 2): a
   quiet copy of the persistence line and the notice's sentence, ruled like
   a margin note; absent while there is nothing to copy. #activity, at the
   top of the page, stays the one that announces. */
.admin .admin-outcome {
  display: grid;
  gap: 0.25rem;
  padding-block: 0.5rem;
  padding-inline: 0.75rem 0;
  border-inline-start: 3px solid var(--echelon-accent-rule);
}
.admin .admin-outcome:not(:has(p)) { display: none; }
.admin .admin-outcome :is(p) { margin: 0; max-inline-size: none; }
.admin .admin-outcome__lines { display: grid; gap: 0.25rem; }
.admin .admin-outcome :is(.admin-outcome__persistence, .admin-outcome__reload) { color: var(--echelon-text-secondary); }
.admin .admin-outcome .admin-outcome__notice { color: var(--forma-color-text-primary); }

/* The activity line sits under the dataset's title, part of the shell. */
.admin .activity > :is(p, div) { margin: 0; }
.admin .activity { color: var(--echelon-text-secondary); }

/* Buttons in table rows keep their label on one line: the table scrolls in
   its region instead (the audit found "Remove" set as a column of letters
   at 834 and 390 px). */
.admin .admin-table :is(td, th) .forma-button { overflow-wrap: normal; white-space: nowrap; }

/* On the narrowest screens buttons and confirmations give their inner
   padding to their labels, so a label breaks between words, not letters. */
@media (max-width: 30rem) {
  .admin .echelon-panel .forma-button { padding-inline: 0.75rem; }
  .admin .admin-confirm { padding: 0.5rem; }
}
/* The lifecycle targets are a list of actions: no bullet, no indent. */
.admin #lifecycle-targets { padding: 0; margin: 0; list-style: none; }

/* ---- Authoring (SIG-ECHELON-APP-002) -----------------------------------
   The draft editor's parts, each on its own panel, in the editor's order. */
.draft-state { margin: 0; }
.draft-editor > .echelon-panel { scroll-margin-block-start: 1rem; }
.admin-rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.5rem;
  border-block-end: 1px solid var(--echelon-border-subtle);
}
.admin-rows li:last-child { border-block-end: 0; }
.admin-title h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
/* On the narrowest screens the editor's numbered lists keep a smaller
   indent and their row buttons a smaller inner padding, so a label breaks
   between words, not letters (the audit's collapse check). */
@media (max-width: 30rem) {
  .admin .draft-panel :is(ol, ul) { padding-inline-start: 1.25rem; }
  .admin .draft-panel .forma-button { padding-inline: 0.5rem; }
}

/* ---- The draft editor's layout (signal#137 review) ---------------------
   One template header with the action group, its outcome and the editor's
   parts to move to; panels two to a row on a wide screen (in reading order,
   left then right), the wide ones across both; fields full width in their
   column up to a readable measure; question rows as structured rows.
   Two to a row from 50rem, so a tablet (834 px) gets them too. */
.draft-head {
  display: grid;
  gap: 0.75rem 1.5rem;
  grid-template-columns: minmax(0, 1fr);
}
.draft-head__title { display: grid; gap: 0.35rem; min-inline-size: 0; }
.draft-head__title > * { margin: 0; }
.draft-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); overflow-wrap: anywhere; }
.draft-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.draft-head > :is(label, .draft-ack, .admin-confirm, .admin-outcome, .draft-parts) { grid-column: 1 / -1; }
@media (min-width: 64rem) {
  .draft-head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .draft-actions { justify-content: flex-end; }
}
.draft-parts__list { list-style: none; margin: 0; padding: 0; }
.admin .draft-parts__link {
  padding: 0.65rem 0.9rem;
  border: 0;
  border-block-end: 3px solid transparent;
  margin-block-end: -1px;
  background: none;
  color: var(--echelon-text-secondary);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: var(--echelon-weight-label);
  cursor: pointer;
}
.admin .draft-parts__link:hover { color: var(--forma-color-text-primary); border-block-end-color: var(--echelon-border-subtle); }
.admin .draft-parts__link:focus-visible { outline: 2px solid var(--forma-color-focus-ring); outline-offset: 2px; }
@media (forced-colors: active) {
  .admin .draft-parts__link { color: LinkText; }
}
.draft-editor .echelon-panel__header h3:focus { outline-offset: 4px; }

/* The editor is Signal's own container (not a Forma stack it would
   restyle): one column of panels, spaced as Forma's stack spaces them, and
   two columns on a wide screen. */
.draft-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--forma-stack-gap, var(--forma-primitive-spacing-4, 1rem));
}
@media (min-width: 50rem) {
  .draft-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: start;
  }
  .draft-editor > :is(.draft-head, .draft-panel--wide) { grid-column: 1 / -1; }
}
.draft-editor .echelon-panel__body > label:not(:has(> input[type="checkbox"], > input[type="radio"])),
.draft-editor .draft-fields > label:not(:has(> input[type="checkbox"], > input[type="radio"])),
.draft-editor .echelon-panel__body > .forma-stack > label:not(:has(> input[type="checkbox"], > input[type="radio"])),
.draft-editor #scoring-authoring > label:not(:has(> input[type="checkbox"], > input[type="radio"])) {
  display: grid;
  gap: 0.35rem;
  justify-self: stretch;
  inline-size: 100%;
  max-inline-size: 40rem;
  font-weight: var(--echelon-weight-label);
}
.draft-editor .echelon-panel__body label :is(input[type="text"], input:not([type]), input[type="number"], textarea, select) {
  inline-size: 100%;
  max-inline-size: 40rem;
  box-sizing: border-box;
  font-weight: normal;
}
.draft-question {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 1rem;
  align-items: start;
  padding-block: 0.75rem;
  border-block-end: 1px solid var(--echelon-border-subtle);
}
.draft-question:last-child { border-block-end: 0; }
.draft-question > p { margin: 0; grid-column: 1; }
.draft-question > .forma-button { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.draft-question__text code { color: var(--echelon-text-secondary); }
.draft-question__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.draft-tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--echelon-surface-sunken);
  color: var(--forma-color-text-on-secondary-surface);
}
@media (forced-colors: active) { .draft-tag { border: 1px solid CanvasText; } }
#draft-questions { list-style: none; padding: 0; margin: 0; }
/* A draft panel's body is the theme's panel body, unrestyled (a grid whose
   one track fills the panel, so fields take its width up to the measure).
   A wide panel's fields are Signal's own column inside it (.draft-fields),
   as scoring's authoring is (.draft-scoring): one track on a narrow screen,
   and on a wide one the fields flow in columns, in reading order, while
   lists, headings, notes, tables and sub-sections take the whole row. */
.draft-editor :is(.draft-fields, .draft-scoring) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  min-inline-size: 0;
}
.draft-editor :is(.draft-fields, .draft-scoring) > :is(p, ul, ol, fieldset, h3, h4) { margin: 0; }
.draft-editor :is(.draft-fields, .draft-scoring) > .forma-button { justify-self: start; }
/* Scoring's sub-sections (How sections score, Interpretations, Overall
   score) each start with space and a rule, so they do not run together;
   the sections' scoring is a plain list, not bullets (signal#141 review). */
.draft-editor .draft-scoring__heading:not(:first-child) {
  margin-block-start: 1rem;
  padding-block-start: 1rem;
  border-block-start: 1px solid var(--echelon-border-subtle);
}
.draft-editor .draft-scoring__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
@media (min-width: 50rem) {
  .draft-panel--wide :is(.draft-fields, .draft-scoring) {
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 0.75rem 1.25rem;
    align-items: end;
  }
  .draft-panel--wide :is(.draft-fields, .draft-scoring) > :not(label, button, template) { grid-column: 1 / -1; }
}
@media (max-width: 30rem) {
  .draft-editor .draft-panel > :is(.echelon-panel__header, .echelon-panel__body) { padding-inline: 0.875rem; }
  .draft-editor { gap: 1rem; }
}
/* On a narrow screen the parts wrap onto further rows, as the route tabs do
   (signal#137 review: a sideways-scrolling row cut "Presentation" off). */
@media (max-width: 48rem) {
  .admin .draft-parts__link { padding-inline: 0.5rem; }
}
/* A phone (and 320 px with 200% text): Remove goes under the question, so
   the question keeps the row's width (the audit found it set four letters a
   line beside the button). */
@media (max-width: 30rem) {
  .draft-question { grid-template-columns: minmax(0, 1fr); }
  .draft-question > .forma-button { grid-column: 1; grid-row: auto; justify-self: start; }
}
/* The warnings' acknowledgement names them and leads to them (signal#137
   review): the checkbox, the warnings' codes, and a way to Validation. */
.draft-ack { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; }
.draft-ack > label { display: inline-flex; align-items: center; gap: 0.5rem; }
#draft-warning-summary { color: var(--echelon-text-secondary); font-family: var(--forma-primitive-font-family-mono); font-size: 0.875rem; overflow-wrap: anywhere; }

/* ---- Results, scoring and report (SIG-ECHELON-APP-002 (e), WI-0123) -----
   Figures keep whole words and numbers: tables scroll in a labelled,
   focusable region on a narrow screen instead of setting "Mean", "Section"
   or "75.0" a few letters a line (the capture's audit at 390 px and at
   320 px with 200% text). */
.admin .admin-table--figures :is(th, td) { white-space: nowrap; overflow-wrap: normal; }
.admin #scoring > .echelon-panel .echelon-panel__body > * { margin: 0; }
.admin #report-snapshots .echelon-panel__body > :is(p, ul) { margin: 0; }

/* Section means, as the "foundry ledger" results compose them (signal#140
   review): a section's name, a bar for the engine's value and the value
   itself, in rows; on a narrow screen the name takes its own line above the
   bar. One colour for every bar: each row is named, so colour carries no
   meaning; a value that cannot be shown draws no bar and says why. */
.admin .admin-figure { margin: 0; display: grid; gap: 0.75rem; min-inline-size: 0; }
.admin .admin-figure__caption { color: var(--echelon-text-secondary); font-size: 0.875rem; }
.admin .admin-figure__note:empty { display: none; }
.admin .admin-figure__note { margin: 0; color: var(--echelon-text-secondary); font-size: 0.875rem; }
.admin .admin-means { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.admin .admin-means__row {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) minmax(6rem, 1fr) minmax(3.5rem, auto);
  gap: 0.5rem 1rem;
  align-items: center;
}
.admin .admin-means__name { overflow-wrap: break-word; min-inline-size: 0; }
.admin .admin-means__value {
  font: 500 1rem/1.2 var(--forma-primitive-font-family-mono);
  text-align: end;
  white-space: nowrap;
}
/* A value that cannot be shown: its reason, in words, where the bar would be. */
.admin .admin-means__row[data-unavailable="true"] .admin-means__value {
  grid-column: 2 / -1;
  text-align: start;
  white-space: normal;
  font: inherit;
  color: var(--echelon-text-secondary);
}
.admin .admin-meter {
  appearance: none;
  inline-size: 100%;
  block-size: 0.75rem;
  border: 0;
  border-radius: 99px;
  background: var(--echelon-surface-sunken);
  overflow: hidden;
}
.admin .admin-meter::-webkit-meter-bar { background: var(--echelon-surface-sunken); border: 0; border-radius: 99px; block-size: 0.75rem; }
.admin .admin-meter::-webkit-meter-optimum-value,
.admin .admin-meter::-webkit-meter-suboptimum-value,
.admin .admin-meter::-webkit-meter-even-less-good-value { background: var(--echelon-accent-rule); border-radius: 99px; }
.admin .admin-meter::-moz-meter-bar { background: var(--echelon-accent-rule); border-radius: 99px; }
@media (forced-colors: active) { .admin .admin-meter { forced-color-adjust: auto; appearance: auto; } }
@media (max-width: 40rem) {
  .admin .admin-means__row { grid-template-columns: minmax(0, 1fr) minmax(3.5rem, auto); }
  .admin .admin-means__name,
  .admin .admin-means__row[data-unavailable="true"] .admin-means__value { grid-column: 1 / -1; }
}
/* The results' quiet options sit beside their heading; a drilled-in
   section's distribution follows the means, under its own heading. */
.admin .admin-option { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.875rem; }
/* A field option: its name above its control, the pair as wide as there is
   room for, up to a measure (the control keeps Forma's own width rule). */
.admin .admin-option--field { display: grid; gap: 0.25rem; flex: 1 1 10rem; max-inline-size: 16rem; min-inline-size: 0; }
.admin .admin-distribution { border-block-start: 1px solid var(--echelon-border-subtle); padding-block-start: 1rem; }
.admin .admin-distribution__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1rem; }
.admin .admin-distribution__head h4 { margin: 0; }
.admin .admin-distribution__head .forma-actions { margin-inline-start: auto; }

/* The report on screen (print keeps Folio's own layout): figures as a
   definition grid, methodology and summary as prose with a measure, and a
   table that, where its box is narrow, shows each row as a card naming its
   figures, so nothing scrolls sideways and no heading is cut off. */
@media screen {
  .admin .report-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
    gap: 0.75rem;
    margin: 0;
  }
  .admin .report-facts > div {
    display: grid;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--echelon-border-subtle);
    border-radius: var(--echelon-radius-container);
    background: var(--echelon-surface-raised);
  }
  .admin .report-facts dt { color: var(--echelon-text-secondary); font-size: 0.875rem; }
  .admin .report-facts dd { margin: 0; font: 500 1.5rem/1.2 var(--forma-primitive-font-family-display); color: var(--forma-color-text-heading); }
  .admin .report-prose { max-inline-size: 70ch; line-height: 1.6; }
  /* Its one track never grows to its longest word: at 320 px with 200%
     text a method's "Responsiveness:" is wider than the column and wraps
     inside it instead of pushing the page sideways. */
  .admin ul.report-prose { padding-inline-start: 1.25rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .admin .report-prose { overflow-wrap: break-word; }
  /* The table's box decides between table and cards, so it never scrolls
     sideways at any width or text size and needs no focusable region. */
  .admin .report-table { container: report-table / inline-size; }
  .admin .report-cards { border-collapse: collapse; inline-size: 100%; }
  .admin .report-cards :is(th, td) {
    overflow-wrap: break-word;
    padding: 0.6rem 0.75rem;
    text-align: start;
    border-block-end: 1px solid var(--echelon-border-subtle);
  }
  .admin .report-cards thead th { color: var(--echelon-text-secondary); font-size: 0.8125rem; }
  /* A section title may be one long unbroken word: it breaks inside the
     word rather than widen the table past the page (signal#142 review). */
  .admin .report-cards th[scope="row"] { overflow-wrap: anywhere; hyphens: auto; }
  .admin .report-cards td { font-variant-numeric: tabular-nums; }
}
@container report-table (max-width: 44rem) {
  .admin .report-cards thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .admin .report-cards,
  .admin .report-cards tbody { display: grid; gap: 0.75rem; }
  .admin .report-cards tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--echelon-border-subtle);
    border-radius: var(--echelon-radius-container);
  }
  /* The card's heading starts where its figures do: the card's padding is
     the only inset (signal#140 review). */
  .admin .report-cards th[scope="row"] { grid-column: 1 / -1; text-align: start; padding: 0 0 0.5rem; }
  .admin .report-cards td { display: contents; }
  .admin .report-cards td::before { content: attr(data-label); color: var(--echelon-text-secondary); }
}
