/* Ya Hala Console — CUBE CSS.
   Layers: tokens → global → composition → utilities → blocks → exceptions.
   Logical properties only (RTL for free); no physical left/right anywhere. */

/* ---------- fonts (self-hosted, see static/fonts/FONTS.md) ---------- */
/* The console is a tool, so it uses the operator's system UI font first
   (San Francisco, Segoe UI, Roboto, …): native look, zero font bytes, no
   swap flash. The self-hosted Plex faces sit BEHIND the system stack as
   glyph fallbacks: a font later in the stack is used only for characters
   the earlier ones lack, so in practice Plex Sans Arabic serves Arabic on
   systems whose UI font has none (some Linux desktops), and Plex Sans is
   never fetched. The Arabic faces are unicode-ranged so they are only
   downloaded when an Arabic glyph actually falls through to them. Plain
   paths (no ?v=): the file names carry the upstream version instead. */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/fonts/plex-sans-v23-regular.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(/static/fonts/plex-sans-v23-600.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(/static/fonts/plex-sans-v23-700.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/fonts/plex-sans-arabic-v15-regular.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200D; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap; src: url(/static/fonts/plex-sans-arabic-v15-600.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200D; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url(/static/fonts/plex-sans-arabic-v15-700.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200D; }

/* ---------- tokens ---------- */
:root {
  color-scheme: light dark;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "IBM Plex Sans Arabic", "IBM Plex Sans", "Noto Sans", "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Type scale (2026-09-12): a fixed 14px body like other admin consoles,
     12px for labels and notes, 16/20/24px for the three heading levels.
     Fixed rather than fluid: a tool's text should not grow with the
     window. */
  --step--1: 0.75rem;
  --step-0:  0.875rem;
  --step-1:  1rem;
  /* The product name beside its mark: bold at 19.2px, large text. */
  --brand-size: 1.2rem;
  --step-2:  1.25rem;
  --step-3:  1.5rem;

  --space-2xs: 0.25rem;
  --space-xs:  0.5rem;
  --space-s:   0.75rem;
  --space-m:   1rem;
  --space-l:   1.5rem;
  --space-xl:  2.5rem;
  --space-2xl: 4rem;

  --radius-s: 0.5rem;
  --radius-m: 0.75rem;
  --measure: 65ch;
  --shell-nav-width: 15rem;
  /* The navigation head's height, shared by the head itself and by the
     rail toggle centred against it, so the two cannot drift apart. */
  /* The head's FULL height, its own rule included. min-block-size is a
     floor, and the head clears it: 2.5rem of brand plus a 1rem inset
     plus the 1px border is 57px against a 56px token, so the rows below
     were sticking 1px into it. Counted here rather than at the two use
     sites, so the two cannot drift apart. */
  --nav-head-h: calc(2.5rem + var(--space-m) + 1px);
  /* The rail toggle's diameter; half of it hangs outside the column. */
  --rail-btn: 1.75rem;
  /* The navigation narrowed to its icons: one 2.5rem row plus the
     column's own inline padding on either side. */
  /* Wide enough to hold a navigation row at its FULL padding -- the
     column's 0.75rem gutter, the row's 0.5rem inset, the 1.25rem icon,
     and those again -- plus the 1px the column's own end border takes out
     of a border-box width. Everything but that border is rem, so the rail
     grows with the reader's text instead of leaving a fixed icon adrift
     in a widening column. Collapsing then removes the label and nothing else: at
     3.5rem the rows had to give up their padding and recentre, which
     walked the icon 12px towards the edge and the brand mark 14.7px
     every time the column was toggled. */
  --shell-rail-width: calc(3.75rem + 1px);
  /* The drawer's own width: wide enough for a label, and always short of
     the screen by a thumb's width so there is a scrim left to tap. */
  --shell-drawer-width: 17rem;
  /* Which of the two the column measures now. The rail's state arrives on
     <html> from the cookie, so the first paint is already the chosen
     width; the drawer overrides the width again on a phone. */
  --nav-width: var(--shell-nav-width);
  /* How far the drawer sits off the screen when it is closed. A translation
     is one of the few things in this file that cannot follow the writing
     direction by itself — it is a distance along the x axis, not an edge —
     so the sign is flipped for a right-to-left page here, once, and the
     rule that uses it stays direction-agnostic. */
  --drawer-out: -100%;

  /* light palette (2026-09-21): the public site's, from the customer's brand
     tokens — a white work area (so tables and forms read on white), the
     side navigation on the soft background #F4F7FB so the two are apart,
     deep navy #0A2B66 text, cool greys; cards keep their edge and shadow.
     The brand blue is the customer's primary blue (#0A7CFF) taken darker on
     the same hue to #0063D4, which clears 4.5:1 as text and under white
     text where #0A7CFF (3.93:1) does not. It marks links, focus and the one
     filled button; dark mode keeps that button blue and uses the brand's
     bright cyan (#3EC5FF) for links. */
  --c-bg: #FFFFFF;
  --c-surface: #ffffff;
  --c-surface-2: #EDF2F8;
  --c-surface-nav: #F4F7FB;
  --c-text: #0A2B66;
  /* Muted text sits on white and on --c-surface-2 (status pills): #6b6b6b
     clears 4.5:1 on both where neutral-500 fell short on the grey. */
  --c-text-muted: #4A5B78;
  /* Muted text at 80%: the quietest links (the "or …" line under a form),
     mixed rather than a fixed hex so it follows the theme. */
  --c-text-quiet: color-mix(in oklab, var(--c-text-muted) 80%, transparent);
  --c-border: #D5DEE9;
  /* Interactive edges (buttons, inputs) share the divider grey: the form
     reads by its layout and labels, not by a darker outline. Below the 3:1
     of WCAG 1.4.11 by design (2026-09-12), like the consoles this follows. */
  --c-border-strong: #D5DEE9;
  /* A switch's track is not an outline around a visible control — it IS
     the control, and its fill is the only thing carrying on/off. So it
     takes a colour that clears the 3:1 non-text floor on every surface it
     can sit on, in both themes, rather than the hairline colour: 3.28:1
     on the page and the hover fill in light, 4.22:1 in dark. */
  --c-switch-off: #78869D;
  /* Blue text is a link; a blue fill is the page's one primary button. */
  --c-accent: #0063D4;
  /* The brand's own colour, deliberately NOT the accent. A brand is not a
     role in this palette: it can carry more than one colour at once, and
     it may change for a season or a campaign, while the accent has to go
     on meaning exactly one thing — "you can act here". Aliasing the two
     made the wordmark the loudest instance of the action colour on every
     page, which is the one thing on screen nobody needs to click. Same
     value on the public site and the panels, so the mark reads as one
     mark everywhere. It is the accent's value today, written out rather
     than aliased: the same colour by choice, not by wiring. */
  --c-brand: #0063D4;
  /* The keyboard's focus ring. The accent carries it in both themes: on the
     page it measures 5.62:1 and on a raised surface 4.99:1, dark 9.7:1,
     against the 3:1 of WCAG 1.4.11. It sits offset, so it stays visible
     around the filled button whose own colour it shares. */
  --c-focus: var(--c-accent);
  --c-accent-hover: #0054B5;
  --c-link: #0063D4;
  --c-link-hover: #0054B5;
  /* The one filled button on a page: brand blue, white text (5.62:1),
     in both themes. Tooltips no longer borrow its colours (see --c-tip-*). */
  --c-primary: #0063D4;
  --c-primary-text: #FFFFFF;
  --c-primary-hover: #0054B5;
  --c-secondary: #0f766e;
  /* Danger is TEXT on its tint (notices, status pills): red-700 clears
     4.5:1 on --c-danger-bg where red-600 (4.2:1) did not. */
  --c-danger: #b91c1c;
  --c-danger-bg: #faedee;
  --c-info-bg: #E3F7FF;
  /* The environment strip: amber, so it is neither a status nor an error;
     amber-900 on amber-100 reads at 7.3:1. Its bottom edge is amber-200,
     one step up from the strip, so it parts from the bar below it without
     reading as a rule of its own. */
  --c-env-bg: #fef3c7;
  --c-env-text: #78350f;
  --c-env-border: #fde68a;
  /* Success is TEXT on a tinted badge, so it is a deep green that clears
     4.5:1 on --c-success-bg. */
  --c-warning: #8a5700;
  --c-success: #067647;
  --c-success-bg: #edfdf7;
  /* Both shadow tokens keep the same layer count in light and dark so the
     theme cross-fade can interpolate them instead of snapping. */
  --shadow-1: 0 1px 2px rgb(0 0 0 / 5%), 0 1px 3px rgb(0 0 0 / 8%);
  --shadow-2: 0 1px 2px rgb(0 0 0 / 5%), 0 8px 24px rgb(0 0 0 / 12%);
  /* Cards: the edge is the text colour at 8%, so it follows the theme, and
     they lift on a wide, faint shadow. */
  --c-card-edge: color-mix(in srgb, var(--c-text) 8%, transparent);
  --shadow-card: 0 12px 32px 0 rgb(0 0 0 / 5%);
  /* The scrim behind a dialog, modal (::backdrop) or not (.touch-backdrop). */
  --c-scrim: rgb(0 0 0 / 45%);
  /* A tooltip is the inverse of the page, like the primary button. */
  --c-tip-bg: #0A2B66;
  --c-tip-text: #FFFFFF;
  /* A sentence in a tooltip sits softer than an identifier: a grey
     against the page, still the page's inverse. */
  --c-tip-prose-bg: #243B63;
  --c-tip-prose-text: #FFFFFF;
  /* The select's chevron, drawn by the stylesheet (the native one sits on
     the edge in Chrome): muted grey per theme, img-src allows data:. */
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%234A5B78' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5 8 10.5l4-4'/%3E%3C/svg%3E");

  /* dark palette, held in staging tokens so the two activation paths below
     (system preference without an explicit light choice; explicit dark
     choice) share ONE definition and cannot drift apart. The public site's
     dark palette (2026-09-21), so every customer-facing surface shares one:
     navy-black page #0A0F1A, cards a step lighter (#111827) so they lift off
     it, raised elements #1A2436, cool text; edges stay one step apart as in
     light. Every text pair clears 4.5:1 (lowest: muted on the info tint,
     6.16:1). */
  --dark-bg: #0A0F1A;
  --dark-surface: #111827;
  --dark-surface-2: #1A2436;
  --dark-surface-nav: #0E1320;
  --dark-text: #E6EEF8;
  --dark-text-muted: #9AA9BE;
  --dark-border: #26324A;
  --dark-border-strong: #2F3D58;
  --dark-accent: #3EC5FF;
  /* Dark: white, the brand book's own rule for the dark logo. The
     alternative tried here was bright_cyan #3EC5FF, but --dark-accent
     already holds that value, so the wordmark became the loudest
     instance of the action colour on the page -- the one thing nobody
     needs to click. Light keeps its value for the accent because
     #0063D4 on white is far more subdued than cyan on near-black, and
     there the accent appears as a solid fill against wordmark text, so
     form separates them. Dark loses that separation. 18.54:1. */
  --dark-brand: #FFFFFF;
  --dark-accent-hover: #7AD7FF;
  --dark-link: #3EC5FF;
  --dark-link-hover: #7AD7FF;
  --dark-primary: #0063D4;
  --dark-primary-text: #FFFFFF;
  --dark-primary-hover: #0A6FE8;
  --dark-secondary: #2dd4bf;
  --dark-danger: #f87171;
  --dark-danger-bg: #2c1a16;
  --dark-info-bg: #102A40;
  /* The light strip inverted: amber-100 text on a deep amber that stands
     apart from the near-black page (1.85:1; #3b2a06 was 1.38:1 and barely
     read as a band). The text holds 9.3:1 on it; the border is a step
     lighter in the strip's own hue (1.28:1), as quiet as the light
     strip's (1.12:1) rather than a rule of its own. */
  --dark-env-bg: #553c08;
  --dark-env-text: #fef3c7;
  --dark-env-border: #6b4a0c;
  --dark-success: #47cd89;
  --dark-success-bg: #12261d;
  --dark-shadow-1: 0 1px 2px rgb(0 0 0 / 40%), 0 1px 3px rgb(0 0 0 / 30%);
  --dark-shadow-2: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 50%);
  /* Dark cards sit in lists 12px apart: a shadow this wide at 45% would
     reach the next card. */
  --dark-shadow-card: 0 12px 32px 0 rgb(0 0 0 / 25%);
  --dark-tip-bg: #E6EEF8;
  --dark-tip-text: #0A0F1A;
  --dark-tip-prose-bg: #CFDAE8;
  --dark-tip-prose-text: #0A0F1A;
  --dark-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%239AA9BE' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5 8 10.5l4-4'/%3E%3C/svg%3E");

  /* The boundaries a reader gets for asking their system for more
     contrast, held in staging tokens like the dark palette above and for
     the same reason: two activation paths, one definition.
     The quiet edges of this file are deliberately faint — a card reads by
     its shadow and a table by its layout, and the note on
     --c-border-strong records that call. Faint is a choice made FOR a
     reader; this is the reader saying otherwise, so every drawn boundary
     is taken to at least the 3:1 of WCAG 1.4.11 against the surface it
     sits on, and the interactive ones a clear step past it. Same hue and
     saturation as the tokens they replace (blue-grey 213° in light, 220°
     in dark, the strip's amber in both) — a stronger line, not a
     different family. Measured against the least forgiving surface each
     one meets: --c-surface-2 for the lines, the strip's own fill for its
     edge. */
  --more-line: #6989B1;
  --more-line-strong: #507199;
  --more-env-border: #A48403;
  --more-dark-line: #5671A7;
  --more-dark-line-strong: #748AB5;
  --more-dark-env-border: #BF8415;
}

:root[dir="rtl"] { --drawer-out: 100%; }
:root[data-nav="collapsed"] { --nav-width: var(--shell-rail-width); }

/* An explicit theme also tells the browser which way to draw its own
   parts (dialogs, form controls, scrollbars), whatever the system says. */
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --c-bg: var(--dark-bg); --c-surface: var(--dark-surface); --c-surface-2: var(--dark-surface-2); --c-surface-nav: var(--dark-surface-nav);
    --c-text: var(--dark-text); --c-text-muted: var(--dark-text-muted); --c-border: var(--dark-border); --c-border-strong: var(--dark-border-strong);
    --c-accent: var(--dark-accent); --c-accent-hover: var(--dark-accent-hover); --c-brand: var(--dark-brand);
    --c-link: var(--dark-link); --c-link-hover: var(--dark-link-hover); --c-secondary: var(--dark-secondary);
    --c-primary: var(--dark-primary); --c-primary-text: var(--dark-primary-text); --c-primary-hover: var(--dark-primary-hover);
    --c-tip-bg: var(--dark-tip-bg); --c-tip-text: var(--dark-tip-text); --c-tip-prose-bg: var(--dark-tip-prose-bg); --c-tip-prose-text: var(--dark-tip-prose-text);
    --c-danger: var(--dark-danger); --c-danger-bg: var(--dark-danger-bg); --c-info-bg: var(--dark-info-bg);
    --c-env-bg: var(--dark-env-bg); --c-env-text: var(--dark-env-text); --c-env-border: var(--dark-env-border);
    --c-warning: #f5c26b; --c-success: var(--dark-success); --c-success-bg: var(--dark-success-bg);
    --shadow-1: var(--dark-shadow-1); --shadow-2: var(--dark-shadow-2); --shadow-card: var(--dark-shadow-card);
    --select-chevron: var(--dark-select-chevron);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --c-bg: var(--dark-bg); --c-surface: var(--dark-surface); --c-surface-2: var(--dark-surface-2); --c-surface-nav: var(--dark-surface-nav);
  --c-text: var(--dark-text); --c-text-muted: var(--dark-text-muted); --c-border: var(--dark-border); --c-border-strong: var(--dark-border-strong);
  --c-accent: var(--dark-accent); --c-accent-hover: var(--dark-accent-hover); --c-brand: var(--dark-brand);
  --c-link: var(--dark-link); --c-link-hover: var(--dark-link-hover); --c-secondary: var(--dark-secondary);
  --c-primary: var(--dark-primary); --c-primary-text: var(--dark-primary-text); --c-primary-hover: var(--dark-primary-hover);
  --c-tip-bg: var(--dark-tip-bg); --c-tip-text: var(--dark-tip-text); --c-tip-prose-bg: var(--dark-tip-prose-bg); --c-tip-prose-text: var(--dark-tip-prose-text);
  --c-danger: var(--dark-danger); --c-danger-bg: var(--dark-danger-bg); --c-info-bg: var(--dark-info-bg);
  --c-env-bg: var(--dark-env-bg); --c-env-text: var(--dark-env-text); --c-env-border: var(--dark-env-border);
  --c-warning: #f5c26b; --c-success: var(--dark-success); --c-success-bg: var(--dark-success-bg);
  --shadow-1: var(--dark-shadow-1); --shadow-2: var(--dark-shadow-2); --shadow-card: var(--dark-shadow-card);
  --select-chevron: var(--dark-select-chevron);
}

/* The tokens the contrast query stages are above; the query itself is
   near the end of the file, with the other preference queries. */

/* ---------- global ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Arabic script sits taller than Latin: more leading. */
:lang(ar) body { line-height: 1.75; }
body {
  margin: 0;
  min-block-size: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0; text-wrap: balance; font-weight: 600; }
/* Headings set their own line-height, so the Arabic body leading above
   does not reach them; give them their own. */
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3, :lang(ar) h4 { line-height: 1.35; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0; max-inline-size: var(--measure); }
a { color: var(--c-link); text-decoration-thickness: from-font; text-underline-offset: 0.15em; }
a:hover { color: var(--c-link-hover); }
/* A ring for the keyboard, nothing for the mouse (2026-09-23, replacing the
   no-ring call of 2026-09-10). :focus-visible is what the browser reports
   when it judges the keyboard was used, so a click leaves no ring behind —
   which is what the old rule was really avoiding, at the cost of leaving a
   person tabbing through with a 1.13:1 hint on four selectors and nothing
   at all on links, rows, menu items and fields. The ring is ours, not the
   browser's grey default, and it follows the element's own corners. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
/* Inside a box that clips (the navigation scrolls at wide sizes, the menu
   panel hides its own fold), the ring turns inwards so it is not cut off. */
.sidenav a:focus-visible, .menu__item:focus-visible, .menu > summary:focus-visible { outline-offset: -2px; }
.field input:focus { border-color: var(--c-accent); }
/* An invalid field keeps its red border when focused; the inset line
   thickens it so focus still reads. */
.field input[aria-invalid="true"]:focus { box-shadow: inset 0 0 0 1px var(--c-danger); }
/* and the ring over a refused field is the refusal's colour: an accent
   ring around a red border says two things at once to someone who is
   being asked to correct it. */
.field input[aria-invalid="true"]:focus-visible { outline-color: var(--c-danger); }
/* The ring above is the indicator; these fills ride along with it, so a
   focused control reads as raised as well as ringed. */
.button:focus-visible, a.button:focus-visible { background: var(--c-surface-2); color: var(--c-text); }
.button--primary:focus-visible, a.button--primary:focus-visible { background: var(--c-primary-hover); color: var(--c-primary-text); }
.iconbtn:focus-visible { background: var(--c-surface-2); }
.linklike:focus-visible { color: var(--c-link-hover); }
img, svg { max-inline-size: 100%; display: block; }
button, input, output { font: inherit; color: inherit; }
/* A fieldset groups fields for the accessibility tree and for disabling
   them together; it draws nothing of its own. */
fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
legend { padding: 0; }
[hidden] { display: none !important; }

/* ---------- composition ---------- */
.stack { display: flex; flex-direction: column; justify-content: flex-start; }
.stack > * { margin-block: 0; }
.stack > * + * { margin-block-start: var(--stack-space, var(--space-m)); }

.cluster { display: flex; flex-wrap: wrap; gap: var(--cluster-space, var(--space-s)); align-items: center; }
/* A section's own action sits on the line's far edge — the right in a
   left-to-right page, the left in a right-to-left one. flex-end follows
   the writing direction, so this needs no RTL twin. */
.cluster--end { justify-content: flex-end; }

.center { box-sizing: content-box; margin-inline: auto; max-inline-size: var(--center-measure, 32rem); padding-inline: var(--space-m); }

.grid {
  display: grid;
  gap: var(--space-m);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-min, 14rem)), 1fr));
}

/* Two columns for the whole height: the navigation, and the rest (header,
   page, footer) stacked. */
.shell { display: flex; flex: 1; min-block-size: 0; }
/* The shell is a query container only where it really has two columns.
   Below that the navigation is a drawer positioned against the viewport,
   and a query container is specified to take layout containment — which
   in some engines makes it the containing block its fixed children are
   measured from, and a drawer measured from a page-tall box scrolls away
   with the page. Chrome does not do that (measured 2026-09-23), but the
   drawer must not rest on which engines do: the container is simply not
   there at the width where the drawer exists. Nothing is lost — every
   shell query but one asks for a width this range cannot reach, and that
   one is restated as a media query below, where the shell and the
   viewport are the same width anyway. */
@media (min-width: 48rem) { .shell { container-type: inline-size; container-name: shell; } }
.shell__body { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; }
/* .main is a container too: the tables fold by the width they actually
   get, which is the shell's less the side navigation. */
.main { flex: 1; padding: var(--space-l) var(--space-m); min-inline-size: 0; --stack-space: var(--space-l); container-type: inline-size; container-name: main; }
@container shell (min-width: 60rem) { .main { padding: var(--space-xl); } }

/* stats: two groups of cards under a small heading, two (users) and six
   (access keys). Two columns; four go on one row from ~52rem of content
   width, five from ~64rem; six go in two rows of three from ~52rem; one
   column on phones. */
.stats__title { font-size: var(--step-0); font-weight: 600; }
.stats__title + .grid { margin-block-start: var(--space-xs); }
[data-layout="stats"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container shell (min-width: 52rem) { [data-layout="stats"][data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container shell (min-width: 64rem) { [data-layout="stats"][data-cols="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@container shell (min-width: 52rem) { [data-layout="stats"][data-cols="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container shell (max-width: 24rem) { [data-layout="stats"] { grid-template-columns: minmax(0, 1fr); } }
/* The same fold where the shell is not a query container (see .shell):
   there the drawer takes no width from the flow, so the shell and the
   viewport measure the same and a media query says exactly what the
   container query above says. */
@media (max-width: 24rem) { [data-layout="stats"] { grid-template-columns: minmax(0, 1fr); } }

/* ---------- utilities ---------- */
.lead { font-size: var(--step-1); color: var(--c-text-muted); }
.muted { color: var(--c-text-muted); }
/* A heading at the h3 size where the outline needs an h2. */
.h3 { font-size: var(--step-1); }
.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.visually-hidden { position: absolute !important; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-block-start: -100%; inset-inline-start: var(--space-m); background: var(--c-surface); padding: var(--space-xs) var(--space-s); border-radius: var(--radius-s); z-index: 10; }
/* Focused, the link takes its place in the flow at the very top, above
   the environment strip, rather than floating over it. It takes its
   text's width, not the page's: the ring around it is what says the
   keyboard is here, and a box the full width of the page has that ring
   cut off at both edges. The margin keeps the indent the absolute
   position gave it and leaves the ring room at the start edge. */
.skip-link:focus { position: static; display: inline-block; margin: var(--space-2xs) var(--space-m); }

/* ---------- blocks ---------- */
/* The environment strip sits above the whole shell, side navigation
   included, so no page hides it (a modal dims it with the rest). */
/* It sticks to the top: a strip that scrolls away stops saying which
   environment this is exactly when a long page makes that easy to
   forget, which is the whole reason it is here.
   --envbar-block-size is what everything else that sticks offsets by, so
   a section heading does not pin itself underneath the strip. It is
   built from what the strip is made of rather than measured: its block
   padding, one line box, and its bottom border. The line box is the
   strip's own (body text at the body's line height) — the smaller text
   inside it sits in that line and does not shrink it. A wrapped strip on
   a very narrow viewport is taller, and the heading then overlaps it by
   the difference rather than by its whole height.
   The line height is the body's, and Arabic sets its own further up this
   file: written as 1.5 for every language the strip came out 3.5px short
   in Arabic, and everything that offsets by it — the sticky group
   headings, the scroll padding, the drawer — sat that far under it. */
:root { --envbar-line: 1.5; --envbar-block-size: calc(2 * var(--space-2xs) + var(--envbar-line) * var(--step-0) + 1px); }
:root:lang(ar) { --envbar-line: 1.75; }
.envbar { position: sticky; inset-block-start: 0; z-index: 28; text-align: center; padding: var(--space-2xs) var(--space-m); background: var(--c-env-bg); color: var(--c-env-text); border-block-end: 1px solid var(--c-env-border); font-weight: 600; }
/* The bar sits on the page, not on a raised surface, and the header is
   meant to read flat. It carried --c-surface, which is the page's own
   white in light and so invisible there, but a lighter navy than the
   page in dark -- a band across the top that read as a panel the bar was
   never meant to be. Nothing here is sticky, so nothing scrolls under
   it. Raised twice in the audit of 2026-09-25 as a missing seam between
   header and page; flat is the decision, and transparent says so where
   the rule is read rather than only in this comment.

   No border to go with it, and if one is ever wanted, do not reach for
   a colour matching --c-bg to hide it: forced-colors replaces author
   colours with the reader's palette, so a line hidden that way comes
   back visible for exactly the readers who did not ask for one. */
.topbar {
  padding: var(--space-s) var(--space-m);
  background: transparent;
}
/* The surface's name sits at the start of the bar, including before
   sign-in. The tools' own auto
   margin is what holds that end — it absorbs the free space before
   justify-content could distribute any, in both states and on a wrapped
   line, so there is no justify-content here to mislead the next reader. */
.topbar__surface { margin: 0; font-weight: 600; color: var(--c-text-muted); }
.brand { display: inline-flex; align-items: center; gap: 0.35em; font-weight: 700; text-decoration: none; color: var(--c-brand); font-size: var(--brand-size); }
/* The logo mark leads the product name in ONE colour, the brand's own,
   matching the public site rather than the tool's text colour: the mark
   means the same thing wherever it is seen. The mark is decoration; the
   name is the link's text. */
.brand__mark { block-size: 1.3em; inline-size: auto; flex: none; }
/* The tools keep the end of the bar; the surface's name holds the start. */
.topbar__tools { --cluster-space: var(--space-xs); margin-inline-start: auto; }

/* Icon buttons: 2.5rem square (comfortably above the WCAG 2.5.8 24px target
   minimum), ghost until hovered, shared by the theme toggle and the two
   disclosure summaries so the header reads as one row of controls. */
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  inline-size: 2.5rem; block-size: 2.5rem; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius-s);
  background: transparent; color: var(--c-text); cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.iconbtn:hover, .menu[open] > .iconbtn { background: var(--c-surface-2); }
.icon { display: block; }
/* The theme button shows the mode it will switch TO: a moon while light, a
   sun while dark (explicit choice or system preference). */
/* The language globe is drawn differently in the dark theme, so the pair
   is switched exactly as the sun and the moon are, below. */
.icon--globe-dark { display: none; }
:root[data-theme="dark"] .icon--globe-dark { display: block; }
:root[data-theme="dark"] .icon--globe-light { display: none; }
.icon--sun { display: none; }
:root[data-theme="dark"] .icon--sun { display: block; }
:root[data-theme="dark"] .icon--moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon--globe-dark { display: block; }
  :root:not([data-theme="light"]) .icon--globe-light { display: none; }
  :root:not([data-theme="light"]) .icon--sun { display: block; }
  :root:not([data-theme="light"]) .icon--moon { display: none; }
}

/* Disclosure menu: <details> so it opens without JavaScript; the panel is
   absolutely positioned under the button's inline-end edge (logical, so RTL
   mirrors it). The summary keeps its focus ring but loses the UA marker. */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__panel {
  position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + var(--space-2xs));
  /* TODO(deferred:menu-panel-trigger-offset): the cap bounds the panel
     by viewport width, not by the trigger's distance from the start edge; a
     third language or a long endonym could push it off-screen at 360px.
     The rule below catches the case that is reachable today — a reader at
     twice the default text size — by width; bound it relative to the
     trigger when a third language is added. */
  min-inline-size: 12rem; max-inline-size: min(20rem, calc(100vw - 2 * var(--space-m)));
  padding: var(--space-2xs); z-index: 15;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-m);
  box-shadow: var(--shadow-2);
  transform-origin: var(--menu-origin, right) top;
}
[dir="rtl"] .menu__panel { --menu-origin: left; }
/* A panel hangs from its own button, which is near the end of the bar:
   where the page is narrower than the panel plus the buttons beside it,
   the panel's far edge leaves the page — and what leaves the page at the
   START edge cannot even be scrolled to, so half a menu is simply gone.
   Measured, that is every page narrower than 19rem: it cannot happen at
   the default text size (320px is 20rem of it, and the language panel
   still had 96px to spare there), and at twice it every phone does it —
   606px was the last width that lost part of the panel.
   Below that width the panel stops hanging from its button and hangs
   from the bar, between the page's own gutters: the bar becomes the
   panel's containing block (the menu itself stops being one), which
   makes inset-block-start's 100% the bar's height, so the panel still
   arrives directly under the bar it belongs to. */
@media (max-width: 19.5rem) {
  .topbar { position: relative; }
  .menu { position: static; }
  .menu__panel { inset-inline: var(--space-m); min-inline-size: 0; max-inline-size: none; }
}
.menu__list { margin: 0; padding: 0; list-style: none; }
.menu__item {
  display: flex; align-items: center; gap: var(--space-xs);
  inline-size: 100%; padding: var(--space-xs) var(--space-s);
  border: 0; border-radius: var(--radius-s); background: transparent;
  color: var(--c-text); text-decoration: none; text-align: start; font: inherit; cursor: pointer;
}
.menu__item:hover, .menu__item:focus-visible { background: var(--c-surface-2); color: var(--c-text); }
/* "true" marks the chosen language; "page" the page open now (a link). */
.menu__item[aria-current="true"], .menu__item[aria-current="page"] { font-weight: 500; }
.menu__item[aria-current="true"]::after, .menu__item[aria-current="page"]::after { content: "\2713"; margin-inline-start: auto; color: var(--c-accent); }
/* A count at the end of an item (passkeys); empty, it takes no room. One
   passkey is tinted: the account page says why a second one matters. */
.menu__count { margin-inline-start: auto; padding: 0 0.5em; border-radius: 999px; background: var(--c-surface-2); color: var(--c-text-muted); font-size: var(--step--1); font-weight: 500; line-height: 1.5; }
.menu__count:empty { display: none; }
.menu__count--warn { background: var(--c-danger-bg); color: var(--c-danger); }
/* On the open page the count sits before the check, which then takes no
   share of the free space (two auto margins would split it). */
.menu__item[aria-current="page"] .menu__count { margin-inline-end: var(--space-xs); }
.menu__item[aria-current="page"]:has(.menu__count:not(:empty))::after { margin-inline-start: 0; }
.menu__head { display: grid; gap: 2px; padding: var(--space-xs) var(--space-s); }
.menu__name { overflow-wrap: anywhere; }
.menu__sep { border: 0; border-block-start: 1px solid var(--c-border); margin: var(--space-2xs) 0; }

.sidenav {
  inline-size: var(--nav-width);
  flex: none;
  /* Widening and narrowing is a move worth watching: the column is the
     thing being resized, so it carries the transition rather than every
     element inside it. --nav-width flips between two custom-property
     values, which is a discrete change, but inline-size resolves to a
     length either way and that is what animates. The labels still
     disappear at once -- they leave the flow, which cannot be eased --
     and the column cannot clip them on the way out, because the rail's
     toggle hangs outside its edge and overflow: hidden would cut it off. */
  transition: inline-size 180ms ease;
  --nav-pad: var(--space-s);
  padding: var(--space-s) var(--nav-pad) var(--space-l);
  border-inline-end: 1px solid var(--c-border);
  position: relative;
  background: var(--c-surface-nav);
  --stack-space: var(--space-2xs);
}
/* The brand shares its row with the control that changes the column's
   shape: the drawer's close on a phone, the rail's narrow/wide toggle
   beside the page. Only one of the two is ever shown, so the row holds
   one control whatever the width. The rule that used to hang off the
   brand link belongs to the row now, so it runs under both. */
.sidenav__head {
  display: flex; align-items: center; gap: var(--space-xs);
  min-block-size: var(--nav-head-h);
  margin-block-end: var(--space-m); padding-block-end: var(--space-m);
  border-block-end: 1px solid var(--c-border);
}
/* The head holds its place while the page scrolls, as the rows below it
   already did — the brand and the toggle used to slide away and leave the
   column headless. It needs the column's own background, or the page
   would show through it, and it is the toggle's containing block so the
   two travel together.

   --nav-stick is where it comes to rest, and it has to include the
   column's own block-start padding: sticking to the bare envbar offset
   left the head 12px BELOW where it sticks, so it still crept up by that
   padding before catching. The rows derive their offset from the same
   value, so the two cannot drift apart. The strip above the stuck head is
   the column's own background — .sidenav is full-height, and the rows
   scroll inside their own box, so nothing passes through it. */
@media (min-width: 48rem) {
  .sidenav { --nav-stick: calc(var(--envbar-offset, 0px) + var(--space-s)); }
  .sidenav__head {
    position: sticky; inset-block-start: var(--nav-stick);
    background: var(--c-surface-nav); z-index: 3;
  }
}
.sidenav__close, .sidenav__rail, .topbar__drawer { flex: none; }
/* The rail's toggle straddles the column's outer edge rather than sitting
   in the head with the brand: narrowed, the head has no room for a second
   2.5rem control and used to push it under the mark, which put the
   control in a different place depending on the state — the one thing a
   toggle must never do. On the edge it keeps one position at both widths.
   The offset is a negative inset-inline-end, not a transform, so the end
   edge is the right-hand one in English and the left-hand one in Arabic
   without a second rule. */
.sidenav__rail {
  position: absolute;
  /* On the head's rule — 100% of the head IS its bottom border — so it
     stays clear of the mark when the column narrows and follows the head
     when it sticks. Reaching past the column's inline padding puts it on
     the outer edge at either width. */
  inset-block-start: 100%;
  inset-inline-end: calc(-1 * var(--nav-pad) - var(--rail-btn) / 2);
  translate: 0 -50%;
  inline-size: var(--rail-btn); block-size: var(--rail-btn);
  border: 1px solid var(--c-border-strong);
  border-radius: 50%;
  /* The fill is the page's own colour, so half the circle would vanish
     over the content at rest; the lift is what makes it an object. */
  background: var(--c-surface);
  box-shadow: var(--shadow-1);
  z-index: 2;
}
.sidenav__rail:hover { background: var(--c-surface-2); border-color: var(--c-border-strong); }
/* Narrowed, the control is QUIET rather than absent: faint at rest, full
   under the pointer or the keyboard. Invisible, an operator who collapsed
   the column once and came back later had nothing to tell them a control
   was there at all — the column just looked like it had lost its labels.
   A pointer that cannot hover gets it at full strength always. */
@media (min-width: 48rem) and (hover: hover) {
  :root[data-nav="collapsed"] .sidenav__rail { opacity: 0.45; transition: opacity 120ms ease; }
  :root[data-nav="collapsed"] .sidenav:hover .sidenav__rail,
  :root[data-nav="collapsed"] .sidenav:focus-within .sidenav__rail,
  :root[data-nav="collapsed"] .sidenav__rail:focus-visible { opacity: 1; }
}
/* Matched to the collapsed rail's own selector, not a bare class: that
   rule is :root[data-nav] .sidenav__rail at (0,3,0) and outranks a lone
   (0,1,0) class whatever the source order, so the toggle kept easing its
   opacity for a reader who asked for no motion. */
@media (prefers-reduced-motion: reduce) {
  .sidenav,
  :root[data-nav="collapsed"] .sidenav__rail { transition: none; }
}
/* Each of the three controls appears only where it means something: the
   opener and the close where the navigation is a drawer, the toggle
   where it is a rail. */
.sidenav__rail, .topbar__drawer { display: none; }
@media (min-width: 48rem) {
  .sidenav__close { display: none; }
  .sidenav__rail { display: inline-flex; }
}
@media (max-width: 47.99rem) { .topbar__drawer { display: inline-flex; } }
/* Beside the page, the section links stay in view however long the page
   is, while the brand above them scrolls away with it: the links' block
   sticks under the environment strip, and scrolls on its own if a short
   screen cannot hold every item (the column itself stretches the page's
   full height, which is what the block sticks within). The narrow
   layout's bar across the top is left to scroll away (pinned, it would
   take a phone's screen); there the block dissolves into the bar. */
@media (min-width: 48rem) {
  .sidenav__items {
    position: sticky; inset-block-start: calc(var(--nav-stick) + var(--nav-head-h) + var(--space-m));
    max-block-size: calc(100dvh - var(--nav-stick) - var(--nav-head-h) - var(--space-m)); overflow-y: auto; overscroll-behavior: contain;
    padding-block: var(--space-2xs);
  }
}
/* Inside the drawer the rows are a plain stack: they scroll with the
   drawer, which has its own height and its own scroll. */
@media (max-width: 47.99rem) { .sidenav__items { --stack-space: var(--space-2xs); } }
/* Back to the top of a long page (site.js shows it past a screen of
   scroll). Bottom corner at the reading end, the toasts' corner: it rides
   above their stack while one shows (--toasts-size, from site.js), so
   neither covers the other. 2.75rem (44px), not the header's 2.5rem icon
   buttons: a floating control alone in a corner gets the full touch
   target. */
.to-top {
  position: fixed; inset-block-end: calc(var(--space-l) + var(--toasts-size, 0px)); inset-inline-end: var(--space-l); z-index: 18;
  transition: inset-block-end 150ms ease;
  display: inline-flex; align-items: center; justify-content: center;
  inline-size: 2.75rem; block-size: 2.75rem; border-radius: 999px;
  background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border);
  box-shadow: var(--shadow-2); text-decoration: none;
}
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }
.to-top[hidden] { display: none; }
.to-top:hover { background: var(--c-surface-2); color: var(--c-text); }
.sidenav a {
  display: flex; align-items: center; gap: var(--space-xs);
  padding: var(--space-xs); border-radius: var(--radius-s);
  /* A fixed height, not a floor. As a floor the rows were 40px in English
     -- an 8px inset either side of a 24px line box, exactly the minimum --
     but 40.5px in Arabic, whose line box is 24.5px (:lang(ar) sets the
     body to 1.75). Collapsed, the labels leave the flow and both scripts
     fall back to the floor, so every row lost half a pixel and the list
     rose about 2px on collapse and sank again on expand. The labels
     cannot wrap any more, so nothing needs room to grow into, and
     align-items centres a taller line box in the same 40px. */
  block-size: 2.5rem;
  color: var(--c-text); text-decoration: none; font-weight: 500;
  /* The label is clipped by its row rather than wrapped inside it. While
     the column widens the labels are already back in the flow at a width
     that cannot hold them: allowed to wrap, every row went to two lines
     and the list dropped 103px before springing back as the column
     caught up. Clipping costs nothing when the column is at rest -- the
     rows are wider than their labels -- and turns the widening into the
     labels being uncovered. The marker is an inset shadow, which paints
     inside the padding box, so this does not clip it. */
  overflow: hidden;
}
/* The label is clipped by its row, so it says so. There is 74px of room
   to spare on the longest label either locale has today, but a hard cut
   mid-glyph gives a reader nothing to notice; an ellipsis does. The span
   has to own the clip for text-overflow to apply, and min-inline-size: 0
   lets it shrink below its content inside the row's flex. */
.sidenav a > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-inline-size: 0; }
.sidenav a:hover { background: var(--c-surface-2); }
/* The icon is the section's mark, not its name. One size here whatever
   each glyph declares for itself — two of them are sized for the larger
   badge contexts elsewhere, and inheriting that made their rows' labels
   sit further in than the others'. A row with no icon starts at the
   padding edge instead: the shell renders none for a name it does not
   know, which the nav-icon coverage test exists to prevent. */
.sidenav a > .icon { flex: none; inline-size: 1.25rem; block-size: 1.25rem; color: var(--c-text-muted); }
.sidenav a[aria-current="page"] > .icon { color: inherit; }
/* The brand heads the navigation, sized like the header's and centred on
   the header's icon row (2.5rem) so the two line up across the rule. The
   row above carries the rule and the height now; the link takes the space
   its row has left over. */
.sidenav .sidenav__brand { display: flex; align-items: center; flex: 1; min-inline-size: 0; padding-block: 0; border-radius: 0; font-weight: 600; }
.sidenav .sidenav__brand:hover { background: transparent; }
/* `.sidenav a` gives every row the text colour and weight 400; the brand
   row keeps the brand's (mark and name one colour, see .brand), hover
   included. 600 rather than 700: at the size the mark sets, the heavier
   face read as a headline over the column rather than as its head. */
/* The colour has to be restated here: `.sidenav a` sets the row colour
   and outranks `.brand` (0-1-1 against 0-1-0), so without this the mark
   silently takes the navigation's text colour and the brand token never
   reaches the one place it most obviously should. */
.sidenav .sidenav__brand, .sidenav .sidenav__brand:hover { font-weight: 600; font-size: var(--brand-size); gap: 0.35em; color: var(--c-brand); }
/* The mark is wider than a 20px navigation icon, so in the narrowed
   column it meets `img, svg { max-inline-size: 100% }`: the cap cuts its
   width while block-size holds its em, and the logo comes out squashed
   rather than smaller. It is let out of that cap here, in EVERY state,
   not only while collapsed -- scoped to the collapsed state the cap came
   back the instant data-nav cleared, with the column still 61px wide, and
   the mark flattened to 0.802 of its aspect for a frame before the column
   caught up. It starts at the same inset as the icons either way, and the
   few pixels it runs past the row's inset fall inside the column's own
   gutter, so nothing clips and nothing shifts. */
.sidenav .sidenav__brand .brand__mark { max-inline-size: none; }
/* The page open now is a tinted pill and keeps it under a pointer on
   another row. Tint and text are the one accent pair, so the mark reads
   as "you are here" rather than as another hover. */
/* The tint is quiet on purpose — barely over 1:1 against the navigation —
   so it is not what marks the row. The bar on the start edge is, which is
   also why the marker survives being read without colour (1.4.1).
   It is an inset edge rather than a border: a border made every row
   reserve 3px it never showed, which pushed the icons off the rail's
   centre and cost the collapsed column three pixels of its width. A
   shadow paints inside the padding box and takes no layout at all, so
   the rows are even and the marker still cannot be missed. */
.sidenav a[aria-current="page"],
.sidenav a[aria-current="page"]:hover {
  background: var(--c-info-bg); color: var(--c-accent);
  box-shadow: inset 3px 0 0 0 var(--c-accent);
}
[dir="rtl"] .sidenav a[aria-current="page"],
[dir="rtl"] .sidenav a[aria-current="page"]:hover {
  box-shadow: inset -3px 0 0 0 var(--c-accent);
}
.chip { display: inline-block; padding: 0 0.5em; border-radius: 999px; background: var(--c-surface-2); font-size: var(--step--1); vertical-align: middle; white-space: nowrap; }
/* An admin-made state (a setting changed for the organisation), apart
   from the platform-imposed ones. */
.chip--info { background: var(--c-info-bg); }
/* The passkey this session signed in with: tinted like an active status. */
.chip--success { background: var(--c-success-bg); color: var(--c-success); }
.chip--warning { color: var(--c-warning); }

/* Small, labelled progress marks remain still when motion is reduced. */
.status-spinner { display: inline-block; flex: 0 0 auto; inline-size: 0.85em; block-size: 0.85em; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; }
@media (prefers-reduced-motion: no-preference) {
 .status-spinner { animation: status-turn 900ms linear infinite; }
 @keyframes status-turn { to { transform: rotate(360deg); } }
}
.te-status { display: inline-flex; align-items: center; gap: 0.4em; }
.te-status__delayed-icon { inline-size: 1em; block-size: 1em; }
.te-status__delayed-icon svg { inline-size: 100%; block-size: 100%; }
.te-sync { font-size: var(--step--1); overflow-wrap: anywhere; }
.te-sync > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35em; inline-size: fit-content; max-inline-size: 100%; min-block-size: 2.75rem; padding-block: var(--space-2xs); }
.te-sync > summary::after { content: "⌄"; margin-inline-start: 0.25em; color: var(--c-text-muted); }
.te-sync[open] > summary::after { transform: rotate(180deg); }
.te-sync--synced > summary { color: var(--c-success); }
.te-sync--syncing > summary { color: var(--c-accent); }
.te-sync--delayed > summary, .te-sync--unavailable > summary { color: var(--c-warning); }
.te-sync__icon { display: inline-flex; align-items: center; inline-size: 1.1em; block-size: 1.1em; }
.te-sync__icon svg { inline-size: 100%; block-size: 100%; }
.te-sync__details { padding-block: var(--space-xs); color: var(--c-text); }
.te-sync__details ul { padding-inline-start: var(--space-m); }
.te-live-error { font-size: var(--step--1); }
/* A destructive capability a role holds (deleting members for good). */
.chip--danger { background: var(--c-danger-bg); color: var(--c-danger); }
/* ---------- the navigation on a phone: an off-canvas drawer ---------- */
/* Too narrow for two columns, the navigation leaves the flow altogether
   and slides in from the reading edge over a scrim, opened by the bar's
   own button. What it replaces was a wrapping strip of rows across the
   top, which on a phone ate several lines of the screen before the page
   began. It hangs from under the environment strip so the strip still
   says which environment this is while the drawer is open.
   Closed, it is slid out by its own width AND loses its visibility:
   visibility is what takes it out of the tab order and out of the
   accessibility tree, which the translation alone would not, and it is
   the one of the two that can still be transitioned (it holds `visible`
   for as long as the slide out runs, then goes). [hidden] is deliberately
   not used: a sign-in reveals the shell by clearing that attribute from
   every data-signed-in element at once, which would fling the drawer
   open on the dashboard's first frame. */
@media (max-width: 47.99rem) {
  .sidenav {
    position: fixed; z-index: 27;
    inset-block: var(--envbar-offset, 0px) 0;
    inset-inline-start: 0;
    /* Wide enough for a label, and always short of the screen by a
       thumb's width so there is a scrim left to tap: at 320px the two
       together are exactly the screen. */
    inline-size: min(var(--shell-drawer-width), calc(100% - 3rem));
    overflow-y: auto; overscroll-behavior: contain;
    box-shadow: var(--shadow-2);
    visibility: hidden;
    translate: var(--drawer-out) 0;
  }
  :root[data-drawer="open"] .sidenav { visibility: visible; translate: none; }
  /* What a tap outside the drawer lands on. It takes the touch itself
     rather than letting a drag through to the page behind, so the page
     does not scroll under a drawer the reader is trying to dismiss. */
  .sidenav-scrim {
    position: fixed; inset: 0; z-index: 26;
    background: var(--c-scrim);
    opacity: 0; visibility: hidden;
    touch-action: none; overscroll-behavior: contain;
  }
  :root[data-drawer="open"] .sidenav-scrim { opacity: 1; visibility: visible; }
}
/* Beside the page there is no drawer, so there is never a scrim. */
@media (min-width: 48rem) { .sidenav-scrim { display: none; } }
/* Sliding in, the visibility flips at once (nothing to animate, and focus
   cannot be given to a subtree the browser still counts as invisible —
   the script moves it into the drawer the moment it opens). Sliding out,
   it flips when the slide has finished, so the drawer is not gone before
   it has left. */
@media (max-width: 47.99rem) and (prefers-reduced-motion: no-preference) {
  .sidenav { transition: translate 200ms ease, visibility 0s linear 200ms; }
  .sidenav-scrim { transition: opacity 200ms ease, visibility 0s linear 200ms; }
  :root[data-drawer="open"] .sidenav { transition: translate 200ms ease, visibility 0s; }
  :root[data-drawer="open"] .sidenav-scrim { transition: opacity 200ms ease, visibility 0s; }
}

/* ---------- the navigation beside the page: a rail ---------- */
/* Narrowed, the column keeps its rows and drops their words: the icon is
   centred in a 2.5rem square and the label is taken out of the layout
   without leaving the accessibility tree, so the row is still named. The
   same words follow the pointer or the keyboard into the page's tooltip
   box (site.js puts them on the rows as data-tip while the rail is
   narrow), because an icon alone is a guess. */
@media (min-width: 48rem) {
  /* The column keeps its gutter and the rows keep their inset, so the
     icon and the brand mark hold the exact position they had while the
     labels were showing. Nothing here recentres anything: the rail's
     width is what makes that fit. */
  :root[data-nav="collapsed"] .sidenav a > span {
    position: absolute; inline-size: 1px; block-size: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* Every card lifts the same way: an edge of the text colour at 8%, so it
   follows the theme, on a wide, faint shadow. */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-card-edge);
  border-radius: var(--radius-m);
  padding: var(--space-l);
  box-shadow: var(--shadow-card);
}
/* The sign-in, enrol and error cards are one fixed width whatever a face
   holds, so the steps do not breathe in and out as the copy changes. */
/* .center is content-box, so the width is the measure less the card's own
   padding and border: 100% would overflow the page by that much on a
   phone. */
[data-page="login"], [data-page="enroll"], [data-page="error"] { margin-block-start: var(--space-xl); inline-size: calc(100% - 2 * var(--space-l) - 2px); --center-measure: 27rem; }

.stat { display: flex; flex-direction: column; gap: var(--space-2xs); }
.stat__label { color: var(--c-text-muted); font-size: var(--step--1); }
.stat__value { font-size: var(--step-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.stat__value--pending { color: var(--c-text-muted); font-weight: 400; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  padding: var(--space-xs) var(--space-m);
  border: 1px solid var(--c-border-strong); border-radius: var(--radius-s);
  background: var(--c-surface); color: var(--c-text);
  cursor: pointer; text-decoration: none; font-weight: 500;
  min-block-size: 2.5rem; box-shadow: var(--shadow-1);
}
/* A link styled as a button keeps the button's text colour on hover: the
   generic `a:hover` rule would otherwise paint it link-blue, which on a
   primary button is the same hue as the background. */
.button:hover, a.button:hover { background: var(--c-surface-2); color: var(--c-text); }
.button--primary { background: var(--c-primary); color: var(--c-primary-text); border-color: transparent; }
.button--primary:hover, a.button--primary:hover { background: var(--c-primary-hover); color: var(--c-primary-text); }
.button--ghost { background: transparent; border-color: transparent; box-shadow: none; }
.button--wide { inline-size: 100%; }
.button[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.button:disabled { opacity: 0.55; cursor: not-allowed; }

.badge { display: inline-block; padding: var(--space-2xs) var(--space-s); border: 0; border-radius: 999px; background: var(--c-surface-2); font-size: var(--step--1); font-weight: 500; line-height: 1.4; }
button.badge { cursor: pointer; }

.notice { padding: var(--space-s) var(--space-m); border-radius: var(--radius-s); border: 1px solid var(--c-border); max-inline-size: none; }
.notice--info { background: var(--c-info-bg); }
.notice--error { background: var(--c-danger-bg); color: var(--c-danger); border-color: color-mix(in srgb, var(--c-danger) 30%, transparent); }

.field { display: flex; flex-direction: column; gap: var(--space-2xs); }
.field label, .field legend { font-weight: 500; }
/* A text-like input, not a box or a radio a field may also hold. The
   exclusion sits in :where(), so the rule keeps .field input's
   specificity and the focus and invalid borders below still win. */
.field input:where(:not([type=checkbox]):not([type=radio])) {
  padding: var(--space-xs) var(--space-s); border: 1px solid var(--c-border-strong); border-radius: var(--radius-s);
  background: var(--c-surface); min-block-size: 2.5rem; box-shadow: var(--shadow-1);
}
/* A multi-line field is the same field: it was left to the browser's own
   box, which carries none of the theme (a white box with a grey hairline
   in dark mode) and none of the focus treatment the rest of the form has.
   It resizes only downward, so a long reason cannot push the dialog's
   buttons sideways. */
.field textarea {
  padding: var(--space-xs) var(--space-s); border: 1px solid var(--c-border-strong); border-radius: var(--radius-s);
  background: var(--c-surface); color: inherit; font: inherit; box-shadow: var(--shadow-1);
  inline-size: 100%; resize: vertical; min-block-size: 4.5rem;
}
.field textarea:focus { border-color: var(--c-accent); }
.field textarea[aria-invalid="true"] { border-color: var(--c-danger); }
.field textarea[aria-invalid="true"]:focus { box-shadow: inset 0 0 0 1px var(--c-danger); }
.field .hint { color: var(--c-text-muted); font-size: var(--step--1); }
.field input[aria-invalid="true"] { border-color: var(--c-danger); }
/* A switch, for a setting that takes effect the moment it is thrown: the
   identifiers on the settings pages. It is NOT used for the boxes in a
   form — those apply when the form is saved (and, here, confirmed with a
   passkey), and a switch would promise an effect that has not happened
   yet. The state is carried by aria-checked, so the label stays put and
   names the thing rather than the next action; a label that changed under
   the pointer would leave the reader unsure which state they are in.
   The knob's resting side is logical (inset-inline-start), but `translate`
   takes physical lengths only — there is no flow-relative form — so the
   travelled distance needs its own right-to-left rule below. */
.switch {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  /* The button beside it in the same row uses these, so the pair hovers
     and reads as one rhythm rather than two kits. */
  padding: var(--space-xs) var(--space-m);
  background: none; border: 1px solid transparent; border-radius: var(--radius-s);
  cursor: pointer; min-block-size: 2.5rem;
}
.switch:hover { background: var(--c-surface-2); }
.switch__track {
  flex: none; position: relative;
  inline-size: 2.25rem; block-size: 1.25rem;
  border-radius: 1rem; background: var(--c-switch-off);
  transition: background-color 140ms ease;
}
.switch__track::before {
  content: ""; position: absolute;
  inset-block-start: 2px; inset-inline-start: 2px;
  inline-size: calc(1.25rem - 4px); block-size: calc(1.25rem - 4px);
  border-radius: 50%; background: var(--c-primary-text); box-shadow: var(--shadow-1);
  transition: translate 140ms ease;
}
.switch[aria-checked="true"] .switch__track { background: var(--c-accent); }
.switch[aria-checked="true"] .switch__track::before { translate: 1rem 0; }
/* `translate` is physical: left alone the knob would leave the track on
   its far side in Arabic instead of crossing it. */
[dir="rtl"] .switch[aria-checked="true"] .switch__track::before { translate: -1rem 0; }
/* The moving parts are the state; with motion turned down the colour and
   the position still change, they just do not animate. */
@media (prefers-reduced-motion: reduce) {
  .switch__track, .switch__track::before { transition: none; }
}

.check { display: flex; align-items: center; gap: var(--space-xs); padding-block: 2px; cursor: pointer; }
.check input { inline-size: 1.1em; block-size: 1.1em; accent-color: var(--c-accent); }
/* A box that may not be ticked reads as such, like a disabled button. */
.check:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
/* Keyboard focus on a box: no ring (the design call above), the fill a
   focused button takes, on the whole label. */
.check:has(input:focus-visible) { background: var(--c-surface-2); border-radius: var(--radius-s, 4px); }
/* A set of choices (radios), each a field with its hint set under its
   label's text, clear of the radio. */
.choices { display: grid; gap: var(--space-s); }
.choices > legend { font-weight: 500; }
.check + .hint { padding-inline-start: calc(1.1em + var(--space-xs)); }

.recovery-key {
  display: block; padding: var(--space-m); border-radius: var(--radius-s);
  background: var(--c-surface-2); font-size: var(--step-1); overflow-wrap: anywhere; text-align: start;
  user-select: all;
}

.footer { padding: var(--space-s) var(--space-m); color: var(--c-text-muted); text-align: center; font-size: var(--step--1); }

/* Invisible but focusable: Safari runs a passkey prompt only for a focused
   document, so the frame takes focus for each ceremony (vault.ceremony).
   visibility:hidden or a zero box would make it unfocusable. */
.vault-frame { position: fixed; inline-size: 1px; block-size: 1px; border: 0; inset-block-end: 0; inset-inline-end: 0; opacity: 0; pointer-events: none; }
.vault-body { background: transparent; }

/* A closed dialog must stay display:none even when a layout utility class is
   added to it — the UA rule is easily overridden and an invisible open box
   would sit over the page and swallow clicks. */
/* A dialog takes the page's text colour: the browser's own sheet gives it
   CanvasText, which follows the system's scheme, not the chosen theme (a
   dark theme on a light system drew black titles on the dark card). */
dialog { color: var(--c-text); }
dialog:not([open]) { display: none; }
/* Wide enough to read, never taller than the window: the tallest of these
   (suspending an account — a reason, a period, two options and their
   hints) had no height cap and no scroll, so on a phone held sideways its
   buttons sat below the fold with no way to reach them. dvh, so the mobile
   toolbar sliding in does not take the footer with it. */
/* Never taller than the window, and scrolling itself when its content is:
   the tallest of these (suspending an account) used to put its buttons
   below the fold with no way to reach them. This cap also governs the
   touch and session dialogs, which carry .card as well — deliberately, in
   dvh rather than the vh they set for themselves, so a mobile toolbar
   sliding in does not take a dialog's own footer with it. */
dialog.card {
  max-inline-size: min(32rem, calc(100vw - 2 * var(--space-m)));
  max-block-size: calc(100dvh - 2 * var(--space-m));
  overflow-y: auto; overscroll-behavior: contain;
}
/* When a dialog does scroll, its answer stays put: the row holding the
   buttons sits at the bottom of the box rather than below the fold, so
   what the dialog asks can always be answered without hunting for it.
   The rule finds that row by what it holds, because a few dialogs put a
   "what is required" line after it. Where :has is not supported the row
   simply scrolls with the rest, which is where it was before. */
dialog.card .cluster:has(> [type="submit"], > [data-dialog-close]) {
  position: sticky; inset-block-end: 0;
  padding-block: var(--space-xs);
  margin-block-end: calc(-1 * var(--space-xs));
  background: var(--c-surface);
}
/* ::backdrop exists for showModal() only; the touch dialog opens with
   show() and draws its own .touch-backdrop. */
dialog.card::backdrop { background: var(--c-scrim); }
/* Spacing between VISIBLE children only: the two dialog faces are siblings
   and one is always hidden, so "* + *" would indent the visible one. */
dialog.card > :not([hidden]) ~ :not([hidden]) { margin-block-start: var(--space-m); }

/* The stack hangs from the reading corner and grows towards the other
   one; the cap keeps the gutter it started from on the far side too,
   which a sentence long enough to cross the page had been taking (a
   toast ran edge to edge on a phone, and at twice the default text size
   on any width). Per cent, not vw: a fixed box measures the viewport
   the reader has, scrollbar already taken off. */
.toasts { position: fixed; inset-block-end: var(--space-m); inset-inline-end: var(--space-m); max-inline-size: calc(100% - 2 * var(--space-m)); --stack-space: var(--space-xs); z-index: 20; }
.toast { padding: var(--space-s) var(--space-m); border-radius: var(--radius-s); background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--shadow-1); }
.toast--error { border-color: var(--c-danger); color: var(--c-danger); }

/* ---------- exceptions ---------- */
.htmx-request .button[type="submit"], a.htmx-request { opacity: 0.7; cursor: progress; }
@media (prefers-reduced-motion: no-preference) {
  .main { animation: fade-in 120ms ease-out; }
  @keyframes fade-in { from { opacity: 0.4; } to { opacity: 1; } }
  /* Menus slide in on open; console.js keeps [open] for the closing run and
     drops it on animationend. Without JavaScript they simply open. */
  .menu[open] > .menu__panel { animation: menu-in 140ms cubic-bezier(0.2, 0, 0, 1); }
  .menu[data-closing] > .menu__panel { animation: menu-out 100ms ease-in forwards; }
  @keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
  @keyframes menu-out { to { opacity: 0; transform: translateY(-4px) scale(0.98); } }
  /* Same as the public site: where the engine can interpolate to auto, the
     panel unfolds instead of fading in at full size. The script waits for
     animationend, so the durations are free to differ from the fade. */
  @supports (interpolate-size: allow-keywords) {
    .menu__panel { interpolate-size: allow-keywords; overflow: hidden; }
    .menu[open] > .menu__panel { animation: menu-unfold 160ms ease; }
    .menu[data-closing] > .menu__panel { animation: menu-fold 120ms ease forwards; }
    @keyframes menu-unfold { from { block-size: 0; padding-block: 0; opacity: 0.4; } to { block-size: auto; padding-block: var(--space-2xs); opacity: 1; } }
    @keyframes menu-fold { to { block-size: 0; padding-block: 0; opacity: 0.4; } }
  }
  /* The theme switch deliberately does NOT cross-fade. It used to, via a
     .theme-transition class on <html> carrying a 220ms transition on every
     element, torn down on a 260ms timer. Measured, that produced the
     opposite of a smooth change:

     - Elements with no colour of their own (h1, label) inherit it. They
       animated to the final colour ahead of their parent, then snapped
       BACKWARDS to the parent's in-flight value the moment the rule was
       removed, then eased up again -- two reversals, plainly visible.
     - The icons that swap on theme (the globe, the sun and the moon) were
       display:none when the transition began, so they had nothing to
       animate and popped to the final colour while the page around them
       was still fading.
     - color-scheme flips in one frame regardless, so the browser's own
       scrollbars and form controls snapped while the CSS faded anyway.

     Changing everything in one frame is both consistent and flicker-free.
     If a cross-fade is ever wanted again, it cannot be done with a
     universal rule on a timer. */
}

/* One frame with no transitions at all, while the theme swaps. The hover
   transitions elsewhere in this file (links, icon buttons, the switch
   track) are wanted on hover and NOT on a theme change, where they left a
   handful of elements easing for 120-140ms after the rest of the page had
   already changed. Unlike a duration, `none` is safe to add and remove
   around a change: nothing animates, so nothing can be caught mid-flight
   and yanked. Outside the reduced-motion query on purpose -- it removes
   motion, so it applies whatever the reader has asked for. */
.theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after {
  transition: none !important;
}

/* ---------- sign-in steps ---------- */
/* A list of things to pick from (remembered addresses, organisations):
   rows like the menu items, full width, with a trailing affordance. */
/* Rows to pick from (remembered addresses, organisations): edge to edge in
   the card, divided, an avatar at the start, a chevron and a trailing
   control. */
.rows { max-block-size: min(22rem, 50dvh); overflow-y: auto; overscroll-behavior: contain; list-style: none; margin: 0 calc(-1 * var(--space-l)); padding: 0; border-block-start: 1px solid var(--c-border); }
.rows li { display: flex; align-items: stretch; border-block-end: 1px solid var(--c-border); }
.rows .choice {
  flex: 1; min-inline-size: 0; display: flex; align-items: center; gap: var(--space-s); min-block-size: 3.5rem;
  padding: var(--space-xs) var(--space-l); border: 0; background: transparent; color: var(--c-text); text-align: start; cursor: pointer; font: inherit;
}
/* Hover is the only highlight on a row: no fill on press or after a click.
   Keyboard focus (:focus-visible, which a click never sets) shows the same
   fill, so a person tabbing down the list can tell which row is next.
   Programmatic focus on a new step must not override pointer hover. */
.rows .choice:hover, .rows .choice:focus-visible { background: var(--c-surface-2); }
.rows .forget:focus-visible { color: var(--c-danger); }
.rows .avatar {
  flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 2.5rem; block-size: 2.5rem;
  border-radius: 999px; background: var(--c-surface-2); border: 1px solid var(--c-border); color: var(--c-text-muted);
}
/* A one-word organisation name or a dotless address has no break
   opportunity: let it wrap anywhere rather than push the card sideways. */
.rows .choice__text { display: flex; flex-direction: column; min-inline-size: 0; flex: 1; overflow-wrap: anywhere; }
.rows .choice__text small { color: var(--c-text-muted); }
.rows .choice::after { content: "\203A"; color: var(--c-text-muted); font-size: 1.25em; margin-inline-start: auto; }
[dir="rtl"] .rows .choice::after { content: "\2039"; }
/* Trust has a wider explanation and three choices, with deferral apart
   from the explicit decision. Logical margins follow the reading direction. */
[data-page="login"]:has([data-step="trust"]:not([hidden])) { --center-measure: 42rem; }
.welcome__head.trust-heading { gap: 0; }
.trust-heading > * { margin-block: 0; }
.trust-heading > .welcome__icon { margin-block-end: var(--space-m); }
.trust-heading > .welcome__title { margin-block-end: var(--space-l); }
.trust-detail { align-self: center; text-align: center; font-size: var(--step--1); }
.trust-actions { display: flex; flex-wrap: wrap; gap: var(--space-s); padding-block-start: var(--space-m); }
.trust-actions__choices { display: flex; flex-wrap: wrap; gap: var(--space-s); margin-inline-start: auto; }
.trust-actions .button { max-inline-size: 100%; }
.trust-actions .button:not(.button--primary) { color: var(--c-link); border-color: var(--c-link); }
@media (max-width: 30rem) {
  .trust-actions > .button, .trust-actions__choices { inline-size: 100%; }
  .trust-actions__choices > .button { flex: 1 1 auto; }
}
/* The "go on" arrow points along the reading direction. */
[dir="rtl"] .icon--enter { transform: scaleX(-1); }
.rows .forget {
  flex: none; align-self: stretch; inline-size: 3.5rem; block-size: auto; min-block-size: 3.5rem;
  margin: 0; border: 0; border-radius: 0; color: var(--c-text-muted);
}
.rows .forget:hover { color: var(--c-danger); }
/* The "welcome back" face: a centred mark, title and subtitle; the rows;
   one line to the form instead. */
.welcome__head { display: grid; justify-items: center; gap: var(--space-2xs); text-align: center; padding-block-end: var(--space-xs); }
/* Navigation sits in the card's existing top padding, without adding a row
   or moving the centred heading. Touch keeps a larger target. */
[data-page="login"] { position: relative; }
.login-back { position: absolute; inset-block-start: var(--space-m); inset-inline-start: var(--space-m); margin: 0; inline-size: 2rem; block-size: 2rem; }
/* Keep the first visible card notice steady as navigation changes. */
[data-page="login"] > .notice:nth-child(1 of .notice:not([hidden])) { margin-block-start: var(--space-xl); }
@media (any-pointer: coarse) {
  .login-back { inline-size: 2.75rem; block-size: 2.75rem; }
}
[dir="rtl"] .login-back .icon { transform: scaleX(-1); }
.welcome__head .muted { overflow-wrap: anywhere; }
[data-trust-lead] strong { color: var(--c-text); font-weight: 600; }
.welcome__icon {
  display: inline-flex; align-items: center; justify-content: center; inline-size: 3rem; block-size: 3rem; margin-block-end: var(--space-2xs);
  border-radius: 999px; background: var(--c-surface-2); border: 1px solid var(--c-border); color: var(--c-text-muted);
}
.welcome__title { font-size: var(--step-2); }
.welcome__other { text-align: center; }
/* The code shown to type elsewhere: large, monospace, selectable at once. */
.code-display {
  display: block; font-size: var(--step-2); letter-spacing: 0.08em; text-align: center;
  padding: var(--space-s); border: 1px solid var(--c-border-strong); border-radius: var(--radius-s); background: var(--c-surface-2);
  user-select: all; -webkit-user-select: all;
}
/* A button that reads as a link: the same underline rules as `a`. */
.linklike { background: none; border: 0; padding: 0; color: var(--c-link); cursor: pointer; font: inherit; text-decoration: underline; text-decoration-thickness: from-font; text-underline-offset: 0.15em; }
.linklike:hover { color: var(--c-link-hover); }
/* The "or …" line under a form: its links are quieter than the form (muted
   at 80%), lifting to the text colour on hover. */
.welcome__other .linklike { color: var(--c-text-quiet); }
.welcome__other .linklike:hover, .welcome__other .linklike:focus-visible { color: var(--c-text); }

/* ---------- organisation pages (slice 2) ---------- */
/* A counter that opens the list it counts. */
/* It says so before it is touched: a stronger edge and a chevron (which
   mirrors in a right-to-left page). */
a.stat--link { color: inherit; text-decoration: none; border-color: var(--c-border-strong); }
a.stat--link .stat__label::after { content: " \203A"; }
[dir="rtl"] a.stat--link .stat__label::after { content: " \2039"; }
a.stat--link:hover, a.stat--link:focus-visible { background: var(--c-surface-2); }

.field select {
  padding: var(--space-xs) var(--space-s); border: 1px solid var(--c-border-strong); border-radius: var(--radius-s);
  background: var(--c-surface); min-block-size: 2.5rem; color: inherit; font: inherit; box-shadow: var(--shadow-1);
}
.field select:focus { border-color: var(--c-accent); }
.field__error { color: var(--c-danger); }

/* Filters sit on one line where there is room, fields bottom-aligned with
   the buttons; they wrap to a column on a phone. */
/* A field whose input and its button share a row (a single search), with
   the hint and any error below both: the button lines up with the input,
   not with the bottom of the hint beneath it. The input takes the room. */
.field__row { display: flex; align-items: center; gap: var(--space-s); }
.field__row > input { flex: 1 1 auto; min-inline-size: 0; }
.field__row > .button { flex: none; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-s) var(--space-m); }
.filters .field { flex: 1 1 12rem; }
.filters > .cluster { flex: 0 0 auto; }

.button--danger { background: var(--c-danger); color: var(--c-surface); border-color: transparent; }
.button--danger:hover, .button--danger:focus-visible { background: color-mix(in srgb, var(--c-danger) 85%, black); color: var(--c-surface); }
.button--danger-ghost { color: var(--c-danger); border-color: color-mix(in srgb, var(--c-danger) 40%, transparent); }
.button--danger-ghost:hover, .button--danger-ghost:focus-visible { background: var(--c-danger-bg); color: var(--c-danger); }

/* Tables: rows divided by a whisper on a wide container; on a narrow one
   each row becomes a card of label/value pairs (the cell's data-label). */
.table-wrap { overflow-x: auto; }
.table { inline-size: 100%; border-collapse: collapse; }
/* Cells centre on the row, not on its first line: a name cell carries
   its identifier under it, and top-aligning left every other cell — the
   count, the status, the chevron — hanging at the name's first line. */
.table th, .table td { text-align: start; vertical-align: middle; padding: var(--space-xs) var(--space-s); border-block-end: 1px solid var(--c-border); }
.table th { color: var(--c-text-muted); font-size: var(--step--1); font-weight: 500; white-space: nowrap; }
.table td { overflow-wrap: anywhere; }
.table td.table__actions { text-align: end; }
.table__actions > * + * { margin-inline-start: var(--space-xs); }
/* A note on a row's actions (why one is held back) sits under them. */
.table__note { display: block; margin-block-start: var(--space-2xs); margin-inline-start: 0; }
/* A row's action label never breaks inside a word (an Arabic word least of
   all); the cell wraps whole controls instead. */
.table__actions .button { white-space: nowrap; }

/* A list whose rows open something: the whole row is the link. The name
   carries the real anchor (one tab stop, a copyable address, the
   accessible name); a pseudo-element of its own covers the row, so a
   click anywhere on the row follows it. Rows with nothing to open keep
   their action buttons and never take this class. Anything else in a
   linked row — a button, another link — is lifted above the cover. */
.table--linked tbody tr { cursor: pointer; }
.table--linked tbody tr:hover { background: var(--c-surface-2); }
@supports selector(:has(a)) {
  .table--linked tbody tr:has(.row-link:focus-visible) { background: var(--c-surface-2); }
}
.row-link { color: var(--c-text); font-weight: 500; text-decoration: none; }
.row-link:hover, .row-link:focus-visible { color: var(--c-text); text-decoration: underline; }
/* The chevron is the row's affordance, not its name: it is decoration
   (the name is the link), it takes no width beyond itself, and it points
   the way the script runs. */
/* The cell shrinks to its content (inline-size: 1px is the shrink
   idiom), which makes the chevron's own max-inline-size: 100% — the
   img/svg reset at the top of this file — resolve against 1px and paint
   nothing at all. The icon opts out of that cap; without this line the
   row loses the one mark that says it opens. */
.table__go { inline-size: 1px; text-align: end; color: var(--c-text-muted); }
.table__go .icon { max-inline-size: none; }
[dir="rtl"] .icon--chevron { transform: scaleX(-1); }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }
.inline-form select { padding: var(--space-2xs) var(--space-xs); border: 1px solid var(--c-border-strong); border-radius: var(--radius-s); background: var(--c-surface); min-block-size: 2.5rem; font: inherit; color: inherit; box-shadow: var(--shadow-1); }
.cell-note { display: block; }
/* Identifiers and instants read as one token: no break inside them. */
.nowrap { white-space: nowrap; overflow-wrap: normal; }
.cell-wrap { overflow-wrap: anywhere; }
/* A row carrying one of these can grow to any height when it is opened,
   and centring the other cells on THAT re-floats the time and the actor
   into empty space, away from the toggle they belong beside. Such a row
   keeps the old top alignment. */
.table tr:has(.cell-details) td { vertical-align: top; }
.cell-details summary { cursor: pointer; white-space: nowrap; }
.json { margin: var(--space-2xs) 0 0; padding: var(--space-xs); background: var(--c-surface-2); border-radius: var(--radius-s); font-family: var(--font-mono); font-size: var(--step--1); white-space: pre-wrap; overflow-wrap: anywhere; text-align: start; }
@container main (max-width: 44rem) {
  .table thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table, .table tbody, .table tr, .table td { display: block; }
  /* Each card is a query container of its own: how much room the pairs
     inside it have is the card's width, which is the page's less the
     navigation, the padding and — on a linked table — the room kept for
     the chevron. No outer query knows that number. */
  .table tr { border: 1px solid var(--c-border); border-radius: var(--radius-m); background: var(--c-surface); padding: var(--space-s); margin-block-end: var(--space-s); container-type: inline-size; container-name: row; }
  /* The label column is a third of the card, and 6rem where a third is
     more than that. Written the other way round — a 6rem floor with a
     35% cap — the floor wins on a narrow card and takes more than the
     card has: at twice the default text size 6rem is 192px, which is
     most of a phone's card, and the value column was left with 23px of
     it. The value column takes what is left and may go below its own
     content's width (minmax(0, …)), so a value that does not fit
     overflows its cell rather than widening the card, and the rules
     below see to it that values do fit. */
  .table td { border: 0; padding: var(--space-2xs) 0; display: grid; grid-template-columns: minmax(min(6rem, 35%), 35%) minmax(0, 1fr); column-gap: var(--space-s); row-gap: var(--space-2xs); }
  /* A row's own heading (a body th) heads its card, flush with the
     cells under it. */
  .table tbody th { display: block; border: 0; padding: 0 0 var(--space-2xs); }
  .table td[data-label]::before { content: attr(data-label); color: var(--c-text-muted); font-weight: 500; grid-row: 1 / span 3; }
  /* Everything a cell holds stacks in the value column, at its own width. */
  .table td > * { grid-column: 2; justify-self: start; }
  .table td.table__actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); justify-content: flex-start; padding-block-start: var(--space-xs); }
  .table__actions > * + * { margin-inline-start: 0; }
  /* Each row is a card here. The chevron is the only cue that a card
     opens something (there is no hover on a touch screen), so it stays
     — pulled up beside the name rather than sitting as a cell of its
     own at the end of the card. */
  /* It is one mark, not a label and a value: the cell drops the pairs'
     two columns (which put the chevron where the value column starts —
     a third of a card away from the corner it is pinned to, and off the
     end of the card at large text) and drops the 1px width that shrinks
     it in a real table, which here only made the cell narrower than the
     mark it holds. */
  .table--linked td.table__go { position: absolute; inset-block-start: var(--space-s); inset-inline-end: var(--space-s); padding: 0; display: block; inline-size: auto; }
  .table--linked tbody tr { position: relative; padding-inline-end: var(--space-xl); }
  /* An instant or an identifier reads as one token, and on a wide table
     it is kept on one line for that. In a card it is the card's width
     that decides: a value that cannot fit on one line wraps at its
     spaces first ("2026-09-23 10:00" becomes two lines before it becomes
     a sideways scroll) and inside the token only when a single token is
     wider than the card. Without this a 16-character instant at twice
     the default text size is 238px against a phone card's 206px, and
     the card — or the page under an unwrapped table — scrolls sideways. */
  .table td .nowrap, .table td.nowrap { white-space: normal; overflow-wrap: anywhere; }
  /* Below this the two columns stop being worth their room: the label
     takes a third and the value is left with too little to read. The
     label goes above its value instead, and the value has the whole
     card. In rem, so it is the reader's text size that decides — at the
     default a card this narrow does not occur (measured, the narrowest
     is a linked card on a 320px page at 234px, against this 208px), and
     at twice it every phone card is below it — the pairs come back at a
     card width of 416px, which is a 588px page. */
  @container row (max-width: 13rem) {
    .table td { grid-template-columns: minmax(0, 1fr); }
    .table td[data-label]::before { grid-row: auto; }
    .table td > * { grid-column: 1; }
  }
}

/* A key's status: text on a tint, never colour alone (the word is the
   status). */
.status { display: inline-block; padding: 0 0.55em; border-radius: 999px; font-size: var(--step--1); font-weight: 500; background: var(--c-surface-2); }
.status--pending { background: var(--c-info-bg); color: var(--c-text); }
.status--used { background: var(--c-success-bg); color: var(--c-success); }
/* The danger tint is faint against a card, so these pills carry a ring as
   well: a pill in every theme, like the others. */
.status--expired, .status--revoked { background: var(--c-danger-bg); color: var(--c-danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-danger) 35%, transparent); }
.status--deleted, .status--canceled, .status--inactive { color: var(--c-text-muted); }

.issued { border-color: var(--c-success); background: var(--c-success-bg); }
.issued:focus { outline: none; }
.pager { justify-content: flex-start; }

/* Users: a member's status, text on a tint like a key's. */
.status--member-active { background: var(--c-success-bg); color: var(--c-success); }
.status--member-suspended, .status--member-needs_reregistration { background: var(--c-danger-bg); color: var(--c-danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-danger) 35%, transparent); }
.status--member-pending { background: var(--c-info-bg); color: var(--c-text); }
.status--member-deleted, .status--member-unknown { color: var(--c-text-muted); }

/* Organisations (the control panel): an organisation's status, the same way. */
.status--org-active { background: var(--c-success-bg); color: var(--c-success); }
.status--org-suspended { background: var(--c-danger-bg); color: var(--c-danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-danger) 35%, transparent); }
.status--org-deleted, .status--org-unknown { color: var(--c-text-muted); }

/* Administrators (the control panel): an administrator's status, the same
   way; an invitation reads as pending. */
.status--admin-active { background: var(--c-success-bg); color: var(--c-success); }
/* A permission a role holds, in the roles matrix. */
.status--granted { background: var(--c-success-bg); color: var(--c-success); }
.status--admin-pending { background: var(--c-info-bg); color: var(--c-text); }
.status--admin-suspended { background: var(--c-danger-bg); color: var(--c-danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-danger) 35%, transparent); }
.status--admin-retired, .status--admin-unknown { color: var(--c-text-muted); }
.status--admin-lapsed { background: var(--c-danger-bg); color: var(--c-danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-danger) 35%, transparent); }

/* Facts: a record's fields as a definition list, term above value, laid
   out in columns as the width allows. */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--facts-min, 10rem)), 1fr)); gap: var(--space-s) var(--space-m); margin: 0; }
.facts > div { display: grid; gap: var(--space-2xs); }
.facts dt { font-size: var(--step--1); color: var(--c-text-muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
/* Facts that are a SET to scan rather than a handful to glance at — a
   role's sections and what it may do in each. One per line with the
   level at the far end: the flowing grid above is right for six boxes of
   detail and becomes a wall to hunt through at twenty, where the reader
   is looking down one list for one section. */
.facts--rows { grid-template-columns: 1fr; gap: 0; }
.facts--rows > div {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline; gap: var(--space-s);
  padding-block: var(--space-xs);
  border-block-end: 1px solid var(--c-border);
}
.facts--rows > div:last-child { border-block-end: 0; }
.facts--rows dt { font-size: inherit; color: inherit; }
.facts--rows dd { text-align: end; }

/* A disclosure (a folded list, such as retired administrators): its summary
   reads as a control, with the site's own chevron in place of the browser
   marker, turned when open and mirrored for right-to-left. */
.disclosure > summary { display: flex; align-items: center; gap: var(--space-xs); min-block-size: 2.5rem; padding: var(--space-2xs) var(--space-xs); border-radius: var(--radius-s); cursor: pointer; color: var(--c-text-muted); list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: "\203A"; display: inline-block; font-size: 1.25em; line-height: 1; }
/* The chevron turns as the area opens — for a reader who asked for less
   motion it is simply turned, like everything else in this file. */
@media (prefers-reduced-motion: no-preference) { .disclosure > summary::before { transition: transform 120ms; } }
[dir="rtl"] .disclosure > summary::before { content: "\2039"; }
.disclosure[open] > summary::before { transform: rotate(90deg); }
[dir="rtl"] .disclosure[open] > summary::before { transform: rotate(-90deg); }
.disclosure > summary:hover { background: var(--c-surface-2); color: var(--c-text); }

/* Settings: one card per key, the form under its facts. */
/* margin-inline only: the block margin is the stack's to set (a `margin: 0`
   here would win over the stack rule and leave the list touching its lead). */
/* A namespace's heading over its settings: an eyebrow a step below the
   cards' own keys, muted, so the scale carries the hierarchy (no tracking:
   Arabic letters must join). */
.settings__group { font-size: var(--step--1); color: var(--c-text-muted); font-weight: 600; }
/* On a long catalogue the group's name stays in view while its cards
   scroll under it. */
/* Clears the environment strip when one is showing (production has
   none, and the fallback is then zero). */
.settings__group { position: sticky; inset-block-start: var(--envbar-offset, 0px); z-index: 1; background: var(--c-bg); padding-block: var(--space-2xs); }
:root:has(.envbar) { --envbar-offset: var(--envbar-block-size); }
.settings__jump { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-s); font-size: var(--step--1); }
/* A jump link is small text, and small text on its own line box gave a
   target 18px tall (21px in Arabic) against the 24px of WCAG 2.5.8 —
   with the next row of links 4px under it, the spacing that can excuse
   an undersized target was not there either. The floor is the criterion's
   own 24px and nothing more, because this row shares its line with two
   2.5rem buttons: at a width where the list fits on one line the bar does
   not change at all, and where it already wraps the bar grows by the
   difference (measured 88px to 100px at 320 and 390). In rem, so a reader
   at twice the text size gets twice the floor. */
.settings__jump a { display: inline-flex; align-items: center; min-block-size: 1.5rem; }
.stack > .settings__group + .settings { margin-block-start: var(--space-s); }
/* The areas' bar: the jump list, and at the end the switch for the keys.
   They share a row while it fits and stack when it does not. */
/* The list of areas takes the room, the switches sit at the end of it.
   Written as "space between what I hold" the bar prised the switches to
   opposite edges of the page wherever it held nothing else — which is
   every organisation page, and the settings page at any width where the
   list of areas wraps to a line of its own. */
/* Two rows: the areas to jump to, then the controls under them. Side by
   side, the controls were pushed about by however many areas the page
   had; on their own row they keep one place. They sit at the end edge —
   the right in English, the left in Arabic — which margin-inline-start
   gives without a second rule. */
.settings__bar { --stack-space: var(--space-xs); align-items: stretch; }
.settings__bar .settings__jump { flex: 1 1 auto; }
.settings__switches { margin-inline-start: auto; gap: var(--space-xs); }
/* The all-areas control carries both chevron pairs and shows the one that
   matches what pressing it would do, so it reads as a control with a
   graphic beside the switch next to it rather than as bare words in a row
   of drawn things. */
/* By name, not by position: three templates emit this pair, and a rule
   that counted them would show the wrong glyph the moment one of them
   reordered its two includes — with nothing to catch it but an eye. */
.settings__all[data-folded="true"] .icon--fold,
.settings__all[data-folded="false"] .icon--unfold { display: none; }
.settings__all { gap: var(--space-2xs); }
/* The platform catalogue has a local index at the reading end. Its
   breakpoint follows the main content, including the global rail's width. */
.settings-layout { display: grid; gap: var(--space-l); min-inline-size: 0; }
.settings-content { display: grid; grid-template-columns: minmax(0, 1fr); min-inline-size: 0; }
.settings-groups { grid-area: 1 / 1; min-inline-size: 0; }
/* Fields and long descriptions must not set the grid's minimum width. */
.settings-content .settings { grid-template-columns: minmax(0, 1fr); }
.settings-content .setting { overflow-wrap: anywhere; }
.settings-content .setting :is(input, select) { max-inline-size: 100%; }
.settings-content .chip { max-inline-size: 100%; white-space: normal; }
.settings-index { --settings-index-wide: 0; position: relative; min-inline-size: 0; align-self: start; }
.settings-index__title { display: none; align-items: center; min-block-size: 2.75rem; margin: 0; font-size: var(--step--1); font-weight: 600; }
/* One header belongs to the whole catalogue, so group boundaries never
   push it away. Native disclosures remain available without the script. */
.settings-area { min-inline-size: 0; }
.settings-area + .settings-area { margin-block-start: var(--space-s); }
.settings-area .settings__group { position: static; min-block-size: 2.75rem; cursor: default; }
.settings-area .settings__group:hover { background: var(--c-bg); color: var(--c-text-muted); }
.settings-area .settings__group > h2 { cursor: pointer; }
.settings-area .settings__group > h2:hover { color: var(--c-accent); text-decoration: underline; text-underline-offset: .15em; }
.settings-content--enhanced .settings-area:first-child .settings__group { visibility: hidden; }
.settings-current {
  grid-area: 1 / 1; align-self: start; position: sticky; inset-block-start: var(--envbar-offset, 0px); z-index: 2;
  display: flex; align-items: center; min-block-size: 2.75rem; background: var(--c-bg); border-radius: 0 0 var(--radius-s) var(--radius-s);
}
.settings-current--sticky { box-shadow: var(--shadow-2); }
.settings-current__heading { flex: 1; min-inline-size: 0; margin: 0; font-size: var(--step--1); font-weight: 600; }
.settings-current__toggle {
  display: inline-flex; align-items: center; gap: var(--space-xs); max-inline-size: 100%; min-block-size: 2.75rem;
  padding: var(--space-2xs) var(--space-xs); border: 0; border-radius: var(--radius-s); background: transparent;
  color: var(--c-text-muted); font: inherit; text-align: start; cursor: pointer;
}
.settings-current__toggle::before { content: "\203A"; flex: none; font-size: 1.25em; line-height: 1; }
[dir="rtl"] .settings-current__toggle::before { content: "\2039"; }
.settings-current__toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
[dir="rtl"] .settings-current__toggle[aria-expanded="true"]::before { transform: rotate(-90deg); }
.settings-current__toggle:is(:hover, :focus-visible) { color: var(--c-accent); }
.settings-current__toggle:is(:hover, :focus-visible) > span { text-decoration: underline; text-underline-offset: .15em; }
.settings-tools { flex: none; flex-wrap: nowrap; gap: var(--space-2xs); margin-inline-end: var(--space-s); }
.settings-tools :is(.switch, .iconbtn):is(:hover, :focus-visible) { background: transparent; }
.settings-tools .settings__all:is(:hover, :focus-visible) { color: var(--c-accent); }
.settings-tools__identifiers { display: flex; align-items: center; gap: var(--space-2xs); }
.settings-tools__label { font-size: var(--step--1); }
.settings-tools__ids { justify-content: center; padding: 0; inline-size: 2.75rem; block-size: 2.75rem; min-block-size: 2.75rem; }
.settings-tools > button { min-block-size: 2.75rem; }
.settings-tools > .iconbtn { inline-size: 2.75rem; block-size: 2.75rem; }
.settings-index__disclosure > summary { display: inline-flex; inline-size: fit-content; max-inline-size: 100%; min-block-size: 2.75rem; font-size: var(--step--1); }
.settings-index .settings__jump { flex-direction: column; gap: 0; margin-block-start: var(--space-xs); }
.settings-index .settings__jump a {
  padding: var(--space-2xs) var(--space-s); min-block-size: 2rem;
  border-inline-start: 2px solid var(--c-border); color: var(--c-text-muted);
  text-decoration: none; overflow-wrap: anywhere;
}
.settings-index .settings__jump a:hover { color: var(--c-text); background: var(--c-surface-2); }
.settings-index .settings__jump a[aria-current="location"] {
  border-inline-start-color: var(--c-accent); color: var(--c-accent); background: var(--c-surface-2); font-weight: 600;
}
.settings-index .settings__jump a:focus-visible { outline-offset: -2px; }
@container main (min-width: 54rem) {
  .settings-layout { grid-template-columns: minmax(0, 1fr) 15rem; }
  .settings-content { grid-column: 1; grid-row: 1; }
  .settings-index {
    --settings-index-wide: 1; grid-column: 2; grid-row: 1;
    position: sticky; inset-block-start: calc(var(--envbar-offset, 0px) + var(--space-s));
    max-block-size: calc(100dvh - var(--envbar-offset, 0px) - 2 * var(--space-s)); overflow-y: auto;
  }
  .settings-index__title { display: flex; }
  .settings-index--enhanced .settings-index__disclosure > summary { display: none; }
}

/* An area folds. Its summary carries the heading, so the heading keeps
   its level and its id for the jump list and for deep links, while the
   row itself is the control: the disclosure block above gives it the
   chevron (mirrored for right-to-left) and the focus ring, and the
   sticky rule above keeps it in view while its cards scroll under it.
   The heading inside takes the row's own type rather than a heading's,
   which would tower over an eyebrow. */
.settings__section > summary > :is(h2, h3) { font: inherit; color: inherit; margin: 0; }
.settings__section > .settings { margin-block-start: var(--space-s); }
/* A folded area still holds the cards; keep the gap under its row from
   collapsing into the next one. */
.settings__section + .settings__section { margin-block-start: var(--space-s); }
.settings { list-style: none; margin-inline: 0; padding: 0; display: grid; gap: var(--space-m); }
/* Match the identifier's copy control even while identifiers are hidden,
   so toggling them does not shift a single-line title or its card. */
.setting__head { display: flex; flex-wrap: wrap; align-items: center; min-block-size: 1.5rem; gap: var(--space-xs) var(--space-s); }
/* A setting's name heads the card in the reader's language; its key sits
   under it as the identifier — smaller, mono, quiet, and always read
   left to right, whatever the page's direction. The pair reads as one
   unit, so the key sits close under the name; in an RTL page the key's
   BLOCK still hangs from the same edge as the name above it, while its
   own characters keep running left to right.
   The margin REPLACES the stack's own gap rather than adding to it —
   both selectors weigh the same and this one comes later — so it is the
   whole distance, written positive. A negative value here does not pull
   the key closer; it drags it onto the name.
   .setting__key stays what it always was: a card's heading, still used
   as one by the email-domain cards. */
.setting__key { overflow-wrap: anywhere; font-size: var(--step-0); }
/* A value is shown whole, and a URL or a list of them has no spaces to break at:
   let it break anywhere rather than run past the card on a narrow screen. */
.setting__facts { overflow-wrap: anywhere; }
.setting__label { overflow-wrap: anywhere; font-size: var(--step-0); }
/* Asked for, not given: a card reads by its name, and the key is what an
   operator quotes to support or types into a tool. It is there when the
   page's toggle asks for it (the state is a cookie the server reads, so
   a page that shows keys shows them from its first paint) and out of the
   way otherwise — display, so it leaves the accessibility tree with the
   ink and a reader is not told a key that no one can see. */
.setting__id { display: none; }
/* The identifier rides at the far end of the head, opposite the label.
   The auto margin resolves against THIS box's own writing mode, so the
   box must stay in the page's direction and only the identifier text
   inside it is pinned LTR — carrying dir="ltr" here would pin the margin
   to the physical left and strand the chip beside the label in Arabic
   (measured: 8px from the label, the free space left at the far end).
   The head already wraps, so on a narrow card it drops to its own line
   under the name rather than squeezing it. */
:root[data-ids="shown"] .setting__id { display: block; margin-inline-start: auto; overflow-wrap: anywhere; font-size: var(--step--1); text-align: start; }
/* A card reached by its link (the administrator limit from a full
   organisation's invitation) lands clear of the top and is picked out.
   scroll-padding on the root covers everything else that scrolls into
   view — keyboard focus, find-in-page — which the per-selector margins
   never did. Both have to clear the environment strip now that it
   stays put. */
html { scroll-padding-block-start: calc(var(--envbar-offset, 0px) + var(--space-s)); }
.setting, .card[id] { scroll-margin-block-start: calc(var(--envbar-offset, 0px) + var(--space-l)); }
/* What lies outside a members' email domain sits under the domain's own
   form, set apart by a rule: a second question on the same card. */
.domain-outside { border-block-start: 1px solid var(--c-border); padding-block-start: var(--space-m); scroll-margin-block-start: calc(var(--envbar-offset, 0px) + var(--space-l)); }
/* Its form's button says what it will do: the keys' words while that
   choice stands, the removal's with it. A browser without :has() shows
   the neutral word alone, never both (nor the wrong one). */
.domain-outside .when-keys, .domain-outside .when-members { display: none; }
@supports selector(:has(a)) {
  .domain-outside .when-any { display: none; }
  .domain-outside form:has(input[name=scope][value=members]:checked) .when-members,
  .domain-outside form:not(:has(input[name=scope][value=members]:checked)) .when-keys { display: inline; }
}
.setting:target { box-shadow: var(--shadow-card), 0 0 0 2px var(--c-accent); }
/* The value field takes the row, so a long value (an address) is read
   whole; a number keeps its own width. */
.setting .inline-form { display: flex; }
.setting .inline-form input:not([type=hidden]):not([type=number]) { flex: 1 1 16rem; }
/* The floor keeps a value field wide enough to read what is in it, and
   min(…, 100%) keeps the floor from outgrowing the card that holds it:
   8rem is 256px at twice the default text size, which a 320px page
   cannot give (the card has 160px to spend there), and the card was
   pushing the page 66px sideways rather than letting the field shrink.
   The same idiom the grid above uses for its own track floor. */
.setting input:not([type=hidden]):not([type=checkbox]):not([type=radio]), .setting select { padding: var(--space-2xs) var(--space-xs); border: 1px solid var(--c-border-strong); border-radius: var(--radius-s); background: var(--c-surface); min-block-size: 2.5rem; font: inherit; color: inherit; min-inline-size: min(8rem, 100%); box-shadow: var(--shadow-1); }

/* Account: one card per passkey — its name, where it lives, when. */
.passkeys { list-style: none; margin-inline: 0; padding: 0; display: grid; gap: var(--space-s); }
.passkey { display: flex; flex-direction: column; gap: var(--space-2xs); overflow-wrap: anywhere; }
.passkey__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-s); }
/* The browser's memory of the sign-in stands apart from the passkey's own
   lines, under a rule: the state line at body size, then its button. */
.passkey__browser { display: flex; flex-direction: column; gap: var(--space-xs); margin-block-start: var(--space-xs); padding-block: var(--space-s) var(--space-2xs); border-block-start: 1px solid var(--c-border); }

/* ---------- passkey faces ---------- */
/* The mark of a ceremony in progress: two rings of dots around the kind's
   icon, turning slowly against each other; still when motion is reduced. */
.rings { position: relative; display: inline-flex; align-items: center; justify-content: center; inline-size: 6.5rem; block-size: 6.5rem; color: var(--c-accent); }
.rings__ring { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.rings__ring--outer { opacity: 0.45; }
.rings__ring--inner { opacity: 0.8; }
.rings .welcome__icon { margin: 0; }
@media (prefers-reduced-motion: no-preference) {
  .rings__ring--outer { animation: rings-turn 24s linear infinite; }
  .rings__ring--inner { animation: rings-turn 24s linear infinite reverse; }
  @keyframes rings-turn { to { transform: rotate(360deg); } }
}
/* The icon follows the kind being asked for: a laptop for this device, a
   key for a security key or phone (and when the kind is not known). */
[data-passkey-kind="device"] .passkey-icon--external, [data-passkey-kind="external"] .passkey-icon--device, [data-passkey-kind=""] .passkey-icon--device { display: none; }
.passkey-icon--device, .passkey-icon--external { display: contents; }
.welcome__icon--error { border-color: var(--c-danger); color: var(--c-danger); background: var(--c-surface); }
.notice--icon { display: flex; align-items: flex-start; gap: var(--space-xs); }
.notice--icon .notice__icon { flex: none; display: inline-flex; margin-block-start: 0.1em; }
/* The touch dialog is opened non-modally (the vault frame must stay
   focusable), so it centres and dims the page itself; console.js makes
   the rest of the page inert while it is open. */
/* The height cap and the scroll come from dialog.card above (which wins
   on specificity, and is the better unit); what is set here is the
   centring, the width and the layer. */
.touch { position: fixed; inset: 0; margin: auto; inline-size: min(27rem, calc(100vw - 2 * var(--space-m))); block-size: fit-content; z-index: 30; }
/* One height for the three faces, content centred, so the box does not
   jump as the touch moves from the rows to the rings to the alert.
   The height is a floor, and a floor outranks the cap dialog.card sets,
   so it is capped here as well: at twice the default text size 20rem is
   640px, and a phone held sideways is 390px tall — the dialog stood
   125px above the top of the screen, title and all, with no way to
   scroll up to it.
   Centred content in a box that scrolls is the same trap on the other
   axis: once the faces are taller than the box, `center` puts the first
   line above the scrollable area, where scrolling cannot reach it.
   `safe center` centres while it fits and falls back to the start when
   it does not; an engine without it takes the line before, as it did. */
.touch[open] {
  display: grid;
  align-content: center;
  align-content: safe center;
  min-block-size: min(20rem, calc(100dvh - 2 * var(--space-m)));
}
.touch-backdrop { position: fixed; inset: 0; z-index: 29; background: var(--c-scrim); }
/* The session dialog's backdrop also blurs the page: a session ends so an
   unattended screen stops showing what it showed, so the page behind the
   dialog must not stay readable. */
.session-backdrop { position: fixed; inset: 0; z-index: 29; background: var(--c-scrim); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
/* Its heading is centred, so are its actions. */
.session .cluster { justify-content: center; }
/* The warning before the session ends: across the top under the
   environment strip, above the page (not a dialog: it takes no focus and
   blocks nothing), below the dialogs and their backdrops. */
.session-warning {
  position: fixed; inset-block-start: calc(var(--envbar-offset, 0px) + var(--space-s)); inset-inline: 0; margin-inline: auto;
  inline-size: min(36rem, calc(100vw - 2 * var(--space-m))); z-index: 25;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-s) var(--space-m);
  padding: var(--space-s) var(--space-m); box-shadow: var(--shadow-2);
}
.session-warning[hidden] { display: none; }
.session-warning__icon { flex: none; display: inline-flex; color: var(--c-accent); }
.session-warning__text { flex: 1 1 14rem; min-inline-size: 0; }
.session-warning__text > * { margin: 0; }
.session-warning [data-session-countdown] { font-variant-numeric: tabular-nums; }

/* ---------- selects ---------- */
.field select:disabled, .inline-form select:disabled, .setting select:disabled { opacity: 0.55; cursor: not-allowed; }
/* One chevron for every select, inset from the edge like a button's text;
   the native control's own is dropped. Placed after the field rules so the
   background-image survives their background shorthand. RTL mirrors the
   inset (background-position has no logical keyword). */
.field select, .inline-form select, .setting select {
  appearance: none; -webkit-appearance: none;
  background-image: var(--select-chevron); background-repeat: no-repeat; background-size: 1rem 1rem;
  background-position: right var(--space-s) center; padding-inline-end: calc(var(--space-s) * 2 + 1rem);
}
[dir="rtl"] .field select, [dir="rtl"] .inline-form select, [dir="rtl"] .setting select { background-position: left var(--space-s) center; }

/* ---------- identifiers ---------- */
/* A shortened identifier with the whole of it in a tooltip (on hover,
   focus or tap of the text, a button so a tap reaches it on iOS) and a
   button that copies it. The tooltip is one floating box for the page
   (#tipbox, console.js), positioned by script above the text: a box
   inside a scrolling table would be clipped. Without a clipboard the
   whole identifier takes the text's place, selectable in one click. */
.idchip { display: inline-flex; align-items: center; gap: var(--space-2xs); vertical-align: middle; }
.idchip__text { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: default; }
/* The button's reset above outranks the utilities it wears (later rule). */
.idchip__text.mono { font-family: var(--font-mono); }
.idchip__text.muted { color: var(--c-text-muted); }
.idchip__text--full { user-select: all; -webkit-user-select: all; }
/* The drawn button stays 1.5rem so a row of identifiers keeps its rhythm;
   the area a finger may hit is 2.5rem, laid over it without taking any
   room (the rows around it are further apart than the overhang). */
.idchip__copy {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; inline-size: 1.5rem; block-size: 1.5rem; padding: 0;
  border: 0; border-radius: var(--radius-s); background: transparent; color: var(--c-text-muted); cursor: pointer;
}
/* The reach is the gap's own width towards the chip's text, so the area
   stops where the neighbour begins — in an audit row that neighbour is a
   button of its own, and a finger landing on it must not copy instead. */
.idchip__copy::after {
  content: ""; position: absolute;
  inset-block: calc(-1 * var(--space-xs));
  inset-inline-end: calc(-1 * var(--space-xs));
  inset-inline-start: calc(-1 * var(--space-2xs));
}
.idchip__copy:hover, .idchip__copy:focus-visible { background: var(--c-surface-2); color: var(--c-text); }
.tipbox {
  position: fixed; z-index: 40; max-inline-size: min(28rem, calc(100vw - 2 * var(--space-m)));
  padding: var(--space-2xs) var(--space-xs); border-radius: var(--radius-s);
  background: var(--c-tip-bg); color: var(--c-tip-text); font-family: var(--font-mono); font-size: var(--step--1); line-height: 1.4;
  overflow-wrap: anywhere; box-shadow: var(--shadow-2); pointer-events: auto;
}

.tipbox--prose { white-space: pre-line; font-family: inherit; background: var(--c-tip-prose-bg); color: var(--c-tip-prose-text); max-inline-size: min(16rem, calc(100vw - 2 * var(--space-m))); overflow-wrap: normal; }

/* Compact row actions share a touch-sized target; primary actions and
   confirmation buttons retain their visible labels. */
.iconbtn--danger { color: var(--c-danger); }
.iconbtn--danger:hover, .iconbtn--danger:focus-visible { background: var(--c-danger-bg); }
.iconbtn:disabled { color: var(--c-text-muted); opacity: .55; cursor: not-allowed; }
.te-identity { display: grid; gap: var(--space-2xs); min-inline-size: 0; }
.te-identity__name { gap: var(--space-xs); }
.te-credential { display: inline-flex; align-items: center; gap: var(--space-2xs); min-inline-size: 0; justify-self: start; }
.te-credential .idchip__text { overflow-wrap: anywhere; min-inline-size: 0; }
.te-credential .idchip__copy, .te-credential .iconbtn { inline-size: 1.75rem; block-size: 1.75rem; flex: none; }
.te-credential .icon { inline-size: 1rem; block-size: 1rem; }
.te-edit .te-credential .iconbtn { inline-size: 1.5rem; block-size: 1.5rem; }
.te-edit .te-credential .icon { inline-size: .875rem; block-size: .875rem; }
.te-actions .iconbtn { inline-size: 2.75rem; block-size: 2.75rem; flex: none; }
.te-credential .idchip__copy::after { content: none; }
.te-code > [data-secret-mask], .te-code > [data-secret-value] { min-inline-size: 6ch; user-select: all; }
[data-secret-toggle] .icon--eye-off { display: none; }
[data-secret-toggle][aria-pressed="true"] .icon--eye { display: none; }
[data-secret-toggle][aria-pressed="true"] .icon--eye-off { display: block; }
.te-actions { display: inline-flex; align-items: center; gap: var(--space-2xs); }
.te-action-held { display: inline-flex; border-radius: var(--radius-s); }
.te-action-held > button { pointer-events: none; }
.te-accounts { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-xs); }
.te-account { display: inline-flex; align-items: center; gap: var(--space-xs); min-block-size: 2.75rem; min-inline-size: 2.75rem; padding: var(--space-2xs); border-radius: var(--radius-s); text-decoration: none; color: var(--c-text); }
.te-account:hover, .te-account:focus-visible { background: var(--c-surface-2); text-decoration: none; }
.te-account__icons { position: relative; display: inline-flex; align-items: center; justify-content: center; inline-size: 2rem; block-size: 2rem; flex: none; }
.te-account__state { position: absolute; inset-inline-end: -.25rem; inset-block-end: -.125rem; display: grid; place-items: center; inline-size: 1rem; block-size: 1rem; background: var(--c-surface); border-radius: 50%; color: var(--c-danger); }
.te-account__state .icon { inline-size: .875rem; block-size: .875rem; stroke-width: 2.5; }
.te-account--active .te-account__state { color: var(--c-success); }
.te-account--suspended .te-account__state { color: var(--c-warning); }
.te-account__detail { display: none; }
.te-account__detail > * { display: block; }
.te-edit__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-s); position: sticky; inset-block-start: 0; background: var(--c-surface); z-index: 1; }
.te-edit__head .iconbtn { flex: none; inline-size: 2.75rem; block-size: 2.75rem; }
@container main (max-width: 44rem) {
 .test-emails td:first-child { display: block; }
 .test-emails td:first-child::before { display: none; }
 .test-emails .te-identity { display: grid; }
 .te-credential .idchip__copy, .te-credential .iconbtn { inline-size: 2.75rem; block-size: 2.75rem; }
 .te-account__detail { display: block; }
 .te-edit .te-credential .iconbtn { inline-size: 2.75rem; block-size: 2.75rem; }
}
@media (hover: none), (pointer: coarse) {
 .te-account__detail { display: block; }
 .te-edit .te-credential .iconbtn { inline-size: 2.75rem; block-size: 2.75rem; }
 .te-credential .idchip__copy, .te-credential .iconbtn { inline-size: 2.75rem; block-size: 2.75rem; }
}

/* ---------- colours the reader forces ---------- */
/* More contrast, asked for at the system level. Only the boundaries move:
   every text pair in this file already clears 4.5:1 in both themes
   (measured), so text is left alone and what a reader gains is the edges
   — the rule under a table row, the line round a card, the edge of a
   field or a button, and the strip's own edge. The card's edge stops
   being the text colour at 8% and becomes the same drawn line as the
   rest; it is written once here because --c-border is already pointed at
   the right value for whichever theme is showing.
   The three selectors mirror the theme blocks above exactly: the page's
   own, the system's dark without an explicit light choice, and an
   explicit dark choice. */
@media (prefers-contrast: more) {
  :root {
    --c-border: var(--more-line);
    --c-border-strong: var(--more-line-strong);
    --c-env-border: var(--more-env-border);
    --c-card-edge: var(--c-border);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --c-border: var(--more-dark-line);
      --c-border-strong: var(--more-dark-line-strong);
      --c-env-border: var(--more-dark-env-border);
    }
  }
  :root[data-theme="dark"] {
    --c-border: var(--more-dark-line);
    --c-border-strong: var(--more-dark-line-strong);
    --c-env-border: var(--more-dark-env-border);
  }
}

/* NOTHING BELOW THIS LINE. The block corrects rules that weigh the same
   as it does, so it wins by being last and by nothing else; a rule added
   after it that touches the same selectors would take the correction
   away, in a mode almost nobody runs while working. Add elsewhere. */
/* Last in the file on purpose: these are corrections to the rules above,
   and they weigh no more than the rules they correct — placed earlier
   they would simply lose.
   Colours the reader forces on the page. The system's palette replaces
   every background, border and text colour here, so a difference this
   file drew with a tint is a difference that stops being drawn. Measured
   in that mode (2026-09-23): cards, dialogs, menus and the drawer keep
   their 1px edge — forced to CanvasText — so what sits over the page
   still reads as raised; the status pills lose their tint but keep the
   word that IS the status, which is why that rule exists; and the scrim
   keeps its 45% and washes the page towards Canvas, so a drawer or a
   dialog still dims what is behind it. Two things did stop being drawn,
   and only those two are answered here. Nothing takes
   forced-color-adjust: none — a page that keeps its own colours in this
   mode is the failure, not the fix. */
@media (forced-colors: active) {
  /* Which section is open. Everything we draw it with is dropped here:
     the tint goes to Canvas, the accent to LinkText like every other
     row, and the inset shadow that marks the row is not painted at all
     in this mode. Highlight on HighlightText is what the platform marks
     a chosen row with, and a system colour named inside this query is
     honoured rather than replaced, so the pill comes back in the
     reader's own palette. The weight is set here too, so the row is not
     resting on that one colour pair alone — the comment used to claim a
     600 against the rows' 500 and no rule had ever set it. The icon
     follows the row's colour already. */
  .sidenav a[aria-current="page"],
  .sidenav a[aria-current="page"]:hover {
    background: Highlight; color: HighlightText; font-weight: 600;
  }

  /* The chevron on a select is ours: appearance:none drops the
     platform's control and a background image draws the mark, with the
     stroke colour baked into the image. An image is not re-coloured in
     this mode, and the theme the image is chosen by is the page's, not
     the reader's palette — so a page in its light theme under a black
     forced background keeps a #4A5B78 stroke on black, 2.96:1, beside a
     border and a label that are pure white. Here the control goes back
     to the browser, which draws its own mark in the reader's colours;
     the room our chevron needed goes back with it. */
  .field select, .inline-form select, .setting select {
    appearance: auto; -webkit-appearance: auto;
    background-image: none;
    padding-inline-end: var(--space-s);
  }
  /* Forced colours paint over the track, so the knob is drawn with a
     border the high-contrast palette keeps. */
  .switch__track { background: ButtonFace; border: 1px solid ButtonText; }
  .switch__track::before { background: ButtonText; }
  .switch[aria-checked="true"] .switch__track { background: Highlight; }
}
