/* One stylesheet for both directions: logical properties only (margin-inline, padding-block, inset-inline,
 * text-align start). System fonts, no external assets. Every color is a custom property of :root, overridden by the
 * dark block below when the system asks for a dark scheme and by /static/brand.css (generated from the BRAND_*
 * settings). TestContrast in internal/web checks the text pairs at 4.5:1 and the focus ring and input borders at 3:1
 * in both schemes. The brand cyan is decorative only (2.7:1 on white): text and focus use darker tokens. */
:root {
  color-scheme: light dark;
  /* brand */
  --primary: #001871;
  --primary-dark: #00125a;
  --brand-cyan: #00a9e0;
  --brand-light: #b8ccea;
  --neutral-mid: #a7a9b4;
  --neutral-light: #c9cad4;
  --neutral-dark: #757982;
  /* the national four colour stripe on the top edge of the government bar (theme.css), decorative only */
  --flag-black: #000000;
  --flag-white: #ffffff;
  --flag-green: #007a3d;
  --flag-red: #ce1126;
  /* text and surfaces */
  --fg: #161b33;
  --muted: #5f6372;
  --bg: #ffffff;
  --page: #eff4fa;
  --surface: #f6f9fc;
  --hover: #e6edf8;
  --tint-blue: #e3ebf7;
  --tint-cyan: #dbf3fb;
  --tint-slate: #e8ecf2;
  --link: #00649e;
  --on-dark: #ffffff;
  --logo-plate: #ffffff; /* the disc behind an official logo, white in both schemes */
  --on-dark-muted: #c9d6ee;
  --focus: #0077b6;
  --focus-on-dark: #00a9e0;
  --input-border: #868ca1;
  /* status */
  --green: #17663a;
  --green-bg: #e7f5ec;
  --red: #b42318;
  --red-dark: #8f1c13;
  --red-bg: #fdecea;
  --amber: #8a4b00;
  --amber-bg: #fff3dc;
  --grey: #4a4f5e;
  --grey-bg: #eef0f4;
  --blue: #001871;
  --blue-bg: #e6eefa;
  /* public pages: the pastel gradient behind the cards */
  --glow-1: #dbe7f7;
  --glow-2: #e9f1fb;
  --glow-3: #f5f8fd;
  /* lines, shadows, shapes */
  --line: rgba(0, 24, 113, 0.12);
  --line-soft: rgba(0, 24, 113, 0.06);
  --shadow: 0 1px 3px rgba(0, 24, 113, 0.08);
  --shadow-hover: 0 4px 12px rgba(0, 24, 113, 0.12);
  --shadow-lg: 0 24px 48px rgba(0, 24, 113, 0.10);
  --shadow-side: 2px 0 20px rgba(0, 0, 0, 0.04);
  --shadow-pill: 0 2px 8px rgba(0, 24, 113, 0.28);
  --shadow-strip: 0 -6px 20px rgba(0, 24, 113, 0.12);
  /* translucent surfaces: the top bar, the big public cards and the hover of the public links */
  --glass: rgba(255, 255, 255, 0.92);
  --glass-strong: rgba(255, 255, 255, 0.96);
  --glass-edge: rgba(255, 255, 255, 0.8);
  --glass-soft: rgba(255, 255, 255, 0.7);
  --overlay: rgba(0, 18, 90, 0.45);
  --gradient: linear-gradient(90deg, var(--brand-cyan) 0%, var(--primary) 55%, var(--brand-light) 100%);
  --radius: 8px;
  --radius-card: 10px;
  --radius-big: 24px;
  --sidebar: 18rem;
  --font: Calibri, "Segoe UI", system-ui, -apple-system, "Noto Sans", Roboto, "Noto Naskh Arabic UI", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  --font-ar: "Segoe UI", "Noto Naskh Arabic UI", "Noto Sans Arabic", Tahoma, Calibri, system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Dark scheme, following the system setting (no toggle). Surfaces are tinted navy, never pure black. The fills
 * (primary, status colors) turn light and the ink on them (--on-dark) turns dark, so every pair of the light scheme
 * holds here too. Screen only: print always uses the light tokens. */
@media screen and (prefers-color-scheme: dark) {
  :root {
    --primary: #9dbdff;
    --primary-dark: #bcd2ff;
    --brand-light: #26365e;
    --neutral-mid: #59627a;
    --neutral-light: #46516b;
    --neutral-dark: #8a94ab;
    --fg: #e7ebf5;
    --muted: #aab3c8;
    --bg: #151d31;
    --page: #0e1527;
    --surface: #1a233a;
    --hover: #232e4a;
    --tint-blue: #1e2a48;
    --tint-cyan: #14303e;
    --tint-slate: #202839;
    --link: #86c8ff;
    --on-dark: #0b1324;
    --on-dark-muted: #22304f;
    --focus: #5fb6ff;
    --focus-on-dark: #0b1324;
    --input-border: #7e89a5;
    --green: #72d6a0;
    --green-bg: #11301f;
    --red: #ff9a90;
    --red-dark: #ffbab3;
    --red-bg: #3b1815;
    --amber: #f2b65c;
    --amber-bg: #33250b;
    --grey: #c3c9d6;
    --grey-bg: #262e40;
    --blue: #9dbdff;
    --blue-bg: #1b2848;
    --glow-1: #17233f;
    --glow-2: #111a2f;
    --glow-3: #0e1527;
    --line: rgba(157, 189, 255, 0.16);
    --line-soft: rgba(157, 189, 255, 0.08);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.45);
    --shadow-side: 2px 0 20px rgba(0, 0, 0, 0.35);
    --shadow-pill: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-strip: 0 -6px 20px rgba(0, 0, 0, 0.5);
    --glass: rgba(21, 29, 49, 0.92);
    --glass-strong: rgba(21, 29, 49, 0.96);
    --glass-edge: rgba(157, 189, 255, 0.12);
    --glass-soft: rgba(157, 189, 255, 0.12);
    --overlay: rgba(4, 8, 18, 0.6);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* The canvas carries the page color, so a page longer than the viewport never shows the bare canvas below its
 * background (the fixed gradient of the public pages, the system canvas of the dark scheme). */
html { -webkit-text-size-adjust: 100%; font-size: 16px; background: var(--page); }

body {
  margin: 0;
  min-block-size: 100vh;
  color: var(--fg);
  background: var(--page);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.55;
  text-align: start;
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: var(--font-ar); line-height: 1.7; }

h1, h2, h3 { color: var(--primary); font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.75rem, 1.4vw + 1.25rem, 2.125rem); line-height: 1.15; margin-block: 0 0.75rem; }
h2 { font-size: clamp(1.125rem, 0.35vw + 1.05rem, 1.25rem); line-height: 1.25; margin-block: 1.5rem 0.5rem; }
h3 { font-size: 1rem; line-height: 1.3; margin-block: 1rem 0.5rem; }
/* Arabic: letter spacing breaks the joining of the letters, so it is 0 everywhere. Small labels and table headers
 * get a medium weight, the thin strokes of small Arabic text are hard to read at regular weight. */
html[lang="ar"] * { letter-spacing: 0; text-transform: none; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.4; }
html[lang="ar"] label, html[lang="ar"] .hint, html[lang="ar"] .eyebrow, html[lang="ar"] .nav-group, html[lang="ar"] .card-sub,
html[lang="ar"] .facts dt, html[lang="ar"] .summary-strip dt, html[lang="ar"] .stat-note, html[lang="ar"] .user-label,
html[lang="ar"] .user-role, html[lang="ar"] .lang-head, html[lang="ar"] .stepper .when, html[lang="ar"] .kv dt { font-weight: 500; }
html[lang="ar"] thead th, html[lang="ar"] .badge, html[lang="ar"] [data-label]::before { font-weight: 600; }
p { margin-block: 0.5rem; }

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { color: var(--primary); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }
/* app.js moves the focus to a form error summary, which is not keyboard focus, so it gets its own ring. */
.error-summary:focus { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip-link {
  position: absolute;
  inset-inline-start: -999rem;
  inset-block-start: 0.5rem;
  z-index: 60;
  padding: 0.6rem 1rem;
  color: var(--primary);
  background: var(--bg);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
}
.skip-link:focus { inset-inline-start: 0.5rem; }

.visually-hidden {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon { inline-size: 1.25em; block-size: 1.25em; flex: none; vertical-align: middle; }
.icon-sm { inline-size: 1rem; block-size: 1rem; }
.icon-lg { inline-size: 1.75rem; block-size: 1.75rem; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* Brand: the emblem and the platform name, see templates/partials/brand.html */
.emblem { inline-size: 2.75rem; block-size: 2.75rem; flex: none; }
.emblem .em-check { stroke: var(--brand-cyan); }
.brand-logo { inline-size: auto; max-inline-size: 8rem; object-fit: contain; }
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; }
.brand-text { display: flex; flex-direction: column; min-inline-size: 0; }
.brand-name { font-weight: 600; font-size: 1.05rem; line-height: 1.2; letter-spacing: -0.01em; }
.brand-sub { font-size: 0.8rem; line-height: 1.3; }

/* Signed-in shell: sidebar, top bar, main area */
/* input[type="checkbox"] in the selector outranks the drawn checkboxes of the Forms block. */
input[type="checkbox"].nav-toggle { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; border: 0; pointer-events: none; }
.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  inline-size: var(--sidebar);
  background: var(--bg);
  box-shadow: var(--shadow-side);
  border-inline-end: 1px solid var(--line-soft);
}
.brand-block {
  position: relative;
  padding: 1.25rem 1.25rem 1.35rem;
  color: var(--on-dark);
  background: var(--primary);
}
.brand-block::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  block-size: 2px;
  background: linear-gradient(90deg, var(--brand-cyan) 0%, var(--brand-light) 100%);
}
[dir="rtl"] .brand-block::after { background: linear-gradient(270deg, var(--brand-cyan) 0%, var(--brand-light) 100%); }
.brand-block .brand, .brand-block .brand:hover { color: var(--on-dark); }
.brand-block .brand-sub { color: var(--on-dark-muted); }
.brand-block :focus-visible { outline-color: var(--focus-on-dark); }
.side-nav { flex: 1; overflow-y: auto; padding: 0.75rem; }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.nav-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.9rem 0 0.25rem;
  padding: 0.35rem 0.75rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-block-size: 2.75rem;
  margin-block: 0.15rem;
  padding: 0.55rem 0.75rem;
  color: var(--fg);
  border-radius: var(--radius);
  text-decoration: none;
}
.nav-item .icon { color: var(--muted); }
.nav-item:hover { color: var(--primary); background: var(--hover); }
.nav-item[aria-current="page"] { color: var(--on-dark); background: var(--primary); font-weight: 500; box-shadow: var(--shadow); }
.nav-item[aria-current="page"] .icon { color: var(--on-dark); }
.side-foot { display: grid; gap: 0.6rem; padding: 0.75rem; border-block-start: 1px solid var(--line-soft); }
.user-card { display: block; min-block-size: 2.75rem; padding: 0.6rem 0.75rem; color: var(--fg); background: var(--surface); border-radius: var(--radius); text-decoration: none; }
.user-card:hover, .user-card[aria-current="page"] { background: var(--hover); }
.user-label { display: block; color: var(--muted); font-size: 0.8rem; }
.who { display: block; color: var(--fg); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { display: block; color: var(--muted); font-size: 0.9rem; }
.signout-form { margin: 0; }
.signout, .signout:hover {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  inline-size: 100%;
  min-block-size: 2.75rem;
  padding: 0.5rem 0.75rem;
  color: var(--red);
  background: none;
  border: 0;
  border-radius: var(--radius);
  font-weight: 500;
  justify-content: flex-start;
  box-shadow: none;
}
.signout:hover { color: var(--red-dark); background: var(--red-bg); }

/* Language switch: a pill with a globe and an EN | ع segmented toggle. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  justify-self: center;
  padding: 0.3rem 0.35rem 0.3rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(145deg, var(--bg) 0%, var(--tint-blue) 100%);
  box-shadow: var(--shadow);
}
.lang-head { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--primary); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.lang-head .icon { color: var(--focus); inline-size: 1rem; block-size: 1rem; }
.lang-track { display: grid; grid-template-columns: 1fr 1fr; direction: ltr; min-inline-size: 6.5rem; padding: 0.2rem; border-radius: 999px; background: var(--tint-slate); }
.lang-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 2rem;
  padding: 0.2rem 0.7rem;
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
.lang-opt:hover { color: var(--primary); background: var(--hover); }
.lang-opt[aria-current="true"], .lang-opt[aria-current="true"]:hover { color: var(--on-dark); background: var(--primary); box-shadow: var(--shadow-pill); }

.overlay { display: none; }
.app-main { display: flex; flex-direction: column; min-block-size: 100vh; margin-inline-start: var(--sidebar); }
.topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-block-size: 3.5rem;
  padding: 0.35rem 1.25rem;
  background: var(--glass);
  border-block-end: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.topbar-title { flex: 1; min-inline-size: 0; color: var(--primary); font-weight: 600; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-mark { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--primary); font-size: 0.85rem; font-weight: 600; }
.topbar-mark .emblem { inline-size: 2.25rem; block-size: 2.25rem; }
.menu-button {
  display: none;
  align-items: center;
  justify-content: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  margin: 0;
  color: var(--primary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.menu-button:hover { background: var(--hover); }
.nav-toggle:focus-visible ~ .app-main .menu-button { outline: 3px solid var(--focus); outline-offset: 2px; }
.page { flex: 1; inline-size: 100%; max-inline-size: 84rem; padding: 2rem 1.5rem 3rem; }
.public-footer { padding: 1rem 1.5rem; color: var(--muted); font-size: 0.9rem; }
.public-footer p { margin: 0; }

/* Signed-out pages: pastel gradient with soft glows, centered cards */
body.public {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(40rem 30rem at 12% 18%, var(--glow-1), transparent 70%),
    radial-gradient(36rem 28rem at 88% 85%, var(--tint-cyan), transparent 70%),
    linear-gradient(135deg, var(--glow-3) 0%, var(--glow-2) 45%, var(--glow-3) 100%);
  background-attachment: fixed;
}
.public-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; padding: 1rem 1.5rem; }
.public-top .brand { color: var(--primary); }
.public-top .brand-sub { color: var(--muted); }
.public-top .emblem { color: var(--primary); }
.public-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-inline-start: auto; }
.public-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.public-nav a { display: inline-flex; align-items: center; gap: 0.4rem; min-block-size: 2.5rem; padding: 0.3rem 0.85rem; color: var(--primary); border-radius: 999px; text-decoration: none; font-weight: 500; }
.public-nav a:hover { background: var(--glass-soft); }
.public-nav a[aria-current="page"] { background: var(--bg); box-shadow: var(--shadow); }
.public-main { flex: 1; inline-size: 100%; max-inline-size: 75rem; margin-inline: auto; padding: 0.5rem 1.25rem 2.5rem; }
.public-footer { text-align: center; }
.public-footer a { color: var(--link); }
body.auth .public-top .brand { visibility: hidden; }

.big-card {
  position: relative;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: var(--glass-strong);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-big);
  box-shadow: var(--shadow-lg);
}
.big-card + .big-card { margin-block-start: 1.5rem; }
.big-card-inner { max-inline-size: 48rem; margin-inline: auto; }
.auth-card {
  position: relative;
  max-inline-size: 36.25rem;
  margin: 1rem auto 2rem;
  padding: 2.25rem clamp(1.25rem, 5vw, 2.5rem) 2.25rem;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
}
.grad-bar { position: absolute; inset-block-start: 0; inset-inline: 0; block-size: 6px; background: linear-gradient(90deg, var(--brand-light), var(--brand-cyan), var(--primary)); }
[dir="rtl"] .grad-bar { background: linear-gradient(270deg, var(--brand-light), var(--brand-cyan), var(--primary)); }
.logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem 1rem;
  color: var(--primary);
  background: linear-gradient(145deg, var(--surface), var(--tint-blue));
  border: 1px solid var(--line);
  border-radius: 1rem;
}
.logo-box .emblem { inline-size: 4rem; block-size: 4rem; }
.logo-box .brand-name { font-size: 1.35rem; }
.logo-box .brand-sub { color: var(--muted); }
.pill-divider { display: block; inline-size: 7rem; block-size: 4px; margin: 1.25rem auto 0.75rem; border-radius: 999px; background: linear-gradient(90deg, var(--brand-cyan), var(--primary), var(--brand-light)); }
[dir="rtl"] .pill-divider { background: linear-gradient(270deg, var(--brand-cyan), var(--primary), var(--brand-light)); }
.tagline { color: var(--muted); text-align: center; font-size: 0.95rem; }
.auth-card hr, .rule { block-size: 1px; margin: 1.5rem 0; background: var(--line); border: 0; }
.auth-card h1 { text-align: center; font-size: 1.6rem; }
.auth-card .note { text-align: center; color: var(--muted); font-size: 0.9rem; margin-block-start: 1.25rem; }
/* The rule with "or" between the password form and the Sanad sign-in. */
.or-rule { display: flex; align-items: center; gap: 0.75rem; margin-block: 1.25rem; color: var(--muted); font-size: 0.9rem; }
.or-rule::before, .or-rule::after { content: ""; flex: 1; block-size: 1px; background: var(--line); }
.demo-card { padding-block: 1.75rem; }
.demo-card h2 { display: flex; align-items: center; gap: 0.5rem; margin-block: 0 0.5rem; font-size: 1.15rem; color: var(--primary); }
.demo-list { display: grid; gap: 0.6rem; margin: 1rem 0; padding: 0; list-style: none; }
.demo-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; }
.demo-fill { min-inline-size: 8.5rem; justify-content: center; }
.demo-text { flex: 1 1 12rem; }
.demo-text strong { display: block; }
body.auth .flash { max-inline-size: 36.25rem; margin-inline: auto; }

/* Page head */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; margin-block-end: 1.5rem; }
.page-head h1 { margin: 0; }
.page-head .lead { flex-basis: 100%; margin: 0; }
.eyebrow { margin: 0 0 0.35rem; color: var(--muted); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.back-link { display: inline-flex; align-items: center; gap: 0.35rem; margin-block-end: 0.75rem; color: var(--link); text-decoration: none; font-weight: 500; }
.back-link:hover { text-decoration: underline; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
/* Breadcrumbs above the title of a detail page: the parent list as a link, the current page as plain text. The
 * separator is a drawn chevron that points the other way in Arabic. */
.crumbs { margin-block-end: 0.75rem; font-size: 0.9rem; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0; margin: 0; padding: 0; list-style: none; }
.crumbs li { display: inline-flex; align-items: center; min-inline-size: 0; color: var(--muted); }
.crumbs li + li::before { content: ""; flex: none; inline-size: 0.4rem; block-size: 0.4rem; margin-inline: 0.55rem 0.7rem; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); }
[dir="rtl"] .crumbs li + li::before { transform: rotate(135deg); }
.crumbs a { display: inline-flex; align-items: center; min-block-size: 2rem; color: var(--link); font-weight: 500; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current="page"] { overflow: hidden; color: var(--fg); text-overflow: ellipsis; white-space: nowrap; }
/* Status summary of the citizen request list: one chip per group with its count. */
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 0.5rem; min-block-size: 2.75rem; padding: 0.35rem 1rem; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); font-size: 0.925rem; }
.chip .icon { inline-size: 1.05rem; block-size: 1.05rem; color: var(--primary); }
.chip-green .icon { color: var(--green); }
.chip-count { color: var(--primary); font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Cards */
.card {
  margin-block: 0 1.5rem;
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}
.card > :first-child { margin-block-start: 0; }
.card > :last-child { margin-block-end: 0; }
/* A compact header row: icon and title centred on one line. .card > .card-head outranks .card > :first-child, which
 * would otherwise cancel the negative top margin and leave a gap above the title. */
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; min-block-size: 3.5rem; margin: 0; padding: 0.7rem 1.5rem; border-block-end: 1px solid var(--line); }
.card > .card-head { margin: -1.5rem -1.5rem 1.25rem; }
.card-head h2 { display: flex; align-items: center; gap: 0.6rem; margin: 0; font-size: 1.1rem; line-height: 1.3; color: var(--fg); }
.card-head h2 .icon { color: var(--primary); }
.card-head .card-sub, .card-head .hint { margin-block: 0.1rem 0; }
.card-sub { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.875rem; }
.card.danger { border-color: var(--red); border-inline-start-width: 4px; }
.card.danger .card-head h2, .card.danger .card-head h2 .icon { color: var(--red); }
.grid-2 { display: grid; gap: 0 1.5rem; grid-template-columns: minmax(0, 1fr); }
.grid-2 > .card { margin-block-end: 1.5rem; }

/* Stat cards and quick actions */
.stat-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin-block-end: 1.5rem; }
.stat-card {
  padding: 1.25rem 1.5rem;
  background: var(--tint-blue);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--primary);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}
.stat-card.stat-cyan { background: var(--tint-cyan); border-inline-start-color: var(--focus); }
.stat-card.stat-slate { background: var(--tint-slate); }
.stat-label { display: flex; align-items: center; gap: 0.5rem; margin: 0; color: var(--fg); font-size: 0.95rem; }
.stat-label .icon { inline-size: 2rem; block-size: 2rem; padding: 0.4rem; color: var(--primary); background: var(--bg); border-radius: 50%; }
.stat-value { display: block; margin: 0.6rem 0 0.35rem; color: var(--primary); font-size: 2rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-note { margin: 0; color: var(--muted); font-size: 0.85rem; }
.quick-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); margin: 0; padding: 0; list-style: none; }
.quick-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  block-size: 100%;
  padding: 1rem;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
}
.quick-card { transition: background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.quick-card:hover { color: var(--fg); background: var(--hover); border-color: var(--primary); box-shadow: var(--shadow-hover); }
.quick-card .icon { color: var(--primary); margin-block-start: 0.1rem; }
.quick-card strong { display: block; font-weight: 600; }
.quick-card span span { display: block; color: var(--muted); font-size: 0.85rem; }

/* Buttons */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-block-size: 2.75rem;
  max-inline-size: 100%;
  padding: 0.55rem 1.15rem;
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  color: var(--on-dark);
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
button:hover, .button:hover { color: var(--on-dark); background: var(--primary-dark); border-color: var(--primary-dark); }
button:active, .button:active { box-shadow: none; }
button.secondary, .button.secondary { color: var(--primary); background: var(--bg); border-color: var(--input-border); box-shadow: none; }
button.secondary:hover, .button.secondary:hover { color: var(--primary); background: var(--hover); border-color: var(--primary); }
button.danger, .button.danger { color: var(--on-dark); background: var(--red); border-color: var(--red); }
button.danger:hover, .button.danger:hover { background: var(--red-dark); border-color: var(--red-dark); }
/* Ghost: a quiet action next to a primary one, such as clearing a filter. */
button.ghost, .button.ghost { color: var(--link); background: transparent; border-color: transparent; box-shadow: none; }
button.ghost:hover, .button.ghost:hover { color: var(--primary); background: var(--hover); border-color: transparent; }
button:disabled, button:disabled:hover { color: var(--primary); background: var(--tint-cyan); border-color: var(--tint-cyan); cursor: not-allowed; box-shadow: none; }
/* app.js marks the button of a sent form busy until the next page: a small ring turns beside the label (it stands
 * still under reduced motion and still reads as busy). */
button[aria-busy="true"] { cursor: progress; }
button[aria-busy="true"]::after { content: ""; inline-size: 1em; block-size: 1em; flex: none; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.button-light { color: var(--primary); background: var(--brand-light); border-color: var(--brand-light); border-radius: 999px; }
.button-light:hover, .ready .button-light { color: var(--on-dark); background: var(--primary); border-color: var(--primary); }
.button-block { inline-size: 100%; min-block-size: 3.5rem; font-size: 1.05rem; }
.link-button { min-block-size: 0; padding: 0; color: var(--link); background: none; border: 0; box-shadow: none; text-decoration: underline; font-weight: 400; }
.link-button:hover { color: var(--primary); background: none; }
.inline-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0; }
/* Arabic buttons get more room to tap and to breathe, a long label wraps inside the button. */
html[lang="ar"] :is(button, .button):not(.link-button, .signout, .button-block) { min-block-size: 3rem; padding-inline: 1.35rem; line-height: 1.4; }
html[lang="ar"] .actions, html[lang="ar"] .form-actions, html[lang="ar"] .inline-form { gap: 0.85rem 1rem; }
/* Copy buttons need the clipboard: app.js sets can-copy, without it the value is plain selectable text. */
.copy { display: none; min-block-size: 2.75rem; padding: 0.3rem 0.8rem; font-size: 0.9rem; }
.can-copy .copy { display: inline-flex; }

/* Forms: one look for every text field, select and date field. A select sits in a .select-wrap span with the lucide
 * chevron of the icon function at its end (the CSP allows no data URI images), so the option list stays the native
 * one of the system. Checkboxes and radios are drawn here with a larger box, a check mark and the focus ring. */
label { display: block; color: var(--fg); font-weight: 500; font-size: 0.95rem; margin-block-end: 0.4rem; }
input:is([type="text"], [type="password"], [type="search"], [type="number"], [type="date"], [type="email"], [type="tel"]), select, textarea {
  inline-size: 100%;
  min-block-size: 2.75rem;
  padding: 0.55rem 0.85rem;
  font: inherit;
  line-height: 1.4;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 2px var(--line-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { min-block-size: 6rem; resize: vertical; }
input:is([type="text"], [type="password"], [type="search"], [type="number"], [type="date"], [type="email"], [type="tel"]):hover, select:hover, textarea:hover { border-color: var(--primary); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--focus); outline: 3px solid var(--focus); outline-offset: 1px; }
input:is([type="text"], [type="password"], [type="search"], [type="number"], [type="date"], [type="email"], [type="tel"]):disabled, select:disabled, textarea:disabled, input[readonly] { color: var(--muted); background: var(--surface); border-style: dashed; box-shadow: none; cursor: not-allowed; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
::-webkit-calendar-picker-indicator { cursor: pointer; }
.select-wrap { position: relative; display: block; }
.select-wrap select { appearance: none; -webkit-appearance: none; padding-inline-end: 2.75rem; text-overflow: ellipsis; cursor: pointer; }
.select-wrap select:disabled { cursor: not-allowed; }
.select-wrap .select-chevron { position: absolute; inset-inline-end: 0.85rem; inset-block-start: 50%; inline-size: 1.15rem; block-size: 1.15rem; margin-block-start: -0.575rem; color: var(--muted); pointer-events: none; }
.select-wrap:hover .select-chevron, .select-wrap:focus-within .select-chevron { color: var(--primary); }
select option { color: var(--fg); background: var(--bg); }
.inline-form .select-wrap { display: inline-block; }
.dropzone input[type="file"]:focus-visible { outline: none; }
.input-lg input[type="text"], .input-lg input[type="password"] { min-block-size: 3.5rem; padding-inline: 1rem; }
/* The request form: roomier boxes, an icon at the start of a text box, a placeholder that is clearly not a value and
 * numbered steps. The placeholder colour is --muted, which meets the contrast of the text tests. */
#new-request-form input:is([type="text"]), #new-request-form select { min-block-size: 3.25rem; border-radius: 0.65rem; border-width: 1.5px; }
#new-request-form ::placeholder { color: var(--muted); opacity: 1; }
.input-icon { position: relative; display: block; }
.input-icon > .icon { position: absolute; inset-inline-start: 0.95rem; inset-block-start: 50%; inline-size: 1.15rem; block-size: 1.15rem; margin-block-start: -0.575rem; color: var(--muted); pointer-events: none; }
.input-icon > input { padding-inline-start: 2.9rem; }
.input-icon:focus-within > .icon { color: var(--primary); }
.form-step { display: flex; align-items: center; gap: 0.65rem; margin: 1.75rem 0 0.9rem; font-size: 1.1rem; font-weight: 600; color: var(--fg); }
legend .form-step { margin-block: 0 0.6rem; }
.step-n { display: inline-flex; flex: none; align-items: center; justify-content: center; inline-size: 1.9rem; block-size: 1.9rem; border-radius: 50%; color: var(--on-dark); background: var(--primary); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
#new-request-form .field > label { font-weight: 600; }
fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
legend { margin-block-end: 0.4rem; padding: 0; color: var(--fg); font-weight: 600; }
.field { margin-block: 0 1.25rem; }
input[type="checkbox"], input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  flex: none;
  inline-size: 1.375rem;
  block-size: 1.375rem;
  margin: 0;
  background: var(--bg);
  border: 2px solid var(--input-border);
  border-radius: 0.3rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]::before { content: ""; inline-size: 0.4rem; block-size: 0.75rem; margin-block-start: -0.15rem; border: solid var(--on-dark); border-width: 0 0.18rem 0.18rem 0; transform: rotate(45deg) scale(0); transition: transform 0.12s ease; }
input[type="radio"]::before { content: ""; inline-size: 0.6rem; block-size: 0.6rem; border-radius: 50%; background: var(--on-dark); transform: scale(0); transition: transform 0.12s ease; }
:is(input[type="checkbox"], input[type="radio"]):hover { border-color: var(--primary); }
:is(input[type="checkbox"], input[type="radio"]):checked { background: var(--primary); border-color: var(--primary); }
input[type="checkbox"]:checked::before { transform: rotate(45deg) scale(1); }
input[type="radio"]:checked::before { transform: scale(1); }
:is(input[type="checkbox"], input[type="radio"]):disabled { background: var(--surface); border-color: var(--neutral-light); cursor: not-allowed; }
:is(input[type="checkbox"], input[type="radio"])[aria-invalid="true"] { border-color: var(--red); box-shadow: none; }
/* The label is the hit area: at least 44px high, and its overlay covers the whole row or tile, so a tap anywhere on
 * it toggles the box. */
.check { position: relative; display: flex; align-items: flex-start; gap: 0.75rem; margin-block: 0.5rem; }
.check input { margin-block-start: 0.7rem; }
.check label { flex: 1; min-block-size: 2.75rem; margin: 0; padding-block: 0.6rem; color: var(--fg); font-size: 1rem; font-weight: 400; cursor: pointer; }
.check label::after { content: ""; position: absolute; inset: 0; }
.check-tile { padding: 0.25rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.check-tile:has(input:checked) { background: var(--tint-blue); border-color: var(--primary); }
/* A switch: the attestation choice of the new request form, a checkbox with role switch. The knob moves to the end
 * of the track when it is on, on the navy track. */
.switch { align-items: center; padding: 0.25rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.switch:has(input:checked) { background: var(--tint-blue); border-color: var(--primary); }
.switch input[type="checkbox"] { align-self: center; inline-size: 3rem; block-size: 1.75rem; margin: 0; padding-inline: 0.15rem; place-content: center start; background: var(--input-border); border-color: var(--input-border); border-radius: 999px; }
.switch input[type="checkbox"]::before { inline-size: 1.2rem; block-size: 1.2rem; margin: 0; background: var(--bg); border: 0; border-radius: 50%; box-shadow: var(--shadow); transform: none; transition: translate 0.15s ease; }
.switch input[type="checkbox"]:checked { background: var(--primary); border-color: var(--primary); }
.switch input[type="checkbox"]:checked::before { transform: none; translate: calc(1.5rem - 4px) 0; }
[dir="rtl"] .switch input[type="checkbox"]:checked::before { translate: calc(4px - 1.5rem) 0; }
.switch label { align-self: center; }
.switch-fee { color: var(--primary); font-weight: 600; white-space: nowrap; }
/* Windows high contrast replaces the fills: the marks take the system text color. */
@media (forced-colors: active) {
  input[type="checkbox"]::before { border-color: CanvasText; }
  input[type="radio"]::before, .switch input[type="checkbox"]::before { background: CanvasText; }
}
.hint { color: var(--muted); font-size: 0.9rem; margin-block: 0.35rem 0; }
.has-error { padding-inline-start: 0.85rem; border-inline-start: 3px solid var(--red); }
.field-error { margin-block: 0.25rem 0.5rem; color: var(--red); font-weight: 600; }
.field-error:empty { display: none; }
/* Choice cards: the document types of the new request form, radio inputs whose labels are cards. */
.choice-field legend { font-size: 1.05rem; }
.choice-field .hint { margin-block: 0 0.75rem; }
.choice-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.choice { position: relative; }
.choice input[type="radio"] { position: absolute; inset-block-start: 1rem; inset-inline-start: 1rem; }
.choice input[type="radio"]:focus-visible { outline: none; }
.choice label {
  display: grid;
  align-content: start;
  gap: 0.25rem;
  block-size: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  padding-inline-start: 3.1rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.choice label:hover { border-color: var(--primary); box-shadow: var(--shadow-hover); }
.choice input:checked + label { background: var(--tint-blue); border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.choice input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.has-error .choice label { border-color: var(--red); }
.choice-name { color: var(--fg); font-weight: 600; line-height: 1.3; }
.choice-fee { color: var(--primary); font-size: 1.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.choice-meta { display: flex; align-items: flex-start; gap: 0.4rem; margin-block-start: 0.2rem; color: var(--muted); font-size: 0.875rem; }
.choice-meta .icon { margin-block-start: 0.15rem; color: var(--primary); }
.choice-meta.mode-none .icon { color: var(--neutral-dark); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-block: 1.25rem 0; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 1rem; padding-block: 1.25rem 0.15rem; }
.filters .field { flex: 1 1 12rem; }
.filters .form-actions { margin-block: 0 1.1rem; }
.grid-form { display: grid; gap: 0 1rem; grid-template-columns: minmax(0, 1fr); }
.grid-form .form-actions, .grid-form .check { grid-column: 1 / -1; }
.total { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-block: 1.25rem 0; padding: 0.9rem 1.1rem; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--primary); border-radius: var(--radius); }
.total-label { font-weight: 600; }
.total-parts { display: block; color: var(--muted); font-size: 0.875rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.total strong { color: var(--primary); font-size: 1.4rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.error-summary {
  margin-block: 0 1.5rem;
  padding: 1rem 1.25rem;
  color: var(--fg);
  background: var(--red-bg);
  border: 1px solid var(--red);
  border-inline-start-width: 4px;
  border-radius: var(--radius);
}
.error-summary h2 { margin-block: 0 0.5rem; font-size: 1.05rem; color: var(--red); letter-spacing: 0; }
.error-summary ul { margin: 0; padding-inline-start: 1.25rem; }
.error-summary a { color: var(--red); font-weight: 600; }
.error-summary p { margin: 0; }

/* Messages: rounded tinted bars with an icon */
.flash, .banner, .notice {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-block: 0 1.25rem;
  padding: 0.8rem 1rem;
  border: 1px solid;
  border-radius: var(--radius-card);
}
.flash .icon, .banner .icon, .notice .icon { margin-block-start: 0.1rem; }
.flash, .banner { border-inline-start-width: 4px; box-shadow: var(--shadow); }
@keyframes rise { from { opacity: 0; transform: translateY(-0.25rem); } }
.flash-ok { color: var(--green); background: var(--green-bg); }
.flash-error { color: var(--red); background: var(--red-bg); }
.banner-warn { color: var(--amber); background: var(--amber-bg); }
.banner-info, .notice { color: var(--blue); background: var(--blue-bg); }
.flash span, .banner span, .notice span { color: var(--fg); }
.notice { border-color: var(--line); }

.lead { font-size: 1.05rem; color: var(--muted); }
.muted { color: var(--muted); }
.mono, .code { font-family: var(--font-mono); font-size: 0.92em; }
/* Long IDs may break anywhere in running text and fact lists. Codes such as state_change never break. */
.mono { overflow-wrap: anywhere; }
.code { padding: 0.05rem 0.4rem; color: var(--fg); background: var(--surface); border: 1px solid var(--line-soft); border-radius: 4px; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-block: 1rem 0; }
.reload { margin-block-start: 1rem; }
.page-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-block: 0 1.5rem; padding: 0; list-style: none; }
.page-links a { display: inline-flex; align-items: center; min-block-size: 2.25rem; padding: 0.25rem 0.9rem; color: var(--primary); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 500; }
.page-links a:hover { background: var(--hover); }
.again { margin-block: 1.25rem 0; text-align: center; }
.again a { display: inline-flex; align-items: center; min-block-size: 2.75rem; padding: 0.4rem 1.2rem; color: var(--primary); border: 1px solid var(--input-border); border-radius: 999px; text-decoration: none; font-weight: 500; }
.again a:hover { background: var(--hover); }

/* Empty states */
.empty { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 2.5rem 1rem; color: var(--muted); text-align: center; }
.empty > .icon { inline-size: 2.75rem; block-size: 2.75rem; color: var(--neutral-dark); margin-block-end: 0.5rem; }
.empty p { max-inline-size: 36rem; margin: 0.2rem 0; }
/* First-use and no-result states: a round icon, a title, one sentence on what to do next and a button or link. */
.empty-icon { display: inline-flex; align-items: center; justify-content: center; inline-size: 4rem; block-size: 4rem; margin-block-end: 0.75rem; color: var(--primary); background: var(--tint-blue); border-radius: 50%; }
.empty-icon .icon { inline-size: 2rem; block-size: 2rem; }
.empty h2 { margin: 0 0 0.25rem; color: var(--fg); font-size: 1.2rem; }
.empty .actions { justify-content: center; margin-block-start: 0.75rem; }
.empty .empty-hint { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; margin-block-start: 1.25rem; padding-block-start: 1rem; border-block-start: 1px solid var(--line-soft); }
.empty-hint .icon { flex: none; color: var(--primary); }
.card > .empty { padding-block: 1.5rem; }

/* Home */
.hero { text-align: center; }
.hero h1 { font-size: clamp(2rem, 2.4vw + 1.25rem, 2.75rem); margin-block-start: 0.5rem; }
.hero .lead { max-inline-size: 38rem; margin-inline: auto; }
.hero .actions { justify-content: center; margin-block-start: 1.5rem; }
.steps { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; }
.step-card { padding: 1.5rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.step-card h3 { display: flex; align-items: center; gap: 0.6rem; margin-block: 0.75rem 0.35rem; font-size: 1.1rem; }
.step-card p { margin: 0; color: var(--muted); }
.step-icon { display: inline-flex; align-items: center; justify-content: center; inline-size: 3rem; block-size: 3rem; color: var(--primary); background: var(--tint-blue); border-radius: 0.85rem; }
.step-icon .icon { inline-size: 1.5rem; block-size: 1.5rem; }
.staff-link { margin-block-start: 1.5rem; text-align: center; color: var(--muted); }

/* Tables: white card, soft header row, row hover */
/* Wide tables scroll inside their region (role region, a name and tabindex 0 so the keyboard can scroll it)
 * instead of squeezing the cells until words break. */
.table-card { margin-block: 0 1.5rem; overflow: hidden; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
/* position: relative keeps the visually hidden labels of the row forms inside the scroll region, otherwise they sit
 * at their static place beyond the clip and widen the whole page. */
.table-wrap { overflow-x: auto; position: relative; }
table.wide { min-inline-size: 46rem; }
table { inline-size: 100%; border-collapse: collapse; }
caption { padding: 0.9rem 1.25rem 0.25rem; text-align: start; color: var(--fg); font-weight: 600; }
th, td { padding: 0.8rem 1.25rem; text-align: start; vertical-align: middle; border-block-end: 1px solid var(--line-soft); }
thead th { padding-block: 0.75rem; color: var(--muted); background: var(--surface); border-block-end: 1px solid var(--line); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child th, tbody tr:last-child td { border-block-end: 0; }
tbody tr { transition: background-color 0.15s ease; }
tbody tr:hover { background: var(--surface); }
tbody th { font-weight: 600; }
td.num, th.num { text-align: end; }
.row-actions { white-space: nowrap; }
.row-actions a, .row-actions .inline-form { margin-inline-end: 0.75rem; }
.row-actions a { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 500; text-decoration: none; }
.row-actions a:hover { text-decoration: underline; }
/* The staff rows hold three forms: they wrap inside the cell instead of widening the table. */
.wrap-actions { white-space: normal; }
.wrap-actions .inline-form { margin-block: 0.2rem; }
/* An ID in a cell stays on one line and is cut with an ellipsis. The full value is in the title and the text. */
.id { display: inline-block; max-inline-size: 13ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.col-details { min-inline-size: 14rem; }
.kv { margin: 0; font-size: 0.85rem; }
.kv div { display: flex; flex-wrap: wrap; gap: 0 0.35rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dt::after { content: ":"; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.pager { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin-block: 0 1.5rem; }
.pager a { display: inline-flex; align-items: center; gap: 0.35rem; min-block-size: 2.75rem; padding: 0.3rem 0.9rem; color: var(--primary); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-weight: 500; }
.pager a:hover { background: var(--hover); }
.bar { display: block; inline-size: 100%; min-inline-size: 5rem; block-size: 0.5rem; appearance: none; border: 0; border-radius: 999px; background: var(--tint-slate); overflow: hidden; }
.bar::-webkit-progress-bar { background: var(--tint-slate); border-radius: 999px; }
.bar::-webkit-progress-value { background: linear-gradient(90deg, var(--focus), var(--primary)); border-radius: 999px; }
.bar::-moz-progress-bar { background: var(--primary); border-radius: 999px; }
td.bar-cell { inline-size: 45%; }

/* Facts lists */
.facts { display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); margin: 0; }
/* One column on phones (label above value), two from 40rem. minmax(0, 1fr) lets a long value wrap, not overflow. */
.facts div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.1rem 1rem; padding-block: 0.65rem; border-block-end: 1px solid var(--line-soft); }
.facts div:last-child { border-block-end: 0; }
.facts dt { color: var(--muted); font-size: 0.9rem; }
.facts dd { margin: 0; color: var(--fg); font-weight: 500; }
.facts dd .copy { margin-inline-start: 0.5rem; }
.sub-title { margin-block: 1.25rem 0.5rem; font-size: 1rem; color: var(--fg); }
.check-list { display: grid; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.check-list li { display: flex; align-items: flex-start; gap: 0.5rem; }
.check-list .icon { flex: none; color: var(--primary); margin-block-start: 0.15rem; }
.summary-strip { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); margin: 0 0 1.5rem; }
.summary-strip div { padding: 0.85rem 1rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.summary-strip dt { color: var(--muted); font-size: 0.85rem; }
.summary-strip dd { margin: 0.15rem 0 0; color: var(--primary); font-weight: 600; }

/* Status labels: always a word and an icon of its own shape (aria-hidden), the color only supports them */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  border: 1px solid;
  border-radius: 999px;
}
.badge .icon { inline-size: 0.95rem; block-size: 0.95rem; stroke-width: 2.5; }
.badge .code { padding: 0; color: inherit; background: none; border: 0; }
.badge-awaiting_payment, .badge-processing, .badge-awaiting_mofa, .badge-info { color: var(--blue); background: var(--blue-bg); }
.badge-ready, .badge-attested, .badge-ok { color: var(--green); background: var(--green-bg); }
.badge-rejected, .badge-refunded, .badge-cancelled, .badge-expired, .badge-off { color: var(--grey); background: var(--grey-bg); }
.badge-failed, .badge-warn { color: var(--amber); background: var(--amber-bg); }
.badge-revoked, .badge-bad { color: var(--red); background: var(--red-bg); }
/* payment and attestation states, named without the badge- prefix that the citizen status labels use */
.pay-pending, .att-processing, .att-awaiting_payment { color: var(--blue); background: var(--blue-bg); }
.pay-paid, .att-completed { color: var(--green); background: var(--green-bg); }
.pay-declined { color: var(--red); background: var(--red-bg); }
.pay-refund_pending, .att-pending_approval { color: var(--amber); background: var(--amber-bg); }
.pay-refunded, .att-rejected { color: var(--grey); background: var(--grey-bg); }
/* the status of a ledger record */
.rec-valid { color: var(--green); background: var(--green-bg); }
.rec-revoked { color: var(--red); background: var(--red-bg); }

/* New request: the form with its type cards, the fee table beside it on wide screens. */
.new-grid { display: grid; gap: 0 1.5rem; grid-template-columns: minmax(0, 1fr); align-items: start; }

/* Request detail */
.detail-grid { display: grid; gap: 0 1.5rem; grid-template-columns: minmax(0, 1fr); }
.status-card { border-block-start: 4px solid var(--primary); }
.live-note { display: flex; align-items: center; gap: 0.5rem; }
.live-note::before { content: ""; flex: none; inline-size: 0.6rem; block-size: 0.6rem; border-radius: 50%; background: var(--focus); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.35; } }
.just-updated .status-card { animation: rise 0.3s ease-out; }
.status-card h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0 0 0.5rem; color: var(--fg); font-size: 1.15rem; }
.status-revoked { border-block-start-color: var(--red); }
.status-ready, .status-attested { border-block-start-color: var(--green); }
.status-failed { border-block-start-color: var(--amber); }
.status-rejected, .status-refunded, .status-cancelled, .status-expired { border-block-start-color: var(--neutral-dark); }
/* The action strip: the primary action of the request (download, pay, attest, cancel) at the top of the main column.
 * On phones it moves to the end of the column and sticks to the bottom of the viewport, see the phone block. */
.action-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-block: 0 1.5rem; padding: 1rem 1.25rem; background: var(--bg); border: 1px solid var(--line); border-inline-start: 4px solid var(--primary); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.action-strip .actions { flex: 1 1 auto; margin: 0; }
.action-strip .button, .action-strip button { min-inline-size: 11rem; }
.attest-later { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; margin: 0; padding: 0.85rem 1rem; background: var(--tint-cyan); border-radius: var(--radius); }
.attest-later p { margin: 0; }
.pay-grid { display: grid; gap: 0.85rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); margin: 0; padding: 0; list-style: none; }
.pay-card { display: grid; gap: 0.35rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pay-card .pay-purpose { display: flex; align-items: center; gap: 0.5rem; color: var(--fg); font-weight: 600; }
.pay-card .pay-purpose .icon { color: var(--primary); }
.pay-card .pay-amount { color: var(--primary); font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.pay-card .pay-refund { color: var(--muted); font-size: 0.9rem; }

/* Timeline: a vertical stepper with an icon per state, the last step is the current one */
.stepper { position: relative; margin: 0; padding: 0; list-style: none; }
.stepper li { position: relative; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 0 0.85rem; padding-block-end: 1.1rem; }
.stepper li::before { content: ""; position: absolute; inset-block: 2.25rem 0; inset-inline-start: calc(1.125rem - 1px); inline-size: 2px; background: var(--line); }
.stepper li:last-child { padding-block-end: 0; }
.stepper li:last-child::before { display: none; }
.step-dot { display: inline-flex; align-items: center; justify-content: center; inline-size: 2.25rem; block-size: 2.25rem; color: var(--primary); background: var(--tint-blue); border-radius: 50%; }
.step-dot .icon { inline-size: 1.1rem; block-size: 1.1rem; }
.stepper li:last-child .step-dot { color: var(--on-dark); background: var(--primary); box-shadow: 0 0 0 4px var(--tint-blue); }
.step-body { display: flex; flex-direction: column; padding-block-start: 0.35rem; }
.step-body > span:last-child { color: var(--fg); font-weight: 500; }
.stepper .when { order: 2; color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

/* Verification: dropzone, result panels */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 2.5rem 1.25rem;
  text-align: center;
  background: var(--surface);
  border: 2px dashed var(--neutral-light);
  border-radius: 1rem;
}
.dropzone:hover, .dropzone.dragging { background: var(--blue-bg); border-color: var(--focus); }
.dropzone:focus-within { border-color: var(--focus); outline: 3px solid var(--focus); outline-offset: 2px; }
.dropzone input[type="file"] { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; opacity: 0; cursor: pointer; }
.dropzone input[type="file"]:disabled { cursor: not-allowed; }
.dropzone label { margin: 0; color: var(--fg); font-size: 1.1rem; font-weight: 600; }
.drop-icon { display: inline-flex; align-items: center; justify-content: center; inline-size: 4rem; block-size: 4rem; margin-block-end: 0.75rem; color: var(--neutral-dark); background: var(--tint-slate); border-radius: 1rem; }
.drop-icon .icon { inline-size: 2rem; block-size: 2rem; }
.drop-sub { margin: 0; color: var(--muted); font-size: 0.9rem; }
.dropzone .hint { max-inline-size: 30rem; font-size: 0.85rem; }
.file-name { margin: 0.35rem 0 0; color: var(--primary); font-weight: 600; overflow-wrap: anywhere; }
.file-name:empty { display: none; }
.dropzone + .notice { margin-block-start: 0.85rem; }
.or-line { display: flex; align-items: center; gap: 0.75rem; margin-block: 1.5rem 1rem; color: var(--muted); font-size: 0.9rem; }
.or-line::before, .or-line::after { content: ""; flex: 1; block-size: 1px; background: var(--line); }
.verify-head { text-align: center; margin-block-end: 1.5rem; }
.verify-head .lead { max-inline-size: 36rem; margin-inline: auto; }
.status-line { margin-block: 0.75rem 0; color: var(--muted); text-align: center; }
.status-line:empty { display: none; }
.result:empty { display: none; }
.result { margin-block-start: 1.5rem; }
.result[aria-busy="true"] { display: block; }
.result[aria-busy="true"] > * { display: none; }
.result[aria-busy="true"]::before { content: ""; display: block; block-size: 10rem; border: 1px solid var(--line); border-radius: 1rem; background: linear-gradient(90deg, var(--tint-slate) 25%, var(--hover) 50%, var(--tint-slate) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.panel { overflow: hidden; margin-block: 0 1rem; background: var(--bg); border: 1px solid; border-radius: 1rem; box-shadow: var(--shadow-lg); }
.panel-band { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.5rem; border-block-end: 1px solid; }
.panel-band h2 { margin: 0; color: var(--fg); font-size: 1.25rem; }
.panel-band .lead { margin: 0.25rem 0 0; color: var(--fg); font-size: 0.95rem; font-weight: 500; }
.panel-title { flex: 1; min-inline-size: 12rem; padding-block-start: 0.6rem; }
.panel-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; inline-size: 3rem; block-size: 3rem; color: var(--on-dark); border-radius: 50%; }
.panel-icon .icon { inline-size: 1.5rem; block-size: 1.5rem; }
.panel-body { padding: 1.25rem 1.5rem 1.5rem; }
.panel-valid, .panel-valid_attested { border-color: var(--green); }
.panel-valid .panel-band, .panel-valid_attested .panel-band { background: var(--green-bg); border-color: var(--green); }
.panel-valid .panel-icon, .panel-valid_attested .panel-icon { background: var(--green); }
.panel-revoked, .panel-altered { border-color: var(--red); }
.panel-revoked .panel-band, .panel-altered .panel-band { background: var(--red-bg); border-color: var(--red); }
.panel-revoked .panel-icon, .panel-altered .panel-icon { background: var(--red); }
.panel-not_found, .panel-ledger_unavailable { border-color: var(--amber); }
.panel-not_found .panel-band, .panel-ledger_unavailable .panel-band { background: var(--amber-bg); border-color: var(--amber); }
.panel-not_found .panel-icon, .panel-ledger_unavailable .panel-icon { background: var(--amber); }
.panel-id_only, .panel-invalid, .panel-error-page { border-color: var(--primary); }
.panel-id_only .panel-band, .panel-invalid .panel-band, .panel-error-page .panel-band { background: var(--blue-bg); border-color: var(--line); }
.panel-id_only .panel-icon, .panel-invalid .panel-icon, .panel-error-page .panel-icon { background: var(--primary); }
.panel .facts { margin-block-end: 1rem; }
.panel-line { display: flex; align-items: center; gap: 0.6rem; margin-block: 0.75rem; padding: 0.7rem 0.9rem; border: 1px solid; border-radius: var(--radius); }
.panel-line span { color: var(--fg); font-weight: 600; }
.panel-line.panel-valid, .panel-line.panel-valid_attested { color: var(--green); background: var(--green-bg); }
.panel-line.panel-revoked, .panel-line.panel-altered { color: var(--red); background: var(--red-bg); }
.panel-line.panel-not_found, .panel-line.panel-ledger_unavailable { color: var(--amber); background: var(--amber-bg); }
.panel-line.panel-id_only { color: var(--blue); background: var(--blue-bg); }
.version { display: flex; align-items: center; gap: 0.5rem; margin-block: 0.4rem; color: var(--fg); font-weight: 600; }
.version .icon { color: var(--green); }
.meaning { display: grid; gap: 0.5rem; margin-block: 1rem; padding: 1rem 1.1rem; background: var(--surface); border-radius: var(--radius); }
.meaning p { margin: 0; }
.checked { color: var(--muted); font-size: 0.9rem; }
.sigcheck { margin-block-start: 1.25rem; padding-block-start: 1.25rem; border-block-start: 1px solid var(--line); }
.sigcheck h3 { margin-block-start: 0; }
.sigcheck .table-wrap { margin-block: 1rem; border: 1px solid var(--line); border-radius: var(--radius); }
.guide { margin-block: 1.5rem 0; padding: 1rem 1.25rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.guide summary::-webkit-details-marker { display: none; }
.guide summary { display: flex; align-items: center; gap: 0.5rem; min-block-size: 2.75rem; color: var(--primary); font-weight: 600; cursor: pointer; }
.guide dl { margin: 0.5rem 0 0; }
.guide dt { margin-block-start: 1rem; color: var(--fg); font-weight: 600; }
.guide dd { margin-inline-start: 0; color: var(--muted); }
.guide dd p { margin-block: 0.25rem; }
.compare { margin-block-start: 1.5rem; }
.compare h2 { margin-block-start: 0; }
.qr-id { text-align: center; color: var(--muted); }
.qr-id .mono { color: var(--primary); font-weight: 600; }

/* Back office */
.cat-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
.cat-grid .card { margin: 0; }
.card-head .badge { font-size: 0.8rem; }
.decide { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
select.select-sm { inline-size: auto; min-inline-size: 10rem; }
input.input-sm { inline-size: auto; min-inline-size: 11rem; }
::placeholder { color: var(--muted); opacity: 1; }
.decide form { padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* Error pages */
.error-card { max-inline-size: 40rem; margin: 1rem auto 2rem; text-align: center; }
.error-card .panel-icon { inline-size: 4rem; block-size: 4rem; margin-block-end: 1rem; background: var(--primary); }
.error-card .panel-icon .icon { inline-size: 2rem; block-size: 2rem; }
.error-card .actions, .error-card .page-links { justify-content: center; }
.error-card .page-links { margin-block: 1.25rem 0.75rem; }

/* Phones: links and buttons people tap get a 44px target. */
@media (max-width: 39.99rem) {
  .row-actions a, .pager a, .page-links a, .again a, .reload a, .back-link, .crumbs a, .public-nav a, .lang-opt, .link-button {
    display: inline-flex;
    align-items: center;
    min-block-size: 2.75rem;
  }
  .page { padding: 1.25rem 1rem 2.5rem; }
  .card { padding: 1.15rem; }
  .card-head { padding: 0.6rem 1.15rem; }
  .card > .card-head { margin: -1.15rem -1.15rem 1rem; }
  th, td { padding: 0.7rem 0.9rem; }
  .panel-band, .panel-body { padding-inline: 1.1rem; }
  .public-top { padding: 0.75rem 1rem; }
  .public-nav { margin-inline-start: 0; inline-size: 100%; }
  /* The sign-in card shows the brand itself, the hidden brand of the top bar gives its row back on phones. */
  body.auth .public-top .brand { display: none; }
  .public-main { padding-inline: 0.75rem; }
  .actions .button, .actions button, .action-strip .button, .action-strip button { inline-size: 100%; }
  .dropzone { padding: 1.75rem 1rem; }
  /* The action strip sits last in the main column and sticks to the bottom of the viewport while the column scrolls
   * by (sticky keeps its own place in the flow, so it never hides the end of the content). The safe area inset keeps
   * it clear of the home indicator, scroll-padding keeps a focused element from scrolling under it. */
  .detail-main { display: flex; flex-direction: column; }
  .action-strip { order: 1; position: sticky; inset-block-end: 0; z-index: 20; gap: 0.6rem; padding: 0.75rem 0.85rem calc(0.75rem + env(safe-area-inset-bottom, 0px)); border-inline-start-width: 1px; border-block-start: 3px solid var(--primary); box-shadow: var(--shadow-strip); }
  .action-strip .actions { gap: 0.6rem; }
  .action-strip .button, .action-strip button { min-inline-size: 0; }
  .action-strip .inline-form { inline-size: 100%; }
  .attest-later { padding: 0.6rem 0.75rem; }
  html:has(.action-strip) { scroll-padding-block-end: 10rem; }
  /* Lists: each row is a card of label and value pairs (the data-label of each cell), the header row stays for
   * assistive technology only. The roles in the markup keep the table semantics that display: block removes. */
  table.cards, table.cards tbody, table.cards tr { display: block; }
  table.wide.cards { min-inline-size: 0; }
  table.cards thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  table.cards tr { padding: 0.65rem 1rem; border-block-end: 1px solid var(--line); }
  table.cards tbody tr:last-child { border-block-end: 0; }
  /* Label in the first column, every part of the value in the second, so a long value wraps beside its label. */
  table.cards td, table.cards tbody th { display: grid; grid-template-columns: minmax(6.5rem, 34%) minmax(0, 1fr); align-items: baseline; gap: 0.25rem 0.75rem; padding: 0.3rem 0; text-align: start; border: 0; white-space: normal; }
  table.cards td > *, table.cards tbody th > * { grid-column: 2; justify-self: start; max-inline-size: 100%; }
  table.cards [data-label]::before { content: attr(data-label); grid-column: 1; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
  table.cards .id { max-inline-size: 100%; }
  table.cards .row-actions { gap: 0.25rem 1rem; }
  table.cards .row-actions a, table.cards .row-actions .inline-form { margin-inline-end: 0; }
  table.cards td.bar-cell { display: block; inline-size: auto; padding-block: 0.4rem 0.2rem; }
  table.cards .kv { min-inline-size: 0; }
  table.cards .inline-form { inline-size: 100%; }
  table.cards select.select-sm, table.cards input.input-sm, table.cards .inline-form .select-wrap { flex: 1 1 8rem; min-inline-size: 0; }
  table.cards .select-wrap select.select-sm { inline-size: 100%; }
  .head-actions { inline-size: 100%; }
  .head-actions .button { flex: 1 1 auto; }
  .chip { flex: 1 1 calc(50% - 0.6rem); }
}

@media (min-width: 40rem) {
  .facts div { grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .decide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64rem) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 75rem) {
  .detail-grid { grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem); }
  .new-grid { grid-template-columns: minmax(0, 1fr) minmax(20rem, 24rem); }
}

/* Tablets and phones: the sidebar becomes an off-canvas drawer, opened by the menu button (a label of the
 * nav-toggle checkbox, so it works without JavaScript), with an overlay that closes it. */
@media (max-width: 56.25rem) {
  .sidebar { inline-size: min(var(--sidebar), 86vw); transform: translateX(-100%); visibility: hidden; transition: transform 0.25s ease, visibility 0s linear 0.25s; }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  .nav-toggle:checked ~ .sidebar { transform: none; visibility: visible; transition: transform 0.25s ease; box-shadow: var(--shadow-lg); }
  .nav-toggle:checked ~ .overlay { display: block; position: fixed; inset: 0; z-index: 35; background: var(--overlay); cursor: pointer; }
  .app-main { margin-inline-start: 0; }
  .menu-button { display: inline-flex; }
  .topbar { padding-inline: 0.75rem; }
  .topbar-mark span { display: none; }
}

/* Wide screens: the sidebar is always there, so the drawer checkbox leaves the tab order. */
@media (min-width: 56.3125rem) {
  input[type="checkbox"].nav-toggle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Print: the content only, no navigation, forms or interactive parts, tables at full width. */
@media print {
  .sidebar, .topbar, .overlay, .nav-toggle, .public-top, .skip-link, .actions, .action-strip, form, .public-footer, .pager,
  .page-links, .again, .reload, .sigcheck, .guide, .copy, .menu-button, .crumbs, .head-actions { display: none !important; }
  html, body, body.public { background: none; }
  .app-main { margin: 0; }
  .card, .table-card, .panel, .big-card, .stat-card { box-shadow: none; break-inside: avoid; }
  .table-wrap { overflow: visible; }
  table.wide { min-inline-size: 0; }
  a { color: var(--fg); }
}
