/* EquaOS ERP app: the layout around the design system's components, and
   nothing that restyles them. Every value is a design-system token, so light,
   dark and a school's theme apply here too. The last section gives the old
   People screens (client/legacy) the design system's look until they move
   into the Employees module. */

html, body, #root { height: 100%; }
body { margin: 0; overflow: hidden; }
body.page-scroll { overflow: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 12px; top: -48px; z-index: 200;
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--surface-1); color: var(--brand-primary-ink); font-weight: 600;
  box-shadow: var(--shadow-lg); text-decoration: none;
}
.skip-link:focus { top: 12px; }

.eq-icon { display: inline-flex; width: 1.15em; height: 1.15em; flex: none; }
.eq-icon svg { width: 100%; height: 100%; }
iconify-icon { display: inline-flex; width: 1em; height: 1em; }
iconify-icon svg { width: 100%; height: 100%; }

/* ── The door: sign-in and the screens around it ─────────────────────── */
.door {
  min-height: 100%; display: grid; place-items: center;
  padding: var(--space-6) var(--space-4); overflow-y: auto; box-sizing: border-box;
}
.door-logo { margin-bottom: var(--space-6); }
.door-title { font-size: var(--fs-display-md); color: var(--text-1); }
.door-sub { margin: var(--space-2) 0 var(--space-5); color: var(--text-muted); font-size: var(--fs-body-md); }
.door-links { margin-top: var(--space-4); text-align: center; }
.door-note { margin: var(--space-5) 0 0; font-size: var(--fs-caption); color: var(--text-muted); }
.door .eq-alert { margin-bottom: var(--space-4); }
.opening { display: flex; align-items: center; gap: var(--space-3); color: var(--text-2); }
.link-button {
  appearance: none; background: none; border: 0; padding: 4px 2px; cursor: pointer;
  font: inherit; font-size: var(--fs-body-sm); font-weight: 500; color: var(--brand-primary-ink);
  text-decoration: underline; text-underline-offset: 3px;
}
.link-button:hover { color: var(--brand-primary-active); }

/* ── Layout helpers ──────────────────────────────────────────────────── */
.stack { display: grid; gap: var(--space-4); }
.stack-lg { display: grid; gap: var(--space-5); }
.grid-2 { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); }
.page-title { font-size: var(--fs-display-lg); color: var(--text-1); }
.page-desc { margin: var(--space-1) 0 0; color: var(--text-2); max-width: 64ch; }
.page-actions { display: flex; gap: var(--space-2); }
.main { display: grid; gap: var(--space-5); outline: none; }
/* A grid item is as wide as its widest content unless told otherwise: one
   long word or pill would widen every card on a phone and be clipped. */
.main > *, .stack > *, .stack-lg > * { min-width: 0; }
.muted-text { color: var(--text-muted); margin: 0; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.cell-stack { display: grid; gap: 2px; }
.cell-stack small { color: var(--text-muted); font-size: var(--fs-caption); }
.cell-strong { color: var(--text-1); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.prose p { margin: 0 0 var(--space-3); color: var(--text-2); }
.prose h4 { margin: var(--space-4) 0 var(--space-2); font-size: var(--fs-body-md); color: var(--text-1); }
.prose ul { margin: 0; padding-left: 1.25em; color: var(--text-2); }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); margin: 0; display: grid; gap: var(--space-3); }
.fieldset legend { padding: 0 var(--space-2); font-weight: 600; color: var(--text-1); }

.panel-head { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); }
.panel-body { padding: var(--space-5); }
.panel-flush { padding: 0 0 var(--space-2); }
.panel-foot { margin: 0; padding: var(--space-3) var(--space-5) var(--space-4); border-top: 1px solid var(--border); font-size: var(--fs-body-sm); color: var(--text-muted); }

.facts { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: var(--space-2) var(--space-5); margin: 0; }
.facts dt { color: var(--text-muted); font-size: var(--fs-body-sm); }
.facts dd { margin: 0; color: var(--text-1); }

.filters { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.filter-actions { display: flex; gap: var(--space-2); align-items: center; }

.stats { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat-label { font-size: var(--fs-body-sm); color: var(--text-muted); }
.stat-value { font-size: var(--fs-display-lg); font-weight: 700; color: var(--text-1); margin: var(--space-2) 0 2px; }
.stat-hint { font-size: var(--fs-caption); color: var(--text-muted); }
.stat-hint-success { color: var(--status-success-text); }
.stat-hint-warning { color: var(--status-warning-text); }
.stat-hint-danger { color: var(--status-danger-text); font-weight: 500; }
@media (max-width: 767px) {
  /* As AppShell and the module kits on phones: 16px between blocks, 26px figures. */
  .main, .stats { gap: var(--space-4); }
  .stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .stat-value { font-size: 26px; }
  .panel-head { padding: 14px var(--space-4); }
  .panel-body { padding: var(--space-4); }
  .panel-foot { padding: var(--space-3) var(--space-4) var(--space-4); }
  .page-title { font-size: var(--fs-display-md); }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: var(--space-2); }
}

/* ── Messages ────────────────────────────────────────────────────────── */
.eq-alert {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  font-size: var(--fs-body-sm); line-height: var(--lh-body);
}
.eq-alert .eq-icon { margin-top: 2px; }
.eq-alert-danger { background: var(--status-danger-bg); color: var(--status-danger-text); }
.eq-alert-warning { background: var(--status-warning-bg); color: var(--status-warning-text); }
.eq-alert-success { background: var(--status-success-bg); color: var(--status-success-text); }
.eq-alert-info { background: var(--status-info-bg); color: var(--status-info-text); }

.loading { display: flex; align-items: center; gap: var(--space-3); color: var(--text-2); }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2px solid var(--brand-primary-soft-border); border-top-color: var(--brand-primary);
  animation: eq-shell-spin .8s linear infinite;
}
@keyframes eq-shell-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.toasts {
  position: fixed; left: var(--space-5); bottom: var(--space-5); z-index: 90;
  display: grid; gap: var(--space-2); max-width: min(480px, calc(100vw - 2 * var(--space-5)));
}
@media (max-width: 767px) { .toasts { left: var(--space-3); right: var(--space-3); bottom: 92px; } }

/* A native <select> composed into FormField, drawn like the system's Input. */
.eq-select {
  appearance: none; width: 100%; height: 40px; padding: 0 36px 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface-1) linear-gradient(45deg, transparent 50%, var(--text-muted) 50%) no-repeat right 18px center / 5px 5px;
  color: var(--text-1); font: inherit; font-size: var(--fs-body-md); cursor: pointer;
}
.eq-select:focus-visible { outline: none; border-color: var(--focus-ring-color); box-shadow: var(--focus-ring-shadow); border-radius: var(--radius-md); }

.reveal-secret {
  margin-top: var(--space-4); padding: var(--space-4); border-radius: var(--radius-md);
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  font-size: var(--fs-body-lg); font-weight: 600; letter-spacing: .04em; word-break: break-all; color: var(--text-1);
}

/* ── The person menu ─────────────────────────────────────────────────── */
.person { position: relative; }
.person-button {
  width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: transparent; display: grid; place-items: center;
}
.person-button:hover .avatar { background: var(--brand-primary-soft-border); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-primary-soft); color: var(--brand-primary-ink); font-weight: 600; font-size: 13px;
  transition: background var(--duration-fast) var(--ease-out);
}
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 70; width: min(300px, calc(100vw - 24px));
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 6px; display: grid; gap: 2px;
}
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-email { font-weight: 600; color: var(--text-1); font-size: var(--fs-body-sm); overflow-wrap: anywhere; }
.menu-role { font-size: var(--fs-caption); color: var(--text-muted); }
.menu-label { padding: 8px 12px 2px; font-size: 11px; font-weight: 600; letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--text-muted); }
.menu-group { display: grid; gap: 2px; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px;
  border: 0; background: transparent; border-radius: var(--radius-sm); cursor: pointer;
  font: inherit; font-size: var(--fs-body-md); color: var(--text-2); text-align: left;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); color: var(--text-1); }
.menu-item[aria-checked="true"] { color: var(--brand-primary-ink); font-weight: 600; }
.menu-item:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 767px) { .menu-item { min-height: 44px; } }

/* ── Module frames (modules not yet micro-frontends) ────────────────────
   The host sits over AppShell's content area: below its top bar (64px, or
   56px on a phone), right of its sidebar (248px desktop, 72px tablet rail,
   none on a phone). The same breakpoints as AppShell. */
#frames { position: fixed; top: 64px; left: 248px; right: 0; bottom: 0; z-index: 5; background: var(--page-bg); pointer-events: none; }
@media (max-width: 1099px) { #frames { left: 72px; } }
@media (max-width: 767px) { #frames { top: 56px; left: 0; } }
#frames[hidden] { display: none; }
.module-frame { width: 100%; height: 100%; border: 0; display: block; background: var(--surface-1); pointer-events: auto; }
.module-frame[hidden] { display: none; }
.module-frame.is-pending { visibility: hidden; pointer-events: none; }
#frames:has(.module-frame.is-pending:not([hidden])) { background: transparent; }

.remote:empty { display: none; }

.noscript { max-width: 32rem; margin: 15vh auto; padding: 0 var(--space-4); font-family: var(--font-body); }

/* ── The old People screens ──────────────────────────────────────────────
   Their markup is unchanged (client/legacy/people.js); these rules draw it
   with the design system's tokens and shapes. */
.legacy { color: var(--text-2); }
.legacy .container { max-width: none; padding: 0; }
.legacy .stack { display: grid; gap: var(--space-5); }
.legacy h2 { font-size: var(--fs-display-lg); color: var(--text-1); }
.legacy h3 { font-size: var(--fs-display-sm); font-weight: 600; color: var(--text-1); margin: 0; }
.legacy .page-head p { margin: var(--space-1) 0 0; color: var(--text-2); }
.legacy .head-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.legacy .panel {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.legacy .panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border);
}
.legacy .panel-body { padding: var(--space-5); }
.legacy .table-wrap { overflow-x: auto; }
.legacy table { width: 100%; min-width: 640px; border-collapse: collapse; }
.legacy th {
  text-align: left; font-size: var(--fs-body-sm); font-weight: 500; color: var(--text-muted);
  padding: 0 var(--space-5); height: 44px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.legacy td { padding: var(--space-3) var(--space-5); height: 58px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.legacy td strong { color: var(--text-1); font-weight: 500; }
.legacy .muted { color: var(--text-muted); font-size: var(--fs-body-sm); }
.legacy .mono { font-variant-numeric: tabular-nums; }
.legacy .label { display: block; font-size: var(--fs-body-sm); font-weight: 500; color: var(--text-1); margin-bottom: 6px; }
.legacy .field { display: grid; gap: 4px; margin-bottom: var(--space-4); }
.legacy .grid-2 { display: grid; gap: 0 var(--space-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.legacy .filters { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-end; }
.legacy .filters .field { margin-bottom: 0; }
.legacy input:not([type="checkbox"]):not([type="radio"]), .legacy select, .legacy textarea {
  height: 40px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface-1); color: var(--text-1); font: inherit; font-size: var(--fs-body-md); box-sizing: border-box; width: 100%;
}
.legacy input:focus-visible, .legacy select:focus-visible, .legacy textarea:focus-visible {
  outline: none; border-color: var(--focus-ring-color); box-shadow: var(--focus-ring-shadow); border-radius: var(--radius-md);
}
.legacy input[type="checkbox"] { accent-color: var(--brand-primary); width: 18px; height: 18px; }
.legacy .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px;
  border-radius: var(--radius-pill); border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  font: inherit; font-weight: 600; font-size: var(--fs-body-md);
  background: var(--brand-primary); color: var(--text-on-primary);
  transition: background var(--duration-fast) var(--ease-standard);
}
.legacy .btn:hover:not(:disabled) { background: var(--brand-primary-hover); }
.legacy .btn:active:not(:disabled) { transform: scale(.98); }
.legacy .btn:disabled { opacity: .45; cursor: not-allowed; }
.legacy .btn-quiet { background: var(--surface-1); color: var(--text-1); border-color: var(--border-strong); }
.legacy .btn-quiet:hover:not(:disabled) { background: var(--surface-2); }
/* The two danger tokens are a matched pair in both themes; white on the
   dark theme's light danger red would be 1.9:1. */
.legacy .btn-danger { background: var(--status-danger-text); color: var(--status-danger-bg); }
.legacy .btn-danger:hover:not(:disabled) { background: var(--status-danger-text); filter: brightness(.92); }
.legacy .btn-sm { height: 32px; padding: 0 14px; font-size: var(--fs-body-sm); }
.legacy .btn-block { width: 100%; }
.legacy .pill {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--radius-pill);
  font-size: var(--fs-caption); font-weight: 500; white-space: nowrap; border: 0;
  background: var(--status-neutral-bg); color: var(--status-neutral-text);
}
.legacy .pill-ok { background: var(--status-success-bg); color: var(--status-success-text); }
.legacy .pill-warn { background: var(--status-warning-bg); color: var(--status-warning-text); }
.legacy .pill-deny { background: var(--status-danger-bg); color: var(--status-danger-text); }
.legacy .pill-brand { background: var(--status-info-bg); color: var(--status-info-text); }
.legacy button.pill { cursor: pointer; }
.legacy .perm-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.legacy .alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: var(--fs-body-sm); }
.legacy .alert-error { background: var(--status-danger-bg); color: var(--status-danger-text); }
.legacy .alert-ok { background: var(--status-success-bg); color: var(--status-success-text); }
.legacy .alert-info { background: var(--status-info-bg); color: var(--status-info-text); }
.legacy .empty { padding: var(--space-8) var(--space-5); text-align: center; color: var(--text-muted); }
.legacy .empty strong { display: block; color: var(--text-1); font-size: var(--fs-display-sm); margin-bottom: var(--space-2); }
.legacy .retention-note { padding: var(--space-3) var(--space-5) var(--space-4); border-top: 1px solid var(--border); font-size: var(--fs-body-sm); color: var(--text-muted); }
.legacy .facts { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: var(--space-2) var(--space-5); margin: 0; }
.legacy .facts dt { margin: 0; }
.legacy .facts dd { margin: 0; color: var(--text-1); }
.legacy .checks { display: grid; gap: var(--space-2); }
.legacy .check { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-2); border-radius: var(--radius-sm); cursor: pointer; }
.legacy .check:hover { background: var(--surface-2); }
.legacy .check-label { color: var(--text-1); font-weight: 500; }
.legacy .check-desc { font-size: var(--fs-caption); color: var(--text-muted); }
.legacy .pager { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.legacy .pager-buttons { display: flex; gap: var(--space-2); }
.legacy .link { background: none; border: 0; padding: 0; color: var(--brand-primary-ink); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.legacy .chain { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.legacy .chain-sep { color: var(--text-muted); }
.legacy .chain-node { color: var(--text-1); }
.legacy ul.org, .legacy ul.org ul { list-style: none; margin: 0; padding-left: var(--space-5); border-left: 1px solid var(--border); }
.legacy ul.org { border-left: 0; padding-left: 0; }
.legacy .org-node { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: 6px 0; }
.legacy .org-name { font-weight: 500; }

/* ── The landing and sign-in page ────────────────────────────────────────
   Sunrise wash (the body's --page-bg), the Logo, the hero and the sign-in
   card; below the sign-in screen, who EquaOS is for, every module with its
   status, the assistant and trust (ui/Landing.jsx). Desktop ≥ 1100: hero
   left, card right. Tablet and phone: hero, card, then the rest. Text on
   the wash is ink or body grey, never muted grey (the marigold glow lowers
   its contrast); cards are white (surface-1) and may use muted text. */
.landing {
  height: 100%; overflow-y: auto; box-sizing: border-box;
  display: flex; flex-direction: column; gap: var(--space-8);
  padding: var(--space-7) var(--space-7) var(--space-6);
  max-width: 1240px; margin: 0 auto;
}
.landing-top { display: flex; align-items: center; justify-content: space-between; }
.landing-signin-link { font-weight: 600; min-height: 44px; padding: 0 var(--space-3); }
.landing-main {
  display: grid; gap: var(--space-6) var(--space-10); align-items: end;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
  grid-template-areas: "intro card" "counts card";
}
.landing-counts { grid-area: counts; min-width: 0; align-self: start; }
.landing-counts .hero-counts { margin-top: 0; }
.landing-intro { grid-area: intro; min-width: 0; }
.landing-card { grid-area: card; min-width: 0; align-self: center; }
.landing-title {
  font-size: var(--fs-display-2xl); line-height: var(--lh-display); letter-spacing: var(--ls-display);
  color: var(--text-1); max-width: 15ch; margin: 0;
}
.landing-lede { margin: var(--space-5) 0 0; font-size: var(--fs-body-lg); line-height: var(--lh-body); color: var(--text-2); max-width: 52ch; }
.landing-assist {
  display: flex; gap: var(--space-3); align-items: flex-start; margin: var(--space-5) 0 0; max-width: 52ch;
  color: var(--text-1); font-size: var(--fs-body-md); font-weight: 500;
}
.landing-assist .eq-icon { color: var(--brand-primary-ink); font-size: 22px; flex: none; margin-top: 1px; }
.hero-counts {
  margin: var(--space-6) 0 0; display: grid; gap: var(--space-3);
  grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 560px;
}
.hero-counts > div {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4); box-shadow: var(--shadow-sm, none);
}
.hero-counts dt { font-size: var(--fs-caption); color: var(--text-muted); }
.hero-counts dd { margin: 2px 0 0; font-size: var(--fs-display-md); font-weight: 600; color: var(--text-1); }

.landing-sections { display: grid; gap: var(--space-10); }
.landing-section { display: grid; gap: var(--space-5); }
.landing-section-head { max-width: 64ch; }
.landing-h2 { margin: 0; font-size: var(--fs-display-lg); line-height: var(--lh-display); color: var(--text-1); }
.landing-section-lede { margin: var(--space-2) 0 0; color: var(--text-2); font-size: var(--fs-body-lg); }

/* Made for */
.persona-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.persona {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: var(--space-5); display: grid; gap: var(--space-3); align-content: start;
}
.persona-head { display: flex; gap: var(--space-3); align-items: center; }
.persona-icon, .module-icon, .rule-icon, .trust-icon {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--brand-primary-soft); color: var(--brand-primary-ink); font-size: 20px;
}
.persona-who { margin: 0; font-size: var(--fs-body-lg); color: var(--text-1); }
.persona-job { margin: 0; font-weight: 600; color: var(--text-1); }
.persona-jobs { margin: 0; padding-left: 1.1em; display: grid; gap: var(--space-1); color: var(--text-2); font-size: var(--fs-body-sm); }

/* Every module */
.module-groups { columns: 340px 3; column-gap: var(--space-5); }
.module-group {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: var(--space-4) var(--space-5);
  break-inside: avoid; margin: 0 0 var(--space-5);
}
.module-group-title { margin: 0 0 var(--space-2); font-size: var(--fs-caption); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.module-list { list-style: none; margin: 0; padding: 0; display: grid; }
.module-tile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.module-tile:first-child { border-top: 0; }
.module-icon { width: 36px; height: 36px; font-size: 18px; }
.module-text { display: grid; min-width: 0; }
.module-name { font-weight: 600; color: var(--text-1); }
.module-purpose { font-size: var(--fs-body-sm); color: var(--text-muted); }

/* The assistant */
.assistant-grid { display: grid; gap: var(--space-6); grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); align-items: center; }
.assistant-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.assistant-steps li { display: flex; gap: var(--space-3); align-items: flex-start; color: var(--text-2); font-size: var(--fs-body-md); }
.assistant-steps strong { color: var(--text-1); }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--brand-primary); color: var(--text-on-primary); font-weight: 600; font-size: var(--fs-body-sm);
}
.plan-example { display: grid; gap: var(--space-3); }
.plan-head { display: flex; gap: var(--space-2); align-items: center; font-size: var(--fs-caption); color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.plan-head .eq-icon { color: var(--brand-primary-ink); }
.plan-say { margin: 0; color: var(--text-1); font-weight: 500; }
.plan-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); font-size: var(--fs-body-sm); color: var(--text-2); }
.plan-steps li { display: flex; gap: var(--space-2); align-items: center; }
.plan-actions { display: flex; gap: var(--space-2); }
.plan-button {
  padding: 6px 14px; border-radius: var(--radius-md); border: 1px solid var(--border-strong);
  font-size: var(--fs-body-sm); font-weight: 600; color: var(--text-1);
}
.plan-approve { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--text-on-primary); }
.rule-grid, .trust-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.rule {
  display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4);
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.rule-title { display: block; font-weight: 600; color: var(--text-1); }
.rule-text { display: block; font-size: var(--fs-body-sm); color: var(--text-muted); }

/* Trust */
.trust {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: var(--space-5); display: grid; gap: var(--space-2); align-content: start;
}
.trust-title { margin: var(--space-2) 0 0; font-size: var(--fs-body-lg); color: var(--text-1); }
.trust-text { margin: 0; color: var(--text-2); font-size: var(--fs-body-sm); }

.landing-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.landing-foot-text { font-size: var(--fs-caption); color: var(--text-2); }

.school-badge {
  display: flex; gap: 10px; align-items: center; padding: 10px; margin-bottom: var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2);
}
.school-initials {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: var(--tenant-accent-ink); font-size: 10px; font-weight: 700;
}
.school-crest { width: 30px; height: 30px; object-fit: contain; flex: none; }
.school-text { min-width: 0; display: grid; }
.school-name { font-weight: 600; font-size: var(--fs-body-sm); color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.school-sub { font-size: var(--fs-caption); color: var(--text-muted); }

@media (max-width: 1099px) {
  .landing { padding: var(--space-6) var(--space-6) var(--space-5); gap: var(--space-7); }
  .landing-main { grid-template-columns: 1fr; grid-template-areas: "intro" "card" "counts"; max-width: 680px; }
  .landing-title { font-size: var(--fs-display-xl); max-width: 18ch; }
  .assistant-grid { grid-template-columns: 1fr; }
  .landing-sections { gap: var(--space-8); }
}
@media (max-width: 767px) {
  .landing { padding: var(--space-4) var(--space-4) var(--space-5); gap: var(--space-6); }
  .landing-title { font-size: var(--fs-display-lg); }
  .landing-lede { font-size: var(--fs-body-md); margin-top: var(--space-3); }
  .landing-card .eq-btn { min-height: 44px; }
  .hero-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing-h2 { font-size: var(--fs-display-md); }
  .module-groups { columns: 1; }
  .module-tile { grid-template-columns: auto minmax(0, 1fr); }
  .module-tile > :last-child { grid-column: 2; justify-self: start; }
}

/* AppShell fills the window. */
.shell { height: 100%; }
/* The sidebar's items gain an address for keyboard use (Shell.jsx); keep
   them looking exactly as the design system draws them, without a link
   underline. */
.shell aside nav a[href] { text-decoration: none; }
/* The design system's Input draws its own focus ring on its border; the
   global ring from base.css would draw a second one on the inner field. */
input:focus-visible, textarea:focus-visible { box-shadow: none; }
.landing-card .eq-alert { margin-bottom: var(--space-4); }
/* AppShell renders the Logo in its default "color" tone, whose wordmark ink
   (#1E2A33) disappears on the dark sidebar. Until the design system passes
   tone="light" in dark mode, the wordmark ink follows the theme here.
   Reported to the design system owners. */
[data-theme="dark"] .shell aside span[style*="rgb(30, 42, 51)"] { color: var(--text-1) !important; }

/* A module's pages under it: a guide line where the module's icon sits, and
   a caret on the module saying whether they are showing. */
.shell aside .nav-indent { align-self: stretch; width: 18px; flex: none; margin: -1px 0; background: linear-gradient(var(--border-strong), var(--border-strong)) center / 1px 100% no-repeat; }
.shell aside a[aria-current] .nav-indent { background-image: none; }
.shell aside .nav-caret { width: 14px; height: 14px; color: var(--text-muted); }
.shell aside a[aria-current] .nav-caret { color: inherit; }

/* ── Sign-in screens and account pages (AUT stories) ────────────────── */
.door-text { margin: 0; color: var(--text-2); font-size: var(--fs-body-md); }
.door-or { display: flex; align-items: center; gap: var(--space-3); color: var(--text-muted); font-size: var(--fs-caption); margin-top: var(--space-4); }
.door-or::before, .door-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.reveal-secret { white-space: pre-wrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.phone-actions { margin-top: var(--space-2); }
.mfa-setup { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 220px) minmax(0, 1fr); align-items: start; }
.mfa-qr { background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-2); max-width: 220px; }
.qr { display: block; width: 100%; height: auto; }
.steps { margin: 0; padding-left: 1.25em; display: grid; gap: var(--space-2); color: var(--text-2); }
.secret-key { display: block; margin-top: var(--space-1); color: var(--text-1); font-weight: 600; letter-spacing: .06em; word-break: break-all; }
.check-grid { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.check { display: flex; gap: var(--space-2); align-items: flex-start; min-height: 32px; cursor: pointer; color: var(--text-1); font-size: var(--fs-body-md); }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand-primary); flex: none; }
.check input:focus-visible { outline: none; box-shadow: var(--focus-ring-shadow); }
.check-label { font-family: var(--font-mono, monospace); font-size: var(--fs-body-sm); }
.check-hint { display: block; color: var(--text-muted); font-size: var(--fs-caption); }
.school-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.school-list li { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
@media (max-width: 767px) {
  .mfa-setup { grid-template-columns: 1fr; }
  .mfa-qr { justify-self: center; width: 200px; }
  .check { min-height: 44px; align-items: center; }
  .row-actions > * { min-height: 44px; }
  .link-button { min-height: 44px; }
}
