/* Account and admin. Tokens only. --bad is for a destructive
   confirmation or an error, never for status. */

input.sr {
  width: 1px;
  min-height: 1px;
  padding: 0;
  border: 0;
}

#who[role="link"] {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  max-width: 12rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.pw-banner {
  margin: 0 auto;
  max-width: var(--measure, 72ch);
  padding: var(--space-2, 0.5rem) var(--space-4, 1rem);
  border-bottom: 1px solid var(--line, currentColor);
  font-size: 0.92em;
  color: var(--muted, inherit);
  text-align: center;
}

/* THE EMAIL BANNER (founder, 23 Nov 2026, lane S1): "verification is a dismissible
   banner until day 7, then the existing #/verify-pending wall".
   A quiet single row above the page, in the product's own greyscale — it is a reminder,
   not an alarm, and `email-banner` carries no colour at all. On a phone the two controls
   wrap under the sentence rather than squeezing it into a column two words wide, which
   is what `flex-wrap` plus `min-width: 0` on the text does. */
.email-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
  margin: 0 auto;
  max-width: var(--measure, 72ch);
  padding: var(--space-2, 0.5rem) var(--space-4, 1rem);
  border-bottom: 1px solid var(--line, currentColor);
  font-size: 0.92em;
  color: var(--muted, inherit);
}

.email-banner[hidden] { display: none; }

.email-banner-text { min-width: 0; flex: 1 1 18rem; }
.email-banner-text b { color: var(--ink, inherit); font-weight: 600; }

.email-banner-acts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2, 0.5rem);
  flex: 0 0 auto;
}

/* The banner's own buttons are the small size: a full-weight primary control at the top
   of every page would compete with the page's real action. */
.email-banner-acts .btn.small {
  padding: 0.2rem 0.65rem;
  font-size: 0.86em;
}

.field-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
}

.hint {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-size: var(--step--1);
  line-height: 1.45;
}

.hint.warn { color: var(--bad); }

.account-facts {
  margin: var(--space-5) 0 0;
}

.account-facts div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
  min-height: var(--tap);
  border-top: 1px solid var(--faint);
  border-top-color: color-mix(in srgb, var(--fg) 12%, transparent);
  padding: var(--space-2) 0;
}

.account-facts div:last-child {
  border-bottom: 1px solid var(--faint);
  border-bottom-color: color-mix(in srgb, var(--fg) 12%, transparent);
}

.account-facts dt {
  color: var(--muted);
  font-size: var(--step--1);
}

.account-facts dd { margin: 0; }

@media (max-width: 719px) {
  .account-facts div {
    grid-template-columns: 1fr;
    gap: 0;
    align-items: start;
    padding: var(--space-3) 0;
  }
}

.admin-page {
  width: min(100%, 76rem);
  margin-inline: auto;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

@media (max-width: 719px) {
  .admin-tabs {
    display: grid;
    /* `auto-fit` rather than a fixed 4: analytics lanes append tabs
       (admin_analytics_contract.md), and a hardcoded count leaves the extra one
       stranded on its own row at phone width. */
    grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  }

  .admin-tabs .btn {
    min-width: 0;
    padding-inline: var(--space-1);
    font-size: var(--step--1);
  }
}

.admin-tabs button[aria-selected="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.admin-panel { margin-top: var(--space-5); }

.admin-tools,
.admin-sort {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.admin-tools .field,
.admin-sort .field {
  margin-top: 0;
  flex: 1 1 14rem;
}

.admin-sort { display: none; }

.figures.admin-stats {
  grid-template-columns: 1fr 1fr;
}

.figures.admin-stats dd.is-missing {
  font-family: var(--font-ui);
  font-size: var(--step-0);
  color: var(--muted);
  letter-spacing: 0;
}

@media (min-width: 720px) {
  .figures.admin-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 720px) {
  table.admin-users { min-width: 72rem; }
}

table.admin-users th button {
  appearance: none;
  width: 100%;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: inherit;
  cursor: pointer;
}

table.admin-users .sort-mark {
  color: var(--faint);
  font-weight: 500;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-width: 12rem;
}

.admin-actions .btn {
  white-space: normal;
  text-align: center;
}

.btn.danger {
  background: var(--bad);
  color: var(--bg);
  border-color: var(--bad);
}

.req + .req,
.audit-group + .audit-group { margin-top: var(--space-5); }

.req-lines {
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: var(--step--1);
  line-height: 1.5;
}

.req-lines a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.req-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* ------------------------------------------------------------- the welcome
   What happened to the message, on the request it belongs to. Deliberately the
   quietest block on the card: a line of text and, when there is something to
   retry, one button. No colour of its own — a failure is named in words, because
   a red badge on an approved request would read as though the decision had gone
   wrong, and it has not: the account exists either way. */

.req-welcome {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--faint);
  border-top-color: color-mix(in srgb, var(--fg) 12%, transparent);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3);
}

.req-welcome-line {
  margin: 0;
  font-size: var(--step--1);
  color: var(--muted);
}

.req-welcome.is-sent .req-welcome-line { color: var(--fg); }

.req-welcome .btn { font-size: var(--step--1); }

.req-welcome .hint {
  flex-basis: 100%;
  margin: 0;
}

/* ---------------------------------------------------------- provenance
   "Sent from" on a request card, and the sign-in list. Greyscale only: the
   Check: notes are a sentence in the same ink as everything else, because a
   colour here would read as a verdict the panel has not made. The block is a
   quiet box rather than a bordered card — it is evidence attached to the
   request, not a second request. */

.prov {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--faint);
  border-top-color: color-mix(in srgb, var(--fg) 12%, transparent);
}

.prov-h {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.prov-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--fg);
  font-size: var(--step--1);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.prov-lines li + li { margin-top: 1px; }

.prov-raw {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-size: var(--step--1);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.prov-ua {
  margin: var(--space-1) 0 0;
  color: var(--faint);
  font-size: 0.72rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.prov-none {
  margin: 0;
  color: var(--muted);
  font-size: var(--step--1);
  line-height: 1.5;
}

.prov-check {
  margin-top: var(--space-3);
  padding: var(--space-2) 0 0;
  border-top: 1px dashed var(--faint);
  border-top-color: color-mix(in srgb, var(--fg) 22%, transparent);
}

.prov-check p {
  margin: 0;
  font-size: var(--step--1);
  line-height: 1.5;
}

.prov-check p + p { margin-top: var(--space-2); }

.prov-check-h {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.prov-note {
  margin: var(--space-3) 0 0;
  color: var(--faint);
  font-size: var(--step--1);
  line-height: 1.45;
}

.prov-last {
  display: inline;
  font-size: var(--step--1);
  line-height: 1.45;
  color: var(--muted);
}

.seen-list {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  max-height: min(52vh, 30rem);
  overflow-y: auto;
}

.seen-row {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--faint);
  border-top-color: color-mix(in srgb, var(--fg) 12%, transparent);
}

.seen-row:first-child { border-top: 0; }

.seen-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  align-items: baseline;
  color: var(--muted);
  font-size: var(--step--1);
}

/* The kind is the one word that distinguishes a successful sign-in from a
   failed one, so it is set at full ink rather than muted. */
.seen-kind {
  color: var(--fg);
  font-weight: 600;
}

.seen-where {
  margin: var(--space-1) 0 0;
  font-size: var(--step--1);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.prov-check-line {
  margin: var(--space-1) 0 0;
  font-size: var(--step--1);
  line-height: 1.45;
}

@media (max-width: 719px) {
  .prov-ua { display: none; }
  .seen-list { max-height: none; }
}

.audit {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
}

.audit li {
  padding: var(--space-4) 0;
  border-top: 1px solid var(--faint);
  border-top-color: color-mix(in srgb, var(--fg) 12%, transparent);
}

.audit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  color: var(--muted);
  font-size: var(--step--1);
}

.audit-action {
  font-weight: 600;
  color: var(--fg);
}

.dialog-back {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding:
    max(var(--space-4), env(safe-area-inset-top))
    max(var(--space-4), env(safe-area-inset-right))
    max(var(--space-4), env(safe-area-inset-bottom))
    max(var(--space-4), env(safe-area-inset-left));
  background: color-mix(in srgb, var(--fg) 32%, transparent);
}

.dialog {
  width: min(100%, 32rem);
  max-height: min(92dvh, 44rem);
  overflow: auto;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5);
}

.dialog h2 { margin-bottom: var(--space-3); }

.secret {
  margin-top: var(--space-2);
  padding: var(--space-3);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
  user-select: text;
  white-space: pre-wrap;
}

@media (min-width: 720px) {
  .dialog-back { align-items: center; }
  .dialog { padding: var(--space-6); }
}

@media (max-width: 719px) {
  .admin-sort { display: flex; }

  .tabbar:has([data-nav="admin"]) a {
    font-size: max(13px, var(--step--1));
    letter-spacing: -0.03em;
    padding-inline: 1px;
    text-align: center;
    line-height: 1.15;
  }

  table.admin-users thead { display: none; }

  table.admin-users,
  table.admin-users tbody,
  table.admin-users tr,
  table.admin-users th,
  table.admin-users td {
    display: block;
    width: 100%;
  }

  table.admin-users tr {
    margin: 0 0 var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    border: 1px solid var(--faint);
    border-color: color-mix(in srgb, var(--fg) 12%, transparent);
    border-radius: var(--radius);
  }

  table.admin-users th,
  table.admin-users td {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    min-height: var(--tap);
    text-align: right;
    border: 0;
    border-bottom: 1px solid var(--faint);
    border-bottom-color: color-mix(in srgb, var(--fg) 10%, transparent);
    padding: var(--space-2) 0;
  }

  table.admin-users th::before,
  table.admin-users td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: var(--step--1);
    font-weight: 500;
    text-align: left;
  }

  table.admin-users tr > :last-child { border-bottom: 0; }

  table.admin-users td.admin-actions,
  table.admin-users th.admin-actions {
    justify-content: flex-start;
  }

  table.admin-users td.admin-actions::before {
    flex-basis: 100%;
  }
}

/* ---------------------------------------------------------------- learning
   Admin analytics, lane 2 (`js/admin/learning.js`). Tokens only; the one colour
   is the risk chip, and `--ok` marks a skill that has genuinely reached
   proficient. Charts are SVG written in the tab module, so everything here is
   layout rather than plotting. */

.al { display: grid; gap: var(--space-4); }

.al-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.al-head h2 { margin: 0; }

.al-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.al-csv { white-space: nowrap; }

.al-source {
  margin-top: var(--space-3);
  max-width: 68ch;
}

/* THE DEFINITIONS. One plain sentence per figure, under the panel that prints the
   figure, so a reader never has to guess what a number counts. A two-column list
   at reading width; on a phone the definition sits under its label rather than
   beside it, because a definition wrapped to twenty characters is unreadable. */
.al-defs {
  margin-top: var(--space-3);
  max-width: 68ch;
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) 1fr;
  gap: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
}
.al-defs > div { display: contents; }
.al-defs dt {
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
}
.al-defs dd { margin: 0; }
@media (max-width: 40rem) {
  .al-defs { grid-template-columns: 1fr; }
  .al-defs dt { margin-top: var(--space-2); }
}

.al-panel {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--faint);
  border-top-color: color-mix(in srgb, var(--fg) 12%, transparent);
}

.al-panel h3 { margin-bottom: var(--space-3); }

/* The class table reuses admin.css's phone card layout through `table.data`,
   so only the numeric alignment and the name link need stating. */
.al-table td.num,
.al-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.al-who {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
}

.al-state {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--faint);
  border-color: color-mix(in srgb, var(--fg) 22%, transparent);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  white-space: nowrap;
}

.al-state.is-through {
  border-color: var(--ok);
  color: var(--ok);
}

.al-chip-ok {
  border-color: color-mix(in srgb, var(--fg) 18%, transparent);
  color: var(--muted);
}

.al-chip-risk {
  border-color: var(--bad);
  color: var(--bad);
  font-weight: 600;
}

.al-flag {
  margin-top: var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--faint);
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
}

.al-flag h3 { margin-bottom: var(--space-2); }

.al-flag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.al-flag-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
}

.al-flag-list .hint { margin: 0; }

/* -- charts ---------------------------------------------------------------- */

.al-chart {
  margin: var(--space-4) 0 0;
  color: var(--fg);
}

.al-chart svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  overflow: visible;
}

/* ---------------------------------------------------------------- security */
/* The security tab (lane 4). Monochrome only; `--bad` appears solely on an
   error, per the project's interface rule. Charts are hand-drawn SVG, so the
   only styling they need is a colour and a width. */

.sec { display: grid; gap: var(--space-6); }

.sec-tiles { margin: 0; }

.sec .figures.sec-tiles-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--space-3);
  margin: 0;
}

.sec-tile {
  border: 1px solid var(--faint);
  border-color: color-mix(in srgb, var(--fg) 12%, transparent);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
}

.sec-tile dt {
  color: var(--muted);
  font-size: var(--step--1);
}

.sec-tile dd {
  margin: var(--space-1) 0 0;
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
}

.sec-tile-hint { margin-top: var(--space-1); font-size: var(--step--1); }

.sec-flags {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
  font-size: var(--step--1);
  color: var(--muted);
}

.sec-flags li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

.sec-block {
  border-top: 1px solid var(--faint);
  border-top-color: color-mix(in srgb, var(--fg) 12%, transparent);
  padding-top: var(--space-4);
}

.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}

.sec-head h2 { margin: 0; }

.sec-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.sec-controls select { min-height: var(--tap); }

.sec-block h3 {
  margin: var(--space-4) 0 var(--space-2);
  font-size: var(--step-0);
  color: var(--muted);
  font-weight: 600;
}

.sec-chart {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  overflow: visible;
}

.al-chart figcaption { margin-top: var(--space-1); }

/* -- bars ------------------------------------------------------------------ */

.al-bar {
  display: block;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fg) 10%, transparent);
  overflow: hidden;
}

.al-bar-fill {
  display: block;
  height: 100%;
  background: var(--fg);
  opacity: 0.72;
}

.al-stack {
  display: block;
  width: 100%;
  max-width: 22rem;
  height: 10px;
  overflow: visible;
}

.al-mods {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.al-mods li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(6rem, 14rem) auto;
  align-items: center;
  gap: var(--space-3);
}

.al-mod-name {
  overflow-wrap: anywhere;
  font-size: var(--step--1);
}

.al-mod-num {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--muted);
  white-space: nowrap;
}

.al-details { margin-top: var(--space-4); }

.al-details summary {
  min-height: var(--tap);
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--muted);
}

.al-when {
  font-family: var(--font-ui);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.al-when.is-overdue { color: var(--bad); font-weight: 600; }
.al-when.is-due { color: var(--fg); font-weight: 600; }
.al-when.is-later { color: var(--muted); }

@media (max-width: 719px) {
  .al-mods li {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: var(--space-1);
  }

  .al-mods .al-bar { grid-column: 1 / -1; }

  .al-table td.num,
  .al-table th.num { text-align: left; }
  color: var(--fg);
  margin: var(--space-3) 0;
  overflow: visible;
}

.sec-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-4);
}

table.sec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}

table.sec-table th,
table.sec-table td {
  text-align: left;
  padding: var(--space-2) var(--space-2);
  border-bottom: 1px solid var(--faint);
  border-bottom-color: color-mix(in srgb, var(--fg) 10%, transparent);
  vertical-align: top;
}

table.sec-table th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

table.sec-table td.num,
table.sec-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

.sec-add {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  align-items: end;
  gap: var(--space-3);
  margin: var(--space-3) 0;
}

.sec-add .field { margin-top: 0; }
.sec-add .form-error,
.sec-add .actions { grid-column: 1 / -1; }

.sec-remove {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.sec-remove .field { margin-top: 0; flex: 1 1 14rem; }

.sec-audit-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.sec-audit-tools .field { margin-top: 0; }

@media (max-width: 719px) {
  table.sec-table thead { display: none; }
  table.sec-table,
  table.sec-table tbody,
  table.sec-table tr,
  table.sec-table td { display: block; width: 100%; }
  table.sec-table tr {
    margin: 0 0 var(--space-3);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--faint);
    border-color: color-mix(in srgb, var(--fg) 12%, transparent);
    border-radius: var(--radius);
  }
  table.sec-table td {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
    border: 0;
    padding: var(--space-1) 0;
    text-align: right;
  }
  table.sec-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 500;
    text-align: left;
  }
}

/* Turnstile's widget host (sign-in and request forms). It starts `hidden` and
   the script reveals it only when the server says a challenge applies, so a
   normal visit paints nothing and makes no third-party request. */
.turnstile-host {
  margin: var(--space-3) 0 0;
  min-height: 0;
}

.turnstile-host:not([hidden]) { min-height: 65px; }

.sec-disclosure {
  margin-top: var(--space-4);
  max-width: 34rem;
}

/* ------------------------------------------------------------ dashboard (ad-)
   The founder's dashboard: Overview, Users, Learning insights, Reports triage,
   Content, Compliance, Billing. Tokens only. Colour appears for exactly two
   things — a probe that is OK or failing (--ok / --bad) — everything else is
   greyscale, so the page survives a theme switch and a greyscale print. */

.ad-overview, .ad-tab { display: grid; gap: var(--space-5); }

.ad-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
}
.ad-bar h2 { margin: 0; }
.ad-bar .hint { margin: var(--space-1) 0 0; max-width: 60ch; }
.ad-bar-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
#ad-range { display: inline-flex; gap: 0; }
.ad-seg-btn { border-radius: 0; margin-left: -1px; min-width: 5rem; }
.ad-seg-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); margin-left: 0; }
.ad-seg-btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.ad-seg-btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); position: relative; }

.ad-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}
@media (max-width: 959px) { .ad-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ad-kpi, .ad-panel {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--fg) 18%, transparent);
  border-radius: 6px;
  padding: var(--space-4);
  min-width: 0;
}
.ad-kpi { display: grid; grid-template-rows: auto auto auto 2.6rem auto; gap: var(--space-1); }
.ad-kpi-title, .ad-panel h3 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.ad-kpi-value {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--step-3);
  line-height: 1.1;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ad-kpi-link { color: inherit; text-decoration: underline; text-underline-offset: 0.12em; text-decoration-thickness: 2px; }
.ad-kpi-meta, .ad-kpi-foot { margin: 0; font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); }
.ad-kpi-foot { color: var(--faint); }
.ad-kpi-spark { color: var(--fg); display: flex; align-items: center; min-height: 2.4rem; }
.ad-kpi-spark .hint { margin: 0; }
.ad-spark { display: block; max-width: 100%; height: auto; }
.ad-delta { font-variant-numeric: tabular-nums; }
.ad-triple { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.ad-triple b { color: var(--fg); font-variant-numeric: tabular-nums; }

.ad-two { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); align-items: start; }
.ad-panel h3 { margin-bottom: var(--space-3); }
.ad-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.ad-panel-head h3 { margin-bottom: 0; }
.ad-source { margin: var(--space-3) 0 0; max-width: 62ch; }
.ad-empty { padding: var(--space-5) var(--space-4); text-align: center; border: 1px dashed color-mix(in srgb, var(--fg) 30%, transparent); border-radius: 6px; }
.ad-empty-title { margin: 0 0 var(--space-1); font-family: var(--font-ui); font-weight: 600; }
.ad-empty .hint { margin: 0 auto; max-width: 52ch; }

.ad-rets, .ad-checks, .ad-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.ad-ret { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: var(--space-1) var(--space-3); align-items: center; font-family: var(--font-ui); }
.ad-ret-label { font-weight: 600; }
.ad-ret-value { font-variant-numeric: tabular-nums; font-weight: 600; }
.ad-ret-n { grid-column: 2 / 4; font-size: var(--step--1); color: var(--muted); }
.ad-legend { grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); margin-top: var(--space-3); font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); }
.ad-legend b { color: var(--fg); }

.ad-pill {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 0.1rem 0.6rem; border-radius: 999px; font-family: var(--font-ui);
  font-size: var(--step--1); font-weight: 600; border: 1px solid currentColor; white-space: nowrap;
}
.ad-pill-ok { color: var(--ok); }
.ad-pill-down { color: var(--bad); }
.ad-pill-degraded { color: var(--fg); }

.ad-check { display: grid; grid-template-columns: 1fr auto; gap: 0 var(--space-3); font-family: var(--font-ui); font-size: var(--step--1); padding-bottom: var(--space-2); border-bottom: 1px solid color-mix(in srgb, var(--fg) 10%, transparent); }
.ad-check-name { font-weight: 600; }
.ad-check-state { font-weight: 600; }
.ad-check-ok .ad-check-state { color: var(--ok); }
.ad-check-bad .ad-check-state { color: var(--bad); }
.ad-check-unknown .ad-check-state { color: var(--muted); }
.ad-check-detail { grid-column: 1 / 3; color: var(--muted); overflow-wrap: anywhere; }
.ad-dl { margin: 0; display: grid; gap: var(--space-3); }
.ad-dl > div { display: grid; gap: 0.1rem; }
.ad-dl dt { font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); }
.ad-dl dd { margin: 0; overflow-wrap: anywhere; }

.ad-badge {
  display: inline-block; min-width: 1.25rem; margin-left: var(--space-2); padding: 0 0.35rem;
  border-radius: 999px; background: var(--bg); color: var(--fg); border: 1px solid currentColor;
  font-size: 0.72rem; line-height: 1.2rem; font-weight: 700; text-align: center;
}
.admin-tabs button:not([aria-selected="true"]) .ad-badge { background: var(--fg); color: var(--bg); border-color: var(--fg); }

@media (max-width: 719px) {
  .ad-kpis { gap: var(--space-3); }
  .ad-kpi { padding: var(--space-3); }
  .ad-kpi-value { font-size: var(--step-2); }
  .ad-two { grid-template-columns: 1fr; }
  .ad-seg-btn { min-width: 0; flex: 1; }
  #ad-range { width: 100%; }
  .ad-bar-tools { width: 100%; }
}
@media (max-width: 400px) { .ad-kpis { grid-template-columns: 1fr; } }

/* Users tab: filters and the detail drawer. */
.admin-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-4); }
.admin-filters .field { margin-top: 0; flex: 1 1 11rem; }
.admin-filters .btn { flex: 0 0 auto; }

.ad-drawer-back { position: fixed; inset: 0; background: color-mix(in srgb, var(--fg) 45%, transparent); z-index: 80; }
.ad-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 81;
  width: min(34rem, 100%); background: var(--bg); color: var(--fg);
  border-left: 1px solid var(--line); box-shadow: -8px 0 32px color-mix(in srgb, var(--fg) 22%, transparent);
  display: flex; flex-direction: column; outline: none;
}
body.ad-drawer-open { overflow: hidden; }
.ad-drawer-bar { display: flex; justify-content: flex-end; padding: var(--space-3) var(--space-4); border-bottom: 1px solid color-mix(in srgb, var(--fg) 14%, transparent); }
.ad-drawer-body { overflow-y: auto; padding: var(--space-4) var(--space-5) var(--space-7); display: grid; gap: var(--space-3); align-content: start; }
.ad-drawer-body h2 { margin: 0; overflow-wrap: anywhere; }
.ad-drawer-body h3 { margin: var(--space-4) 0 0; font-family: var(--font-ui); font-size: var(--step--1); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ad-drawer-head { display: grid; gap: var(--space-1); }
.ad-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; }
.ad-chip { display: inline-block; padding: 0.05rem 0.55rem; border: 1px solid var(--line); border-radius: 999px; font-family: var(--font-ui); font-size: var(--step--1); }
.ad-chip-solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.ad-chip-warn { border-style: dashed; }
.ad-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--space-3) var(--space-4); }
.ad-facts dt { font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); }
.ad-facts dd { margin: 0; overflow-wrap: anywhere; }
.ad-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.ad-list li { display: grid; gap: 0.1rem; padding: var(--space-2) 0; border-bottom: 1px solid color-mix(in srgb, var(--fg) 10%, transparent); font-size: var(--step--1); font-family: var(--font-ui); }
.ad-list li .btn { justify-self: start; margin-top: var(--space-1); }
.ad-drawer-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
table.ad-mini { font-size: var(--step--1); }
table.ad-mini td.num, table.ad-mini th.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 719px) {
  .ad-drawer { width: 100%; border-left: 0; }
  .ad-drawer-body { padding-inline: var(--space-4); }
  .admin-filters .field { flex-basis: 45%; }
}

@media (min-width: 720px) {
  .admin-actions { min-width: 15rem; gap: var(--space-1); }
  .admin-actions .btn { min-height: 2rem; padding: 0.1rem 0.55rem; font-size: var(--step--1); }
}

/* Learning: view switch, insights. */
.al-views { display: inline-flex; margin-bottom: var(--space-4); }
.al-views .ad-seg-btn { min-width: 6rem; }
.ad-inline-field { margin-top: 0; min-width: 14rem; }
.ad-chart { color: var(--fg); margin-bottom: var(--space-3); max-width: 40rem; }
.ad-chart .hint { margin: var(--space-1) 0 0; }
.ad-cell-meter { display: grid; grid-template-columns: minmax(3rem, 6rem) auto; align-items: center; gap: var(--space-2); color: var(--fg); }
.ad-cell-meter span { font-variant-numeric: tabular-nums; }

/* Question and lesson previews (admin/preview.js). */
.ad-modal {
  position: fixed; z-index: 81; top: 5vh; left: 50%; transform: translateX(-50%);
  width: min(46rem, calc(100% - 1.5rem)); max-height: 90vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 12px 40px color-mix(in srgb, var(--fg) 28%, transparent); outline: none;
}
.ad-modal-head, .ad-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.ad-modal-head { border-bottom: 1px solid color-mix(in srgb, var(--fg) 14%, transparent); }
.ad-modal-foot { border-top: 1px solid color-mix(in srgb, var(--fg) 14%, transparent); justify-content: flex-end; }
.ad-modal-head h2 { margin: 0; font-size: var(--step-1); }
.ad-modal-body { padding: var(--space-4); overflow-y: auto; }
.ad-q { display: grid; gap: var(--space-3); }
.ad-q-meta { margin: 0; color: var(--muted); font-family: var(--font-ui); font-size: var(--step--1); }
.ad-q-concept { margin: 0; font-family: var(--font-ui); font-weight: 600; }
.ad-q-prompt p { margin: 0 0 var(--space-2); }
.ad-q-options { margin: 0; padding-left: 1.6rem; display: grid; gap: var(--space-2); }
.ad-q-options li { padding: var(--space-2); border: 1px solid color-mix(in srgb, var(--fg) 14%, transparent); border-radius: var(--radius); }
.ad-q-options li.is-key { border-color: var(--ok); border-width: 2px; }
.ad-q-keymark { color: var(--ok); font-family: var(--font-ui); font-weight: 700; font-size: var(--step--1); }
.ad-q-note { display: block; margin-top: var(--space-1); color: var(--muted); font-family: var(--font-ui); font-size: var(--step--1); }
.ad-q-expl h4, .ad-lesson h4 { margin: 0 0 var(--space-1); font-family: var(--font-ui); font-size: var(--step--1); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ad-lesson-body { max-height: 22rem; overflow-y: auto; padding: var(--space-3); border: 1px solid color-mix(in srgb, var(--fg) 14%, transparent); border-radius: var(--radius); }
.ad-obj { margin: 0 0 var(--space-2); padding-left: 1.2rem; font-family: var(--font-ui); font-size: var(--step--1); }
@media (max-width: 719px) { .ad-modal { top: 0; left: 0; transform: none; width: 100%; max-height: 100%; height: 100%; border-radius: 0; } }

/* Reports triage (admin/reports.js). */
.rt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.rt-row { background: var(--surface); border: 1px solid color-mix(in srgb, var(--fg) 18%, transparent); border-radius: 6px; padding: var(--space-3) var(--space-4); display: grid; gap: var(--space-2); }
.rt-row.is-resolved { background: transparent; }
.rt-row.is-resolved .rt-msg { color: var(--muted); }
.rt-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); font-family: var(--font-ui); }
.rt-head .ad-chip { margin-left: auto; }
.rt-pick { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 1.75rem; font-family: var(--font-ui); font-size: var(--step--1); cursor: pointer; }
.rt-pick input { width: 1.15rem; height: 1.15rem; accent-color: var(--fg); }
.rt-msg { margin: 0; overflow-wrap: anywhere; }
.rt-meta { margin: 0; font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); overflow-wrap: anywhere; }
.rt-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.rt-actions .btn { min-height: 2rem; padding: 0.1rem 0.7rem; font-size: var(--step--1); }
.rt-preview, .rt-thread { border-top: 1px solid color-mix(in srgb, var(--fg) 12%, transparent); padding-top: var(--space-3); }
.rt-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); border: 1px dashed color-mix(in srgb, var(--fg) 28%, transparent); border-radius: 6px; font-family: var(--font-ui); }
.rt-bulk .btn { min-height: 2rem; padding: 0.1rem 0.7rem; font-size: var(--step--1); }
.rt-note-form { display: grid; gap: var(--space-2); margin-top: var(--space-2); }
.rt-note-form textarea { width: 100%; font: inherit; padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--fg); }
.rt-note-form .btn { justify-self: start; }
.rt-filters .field { flex: 1 1 9rem; }
@media (max-width: 719px) { .rt-head .ad-chip { margin-left: 0; } .rt-actions .btn { min-height: var(--tap); } .rt-bulk .btn { min-height: var(--tap); } }

/* Content and Compliance tabs. */
.ct-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); align-items: start; }
.ct-facts { margin-bottom: var(--space-3); }
.ct-big { font-family: var(--font-ui); font-size: var(--step-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.ct-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); padding: var(--space-2) 0; border-top: 1px solid color-mix(in srgb, var(--fg) 10%, transparent); font-family: var(--font-ui); font-size: var(--step--1); }
.ct-h { margin: var(--space-3) 0 var(--space-1); font-family: var(--font-ui); font-size: var(--step--1); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ct-flags { margin: 0; padding-left: 1.1rem; font-family: var(--font-ui); font-size: var(--step--1); display: grid; gap: var(--space-1); }
.cp-tiles { margin: var(--space-3) 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: var(--space-3); }
.cp-tile { display: grid; gap: 0.15rem; padding: var(--space-2) var(--space-3); border: 1px solid color-mix(in srgb, var(--fg) 14%, transparent); border-radius: var(--radius); align-content: start; }
.cp-tile dt { font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); }
.cp-tile dd { margin: 0; font-family: var(--font-ui); font-size: var(--step-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.cp-tile .hint { margin: 0; font-size: 0.75rem; }
.cp-warn { border-width: 2px; border-color: var(--fg); }
.cp-big { margin: 0 0 var(--space-3); font-family: var(--font-ui); font-size: var(--step-3); font-weight: 600; }
.cp-callout { padding: var(--space-3); border: 2px solid var(--fg); border-radius: var(--radius); margin: 0 0 var(--space-3); }
.ad-tally li { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.ad-q-sub { margin: var(--space-2) 0 0; font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); }
.ad-q .is-key { border-color: var(--ok); }

/* K-12 readiness, the commercial-beta bar. A DOMAIN table only (ADR 0015: no book
   identity in an API response). It sits above the per-course cards because it answers
   the question the Content tab exists for at this stage of the product — "can we sell
   this yet" — and a row per domain is the smallest thing that answers it. The six
   columns are the ones the release check reads: in scope, covered, TAUGHT, the number
   of taught sections the 95% bar needs, and the gap between them. */
.k12 { margin-bottom: var(--space-4); }
/* THE HEADLINE IS TWO FACTS, EACH WITH ITS OWN NOUN AND DENOMINATOR.
   "98.5% of 1,774 in-scope sections taught" and "0 of 25 textbooks below 95%"
   are measured over different sets, and a card that prints "98.5%" beside "0 of
   25 books below the bar" reads as one claim contradicted by the other (the
   walkthrough's L-5). Two columns on anything wider than a phone, one on a
   phone, each pair reading number-then-detail. */
.k12-head { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-4); margin: var(--space-3) 0 var(--space-2); }
.k12-head-n { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem; margin: 0; font-family: var(--font-ui); font-size: var(--step--1); }
.k12-head-n b { font-size: var(--step-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.k12-head-n span { color: var(--fg); }
.k12-head-d { grid-row: auto; margin: 0; color: var(--muted); font-family: var(--font-ui); font-size: var(--step--1); }
@media (max-width: 560px) {
  .k12-head { grid-template-columns: minmax(0, 1fr); }
}
.k12-table { width: 100%; border-collapse: collapse; margin: var(--space-3) 0 var(--space-2); font-family: var(--font-ui); font-size: var(--step--1); }
.k12-table th, .k12-table td { padding: var(--space-2) var(--space-2); text-align: left; border-bottom: 1px solid color-mix(in srgb, var(--fg) 10%, transparent); vertical-align: baseline; }
.k12-table thead th { font-weight: 600; color: var(--muted); white-space: nowrap; }
.k12-table tbody th { font-weight: 500; }
.k12-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.k12-where li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-3); }
.k12-where .muted { text-align: right; }

/* A phone cannot show six numeric columns; it can show the three that decide. */
@media (max-width: 719px) {
  .k12-table thead { display: none; }
  .k12-table, .k12-table tbody, .k12-table tr, .k12-table th, .k12-table td { display: block; width: 100%; }
  .k12-table tr { margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent); border-radius: var(--radius); }
  .k12-table th, .k12-table td { border: 0; padding: 0.15rem 0; text-align: left; }
  .k12-table td.num { text-align: left; }
  .k12-table td.num::before { content: attr(data-label) ": "; color: var(--muted); }
}

/* ---------------------------------------------------- the business pulse (Overview)
   Tokens only. The five tiles across the top are the page's first reading pass —
   site health, last deploy, K-12 readiness, open reports, rate-limit activity — so
   they are the only place on the dashboard where a border colour carries status.
   Each tile carries a sr-only word for its state as well as the colour, and the
   value stays in the body font at a size that reads across a desk. */

.ad-tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
}

.ad-tile {
  display: grid;
  gap: 0.15rem;
  align-content: start;
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid color-mix(in srgb, var(--fg) 18%, transparent);
  border-left-width: 4px;
  border-radius: 6px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}
a.ad-tile:hover, a.ad-tile:focus-visible { border-color: var(--fg); }
.ad-tile-ok { border-left-color: var(--ok); }
.ad-tile-warn { border-left-color: var(--fg); border-left-style: dashed; }
.ad-tile-bad { border-left-color: var(--bad); }
.ad-tile-idle { border-left-color: color-mix(in srgb, var(--fg) 30%, transparent); }
.ad-tile-label { margin: 0; font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); }
.ad-tile-value {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.ad-tile-detail { margin: 0; font-family: var(--font-ui); font-size: 0.75rem; color: var(--faint); }

@media (max-width: 1099px) { .ad-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 719px) {
  .ad-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .ad-tile { padding: var(--space-2) var(--space-3); }
  .ad-tile-value { font-size: var(--step-0); }
}
@media (max-width: 420px) { .ad-tiles { grid-template-columns: 1fr; } }

/* The scenario panel: three curves on one scale, and the live count beside them. */
.ad-scen-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.ad-scen-list li {
  display: grid;
  grid-template-columns: 8rem minmax(3rem, 1fr) 4rem;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-ui);
  font-size: var(--step--1);
}
.ad-scen-name { font-weight: 600; }
.ad-scen-bar { color: var(--fg); }
.ad-scen-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.ad-scen-facts { margin: var(--space-3) 0 0; display: grid; gap: 0.15rem; }
.ad-scen-facts dt { font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); }
.ad-scen-facts dd { margin: 0; font-variant-numeric: tabular-nums; }

/* The funnel strip on the Overview: one number per measured stage. */
.ad-fun-strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
}
.ad-fun-strip li { display: grid; gap: 0.1rem; }
.ad-fun-value { font-family: var(--font-ui); font-size: var(--step-1); font-weight: 600; font-variant-numeric: tabular-nums; }
.ad-fun-label { font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); }

/* ------------------------------------------------- the funnel tab, one row a stage */
.ad-fun-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.ad-fun-row {
  display: grid;
  grid-template-columns: 1.75rem 11rem minmax(3rem, 1fr) 6rem 4.5rem;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--fg) 10%, transparent);
  font-family: var(--font-ui);
  font-size: var(--step--1);
}
.ad-fun-row.is-unmeasured { color: var(--muted); }
.ad-fun-step {
  display: inline-grid; place-items: center;
  width: 1.5rem; height: 1.5rem;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.75rem; color: var(--muted);
}
.ad-fun-name { font-weight: 600; }
.ad-fun-bar { display: block; height: 10px; background: color-mix(in srgb, var(--fg) 10%, transparent); border-radius: 999px; overflow: hidden; }
.ad-fun-fill { display: block; height: 100%; width: var(--w, 0%); background: var(--fg); border-radius: 999px; }
.ad-fun-count { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.ad-fun-conv { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.ad-fun-detail { grid-column: 2 / 6; color: var(--muted); }
.ad-fun-why { display: block; color: var(--faint); }

.ad-fun-defs { margin: 0; display: grid; gap: var(--space-3); }
.ad-fun-defs div { display: grid; gap: 0.15rem; padding-bottom: var(--space-2); border-bottom: 1px solid color-mix(in srgb, var(--fg) 10%, transparent); }
.ad-fun-defs dt { font-family: var(--font-ui); font-size: var(--step--1); font-weight: 600; }
.ad-fun-defs dd { margin: 0; color: var(--muted); font-size: var(--step--1); }

@media (max-width: 719px) {
  .ad-fun-row { grid-template-columns: 1.5rem 1fr 4.5rem; }
  .ad-fun-bar { grid-column: 2 / 4; }
  .ad-fun-count, .ad-fun-conv { text-align: left; }
  .ad-fun-conv { grid-column: 3; }
  .ad-fun-detail { grid-column: 2 / 4; }
}

/* --------------------------------------------------------- the founder's page */
.ad-gates { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.ad-gate {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid color-mix(in srgb, var(--fg) 16%, transparent);
  border-radius: 6px;
}
.ad-gate.is-done { border-style: dashed; }
.ad-gate-mark { font-family: var(--font-ui); font-size: var(--step-1); line-height: 1; }
.ad-gate.is-done .ad-gate-mark { color: var(--ok); }
.ad-gate-body { display: grid; gap: 0.2rem; min-width: 0; }
.ad-gate-title { font-family: var(--font-ui); font-weight: 600; }
.ad-gate-why { color: var(--muted); font-size: var(--step--1); }
.ad-gate-link { align-self: center; }

.ad-todo-tiers { display: grid; gap: var(--space-4); }
.ad-todo-tier h4 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.ad-todo-list { list-style: none; margin: 0 0 var(--space-2); padding: 0; display: grid; gap: var(--space-1); }
.ad-todo {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  padding: var(--space-1) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--fg) 8%, transparent);
}
.ad-todo-check { display: flex; align-items: flex-start; gap: var(--space-2); min-height: var(--tap); flex: 1 1 22rem; cursor: pointer; }
.ad-todo-check input { width: 1.15rem; height: 1.15rem; margin-top: 0.55rem; accent-color: var(--fg); flex: 0 0 auto; }
.ad-todo-text { padding-top: 0.4rem; }
.ad-todo.is-done .ad-todo-text { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.ad-todo-due { font-family: var(--font-ui); font-size: var(--step--1); color: var(--faint); }
.ad-todo-add { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ad-todo-add input {
  flex: 1 1 16rem;
  font: inherit;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
}

.ad-compliance-head { margin: 0 0 var(--space-3); font-family: var(--font-ui); }
.ad-comp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.ad-comp {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) 6rem;
  gap: var(--space-2) var(--space-3);
  align-items: baseline;
  padding: var(--space-1) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--fg) 8%, transparent);
  font-family: var(--font-ui);
  font-size: var(--step--1);
}
.ad-comp-id { color: var(--muted); }
.ad-comp-state { text-align: right; font-weight: 600; }
.ad-comp-missing .ad-comp-state { color: var(--bad); }
.ad-comp-partial .ad-comp-state { color: var(--muted); }
@media (max-width: 719px) {
  .ad-comp { grid-template-columns: 3.5rem minmax(0, 1fr); }
  .ad-comp-state { grid-column: 2; text-align: left; }
}

.ad-scen-table { width: 100%; font-size: var(--step--1); }
.ad-price-table { width: 100%; font-size: var(--step--1); }

/* ------------------------------------------- bottlenecks (Learning tab) */
.ad-bn-table .ad-bn-note { display: block; max-width: 34ch; }
.ad-bn-table td, .ad-bn-table th { vertical-align: top; }
.ad-bn-table .btn { min-height: 2rem; padding: 0.1rem 0.6rem; font-size: var(--step--1); }

/* Content tab: what has shipped. */
.ct-merges li { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); justify-content: space-between; }


/* ------------------------------------------------ ADR 0019: written proofs */
/* Monochrome like the rest of the dashboard. The per-skill table is the same
   shape as the K-12 one on purpose: it is the same kind of record — a measured
   bar and where each row sits against it — so a reader compares them without
   learning a second layout. */
.proofs .ad-facts { margin-bottom: var(--space-3); }
.proofs .ad-list .mono { margin-right: var(--space-2); }
.proofs-table { width: 100%; border-collapse: collapse; margin: var(--space-3) 0 var(--space-2); font-family: var(--font-ui); font-size: var(--step--1); }
.proofs-table th, .proofs-table td { padding: var(--space-2) var(--space-2); text-align: left; border-bottom: 1px solid color-mix(in srgb, var(--fg) 10%, transparent); vertical-align: baseline; }
.proofs-table thead th { font-weight: 600; color: var(--muted); white-space: nowrap; }
.proofs-table td.mono { font-family: var(--font-mono); }
@media (max-width: 640px) {
  .proofs-table { display: block; overflow-x: auto; }
}

/* --------------------------------------- ADR 0023: the learning observatory */
/* A ranked list of findings rather than a chart. Monochrome, like the rest of
   the dashboard: severity is carried by ORDER and a weight on the subject line,
   not by colour, because a colour that means "urgent" is decoration the moment a
   reader has seen it twice. */
.ad-obs .ad-obs-head h2 { margin-bottom: var(--space-1); }
.ad-obs-floor { max-width: 62ch; font-size: var(--step--1); color: var(--muted); }
.ad-obs-note { max-width: 62ch; }
.ad-obs-tools { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.ad-obs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.ad-obs-item { border-left: 2px solid color-mix(in srgb, var(--fg) 18%, transparent); padding-left: var(--space-3); }
.ad-obs-item.ad-sev-1 { border-left-width: 4px; border-left-color: var(--fg); }
.ad-obs-sub { margin: 0; font-family: var(--font-mono); font-size: var(--step--1); overflow-wrap: anywhere; }
.ad-obs-item.ad-sev-1 .ad-obs-sub { font-weight: 700; }
.ad-obs-why { margin: var(--space-1) 0; max-width: 68ch; }
.ad-obs-ev { margin: 0; font-size: var(--step--1); color: var(--muted); }
.ad-obs-act { margin: var(--space-1) 0 0; max-width: 68ch; font-size: var(--step--1); }
.ad-obs-report { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mono);
  font-size: var(--step--1); line-height: 1.5; max-height: 70vh; overflow: auto;
  padding: var(--space-3); border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent); }
@media (max-width: 640px) {
  .ad-obs-why, .ad-obs-act, .ad-obs-floor { max-width: none; }
}

/* ------------------------------------------------- the dashboard's banners
   A warning that only appears on the tab it belongs to is a warning a reader
   never sees: an admin who opens Users first must still learn that the
   read-aloud credit is nearly gone. The strip renders above the tab, and its
   tones are the two the rest of admin already uses — `--bad` for "this has
   already stopped working", a dashed rule for "this will". */
.ad-banners { display: grid; gap: var(--space-2); margin: 0 0 var(--space-4); }
.ad-banner { display: grid; gap: 0.15rem; padding: var(--space-3) var(--space-4);
  border: 1px solid color-mix(in srgb, var(--fg) 20%, transparent);
  border-left-width: 3px; border-radius: 2px; font-size: var(--step--1); }
.ad-banner b { font-family: var(--font-ui); letter-spacing: 0.01em; }
.ad-banner span { color: var(--muted); line-height: 1.5; }
.ad-banner-warn { border-left-style: dashed; }
.ad-banner-bad { border-color: var(--bad); border-left-color: var(--bad); }
.ad-banner-bad b { color: var(--bad); }
.ad-panel-head-extra { margin-left: auto; }
.ad-alert-line { margin: var(--space-2) 0 0; font-size: var(--step--1);
  line-height: 1.5; color: var(--fg); font-weight: 600; }
