/* https://site.invalid/admin/engine/ops/style.css */
@scope (html[data-site-styles~="ad6012a420996f79"]) {/* ============================================================================
 * Admin Portal
 *
 * Self-contained, same discipline as apps/admin-provenance/style.css: apps/
 * pages get no platform stylesheet, so the flat design tokens from
 * style/iotclass.css + style/design-system.css are mirrored here rather than
 * imported -- the same ink/line/surface ramp, the same accent, the same
 * "no shadow, no gradient, hairline frames" Khan-flat discipline. Token
 * values and every `--adm-*` custom property are deliberately identical to
 * admin-provenance's own `--pv-*` set (same hex values) so the two admin
 * tools read as siblings, per ADMIN-PORTAL-MIGRATION-PLAN.md §3's "founder
 * should feel these are sibling tools." Each app still owns its file: no
 * shared stylesheet import, per the plan's "self-owned styling" rule.
 *
 * If the platform ramp changes, mirror it here AND in admin-provenance's
 * style.css -- this file is the only place these values appear in this app.
 * ========================================================================== */

:root:where(:scope) {
  /* Mirrored from style/iotclass.css :root — flat interaction system,
     identical values to apps/admin-provenance/style.css's --pv-* set. */
  --adm-surface: #ffffff;
  --adm-surface-muted: #f7f9fb;
  --adm-surface-sunken: #f1f4f7;
  --adm-surface-hover: #fbfcfe;
  --adm-line: #e6e8eb;
  --adm-line-strong: #d2d6dc;
  --adm-ink: #1f2933;
  --adm-ink-soft: #52606d;
  --adm-ink-faint: #7b8794;
  --adm-accent: #1865f2;
  --adm-accent-ink: #0f47ad;
  --adm-accent-soft: #eef3ff;

  /* Semantic states, matched to admin-provenance/admin-unit-reviews.css */
  --adm-green: #16784b;
  --adm-green-soft: #e7f6ee;
  --adm-amber: #9a6500;
  --adm-amber-soft: #fff4d5;
  --adm-red: #b42318;
  --adm-red-soft: #feeceb;
  --adm-gray: #667085;
  --adm-gray-soft: #f2f4f7;

  --adm-radius: 10px;
  --adm-radius-sm: 7px;
  --adm-radius-pill: 999px;

  --adm-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --adm-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --adm-topbar-h: 4.6rem;
  --adm-homebar-h: 2.35rem;
}

*:where(:scope, *),
*:where(:scope, *)::before,
*:where(:scope, *)::after {
  box-sizing: border-box;
}

html:where(:scope),
body:where(:scope, *) {
  margin: 0;
  padding: 0;
  max-width: 100%;
}

body:where(:scope, *) {
  background: var(--adm-surface-muted);
  color: var(--adm-ink);
  font-family: var(--adm-font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden]:where(:scope, *) {
  display: none !important;
}

a:where(:scope, *) {
  color: var(--adm-accent-ink);
  text-decoration: none;
}

:focus-visible:where(:scope, *) {
  outline: 2px solid var(--adm-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.adm-visually-hidden:where(:scope, *),
.adm-sr-only-live:where(:scope, *) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Home bar -------------------------------------------------------- */

.adm-homebar:where(:scope, *) {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  height: var(--adm-homebar-h);
  padding: 0 clamp(1rem, 3vw, 2rem);
  background: var(--adm-surface);
  border-bottom: 1px solid var(--adm-line);
}

.adm-homebar-link:where(:scope, *) {
  color: var(--adm-ink-faint);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.adm-homebar-link:hover:where(:scope, *) {
  color: var(--adm-accent-ink);
  text-decoration: none;
}

/* ---- Gate states ------------------------------------------------------- */

.adm-gate:where(:scope, *) {
  display: grid;
  place-content: center;
  min-height: calc(100vh - var(--adm-homebar-h));
  padding: 2rem;
}

.adm-gate-card:where(:scope, *) {
  max-width: 34rem;
  padding: 2.5rem 2.25rem;
  border: 1px solid var(--adm-line);
  border-top: 4px solid var(--adm-accent);
  border-radius: var(--adm-radius);
  background: var(--adm-surface);
  text-align: center;
}

.adm-gate-card--denied:where(:scope, *) {
  border-top-color: var(--adm-red);
}

.adm-gate-icon:where(:scope, *) {
  width: 2.1rem;
  height: 2.1rem;
  margin-bottom: 0.85rem;
  color: var(--adm-accent);
}

.adm-gate-card--denied .adm-gate-icon:where(:scope, *) {
  color: var(--adm-red);
}

.adm-gate-card h1:where(:scope, *),
.adm-gate-card .adm-gate-title:where(:scope, *) {
  margin: 0 0 0.6rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.adm-gate-card p:where(:scope, *) {
  margin: 0;
  color: var(--adm-ink-soft);
}

.adm-gate-actions:where(:scope, *) {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin: 1.5rem 0 1.25rem;
  flex-wrap: wrap;
}

.adm-gate-foot:where(:scope, *) {
  padding-top: 1.1rem;
  border-top: 1px solid var(--adm-line);
  color: var(--adm-ink-faint) !important;
  font-size: 0.8rem;
}

/* ---- Buttons ------------------------------------------------------------ */

.adm-btn:where(:scope, *) {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--adm-line-strong);
  border-radius: var(--adm-radius-sm);
  background: var(--adm-surface);
  color: var(--adm-ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.adm-btn:hover:where(:scope, *) {
  background: var(--adm-surface-sunken);
  text-decoration: none;
}

.adm-btn:disabled:where(:scope, *) {
  cursor: not-allowed;
  opacity: 0.55;
}

.adm-btn--primary:where(:scope, *) {
  border-color: var(--adm-accent);
  background: var(--adm-accent);
  color: #fff;
}

.adm-btn--primary:hover:where(:scope, *) {
  background: var(--adm-accent-ink);
  border-color: var(--adm-accent-ink);
}

.adm-btn--danger:where(:scope, *) {
  border-color: var(--adm-red);
  color: var(--adm-red);
}

.adm-btn--danger:hover:where(:scope, *) {
  background: var(--adm-red-soft);
}

.adm-linkbtn:where(:scope, *) {
  padding: 0;
  border: 0;
  background: none;
  color: var(--adm-accent-ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

/* ---- Top bar ------------------------------------------------------------ */

.adm-topbar:where(:scope, *) {
  position: sticky;
  top: var(--adm-homebar-h);
  z-index: 30;
  background: var(--adm-surface);
  border-bottom: 1px solid var(--adm-line);
}

.adm-topbar-inner:where(:scope, *) {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  max-width: 1680px;
  margin-inline: auto;
  padding: 1.1rem clamp(1rem, 3vw, 2rem) 1rem;
}

.adm-eyebrow:where(:scope, *) {
  margin: 0 0 0.2rem;
  color: var(--adm-ink-faint);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.adm-brand h1:where(:scope, *) {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.022em;
}

.adm-chip:where(:scope, *) {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--adm-radius-pill);
  background: var(--adm-gray-soft);
  color: var(--adm-ink-soft);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

.adm-chip--admin:where(:scope, *) {
  background: var(--adm-accent-soft);
  color: var(--adm-accent-ink);
}

.adm-chip--teacher:where(:scope, *) {
  background: var(--adm-green-soft);
  color: var(--adm-green);
}

.adm-chip--moderator:where(:scope, *) {
  background: var(--adm-amber-soft);
  color: var(--adm-amber);
}

.adm-error:where(:scope, *),
.adm-load-error:where(:scope, *) {
  max-width: 1680px;
  margin: 1rem auto 0;
  padding: 0.75rem 1rem;
  border: 1px solid #f3b6b1;
  border-radius: var(--adm-radius-sm);
  background: var(--adm-red-soft);
  color: var(--adm-red);
  font-size: 0.88rem;
}

.adm-load-error:where(:scope, *) {
  margin: 0 0 1rem;
}

/* ---- Shell / nav --------------------------------------------------------- */

.adm-shell:where(:scope, *) {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  max-width: 1680px;
  margin-inline: auto;
  padding: 1.15rem clamp(1rem, 3vw, 2rem) 3rem;
}

.adm-nav:where(:scope, *) {
  padding: 0.6rem 0.6rem 0.35rem;
  border: 1px solid var(--adm-line);
  border-radius: var(--adm-radius);
  background: var(--adm-surface);
}

.adm-nav-groups:where(:scope, *) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.15rem;
}

.adm-nav-group:where(:scope, *) {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.adm-nav-group-label:where(:scope, *) {
  margin: 0;
  color: var(--adm-ink-faint);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.adm-nav-chips:where(:scope, *) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.adm-navtab:where(:scope, *) {
  padding: 0.32rem 0.62rem;
  border: 1px solid var(--adm-line);
  border-radius: var(--adm-radius-pill);
  background: var(--adm-surface-muted);
  color: var(--adm-ink-soft);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.adm-navtab:hover:where(:scope, *) {
  color: var(--adm-ink);
  border-color: var(--adm-line-strong);
}

.adm-navtab.is-active:where(:scope, *) {
  border-color: var(--adm-accent);
  background: var(--adm-accent-soft);
  color: var(--adm-accent-ink);
}

.adm-field.adm-nav-select-field:where(:scope, *) {
  display: none;
  padding: 0 0.6rem 0.6rem;
}

.adm-field:where(:scope, *) {
  display: block;
}

.adm-field > span:where(:scope, *) {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--adm-ink-faint);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.adm-field input:where(:scope, *),
.adm-field select:where(:scope, *) {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--adm-line-strong);
  border-radius: var(--adm-radius-sm);
  background: var(--adm-surface);
  color: var(--adm-ink);
  font: inherit;
  font-size: 0.9rem;
}

.adm-field input:where(:scope, *)::placeholder {
  color: var(--adm-ink-faint);
}

/* ---- Panels --------------------------------------------------------------
 * Each mounted section is a plain card-free vertical stack -- panel content
 * (stat rows, tables) provides its own card treatment; the panel itself is
 * just the layout container app.js setPanel() toggles [hidden] on. */

.adm-panel:where(:scope, *) {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.adm-panel-head:where(:scope, *) {
  padding-bottom: 0.2rem;
}

.adm-panel-head h2:where(:scope, *) {
  margin: 0.15rem 0 0.4rem;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.adm-panel-lede:where(:scope, *) {
  margin: 0;
  max-width: 74ch;
  color: var(--adm-ink-soft);
  font-size: 0.92rem;
}

/* ---- Placeholder panel (unmigrated slices) -------------------------------
 * Honest "not built yet" card -- never a fake/empty table, never silently
 * missing from the nav. Matches the founder-facing framing in
 * ADMIN-PORTAL-MIGRATION-PLAN.md §6's build sequence. */

.adm-placeholder:where(:scope, *) {
  max-width: 42rem;
  padding: 2rem 2.1rem;
  border: 1px dashed var(--adm-line-strong);
  border-radius: var(--adm-radius);
  background: var(--adm-surface);
}

.adm-placeholder h2:where(:scope, *) {
  margin: 0.15rem 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.012em;
}

.adm-placeholder p:where(:scope, *) {
  margin: 0;
  color: var(--adm-ink-soft);
  font-size: 0.92rem;
  line-height: 1.65;
}

.adm-placeholder code:where(:scope, *) {
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  background: var(--adm-surface-sunken);
  font-family: var(--adm-mono);
  font-size: 0.85em;
}

/* ---- Stat row / stat box (Teacher Applications, Content Reviews) --------- */

.adm-stats-row:where(:scope, *) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
}

.adm-stat-box:where(:scope, *) {
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--adm-line);
  border-radius: var(--adm-radius);
  background: var(--adm-surface);
}

.adm-stat-value:where(:scope, *) {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.adm-stat-value--green:where(:scope, *) {
  color: var(--adm-green);
}

.adm-stat-value--red:where(:scope, *) {
  color: var(--adm-red);
}

.adm-stat-label:where(:scope, *) {
  margin-top: 0.2rem;
  color: var(--adm-ink-faint);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Sub-caption under a stat tile's label -- e.g. "+3 new users in the last
   7 days". Shared by Dashboard and the Users panel's summary row (both
   built through app.js's statTilesHtml()). */
.adm-stat-sub:where(:scope, *) {
  margin-top: 0.3rem;
  color: var(--adm-ink-faint);
  font-size: 0.72rem;
}

/* ---- Quick links (Dashboard) ---------------------------------------------- */

.adm-quicklinks:where(:scope, *) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.65rem;
}

.adm-quicklink:where(:scope, *) {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--adm-line);
  border-radius: var(--adm-radius);
  background: var(--adm-surface);
  color: inherit;
}

.adm-quicklink:hover:where(:scope, *) {
  border-color: var(--adm-accent);
  background: var(--adm-accent-soft);
  text-decoration: none;
}

.adm-quicklink-label:where(:scope, *) {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--adm-ink);
}

.adm-quicklink-desc:where(:scope, *) {
  color: var(--adm-ink-faint);
  font-size: 0.78rem;
  line-height: 1.4;
}

/* ---- Pagination (Users) ---------------------------------------------------- */

.adm-pagination:where(:scope, *) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.adm-page-info:where(:scope, *) {
  color: var(--adm-ink-faint);
  font-size: 0.82rem;
}

/* ---- Section header / empty state ---------------------------------------- */

.adm-section-header:where(:scope, *) {
  margin-top: 0.4rem;
}

.adm-section-title:where(:scope, *) {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.008em;
}

.adm-empty:where(:scope, *) {
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--adm-line-strong);
  border-radius: var(--adm-radius-sm);
  background: var(--adm-surface);
  color: var(--adm-ink-faint);
  font-size: 0.86rem;
}

/* ---- Tables --------------------------------------------------------------- */

.adm-table-wrap:where(:scope, *) {
  overflow-x: auto;
  border: 1px solid var(--adm-line);
  border-radius: var(--adm-radius);
  background: var(--adm-surface);
}

.adm-table:where(:scope, *) {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.adm-table th:where(:scope, *),
.adm-table td:where(:scope, *) {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--adm-line);
  text-align: left;
  vertical-align: top;
}

.adm-table thead th:where(:scope, *) {
  background: var(--adm-surface-muted);
  color: var(--adm-ink-faint);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.adm-table tbody tr:last-child td:where(:scope, *) {
  border-bottom: 0;
  }

.adm-table tbody tr:hover:where(:scope, *) {
  background: var(--adm-surface-hover);
}

.adm-table small:where(:scope, *) {
  display: block;
  margin-top: 0.15rem;
  color: var(--adm-ink-faint);
  font-size: 0.76rem;
}

/* Generic vertical stack used inside table cells that carry more than one
   line (a value plus a caption, or a control plus its error) -- shared by
   the Teacher Applications action cell and every Unit Reviews data cell. */
.adm-cell-stack:where(:scope, *) {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.adm-table code:where(:scope, *) {
  font-family: var(--adm-mono);
  font-size: 0.8em;
}

/* Teacher applications: applicant identity cell */

.tapp-applicant:where(:scope, *) {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.tapp-avatar-fallback:where(:scope, *) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--adm-accent-soft);
  color: var(--adm-accent-ink);
  font-size: 0.72rem;
  font-weight: 800;
  flex: none;
}

.tapp-applicant-name:where(:scope, *) {
  font-weight: 600;
}

.tapp-note-input:where(:scope, *) {
  width: 100%;
  min-width: 12rem;
  padding: 0.4rem 0.55rem;
  margin-bottom: 0.4rem;
  border: 1px solid var(--adm-line-strong);
  border-radius: var(--adm-radius-sm);
  font: inherit;
  font-size: 0.82rem;
}

.tapp-action-buttons:where(:scope, *) {
  display: flex;
  gap: 0.4rem;
}

.tapp-approve-btn:where(:scope, *),
.tapp-reject-btn:where(:scope, *) {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--adm-line-strong);
  border-radius: var(--adm-radius-sm);
  background: var(--adm-surface);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.tapp-approve-btn:where(:scope, *) {
  border-color: var(--adm-green);
  color: var(--adm-green);
}

.tapp-approve-btn:hover:where(:scope, *) {
  background: var(--adm-green-soft);
}

.tapp-reject-btn:where(:scope, *) {
  border-color: var(--adm-red);
  color: var(--adm-red);
}

.tapp-reject-btn:hover:where(:scope, *) {
  background: var(--adm-red-soft);
}

.tapp-approve-btn:disabled:where(:scope, *),
.tapp-reject-btn:disabled:where(:scope, *) {
  cursor: not-allowed;
  opacity: 0.5;
}

.tapp-row-error:where(:scope, *) {
  margin-top: 0.35rem;
  color: var(--adm-red);
  font-size: 0.76rem;
}

.tapp-status-pill:where(:scope, *) {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--adm-radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: capitalize;
}

.tapp-status-approved:where(:scope, *) {
  background: var(--adm-green-soft);
  color: var(--adm-green);
}

.tapp-status-rejected:where(:scope, *) {
  background: var(--adm-red-soft);
  color: var(--adm-red);
}

/* ---- Users identity cell (usr-*) ------------------------------------------ */
.usr-config-banner:where(:scope, *) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.7rem;
  margin: 0 0 1rem;
  padding: 0.72rem 0.9rem;
  color: var(--adm-muted);
  background: var(--adm-surface-soft, #f7f8fa);
  border: 1px solid var(--adm-border, #dfe3e8);
  border-radius: 0.55rem;
  font-size: 0.875rem;
}
.usr-config-banner__label:where(:scope, *) { font-weight: 600; color: var(--adm-text, #18212b); }
.usr-config-banner strong:where(:scope, *) { color: var(--adm-text, #18212b); }
.usr-state-chip:where(:scope, *) {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.25rem 0.58rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.usr-state-chip--active:where(:scope, *) { color: #16784b; background: #e8f7ef; }
.usr-state-chip--pending:where(:scope, *) { color: #9a5b00; background: #fff4d6; }
.usr-state-chip--suspended:where(:scope, *) { color: #a52a2a; background: #fdeaea; }
.usr-account-actions:where(:scope, *) { display: flex; flex-wrap: wrap; gap: 0.4rem; min-width: 10rem; }
.usr-account-action:where(:scope, *) { min-height: 2rem; padding: 0.34rem 0.62rem; font-size: 0.78rem; }
.usr-account-action--approve:where(:scope, *),
.usr-account-action--reactivate:where(:scope, *) { color: #fff; background: #16784b; border-color: #16784b; }
.usr-account-action--suspend:where(:scope, *) { color: #a52a2a; background: #fff; border-color: #c96060; }
.usr-account-action[disabled]:where(:scope, *) { opacity: 0.58; cursor: wait; }
.usr-account-status:where(:scope, *) { flex-basis: 100%; min-height: 1rem; color: var(--adm-muted); font-size: 0.75rem; }
.usr-account-status[data-error="true"]:where(:scope, *) { color: #a52a2a; }

.usr-identity:where(:scope, *) {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.usr-avatar:where(:scope, *) {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  flex: none;
  background: var(--adm-surface-sunken);
  object-fit: cover;
}

.usr-name:where(:scope, *) {
  font-weight: 600;
}

.usr-role-none:where(:scope, *) {
  color: var(--adm-ink-faint);
  font-size: 0.82rem;
}

/* ---- Content Reviews (crev-*) --------------------------------------------- */

.crev-section:where(:scope, *) {
  margin-bottom: 1.1rem;
}

.crev-section-title:where(:scope, *) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

.crev-count:where(:scope, *) {
  padding: 0.1rem 0.5rem;
  border-radius: var(--adm-radius-pill);
  background: var(--adm-gray-soft);
  color: var(--adm-ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.crev-table-wrap:where(:scope, *) {
  overflow-x: auto;
  border: 1px solid var(--adm-line);
  border-radius: var(--adm-radius);
  background: var(--adm-surface);
}

.crev-table:where(:scope, *) {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.crev-table th:where(:scope, *),
.crev-table td:where(:scope, *) {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--adm-line);
  text-align: left;
  vertical-align: top;
}

.crev-table thead th:where(:scope, *) {
  background: var(--adm-surface-muted);
  color: var(--adm-ink-faint);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.crev-table tbody tr:last-child td:where(:scope, *) {
  border-bottom: 0;
}

.crev-unit:where(:scope, *) {
  font-family: var(--adm-mono);
  font-size: 0.8em;
  white-space: nowrap;
}

.crev-section-cell small:where(:scope, *) {
  display: block;
  margin-top: 0.15rem;
  color: var(--adm-ink-faint);
  font-family: var(--adm-mono);
  font-size: 0.76rem;
}

.crev-actions:where(:scope, *) {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 14rem;
}

.crev-note:where(:scope, *) {
  width: 100%;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--adm-line-strong);
  border-radius: var(--adm-radius-sm);
  font: inherit;
  font-size: 0.8rem;
}

.crev-buttons:where(:scope, *) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.crev-action:where(:scope, *) {
  padding: 0.32rem 0.6rem;
  border: 1px solid var(--adm-line-strong);
  border-radius: var(--adm-radius-sm);
  background: var(--adm-surface);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.crev-action:hover:where(:scope, *) {
  background: var(--adm-surface-sunken);
}

.crev-action:disabled:where(:scope, *) {
  cursor: not-allowed;
  opacity: 0.5;
}

.crev-row-error:where(:scope, *) {
  color: var(--adm-red);
  font-size: 0.76rem;
}

/* ---- Unit Reviews (urev-*) -------------------------------------------- */

.adm-summary:where(:scope, *) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.7rem;
}

.adm-summary-card:where(:scope, *) {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--adm-line);
  border-left: 4px solid var(--adm-line-strong);
  border-radius: var(--adm-radius);
  background: var(--adm-surface);
}

.adm-summary-card strong:where(:scope, *) {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.adm-summary-card span:where(:scope, *) {
  color: var(--adm-ink-faint);
  font-size: 0.74rem;
  font-weight: 700;
}

.adm-summary-card--confirmed:where(:scope, *) {
  border-left-color: var(--adm-green);
}

.adm-summary-card--stale:where(:scope, *) {
  border-left-color: var(--adm-amber);
}

.adm-summary-card--needs_work:where(:scope, *) {
  border-left-color: var(--adm-red);
}

.adm-appoint:where(:scope, *) {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1.5rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--adm-line);
  border-radius: var(--adm-radius);
  background: var(--adm-surface);
}

.adm-appoint h3:where(:scope, *) {
  margin: 0.1rem 0 0.4rem;
  font-size: 1.02rem;
  font-weight: 700;
}

.adm-appoint p:where(:scope, *) {
  margin: 0 0 0.7rem;
  color: var(--adm-ink-soft);
  font-size: 0.86rem;
}

.adm-appoint-form label:where(:scope, *) {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--adm-ink-faint);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.adm-appoint-form-row:where(:scope, *) {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.adm-appoint-form-row input:where(:scope, *) {
  flex: 1 1 14rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--adm-line-strong);
  border-radius: var(--adm-radius-sm);
  font: inherit;
  font-size: 0.9rem;
}

.adm-form-status:where(:scope, *) {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--adm-green);
}

.adm-form-status[data-error="true"]:where(:scope, *) {
  color: var(--adm-red);
}

.adm-appoint-current h3:where(:scope, *) {
  margin: 0.1rem 0 0.5rem;
  font-size: 0.92rem;
}

.adm-reviewer-list:where(:scope, *) {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.adm-reviewer-list li:where(:scope, *) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--adm-line);
  border-radius: var(--adm-radius-sm);
  background: var(--adm-surface-muted);
  font-size: 0.82rem;
}

.adm-reviewer-list small:where(:scope, *) {
  display: block;
  color: var(--adm-ink-faint);
  font-family: var(--adm-mono);
  font-size: 0.72rem;
}

.adm-reviewer-list time:where(:scope, *) {
  color: var(--adm-ink-faint);
  font-size: 0.76rem;
  white-space: nowrap;
}

.adm-units:where(:scope, *) {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.adm-toolbar-row:where(:scope, *) {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.adm-toolbar-row h3:where(:scope, *) {
  margin: 0.1rem 0 0;
  font-size: 1.02rem;
  font-weight: 700;
}

.adm-filters:where(:scope, *) {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.adm-filters .adm-field:where(:scope, *) {
  min-width: 11rem;
}

.adm-match-count:where(:scope, *) {
  padding-bottom: 0.55rem;
  color: var(--adm-ink-faint);
  font-size: 0.82rem;
  white-space: nowrap;
}

.adm-legend:where(:scope, *) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.76rem;
  color: var(--adm-ink-faint);
}

.adm-legend span:where(:scope, *)::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  vertical-align: middle;
  background: var(--adm-gray);
}

.adm-legend--confirmed:where(:scope, *)::before {
  background: var(--adm-green) !important;
}

.adm-legend--stale:where(:scope, *)::before {
  background: var(--adm-amber) !important;
}

.adm-legend--needs_work:where(:scope, *)::before {
  background: var(--adm-red) !important;
}

.urev-row .urev-state-dot:where(:scope, *) {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--adm-gray);
  vertical-align: middle;
}

.urev-row--confirmed .urev-state-dot:where(:scope, *) {
  background: var(--adm-green);
}

.urev-row--stale .urev-state-dot:where(:scope, *) {
  background: var(--adm-amber);
}

.urev-row--needs_work .urev-state-dot:where(:scope, *) {
  background: var(--adm-red);
}

.urev-row--unreviewed .urev-state-dot:where(:scope, *) {
  background: var(--adm-gray);
}

.urev-state-cell:where(:scope, *) {
  min-width: 8.7rem;
}

.urev-approval-toggle:where(:scope, *) {
  min-width: 7.2rem;
  border-color: var(--adm-line-strong);
  background: var(--adm-surface);
  color: var(--adm-ink);
  white-space: nowrap;
}

.urev-approval-toggle--approved:where(:scope, *),
.urev-approval-toggle--approved:hover:where(:scope, *) {
  border-color: var(--adm-green);
  background: var(--adm-green);
  color: #fff;
}

.urev-appointed-state:where(:scope, *) {
  color: var(--adm-ink-faint);
  white-space: normal;
}

.urev-open-flag:where(:scope, *) {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--adm-radius-pill);
  background: var(--adm-red-soft);
  color: var(--adm-red);
  font-size: 0.68rem;
  font-weight: 800;
}

.urev-note:where(:scope, *) {
  display: block;
  margin-top: 0.2rem;
  color: var(--adm-ink-faint);
  font-style: italic;
}

.urev-links:where(:scope, *) {
  white-space: nowrap;
}

.urev-links a:where(:scope, *) {
  margin-right: 0.6rem;
  font-size: 0.82rem;
}

.urev-module:where(:scope, *) {
  padding: 0.1rem 0.45rem;
  border-radius: var(--adm-radius-pill);
  background: var(--adm-gray-soft);
  color: var(--adm-ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

/* ---- ADM-A: Analytics + Content Health ---------------------------------- */

.adm-panel-head--actions:where(:scope, *),
.adm-panel-actions:where(:scope, *),
.adm-period-control:where(:scope, *) {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.adm-panel-head--actions:where(:scope, *) {
  justify-content: space-between;
  gap: 1rem;
}

.adm-panel-actions:where(:scope, *) {
  justify-content: flex-end;
}

.adm-updated:where(:scope, *),
.adm-source-note:where(:scope, *) {
  color: var(--adm-ink-faint);
  font-size: 0.78rem;
}

.adm-source-note:where(:scope, *) {
  margin: 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--adm-line);
  border-radius: var(--adm-radius-sm);
  background: var(--adm-surface-muted);
}

.adm-period-control:where(:scope, *) {
  padding: 0.2rem;
  border: 1px solid var(--adm-line);
  border-radius: var(--adm-radius-pill);
  background: var(--adm-surface-muted);
}

.adm-period-btn:where(:scope, *) {
  padding: 0.28rem 0.58rem;
  border: 0;
  border-radius: var(--adm-radius-pill);
  background: transparent;
  color: var(--adm-ink-soft);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.adm-period-btn.is-active:where(:scope, *) {
  background: var(--adm-surface);
  color: var(--adm-accent-ink);
  box-shadow: 0 0 0 1px var(--adm-accent);
}

.adm-split-grid:where(:scope, *),
.adm-health-grid:where(:scope, *) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.adm-health-grid:where(:scope, *) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.adm-data-card:where(:scope, *),
.adm-health-card:where(:scope, *) {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--adm-line);
  border-radius: var(--adm-radius);
  background: var(--adm-surface);
}

.adm-data-card:where(:scope, *) {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.adm-health-card:where(:scope, *) {
  border-left: 4px solid var(--adm-green);
}

.adm-health-card--stale:where(:scope, *) {
  border-left-color: var(--adm-amber);
}

.adm-health-card--unavailable:where(:scope, *) {
  border-left-color: var(--adm-red);
}

.adm-health-card > div:where(:scope, *) {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.adm-health-card strong:where(:scope, *) {
  font-size: 1rem;
}

.adm-health-card p:where(:scope, *) {
  margin: 0.45rem 0;
  color: var(--adm-ink-soft);
  font-size: 0.8rem;
}

.adm-health-card code:where(:scope, *) {
  display: block;
  overflow: hidden;
  color: var(--adm-ink-faint);
  font-family: var(--adm-mono);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adm-status-pill:where(:scope, *) {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: var(--adm-radius-pill);
  font-size: 0.72rem;
  font-weight: 800;
}

.adm-status-pill--ok:where(:scope, *) {
  background: var(--adm-green-soft);
  color: var(--adm-green);
}

.adm-status-pill--issue:where(:scope, *) {
  background: var(--adm-red-soft);
  color: var(--adm-red);
}

.adm-status-pill--blocked:where(:scope, *) {
  background: var(--adm-amber-soft);
  color: var(--adm-amber);
}

.adm-stat-value--amber:where(:scope, *),
.adm-cell-neutral:where(:scope, *) {
  color: var(--adm-amber);
}

.adm-cell-alert:where(:scope, *) {
  color: var(--adm-red);
  font-weight: 800;
}

.adm-cell-neutral:where(:scope, *) {
  font-weight: 800;
}

.adm-waiver-reasons:where(:scope, *) {
  max-width: 28rem;
  color: var(--adm-ink-soft);
  font-size: 0.75rem;
  line-height: 1.35;
}

.adm-bar-chart:where(:scope, *) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.35rem 0.8rem;
  max-height: 32rem;
  overflow-y: auto;
}

.adm-bar-row:where(:scope, *) {
  display: grid;
  grid-template-columns: 2.8rem minmax(4rem, 1fr) 2.2rem;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  font-size: 0.72rem;
}

.adm-bar-row time:where(:scope, *),
.adm-bar-row strong:where(:scope, *) {
  color: var(--adm-ink-faint);
  font-variant-numeric: tabular-nums;
}

.adm-bar-row strong:where(:scope, *) {
  text-align: right;
}

.adm-bar-track:where(:scope, *) {
  height: 0.5rem;
  overflow: hidden;
  border-radius: var(--adm-radius-pill);
  background: var(--adm-surface-sunken);
}

.adm-bar-fill:where(:scope, *) {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--adm-accent);
}

/* ---- Registry-backed panels: Badges (bad-*) + Assessments (asm-*) ------- */

.adm-source-row:where(:scope, *),
.adm-section-header--split:where(:scope, *) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.adm-source-row:where(:scope, *) {
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--adm-line);
  border-radius: var(--adm-radius-sm);
  background: var(--adm-surface-muted);
}

.adm-source-row .adm-source-note:where(:scope, *) {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.adm-chip--chapter:where(:scope, *) {
  background: var(--adm-accent-soft);
  color: var(--adm-accent-ink);
}

.adm-chip--module:where(:scope, *) {
  background: var(--adm-green-soft);
  color: var(--adm-green);
}

.adm-chip--milestone:where(:scope, *) {
  background: var(--adm-amber-soft);
  color: var(--adm-amber);
}

.bad-identity:where(:scope, *) {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 18rem;
}

.bad-artwork:where(:scope, *) {
  width: 2.6rem;
  height: 2.6rem;
  flex: none;
  border: 1px solid var(--adm-line);
  border-radius: 50%;
  background: var(--adm-surface-sunken);
  object-fit: cover;
}

.bad-artwork--missing:where(:scope, *) {
  display: grid;
  place-content: center;
  color: var(--adm-ink-faint);
  font-weight: 800;
}

.bad-award-count:where(:scope, *) {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.adm-table--badges:where(:scope, *),
.adm-table--coverage:where(:scope, *) {
  min-width: 760px;
}

.adm-table--kcs:where(:scope, *) {
  min-width: 1080px;
}

.adm-registry-section:where(:scope, *) {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.adm-section-header--split .adm-match-count:where(:scope, *) {
  padding-bottom: 0;
}

.asm-question:where(:scope, *) {
  min-width: 18rem;
  max-width: 34rem;
}

.asm-answer:where(:scope, *) {
  min-width: 15rem;
  max-width: 30rem;
  color: var(--adm-ink-soft);
}

/* ---- Toast region ---------------------------------------------------- */

.adm-toast-region:where(:scope, *) {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.adm-toast:where(:scope, *) {
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--adm-line-strong);
  border-left: 3px solid var(--adm-red);
  border-radius: var(--adm-radius-sm);
  background: var(--adm-surface);
  color: var(--adm-ink);
  font-size: 0.82rem;
  box-shadow: none;
}

/* ---- Split-shell embedding ------------------------------------------- */

.adm-feedback-frame:where(:scope, *) {
  display: block;
  width: 100%;
  min-height: 54rem;
  border: 1px solid var(--adm-line);
  border-radius: var(--adm-radius-sm);
  background: var(--adm-surface);
}

body.adm-embedded .adm-homebar:where(:scope, *),
body.adm-embedded .adm-topbar:where(:scope, *) {
  display: none;
}

body.adm-embedded .adm-shell:where(:scope, *) {
  padding-top: 1rem;
}

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 900px) {
  .adm-appoint:where(:scope, *) {
    grid-template-columns: 1fr;
  }

  .adm-split-grid:where(:scope, *),
  .adm-health-grid:where(:scope, *) {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .adm-nav-groups:where(:scope, *) {
    display: none;
  }

  .adm-field.adm-nav-select-field:where(:scope, *) {
    display: block;
  }
}

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