/* =============================================================================
   Design tokens — IHM CAT
   Extracted verbatim from the approved prototype. Colour values are the brand
   identity and must not be changed without design approval.
   ========================================================================== */

:root {
  /* Navy — primary brand scale */
  --navy-950: #06101f;
  --navy-900: #0a2351;
  --navy-800: #102d63;
  --navy-700: #1a57a8;

  --brand: #0a2351;
  --brand-secondary: #1a57a8;
  --brand-accent: #2d7dd2;
  --brand-highlight: #7db8f0;
  --brand-light: #eef4fb;

  /* Silver — neutral scale */
  --silver-50: #f8fafc;
  --silver-100: #f1f5f9;
  --silver-200: #e2e8f0;
  --silver-300: #cbd5e1;
  --silver-400: #94a3b8;
  --silver-500: #64748b;
  --silver-600: #475569;
  --silver-700: #334155;
  --silver-800: #1e293b;
  --silver-900: #0f172a;

  /* Status scales */
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-600: #059669;
  --emerald-800: #065f46;

  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-600: #d97706;
  --amber-800: #92400e;

  /* Classification label colours (four-category system) */
  --label-relevant-bg: #fee2e2;
  --label-relevant-fg: #991b1b;
  --label-not-bg: var(--emerald-100);
  --label-not-fg: var(--emerald-800);
  --label-review-bg: var(--amber-100);
  --label-review-fg: var(--amber-800);
  --label-additional-bg: #fef08a;
  --label-additional-fg: #854d0e;

  --danger: #dc2626;

  /* Shape and depth */
  --radius: 14px;
  --shadow-card: 0 1px 3px rgba(10, 35, 81, 0.08), 0 8px 24px rgba(10, 35, 81, 0.06);
  --shadow-hover: 0 4px 12px rgba(10, 35, 81, 0.12), 0 16px 40px rgba(10, 35, 81, 0.1);

  /* Focus ring — WCAG 2.4.7 (focus visible). Deliberately high-contrast. */
  --focus-ring: 0 0 0 3px #fff, 0 0 0 6px var(--brand-accent);
  --focus-ring-dark: 0 0 0 3px var(--navy-950), 0 0 0 6px var(--brand-highlight);

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Spacing scale (Modification 19, phase 7, S0; task 3.7). Every new rule spaces with these steps. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 48px;

  /* Semantic colours of the signed-in pages (S0). The light values are today's colours; the dark set below
     redefines them. The public website does not use them and is never dark. */
  --surface-page: var(--silver-50);
  --surface-card: #fff;
  --surface-sunken: var(--silver-100);
  --surface-raised: #fff;
  --text-strong: var(--navy-900);
  --text-body: var(--silver-700);
  --text-muted: var(--silver-500);
  --text-link: var(--brand-secondary);
  --line: var(--silver-200);
  --line-soft: var(--silver-100);
  --line-strong: var(--silver-300);
  --band-bg: linear-gradient(
    135deg,
    var(--navy-950) 0%,
    var(--navy-900) 70%,
    var(--brand-secondary) 140%
  );
  --band-fg: #fff;
  --band-fg-muted: var(--silver-200);
  --table-head-bg: var(--silver-100);
  --table-head-fg: var(--silver-600);

  /* Status colours (task 3.7): green done or nothing needed, amber needs the user, red a problem, blue in progress. */
  --ok-bg: var(--emerald-50);
  --ok-fg: var(--emerald-800);
  --ok-line: #a7f3d0;
  --warn-bg: var(--amber-50);
  --warn-fg: var(--amber-800);
  --warn-line: #fcd34d;
  --bad-bg: #fef2f2;
  --bad-fg: #991b1b;
  --bad-line: #fca5a5;
  --busy-bg: var(--brand-light);
  --busy-fg: var(--navy-700);
  --busy-line: #bfdbfe;

  --radius-sm: 8px;
  --shadow-pop: 0 6px 24px rgba(10, 35, 81, 0.16);
}

/* The dark token set (task 9.1, built in S0). `theme.ts` sets `data-theme="dark"` on the signed-in pages only. The
   neutral scale turns over (light text on dark ground), the brand navy stays for the title band, and the semantic
   colours follow. */
html[data-theme='dark'] {
  color-scheme: dark;
  --silver-50: #0f1726;
  --silver-100: #162033;
  --silver-200: #24314a;
  --silver-300: #34435f;
  --silver-400: #6b7a94;
  --silver-500: #94a3b8;
  --silver-600: #b4c0d2;
  --silver-700: #cbd5e1;
  --silver-800: #e2e8f0;
  --silver-900: #f1f5f9;
  --brand-light: #13264a;

  --surface-page: #0b1220;
  --surface-card: #121b2c;
  --surface-sunken: #0f1726;
  --surface-raised: #182338;
  --text-strong: #eef3fa;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --text-link: #8cc2f5;
  --line: #24314a;
  --line-soft: #1b263b;
  --line-strong: #34435f;
  --band-bg: linear-gradient(135deg, #050c18 0%, #0a1d42 70%, #123f7c 140%);
  /* Queue Q13: stated here, not through --silver-200, which this set turns dark (#24314a): the band's small labels
     were dark on dark (1.3:1). #c3d0e3 is at least 6.6:1 on every part of the dark band. */
  --band-fg: #fff;
  --band-fg-muted: #c3d0e3;
  --table-head-bg: #162033;
  --table-head-fg: #b4c0d2;

  --ok-bg: #0d2a20;
  --ok-fg: #86efac;
  --ok-line: #166534;
  --warn-bg: #2d2109;
  --warn-fg: #fcd34d;
  --warn-line: #92400e;
  --bad-bg: #2f1214;
  --bad-fg: #fca5a5;
  --bad-line: #991b1b;
  --busy-bg: #11233f;
  --busy-fg: #93c5fd;
  --busy-line: #1e40af;

  --emerald-50: #0d2a20;
  --emerald-100: #11392b;
  --emerald-800: #86efac;
  --amber-50: #2d2109;
  --amber-100: #3a2a0b;
  --amber-800: #fcd34d;
  --label-relevant-bg: #3b1518;
  --label-relevant-fg: #fca5a5;
  --label-additional-bg: #3a330b;
  --label-additional-fg: #fde68a;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 8px 28px rgba(0, 0, 0, 0.55);
  --focus-ring: 0 0 0 3px #0b1220, 0 0 0 6px var(--brand-highlight);
}

/* Layout 9.5 and 9.7: the four category colours of the Result Excel File, for the Result view's badges. */
:root {
  --cat-relevant-fg: #9c0006;
  --cat-relevant-bg: #ffc7ce;
  --cat-not-relevant-fg: #006100;
  --cat-not-relevant-bg: #c6efce;
  /* Review F8: darker than the file's #9c6500, so the 12px badge text reaches 4.5:1 on #ffeb9c. */
  --cat-additional-fg: #7a4f00;
  --cat-additional-bg: #ffeb9c;
  --cat-human-review-fg: #3f3f76;
  --cat-human-review-bg: #ffcc99;
  --cat-duplicate-fg: #0077a8;
}

html[data-theme='dark'] {
  --cat-relevant-fg: #ffb3bb;
  --cat-relevant-bg: #4a1419;
  --cat-not-relevant-fg: #a8e6b4;
  --cat-not-relevant-bg: #133a1d;
  --cat-additional-fg: #ffe08a;
  --cat-additional-bg: #3d2f08;
  --cat-human-review-fg: #d6d6ff;
  --cat-human-review-bg: #4a3220;
  --cat-duplicate-fg: #5cc8f0;
}

/* =============================================================================
   Base — reset, typography, containers, accessibility primitives
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--silver-700);
  line-height: 1.6;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  color: var(--navy-900);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
}

a {
  color: var(--brand-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

/* -----------------------------------------------------------------------------
   Keyboard focus.

   The prototype had no visible focus states, which fails WCAG 2.4.7 and makes
   the site unusable by keyboard. `:focus-visible` shows the ring for keyboard
   users without putting a ring on every mouse click.
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 6px;
}

/* On dark backgrounds the white inner ring would disappear. */
.hero :focus-visible,
footer :focus-visible,
.stats :focus-visible {
  box-shadow: var(--focus-ring-dark);
}

/* -----------------------------------------------------------------------------
   `hidden` means hidden.

   The browser's own `[hidden] { display: none }` sits in the user-agent
   stylesheet, so ANY author rule that sets `display` beats it — `.btn` declares
   `display: inline-flex`, which means a button with the `hidden` attribute was
   still on screen and still clickable. Found on the enquiries screen, where
   "Reopen enquiry" appeared next to "Close enquiry" on an open enquiry and
   offered an action the server would refuse.

   `!important` because the whole point is to win against a component's own
   `display`. Anything that needs to be laid out must not be marked `hidden`.
   -------------------------------------------------------------------------- */
[hidden] {
  display: none !important;
}

/* -----------------------------------------------------------------------------
   Screen-reader-only text and the skip link.
   -------------------------------------------------------------------------- */
.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: -100px;
  z-index: 200;
  background: var(--navy-900);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  font-size: 14px;
  transition: top 0.15s ease-in-out;
}

.skip-link:focus {
  top: 0;
  text-decoration: none;
}

/* -----------------------------------------------------------------------------
   Reduced motion.

   The page uses smooth scrolling, hover transforms and a fade animation. Honour
   the user's system preference — vestibular motion disorders are a real
   accessibility concern (WCAG 2.3.3).
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Spacing helpers retained from the prototype. */
.mt-s {
  margin-top: 18px;
}
.mt-m {
  margin-top: 28px;
}
.mt-l {
  margin-top: 40px;
}

.prose p {
  margin-bottom: 14px;
}
/* `h2.h-as-h3` is a heading promoted from h3 to close a gap in the document
   outline. It must keep the size and spacing it had — see components.css. */
.prose h3,
.prose h2.h-as-h3 {
  margin: 22px 0 8px;
  font-size: 18px;
}
/* Terms of service uses ordered lists where the numbering is part of the
   meaning: the contract-formation steps and the order of precedence. */
.prose ul,
.prose ol {
  margin: 0 0 14px 20px;
}
.prose li {
  margin-bottom: 7px;
}

/* Marks unresolved legal text awaiting counsel — see docs/LEGAL_CONTENT_REVIEW.md */
.placeholder {
  color: #b45309;
  background: #fffbeb;
  padding: 0 4px;
  border-radius: 3px;
  font-style: italic;
  font-size: 0.95em;
}

/* =============================================================================
   Layout — header, navigation, hero, sections, stats, footer
   ========================================================================== */

/* -----------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--silver-200);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo:hover {
  text-decoration: none;
}

.logo-mark {
  height: 44px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.logo-name {
  font-weight: 800;
  font-size: 16px;
  color: var(--navy-900);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 2px;
  align-items: center;
  list-style: none;
}

.nav-links-wrap {
  min-width: 0;
}

.nav-links a {
  display: block;
  color: var(--silver-600);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 9px;
  border-radius: 8px;
  transition: 0.15s;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--navy-900);
  background: var(--silver-100);
  text-decoration: none;
}

/* aria-current="page" is the accessible source of truth; the class is cosmetic. */
.nav-links a[aria-current='page'] {
  color: var(--brand-secondary);
  background: var(--brand-light);
}

/* -----------------------------------------------------------------------------
   The `More` group — administrator-created pages.

   A disclosure, not a hover menu. There is deliberately no `:hover` rule that
   opens it: a hover menu cannot be opened from a keyboard and cannot be opened
   at all by touch. `<details open>` is the only thing that shows the list, and
   that state comes from a click, from Enter or Space, or from the script.

   The panel is absolutely positioned so opening it cannot push the header wider
   and cannot introduce a horizontal scrollbar. `right: 0` anchors it to the end
   of the row, which is where the group sits.
   -------------------------------------------------------------------------- */
.nav-more {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-more-disclosure > summary {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  list-style: none;
  color: var(--silver-600);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 9px;
  border-radius: 8px;
  transition: 0.15s;
  white-space: nowrap;
}

.nav-more-disclosure > summary::-webkit-details-marker {
  display: none;
}

.nav-more-disclosure > summary:hover,
.nav-more-disclosure[open] > summary {
  color: var(--navy-900);
  background: var(--silver-100);
}

.nav-more-disclosure > summary:focus-visible {
  outline: 2px solid var(--brand-secondary);
  outline-offset: 2px;
}

.nav-more-disclosure[data-current='true'] > summary {
  color: var(--brand-secondary);
  background: var(--brand-light);
}

.nav-more-disclosure[open] > summary span {
  transform: rotate(180deg);
}

.nav-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--silver-200);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 27, 45, 0.12);
  padding: 6px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-more-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--silver-700);
  font-size: 13.5px;
  white-space: normal;
}

.nav-more-menu a:hover {
  background: var(--silver-100);
  color: var(--navy-900);
  text-decoration: none;
}

.nav-more-menu a[aria-current='page'] {
  color: var(--brand-secondary);
  background: var(--brand-light);
}

/* Inside the mobile menu the group is part of the column, so the panel is in
   the flow rather than floating over it. */
.nav-more-mobile {
  display: block;
}

.nav-more-mobile .nav-more-disclosure > summary {
  padding: 10px 12px;
  font-size: 14.5px;
  color: var(--silver-700);
  justify-content: space-between;
}

.nav-more-mobile .nav-more-menu {
  position: static;
  border: none;
  box-shadow: none;
  padding: 2px 0 2px 12px;
  min-width: 0;
  max-width: none;
  background: transparent;
}

.nav-cta {
  display: flex;
  gap: 8px;
  align-items: center;
  /* Never squeezed out by a long link row: sign out must always be reachable. */
  flex: none;
}

.nav-cta .btn {
  padding: 9px 15px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--navy-900);
}

.menu-toggle svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  display: block;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
  border-top: 1px solid var(--silver-200);
  list-style: none;
}

.mobile-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--silver-700);
  font-size: 14.5px;
}

.mobile-menu a:hover {
  background: var(--silver-100);
  text-decoration: none;
}

.mobile-menu.is-open {
  display: flex;
}

/* -----------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section {
  padding: 72px 0;
}
.section-sm {
  padding: 48px 0;
}
.bg-white {
  background: #fff;
}
.bg-silver {
  background: var(--silver-50);
}
.bg-light {
  background: var(--brand-light);
}

.sec-head {
  max-width: 680px;
  margin-bottom: 14px;
}
.sec-head.center {
  margin: 0 auto 14px;
  text-align: center;
}
.sec-head h2 {
  font-size: clamp(24px, 3.5vw, 34px);
}
.sec-head p {
  margin-top: 14px;
  color: var(--silver-600);
  font-size: 16px;
}

/* -----------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  background: linear-gradient(
    135deg,
    var(--navy-950) 0%,
    var(--navy-900) 55%,
    var(--brand-secondary) 130%
  );
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  right: -120px;
  top: -120px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 80px rgba(255, 255, 255, 0.03),
    0 0 0 160px rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.hero .container,
.hero .container-narrow {
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: #fff;
  font-size: clamp(30px, 5vw, 54px);
}

.hero p.lead {
  color: var(--silver-300);
  font-size: clamp(16px, 2vw, 20px);
  margin-top: 18px;
  max-width: 640px;
}

.hero-pad {
  padding: 84px 24px;
}
.hero-pad-sm {
  padding: 60px 24px;
}

.highlight {
  color: var(--brand-highlight);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 44px;
}

.hero-text {
  min-width: 0;
  max-width: 660px;
}

.hero-logo img {
  width: 340px;
  max-width: 34vw;
  height: auto;
  display: block;
  background: #fff;
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.33);
}

.hero-note {
  color: var(--silver-400);
  font-size: 12.5px;
  margin-top: 18px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

/* -----------------------------------------------------------------------------
   Stats bar
   -------------------------------------------------------------------------- */
.stats {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(6, 16, 31, 0.5);
}

.stats .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding-top: 22px;
  padding-bottom: 22px;
}

.stat {
  text-align: center;
}
.stat b {
  display: block;
  font-size: 26px;
  color: #fff;
  font-weight: 800;
}
.stat span {
  display: block;
  font-size: 11.5px;
  color: var(--silver-400);
  margin-top: 2px;
}
.stat em {
  display: block;
  font-size: 11px;
  color: var(--silver-500);
  font-style: normal;
}

/* -----------------------------------------------------------------------------
   Grid helpers
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: 22px;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* -----------------------------------------------------------------------------
   Server-rendered listings

   The news and resource listings come from the database, so the number of
   cards is not known when this stylesheet is written. `auto-fill` with a
   minimum track width lets the row decide for itself, which is what the fixed
   .grid-2/3/4 helpers cannot do.

   These were used by the news listing before they existed here, which meant the
   cards stacked as plain blocks and the pager had no layout. Found while
   building the resources listing on the same shell.
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
  font-size: 13px;
  color: var(--silver-600);
}

/* -----------------------------------------------------------------------------
   CTA strip
   -------------------------------------------------------------------------- */
.cta-strip {
  background: var(--brand-light);
  border-top: 1px solid var(--silver-200);
  border-bottom: 1px solid var(--silver-200);
}

.cta-strip .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 36px;
  padding-bottom: 36px;
}

/* -----------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--navy-950);
  color: #c6d4e7;
  padding: clamp(52px, 6vw, 72px) 0 28px;
}

/* A stable brand column and a separate horizontal navigation grid. The
   optional CMS-managed group joins the inner grid without pushing one lonely
   column onto a new desktop row. */
.foot-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) repeat(auto-fit, minmax(150px, 1fr));
  align-items: start;
  gap: clamp(32px, 4vw, 56px);
  margin-bottom: 44px;
}

/* Current builds wrap the link groups in a semantic navigation region. Keep
   the direct-child fallback above until every long-running server image has
   been rebuilt with the shared renderer. */
.foot-grid:has(> .foot-navigation) {
  grid-template-columns: minmax(260px, 1.15fr) minmax(0, 2.85fr);
  gap: clamp(48px, 7vw, 96px);
}

.foot-navigation {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 32px clamp(28px, 4vw, 56px);
  min-width: 0;
}

.site-footer h2 {
  color: #f8fbff;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 18px;
}

.foot-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;
}

.foot-links a {
  color: #dbe7f6;
  font-size: 14px;
  line-height: 1.5;
  text-decoration-color: transparent;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition:
    color 160ms ease,
    text-decoration-color 160ms ease;
}

.foot-links a:hover,
.foot-links a:focus-visible {
  color: #fff;
  text-decoration-line: underline;
  text-decoration-color: #69a7ff;
}

.foot-brand p {
  font-size: 14px;
  line-height: 1.65;
  color: #c6d4e7;
  margin-top: 16px;
  max-width: 340px;
}

.foot-logo-chip {
  display: inline-flex;
  background: #fff;
  border-radius: 12px;
  padding: 6px 8px;
  flex-shrink: 0;
}

.foot-logo-chip img {
  height: 44px;
  width: auto;
  display: block;
}

.foot-brand .foot-ai {
  font-size: 12.5px;
  color: #d6e2f0;
  background: rgba(125, 184, 240, 0.08);
  border: 1px solid rgba(125, 184, 240, 0.28);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 20px;
  max-width: 340px;
}

.foot-bottom {
  border-top: 1px solid rgba(185, 211, 239, 0.18);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  line-height: 1.5;
  color: #adbed4;
}

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

   The navigation needs ~1120px for its full desktop layout, so it collapses to
   the hamburger EARLIER than the content grids, which only need to stack below
   880px. Using one breakpoint for both caused the header to overflow.
   -------------------------------------------------------------------------- */
@media (max-width: 1120px) {
  .nav-links,
  .nav-cta .btn-ghost {
    display: none;
  }

  .menu-toggle {
    display: block;
  }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-logo {
    display: none;
  }
}

@media (max-width: 880px) {
  .grid-2,
  .grid-3,
  .grid-4,
  .stats .container,
  .cta-strip .container {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .foot-grid,
  .foot-grid:has(> .foot-navigation) {
    grid-template-columns: minmax(0, 1fr);
    gap: 38px;
  }

  .foot-brand p,
  .foot-brand .foot-ai {
    max-width: 620px;
  }

  .foot-navigation {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats .container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .logo-name {
    display: none;
  }

  .nav-cta .btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* One column at 375px keeps long legal and CMS-managed labels readable
     without pushing the page sideways. */
  .foot-navigation {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .foot-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* =============================================================================
   Components — buttons, badges, cards, labels, notices, steps, tables, forms,
   FAQ disclosure, output rows
   ========================================================================== */

/* -----------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: var(--fs-text, 14px);
  font-family: inherit;
  padding: 10px 18px;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--brand-secondary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(10, 35, 81, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: var(--navy-800);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #fff;
  color: var(--navy-900);
  border-color: var(--silver-300);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--brand-accent);
  color: var(--brand-secondary);
}

.btn-ghost {
  background: transparent;
  color: var(--silver-600);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--navy-900);
  background: var(--silver-100);
}

.btn-outline-white {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline-white:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

/* -----------------------------------------------------------------------------
   Badges and pills
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-small, 11.5px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-secondary);
  margin-bottom: 16px;
}

.badge-light {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-600);
}

.pill {
  display: inline-block;
  font-size: var(--fs-small, 11px);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.pill-em {
  background: var(--emerald-100);
  color: var(--emerald-800);
}
.pill-am {
  background: var(--amber-100);
  color: var(--amber-800);
}

/* -----------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  background: #fff;
  border: 1px solid var(--silver-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: 0.2s;
  padding: 26px;
}

.card-hover:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--silver-300);
}

.card-icon {
  font-size: 30px;
  line-height: 1;
  display: block;
}

/* -----------------------------------------------------------------------------
   Classification labels — the four-category output system.
   Colour alone must never carry the meaning (WCAG 1.4.1), so the label always
   contains its text.
   -------------------------------------------------------------------------- */
.label {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-small, 11px);
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 5px 11px;
  border-radius: 7px;
  white-space: nowrap;
}

.label-relevant {
  background: var(--label-relevant-bg);
  color: var(--label-relevant-fg);
}
.label-not {
  background: var(--label-not-bg);
  color: var(--label-not-fg);
}
.label-review {
  background: var(--label-review-bg);
  color: var(--label-review-fg);
}
.label-additional {
  background: var(--label-additional-bg);
  color: var(--label-additional-fg);
}

/* -----------------------------------------------------------------------------
   Notices
   -------------------------------------------------------------------------- */
.notice {
  border-radius: 11px;
  padding: 16px 18px;
  font-size: var(--fs-text, 13.5px);
  line-height: 1.6;
}

.notice-info {
  background: var(--brand-light);
  border: 1px solid #cfe0f5;
  color: var(--navy-800);
}

.notice-ai {
  background: var(--silver-100);
  border: 1px dashed var(--silver-400);
  color: var(--silver-600);
  font-size: var(--fs-text, 13px);
}

.notice-legal {
  background: var(--amber-50);
  border: 1px solid var(--amber-100);
  color: var(--amber-800);
}

.notice-legal strong {
  color: #7c2d12;
}

.notice-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Dark theme: the refusal box follows the dark tokens (it stayed light, red text on a pale ground). */
html[data-theme='dark'] .notice-error {
  background: var(--bad-bg);
  border-color: var(--bad-line);
  color: var(--bad-fg);
}

.notice-success {
  background: var(--emerald-50);
  border: 1px solid var(--emerald-100);
  color: var(--emerald-800);
}

/* -----------------------------------------------------------------------------
   Check lists
   -------------------------------------------------------------------------- */
.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 8px;
}

.check-list li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: var(--fs-text, 14.5px);
  color: var(--silver-700);
}

.check-ico {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--emerald-100);
  color: var(--emerald-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  margin-top: 1px;
}

/* -----------------------------------------------------------------------------
   Process steps
   -------------------------------------------------------------------------- */
.step {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.step-num {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--navy-900);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  box-shadow: var(--shadow-card);
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-phase {
  font-size: var(--fs-small, 11px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-secondary);
}

.step-body h3,
.step-body h2.h-as-h3 {
  font-size: 18px;
  margin-top: 3px;
}

.step-detail {
  margin-top: 13px;
  background: var(--silver-50);
  border: 1px solid var(--silver-200);
  border-radius: 10px;
  padding: 13px 15px;
  font-size: var(--fs-text, 13.5px);
  color: var(--silver-600);
}

/* -----------------------------------------------------------------------------
   Tables. Wide tables scroll inside their own container so the page body never
   scrolls horizontally.
   -------------------------------------------------------------------------- */
.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-text, 13.5px);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

thead tr {
  background: var(--navy-900);
  color: #fff;
}

th {
  text-align: left;
  padding: 14px 18px;
  font-weight: 600;
  font-size: var(--fs-text, 13px);
}

td {
  padding: 13px 18px;
  border-top: 1px solid var(--silver-100);
  color: var(--silver-700);
}

tbody tr:nth-child(even) {
  background: var(--silver-50);
}

td.aspect {
  font-weight: 700;
  color: var(--navy-800);
}

/* -----------------------------------------------------------------------------
   Illustrative output rows
   -------------------------------------------------------------------------- */
.out-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  border-radius: 9px;
  background: var(--silver-50);
  border: 1px solid var(--silver-100);
  margin-bottom: 9px;
}

.out-row .meta {
  min-width: 0;
}

.out-row .meta b {
  display: block;
  font-size: var(--fs-hint, 12.5px);
  color: var(--navy-800);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.out-row .meta span {
  font-size: var(--fs-small, 11.5px);
  color: var(--silver-500);
}

/* -----------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.flbl {
  font-size: var(--fs-text, 13px);
  font-weight: 600;
  color: var(--navy-800);
}

.flbl .req {
  color: var(--danger);
}

.input,
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--silver-300);
  border-radius: 9px;
  font-size: var(--fs-text, 14px);
  font-family: inherit;
  color: var(--silver-800);
  background: #fff;
  transition: 0.15s;
}

.input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(45, 125, 210, 0.12);
}

/* 6.8.3a, section 1f (point 51, WCAG 2.4.7 / 1.4.11): the 12 % halo above was the only focus mark of a field, and in
   the night view nothing showed. From the keyboard a field shows the theme's focus ring (`--focus-ring`: a ring of the
   page colour, then the accent, at least 3:1 in both themes, tokens.css). */
.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  /* Section 1g (point 65): forced-colours mode draws no shadow; it draws this outline in its own colour. */
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

/* Invalid fields are marked with aria-invalid, so style from that attribute —
   the visual state and the accessible state can then never disagree. */
.input[aria-invalid='true'],
select[aria-invalid='true'],
textarea[aria-invalid='true'] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

textarea {
  resize: vertical;
  min-height: 96px;
}

.hint {
  font-size: var(--fs-hint, 12px);
  color: var(--silver-500);
}

.field-error {
  font-size: var(--fs-hint, 12px);
  color: var(--danger);
  font-weight: 500;
}

/* -----------------------------------------------------------------------------
   The form rule (P5-16; `scripts/app/form-rule.ts`).

   A file field, a tick box and a radio button are marked too. They have no
   border of their own to colour, so their mark is an outline around the
   control, in the same red and read from the same attribute.
   -------------------------------------------------------------------------- */
input[type='file'][aria-invalid='true'],
input[type='checkbox'][aria-invalid='true'],
input[type='radio'][aria-invalid='true'] {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
  border-radius: 4px;
}

/* A message the rule put under a field whose page ships no slot for it. The red
   of `--danger` on white is 4.83:1, above the 4.5:1 that WCAG AA asks of text
   this size. */
.field-error[data-field-error] {
  margin: 6px 0 0;
}

/* The answer under the button pressed: one live line for a row of buttons or
   for a card. It is found by its attribute, because the line's classes are the
   notice's tone and change with every answer. */
[data-answer] {
  margin: 12px 0 0;
}

/* -----------------------------------------------------------------------------
   Headings promoted from h3 to h2.

   Six pages went straight from h1 to h3, which leaves a hole in the document
   outline: someone navigating by heading hears a level that has no parent. The
   sections were always peers, so they are h2 now.

   The LEVEL is what assistive technology announces; the SIZE is what everyone
   else sees, and that must not move. `1.17em` is the browser's default h3 size,
   which is what these headings rendered at before — the stylesheet sets colour,
   weight and spacing for headings but no per-level size. Any inline size on an
   individual heading still wins, as it did.
   -------------------------------------------------------------------------- */
.h-as-h3 {
  font-size: 1.17em;
}

.chk {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: var(--fs-text, 13px);
  color: var(--silver-600);
}

.chk input {
  margin-top: 3px;
  flex-shrink: 0;
}

/* Honeypot. Hidden from people, reachable by naive bots. `display:none` is
   avoided because some bots skip such fields; this keeps it off-screen instead. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* -----------------------------------------------------------------------------
   Contact page: details card beside the form.

   `minmax(0, …)` on both tracks rather than the bare `1fr 2fr` this replaced.
   A default `1fr` track is `minmax(auto, 1fr)`, whose floor is the content's
   own minimum width — so a long unbroken string such as an email address can
   push a track wider than its share and take the page with it.
   -------------------------------------------------------------------------- */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 40px;
  align-items: start;
}

@media (max-width: 880px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* One column, and the details card first — a visitor on a phone should be
     able to call or email without scrolling past the whole form. */
  .contact-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

/* -----------------------------------------------------------------------------
   FAQ disclosure.

   Built on <button> + hidden panel so it is keyboard operable and announced
   correctly. The prototype used a div with an onclick handler, which was
   unreachable by keyboard.
   -------------------------------------------------------------------------- */
.faq-item {
  border: 1px solid var(--silver-200);
  border-radius: 11px;
  margin-bottom: 12px;
  overflow: hidden;
  background: #fff;
}

.faq-q {
  width: 100%;
  padding: 16px 20px;
  font-weight: 600;
  font-family: inherit;
  color: var(--navy-900);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  font-size: var(--fs-text, 14.5px);
  text-align: left;
  background: none;
  border: none;
}

.faq-q:hover {
  background: var(--silver-50);
}

.faq-q .tw {
  flex-shrink: 0;
  transition: 0.2s;
  color: var(--brand-secondary);
  font-size: 20px;
  line-height: 1;
}

.faq-q[aria-expanded='true'] .tw {
  transform: rotate(45deg);
}

.faq-a {
  padding: 0 20px 18px;
  color: var(--silver-600);
  font-size: var(--fs-text, 14px);
}

.faq-a[hidden] {
  display: none;
}

/* --------------------------------------------------- legal page helpers ----
   Used by the privacy policy. These have no prototype counterpart: that page
   was owner-supplied boilerplate carved into the site later, so the styling
   below follows the existing design system rather than copying anything.

   Both classes were referenced in the markup and defined nowhere, so the
   table of contents rendered as an unstyled bullet list and the statutory
   references were indistinguishable from body copy. */

/* Table of contents for a long legal document. `.privacy-toc` came first and is
   kept so the privacy page is untouched; `.legal-toc` is the same treatment
   under a name that does not claim to belong to one page. */
.privacy-toc,
.legal-toc {
  background: var(--silver-50);
  border: 1px solid var(--silver-200);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 32px;
}

.privacy-toc h2,
.legal-toc h2 {
  font-size: 16px;
  margin-bottom: 12px;
}

.privacy-toc ul,
.legal-toc ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 4px 28px;
}

.privacy-toc li,
.legal-toc li {
  font-size: var(--fs-text, 13.5px);
  line-height: 1.7;
}

.privacy-toc a,
.legal-toc a {
  color: var(--silver-700);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.privacy-toc a:hover,
.legal-toc a:hover {
  color: var(--brand-secondary);
  border-bottom-color: var(--brand-secondary);
}

/* Legal boilerplate quotes third-party policy URLs in full, and a bare URL is
   one unbreakable token. At 390px the longest is 408px wide and pushed the
   whole page sideways — a horizontal scrollbar on the privacy policy.
   Pre-existing in the owner-supplied text; fixed here rather than by rewording,
   because that copy is authoritative (docs/DECISIONS.md D-005). */
.prose a,
.prose p,
.prose li {
  overflow-wrap: anywhere;
}

/* Statutory citations sitting under a heading. Set apart from the body copy
   they qualify, without becoming a heading themselves. */
.legal-reference {
  font-size: var(--fs-hint, 12.5px);
  color: var(--silver-500);
  font-style: italic;
  margin-top: -2px;
  margin-bottom: 6px;
}

@media (max-width: 880px) {
  .privacy-toc,
  .legal-toc {
    padding: 18px 20px;
  }
  .privacy-toc ul,
  .legal-toc ul {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Layout 9.5: the Result view on both request pages (`result-items-view.ts`) ---------------------------------- */
.result-items-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.result-items-search {
  display: flex;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
}

.result-items-search input {
  flex: 1 1 auto;
  max-width: 360px;
}

.result-items-table td {
  vertical-align: top;
}

.result-items-table .result-item-no,
.result-items-table .result-confidence {
  text-align: center;
  white-space: nowrap;
}

.result-confidence small {
  display: block;
}

.result-badge {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 99px;
  font-size: var(--fs-hint, 12px);
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface-sunken);
  color: var(--text-body);
}

.result-badge[data-category='relevant'] {
  background: var(--cat-relevant-bg);
  color: var(--cat-relevant-fg);
}

.result-badge[data-category='not-relevant'] {
  background: var(--cat-not-relevant-bg);
  color: var(--cat-not-relevant-fg);
}

.result-badge[data-category='additional'] {
  background: var(--cat-additional-bg);
  color: var(--cat-additional-fg);
}

.result-badge[data-category='human-review'] {
  background: var(--cat-human-review-bg);
  color: var(--cat-human-review-fg);
}

/* Release 6.7, point 12: an item released as "To be assessed" is marked in the warn colours of both themes. */
.result-badge[data-category='to-be-assessed'] {
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.result-duplicate {
  text-align: center;
  color: var(--cat-duplicate-fg);
}

/* Review F3: the file's line breaks are kept; the clamp holds only where "Show more" is (`data-clamped`). */
.result-reasoning {
  margin: 0;
  white-space: pre-line;
}

[data-clamped] > .result-reasoning {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

[data-clamped][data-open] > .result-reasoning {
  display: block;
  -webkit-line-clamp: unset;
}

.result-more {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-accent);
  font: inherit;
  font-size: var(--fs-hint, 12.5px);
  cursor: pointer;
  text-decoration: underline;
}

.result-items-pager {
  align-items: center;
  gap: var(--space-2);
}

/* Release 6.8 points 26 and 29 (review F14): the internal-archive parts. Colours come from the tokens, so the dark
   theme follows. The mark is a neutral outlined pill, not the green of an On status. */
.pill.ia {
  background: var(--surface-sunken);
  color: var(--text-strong);
  border: 1px solid var(--line-strong);
  font-weight: 600;
  white-space: normal;
}
.ia-row-option {
  display: block;
  margin-top: var(--space-1, 4px);
  font-size: var(--fs-text, 13px);
  color: var(--text-body);
}
[data-ia-conflict] .two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3, 12px);
  margin: var(--space-2, 8px) 0;
}
@media (max-width: 1366px) {
  [data-ia-conflict] .two {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   Signed-in screens — portal and administrator
   Reuses the public design system; adds only what the application needs.
   ========================================================================== */

.app-main {
  min-height: 70vh;
  background: var(--silver-50);
  padding-bottom: 64px;
}

.app-head {
  background: linear-gradient(
    135deg,
    var(--navy-950) 0%,
    var(--navy-900) 70%,
    var(--brand-secondary) 140%
  );
  color: #fff;
  padding: 36px 0 30px;
}

.app-head h1 {
  color: #fff;
  font-size: clamp(24px, 3.5vw, 34px);
}

.app-lead {
  color: var(--silver-300);
  margin-top: 8px;
  max-width: 620px;
}

.app-main > .container > [data-status],
.app-main [data-status] {
  margin: 20px auto 0;
}

/* -----------------------------------------------------------------------------
   Administrator sign-in — the isolated shell on admin.ihm-cat.com

   One centred panel and nothing else. There is no site navigation, no footer,
   no registration link and no route back to the company portal on this page,
   because that host serves none of them. The panel keeps the product's own
   colours and type so an administrator can see at a glance that they are on the
   right system.

   Sized in `clamp()` and capped by `max-width`, so the same markup is a centred
   card at 1280px and a full-width panel at 375px with no horizontal overflow
   and no separate mobile layout to maintain.
   -------------------------------------------------------------------------- */
/* The shared `.app-main` reserves space under the signed-in screens' content.
   This page centres itself in the viewport instead, and that 64px would put the
   panel permanently off-centre and add a scrollbar to a page that fits. */
[data-shell='admin-auth'] .app-main {
  padding-bottom: 0;
}

.auth-panel-wrap {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  /* 68px is the header above it, so the panel is centred in what is left. */
  min-height: calc(100vh - 68px);
  padding: clamp(24px, 6vw, 72px) 20px;
}

.auth-panel {
  background: #fff;
  border: 1px solid var(--silver-200);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  max-width: 460px;
  overflow: hidden;
  width: 100%;
}

.auth-panel-head {
  background: linear-gradient(
    135deg,
    var(--navy-950) 0%,
    var(--navy-900) 70%,
    var(--brand-secondary) 140%
  );
  color: #fff;
  padding: 28px clamp(20px, 5vw, 30px) 26px;
}

.auth-panel-head h1 {
  color: #fff;
  font-size: clamp(21px, 4vw, 26px);
  margin: 0;
}

.auth-lead {
  color: var(--silver-300);
  font-size: var(--fs-text, 14.5px);
  line-height: 1.55;
  margin-top: 10px;
}

.auth-panel-body {
  padding: 26px clamp(20px, 5vw, 30px) 30px;
}

/* The header is the product mark alone: no navigation, nothing to space it
   against, so it sits at the start rather than being pushed apart. */
.app-header-admin-auth .app-topbar {
  justify-content: flex-start;
}

/* Signed-in application header. The area and the person are separate facts. */
.app-topbar {
  height: 68px;
}

.app-area-name {
  border-left: 1px solid var(--silver-300);
  color: var(--navy-700);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  margin-left: 4px;
  padding: 5px 0 5px 14px;
  white-space: nowrap;
}

.app-header-nav {
  border-top: 1px solid var(--silver-200);
}

.app-nav-links {
  gap: 8px;
  padding: 7px 0 8px;
  width: 100%;
}

.app-header-admin .app-nav-links {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.app-nav-direct > a,
.app-nav-group summary {
  border-radius: 8px;
  color: var(--silver-600);
  cursor: pointer;
  display: flex;
  font-size: var(--fs-nav, 13px);
  font-weight: 600;
  justify-content: center;
  padding: 8px 12px;
  text-align: center;
  user-select: none;
}

.app-nav-direct > a:hover,
.app-nav-group summary:hover,
.app-nav-group details[open] > summary {
  background: var(--silver-100);
  color: var(--navy-900);
  text-decoration: none;
}

.app-nav-direct > a[aria-current='page'],
.app-nav-group details[data-current='true'] > summary {
  background: var(--brand-light);
  color: var(--brand-secondary);
}

.app-nav-group {
  min-width: 0;
  position: relative;
}

.app-nav-group summary {
  align-items: center;
  gap: 7px;
  list-style: none;
}

.app-nav-group summary::-webkit-details-marker {
  display: none;
}

.app-nav-group details[open] summary span {
  transform: rotate(180deg);
}

.app-nav-menu {
  background: #fff;
  border: 1px solid var(--silver-200);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  left: 0;
  list-style: none;
  min-width: 220px;
  padding: 7px;
  position: absolute;
  top: calc(100% + 5px);
  z-index: 60;
}

.app-nav-menu a {
  display: block;
  padding: 9px 11px;
}

.app-nav-group:last-child .app-nav-menu {
  left: auto;
  right: 0;
}

.signed-in {
  align-items: baseline;
  color: var(--silver-500);
  display: flex;
  font-size: 12px;
  gap: 5px;
  white-space: nowrap;
}

.who {
  font-size: 13px;
  color: var(--navy-800);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* A long company name is 200px of unwrappable text. On a narrow screen that,
   plus the logo, Sign out and the menu button, is wider than the viewport and
   pushed the whole page sideways. The name is not needed to operate the app —
   it is confirmation of who is signed in — so it goes first. */
@media (max-width: 560px) {
  .signed-in {
    display: none;
  }
}

@media (max-width: 1120px) {
  .app-header-nav {
    display: none;
  }

  .mobile-nav-group details {
    border-bottom: 1px solid var(--silver-200);
  }

  .mobile-nav-group summary {
    justify-content: space-between;
    padding: 10px 12px;
    text-align: left;
  }

  .mobile-nav-group .app-nav-menu {
    background: var(--silver-50);
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    min-width: 0;
    padding: 4px 8px 9px 18px;
    position: static;
  }
}

/* Dashboard tiles. */
.stat-card {
  text-align: center;
  padding: 20px;
}
.stat-card b {
  display: block;
  font-size: 30px;
  color: var(--navy-900);
  font-weight: 800;
}
.stat-card span {
  display: block;
  font-size: var(--fs-hint, 12.5px);
  color: var(--silver-500);
  margin-top: 4px;
}

.card-title {
  font-size: var(--fs-title, 15px);
  margin-bottom: 10px;
}

/* Definition grid used on both detail screens. */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px 28px;
  background: #fff;
  border: 1px solid var(--silver-200);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-card);
}
.detail-grid dt {
  font-size: var(--fs-small, 11px);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--silver-500);
  font-weight: 700;
}
.detail-grid dd {
  margin-top: 4px;
  color: var(--silver-800);
  font-size: var(--fs-text, 14.5px);
}
/* A label and its value in one block (P3-22 Amendment 2, N5): the pair is the grid cell, whatever the width, and a long
   value wraps inside it. */
.detail-pair {
  min-width: 0;
}
.detail-pair dd {
  overflow-wrap: anywhere;
}

/* Status pills. Colour never carries the meaning alone — the text is the label. */
.pill-ok {
  background: var(--emerald-100);
  color: var(--emerald-800);
}
.pill-bad {
  background: #fee2e2;
  color: #991b1b;
}
.pill-busy {
  background: var(--brand-light);
  color: var(--brand-secondary);
}
.pill-wait {
  background: var(--silver-200);
  color: var(--silver-700);
}

.btn-sm {
  padding: 5px 11px;
  font-size: var(--fs-hint, 12.5px);
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}

/*
 * A control group that sits INSIDE an .action-row - a file input and its
 * submit button, say - and must line up with the plain buttons beside it.
 *
 * It keeps .action-row's centring and wrapping and drops the row's own
 * `margin-top`. That margin is the whole defect: on a nested row it is part
 * of the item's outer box, so `align-items: center` centres the box INCLUDING
 * the margin and the group ends up sitting half the margin lower than every
 * button next to it.
 */
.action-row-inline {
  display: inline-flex;
  gap: 8px;
  margin-top: 0;
}

td.empty {
  color: var(--silver-500);
  font-style: italic;
}

/* Released result versions. */
.version-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.version-head h3 {
  font-size: 16px;
}

.file-list {
  list-style: none;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.file-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--silver-50);
  border: 1px solid var(--silver-100);
  border-radius: 9px;
}
.file-name {
  font-weight: 600;
  color: var(--navy-800);
  font-size: var(--fs-text, 13.5px);
}
.checksum {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-small, 11px);
  color: var(--silver-500);
  margin-left: auto;
}

/* Human-review queue. */
.review-item {
  border: 1px solid var(--silver-200);
  border-radius: 11px;
  padding: 16px;
  margin-top: 12px;
  background: var(--silver-50);
}
.review-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}
.review-controls select {
  max-width: 220px;
}
.review-controls .input {
  flex: 1;
  min-width: 220px;
}

.radio-desc {
  display: block;
  font-size: var(--fs-hint, 12.5px);
  color: var(--silver-600);
  margin-top: 2px;
}

@media (max-width: 880px) {
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .checksum {
    margin-left: 0;
  }
}

/* ------------------------------------------------------------------ messages
   The thread is the official record of correspondence about a request. Message
   bodies are inserted with textContent, so `pre-wrap` is what preserves the
   line breaks the author typed, and `overflow-wrap` stops a long unbroken
   string from widening the page. */

.thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
  padding: 4px 2px;
}

.msg {
  border: 1px solid var(--silver-200);
  border-radius: var(--radius);
  padding: 10px 13px;
  max-width: 46em;
}

.msg-mine {
  background: var(--brand-light);
  border-color: #d6e4f6;
  align-self: flex-end;
}

.msg-theirs {
  background: #fff;
  align-self: flex-start;
}

.msg-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 4px;
}

.msg-author {
  font-weight: 600;
  font-size: var(--fs-text, 13.5px);
  color: var(--navy-900);
}

.msg-when {
  font-size: var(--fs-hint, 12px);
  color: var(--silver-500);
  white-space: nowrap;
}

.msg-body {
  margin: 0;
  font-size: var(--fs-text, 14.5px);
  line-height: 1.55;
  color: var(--silver-800);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.unread-list {
  margin: 6px 0 0;
  padding-left: 18px;
}

.unread-list li {
  margin-top: 2px;
}

/* ------------------------------------------------------- request form ------
   Choice cards, consent panel and upload box.
   Values taken verbatim from the approved prototype
   (docs/source/ihm-tool-preview-original.html); the markup differs because
   these are real controls rather than a click-through mock. */

/* A native radio wrapped in its own label, so the whole card is a click target
   and a screen reader announces the control with its description — no JS, and
   no `onclick` on a div as the prototype had. */
.radio-card {
  border: 1px solid var(--silver-300);
  border-radius: 11px;
  padding: 15px;
  cursor: pointer;
  transition: 0.15s;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.radio-card:hover {
  border-color: var(--brand-accent);
}

/* `.sel` is applied by script to mirror the checked state, because a parent
   cannot be selected from a child in CSS everywhere we support. `:has()` does
   the same thing natively where available — both are listed so the card is
   never left looking unselected. */
.radio-card.sel,
.radio-card:has(input:checked) {
  border-color: var(--brand-secondary);
  background: var(--brand-light);
  box-shadow: 0 0 0 1px var(--brand-secondary);
}

/* The ring goes on the card, because the radio itself is only 13px and its
   focus outline is easy to miss against the border. */
.radio-card:has(input:focus-visible) {
  box-shadow: var(--focus-ring);
}

.radio-card input {
  margin-top: 3px;
}

.radio-card b {
  color: var(--navy-900);
  font-size: var(--fs-text, 14px);
}

.radio-card p {
  font-size: var(--fs-hint, 12.5px);
  color: var(--silver-600);
  margin-top: 2px;
}

.consent-box {
  border: 1px solid var(--amber-100);
  background: var(--amber-50);
  border-radius: 11px;
  padding: 16px;
  margin-top: 6px;
}

/* ---------------------------------------------------------- upload box ----
   The prototype's dashed drop area, driven by a real `<label for>` instead of
   an inline onclick. The input stays in the accessibility tree and keeps
   keyboard focus; it is only visually removed, never `display: none`, which
   would make it unreachable by keyboard. */
.upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.upload {
  display: block;
  border: 2px dashed var(--silver-300);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: 0.15s;
  background: var(--silver-50);
}

.upload:hover {
  border-color: var(--brand-accent);
  background: var(--brand-light);
}

/* Focus lands on the hidden input, so the visible ring must be drawn on the
   label that follows it. Without this the box would be operable by keyboard
   with no indication of where focus is. */
.upload-input:focus-visible + .upload {
  border-color: var(--brand-accent);
  background: var(--brand-light);
  box-shadow: var(--focus-ring);
}

.upload svg {
  width: 34px;
  height: 34px;
  stroke: var(--brand-secondary);
  margin-bottom: 8px;
}

.upload-primary {
  display: block;
  font-weight: 600;
  font-size: var(--fs-text, 14px);
  color: var(--navy-900);
}

.upload-hint {
  display: block;
  font-size: var(--fs-hint, 12.5px);
  color: var(--silver-600);
  margin-top: 4px;
}

/* Set once a file is chosen. Colour alone does not carry the meaning — the
   filename itself is the signal. */
.upload.has-file {
  border-style: solid;
  border-color: var(--brand-secondary);
  background: var(--brand-light);
}

@media (prefers-reduced-motion: reduce) {
  .radio-card,
  .upload {
    transition: none;
  }
}

/* -----------------------------------------------------------------------------
   Quota meter.

   A real <meter>-role element rather than a decorative bar: the numbers live in
   aria-valuenow/valuemax/valuetext and are repeated in visible text beneath it,
   so the figure is never carried by the fill width alone.
   -------------------------------------------------------------------------- */
.quota-meter {
  margin-top: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--silver-200);
  overflow: hidden;
}

.quota-meter-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--brand-secondary);
  transition: width 200ms ease;
}

/* A full allowance is a state worth noticing, not just a longer bar. */
.quota-meter[aria-valuenow][aria-valuemax]:not([aria-valuemax='0']) .quota-meter-fill {
  background: var(--brand-secondary);
}

@media (prefers-reduced-motion: reduce) {
  .quota-meter-fill {
    transition: none;
  }
}

/* -----------------------------------------------------------------------------
   Gates (Task 9B.3)

   Cards rather than a table row, because a gate carries two independent states
   plus health evidence plus what it is currently running, and a row wide enough
   for all of it stops being readable on a phone. The grid collapses to one
   column below 720px; nothing scrolls sideways.
   -------------------------------------------------------------------------- */
.gate-family {
  margin-top: 26px;
}
.gate-family h3 {
  margin-bottom: 4px;
}

.gate-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.gate-card {
  padding: 18px 20px;
  /* Long codes and references must wrap rather than widen the grid track. */
  min-width: 0;
  overflow-wrap: anywhere;
}

.gate-title {
  font-size: 15.5px;
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.gate-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-text, 13px);
  background: var(--silver-100);
  border: 1px solid var(--silver-200);
  border-radius: 6px;
  padding: 2px 7px;
}

/*
   The two badges. Health and occupancy are separate facts and are shown as
   separate badges — colour is reinforcement, never the message, because each
   badge's text IS its state.
*/
.gate-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.gate-facts {
  margin-top: 12px;
}
.gate-facts dt {
  font-size: var(--fs-small, 11.5px);
}
.gate-facts dd {
  font-size: var(--fs-text, 13.5px);
}

/* The card is narrow: about 356 to 424 px wide (Build 5's measure). An aligned row keeps up to 220 px for its label,
   so a value had 24 to 92 px there: a date broke inside its number, and a card of seven facts grew to several times
   its height. Inside the gate card a row is one column, the label above its value, which is the form the rows take
   on a narrow screen (`chrome.css`). Ruled on 11 October 2026 (the lane file, 99345182), for the gate card; one
   shared rule for every narrow container follows. */
.gate-card .kv-row {
  grid-template-columns: minmax(0, 1fr);
}

/* A date and its time stay on one line inside a gate card. A fact that is a sentence wraps in the narrow card, and
   without this a line could end on the date and the next begin with its time (seen in a browser at 1,536 px on
   11 October 2026, in the Paused row). */
.gate-card .date-time {
  white-space: nowrap;
}

.gate-actions {
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

/* An amber notice for something that needs a decision but is not an error. */
.notice-warn {
  background: var(--amber-50);
  border: 1px solid var(--amber-100);
  color: var(--amber-800);
}

/* Modification 19 (P2A-09; R19-CO-19): a suspended company's portal is
   read-only. The shell puts this banner first in every page's main region and
   marks the body; every control marked `data-write-control` is then hidden.
   The server refuses those writes whatever the page shows. */
.suspended-banner {
  background: var(--amber-50);
  border-bottom: 1px solid var(--amber-100);
  color: var(--amber-800);
  padding: 12px 0;
  font-size: var(--fs-text, 14px);
  line-height: 1.5;
}

body[data-company-suspended='true'] [data-write-control] {
  display: none !important;
}

/* Close-out 46 item 2: what only the company administrator may use is not offered to a company user (the shell marks
   the body with the role; the server refuses it anyway). */
body[data-company-role='COMPANY_USER'] [data-company-min-role='COMPANY_ADMIN'] {
  display: none !important;
}

@media (max-width: 720px) {
  .gate-cards {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------------------
   Client status timeline (Task 9C.2)

   Wraps rather than scrolls: on a 375px screen eight steps cannot sit on one
   line, and a horizontally scrolling progress indicator hides the end of its
   own sequence. Flex-wrap keeps every step visible and keeps the page free of
   horizontal overflow.
   --------------------------------------------------------------------------- */
.status-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.timeline-step {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line, #d8dee6);
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--muted, #5b6672);
  background: transparent;
}

.timeline-done {
  border-color: var(--ok-line, #b7d9c0);
  background: var(--ok-bg, #eef7f0);
  color: var(--ok-text, #1f5130);
}

.timeline-current {
  border-color: var(--accent, #1f4f82);
  background: var(--accent-bg, #eaf1f9);
  color: var(--accent, #1f4f82);
  font-weight: 600;
}

/* A request that ended without reaching "Result ready" — Rejected, Failed,
   Cancelled or Result expired. Marked distinctly so it does not read as a step
   still to come. */
.timeline-ended {
  border-color: var(--warn-line, #e2c9a0);
  background: var(--warn-bg, #fdf5e7);
  color: var(--warn-text, #7a5312);
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Statistics dashboards (Task 10B)

   Hand-drawn inline SVG, no charting library and no CDN request — the site
   ships no third-party runtime and the privacy notice depends on that staying
   true.

   Everything below wraps rather than scrolls the page. A dashboard is the
   easiest place to introduce horizontal overflow at 375px, so every grid is
   `auto-fit` with a minimum column and every table sits in its own
   `overflow-x: auto` wrapper.
   --------------------------------------------------------------------------- */

.filter-bar fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

/* Figures. `minmax(0, …)` on the column so a long value cannot push the grid
   wider than its container. */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 10px 20px;
  margin: 0 0 12px;
}

.stat-grid dt {
  font-size: 0.82rem;
  color: var(--muted, #5b6672);
  margin: 0;
}

.stat-grid dd {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
  /* A long "Not available (0 of 0)" must wrap, not widen the page. */
  overflow-wrap: anywhere;
}

.statistics-dashboard .stat-grid {
  gap: 12px;
}

.statistics-dashboard .stat-metric {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line, #e3e8ee);
  border-radius: 12px;
  background: linear-gradient(145deg, #ffffff 0%, #f7f9fc 100%);
}

.statistics-dashboard .stat-metric dd {
  margin: 4px 0 0;
  color: var(--navy, #0c2c55);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

/* Close-out 38 (22 Nov 2026): in Night the Statistics tiles stood white on the dark page. They take the night's raised
   surface and its strong text; Day is unchanged. */
html[data-theme='dark'] .statistics-dashboard .stat-metric {
  background: var(--surface-raised);
}

html[data-theme='dark'] .statistics-dashboard .stat-metric dd {
  color: var(--text-strong);
}

.stats-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.stats-chart-grid > .card {
  min-width: 0;
  margin-top: 0 !important;
}

.stats-chart-card {
  overflow: hidden;
}

.definition-list dt {
  font-weight: 600;
  margin-top: 10px;
}

.definition-list dd {
  margin: 2px 0 0;
  color: var(--muted, #5b6672);
  font-size: 0.9rem;
}

.chart-wrap {
  margin: 12px 0;
  /* The SVG scales to this box; nothing inside it is a fixed pixel width. */
  max-width: 100%;
}

.chart {
  display: block;
  max-width: 100%;
  height: auto;
  overflow: visible;
}

.chart-label {
  fill: var(--muted, #5b6672);
}

.chart-value {
  fill: var(--ink, #1c2530);
  font-weight: 600;
}

.chart-bar {
  fill: var(--accent, #1f4f82);
}

/* The second series is HATCHED as well as tinted, so the two stay
   distinguishable in greyscale and to a colour-blind reader — colour is never
   the only signal. */
.chart-bar-secondary {
  stroke: var(--accent, #1f4f82);
  stroke-width: 0.3;
}

.chart-hatch-bg {
  fill: var(--ok-bg, #eef7f0);
}

.chart-hatch-line {
  fill: var(--accent, #1f4f82);
}

.chart-legend {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--muted, #5b6672);
}

.chart-empty {
  margin: 12px 0;
  font-style: italic;
}

/* The two quantities have different units and therefore different scales. */
.trend-chart {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.trend-panel {
  min-width: 0;
  padding: 14px 14px 6px;
  border: 1px solid var(--line, #e3e8ee);
  border-radius: 12px;
  background: #fbfcfe;
}

.trend-panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.trend-panel-heading h3 {
  margin: 0;
  color: var(--ink, #1c2530);
  font-size: 0.95rem;
  text-transform: capitalize;
}

.trend-panel-heading span {
  color: var(--muted, #5b6672);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.trend-plot {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 4px;
}

.trend-grid-line {
  stroke: #dbe3ec;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.trend-axis-label {
  fill: var(--muted, #5b6672);
  font-size: var(--fs-small, 11px);
  font-variant-numeric: tabular-nums;
}

.trend-area {
  stroke: none;
  opacity: 0.14;
}

.trend-area-primary {
  fill: #1f5b91;
}

.trend-area-secondary {
  fill: #16736b;
}

.trend-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.trend-line-primary,
.trend-point-primary {
  stroke: #1f5b91;
}

.trend-line-secondary,
.trend-point-secondary {
  stroke: #16736b;
}

.trend-point {
  fill: #ffffff;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

/* Compact part-to-whole chart. The text legend carries the actual meaning. */
.donut-chart {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 190px;
}

.donut-plot {
  display: block;
  width: 100%;
  height: auto;
  max-width: 180px;
  margin: auto;
}

.donut-track,
.donut-segment {
  fill: none;
  stroke-width: 16;
}

.donut-track {
  stroke: #e8edf3;
}

.donut-segment {
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  stroke-linecap: butt;
}

.donut-total {
  fill: var(--navy, #0c2c55);
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.donut-total-label {
  fill: var(--muted, #5b6672);
  font-size: 8px;
  text-transform: uppercase;
}

.donut-legend {
  display: grid;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.donut-legend li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.86rem;
}

.donut-key {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.donut-key-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.donut-legend strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.donut-segment-1 {
  stroke: #174f83;
}
.donut-segment-2 {
  stroke: #16736b;
}
.donut-segment-3 {
  stroke: #b86f12;
}
.donut-segment-4 {
  stroke: #a7445b;
}
.donut-segment-5 {
  stroke: #6a59a3;
}
.donut-segment-6 {
  stroke: #3d79b4;
}
.donut-segment-7 {
  stroke: #5d7d39;
}
.donut-segment-8 {
  stroke: #6b7580;
}
.donut-key-1 {
  background: #174f83;
}
.donut-key-2 {
  background: #16736b;
}
.donut-key-3 {
  background: #b86f12;
}
.donut-key-4 {
  background: #a7445b;
}
.donut-key-5 {
  background: #6a59a3;
}
.donut-key-6 {
  background: #3d79b4;
}
.donut-key-7 {
  background: #5d7d39;
}
.donut-key-8 {
  background: #6b7580;
}

/* The horizontal bar chart. HTML rather than SVG, so labels wrap instead of
   overrunning their column — see the note on barChart in charts.ts. */
.bar-chart {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(6rem, 11rem) 1fr auto;
  align-items: center;
  gap: 10px;
}

.bar-label {
  font-size: 0.85rem;
  /* Wraps rather than overflows; the row grows to fit. */
  overflow-wrap: anywhere;
}

.bar-track {
  display: block;
  height: 14px;
  min-width: 0;
  border-radius: 3px;
  background: var(--line, #e3e8ee);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  background: var(--accent, #1f4f82);
}

.bar-value {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  font-weight: 600;
}

/* At 375px the label column would squeeze the bar to nothing, so the row
   becomes two lines: label and value together, bar beneath. */
@media (max-width: 480px) {
  .bar-row {
    grid-template-columns: 1fr auto;
  }

  .bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 900px) {
  .stats-chart-grid,
  .trend-chart {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .donut-chart {
    grid-template-columns: 1fr;
  }

  .donut-plot {
    max-width: 160px;
  }
}

.chart-data {
  margin-top: 8px;
}

.chart-data summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--accent, #1f4f82);
  /* This is the only way to reach a chart's underlying numbers, so it has to
     be comfortably tappable. The text alone measured 23px tall on a 375px
     viewport; the padding brings the target to a usable size without changing
     how the line reads. */
  display: inline-block;
  padding: 8px 4px;
  min-height: 24px;
}

.progress {
  display: block;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: var(--line, #e3e8ee);
  overflow: hidden;
  margin: 6px 0;
}

.progress-fill {
  display: block;
  height: 100%;
  background: var(--accent, #1f4f82);
}

/* The live-snapshot card is visually distinct from the historical cards, so
   nobody reads a current gate count as a period average. */
.card-snapshot {
  border-left: 4px solid var(--accent, #1f4f82);
}

/* Tables scroll inside their own box; the PAGE never scrolls sideways. */
.table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}

.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;
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .filter-row {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   Pages — the content-management screen.

   Two presentations of one list. The table is the desktop view; below the
   tablet breakpoint it is replaced by stacked cards carrying the same facts,
   because a ten-column table on a phone is either unreadable or a sideways
   scroll through the whole page. Neither presentation ever makes the PAGE
   scroll horizontally: wide content scrolls inside its own box.
   ========================================================================== */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #fff;
  border: 1px solid var(--silver-200);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.kpi-label {
  font-size: var(--fs-hint, 12px);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--silver-600);
  font-weight: 600;
}

.kpi-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.15;
  margin: 4px 0 2px;
}

.kpi-note {
  font-size: var(--fs-hint, 12px);
  color: var(--silver-600);
}

.cms-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 8px;
}

.cms-toolbar .field {
  margin: 0;
  min-width: 0;
}

.cms-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* The table scrolls inside its own box; the page body never scrolls sideways. */
.cms-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
  border-radius: var(--radius);
}

.cms-table {
  min-width: 100%;
}

.cms-table td {
  vertical-align: top;
}

.cms-page-name {
  display: block;
  font-weight: 600;
  color: var(--navy-900);
}

.cms-page-template {
  display: block;
  font-size: var(--fs-hint, 12px);
  color: var(--silver-600);
}

.action-row-tight {
  gap: 6px;
  flex-wrap: wrap;
}

/* Cards replace the table below the tablet breakpoint. */
.cms-card-list {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.cms-card {
  background: #fff;
  border: 1px solid var(--silver-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
}

.cms-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.cms-card-head h3 {
  font-size: var(--fs-title, 15px);
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.cms-card-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 4px 12px;
  font-size: var(--fs-text, 13px);
  margin-bottom: 12px;
}

.cms-card-facts dt {
  color: var(--silver-600);
}

.cms-card-facts dd {
  color: var(--navy-900);
  overflow-wrap: anywhere;
}

/* ---- detail: editing column and publication panel ---------------------- */

.cms-detail {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 16px;
}

.cms-main {
  min-width: 0;
}

.cms-side {
  min-width: 0;
  position: sticky;
  top: 16px;
}

.cms-panel {
  background: #fff;
  border: 1px solid var(--silver-200);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-card);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.cms-panel h3 {
  margin-top: 0;
}

.cms-panel h4 {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--silver-200);
  font-size: var(--fs-text, 13px);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--silver-600);
}

/* A list of facts in the panel (W6, P5-08). The panel is a third of the editor's width, so an aligned row has no room
   there for its value beside the label: 0 to 97 px on a screen 1,110 to 1,366 px wide. Inside the panel a row is one
   column, the label above its value, which is the form the rows take on a narrow screen (`chrome.css`). */
.cms-panel .kv-row {
  grid-template-columns: minmax(0, 1fr);
}

.cms-editor-actions {
  margin-top: 20px;
}

.cms-history-heading {
  margin-top: 32px;
}

.cms-preview-frame {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--silver-300);
  background: #fff;
  max-width: 100%;
}

/* ---- the structured block editor --------------------------------------- */

.block-card {
  border: 1px solid var(--silver-200);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 12px;
  overflow: hidden;
}

.block-card-invalid {
  border-color: #b3261e;
  box-shadow: 0 0 0 2px rgba(179, 38, 30, 0.12);
}

.block-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--silver-100);
  border-bottom: 1px solid var(--silver-200);
}

.block-toggle {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 7px;
  text-align: left;
  min-width: 0;
}

.block-toggle:focus-visible {
  outline: 2px solid var(--brand-secondary);
  outline-offset: 2px;
}

.block-type {
  font-weight: 700;
  color: var(--navy-900);
  font-size: var(--fs-text, 14px);
}

.block-position {
  font-size: var(--fs-hint, 12px);
  color: var(--silver-600);
}

.block-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.block-body {
  padding: 14px 12px 4px;
}

.repeater {
  border: 1px solid var(--silver-200);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 8px;
}

.repeater-item + .repeater-item {
  border-top: 1px solid var(--silver-200);
  padding-top: 12px;
  margin-top: 12px;
}

.repeater-label {
  font-size: var(--fs-hint, 12px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--silver-600);
}

.add-block {
  position: relative;
}

.add-block-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--silver-200);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 27, 45, 0.14);
  padding: 6px;
  list-style: none;
}

.add-block-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: inherit;
  font-size: var(--fs-text, 13.5px);
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--navy-900);
}

.add-block-item:hover,
.add-block-item:focus-visible {
  background: var(--silver-100);
}

/* ---- the confirmation dialog ------------------------------------------- */

.btn-danger {
  background: #b3261e;
  color: #fff;
  border-color: #8f1d17;
}

.btn-danger:hover:not(:disabled) {
  background: #8f1d17;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 22, 40, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(10, 22, 40, 0.35);
}

.modal h2 {
  margin-top: 0;
  font-size: 19px;
}

.modal p {
  font-size: var(--fs-text, 14px);
  color: var(--silver-700);
  margin-bottom: 10px;
}

.modal-subject {
  font-size: var(--fs-text, 13.5px);
  background: var(--silver-100);
  border: 1px solid var(--silver-200);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--navy-900);
  overflow-wrap: anywhere;
}

.modal-form {
  margin-top: 12px;
}

.modal-actions {
  margin-top: 18px;
}

/* Release 6.8.2 (W1's finding; every form of this round ends this way): the dialog's buttons stand at the right, Cancel
   first and the confirm button last, in both portals. Focus still opens on the safe choice (page-modal.ts). */
body[data-shell] .modal-actions {
  justify-content: flex-end;
}

.slug-preview {
  display: block;
  font-size: var(--fs-text, 14px);
  background: var(--silver-100);
  border: 1px solid var(--silver-200);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--navy-900);
}

/* The page behind a modal neither scrolls nor can be reached. */
body[data-modal-open] {
  overflow: hidden;
}

/* ---- responsive -------------------------------------------------------- */

@media (max-width: 1100px) {
  .cms-detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .cms-side {
    position: static;
  }

  .cms-panel {
    max-height: none;
  }
}

@media (max-width: 880px) {
  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cms-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Below the tablet breakpoint the table is replaced, not squeezed. */
  .cms-table-wrap {
    display: none;
  }

  .cms-card-list {
    display: flex;
  }
}

@media (max-width: 480px) {
  .kpi-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .cms-card-facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .cms-card-facts dd {
    margin-bottom: 6px;
  }

  .modal {
    padding: 18px;
  }
}

/* ===========================================================================
   Revision comparison — Content → Legal documents
   ---------------------------------------------------------------------------
   MEANING IS NOT CARRIED BY COLOUR.

   Four independent signals mark every line, and any one of them is enough:

     1. semantics   — <ins> and <del>, which assistive technology announces
     2. a marker    — a visible "+" or "−" in the gutter
     3. a label     — .sr-only text ("Added:", "Removed:") for screen readers
     4. a border    — a thick left rule on changed lines, thin on unchanged

   Colour is the fifth and the least of them, so the panel is still readable in
   monochrome, under any colour-vision deficiency, and when a forced-colours
   mode discards the palette entirely.

   NO HORIZONTAL PAGE OVERFLOW.

   Long lines WRAP rather than extend the page — a policy body contains prose,
   not code, and a document that pushes the viewport sideways on a phone is
   unusable. `.diff-scroll` keeps `overflow-x: auto` as a safety net for an
   unbreakable token, so the scroll is confined to the panel and never the page.
   =========================================================================== */

.diff-scroll {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--line, #d9dee5);
  border-radius: 6px;
  background: #fff;
}

.diff {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-text, 13px);
  line-height: 1.55;
}

.diff-line {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  gap: 8px;
  padding: 1px 10px 1px 0;
  border-left: 3px solid transparent;
}

.diff-mark {
  text-align: center;
  user-select: none;
  opacity: 0.75;
}

.diff-text {
  display: block;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.diff-line-add {
  border-left-color: #1a7f37;
  background: #e9f5ec;
}

.diff-line-remove {
  border-left-color: #b42318;
  background: #fdeceb;
}

.diff-line-same {
  border-left-color: #e6e9ee;
  color: #56606e;
}

/* An empty line still needs height, or a removed blank line vanishes. */
.diff-text:empty::after {
  content: ' ';
  white-space: pre;
}

@media (max-width: 480px) {
  .diff {
    font-size: var(--fs-hint, 12px);
  }

  .diff-line {
    grid-template-columns: 1.25rem minmax(0, 1fr);
    gap: 6px;
  }
}

/* ===========================================================================
   .table-scroll — the class the markup already asked for
   ---------------------------------------------------------------------------
   Seventeen pages wrap a wide table in `<div class="table-scroll">`, and until
   now that class had NO RULE ANYWHERE. The markup expressed the intent and the
   stylesheet never implemented it, so every one of those tables pushed the
   whole document sideways on a narrow screen: at 375px the admin content page
   measured 465px of scrollWidth, and the horizontal scroll was on the page
   rather than on the table.

   It was invisible on a desktop, which is where it was looked at.

   `min-width: 0` is the load-bearing half. A grid or flex child defaults to
   `min-width: auto`, meaning it refuses to shrink below its content — so
   `overflow-x: auto` alone would have done nothing here: the box would simply
   have grown to the width of the table and taken the page with it.
   =========================================================================== */

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  /* A positioning context, and it is not cosmetic.
     `.sr-only` is absolutely positioned. Inside a `<th>` with no positioned
     ancestor it resolves against the initial containing block, so it escapes
     this scroller and is laid out at the far edge of the FULL table width —
     which kept `documentElement.scrollWidth` at 465px on a 375px viewport even
     after the table itself was contained. `body.scrollWidth` read 375 the whole
     time, which is why it looked fixed and was not. */
  position: relative;
}

/* Contain the screen-reader labels.
   `.sr-only` is absolutely positioned; without a positioned ancestor it
   resolves against the initial containing block and can sit at the far edge of
   an already-too-wide page, which is how it showed up in the overflow audit. */
.diff-line {
  position: relative;
}

/* ===========================================================================
   Long unbreakable strings inside rendered legal documents
   ---------------------------------------------------------------------------
   Section 21 of the approved privacy notice cites the Digital Services
   Coordinator by full URL — 89 characters with no space in it. At 375px that
   single token measured 720px wide and pushed the whole page sideways, while
   every element's bounding box stayed inside the viewport: it is the inline
   content that overflows, not a box, which is why an element-rect audit finds
   nothing to blame.

   `anywhere` rather than `break-word`: it also lets the browser count the long
   token when sizing the line box, so a table cell containing a URL shrinks
   instead of forcing its column wide.
   =========================================================================== */

.prose {
  overflow-wrap: anywhere;
}

/* The document fingerprint is 64 unbreakable hex characters.
   It sits outside `.prose` — it is chrome, not document text — so the rule
   above did not reach it, and at 375px it measured 391px inside a 327px box
   and was the last thing pushing the page sideways.

   The privacy page no longer shows a fingerprint, so `[data-privacy-hash]` is
   gone from this selector; the legal pages still do. */
[data-legal-hash] {
  overflow-wrap: anywhere;
}

/* Notification bell in either signed-in header, and its unread badge. The
   administrator and company centres share this styling; nothing here is scoped
   to one area. */
.notify-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 36px;
  height: 36px;
  color: inherit;
}
.notify-bell svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}
.notify-count {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger, #b42318);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.notify-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  padding: 10px 14px;
  border-radius: var(--radius, 8px);
  background: var(--ink, #111);
  color: #fff;
  font-size: var(--fs-text, 14px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.notify-toast a {
  color: #fff;
  text-decoration: underline;
}
tr.notify-unread td:first-child {
  font-weight: 600;
}
.pill-err {
  background: #fde8e6;
  color: #8a1c14;
}

/* -----------------------------------------------------------------------------
   Dataset panel (Modification 8) - the imported workbook rows
   -------------------------------------------------------------------------- */
.dataset-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}
.dataset-toolbar .input {
  flex: 1 1 240px;
  max-width: 420px;
}
.dataset-toolbar select {
  width: auto;
}
.dataset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.dataset-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.dataset-pager select {
  width: auto;
}
.dataset-table td {
  vertical-align: top;
}
.dataset-table .input-sm {
  padding: 6px 8px;
  min-width: 200px;
  font-size: var(--fs-text, 13px);
}
.dataset-row-deleted td {
  color: var(--silver-600, #6b7280);
}
.dataset-deleted {
  text-decoration: line-through;
}
.dataset-row-invalid td {
  background: #fff7f5;
}
.dataset-error {
  color: #8a1c14;
  font-size: var(--fs-text, 13px);
}

/* ---------------------------------------------------------------------------
   Gate configuration form (Modification 9)

   `.field-error` already exists in components.css and is not restated here —
   two definitions of one class is how they drift. What is new is the pair that
   makes the form's rules VISIBLE before a save rather than after it: the
   invalid outline that accompanies `aria-invalid`, and the disabled styling on
   the path and family fields when this gate's state would refuse them.

   In both cases the colour is reinforcement only. `aria-invalid` and the error
   text carry the meaning, and a disabled control is announced as disabled.
   -------------------------------------------------------------------------- */
[data-gate-config-form] [aria-invalid='true'] {
  border-color: var(--danger);
}

[data-gate-config-form] select:disabled,
[data-gate-config-form] input:disabled,
[data-gate-config-form] textarea:disabled {
  background: var(--silver-100);
  color: var(--silver-700);
  cursor: not-allowed;
}

/* P3-26 (DEC:154): the Admin controls' one row of buttons, each with its meaning beneath it. */
.ws-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  align-items: flex-start;
  margin-top: 12px;
}

.ws-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 230px;
}

.ws-control-meaning {
  margin: 0;
  font-size: var(--fs-hint, 12.5px);
}

/* P3-26 item 8 (DEC:153): the five boxes of the administrator's "Input file and checks" tab. */
.ws-input-boxes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}

@media (max-width: 720px) {
  .ws-input-boxes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ws-input-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--silver-300);
  border-radius: 8px;
  background: #fff;
}

.ws-input-box-label {
  font-size: var(--fs-hint, 12.5px);
  color: var(--silver-700);
}

.ws-input-box-value {
  font-size: 18px;
}
/* -----------------------------------------------------------------------------
   MODIFICATION 19, PHASE 3 (P3-23; `DEC:143`): the New request page and the dashboard's
   allowance, the two sketches the owner accepted, in the portal's own tokens.
   -------------------------------------------------------------------------- */

/* This month's allowance: a framed panel with four boxes. */
.allowance-panel {
  margin-top: 22px;
  border: 1px solid var(--silver-200);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}

.allowance-title {
  margin: 0 0 12px;
  font-size: var(--fs-text, 14px);
  font-weight: 600;
  color: var(--navy-900);
}

.allowance-boxes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.allowance-box {
  background: var(--silver-100);
  border-radius: 8px;
  padding: 10px 12px;
}

.allowance-box-label {
  margin: 0;
  font-size: var(--fs-hint, 12px);
  color: var(--silver-600);
}

.allowance-box-value {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--navy-900);
}

.allowance-box-hint {
  margin: 2px 0 0;
  font-size: var(--fs-small, 11px);
  color: var(--silver-500);
}

/* Left: green while there is plenty, amber, then red as it runs out. The words and the numbers
   carry the meaning; the colour only reinforces it. */
.allowance-box-ok {
  background: var(--emerald-50);
}
.allowance-box-ok .allowance-box-label,
.allowance-box-ok .allowance-box-value {
  color: var(--emerald-800);
}
.allowance-box-amber {
  background: var(--amber-100);
}
.allowance-box-amber .allowance-box-label,
.allowance-box-amber .allowance-box-value {
  color: var(--amber-800);
}
.allowance-box-red {
  background: #fee2e2;
}
.allowance-box-red .allowance-box-label,
.allowance-box-red .allowance-box-value {
  color: #991b1b;
}

.allowance-period,
.allowance-rule {
  margin: 12px 0 0;
  font-size: var(--fs-text, 13px);
  color: var(--silver-600);
}

.allowance-rule {
  margin-top: 6px;
}

@media (max-width: 640px) {
  .allowance-boxes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The official template: a highlighted strip above the file field. */
.template-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 10px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--brand-light);
}

.template-strip-text {
  flex: 1;
  min-width: 200px;
}

.template-strip-title {
  margin: 0;
  font-size: var(--fs-text, 14px);
  font-weight: 600;
  color: var(--navy-800);
}

.template-strip-meta {
  margin: 2px 0 0;
  font-size: var(--fs-hint, 12px);
  color: var(--navy-700);
}

/* The template's exact format, in the warning tone. */
.format-box {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--amber-50);
  border: 1px solid var(--amber-100);
  color: var(--amber-800);
}

.format-box-title {
  margin: 0;
  font-size: var(--fs-text, 14px);
  font-weight: 600;
}

.format-box-list {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: var(--fs-text, 13px);
  line-height: 1.7;
}

.format-box-list code {
  font-family: inherit;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--amber-100);
  border-radius: 6px;
  padding: 1px 6px;
}

/* A chosen or dropped file: a card with its name, its size and "not sent yet". */
.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--silver-300);
  border-radius: 8px;
  background: #fff;
}

.file-card[hidden] {
  display: none;
}

.file-card-text {
  flex: 1;
  min-width: 180px;
}

.file-card-name {
  margin: 0;
  font-size: var(--fs-text, 14px);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.file-card-meta {
  margin: 2px 0 0;
  font-size: var(--fs-hint, 12px);
  color: var(--silver-600);
}

.btn-danger-outline {
  color: var(--danger);
  border-color: #fca5a5;
}

.upload.is-dropping {
  border-color: var(--brand-accent);
  background: var(--brand-light);
}

.upload[hidden] {
  display: none;
}

/* =============================================================================
   The New request page uses the width (release 6.1, orders 29e, option B; the owner, 12 October 2026).

   On a wide screen the part before the check is two columns: on the left what the client fills in (the request type,
   the file and its format box), on the right what the client reads (the requirements, this month's allowance, the
   processing route). The file check below takes the whole width: its tiles in one row, the filters, the table and
   Approve and Submit. Running text keeps its reading width (`form-measure`, 820px).

   One grid on the page's container; the form is `display: contents`, so its children are the grid's items and the
   markup keeps today's order, which stays the reading and keyboard order. Every item has its own area, so a notice
   that is hidden leaves its row empty instead of letting another item move into it. A hidden form (a suspended
   company) stays hidden: `[hidden]` wins (base.css), and the page is then one column, as before. Below 1100px
   nothing here applies: one column, as before.
   ========================================================================== */

@media (min-width: 1100px) {
  .new-request-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      'suspended suspended'
      'status status'
      'type requirements'
      'file requirements'
      'file allowance'
      'file allowance-line'
      'file route'
      'file .'
      'check check'
      'objective objective'
      'issues issues'
      'actions actions';
    /* The 1fr row takes what the file's column needs beyond the reading column, so the right column's rows keep
       their own height. */
    grid-template-rows: repeat(7, auto) 1fr repeat(4, auto);
    column-gap: 32px;
    align-items: start;
  }

  .new-request-form {
    display: contents;
  }

  /* A suspended company's form is hidden and its notice says why: the page keeps today's one column. */
  .new-request-layout:has(> .new-request-form[hidden]) {
    display: block;
  }

  .new-request-suspended {
    grid-area: suspended;
  }

  /* The status line and the allowance line are placed by their hooks: the page's script rewrites their class. */
  .new-request-layout [data-status] {
    grid-area: status;
  }

  .new-request-type {
    grid-area: type;
  }

  .new-request-requirements {
    grid-area: requirements;
  }

  .new-request-file {
    grid-area: file;
  }

  .new-request-allowance {
    grid-area: allowance;
  }

  .new-request-layout [data-allowance-line] {
    grid-area: allowance-line;
  }

  .new-request-route {
    grid-area: route;
  }

  .new-request-check {
    grid-area: check;
  }

  .new-request-objective {
    grid-area: objective;
  }

  .new-request-issues {
    grid-area: issues;
  }

  .new-request-actions {
    grid-area: actions;
  }
}

/* =============================================================================
   The check step before Approve and Submit (P3-25; DEC:148, DEC:149, DEC:150).
   The summary boxes, the file's checks folded away, the rows table with its filters
   and the footer. The words and the figures carry the meaning; colour only reinforces.
   ========================================================================== */

.check-panel {
  margin-top: 16px;
}

.check-panel[hidden],
.check-bulk[hidden],
.check-more[hidden] {
  display: none;
}

.check-boxes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.check-box {
  background: var(--silver-100);
  border-radius: 8px;
  padding: 10px 12px;
}

.check-box-label {
  margin: 0;
  font-size: var(--fs-hint, 12px);
  color: var(--silver-600);
}

.check-box-value {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--navy-900);
}

.check-box-hint {
  margin: 2px 0 0;
  font-size: var(--fs-small, 11px);
  color: var(--silver-500);
}

.check-box-amber {
  background: var(--amber-100);
}
.check-box-amber .check-box-label,
.check-box-amber .check-box-value {
  color: var(--amber-800);
}

.check-box-ok {
  background: var(--emerald-50);
}
.check-box-ok .check-box-label,
.check-box-ok .check-box-value,
.check-box-ok .check-box-hint {
  color: var(--emerald-800);
}

.check-details {
  margin-top: 12px;
  font-size: var(--fs-text, 13px);
  color: var(--silver-600);
}

.check-details summary {
  cursor: pointer;
}

.check-details ul {
  margin: 8px 0 0;
  padding-left: 20px;
  line-height: 1.6;
}

.check-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.check-filter {
  font: inherit;
  font-size: var(--fs-hint, 12px);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--silver-300);
  background: #fff;
  color: var(--silver-600);
  cursor: pointer;
}

.check-filter.is-active {
  border-color: var(--navy-700);
  color: var(--navy-900);
  font-weight: 600;
}

.check-bulk {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.check-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-text, 13px);
  margin-top: 8px;
}

/* P5-24 (`DEC:204`): the preview's header is the portal's standard table header, white on the dark band
   (`thead tr` in components.css). It used to override the colour with a grey that fell below 4.5:1 on that band. */
.check-table th {
  text-align: left;
  font-weight: 600;
  color: inherit;
  padding: 10px 12px;
}

.check-table td {
  padding: 6px 8px;
  border-top: 1px solid var(--silver-200);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.check-table td .btn {
  margin-left: 6px;
}

.check-table input[type='text'] {
  width: 100%;
  min-width: 140px;
}

.check-row-removed td {
  color: var(--silver-500);
  text-decoration: line-through;
}

.check-row-removed td:last-child {
  text-decoration: none;
}

.check-status-ok {
  color: var(--emerald-800);
}
.check-status-amber {
  color: var(--amber-800);
}
.check-status-accent {
  color: var(--navy-700);
}
.check-status-muted {
  color: var(--silver-600);
}

.check-problem {
  display: block;
  font-size: var(--fs-hint, 12px);
  color: var(--amber-800);
}

.check-blank {
  background: var(--brand-light);
  color: var(--navy-800);
  padding: 1px 6px;
  border-radius: 6px;
}

.check-more {
  margin: 8px 0 0;
}

.check-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--silver-200);
}

.check-foot .hint {
  flex: 1;
  min-width: 220px;
  margin: 0;
}

@media (max-width: 640px) {
  .check-boxes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =============================================================================
   Release 6.8, Lane A (company portal). Points 12 and 23: the checked rows in a box of their own, the Send bar always in
   view. Point 13: one full-width block, the information behind the (i). Points 9 to 11: the per-cell count, the causes
   line and the undo line. Point 32: "New request" in the request banner.
   ========================================================================== */

.upload-block {
  margin-top: 18px;
}

.upload-info-toggle {
  margin-left: 8px;
  vertical-align: middle;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  background: transparent;
  border: 0;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--band-fg-muted);
}

.upload-info-toggle:hover,
.upload-info-toggle[aria-expanded='true'] {
  color: var(--band-fg);
}

.upload-info-toggle:focus-visible {
  outline: 2px solid var(--band-fg);
  outline-offset: 2px;
  border-radius: 4px;
}

.upload-info {
  position: relative;
  margin-top: 12px;
  padding: 12px 44px 12px 12px;
  border: 1px solid var(--silver-200);
  border-radius: 8px;
  background: var(--surface-sunken);
}

.upload-info[hidden] {
  display: none;
}

.upload-info-close {
  position: absolute;
  top: 8px;
  right: 8px;
}

.upload-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.upload-info-grid > * {
  min-width: 0;
}

@media (max-width: 760px) {
  .upload-info-grid {
    grid-template-columns: 1fr;
  }
}

/* The rows box: fills the space down to the Send bar and scrolls on its own; the headings stay fixed at its top. */
.check-rows-box {
  max-height: clamp(240px, calc(100vh - 520px), 1400px);
  min-height: 200px;
  overflow: auto;
  margin-top: 8px;
  border: 1px solid var(--silver-200);
  border-radius: 6px;
  background: var(--surface-card);
}

.check-rows-box .check-table {
  margin-top: 0;
}

/* The headings stay fixed at the top of the box (the row's own dark band travels with it). */
.check-rows-box thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

@media (max-width: 640px) {
  .check-rows-box {
    max-height: clamp(180px, 38vh, 420px);
  }
}

.check-rows-count {
  margin: 4px 0 0;
  font-size: var(--fs-hint, 12px);
}

/* The Send bar stays in view, one line above the page footer. */
.check-send-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--surface-card);
  border: 1px solid var(--silver-200);
  border-radius: 8px;
  box-shadow: 0 -4px 10px rgba(15, 23, 42, 0.08);
}

.check-causes,
.check-undo {
  margin: 8px 0 0;
  font-size: var(--fs-text, 13px);
}

.check-causes {
  color: var(--amber-800);
  font-weight: 600;
}

.check-undo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.check-causes[hidden],
.check-undo[hidden] {
  display: none;
}

/* Point 9: the summary above the paste table. */
.paste-toolong {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid var(--bad-fg, #b42318);
  border-radius: 6px;
  background: var(--bad-bg, #fef2f2);
  color: var(--bad-fg, #b42318);
  font-size: var(--fs-text, 13px);
  font-weight: 600;
}

.paste-toolong[hidden] {
  display: none;
}

/* Point 32: "+ New request" at the right end of the request banner, with the allowance under it. */
.rq-new-request {
  margin-left: auto;
  text-align: right;
  align-self: flex-end;
}

.rq-new-request .btn[aria-disabled='true'] {
  opacity: 0.6;
  cursor: not-allowed;
}

.rq-new-request-note {
  margin: 4px 0 0;
  font-size: var(--fs-hint, 12px);
  color: var(--band-fg-muted);
}

.rq-new-request-note a {
  color: inherit;
  text-decoration: underline;
}

/* =============================================================================
   "Needs your action" (release 6.1, the owner's request of 12 October): one table per group on both portals
   (needs-action-view.ts). Each table used to size its columns by its own content, so the columns of one group did not
   stand under the columns of the next. Every group's table now has the same fixed column widths, set on its colgroup,
   so the columns line up down the page; long text wraps inside its cell. Each table has a minimum width, 40rem for
   the administrator's four columns and 28rem for the company's three (the review's F4): on a screen narrower than
   that, the table scrolls sideways inside its `.table-scroll`. Before 6.1 a table sized itself to its content.
   ========================================================================== */

.needs-action-table {
  table-layout: fixed;
  min-width: 40rem;
}

.needs-action-table-company {
  min-width: 28rem;
}

.needs-action-table td {
  overflow-wrap: anywhere;
}

/* The administrator's four columns: What, Company, Needed, Since (German time). */
.needs-action-col-what {
  width: 24%;
}

.needs-action-col-company {
  width: 22%;
}

.needs-action-col-needed {
  width: 36%;
}

.needs-action-col-since {
  width: 18%;
}

/* The company's list has no Company column: What and Needed take its share. */
.needs-action-table-company .needs-action-col-what {
  width: 30%;
}

.needs-action-table-company .needs-action-col-needed {
  width: 52%;
}

/* Release 6.6, item 29: the new-message notice sits above the bell's toast. */
.notify-toast.msg-toast {
  bottom: 68px;
}
.msg-toast-open {
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Release 6.6, item 39 (cosmetic): in the recent-errors list of the Workflow connections page the first two columns, Time and Gate, never wrap
   (at 1366 px they did). The page draws them without a class of their own, so they are named by their place inside the list's host. */
[data-gate-errors] table th:nth-child(-n + 2),
[data-gate-errors] table td:nth-child(-n + 2) {
  white-space: nowrap;
}

/* Release 6.8, points 12 and 23 (sketch v2, approved 23 October 2026): the page after the check on one screen. */
.check-folded {
  display: none;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 14px;
  border: 1px solid var(--silver-200);
  border-radius: 8px;
  background: var(--surface-card);
  font-size: var(--fs-text, 13px);
}

.is-checked .check-folded {
  display: flex;
}

.check-folded-ok {
  color: var(--emerald-800);
  font-weight: 700;
}

.check-folded-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* The input block folds away while a check is shown; "Edit the pasted rows" opens it again above the results. */
.is-checked:not(.is-editing) .upload-block,
.is-checked .p7-card > [data-allowance-line] {
  display: none;
}

.is-checked .check-wide {
  margin-top: 10px;
}

/* The counts: small buttons on one row, not tiles. */
.is-checked .check-boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.is-checked .check-box {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 999px;
}

.is-checked .check-box p {
  margin: 0;
  font-size: var(--fs-text, 13px);
}

.is-checked .check-box-value {
  font-weight: 700;
  order: -1;
}

.is-checked .check-filters {
  margin-top: 8px;
}

/* One amber fix line, only when something is wrong. */
.check-fix {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 8px 14px;
  border: 1px solid #fde68a;
  border-radius: 6px;
  background: var(--amber-50, #fffbeb);
}

.check-fix[hidden] {
  display: none;
}

.check-fix .check-causes,
.check-fix .check-bulk {
  margin: 0;
}

.check-fix .check-bulk {
  margin-left: auto;
}

/* Only the rows box scrolls: its height is what is left of the screen. */
.is-checked .check-rows-box {
  max-height: none;
  height: clamp(220px, calc(100vh - 520px), 1400px);
}

/* The count buttons and the view buttons follow the theme (they carried a fixed white and a fixed navy). */
.check-box-value {
  color: var(--text-strong);
}

.check-filter {
  background: var(--surface-card);
  color: var(--text-body);
}

.check-filter.is-active {
  color: var(--text-strong);
}

/* Release 6.8, points 26 and 29 (Lane A for Lane IA): the archive choices stay compact; the two answers of a conflict
   stand side by side (one column on a narrow screen). */
[data-ia-bar] select,
[data-gate-internal-archive-host] select,
.ia-row-option select {
  width: auto;
  max-width: 360px;
}

.ia-row-option {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-hint, 12px);
}

[data-ia-conflict] .two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 760px) {
  [data-ia-conflict] .two {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   Administrator workspaces — banner, tabs, panel, phase track, side panel

   The six shared primitives of Modification 12. Every rule here is component
   CSS: no screen owns anything in this file, and nothing in it names a
   request, a gate or a company.

   IMPORTED LAST, DELIBERATELY.
   `buildStyles()` concatenates `main.css`'s @imports in listed order, so this
   sheet must be the last one. Imported anywhere else it would lose specificity
   ties to `app.css` and the failure would show up as "the tab looks wrong on
   one page".

   THE SINGLE SCROLL SURFACE
   The DOCUMENT scrolls. No `.ws-panel` rule sets `overflow-y`, no grid track
   is anything but `minmax(0, …)`, and the tab strip never makes the PAGE
   scroll sideways — it wraps on a wide screen and scrolls inside itself on a
   narrow one. A tabbed layout is the classic place a second scrollbar appears,
   because "one panel visible" invites "and it fills the viewport".

   COLOUR NEVER CARRIES THE MEANING ALONE
   The selected tab has weight and an underline as well as colour; every phase
   state has its own marker shape and border weight as well as its own colour,
   and its state is in text.

   BREAKPOINTS
   Only the four the site already uses — 1120, 1100, 880 and 480. Five is
   already a lot to keep coherent, and a sixth would have to be honoured by
   every screen that adopts these components.
   ========================================================================== */

/* -----------------------------------------------------------------------------
   Workspace head — the banner and the tab strip, together

   "Keep the applicable workspace banner and horizontal tab bar visible while
   the selected panel is being used on desktop" (spec `:1350`), restated as an
   acceptance test at `:1433`. Sticky, not fixed, so the two of them scroll off
   nothing and the DOCUMENT remains the only scroll surface — the alternative,
   a fixed head over a panel with its own scroller, is the double scrolling
   `:1352` forbids.

   Two conditions, both from 05 §5.6: it paints an opaque background token,
   because it sits over content; and it goes `position: static` no later than
   1120px, where the desktop navigation row is already gone and a sticky head
   plus a tab strip would eat most of a phone's viewport.

   Below the sticky header (`z-index: 50`), so the site chrome still wins.
   -------------------------------------------------------------------------- */
.ws-head {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: 20px;
  background: var(--silver-50);
}

/* -----------------------------------------------------------------------------
   Summary banner

   The facts that stay true on every tab: the record's identifier and up to
   four labelled cells. There is no button in here — owner decision OD-11 —
   because a control visible from every tab is the duplication the
   canonical-ownership rule forbids, in a stronger form.
   -------------------------------------------------------------------------- */
.ws-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  padding: 18px 24px;
  border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    var(--navy-950) 0%,
    var(--navy-900) 70%,
    var(--brand-secondary) 160%
  );
  color: #fff;
}

.ws-banner-id {
  margin: 0;
  min-width: 0;
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  /* A long reference wraps rather than widening the page. */
  overflow-wrap: anywhere;
}

.ws-banner-facts {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 3px 24px;
  margin: 0;
  flex: 1 1 340px;
  min-width: 0;
}

/* One rule per cell, including the first, which separates the cells from the
   identifier. */
.ws-banner-facts > dt,
.ws-banner-facts > dd {
  min-width: 0;
  padding-left: 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.ws-banner-label {
  margin: 0;
  font-size: var(--fs-hint, 12.5px);
  font-weight: 500;
  color: var(--silver-300);
}

.ws-banner-value {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  overflow-wrap: anywhere;
}

/* A cell's second line (Modification 19, D-10): since when the Next step has
   stood, or how many rows were not accepted. Same contrast as the label. */
.ws-banner-note {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-hint, 12.5px);
  font-weight: 500;
  color: var(--silver-300);
}

/* -----------------------------------------------------------------------------
   Tab list

   On a wide screen the strip wraps rather than scrolling — a horizontally
   scrolling indicator hides the end of its own sequence, which is the same
   reasoning the client status timeline records for itself.

   On a narrow screen the specification is explicit and governs: "On narrow
   screens, tabs become an accessible overflow menu or horizontally scrollable
   tab list with the current step kept visible" (spec `:1417`). So below 880px
   it becomes the scrollable list, with `overflow-x` ON THE STRIP and never on
   an ancestor, so the PAGE still never scrolls sideways. `workspace-tabs.ts`
   keeps the selected tab in view.
   -------------------------------------------------------------------------- */
.ws-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  margin: 22px 0 0;
  padding: 0;
  border-bottom: 1px solid var(--silver-200);
}

.ws-tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 8px 8px 0 0;
  /* Comfortably above the 24px minimum the chart disclosure records, and at
     the 44px normally asked of a screen's primary navigation. */
  min-height: 44px;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--silver-600);
  cursor: pointer;
}

.ws-tab:hover {
  color: var(--navy-800);
  background: var(--silver-100);
}

/* Weight and an underline, not only colour. */
.ws-tab[aria-selected='true'] {
  color: var(--brand-secondary);
  border-bottom-color: var(--brand-secondary);
  font-weight: 700;
}

/* -----------------------------------------------------------------------------
   Panel

   Stays in normal flow. No `overflow-y`, no `height: 100vh`, no nested
   scroller: the document scrolls, and nothing inside the workspace has a
   scrollbar of its own.
   -------------------------------------------------------------------------- */
.ws-panel {
  margin-top: 24px;
}

/* One live region per panel, beside the controls that write to it — owner
   decision OD-12. `setStatus` hides it when the message is empty, and a hidden
   region announces nothing, so an empty region between actions is correct.

   Selected on the ATTRIBUTE, not on the class: `setStatus` ASSIGNS
   `className = 'notice notice-<kind>'`, so a class-based rule would apply
   until the first message and then silently stop. */
[data-panel-status] {
  margin: 0 0 16px;
}

/* -----------------------------------------------------------------------------
   Phase progress track

   ONE track, the active one, inside the selected panel. Completed is a filled
   disc with a check, current a heavier ring with a centre dot, blocked and
   ended their own marks — so the states differ in shape and border weight
   before any colour is involved, and each carries its state as text.
   -------------------------------------------------------------------------- */
.ws-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  margin: 0 0 22px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--silver-200);
  list-style: none;
}

.ws-track-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 6px;
  text-align: center;
}

/* The connector to the next step, drawn behind the markers. */
.ws-track-step::after {
  content: '';
  position: absolute;
  top: 13px;
  left: 50%;
  width: 100%;
  height: 2px;
  /* --silver-300 measures 1.5:1 on white, below the 3:1 WCAG 1.4.11 asks of
     a non-text indicator. --silver-400 clears it. */
  background: var(--silver-400);
}

.ws-track-step:last-child::after {
  display: none;
}

.ws-track-step-done::after {
  background: var(--emerald-600);
}

.ws-track-mark {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  /* Same 3:1 reasoning as the connector: the marker is the state indicator,
     so its ring has to be visible, not merely tasteful. */
  border: 2px solid var(--silver-500);
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.ws-track-step-done .ws-track-mark {
  border-color: var(--emerald-600);
  background: var(--emerald-600);
  color: #fff;
}

.ws-track-step-current .ws-track-mark {
  border-width: 4px;
  border-color: var(--brand-secondary);
  color: var(--brand-secondary);
  font-size: 10px;
}

.ws-track-step-blocked .ws-track-mark {
  border-width: 4px;
  border-color: var(--amber-600);
  background: var(--amber-50);
  color: var(--amber-800);
}

.ws-track-step-ended .ws-track-mark {
  border-width: 4px;
  border-color: var(--danger);
  color: var(--danger);
}

.ws-track-step-future .ws-track-mark {
  border-style: dashed;
}

.ws-track-label {
  font-size: var(--fs-text, 13px);
  font-weight: 600;
  color: var(--silver-500);
  overflow-wrap: anywhere;
}

.ws-track-step-done .ws-track-label {
  color: var(--emerald-800);
}

.ws-track-step-current .ws-track-label {
  color: var(--brand-secondary);
}

.ws-track-step-blocked .ws-track-label {
  color: var(--amber-800);
}

.ws-track-step-ended .ws-track-label {
  color: var(--danger);
}

.ws-track-time {
  font-size: var(--fs-small, 11.5px);
  color: var(--silver-500);
}

/* Server-authored, shown verbatim. */
.ws-track-blocker {
  font-size: var(--fs-hint, 12px);
  font-weight: 500;
  color: var(--amber-800);
  overflow-wrap: anywhere;
}

/* -----------------------------------------------------------------------------
   Side panel

   NON-MODAL on desktop — owner decision OD-13. It does not cover the record,
   it does not lock the page behind it, and it carries no backdrop, because
   keeping the record readable beside the fields is the whole reason those
   actions were classified as side-panel work rather than as modals.

   It scrolls internally when its own content is longer than the viewport. That
   is the overlay's own surface, not a second scroller inside the workspace:
   the panel is `position: fixed` and is not part of the panel flow the
   single-scroll rule governs.

   `z-index` sits BELOW `.modal-backdrop` (100). The two are never open at
   once — `openSidePanel` refuses while the dialog is open — and if that ever
   failed, the dialog would still be the thing on top.
   -------------------------------------------------------------------------- */
.ws-side-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(420px, 100%);
  padding: 22px 24px;
  background: #fff;
  border-left: 1px solid var(--silver-200);
  box-shadow: -18px 0 48px rgba(10, 22, 40, 0.18);
  overflow-y: auto;
}

.ws-side-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ws-side-panel-title {
  margin: 0;
  font-size: 19px;
}

.ws-side-panel-close {
  appearance: none;
  flex: none;
  width: 36px;
  height: 36px;
  /* 6.8.3a, section 1f (point 52): theme tokens, so the night view keeps the "×" readable (a white ground under the
     night view's light grey gave 1.84:1). */
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-card);
  color: var(--text-body);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.ws-side-panel-close:hover {
  background: var(--surface-sunken);
  color: var(--text-strong);
}

.ws-side-panel-lead {
  margin: 0;
  font-size: var(--fs-text, 14px);
  color: var(--silver-700);
}

.ws-side-panel-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.ws-side-panel-actions {
  margin-top: auto;
  padding-top: 6px;
}

/* -----------------------------------------------------------------------------
   Messages panel — Modification 19 (P1-27; R19-LC-18)

   The request's thread, on both request pages, beside every tab. It wears the
   side panel's surface and its narrow-screen sheet (the rules above and below)
   but is its own component (`messages-panel.ts`): it stays open across tabs.
   It sits BELOW the shared side panel (90) and the dialog (100), so a form or
   a confirmation opened from the record is always the thing on top.

   `.ws-side-panel` sets `display: flex`, which would override the `hidden`
   attribute's own rule, so the closed state is restated here.

   The handle is fixed to the viewport's corner so it is reachable from every
   tab and at any scroll; its place in the document keeps it in the tab order
   right after the record's head.
   -------------------------------------------------------------------------- */
.ws-msg-panel {
  z-index: 85;
}

.ws-msg-panel[hidden] {
  display: none;
}

.ws-msg-handle {
  position: fixed;
  right: 16px;
  /* Above the signed-in pages' thin fixed footer (S0 Q37); 16 px where there is none. */
  bottom: calc(16px + var(--portal-footer-h, 0px));
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(10, 22, 40, 0.18);
}

.ws-msg-count[hidden] {
  display: none;
}

.ws-msg-panel .thread {
  flex: 1 1 auto;
}

/* The page behind the messages SHEET neither scrolls nor can be reached; on a
   desktop the panel is non-modal and the record stays scrollable. */
body[data-messages-sheet-open] {
  overflow: hidden;
}

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

/* The head un-sticks before the desktop navigation row disappears: on a
   narrow screen a sticky banner plus a tab strip consumes most of the
   viewport, which is the opposite of the problem this modification is for. */
@media (max-width: 1120px) {
  .ws-head {
    position: static;
    padding-top: 0;
  }
}

@media (max-width: 880px) {
  /* Spec `:1417`: a horizontally scrollable tab list with the current step
     kept visible. `overflow-x` sits on the STRIP, never on an ancestor, so the
     page itself still cannot scroll sideways, and `workspace-tabs.ts` scrolls
     the selected tab back into view.

     A scroll container clips its descendants at its PADDING box, and the focus
     ring is drawn 6px outside a control — so the padding is what stops the
     ring being cut off, and the negative margin puts the strip back where it
     was. The strip's own baseline goes with it: at this width the selected
     tab's underline is the line, and one line is enough. */
  .ws-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    border-bottom: 0;
    padding: 6px;
    margin: 16px -6px 0;
  }

  .ws-tab {
    flex: 0 0 auto;
  }

  /* 6.8.3a, point 24 (the sweep's touch-size note): each tab of a page's head is at least 44 px tall, the usual floor
     for a finger (one class heavier than the head's 36 px rule below, which comes later). */
  .pg-head .pg-head-tools:has(> .pg-tabs-bar) .ws-tabs .ws-tab {
    min-height: 44px;
  }

  /* Release 6.4 review C6: a head's chrome tab strip (item 25, below) keeps the same room for the ring on every side.
     Its base rule comes later at four classes; naming the bar (five) lets this one win, or the first and last tabs'
     rings and the top edge are cut off. */
  .pg-head .pg-head-tools:has(> .pg-tabs-bar) > .pg-tabs-bar .ws-tabs {
    padding: 6px 6px 14px;
  }

  .ws-banner-facts {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-rows: none;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    gap: 6px 14px;
  }

  .ws-banner-facts > dt,
  .ws-banner-facts > dd {
    padding-left: 0;
    border-left: 0;
  }

  /* Stacked, so no connector dangles at the end of a wrapped row. */
  .ws-track {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    gap: 12px;
  }

  .ws-track-step {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    text-align: left;
  }

  .ws-track-step::after {
    display: none;
  }

  /* The accessible full-screen sheet the specification permits on a narrow
     screen — owner decision OD-13, which took option A with option C's
     narrow-screen behaviour. It covers the viewport, so here it IS modal:
     `side-panel.ts` adds `aria-modal`, traps Tab and sets `data-sheet-open`
     while this rule is the one in force. */
  .ws-side-panel {
    inset: 0;
    width: 100%;
    border-left: 0;
    box-shadow: none;
  }
}

/* The page behind the SHEET neither scrolls nor can be reached — the same
   mechanism `body[data-modal-open]` already uses for the dialog, under its own
   flag so the two overlays stay distinguishable. There is deliberately no such
   rule for the desktop side panel: keeping the record readable and scrollable
   beside the fields is the whole point of the non-modal choice. */
body[data-sheet-open] {
  overflow: hidden;
}

@media (max-width: 480px) {
  .ws-tab {
    min-height: 44px;
    padding: 10px 12px;
    font-size: var(--fs-text, 14px);
  }

  .ws-side-panel {
    padding: 18px 16px;
  }
}

/* -----------------------------------------------------------------------------
   Spacing utilities
   -------------------------------------------------------------------------- */

/* Seven single-purpose classes, added under a COORDINATOR-OWNED TASK 10
   CORRECTION so workspace markup can express vertical rhythm, and one form
   width, without inline `style` attributes.

   WHY LITERAL PIXELS RATHER THAN TOKENS. There is no spacing scale to reuse.
   `tokens.css` defines colour, radius, shadow, focus-ring and font tokens and
   nothing else, and no `--space-*` custom property exists anywhere under
   `apps/web/src/styles`. The only 14px token in the repository is `--radius`,
   and spending a corner radius on a margin would be a false equivalence: it
   would couple two values that have no reason to move together, so the next
   person to change the radius would silently move a margin.

   Each class sets EXACTLY ONE property. None sets a colour, a layout mode, a
   position, or a dimension other than the single max-width, and none appears
   inside a media query. That is what makes them composable onto any element
   without changing how a primitive behaves — and it is asserted, not just
   intended, in `workspace-primitives.integration.spec.ts`. */

.ws-card-stack {
  margin-top: 24px;
}

/* Modification 19 (P1-23; R19-LC-10): the Admin controls panel, between the
   head and the tab panels, on every tab. Its status line answers its own acts;
   the workflow change folds away under its summary. */
.ws-admin-controls {
  margin: 16px 0 24px;
}

[data-admin-controls-status] {
  margin: 0 0 12px;
}

.ws-admin-workflow {
  margin-top: 16px;
}

.ws-field-gap {
  margin-top: 16px;
}

.ws-notice-gap {
  margin-top: 14px;
}

.ws-content-gap {
  margin-top: 12px;
}

.ws-control-gap {
  margin-top: 10px;
}

.ws-lead-gap {
  margin-bottom: 12px;
}

/* The only dimension here, and deliberately a MAXIMUM: it narrows a form on a
   wide screen and is inert below 560px, so it introduces no breakpoint and
   gives the responsive rules above nothing to disagree with. */
.ws-form-narrow {
  max-width: 560px;
}

/* Tabs in a page's head (release 6.4 item 25: every page with tabs in its banner, both portals, so they look alike;
   the row under the title band is painted as the band's last line, pattern.css), the owner's option 2 of request_tabs_chrome_sketch.html, both portals: each tab is its own
   chrome button, only as wide as its word (no full-width box): a metallic gradient with a white top edge, a thin grey
   rim and a small shadow; the open tab is a blue chrome button with white text; hover lightens. The keyboard's focus
   ring is the light highlight outside the button, clear on the navy band. Kept here with the other workspace rules. */
.pg-head .pg-head-tools:has(> .pg-tabs-bar) .ws-tabs {
  gap: 10px;
  padding: 4px 0 14px;
}

.pg-head .pg-head-tools:has(> .pg-tabs-bar) .ws-tab {
  min-height: 36px;
  padding: 7px 18px;
  border: 1px solid #9aa6b6;
  border-radius: 8px;
  color: #22324a;
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #e6eaf0 22%,
    #c3cbd6 50%,
    #dde2e9 78%,
    #f4f6f9 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(0, 0, 0, 0.35);
  font-size: var(--fs-text, 14px);
  font-weight: 600;
  line-height: 1.2;
  transition: filter 0.15s;
}

.pg-head .pg-head-tools:has(> .pg-tabs-bar) .ws-tab:hover {
  color: #22324a;
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #e6eaf0 22%,
    #c3cbd6 50%,
    #dde2e9 78%,
    #f4f6f9 100%
  );
  filter: brightness(1.06);
}

.pg-head .pg-head-tools:has(> .pg-tabs-bar) .ws-tab[aria-selected='true'] {
  color: #fff;
  border-color: #0d2f66;
  /* Release 6.4 review C7: every stop dark enough for white words (at least 4.5:1 along the whole button, 4.79:1 at
     its lightest, the top); the white top edge is the inset highlight. */
  background: linear-gradient(180deg, #3d70cc 0%, #2f66c4 45%, #1d4ea5 55%, #2f66c4 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 1px 3px rgba(0, 0, 0, 0.4);
  font-weight: 700;
}

.pg-head .pg-head-tools:has(> .pg-tabs-bar) .ws-tab:focus-visible {
  outline: 3px solid var(--brand-highlight);
  outline-offset: 2px;
}

/* 6.8.3a, point 24 (the sweep: at 375 px a row of tabs cut its last tab with no sign that more follow): while the
   row goes on past its right edge (`data-more-right`, scroll-cues.ts), that edge fades out, as a wide table's does. */
.ws-tabs[data-more-right] {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
}

/* 6.8.3a, section 1e (R6): scrolled away from its start (to the open tab), the left edge fades too; both while tabs
   go on at each side. */
.ws-tabs[data-more-left] {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 44px);
  mask-image: linear-gradient(to right, transparent, #000 44px);
}

.ws-tabs[data-more-left][data-more-right] {
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 44px,
    #000 calc(100% - 44px),
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 44px,
    #000 calc(100% - 44px),
    transparent
  );
}

/* 6.8.3a, section 1f (point 40: the company page's nine tabs broke onto two rows at 1280 px): on a wide screen too, a
   head's tabs keep one row; where they do not fit, the row scrolls sideways and fades at the edge where tabs go on
   (the marks above). The padding keeps room for the focus ring on every side, as below 881 px. */
@media (min-width: 881px) {
  :is(.pg-head) .pg-head-tools:has(> .pg-tabs-bar) .ws-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-right: 6px;
    padding-left: 6px;
    margin-right: -6px;
    margin-left: -6px;
  }

  /* Each tab keeps its words on one line, as below 881 px; the row scrolls instead of squeezing them. */
  :is(.pg-head) .pg-head-tools:has(> .pg-tabs-bar) .ws-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* =============================================================================
   The shared page chrome of both portals (P5-F1; DEC:198 to DEC:201, P5-08, P5-11)

   - the page head: the dark blue title band with its ⓘ, a neutral tab bar and the page's filters. While the page
     scrolls only the menu bar and the row of tabs stay in place (C1a, the owner's choice B, which amends DEC:200 and
     DEC:201); the band, the summary and the filters scroll away. On a screen 560px high or lower the row of tabs
     scrolls away too;
   - aligned rows for details cards, one row per fact;
   - the ⓘ toggle;
   - full-width data pages and the working area's own zoom.

   Contrast: every text/background pair below is at least WCAG AA (4.5:1). The title band's text is white or
   --silver-200 on --navy-950..--navy-900 (above 12:1); the ⓘ text sits in a white panel in --silver-800.
   ========================================================================== */

/* --- The page head: only the row of tabs stays pinned (C1a, the owner's choice B) ----------------------------- */
/* While a page scrolls, the menu bar and the row of tabs stay in place. The title band with its ⓘ, the summary box and
   the filters scroll away with the page, and a page without tabs keeps only the menu bar.

   A pinned element stays pinned only inside its parent's box. So the head makes no box of its own: its parts are laid
   out as the page's own, and the row of tabs is pinned against the whole page, not against a head that has scrolled
   away. Nothing of the head may therefore be styled on `.pg-head` itself; the guard spec holds that. */
.pg-head {
  display: contents;
}

/* The row of tabs: the tools row that holds a tab bar, with the zoom at its end, and the request page's strip, which
   its script appends to the head itself. A tools row without tabs is not pinned. Pinned at every width: on a narrow
   screen its strip scrolls sideways inside it. Not pinned on a short screen (the rule below). */
.pg-head-tools:has(> .pg-tabs-bar),
.pg-head > .ws-tabs {
  position: sticky;
  top: var(--app-header-h, 68px);
  z-index: 45;
  background: var(--silver-50);
  border-bottom: 1px solid var(--silver-200);
}

/* A short screen (a phone held sideways, a small window): 560px high or lower, the row of tabs is not pinned and
   scrolls away with the page, and only the menu bar stays. On a narrow screen the row is two lines, the strip and the
   zoom under it, and with the menu bar it would keep close to half of such a screen (the layout foundation's
   short-screen rule, R1 N4; ruled for the row on 11 October 2026). `page-chrome.ts` asks the same limit, so that what
   the page scrolls to is not kept clear of a row that is not there. */
@media (max-height: 560px) {
  .pg-head-tools:has(> .pg-tabs-bar),
  .pg-head > .ws-tabs {
    position: static;
  }
}

/* The title band keeps today's look: dark blue, white title. It is a little tighter in the page head. */
.pg-head .app-head {
  padding: 18px 0 16px;
}

.pg-head .app-head h1 {
  display: inline;
  margin: 0;
}

.pg-head-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  justify-content: space-between;
}

/* The neutral tab bar and the page's filters sit under the band, on the neutral ground.

   C1b: the bar never asks for more width than its row has. A flex item is by default at least as wide as its content,
   and on a narrow screen the strip's content is all the tabs in one line, so the bar pushed the page wider than the
   screen. With these two the strip scrolls sideways inside the bar (`workspace.css`, 880px) and the page keeps its
   width. */
.pg-tabs-bar {
  padding-top: 6px;
  min-width: 0;
  max-width: 100%;
}

.pg-tabs-bar .ws-tabs {
  margin-top: 0;
  border-bottom: 0;
}

.pg-filters {
  padding: 8px 0 10px;
}

/* What the page scrolls to lands below the pinned part, never under it: a `#` link, a field reached by the keyboard, a
   form's answer under its button. `page-chrome.ts` measures the menu bar and the row of tabs into the variable; a page
   that does not run it (the public site) keeps the browser's own behaviour. */
html {
  scroll-padding-top: var(--pg-scroll-top, 0px);
}

/* The request page's head was the workspace head, with room above its first row. The head makes no box now, so the
   room is the first row's own; it goes where the workspace head lost it (`workspace.css`, 1120px). */
.ws-head.pg-head > .pg-head-tools {
  padding-top: 20px;
}

@media (max-width: 1120px) {
  .ws-head.pg-head > .pg-head-tools {
    padding-top: 0;
  }
}

/* Nothing of the head has a `max-height` or an `overflow` (R1 N4, N1, N2): a scroller around the title band would
   clip the ⓘ's focus ring and its opened panel. The one scroller is the strip of tabs itself, sideways, on a narrow
   screen (`workspace.css`). */

/* --- The ⓘ toggle ------------------------------------------------------------------------------------------ */
.info {
  display: inline;
}

.info-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  margin-left: 8px;
  padding: 0;
  font: inherit;
  font-size: 15px;
  line-height: 1;
  color: inherit;
  cursor: pointer;
  vertical-align: middle;
}

.info-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
}

.info-toggle:focus-visible {
  outline: 3px solid var(--brand-highlight);
  outline-offset: 2px;
}

.info-toggle[aria-expanded='true'] {
  background: rgba(255, 255, 255, 0.2);
}

.info-text {
  display: block;
  margin-top: 10px;
  padding: 12px 16px;
  max-width: 78ch;
  border-radius: 10px;
  background: #fff;
  color: var(--silver-800);
  font-size: var(--fs-text, 14.5px);
  font-weight: 400;
  line-height: 1.5;
  box-shadow: var(--shadow-card);
}

.info-text[hidden] {
  display: none;
}

/* In a card the ⓘ sits on a white ground, so it is dark. */
.card .info-toggle,
.kv .info-toggle {
  color: var(--navy-800);
}

.card .info-toggle:hover,
.kv .info-toggle:hover {
  background: var(--silver-100);
}

/* --- Aligned rows ------------------------------------------------------------------------------------------ */
.kv {
  margin: 0;
  background: #fff;
  border: 1px solid var(--silver-200);
  border-radius: var(--radius);
  padding: 6px 22px;
  box-shadow: var(--shadow-card);
}

/* A list without a row draws no frame: a card whose record has not arrived yet, or could not be read, shows nothing
   there. `:empty` means nothing at all inside, so a page ships such a list with no space between its tags. */
.kv:empty {
  display: none;
}

/* One row per fact: the label in a fixed column on the left, the value on the right. Each row is its own grid, so a
   long value wraps inside its row and never moves the next label (the cause of P5-32). */
.kv-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 4px 24px;
  padding: 10px 0;
  border-bottom: 1px solid var(--silver-100);
}

.kv-row:last-child {
  border-bottom: 0;
}

.kv-row > dt {
  margin: 0;
  font-size: var(--fs-text, 13px);
  font-weight: 600;
  color: var(--silver-600);
}

.kv-row > dd {
  margin: 0;
  min-width: 0;
  font-size: var(--fs-text, 14.5px);
  color: var(--silver-800);
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .kv-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Full-width data pages and the working area's zoom ------------------------------------------------------- */
.container-wide {
  width: 100%;
  max-width: none;
  padding-left: 24px;
  padding-right: 24px;
}

/*
 * P6 C4: on a page whose working area is full width, the banner's two rows are `.container-wide` too (layout.mjs), so
 * the logo stands at the left edge above the page title and "Sign out" at the right edge above the zoom control. The
 * menu row starts at the left with its normal spacing and is not stretched over the width: its list keeps the width
 * it has inside the 1140 px column (1140 minus the two 24 px side margins).
 */
.app-header-wide .app-nav-links {
  width: min(100%, 1092px);
}

/* The working area only: the header block above is never scaled. `zoom` is supported by every current browser. */
.pg-work {
  zoom: var(--work-zoom, 1);
}

.work-zoom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--silver-700);
  font-size: 13px;
}

.work-zoom button {
  min-width: 32px;
  min-height: 32px;
  border: 1px solid var(--silver-300);
  border-radius: 8px;
  background: #fff;
  color: var(--silver-800);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.work-zoom button:disabled {
  opacity: 0.45;
  cursor: default;
}

.work-zoom button:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

/* --- Neutral tabs everywhere: only the dark blue, then neutral (DEC:200) ---------------------------------------- */
.ws-tab[aria-selected='true'] {
  color: var(--navy-900);
  border-bottom-color: var(--navy-900);
}

/* --- The company pages of P5-F2: a form keeps its reading width while its check table takes the full width ---- */
.form-measure {
  max-width: 820px;
}

.check-wide {
  margin-top: 18px;
}

/* =============================================================================
   The portals' new layout, shared foundation (Modification 19, phase 7, slice S0)

   Task file `docs/project-control/tasks/MOD19-P7-LAYOUT.md` sections 3.1 to 3.4b, 3.7, 4.14, 4.23 and 9.15. Every
   component here is used by both portals. Pages adopt them slice by slice (S1 to S5); the class names are stable.

   Components, in order:
     1. light tables (every signed-in page)
     2. title band with tools and a single title (`.pg-band`)
     3. banner with stage progress (`.p7-banner`, `.p7-progress`)
     4. status strip (`.status-strip`)
     5. ruled fact rows and the action bar (`.fact-rows`, `.action-bar`; `.kv` follows 3.4b too)
     6. chips (`.chip-row`, `.chip`)
     7. status badges (`.status-badge`)
     8. cards in two columns (`.p7-grid`, `.p7-card`)
     9. list rows (`.list-rows`) and timeline (`.timeline`)
    10. the floating ⓘ note (`.info-text` as a popover)
    11. the zoom reset chip (`.zoom-chip`)
    12. the live-update stamp (`.live-stamp`)
    13. the header: search, name menu, sun/moon, bell panel
    14. the company top menu, spread (3.4a)
    15. the administrator left menu (4.14)
    16. dark set for the existing signed-in styles
    17. the administrator detail page header, note and facts (Q40)
    18. the top bar keeps the logo and the portal name whole (Q47)
    19. banner facts with room and thin dividers (6.4 item 27)
    20. the banner's right side on one centre line (6.4 item 17)
   ========================================================================== */

/* --- 1. Light tables (3.4): a light header row, the same row height everywhere ------------------------------- */
body[data-shell] table {
  box-shadow: none;
  border: 1px solid var(--line);
  background: var(--surface-card);
  border-radius: var(--radius-sm);
}

body[data-shell] thead tr {
  background: var(--table-head-bg);
  color: var(--table-head-fg);
}

body[data-shell] th {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-hint, 12.5px);
  font-weight: 600;
  color: var(--table-head-fg);
  border-bottom: 1px solid var(--line);
}

body[data-shell] td {
  padding: 10px var(--space-4);
  border-top: 1px solid var(--line-soft);
  color: var(--text-body);
}

body[data-shell] tbody tr:nth-child(even) {
  background: transparent;
}

body[data-shell] tbody tr:hover {
  background: var(--surface-sunken);
}

/* Actions at the row's right end. */
body[data-shell] td.row-actions,
body[data-shell] th.row-actions {
  text-align: right;
  white-space: nowrap;
}

/* --- 2. Title band with tools and a single title (3.4) -------------------------------------------------------- */
/* Markup:
   <section class="app-head pg-band">
     <div class="container-wide pg-band-row">
       <div class="pg-band-main"><h1>Title</h1> ⓘ <p class="pg-band-sub">One line</p></div>
       <div class="pg-band-tools"> filters, buttons, counts </div>
     </div>
   </section>
   No tool row under the band, no gap. A `.badge` over the title stays only when it adds something. */
.pg-band {
  background: var(--band-bg);
  color: var(--band-fg);
}

.pg-head .app-head.pg-band,
.app-head.pg-band {
  padding: var(--space-4) 0;
}

.pg-band-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
}

.pg-band-main {
  min-width: 0;
}

.pg-band h1 {
  display: inline;
  margin: 0;
  color: var(--band-fg);
  font-size: clamp(22px, 2.6vw, var(--fs-band-title, 28px));
}

.pg-band-sub {
  margin: var(--space-1) 0 0;
  color: var(--band-fg-muted);
  font-size: var(--fs-text, 13.5px);
}

.pg-band-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-text, 13px);
}

/* Tools on the dark band: light outline controls. */
.pg-band-tools .btn-secondary,
.pg-band-tools .btn-band {
  background: transparent;
  color: var(--band-fg);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.pg-band-tools .btn-secondary:hover,
.pg-band-tools .btn-band:hover {
  background: rgba(255, 255, 255, 0.12);
}

.pg-band-tools select,
.pg-band-tools input[type='search'],
.pg-band-tools input[type='text'] {
  min-height: 32px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
  color: var(--band-fg);
  font: inherit;
  font-size: var(--fs-text, 13px);
}

.pg-band-tools select option {
  color: #0f172a;
}

.pg-band-tools label,
.pg-band-tools .hint,
.pg-band-count {
  color: var(--band-fg-muted);
}

/* A tools row that stays under a band (a page not yet in its slice) sits flush: no gap above the content. */
.pg-head-tools:not(:has(> .pg-tabs-bar)):not(:has(> *)) {
  display: none;
}

/* --- 3. Banner with the stages as a thin progress bar (3.4) --------------------------------------------------- */
.p7-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
  padding: var(--space-4) 0;
  background: var(--band-bg);
  color: var(--band-fg);
}

.p7-banner-title {
  margin: 0;
  color: var(--band-fg);
  font-size: clamp(20px, 2.4vw, 26px);
}

.p7-banner-kicker {
  margin: 0;
  font-size: var(--fs-hint, 12.5px);
  color: var(--band-fg-muted);
}

.p7-banner-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin: 0;
}

.p7-banner-fact {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.p7-banner-fact dt {
  font-size: var(--fs-hint, 12px);
  color: var(--band-fg-muted);
}

.p7-banner-fact dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--band-fg);
  overflow-wrap: anywhere;
}

.p7-progress {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--space-1);
  width: 100%;
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

/* Release 6.4 item 36, the owner's option 1 of stage_line_current_step_sketch.html, both portals: done steps a green
   check and a green bar; the current step a white pill with a pulsing blue dot over a thicker bar that glows and
   moves; future steps dim; a step that needs someone amber, where an ended request stopped red, instead of blue. No
   movement for those who ask for less (prefers-reduced-motion). Words: navy on the white pill, light on the navy band
   (AA). */
.p7-progress li {
  position: relative;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  padding-top: 9px;
}

.p7-progress li::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
}

.p7-progress li[data-state='done'] {
  color: var(--band-fg);
}

.p7-progress li[data-state='done']::before {
  background: #5fd39b;
}

.p7-progress li[data-state='done'] .p7-progress-label::before {
  content: '\2713\00a0';
  color: #5fd39b;
  font-weight: 700;
}

.p7-progress li:is([data-state='current'], [data-state='attention'], [data-state='ended'])::before {
  top: -1px;
  height: 6px;
}

.p7-progress li[data-state='current']::before {
  background: linear-gradient(90deg, #4f8ef0, #a9c9ff, #4f8ef0);
  background-size: 200% 100%;
  box-shadow: 0 0 10px rgba(143, 182, 255, 0.8);
  animation: p7-progress-flow 1.6s linear infinite;
}

.p7-progress li[data-state='attention']::before {
  background: linear-gradient(90deg, #d97706, #fcd34d, #d97706);
  background-size: 200% 100%;
  box-shadow: 0 0 10px rgba(252, 211, 77, 0.7);
  animation: p7-progress-flow 1.6s linear infinite;
}

/* Where an ended request stopped (review R-p7-S1, F3): a red mark, not the in-progress one; it does not move. */
.p7-progress li[data-state='ended']::before {
  background: #f87171;
}

.p7-progress
  li:is([data-state='current'], [data-state='attention'], [data-state='ended'])
  .p7-progress-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fff;
  color: #071631;
  font-weight: 700;
}

.p7-progress
  li:is([data-state='current'], [data-state='attention'], [data-state='ended'])
  .p7-progress-label::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f66c4;
}

.p7-progress li[data-state='current'] .p7-progress-label::before {
  animation: p7-progress-pulse 1.2s ease-in-out infinite;
}

.p7-progress li[data-state='attention'] .p7-progress-label::before {
  background: #d97706;
  animation: p7-progress-pulse 1.2s ease-in-out infinite;
}

.p7-progress li[data-state='ended'] .p7-progress-label::before {
  background: #dc2626;
}

/* Mod 19 P8, lane C (C15): a cancelled or closed request ended by choice: a grey mark, not the red one. */
.p7-progress li[data-state='ended'][data-ending='neutral']::before {
  background: #94a3b8;
}

.p7-progress li[data-state='ended'][data-ending='neutral'] .p7-progress-label::before {
  background: #64748b;
}

@keyframes p7-progress-flow {
  to {
    background-position: -200% 0;
  }
}

@keyframes p7-progress-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.35;
    transform: scale(0.7);
  }
}

/* Release 6.4 review C5: as specific as the moving rules above and after them, so it wins the cascade on its own. */
@media (prefers-reduced-motion: reduce) {
  .p7-progress li:is([data-state='current'], [data-state='attention'])::before,
  .p7-progress li:is([data-state='current'], [data-state='attention']) .p7-progress-label::before {
    animation: none;
  }
}

/* --- 4. Status strip (3.4): what is happening now, whether anything needs the user, the actions for it -------- */
.status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-body);
}

.status-strip[data-tone='ok'] {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok-fg);
}

.status-strip[data-tone='warn'] {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn-fg);
}

.status-strip[data-tone='bad'] {
  background: var(--bad-bg);
  border-color: var(--bad-line);
  color: var(--bad-fg);
}

.status-strip[data-tone='busy'] {
  background: var(--busy-bg);
  border-color: var(--busy-line);
  color: var(--busy-fg);
}

.status-strip-text {
  margin: 0;
  min-width: 0;
  font-weight: 600;
}

.status-strip-detail {
  display: block;
  font-weight: 400;
  font-size: var(--fs-text, 13.5px);
  opacity: 0.92;
}

.status-strip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.status-strip-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.status-strip-chips a {
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--surface-card);
  color: inherit;
  font-size: var(--fs-text, 13px);
}

.status-strip details {
  flex-basis: 100%;
  font-size: var(--fs-text, 13.5px);
}

/* --- 5. Ruled fact rows (3.4b) and the action bar ------------------------------------------------------------- */
/* Markup (`fact-rows.ts`):
   <div class="fact-rows">
     <section class="fact-group"><h3 class="fact-group-title">Company</h3>
       <dl class="fact-grid"><div class="fact-row"><dt>Name</dt><dd>Test</dd></div> …</dl>
     </section>
   </div>
   Two columns side by side when the block is wide, one when it is narrow. */
.fact-rows {
  container-type: inline-size;
}

.fact-group + .fact-group {
  margin-top: var(--space-4);
}

.fact-group-title {
  margin: 0 0 var(--space-1);
  font-size: var(--fs-small, 11.5px);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: var(--space-6);
  margin: 0;
}

.fact-row {
  display: grid;
  grid-template-columns: minmax(120px, 40%) minmax(0, 1fr);
  gap: var(--space-1) var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.fact-row > dt {
  margin: 0;
  font-size: var(--fs-text, 13px);
  color: var(--text-muted);
}

.fact-row > dd {
  margin: 0;
  min-width: 0;
  font-size: var(--fs-text, 14px);
  color: var(--text-body);
  overflow-wrap: anywhere;
}

.fact-empty {
  color: var(--text-muted);
}

@container (min-width: 720px) {
  .fact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The existing aligned rows (.kv) follow the same rule: four rows or more stand in two columns side by side when
   the block is wide (about 720 px), in one when it is narrow. A container query cannot read the element it styles
   (review F9), and making every box around a .kv a container would give it no width of its own; so the columns come
   from the grid itself: each column is at least half the block and at least 340 px, never wider than the block. */
.kv:has(> .kv-row + .kv-row + .kv-row + .kv-row) {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(min(100%, max(340px, calc((100% - var(--space-6)) / 2))), 1fr)
  );
  column-gap: var(--space-6);
}

.kv:has(> .kv-row + .kv-row + .kv-row + .kv-row) > .kv-row:last-child {
  border-bottom: 1px solid var(--line-soft);
}

.kv-row {
  border-bottom-color: var(--line);
}

/* The bar under a block: everyday actions on the left, risky ones on the right in red outline. */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.action-bar-start,
.action-bar-end {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Queue Q14: on a phone a long button ("Turn platform automatic processing on…") wraps its words inside the row
   instead of running past its card; a card head lets its tools go under the title. */
@media (max-width: 480px) {
  :is(.action-bar, .action-row, .p7-card-head, .status-strip-actions) .btn {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }

  .p7-card-head {
    flex-wrap: wrap;
  }
}

.btn-risk {
  background: transparent;
  color: var(--bad-fg);
  border: 1px solid var(--bad-line);
}

.btn-risk:hover {
  background: var(--bad-bg);
}

/* --- 6. Chips (filters with counts) ---------------------------------------------------------------------------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 3px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--surface-card);
  color: var(--text-body);
  font: inherit;
  font-size: var(--fs-text, 13px);
  cursor: pointer;
}

.chip[aria-pressed='true'],
.chip[aria-current='true'] {
  background: var(--busy-bg);
  border-color: var(--busy-line);
  color: var(--busy-fg);
  font-weight: 600;
}

.chip-count {
  min-width: 18px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--surface-sunken);
  font-size: var(--fs-small, 11.5px);
  text-align: center;
}

.chip:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

/* --- 7. Status badges (sentence case words; colour never carries the meaning alone) --------------------------- */
.status-badge {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 99px;
  font-size: var(--fs-hint, 12px);
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface-sunken);
  color: var(--text-body);
}

.status-badge[data-tone='ok'] {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.status-badge[data-tone='warn'] {
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.status-badge[data-tone='bad'] {
  background: var(--bad-bg);
  color: var(--bad-fg);
}

.status-badge[data-tone='busy'] {
  background: var(--busy-bg);
  color: var(--busy-fg);
}

/* Release 6.8.2, C5.1 (the owner, 24 Oct 2026): the purple "Internal" mark of an internal request (Queue, request page),
   so it is never mistaken for a company's request. Readable in both views (the words say it; the colour repeats it). */
.status-badge[data-tone='internal'] {
  background: #f3e8ff;
  color: #6d28d9;
}

html[data-theme='dark'] .status-badge[data-tone='internal'] {
  background: #3b1d6e;
  color: #e9d5ff;
}

/* --- 8. Cards in two columns (one on a narrow screen) --------------------------------------------------------- */
.p7-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  margin: var(--space-4) 0;
}

@media (min-width: 1000px) {
  .p7-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .p7-grid-wide-left {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }
}

/* Release 6.7, lane B2: a card that spans both columns of the grid (the rules for items and results). */
.p7-card-wide {
  grid-column: 1 / -1;
}

/* Release 6.8, point 3: the blocks of a Processing page (company tab and System) are full-width rows, one under the
   other: the name and state on the left, the facts in the middle, the buttons on the right. On a narrow screen a row
   stacks in that order. The wide cards (rules table, clean-up) keep their own layout. */
.p8-rows,
.p7-grid.p8-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.p8-rows[data-processing-settings] {
  margin-top: 0;
}

@media (min-width: 1000px) {
  .p8-rows > .p7-card:not(.p7-card-wide) {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(0, 3fr) auto;
    column-gap: var(--space-5);
    align-items: start;
  }

  .p8-rows > .p7-card:not(.p7-card-wide) > .p7-card-head {
    grid-column: 1;
    grid-row: 1 / span 6;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0;
  }

  .p8-rows > .p7-card:not(.p7-card-wide) > :not(.p7-card-head, .action-bar, .action-row) {
    grid-column: 2;
  }

  .p8-rows > .p7-card:not(.p7-card-wide) > :is(.action-bar, .action-row) {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    margin-top: 0;
  }
}

.p7-card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-5);
  min-width: 0;
}

.p7-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.p7-card-title {
  margin: 0;
  font-size: var(--fs-title, 15px);
  color: var(--text-strong);
}

/* --- 9. List rows and the timeline ---------------------------------------------------------------------------- */
.list-rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
}

.list-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: 10px var(--space-4);
  border-top: 1px solid var(--line-soft);
}

.list-row:first-child {
  border-top: 0;
}

.list-row-main {
  flex: 1 1 240px;
  min-width: 0;
}

.list-row-end {
  margin-left: auto;
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  position: relative;
  padding: 0 0 var(--space-3) var(--space-5);
  border-left: 2px solid var(--line);
  margin-left: 5px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface-card);
  border: 2px solid var(--brand-accent);
}

.timeline-item:last-child {
  border-left-color: transparent;
}

.timeline-what {
  margin: 0;
  font-weight: 600;
  color: var(--text-strong);
  font-size: var(--fs-text, 14px);
}

.timeline-meta {
  margin: 0;
  font-size: var(--fs-hint, 12.5px);
  color: var(--text-muted);
}

/* --- 10. The ⓘ as a floating note (3.2) ---------------------------------------------------------------------- */
/* The icon (queue job Q37, the owner's corrections 3 and 4, both portals): icon A, a thin ring with a small "i",
   sized to the text it sits beside: 0.72em, about a capital letter of that text (20 px beside a 28 px title, 10 px
   beside 14 px text; Q50 follow-up), centred on the line, muted, the accent colour on hover or while its note shows.
   One look on every page: these rules come after chrome.css's older 24 px circle. The
   focus ring is for the keyboard only (:focus-visible; a browser draws none for a mouse click, so no rule takes an
   outline away, the visual-parity guard). Until its script has drawn the "i", the icon is not shown (the markup ships
   the ⓘ character, which would draw a second ring). */
.info-toggle[data-info-toggle] {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 0.72em;
  height: 0.72em;
  margin: 0 0 0 0.3em;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: inherit;
  line-height: 1;
  vertical-align: -0.06em;
  cursor: help;
}

.info-toggle[data-info-toggle]:not([data-info-bound]) {
  color: transparent;
}

/* 6.8.3a, section 1f (point 57, WCAG 2.5.8): the ring stays its small size, but the button answers a click on a 24 px
   square around it; a card heading keeps 8 px before what follows (the Full screen button beside the ⓘ). */
.info-toggle[data-info-toggle] {
  position: relative;
}

.info-toggle[data-info-toggle]::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  content: '';
}

:is(.card-title, .p7-card-title, .cb-card-head, .fr-box-head) .info-toggle[data-info-toggle] {
  margin-right: 8px;
}

.info-toggle[data-info-toggle]:hover,
.info-toggle[data-info-toggle][aria-expanded='true'] {
  background: transparent;
  color: var(--brand-accent);
}

.info-toggle[data-info-toggle]:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.info-i {
  font:
    600 0.52em/1 Georgia,
    'Times New Roman',
    serif;
  font-style: normal;
}

/* On the dark title band and banner the icon follows the band's text. */
:is(.app-head, .pg-band, .p7-banner) .info-toggle[data-info-toggle] {
  color: var(--band-fg-muted);
}

:is(.app-head, .pg-band, .p7-banner) .info-toggle[data-info-toggle]:hover,
:is(.app-head, .pg-band, .p7-banner) .info-toggle[data-info-toggle][aria-expanded='true'] {
  color: var(--band-fg);
}

.info {
  position: relative;
  display: inline-block;
}

.info-text {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  left: 0;
  width: max-content;
  max-width: min(360px, calc(100vw - 32px));
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text-body);
  font-size: var(--fs-text, 13.5px);
  line-height: 1.5;
  text-align: left;
  white-space: normal;
  box-shadow: var(--shadow-pop);
}

.info-text[data-align='end'] {
  left: auto;
  right: 0;
}

.info-note-close {
  display: block;
  margin-top: var(--space-2);
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-link);
  font: inherit;
  font-size: var(--fs-text, 13px);
  font-weight: 600;
  cursor: pointer;
}

.info-note-close:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

/* Beside a title the ⓘ follows the title's size, not the band's text (Q50, the owner's correction 3): the icon sits
   after the h1, so each rule that sizes a band's h1 has its twin here, with the same weight, for the h1's ⓘ. Inside
   a heading or a line the icon already follows its text (font-size: inherit). */
.app-head h1 + .info {
  font-size: clamp(24px, 3.5vw, 34px);
}

/* Release 6.4 item 14: a band whose lead line holds only the ⓘ (Settings in both portals, the Notification centre) keeps
   that line's markup (the banner-lead pins: a lead lives on .app-lead) but sets it on the title line, right after the
   title, at the title's size, like every other band's ⓘ. */
.pg-head .app-head h1 + .app-lead:has(> .info:only-child) {
  display: inline;
  margin: 0;
  font-size: clamp(24px, 3.5vw, 34px);
}

.pg-band h1 + .info {
  font-size: clamp(22px, 2.6vw, var(--fs-band-title, 28px));
}

.pg-band .detail-title > .info {
  font-size: clamp(20px, 2.2vw, var(--fs-detail-title, 24px));
}

/* --- 11. The zoom reset chip (3.3) ---------------------------------------------------------------------------- */
/* One stack for the floaters at the bottom right (review F10), from the bottom up: the request pages' Messages handle
   (.ws-msg-handle, 16 px), the zoom chip above it, the new-notification toast above both. Each lifts itself by the
   height of what is shown below it, so none covers another's buttons. */
body[data-shell]:has([data-messages-handle]:not([hidden])) {
  --float-under-chip: 56px;
}

body[data-shell]:has([data-zoom-chip]:not([hidden])) {
  --float-under-toast-chip: 48px;
}

body[data-shell] .notify-toast {
  bottom: calc(
    var(--space-4) + var(--portal-footer-h, 0px) + var(--float-under-chip, 0px) +
      var(--float-under-toast-chip, 0px)
  );
}

.zoom-chip {
  position: fixed;
  right: var(--space-4);
  bottom: calc(var(--space-4) + var(--portal-footer-h, 0px) + var(--float-under-chip, 0px));
  z-index: 65;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 6px 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--surface-raised);
  color: var(--text-body);
  font-size: 13px;
  box-shadow: var(--shadow-pop);
  transition: opacity 0.4s;
}

.zoom-chip[hidden] {
  display: none;
}

.zoom-chip[data-faded='true'] {
  opacity: 0;
  pointer-events: none;
}

.zoom-chip-level {
  font-weight: 600;
  padding-right: var(--space-2);
  border-right: 1px solid var(--line);
}

.zoom-chip button {
  border: 0;
  background: none;
  color: var(--text-link);
  font: inherit;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.zoom-chip button:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 1px;
}

.zoom-chip [data-zoom-chip-close] {
  color: var(--text-muted);
}

/* --- 12. The live-update stamp (9.15) -------------------------------------------------------------------------- */
.live-stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-hint, 12.5px);
  color: var(--band-fg-muted);
}

.live-stamp button {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: var(--fs-text, 14px);
  line-height: 1;
}

.p7-card .live-stamp,
.status-strip .live-stamp {
  color: var(--text-muted);
}

.p7-card .live-stamp button {
  border-color: var(--line-strong);
}

/* --- 13. The header: search, name menu, sun/moon, bell panel -------------------------------------------------- */
.app-header {
  background: var(--surface-card);
}

.nav-cta {
  position: relative;
}

.app-search {
  position: relative;
}

.app-search input {
  width: 220px;
  min-height: 34px;
  padding: 4px 10px 4px 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-body);
  font: inherit;
  font-size: 13px;
}

.app-search svg {
  position: absolute;
  left: 9px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  stroke: var(--text-muted);
  pointer-events: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-body);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-sunken);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

.icon-btn:focus-visible,
.notify-bell:focus-visible,
.name-menu summary:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

/* The sun shows at night (to switch to day), the moon by day. */
.theme-toggle [data-icon='sun'] {
  display: none;
}

html[data-theme='dark'] .theme-toggle [data-icon='sun'] {
  display: block;
}

html[data-theme='dark'] .theme-toggle [data-icon='moon'] {
  display: none;
}

.notify-bell {
  justify-content: center;
  border-radius: 50%;
  color: var(--text-body);
}

.notify-bell:hover {
  background: var(--surface-sunken);
}

.name-menu {
  position: relative;
}

.name-menu summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.name-menu summary::-webkit-details-marker {
  display: none;
}

.name-menu summary:hover,
.name-menu[open] summary {
  background: var(--surface-sunken);
}

.name-menu-panel,
.bell-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 80;
  min-width: 230px;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-pop);
}

.name-menu-panel a,
.name-menu-panel button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-body);
  font: inherit;
  font-size: var(--fs-text, 13.5px);
  text-align: left;
  cursor: pointer;
}

.name-menu-panel a:hover,
.name-menu-panel button:hover,
.name-menu-panel a[aria-current='page'] {
  background: var(--surface-sunken);
  text-decoration: none;
}

.name-menu-label {
  margin: var(--space-2) 10px var(--space-1);
  font-size: var(--fs-small, 11.5px);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.name-menu-panel hr {
  margin: var(--space-1) 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.name-menu-panel button[aria-pressed='true']::after,
.name-menu-panel button[aria-checked='true']::after {
  content: ' ✓';
  color: var(--text-link);
}

.bell-panel {
  width: min(380px, calc(100vw - 24px));
  padding: 0;
}

.bell-panel[hidden] {
  display: none;
}

.bell-panel-head,
.bell-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 10px var(--space-4);
  font-size: var(--fs-text, 13px);
}

.bell-panel-head {
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  color: var(--text-strong);
}

.bell-panel-foot {
  border-top: 1px solid var(--line);
}

/* The answer to "Mark all as read" (review F7); empty, it takes no room. */
.bell-panel-status {
  margin: 0;
  padding: 6px var(--space-4);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-hint, 12px);
  color: var(--ok-fg);
}

.bell-panel-status:empty {
  display: none;
}

.bell-panel-status[data-tone='error'] {
  color: var(--bad-fg);
}

.bell-panel-head button {
  border: 0;
  background: none;
  color: var(--text-link);
  font: inherit;
  font-weight: 400;
  cursor: pointer;
}

.bell-panel-list {
  max-height: min(420px, 60vh);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

/* Release 6.4 item 16: an item without a link (a company notice about no request) is a div; it takes the same box as
   a linked one, so no item touches the panel's edges in either portal. */
.bell-panel-item > :is(a, div) {
  display: block;
  padding: 10px var(--space-4);
  border-top: 1px solid var(--line-soft);
  color: var(--text-body);
  font-size: var(--fs-text, 13px);
}

.bell-panel-item:first-child > :is(a, div) {
  border-top: 0;
}

.bell-panel-item a:hover {
  background: var(--surface-sunken);
  text-decoration: none;
}

.bell-panel-line {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.bell-panel-ref {
  font-weight: 600;
  color: var(--text-strong);
}

.bell-panel-time {
  margin-left: auto;
  color: var(--text-muted);
  font-size: var(--fs-hint, 12px);
  white-space: nowrap;
}

.bell-panel-text {
  display: block;
  color: var(--text-muted);
}

.bell-panel-empty {
  padding: var(--space-4);
  color: var(--text-muted);
  font-size: var(--fs-text, 13px);
}

.unread-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-accent);
  flex: none;
}

.notify-count {
  background: var(--brand-secondary);
}

/* --- 14. The company top menu, spread across the width (3.4a) -------------------------------------------------- */
.app-header-portal .app-nav-links {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.app-header-wide.app-header-portal .app-nav-links {
  width: 100%;
}

.app-header-portal .app-nav-direct > a {
  border-radius: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 10px;
}

.app-header-portal .app-nav-direct > a[aria-current='page'] {
  background: transparent;
  color: var(--brand-secondary);
  border-bottom-color: var(--brand-secondary);
}

/* --- 15. The administrator left menu (4.14) ------------------------------------------------------------------- */
/* The admin document is a two-column frame below the header: the menu and the page. */
.app-frame {
  display: grid;
  grid-template-columns: var(--side-w, 216px) minmax(0, 1fr);
  min-height: calc(100vh - var(--app-header-h, 60px) - var(--portal-footer-h, 0px));
}

html[data-side='collapsed'] .app-frame {
  --side-w: 56px;
}

/* The menu's column keeps its ground and its edge down the whole page: the menu itself is sticky and one screen tall, so on a
   long page its own background stopped at the first screen. */
.app-frame {
  background: linear-gradient(
    to right,
    var(--surface-sunken) calc(var(--side-w, 216px) - 1px),
    var(--line) calc(var(--side-w, 216px) - 1px),
    var(--line) var(--side-w, 216px),
    transparent var(--side-w, 216px)
  );
}

@media (max-width: 1120px) {
  .app-frame {
    background: none;
  }
}

.app-frame > .app-main {
  min-width: 0;
}

.admin-side {
  position: sticky;
  top: var(--app-header-h, 60px);
  align-self: start;
  height: calc(100vh - var(--app-header-h, 60px) - var(--portal-footer-h, 0px));
  padding: var(--space-2) var(--space-2) var(--space-4);
  border-right: 1px solid var(--line);
  background: var(--surface-sunken);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 40;
}

/* Folded, the rail does not scroll: an item's name on hover is drawn outside it, and a scroll box would clip it (one
   axis on auto turns a visible other axis into auto). The fourteen icons fit in any normal height. */
html[data-side='collapsed'] .admin-side {
  overflow: visible;
  /* Above the pinned tab rows (45) the name is drawn over, below the sticky header (50) and its menus. */
  z-index: 48;
}

.admin-side-toggle {
  position: sticky;
  top: 0;
  float: right;
  margin: 2px -2px 0 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-card);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  z-index: 2;
}

.admin-side-toggle:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

html[data-side='collapsed'] .admin-side-toggle {
  float: none;
  display: block;
  margin: 0 auto var(--space-2);
  transform: rotate(180deg);
}

.side-group {
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-group-title {
  margin: var(--space-3) var(--space-2) 2px;
  font-size: var(--fs-small, 11px);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-size: var(--fs-nav, 13px);
  line-height: 1.3;
}

.side-link:hover {
  background: var(--surface-card);
  text-decoration: none;
}

.side-link[aria-current='page'] {
  background: var(--surface-card);
  border-color: var(--line);
  color: var(--brand-secondary);
  font-weight: 600;
}

html[data-theme='dark'] .side-link[aria-current='page'] {
  color: var(--text-link);
}

.side-link:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 1px;
}

.side-icon {
  flex: none;
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.side-count {
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.side-count[hidden] {
  display: none;
}

/* Close-out 41a (the owner's yes of 22 Nov 2026): grey, what waits there for someone else (a company or an applicant),
   after the amber count of the administrator's own step. */
.side-count-quiet {
  background: var(--silver-200);
  color: var(--silver-700);
}

.side-count:not([hidden]) + .side-count-quiet {
  margin-left: 6px;
}

html[data-side='collapsed'] .side-label,
html[data-side='collapsed'] .side-group-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

html[data-side='collapsed'] .side-link {
  justify-content: center;
  padding: 7px 0;
}

/* Collapsed: a dot instead of a count. */
html[data-side='collapsed'] .side-count {
  position: absolute;
  top: 3px;
  right: 7px;
  min-width: 0;
  width: 8px;
  height: 8px;
  padding: 0;
  font-size: 0;
  background: var(--amber-600);
}

/* Collapsed: one dot per item, amber when anything is the administrator's, else grey. */
html[data-side='collapsed'] .side-count-quiet {
  background: var(--silver-400);
}

html[data-side='collapsed'] .side-count:not([hidden]) + .side-count-quiet {
  display: none;
}

/* The name on hover, in the rail. */
html[data-side='collapsed'] .side-link:hover .side-label,
html[data-side='collapsed'] .side-link:focus-visible .side-label {
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  height: auto;
  clip: auto;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--silver-900);
  color: var(--silver-50);
  font-size: 12px;
  z-index: 90;
}

/* The administrator header: no menu row (the menu is on the left). */
.app-header-admin .app-header-nav {
  display: none;
}

@media (max-width: 1120px) {
  .app-frame {
    display: block;
  }

  .admin-side {
    display: none;
  }

  .app-search input {
    width: 160px;
  }
}

@media (max-width: 720px) {
  .app-search {
    display: none;
  }

  .name-menu summary [data-name-text] {
    display: none;
  }
}

/* The mobile drawer reuses the menu's markup: groups and links, stacked. */
.mobile-menu .side-group-title {
  margin-top: var(--space-3);
}

/* Q17: `.mobile-menu a` (layout.css) makes every drawer link a block, which ran the icon, the name and the count
   together ("Queue3"). In the drawer a menu link is the same row as in the left menu: icon, name, count at the end. */
.mobile-menu .side-link {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-menu .side-count {
  margin-left: auto;
}

/* --- 16. Dark set for the existing signed-in styles (9.1) ----------------------------------------------------- */
/* The existing styles name white and navy directly in many rules. On the signed-in pages in dark mode the main
   surfaces and the text follow the dark tokens. Each page's own details are finished in its slice (S1 to S5). */
html[data-theme='dark'] body[data-shell] {
  background: var(--surface-page);
  color: var(--text-body);
}

html[data-theme='dark'] body[data-shell] :is(h1, h2, h3, h4, td.aspect, .who, .stat-card b) {
  color: var(--text-strong);
}

html[data-theme='dark'] body[data-shell] :is(.app-head, .pg-band, .p7-banner) :is(h1, h2, h3) {
  color: var(--band-fg);
}

html[data-theme='dark']
  body[data-shell]
  :is(.card, .kv, .modal, .app-nav-menu, .auth-panel, .ws-side-panel) {
  background: var(--surface-card);
  border-color: var(--line);
}

html[data-theme='dark']
  body[data-shell]
  :is(.section, .bg-white, .bg-silver, .pg-head-tools, .app-main) {
  background: var(--surface-page);
}

html[data-theme='dark'] body[data-shell] .site-header {
  background: var(--surface-card);
  border-color: var(--line);
}

html[data-theme='dark'] body[data-shell] :is(input, select, textarea, .input) {
  background: var(--surface-sunken);
  color: var(--text-body);
  border-color: var(--line-strong);
}

html[data-theme='dark'] body[data-shell] :is(.btn-secondary, .btn-ghost) {
  background: var(--surface-card);
  color: var(--text-body);
  border-color: var(--line-strong);
}

/* The narrow screen's menu button is navy in the light rules; on the dark header it must stand out (review F4). */
html[data-theme='dark'] body[data-shell] .menu-toggle {
  color: var(--text-strong);
}

html[data-theme='dark'] body[data-shell] :is(.logo-name, .app-area-name) {
  color: var(--text-strong);
}

html[data-theme='dark'] body[data-shell] .logo-mark {
  background: #fff;
  border-radius: 50%;
}

html[data-theme='dark'] body[data-shell] a:not(.btn):not(.side-link) {
  color: var(--text-link);
}

html[data-theme='dark'] body[data-shell] .hint {
  color: var(--text-muted);
}

html[data-theme='dark'] body[data-shell] :is(label, .flbl, .ws-tab, .ws-tab[aria-selected='true']) {
  color: var(--text-body);
}

/* Queue Q13: on the title band and the request banner the dark set's own label and hint colours (above) do not apply:
   the band keeps its light-on-navy words (--band-fg-muted, at least 6.6:1). */
html[data-theme='dark']
  body[data-shell]
  :is(.app-head, .pg-band, .p7-banner)
  :is(label, .flbl, .hint, dt, .pg-band-sub, .pg-band-count, .live-stamp, .badge) {
  color: var(--band-fg-muted);
}

html[data-theme='dark'] body[data-shell] .ws-tab[aria-selected='true'] {
  color: var(--text-strong);
  border-bottom-color: var(--brand-highlight);
}

/* Release 6.4 item 25: the chrome tabs of a dark band keep their own words' colours in the dark view (the rules above
   recolour every tab's words for the dark ground; a chrome button is its own light ground). */
/* The row of tabs keeps the band's ground in the dark view too (the dark set's page surface above outweighs the light rule). */
html[data-theme='dark'] body[data-shell] .pg-head .pg-head-tools:has(> .pg-tabs-bar) {
  background: var(--band-bg);
}

html[data-theme='dark'] body[data-shell] .pg-head .pg-head-tools:has(> .pg-tabs-bar) .ws-tab {
  color: #22324a;
}

html[data-theme='dark']
  body[data-shell]
  .pg-head
  .pg-head-tools:has(> .pg-tabs-bar)
  .ws-tab[aria-selected='true'] {
  color: #fff;
  border-bottom-color: #0d2f66;
}

/* --- 3.8, queue job Q20: the shell's Help and footer, and the helpers S3 built with inline styles (review R-p7-S23,
   F8). Colours are the theme's tokens, so the dark set reaches them. ------------------------------------------------ */
.help-toggle {
  font-weight: 700;
  font-size: 16px;
}

.help-wrap {
  position: relative;
}

.help-list {
  padding: 8px 16px;
  max-height: min(420px, 60vh);
  overflow-y: auto;
}

.help-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}

.help-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: var(--fs-text, 13.5px);
}

.help-item p {
  margin: 6px 0 2px;
  font-size: var(--fs-text, 13px);
  color: var(--text-body);
}

/* On a phone the company header has no room for the "?" too: the area's words give way (review R-p7-S23, F3). */
@media (max-width: 520px) {
  .app-header-portal .app-area-name {
    display: none;
  }
}

/* The administrator's longer name (Q50 item 6) keeps its place on a phone: the word mark gives way instead, as the
   logo image carries IHM CAT itself. */
@media (max-width: 520px) {
  .app-header-admin .logo-name {
    display: none;
  }
}

/* The thin footer (Q37, the owner's corrections 2 and 2a, both portals): one low line fixed at the bottom of the
   window, outside the working area, so scrolling and the zoom never move it. The page keeps its height free at the
   bottom; the bottom-right floaters and the administrator's left menu stand above it. */
body[data-shell]:has(> .portal-footer) {
  --portal-footer-h: 30px;
  padding-bottom: var(--portal-footer-h);
}

.portal-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--portal-footer-h, 30px);
  margin: 0;
  padding: 0 24px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background: var(--surface-card);
  font-size: var(--fs-hint, 12px);
  line-height: 1;
  white-space: nowrap;
  color: var(--text-muted);
}

.portal-footer a {
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .portal-footer {
    gap: 16px;
    padding: 0 16px;
  }
}

/* The working area reaches the footer on a short page too (Q50 item 5): the page behind it has the working area's
   colour, and the working area is at least as tall as the room between the top bar and the footer. Release 6.5
   item 1: the administrator portal has no footer; its frame (menu and page) runs to the bottom of the window and
   keeps the same page colour behind it. */
body[data-shell]:has(> :is(.portal-footer, .app-frame)) {
  background: var(--surface-page);
}

body[data-shell]:has(> .portal-footer) .app-main {
  min-height: calc(100vh - var(--app-header-h, 68px) - var(--portal-footer-h, 30px));
}

/* The right-hand column of cards beside a page's main card. */
.p7-col {
  display: grid;
  gap: 16px;
  align-content: start;
}

/* A grey row shaped like the content while it loads, in place of "Loading…". */
.skeleton-bar {
  display: block;
  height: 12px;
  border-radius: 4px;
  background: var(--surface-sunken);
}

/* The small confirmation after an act ("✓ Saved"), at the foot of the screen; it fades by script. */
.done-note {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 66;
  padding: 8px 16px;
  border-radius: 99px;
  border: 1px solid var(--ok-line);
  background: var(--ok-bg);
  color: var(--ok-fg);
  font-size: var(--fs-text, 13.5px);
  font-weight: 600;
  box-shadow: var(--shadow-pop);
}

/* A person's initials in a circle, before their name. */
.initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--busy-bg);
  color: var(--busy-fg);
  font-size: 11.5px;
  font-weight: 700;
  vertical-align: middle;
}

/* A share bar (the month's allowance): the segments' widths are set by script; the words under it say the numbers. */
.p7-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--surface-sunken);
}

.p7-bar-used {
  background: var(--brand-secondary);
}

.p7-bar-progress {
  background: var(--brand-highlight);
}

/* --- 17. The administrator detail page (queue job Q40; the owner's correction 6, 17 October 2026) ------------- */
/* Sketch `admin_detail_page_polished_sketch.html` (records fddcbc2c). Markup, with `detailHeader()` in
   `scripts/app/detail-header.ts` filling the band:
     <div class="pg-head detail-head" data-page-head>
       <section class="app-head pg-band">
         <div class="container-wide detail-band" data-detail-band>
           <a class="detail-back" href="/admin/gates">← Workflow gates</a>
           <div class="detail-title-row">
             <div class="detail-title"><h1>EU-01 · EU Gate 1</h1> .status-badge … <span class="info">…</span></div>
             <div class="detail-actions"><button class="btn btn-band">History</button>
               <button class="btn btn-band-primary">Enable</button></div>
           </div>
           <p class="detail-sub">EU family · used by Open · no connection yet</p>
         </div>
       </section>
       <div class="container-wide pg-head-tools"><div class="pg-tabs-bar" data-workspace-head></div></div>
     </div>
   The tab row keeps its pinned place (P5-C1a) and is painted as the band's last line, so the tabs read as inside
   the banner. Everything starts on the same left edge as the tabs and cards (`container-wide`). */
.detail-band {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.detail-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: -6px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-sm);
  color: var(--band-fg-muted);
  font-size: var(--fs-text, 13.5px);
  font-weight: 600;
  text-decoration: none;
}

.detail-back:hover,
.detail-back:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: var(--band-fg);
  text-decoration: none;
}

.detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  margin: 2px 0 0;
}

.detail-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) 10px;
  min-width: 0;
}

.pg-band .detail-title h1 {
  display: block;
  margin: 0;
  font-size: clamp(20px, 2.2vw, var(--fs-detail-title, 24px));
  overflow-wrap: anywhere;
}

.detail-pills {
  display: contents;
}

/* The actions: every one fully visible (they wrap under the title on a narrow screen, never cut), the main one blue. */
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.detail-actions .btn {
  white-space: nowrap;
}

.btn-band {
  background: transparent;
  color: var(--band-fg);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.btn-band:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--band-fg);
}

.btn-band-primary {
  background: var(--brand-accent);
  color: #fff;
  border: 1px solid var(--brand-accent);
}

.btn-band-primary:hover {
  filter: brightness(1.08);
  color: #fff;
}

.btn-band:focus-visible,
.btn-band-primary:focus-visible {
  outline: 3px solid var(--brand-highlight);
  outline-offset: 2px;
}

.detail-sub {
  margin: 0;
  color: var(--band-fg-muted);
  font-size: var(--fs-text, 13px);
}

/* Release 6.8, point 16: the AI usage fact is a link, but it reads in the colour of its neighbours (Processing time,
   Items ...); a link shows by its underline on hover and on keyboard focus, not by colour. */
.detail-sub a[data-banner-ai-usage] {
  color: inherit;
  text-decoration: none;
}

.detail-sub a[data-banner-ai-usage]:hover,
.detail-sub a[data-banner-ai-usage]:focus-visible {
  text-decoration: underline;
}

/* Review F-f: the dark theme's own link rule (html[data-theme='dark'] body[data-shell] a:not(.btn):not(.side-link))
   is more specific; this one outweighs it so the fact reads in the band colour in both themes. */
html[data-theme='dark']
  body[data-shell]
  .detail-sub
  a[data-banner-ai-usage]:not(.btn):not(.side-link),
html body[data-shell] .detail-sub a[data-banner-ai-usage]:not(.btn):not(.side-link) {
  color: inherit;
}

/* The tab row painted as the band's last line: light tabs, the current one underlined. */
.detail-head .app-head.pg-band {
  padding-bottom: var(--space-2);
}

.detail-head .pg-head-tools {
  background: var(--band-bg);
  border-bottom: 0;
}

/* Release 6.4 item 25: on every page whose head holds a row of tabs, that row is the band's last line (its tabs are
   chrome buttons, workspace.css), both portals; the detail pages above already were. */
.pg-head .pg-head-tools:has(> .pg-tabs-bar) {
  background: var(--band-bg);
  border-bottom: 0;
}

.pg-head:has(> .pg-head-tools > .pg-tabs-bar) > .app-head {
  padding-bottom: var(--space-2);
}

/* The note: only when it adds who, when or why (never a state the pills show), with its link on the right. */
.detail-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  margin: 0 0 var(--space-4);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn-fg);
  background: var(--surface-card);
  color: var(--text-body);
  font-size: var(--fs-text, 13.5px);
}

.detail-note[data-tone='ok'] {
  border-left-color: var(--ok-fg);
}

.detail-note[data-tone='bad'] {
  border-left-color: var(--bad-fg);
}

.detail-note[data-tone='busy'] {
  border-left-color: var(--busy-fg);
}

/* Facts on a detail page: the ruled rows of 3.4b in two columns side by side, a line between the columns, each label
   next to its value; a link beside a value ("Assign") stays on its line. */
@container (min-width: 720px) {
  .detail-facts .fact-grid {
    column-gap: 0;
  }

  .detail-facts .fact-row {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .detail-facts .fact-row:nth-child(odd) {
    border-right: 1px solid var(--line);
  }
}

.detail-facts .fact-row > dd a {
  margin-left: var(--space-2);
}

/* --- 18. The top bar keeps the logo and the portal's name whole (queue job Q47, correction 9) ------------------ */
/* The owner saw "in portal" with the left menu folded: the start of the bar was out of view. The bar is pinned at the
   top already; it is now pinned at the left edge too, so a page scrolled sideways never carries the logo away, and the
   logo with the portal's name keeps its full width in both menu states. */
body[data-shell] .site-header.app-header {
  left: 0;
}

.app-header .logo {
  flex: none;
  min-width: max-content;
}

.app-header .app-area-name {
  white-space: nowrap;
}

/* --- 19. Banner facts with room and thin dividers (release 6.4 item 27) ---------------------------------------- */
/* Sketch request_banner_facts_spacing_sketch.html (agreed: "thin light line separates"): the facts after the title
   (Items, Submitted, Available until, ...) get about 32 px on each side, with a thin light line between the title and
   each fact. Shared: every banner that shows facts this way (.p7-banner-facts) takes it, in both portals. On a narrow
   screen the request banner stacks its facts (workspace.css, 880 px) and the lines go. */
.p7-banner-facts {
  gap: var(--space-2) 0;
}

.p7-banner-fact {
  padding: 0 32px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

/* A list of facts that opens its block (no title before it) starts without a line. */
.p7-banner-facts:first-child > .p7-banner-fact:first-child {
  padding-left: 0;
  border-left: 0;
}

@media (max-width: 880px) {
  .p7-banner-fact {
    padding: 0;
    border-left: 0;
  }

  .p7-banner-facts {
    gap: var(--space-2) var(--space-6);
  }
}

/* --- 20. The banner's right side on one centre line (release 6.4 item 17, the rule for every banner) ---------- */
/* Owner: "not aligning ... should be well finished and well polished". In every banner of both portals, what sits on
   the right (the live stamp, buttons, a filter or a search) stands on one centre line with the title block: one row,
   vertically centred, the controls 36 px high, even 12 px gaps. A narrow screen still wraps the row under the title. */
.pg-band-row {
  align-items: center;
}

.pg-band-tools,
.detail-actions {
  align-items: center;
  gap: var(--space-3);
}

.pg-band-tools :is(.btn, select, input[type='search'], input[type='text']),
.detail-actions :is(.btn, .live-stamp) {
  box-sizing: border-box;
  min-height: 36px;
}

.pg-band-tools .btn,
.detail-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
}

.pg-band-tools .live-stamp {
  min-height: 36px;
}

/* A field in the band takes its own width, not the whole row, and its label stands beside it: a search, a label and
   its list on one line, not a stack. */
.pg-band-tools :is(.input, select, input[type='search'], input[type='text']) {
  width: auto;
  min-width: 12rem;
}

.pg-band-tools :is(label, .flbl):not(.sr-only) {
  display: inline;
  margin: 0;
}

/* --- 21. The controls around a long table (release 6.5 items 5 and 8; `table-controls.ts`), both portals ------- */
/* Sketch `result_table_controls_sketch.html`. Colours come from the theme's tokens, so the dark view needs no twin. */

/* Above the table: the search and its Clear on the left, the table's own zoom on the right. */
.tc-bar,
.tc-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-3);
}

.tc-spacer {
  flex: 1 1 auto;
}

.tc-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 1 auto;
  min-width: 0;
}

.tc-search .tc-search-input {
  width: 320px;
  max-width: 100%;
  min-height: 34px;
  padding: 6px 10px;
}

.tc-btn {
  min-height: 34px;
  padding: 6px 12px;
  font-size: var(--fs-text, 13px);
}

.tc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* The table's zoom: one rounded group, − 100 % + Reset. */
.tc-zoom {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-card);
  overflow: hidden;
}

.tc-zoom-btn,
.tc-zoom-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-body);
  font: inherit;
  font-size: 13px;
}

.tc-zoom > :last-child {
  border-right: 0;
}

.tc-zoom-btn {
  min-width: 34px;
  cursor: pointer;
}

.tc-zoom-btn:hover:not(:disabled) {
  background: var(--surface-sunken);
}

.tc-zoom-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tc-zoom-btn:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: -3px;
}

.tc-zoom-value {
  min-width: 56px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* The table's area: it scrolls sideways inside its card, so every column stays reachable at any zoom; only this
   part is scaled (CSS zoom, so the scroll follows the new size), never the page. */
.tc-scroll {
  margin-top: var(--space-3);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* Release 6.5 review (J4): the table fills its card and short columns keep one line; the long text columns wrap at a
   set width. Only when the card is narrower than the columns together (a small window, or the zoom enlarged) does the
   area scroll sideways, so every column, Confidence included, stays reachable. */
.tc-zoomed > table {
  width: 100%;
}

.tc-zoomed > table :is(th, td) {
  white-space: nowrap;
}

/* The result table's long text columns (both portals, the view and Edit result): Article description (3), Reasoning
   (5) and Regulatory reference (6) wrap at a sensible width; their fields in Edit result fill that width. */
.tc-zoomed > .result-items-table :is(th, td):is(:nth-child(3), :nth-child(5), :nth-child(6)) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.tc-zoomed > .result-items-table th:nth-child(3) {
  width: 18rem;
  min-width: 14rem;
}

.tc-zoomed > .result-items-table th:nth-child(5) {
  width: 28rem;
  min-width: 20rem;
}

.tc-zoomed > .result-items-table th:nth-child(6) {
  width: 16rem;
  min-width: 12rem;
}

.tc-zoomed > .result-items-table td :is(textarea, input[type='text']) {
  width: 100%;
  min-width: 10rem;
}

/* Edit result: the category list shows its longest word ("For human review"); the confidence level and number stand
   one under the other in their column, so the row fits the card at 1920 px. */
.tc-zoomed > .result-items-table tr[data-editable-item] select {
  min-width: 11.5rem;
}

.tc-zoomed > .result-items-table tr[data-editable-item] .result-confidence > span {
  display: block;
}

.tc-zoomed > .result-items-table tr[data-editable-item] .result-confidence > span + span {
  margin-top: var(--space-1);
}

/* Below the table, one line: the readable count on the left; the rows-per-page select with its label and the two
   buttons together on the right. */
.tc-pager {
  color: var(--text-body);
  font-size: var(--fs-text, 13px);
}

.tc-count b {
  color: var(--text-strong);
}

.tc-size-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-text, 13px);
  font-weight: 400;
}

.tc-size-label .tc-size {
  width: auto;
  min-width: 0;
  min-height: 32px;
  padding: 4px 8px;
  font-size: var(--fs-text, 13px);
}

.tc-pager-buttons {
  display: inline-flex;
  gap: var(--space-2);
}

/* ---------------------------------------------------------------------------------------------------------------------
   Release 6.7, lane B2 (point 11): the Retention tab's tiles and its fold of checks and manual actions.
   ------------------------------------------------------------------------------------------------------------------ */
.retention-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.retention-tile {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  min-width: 0;
}

.retention-tile-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
}

.retention-tile-label {
  display: block;
  font-size: var(--fs-hint, 12.5px);
  color: var(--text-muted);
}

.retention-tile[data-tone='ok'] .retention-tile-value {
  color: var(--ok-fg);
}

.retention-tile[data-tone='bad'] {
  border-color: var(--bad-line);
}

.retention-tile[data-tone='bad'] .retention-tile-value {
  color: var(--bad-fg, var(--danger));
}

.retention-tools {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
}

.retention-tools > summary {
  font-weight: 600;
  cursor: pointer;
}

.retention-danger {
  border: 1px solid var(--bad-line);
  background: var(--bad-bg, var(--surface-sunken));
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-4);
}

/* Release 6.8, point 5: the live item count and its bar (the status strip of the administrator's request page). */
.live-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: var(--space-1) 0 0;
  font-size: var(--fs-text, 13px);
}

.live-progress[hidden] {
  display: none;
}

.live-progress-bar {
  width: min(240px, 100%);
  height: 8px;
}

/* Release 6.8, point 20: the compact summary of the current released version on Review and release. */
.version-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-left: 4px solid var(--status-ok, #16a34a);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
}

.version-summary-v {
  font-size: 18px;
  color: var(--text-strong);
}

.summary-fact small {
  display: block;
  font-size: var(--fs-small, 11px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.version-summary-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-left: auto;
}

.version-summary-note {
  flex-basis: 100%;
}

/* Release 6.8 (points 15, 17a): the new notices read in both themes (the shared .notice-info keeps a light-only text
   colour), with the same tokens the company page uses for its intake line. */
:is(
  [data-being-corrected],
  [data-being-corrected-warning],
  [data-edit-taken-over],
  [data-archive-waiting]
) {
  background: var(--busy-bg);
  border-color: var(--busy-line);
  color: var(--busy-fg);
}

/* =============================================================================
   Administrator additions (Modification 19, phase 7, F7; task 9.9 to 9.13)

   After pattern.css (main.css imports this file last). Only what F7 adds:
     1. administrator roles: what a role may not use is hidden (the server refuses it anyway)
     2. View as the company: the fixed banner, the read-only preview, the greyed menu items
     3. the quick jump (Ctrl+K) and the header search's results
     4. the bulk bar and its result panel
     5. the Excel button in a title band
   ========================================================================== */

/* --- 1. Roles (9.13) ------------------------------------------------------------------------------------------- */
body[data-admin-role='OPERATOR'] [data-min-role='ADMINISTRATOR'],
body[data-admin-role='OPERATOR'] [data-admin-write='ADMINISTRATOR'],
body[data-admin-role='VIEWER'] [data-admin-write] {
  display: none !important;
}

.viewer-line {
  color: var(--warn-fg, var(--amber-800));
  margin-top: 4px;
}

/* --- 2. View as the company (9.9) ------------------------------------------------------------------------------- */
.view-as-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--amber-100);
  border-bottom: 1px solid var(--amber-600);
  color: var(--amber-800);
  font-size: var(--fs-text, 14px);
  font-weight: 600;
  padding: 8px 16px;
  text-align: center;
}

.view-as-exit {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.view-as-note {
  font-weight: 400;
}

.view-as-ended {
  background: var(--amber-50);
  border-bottom: 1px solid var(--amber-100);
  color: var(--amber-800);
  padding: 10px 16px;
  text-align: center;
}

body[data-view-as='true'] [data-write-control],
body[data-view-as='true'] [data-download-control],
body[data-view-as='true'] [data-name-menu],
body[data-view-as='true'] [data-bell-mark-all],
body[data-view-as='true'] [data-bell-settings],
body[data-view-as='true'] [data-bell-see-all] {
  display: none !important;
}

.view-as-off {
  color: var(--text-muted, #6b7280) !important;
  cursor: not-allowed;
  opacity: 0.55;
}

/* --- 3. Quick jump (9.12) -------------------------------------------------------------------------------------- */
.quick-jump-backdrop {
  background: rgba(10, 35, 81, 0.35);
  inset: 0;
  position: fixed;
  z-index: 80;
}

.quick-jump {
  background: var(--surface, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(10, 35, 81, 0.25);
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 12px;
  position: fixed;
  top: 12vh;
  transform: translateX(-50%);
  width: 560px;
  z-index: 81;
}

.quick-jump input {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 16px;
  padding: 10px 12px;
  width: 100%;
}

.quick-jump-list,
.app-search-results {
  list-style: none;
  margin: 8px 0 0;
  max-height: 50vh;
  overflow-y: auto;
  padding: 0;
}

.app-search {
  position: relative;
}

.app-search-results {
  background: var(--surface, #fff);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(10, 35, 81, 0.18);
  min-width: 320px;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 70;
}

.quick-jump-item a {
  border-radius: 8px;
  color: inherit;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 8px 10px;
  text-decoration: none;
}

.quick-jump-item[aria-selected='true'] a,
.quick-jump-item a:hover {
  background: var(--brand-light);
}

.quick-jump-kind,
.quick-jump-detail {
  color: var(--text-muted, #6b7280);
  font-size: var(--fs-hint, 12px);
}

.quick-jump-empty {
  color: var(--text-muted, #6b7280);
  padding: 8px 10px;
}

/* --- 4. Bulk bar (9.10) ---------------------------------------------------------------------------------------- */
.bulk-bar {
  align-items: center;
  background: var(--brand-light);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
  padding: 8px 12px;
}

.bulk-result {
  margin: 8px 0;
}

/* --- 5. Excel in a title band (9.11) ----------------------------------------------------------------------------- */
.csv-export {
  white-space: nowrap;
}

html[data-theme='dark'] body[data-shell] :is(.quick-jump, .app-search-results) {
  background: var(--navy-900, #0b1a33);
}

/* =============================================================================
   The edit panel (Modification 19, phase 7; correction 7, owner 17 October; queue Q43)

   Sketch `admin_gate_allocations_edit_panel_sketch.html`. Drawn by `openEditPanel`, `optionCards` and `chipPicker`
   in `scripts/app/side-panel.ts`. The panel wears the side panel's surface (its position, its sheet at 880 px and
   below, its dark set); these rules only lay out its head, parts, footer, option cards and chips, and highlight the
   list row being edited. They name no workspace class, and every colour is a semantic token, so the dark set turns
   them over with the rest of the page. The S0 chat may fold this file into pattern.css later.
   ========================================================================== */

.ep-panel {
  width: min(620px, 92vw);
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.ep-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.ep-title {
  margin: 0;
  font-size: 18px;
  color: var(--text-strong);
}

.ep-sub {
  margin: 2px 0 0;
  font-size: var(--fs-hint, 12.5px);
  color: var(--text-muted);
}

.ep-close {
  appearance: none;
  flex: none;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.ep-close:hover {
  color: var(--text-strong);
  background: var(--surface-sunken);
}

.ep-body {
  flex: 1 1 auto;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px;
}

.ep-muted {
  color: var(--text-muted);
  font-size: var(--fs-hint, 12.5px);
  font-weight: 400;
}

.ep-part {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ep-part-head {
  margin: 0;
  padding: 10px 14px;
  font-size: var(--fs-text, 14px);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 12px;
}

.ep-part-tags {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ep-part-in {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: var(--fs-text, 13.5px);
}

.ep-now {
  font-size: var(--fs-hint, 12px);
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
  background: var(--surface-sunken);
  color: var(--text-muted);
}

.ep-now-ok {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.ep-now-warn {
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.ep-changed {
  font-size: var(--fs-hint, 12px);
  font-weight: 600;
  color: var(--warn-fg);
}

.ep-changed[hidden] {
  display: none;
}

/* Option cards: one choice among a few. */
.ep-opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.ep-opt {
  appearance: none;
  text-align: left;
  font: inherit;
  font-size: var(--fs-text, 13px);
  color: var(--text-body);
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  cursor: pointer;
}

.ep-opt b {
  display: block;
  font-size: var(--fs-text, 13.5px);
  color: var(--text-strong);
}

.ep-opt.ep-on {
  border-color: var(--text-link);
  background: var(--brand-light);
}

.ep-opt.ep-on b {
  color: var(--text-link);
}

/* Chips: several items chosen. */
.ep-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ep-chip {
  appearance: none;
  font: inherit;
  font-size: var(--fs-hint, 12.5px);
  color: var(--text-body);
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
}

.ep-chips-accent .ep-chip.ep-on {
  background: var(--brand-secondary);
  border-color: var(--brand-secondary);
  color: #fff;
}

.ep-chips-ok .ep-chip.ep-on {
  background: var(--emerald-600);
  border-color: var(--emerald-600);
  color: #fff;
}

.ep-off {
  font-style: normal;
  font-size: var(--fs-small, 11px);
  background: var(--warn-bg);
  color: var(--warn-fg);
  border-radius: 999px;
  padding: 0 6px;
  margin-left: 2px;
}

.ep-chip.ep-on .ep-off {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.ep-chip-summary {
  margin: 6px 0 0;
}

.ep-label {
  display: block;
  margin-bottom: 4px;
  font-size: var(--fs-hint, 12.5px);
  font-weight: 600;
  color: var(--text-muted);
}

.ep-reason {
  width: 100%;
  min-height: 58px;
}

.ep-history summary {
  cursor: pointer;
  font-weight: 600;
  font-size: var(--fs-text, 13.5px);
}

.ep-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}

.ep-state {
  margin: 0;
  font-size: var(--fs-hint, 12.5px);
  color: var(--text-muted);
}

.ep-state-refused {
  color: var(--danger);
}

.ep-foot-acts {
  display: flex;
  gap: 8px;
}

.ep-foot-acts .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* The same option cards and chips inside a FORM the page ships: each wraps its real radio or checkbox (the form reads
   it as before), which is visually hidden but keeps the keyboard and the screen reader; the card or chip shows it. */
.ep-opt-field,
.ep-chip-field {
  position: relative;
  display: block;
}

.ep-chip-field {
  display: inline-block;
}

.ep-opt-field input,
.ep-chip-field input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.ep-opt-field:has(input:checked) {
  border-color: var(--text-link);
  background: var(--brand-light);
}

.ep-opt-field:has(input:checked) b {
  color: var(--text-link);
}

.ep-chips-accent .ep-chip-field:has(input:checked) {
  background: var(--brand-secondary);
  border-color: var(--brand-secondary);
  color: #fff;
}

.ep-opt-field:has(input:focus-visible),
.ep-chip-field:has(input:focus-visible),
.ep-opt:focus-visible,
.ep-chip:focus-visible {
  outline: 2px solid var(--text-link);
  outline-offset: 2px;
}

/* The list row being edited, while its panel is open. */
.ep-row-editing > td,
.ep-row-editing > th {
  background: var(--brand-light);
}

/* Release 6.8, point 18 (sketch next_p8_18_sketch.html): the gate setup panel, wider and calmer. Layout only. */
.ep-panel.gs-panel {
  width: min(760px, 94vw);
}

.gs-panel .ep-body {
  gap: 22px;
  padding: 20px 24px;
}

.gs-panel .ep-label {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: var(--fs-hint, 12px);
}

.gs-panel [data-allocation-part] {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gs-panel [data-allocation-part] > p {
  margin: 0;
}

.gs-panel .ep-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.gs-panel .ep-chip {
  border-radius: 6px;
  padding: 6px 10px;
  text-align: left;
}

/* A gate out of service is grey when not chosen. */
.gs-panel .ep-chip:has(.ep-off):not(.ep-on) {
  background: var(--surface-sunken);
  color: var(--text-muted);
}

.gs-panel .gs-try {
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

.gs-panel .gs-result {
  padding: 8px 12px;
  border: 1px solid var(--ok-fg);
  border-radius: 6px;
  background: var(--ok-bg);
  color: var(--ok-fg);
  font-size: var(--fs-text, 13px);
}

/* A preview that could not be read is never drawn as a good answer. */
.gs-panel .gs-result.gs-result-error {
  border-color: var(--bad-line);
  background: var(--bad-bg);
  color: var(--bad-fg);
}

.gs-panel .ep-off {
  display: block;
  margin: 2px 0 0;
  font-size: var(--fs-small, 11px);
}

.gs-panel .gs-warn {
  padding: 8px 12px;
  border-left: 4px solid var(--warn-fg);
  border-radius: 4px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  font-size: var(--fs-text, 13px);
}

.gs-panel .gs-warn[hidden] {
  display: none;
}

/* =============================================================================
   The Website content editors as edit panels (Modification 19, phase 7; correction 7; queue Q52)

   `scripts/app/content-panel.ts` shows each editor's own section inside the shared edit panel (`edit-panel.css`).
   These rules only size it: an editor with its preview beside the fields takes the wide panel, and the section drops
   the page spacing it had when it stood in the working area. Colours are the panel's own tokens.
   ========================================================================== */

.cp-wide {
  width: min(1180px, 96vw);
}

.cp-panel .section-sm {
  padding: 0;
}

.cp-panel .container-wide,
.cp-panel .container {
  max-width: none;
  padding: 0;
}

/* =============================================================================
   Outgoing messages (release 6.7 point 20; the approved sketch next_outgoing_messages_editor_sketch.html)

   After content-panel.css (main.css imports this file last). Only the editor's two columns, the preview card, the
   value chips and the wording tags; colours from the tokens, so both themes follow.
   ========================================================================== */

.outgoing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
  gap: var(--space-4, 1rem);
}
.outgoing-grid > div {
  min-width: 0;
}
.outgoing-mail {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface-sunken);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.outgoing-mail .outgoing-mail-subject {
  color: var(--text-muted, inherit);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.outgoing-value {
  font-family: ui-monospace, Consolas, monospace;
  font-size: var(--fs-hint, 0.85em);
  margin: 0 4px 4px 0;
}
.outgoing-tag {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: var(--fs-small, 0.8rem);
  border: 1px solid var(--line);
  background: var(--surface-sunken);
}
.outgoing-tag[data-state='CHANGED'] {
  border-color: var(--warn-line, var(--line-strong));
}
.outgoing-tag[data-state='OFF'] {
  border-style: dashed;
}
.outgoing-channel {
  white-space: nowrap;
}

/* Release 6.8.2, C5.7 (sketch next_682_admin_outgoing_messages_sketch.html): the toolbar of the box, one line per
   message, area headings, the pills, and the panel's two modes. The frame (`fr-*`) is the shared one. */
.outgoing-toolbar select {
  width: auto;
}
.outgoing-toolbar .fr-box-tools .input {
  width: 220px;
  max-width: 100%;
}
[data-outgoing-list] > .table td,
[data-outgoing-list] > .table th {
  padding-top: 6px;
  padding-bottom: 6px;
  vertical-align: middle;
  /* One line per message (C5.7); a narrow box scrolls sideways with the message name pinned (C0.1 amended). */
  white-space: nowrap;
}
.outgoing-area {
  padding-top: 10px;
  font-size: var(--fs-small, 11px);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-sunken);
}
.outgoing-actions {
  white-space: nowrap;
  text-align: right;
}
.outgoing-tag[data-state='STANDARD'] {
  color: var(--text-muted);
}
.outgoing-tag[data-state='CHANGED'] {
  background: #fff4dc;
  border-color: #e7b54a;
  color: #7a4b00;
}
.outgoing-saved {
  padding: 10px 12px;
}
.outgoing-panel[data-outgoing-mode='view'] [data-outgoing-edit-only],
.outgoing-panel[data-outgoing-mode='edit'] [data-outgoing-view-only] {
  display: none;
}

/* 6.8.3a, point 24 (the sweep: each row's "View" and "Edit" stood past the box's right edge at every width): the long
   "When it is sent" sentences may wrap inside their column (each message stays one row), so the table fits its box
   at 1920 px; the actions cell stays in view at the row's right end whenever the box is narrower than the table, as
   the message name stays pinned at its left. */
[data-outgoing-list] > .table {
  overflow: visible;
}

[data-outgoing-list] > .table td:nth-child(2) {
  min-width: 14rem;
  white-space: normal;
}

[data-outgoing-list] > .table td.outgoing-actions,
[data-outgoing-list] > .table thead th:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--surface-card);
  box-shadow: -8px 0 8px -8px rgba(10, 22, 40, 0.35);
}

[data-outgoing-list] > .table thead th:last-child {
  z-index: 3;
  background: var(--surface-sunken);
}

/* 6.8.3a, point 24, second pass (the point-25 sweep: under 1920 px the sticky View / Edit stood over Channel and
   Wording; nothing may lie under them, at rest or while scrolling). From 881 to 1919 px every cell may wrap, so the
   table fits its box and never scrolls sideways: the actions cell (sticky, with its shadow) covers nothing. Measured:
   1 014 px in a 1 014 px box at 1280, 870 / 870 at 900. */
@media (min-width: 881px) and (max-width: 1919px) {
  [data-outgoing-list] > .table :is(th, td) {
    white-space: normal;
  }

  [data-outgoing-list] > .table td:nth-child(2) {
    min-width: 0;
  }
}

/* Below 881 px each message is a card (as the notification lists are on a phone): one line after another, the full
   width; View and Edit on its last line, in view, standing over nothing. The column headings stay for screen readers
   only. */
@media (max-width: 880px) {
  [data-outgoing-list] > .table,
  [data-outgoing-list] > .table > tbody,
  [data-outgoing-list] > .table > tbody > tr,
  [data-outgoing-list] > .table > tbody > tr > :is(td, th) {
    display: block;
    width: auto;
    min-width: 0;
    box-sizing: border-box;
  }

  [data-outgoing-list] > .table > thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  [data-outgoing-list] > .table > tbody > tr {
    padding: 10px 12px;
    border-top: 1px solid var(--line);
  }

  [data-outgoing-list] > .table > tbody > tr > :is(td, th) {
    padding: 2px 0;
    border: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* Each cell shows its column heading before its value (cell-labels.ts); the message's name stands alone. */
  [data-outgoing-list] > .table > tbody > tr > [data-label]:not(:first-child)::before {
    content: attr(data-label) ': ';
    font-weight: 600;
  }

  [data-outgoing-list] > .table td.outgoing-actions {
    position: static;
    padding-top: 6px;
    box-shadow: none;
    background: transparent;
  }
}

/* =============================================================================
   Release 6.8.2, lane W5: the page-local rules of the administrator pages Oversight, Statistics, AI usage, System,
   Result documents and Guide (C5.6, C5.8 to C5.13). The frame itself (`fr-*`, the boxed tabs, the side panel dock) is
   the shared one of lane B0; nothing here restyles it. Colours from the tokens, so both themes follow; a pill keeps its
   own light ground in both themes.
   ========================================================================== */

/* --- Result documents (C5.6) --- */
.rd-toolbar select {
  width: auto;
}
.rd-toolbar .fr-box-tools .input {
  width: 220px;
  max-width: 100%;
}
.rd-settings {
  flex: 1 1 auto;
}
.rd-badge-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-text, 13px);
}
.rd-badge-box {
  display: grid;
  gap: 8px;
  max-width: 460px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-sunken);
}
.rd-kind {
  display: inline-block;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: var(--fs-small, 11px);
  font-weight: 600;
  color: var(--text-muted);
}
.rd-hint {
  flex: none;
  margin: 0;
  padding: 6px 12px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-hint, 12px);
}
[data-result-documents] tr[data-off] {
  color: var(--text-muted);
}

/* The status pills of the content pages (C5.6): green shown / published, amber draft, blue changed since published,
   grey switched off / archived. */
.pill[data-shown='on'],
.pill[data-guide-state='published'] {
  background: #e3f4e8;
  border-color: #8fcca1;
  color: #1d6b35;
}
.pill[data-shown='off'],
.pill[data-guide-state='archived'],
.pill[data-guide-state='empty'] {
  background: #eef0f3;
  border-color: #c9ced6;
  color: #4b5563;
}
.pill[data-badge],
.pill[data-guide-state='changed'] {
  background: #e6effb;
  border-color: #9dbbe6;
  color: #1f4f8f;
}
.pill[data-guide-state='draft'] {
  background: #fff4dc;
  border-color: #e7b54a;
  color: #7a4b00;
}

/* --- Guide (C5.6) --- */
.guide-switch {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.guide-published-count {
  font-size: var(--fs-hint, 12px);
  color: var(--text-muted);
}

/* --- Statistics on one screen (C5.9) --- */
.stats-one,
.stats-one-inner,
.stats-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}
.stats-panel .stat-grid[data-platform-grid] {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  gap: 8px;
}
.stats-row.p7-grid {
  flex: 1 1 0;
  gap: 10px;
  min-height: 0;
  margin: 0;
}
.stats-row-3.p7-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stats-row-2.p7-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}
.stats-box {
  /* B0's inventory (1280x800): the document was 83 px taller than the window. The screen-reader captions of the
     tables inside a box (`.sr-only`, absolutely placed) were placed against an element outside the box, so the box's
     scrolling did not hold them and they stretched the page. The box is now their frame: they stay inside it. */
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
}
/* Addendum 21: a box whose content is taller than the box scrolls inside it and shows it: a visible thin scroll bar,
   and while more is hidden below (`data-more-below`, set by admin-statistics.ts) a shade along its lower edge. */
.stats-box {
  scrollbar-width: thin;
  scrollbar-gutter: stable;
}
.stats-box[data-more-below]::after {
  content: '';
  position: sticky;
  bottom: -10px;
  z-index: 2;
  display: block;
  height: 28px;
  margin: -28px -12px -10px;
  background: linear-gradient(transparent, rgba(12, 44, 85, 0.16));
  pointer-events: none;
}
/* Addendum 21: the contents are sized to fit the box at 1280x800: a smaller ring with its legend beside it, compact
   table rows, the Processing figures as one line each. B0's type scale (addendum 24): cells read the text size, the
   headings the hint size; a box that then holds more than it shows scrolls inside with its cue. */
.stats-box .table th,
.stats-box .table td {
  padding: 4px 8px;
}
.stats-box .table th {
  font-size: var(--fs-hint, 12.5px);
}
.stats-box .table td {
  font-size: var(--fs-text, 12.5px);
}
.stats-box .stat-grid[data-batches-grid] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 16px;
  margin: 4px 0;
}
.stats-box [data-batches-grid] .stat-metric {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  font-size: var(--fs-text, 12.5px);
}
.stats-box [data-batches-grid] .stat-metric dd {
  margin: 0;
  font-size: var(--fs-text, 13px);
  /* Candidate P-1 (21 Nov 2026): at 375 px "Not available" broke inside its word ("availabl / e"). A value here breaks
     only between words, and the figure's name beside it gives way instead. */
  overflow-wrap: normal;
  word-break: normal;
  text-align: right;
}
.stats-box [data-batches-grid] .stat-metric dt {
  min-width: 0;
}
.stats-box .chart-wrap {
  margin: 6px 0;
}
.stats-box .chart-wrap svg {
  max-height: 140px;
}
.stats-box [data-trend-chart] svg {
  max-height: 112px;
}
/* Addendum 19: a ring's legend keeps its width (addendum 21: about 9.5em, beside a 96px ring) beside the ring, and goes
   under the ring when the box is narrower, never one letter per line. */
.stats-box .donut-chart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  min-height: 0;
}
.stats-box .donut-plot {
  flex: 0 1 96px;
  max-width: 96px;
  margin: 0;
}
.stats-box .donut-legend {
  flex: 1 1 9.5em;
  gap: 2px;
  min-width: min(9.5em, 100%);
}
.stats-box .donut-legend li {
  font-size: var(--fs-hint, 12.5px);
}
.stats-box .donut-key-label {
  overflow-wrap: break-word;
}
.stats-box .chart-data > summary {
  font-size: var(--fs-hint, 12px);
  cursor: pointer;
}
.stats-sub {
  margin: 4px 0;
  font-size: var(--fs-hint, 12px);
  font-weight: 600;
}
.stats-family {
  margin-top: 8px;
}
.stats-internal > * {
  border-top: 2px solid var(--line);
  color: var(--text-muted);
}
[data-more-detail] .p7-card-title {
  font-size: var(--fs-title, 15px);
}
@media (max-width: 1100px) {
  .stats-panel .stat-grid[data-platform-grid] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 880px) {
  .stats-row-3.p7-grid,
  .stats-row-2.p7-grid,
  .stats-panel .stat-grid[data-platform-grid] {
    grid-template-columns: minmax(0, 1fr);
  }
  .stats-row.p7-grid {
    flex: none;
  }
}

/* 6.8.3a, point 24 (the sweep: at 1280 and 1920 px the boxes were cut, the charts squeezed to a few pixels): a row of
   boxes keeps at least 19rem (a chart with its legend, a list of five), so each chart, list and figure shows; on a
   taller window the rows still share the height; on a shorter one the statistics area scrolls under the fixed head. A
   box with more than it shows keeps its own scroll and its shade (addendum 21). */
@media (min-width: 881px) {
  .stats-one {
    overflow-y: auto;
  }

  .stats-row.p7-grid {
    flex: 1 0 auto;
    min-height: 19rem;
  }
}

/* --- AI usage: the page fixed, only the table scrolls (C5.9) --- */
.ai-head {
  gap: 10px 16px;
}
.ai-credit-row.card {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  font-size: var(--fs-text, 13px);
}
.ai-credit-row .card-title {
  margin: 0;
  font-size: var(--fs-text, 13px);
}
.ai-credit-row p {
  margin: 0 !important;
}
.ai-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* Close-out 48 (the owner's "agree" of 23 Nov 2026): the AI credit and the four totals in one row; each total its label
   and value (the line under it is its title). */
.ai-head-top {
  align-items: center;
}
.ai-head-top .ai-tiles {
  margin-left: auto;
}
.ai-tile {
  display: flex;
  flex-direction: column;
  min-width: 104px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.ai-tile strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
/* The toolbar line: Group by (one grouped list), the order in force, then Excel and "How to read this". */
.ai-controls {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}
.ai-tools {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}
/* The headings that set an order: the heading's own words, as a button. */
.ai-table th .ai-sort-head {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}
.ai-table th[aria-sort='ascending'] .ai-sort-head,
.ai-table th[aria-sort='descending'] .ai-sort-head {
  text-decoration: none;
}
.ai-table th .ai-sort-head:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}
/* "Clear filters" in the blue banner, as the banner's other way back reads. */
.pg-band-tools .ai-clear {
  min-height: 32px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: var(--band-fg);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.pg-band-tools .ai-clear[hidden] {
  display: none;
}
.pg-band-tools .ai-clear:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}
.ai-table td.num,
.ai-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* The internal requests' line under its own separator (C5.1 / C5.9). */
.ai-table tr.ai-internal > td {
  border-top: 2px solid var(--line);
  color: var(--text-muted);
}
/* "All, including internal" (addendum 14) closes the table; with it, the Total stands just above it. */
.ai-table tr[data-ai-all] > td {
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: var(--surface-sunken);
}
.ai-table tr[data-ai-total]:has(+ tr[data-ai-all]) > td {
  bottom: 2.4em;
}
/* The Total line stays visible at the bottom of the scrolling table. */
.ai-table tr[data-ai-total] > td {
  position: sticky;
  bottom: 0;
  z-index: 1;
  border-top: 1px solid var(--line);
  background: var(--surface-sunken);
}
.ai-pager {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 6px 12px;
  border-top: 1px solid var(--line);
}
.ai-pager-buttons {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* --- System: each tab is the left column of its sections and ONE box (C5.10 to C5.13) --- */
.sys-body > .sys-panel:not([hidden]) {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: 10px;
  min-width: 0;
  min-height: 0;
}
.sys-panel > [data-panel-status] {
  grid-column: 1 / -1;
  margin: 0 0 8px;
}
.sys-panel > .fr-filters,
.sys-panel > .fr-box {
  grid-row: 2;
}
.sys-panel > .fr-box {
  margin: 0;
}
.sys-sections .input {
  width: 100%;
}
.sys-section-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sys-only-changed {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: var(--fs-text, 13px);
}
/* The parts of the box: the former cards, flat, each with its heading sticky at the top while its rows scroll. */
.sys-parts.p7-grid,
.sys-parts {
  display: block;
  margin: 0;
}
.sys-parts .p7-card {
  margin: 0;
  padding: 0 0 8px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.sys-parts > .p7-card + .p7-card,
.sys-parts [data-health-board] > * + * {
  border-top: 1px solid var(--line);
}
.sys-parts .p7-card > .p7-card-head {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 0 0 6px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-sunken);
}
.sys-parts .p7-card > .p7-card-head .p7-card-title {
  margin: 0;
  font-size: var(--fs-title, 14px);
}
.sys-parts .p7-card > :not(.p7-card-head) {
  margin-left: 12px;
  margin-right: 12px;
}
.sys-parts .p7-card .p7-card {
  padding: 0;
}
/* Addendum 20 (the owner's clarity review): on Processing, the head's link and the sentence of what is in effect take
   the row pattern's sizes: the link as a row's "Change…" (12.5px), the sentence as a row's explanation, a step up
   (13px), not the page's 16px body size. */
.sys-parts .p7-card > .p7-card-head > a {
  font-size: var(--fs-text, 12.5px);
  font-weight: 400;
  white-space: nowrap;
}
.sys-parts [data-processing-in-effect] {
  margin: 4px 0;
  font-size: var(--fs-text, 13px);
}
.sys-group-head.fr-part-head {
  margin: 0 0 6px;
  font-size: var(--fs-title, 14px);
}
.sys-maintenance-grid.p7-grid {
  margin: 0;
}
/* The Administrators tab: its box is the card itself. */
.sys-panel > .fr-box[data-administrators-box] {
  padding: 0;
}
[data-administrators-box] > .p7-card-head {
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

/* One row per setting (C5.10): name and explanation · value in force · last change · Change… */
.sys-row {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1.3fr) auto;
  gap: 4px 14px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.sys-row:last-child {
  border-bottom: 0;
}
.sys-row-explain {
  margin: 2px 0 0;
  font-size: var(--fs-hint, 12px);
}
.sys-row-value {
  font-weight: 600;
}
.sys-row-value .hint {
  font-weight: 400;
}
.sys-row-last {
  font-size: var(--fs-hint, 12px);
}
.sys-row-end {
  justify-self: end;
  min-width: 90px;
  text-align: right;
}
.sys-changed {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid #e7b54a;
  border-radius: 999px;
  background: #fff4dc;
  color: #7a4b00;
  font-size: var(--fs-small, 11px);
  font-weight: 600;
}
@media (max-width: 880px) {
  .sys-body > .sys-panel:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .sys-row {
    /* Two shared columns, so a long value cannot take the label's width (the review, candidate 2e24c92d8). */
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
}
/* The owner's administrator review (candidate 2e24c92d8): below 600px a row stacks, each part at full width: the
   label (with its ⓘ), the value, the explanation, the last change, then the Change… button. Never a column of a few
   pixels with one letter per line. */
@media (max-width: 600px) {
  .sys-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
  }
  .sys-row > *,
  .sys-row-name > * {
    flex: 1 1 100%;
    min-width: 0;
  }
  .sys-row-name {
    display: contents;
  }
  .sys-row-name > strong,
  .sys-row-name > .info {
    flex: 0 1 auto;
    order: 1;
  }
  .sys-row-value {
    order: 2;
  }
  .sys-row-explain {
    order: 3;
    margin: 0;
  }
  /* Audit lane S2, A96: a row's warning reads after its explanation, not above its name. */
  .sys-row [data-number-warning] {
    order: 3;
  }
  .sys-row-last {
    order: 4;
  }
  .sys-row-end {
    order: 5;
    justify-self: auto;
    min-width: 0;
    text-align: left;
  }
}

/* --- Oversight: each tab is its left column and ONE box (C5.8 amended) --- */
.ov-body > .ov-panel:not([hidden]) {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: 240px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: 10px;
  min-width: 0;
  min-height: 0;
}
.ov-panel > [data-panel-status] {
  grid-column: 1 / -1;
  margin: 0 0 8px;
}
.ov-panel > .fr-filters,
.ov-panel > .fr-box {
  grid-row: 2;
}
.ov-panel > .fr-box {
  margin: 0;
}
.ov-filters form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ov-filters .input,
.ov-filters select {
  width: 100%;
}
.ov-filters .ov-more .field {
  margin: 0 0 6px;
}
.ov-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ov-quick > .fr-filter {
  width: auto;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--fs-small, 12px);
}
.ov-routine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: var(--fs-small, 12px);
}
.ov-box-title {
  margin: 0;
  font-size: var(--fs-title, 15px);
}
.ov-note {
  margin: 0;
  padding: 4px 12px;
}
/* The day headings of Activity (C5.8). */
tr.ov-day > th {
  padding: 8px 10px 4px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-card);
  font-size: var(--fs-small, 11px);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  color: var(--text-muted);
}
tr[data-audit-row] {
  cursor: pointer;
}
tr[data-audit-row][aria-current='true'] {
  background: #e8f0fb;
}
/* Refused signals: a row opens its group in the panel (addendum 14). */
tr[data-signal-opens] {
  cursor: pointer;
}
/* Refused signals: the counts in the column. */
.stat-grid[data-signal-metrics] {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  margin: 0;
}
[data-signal-metrics] .stat-metric {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  border: 0;
}
[data-signal-metrics] dd {
  margin: 0;
  font-size: var(--fs-hint, 13px);
}
/* Retention: one list at a time; the tiles as one compact status line in the box's head. */
.ov-panel .retention-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.ov-panel .retention-tile {
  flex-direction: row;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  padding: 3px 9px;
}
.ov-panel .retention-tile-value {
  font-size: var(--fs-text, 15px);
}
.ov-list > .fr-part-head {
  margin: 0;
}
.ov-list .table-scroll {
  overflow: visible;
}
.ov-panel .fr-filter[data-tone='bad'] .fr-filter-count {
  color: var(--bad-fg, #991b1b);
  font-weight: 700;
}
/* Overview: the tiles of what needs the administrator, the facts of the last 24 hours. */
.ov-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  padding: 10px 12px;
}
.ov-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 8px;
  background: var(--surface-card);
}
.ov-tile[data-tone='bad'] {
  border-left-color: #c0392b;
}
.ov-tile[data-tone='warn'] {
  border-left-color: #e0a100;
}
.ov-tile[data-tone='ok'] {
  border-left-color: #2e8b57;
}
.ov-tile-value {
  font-size: 22px;
  font-weight: 700;
}
.ov-tile[data-tone='bad'] .ov-tile-value {
  color: var(--bad-fg, #991b1b);
}
.ov-tile-label {
  font-weight: 600;
}
.ov-tile-detail {
  font-size: var(--fs-hint, 12px);
}
.ov-tile-link {
  align-self: flex-start;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-secondary);
  font: inherit;
  font-size: var(--fs-hint, 13px);
  cursor: pointer;
}
.ov-tile-link:hover {
  text-decoration: underline;
}
.ov-fact {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 8px;
  font-size: var(--fs-hint, 13px);
}
@media (max-width: 880px) {
  .ov-body > .ov-panel:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
}
/* A System card whose title is a bare heading (the limits, layouts and archive cards): the same sticky part head. */
.sys-parts .p7-card > h3.p7-card-title:first-child {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 0 0 6px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-sunken);
  font-size: var(--fs-title, 14px);
}

/* --- Website content editors: Website content, News, Resources, Pages (addenda 24-25, W3's dialog census) --- */
/* Every field wears the shared input style (`class="input"` in the pages); a text field and a select are the same
   height (one line height for both), with the shared focus ring. */
[data-editor-form] :is(input.input, select),
[data-publish-pane] input.input,
.input[data-schedule-at] {
  height: calc(1.5em + 24px);
  line-height: 1.5;
}
/* Paired fields line up: in a two-column row each field's label, field and hint share rows with its neighbour, so a
   label that wraps does not push one field lower than the other. The fields stay inside their card. */
[data-editor-form] > :not(:first-child) {
  margin-top: 14px;
}
[data-editor-form] .form-grid {
  row-gap: 14px;
  column-gap: 18px;
}
/* Four shared rows, each part in its own (R1 on 2589f2f4e): label, field, the field's error (the form rule puts a
   `p.field-error` right after the field when the server refuses it), then the hint. An error never draws over the
   hint, and an empty error row takes no height, so the two fields of a pair stay lined up whether one, both or
   neither has an error. */
[data-editor-form] .form-grid > .field:not([hidden]) {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  row-gap: 0;
  align-content: start;
  min-width: 0;
}
[data-editor-form] .form-grid > .field.full {
  grid-column: 1 / -1;
}
[data-editor-form] .form-grid > .field > .flbl {
  grid-row: 1;
  align-self: end;
}
[data-editor-form] .form-grid > .field > :is(input, select, textarea) {
  grid-row: 2;
  align-self: start;
  margin-top: 6px;
}
[data-editor-form] .form-grid > .field > .field-error {
  grid-row: 3;
  margin: 6px 0 0;
}
[data-editor-form] .form-grid > .field > .hint {
  grid-row: 4;
  margin: 6px 0 0;
}
/* The editor footers: one tidy row, the buttons on the right, directly under the last field. */
[data-editor-form] > .action-row,
[data-publish-pane] .container > .action-row {
  justify-content: flex-end;
  margin-top: 8px;
}

/* 6.8.3a, section 1e (R1: AI providers at 1280 px, the policy table 6 px wider than its box, "Not set" over two lines
   and the State column cut at the right): the policy's code may break after an underscore (provider-policies.ts), so
   the Policy column gives way first; Model, Region and Family keep room for "Not set" on one line. The table then fits
   its box and the State column stands whole. */
table:has(> tbody[data-ai-providers])
  > tbody
  > tr
  > td:is(:nth-child(3), :nth-child(4), :nth-child(5)) {
  min-width: 5.5em;
}

/* 6.8.3a, section 1f (point 41: API access at 1280 px, the Keys table squeezed into half the width, its headings over
   two lines, while History ran the full width): while no client is chosen (its card hidden) the Keys card takes the
   full width; below 1500 px the client's card and its keys stand one under the other. */
.p7-grid:has(> [data-client-detail][hidden]) > [data-panel='credentials'] {
  grid-column: 1 / -1;
}

@media (max-width: 1499px) {
  .p7-grid:has(> [data-panel='credentials']) {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 6.8.3a, section 1g (point 68: at 1920 px the policy code broke, "ANTHROPIC_ / COMMERCIAL", although the table had
   room): from 1500 px the code keeps one line; below it, it may break after an underscore (R1). */
@media (min-width: 1500px) {
  table:has(> tbody[data-ai-providers]) > tbody > tr > td:first-child > strong {
    white-space: nowrap;
  }

  /* Chrome still breaks at a word-break point inside one line's text; the point is taken out here. */
  table:has(> tbody[data-ai-providers]) > tbody > tr > td:first-child > strong > wbr {
    display: none;
  }
}

/* 6.8.3a, section 1g (point 72: Administrators at 1280 px, the last sign-in over two lines): the date keeps one line,
   with the year (the owner's rule). */
tbody[data-administrators] > tr > td:nth-child(5) {
  white-space: nowrap;
}

/* Release 6.8.5, lane S (the approved sketch SKETCH-685-HEALTH-LOAD.html): System > Health, the Load block's
   processing service table. On a phone the "Read" column steps aside so the figures fit without sideways scrolling;
   the time stays in the block's own "Read" line. */
@media (max-width: 640px) {
  table[data-load-service] th:nth-child(4),
  table[data-load-service] td:nth-child(4) {
    display: none;
  }
}

/* --- Release 6.8.5 lane S, amendment 7: Archive vs AI (sketch SKETCH-ARCHIVE-VS-AI.html) ---
   A row of its own under the two rows above, at its natural height (decision (d): reached by scrolling). The month
   columns are HTML (charts.ts explains why); the hatch marks "similar or AI (before the split)" in colour and pattern. */
.stats-row-1.p7-grid {
  grid-template-columns: minmax(0, 1fr);
  flex: 0 0 auto;
}
.aa-row .stats-box {
  overflow: visible;
}
/* Close-out 38b (the owner's yes, 22 Nov 2026: the rows of the first sketch and the line of the second). */
.aa-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.aa-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  font-size: var(--fs-hint, 12.5px);
}
.aa-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.aa-sw {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.aa-exact {
  background: #0c2c55;
}
.aa-similar {
  background: #2f6bb0;
}
.aa-ai {
  background: #e2a33b;
}
/* The part from before the split: one plain grey part (its note at the legend). */
.aa-unsplit {
  background: #c3ccd8;
}
/* Audit lane S2, M1: copied lines (the same article kind, no AI call). */
.aa-copied {
  background: #24786a;
}
html[data-theme='dark'] .aa-sw,
html[data-theme='dark'] .aa-bar {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
}
/* One row per month: the month, its shares above its bar, its AI cost per article at the right. */
.aa-mhead,
.aa-mrow {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 132px;
  column-gap: 14px;
}
.aa-mhead {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line, #e2e8f0);
  color: var(--text-muted, #64748b);
  font-size: var(--fs-hint, 12.5px);
  font-weight: 600;
}
.aa-mhead-cost {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  text-align: right;
}
.aa-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aa-mrow {
  grid-template-rows: auto auto;
  row-gap: 4px;
  align-items: center;
}
.aa-m {
  display: flex;
  flex-direction: column;
  grid-row: 1 / 3;
  color: var(--text-strong, #0a2351);
  font-size: 13.5px;
  font-weight: 600;
}
.aa-mrow.aa-in .aa-m {
  font-weight: 800;
}
.aa-m small,
.aa-c small {
  color: var(--text-muted, #64748b);
  font-size: 11.5px;
  font-weight: 400;
}
.aa-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  color: var(--text-body, #334155);
  font-size: 12.5px;
}
.aa-rn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.aa-rn b {
  color: var(--text-strong, #0a2351);
}
.aa-rn .aa-sw {
  width: 10px;
  height: 10px;
}
.aa-bar {
  display: flex;
  grid-column: 2;
  height: 16px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface-sunken, #f1f5f9);
}
.aa-seg {
  display: block;
  height: 100%;
}
.aa-seg + .aa-seg {
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.7);
}
.aa-c {
  display: flex;
  flex-direction: column;
  grid-row: 1 / 3;
  grid-column: 3;
  align-items: flex-end;
  color: var(--text-strong, #0a2351);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* The AI cost per article, per month: the points (their values written) joined by a line drawn at its measured size. */
.aa-sub {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 8px 0 0;
  color: var(--text-strong, #0a2351);
  font-size: 13px;
  font-weight: 700;
}
.aa-carea {
  position: relative;
  height: 110px;
  border-bottom: 1px solid var(--line-strong, #cbd5e1);
}
.aa-line {
  position: absolute;
  inset: 0;
  overflow: visible;
}
.aa-line polyline {
  fill: none;
  stroke: #a3361f;
  stroke-width: 2;
}
.aa-points {
  display: flex;
  height: 100%;
  justify-content: space-evenly;
  gap: 14px;
}
.aa-pcol {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 360px;
}
.aa-dot {
  position: absolute;
  left: 50%;
  width: 9px;
  height: 9px;
  margin: 0 0 -4.5px -4.5px;
  border-radius: 50%;
  background: #a3361f;
}
html[data-theme='dark'] .aa-line polyline {
  stroke: var(--bad-fg, #fca5a5);
}
html[data-theme='dark'] .aa-dot {
  background: var(--bad-fg, #fca5a5);
}
.aa-pv {
  position: absolute;
  right: -10px;
  left: -10px;
  color: var(--text-strong, #0a2351);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.aa-paxis {
  height: auto;
  margin-top: 4px;
}
.aa-pm {
  color: var(--text-body, #334155);
  font-size: 11.5px;
  text-align: center;
}
.aa-est {
  margin: 0;
  color: var(--text-muted, #64748b);
  font-size: 11.5px;
}
/* The shares and the three figures side by side under the charts; the figures per month at the foot. */
.aa-mid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-top: 4px;
}
.stats-panel .aa-mid .aa-tiles {
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
}
.aa-foot {
  padding-top: 8px;
  border-top: 1px solid var(--line, #e2e8f0);
}
.aa-figs-title {
  margin: 0 0 4px;
  color: var(--text-strong, #0a2351);
  font-size: 13px;
}
.aa-figs {
  margin: 0;
  padding-left: 1.2em;
  color: var(--text-body, #334155);
  font-size: 12.5px;
  line-height: 1.55;
}
.aa-shares td {
  white-space: nowrap;
}
/* The period heading ("1 Apr 2027 – 30 Apr 2027") wraps, so the table fits its box and never scrolls sideways. */
.aa-shares thead th {
  white-space: normal;
}
.aa-shares td:not(:first-child),
.aa-shares th:not(:first-child) {
  text-align: right;
}
.aa-shares .aa-n {
  margin-left: 4px;
  font-size: 11.5px;
  opacity: 0.75;
}
.stats-panel .aa-tiles {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
}
.aa-tiles dd {
  font-size: 15px;
}
.aa-was {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  opacity: 0.8;
}
.aa-up {
  color: #1d6b39;
}
.aa-down {
  color: #a3361f;
}
/* Close-out 38: in Night the rise and fall take the night's own green and red, readable on the dark tiles. */
html[data-theme='dark'] .aa-up {
  color: var(--ok-fg);
}
html[data-theme='dark'] .aa-down {
  color: var(--bad-fg);
}
.aa-links {
  margin: 8px 0 0;
  font-size: var(--fs-hint, 12.5px);
}
@media (max-width: 1100px) {
  .aa-mid {
    grid-template-columns: minmax(0, 1fr);
  }
  .stats-panel .aa-mid .aa-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .stats-panel .aa-tiles {
    grid-template-columns: minmax(0, 1fr);
  }
  .aa-shares .aa-n {
    display: none;
  }
  .aa-shares th {
    white-space: normal;
  }
  .stats-panel .aa-mid .aa-tiles {
    grid-template-columns: minmax(0, 1fr);
  }
  .aa-mhead,
  .aa-mrow {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .aa-mhead-mid {
    display: none;
  }
  .aa-m {
    flex-direction: row;
    grid-row: 1;
    align-items: baseline;
    gap: 8px;
  }
  .aa-c {
    flex-direction: row;
    grid-row: 1;
    grid-column: 2;
    align-items: baseline;
    gap: 4px;
  }
  .aa-nums {
    grid-row: 2;
    grid-column: 1 / -1;
  }
  .aa-bar {
    grid-row: 3;
    grid-column: 1 / -1;
  }
  .aa-carea {
    height: 96px;
  }
  .aa-points {
    gap: 6px;
  }
  .aa-pv {
    font-size: 9.5px;
  }
  .aa-pm {
    font-size: 9.5px;
  }
  #adminStatsCompany {
    max-width: 100%;
  }
}

/* Audit lane S2, round 3 review L2 (21 Nov 2026): in the gate settings panel (System → Numbers) each number keeps its
   unit word ("articles", "calls", "seconds") on the line of its input, at every width. The label stands above them,
   and an error the page writes stands below them. */
[data-sys-fields='gateSettings'] > .field:has(> input) {
  flex-flow: row wrap;
  align-items: center;
  column-gap: 8px;
}

[data-sys-fields='gateSettings'] > .field:has(> input) > * {
  flex: 1 0 100%;
  order: 3;
}

[data-sys-fields='gateSettings'] > .field:has(> input) > .flbl {
  order: 0;
}

[data-sys-fields='gateSettings'] > .field:has(> input) > input {
  flex: 1 1 0;
  min-width: 0;
  order: 1;
}

[data-sys-fields='gateSettings'] > .field:has(> input) > .hint {
  flex: none;
  order: 2;
  white-space: nowrap;
}

/* Audit lane S2, amendment 6: "Resolve all stuck parts (N)", the line above a request's parts (at the top of their scroll
   box, kept at its left while the rows scroll sideways) and above Running now on Processing; the parts in its panel. */
.rq-stuck {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 0 0 10px;
}

.rq-stuck-line {
  margin: 0;
}

.rq-parts-scroll > .rq-stuck {
  position: sticky;
  left: 0;
}

.rq-stuck-list {
  margin: 0 0 10px;
  padding-left: 18px;
}

.rq-stuck-list li {
  margin: 4px 0;
}

/* Audit A38: the archive check's lists in its side panel (stored answers, the proposals of "Accept all"). */
.ac-list {
  margin: 0;
  padding-left: 18px;
}
.ac-list li {
  margin: 2px 0;
}
/* Audit A38: in the archive check's details, a fact's name reads as a name (as the prototype 2.1 draws it). */
aside[data-row-details='archive-check'] dl.kv dt {
  margin-top: 10px;
  font-size: 0.92em;
  font-weight: 600;
  opacity: 0.75;
}
aside[data-row-details='archive-check'] dl.kv dd {
  margin: 2px 0 0;
}
aside[data-row-details='archive-check'] .action-row {
  margin-top: 14px;
}

/* --- The administrator's top bar on a narrow phone (420 px and below) ----------------------------------------------
   At 375 px the bar's right side (search, night view, bell, Account, menu) left the logo side 112 px, and the portal's
   name was cut to "Adminis…" (it needs about 144 px: the mark, then "Administrator" over "portal"). The bar gives a few
   pixels back on both sides instead: narrower margins and gaps, a smaller mark, the name on two lines at the width of
   its longest word, and less padding inside Account and the menu button. Nothing is hidden; every control keeps at
   least 32 px. Above 420 px nothing changes. Administrator header only; the company's header is as before. */
@media (max-width: 420px) {
  body[data-shell] .app-header-admin .app-topbar {
    gap: 4px;
    padding-left: 8px;
    padding-right: 8px;
  }

  body[data-shell] .app-header-admin .app-topbar > .logo {
    gap: 6px;
  }

  body[data-shell] .app-header-admin .app-topbar .logo-mark {
    width: 38px;
  }

  body[data-shell] .app-header-admin .app-topbar .app-area-name {
    width: min-content;
    max-width: none;
    margin-left: 0;
    padding-left: 6px;
    overflow: visible;
  }

  body[data-shell] .app-header-admin .app-topbar .name-menu summary {
    padding-left: 4px;
    padding-right: 4px;
  }

  body[data-shell] .app-header-admin .app-topbar .menu-toggle {
    width: 34px;
    padding-left: 2px;
    padding-right: 2px;
  }
}

/* =============================================================================
   The guide and the documents library (release 6.8 points 27 and 8, Lane G; sketches next_p8_27_sketch.html and
   next_p8_company_documents_sketch.html)

   After the shared files (main.css imports this one last). The guide reader's two columns, the section text, the search
   hits, and the document library's name, badge, type icon and description. Colours from the tokens, so both themes follow.
   ========================================================================== */

.guide-meta {
  margin: 0 0 12px;
  color: var(--text-muted, var(--muted));
  font-size: var(--fs-hint, 0.85rem);
}
.guide-layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.guide-side {
  position: sticky;
  top: 12px;
  border-right: 1px solid var(--line);
  padding-right: 14px;
}
.guide-toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 10px;
  font-size: var(--fs-text, 0.9rem);
}
.guide-toc a {
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
}
.guide-toc a:hover {
  background: var(--brand-light);
}
.guide-toc a[aria-current='true'] {
  background: var(--brand-light);
  color: var(--text-link);
  font-weight: 700;
}
.guide-group {
  margin-top: 10px;
  font-size: var(--fs-small, 0.72rem);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, var(--muted));
}
.guide-article {
  min-width: 0;
  max-width: 78ch;
}
.guide-article h2 {
  margin-top: 0;
}

/* Close-out 33 (the owner, 22 Nov 2026: the reader is crowded). The base reset sets every margin and padding to 0, and
   .guide-body never set them back, so headings sat on the text, the title and the part headings were one size (22.5px),
   and the bullets hung outside the text column. These are the manual chat's sketch's own rules, word for word
   (MOD19-P8-GUIDE-DAILY-WORK-SKETCH.html at 535a2ed0e, "Show the layout rules (lane S2)"); the table and rule spacing at
   the end are neutral extras on the same rhythm. Scoped to the reader; both portals' guides use it. */
.guide-article > h2[data-guide-heading] {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
}
.guide-body {
  font-size: 15px;
  line-height: 1.6;
}
.guide-body > :first-child {
  margin-top: 0;
}
.guide-body h2 {
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 34px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft, var(--line));
}
.guide-body h3 {
  font-size: 1.02rem;
  line-height: 1.35;
  margin: 22px 0 6px;
}
.guide-body h4 {
  font-size: 0.95rem;
  margin: 16px 0 4px;
}
.guide-body p {
  margin: 0 0 12px;
}
.guide-body ul,
.guide-body ol {
  margin: 0 0 14px;
  padding-left: 1.5em;
  list-style-position: outside;
}
.guide-body ul {
  list-style-type: disc;
}
.guide-body ol {
  list-style-type: decimal;
}
.guide-body li {
  margin: 0 0 6px;
  padding-left: 2px;
}
.guide-body li::marker {
  color: var(--text-muted, var(--muted));
}
.guide-body .guide-figure {
  margin: 16px 0 22px;
}
.guide-body .guide-figure img {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.guide-body blockquote {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-left: 4px solid var(--brand, #1d4ed8);
  background: var(--brand-light);
  border-radius: 4px;
}
.guide-body blockquote p:last-child {
  margin-bottom: 0;
}
/* Neutral extras (not in the sketch): a table and a rule keep the lists' rhythm. */
.guide-body .table-scroll {
  margin: 0 0 14px;
}
.guide-body hr {
  margin: 24px 0;
}
.guide-body img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.guide-hit {
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.guide-hit p {
  margin: 2px 0 0;
  color: var(--text-muted, var(--muted));
}
.guide-pager {
  margin-top: 24px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 760px) {
  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .guide-side {
    position: static;
    border-right: 0;
    padding-right: 0;
  }
}
@media print {
  .guide-side,
  .guide-pager {
    display: none;
  }
  .guide-layout {
    display: block;
  }
}

/* The company's Documents page (point 8) */
[data-documents-intro] {
  margin: 12px 0;
  max-width: 80ch;
  color: var(--text-muted, var(--muted));
}
.doc-name {
  line-height: 1.3;
}
[data-portal-documents-list] td {
  vertical-align: top;
}
[data-portal-documents-list] td .hint {
  margin: 3px 0 0;
  max-width: 60ch;
}
[data-portal-documents-list] th[scope='colgroup'] {
  text-align: left;
  background: var(--surface-sunken);
}
.file-kind {
  display: inline-block;
  min-width: 2.2em;
  padding: 1px 5px;
  border-radius: 3px;
  color: #fff;
  font-size: var(--fs-small, 0.65rem);
  font-weight: 700;
  text-align: center;
  background: var(--brand-secondary);
}
.file-kind[data-document-kind='EXCEL'] {
  background: #15803d;
}
.file-kind[data-document-kind='PDF'] {
  background: #b91c1c;
}
.file-kind[data-document-kind='WORD'] {
  background: #1d4ed8;
}
[data-document-badge] {
  margin-left: 4px;
  background: var(--ok-bg);
  color: var(--ok-fg);
}

/* The "?" panel's guide link and the administrator's whole "?" stay out until a guide is published. */
.help-wrap[hidden],
[data-help-guide][hidden] {
  display: none;
}

/* Fix lane H (18 Nov 2026): "Add picture" in the guide editor, and pictures that always fit the reader's width. */
.guide-body .guide-figure img {
  display: block;
  max-width: 100%;
  height: auto;
}
.guide-text-tools {
  margin: 6px 0 2px;
}
.guide-picture-dialog .guide-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 12px;
}
.guide-picture-thumb {
  display: block;
  max-width: 100%;
  max-height: 160px;
  height: auto;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.guide-picture-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}
.guide-picture-option {
  display: grid;
  grid-template-columns: auto 96px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.guide-picture-option .guide-picture-thumb {
  max-height: 64px;
  margin: 0;
}
.guide-picture-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* =============================================================================
   The company portal's page details of release 6.8.2 (lane W2; C4.1 to C4.10)

   Page-specific details only, inside the shared frame of lane B0 (`frame.css`: `.fr-page`, `.fr-body`, `.fr-box`,
   `.fr-scroll`, the side dock). Nothing here repeats the frame. Loaded just before `frame.css`, so the frame wins.
   Text sizes read B0's type tokens (`--fs-text` 15, `--fs-hint` 13.5, `--fs-small` 12.5, `--fs-title` 17; addendum 24
   rule 1), each with its earlier size as the fallback.
   ========================================================================== */

/* A block inside a box that fills the rest of it, so its own `.fr-scroll` can scroll. */
.cp-fill {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.cp-fill[hidden],
.cp-row[hidden] {
  display: none;
}

/* Two boxes side by side, each down to the footer and scrolling inside (Overview, Files and history; C4.2, C4.4). */
.cp-row {
  display: flex;
  flex: 1 1 auto;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.cp-row > .fr-box {
  flex: 1 1 0;
}

.cp-end {
  margin-left: auto;
}

@media (max-width: 880px) {
  .cp-row {
    flex-direction: column;
  }
}

.cp-pad {
  margin: 0;
  padding: 10px 12px;
}

/* 6.8.3a, fault 6 (the owner: a card inside a card): the request's fact rows on the Overview are the box's own rows,
   without a second frame of their own (the `.kv` frame is for a fact list that stands alone). */
.fr-box > .cp-pad > .kv[data-summary] {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* The small line at the bottom of a box (a note, the explaining line, the links of the Results tab). */
.cp-box-foot {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 0;
  padding: 6px 12px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: var(--fs-hint, 12.5px);
}

.cp-box-foot .cp-end {
  margin-left: auto;
}

/* The "Showing only … ✕ Show all" line, the frame's look, for the lines this lane draws itself. */
.cp-box-foot[hidden],
.doc-showing[hidden] {
  display: none;
}

.doc-showing {
  flex: none;
  margin: 0;
  padding: 4px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-sunken);
  font-size: var(--fs-hint, 13px);
}

/* C4.5, C4.6: the bar of filters and the search in the box head. */
.doc-bar .chip-row {
  margin: 0;
}

.doc-search {
  width: auto;
  min-width: 220px;
  margin-left: auto;
}

.doc-download-col {
  width: 130px;
}

/* C4.7: Statistics on one screen. The six figures in one short row; the four charts in a 2 x 2 grid, each sized to its
   quarter. At phone width the grid falls back to one column and the page scrolls (width only: the frame's guard allows
   one height rule in all the stylesheets, the pinned tabs' own). */
@media screen and (min-width: 881px) {
  .cp-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
  }

  .cp-stats > .p7-card {
    flex: none;
    margin: 0;
  }

  .cp-stats .stat-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .cp-stats .stats-chart-grid {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-height: 0;
    margin: 0;
  }

  /* The coordinator's check: tighter card padding, so the charts get the height (about 110 px or more at 1280x800). */
  .cp-stats > .p7-card,
  .cp-stats .stats-chart-card {
    padding: 8px 12px;
  }

  .cp-stats .stats-chart-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0;
    overflow: hidden;
  }

  /* The owner's review: a chart that does not fit scrolls inside its box with W5's shade (`.stats-box`), never cut. */
  .cp-stats .stats-chart-card .chart-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }

  /* The owner's review: each over-time chart fills its box (one panel, its own height). */
  .cp-stats .cp-trend,
  .cp-stats .cp-trend > .trend-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }

  /* The coordinator's check: one box, not a card in a box. The chart is the box's content: no frame, no ground, no
     scroll bar of its own; it scales to the box (the ring boxes keep W5's shade for real overflow). */
  .cp-stats [data-trend-card] .chart-wrap {
    overflow: hidden;
  }

  .cp-stats .cp-trend > .trend-panel {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
  }

  .cp-stats .trend-plot {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin-top: 2px;
  }

  .cp-stats .donut-chart {
    height: 100%;
  }

  .cp-stats .donut-plot {
    width: auto;
    height: 100%;
    max-height: 160px;
  }
}

@media (max-width: 880px) {
  .cp-stats .stats-chart-grid {
    grid-template-columns: 1fr;
  }
}

/* C4.8: a row whose result waits to be downloaded. */
tr[data-new-result] > td {
  background: var(--warn-bg);
}

/* C4.10, C4.9: the Send bar and the paste action bar stay visible at the bottom of the box. */
.cp-action-bar {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-card);
}

.cp-action-bar > .cp-end {
  margin-left: auto;
}

/* C4.1: the Results box: its head, filters and pager stay, the table fills the rest and scrolls inside. */
.cp-results > [data-result-body] {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.cp-results [data-result-scroll] {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.cp-results .p7-card-head,
.cp-results [data-result-chips],
.cp-results [data-table-controls],
.cp-results [data-showing-only],
.cp-results .notice,
.cp-results .tc-pager,
.cp-results [data-table-pager] {
  flex: none;
}

.cp-results .p7-card-head {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.cp-results [data-result-chips],
.cp-results [data-table-controls] {
  padding: 6px 12px 0;
}

.cp-results [data-showing-only] {
  margin: 4px 12px 0;
}

/* C4.9, C4.10: the New request page's working area scrolls inside itself (never the window); its action bars stick to
   its bottom, so Check rows and Send stay in view. */
.cp-scroll-own {
  overflow: auto;
  overscroll-behavior: contain;
}

.cp-sticky-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* C4.1: the request page's banner, shorter: one line with the reference and the facts, the stage bar under it. */
.cp-request-head .p7-banner {
  align-items: center;
  gap: 4px 20px;
  padding: 6px 0;
}

.cp-request-head .p7-banner-title {
  font-size: 19px;
}

.cp-request-head .p7-banner > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.cp-request-head .p7-banner-fact dd {
  font-size: var(--fs-text, 14px);
}

.cp-request-head [data-banner-steps] {
  flex-basis: 100%;
  margin: 0;
}

/* Addendum 19 (the owner's local test, C4.4): the cancel part of the Overview as one compact line under the boxes. */
.cp-cancel-line {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-card);
}

.cp-cancel-line[hidden] {
  display: none;
}

.cp-cancel-title {
  flex: none;
  margin: 0;
  font-size: var(--fs-text, 14px);
}

.cp-cancel-text {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cp-cancel-line > .btn {
  flex: none;
}

/* Addendum 19: the Messages handle at the right of the banner, in the flow: it floats over nothing. */
.cp-msg-handle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Addendum 19 (the coordinator's browser check): the request page's status notice ("Request … was registered") sits
   close above the boxes, without the 20 px margin and the tall padding of a page notice. */
.cp-request [data-status] {
  flex: none;
  margin: 0;
  padding: 6px 12px;
}

/* The owner's review: the Statistics titles in sentence case like every other title ("Requests over time"); the
   shared chart heading capitalises each word. */
.cp-stats .trend-panel-heading h3 {
  text-transform: none;
}

.cp-trend > .trend-panel {
  min-width: 0;
}

/* The owner's review: the request reference stays on one line at phone width (the list scrolls inside its box). */
[data-requests] td:first-child,
[data-requests] td:first-child a {
  white-space: nowrap;
}

/* The coordinator's re-check (Settings): the page's old section and container sit inside the frame's box, which has its
   own padding, so their own top padding and side gutters were a second, empty margin (the gap above "My account"). */
.fr-scroll > .section-sm {
  padding-top: 0;
}

@media (max-width: 600px) {
  .fr-scroll > .section-sm {
    padding-bottom: 16px;
  }

  .fr-scroll > .section-sm > .container-wide {
    padding-right: 0;
    padding-left: 0;
  }

  .fr-scroll > .section-sm .p7-card {
    padding: 12px;
  }
}

/* Addendum 24 (the owner's 1920 px test; approved sketch SKETCH-6.8.2-WIDE-SCREEN.html): no empty right side.
   Subscription with no plan: "Change your plan" on the left, "How a plan starts" and "Offers" on the right (the hidden
   allowance card left the side column in the narrow first track before). Settings > My account: the three cards side by
   side under the facts. Below 900 px everything stacks as before. */
.cp-steps {
  margin: 4px 0 0;
  padding-left: 1.4em;
}

.cp-steps > li + li {
  margin-top: 4px;
}

@media (min-width: 900px) {
  [data-subscription-grid][data-no-plan] {
    grid-template-columns: minmax(0, 1fr);
  }

  [data-subscription-grid][data-no-plan] > [data-subscription-side] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  [data-subscription-grid][data-no-plan] > [data-subscription-side] > * {
    grid-column: 2;
  }

  [data-subscription-grid][data-no-plan] > [data-subscription-side] > [data-plan-change-card] {
    grid-column: 1;
    grid-row: 1 / span 6;
  }

  [data-panel='account']:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 16px;
    align-items: start;
  }

  [data-panel='account'] > h2,
  [data-panel='account'] > [data-account-facts] {
    grid-column: 1 / -1;
  }

  [data-panel='account'] > .form-measure {
    max-width: none;
  }
}

/* Addenda 24-25 (the dialog and form look, W3's census): on the company forms the fields come first, then the buttons
   on the right, as on every dialog. */
.cp-actions-end {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.cp-actions-end[hidden] {
  display: none;
}

/* Addendum 25 (W3's census): the Statistics period dates wear the shared input style, at the band's own field size
   (the band's shared rule names search, text and select fields, not dates). */
.pg-band-tools.cp-stats-band input[type='date'].input {
  box-sizing: border-box;
  width: auto;
  min-width: 0;
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: var(--band-fg);
  font: inherit;
  font-size: var(--fs-text, 13px);
  color-scheme: dark;
}

/* R1's note on addendum 25: on the navy band, the four Statistics controls (Range, Group by, From, To) show a clearly
   visible keyboard focus ring: the dark-ground ring of the shared tokens (light blue #7db8f0 on navy, well above 3:1),
   not the band select's faint highlight. Only the Statistics band. */
.pg-band-tools.cp-stats-band :is(select, input[type='date']):focus-visible {
  outline: 2px solid transparent;
  border-color: var(--brand-highlight);
  box-shadow: var(--focus-ring-dark);
}

/* Addendum 24, administrator Settings (B0's 1920 px inventory; lane W2 took the page): the same rule as the company's
   My account. In the frame's box the old section's own padding is a second, empty margin; Account security's two
   cards side by side across the width from 900 px, stacked below. */
.fr-scroll > [data-settings-section] {
  padding-top: 0;
  padding-bottom: 16px;
}

@media (max-width: 600px) {
  .fr-scroll > [data-settings-section] > .container-wide {
    padding-right: 0;
    padding-left: 0;
  }
}

@media (min-width: 900px) {
  [data-panel='account-security']:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
    align-items: start;
  }

  [data-panel='account-security'] > h2 {
    grid-column: 1 / -1;
  }

  [data-panel='account-security'] > .form-measure {
    max-width: none;
  }

  /* Side by side the cards start on one line (the second card's own top margin is for the stacked view). */
  [data-panel='account-security'] > .form-measure + .form-measure {
    margin-top: 0 !important;
  }
}

/* 6.8.3a, faults 5 and 13: the company request page's scroll rules name `.ws-panel`, so they stand in frame.css. */

/* 6.8.3a, point 24 (found in the point-25 sweep, Files and history at 1280 px): beside History the Files table had
   about 700 px and cut its file names and words to a few letters ("orders…", "Your u…"). Below 1500 px, as on the
   administrator's page (point 17), Files takes the full width and History stands under it, each box scrolling on its
   own. */
@media (min-width: 881px) and (max-width: 1499px) {
  [data-panel='files'] > .cp-row {
    flex-direction: column;
  }
}

/* 6.8.3a, point 24 (found in the point-25 sweep, company Results at 375 px): the company table's fixed columns (6.8.2,
   C4.1) left Supplier and Article description 0 px on a phone, their headings one letter per line (a 406 px heading
   row, the box looked empty). Like the administrator's, the table keeps a least width and its box scrolls sideways:
   the fixed columns (Reasoning's 28rem among them) take about 940 px, so 1 200 px leaves Supplier and Article about
   260 px together, and at 1280 px (a 1 250 px box) the table still fits without a sideways scroll. */
.result-items-table[data-audience='company'] {
  min-width: 1200px;
}

/* 6.8.3a, section 1e (R4: Subscription at 375 px, "This month's allowance" over three lines in a 103 px column): below
   600 px each line of the breakdown is what and its items on one line, its note under it the full width (an empty note
   takes no line). The Note heading stays for screen readers. */
@media (max-width: 599px) {
  table:has(> tbody[data-allowance-breakdown]) :is(thead, tbody) > tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
  }

  table:has(> tbody[data-allowance-breakdown]) :is(thead, tbody) > tr > :is(th, td) {
    padding-right: 10px;
    padding-left: 10px;
  }

  table:has(> tbody[data-allowance-breakdown]) > tbody > tr > td:nth-child(3) {
    grid-column: 1 / -1;
    padding-top: 0;
    font-size: var(--fs-hint, 13px);
  }

  table:has(> tbody[data-allowance-breakdown]) > tbody > tr > td:nth-child(3):empty,
  table:has(> tbody[data-allowance-breakdown]) > tbody > tr > td[colspan] + td {
    display: none;
  }

  table:has(> tbody[data-allowance-breakdown]) > tbody > tr > td[colspan] {
    grid-column: 1 / -1;
  }

  table:has(> tbody[data-allowance-breakdown]) > thead > tr > th:nth-child(3) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* 6.8.3a, section 1f (point 50): the chosen request type's whole words under the list, on a phone only (portal.ts). */
[data-type-words] {
  display: none;
  margin: 4px 0 0;
}

@media (max-width: 599px) {
  [data-type-words] {
    display: block;
  }
}

/* 6.8.3a, section 1h (point 78: "No results have been released yet." touched the Results box's left edge): a sentence
   standing alone in the box has the box's inner padding. */
.fr-box.cp-results > p.hint {
  margin: 0;
  padding: 10px 12px;
}

/* =============================================================================
   The administrator request page (release 6.8.2, lane W1; C2, C3.1 to C3.9, C5.5)

   The page sits in the shared page frame (`.fr-page`, `frame.css`, lane B0): the window does not scroll. Here only the
   page's own blocks: the work area under the head fills what the frame leaves, the open tab fills the work area, and
   each of its boxes scrolls inside itself when its content is longer than its room (both ways, headings fixed; C0.1,
   C0.2). At phone width (880 px and below) the page scrolls as a whole as before (C2), so nothing is cut off; on a
   short screen the open tab itself is the scroller of last resort (the shared guard allows one height rule only, the
   pinned row's, so the page asks no screen height of its own).
   Only `rq-` classes and the page's own hooks; nothing here is shared with another page.
   ========================================================================== */

/* --- The one screen (768 px and wider; 881 px before 6.8.3b, R5) ---------------------------------------------- */
@media (min-width: 768px) {
  .rq-page > .pg-head > * {
    flex: none;
  }

  .rq-page > .section-sm {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    padding: 8px 0 10px;
  }

  .rq-page > .section-sm > .container-wide {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  .rq-page .pg-work {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  .rq-page .pg-work > * {
    flex: none;
  }

  /* C2: no gap above the strip. */
  .rq-page .pg-work > .status-strip {
    margin: 0 0 8px;
  }

  /* The open tab fills the work area; it scrolls itself only when its boxes cannot shrink further. */
  .rq-page .pg-work > [data-panel]:not([hidden]) {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: auto;
  }

  .rq-page .pg-work > [data-panel]:not([hidden]) > * {
    flex: none;
  }

  /* --- Overview (C2): the two boxes fill the screen; only a box scrolls inside ------------------------------------- */
  .rq-page .pg-work > [data-panel='overview']:not([hidden]) > .p7-grid {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
  }

  .rq-page .pg-work > [data-panel='overview']:not([hidden]) > .p7-grid > .p7-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .rq-box-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }

  /* --- Input file and checks (C3.1): one box; only the rows scroll, the page buttons at its bottom --------------- */
  .rq-page .pg-work > [data-panel='workbook-validation']:not([hidden]) > [data-dataset-card] {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    margin: 0;
  }

  [data-dataset-card] > [data-dataset-panel] {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  [data-dataset-panel] > * {
    flex: none;
  }

  [data-dataset-panel] > .rq-input-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }

  /* --- Processing (C3.2): the controls row stays; the parts box fills the rest, only its rows scroll ------------- */
  .rq-page .pg-work > [data-panel='processing']:not([hidden]) > [data-parts-card]:not([hidden]) {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 12rem;
  }

  [data-parts-card] > [data-parts] {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  [data-parts] > * {
    flex: none;
  }

  /* 6.8.3, F11 (CAT-2026-000063: the box showed about one row of seven): every part on its own row, all at once. The
     box takes the height of its rows (it no longer shrinks into a small inner scroll area); the open tab scrolls when
     the rows are more than the screen, and "⤢ Full screen" shows them over the whole window. */
  /* 6.8.3b, R5 (the owner's remark 5, and the coordinator's answer 4): only an open block scrolls inside. The Parts box
     takes the room the tab leaves and its rows scroll inside it, their headings fixed, with "More below ↓"
     (scroll-cues.ts); it keeps at least 26rem (its lines and about four rows), so on a short window the tab gives
     the rest. "—" on
     Controls gives Parts its room, "□" the whole window. */
  .rq-page .pg-work > [data-panel='processing']:not([hidden]) > [data-parts-card]:not([hidden]) {
    min-height: 26rem;
  }

  [data-parts] > .rq-parts-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }

  [data-parts] > .rq-parts-scroll > table > thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-card);
  }

  /* --- Files and history (C3.9): files left, history right, each box scrolling on its own --------------------- */
  .rq-page .pg-work > [data-panel='files-evidence']:not([hidden]) > .rq-files-grid {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
  }

  .rq-files-grid > .card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0;
  }

  .rq-files-grid > .card > * {
    flex: none;
  }

  .rq-files-grid > .card > .rq-box-scroll,
  .rq-files-grid > .card > [data-history-scroll] {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
  }

  /* 6.8.3a, faults 1 to 5 (the owner: "only a block inside the window could be scrollable"; nothing unreachable): a
     box's own scroll area never shrinks to nothing on a short window. It keeps room for several rows; below that the
     open tab scrolls (above), and every box around the area grows with it, its border never ending above its rows. */
  .rq-page.rq-page
    .pg-work
    > [data-panel]:not([hidden])
    :is(.rq-box-scroll, .rq-input-scroll, [data-history-scroll]) {
    flex: 1 1 0;
    height: 0;
    min-height: 14rem;
  }

  .rq-page.rq-page
    .pg-work
    > [data-panel]:not([hidden])
    :has(.rq-box-scroll, .rq-input-scroll, [data-history-scroll]) {
    min-height: auto;
  }
}

/* --- Input file and checks (C3.1), every width ---------------------------------------------------------------- */
.rq-input-summary {
  margin: 0 0 8px;
}

.rq-details-link {
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-link);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.rq-details-link:hover {
  text-decoration: underline;
}

.rq-details-link:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

/* One line per item: fixed column widths, a long text cut with "…" (whole on hover, the cell's title). */
.rq-input-table {
  width: 100%;
  table-layout: fixed;
}

.rq-input-table :is(th, td) {
  white-space: nowrap;
}

.rq-input-table[data-columns='6'] :is(th, td):nth-child(1) {
  width: 64px;
}

.rq-input-table[data-columns='6'] :is(th, td):nth-child(2) {
  width: 84px;
}

.rq-input-table[data-columns='6'] :is(th, td):nth-child(4) {
  width: 24%;
}

.rq-input-table[data-columns='6'] :is(th, td):nth-child(5) {
  width: 150px;
}

.rq-input-table[data-columns='6'] :is(th, td):nth-child(6) {
  width: 22%;
}

.rq-cut,
.rq-input-table td:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.rq-input-pager {
  padding-top: 8px;
}

/* --- The strip (C2): one calm line; a routing conflict in amber under it ----------------------------------------- */
.rq-strip-conflict {
  flex: 1 1 100%;
}

.rq-strip-conflict > .notice,
[data-panel='overview'] [data-routing-conflict] > .notice {
  margin: 0 0 8px;
}

/* --- Processing (C3.2): the controls' actions as links ------------------------------------------------------------ */
.rq-control-link {
  font-size: var(--fs-hint, 13px);
  font-weight: 600;
  color: var(--text-link);
}

.rq-control-link:hover {
  text-decoration: underline;
}

.rq-control-link:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

/* --- Processing (C3.2), every width ------------------------------------------------------------------------------- */
/* The title line: "Parts ⓘ", then the summary, the counts and the release line, one line where it fits. */
[data-parts-card] > .card-title {
  display: inline;
  margin-right: 10px;
}

/* 6.8.3, F11: "⤢ Full screen" at the right end of the Parts title line, as on the Result box. */
[data-parts-card] > .card-title > [data-parts-full-screen] {
  float: right;
  margin-left: 10px;
}

.rq-parts-summary,
[data-parts-card] > [data-processing-counts],
[data-parts-card] > [data-processing-release] {
  display: inline;
  margin: 0 10px 0 0;
}

[data-parts-card] > [data-parts] {
  margin-top: 8px;
}

/* One line per part: no wrapping; the state's whole line is the pill's hover (and stays for a screen reader). */
.rq-part-row > td {
  white-space: nowrap;
}

.rq-part-state,
.rq-part-row [data-part-note],
.rq-part-row [data-part-source] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The second, amber line of a part with a problem: what the return said, the error file, the failed items. */
.rq-part-problem {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  padding: 6px 10px;
  font-size: var(--fs-hint, 13px);
}

.rq-part-errors > summary {
  cursor: pointer;
  font-weight: 600;
}

/* 6.8.3a, fault 10 (the owner: "Resubmit failed items (…)" and "More" cut off, a sideways scroll bar): a part's
   actions wrap inside their cell, each button on one line, right-aligned; the cell stays in view at the row's right end
   when the rows are wider than the box, so every action is fully visible. */
/* The table must not clip (the shared `.table` does, for its round corners): the cell keeps to the scroll box. */
[data-parts] .rq-parts-scroll > table {
  overflow: visible;
}

.rq-part-row > td[data-part-actions] {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--surface-card);
  white-space: normal;
}

.rq-part-row > td[data-part-actions] > .action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin: 0 0 6px;
}

.rq-part-row > td[data-part-actions] .btn {
  white-space: nowrap;
}

/* "More ▾" at the row's end. */
.rq-more {
  position: relative;
  display: inline-block;
  margin-left: 6px;
}

.rq-more > summary {
  list-style: none;
}

.rq-more > summary::-webkit-details-marker {
  display: none;
}

.rq-more-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-card);
  box-shadow: 0 8px 24px rgba(10, 22, 40, 0.16);
}

.rq-more-item {
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-body);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.rq-more-item:hover {
  background: var(--surface-sunken);
}

.rq-more-item:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 1px;
}

/* --- 6.8.3, F13 (approved sketch SKETCH-6.8.3-REVIEW-RESULT-UP.html): the result table higher up. The chips and the
   search (with the zoom and Full screen at its right end) share one line, wrapping on a narrow screen; the three
   downloads are one "Download ▾" menu in the version row (the "More ▾" menu's look). */
.rq-result-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.rq-result-toolbar > [data-result-chips] {
  flex: 0 1 auto;
}

.rq-result-toolbar > :last-child {
  flex: 1 1 320px;
}

.rq-download-menu {
  margin-left: 0;
}

/* --- Review and release (C3.3): one Result box -------------------------------------------------------------------- */
/* While Edit result draws the box's table (editing, rows that are not the released version's, the changed rows), the
   released view stands aside, so the same items are never shown twice. */
[data-result-items].rq-merged {
  display: none;
}

/* --- The internal request (C5.1): the purple "Internal" mark beside the reference --------------------------------- */
.status-badge.rq-internal-mark {
  border-color: #c4b5fd;
  background: #ede9fe;
  color: #5b21b6;
}

/* --- Files and history (C3.9), every width ------------------------------------------------------------------------ */
.rq-box-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}

.rq-box-head > .card-title {
  margin: 0;
}

/* 6.8.3b, R6: the Files heading reads "Files ⓘ  N files · available until …", then "🗑 Delete files…" and "— □". */
.rq-box-head > .cb-summary {
  flex: 1 1 auto;
  min-width: 0;
}

.rq-box-head > .cb-win {
  margin-left: 0;
}

.rq-files-delete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.rq-delete-files-button {
  flex: none;
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  background: var(--surface-card, #fff);
  color: #b91c1c;
  font: inherit;
  font-size: var(--fs-small, 12px);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.rq-delete-files-button:hover {
  background: #fef2f2;
}

.rq-delete-files-button:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--focus-ring);
}

.rq-delete-files-button:disabled {
  border-color: var(--line);
  color: var(--text-muted);
  cursor: default;
}

html[data-theme='dark'] .rq-delete-files-button {
  border-color: #f87171;
  background: transparent;
  color: #fca5a5;
}

/* 6.8.3b, R6: once the files are deleted, their record (who, when, why) takes its own row under the heading; the
   heading line keeps its name, its summary and its "— □" at the right. */
.rq-files-delete:has(> [data-files-deleted]) {
  flex: 1 1 100%;
  order: 100;
  justify-content: flex-start;
}

.rq-files-delete > [data-files-deleted] {
  margin: 0;
}

.rq-files-delete > [data-delete-files-refusal] {
  flex-basis: 100%;
  margin: 0;
}

.rq-files-deleted-title {
  color: var(--bad-fg);
}

/* --- Review and release (C3.5): the administrator's result table, fixed column widths ---------------------------- */
/* Supplier, Article, Other names, Regulatory reference, Confidence and AI usage each stay on one line (cut with "…",
   whole on hover); the reasoning keeps its clamp and "Show more". The company's table is not touched here. */
.result-items-table[data-audience='admin'] {
  table-layout: fixed;
  min-width: 1180px;
}

.result-items-table[data-audience='admin']
  > tbody
  > tr
  > td:is(
    :nth-child(2),
    :nth-child(3),
    :nth-child(4),
    :nth-child(7),
    :nth-child(8),
    :nth-child(9)
  ) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 6.8.3a, point 24 (the point-25 sweep): 64 px cut the heading to "Item Nc"; 84 px holds "Item No." whole. */
.result-items-table[data-audience='admin'] > thead > tr > th:nth-child(1) {
  width: 84px;
}

.result-items-table[data-audience='admin'] > thead > tr > th:nth-child(2) {
  width: 150px;
}

.result-items-table[data-audience='admin'] > thead > tr > th:nth-child(3) {
  width: 220px;
}

.result-items-table[data-audience='admin'] > thead > tr > th:nth-child(4) {
  width: 150px;
}

.result-items-table[data-audience='admin'] > thead > tr > th:nth-child(5) {
  width: 130px;
}

.result-items-table[data-audience='admin'] > thead > tr > th:nth-child(7) {
  width: 150px;
}

.result-items-table[data-audience='admin'] > thead > tr > th:nth-child(8) {
  width: 120px;
}

.result-items-table[data-audience='admin'] > thead > tr > th:nth-child(9) {
  width: 140px;
}

/* Close-out 62 item B (the owner's yes to the sketch MOD19-P8-RESULT-EDITOR-SKETCH.html), Edit result only: the whole
   Article description and the whole Other names, wrapped, never cut with "…"; Other names is a box like Reasoning, in
   the Reasoning column's width. The table when not editing and the company's table keep their one-line cells. */
.result-items-table[data-audience='admin'][data-editable]
  > tbody
  > tr
  > td:is(:nth-child(3), :nth-child(4)) {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.result-items-table[data-audience='admin'][data-editable] > thead > tr > th:nth-child(4) {
  width: 256px;
}

/* In Edit result the fields fill their cell. */
.result-items-table[data-audience='admin'] [data-edit-field] {
  width: 100%;
  min-width: 0;
}

/* 6.8.3a, fault 12 (the owner: the Confidence list cut by the AI usage column): the confidence level's list fits its
   column (its longest word is "Medium"); the category list keeps the room for "For human review". */
.result-items-table[data-audience='admin'] tr[data-editable-item] .result-confidence select {
  width: 100%;
  min-width: 0;
  max-width: 8rem;
}

/* --- Review and release (C3.3a): the filter buttons are painted in the category colours by result-items-view.ts --- */
/* The chosen filter keeps its colour and is marked by a heavier ring, so the colour never carries the meaning alone. */
.rq-page [data-result-chips] [data-chip][aria-pressed='true'] {
  box-shadow: 0 0 0 2px currentColor;
  font-weight: 700;
}

/* --- Files and history (C3.9, addendum 14): two short lines per event ------------------------------------------- */
/* Line 1 "when · what", line 2 in grey "by · reason". The three cells (When, What, By) stay; the headings stay for a
   screen reader and are hidden on screen, the list scrolls inside its box. */
[data-history-scroll] > table > thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

tr.rq-history-event {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 6px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
}

tr.rq-history-event > td {
  padding: 0;
  border: 0;
}

.rq-history-when {
  white-space: nowrap;
  color: var(--text-muted);
}

.rq-history-when::after {
  content: ' ·';
}

.rq-history-what {
  font-weight: 600;
}

.rq-history-by {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: var(--fs-hint, 13px);
}

/* --- The Needs-you box (addendum 20): the step first, primary; the other actions smaller beside it ------------- */
.rq-page .status-strip-actions:has(> [data-next-step-action]) [data-controls-row] .btn {
  padding: 4px 10px;
  font-size: var(--fs-hint, 13px);
}

.rq-page .status-strip-actions > [data-next-step-action] {
  order: -1;
}

/* --- The Messages handle in the banner (addendum 21): an ordinary banner button, not a floating one ---------------- */
.rq-msg-handle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* --- The Sample tab's trial steps (addendum 21): the stage bar's look on a light card -------------------------- */
.p7-progress.rq-trial-steps {
  margin: 8px 0 12px;
}

.p7-progress.rq-trial-steps li {
  color: var(--text-muted);
}

.p7-progress.rq-trial-steps li::before {
  background: var(--line);
}

.p7-progress.rq-trial-steps li[data-state='done'] {
  color: var(--text-body);
}

.p7-progress.rq-trial-steps li[data-state='done']::before {
  background: var(--ok-fg);
}

.p7-progress.rq-trial-steps li[data-state='done'] .p7-progress-label::before {
  color: var(--ok-fg);
}

.p7-progress.rq-trial-steps li[data-state='current'] .p7-progress-label {
  border: 1px solid var(--brand-accent);
}

/* --- The Files table at phone width (the coordinator's re-sweep of trial13): below 600 px each file is a card, on both
   portals. Line 1 the file name in full (wrapping, with its pills), line 2 what it is, line 3 size · date · by (the date
   with its year, the owner's rule), then the check and the Download button. The column headings are kept for screen
   readers only. At 600 px and wider the table stays as it is. The cells' inline one-line styles are overridden here. */
@media (max-width: 599px) {
  [data-files-one-line],
  [data-files-one-line] > tbody,
  [data-files-one-line] > tbody > tr,
  [data-files-one-line] > tbody > tr > :is(th, td) {
    display: block;
    width: auto;
    box-sizing: border-box;
  }

  [data-files-one-line] > thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  /* One card: its own flow, so the check (left) and Download (right) share the last line. */
  [data-files-one-line] > tbody > tr[data-file-group-item] {
    display: flow-root;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
  }

  [data-files-one-line] > tbody > tr[data-file-group-item] > td {
    padding: 0;
    border-top: 0;
    font-size: var(--fs-text, 13px);
  }

  [data-files-one-line]
    > tbody
    > tr[data-file-group-item]
    > td:is([data-file-cell='name'], [data-file-cell='what'], [data-file-cell='by']) {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere;
  }

  [data-files-one-line] [data-file-cell='name'] {
    font-weight: 600;
  }

  [data-files-one-line] [data-file-cell='what'] {
    margin: 2px 0 4px;
  }

  /* Line 3: size · date · by, one run of words (the date never split). */
  [data-files-one-line]
    > tbody
    > tr[data-file-group-item]
    > td:is([data-file-cell='size'], [data-file-cell='date'], [data-file-cell='by']) {
    display: inline;
  }

  [data-files-one-line] :is([data-file-cell='date'], [data-file-cell='by'])::before {
    content: '\00A0\00B7\0020';
  }

  /* The last line: the check starts a new line (its forced break), Download floats to its right. */
  [data-files-one-line] > tbody > tr[data-file-group-item] > td[data-file-cell='check'] {
    display: inline;
  }

  [data-files-one-line] > tbody > tr[data-file-group-item] > td[data-file-cell='check'] > * {
    line-height: 44px;
  }

  [data-files-one-line] > tbody > tr[data-file-group-item] > td[data-file-cell='check']::before {
    content: '\A';
    white-space: pre;
  }

  [data-files-one-line] > tbody > tr[data-file-group-item] > td[data-file-cell='action'] {
    float: right;
    margin-top: 6px;
  }

  [data-files-one-line] > tbody > tr:is([data-file-origin], [data-origin-empty]) > :is(th, td) {
    padding: 8px 12px;
  }
}

/* --- Processing tab, Controls on a phone (the coordinator's check at 375 / 320 px): below 600 px the four cards (Start,
   Release, Gates, Runs under) stand one per row at full width, each value with its line under it. The grid is admin.ts's
   inline one, so it is overridden here. */
@media (max-width: 599px) {
  [data-processing-controls] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .rq-controls-slim > .rq-control-cell {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .rq-controls-slim > .rq-control-cell:last-child {
    border-bottom: 0;
  }
}

/* --- 6.8.3, F10 (approved sketch SKETCH-6.8.3-PROCESSING-TAB.html): Controls in one slim row. Four cells side by side in
   one bordered box, each its small label above, then its value, the short word of whose setting it is, the ⓘ with the
   long sentences, and its link. */
.rq-controls-slim {
  border: 1px solid var(--border);
  border-radius: 8px;
}
.rq-controls-slim > .rq-control-cell {
  padding: 8px 12px;
  min-width: 0;
  border-right: 1px solid var(--border);
}
.rq-controls-slim > .rq-control-cell:last-child {
  border-right: 0;
}
.rq-control-label {
  display: block;
  font-size: var(--fs-small, 11.5px);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.rq-control-value .rq-control-link {
  margin-left: 6px;
}

/* --- Addendum 24 (W3's dialog census): the compilation form's row. The month and the two days in the shared input
   style, lined up on one row with their words; "Create compilation" at the right end. It wraps on a phone. */
.rq-compilation-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.rq-compilation-row > .input {
  flex: 0 1 180px;
  width: auto;
  min-width: 0;
}

.rq-compilation-row > .btn {
  margin-left: auto;
}

@media (max-width: 599px) {
  .rq-compilation-row > .input {
    flex-basis: 100%;
  }
}

/* --- Addendum 24: the request pages' small forms and dialog fields, at 1920 and 1280 px alike.
   A file field framed like the shared input (its height, border and one focus ring). */
.rq-file-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--silver-300);
  border-radius: 9px;
  background: #fff;
  font: inherit;
  font-size: var(--fs-text, 14px);
  color: var(--silver-800);
}

.rq-file-input:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(45, 125, 210, 0.12);
}

/* 6.8.3a, section 1g (point 65): from the keyboard the file field shows the theme's focus ring, as every field does
   (components.css), with a transparent outline that forced-colours mode draws. */
.rq-file-input:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

/* "Finish the corrections": no native fieldset frame; the choices start where the dialog's words start. */
fieldset.rq-choices {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

/* Resolve part N and Upload by hand: the fields one under the other, the button on the right under them. */
.rq-hand-form {
  display: grid;
  gap: 8px;
  max-width: 560px;
}

.rq-hand-form > [type='submit'] {
  justify-self: end;
}

/* Prepared for: the field at a form's width, Save and Cancel on the right under it. */
.rq-page [data-prepared-for-editor] {
  max-width: 560px;
}

.rq-page [data-prepared-for-editor] > .action-row {
  justify-content: flex-end;
}

/* --- Addendum 27 (the owner approved SKETCH-6.8.2-NEEDS-YOU-COMPACT): the "Needs you / Waiting" box, both portals'
   request pages, is ONE line of about 52 px. The state on the left, the server's answer as a small tag, the buttons on
   the right of the same line with the step as the one blue button; the tone's edge (amber when it asks for something).
   Each button's sentence leaves the line: it is the button's description and opens on hover and keyboard focus
   (control-tips.ts); on a touch device it stays a short grey line under its button. Phones: the line wraps. */
.rq-strip.status-strip {
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px 14px;
  min-height: 52px;
  box-sizing: border-box;
  padding: 7px 16px;
}

.rq-strip > .status-strip-text {
  flex: 0 1 auto;
  min-width: 12em;
}

/* From 900 px the box never wraps: the buttons keep their size, the tag gives way first (its "…"), then the state's
   words take a second line. Below 900 px the line wraps (state on top, the buttons in a row). */
@media (min-width: 900px) {
  .rq-strip.status-strip {
    flex-wrap: nowrap;
  }

  .rq-strip > .status-strip-actions {
    flex: none;
    flex-wrap: nowrap;
  }
}

.rq-strip .status-strip-detail {
  display: inline;
  margin-left: 8px;
}

.rq-strip > [data-admin-controls-status].notice {
  flex: 0 1 auto;
  margin: 0;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: var(--fs-hint, 13.5px);
  font-weight: 600;
}

.rq-strip > .status-strip-actions {
  flex: 0 1 auto;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.rq-strip [data-controls-row],
.rq-strip [data-controls-row] > [data-control] {
  display: contents;
}

.rq-strip .status-strip-actions .btn {
  padding: 7px 14px;
  font-size: var(--fs-text, 14px);
  white-space: nowrap;
}

.rq-strip [data-next-step-line] {
  margin: 0;
  font-size: var(--fs-hint, 13px);
}

/* A success answer is a one-line tag on a desktop, its whole sentence the explanation on hover and keyboard focus
   (control-tips.ts keepTagWhole: the tag takes focus); an error keeps every word in view. */
.rq-strip > [data-admin-controls-status].notice-success {
  min-width: 6em;
  max-width: 36ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rq-strip > [data-admin-controls-status].notice-success::before {
  content: '\2713\00A0';
}

.rq-strip > [data-admin-controls-status]:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

/* R1: a touch screen has no hover and cannot open a title, and below 900 px the line wraps anyway: the tag shows every
   word. */
@media (hover: none), (max-width: 899px) {
  .rq-strip > [data-admin-controls-status].notice-success {
    max-width: none;
    overflow: visible;
    white-space: normal;
  }
}

/* The sentence stays in the page for a screen reader (aria-describedby) and opens as the floating explanation. */
.rq-strip [data-control-meaning] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Below 900 px the line wraps: the state on top, then the buttons in a row from the left. */
@media (max-width: 899px) {
  .rq-strip > .status-strip-actions {
    justify-content: flex-start;
    margin-left: 0;
  }
}

/* What does not fit one line stands under it, the full width: the part tools, a routing conflict, the flagged rows. */
.rq-strip > :is([data-admin-part-tools], [data-routing-conflict]):not([hidden]) {
  flex-basis: 100%;
  margin: 0;
}

/* A touch device has no hover: each sentence is a short grey line under its button. */
@media (hover: none) {
  .rq-strip [data-controls-row] > [data-control] {
    display: flex;
    flex: 1 1 140px;
    flex-direction: column;
    gap: 2px;
    max-width: 240px;
  }

  .rq-strip [data-control-meaning] {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    color: var(--text-muted);
    font-size: var(--fs-hint, 12.5px);
  }
}

/* The floating explanation: fixed to the window, placed inside it by control-tips.ts (never clipped, never a sideways
   scroll). R1's second note: one taller than the window is held to it (max-height, set by the script) and scrolls
   inside; the pointer may move onto it to scroll it. */
.rq-tip {
  position: fixed;
  z-index: 1000;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 8px 10px;
  border-radius: 6px;
  background: #14213d;
  color: #fff;
  font-size: var(--fs-hint, 13px);
  font-weight: 400;
  line-height: 1.4;
  box-shadow: 0 4px 14px rgba(20, 33, 61, 0.25);
}

/* --- 6.8.3, F25: the second-try choices, marked for a moment when the Needs-you step button brings them into view. */
.rq-attention {
  outline: 3px solid var(--brand-accent);
  outline-offset: 4px;
  border-radius: 8px;
}

/* --- 6.8.3a, fault 8 (the owner: "Estimated cost" dropped alone to a second line behind a stray divider): the banner's
   facts keep their room and thin lines (6.4 item 27, drawn by admin.ts), and a fact that starts a line has no line
   before it. Every fact carries its line and its left room; the row is shifted left by that much and the shifted
   strip is clipped, so the first fact of each line stands at the left edge with nothing before it. */
/* 6.8.3b, R8 (the owner's remark 8: the facts as live, a5e6bad): one line, the facts parted by thin vertical lines,
   "AI usage: N calls · X k tokens" and "Estimated cost: $x" included; at 1280 px and wider every fact stands on the one
   line from 1440 px (the hint size, 10 px either side of each line); at 1280 px the seven facts of a released request
   need about 1 140 px of the band's 1 029, so the row wraps cleanly between two facts, never inside one. */
.rq-page .detail-sub[data-detail-sub] {
  display: flex;
  flex-wrap: wrap;
  row-gap: 2px;
  margin-left: -11px;
  clip-path: inset(-6px -6px -6px 11px);
  font-size: var(--fs-hint, 13.5px);
}

.rq-page .detail-sub[data-detail-sub] > .rq-banner-fact-pair {
  display: inline-flex;
  white-space: nowrap;
}

.rq-page .detail-sub[data-detail-sub] [data-banner-fact] {
  padding: 0 10px !important;
  border-left: 1px solid rgba(255, 255, 255, 0.22) !important;
  white-space: nowrap;
}

/* --- 6.8.3a, point 18 (the owner: a box inside the box, sentences in tall narrow columns): the Overview's Request box
   holds its fact rows without a second frame, one row under the other, each value on the line beside its label; the
   explanations are behind each row's ⓘ (admin.ts). */
.rq-page.rq-page .kv[data-summary],
.rq-page.rq-page .kv[data-summary]:has(> .kv-row) {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.rq-page .kv[data-summary] > .kv-row {
  grid-template-columns: minmax(120px, 190px) minmax(0, 1fr);
}

/* --- 6.8.3a, point 20: "It happens on Processing." stays one line in the Needs-you box. */
.rq-strip [data-next-step-line] {
  flex: none;
  white-space: nowrap;
}

/* --- 6.8.3a, point 19 (the owner: the AI usage cell cut, "not repo…"): the parts table fits its box. The words of
   Items and Version may wrap inside their cells (each part stays one row; Error rate and AI usage keep one line), so at
   1920 px the table needs no sideways scroll and the actions cell covers no column; at 1280 px the actions cell stays
   in view with a shadow on its left edge so nothing seems cut. */
.rq-part-row > td:is(:nth-child(3), :nth-child(11)) {
  white-space: normal;
}

.rq-part-row > td[data-part-ai-usage] {
  min-width: 7em;
}

.rq-part-row > td[data-part-actions] {
  box-shadow: -8px 0 8px -8px rgba(10, 22, 40, 0.35);
}

/* --- 6.8.3a, point 17: the Files table's Check cell keeps to its column (both portals); anything longer ends in "…",
   its whole sentence on pointing. */
[data-files-one-line] [data-file-cell='check'] {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- 6.8.3a, point 17 at 1280 px: beside History the Files table had about 600 px, and its File, What it is and By
   columns shrank to one letter. Below 1500 px Files takes the full width and History stands under it; each box keeps
   its own scroll (at least 14rem, above) and the open tab scrolls. */
@media (min-width: 768px) and (max-width: 1499px) {
  .rq-page .pg-work > [data-panel='files-evidence']:not([hidden]) > .rq-files-grid {
    grid-template-columns: minmax(0, 1fr);
    /* 6.8.3b, review L1: Files takes two thirds of the tab's height, History one third, at least its heading, its
       chips and 4rem of its list (on an 800 px window the tab has about 400 px). */
    grid-template-rows: minmax(0, 2fr) minmax(min-content, 1fr);
  }
}

/* --- 6.8.3a, point 24 (the coordinator: at 375 px the sticky "More ▾" stood over the Items column, "5 ite"). Below
   881 px the parts box had no sideways scroll of its own (only from 881 px, above), so the columns past the window
   could not be reached and the sticky cell stood over them. Now the box scrolls sideways at every width; below 881 px
   the actions cell is an ordinary last cell, reached at the row's end, and stands over no other column. */
@media (max-width: 767px) {
  [data-parts] > .rq-parts-scroll {
    overflow-x: auto;
  }
}

/* 6.8.3b, R5: the one-screen frame now starts at 768 px, but the parts table fits its box from 900 px only (measured
   above), so up to 899 px the actions cell stays an ordinary last cell and the long cells keep their least widths. */
@media (max-width: 899px) {
  .rq-part-row > td[data-part-actions] {
    position: static;
    box-shadow: none;
  }
}

/* --- 6.8.3a, point 24 (the coordinator: at 1280 px the sticky actions cell stood over part 5's error rate; nothing
   may lie under it, at rest or while scrolling). From 881 px up to 1919 px the parts table fits its box, so it never
   scrolls sideways and the actions cell (sticky, with its edge shadow, fault 10) covers no value: every data cell may
   wrap, the cells are a little closer, and a part's actions stand one under the other, their words wrapping in a
   column of 11rem. Measured: 942 px in a 942 px box at 1280; it fits down to 900. From 1920 px the one-line table fits
   as it is (point 19). Below 881 px the actions are an ordinary last cell (above). */
@media (min-width: 900px) and (max-width: 1919px) {
  .rq-part-row > td:not([data-part-actions]),
  [data-parts] .rq-parts-scroll > table > thead th {
    white-space: normal;
  }

  .rq-part-row > td[data-part-ai-usage] {
    min-width: 0;
  }

  [data-parts] .rq-parts-scroll > table :is(th, td) {
    padding-right: 8px;
    padding-left: 8px;
  }

  .rq-part-row > td[data-part-actions] {
    width: 11rem;
  }

  .rq-part-row > td[data-part-actions] > .action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .rq-part-row > td[data-part-actions] .btn {
    white-space: normal;
    text-align: center;
  }
}

/* From 1000 px the short cells keep one line ("Part 1", "EU-01", "1 s", "1"); below it they may wrap, so the table
   still fits (measured: 13 px too wide at 900 otherwise). */
@media (min-width: 1000px) and (max-width: 1919px) {
  .rq-part-row > td:is(:nth-child(1), :nth-child(4), :nth-child(7), :nth-child(8)) {
    white-space: nowrap;
  }
}

/* --- 6.8.3a, point 24 (found in the point-25 sweep, CAT-2026-000001, Review and release at 375 px): the search's
   Clear and the zoom's Reset ran 65 px past the window (the search field kept its 320 px), so the phone page was wider
   than the screen. On a narrow screen the field gives way, the search takes the line and the zoom wraps under it. */
@media (max-width: 599px) {
  .rq-result-toolbar > :last-child,
  .rq-result-toolbar .tc-search {
    min-width: 0;
    flex: 1 1 100%;
  }

  .rq-result-toolbar .tc-search .tc-search-input {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }
}

/* --- 6.8.3a, point 24 (found in the point-25 sweep, Input file and checks at 375 px): the input table's fixed columns
   left Supplier about 10 px ("S") and Article none. Below 881 px the table keeps a least width and its box scrolls
   sideways (from 881 px the box scrolls already, above). */
@media (max-width: 899px) {
  .rq-input-table {
    min-width: 760px;
  }

  [data-dataset-panel] > .rq-input-scroll {
    overflow-x: auto;
  }
}

/* --- 6.8.3a, point 24 (found in the point-25 sweep, CAT-2026-000002 at 1280 px): with Resume, Stop workflow, Cancel
   request… and the parts link on the one line, the "Needs you" words had about 190 px, five lines tall (at 1920 px
   three). From 900 px the line may wrap: the words keep at least 24em, and when the buttons do not fit beside them
   they stand on a second line at the right. */
@media (min-width: 900px) {
  .rq-strip.status-strip {
    flex-wrap: wrap;
  }

  .rq-strip > .status-strip-text {
    min-width: 24em;
  }
}

/* --- 6.8.3a, section 1e (R9: at 375 px "5 items · 5 processed" ran over three lines in the Items cell): below 881 px
   the count keeps its line and what became of the items stands on the line under it, whole. */
@media (max-width: 899px) {
  /* Section 1g (point 69: part 5's long note ran on one line past the edge): the cell keeps 9em, the count on its
     line, the note under it wrapping within the cell. */
  .rq-part-row > td:nth-child(3) {
    min-width: 9em;
    white-space: normal;
  }

  .rq-part-row > td:nth-child(3) > .hint {
    display: block;
  }
}

/* --- 6.8.3a, section 1f (point 38: file names cut to "CAT-2026-000001_Res…" although the table had room): from 600 px
   a file's name may wrap inside its cell, both portals, so it reads whole (its version and state with it); the other
   one-line cells keep their "…" with the whole words on pointing. The cell's one-line style is set on the element
   (file-repository.ts), so this rule must say so. */
@media (min-width: 600px) {
  [data-files-one-line] > tbody > tr > td[data-file-cell='name'] {
    overflow: visible !important;
    overflow-wrap: anywhere;
    white-space: normal !important;
  }
}

/* --- 6.8.3a, section 1f (point 43: Parts in full screen at 1280 px, the sent and returned dates and "not reported"
   wrapped, part 5's buttons broke their words): with the whole window (1 200 px and wider) the sent and returned dates
   and the AI usage keep one line and each action keeps its words on one line, one under the other; the items and the
   error rate give way. */
@media (min-width: 1200px) {
  .fr-full .rq-part-row > td:is(:nth-child(5), :nth-child(6), :nth-child(10)) {
    white-space: nowrap;
  }

  .fr-full .rq-part-row > td[data-part-actions] {
    width: auto;
  }

  .fr-full .rq-part-row > td[data-part-actions] .btn {
    white-space: nowrap;
  }
}

/* --- 6.8.3b, R5 (found in the 768 px check): from 768 px the Files box scrolls inside itself, and between 600 and
   1099 px its seven columns had too little room (the file name ran one letter per line). There the table keeps a least
   width and its box scrolls sideways, as the input table does. */
@media (min-width: 600px) and (max-width: 1099px) {
  [data-file-repository] table[data-files-one-line] {
    min-width: 860px;
  }

  .rq-box-scroll[data-file-repository] {
    overflow-x: auto;
  }
}

/* --- 6.8.3b, R7 (the owner's remark 7): tick the files to delete, on the administrator's request page only. A tick per
   file, per group and for all; a ticked row is tinted; a deleted file stays in the list struck through, saying when and
   by whom, with no download. */
[data-files-one-line] .rq-file-tick-cell {
  width: 32px;
  padding-right: 0;
  text-align: center;
}

.rq-file-tick {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.rq-file-tick:disabled {
  cursor: default;
}

[data-files-one-line] tr[data-file-ticked] > td {
  background: var(--bad-bg, #fef2f2);
}

[data-files-one-line] tr[data-file-deleted] > td {
  color: var(--text-muted);
  text-decoration: line-through;
}

[data-files-one-line]
  tr[data-file-deleted]
  > td:is([data-file-cell='what'], [data-file-cell='action']) {
  text-decoration: none;
}

/* R7 on a phone (the rows stand as cards, above): the tick stands at the start of the card's first line, not on a line
   of its own. */
@media (max-width: 599px) {
  [data-files-one-line] > tbody > tr > .rq-file-tick-cell {
    float: left;
    width: auto;
    padding: 2px 8px 0 0;
  }
}

/* --- 6.8.3b, review M2: once a result file is deleted, the Result heading's files stand one under the other: the
   deleted one named with its date, the others still downloadable on their own lines. */
[data-result-items] .result-items-downloads[data-has-deleted-file] {
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* --- 6.8.3b, review L1 (at 1280 x 800 the Files box had a scroller inside a scroller): the Files table has ONE scroller,
   its box, both ways (its headings fixed there); the table's own wrapper does not scroll. */
@media (min-width: 768px) {
  .rq-box-scroll[data-file-repository] .table-scroll {
    overflow: visible;
  }

  .rq-box-scroll[data-file-repository] [data-files-one-line] > thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--table-head-bg, var(--surface-sunken));
  }
}

/* Review L1 (measured: at 1280 x 800 the grid took its content's height, 775 + 388 px, so the tab scrolled around the
   Files box): the grid starts from no height and shares the tab's room, Files two thirds and History one third, each
   with its own scroller; on this tab the boxes keep 8rem and 4rem, so the tab itself does not scroll at 800 px high. */
@media (min-width: 768px) {
  .rq-page.rq-page .pg-work > [data-panel='files-evidence']:not([hidden]) > .rq-files-grid {
    flex: 1 1 0;
    min-height: 0;
  }

  .rq-page.rq-page .pg-work > [data-panel='files-evidence']:not([hidden]) .rq-files-grid > .card {
    min-height: 0;
  }

  .rq-page.rq-page
    .pg-work
    > [data-panel='files-evidence']:not([hidden])
    .rq-box-scroll[data-file-repository] {
    min-height: 8rem;
  }

  .rq-page.rq-page .pg-work > [data-panel='files-evidence']:not([hidden]) [data-history-scroll] {
    min-height: 4rem;
  }
}

/* Review L1, the coordinator's decision: History folded (it starts so under 900 px high), Files takes the tab's height
   and History its heading line; opened by hand, the two share the tab again (above) and each scrolls inside. */
@media (min-width: 768px) and (max-width: 1499px) {
  .rq-page.rq-page
    .pg-work
    > [data-panel='files-evidence']:not([hidden])
    > .rq-files-grid:has(> [data-history-card][data-collapsed]) {
    grid-template-rows: minmax(0, 1fr) auto;
  }
}

/* Review L1 on the company's Files and history tab (the same decision): the two boxes keep 7rem and 4rem there (not
   14rem), so the tab itself does not scroll on an 800 px window; with History folded, Files takes the rest. */
@media (min-width: 768px) {
  .cp-request [data-panel='files'] > .cp-row > .fr-box > .fr-scroll[data-file-repository] {
    min-height: 7rem;
  }

  .cp-request [data-panel='files'] > .cp-row > .fr-box > .fr-scroll[data-history-scroll] {
    min-height: 4rem;
  }
}

/* --- 6.8.3b, review L1 (the coordinator's decision): every file row on ONE line, both portals, from 768 px, about
   36 px tall, so the Files box shows several rows on a short window. The file name and "What it is" end in "…", their
   whole words on hover and for a screen reader (the cells' titles); the version and "Current" stand after the name on
   the same line; Size, Date, By and Check keep one line; the Download button is compact. Replaces, from 768 px, 6.8.3a
   point 38's wrapping names (600 px and up, above). */
@media (min-width: 768px) {
  :is(.rq-page, .cp-request) [data-files-one-line] > tbody > tr[data-file-group-item] > td {
    padding-top: 5px;
    padding-bottom: 5px;
    vertical-align: middle;
  }

  :is(.rq-page, .cp-request)
    [data-files-one-line]
    > tbody
    > tr[data-file-group-item]
    > td:is([data-file-cell='name'], [data-file-cell='what'], [data-file-cell='by']) {
    overflow: hidden !important;
    text-overflow: ellipsis;
    white-space: nowrap !important;
  }

  :is(.rq-page, .cp-request)
    [data-files-one-line]
    > tbody
    > tr[data-file-group-item]
    > td[data-file-cell='name']
    .pill {
    padding-top: 0;
    padding-bottom: 0;
    font-size: var(--fs-small, 12.5px);
    line-height: 1.5;
    vertical-align: baseline;
  }

  :is(.rq-page, .cp-request)
    [data-files-one-line]
    > tbody
    > tr[data-file-group-item]
    > td[data-file-cell='action']
    .btn {
    min-height: 26px;
    padding: 2px 10px;
    font-size: var(--fs-small, 12.5px);
    line-height: 1.4;
  }

  :is(.rq-page, .cp-request) [data-files-one-line] > tbody > tr[data-file-origin] > :is(th, td) {
    padding-top: 5px;
    padding-bottom: 5px;
  }
}

/* Review L1 (company, History opened by hand on a 768 px high window): History keeps its heading and about two rows,
   Files a little less, so the tab never scrolls. */
@media (min-width: 768px) {
  .cp-request [data-panel='files'] > .cp-row > .fr-box > .fr-scroll[data-history-scroll] {
    min-height: 3rem;
  }

  .cp-request [data-panel='files'] > .cp-row > .fr-box > .fr-scroll[data-file-repository] {
    min-height: 5.5rem;
  }
}

/* Review L1: on the Files and history tab the two cards keep 12 px of room top and bottom (26 px elsewhere), so the
   Files box shows about two rows more on a short window. */
@media (min-width: 768px) {
  .rq-page.rq-page .pg-work > [data-panel='files-evidence']:not([hidden]) .rq-files-grid > .card {
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

/* Review L1: the name gives way, its version and state stay in view after it, on the one line. */
@media (min-width: 768px) {
  [data-files-one-line] td[data-file-cell='name'] > .rq-file-line {
    display: flex;
    gap: 4px;
    align-items: center;
    min-width: 0;
  }

  [data-files-one-line] td[data-file-cell='name'] > .rq-file-line > .rq-file-name {
    flex: 0 1 auto;
    min-width: 2.5em;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  [data-files-one-line] td[data-file-cell='name'] > .rq-file-line > .pill {
    flex: none;
  }
}

/* --- 6.8.3b, P1 (Review on the candidate: on a held request at 1280 x 800 the Processing tab showed the Parts heading
   and no row, with two scrollers). On a window under 900 px high (768 px wide and up) the Parts table takes the tab:
   Controls starts folded (admin.ts; the strip above shows what needs you, with its actions); the Parts lines stand on
   one compact line, each ending in "…" with its whole words on hover; the held notice and "Upload result for …" share
   one line; each part's row keeps one line (the box scrolls both ways, the only scroller); the tab does not scroll. */
@media (min-width: 768px) {
  .rq-page .pg-work > [data-panel='processing']:not([hidden]) > .card {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .rq-page .pg-work > [data-panel='processing']:not([hidden]) > [data-parts-card]:not([hidden]) {
    display: grid;
    flex: 1 1 0;
    grid-template-columns: repeat(3, minmax(0, max-content)) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    column-gap: 14px;
    min-height: 0;
  }

  [data-parts-card] > .cb-card-head {
    grid-column: 1 / -1;
  }

  [data-parts-card]
    > p:is([data-processing-counts], [data-processing-release], [data-processing-ai-usage-line]) {
    grid-row: 2;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  [data-parts-card] > p[data-processing-rows-not-accepted] {
    display: none;
  }

  [data-parts-card] > p[data-processing-rows-not-accepted]:not(:empty) {
    display: block;
    grid-row: 2;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  [data-parts-card] > [data-parts] {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr) auto;
    column-gap: 12px;
    min-height: 0;
  }

  [data-parts] > * {
    grid-column: 1 / -1;
  }

  [data-parts] > [data-batches-held] {
    grid-column: 1;
    grid-row: 1;
    margin: 4px 0;
    padding-top: 2px;
    padding-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  [data-parts] > [data-upload-result] {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    margin: 0;
  }

  [data-parts] > [data-upload-result][open] {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  [data-parts] > .rq-parts-scroll {
    grid-row: 2;
    min-height: 0;
    overflow: auto;
  }

  [data-parts] .rq-parts-scroll > table > thead th,
  .rq-part-row > td {
    padding-top: 4px;
    padding-bottom: 4px;
    white-space: nowrap !important;
  }

  .rq-part-row > td > .hint {
    display: inline !important;
  }

  .rq-part-row > td[data-part-actions] {
    position: static;
    width: auto;
    box-shadow: none;
  }

  .rq-part-row > td[data-part-actions] > .action-row {
    flex-direction: row !important;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .rq-part-row > td[data-part-actions] .btn {
    min-height: 26px;
    padding: 2px 8px;
    font-size: var(--fs-small, 12.5px);
    white-space: nowrap !important;
  }
}

@media (min-width: 768px) {
  [data-parts-card] > p[data-processing-ai-usage-line] * {
    display: inline;
  }

  [data-parts-card] > p[data-processing-ai-usage-line] br {
    display: none;
  }
}

/* P1: the folded Controls card is one slim line. */
@media (min-width: 768px) {
  .rq-page
    .pg-work
    > [data-panel='processing']:not([hidden])
    > [data-processing-controls-card][data-collapsed] {
    margin-bottom: 6px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
}

/* --- 6.8.3b, P1 (the coordinator: the strip on one line): on the Processing tab the Needs-you strip stands on ONE line,
   its words ending in "…" (whole on hover, admin.ts), its buttons and the parts link beside them on the same line;
   every button and action stays. The other tabs keep the strip as it is. */
@media (min-width: 768px) {
  .rq-page .pg-work:has(> [data-panel='processing']:not([hidden])) > .rq-strip.status-strip {
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .rq-page
    .pg-work:has(> [data-panel='processing']:not([hidden]))
    > .rq-strip
    > .status-strip-text {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rq-page
    .pg-work:has(> [data-panel='processing']:not([hidden]))
    > .rq-strip
    > .status-strip-text
    > * {
    display: inline;
  }

  .rq-page
    .pg-work:has(> [data-panel='processing']:not([hidden]))
    > .rq-strip
    > .status-strip-actions {
    flex: none;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    margin: 0;
  }

  .rq-page
    .pg-work:has(> [data-panel='processing']:not([hidden]))
    > .rq-strip
    > .status-strip-actions
    .btn {
    min-height: 28px;
    padding: 3px 10px;
    white-space: nowrap;
  }

  .rq-page
    .pg-work:has(> [data-panel='processing']:not([hidden]))
    > .rq-strip
    > .status-strip-actions
    > *,
  .rq-page
    .pg-work:has(> [data-panel='processing']:not([hidden]))
    > .rq-strip
    > .status-strip-actions
    [data-controls-row] {
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .rq-page
    .pg-work:has(> [data-panel='processing']:not([hidden]))
    > .rq-strip
    > [data-admin-part-tools] {
    flex: none;
    margin: 0;
    white-space: nowrap;
  }

  .rq-page
    .pg-work:has(> [data-panel='processing']:not([hidden]))
    > .rq-strip
    > :is(h2, [data-admin-controls-status]:empty, .rq-strip-conflict:empty) {
    flex: none;
  }
}

/* P1: the part rows' cells keep 4 px top and bottom (a more specific table rule gave them 10 px), so a row is about
   32 px. */
@media (min-width: 768px) {
  .rq-page [data-parts] .rq-parts-scroll > table > tbody > tr.rq-part-row > td,
  .rq-page [data-parts] .rq-parts-scroll > table > thead > tr > th {
    padding-top: 4px;
    padding-bottom: 4px;
    line-height: 1.4;
  }
}

/* P1: the held notice and "Upload result for …" join the Parts lines on the ONE compact line (five parts, each ending
   in "…", whole on hover); the rows take the rest. Opened, the upload form takes a line of its own. */
@media (min-width: 768px) {
  .rq-page .pg-work > [data-panel='processing']:not([hidden]) > [data-parts-card]:not([hidden]) {
    grid-template-columns: repeat(5, minmax(0, max-content));
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    justify-content: start;
  }

  [data-parts-card] > [data-parts] {
    display: contents;
  }

  [data-parts-card] > [data-parts] > [data-batches-held] {
    grid-column: auto;
    grid-row: 2;
    min-width: 0;
    margin: 0;
    padding: 0 8px;
    line-height: 22px;
  }

  [data-parts-card] > [data-parts] > [data-upload-result] {
    grid-column: auto;
    grid-row: 2;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
  }

  [data-parts-card] > [data-parts] > [data-upload-result] > summary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  [data-parts-card] > [data-parts] > [data-upload-result][open] {
    grid-column: 1 / -1;
    grid-row: 4;
    overflow: visible;
    white-space: normal;
  }

  [data-parts-card] > [data-parts] > .rq-parts-scroll {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  [data-parts-card]
    > [data-parts]
    > :not([data-batches-held], [data-upload-result], .rq-parts-scroll) {
    grid-column: 1 / -1;
  }
}

/* =============================================================================================================
   Mod 19 P8, lane C (the administrator and company audits of 17 Nov 2026; sketch
   docs/project-control/tasks/sketches/MOD19-P8-FIX-C/index.html). Both portals' request pages. Loaded after every
   rule above, so these win their ties.
   ============================================================================================================= */

/* --- Item 4: the Files table from 768 px. The File column takes the spare width and its name wraps whole (its version
   and state after it); What it is and By wrap in their shares; Size and Check are narrow: Check shows the tick and
   "SHA-256" (the scan sentence stays on pointing and for a screen reader). Replaces review L1's one line per file. */
@media (min-width: 768px) {
  :is(.rq-page, .cp-request)
    [data-files-one-line]
    > tbody
    > tr[data-file-group-item]
    > td:is([data-file-cell='name'], [data-file-cell='what'], [data-file-cell='by']) {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  :is(.rq-page, .cp-request) [data-files-one-line] > tbody > tr[data-file-group-item] > td {
    vertical-align: top;
  }

  [data-files-one-line] td[data-file-cell='name'] > .rq-file-line {
    display: block;
  }

  [data-files-one-line] td[data-file-cell='name'] > .rq-file-line > .rq-file-name {
    overflow: visible;
    text-overflow: clip;
  }

  [data-files-one-line] td[data-file-cell='name'] > .rq-file-line > .pill {
    display: inline-block;
    margin-left: 4px;
  }

  :is(.rq-page, .cp-request) [data-files-one-line] [data-file-cell='check'] {
    overflow: visible;
    white-space: normal;
  }

  :is(.rq-page, .cp-request) [data-files-one-line] [data-file-cell='check'] [data-scan-word] {
    display: none;
  }

  :is(.rq-page, .cp-request) [data-files-one-line] [data-file-cell='check'] .checksum {
    white-space: nowrap;
  }
}

/* Item 4 at tablet widths (600 to 1099 px): the table keeps a least width and its box scrolls sideways (6.8.3b, R5);
   the least width grows so the File column, not What it is or By, gets the room. */
@media (min-width: 600px) and (max-width: 1099px) {
  [data-file-repository] table[data-files-one-line] {
    min-width: 980px;
  }
}

/* --- Item 53: a combined result's parts, one line closed ("made from 44 parts", then "Show the 44 parts"). --- */
.rq-made-from {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: var(--fs-hint, 12.5px);
  white-space: normal;
}

.rq-made-from > summary {
  cursor: pointer;
  color: var(--link, var(--text-muted));
}

.rq-made-from > span {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

/* Item 53: the Files list in pages of 20, "Show 20 more" and "Show all N files" under the table. */
.rq-files-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 8px;
}

.rq-files-pager > [hidden] {
  display: none;
}

/* Item 53: on a phone, Files and History are two tabs; from 600 px the switch is not shown and both boxes stand. */
.rq-fh-switch.rq-fh-switch {
  display: none;
}

@media (max-width: 599px) {
  .rq-fh-switch.rq-fh-switch {
    display: flex;
    gap: 6px;
    margin: 0 0 8px;
  }

  [data-rq-fh-show='files'] > [data-rq-fh-box='history'],
  [data-rq-fh-show='history'] > [data-rq-fh-box='files'] {
    display: none !important;
  }
}

/* --- Item 54: at tablet widths (768 to 1099 px) Files and History share the tab's height equally and grow with the
   window; History keeps room for its rows (it had 64 px at 768 x 1024). */
@media (min-width: 768px) and (max-width: 1099px) {
  .rq-page.rq-page .pg-work > [data-panel='files-evidence']:not([hidden]) > .rq-files-grid {
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }

  .rq-page.rq-page .pg-work > [data-panel='files-evidence']:not([hidden]) [data-history-scroll] {
    min-height: 10rem;
  }

  .cp-request [data-panel='files'] > .cp-row > .fr-box > .fr-scroll[data-history-scroll] {
    min-height: 10rem;
  }
}

/* --- Item 52: on a phone the banner's facts wrap, "AI usage" and "Estimated cost" included; nothing runs past the
   window, so the page never scrolls sideways (51 px at 375 px before). */
@media (max-width: 599px) {
  .rq-page .detail-sub[data-detail-sub] > .rq-banner-fact-pair {
    display: inline-flex;
    flex-wrap: wrap;
    max-width: 100%;
    white-space: normal;
  }

  .rq-page .detail-sub[data-detail-sub] [data-banner-fact] {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* --- Item 42: Review and release from 768 px. The result's table fills the tab under the Result box and scrolls inside
   its own box; the tab does not scroll as well (it still does on a window too short for the table's least room). */
@media (min-width: 768px) {
  /* The Result box above gives way first (its own scroll, at least 6rem), so the table keeps its room. Close-out 30 (the
     4e live fault on CAT-2026-000079): only while the released view below is shown. When Edit result draws the box's own
     table, the released view is merged (`.rq-merged`, C3.3: hidden, the same items never shown twice) and the box keeps
     its whole height; and a box shown full screen (`.fr-full`, frame.css) always covers the window. */
  .rq-page.rq-page
    .pg-work
    > [data-panel='review-release']:not([hidden]):has(
      > [data-result-items]:not([hidden]):not(.rq-merged)
    )
    > [data-candidate-card]:not([hidden]):not([data-collapsed]):not(.fr-full) {
    flex: 0 1 auto;
    min-height: 6rem;
    max-height: 40%;
    overflow: auto;
  }

  /* Close-out 30: never over C3.3's merged view, which stays hidden (request-page.css, "one Result box"). */
  .rq-page.rq-page
    .pg-work
    > [data-panel='review-release']:not([hidden])
    > [data-result-items]:not([hidden]):not([data-collapsed]):not(.rq-merged) {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    /* At least its toolbar, 8rem of rows and its pager. */
    min-height: auto;
  }

  .rq-page.rq-page
    .pg-work
    > [data-panel='review-release']:not([hidden])
    > [data-result-items]
    > [data-result-body] {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: auto;
  }

  .rq-page.rq-page
    .pg-work
    > [data-panel='review-release']:not([hidden])
    > [data-result-items]
    > [data-result-body]
    > * {
    flex: none;
  }

  .rq-page.rq-page
    .pg-work
    > [data-panel='review-release']:not([hidden])
    > [data-result-items]
    > [data-result-body]
    > :is(.tc-scroll, [data-result-scroll]) {
    flex: 1 1 0;
    height: auto;
    min-height: 8rem;
    /* result-items-view.ts sets 60vh on the element; here the box, not the window, sets its height. */
    max-height: none !important;
  }
}

/* --- Item 22: the Files heading's line ("15 files · will be deleted on …") wraps instead of being cut. --- */
.rq-box-head > [data-files-summary] {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* =============================================================================
   Release 6.8.2, lane W3: the page-local rules of the administrator Processing section (Processing, Workflow gates,
   Gate allocations, Workflow connections, AI providers, Excluded suppliers, Internal archives). The frame itself
   (`fr-*`, the boxed tabs, the side panel dock) is the shared one of lane B0; nothing here restyles it. Colours from the
   tokens, so both themes follow.

   Addendum 20 (the owner's review at 1280x800, 25 October 2026), layout only:
   - (c) a helper or empty-state sentence placed straight in a box (not in its head, its scrolling list or the
     "Showing only" line) sits on the box's inner padding, not flush on its left edge;
   - (d) the Workflow gates table shows one line per gate: code and name side by side (a long name is cut, the whole
     name in its hover title) and the state badges side by side.
   ========================================================================== */

/* --- (c) the box's inner padding for what stands straight in it --- */
:is(
    body[data-page='admin-processing'],
    body[data-page='admin-workflow-connections'],
    body[data-page='admin-internal-archives'],
    body[data-page='admin-gate-allocations'],
    body[data-page='admin-gates']
  )
  .fr-box
  > :not(.fr-box-head, .fr-scroll, .fr-showing, .fr-part-head, .fr-more-below, .fr-more-right) {
  /* 6.8.3a, section 1i (point 83): the "More below" and "More columns" lines keep their own place at the right. */
  margin-left: 12px;
  margin-right: 12px;
}

/* --- (d) Workflow gates: one line per gate --- */
[data-gate-rows] > tr > td {
  white-space: nowrap;
}

[data-gate-rows] .gate-badges {
  flex-wrap: nowrap;
}

.w3-gate-name {
  display: inline-block;
  max-width: 18em;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

/* --- Addendum 24 (the owner's local test): the "New workflow connection" form --------------------------------------
   Every field wears the shared input style (`.input`: the select's height, one focus ring). A two-field row keeps
   both fields inside their card (`minmax(0, 1fr)`) and lines their boxes up at the bottom whatever their labels wrap
   to. Note and Reason are one row with the buttons on the right, right after the three cards: on a wide screen the
   panel is as tall as its content, never a screen-high gap; on a phone it is the full sheet as before. */
.w3-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.w3-pair > .field {
  min-width: 0;
}

/* The coordinator's live check (1920x1080): a paired label that wraps ("Workflow version *") must not push its field
   below its neighbour's. Each field takes three rows of the pair (label, field, error) as a subgrid: the labels of
   one row end on the same line and both fields start on the same line, however the labels wrap, and an error under
   one field does not move the other. Without subgrid the pair keeps lining up its fields at the bottom (above). */
@supports (grid-template-rows: subgrid) {
  .w3-pair {
    row-gap: 0;
    align-items: stretch;
  }

  .w3-pair > .field {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 4px;
    margin: 0 0 10px;
  }

  .w3-pair > .field > :first-child {
    align-self: end;
  }
}

.w3-connection-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.w3-form-foot {
  align-items: flex-end;
}

.w3-form-foot > .field {
  flex: 1 1 260px;
  margin: 0;
}

.w3-form-foot textarea.input {
  min-height: 0;
  resize: vertical;
}

@media (min-width: 881px) {
  aside[data-connection-form-section] {
    bottom: auto;
    max-height: 100%;
  }

  aside[data-connection-form-section] > .w3-connection-form,
  aside[data-connection-form-section] .ep-body {
    flex: 0 1 auto;
  }
}

/* --- Addendum 26 (the owner, 25 October 2026; approved clickable mock MOCK-6.8.2-OVERSIGHT-CLICKABLE.html): the
   Oversight Overview. Lane W3 builds it while lane W5 owns the rest of Oversight (admin-w5-pages.css); these rules are
   the Overview's only. The full width (no left column), the chips of the last 24 hours, and one list in two groups:
   one line per item with its sign, number, sentence, grey line and the link at the right. --- */
.ov-panel[data-panel='overview'] > .fr-box {
  grid-column: 1 / -1;
}

.ov-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px 16px;
}

.ov-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.ov-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-card);
  color: var(--text-body);
  font: inherit;
  cursor: pointer;
}

.ov-chip:hover {
  border-color: var(--brand-secondary);
}

.ov-chip-count {
  padding: 0 7px;
  border-radius: 10px;
  background: var(--surface-sunken);
}

.ov-group-title {
  margin: 12px 0 0;
  font-size: var(--fs-hint, 13px);
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.ov-group-title[data-overview-group-title='needs'] {
  color: var(--bad-fg);
}

.ov-group-title[data-overview-group-title='order'] {
  color: var(--ok-fg);
}

.ov-line {
  display: grid;
  grid-template-columns: 28px 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--surface-card);
}

.ov-line[data-tone='bad'] {
  border-left-color: var(--bad-fg);
  background: var(--bad-bg);
}

.ov-line[data-tone='warn'] {
  border-left-color: var(--warn-fg);
  background: var(--warn-bg);
}

.ov-line[data-tone='ok'] {
  border-left-color: var(--ok-fg);
}

.ov-line-sign {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-muted);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.ov-line[data-tone='bad'] .ov-line-sign {
  background: var(--bad-fg);
}

.ov-line[data-tone='warn'] .ov-line-sign {
  background: var(--warn-fg);
}

.ov-line[data-tone='ok'] .ov-line-sign {
  background: var(--ok-fg);
}

.ov-line-value {
  font-size: 24px;
  font-weight: 700;
  text-align: right;
}

.ov-line-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ov-line-label {
  font-weight: 600;
}

.ov-line-label::first-letter {
  text-transform: uppercase;
}

.ov-line-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-secondary);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.ov-line-link:hover {
  text-decoration: underline;
}

/* A phone: the link goes under the sentence; nothing scrolls sideways. */
@media (max-width: 560px) {
  .ov-line {
    grid-template-columns: 28px 56px minmax(0, 1fr);
  }

  .ov-line-link {
    grid-column: 3;
    justify-self: start;
    white-space: normal;
  }
}

/* --- Release 6.8.3, F9 (sketch 683/SKETCH-6.8.3-GATE-ALLOCATION-PANEL.html, approved): a company's gate setup beside
   the list. One "Change…" in the head row; each family a collapsible section (`collapse.css`) with the setup in
   short, the gates as chips with their state and the reason for "Attention"; History as a small timeline. --- */
.ga-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
}

/* In the 380 px panel a section's body keeps a small indent only (`.cb.` to win over collapse.css, loaded later). */
.cb.ga-section > .cb-head {
  padding: 8px 10px;
}

.cb.ga-section > .cb-body {
  padding: 0 10px 10px 14px;
}

.ga-sentence {
  margin: 0 0 8px;
}

.ga-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ga-chip {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ga-warn {
  margin: 8px 0 0;
  padding: 6px 10px;
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.ga-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The date on its own short line above the change: the panel is too narrow for a date column. */
.ga-timeline > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
}

.ga-timeline > li:first-child {
  border-top: 0;
}

.ga-when {
  color: var(--text-muted);
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ga-who {
  display: block;
}

/* --- Release 6.8.3, F1 (screenshot 26 Oct 2026, 12:55): in the connection side panel (380 px) the label column of an
   aligned row grew to its 220 px before the value had its share, so Reference, Masked suffix and Header stood one
   character per line. Inside that panel the label takes at most about a third and the value the rest; the secret
   boxes keep a small padding. --- */
[data-row-details='connections'] .kv-row {
  grid-template-columns: minmax(84px, 34%) minmax(0, 1fr);
  gap: 2px 12px;
}

[data-row-details='connections'] [data-credential-states] > .card {
  padding: 12px;
}

/* --- Release 6.8.3, F27 (sketch 683/SKETCH-6.8.3-AI-CREDIT-LEFT.html, approved): the AI credit panel on AI usage and
   AI providers. The money first (one line per account: name, big figure, status, checked time, ⓘ); the keys with
   nothing to report folded into one collapsed line (`collapse.css`). --- */
.ac-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 4px 0;
}

.ac-big {
  color: var(--text-strong);
  font-size: 1.35em;
  font-variant-numeric: tabular-nums;
}

.ac-big.ac-key {
  font-size: 1.1em;
}

.ac-row[data-tone='bad'] .ac-big {
  color: var(--bad-fg);
}

.cb.ac-keys {
  margin: 8px 0 0;
}

.ac-key-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px 14px;
  margin: 0;
}

.ac-key-list > dt {
  font-weight: 600;
}

.ac-key-list > dd {
  margin: 0;
  color: var(--text-muted);
}

/* 6.8.3a, point 24 (the sweep: at 1280 px the gates table's last column ran past the box): below 1500 px the gate's
   name and its connection may wrap inside their cells, so the table fits its box. Section 1e (R3): the last signal
   ("3h ago (stale)") keeps one line. */
@media (max-width: 1499px) {
  [data-gates-table] td:is(:nth-child(1), :nth-child(4)) {
    white-space: normal;
  }
}

/* 6.8.3a, section 1e (R2: Workflows › Run history at 1280 px, the reference broke "CAT-" / "2026-" / "000002" one
   piece per line, "EU-01" and "latest: 5 · Part 5" split too): the reference, the gate and the latest attempt keep one
   line each; the attempts count and the part stand on the line under them. Where the table is wider than its box,
   the box scrolls sideways and fades at its right edge (frame.css). */
tbody[data-runs] > tr > td:is(:nth-child(1), :nth-child(4), :nth-child(5)) {
  white-space: nowrap;
}

tbody[data-runs] > tr > td > span > :is([data-attempts], [data-run-part]) {
  display: block;
}

/* 6.8.3a, section 1g (point 61: Gates at 1280 px with the real state "Offline · Idle · Stopped reporting" ran past its
   box, "Last signal" cut): below 1500 px the state's pills may wrap inside their cell, so the last signal keeps its one
   line and the table fits. */
@media (max-width: 1499px) {
  [data-gates-table] td:nth-child(3) {
    white-space: normal;
  }

  /* The pills stand in a row of their own; it may wrap too. */
  [data-gates-table] td:nth-child(3) > * {
    flex-wrap: wrap;
  }
}

/* Section 1g (point 72): a run's dispatch time keeps one line ("28 Oct 2026, 01:18", with the year). */
tbody[data-runs] > tr > td:nth-child(7) {
  white-space: nowrap;
}

/* 6.8.3a, section 1g (point 70: the gate page's part headings stood as large plain headings before each block): the
   heading and its "Full audit" link stand over the block's first line, after its ▸ (1 px border, 14 px padding, 12 px
   arrow, 10 px gap), in the block's own size; a click on the heading's words reaches the line beneath (it opens and
   closes the block), the link stays a link. */
[data-gate-part] {
  position: relative;
}

[data-gate-part] > .gate-part-title {
  position: absolute;
  top: 1px;
  left: 37px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  pointer-events: none;
}

[data-gate-part] > .gate-part-title > .fr-part-head {
  position: static;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-strong);
  font-size: inherit;
  font-weight: 700;
}

[data-gate-part] > .gate-part-title a {
  pointer-events: auto;
}

[data-gate-part] .gate-part-spacer {
  flex: none;
  min-height: 1px;
}

/* =============================================================================
   Release 6.8.2, lane W4: the page-local rules of the administrator Queue. The frame itself (`fr-*`, the boxed tabs,
   the side panel dock) is the shared one of lane B0; nothing here restyles it. Colours from the tokens.

   Addendum 23 (the owner's administrator review at 1280x800, 25 October 2026), layout only:
   - one line per request: every cell keeps one line. Only the company and the next step are cut with "…" and share the
     room that is left; badges, references, dates and the mode never are. A cell's second fact (origin, progress) and
     every whole text are in the cell's hover title (set by the script). When even the uncut cells do not fit, the table
     scrolls sideways inside its box, never the page;
   - the five figures stand as one row of small chips (`.chip-row`, the shared chips), so the list gets the height.
   ========================================================================== */

.fr-scroll > table.q-table {
  position: relative;
  table-layout: auto;
  width: 100%;
}

/* The screen-reader words of a cell (its second fact) are positioned out of view by `.sr-only`; each cell is their
   containing block, so they stay inside the list's scroll box and never widen the page on a phone (the coordinator's
   re-sweep, 25 Oct 2026: 62 px of sideways scroll at 375). The first cell keeps the frame's sticky pin. */
.q-table > tbody > tr > td:not(:first-child) {
  position: relative;
}

/* One line per request. Every cell keeps its width (badges, references, dates, the mode are never cut)... */
.q-table > tbody > tr > td {
  width: 1%;
  padding-left: 8px;
  padding-right: 8px;
  white-space: nowrap;
  vertical-align: middle;
}

/* ...but the company and the next step: they share the room that is left (the company more) and are cut with "…". */
.q-table > tbody > tr > td.q-flex {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-table > tbody > tr > td.q-flex:nth-child(2) {
  width: 55%;
}

.q-table > tbody > tr > td.q-flex:nth-child(4) {
  width: 45%;
}

.q-table .q-cut {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The five figures: one compact row of chips, each a filter of the list. */
.q-figures {
  position: relative;
  margin: 8px 0;
}

/* The same for each figure chip's screen-reader line. */
.q-figures .chip {
  position: relative;
}

/* -----------------------------------------------------------------------------
   Release 6.8.2, addendum 28 (A1; the owner's approved SKETCH-6.8.2-COMPANY-PLAN-STATUS.html): the company page's
   "Plan and quotation" card under the band, until the plan runs. Six steps with their dates, the next act, the
   company's quotations. Text sizes of addendum 24: body 15px, hints 13.5px, the box title 17px. Colours from the
   tokens, so the dark theme follows. On a phone the steps stand two by two and the card can be folded.
   -------------------------------------------------------------------------- */

.pc-host {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.pc-card {
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-text, 15px);
  color: var(--text-body);
}

.pc-head {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.pc-title {
  font-size: var(--fs-title, 17px);
  font-weight: 700;
  color: var(--text-strong);
}

.pc-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-2);
  margin: var(--space-3) 0;
  padding: 0;
  list-style: none;
}

.pc-steps li {
  border-top: 5px solid var(--line-strong);
  padding-top: var(--space-2);
  font-size: var(--fs-hint, 13.5px);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.pc-step-label {
  display: block;
  font-size: var(--fs-text, 15px);
  color: var(--text-strong);
}

.pc-step-detail {
  display: block;
}

.pc-steps li[data-state='done'] {
  border-top-color: var(--ok-fg);
}

.pc-steps li[data-state='done'] .pc-step-label::before {
  content: '\2713\00a0';
  color: var(--ok-fg);
}

.pc-steps li[data-state='current'] {
  border-top-color: var(--text-link);
}

.pc-steps li[data-state='attention'] {
  border-top-color: var(--warn-fg);
}

.pc-steps li[data-state='attention'] .pc-step-label {
  color: var(--warn-fg);
}

.pc-steps li[data-state='ended'] {
  border-top-color: var(--bad-fg);
}

.pc-steps li[data-state='ended'] .pc-step-label {
  color: var(--bad-fg);
}

.pc-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.pc-next-text {
  flex: 1 1 260px;
  min-width: 0;
}

.pc-next-text b {
  display: block;
  font-size: var(--fs-text, 15px);
  color: var(--text-strong);
}

.pc-next-text .hint {
  font-size: var(--fs-hint, 13.5px);
}

.pc-acts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.pc-card [data-plan-card-answer] {
  margin: var(--space-2) 0 0;
}

.pc-quotations {
  margin-top: var(--space-3);
}

.pc-quotations .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

@media (max-width: 900px) {
  .pc-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .pc-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Open, the fold never takes more than about a third of the window: its steps and rows scroll inside it, so the
   next act under it and the tab's own box keep their room under the pinned band (audit C62). */
.pc-fold[open] {
  max-height: 34vh;
  overflow-y: auto;
}

/* Folded, the head says what the fold holds; open, the steps show it. */
.pc-fold[open] .pc-head-next {
  display: none;
}

/* The next act and its buttons, always shown, under the fold (audit C62). */
.pc-card > .pc-next {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
}

/* 6.8.3a, section 1f (point 44) and section 1g (point 62: at 1280 px the next step was still cut after two lines):
   the next step wraps and reads whole on the row, as many lines as it needs; the company keeps its one line. */
.q-table > tbody > tr > td.q-flex:nth-child(4) {
  overflow: visible;
  white-space: normal;
}

.q-table > tbody > tr > td.q-flex:nth-child(4) .q-cut {
  display: block;
  overflow: visible;
  white-space: normal;
}

/* =============================================================================
   Release 6.8.2, addendum 25 (the owner, 25 October 2026: "this should be applied for all everywhere"; sketch
   682-wide/SKETCH-6.8.2-LIST-TOOLBAR.html): the toolbar above a list and "Clear all filters" (`list-toolbar.ts`), and
   the Excel button of every list (`csv-button.ts`). `lt-` classes only; no workspace class. Sizes relative to the
   shared text (B0's addendum 24 raises it), colours from the tokens, so both themes follow.
   ========================================================================== */

/* One line above the list: the filters as tags on the left (they wrap among themselves), Excel at the right end of the
   first line, always in view, on a phone too. */
.lt-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 8px 14px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-sunken);
}

.lt-tags {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}

/* 6.8.3a, section 1f (point 53): the muted grey on the band's grey was 4.34:1; one step darker reads at about 6.9:1
   (the night view's step is light, as its tokens are). */
.lt-label,
.lt-all {
  color: var(--silver-600);
}

.lt-all {
  font-weight: 600;
}

.lt-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 4px 2px 10px;
  border: 1px solid var(--brand-secondary);
  border-radius: 99px;
  background: var(--surface-card);
  color: var(--text-body);
  font-size: 0.93em;
}

.lt-tag-x {
  padding: 0 5px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--brand-secondary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.lt-tag-x:hover,
.lt-tag-x:focus-visible {
  background: var(--surface-sunken);
}

.lt-tag-x:focus-visible,
.lt-clear:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 1px;
}

/* "Clear all filters": a link-like button, in the toolbar and in an empty list. */
.lt-clear {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-secondary);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
  cursor: pointer;
}

/* Excel at the right end of the line, always in view. */
.lt-excel {
  display: flex;
  flex: none;
  align-items: center;
  margin-left: auto;
}

/* On a phone, Excel stands first on its own line (right-aligned) and the tags take the whole width under it. */
@media (max-width: 600px) {
  .lt-bar {
    flex-wrap: wrap;
  }

  .lt-excel {
    order: -1;
    width: 100%;
    justify-content: flex-end;
  }
}

/* The Excel button of every list: a normal secondary button with the download mark. */
.csv-export::before {
  content: '⤓';
  margin-right: 6px;
}

/* The filter column: "Filters (N set)", each changed filter outlined, "✕ Clear all filters" at its bottom. */
.lt-head {
  margin: 0;
  font-weight: 700;
  color: var(--text-body);
}

.lt-count {
  font-weight: 400;
  color: var(--text-muted);
}

.fr-filters :is(select, input).lt-set {
  border-color: var(--brand-secondary);
  box-shadow: 0 0 0 1px var(--brand-secondary);
}

.lt-clear-all {
  width: 100%;
  margin-top: 6px;
}

.lt-clear-all:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* --- 6.8.3a, point 24 (the sweep) ------------------------------------------------------------------------------------
   The checkbox a list row is chosen with (bulk-bar.ts) keeps a gap before the row's first words ("☐27 Oct" read as
   one). */
.bulk-choose {
  margin: 0 8px 0 0;
  vertical-align: middle;
}

/* A pill in a table cell keeps its words on one line ("Always on" broke over two in the notification settings). */
td > .pill {
  white-space: nowrap;
}

/* Below 600 px a notification, a quotation and a user are each a card, as the Files table is (both portals): one line
   after another, the full width, nothing squeezed into a one-word column or cut at the right. The column headings stay
   for screen readers only. At 600 px and wider the tables stay as they are. */
@media (max-width: 599px) {
  table:has(
    > tbody:is(
        [data-notifications],
        [data-portal-notifications],
        [data-portal-quotations],
        [data-users],
        [data-requests]
      )
  ),
  table:has(
      > tbody:is(
          [data-notifications],
          [data-portal-notifications],
          [data-portal-quotations],
          [data-users],
          [data-requests]
        )
    )
    > tbody,
  table:has(
      > tbody:is(
          [data-notifications],
          [data-portal-notifications],
          [data-portal-quotations],
          [data-users],
          [data-requests]
        )
    )
    > tbody
    > tr,
  table:has(
      > tbody:is(
          [data-notifications],
          [data-portal-notifications],
          [data-portal-quotations],
          [data-users],
          [data-requests]
        )
    )
    > tbody
    > tr
    > :is(td, th) {
    display: block;
    width: auto;
    min-width: 0;
    box-sizing: border-box;
  }

  table:has(
      > tbody:is(
          [data-notifications],
          [data-portal-notifications],
          [data-portal-quotations],
          [data-users],
          [data-requests]
        )
    )
    > thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  table:has(
      > tbody:is(
          [data-notifications],
          [data-portal-notifications],
          [data-portal-quotations],
          [data-users],
          [data-requests]
        )
    )
    > tbody
    > tr {
    padding: 10px 12px;
    border-top: 1px solid var(--line);
  }

  table:has(
      > tbody:is(
          [data-notifications],
          [data-portal-notifications],
          [data-portal-quotations],
          [data-users],
          [data-requests]
        )
    )
    > tbody
    > tr
    > :is(td, th) {
    padding: 2px 0;
    border: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* 6.8.3a, section 1e (R5: about 90 px of empty space between "Unread only · Mark all as read" and the "Inbox"
   heading): the Notification centre's working area starts 16 px under its filter row, as the other list pages do
   (the public site's 72 px section padding does not belong in the frame). */
.pg-work > .section:has(> .container-wide > [data-panel='inbox']) {
  padding-top: 16px;
}

/* 6.8.3a, section 1f: on a phone card each cell shows its column heading before its value ("Rows: 60"; cell-labels.ts
   copies it onto the cell); a cell whose column has no visible heading (actions) shows none. Point 37: the company's
   request list is one of these lists. */
@media (max-width: 599px) {
  tbody:is(
      [data-notifications],
      [data-portal-notifications],
      [data-portal-quotations],
      [data-users],
      [data-requests]
    )
    > tr
    > [data-label]::before {
    content: attr(data-label) ': ';
    font-weight: 600;
  }
}

/* 6.8.3a, section 1f (point 42: Notification centre at 1280 px, the date over three lines; the owner's rule: one line,
   with the year): from 600 px a notice's date keeps one line, in both portals (below 600 px each notice is a card). */
@media (min-width: 600px) {
  tbody:is([data-notifications], [data-portal-notifications]) > tr > td:first-child {
    white-space: nowrap;
  }
}

/* 6.8.3a, section 1g (point 64): a link in a notice's details ("Open") is underlined, as links in running text are
   (frame.css); both portals. */
tbody:is([data-notifications], [data-portal-notifications]) td a:not(.btn) {
  text-decoration: underline;
}

/* =============================================================================
   Release 6.8.3b, remark R9 (the owner, 28 October 2026; prototype PROTOTYPE-683B-REMARKS-FROZEN-28OCT2026.html, the
   Queue as approved): every page's filters stand in its blue banner, under the title row, as one row
   (`banner-filters.ts`); no side column. Each label stands above its control; a group of filter buttons is a row of
   chips; "More" opens its further filters on a line of their own; "Clear all filters" at the row's end. Under 768 px
   the row folds behind "Filters (n) ▾". The selectors name the banner, so they win over the frame's column rules,
   which `main.css` loads later. A page with a row of tabs gets its row under the tabs, on the band's ground.
   ========================================================================== */
/* Until the page's script has moved it (the first drawing, before the session read), a page's column with a banner to
   go to is not drawn at the side, so nothing jumps from the side into the band. */
.fr-page:has(.pg-band) .fr-filters:not([data-banner-row]) {
  display: none;
}

.bf-holder {
  margin-top: 10px;
  color: var(--band-fg);
}

/* Under a row of tabs (Oversight, System: each tab's own filters), the row keeps the band's ground. */
.pg-head > .bf-holder {
  margin-top: 0;
  padding-top: 10px;
  padding-bottom: 12px;
  background: var(--band-bg);
}

.bf-holder[data-banner-off] {
  display: none;
}

/* A bar with nothing shown yet (the company Quotations before any quotation) takes no room in the band. */
.bf-holder:not(:has(> .bf-row > :not([hidden]))) {
  display: none;
}

.bf-holder .bf-toggle {
  display: none;
}

.bf-holder > .bf-row,
.bf-holder .fr-filters.bf-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  width: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--band-fg);
}

.bf-holder .bf-row .bf-sub {
  display: contents;
}

/* "More"'s further filters, and a page's own "more" box: a line of their own under the row. */
.bf-holder .bf-row :is([data-queue-more-filters], .ov-more, [data-bf-more]):not([hidden]) {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: flex-end;
  /* After "Clear all filters", which stays on the first line beside "More". */
  order: 1;
  gap: 8px 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.bf-holder .bf-row :is(.bf-field, .field) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  margin: 0;
}

/* A search or a list with its explaining line stays narrow; a group of chips takes the width it needs. */
.bf-holder .bf-row :is(.bf-field, .field):not(:has(.fr-filter, .chip, [role='group'])) {
  max-width: 340px;
}

/* A field's own explaining line stays under it, small, in the band's light words. */
.bf-holder .bf-row .bf-field :is(.hint, p:not(.fr-filters-label)) {
  margin: 0;
  font-size: 12px;
}

.bf-holder .bf-row :is(.fr-filters-label, .flbl) {
  margin: 0;
  color: var(--band-fg-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bf-holder .bf-row :is(select, input:not([type='checkbox'], [type='radio'], [type='hidden'])) {
  box-sizing: border-box;
  width: auto;
  min-width: 150px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid #fff;
  border-radius: 6px;
  background: #fff;
  color: #1e293b;
  font: inherit;
  font-size: var(--fs-text, 13px);
}

/* A list takes the width of its choice, at most 230 px (its open list shows every choice whole), so the row keeps
   "Clear all filters" beside the filters at 1280 px. */
.bf-holder .bf-row select {
  max-width: 230px;
}

/* A search field shows its whole placeholder ("Search by company name"). */
.bf-holder .bf-row input[type='search'] {
  min-width: 210px;
}

.bf-holder .bf-row select option {
  color: #1e293b;
}

/* A changed filter: outlined in the band's highlight (the column's outline, `lt-set`, on the white field). */
.bf-holder .bf-row :is(select, input).lt-set {
  box-shadow: 0 0 0 2px var(--brand-highlight, #fbbf24);
}

.bf-holder .bf-row :is(select, input, button):focus-visible {
  outline: 3px solid var(--brand-highlight, #fbbf24);
  outline-offset: 2px;
}

/* A group of filter buttons (and a page's own group of a search and a switch) is a row, not the column's stack. */
.bf-holder .bf-row :is([role='group'], .sys-filter-group, div:has(> .fr-filter)) {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 6px 8px;
}

.bf-holder .bf-row .fr-filter {
  display: inline-flex;
  width: auto;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  background: transparent;
  color: var(--band-fg);
  white-space: nowrap;
}

.bf-holder .bf-row .fr-filter:hover {
  background: rgba(255, 255, 255, 0.12);
}

.bf-holder .bf-row .fr-filter[aria-pressed='true'] {
  border-color: #fff;
  background: #fff;
  color: #0a2351;
}

/* A page's own chips (`chips.ts`: the company Requests, Documents and Quotations, the Guide editor's, Outgoing
   messages', Result documents' quick filters) on the band, as the prototype's: outlined, the chosen one white. */
.bf-holder .bf-row .chip {
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  background: transparent;
  color: var(--band-fg);
}

.bf-holder .bf-row .chip:hover {
  background: rgba(255, 255, 255, 0.12);
}

.bf-holder .bf-row .chip[aria-pressed='true'] {
  border-color: #fff;
  background: #fff;
  color: #0a2351;
}

.bf-holder .bf-row .chip .chip-count {
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
}

.bf-holder .bf-row .chip[aria-pressed='true'] .chip-count {
  background: #dbeafe;
  color: #0a2351;
}

.bf-holder .bf-row .fr-filter-count {
  margin-left: 6px;
  color: inherit;
}

.bf-holder .bf-row .btn {
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  color: var(--band-fg);
}

.bf-holder .bf-row .btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.bf-holder .bf-row :is(label, .hint, p:not(.fr-filters-label)) {
  color: var(--band-fg);
}

/* The column's own header and its "more below" mark are a column's; the row needs neither. */
.bf-holder .bf-row :is(.lt-head, .fr-more-below, .fr-fold-toggle) {
  display: none;
}

.bf-holder .bf-row .lt-clear-all {
  width: auto;
  min-height: 32px;
  margin: 0;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: var(--band-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bf-holder .bf-row .lt-clear-all:disabled {
  opacity: 1;
  color: var(--band-fg-muted);
  font-weight: 400;
  text-decoration: none;
  cursor: default;
}

/* With a filter set, the way back reads as the row's one action. */
.bf-holder .bf-row .lt-clear-all:not(:disabled) {
  font-weight: 700;
}

@media (max-width: 767px) {
  .bf-holder .bf-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    background: transparent;
    color: var(--band-fg);
    font: inherit;
    cursor: pointer;
  }

  .bf-holder .bf-toggle:focus-visible {
    outline: 3px solid var(--brand-highlight, #fbbf24);
    outline-offset: 2px;
  }

  .bf-holder .bf-count {
    padding: 0 6px;
    border-radius: 9px;
    background: #fff;
    color: #0a2351;
    font-size: 11px;
    font-weight: 700;
  }

  .bf-holder:not([data-banner-open]) > .bf-row {
    display: none;
  }

  .bf-holder[data-banner-open] > .bf-row {
    margin-top: 10px;
  }

  .bf-holder .bf-row :is(.bf-field, .field) {
    flex: 1 1 140px;
  }

  .bf-holder .bf-row :is(select, input:not([type='checkbox'], [type='radio'], [type='hidden'])) {
    width: 100%;
    min-width: 0;
    min-height: 40px;
  }

  .bf-holder .bf-row .fr-filter,
  .bf-holder .bf-row .btn,
  .bf-holder .bf-row .lt-clear-all {
    min-height: 40px;
  }
}

/* System's and Oversight's tabs laid their column out in a grid track of its own: with the column in the banner, the
   box takes the whole width. */
@media screen and (min-width: 881px) {
  .sys-body > .sys-panel:not([hidden]):not(:has(> .fr-filters)),
  .ov-body > .ov-panel:not([hidden]):not(:has(> .fr-filters)) {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Release 6.8.3b, R3: the Queue's "AI cost" column (administrator portal only) ----------------------------------- */
.q-table :is(.q-num, [data-queue-ai-cost-head]) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* The heading is a button: the server sorts by the cost, so the paging stays right. */
/* The heading and the figure stay on one line ("AI cost ↕", "≈ $0.0123 so far"): the list keeps its rows short. */
.q-table :is([data-queue-ai-cost-head], .q-num),
.q-table .q-sort {
  white-space: nowrap;
}

.q-table .q-sort {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
}

.q-table .q-sort:hover {
  color: var(--brand-secondary);
}

.q-table .q-sort:focus-visible,
.q-table .q-ai-cost:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

.q-table .q-sort-mark {
  margin-left: 2px;
  color: var(--silver-600);
  font-size: 0.85em;
}

.q-table .q-ai-cost {
  border-bottom: 1px dotted currentColor;
  cursor: help;
}

/* =============================================================================
   Release 6.8.3b, R5 for the list pages outside the frame (Website content, News, Media, Resources, Notifications;
   `data-list-page`): with the list shown (no editor, detail, publish or upload pane open), the working area does not
   scroll at 768 px and up. The list takes the height left under the band and scrolls in its own box (`data-list-scroll`,
   the frame's box look), headings fixed. With a pane open, or under 768 px, the page scrolls as before.
   ========================================================================== */
@media screen and (min-width: 768px) {
  /* No :has() inside :has() (CSS refuses it, and the whole rule with it; the review's probe caught that): the list
     state and the pane state are two rules, the second winning while a pane is open. The working area takes the
     frame's height (at 768 to 880 px the frame is a block, so its height is handed on by `height: 100%`). */
  body[data-frame][data-shell] .app-main:has(> .pg-work[data-list-page]) {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding-bottom: 0;
    overflow: hidden;
  }

  body[data-frame][data-shell]
    .app-main:has(
      > .pg-work[data-list-page]
        :is([data-editor], [data-detail], [data-publish-pane], [data-upload-holder]):not([hidden])
    ) {
    display: block;
    overflow: auto;
  }

  .app-main > .pg-work[data-list-page] {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  .app-main > .pg-work[data-list-page] > :not([data-list-section]) {
    flex: none;
  }

  /* The list section and every box between it and its table: one column that hands the height down. */
  .pg-work[data-list-page] :is([data-list-section], [data-list-section] :has([data-list-scroll])) {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  .pg-work[data-list-page]
    [data-list-section]
    :has([data-list-scroll])
    > :not(:has([data-list-scroll]), [data-list-scroll]) {
    flex: none;
  }

  .pg-work[data-list-page] [data-list-scroll] {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-card);
  }

  .pg-work[data-list-page] [data-list-scroll] thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-sunken);
  }

  /* The section's own room: the list reaches the bottom of the working area with the frame's 10 px. */
  .pg-work[data-list-page] > [data-list-section] {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

/* Release 6.8.3b (the coordinator's check at 768 px): between 721 and 900 px the administrator's header search (160 px,
   `pattern.css`) stood flush against "Administrator portal" and the bar ran 768 px wide. A 12 px gap and a narrower
   search there (its placeholder shows "Company" at 768 px; the full words return from 880 px). Above 900 px and under
   721 px nothing changes. */
@media (min-width: 721px) and (max-width: 900px) {
  .site-header .app-search {
    margin-left: 12px;
  }

  .site-header .app-search input {
    width: clamp(112px, calc(100vw - 680px), 160px);
  }
}

/* --- Release 6.8.3b, the review's F1 to F3 on the band rows ----------------------------------------------------------
   F1: a compact band. One line of filters where it fits; what does not fit waits under "More ▾" (`banner-filters.ts`
   marks it `data-bf-over`). Tighter room between the title row and the filters, and a smaller label. */
.bf-holder .bf-row [data-bf-over] {
  display: none;
}

.pg-head .app-head.pg-band:has(> .bf-holder) {
  padding-top: 12px;
  padding-bottom: 10px;
}

.pg-band > .bf-holder {
  margin-top: 6px;
}

.pg-head > .bf-holder {
  padding-top: 6px;
  padding-bottom: 8px;
}

.bf-holder > .bf-row,
.bf-holder .fr-filters.bf-row {
  gap: 6px 10px;
}

.bf-holder .bf-row :is(.bf-field, .field) {
  gap: 2px;
}

.bf-holder .bf-row :is(.fr-filters-label, .flbl) {
  font-size: 10.5px;
  line-height: 1.3;
}

/* F2: a field's explaining line waits behind the ⓘ beside its label; the labels share one line height, so the
   controls of a row stand on one baseline. */
.bf-holder .bf-row .bf-label-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
}

.bf-holder .bf-row .bf-info .info-toggle {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin-left: 2px;
  font-size: 12px;
  color: var(--band-fg);
}

.bf-holder .bf-row .bf-info .info-text :is(.hint, p) {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
}

/* F3: one "Clear all filters", in the band: where the band has one, the toolbar line's and the empty list's go. */
body:has(.bf-holder:not([data-banner-off]) .bf-row .lt-clear-all:not([hidden])) .lt-clear {
  display: none;
}

/* F1, the title row of a band with filters: a smaller title and its sub-lines closer, so the list keeps the height
   (28 px to 24 px; the frame's banner words and links are unchanged). And the toolbar line above every list slimmer. */
.pg-head .app-head.pg-band:has(> .bf-holder) h1,
.pg-head:has(> .bf-holder) .app-head.pg-band h1 {
  font-size: 24px;
  line-height: 1.2;
}

.pg-head .app-head.pg-band:has(> .bf-holder) .pg-band-sub,
.pg-head:has(> .bf-holder) .app-head.pg-band .pg-band-sub {
  margin-top: 2px;
}

.lt-bar {
  padding-top: 4px;
  padding-bottom: 4px;
}

/* F1, the Companies list: the company's name, its plan and its start · release stay on one line (they wrapped into
   three lines in narrow columns, so a row took 93 px); the table scrolls sideways in its box when it must. */
tbody[data-company-directory] > tr > td:is(:nth-child(1), :nth-child(3), :nth-child(7)) {
  white-space: nowrap;
}

/* Review F6 (Website content and Media at 768 px): a bar without stacked labels ("Show", its kind chips, "Include
   archived") stands on one centre line; a chip row inside it brings no margin of its own. */
.bf-holder > .bf-row:not(:has(.bf-field, .field)) {
  align-items: center;
}

.bf-holder .bf-row .chip-row {
  margin: 0;
}

/* Review addendum (b): the Queue's "Needs you" item lists ("Show each item") scroll in a box of their own, at most
   40 % of the screen high, their headings fixed like the list's; opened, they no longer push the list off the screen. */
[data-queue-strip] .table-scroll {
  max-height: 40vh;
  overflow: auto;
}

[data-queue-strip] .table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-sunken);
}

/* Lane 1's sweep at 768 px: the Notification centre and Processing · Run history squeezed a column (Details about
   90 px, one word a line; the company name over two lines). The column keeps its room; the table scrolls sideways
   in its own box when the screen is narrower ("More columns →"). */
tbody[data-notifications] > tr > td:nth-child(4) {
  min-width: 260px;
}

tbody[data-notifications] > tr > td:is(:nth-child(1), :nth-child(3)),
tbody[data-runs] > tr > td:nth-child(2) {
  white-space: nowrap;
}

/* The coordinator's re-measure with lane 1's frame fix: a table's own `.table-scroll` inside a frame box (Subscriptions'
   tabs) made a scroll box of its own that never scrolls, so the heading stuck to it and scrolled away with the frame box.
   Inside a frame box it is no scroller: the frame box scrolls both ways and the heading stays at its top. */
.fr-scroll .table-scroll {
  overflow: visible;
}

/* The coordinator's re-measure (heading in view after scrolling a list to its end): the shared `table { overflow:
   hidden }` (`components.css`, for its rounded corners) made every table its own sticky container, so a "sticky"
   heading scrolled away with the rows (Companies: heading at y = -2528 at the list's end). A table in a list box does
   not clip; the box keeps the corners. */
:is(.fr-scroll, [data-list-scroll], .table-scroll) table {
  overflow: visible;
}

/* =============================================================================
   Release 6.8.3, B0 for F19 (the owner, 27 October 2026: "all information should have a collapse option"; sketch
   683/SKETCH-6.8.3-COLLAPSE.html, approved): every information block of both portals is a `<details class="cb">`
   with a ▸ heading, its name, a one-line summary that stays in view when closed, and a small hint at the right end
   (`collapse.ts`). "Collapse all" / "Expand all" sit in `.cb-bar`. `cb-` classes only; colours from the tokens, so
   both themes follow.

   6.8.3b, R1 (the owner's remark 1, 28 Oct 2026; prototype PROTOTYPE-683B-REMARKS-FROZEN-28OCT2026.html): the ▸, the hint
   and the "⤢ Full screen" text button gave way to two window icons at the top right of every block's heading, "—" / "+"
   and "□" (`.cb-win`); R4: "Collapse all · Expand all" is one thin line in the banner's top right corner.
   ========================================================================== */

.cb {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-card);
  margin: 0 0 10px;
}

.cb > .cb-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 8px 14px;
  cursor: pointer;
  list-style: none;
}

.cb > .cb-head::-webkit-details-marker {
  display: none;
}

.cb > .cb-head:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 10px;
}

.cb-title {
  color: var(--text-strong);
  font-weight: 700;
}

/* A page's own heading moved into a block's heading (the gate page's parts, `.fr-part-head`) reads as the block's name,
   not as a band of its own. */
.cb > .cb-head > .cb-title {
  position: static;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
}

.cb-summary {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.9em;
}

.cb > .cb-body {
  padding: 0 14px 12px;
}

/* --- R1: the window icons ---------------------------------------------------------------------------------------- */
.cb-win {
  display: inline-flex;
  flex: none;
  order: 99;
  gap: 2px;
  align-items: center;
  margin-left: auto;
  float: right;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}

.cb-win[hidden] {
  display: none;
}

/* A plain heading (a title on its own) floats the icons to its right; a heading row (flex) ends with them at its right
   end, and the row's own tools (downloads, a link) stand right before them. */
.cb-card-head > .cb-win {
  margin-left: auto;
  padding-left: 8px;
}

.cb-card-head > :nth-last-child(2):not(:first-child) {
  margin-left: auto;
}

.cb-card-head > :nth-last-child(2):not(:first-child) + .cb-win {
  margin-left: 0;
}

.cb-win-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-strong);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.cb-win-btn:hover {
  background: var(--surface-sunken);
}

.cb-win-btn:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--focus-ring);
}

/* "□": one square; "❐" (Restore, in the full-screen bar): two overlapping squares. Drawn, so every font shows them. */
.cb-win-full::before,
.cb-win-restore::before,
.cb-win-restore::after {
  box-sizing: border-box;
  content: '';
  border: 1.5px solid currentColor;
  border-radius: 1px;
}

.cb-win-full::before {
  width: 11px;
  height: 11px;
}

.cb-win-restore::before,
.cb-win-restore::after {
  position: absolute;
  width: 9px;
  height: 9px;
  background: var(--band-bg);
}

.cb-win-restore::before {
  top: 8px;
  left: 14px;
}

.cb-win-restore::after {
  top: 12px;
  left: 10px;
}

/* A phone: larger targets (36 to 40 px, R1). */
@media (max-width: 767px) {
  .cb-win-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }
}

/* A block that needs you (a red or yellow notice) keeps the notice's colours, open or closed. */
.cb[data-needs-you] {
  border-color: var(--warn-line);
  background: var(--warn-bg);
}

.cb[data-needs-you] .cb-summary {
  color: var(--warn-fg);
}

.cb-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 8px;
}

/* 6.8.3a (the owner, 27 Oct 2026: boxes ran past their cards and stopped scrolling): a card that collapses IN PLACE
   (`attachCardCollapse`). Nothing of the card moves, so its own height and scroll rules hold; its heading gains the ▸
   toggle and the hint, and a closed card shows only its heading and its one-line summary. */
.cb-card-head {
  cursor: pointer;
}

.cb-card-head > .cb-summary {
  margin-left: 10px;
  font-weight: 400;
}

/* In full screen (`full-screen.ts` marks the box `data-full`) the whole card shows; the bar's "❐" stands for its icons. */
[data-full] .cb-card-head {
  cursor: auto;
}

/* Full screen (`data-full`) shows the whole card, closed or not. */
.cb-card[data-collapsed]:not([data-full]) > :not(.cb-card-head, .cb-card-keep) {
  display: none !important;
}

.cb-card[data-collapsed]:not([data-full]) {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
}

.cb-card[data-needs-you] {
  border-color: var(--warn-line);
}

/* 6.8.3a, point 22: "Collapse all · Expand all" as small links in a heading row that is already there (the tab's
   top-right block, a panel's head line): the size of a block's own hint, at the row's right end, never a row of their
   own. In a plain heading they float to its right; in a heading row (flex) they follow its last item. */
.cb-all-links {
  float: right;
  margin-left: 14px;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.6;
  white-space: nowrap;
}

/* A heading row (title and tools): the title takes the free room, so its tools and the two links stand together at
   the right end. */
.cb-card-head:has(> .cb-all-links) > :first-child {
  margin-right: auto;
}

/* 6.8.3a, section 1e (R8: on a phone the links wrap under the heading's words; floating, they hung below the heading
   and the block under it, a box of its own, stood beside them, about 130 px wide): the heading holds its links. */
.cb-card-head:has(> .cb-all-links)::after {
  display: block;
  clear: both;
  content: '';
}

.cb-all-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-link);
  font: inherit;
  cursor: pointer;
}

.cb-all-link:hover {
  text-decoration: underline;
}

.cb-all-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

.cb-all-sep {
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .cb > .cb-body {
    padding-left: 14px;
  }
}

/* A `<details>` block shown full screen (`data-full`): the browser draws its summary first, above the full-screen bar;
   the bar names the block and holds "❐", so the summary steps aside until the block is restored. */
.cb[data-full] > .cb-head {
  display: none;
}

/* --- R4: "Collapse all · Expand all", one very thin line in the top right corner of the blue banner ------------- */
.cb-banner-host {
  position: relative;
}

.cb-all-links.cb-banner-all {
  position: absolute;
  top: 0;
  right: 24px;
  z-index: 1;
  float: none;
  margin: 0;
  font-size: 11px;
  line-height: 1;
  color: var(--band-fg-muted);
}

/* The words stay one thin 11 px line; the invisible room around them makes each a 24 px target (WCAG 2.5.8). */
.cb-banner-all .cb-all-link {
  min-height: 24px;
  padding: 6px 2px;
  color: var(--band-fg-muted);
  font-size: 11px;
  line-height: 1;
}

.cb-banner-all .cb-all-link:hover,
.cb-banner-all .cb-all-link:focus-visible {
  color: var(--band-fg);
  text-decoration: underline;
}

.cb-banner-all .cb-all-link:focus-visible {
  outline: 2px solid var(--band-fg);
  outline-offset: 1px;
  box-shadow: none;
}

.cb-banner-all .cb-all-sep {
  color: var(--band-fg-muted);
}

@media (max-width: 767px) {
  .cb-all-links.cb-banner-all {
    right: 16px;
  }
}

/* -----------------------------------------------------------------------------
   Fix lane A (audit C56 to C61, C68; 17 Nov 2026): THE REGISTRATION DRAWER.

   The registration review and Create company open as a drawer anchored to the right, 560 to 640 px wide, over a
   dimmed page (C60). The review's body scrolls; its footer is fixed: the primary "Approve registration", "Reject…" set
   apart, "More" with the removal, one line under each (C58). Words break between words only, never inside one.
   On a narrow screen the drawer is the full-screen sheet, as every side panel is (`side-panel.ts`).
   -------------------------------------------------------------------------- */

/* Candidate F10 (the coordinator's ruling, 21 Nov 2026): frame.css is the only sheet after workspace.css that names a
   workspace class, so the drawer is named by its own class, twice for the same weight as before (it is only ever on
   the two side panels of admin-companies.html). */
.rg-drawer.rg-drawer,
[data-side-dock] > .rg-drawer.rg-drawer {
  position: fixed;
  top: var(--app-header-h, 68px);
  right: 0;
  bottom: 0;
  z-index: 90;
  width: clamp(560px, 42vw, 640px);
  max-width: 100%;
  height: auto;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-card);
  box-shadow: -18px 0 48px rgba(10, 22, 40, 0.22);
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
}

/* The review: head, a body that scrolls, a fixed footer. */
.rg-drawer.rg-drawer[data-review-panel] {
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.rg-drawer .rg-head {
  flex: none;
  padding: 18px 24px 12px;
  border-bottom: 1px solid var(--line);
}

.rg-head-text {
  min-width: 0;
}

.rg-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 6px 0 0;
  font-size: var(--fs-hint, 13.5px);
  color: var(--text-muted);
}

.rg-sub:empty {
  display: none;
}

.rg-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 24px 20px;
}

.rg-section-title {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rg-drawer .kv dt,
.rg-drawer .kv dd {
  overflow-wrap: break-word;
  word-break: normal;
}

.rg-check .pill {
  margin-right: 4px;
}

.rg-approval {
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-sunken);
}

.rg-section .rg-approval {
  margin-top: 12px;
}

.rg-technical > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-strong);
}

.rg-technical[open] > summary {
  margin-bottom: 10px;
}

/* The footer. Hidden while it holds nothing (a decided registration). */
.rg-foot {
  flex: none;
  padding: 14px 24px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-card);
}

.rg-foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 20px;
}

.rg-foot-main {
  display: flex;
  flex: 1 1 260px;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* "Reject…" and "More" stand apart, on the right, behind a rule. */
.rg-foot-apart {
  display: flex;
  flex: 0 1 200px;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.rg-act {
  min-width: 0;
}

.rg-act-line {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
}

.rg-act button:disabled + .rg-act-line {
  color: var(--text-body);
}

.rg-more {
  position: relative;
}

.rg-more > summary {
  list-style: none;
}

.rg-more > summary::-webkit-details-marker {
  display: none;
}

.rg-more-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 2;
  width: 280px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-card);
  box-shadow: 0 12px 32px rgba(10, 22, 40, 0.18);
}

.rg-more-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--bad-fg);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.rg-more-item:hover,
.rg-more-item:focus-visible {
  background: var(--surface-sunken);
}

.rg-more-menu .rg-act-line {
  padding: 0 10px 4px;
}

.rg-step {
  display: grid;
  gap: 8px;
}

.rg-step-lead {
  margin: 0;
}

.rg-step-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.rg-answer,
.rg-drawer > [data-answer] {
  margin: 10px 0 0;
}

.rg-drawer > [data-answer] {
  padding: 0 24px 14px;
}

.rg-answer[data-tone='error'] {
  color: var(--bad-fg);
}

/* The dimmed page behind an open drawer; a click on it closes the drawer. */
.rg-backdrop {
  position: fixed;
  inset: var(--app-header-h, 68px) 0 0 0;
  z-index: 89;
  background: rgba(10, 22, 40, 0.45);
}

@media (max-width: 880px) {
  .rg-drawer.rg-drawer,
  [data-side-dock] > .rg-drawer.rg-drawer {
    top: 0;
    width: 100%;
    border-left: 0;
  }

  .rg-backdrop {
    inset: 0;
  }

  .rg-foot-apart {
    flex: 1 1 100%;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .rg-foot-apart > .rg-act {
    flex: 1 1 auto;
  }

  /* The footer never takes more than half of a phone's height; it scrolls inside itself beyond that. */
  .rg-foot {
    max-height: 50vh;
    overflow-y: auto;
  }

  .rg-more-menu {
    right: auto;
    left: 0;
  }
}

@media (max-width: 480px) {
  .rg-drawer .rg-head,
  .rg-body,
  .rg-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* The approval form's own summary is kept for the scripts that fill it; the drawer's body shows the same facts. */
.rg-approval [data-approval-summary] {
  display: none;
}

/* The same footer on the company page of a registration that waits (C56, C65), under the band. */
.rg-host {
  padding-top: var(--space-2, 8px);
  padding-bottom: var(--space-2, 8px);
}

.rg-company-card {
  padding: 12px 16px 14px;
  border: 1px solid var(--warn-line, var(--line));
  border-radius: var(--radius-sm, 8px);
  background: var(--surface-card);
}

.rg-company-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 10px;
}

.rg-company-review {
  margin-left: auto;
}

/* The Queue's "Registrations to decide" line (C64), above Needs you. */
.q-registrations {
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--text-link, #1d4ed8);
  border-radius: var(--radius-sm, 8px);
  background: var(--surface-card);
}

/* Close-out 40 and 41a: the panel that replaces the register form after an accepted Submit. */
.reg-done {
  padding: 22px 24px;
  border-radius: 12px;
}

.reg-done-title {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.reg-done p {
  margin: 0 0 10px;
}

.reg-done-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 6px;
}

/* The register page's three steps (C52). */
.reg-steps-title {
  margin: 0 0 10px;
  font-size: 20px;
}

.reg-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  counter-reset: reg-step;
}

.reg-steps > li {
  position: relative;
  padding: 14px 14px 14px 52px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-card);
  counter-increment: reg-step;
}

.reg-steps > li::before {
  content: counter(reg-step);
  position: absolute;
  top: 14px;
  left: 14px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text-link, #1d4ed8);
  color: #fff;
  font-weight: 700;
}

.reg-steps > li strong,
.reg-steps > li span {
  display: block;
}

.reg-steps > li span {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-muted);
}

@media (max-width: 760px) {
  .reg-steps {
    grid-template-columns: 1fr;
  }
}

/* Fix lane A (audit C66): on the company page the tabs wrap onto a second line instead of hiding behind a sideways
   scroll (from 601 px; on a phone the strip still scrolls sideways, six rows of tabs would fill the screen), and the plan card and the registration decision stand below the band and its tabs. */
@media (min-width: 601px) {
  /* F10: the tab strip by its role (every workspace tab strip is a tablist), twice for the same weight. */
  .fr-page .detail-head .pg-head-tools .pg-tabs-bar [role='tablist'][role='tablist'] {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 6px;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* Fix lane A (audit C67): on a phone the Companies list and the registrations list read as cards, one per company,
   each cell on its own line with its column's name. */
@media (max-width: 600px) {
  :is([data-panel='directory'], [data-panel='awaiting']) table,
  :is([data-panel='directory'], [data-panel='awaiting']) tbody,
  :is([data-panel='directory'], [data-panel='awaiting']) tr,
  :is([data-panel='directory'], [data-panel='awaiting']) td {
    display: block;
    width: 100%;
  }

  :is([data-panel='directory'], [data-panel='awaiting']) thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  :is([data-panel='directory'], [data-panel='awaiting']) tbody tr {
    margin: 0 0 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-card);
  }

  :is([data-panel='directory'], [data-panel='awaiting']) tbody td {
    position: static;
    padding: 4px 0;
    border: 0;
    white-space: normal;
  }

  /* Review R1, M1: the cards keep the phone's width whatever a wider table rule says. A rule for every table (lane D's
     "a table under 1024 px keeps a readable minimum width", `look.css`, at specificity 0-1-2 for the table, 0-1-3 for
     its cells and 0-3-4 for the Companies list's fifth cell) would widen a card to 880 px. These selectors are scoped to
     the two lists and carry more weight on purpose (`html body`, and `:nth-child(n):not([hidden])` on a cell, which
     matches every visible cell), so they win wherever the other file is imported. */
  html body :is([data-panel='directory'], [data-panel='awaiting']) :is(table, thead, tbody, tr) {
    min-width: 0;
    max-width: 100%;
  }

  html
    body
    :is([data-panel='directory'], [data-panel='awaiting'])
    table
    > tbody
    > tr
    > td:nth-child(n):not([hidden]) {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  :is([data-panel='directory'], [data-panel='awaiting']) tbody td[data-col]::before {
    content: attr(data-col);
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
  }
}

/* =============================================================================
   Mod 19 P8, lane D (audit 17 Nov 2026, Groups D, E, F): one look in both portals.
   Sketches: docs/project-control/tasks/sketches/MOD19-P8-D-*.html. Loaded before frame.css (which stays last).
   Sections: E1 the banner template · E2 badges, empty states · D narrow widths · F small layout points.
   ========================================================================== */

/* --- E1. The one banner template ------------------------------------------------------------------------------------
   Title: one size on every page (24 px; 28 px stood on the pages without filters). The count line right under it. */
.pg-head .app-head.pg-band h1,
.app-head.pg-band h1 {
  font-size: 24px;
  line-height: 1.2;
}

.app-head.pg-band .pg-band-sub {
  margin-top: 2px;
}

/* Figures (counts) are not filters: one row of chips at the top of the box (the Queue's figures, Oversight's refused
   signal counts), never a column in the banner. */
.fr-box > .stat-grid[data-signal-metrics] {
  display: flex;
  flex-flow: row wrap;
  gap: 6px;
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.fr-box > [data-signal-metrics] .stat-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.fr-box > [data-signal-metrics] dt {
  color: var(--text-muted);
  font-size: 13px;
}

.fr-box > [data-signal-metrics] dd {
  margin: 0;
  font-weight: 600;
  font-size: 13px;
}

/* --- D. Narrow widths (tablet 768 px, phone 375 px) ------------------------------------------------------------------
   59: the phone header. The search stays as a 40 px magnifier that opens into a full-width field when tapped (it
   was removed under 720 px); the account button says "Account" and is 40 px high (it was a lone "⌄"). */
.name-menu-short {
  display: none;
}

@media (max-width: 720px) {
  .site-header .app-search {
    display: block;
    position: static;
  }

  .site-header .app-search input {
    width: 40px;
    min-height: 40px;
    padding: 0;
    border-color: transparent;
    background: transparent;
    color: transparent;
    cursor: pointer;
  }

  .site-header .app-search input::placeholder {
    color: transparent;
  }

  .site-header .app-search svg {
    left: auto;
    width: 18px;
    height: 18px;
    transform: translate(11px, -50%);
  }

  .site-header .app-search:focus-within input {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 12px;
    z-index: 80;
    width: auto;
    padding: 4px 10px 4px 30px;
    border-color: var(--line-strong);
    background: var(--surface-card);
    color: var(--text-body);
    cursor: text;
  }

  .site-header .app-search:focus-within input::placeholder {
    color: var(--text-muted);
  }

  .site-header .app-search:focus-within svg {
    display: none;
  }

  .name-menu summary {
    min-height: 40px;
    min-width: 40px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .name-menu-short {
    display: inline;
    font-weight: 600;
    font-size: 13px;
  }

  /* The portal's name keeps its words on two short lines instead of "Ad… por…". */
  .site-header .app-area-name {
    flex: 0 0 auto;
    min-width: 72px;
    max-width: 76px;
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    font-size: 11px;
    line-height: 1.15;
  }

  .site-header .nav-cta {
    gap: 2px;
  }
}

/* 58: a tab row never shows a scroll track; a row that does not fit scrolls by swipe, its edges fade as before.
   Round 2 (R1 D4): under 1024 px only; on a desktop a mouse user keeps the scroll track as the overflow hint. */
@media (max-width: 1023px) {
  :is(.pg-tabs-bar, [role='tablist']) {
    scrollbar-width: none;
  }

  :is(.pg-tabs-bar, [role='tablist'])::-webkit-scrollbar {
    display: none;
  }
}

/* The figures' chips stay ONE row on a phone (they took five lines over the list); the row swipes sideways. */
@media (max-width: 767px) {
  .fr-box :is(.chip-row.q-figures, .stat-grid[data-signal-metrics]) {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .fr-box :is(.chip-row.q-figures, .stat-grid[data-signal-metrics]) > * {
    flex: 0 0 auto;
  }
}

/* C5-C11, 56, 60, 61, 64-67: a date, a code, a badge and a button in a table cell never break inside.
   Candidate F10 (the coordinator's ruling, 21 Nov 2026): the wide-table rule that stood here (a table of five or more
   columns keeps a readable minimum width under 1024 px) names the side panel to leave it out, and frame.css is the only
   sheet after workspace.css that names a workspace class; it is a rule of the shared frame, so it moved to the end of
   frame.css, unchanged. */
@media (max-width: 1023px) {
  :is(.fr-scroll, .table-scroll, [data-list-scroll])
    > table:not(:is([data-panel='directory'], [data-panel='awaiting'], [data-table-cards]) table)
    td
    :is(time, code, .mono, .pill, .badge, .btn, a[href*='CAT-']) {
    white-space: nowrap;
  }
}

/* 64: the Queue's Next step keeps a column of its own width (it read "Review / the / result" at 768 px).
   Round 2 (R1 D5): by the cell's class, not its position; the column takes the cell's width, the header stays plain
   (P5-24). */
.q-table td.q-next {
  min-width: 180px;
}

/* 55: Gate allocations' "Set on, by" stays readable at 768 px: its own width; the table scrolls sideways in its box. */
table[aria-labelledby='companies-heading'] > tbody[data-companies] > tr > td:nth-child(5) {
  min-width: 220px;
}

/* =============================================================================
   The shared page frame of both portals (release 6.8.2, lane B0; C0.1 to C0.4, C3.4, C3.6, C4.0, C5.19)

   - C0.1, C0.2: the window never scrolls. Above the narrow screen (881 px and wider) every signed-in page is one
     screen: the top bar, the administrator's menu and the company footer stay put, and the working area (`.app-main`)
     is the one scroller of last resort. A page placed in the frame (`.fr-page`) does not scroll at all: only its boxes
     (`.fr-scroll`, `.fr-filters`, the docked side panel) scroll, both ways, with fixed table headings and, on request,
     a fixed first column. On a narrow screen (880 px and below) the page scrolls as a whole, as before, so nothing is
     cut off. `layout.mjs` marks every signed-in document `data-frame`; the guard spec `frame-no-window-scroll.spec.ts`
     holds the rules below and refuses any later rule that lets the window scroll again.
   - C0.3: the back arrow "← Back to <page>" (`back-link.ts`), at the top left of the banner.
   - C0.4: one boxed tab style for every tab strip of both portals (the chrome buttons of the request page's head).
   - C3.6: the line "Showing only: <filter> ✕ Show all N" (`show-all.ts`).
   - C3.4: "⤢ Full screen" for a long table, Esc closes (`full-screen.ts`).
   - The administrator layout of the final review file: the left filter column, one box, the side panel docked beside it.
   - C5.19: the administrator menu's headings, navy and bold with a blue bar on a light band, each foldable; the active
     page with a blue bar on the left.
   - C4.0: the company footer stays as it is (`layout.mjs`, `pattern.css`); the administrator portal has none. The
     working area's zoom chip stays (DEC:200).

   Loaded last by `main.css`, so the frame wins every tie. Colours are the theme's tokens or the chrome tab's own
   fixed colours (a chrome button is its own light ground in both views).
   ========================================================================== */

/* --- C0.1, C0.2: one screen, the window never scrolls ------------------------------------------------------------
   6.8.3b, R5 (the owner's remark 5): from 768 px (tablet and laptop widths), no longer from 881 px; below 768 px (a
   phone) the page scrolls as before. */
@media screen and (min-width: 768px) {
  html:has(> body[data-frame]) {
    height: 100%;
    overflow: hidden;
  }

  body[data-frame] {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
  }

  body[data-frame] > .site-header {
    flex: none;
  }

  /* The administrator's two columns fill what the top bar leaves; the menu scrolls inside itself. */
  body[data-frame][data-shell] > .app-frame {
    flex: 1 1 auto;
    min-height: 0;
  }

  body[data-frame][data-shell] > .app-frame > .admin-side {
    position: static;
    align-self: stretch;
    height: auto;
    min-height: 0;
  }

  /* The working area: the scroller of last resort for a page not yet placed in the frame. Inside it, the pinned row of
     tabs pins at its top (the top bar is outside it), and what it scrolls to lands below that row. */
  body[data-frame][data-shell] > .app-main,
  body[data-frame][data-shell] > .app-frame > .app-main {
    --app-header-h: 0px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scroll-padding-top: var(--pg-scroll-top-in, 0px);
  }

  /* 6.8.3b (found by lane 2 at 768 to 880 px): below 1121 px the administrator's frame is a plain block (pattern.css,
     the menu becomes a drawer), so the working area grew to its content's height and nothing in it could scroll: a
     list's lower rows were out of reach. The working area takes the frame's height at every width of the one screen,
     so its boxes (or, for a page not in the frame, the working area itself) scroll again. */
  body[data-frame][data-shell] > .app-frame > .app-main {
    height: 100%;
    min-height: 0;
  }

  /* A page placed in the frame does not scroll at all: only its boxes do. */
  body[data-frame][data-shell] .app-main:has(> .fr-page) {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    overflow: hidden;
  }

  .app-main > .fr-page {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  .fr-page > * {
    flex: none;
  }

  .fr-page > .fr-body {
    flex: 1 1 auto;
    min-height: 0;
  }
}

/* --- The administrator layout: the left filter column, one box, the side panel ----------------------------------- */
.fr-body {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  min-width: 0;
}

/* The left column: the filters and the page's own short lists. */
.fr-filters {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 6px;
  width: 220px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-card);
  font-size: var(--fs-text, 13px);
}

.fr-filters-label {
  margin: 4px 0 0;
  font-size: var(--fs-small, 11px);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* A choice in the column: the selected one is light blue and bold; clicking it again returns to All (C3.6). */
.fr-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-body);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.fr-filter:hover {
  background: var(--surface-sunken);
}

.fr-filter[aria-pressed='true'] {
  background: #e8f0fb;
  color: var(--brand-secondary);
  font-weight: 600;
}

.fr-filter:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 1px;
}

.fr-filter-count {
  margin-left: auto;
  font-size: var(--fs-small, 11px);
  color: var(--text-muted);
}

/* 6.8.3a, section 1f (point 54): on the chosen filter's pale blue the grey count was 4.14:1; it takes the chosen
   filter's own colour, as its words do. */
.fr-filter[aria-pressed='true'] .fr-filter-count {
  color: inherit;
}

/* The one box: its head stays, its list scrolls. */
.fr-box {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-card);
}

.fr-box-head {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.fr-box-head > .fr-box-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

/* A part of the box with its own heading (System's tabs: one box, parts with sticky headings). */
.fr-part-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-sunken);
  font-weight: 600;
}

/* The scrolling block (C0.1 amended): both ways when needed, headings fixed. */
.fr-scroll {
  flex: 1 1 auto;
  min-width: 0;
  overflow: auto;
}

.fr-scroll > table {
  min-width: 100%;
}

.fr-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-sunken);
}

/* A wide table keeps its first column (Item No. or the name) at the left while it scrolls sideways. */
.fr-pin-first th:first-child,
.fr-pin-first td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface-card);
}

.fr-pin-first thead th:first-child {
  z-index: 3;
  background: var(--surface-sunken);
}

/* The docked side panel: beside the box, not over the page. `side-panel.ts` puts a panel into `[data-side-dock]` when
   the page has one; the slot takes no room while no panel is open. At 880 px and below the panel is the sheet. */
.fr-side {
  display: flex;
  flex: none;
  min-height: 0;
}

.fr-side:not(:has(> .ws-side-panel:not([hidden]))) {
  display: none;
}

@media screen and (min-width: 881px) {
  .fr-filters,
  .fr-box,
  .fr-side {
    min-height: 0;
  }

  .fr-filters {
    overflow: auto;
  }

  [data-side-dock] > .ws-side-panel {
    position: static;
    inset: auto;
    z-index: auto;
    width: 380px;
    max-width: 100%;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: none;
    overflow-y: auto;
  }

  [data-side-dock] > .ws-side-panel.fr-side-wide,
  [data-side-dock] > .ep-panel {
    width: 540px;
  }
}

/* On a narrow screen the blocks stand one under the other; a wide table still scrolls sideways inside its box, never
   the page. */
@media (max-width: 880px) {
  .fr-body {
    flex-direction: column;
    padding: 10px;
  }

  .fr-filters {
    width: auto;
  }
}

/* 6.8.3b, R5: from 768 px the page does not scroll, so between 768 and 880 px the stacked box takes the room left and
   scrolls inside itself; the column above it keeps at most a third of the window. */
@media screen and (min-width: 768px) and (max-width: 880px) {
  .fr-filters,
  .fr-box,
  .fr-side {
    min-height: 0;
  }

  .fr-filters {
    flex: none;
    max-height: 33vh;
    overflow: auto;
  }

  .fr-body > .fr-box {
    flex: 1 1 auto;
  }

  /* The administrator's Statistics area scrolls under its fixed head from 881 px (admin-w5-pages.css, 6.8.3a); the one
     screen starts at 768 px now, so it does here too (found by the reachability sweep: rows out of reach at 768 to
     880 px). */
  .stats-one {
    overflow-y: auto;
  }
}

/* A phone (under 768 px): the page scrolls as a whole. */
@media (max-width: 767px) {
  .fr-scroll {
    overflow-y: visible;
    overflow-x: auto;
  }
}

/* --- C0.3: the back arrow, at the top left of the banner ---------------------------------------------------------- */
.fr-back {
  display: inline-block;
  margin: 0 0 4px;
  font-size: var(--fs-text, 13px);
  font-weight: 600;
  color: var(--band-fg-muted, #93c5fd);
}

.fr-back:hover {
  text-decoration: underline;
}

.fr-back:focus-visible {
  outline: 3px solid var(--brand-highlight);
  outline-offset: 2px;
}

/* On a light ground (a page without a dark band) the arrow takes the link colour. */
.fr-back.fr-back-light {
  color: var(--text-link);
}

/* --- C0.4: one boxed tab style, both portals ---------------------------------------------------------------------- */
/* Every tab strip looks like the request page's head: each tab its own light chrome button, only as wide as its word;
   the open tab blue with white words; count pills inside; no underline strip. The head's own rule (workspace.css) is
   the same look on the navy band and stays. */
.ws-tabs {
  gap: 8px;
  border-bottom: 0;
}

.ws-tab {
  min-height: 34px;
  padding: 6px 16px;
  border: 1px solid #9aa6b6;
  border-radius: 8px;
  color: #22324a;
  background: linear-gradient(180deg, #ffffff 0%, #eef1f5 45%, #dfe4eb 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(0, 0, 0, 0.18);
  font-size: var(--fs-text, 14px);
  font-weight: 600;
  line-height: 1.2;
}

.ws-tab:hover {
  color: #22324a;
  background: linear-gradient(180deg, #ffffff 0%, #f4f6f9 45%, #e6eaf0 100%);
}

.ws-tab[aria-selected='true'] {
  color: #fff;
  border-color: #0d2f66;
  background: linear-gradient(180deg, #3d70cc 0%, #2f66c4 45%, #1d4ea5 55%, #2f66c4 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 1px 3px rgba(0, 0, 0, 0.3);
  font-weight: 700;
}

.ws-tab:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

/* The count inside a tab: a small white pill, blue on the open tab. */
.ws-tab-count,
.ws-tab [data-tab-count] {
  display: inline-block;
  min-width: 18px;
  margin-left: 6px;
  padding: 0 6px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #1e293b;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.ws-tab[aria-selected='true'] :is(.ws-tab-count, [data-tab-count]) {
  border-color: #fff;
  color: #1d4ed8;
}

.ws-tab-count[hidden] {
  display: none;
}

/* The chrome button is its own light ground in the dark view too: its words keep their colours. */
html[data-theme='dark'] body[data-shell] .ws-tab {
  color: #22324a;
}

html[data-theme='dark'] body[data-shell] .ws-tab[aria-selected='true'] {
  color: #fff;
  border-color: #0d2f66;
}

/* --- C3.6: "Showing only: <filter> ✕ Show all N" ------------------------------------------------------------------ */
.fr-showing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 5px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text-body);
  font-size: var(--fs-hint, 12.5px);
}

.fr-showing[hidden] {
  display: none;
}

.fr-showing-what {
  font-weight: 600;
  color: var(--text-strong);
}

.fr-show-all {
  padding: 2px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-card);
  color: var(--text-link);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.fr-show-all:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

html[data-theme='dark'] body[data-shell] .fr-showing {
  background: var(--surface-sunken);
}

/* --- C3.4: "⤢ Full screen" for a long table, Esc closes ----------------------------------------------------------- */
/* 6.8.3b, R1: the opener is the window icon "□" (collapse.css `.cb-win-full`), the bar's closer "❐". */
/* The same element covers the window: nothing is drawn again, so a draft in it is never lost. Below the dialog (100)
   and the side panel (90), above the top bar (50) and the footer (55). */
.fr-full {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  margin: 0;
  max-width: none;
  max-height: none;
  padding: 10px 14px;
  border-radius: 0;
  background: var(--surface-page);
  /* 6.8.3a (the owner: "if I made the rows ... full screen, then I couldn't scroll down"): a box whose rows are not in
     one of the scroll areas below still scrolls as a whole; the bar stays at the top. */
  overflow: auto;
  zoom: 1;
}

.fr-full-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--band-bg, #0a2351);
  color: #fff;
  font-size: var(--fs-text, 14px);
}

.fr-full-bar[hidden] {
  display: none;
}

/* 6.8.3a: the box's own "□" is not offered while it is full screen ("❐" Restore is in the bar). */
.fr-full .fr-full-button[aria-expanded='true'] {
  display: none;
}

.fr-full-title {
  font-weight: 700;
}

/* 6.8.3a, section 1e (R7: at 375 px "CAT-2026-000001 · Parts · Processed · 60 of 60 items done · 12 parts" ran over
   four lines and the bar's top was clipped): the title takes the room beside "Close full screen", at most two lines,
   then "…" (its whole words on hover, full-screen.ts); the button keeps its size; the bar stays whole at the top. */
.fr-full-bar > .fr-full-title {
  display: -webkit-box;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow-wrap: anywhere;
}

.fr-full-bar > .fr-full-close {
  flex: none;
}

.fr-full-bar .fr-full-close {
  margin-left: auto;
}

/* 6.8.3b, R1: the bar's "❐" (Restore) is light on the dark bar, with the dark focus ring. */
.fr-full-bar > .cb-win-restore {
  color: #fff;
}

.fr-full-bar > .cb-win-restore:hover {
  background: rgb(255 255 255 / 16%);
}

.fr-full-bar > .cb-win-restore:focus-visible {
  box-shadow: var(--focus-ring-dark);
}

.fr-full :is(.fr-scroll, .tc-scroll, .table-scroll) {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  height: auto;
  overflow: auto;
}

body[data-full-screen] {
  overflow: hidden;
}

/* --- C5.19: the administrator menu ---------------------------------------------------------------------------- */
.side-group-title {
  margin: var(--space-3) 2px 4px;
  padding: 0;
  font-size: var(--fs-small, 11.5px);
  letter-spacing: 0.09em;
}

.side-fold {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(90deg, #eaf1fc, rgba(234, 241, 252, 0));
  color: var(--navy-900);
  font: inherit;
  font-weight: 800;
  letter-spacing: inherit;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}

.side-fold::before {
  content: '';
  flex: none;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--brand-secondary);
}

.side-fold-mark {
  margin-left: auto;
  font-size: var(--fs-small, 11px);
  color: var(--text-muted);
  transition: transform 0.2s;
}

.side-fold[aria-expanded='false'] .side-fold-mark {
  transform: rotate(-90deg);
}

.side-fold:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 1px;
}

.side-group[data-folded] > li:not(.side-group-title) {
  display: none;
}

/* The active page: a blue bar on the left and bold navy words. */
.side-link[aria-current='page'] {
  background: #e8f0fb;
  border-color: transparent;
  color: var(--navy-900);
  font-weight: 700;
}

.side-link[aria-current='page']::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--brand-secondary);
}

html[data-theme='dark'] .side-fold {
  background: linear-gradient(90deg, var(--surface-card), transparent);
  color: var(--text-strong);
}

html[data-theme='dark'] .side-link[aria-current='page'] {
  background: var(--surface-card);
  color: var(--text-link);
}

/* Folded into the rail, the headings are not drawn and every item shows (a rail has no headings to open). */
html[data-side='collapsed'] .side-group[data-folded] > li:not(.side-group-title) {
  display: list-item;
}

html[data-side='collapsed'] .side-link[aria-current='page']::before {
  left: -6px;
}

/* --- The header on a phone (release 6.8.2, the owner's review of the candidate: "eye-friendly portals") ------------
   At 600 px and below the top bar of both portals fits the screen (375 px included): the icons and the menu button
   keep their place at the right and never leave the screen; the logo side gives way (narrower margins, the area's
   words on two lines and cut with "…" if still too long). Nothing is hidden that was shown before. */
@media (max-width: 600px) {
  body[data-shell] .app-topbar {
    gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
  }

  body[data-shell] .app-topbar > .logo {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  body[data-shell] .app-topbar .logo-mark {
    flex: none;
    width: 46px;
    height: auto;
  }

  body[data-shell] .app-topbar .app-area-name {
    min-width: 0;
    overflow: hidden;
    padding-left: 10px;
    line-height: 1.15;
    white-space: normal;
    text-overflow: ellipsis;
  }

  body[data-shell] .app-topbar > .nav-cta {
    flex: none;
    gap: 2px;
  }

  body[data-shell] .nav-cta :is(.icon-btn, .notify-bell) {
    width: 32px;
    height: 32px;
  }

  body[data-shell] .nav-cta .menu-toggle {
    flex: none;
    padding: 6px;
  }
}

/* The company footer on a phone (the coordinator's check at about 437 px): at 600 px and below its line wraps onto
   two lines instead of scrolling sideways; the room kept for it under the page grows with it. */
@media (max-width: 600px) {
  body[data-shell]:has(> .portal-footer) {
    --portal-footer-h: 46px;
  }

  body[data-shell] > .portal-footer {
    flex-wrap: wrap;
    align-content: center;
    gap: 4px 14px;
    padding: 4px 12px;
    overflow-x: visible;
    white-space: normal;
  }
}

/* The banner's sub-line (both portals): on the navy band it always takes the band's light words (--band-fg-muted, at
   least 9:1 on the band's lightest point in the day view, WCAG AA 4.5:1 needs less), also where a page's own rule gave
   it a muted grey meant for a light ground (the Documents intro, guide.css). */
:is(.pg-band, .app-head, .p7-banner) :is(.pg-band-sub, .app-lead, [data-documents-intro]) {
  color: var(--band-fg-muted);
}

/* 6.8.3a, section 1f (point 55): a link in the banner's sub-line (the company request page's breadcrumb "Requests")
   took the page's link blue, 3.6:1 on the navy band; it takes the band's light words, as the back arrow (`.fr-back`)
   does, underlined so it reads as a link. */
:is(.pg-band, .app-head, .p7-banner) .pg-band-sub a:not(.btn) {
  color: var(--band-fg-muted);
  text-decoration: underline;
}

:is(.pg-band, .app-head, .p7-banner) .pg-band-sub a:not(.btn):focus-visible {
  outline: 3px solid var(--brand-highlight);
  outline-offset: 2px;
}

/* 6.8.3a, section 1f (point 56, WCAG 1.4.1): a link inside a sentence is told apart by more than its colour: it is
   underlined (the status line's "It happens on Processing.", links in body text, the footer's e-mail address). Links
   that stand alone (buttons, tabs, menus, table references, the back arrow) keep their look. 6.8.3b, R8: the banner's
   "AI usage" fact reads as live (a5e6bad), in its neighbours' words, underlined on hover and focus (pattern.css). */
.app-main
  :is(p, li, dd)
  a:not(.btn, .fr-back, [role='tab'], [role='button'], [role='menuitem'], [data-banner-ai-usage]),
footer a[href^='mailto:'] {
  text-decoration: underline;
}

/* The ruled fact rows on a narrow phone (the coordinator's 320 px sweep): at 420 px and below the label no longer
   takes a column of its own (it left the value about 29 px, one word per line); it stands on top as a small label and
   the value takes the full width under it. Both portals; fact-rows.ts draws these rows on many pages. */
@media (max-width: 420px) {
  .fact-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .fact-row > dt {
    font-size: var(--fs-hint, 12px);
  }
}

/* --- The left column folds like the main menu (the owner: "close and open by arrow same as the main tree") ------- */
/* `filter-fold.ts` puts the main menu's round arrow at the top of every `.fr-filters` column. Folded, the column is a
   narrow strip with the arrow (and how many filters are set), and the box beside it takes the width; its controls are
   only not drawn, so every filter keeps its value. On a narrow screen the folded column is one short row. */
.fr-fold-toggle {
  position: sticky;
  top: 0;
  z-index: 2;
  display: inline-flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  align-self: flex-end;
  gap: 3px;
  min-width: 24px;
  min-height: 24px;
  margin: -4px -4px 0 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-card);
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  line-height: 22px;
  cursor: pointer;
}

.fr-fold-toggle:hover {
  color: var(--text-strong);
}

.fr-fold-toggle:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

.fr-fold-arrow {
  display: block;
  width: 22px;
  text-align: center;
  transition: transform 0.15s;
}

.fr-fold-count {
  display: block;
  min-width: 18px;
  margin: 0 2px 3px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.fr-fold-count[hidden] {
  display: none;
}

.fr-filters[data-folded] {
  align-items: center;
  width: 40px;
  padding: 8px 4px;
}

.fr-filters[data-folded] > :not(.fr-fold-toggle) {
  display: none !important;
}

.fr-filters[data-folded] > .fr-fold-toggle {
  align-self: center;
  margin: 0;
}

.fr-filters[data-folded] .fr-fold-arrow {
  transform: rotate(180deg);
}

/* System and Oversight lay the column out in a grid track of their own: folded, the track is as narrow as the strip. */
@media screen and (min-width: 881px) {
  .sys-body > .sys-panel:not([hidden]):has(> .fr-filters[data-folded]),
  .ov-body > .ov-panel:not([hidden]):has(> .fr-filters[data-folded]) {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

@media (max-width: 880px) {
  .fr-fold-arrow {
    transform: rotate(90deg);
  }

  .fr-filters[data-folded] {
    flex-direction: row;
    justify-content: flex-start;
    width: auto;
  }

  .fr-filters[data-folded] .fr-fold-arrow {
    transform: rotate(-90deg);
  }

  .fr-filters[data-folded] > .fr-fold-toggle {
    flex-direction: row;
  }
}

/* --- The stage bars on a phone (both portals: the request's stages, the sample's trial steps) ----------------------
   Below 600 px the steps' labels ran into each other. There the segment bar stays, the labels give way (still read by
   a screen reader, with the current step's aria-current), and one line right after the bar's list says "Step 2 of 8 ·
   <step>" and the next step in grey (`stageSummary` / `buildStageSummary`, stage-progress.ts). Wider screens keep the
   labels; the line is not shown. */
.p7-progress-summary {
  display: none;
}

@media (max-width: 600px) {
  .p7-progress > li {
    min-height: 6px;
    padding-top: 0;
  }

  .p7-progress li[data-state] .p7-progress-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  .p7-progress + .p7-progress-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    min-width: 0;
    margin: 8px 0 0;
    font-size: var(--fs-text, 13px);
    color: var(--band-fg);
  }

  .p7-progress-summary-step {
    color: var(--band-fg-muted);
  }

  .p7-progress-summary-name {
    min-width: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
  }

  .p7-progress-summary-next {
    flex-basis: 100%;
    color: var(--band-fg-muted);
    font-size: var(--fs-hint, 12px);
  }

  /* The sample's trial steps stand on a light card. */
  .p7-progress.rq-trial-steps + .p7-progress-summary {
    margin: -4px 0 12px;
    color: var(--text-strong);
  }

  .p7-progress.rq-trial-steps
    + .p7-progress-summary
    :is(.p7-progress-summary-step, .p7-progress-summary-next) {
    color: var(--text-muted);
  }
}

/* --- The type scale of both portals (release 6.8.2, rule 1; the owner on a 1920 px screen: larger text) ------------
   One set of sizes for every signed-in page; the shared stylesheets read them with today's size as the fallback, so
   the public site (no token) keeps its sizes. Top menu 15 px; normal text, labels, table cells and buttons 15 px; grey
   help lines 13.5 px; small capitals, counts and badges 12.5 px; box titles 17 px; the band's page title 30 px. The
   header bar, the stage bar's step words and fixed-size round controls keep their sizes (they must fit their room). */
body[data-shell] {
  --fs-text: 15px;
  --fs-hint: 13.5px;
  --fs-small: 12.5px;
  --fs-nav: 15px;
  --fs-title: 17px;
  --fs-band-title: 30px;
  /* A record's title (request, company, gate) is long ("CAT-2026-000002 · IHM CAT internal · for MV Test Vessel"):
     26 px keeps it, its ⓘ and its pills on one line at 1280 px (measured: they end at 1201 of 1256). */
  --fs-detail-title: 26px;
  /* The administrator's left menu is a little wider, so its 15 px names stay on one line ("Workflow connections");
     folded, it is the narrow rail as before (its own rule sets the width on the frame). */
  --side-w: 236px;
  font-size: var(--fs-text);
}

/* Box titles: the head of a frame box and the titles of cards. */
body[data-shell] :is(.fr-box-head > :is(b, strong, h2, h3), .p7-card-title, .card-title) {
  font-size: var(--fs-title);
}

/* --- A block that scrolls inside itself shows it (release 6.8.2, rule 1) -------------------------------------------
   The frame's left column and its scrolling box, in both portals (scroll-cues.ts):
   - a thin scroll bar where the system draws one;
   - while more is hidden under the lower edge (`data-more-below`), that edge is shaded and a small "More below ↓"
     button stands at its right; the button scrolls a screen further; both are gone at the end;
   - while a wide table goes on past the right edge (`data-more-right`), that edge fades out.
   Neither the shade nor the fade takes a click. */
.app-main :is(.fr-filters, .fr-scroll) {
  scrollbar-width: thin;
}

.app-main :is(.fr-filters, .fr-scroll)[data-more-below]::after {
  content: '';
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: block;
  flex: none;
  height: 24px;
  margin-top: -24px;
  background: linear-gradient(transparent, rgba(12, 44, 85, 0.16));
  pointer-events: none;
}

/* 6.8.3a, section 1f (point 47) and section 1h (point 77: the drawn shade left a hard grey edge over the box's last
   line, a white strip under it): the request page's scrolling tab, Files box and history list fade their last line out
   while more is below (the content fades, nothing is drawn over it); "More below ↓" stands under the box. */
.app-main
  :is(.rq-page .pg-work > .ws-panel, .rq-box-scroll, [data-history-scroll])[data-more-below] {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
}

/* The left column has its own padding: the shade reaches its edges. */
.app-main .fr-filters[data-more-below]::after {
  margin: -24px -10px -10px;
}

/* The button sits on the lower edge, at the right, and adds nothing to the block's height. It stays pinned at the box's
   right edge also while a wide table is scrolled sideways (its width, `--fr-btn-w`, is measured by scroll-cues.ts);
   beside a fading right edge it keeps a gap wider than the fade (`--fr-btn-gap`, below). */
.fr-more-below {
  position: sticky;
  bottom: 8px;
  left: calc(100% - var(--fr-btn-w, 140px) - var(--fr-btn-gap, 8px));
  z-index: 4;
  display: block;
  flex: none;
  width: max-content;
  height: 28px;
  margin: -28px var(--fr-btn-gap, 8px) 0 auto;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-card);
  box-shadow: 0 1px 4px rgba(12, 44, 85, 0.18);
  color: var(--text-link);
  font: inherit;
  font-size: var(--fs-small, 12.5px);
  font-weight: 600;
  line-height: 26px;
  cursor: pointer;
}

.fr-more-below[hidden] {
  display: none;
}

/* 6.8.3a, section 1g (points 66, 67): outside its box the button stands on its own line under the box's right end; it
   lies over nothing, and each scrolling box has its own. */
.fr-more-below.fr-more-below-out {
  position: static;
  flex: none;
  align-self: flex-end;
  height: 26px;
  margin: 4px 8px 0 auto;
  line-height: 24px;
}

.fr-more-below:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

/* A wide table: the right edge fades out while it goes on past it (the content fades, nothing is laid over it). The
   fade is 36 px wide and ends where the box's own scroll bars begin (`--fr-sb-v` at the right, `--fr-sb-h` at the
   foot, measured by scroll-cues.ts; 0 where the system lays its bars over the content): the bars stay whole and
   usable. The "More below" button keeps 48 px from that edge, clear of the fade. */
.app-main .fr-scroll[data-more-right] {
  --fr-fade: 36px;
  --fr-fade-end: calc(100% - var(--fr-sb-v, 0px));
  --fr-btn-gap: 48px;
  -webkit-mask-image:
    linear-gradient(
      to right,
      #000 calc(var(--fr-fade-end) - var(--fr-fade)),
      transparent var(--fr-fade-end),
      #000 var(--fr-fade-end)
    ),
    linear-gradient(to top, #000 var(--fr-sb-h, 0px), transparent var(--fr-sb-h, 0px));
  -webkit-mask-composite: source-over;
  mask-image:
    linear-gradient(
      to right,
      #000 calc(var(--fr-fade-end) - var(--fr-fade)),
      transparent var(--fr-fade-end),
      #000 var(--fr-fade-end)
    ),
    linear-gradient(to top, #000 var(--fr-sb-h, 0px), transparent var(--fr-sb-h, 0px));
  mask-composite: add;
}

/* 6.8.3a, section 1f (points 36 and 46: at 375 px the result table, the input table, API access, Website content and
   other wide tables went on past their box's right edge with nothing to say so): a table's own scroll box fades at its
   right edge too, the same mask (scroll-cues.ts marks these boxes as well). */
.app-main :is(.tc-scroll, .table-scroll, .rq-parts-scroll, .rq-input-scroll)[data-more-right] {
  --fr-fade: 36px;
  --fr-fade-end: calc(100% - var(--fr-sb-v, 0px));
  -webkit-mask-image:
    linear-gradient(
      to right,
      #000 calc(var(--fr-fade-end) - var(--fr-fade)),
      transparent var(--fr-fade-end),
      #000 var(--fr-fade-end)
    ),
    linear-gradient(to top, #000 var(--fr-sb-h, 0px), transparent var(--fr-sb-h, 0px));
  -webkit-mask-composite: source-over;
  mask-image:
    linear-gradient(
      to right,
      #000 calc(var(--fr-fade-end) - var(--fr-fade)),
      transparent var(--fr-fade-end),
      #000 var(--fr-fade-end)
    ),
    linear-gradient(to top, #000 var(--fr-sb-h, 0px), transparent var(--fr-sb-h, 0px));
  mask-composite: add;
}

@media (prefers-reduced-motion: reduce) {
  .app-main :is(.fr-filters, .fr-scroll) {
    scroll-behavior: auto;
  }
}

/* 6.8.3a, section 1f (point 48: Oversight's Activity and Retention filters at 1920 px, the "More below" pill stood over
   the OUTCOME heading and its chips in the narrow left column): in the left column the cue is a small round "↓" at
   its right edge (its name "Show more below" stays), so it covers no heading; the shade still marks the edge. */
.fr-filters > .fr-more-below {
  --fr-btn-w: 28px;
  width: 28px;
  padding: 0;
  overflow: hidden;
  font-size: 0;
  line-height: 26px;
  text-align: center;
}

.fr-filters > .fr-more-below::before {
  content: '↓';
  font-size: var(--fs-text, 14px);
}

/* 6.8.3a, section 1g (point 71): the fold's word (the column's name, "Filters") shows on the folded strip on a narrow
   screen, where the strip is a row; on a wide screen the strip is narrow and keeps the arrow alone. */
.fr-fold-word {
  display: none;
}

@media (max-width: 880px) {
  .fr-filters[data-folded] > .fr-fold-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    padding-right: 10px;
  }

  .fr-filters[data-folded] .fr-fold-word {
    display: inline;
    color: var(--text-body);
    font-weight: 600;
  }
}

/* 6.8.3a, section 1g (point 63): "More columns →" under a wide table's box, at its right, while columns lie past the
   right edge (scroll-cues.ts); the "More below" line's look. */
.fr-more-right {
  display: block;
  width: max-content;
  height: 26px;
  margin: 4px 8px 0 auto;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-card);
  color: var(--text-link);
  font: inherit;
  font-size: var(--fs-small, 12.5px);
  font-weight: 600;
  line-height: 24px;
  cursor: pointer;
}

.fr-more-right[hidden] {
  display: none;
}

.fr-more-right:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

/* 6.8.3a, section 1i (point 84): a box in full screen lies inside its tab; while it is full screen no fade of the tab,
   of a box or of a table box above it may clip or fade it (a mask on an ancestor applies to a fixed box too). */
body[data-full-screen='true']
  .app-main
  :is(.rq-page .pg-work > .ws-panel, .rq-box-scroll, [data-history-scroll], .fr-scroll):has(
    .fr-full
  ) {
  -webkit-mask-image: none;
  mask-image: none;
}

/* 6.8.3a, section 1i (point 82: the Result in full screen at 1280 px, its pager and "More below" line under the window's
   edge): in full screen the blocks that hold a table's scroll area stand as columns that may shrink, so the table's
   area takes the room left and its pager and lines stay in the window. Section 1j (point 86): from 600 px only; on a
   phone the shrinking left the table about two rows, so there the box scrolls as a whole, as before. */
@media (min-width: 600px) {
  .fr-full :is(div, section):has(.tc-scroll) {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  .fr-full :is(div, section):has(.tc-scroll) > :not(.tc-scroll, :has(.tc-scroll)) {
    flex: none;
  }

  .fr-full .tc-scroll {
    min-height: 8rem;
  }

  /* Close-out 37 (the owner, 22 Nov 2026: "Can we expand it?"): a result table shown full screen grows to the bottom of the
     window, its pager still in view. result-items-view.ts caps the table at 60vh with an inline style, which beat the
     full-screen box's own "no cap"; in full screen only, the cap gives way and the column above sets the height. The
     normal view keeps its 60vh. Only the administrator's result tables carry the cap; the company's Results table has none
     and already fills its full-screen box. */
  .fr-full .tc-scroll[data-result-scroll] {
    max-height: none !important;
  }
}

/* 6.8.3a, section 1j (point 87): in a full-screen box "More below ↓" stands in the title bar, beside "Close full
   screen", while the box goes on below the window (scroll-cues.ts); it lies over no row. */
.fr-full-bar > .fr-more-below.fr-more-below-bar {
  position: static;
  flex: none;
  height: 28px;
  margin: 0 0 0 auto;
  line-height: 26px;
}

.fr-full-bar:has(> .fr-more-below-bar:not([hidden])) > .fr-full-close {
  margin-left: 8px;
}

/* On a phone, while "More below ↓" shows in the bar, the title takes its own line and the two buttons stand under it
   at the right, so the title is not squeezed to a few letters. */
@media (max-width: 599px) {
  .fr-full-bar:has(> .fr-more-below-bar:not([hidden])) {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .fr-full-bar:has(> .fr-more-below-bar:not([hidden])) > .fr-full-title {
    flex: 1 1 100%;
  }
}

/* 6.8.3b, R1: the ▸ before a block's name is gone (collapse.css), so the gate page's part titles, laid over their
   summary line (admin-w3-pages.css, 6.8.3a), stand at the heading's own left room, no longer 23 px further in, where
   they ran into the summary's words. */
[data-gate-part] > .gate-part-title {
  left: 15px;
}

/* Moved from company-pages.css (6.8.3b, P1): these rules name the workspace class `.ws-panel`, and frame.css is the
   one sheet after workspace.css that may (workspace-primitives.integration.spec.ts). Unchanged: no rule between the
   two places sets these properties on these elements at the same weight, so the cascade is the same. */
/* 6.8.3a, faults 5 and 13 (the owner: the result table did not show, an empty card under the filters; "only a block
   inside the window could be scrollable"): a box's own scroll area never shrinks to nothing on a short window. It keeps
   room for several rows; when the window is shorter than that, the open tab scrolls under the fixed head and footer, so
   nothing is out of reach. */
.cp-request > [data-panel]:not([hidden]),
.cp-request .ws-panel.cp-fill:not([hidden]) {
  overflow-y: auto;
}

.cp-request .ws-panel :is(.tc-scroll, .fr-scroll) {
  flex: 1 1 0;
  height: 0;
  min-height: 14rem;
}

/* Every box around such an area grows with it (its border never ends above its content). */
.cp-request .ws-panel.cp-fill :has(.tc-scroll, .fr-scroll) {
  min-height: auto;
}

/* Mod 19 P8, lane D (look.css), moved here by candidate F10 (the coordinator's ruling, 21 Nov 2026): frame.css is the
   only sheet after workspace.css that names a workspace class, and this rule names the side panel. Unchanged; its
   weight decides it against every other rule on these tables, so its new place changes nothing on the page.
   C5-C11, 56, 60, 61, 64-67: a wide table under 1024 px keeps a readable minimum width and scrolls sideways in its own
   box (the box already scrolls both ways), instead of squeezing a column to one word a line.
   Round 2 (R1 D1): the rule is scoped. It applies only to a table of five or more columns, and never to a table in a
   dialog, a side panel or drawer, a list shown as cards on a phone (lane A's Companies and registrations panels,
   C67) or one that opts out with `data-table-cards`. A two- or three-column table keeps its own width. */
@media (max-width: 1023px) {
  body
    :is(.fr-scroll, .table-scroll, [data-list-scroll])
    > table:has(tr > :nth-child(5)):not(
      :is(
          dialog,
          [role='dialog'],
          .ws-side-panel,
          [data-drawer],
          [data-panel='directory'],
          [data-panel='awaiting'],
          [data-table-cards]
        )
        table
    ) {
    min-width: max(100%, 880px);
  }

  body
    :is(.fr-scroll, .table-scroll, [data-list-scroll])
    > table:has(tr > :nth-child(5)):not(
      :is(
          dialog,
          [role='dialog'],
          .ws-side-panel,
          [data-drawer],
          [data-panel='directory'],
          [data-panel='awaiting'],
          [data-table-cards]
        )
        table
    )
    :is(th, td) {
    min-width: 6.5em;
  }
}
