/* ReSync design tokens.
 *
 * Every surface imports this file: the approval web app, the operator console,
 * the sign-in pages, generated HTML documentation and email templates. Nothing
 * hard-codes a hex. If a value is wrong it is wrong here, and it is fixed here —
 * not overridden in a stylesheet.
 *
 * Palette and type follow ReliStack's tokens (Q41, Daniel, Thu 22 October 2026):
 * "Reliable Blue" is #2563EB in every Reliable I.T. product. Ported from
 * ReliStack apps/web/src/styles/tokens.css at origin/staging d5dd354e; the
 * semantic names below (--rs-bg, --rs-panel, --rs-line, --rs-accent …) are
 * ReliStack's with the --rs- prefix, so resync-ui.css reads like its source.
 * The older ReSync names are kept and re-pointed, so existing stylesheets
 * render in the new palette without an edit.
 */

:root {
  /* -- Brand primitives (ReliStack's brand pack) --------------------------- */
  --rs-reliable-blue: #2563eb;
  --rs-azure: #0ea5e9; /* 2.8:1 on white: Midnight surfaces only, never text on light */
  --rs-midnight: #0a1a2f;
  --rs-canvas: #f8fafc;
  --rs-white: #ffffff;

  /* Neutrals: ReliStack's slate scale, anchored on Midnight */
  --rs-ink-950: #06111f;
  --rs-ink-900: #0a1a2f;
  --rs-ink-800: #1e293b;
  --rs-ink-700: #334155;
  --rs-ink-600: #475569;
  --rs-ink-500: #64748b;
  --rs-ink-400: #94a3b8;
  --rs-ink-300: #cbd5e1;
  --rs-ink-200: #dbe2ea;
  --rs-ink-150: #e2e8f0;
  --rs-ink-100: #edf1f6;
  --rs-ink-50: #f4f7fa;

  /* -- ReSync's earlier names, re-pointed onto the palette above ----------- */
  --rs-mid-blue: #7ea6f8; /* ReliStack's accent on Midnight; the wordmark's "Sync" */
  --rs-pale-blue: #a9c4ff;
  --rs-deep-field: var(--rs-midnight);
  --rs-deep-field-tint: #112540; /* rows and inset panels on Midnight */
  --rs-slate: var(--rs-ink-600);
  --rs-cool-ground: var(--rs-canvas);

  /* Amber means "needs attention" and nothing else. Used decoratively it stops
   * meaning anything. It is ReliStack's warning pair. */
  --rs-amber: #b45309; /* text and rules on light */
  --rs-amber-on-dark: #f59e0b; /* dots, and anything on Midnight */

  /* -- Semantic roles (ReliStack's, light theme) --------------------------- */
  --rs-bg: var(--rs-canvas);
  --rs-bg-subtle: #f1f5f9;
  --rs-panel: var(--rs-white);
  --rs-panel-sunken: #f5f7fa;
  --rs-hover: #f1f5f9;
  --rs-selected: #eaf1fe;
  --rs-line: var(--rs-ink-150);
  --rs-line-strong: var(--rs-ink-300);
  --rs-text: var(--rs-midnight);
  --rs-text-2: var(--rs-ink-600);
  --rs-text-3: #5b6b82;
  --rs-text-disabled: var(--rs-ink-400);
  --rs-text-inverse: var(--rs-canvas);

  --rs-accent: var(--rs-reliable-blue); /* 5.2:1 on white: fills buttons, marks focus */
  --rs-accent-hover: #1d4ed8;
  --rs-accent-press: #1e40af;
  --rs-accent-text: #1d4ed8; /* links: stays above 4.5:1 on tinted surfaces */
  --rs-accent-soft: #eaf1fe;
  --rs-accent-soft-text: #1e40af;
  --rs-focus: var(--rs-reliable-blue);
  --rs-focus-ring: rgba(37, 99, 235, 0.2);
  --rs-selection: rgba(37, 99, 235, 0.22);

  /* Outcome colours. Red is a refusal or a failure, green a write that landed;
   * neither is a client status. Warning is amber, so it keeps amber's meaning. */
  --rs-success: #15803d;
  --rs-success-dot: #22c55e;
  --rs-success-soft: #e9f8ee;
  --rs-warning: var(--rs-amber);
  --rs-warning-dot: var(--rs-amber-on-dark);
  --rs-warning-soft: #fef5e2;
  --rs-danger: #b91c1c;
  --rs-danger-fill: #c81e1e;
  --rs-danger-fill-hover: #b01a1a;
  --rs-danger-dot: #ef4444;
  --rs-danger-soft: #fdecec;
  --rs-info: #1d4ed8;
  --rs-info-dot: var(--rs-reliable-blue);
  --rs-info-soft: #eaf1fe;

  /* Production is marked with a caution colour so it is never mistaken for a sandbox. */
  --rs-prod: var(--rs-amber);
  --rs-prod-soft: #fef2dc;
  --rs-prod-line: var(--rs-amber-on-dark);

  /* Navigation and hero bands are always Midnight. */
  --rs-nav-bg: var(--rs-midnight);
  --rs-nav-hover: #13294a;
  --rs-nav-active: #18335c;
  --rs-nav-text: var(--rs-ink-300);
  --rs-nav-text-strong: var(--rs-canvas);
  --rs-nav-muted: #8193ad;
  --rs-nav-indicator: var(--rs-azure);
  --rs-nav-line: #162b4a;

  /* Code blocks are always dark. */
  --rs-term-bg: #08162a;
  --rs-term-text: var(--rs-ink-150);

  /* -- Surfaces, in the names the existing stylesheets use ----------------- */
  --rs-surface-page: var(--rs-bg);
  --rs-surface-card: var(--rs-panel);
  --rs-surface-reversed: var(--rs-midnight);
  --rs-surface-reversed-inset: var(--rs-deep-field-tint);

  --rs-text-primary: var(--rs-text);
  --rs-text-secondary: var(--rs-text-2);
  --rs-text-on-reversed: var(--rs-white);
  --rs-text-accent: var(--rs-accent-text);

  --rs-rule: var(--rs-line);

  /* -- Status — three client-facing states, no more -----------------------
   * resync_sync.status holds the same dots; its tests read resync-tokens.json.
   * Never surface a raw error code as the headline; it belongs in the detail
   * line underneath. */
  --rs-status-in-sync: var(--rs-reliable-blue); /* ReliStack: blue is calm */
  --rs-status-needs-a-look: var(--rs-amber-on-dark);
  --rs-status-paused: var(--rs-ink-400);

  /* -- Typography ----------------------------------------------------------
   * Inter is the primary face; Plus Jakarta Sans is for navigation, controls
   * and the few display statements; JetBrains Mono for figures and codes. All
   * three are OFL and shipped since Fri 23 October 2026 (Q41), self-hosted and
   * declared in resync-ui.css. The Variable name first, the static name next
   * for anyone who has it installed, then the system face: a page is readable
   * at every step, including the moment before the file arrives. */
  --rs-font-display: "Plus Jakarta Sans Variable", "Plus Jakarta Sans", "Inter Variable",
    "Inter", system-ui, sans-serif;
  --rs-font-heading: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rs-font-body: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rs-font-ui: "Plus Jakarta Sans Variable", "Plus Jakarta Sans", "Inter Variable", "Inter",
    system-ui, sans-serif;
  --rs-font-mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "Cascadia Code",
    Consolas, monospace;

  /* The type scale. A size that is not one of these is a new token, not a
   * literal in a stylesheet (the UI review of Thu 22 October 2026 found seven
   * ad-hoc sizes). */
  --rs-text-xs: 0.75rem; /* 12px: hints, pills, table labels on a phone */
  --rs-text-sm: 0.8125rem; /* 13px: tables, buttons, callouts */
  --rs-text-md: 0.875rem; /* 14px: body */
  --rs-text-lg: 1rem; /* 16px: h2, empty-state titles */
  --rs-text-xl: 1.25rem; /* 20px: h1 */
  --rs-text-2xl: 1.5rem; /* 24px: metric values, display */
  --rs-text-eyebrow: 0.6875rem; /* 11px: uppercase mono labels */
  --rs-text-code: 0.92em; /* mono beside proportional text reads larger */
  --rs-text-code-inline: 0.86em;

  --rs-weight-heading: 700;
  --rs-weight-strong: 650;
  --rs-weight-ui: 600;
  --rs-weight-body: 400;
  --rs-weight-data: 500;

  --rs-tracking-heading: -0.018em;
  --rs-tracking-wordmark: -0.035em;
  --rs-tracking-eyebrow: 0.2em;

  --rs-body-size: 1rem; /* the existing stylesheets' body; resync-ui.css uses --rs-text-md */
  --rs-body-line-height: 1.5;
  --rs-eyebrow-size: var(--rs-text-eyebrow);

  /* -- Space (4px grid) ---------------------------------------------------- */
  --rs-s-1: 4px;
  --rs-s-2: 8px;
  --rs-s-3: 12px;
  --rs-s-4: 16px;
  --rs-s-5: 20px;
  --rs-s-6: 24px;
  --rs-s-8: 32px;
  --rs-s-10: 40px;

  /* -- Shape: radius follows hierarchy (8, 12, 16) ------------------------- */
  --rs-r-xs: 4px;
  --rs-r-sm: 6px;
  --rs-r-md: 8px;
  --rs-r-lg: 12px;
  --rs-r-xl: 16px;
  --rs-r-pill: 999px;

  --rs-radius-control: var(--rs-r-sm); /* buttons, inputs, tags */
  --rs-radius-block: var(--rs-r-md); /* alerts, gate and finding blocks */
  --rs-radius-card: var(--rs-r-lg); /* cards and dialogs */
  --rs-radius-round: 9999px; /* pill badges, status dots */

  --rs-shadow-1: 0 1px 2px rgba(10, 26, 47, 0.06);
  --rs-shadow-2: 0 2px 6px rgba(10, 26, 47, 0.08), 0 1px 2px rgba(10, 26, 47, 0.05);
  --rs-shadow-pop: 0 12px 32px rgba(10, 26, 47, 0.16), 0 2px 6px rgba(10, 26, 47, 0.08);
  --rs-shadow-card: var(--rs-shadow-1);
  --rs-shadow-toolbar: var(--rs-shadow-1);

  --rs-control-height: 2rem; /* 32px: buttons and inputs */
  --rs-control-height-sm: 1.75rem;
  --rs-control-height-lg: 2.375rem;
  --rs-topbar-height: 52px;
  --rs-content-max-width: 1160px;
  --rs-gutter: 20px;
  --rs-border-width: 1px; /* secondary button outline */

  /* -- Motion (ReliStack's animation system) -------------------------------
   * Surfaces apply transitions only under prefers-reduced-motion:
   * no-preference, so anyone who asked for less movement gets none. */
  --rs-ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --rs-ease-entrance: cubic-bezier(0.22, 1, 0.36, 1);
  --rs-duration-fast: 120ms;
  --rs-duration-press: 130ms;
  --rs-duration-medium: 200ms;
}

/* Reversed panels: the same tokens, re-pointed. Surfaces switch by setting
 * data-rs-surface="reversed" rather than by overriding colours. */
[data-rs-surface="reversed"] {
  --rs-surface-page: var(--rs-midnight);
  --rs-surface-card: var(--rs-deep-field-tint);
  --rs-bg: var(--rs-midnight);
  --rs-panel: var(--rs-deep-field-tint);
  --rs-line: var(--rs-nav-line);
  --rs-text: var(--rs-ink-150);
  --rs-text-2: var(--rs-ink-300);
  --rs-text-primary: var(--rs-white);
  --rs-text-secondary: var(--rs-ink-300);
  --rs-text-accent: var(--rs-mid-blue);
  --rs-accent-text: var(--rs-mid-blue);
  --rs-rule: var(--rs-deep-field-tint);
}

/* ReSync's shared stylesheet: ReliStack's CSS system, ported for server-rendered pages.
 *
 * Provenance. Ported from ReliStack (C:\GitHub\ReliStack, read only) at
 * origin/staging d5dd354e62d7f7a9d7d04bb77e61b8f8d074a5c4 (Thu 22 October 2026):
 * apps/web/src/styles/base.css, components.css and layout.css. Q41, Daniel,
 * Thu 22 October 2026: the two products share one vocabulary, so the class
 * names are ReliStack's (.btn, .btn--primary, .panel, .pill, .kv, .callout,
 * .table, .table--responsive …) and its custom properties are read through the
 * --rs- prefix that resync-tokens.css defines.
 *
 * What the port changed, and why:
 * - No JavaScript and no inline style: the content security policy is
 *   `default-src 'none'; style-src 'self'; img-src 'self'`. ReliStack's
 *   React-only parts (dialog, drawer, menu, toast, tooltip, command palette,
 *   switch and tab indicators driven by data-state) are left out.
 * - No url() at all: the select chevron was a data: URI, which img-src 'self'
 *   refuses, so a select keeps its native arrow.
 * - No color-mix() and no literal colour: every colour and font is a token,
 *   which tests/test_surfaces_use_the_brand_tokens.py enforces.
 * - The shell (sidebar, light top bar) and link tabs came later, from
 *   origin/main b52283a (Fri 13 November 2026), for the console.
 * - The reversed bar's wrap on a phone, its ghost button and
 *   .topbar__nav + .topbar__end are ReSync's own, added in release 1.0.20 for
 *   the client portal.
 * - Light theme only, for now. ReliStack's dark theme is not ported; the
 *   surfaces have never had one.
 * - Sizes come from the type scale (--rs-text-*), never a literal.
 *
 * Edit brand/ui/resync-ui.css, then copy it; tests/test_the_shared_stylesheet.py
 * says which copies are behind.
 */

/* ---------------------------------------------------------------- */
/* Faces                                                             */
/* ---------------------------------------------------------------- */
/* Q41 (Daniel, Fri 23 October 2026). Variable woff2 from
 * @fontsource-variable 5.1.0, latin subset, weight axis only — three files,
 * about 113 KB in all. Self-hosted because the policy above is `'self'`-only:
 * a client's browser never reaches a font CDN (ADR-0019), and the approval app
 * keeps working behind the WAF with no external dependency. Each file is named
 * by the hash of its own bytes, as the stylesheet and the icons are, so a
 * changed face is a changed URL and no browser keeps the old one. The URLs are
 * relative, so they resolve beside this sheet wherever a surface serves it.
 * `font-display: swap` keeps text readable before the face arrives, and
 * resync-tokens.css still names the system fallback after each. Licences
 * travel with the files in fonts/OFL.txt, as the OFL requires. */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-latin-wght-normal.f052ee44c372.woff2") format("woff2-variations");
}

@font-face {
  font-family: "Plus Jakarta Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/plus-jakarta-sans-latin-wght-normal.1262bff0591c.woff2")
    format("woff2-variations");
}

@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("fonts/jetbrains-mono-latin-wght-normal.d8188600846f.woff2") format("woff2-variations");
}

/* ---------------------------------------------------------------- */
/* Base                                                              */
/* ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--rs-bg);
  color: var(--rs-text);
  font-family: var(--rs-font-body);
  font-size: var(--rs-text-md);
  line-height: var(--rs-body-line-height);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
  font-family: var(--rs-font-heading);
  color: var(--rs-text);
  margin: 0;
  letter-spacing: var(--rs-tracking-heading);
  line-height: 1.25;
}

h1 {
  font-size: var(--rs-text-xl);
  font-weight: 750;
}

h2 {
  font-size: var(--rs-text-lg);
  font-weight: var(--rs-weight-heading);
}

h3 {
  font-size: var(--rs-text-md);
  font-weight: var(--rs-weight-heading);
}

p {
  margin: 0;
}

a {
  color: var(--rs-accent-text);
  text-decoration: none;
}

a:hover {
  text-decoration-line: underline;
  text-underline-offset: 2px;
}

code,
kbd,
pre,
.mono {
  font-family: var(--rs-font-mono);
  font-size: var(--rs-text-code);
  font-variant-ligatures: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

:focus-visible {
  outline: 2px solid var(--rs-focus);
  outline-offset: 2px;
  border-radius: var(--rs-r-xs);
}

::selection {
  background: var(--rs-selection);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  background: var(--rs-panel);
  color: var(--rs-text);
  padding: var(--rs-s-2) var(--rs-s-3);
  border-radius: var(--rs-r-sm);
  box-shadow: var(--rs-shadow-pop);
}

.skip-link:focus {
  top: 12px;
}

.muted {
  color: var(--rs-text-2);
}

.subtle {
  color: var(--rs-text-3);
}

.num {
  font-variant-numeric: tabular-nums;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--rs-s-4);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--rs-s-2);
}

.row-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--rs-s-2);
}

.spacer {
  flex: 1;
}

.grid {
  display: grid;
  gap: var(--rs-s-4);
}

.grid-2 {
  display: grid;
  gap: var(--rs-s-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.grid-3 {
  display: grid;
  gap: var(--rs-s-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

/* Uppercase mono label above a heading or a figure: ReSync's, kept. */
.eyebrow {
  font-family: var(--rs-font-mono);
  font-size: var(--rs-text-eyebrow);
  font-weight: var(--rs-weight-data);
  letter-spacing: var(--rs-tracking-eyebrow);
  text-transform: uppercase;
  color: var(--rs-text-2);
}

/* The lockup (brand pack §3): the mark beside "Re" and "Sync". ReSync's, kept.
 * On a reversed ground the tokens re-point, so "Re" is white and "Sync" the
 * reversed accent. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  display: block;
  width: 28px;
  height: 28px;
  flex: none;
}

.brand__mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand__word {
  font-family: var(--rs-font-heading);
  font-size: var(--rs-text-lg);
  font-weight: var(--rs-weight-heading);
  letter-spacing: var(--rs-tracking-wordmark);
  line-height: 1;
}

.brand__re {
  color: var(--rs-reliable-blue);
}

.brand__sync {
  color: var(--rs-mid-blue);
}

[data-rs-surface="reversed"] .brand__re {
  color: var(--rs-white);
}

[data-rs-surface="reversed"] .brand__sync {
  color: var(--rs-text-accent);
}

/* One labelled control under another, no wider than a sentence reads. A
 * stretched button would look like the form's own width, so it keeps its size. */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--rs-s-4);
  max-width: 440px;
}

.form > .btn {
  align-self: flex-start;
}

/* ---------------------------------------------------------------- */
/* Page frame: the shell, the top bar, the page header, breadcrumbs  */
/* ---------------------------------------------------------------- */

/* ReliStack's shell: a Midnight sidebar beside the page, and a light top bar
 * over it. Ported at b52283a for the console (Daniel, Fri 13 November 2026).
 * With no script the sidebar cannot collapse and its indicator cannot slide,
 * so the current link carries a fixed Azure edge, and on a phone the sidebar
 * lies across the top as one wrapped row. */
.shell {
  --rs-shell-sidebar: 232px;
  display: grid;
  grid-template-columns: var(--rs-shell-sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.shell__page {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--rs-nav-bg);
  color: var(--rs-nav-text);
  border-right: 1px solid var(--rs-nav-line);
  overflow: hidden;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--rs-s-2);
  flex: none;
  min-height: var(--rs-topbar-height);
  padding: 0 14px;
  border-bottom: 1px solid var(--rs-nav-line);
}

.sidebar__brand:hover {
  text-decoration: none;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px var(--rs-s-2);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar__group {
  font-family: var(--rs-font-ui);
  margin: 14px 10px var(--rs-s-1);
  font-size: var(--rs-text-eyebrow);
  font-weight: var(--rs-weight-ui);
  color: var(--rs-nav-muted);
  white-space: nowrap;
}

.sidebar__group:first-child {
  margin-top: var(--rs-s-1);
}

.sidebar__foot {
  flex: none;
  padding: var(--rs-s-3) 14px;
  border-top: 1px solid var(--rs-nav-line);
  font-size: var(--rs-text-xs);
  color: var(--rs-nav-muted);
}

.nav-link {
  font-family: var(--rs-font-ui);
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border-left: 3px solid transparent;
  border-radius: var(--rs-r-sm);
  color: var(--rs-nav-text);
  font-size: var(--rs-text-sm);
  font-weight: var(--rs-weight-ui);
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--rs-nav-hover);
  color: var(--rs-nav-text-strong);
  text-decoration: none;
}

.nav-link[aria-current="page"] {
  background: var(--rs-nav-active);
  color: var(--rs-nav-text-strong);
  border-left-color: var(--rs-nav-indicator);
}

/* The bar over the page: where you are, which estate, and the way out. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--rs-s-2) var(--rs-s-3);
  min-height: var(--rs-topbar-height);
  padding: var(--rs-s-2) var(--rs-gutter);
  background: var(--rs-bg);
  border-bottom: 1px solid var(--rs-line);
}

/* Production is marked with a caution colour so it is never mistaken for
 * anything else (ReliStack's rule). */
.topbar--production {
  border-bottom: 2px solid var(--rs-prod-line);
}

.topbar .crumbs {
  flex: 1 1 auto;
  margin-bottom: 0;
}

.topbar__end {
  display: flex;
  align-items: center;
  gap: var(--rs-s-2);
  margin-left: auto;
}

/* A surface with a handful of destinations and no sidebar runs the Midnight
 * band across the top instead (the port of Thu 22 October 2026). */
.topbar--reversed {
  position: static;
  display: block;
  padding: 0;
  background: var(--rs-nav-bg);
  color: var(--rs-nav-text);
  border-bottom-color: var(--rs-nav-line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: var(--rs-s-3);
  max-width: var(--rs-content-max-width);
  min-height: var(--rs-topbar-height);
  margin: 0 auto;
  padding: 0 var(--rs-gutter);
}

.topbar__product {
  font-family: var(--rs-font-ui);
  font-size: var(--rs-text-sm);
  font-weight: var(--rs-weight-ui);
  color: var(--rs-nav-muted);
}

.topbar__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rs-s-1);
  margin-left: auto;
}

.topbar__nav .nav-link {
  display: inline-flex;
  height: var(--rs-control-height);
  padding: 0 var(--rs-s-3);
  border-left: none;
}

.topbar__nav .nav-link[aria-current="page"] {
  border-bottom: 2px solid var(--rs-nav-indicator);
}

/* With the destinations in the bar, the way out sits against them. */
.topbar__nav + .topbar__end {
  margin-left: 0;
}

/* A quiet button on the Midnight band reads in the band's own text colours. */
[data-rs-surface="reversed"] .btn--ghost {
  --rs-btn-fg: var(--rs-nav-text);
}

[data-rs-surface="reversed"] .btn--ghost:hover:not(:disabled) {
  background: var(--rs-nav-hover);
  color: var(--rs-nav-text-strong);
}

.main {
  width: 100%;
  max-width: var(--rs-content-max-width);
  margin: 0 auto;
  padding: var(--rs-s-5) var(--rs-gutter) 48px;
  min-width: 0;
}

/* In the shell the page fills what the footer leaves. */
.shell__page > .main {
  flex: 1 0 auto;
}

/* Sections of a page that follow one another keep one gap, without a wrapper. */
.main > :is(.panel, .callout, .grid-2, .grid-3, .stack) + :is(.panel, .callout, .grid-2, .grid-3, .stack) {
  margin-top: var(--rs-s-4);
}

/* The endorsement (brand pack §3), once, at the foot of the page. ReSync's, kept. */
.footer {
  border-top: 1px solid var(--rs-line);
}

.footer__inner {
  display: flex;
  align-items: center;
  gap: var(--rs-s-3);
  max-width: var(--rs-content-max-width);
  margin: 0 auto;
  padding: var(--rs-s-3) var(--rs-gutter);
  font-size: var(--rs-text-xs);
  color: var(--rs-text-2);
}

.footer__inner .brand__word {
  font-size: var(--rs-text-md);
}

.footer__rule {
  width: 1px;
  height: 18px;
  background: var(--rs-line-strong);
}

.footer__inner strong {
  color: var(--rs-text);
  font-weight: var(--rs-weight-strong);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--rs-s-3) var(--rs-s-4);
  margin-bottom: var(--rs-s-5);
}

.page-header__text {
  min-width: 0;
  flex: 1 1 320px;
}

.page-header__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--rs-s-2) 10px;
}

.page-header__desc {
  margin-top: var(--rs-s-1);
  color: var(--rs-text-2);
  font-size: var(--rs-text-sm);
  max-width: 72ch;
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rs-s-2);
  align-items: center;
}

.crumbs {
  font-family: var(--rs-font-ui);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-width: 0;
  margin-bottom: var(--rs-s-3);
  font-size: var(--rs-text-sm);
}

.crumbs a {
  color: var(--rs-text-2);
  padding: var(--rs-s-1) 6px;
  border-radius: var(--rs-r-xs);
}

.crumbs a:hover {
  background: var(--rs-hover);
  color: var(--rs-text);
  text-decoration: none;
}

.crumbs__sep {
  color: var(--rs-ink-300);
  flex: none;
}

.crumbs__current {
  color: var(--rs-text);
  font-weight: var(--rs-weight-strong);
  padding: var(--rs-s-1) 6px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: var(--rs-s-2);
  margin: var(--rs-s-6) 0 var(--rs-s-3);
}

.section-title h2 {
  font-size: var(--rs-text-md);
}

/* ---------------------------------------------------------------- */
/* Buttons                                                           */
/* ---------------------------------------------------------------- */

/* --rs-btn-* are this component's own, set from tokens by each variant. */
.btn {
  --rs-btn-bg: var(--rs-panel);
  --rs-btn-fg: var(--rs-text);
  --rs-btn-border: var(--rs-line-strong);
  font-family: var(--rs-font-ui);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--rs-control-height);
  padding: 0 var(--rs-s-3);
  border: 1px solid var(--rs-btn-border);
  border-radius: var(--rs-r-sm);
  background: var(--rs-btn-bg);
  color: var(--rs-btn-fg);
  font-size: var(--rs-text-sm);
  font-weight: var(--rs-weight-ui);
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

a.btn:hover {
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  background: var(--rs-hover);
}

.btn:disabled {
  opacity: 0.55;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.btn--primary {
  --rs-btn-bg: var(--rs-accent);
  --rs-btn-fg: var(--rs-white);
  --rs-btn-border: var(--rs-accent);
}

.btn--primary:hover:not(:disabled) {
  background: var(--rs-accent-hover);
  border-color: var(--rs-accent-hover);
}

.btn--primary:active:not(:disabled) {
  background: var(--rs-accent-press);
}

.btn--danger {
  --rs-btn-bg: var(--rs-danger-fill);
  --rs-btn-fg: var(--rs-white);
  --rs-btn-border: var(--rs-danger-fill);
}

.btn--danger:hover:not(:disabled) {
  background: var(--rs-danger-fill-hover);
  border-color: var(--rs-danger-fill-hover);
}

.btn--ghost {
  --rs-btn-bg: transparent;
  --rs-btn-border: transparent;
  --rs-btn-fg: var(--rs-text-2);
}

.btn--ghost:hover:not(:disabled) {
  color: var(--rs-text);
}

.btn--sm {
  height: var(--rs-control-height-sm);
  padding: 0 10px;
  font-size: var(--rs-text-xs);
}

.btn--lg {
  height: var(--rs-control-height-lg);
  padding: 0 var(--rs-s-4);
  font-size: var(--rs-text-md);
}

.btn--block {
  width: 100%;
}

/* ---------------------------------------------------------------- */
/* Form controls                                                     */
/* ---------------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field__label {
  font-size: var(--rs-text-sm);
  font-weight: var(--rs-weight-ui);
  color: var(--rs-text);
}

.field__label .optional {
  font-weight: var(--rs-weight-body);
  color: var(--rs-text-3);
  margin-left: var(--rs-s-1);
}

.field__hint {
  font-size: var(--rs-text-xs);
  color: var(--rs-text-3);
}

.field__error {
  font-size: var(--rs-text-xs);
  color: var(--rs-danger);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--rs-line-strong);
  border-radius: var(--rs-r-sm);
  background: var(--rs-panel);
  color: var(--rs-text);
  font-size: var(--rs-text-md);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--rs-text-disabled);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--rs-ink-400);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--rs-focus);
  box-shadow: 0 0 0 3px var(--rs-focus-ring);
}

.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--rs-danger-dot);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--rs-panel-sunken);
  color: var(--rs-text-3);
}

.input--mono,
.textarea--mono {
  font-family: var(--rs-font-mono);
  font-size: var(--rs-text-sm);
}

.textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}

.checkbox {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--rs-s-2);
  cursor: pointer;
  font-size: var(--rs-text-md);
}

.checkbox input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--rs-accent);
  flex: none;
}

/* ---------------------------------------------------------------- */
/* Surfaces                                                          */
/* ---------------------------------------------------------------- */

.panel {
  background: var(--rs-panel);
  border: 1px solid var(--rs-line);
  border-radius: var(--rs-r-lg);
  box-shadow: var(--rs-shadow-1);
  min-width: 0;
}

.panel__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--rs-s-3);
  padding: var(--rs-s-3) var(--rs-s-4);
  border-bottom: 1px solid var(--rs-line);
  min-height: 48px;
}

.panel__header h2,
.panel__header h3 {
  font-size: var(--rs-text-md);
}

.panel__body {
  padding: var(--rs-s-4);
}

.panel__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--rs-s-2);
  padding: var(--rs-s-3) var(--rs-s-4);
  border-top: 1px solid var(--rs-line);
  background: var(--rs-panel-sunken);
  border-radius: 0 0 var(--rs-r-lg) var(--rs-r-lg);
}

.panel--flush .panel__body {
  padding: 0;
}

a.panel--link {
  display: block;
  color: inherit;
}

a.panel--link:hover {
  text-decoration: none;
  border-color: var(--rs-line-strong);
  box-shadow: var(--rs-shadow-2);
}

/* Metric tiles: a single line of meaning per tile. */
.metric {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px var(--rs-s-4);
  color: inherit;
}

.metric__label {
  font-size: var(--rs-text-sm);
  color: var(--rs-text-2);
}

.metric__value {
  font-family: var(--rs-font-heading);
  font-size: var(--rs-text-2xl);
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.metric__value small {
  font-family: var(--rs-font-body);
  font-size: var(--rs-text-sm);
  font-weight: var(--rs-weight-data);
  color: var(--rs-text-2);
  margin-left: 6px;
  letter-spacing: 0;
}

.metric__detail {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rs-s-1) var(--rs-s-3);
  font-size: var(--rs-text-xs);
  color: var(--rs-text-2);
}

/* Callouts. --warning is amber, so it is for what needs attention only. */
.callout {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px var(--rs-s-3);
  border-radius: var(--rs-r-md);
  border: 1px solid var(--rs-line);
  background: var(--rs-panel-sunken);
  font-size: var(--rs-text-sm);
}

.callout__title {
  font-weight: var(--rs-weight-strong);
}

.callout--info {
  background: var(--rs-info-soft);
  border-color: transparent;
}

.callout--success {
  background: var(--rs-success-soft);
  border-color: transparent;
}

.callout--warning {
  background: var(--rs-warning-soft);
  border-color: transparent;
}

.callout--danger {
  background: var(--rs-danger-soft);
  border-color: transparent;
}

.callout--info .callout__title {
  color: var(--rs-info);
}

.callout--success .callout__title {
  color: var(--rs-success);
}

.callout--warning .callout__title {
  color: var(--rs-warning);
}

.callout--danger .callout__title {
  color: var(--rs-danger);
}

/* Key/value lists: two columns on a desktop, one on a phone. */
.kv {
  display: grid;
  /* The key column is capped at 100% so no grid column can be wider than the
     screen (the console's width test). Above 720px the container is always
     wider than 120px, so this is exactly 120px there; below it the phone rule
     collapses the list to one column anyway. */
  grid-template-columns: minmax(min(100%, 120px), max-content) 1fr;
  gap: var(--rs-s-2) var(--rs-s-5);
  margin: 0;
  font-size: var(--rs-text-sm);
}

.kv dt {
  color: var(--rs-text-2);
}

.kv dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- */
/* Status                                                            */
/* ---------------------------------------------------------------- */

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rs-ink-400);
  flex: none;
}

.dot--success {
  background: var(--rs-success-dot);
}

.dot--warning {
  background: var(--rs-warning-dot);
}

.dot--danger {
  background: var(--rs-danger-dot);
}

.dot--info {
  background: var(--rs-info-dot);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 var(--rs-s-2);
  border-radius: var(--rs-r-pill);
  font-size: var(--rs-text-xs);
  font-weight: var(--rs-weight-ui);
  white-space: nowrap;
  background: var(--rs-panel-sunken);
  color: var(--rs-text-2);
  border: 1px solid var(--rs-line);
}

.pill--success {
  background: var(--rs-success-soft);
  color: var(--rs-success);
  border-color: transparent;
}

.pill--warning {
  background: var(--rs-warning-soft);
  color: var(--rs-warning);
  border-color: transparent;
}

.pill--danger {
  background: var(--rs-danger-soft);
  color: var(--rs-danger);
  border-color: transparent;
}

.pill--info {
  background: var(--rs-info-soft);
  color: var(--rs-info);
  border-color: transparent;
}

.pill--neutral {
  background: var(--rs-panel-sunken);
}

/* The three client status words, named by resync_sync.status's values so a
 * template writes pill--{{ status.value }}. The label comes from that module;
 * these give it its dot and nothing else may. */
.pill--in_sync,
.pill--needs_a_look,
.pill--paused_by_you {
  background: var(--rs-panel);
  color: var(--rs-text);
}

.pill--in_sync::before,
.pill--needs_a_look::before,
.pill--paused_by_you::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pill--in_sync::before {
  background: var(--rs-status-in-sync);
}

.pill--needs_a_look {
  border-color: var(--rs-status-needs-a-look);
}

.pill--needs_a_look::before {
  background: var(--rs-status-needs-a-look);
}

.pill--paused_by_you::before {
  background: var(--rs-status-paused);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--rs-r-pill);
  background: var(--rs-accent);
  color: var(--rs-white);
  font-size: var(--rs-text-eyebrow);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.env {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 var(--rs-s-2);
  border-radius: var(--rs-r-xs);
  font-size: var(--rs-text-xs);
  font-weight: var(--rs-weight-strong);
  background: var(--rs-panel-sunken);
  color: var(--rs-text-2);
  border: 1px solid var(--rs-line);
}

.env--production {
  background: var(--rs-prod-soft);
  color: var(--rs-prod);
  border-color: var(--rs-prod-line);
}

.env--sandbox {
  background: var(--rs-info-soft);
  color: var(--rs-info);
  border-color: transparent;
}

/* ---------------------------------------------------------------- */
/* Tables                                                            */
/* ---------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--rs-text-sm);
}

.table th {
  text-align: left;
  font-weight: var(--rs-weight-ui);
  color: var(--rs-text-2);
  background: var(--rs-panel-sunken);
  border-bottom: 1px solid var(--rs-line);
  padding: var(--rs-s-2) var(--rs-s-3);
  white-space: nowrap;
}

.table td {
  padding: 9px var(--rs-s-3);
  border-bottom: 1px solid var(--rs-line);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: var(--rs-hover);
}

.table .num,
.table th.num {
  text-align: right;
}

.table .cell-primary {
  font-weight: var(--rs-weight-ui);
  color: var(--rs-text);
}

.table .cell-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.table--compact td {
  padding: 6px var(--rs-s-3);
}

/* An act on a row that needs a reason first: closed, a link; open, a small
 * form floating under it, so the table keeps its columns. ReliStack opens a
 * dialog here, which needs script; this is <details>, which does not. */
.disclosure {
  position: relative;
  display: inline-block;
  text-align: left;
}

.disclosure > summary {
  cursor: pointer;
  color: var(--rs-accent-text);
  font-weight: var(--rs-weight-ui);
  white-space: nowrap;
}

.disclosure__panel {
  position: absolute;
  right: 0;
  top: calc(100% + var(--rs-s-1));
  z-index: 5;
  width: 320px;
  max-width: calc(100vw - 2 * var(--rs-gutter));
  padding: var(--rs-s-4);
  background: var(--rs-panel);
  border: 1px solid var(--rs-line);
  border-radius: var(--rs-r-md);
  box-shadow: var(--rs-shadow-pop);
  white-space: normal;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--rs-s-2);
  padding: 10px var(--rs-s-3);
  border-bottom: 1px solid var(--rs-line);
}

/* ---------------------------------------------------------------- */
/* Tabs: links, so each is a page with its own address               */
/* ---------------------------------------------------------------- */

/* ReliStack scrolls a long row sideways; with no script to bring the current
 * tab into view, this one wraps. */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2px;
  margin-bottom: var(--rs-s-5);
  border-bottom: 1px solid var(--rs-line);
}

.tab {
  font-family: var(--rs-font-ui);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px var(--rs-s-3);
  color: var(--rs-text-2);
  font-size: var(--rs-text-sm);
  font-weight: var(--rs-weight-ui);
  white-space: nowrap;
  border-radius: var(--rs-r-xs) var(--rs-r-xs) 0 0;
}

.tab:hover {
  color: var(--rs-text);
  text-decoration: none;
}

.tab[aria-current="page"] {
  color: var(--rs-text);
}

.tab[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: var(--rs-s-2);
  right: var(--rs-s-2);
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--rs-accent);
}

/* ---------------------------------------------------------------- */
/* Empty states, code, lists                                         */
/* ---------------------------------------------------------------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: var(--rs-s-8) var(--rs-s-6);
  max-width: 520px;
}

.empty--center {
  align-items: center;
  text-align: center;
  margin: 0 auto;
}

.empty__title {
  font-family: var(--rs-font-heading);
  font-size: var(--rs-text-lg);
  font-weight: var(--rs-weight-heading);
}

.empty__body {
  color: var(--rs-text-2);
  font-size: var(--rs-text-sm);
}

/* Nothing here, said in a line: for a panel among several, where the full
 * empty state repeated down the page reads as the page's content. */
.empty--compact {
  gap: var(--rs-s-1);
  padding: var(--rs-s-4);
}

.empty--compact .empty__title {
  font-family: var(--rs-font-body);
  font-size: var(--rs-text-sm);
  font-weight: var(--rs-weight-body);
  color: var(--rs-text-2);
}

/* Work in flight, as the browser's own bar: no script moves it. */
.progress {
  display: block;
  width: 100%;
  height: 8px;
  accent-color: var(--rs-accent);
}

.code {
  display: block;
  padding: 10px var(--rs-s-3);
  border-radius: var(--rs-r-md);
  background: var(--rs-term-bg);
  color: var(--rs-term-text);
  font-family: var(--rs-font-mono);
  font-size: var(--rs-text-sm);
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

.inline-code {
  padding: 1px 5px;
  border-radius: var(--rs-r-xs);
  background: var(--rs-panel-sunken);
  border: 1px solid var(--rs-line);
  font-family: var(--rs-font-mono);
  font-size: var(--rs-text-code-inline);
}

.divider {
  height: 1px;
  background: var(--rs-line);
  border: none;
  margin: 0;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list > li {
  display: flex;
  align-items: center;
  gap: var(--rs-s-3);
  padding: 10px var(--rs-s-4);
  border-bottom: 1px solid var(--rs-line);
  min-width: 0;
}

.list > li:last-child {
  border-bottom: none;
}

/* ---------------------------------------------------------------- */
/* Phones                                                            */
/* ---------------------------------------------------------------- */

@media (max-width: 720px) {
  .topbar,
  .topbar__inner,
  .main {
    padding-left: var(--rs-s-4);
    padding-right: var(--rs-s-4);
  }

  .topbar--reversed {
    padding-left: 0;
    padding-right: 0;
  }

  /* The bar's parts wrap: the lockup and the way out on one row, the
   * destinations on the next. Nothing is hidden behind a control. */
  .topbar__inner {
    flex-wrap: wrap;
    padding-top: var(--rs-s-2);
    padding-bottom: var(--rs-s-2);
  }

  .topbar__product {
    display: none;
  }

  .topbar__nav {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .topbar__nav + .topbar__end {
    margin-left: auto;
  }

  /* The sidebar lies across the top: the brand, then its links in one
   * wrapped row. Nothing is hidden behind a control that needs script. */
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }

  .shell__page {
    min-height: 0;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--rs-nav-line);
  }

  .sidebar__nav {
    flex-direction: row;
    flex-wrap: wrap;
    overflow: visible;
    padding: var(--rs-s-1) var(--rs-s-2) var(--rs-s-2);
  }

  .sidebar__group,
  .sidebar__foot {
    display: none;
  }

  .topbar {
    position: static;
  }

  .page-header__actions {
    width: 100%;
  }

  .kv {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .kv dd {
    margin-bottom: var(--rs-s-2);
  }

  /* A responsive table becomes one labelled stack per row instead of
   * scrolling sideways. Each cell names its column in data-label, which the
   * template writes beside the value; CSS prints it, so nothing needs script
   * and the figure an approver reads is still the cell's own text. */
  .table--responsive thead {
    display: none;
  }

  .table--responsive,
  .table--responsive tbody,
  .table--responsive tr,
  .table--responsive td {
    display: block;
    width: 100%;
  }

  .table--responsive tr {
    padding: 10px var(--rs-s-3);
    border-bottom: 1px solid var(--rs-line);
  }

  .table--responsive tbody tr:last-child {
    border-bottom: none;
  }

  .table--responsive td {
    border: none;
    padding: 2px 0;
  }

  .table--responsive td[data-label] {
    display: grid;
    justify-items: start;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: var(--rs-s-2);
    align-items: baseline;
  }

  .table--responsive td[data-label]::before {
    content: attr(data-label);
    color: var(--rs-text-3);
    font-size: var(--rs-text-xs);
  }

  .table--responsive td[data-label=""] {
    display: block;
  }

  .table--responsive .num {
    text-align: left;
  }

  .table .cell-actions {
    width: auto;
    text-align: left;
    padding-top: 6px;
  }

  .disclosure {
    display: block;
  }

  .disclosure__panel {
    position: static;
    width: auto;
    max-width: none;
    margin-top: var(--rs-s-2);
    box-shadow: none;
  }
}

/* ---------------------------------------------------------------- */
/* Tablets: a wide table stacks before a phone would make it         */
/* ---------------------------------------------------------------- */

/* Five or more columns beside the sidebar squeeze the last to a letter wide
 * well above a phone's width (the console's roster at 768 pixels, Wed 21
 * October 2026). A table marked --wide as well as --responsive stacks here;
 * the rules are the phone block's, repeated because CSS cannot share them. */
@media (max-width: 960px) {
  .table--wide thead {
    display: none;
  }

  .table--wide,
  .table--wide tbody,
  .table--wide tr,
  .table--wide td {
    display: block;
    width: 100%;
  }

  .table--wide tr {
    padding: 10px var(--rs-s-3);
    border-bottom: 1px solid var(--rs-line);
  }

  .table--wide tbody tr:last-child {
    border-bottom: none;
  }

  .table--wide td {
    border: none;
    padding: 2px 0;
  }

  .table--wide td[data-label] {
    display: grid;
    justify-items: start;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: var(--rs-s-2);
    align-items: baseline;
  }

  .table--wide td[data-label]::before {
    content: attr(data-label);
    color: var(--rs-text-3);
    font-size: var(--rs-text-xs);
  }

  .table--wide td[data-label=""] {
    display: block;
  }

  .table--wide .num {
    text-align: left;
  }

  .table--wide .cell-actions {
    width: auto;
    text-align: left;
    padding-top: 6px;
  }

  .table--wide .disclosure {
    display: block;
  }

  .table--wide .disclosure__panel {
    position: static;
    width: auto;
    max-width: none;
    margin-top: var(--rs-s-2);
    box-shadow: none;
  }
}

/* ---------------------------------------------------------------- */
/* What's new: a centred dialog after sign-in, once per release      */
/* ---------------------------------------------------------------- */

/* No script under the CSP: the page beneath is dimmed and held still
   by CSS, and "Got it" is a form post. */
body:has(.whats-new) {
  overflow: hidden;
}

.whats-new {
  position: fixed;
  inset: 0;
  /* Above the skip link (100), which would otherwise show through. */
  z-index: 200;
  display: grid;
  place-items: center;
  padding: var(--rs-s-4);
}

.whats-new::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--rs-ink-950);
  opacity: 0.45;
}

.whats-new__box {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100dvh - 2 * var(--rs-s-4));
  overflow-y: auto;
  padding: var(--rs-s-6);
  border-top: 4px solid var(--rs-accent);
  border-radius: var(--rs-radius-card);
  background: var(--rs-surface-card);
  box-shadow: var(--rs-shadow-pop);
}

.whats-new__box h2 {
  margin: var(--rs-s-1) 0 var(--rs-s-4);
  font-size: var(--rs-text-xl);
}

.whats-new__box p:not(.eyebrow) {
  margin: 0 0 var(--rs-s-3);
  color: var(--rs-text-secondary);
  line-height: var(--rs-body-line-height);
}

.whats-new__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--rs-s-5);
}

@media (max-width: 720px) {
  .whats-new__box {
    padding: var(--rs-s-5);
  }

  .whats-new__actions .btn {
    width: 100%;
  }
}

/* ---------------------------------------------------------------- */
/* Motion: only for anyone who has not asked for less                */
/* ---------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition:
      background var(--rs-duration-fast) var(--rs-ease-soft),
      border-color var(--rs-duration-fast) var(--rs-ease-soft),
      transform var(--rs-duration-press) var(--rs-ease-soft);
  }

  .btn:active:not(:disabled) {
    transform: scale(0.98);
  }

  .input,
  .select,
  .textarea {
    transition:
      border-color var(--rs-duration-fast) var(--rs-ease-soft),
      box-shadow var(--rs-duration-fast) var(--rs-ease-soft);
  }

  .whats-new__box {
    animation: whats-new-in var(--rs-duration-medium) var(--rs-ease-entrance);
  }

  @keyframes whats-new-in {
    from {
      opacity: 0;
      transform: translateY(8px) scale(0.98);
    }
  }

  .table tbody tr,
  a.panel--link {
    transition:
      background var(--rs-duration-fast) var(--rs-ease-soft),
      box-shadow var(--rs-duration-fast) var(--rs-ease-soft);
  }
}

/* The sign-in pages' own rules: the split splash, and nothing else.
 *
 * Every other class a sign-in page writes is brand/ui/resync-ui.css's
 * (ReliStack's vocabulary, Q41): the lockup is .brand, the card .panel, the
 * button .btn, the recovery form .form with .field and .input. ReliStack has
 * no split sign-in, so the five layout classes here are kept, each with its
 * reason in tests/surface_class_debt.toml; the rest of this file places shared
 * components inside that layout and names no class of its own.
 *
 * Served after resync-tokens.css and resync-ui.css in one response, every
 * colour and font a token (brand/README.md), and never inlined, so the content
 * security policy stays style-src 'self'. The design is
 * docs/design/mockups/signin-splash.html. On the console's origin the card
 * side is reversed too, so an operator can tell the two apart before signing
 * in to the wrong one. Dark grounds re-point the tokens through
 * data-rs-surface="reversed"; nothing here overrides a colour but the
 * console's white button.
 */

/* -- The split ------------------------------------------------------------- */

.splash {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  background: var(--rs-surface-page);
  color: var(--rs-text-primary);
}

/* -- The brand panel: Deep Field on both origins ---------------------------- */

.brandside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 40px 48px;
  background: var(--rs-surface-page);
  color: var(--rs-text-primary);
  border-right: 1px solid var(--rs-rule);
}

/* The large mark bleeding off the corner: faint, and behind everything. */
.bigmark {
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 460px;
  height: 460px;
  opacity: .14;
}
.bigmark svg { display: block; width: 100%; height: 100%; }

.brandside .brand { position: relative; align-self: flex-start; }
/* The splash's lockup is a size up from a bar's. */
.brandside .brand__mark { width: 34px; height: 34px; }
.brandside .brand__word { font-size: 1.375rem; }

.pitch {
  position: relative;
  margin-top: auto;
  display: grid;
  gap: 14px;
  max-width: 22ch;
}

.pitch h1 {
  font-size: clamp(2rem, 4.2vw, 2.875rem);
  line-height: 1.08;
  letter-spacing: var(--rs-tracking-wordmark);
  text-wrap: balance;
}

.pitch p {
  max-width: 34ch;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--rs-text-secondary);
}

/* The endorsement (brand pack §3), once, under the pitch. */
.brandside > .muted {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .75rem;
}
.brandside > .muted::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}
.brandside > .muted strong {
  color: var(--rs-text-primary);
  font-weight: var(--rs-weight-heading);
}

/* -- The card: one thing to read, one thing to do --------------------------- */

.formside {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.formside .panel {
  width: min(400px, 100%);
  display: grid;
  gap: 20px;
  padding: 32px;
}

/* "Restricted", on the console's reversed card only: the cue for which origin
 * this is, so it sets both its colours rather than inherit a light pill's. */
.formside .pill {
  justify-self: start;
  background: var(--rs-surface-reversed);
  color: var(--rs-pale-blue);
  border-color: transparent;
}

.formside h2 {
  margin-top: .25rem;
  font-size: 1.5rem;
  line-height: 1.25;
}

.formside h2 + .muted {
  margin-top: 4px;
  font-size: .875rem;
}

/* The line under the button: what to do if this is not enough. */
.formside .panel > .muted {
  padding-top: 16px;
  border-top: 1px solid var(--rs-rule);
  font-size: .8125rem;
}

.formside .form { max-width: none; }

/* rdash's sign-in size for the one button. */
.formside .btn--lg { height: 42px; }

/* Microsoft's four squares, at the size its sign-in guidance asks. */
.formside .btn svg { width: 18px; height: 18px; }

/* On the console's reversed card the button is white instead of blue. */
[data-rs-surface="reversed"] .formside .btn--primary {
  --rs-btn-bg: var(--rs-white);
  --rs-btn-fg: var(--rs-deep-field);
  --rs-btn-border: var(--rs-white);
}
[data-rs-surface="reversed"] .formside .btn--primary:hover:not(:disabled),
[data-rs-surface="reversed"] .formside .btn--primary:active:not(:disabled) {
  background: var(--rs-pale-blue);
  border-color: var(--rs-pale-blue);
}

/* On a dark ground the focus ring and a focused field take the lighter blue,
 * which the shared sheet's accent would not show against Deep Field. */
[data-rs-surface="reversed"] :focus-visible { outline-color: var(--rs-mid-blue); }
[data-rs-surface="reversed"] .formside .input:focus { border-color: var(--rs-mid-blue); }

/* RDASH's motion, and only for those who have not asked for less (§8). */
@media (prefers-reduced-motion: no-preference) {
  .pitch { animation: rise 460ms var(--rs-ease-entrance) both; }
  .formside .panel { animation: rise 460ms var(--rs-ease-entrance) both 80ms; }
  @keyframes rise {
    from { opacity: .001; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
}

/* -- Narrow screens: the panel stacks above the card ------------------------ */

@media (max-width: 760px) {
  .splash { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .brandside { padding: 28px 24px; gap: 32px; border-right: 0; }
  .bigmark { width: 300px; height: 300px; right: -90px; bottom: -110px; }
  .pitch { margin-top: 0; }
  .formside { padding: 24px 16px 32px; }
  .formside .panel { padding: 24px 20px; }
}
