/* Hallmark · checked: 2026-11-26 · genre: modern-minimal (inferred) · shape: app screen · scope: ProjectDetail (.page.proj)
 * screen: a jobs navigator beside the selected job's brief; the brief leads · signature: the brief, tasks opening in place to their summary
 * fixed: 48, 67 (app-wide) and 44d on .proj, the Reports delete confirm (DESIGN.md rule 22), loading states, Reports as a table
 * dismissed 56 · the sticky .lhead and .tb th stick inside their own scrolling card, never against the page's top bar
 * dismissed 34 · 100vw only caps the width of the top-bar popup, which is positioned and never widens the page
 * built: the project · redesign: full · v2.0.0 */
/* ==========================================================================
   ALDUS: the application stylesheet (Bridge design)
   Consolidated from docs/design/app/app.css: each override resolved into one
   rule, mockup-only rules (tweaks panel, scheme page, sample-data hooks) left out.
   Spec: docs/design/DESIGN.md (rules 1 to 18). Plan: docs/ALDUS-MIGRATION-PLAN.md.

   Colours, type and radius come from /brand/tokens (--color-*, --font-*, --radius*).
   This file adds only a few derived tokens (--ad-*).

   SCOPING DURING THE MIGRATION
   site.css still styles every page and shares class names with this file
   (.btn, .card, .chip and others). So component styles apply only inside an
   element with class "aldus": a ported page wraps its markup in
   <div class="aldus ...">, and the side menu carries the class too. Unported
   pages are untouched. When site.css is deleted, drop the .aldus wrapper
   (un-nest the block below) and move the components into @layer.
   No cascade layers yet: a layered rule would lose to unlayered site.css.

   Sections
   1. Derived tokens
   2. Shell: side menu, page header, account menu (global; unique class names)
   3. Scoped components (.aldus): base, layout, cards, buttons, forms, tabs,
      status and badges, tables, expanding list, progress, dialog, menu,
      utilities
   ========================================================================== */

/* ---------- 1. Derived tokens ---------- */
:root {
  --ad-tint: color-mix(in srgb, var(--color-ink) 6%, transparent);
  --ad-tint-2: color-mix(in srgb, var(--color-ink) 11%, transparent);
  --ad-row-hover: color-mix(in srgb, var(--color-ink) 3.5%, transparent);
  --ad-line-soft: color-mix(in srgb, var(--color-rule) 60%, transparent);
  --ad-btn-line: color-mix(in srgb, var(--color-ink) 20%, transparent);
  --ad-field-line: color-mix(in srgb, var(--color-ink) 28%, transparent);
  --ad-hl: color-mix(in srgb, var(--color-status-warning) 34%, transparent);   /* a search match (rule 55) */
  --ad-hl-now: var(--color-status-warning);                                   /* the current match */
  --ad-hi: var(--color-surface);       /* "running" pill and current-step fill */
  --ad-row-y: 11px;                    /* table and list row padding */
  --ad-ctl-y: 8px;                     /* control padding */
  --ad-side-w: 232px;
  --ad-side-min: 64px;
  --ad-side: var(--ad-side-w);
}
:root[data-theme="dark"] { --ad-hi: var(--color-ground); }

@keyframes ad-spin { to { transform: rotate(360deg); } }
@keyframes ad-pulse { 50% { opacity: .25; } }

/* ---------- 2. Shell: side menu (rule 16) ---------- */
/* Static left menu on the darkest theme colour, never a mid tone (rule 8). Lockup at the top, then
   the main and admin links with icons on the left; the account menu is pinned to the bottom and opens
   upward. No collapse toggle: at 1024px and narrower it shows icons only, with the label as a tooltip.
   Markup: <div class="shell"><aside class="side aldus">...</aside><main class="shell-main">. */
.shell { padding-left: var(--ad-side); min-height: 100vh; }
.shell-main { min-width: 0; }
/* MainLayout gives <main> the legacy site.css .main class (padding) for unported pages.
   A ported page (<div class="aldus page">) sets its own padding, so drop the legacy box. */
.shell-main:has(> .aldus:is(.page, .pages)) { padding: 0; margin: 0; }
.side {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--ad-side);
  display: flex; flex-direction: column;
  background: var(--color-menu); color: var(--color-on-menu);
  border-right: 1px solid color-mix(in srgb, var(--color-on-menu) 12%, var(--color-menu));
}
/* dark theme: menu and page are both near black, so the edge needs a visible hairline */
:root[data-theme="dark"] .side { border-right-color: color-mix(in srgb, var(--color-on-menu) 20%, var(--color-menu)); }
.side :focus-visible { outline: 2px solid var(--color-on-menu); outline-offset: -2px; }
.side-h { display: flex; align-items: center; height: 60px; padding: 0 20px; flex: none; }
.side.aldus .side-h .lockup { color: var(--color-on-menu); }
.side.aldus .mark .link { stroke: var(--color-on-menu); }
.side.aldus .mark .node { fill: var(--color-on-menu); }
.side.aldus .mark .loose { fill: var(--color-menu-accent); }
.side-nav { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; overflow-y: auto; }
.side-g {
  padding: 18px 12px 6px; font-size: .72rem; font-weight: 500; white-space: nowrap;
  color: color-mix(in srgb, var(--color-on-menu) 48%, transparent);
}
.side-a {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 36px;
  padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: none;
  font: 500 .93rem/1.5 var(--font-sans); white-space: nowrap; text-align: left; cursor: pointer;
  color: color-mix(in srgb, var(--color-on-menu) 70%, transparent);
}
.side-a:hover { text-decoration: none; color: var(--color-on-menu); background: color-mix(in srgb, var(--color-on-menu) 8%, transparent); }
.side-a.active, .side-a[aria-current] { color: var(--color-on-menu); background: color-mix(in srgb, var(--color-on-menu) 14%, transparent); }
.side-a[aria-disabled="true"] { color: color-mix(in srgb, var(--color-on-menu) 42%, transparent); cursor: default; }
.side-a[aria-disabled="true"]:hover { background: none; }
.side-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* line icons: 24 x 24, stroked (the Icon component) */
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- page header (rule 47) ---------- */
/* A sticky bar over the content area that blends into the page: no fill or rule at the top of the
   page; once the window scrolls, js/top-bar.js adds .is-stuck (translucent ground, blur, hairline),
   as the landing page nav does. Right side: Recent, Favorites, a divider, the account menu.
   Markup: Layout/TopBar.razor (header.top.aldus), rendered between the side menu and <main>. */
:root {
  --ad-top-h: 52px;
  /* shadows (ink at fixed alphas): tooltip, dialog, dropdown */
  --ad-shadow-tip: 0 8px 20px -10px rgb(0 0 0 / .5);
  --ad-shadow-dlg: 0 30px 60px -20px rgb(0 0 0 / .55);
  --ad-shadow-pop: 0 14px 30px -14px rgb(0 0 0 / .35);
}
.top {
  position: sticky; top: 0; z-index: 35; height: var(--ad-top-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px 0 24px;
  background: transparent; border-bottom: 1px solid transparent;
  transition: background-color .25s, border-color .25s, backdrop-filter .25s;
}
.top.is-stuck {
  background: color-mix(in srgb, var(--color-ground) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--color-rule);
}
.top-l { min-width: 0; flex: 1; }
.top-r { display: flex; align-items: center; gap: 4px; flex: none; }
.top-div { width: 1px; height: 20px; margin: 0 8px; background: var(--color-rule); }
/* quiet icon + label buttons (rule 25: light, never filled) */
.top .top-b {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border-radius: var(--radius);
  font: 500 .87rem var(--font-sans); color: var(--color-text-muted); cursor: pointer; list-style: none;
}
.top .top-b:hover, .top .menu[open] > .top-b { color: var(--color-text); background: var(--ad-tint); }
.top .top-b .ic { width: 17px; height: 17px; }
.top .menu:not(.acct) > .top-b::after { margin-left: 2px; opacity: .6; }
.top :focus-visible { outline: 2px solid var(--color-ink); outline-offset: 1px; }
/* Recent and Favorites popups: a small heading, then the items (placeholder empty state for now) */
.top .top-pop { width: 19rem; }
.top-ph { padding: 6px 10px 4px; font-size: .8rem; font-weight: 600; color: var(--color-text-muted); }
.top-empty { display: grid; justify-items: center; gap: 4px; padding: 16px 14px 18px; text-align: center; }
.top-empty .ic { width: 22px; height: 22px; margin-bottom: 4px; color: var(--color-text-muted); }
.top-empty b { font-weight: 600; font-size: .9rem; }
.top-empty small { font-size: .8rem; line-height: 1.4; color: var(--color-text-muted); }

/* account menu: initials avatar at the far right of the header, opens downward */
.acct { position: relative; }
.acct > summary {
  display: flex; align-items: center; gap: 4px; padding: 3px 6px 3px 3px; border-radius: 999px;
  cursor: pointer; list-style: none; color: var(--color-text-muted);
}
.acct > summary::-webkit-details-marker { display: none; }
.acct > summary:hover, .acct[open] > summary { background: var(--ad-tint); color: var(--color-text); }
.av {
  width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--color-ink); color: var(--color-on-ink); font: 500 .72rem var(--font-mono); font-style: normal;
}
.acct .ic.chev { width: 14px; height: 14px; }
.top .acct-pop { min-width: 15rem; }
.acct-id { padding: 8px 10px 10px; display: grid; line-height: 1.3; }
.acct-id b { font-weight: 600; }
.acct-id small { font-size: .8rem; color: var(--color-text-muted); }
.acct-pop form { display: grid; margin: 0; }
.acct-pop .menu-i { display: flex; align-items: center; gap: 10px; width: 100%; font: inherit; color: var(--color-text); }
.acct-pop .menu-i:hover { text-decoration: none; }
.acct-pop .menu-i .ic { width: 16px; height: 16px; color: var(--color-text-muted); }

/* the page under the header: the header takes the top gap (a .page.fill subtracts --ad-top-h, section 3) */
.top ~ .shell-main :is(.aldus.page, .aldus.pages > .page:first-child) { padding-top: 6px; }
.top ~ .shell-main.main { margin-top: 0; }   /* legacy pages: the header replaces site.css's top margin */
/* narrow: icons only; the Recent and Favorites popups pin to the header's right edge so they stay
   clear of the side menu */
@media (max-width: 760px) {
  .top-t { display: none; }
  .top { padding: 0 12px 0 16px; }
  .top-r { position: relative; }
  /* .top-r in the selectors outranks the scoped .aldus .menu / .menu-pop.end rules in section 3 */
  .top .top-r .top-m { position: static; }
  .top .top-r .menu-pop.top-pop { right: 0; left: auto; width: min(19rem, calc(100vw - var(--ad-side) - 24px)); }
}

/* narrow screens: icons only, label as a tooltip on hover or focus */
@media (max-width: 1024px) {
  :root { --ad-side: var(--ad-side-min); }
  .side-h { padding: 0; justify-content: center; }
  .side-t { display: none; }
  .side-g { height: 1px; padding: 0; margin: 14px 10px 9px; background: color-mix(in srgb, var(--color-on-menu) 14%, transparent); }
  .side-a { justify-content: center; padding: 0; }
  .side-nav { overflow: visible; }   /* a scroll box would clip the tooltips beside the links */
  .side-a[data-tip]:is(:hover, :focus-visible)::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; translate: 0 -50%; z-index: 50;
    padding: 5px 9px; border-radius: var(--radius-sm); background: var(--color-ink); color: var(--color-on-ink);
    font-size: .8rem; white-space: nowrap; pointer-events: none; box-shadow: var(--ad-shadow-tip);
  }
}

/* ---------- 3. Scoped components ---------- */
.aldus {
  font: 400 1rem/1.5 var(--font-sans);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;

  /* base element rules live outside this block, at zero specificity (see below) */

  /* lockup and mark (inline SVG with .link, .node, .loose) */
  & .lockup { display: flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: var(--tracking-wordmark); font-size: 1.05rem; }
  & .lockup:hover { text-decoration: none; }
  & .mark { width: 26px; height: 26px; flex: none; }
  & .mark .link { stroke: var(--color-ink); fill: none; stroke-width: 38; stroke-linecap: round; stroke-linejoin: round; }
  & .mark .node { fill: var(--color-ink); }
  & .mark .loose { fill: var(--color-accent); }

  /* layout */
  /* the main content never has a max-width: it always grows to fill the window (DESIGN.md rule 19) */
  &.page, & .page { padding: 22px 24px 80px; display: grid; gap: var(--space); }
  & .head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
  & .head p { color: var(--color-text-muted); font-size: .87rem; margin-top: 4px; }
  & .head .grow > .row { margin-bottom: 6px; }
  /* the badge row under the date line */
  & .head .grow > .row.meta { margin: 10px 0 0; }
  /* job title with its rename and move icons (rule 65, Shared/JobHeader.razor): muted, after the title, level with its
     first line when it wraps (the 28px buttons match the h1 line height) */
  & .head .ttl { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
  & .head .ttl-a { display: flex; gap: 2px; flex: none; margin-top: 1px; }
  /* inline name editor (rule 65, Shared/TitleEditor.razor): the field, then Save and Cancel; an error line under it */
  & .tedit { display: grid; gap: 4px; min-width: 0; }
  & .tedit-r { display: flex; align-items: center; gap: 4px; min-width: 0; }
  & .tedit .inp { flex: 1 1 auto; min-width: 0; padding-block: 3px; font-weight: 500; }
  & .tedit.is-h1 .inp { font-size: 1.75rem; font-weight: 600; letter-spacing: var(--tracking-heading); line-height: 1.15; padding: 2px 8px; }
  & .tedit .btn.ico { flex: none; }
  & .tedit-e { font-size: .8rem; color: var(--color-accent); }
  /* level chips (rule 50, Shared/LevelPath.razor): small forward-leaning chips above the h1, one per level down to
     this page's (Project, Job, Task), kinds only. One light fill for all; levels above are grey links, this level is
     bold ink. The first chip has a square left side: an upright block covers its slanted left edge. */
  & .lvl { display: flex; gap: 4px; padding-left: 5px; margin-bottom: 10px; font-size: .74rem; line-height: 1.2; }
  & .lvl > * { position: relative; isolation: isolate; display: inline-flex; align-items: center; padding: 4px 12px; color: var(--color-text-muted); text-decoration: none; }
  & .lvl > *::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--color-surface); border: 1px solid var(--color-rule); border-radius: var(--radius-sm); transform: skewX(-20deg); }
  & .lvl > :first-child::after { content: ""; position: absolute; top: 0; bottom: 0; left: -5px; right: 50%; z-index: -1; background: var(--color-surface); border: 1px solid var(--color-rule); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
  & .lvl > a:hover { color: var(--color-text); text-decoration: none; }
  & .lvl > a:hover::before, & .lvl > a:first-child:hover::after { background: color-mix(in srgb, var(--color-ink) 6%, var(--color-surface)); }
  & .lvl > [aria-current] { color: var(--color-text); font-weight: 600; }
  /* parent lines (rule 50, Shared/ParentLines.razor): the project (and job) a detail pane's item belongs to, above its title */
  & .parents { display: grid; gap: 2px; margin: 0 0 6px; font-size: .82rem; min-width: 0; }
  & .parents > div { display: flex; gap: 6px; min-width: 0; }
  & .parents dt { flex: none; color: var(--color-text-muted); font-weight: 400; }
  & .parents dd { margin: 0; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; color: var(--color-text); }
  & .parents a { color: inherit; text-decoration: none; }
  & .parents a:hover { text-decoration: underline; }
  /* columns: cards stretch to the row height and their bottoms align (rule 7) */
  & .cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space); align-items: stretch; }
  & .cols.wide-rail { grid-template-columns: minmax(0, 1fr) 390px; }
  & .cols.form-rail { grid-template-columns: minmax(0, 1fr) clamp(320px, 30%, 420px); }   /* a table beside a details form (Knowledge Registry) */
  & .cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  & .cols.duo { grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); }   /* 70/30 list and sidebar */
  & .cols.duo.jd { grid-template-columns: minmax(0, 13fr) minmax(0, 7fr); }   /* Job Details: 65/35, a wider progress column (rule 52) */
  & .cols.sixty { grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); }   /* 60/40 list and details panel (job Tasks tab) */
  & .cols.one { grid-template-columns: minmax(0, 1fr); }
  & .cols.lead { grid-template-columns: minmax(0, 3fr) minmax(0, 7fr); }  /* 30/70 with the sidebar first, on the left (Sources) */                 /* one full-width card that fills the page */
  & .cols.nav { grid-template-columns: minmax(300px, 2fr) minmax(0, 3fr); }   /* a contents list beside a document (40/60 as the Tasks tab, Findings, rule 54) */
  & .rail { min-width: 0; }
  & .cols > :is(.rail, .stack) { display: flex; flex-direction: column; gap: var(--space); }
  & .cols > :is(.rail, .stack) > .card:last-child { flex: 1; }
  /* 70/30 page that fills the viewport: the list scrolls, the sidebar stays in view */
  /* (the wrapper may itself be the .page.fill, or contain it) */
  &.page.fill, & .page.fill { height: calc(100vh - var(--ad-top-h)); display: flex; flex-direction: column; padding-bottom: 24px; }
  &.page.fill > *, & .page.fill > * { flex: none; }
  &.page.fill > .cols, & .page.fill > .cols { flex: 1 0 24rem; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  &.page.fill .card.scroll, & .page.fill .card.scroll { contain: none; min-height: 0; }
  &.page.fill .rail, & .page.fill .rail { min-height: 0; }
  &.page.fill .rail > .card, & .page.fill .rail > .card { min-height: 0; overflow: auto; }
  /* a sidebar card's body (.card-b.pane) scrolls under its fixed header (rule 18); sidebars hold no action buttons */
  & .rail > .card > .card-b.pane { flex: 1 1 auto; min-height: 0; overflow: auto; align-content: start; }
  /* a full-height page followed by more content further down (.aldus.pages > .page.fill + .page):
     the first screen fills the viewport, the page scrolls to reach the rest */
  & .page + .page { padding-top: 0; }
  & .prose { display: grid; gap: 10px; }
  & .prose p { color: color-mix(in srgb, var(--color-text) 85%, transparent); }

  /* cards */
  & .card { display: flex; flex-direction: column; background: var(--color-surface); border: 1px solid var(--color-rule); border-radius: var(--radius-lg); min-width: 0; box-shadow: none; overflow: visible; }   /* site.css clips cards; menus must escape */
  & .card-h { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--color-rule); }
  & .card-b { padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space); }   /* the column never grows past the card (long one-line rows) */
  & .row > .sub { margin-bottom: 0; }
  & .card-b .row:has(> .sub) { margin-bottom: 8px; }
  & .card-f {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: auto;
    padding: 11px 16px; border-top: 1px solid var(--color-rule); font-size: .82rem; color: var(--color-text-muted);
  }
  & .toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--color-rule); }
  /* a list filtered to a source from Source Details (rule 51, Shared/SourceFilterChip.razor): a quiet chip, x to clear */
  & .fchip { display: inline-flex; align-items: center; gap: 6px; max-width: 40ch; min-width: 0; padding: 4px 4px 4px 10px; border: 1px solid var(--color-ink); border-radius: var(--radius-sm); background: var(--color-surface); font-size: .82rem; font-weight: 500; }
  & .fchip > .ic { width: 14px; height: 14px; flex: none; }
  & .fchip-t { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
  & .fchip a { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: var(--radius-sm); color: var(--color-text-muted); }
  & .fchip a:hover { background: var(--ad-tint); color: var(--color-text); text-decoration: none; }
  & .fchip a .ic { width: 14px; height: 14px; }
  & .toolbar > .inp.auto { flex: 0 1 13rem; min-width: 7rem; }   /* the search box gives way before the title or controls */
  & .toolbar > .inp.search { flex: 0 1 22rem; min-width: 10rem; }   /* a fixed-width search box, not one that fills the toolbar */
  & .toolbar > .end { margin-left: auto; }   /* pushes the toolbar's main action to the right edge */
  /* a long list scrolls inside its card and takes its height from the neighbouring column */
  & .card.scroll { contain: size; min-height: 26rem; }
  /* the list shrinks to its rows (no empty bordered box under a short list) and scrolls when long */
  & .card.scroll > :is(.tblw, .list, .doc, .toc, .pane) { flex: 0 1 auto; min-height: 0; overflow: auto; }
  /* .pane: a plain scroll region under a card's toolbar, for tab content that mixes blocks (task detail) */
  & .card.scroll .tb th { position: sticky; top: 0; z-index: 1; }

  /* buttons: light; red only for destructive (rule 1) */
  & .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    font: 500 .9rem/1.2 var(--font-sans); padding: var(--ad-ctl-y) 14px; border-radius: var(--radius);
    border: 1px solid var(--ad-btn-line); background: var(--color-surface); color: var(--color-text);
    cursor: pointer; white-space: nowrap; text-transform: none; box-shadow: none;
    height: auto; width: auto; transition: background-color .14s ease;   /* reset site.css .btn */
  }
  & .btn:hover { text-decoration: none; background: var(--color-raised); }
  & .btn.pri { background: var(--color-rule); color: var(--color-text); font-weight: 600; border-color: color-mix(in srgb, var(--color-ink) 30%, transparent); }
  & .btn.pri:hover { background: color-mix(in srgb, var(--color-ink) 10%, var(--color-rule)); }
  /* a dialog's submit button is green (rule 29); destructive ones stay red (.btn.dan) */
  & .dlg footer .btn.pri { background: var(--color-status-ok); border-color: var(--color-status-ok); color: var(--color-on-ink); }
  & .dlg footer .btn.pri:hover { background: color-mix(in srgb, var(--color-ink) 14%, var(--color-status-ok)); }
  & .dlg footer .btn.pri:disabled, & .dlg footer .btn.pri:disabled:hover { background: var(--color-surface); color: color-mix(in srgb, var(--color-text) 38%, transparent); border-color: color-mix(in srgb, var(--ad-btn-line) 60%, transparent); }
  & .btn:is(.sec, .out) { background: var(--color-surface); border-color: var(--ad-btn-line); }
  & .btn:is(.gho, .ico) { background: transparent; border-color: transparent; }
  & .btn:is(.gho, .ico):hover { background: var(--ad-tint-2); }
  & .btn.pos { background: color-mix(in srgb, var(--color-status-ok) 15%, var(--color-surface)); color: color-mix(in srgb, var(--color-status-ok) 78%, var(--color-text)); border-color: color-mix(in srgb, var(--color-status-ok) 45%, transparent); }
  & .btn.pos:hover { background: color-mix(in srgb, var(--color-status-ok) 24%, var(--color-surface)); }
  & .btn.dan { background: color-mix(in srgb, var(--color-accent) 8%, var(--color-surface)); color: var(--color-accent); border-color: color-mix(in srgb, var(--color-accent) 45%, transparent); }
  & .btn.dan:hover { background: color-mix(in srgb, var(--color-accent) 16%, var(--color-surface)); }
  /* a disabled button stays light (white, its border kept) with faded text, never a grey fill (rule 25) */
  & .btn:disabled, & .btn:disabled:hover { background: var(--color-surface); color: color-mix(in srgb, var(--color-text) 38%, transparent); border-color: color-mix(in srgb, var(--ad-btn-line) 60%, transparent); cursor: not-allowed; }
  & .btn[aria-pressed=true] { border-color: var(--color-ink); box-shadow: inset 0 0 0 1px var(--color-ink); }   /* toggle on, e.g. Like */
  & .btn.sm { padding: calc(var(--ad-ctl-y) - 3px) 10px; font-size: .8rem; border-radius: var(--radius-sm); }
  & .btn.ico { padding: 0; width: 28px; height: 28px; border-radius: var(--radius-sm); color: var(--color-text-muted); }
  & .btn.ico:hover { color: var(--color-text); }
  & .btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

  /* form controls */
  & .fld { display: grid; gap: 5px; min-width: 0; align-content: start; }
  & .fld > label, & .fld > span:first-child { font-size: .82rem; font-weight: 500; }
  & .inp {
    width: 100%; font: 400 .93rem/1.35 var(--font-sans); padding: var(--ad-ctl-y) 11px; border-radius: var(--radius);
    border: 1px solid var(--ad-field-line); background: var(--color-surface); color: var(--color-text);
  }
  & .inp::placeholder { color: color-mix(in srgb, var(--color-text-muted) 75%, transparent); }
  & .inp:focus { outline: 0; border-color: var(--color-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-ink) 16%, transparent); }
  & .inp.err { border-color: var(--color-accent); }
  & select.inp {
    appearance: none; padding-right: 30px;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
  }
  & textarea.inp { min-height: 84px; resize: vertical; }
  & textarea.inp.tall { min-height: 140px; }   /* a goal or instructions box */
  /* a markdown editor that fills a .card.scroll under its header (the report page's Edit tab) */
  & .rte > textarea.inp.md {
    flex: 1 1 auto; min-height: 0; resize: none; border: 0; border-radius: 0; box-shadow: none; padding: 20px 28px;
    font: 400 .86rem/1.6 var(--font-mono);
  }
  & .rte > textarea.inp.md:focus { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--color-ink) 16%, transparent); }
  /* the report's visual editor (rule 71; ClientApp/editor, TipTap): a toolbar over the document, which scrolls.
     report-editor.js sets aria-pressed, disabled and the table group's hidden; TipTap's own CSS is off (injectCSS). */
  & .card.scroll > .rte { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  & .card-h.edh { flex-wrap: wrap; row-gap: 8px; }   /* the Visual / Markdown switch, Discard and Save: wrap on a phone */
  & .card-h.edh .seg { flex: none; }
  & .rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 12px; border-bottom: 1px solid var(--color-rule); }
  & .rte-bar .btn.ico[aria-pressed=true] { background: var(--ad-tint-2); color: var(--color-text); }
  & .rte-bar .btn.ico.tx { width: auto; min-width: 28px; padding: 0 6px; font-size: .8rem; font-weight: 600; }
  & .rte-sep { width: 1px; height: 18px; margin: 0 6px; background: var(--color-rule); }
  & .rte-grp { display: inline-flex; align-items: center; gap: 2px; }
  & .rte-grp[hidden] { display: none; }
  & .rte-grp .btn.ico.tx { font-weight: 500; }
  & .rte-body { flex: 1 1 auto; min-height: 0; overflow: auto; cursor: text; }
  & .rte-doc { min-height: 100%; outline: 0; white-space: pre-wrap; overflow-wrap: break-word; font-variant-ligatures: none; }
  & .rte-doc a { color: var(--color-text); text-decoration: underline; text-underline-offset: 3px; }
  & .rte-doc code { font: .88em var(--font-mono); padding: 1px 4px; border-radius: var(--radius-sm); background: var(--ad-tint-2); }
  & .rte-doc pre { padding: 10px 14px; border-radius: var(--radius); background: var(--ad-row-hover); overflow-x: auto; }
  & .rte-doc pre code { padding: 0; background: none; }
  & .rte-doc :is(td, th) { vertical-align: top; position: relative; }
  & .rte-doc :is(td, th) > p { margin: 0; }
  & .rte-doc .selectedCell { background: var(--ad-tint-2); }
  & .rte-doc hr.ProseMirror-selectednode { outline: 2px solid var(--color-ink); }
  & .rte-doc .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; }
  & .rte-doc .ProseMirror-gapcursor::after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid var(--color-text); }
  & .rte-doc.ProseMirror-focused .ProseMirror-gapcursor { display: block; }
  & .inp.auto { width: auto; }
  & .hint { font-size: .78rem; color: var(--color-text-muted); }
  & .hint.err { color: var(--color-accent); }
  & .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  & .chk { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
  & input[type=checkbox] {
    appearance: none; margin: 0; width: 16px; height: 16px; flex: none; border-radius: 3px;
    border: 1.5px solid var(--color-ink); background: transparent; display: inline-grid; place-items: center; cursor: pointer; vertical-align: middle;
  }
  & input[type=checkbox]:checked { background: var(--color-ink); }
  & input[type=checkbox]:checked::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--color-on-ink); }
  & input[type=checkbox]:disabled { opacity: .4; cursor: not-allowed; }
  & input[type=checkbox].tog { width: 34px; height: 20px; border-radius: 99px; border: 0; background: var(--color-rule); justify-items: start; padding: 3px; }
  & input[type=checkbox].tog::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--color-ground); transition: translate .15s; }
  & input[type=checkbox].tog:checked { background: var(--color-ink); }
  & input[type=checkbox].tog:checked::after { translate: 14px 0; background: var(--color-on-ink); }
  /* segmented control: ink when active (rule 11) */
  & .seg { display: inline-flex; border: 1px solid var(--color-ink); border-radius: var(--radius); overflow: hidden; font-size: .84rem; font-weight: 500; }
  & .seg button { border: 0; background: none; padding: calc(var(--ad-ctl-y) - 1px) 12px; cursor: pointer; }
  & .seg button[aria-pressed=true] { background: var(--color-ink); color: var(--color-on-ink); }
  /* option cards (radio groups) */
  & .radios { --row-h: 2.4rem; margin: 0; padding: 0; border: 1px solid var(--ad-field-line); border-radius: var(--radius); background: var(--color-surface); }
  & .radios label { display: flex; align-items: center; gap: 8px; height: var(--row-h); padding: 0 6px 0 10px; border-bottom: 1px solid var(--ad-line-soft); }
  & .radios label:last-child { border-bottom: 0; }
  /* New Research Job (rule 28, revised 2026-11-28): depth, then the sources, each one row read left to right.
     Depth: the radios side by side, each with its task range under the name; the model select sits at its right. */
  & .setup-r { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: end; }
  & .setup-r.with-model { grid-template-columns: minmax(0, 1fr) minmax(12rem, 16rem); }
  & .radios.across { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  & .radios.across label { height: auto; min-height: 3rem; padding: 8px 12px; border-bottom: 0; border-right: 1px solid var(--ad-line-soft); }
  & .radios.across label:last-child { border-right: 0; }
  & .radios.across .rl { display: grid; gap: 1px; min-width: 0; line-height: 1.25; }
  /* Sources: a checkbox each, with a drag handle (drag along the row, or the arrow keys on a focused handle) */
  & .order.across { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
  & .order.across li {
    display: inline-flex; align-items: center; gap: 4px; padding: 0 12px 0 4px; height: 2.4rem;
    border: 1px solid var(--ad-field-line); border-radius: var(--radius); background: var(--color-surface);
    transition: border-color .12s, background-color .12s, opacity .12s;
  }
  & .order.across li.off { padding-left: 12px; color: var(--color-text-muted); }
  & .order.across li.off .chk { color: var(--color-text-muted); cursor: not-allowed; }
  /* the dragged source's place: an empty dashed slot the others make room for */
  & .order.across li.dragging { border-style: dashed; border-color: color-mix(in srgb, var(--color-ink) 45%, transparent); background: var(--ad-tint); }
  & .order.across li.dragging > * { visibility: hidden; }
  & .order.across .grip {
    display: grid; place-items: center; width: 22px; height: 28px; padding: 0; border: 0; border-radius: var(--radius-sm);
    background: none; color: var(--color-text-muted); cursor: grab;
  }
  & .order.across .grip:hover { color: var(--color-text); background: var(--ad-tint); }
  & .order.across .grip:active { cursor: grabbing; background: var(--ad-tint-2); }
  & .order.across .grip:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 0; }
  & .order.across .grip .ic { width: 16px; height: 16px; }
  & .order.across .grip .ic circle { fill: currentColor; stroke: none; }
  @media (max-width: 640px) {
    & .radios.across { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    & .radios.across label:nth-child(2) { border-right: 0; }
    & .radios.across label:nth-child(-n + 2) { border-bottom: 1px solid var(--ad-line-soft); }
    & .setup-r.with-model { grid-template-columns: minmax(0, 1fr); }
  }
  /* the chosen sources in search order, as numbered badges across the dialog */
  & .seq { list-style: none; margin: -4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
  & .seq .tag { display: inline-flex; align-items: center; gap: 6px; }
  & .seq .tag b { font-weight: 600; opacity: .7; }
  & .radios label { cursor: pointer; font-size: .9rem; padding-right: 12px; }
  & .radios label:has(:checked) { background: var(--ad-tint); font-weight: 500; }
  & .radios small { color: var(--color-text-muted); font-size: .78rem; }
  & .radios.picks { max-height: 15rem; overflow: auto; }   /* a long checklist in a dialog (Generate Report task picker) */
  & .radios.filt { max-height: 16rem; overflow: auto; }   /* a checkbox filter with counts (job Sources summary) */
  & .radios.filt label { height: auto; min-height: 34px; font-size: .85rem; }
  /* filter groups beside a filtered table (rule 39): each a collapsible <details> with the checked count */
  & .filt-g { border: 1px solid var(--color-rule); border-radius: var(--radius); background: var(--color-surface); }
  & .filt-g > summary { display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 12px; cursor: pointer; list-style: none; font-size: .86rem; font-weight: 600; }
  & .filt-g > summary::-webkit-details-marker { display: none; }
  & .filt-g > summary:hover { background: var(--ad-tint-2); border-radius: var(--radius); }
  & .filt-g > summary .chev { width: 15px; height: 15px; color: var(--color-text-muted); transition: transform .15s ease; }
  & .filt-g:not([open]) > summary .chev { transform: rotate(-90deg); }
  & .filt-g > summary small { font-weight: 400; color: var(--color-text-muted); }
  & .filt-g[open] > summary { border-bottom: 1px solid var(--ad-line-soft); border-radius: var(--radius) var(--radius) 0 0; }
  & .filt-g .radios.filt { border: 0; border-radius: 0; background: transparent; }
  & .filt-g .filt-x { display: flex; justify-content: flex-end; padding: 4px 6px; border-top: 1px solid var(--ad-line-soft); }
  & .filt-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--color-ink); color: var(--color-on-ink); font: 500 .7rem/1 var(--font-mono); }

  /* Source Details dialog (.sd) */
  & .sd header { padding: 16px 20px; }
  & .sd-hh { display: flex; align-items: center; gap: 12px; min-width: 0; }
  & .sd-hh small { display: block; margin-top: 2px; font-size: .82rem; color: var(--color-text-muted); }
  & .sd-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius); }
  & .sd-ic .ic { width: 19px; height: 19px; }
  & .sd-ic.web { background: color-mix(in srgb, var(--color-source-web) 14%, transparent); color: var(--color-source-web); }
  & .sd-ic.kb { background: color-mix(in srgb, var(--color-source-kb) 14%, transparent); color: var(--color-source-kb); }
  & .sd .bd { gap: 20px; padding: 20px; }
  & .sd-hero { display: grid; gap: 10px; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--color-surface); border: 1px solid var(--color-rule); }   /* white, like the tiles above it */
  & .sd-tags { display: flex; flex-wrap: wrap; gap: 6px; }
  & .sd-tags .tag { padding: 4px 7px; }
  & .sd-hero h3 { font-size: 1.22rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
  /* the URL as plain text with a copy button (no external link) */
  & .sd-url { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: .84rem; color: var(--color-text-muted); }
  & .sd-url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  & .sd-url .btn { flex: none; }
  /* count tiles: one colour each, an icon chip, a large number */
  /* fields: label over value, in a grid */
  & .sd-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; margin: 4px 0 0; padding: 12px 0 0; border-top: 1px solid var(--ad-line-soft); }   /* the source's fields, inside its card */
  & .sd-fields > div { min-width: 0; }
  & .sd-fields dt { font-size: .74rem; color: var(--color-text-muted); margin-bottom: 3px; }
  & .sd-fields dd { margin: 0; font-size: .9rem; font-weight: 500; overflow-wrap: anywhere; }
  /* sections: a titled card each */
  & .sd-sec { border: 1px solid var(--color-rule); border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface); }   /* white, like the source card */
  & .sd-sec-h { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--color-rule); }
  & .sd-sec-h h4 { font-size: .92rem; font-weight: 600; }
  /* Excerpts (rule 57): one block per cited passage, a label line (task, section, page), then the passage as a small
     document clamped to about seven lines with a fade, until Show more */
  & .sd-ex { list-style: none; margin: 0; padding: 0; }
  & .sd-ex > li { padding: 14px; border-top: 1px solid var(--ad-line-soft); }
  & .sd-ex > li:first-child { border-top: 0; }
  & .sd-ex-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 8px; font-size: .8rem; color: var(--color-text-muted); min-width: 0; }
  & .sd-ex-h a { color: var(--color-text); font-weight: 500; text-decoration: none; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  & .sd-ex-h a:hover { text-decoration: underline; }
  & .sd-ex-h > span:not(.mono) { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  & .sd-ex-h .mono { font-size: .74rem; }
  & .sd-ex-b.doc { padding: 10px 14px; border-left: 3px solid var(--color-rule); background: var(--ad-row-hover); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .86rem; line-height: 1.55; overflow-wrap: anywhere; }
  & .sd-ex-b.clamp {   /* only a long excerpt (Show more), until opened */
    max-height: 10.5em; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, var(--color-ink) 70%, transparent); mask-image: linear-gradient(to bottom, var(--color-ink) 70%, transparent); }
  & .sd-ex-b.doc :is(h1, h2, h3, h4) { font-size: .9rem; margin: 10px 0 4px; }
  & .sd-ex-b.doc > :first-child { margin-top: 0; }
  & .sd-ex-b.doc > :last-child { margin-bottom: 0; }
  & .sd-ex-b.doc p { margin: 0 0 8px; }
  & .sd-ex-b.doc table { display: block; max-width: 100%; overflow-x: auto; font-size: .8rem; }
  & .sd-ex-more { margin-top: 6px; }
  & .sd-ex-ph { display: grid; gap: 9px; padding: 14px; }
  & .sd-ex-none { margin: 0; padding: 12px 14px; }
  & .sd-n { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 99px; background: var(--color-surface); border: 1px solid var(--color-rule); font: 500 .72rem/1 var(--font-mono); color: var(--color-text-muted); }
  & .skel { display: block; height: 12px; border-radius: 99px; background: var(--ad-tint); animation: ad-skel 1.4s ease-in-out infinite; }
  & .skel.short { width: 55%; }
  /* skeleton rows and page skeletons (rule 66, Shared/Skeleton.razor, Shared/PageSkeleton.razor): the shape of what is
     coming, in grey pulsing bars, never a spinner or a loading line */
  &.skw { display: block; }
  & .skl { display: grid; }
  & .skl-r { display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem; gap: 14px; align-items: center; padding: 15px 16px; border-bottom: 1px solid var(--ad-line-soft); }
  & .skl-r:last-child { border-bottom: 0; }
  & .skl.lines { gap: 12px; padding: 18px 16px; }
  & .skl.lines .skl-r { grid-template-columns: minmax(0, 1fr); padding: 0; border: 0; }
  & .skl .skel.w0 { width: 72%; }
  & .skl .skel.w1 { width: 88%; }
  & .skl .skel.w2 { width: 54%; }
  & .pskel .skel { margin-bottom: 10px; }
  & .pskel .skel.chips { width: 120px; height: 20px; border-radius: var(--radius-sm); }
  & .pskel .skel.ttl { width: min(36rem, 70%); height: 30px; border-radius: var(--radius); }
  & .pskel .skel.sub { width: 9rem; margin-bottom: 0; }
  & .pskel-tabs { display: flex; gap: 10px; }
  & .pskel-tabs .skel { width: 84px; height: 30px; border-radius: var(--radius); }
  & .card-h .skel.hd { width: 7rem; height: 14px; }
  & .sd-sec > .snap { padding: 14px; }   /* Found In tiles */
  & .sd-sec > .hint { padding: 0 14px 12px; }
  @media (max-width: 640px) {
    & .sd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    & .sd-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  & .fld > .row > span:first-child { font-size: .82rem; font-weight: 500; }   /* a field label sharing its row with a small button */
  & .opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  & .opts label { display: grid; gap: 1px; text-align: center; padding: 9px 6px; border: 1px solid var(--ad-field-line); border-radius: var(--radius); cursor: pointer; font-size: .86rem; font-weight: 500; }
  & .opts label small { font-weight: 400; color: var(--color-text-muted); font-size: .76rem; }
  & .opts input { position: absolute; opacity: 0; pointer-events: none; }
  & .opts label:has(:checked) { border-color: var(--color-ink); box-shadow: inset 0 0 0 1px var(--color-ink); background: var(--ad-tint); }
  & .opts label:has(:focus-visible) { outline: 2px solid var(--color-ink); outline-offset: 2px; }

  /* tabs: ink when active (rule 11) */
  & .tabs { display: flex; gap: 4px; flex-wrap: wrap; }
  /* links for page tabs, buttons (role="tab", aria-selected) for in-page views */
  & .tabs :is(a, button) { padding: calc(var(--ad-ctl-y) - 1px) 13px; border: 0; border-radius: var(--radius); background: none; cursor: pointer; font-size: .9rem; font-weight: 500; color: var(--color-text-muted); }
  & .tabs :is(a, button):hover { background: var(--ad-tint); text-decoration: none; color: var(--color-text); }
  & .tabs :is(a, button):is([aria-current], [aria-selected=true], .active) { background: var(--color-ink); color: var(--color-on-ink); }
  & .tabs :is(a, button) span { font: 400 .76rem var(--font-mono); opacity: .7; margin-left: 5px; }
  & .tabs a[aria-disabled=true], & .tabs a[aria-disabled=true]:hover { color: color-mix(in srgb, var(--color-text) 38%, transparent); background: none; cursor: default; }   /* no page yet */

  /* status pills: running is ink, never red (rules 2, 11) */
  & .st {
    display: inline-flex; align-items: center; gap: 6px; font: 400 .8rem/1 var(--font-sans);
    padding: 5px 9px; border-radius: 99px; white-space: nowrap; color: var(--color-text);
    background: color-mix(in srgb, var(--color-status-queued) 13%, transparent);
  }
  & .st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--color-status-queued); }
  & .st.run { background: var(--ad-hi); box-shadow: inset 0 0 0 1px var(--color-rule); }
  & .st.run::before { background: var(--color-status-running); animation: ad-pulse 1.6s ease-in-out infinite; }
  & .st.ok { background: color-mix(in srgb, var(--color-status-ok) 16%, transparent); }
  & .st.ok::before { background: var(--color-status-ok); }
  & .st.warn { background: color-mix(in srgb, var(--color-status-warning) 16%, transparent); }
  & .st.warn::before { background: var(--color-status-warning); }
  & .st.bad { background: color-mix(in srgb, var(--color-status-failed) 13%, transparent); }
  & .st.bad::before { background: var(--color-status-failed); }
  /* status icons in list rows: icon only, in the status colour (rule 9) */
  & .si { justify-self: center; display: grid; }
  & .si svg { width: 17px; height: 17px; display: block; }
  & .si.ok { color: var(--color-status-ok); }
  & .si.run { color: var(--color-status-running); }
  & .si.q { color: var(--color-status-queued); }
  & .si.warn { color: var(--color-status-warning); }
  & .si.bad { color: var(--color-status-failed); }
  & .si .spin { transform-origin: 8px 8px; animation: ad-spin 1.1s linear infinite; }

  /* badges by source type: web blue, knowledge base purple, anything else grey (rule 11) */
  & :is(.ty, .tag) { display: inline-block; font: 500 .8rem/1 var(--font-sans); border: 0; border-radius: var(--radius-sm); white-space: nowrap; background: color-mix(in srgb, var(--color-source-other) 13%, transparent); color: var(--color-source-other); }
  & .tag { padding: 4px 7px; }
  & .tb td .tag { white-space: normal; line-height: 1.25; }   /* a long type wraps inside its tag rather than widening the table */
  & .ty { flex: none; width: 2.9rem; text-align: center; padding: 4px 0; }
  & :is(.ty, .tag).web { background: color-mix(in srgb, var(--color-source-web) 14%, transparent); color: var(--color-source-web); }
  & :is(.ty, .tag).kb { background: color-mix(in srgb, var(--color-source-kb) 14%, transparent); color: var(--color-source-kb); }
  & .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--color-source-kb); }
  & .dot.web { background: var(--color-source-web); }
  & .dot.other { background: var(--color-source-other); }

  /* tables: rows tint on hover; a selected row has the ink left edge and the same tint (rule 41) */
  & .tblw { overflow-x: auto; }
  & .card > .tblw { margin: 16px; border: 1px solid var(--color-rule); border-radius: var(--radius); }   /* inset from the card edges */
  & table.tb { border-collapse: collapse; width: 100%; font-size: .9rem; }
  & .tb th {
    font: 500 .82rem/1 var(--font-sans); color: var(--color-text-muted); text-align: left;
    padding: 10px 12px; background: var(--color-surface); border-bottom: 1px solid var(--color-rule); white-space: nowrap;
  }
  & .tb th[aria-sort] { color: var(--color-text); }
  & .tb th[aria-sort=ascending]::after { content: " \2191"; }
  & .tb th[aria-sort=descending]::after { content: " \2193"; }
  & .tb td { padding: var(--ad-row-y) 12px; border-bottom: 1px solid var(--ad-line-soft); vertical-align: top; }   /* row cells align top (rule 31) */
  & .tb > tbody > tr:last-child > td { border-bottom: 0; }
  & .tb tr.sel > td:first-child { box-shadow: inset 3px 0 0 var(--color-ink); }
  & .tb .num { font-family: var(--font-mono); font-size: .82rem; text-align: right; white-space: nowrap; }
  & .tb th.num { font: 500 .82rem/1 var(--font-sans); }   /* a number column's header keeps the header face and size, not the mono figures */
  & .tb td.date { font-family: var(--font-sans); font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--color-text-muted); }   /* dates are Geist, never mono (rule 73) */
  & .tb .fit { width: 1%; white-space: nowrap; }
  & .tb .title { font-weight: 500; width: 44%; min-width: 12rem; }   /* a name never squeezes to a word per line */
  & .tb td small { display: block; color: var(--color-text-muted); font-size: .8rem; }
  /* a column that takes all the spare width and truncates to one line per text (Sources, rule 56): max-width 0 lets
     the cell shrink below its content, width 100% gives it everything the .fit columns leave */
  & .tb .clip { width: 100%; max-width: 0; }
  & .tb td.clip > :is(span, small) { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  & .tb td.clip > span { font-weight: 500; }
  & .tb .cut { display: inline-block; max-width: 14rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; vertical-align: top; }
  & .tb [data-select] { cursor: pointer; }

  /* row hover and selection (rule 41): every table and list row tints on hover; a selected row keeps the
     ink left edge and the same light tint. Header rows (.lhead, th) never tint. */
  & :is(.tb > tbody > tr, .item, .jrow, .prow, .arow):not(.lhead):hover { background: var(--ad-row-hover); }
  & :is(.tb tr.sel, .item[aria-selected=true], .jrow[aria-selected=true]):not(.lhead) { background: var(--ad-row-hover); }

  /* expand button: checkbox first, expand second, then the title (rule 15) */
  & .exp {
    width: 22px; height: 22px; flex: none; border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, var(--color-ink) 30%, transparent);
    background: var(--color-surface); cursor: pointer; display: grid; place-items: center; padding: 0; margin: 0; font: 400 .95rem/1 var(--font-mono);
  }
  & .exp::before { content: "+"; }
  & .exp[aria-expanded=true] { background: var(--color-ink); color: var(--color-on-ink); border-color: var(--color-ink); }
  & .exp[aria-expanded=true]::before { content: "\2212"; }

  /* lists and the expanding job list: title and status only (rule 9) */
  & .list { list-style: none; margin: 16px; padding: 0; border: 1px solid var(--color-rule); border-radius: var(--radius); overflow: hidden; }
  & .list.flush { margin: 0; }
  & .item { display: flex; align-items: flex-start; gap: 12px; padding: var(--ad-row-y) 14px; border-bottom: 1px solid var(--ad-line-soft); }
  & .item:last-child { border-bottom: 0; }
  & .item[aria-selected=true] { box-shadow: inset 3px 0 0 var(--color-ink); }
  & .item .t { font-weight: 500; display: block; }
  & .item[aria-selected=true] .t { font-weight: 600; }
  & .item .m { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; font-size: .8rem; color: var(--color-text-muted); }
  & :is(.tree, .tree ul) { list-style: none; padding: 0; }
  & .tree ul { margin: 0; }
  & .jrow {
    display: grid; grid-template-columns: 16px 22px minmax(0, 1fr) 3.5rem;   /* checkbox, expand, title, status */
    gap: 14px; align-items: start; padding: var(--ad-row-y) 14px; border-bottom: 1px solid var(--ad-line-soft); cursor: pointer;
  }
  & .jrow[aria-selected=true] { box-shadow: inset 3px 0 0 var(--color-ink); }
  & .tree.mcol .jrow { grid-template-columns: 22px minmax(0, 1fr) 3.5rem 28px; }   /* expand, title, status, row menu; no checkbox (rule 22) */
  & .tree.mcol.bulk .jrow { grid-template-columns: 16px 22px minmax(0, 1fr) 3.5rem 28px; }   /* checkbox for a bulk action first (rule 14) */
  & .jrow.jt { grid-template-columns: 16px 2.9rem minmax(0, 1fr) 7.5rem 4rem 28px; }   /* job Tasks tab: checkbox, type, task, completed, status, row menu */
  & .jrow .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
  & .jrow:not(.lhead) .num { font-size: .85rem; color: var(--color-text-muted); }
  & .jrow .t { font-weight: 500; display: inline; }
  & .jrow[aria-selected=true] .t { font-weight: 600; }
  /* project list row: the project, right-aligned number columns, then the row menu last (rule 22) */
  & .prow {
    display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem 7.5rem 28px;
    gap: 14px; align-items: start; padding: var(--ad-row-y) 14px; border-bottom: 1px solid var(--ad-line-soft);
  }
  & .prow:last-child { border-bottom: 0; }
  & .prow .t { font-weight: 500; display: block; }
  /* a title link is only as wide as its text, so a click in the empty part of the row does not open it
     (rule 24); the description below stays its own line */
  & :is(.item, .prow) a.t { width: fit-content; max-width: 100%; }
  & .prow .m { margin-top: 5px; font-size: .8rem; color: var(--color-text-muted); }
  & .prow .acts { display: flex; gap: 4px; }
  & .prow .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
  & .prow:not(.lhead) .num { font-size: .85rem; color: var(--color-text-muted); }
  /* all-jobs list row: job with its project below, created, status, then the row menu last (rule 22) */
  & .arow {
    display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem 5rem 28px;
    gap: 14px; align-items: start; padding: var(--ad-row-y) 14px; border-bottom: 1px solid var(--ad-line-soft);
  }
  & .arow:last-child { border-bottom: 0; }
  & .arow .t { font-weight: 500; display: block; width: fit-content; max-width: 100%; }
  & .arow .pj { display: block; margin-top: 5px; font-weight: 400; color: var(--color-text-muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: fit-content; max-width: 100%; }
  /* all-tasks list row: the KB/Web badge first, then as .arow (task title only; job and project are in its row menu) */
  & .arow.tk { grid-template-columns: 2.9rem minmax(0, 1fr) 7.5rem 5rem 28px; }
  /* all-reports list row: report with its job and project below, task count, created, row menu */
  & .arow.rp { grid-template-columns: minmax(0, 1fr) 4rem 7.5rem 28px; }
  /* sortable header cells of any list (.lhead): the button fills the cell, aria-sort draws the arrow (as .tb th) */
  & .lhead .sortb { white-space: nowrap; }
  & .lhead .si .sortb { text-align: center; }
  & .lhead [aria-sort=ascending] > .sortb::after { content: " \2191"; }
  & .lhead [aria-sort=descending] > .sortb::after { content: " \2193"; }
  & .lhead [aria-sort] > .sortb { color: var(--color-text); }
  & .arow .acts { display: flex; gap: 4px; }
  & .arow .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
  & .arow:not(.lhead) .num { font-size: .85rem; color: var(--color-text-muted); }
  & .lhead { position: sticky; top: 0; z-index: 1; background: var(--color-surface); cursor: default; border-bottom-color: var(--color-rule); font: 500 .82rem/1 var(--font-sans); color: var(--color-text-muted); }
  & .trow { padding-block: 0; }
  & .trow > * { padding-block: calc(var(--ad-row-y) - 2px); }
  & .trow .t { font-weight: 400; }
  & .tt { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
  & .peek-h { display: grid; gap: 8px; padding: 16px; border-bottom: 1px solid var(--color-rule); }
  & .peek-h > .sub { margin-bottom: 0; }
  & .pane-hd { display: grid; gap: 8px; }   /* title with its badges under it, at the top of a sidebar body */
  & .pane-t { font-size: 1.1rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
  & .peek-h h2 { font-size: 1.2rem; letter-spacing: -.02em; line-height: 1.25; }
  & .item .d { margin-top: 5px; font-size: .85rem; color: var(--color-text-muted); }
  /* a list row that expands to a detail block under it (registry entities and locations) */
  & .xrow { border-bottom: 1px solid var(--ad-line-soft); }
  & .xrow:last-child { border-bottom: 0; }
  & .xrow > .item { border-bottom: 0; align-items: flex-start; }
  & .xrow-d { display: grid; gap: 14px; padding: 2px 14px 16px 48px; }
  & .mention { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--color-rule); border-radius: var(--radius); }
  & .conn { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
  & .conn li { display: grid; gap: 3px; }
  & .conn .row { gap: 8px; }
  & .conn p { font-size: .85rem; color: var(--color-text-muted); }
  & .tags { display: flex; flex-wrap: wrap; gap: 6px; }   /* a run of tags (aliases) */
  & .qs { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: .87rem; }
  /* a row-sized checkbox choice inside a list (dialogs) */
  & .item.pick { cursor: pointer; }
  & .item.pick .m { margin-top: 2px; }
  /* a button that reads as a link */
  & .lnk { border: 0; background: none; padding: 0; font-weight: 500; text-align: left; cursor: pointer; }
  & .lnk:hover { text-decoration: underline; text-underline-offset: 3px; }
  /* contents list (Findings) and a long rendered document */
  /* Findings Contents (rule 54): numbered task entries, their section headings under them; the entry being read
     (js/doc-contents.js: li.on, button[aria-current]) has the ink left edge and a light tint, as a selected row */
  & .toc { list-style: none; margin: 0; padding: 6px 0 12px; display: grid; align-content: start; }
  & .toc > li { border-bottom: 1px solid var(--ad-line-soft); box-shadow: inset 3px 0 0 transparent; transition: box-shadow .15s, background .15s; }
  & .toc > li:last-child { border-bottom: 0; }
  & .toc > li.on { box-shadow: inset 3px 0 0 var(--color-ink); }   /* the ink edge only, no tint (rule 55) */
  & .toc :is(.toc-t, .toc-s) { display: grid; width: 100%; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; font: inherit; }
  & .toc-r { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; padding: 0 0 0 8px; }
  & .toc-r .xp { margin-top: 7px; }
  & .toc-r .xp .ic { width: 16px; height: 16px; transition: transform .15s ease-out; }
  & .toc-r .xp[aria-expanded=true] .ic { transform: rotate(180deg); }
  & .toc .toc-t { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 11px 16px 9px 4px; font-size: .9rem; font-weight: 500; line-height: 1.35; }
  & .toc-t:hover .toc-l { text-decoration: underline; text-underline-offset: 3px; }
  & .toc-t .ty { margin-top: 1px; }
  & .toc.flat .toc-t { padding-left: 16px; }   /* a flat Contents, no caret column (the task page's Findings, rule 63) */
  /* sections as a tree under the task number: a guide line with an elbow into each title, rounded at the last */
  & .toc-tree { list-style: none; margin: -2px 0 0; padding: 0 16px 12px calc(8px + 14px); display: grid; }   /* the guide line drops from under the caret */
  & .toc-tree > li { position: relative; padding-left: 18px; }
  & .toc-tree > li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1px solid var(--ad-btn-line); }
  & .toc-tree > li::after { content: ""; position: absolute; left: 0; top: 14px; width: 12px; border-top: 1px solid var(--ad-btn-line); }
  & .toc-tree > li:last-child::before { bottom: auto; height: 14px; width: 12px; border-bottom: 1px solid var(--ad-btn-line); border-bottom-left-radius: 6px; }
  & .toc-tree > li:last-child::after { display: none; }
  & .toc .toc-s { padding: 5px 0; font-size: .84rem; line-height: 1.35; color: var(--color-text-muted); }
  & .toc .toc-s:hover { color: var(--color-text); }
  & .toc .toc-s[aria-current] { color: var(--color-text); font-weight: 500; }
  & .doc { padding: 20px 28px 32px; font-size: .95rem; line-height: 1.6; }
  & .doc :is(h1, h2, h3, h4) { scroll-margin-top: 12px; }
  & .doc h2 { font-size: 1.25rem; margin: 28px 0 10px; }
  & .doc h2:first-child { margin-top: 0; }
  & .doc h3 { font-size: 1rem; margin: 20px 0 6px; }
  & .doc p { margin: 0 0 12px; color: color-mix(in srgb, var(--color-text) 88%, transparent); }
  & .doc :is(ul, ol) { margin: 0 0 12px; padding-left: 22px; }
  & .doc li { margin: 3px 0; }
  & .doc hr { border: 0; border-top: 1px solid var(--color-rule); margin: 28px 0; }
  & .doc blockquote { margin: 0 0 12px; padding: 2px 0 2px 14px; border-left: 3px solid var(--color-rule); color: var(--color-text-muted); }
  & .doc table { border-collapse: collapse; margin: 0 0 14px; font-size: .88rem; }
  /* footnotes (rule 58): ink number chips at the end of a section's text, and one Sources list at the end of each task,
     collapsed under "Sources n" (number, data source badge, name, domain on one line); both open Source Details */
  & .doc sup.fn { font-size: .78em; line-height: 0; vertical-align: .45em; margin-left: 3px; }
  & .doc sup.fn + sup.fn { margin-left: 3px; }
  & .doc sup.fn a { display: inline-block; min-width: 1.6em; padding: 2px 4px; border-radius: var(--radius-sm); text-align: center; font: 600 1em/1.2 var(--font-mono); color: var(--color-text); background: var(--ad-tint-2); text-decoration: none; }
  & .doc sup.fn a:hover { background: var(--color-ink); color: var(--color-on-ink); }
  & .doc .fn-only { margin-top: -6px; }
  & .fnotes { margin: 20px 0 0; padding-top: 10px; border-top: 1px dashed var(--color-rule); }
  & .fnotes > summary { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: var(--radius-sm); cursor: pointer; list-style: none; font-size: .84rem; font-weight: 600; color: var(--color-text); }
  & .fnotes > summary::-webkit-details-marker { display: none; }
  & .fnotes > summary::before { content: ""; width: 6px; height: 6px; margin: 0 4px 2px 6px; border: solid var(--color-text-muted); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform .15s ease-out; }
  & .fnotes[open] > summary::before { transform: rotate(45deg); margin-bottom: 4px; }
  & .fnotes > summary:hover { background: var(--ad-row-hover); }
  & .fnotes .fn-c { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 99px; border: 1px solid var(--color-rule); font: 500 .72rem/1 var(--font-mono); color: var(--color-text-muted); }
  & .fnotes > ol { margin-top: 6px; }
  & .fnotes ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
  & .fnotes li { margin: 0; }
  & .fnotes :is(a, button) { display: grid; grid-template-columns: 1.6rem auto minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 3px 6px; border-radius: var(--radius-sm); font-size: .82rem; font-weight: 400; color: var(--color-text); text-decoration: none; }
  & .fnotes :is(a, button):hover { background: var(--ad-row-hover); }
  & .fnotes button { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; font-family: inherit; }
  & .fnotes :is(a, button):hover .fn-t { text-decoration: underline; text-underline-offset: 3px; }
  & .fnotes .fn-n { font: 500 .76rem/1.4 var(--font-mono); color: var(--color-text-muted); text-align: right; }
  & .fnotes .tag { font-size: .72rem; padding: 1px 6px; }
  & .fnotes .fn-t { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  & .fnotes .fn-d { font-size: .76rem; color: var(--color-text-muted); white-space: nowrap; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; }
  /* source hover card (rule 59, js/source-preview.js): one fixed card for the whole page, shown beside the hovered
     source; badge and domain, the name, the start of an excerpt (three lines), and a hint that a click opens the details */
  & .srcpop { position: fixed; z-index: 120; width: min(340px, calc(100vw - 16px)); padding: 12px 14px; border: 1px solid var(--color-rule); border-radius: var(--radius); background: var(--color-surface); box-shadow: 0 8px 28px color-mix(in srgb, var(--color-ink) 16%, transparent); display: grid; gap: 6px; font-size: .82rem; line-height: 1.45; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(3px); transition: opacity .12s, transform .12s, visibility 0s .12s; }
  & .srcpop.on { opacity: 1; visibility: visible; transform: none; transition: opacity .12s, transform .12s; }
  & .srcpop-h { display: flex; align-items: center; gap: 8px; min-width: 0; }
  & .srcpop-h .tag { font-size: .72rem; padding: 1px 6px; }
  & .srcpop-h small { color: var(--color-text-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  & .srcpop b { font-weight: 600; font-size: .86rem; color: var(--color-text); }
  & .srcpop p { margin: 0; color: var(--color-text-muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
  & .srcpop p.none { font-style: normal; }
  & .srcpop em { font-style: normal; font-size: .74rem; color: var(--color-text-muted); }
  /* search matches (rule 55): a bright highlighter tint on every match, the current one solid */
  & mark.search-highlight { padding: 0 1px; border-radius: 2px; background: var(--ad-hl); color: inherit; }
  & mark.search-highlight.now { background: var(--ad-hl-now); color: var(--color-on-ink); box-shadow: 0 0 0 2px var(--ad-hl-now); }
  /* the search field with its match count and previous / next, drawn as one control */
  & .findh { flex-wrap: nowrap; }
  & .findh > h2 { flex: 1 0 auto; min-width: max-content; }   /* the title keeps its width; the search gives way */
  & .sfind { display: flex; align-items: center; gap: 2px; flex: 0 1 340px; min-width: 190px; border: 1px solid var(--ad-field-line); border-radius: var(--radius); background: var(--color-surface); padding-right: 3px; }
  & .sfind:focus-within { border-color: var(--color-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-ink) 16%, transparent); }
  & .sfind .inp { flex: 1 1 auto; min-width: 0; border: 0; background: none; box-shadow: none; }
  & .sfind-n { flex: none; padding: 0 6px; font: 500 .78rem/1 var(--font-mono); color: var(--color-text-muted); white-space: nowrap; }
  & .sfind .btn.ico { flex: none; width: 26px; height: 26px; }
  & .sfind .btn.ico:disabled { opacity: .4; }
  /* the consolidated findings (rule 54): tasks set apart by space and a rule, a meta line under each title, the
     executive summary as a tinted callout, section headings a step down */
  & .doc.findings { padding: 24px 32px 48px; }
  & .doc.findings h2 { font-size: 1.3rem; letter-spacing: -.02em; line-height: 1.25; margin: 40px 0 6px; padding-top: 32px; border-top: 1px solid var(--color-rule); }
  & .doc.findings h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
  & .doc.findings h3 { font-size: 1.02rem; margin: 24px 0 6px; }
  & .doc.findings :is(h2, h3) { scroll-margin-top: 16px; }
  & .doc .fmeta p { margin: 0 0 14px; font-size: .84rem; color: var(--color-text-muted); }
  & .doc .fmeta a { color: var(--color-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--color-rule); }
  & .doc .fmeta a:hover { text-decoration-color: currentColor; }
  & .doc .fsum { margin: 0 0 8px; padding: 14px 16px; border-radius: var(--radius); background: var(--ad-row-hover); }   /* the faintest tint (3.5%) */
  & .doc .fsum p { margin: 0; color: var(--color-text); }
  & .doc .fsum p + p { margin-top: 6px; }
  & .doc .fsum p:first-child strong { font-size: .84rem; font-weight: 600; }
  & .doc :is(th, td) { border: 1px solid var(--color-rule); padding: 6px 10px; text-align: left; }
  /* quality score ring (Evaluation): the arc length is the score, via pathLength="100" */
  & .score { display: grid; justify-items: center; text-align: center; gap: 10px; }
  & .score-svg { width: 132px; height: 132px; }
  & .score-svg circle { fill: none; stroke-width: 10; }
  & .score-svg .track { stroke: var(--color-rule); }
  & .score-svg .arc { stroke: var(--color-status-queued); stroke-linecap: round; }
  & .score-svg .arc.ok { stroke: var(--color-status-ok); }
  & .score-svg .arc.warn { stroke: var(--color-status-warning); }
  & .score-svg .arc.bad { stroke: var(--color-status-failed); }
  & .score-svg text { font: 600 30px var(--font-sans); fill: var(--color-text); text-anchor: middle; dominant-baseline: central; letter-spacing: -.03em; }
  & .score b { display: block; font-size: 1.05rem; }
  /* a sortable column header: the button fills the cell; th[aria-sort] draws the arrow */
  & .sortb { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }
  & .sortb:hover { color: var(--color-text); }
  & .num .sortb { text-align: right; }
  & .tb th:has(> .sortb)::after { content: none; }                          /* the arrow sits on the button, not after it */
  & .tb th[aria-sort=ascending] > .sortb::after { content: " \2191"; }
  & .tb th[aria-sort=descending] > .sortb::after { content: " \2193"; }
  & .brk { overflow-wrap: anywhere; }                          /* long URLs */
  & .ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  & mark { background: color-mix(in srgb, var(--color-status-warning) 22%, transparent); color: inherit; border-radius: 2px; }

  /* task results and findings */
  & .result { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 18px; }
  & .result p { font-size: .9rem; color: color-mix(in srgb, var(--color-text) 82%, transparent); }
  & .result dl { margin: 0; display: grid; gap: 8px; align-content: start; padding-left: 16px; border-left: 1px solid var(--color-rule); }
  & .result dd { margin: 2px 0 0; font-size: .9rem; }
  & details.find { border: 1px solid var(--color-rule); border-radius: var(--radius); background: var(--color-surface); }
  & details.find + details.find { margin-top: 6px; }
  & details.find > summary { display: flex; align-items: center; gap: 9px; padding: 9px 12px; cursor: pointer; font-weight: 500; font-size: .9rem; list-style: none; }
  & details.find > summary::-webkit-details-marker { display: none; }
  & details.find > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border: solid var(--color-text-muted); border-width: 0 1.5px 1.5px 0; rotate: 45deg; transition: rotate .15s; }
  & details.find[open] > summary::after { rotate: 225deg; }
  & details.find p { padding: 0 12px 12px 37px; }
  /* findings body rendered from markdown (sidebar): headings, lists and sources inside */
  & details.find .find-b { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 0 12px 12px; font-size: .87rem; color: color-mix(in srgb, var(--color-text) 85%, transparent); }
  & details.find .find-b p { padding: 0; }
  & details.find .find-b :is(ul, ol) { margin: 0; padding-left: 18px; }
  & details.find .find-b :is(h1, h2, h3, h4) { font-size: .9rem; }
  & details.find .find-b .src { margin-top: 4px; }
  /* a finding's sources, each expanding to its details (task detail) */
  & details.find .find-b ul.srcs { list-style: none; margin: 0; padding: 0; }
  & .srcs li + li { border-top: 1px solid var(--ad-line-soft); }
  & .srcs summary { display: flex; gap: 10px; align-items: center; padding: 7px 0; cursor: pointer; list-style: none; }
  & .srcs summary::after { content: ""; flex: none; width: 5px; height: 5px; margin: 0 4px 3px 0; border: solid var(--color-text-muted); border-width: 0 1.5px 1.5px 0; rotate: 45deg; transition: rotate .15s; }
  & .srcs details[open] > summary::after { rotate: 225deg; margin-bottom: -3px; }
  & .srcs summary > .tag { flex: none; }
  & .srcs summary::-webkit-details-marker { display: none; }
  & .srcs summary > span:nth-child(2) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--color-text); }
  & .srcs code { flex: none; font-family: var(--font-mono); font-size: .72rem; color: var(--color-text-muted); }
  & .srcs details[open] summary > span:nth-child(2) { white-space: normal; }
  & .srcs-d { display: grid; gap: 8px; padding: 2px 0 10px; }
  & .srcs-d .sd-ex-more { justify-self: start; margin-top: -2px; }   /* the excerpt itself uses the Source Details styles (.sd-ex-b, rule 60) */

  /* progress dots: complete green, running an open ink ring, queued grey; never red (rule 12) */
  & .pg { display: flex; gap: 4px; }
  & .pg i { width: 10px; height: 10px; border-radius: 50%; background: var(--color-rule); flex: none; }
  & .pg i.on { background: var(--color-status-ok); }
  & .pg i.on + i.on { box-shadow: -8px 0 0 -3px var(--color-status-ok); }
  & .pg i.cur { background: var(--ad-hi); box-shadow: inset 0 0 0 2px var(--color-status-running); }
  & .pg.lg { gap: 8px; }
  & .pg.lg i { width: 18px; height: 18px; }
  & .pg.lg i.on + i.on { box-shadow: -14px 0 0 -6px var(--color-status-ok); }
  & .pg.lg i.cur { box-shadow: inset 0 0 0 4px var(--color-status-running); }
  /* pipeline of linked stages */
  & .pipe { display: flex; align-items: flex-start; }
  & .pipe div { flex: 1; display: grid; justify-items: center; gap: 7px; position: relative; font-size: .78rem; text-align: center; color: var(--color-text-muted); }
  & .pipe i { width: 22px; height: 22px; border-radius: 50%; background: var(--color-rule); position: relative; z-index: 1; }
  & .pipe div::before { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 10px; background: var(--color-rule); }
  & .pipe div:first-child::before { display: none; }
  & .pipe .dn { color: var(--color-text); }
  & .pipe :is(.dn i, .dn::before, .cu::before) { background: var(--color-status-ok); }
  & .pipe .cu { font-weight: 600; color: var(--color-text); }
  & .pipe .cu i { background: var(--ad-hi); box-shadow: inset 0 0 0 5px var(--color-status-running), 0 0 0 4px color-mix(in srgb, var(--color-status-running) 14%, transparent); }
  /* job progress column (Job Details, rule 37). Summary card: where the job is, a status icon, and a bar
     with a segment per stage (done green, current running, a failed stop red, later grey; rule 12). */
  & .prog { flex: none; padding: 16px; display: grid; gap: 14px; }
  & .prog-h { display: flex; align-items: flex-start; gap: 12px; }
  & .prog-h h2 { font-size: 1.1rem; letter-spacing: -.02em; line-height: 1.25; }
  & .prog-h p { margin-top: 3px; font-size: .85rem; color: var(--color-text-muted); }
  & .prog-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius); background: color-mix(in srgb, var(--color-status-queued) 13%, transparent); color: var(--color-status-queued); }
  & .prog-ic.cu { background: color-mix(in srgb, var(--color-status-running) 13%, transparent); color: var(--color-status-running); }
  & .prog-ic.dn { background: color-mix(in srgb, var(--color-status-ok) 15%, transparent); color: var(--color-status-ok); }
  & .prog-ic.bad { background: color-mix(in srgb, var(--color-status-failed) 13%, transparent); color: var(--color-status-failed); }
  & .prog-ic .ic { width: 18px; height: 18px; }
  & .segs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
  & .segs i { height: 5px; border-radius: 99px; background: var(--color-rule); }
  & .segs i.dn { background: var(--color-status-ok); }
  & .segs i.cu { background: var(--color-status-running); }
  & .segs i.bad { background: var(--color-status-failed); }

  /* timeline: stage icon nodes on one vertical line, a group label (Completed, In progress, Up next) above
     each run of stages, each stage's facts, and its tasks branching off the line as sub-steps */
  & .tl { list-style: none; margin: 0; padding: 0; }
  & .tl > li { position: relative; padding: 0 0 20px 40px; }
  & .tl > li:last-child { padding-bottom: 0; }
  & .tl > li::before { content: ""; position: absolute; left: 12px; top: 0; bottom: 0; width: 2px; background: var(--color-rule); }
  & .tl > li:first-child::before { top: 10px; }
  & .tl > li:last-child::before { bottom: auto; height: 6px; }
  & .tl > .tl-g { padding-bottom: 12px; font-size: .8rem; font-weight: 600; color: var(--color-text-muted); }
  & .tl > .tl-g::after { content: ""; position: absolute; left: 9px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-rule); }
  & .tl .nd { position: absolute; left: 0; top: -3px; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--color-surface); color: var(--color-text-muted); box-shadow: inset 0 0 0 1.5px var(--color-rule); }
  & .tl .nd .ic { width: 14px; height: 14px; }
  & .tl > .dn .nd { background: color-mix(in srgb, var(--color-status-ok) 15%, var(--color-surface)); color: var(--color-status-ok); box-shadow: none; }
  & .tl > .cu .nd { background: var(--color-status-running); color: var(--color-on-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-status-running) 18%, transparent); }
  & .tl > .bad .nd { background: var(--color-status-failed); color: var(--color-on-ink); box-shadow: none; }
  & .tl-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 20px; }
  & .tl-h b { font-weight: 600; }
  & .tl > .tl-s:not(.dn, .cu, .bad) .tl-h b { font-weight: 500; color: var(--color-text-muted); }
  & .tl-m { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; margin: 6px 0 0; font-size: .82rem; color: var(--color-text-muted); }
  & .tl-m dd { margin: 0; color: var(--color-text); }
  /* sub-steps: a marker per task (check, dot), badge and title, set under the stage; no branch line from the main
     line into the list (DESIGN.md rule 52) */
  & .tl ul { position: relative; list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 9px; }
  & .tl ul li { display: grid; grid-template-columns: 14px auto minmax(0, 1fr); gap: 8px; align-items: start; font-size: .86rem; }
  & .tl .mk { position: relative; display: grid; place-items: center; width: 14px; height: 18px; color: var(--color-status-ok); }
  & .tl .mk .ic { width: 14px; height: 14px; stroke-width: 2.4; }
  & .tl .mk::after { content: ""; width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--color-status-queued); }
  & .tl li.ok .mk::after { display: none; }
  & .tl li.run .mk::after { background: var(--color-status-running); box-shadow: none; animation: ad-pulse 1.6s ease-in-out infinite; }
  & .tl li.bad .mk::after { background: var(--color-status-failed); box-shadow: none; }
  & .tl ul .ty { width: 2.6rem; padding: 3px 0; }
  & .tl ul .t { color: var(--color-text); text-decoration: none; line-height: 1.35; }
  & .tl ul li.ok .t { color: var(--color-text-muted); }
  & .tl ul .t:hover { color: var(--color-text); text-decoration: underline; }
  /* post-processing sub-steps: marker, step name, duration; a failure reason on its own line */
  & .tl ul.steps li { grid-template-columns: 14px minmax(0, 1fr) auto; font-size: .82rem; }
  & .tl ul.steps li.ok > .mono:not(.muted) { color: var(--color-text-muted); }
  & .tl ul.steps .hint { grid-column: 2 / -1; margin: 0; }
  /* the progress band and the source split */
  & .band { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.5fr); gap: 28px; padding: 18px 16px; align-items: center; }
  & .split { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--color-rule); }
  & .split i { background: var(--color-source-kb); width: var(--kb, 50%); }   /* --kb is the one allowed inline custom property */
  & .split i + i { background: var(--color-source-web); width: auto; flex: 1; }
  /* the same split drawn as an SVG, so its widths are attributes rather than inline styles (Blazor) */
  & svg.split { display: block; width: 100%; height: 10px; border-radius: 99px; overflow: hidden; }
  & svg.split .kb { fill: var(--color-source-kb); }
  & svg.split .web { fill: var(--color-source-web); }
  & .key { display: flex; gap: 16px; font-size: .8rem; color: var(--color-text-muted); }
  & .key span { display: inline-flex; align-items: center; gap: 6px; }

  /* count tiles (Shared/StatTile.razor, rule 46; Job Details snapshot, Source Details): a row of plain tiles. White surface, thin rule, the label
     muted with a line icon at the right, a large number, an optional muted line. Columns follow the row's width
     (container query): four, then two under 560px, then one under 300px. */
  & .snap { container-type: inline-size; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  & .snap.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }   /* three tiles in a narrow sidebar (Knowledge Registry) */
  & .snap.three > .snap-t { padding: 12px; }
  & .snap.three .snap-h { margin-bottom: 8px; font-size: .82rem; }
  & .snap.three .snap-h .ic { width: 16px; height: 16px; }
  & .snap.three .snap-t b { font-size: 1.6rem; }
  & .snap-t {
    min-width: 0; display: grid; gap: 4px; align-content: start; padding: 16px 18px 18px;
    color: var(--color-text); text-decoration: none; background: var(--color-surface);
    border: 1px solid var(--color-rule); border-radius: var(--radius-lg); transition: border-color .15s;
  }
  & a.snap-t:hover { text-decoration: none; border-color: color-mix(in srgb, var(--color-ink) 30%, var(--color-rule)); }
  & .snap-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; font-size: .9rem; color: var(--color-text-muted); }
  & .snap-h .ic { width: 18px; height: 18px; flex: none; color: var(--color-text); }
  & .snap-t b { font-size: 2.2rem; font-weight: 600; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
  & .snap-t small { font-size: .85rem; color: var(--color-text); min-height: 1.2em; }
  @container (max-width: 560px) {
    & .snap:not(.three) > .snap-t { grid-column: span 2; }
  }
  @container (max-width: 300px) {
    & .snap-t { grid-column: span 4; }
  }
  & .src { list-style: none; margin: 0; padding: 0; }
  & .src li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--ad-line-soft); font-size: .87rem; }
  & .src li:first-child { border-top: 0; padding-top: 0; }
  & .src li:last-child { padding-bottom: 0; }
  & .src li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  & .src code { font-family: var(--font-mono); font-size: .72rem; color: var(--color-text-muted); }
  & .kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .88rem; }
  & .kv dt { color: var(--color-text-muted); }
  & .kv dd { margin: 0; text-align: right; }
  & .kv.lft dd { text-align: left; }   /* long values such as URLs */

  /* dialog */
  & dialog.dlg { border: 0; padding: 0; background: var(--color-ground); color: var(--color-text); border-radius: var(--radius-lg); width: min(92vw, 680px); box-shadow: var(--ad-shadow-dlg); }
  & dialog.dlg::backdrop { background: var(--color-backdrop); }
  & .dlg header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--color-rule); }
  & .dlg header h2 { font-size: 1.2rem; }
  & .dlg .bd { padding: 18px 20px; display: grid; gap: 16px; max-height: 70vh; overflow: auto; }
  & .dlg footer { display: flex; justify-content: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--color-rule); background: color-mix(in srgb, var(--color-raised) 50%, transparent); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

  /* dropdown menu (details.menu), e.g. "Job options (n)" (rule 14) */
  & .menu { position: relative; }
  & .menu > summary { list-style: none; }
  & .menu > summary::-webkit-details-marker { display: none; }
  & .menu:not(.acct, .rowmenu) > summary::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; rotate: 45deg; margin: -3px 2px 0 4px; }
  & .menu-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 13rem; padding: 6px; display: grid; background: var(--color-surface); border: 1px solid var(--color-rule); border-radius: var(--radius); box-shadow: var(--ad-shadow-pop); }
  & .menu-pop.end { left: auto; right: 0; }   /* menu under a button at the right edge */
  /* row menu (Shared/RowMenu.razor) inside a scrolling list: fixed, so the list's overflow does not clip it;
     js/row-menu.js places it under (or above) its button when it opens and closes it on scroll */
  & .rowmenu > .menu-pop { position: fixed; min-width: 10rem; }
  /* rows align top (rule 31): pull the 28px button up so its dots sit on the title's first line */
  & .rowmenu:not(.btnmenu) > summary { margin-block: -4px; }   /* the row's ellipsis button, pulled up to the title line */
  & .rowmenu[open] > summary { background: var(--ad-tint-2); color: var(--color-text); }
  & .menu-pop > a.menu-i { color: var(--color-text); text-decoration: none; }
  & dialog.dlg.sm { width: min(92vw, 460px); }
  & dialog.dlg.lg { width: min(94vw, 760px); }   /* a long form (New Research Job) */
  & .menu-i { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 400; }
  & .menu-i:hover { background: var(--ad-tint); }
  & .menu-i.dan { color: var(--color-accent); }
  & .menu-i .ic { width: 16px; height: 16px; color: var(--color-text-muted); }
  & .menu-i.dan .ic { color: currentColor; }
  & .menu-i[aria-pressed=true] { font-weight: 600; }   /* a toggled item (Like, Dislike) */
  & .menu-i[aria-pressed=true] .ic { color: var(--color-text); }
  & .menu-i:disabled { color: color-mix(in srgb, var(--color-text) 38%, transparent); cursor: not-allowed; background: none; }
  & .menu-i small { margin-left: auto; font-size: .75rem; }   /* a note at the right of an item ("TBD") */
  /* a header button that opens a menu (+ Report on the job Tasks tab): a .rowmenu (row-menu.js places and
     closes it) whose summary is a light button with a down chevron; .caret draws the same chevron on the
     disabled stand-in button */
  & .btn.caret::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; rotate: 45deg; margin: -3px 2px 0 2px; }
  & .menu-sep { height: 1px; background: var(--ad-line-soft); margin: 4px 0; }

  /* inline message (errors above a card or inside a dialog) and empty state */
  & .msg { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius); font-size: .9rem; border: 1px solid var(--color-rule); background: var(--color-surface); }
  & .msg .ic { flex: none; }
  & .msg.ok { border-color: color-mix(in srgb, var(--color-status-ok) 45%, transparent); background: color-mix(in srgb, var(--color-status-ok) 8%, var(--color-surface)); }
  & .sentinel { height: 1px; }   /* infinite scroll: loads the next page when it comes into view (js/infinite-scroll.js) */
  & .picks { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }   /* a list of radio choices in a dialog */
  & .msg.bad { color: var(--color-accent); border-color: color-mix(in srgb, var(--color-accent) 45%, transparent); background: color-mix(in srgb, var(--color-accent) 8%, var(--color-surface)); }
  & .empty { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 48px 16px; }
  /* dialog rendered by Blazor (not showModal): the scrim stands in for ::backdrop */
  & .scrim { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: var(--color-backdrop); }
  & .scrim > dialog.dlg { position: static; margin: 0; }

  /* utilities */
  & .muted { color: var(--color-text-muted); }
  & .mono { font-family: var(--font-mono); font-size: .86em; }
  /* sub-title inside a card: sentence case Geist, no leading icon, in place of the all-caps mono .label
     eyebrow (DESIGN.md: all-caps mono labels were rejected) */
  & .sub { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: .86rem; font-weight: 600; letter-spacing: -.01em; color: var(--color-text); }
  & .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  & .grow { flex: 1; min-width: 0; }
  & .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  & .stack { display: grid; gap: var(--space); }
  & .stack-s { display: grid; gap: 8px; }
}

/* Base element rules for .aldus regions. Wrapped in :where() so they carry no class specificity:
   they still beat site.css's bare element rules (same specificity, later in the cascade) but never
   outrank a component class such as .side-a or .btn. */
:where(.aldus), :where(.aldus) *, :where(.aldus) *::before, :where(.aldus) *::after { box-sizing: border-box; }
:where(.aldus) :is(h1, h2, h3, h4, p) { margin: 0; }
:where(.aldus) p { line-height: inherit; }                                      /* reset site.css p */
:where(.aldus) h1 { font-size: 1.75rem; font-weight: 600; letter-spacing: var(--tracking-heading); line-height: 1.15; }
:where(.aldus) h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -.015em; }
:where(.aldus) h3 { font-size: .95rem; font-weight: 600; letter-spacing: -.01em; }
:where(.aldus) a { color: inherit; font-weight: 500; text-decoration: none; }   /* links are ink at 500, not blue */
:where(.aldus) a:hover { text-decoration: underline; text-underline-offset: 3px; }
:where(.aldus) :is(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.aldus) :focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; }   /* focus is ink (rule 3) */

/* ProjectDetail (.page.proj), Hallmark redesign 2026-11-26 (DESIGN.md rule 48). Its 1480px cap was dropped
   2026-12-01: like every page it fills the window (rule 19). */
.aldus.proj {
  /* loading placeholders in the shape of what is coming (skeleton rows, summary lines) */
  & .skel-row { pointer-events: none; }
  & .skel-row .skel { margin-top: 4px; }
  & .ph { display: grid; gap: 9px; padding: 14px; }
}

/* A navigator beside a leading brief (DESIGN.md rules 48, 51): the project's Jobs tab (jobs navigator, job brief) and
   the job's Tasks tab (tasks navigator, task brief). Class names are unique, so these apply on any .aldus page. */
.aldus {
  & .brief .ph { display: grid; gap: 9px; padding: 4px 0; }
  & .navl.navck .jrow { grid-template-columns: 16px 18px minmax(0, 1fr) 28px; gap: 10px; }   /* checkbox, status, title, row menu */
  & .navl.navck .jrow .si { margin-top: 1px; }
  & .navc .toolbar > input[type=checkbox] { flex: none; }
  & .navc .card-f { display: flex; gap: 12px; }
  & .cols.brief-cols { grid-template-columns: minmax(300px, 2fr) minmax(0, 3fr); }
  & .navl .jrow { grid-template-columns: minmax(0, 1fr) 28px; font-size: .86rem; padding-block: 9px; }   /* title, row menu */
  & .navl .jrow .t { font-weight: 400; }
  & .navl .jrow[aria-selected=true] .t { font-weight: 600; }
  /* the project's jobs navigator as a table inset in its card (2026-12-01): Job, Created, row menu */
  & .navt { font-size: .86rem; }
  & .navt td .t { font-weight: 400; overflow-wrap: anywhere; }
  & .navt tr.sel td .t { font-weight: 600; }
  & .navt td.num { color: var(--color-text-muted); }
  & .navt th.fit { width: 1%; }
  /* the brief's top line: parent lines at the left, an icon-only Open at the top right (no "Job" header, 2026-12-01) */
  & .bf-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
  & .bf-top > .btn.ico { flex: none; width: 34px; height: 34px; margin: -6px -8px 0 auto; color: var(--color-text); border: 1px solid var(--color-rule); background: var(--color-surface); }
  & .bfl .jrow { grid-template-columns: 28px 1.9rem 1.9rem minmax(0, 1fr) auto 28px; gap: 8px; padding-left: 8px; }   /* expand, status, source, title, rating, menu */
  /* navigator: no header row; the list runs to the card edges and scrolls between the toolbar and the footer */
  & .card.scroll > .list.navl { flex: 1 1 auto; margin: 0; border: 0; border-radius: 0; }
  & .navc .toolbar { flex-wrap: nowrap; }   /* search, the status filter and + Job on one line */
  & .navc .toolbar > .inp.grow { flex: 1 1 auto; min-width: 0; }
  & .navc .toolbar .btn.ico { width: 34px; height: 34px; flex: none; color: var(--color-text); border: 1px solid var(--color-rule); background: var(--color-surface); }
  & .navc .toolbar .btn.ico.on { border-color: var(--color-ink); }   /* a status filter is on */
  & .navc .menu-pop .ic.off { visibility: hidden; }   /* the unchecked filter items keep the check's space */
  & .brief { min-height: 0; overflow: hidden; }
  & .brief > .card-h { padding-block: 9px; }
  & .brief > .card-h .end { margin-left: auto; }
  & .brief > .card-h .sub { font-size: 1.05rem; }
  & .brief > .card-b.pane { flex: 1 1 auto; min-height: 0; overflow: auto; align-content: start; gap: 22px; padding: 22px 24px; }
  & .bf-hd { display: grid; gap: 10px; }
  & .bf-t { font-size: 1.45rem; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; overflow-wrap: break-word; min-width: 0; }
  & :is(.bf-q, .bf-sum p) { line-height: 1.6; }
  & .bf-q { font-size: 1rem; }
  & .bf-th { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
  & .bf-th .sub { margin-bottom: 0; }
  & .bf-th .muted { font-size: .85rem; font-variant-numeric: tabular-nums; }
  & .bfl > li { border-bottom: 1px solid var(--ad-line-soft); }
  & .bfl > li:last-child { border-bottom: 0; }
  & .bfl .jrow { border-bottom: 0; }
  /* the open task: the ink edge only, no tint (rule 41 tint dropped here) */
  & .bfl .jrow[aria-selected=true] { background: none; box-shadow: none; }
  & .bfl > li:has(> [aria-selected=true]) { box-shadow: inset 3px 0 0 var(--color-ink); }
  & .bfl .xp { margin-top: -4px; }
  & .bfl .xp .ic { width: 16px; height: 16px; transition: transform .15s ease-out; }
  & .bfl .xp[aria-expanded=true] .ic { transform: rotate(180deg); }
  & .bfl .ty.ico { width: auto; display: inline-grid; place-items: center; padding: 3px 0; }
  & .bfl .ty.ico .ic { width: 15px; height: 15px; }
  /* status as an icon badge, the same box as the source badge, tinted in the status colour */
  & .bfl .sb { display: inline-grid; place-items: center; padding: 3px 0; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--color-status-queued) 13%, transparent); }
  & .bfl .sb.ok { background: color-mix(in srgb, var(--color-status-ok) 14%, transparent); }
  & .bfl .sb.run { background: var(--ad-tint); }
  & .bfl .sb.warn { background: color-mix(in srgb, var(--color-status-warning) 14%, transparent); }
  & .bfl .sb.bad { background: color-mix(in srgb, var(--color-status-failed) 12%, transparent); }
  & .bfl .sb .si svg { width: 14px; height: 14px; }
  & .bfl .rt { display: inline-grid; place-items: center; padding-top: 2px; color: var(--color-text-muted); }
  & .bfl .rt .ic { width: 15px; height: 15px; }
  & .bf-sum .clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
  & .bf-sum .more { width: fit-content; font-size: .86rem; text-decoration: underline; text-underline-offset: 3px; }
  & .bf-sum { display: grid; gap: 6px; padding: 2px 14px 16px 46px; }   /* under the title, past the expand button */
  & .bf-sum .sub { margin-bottom: 0; }
  & .bf-sum .ph { padding: 4px 0; }

  /* a count pill after a card title ("Links 12"; registry item page). Same pill as Source Details' .sd-n */
  & .card-h h2 > .n, & .n.pill { display: inline-grid; place-items: center; min-width: 22px; height: 20px; margin-left: 6px; padding: 0 7px; border-radius: 99px; background: var(--color-surface); border: 1px solid var(--color-rule); font: 500 .72rem/1 var(--font-mono); color: var(--color-text-muted); vertical-align: 2px; }
  /* an icon-only head button at a normal button's height (the registry item's Delete) */
  & .btn.sq { padding: 0; width: 36px; height: 36px; flex: none; }
  & .btn.sq svg { width: 16px; height: 16px; }

  /* help as an info icon with a tooltip (Shared/InfoTip.razor, rule 75), in place of a hint line under a field */
  & .fld > .lbl { display: inline-flex; align-items: center; gap: 4px; justify-self: start; }
  & .itip { position: relative; display: inline-flex; vertical-align: middle; }
  & .itip-b { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--color-text-muted); cursor: help; }
  & .itip-b:hover, & .itip-b:focus-visible { color: var(--color-text); }
  & .itip-b:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 1px; }
  & .itip-b .ic { width: 15px; height: 15px; }
  & .itip-t { position: absolute; left: -6px; top: calc(100% + 6px); z-index: 60; width: max-content; max-width: min(18rem, 70vw); padding: 7px 10px; border-radius: var(--radius-sm); background: var(--color-ink); color: var(--color-on-ink); font: 400 .8rem/1.4 var(--font-sans); box-shadow: var(--ad-shadow-tip); visibility: hidden; opacity: 0; transition: opacity .12s ease-out, visibility .12s; pointer-events: none; }
  & .itip:hover .itip-t, & .itip-b:focus-visible + .itip-t { visibility: visible; opacity: 1; }
  & .itip.hush .itip-t { visibility: hidden; opacity: 0; }

  /* a text field with suggestions (Shared/SuggestInput.razor, rule 76): a chevron in the field, a list under it */
  & .sug { position: relative; min-width: 0; }
  & .sug > .inp { padding-right: 34px; }
  & .sug-b { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 0 var(--radius) var(--radius) 0; background: none; color: var(--color-text-muted); cursor: pointer; }
  & .sug-b:hover { color: var(--color-text); }
  & .sug-b .ic { width: 16px; height: 16px; transition: transform .15s ease-out; }
  & .sug.open .sug-b .ic { transform: rotate(180deg); }
  & .sug-l { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; max-height: 15rem; overflow-y: auto; margin: 0; padding: 4px; list-style: none; border: 1px solid var(--color-rule); border-radius: var(--radius); background: var(--color-surface); box-shadow: var(--ad-shadow-pop); }
  & .sug-l li { padding: 6px 9px; border-radius: var(--radius-sm); font-size: .9rem; cursor: pointer; }
  & .sug-l li:hover { background: var(--ad-row-hover); }
  & .sug-l li[aria-selected=true] { background: var(--ad-tint-2); }
  & .sug-l li.cur { font-weight: 600; }

  /* aliases as chips (Shared/AliasInput.razor): a field-shaped box of chips with a borderless text field after them */
  & .aka { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 38px; padding: 5px 6px; border: 1px solid var(--ad-field-line); border-radius: var(--radius); background: var(--color-surface); cursor: text; }
  & .aka:focus-within { border-color: var(--color-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-ink) 16%, transparent); }
  & .aka.off { cursor: default; background: transparent; }
  & .aka-c { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-width: 0; padding: 2px 2px 2px 9px; border: 1px solid var(--color-rule); border-radius: var(--radius-sm); background: var(--ad-tint); font-size: .86rem; line-height: 1.4; }
  & .aka.off .aka-c { padding-right: 9px; }
  & .aka-t { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
  & .aka-c button { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; padding: 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--color-text-muted); cursor: pointer; }
  & .aka-c button:hover { background: var(--ad-tint-2); color: var(--color-text); }
  & .aka-c button .ic { width: 12px; height: 12px; }
  & .aka input { flex: 1 1 8rem; min-width: 8rem; padding: 3px 5px; border: 0; outline: 0; background: none; font: 400 .93rem/1.35 var(--font-sans); color: var(--color-text); }
  & .aka input::placeholder { color: color-mix(in srgb, var(--color-text-muted) 75%, transparent); }

  /* registry item page (Pages/Registry/RegistryItem.razor) */
  & .ri .tb .rel .rl { display: inline-flex; align-items: center; gap: 6px; }
  & .ri .tb .rel .dir { width: 13px; height: 13px; flex: none; color: var(--color-text-muted); }
  & .ri .tb .rel .dir.in { transform: scaleX(-1); }   /* the relationship reads from the other item to this one */
  & .ri .tb .rel { white-space: nowrap; }
  /* Links: one tbody per link; the description is a full-width row under the link row, read as one row */
  & .ri .tb.links > tbody > tr:last-child > td { border-bottom: 1px solid var(--ad-line-soft); }
  & .ri .tb.links > tbody:last-child > tr:last-child > td { border-bottom: 0; }
  & .ri .tb.links > tbody > tr.has-d > td { border-bottom: 0; padding-bottom: 2px; }
  & .ri .tb.links > tbody > tr:hover { background: none; }
  & .ri .tb.links > tbody:hover > tr { background: var(--ad-row-hover); }
  & .ri .tb.links .ld > td { padding-top: 0; padding-left: 31px; color: var(--color-text-muted); font-size: .86rem; line-height: 1.45; }   /* under the relationship text, past the arrow */
  /* Found In grouped by project, then job: a project band, job rows that fold, then their mentions indented */
  & .ri .tb.fi > tbody > tr:last-child > td { border-bottom: 1px solid var(--ad-line-soft); }
  & .ri .tb.fi > tbody:last-child > tr:last-child > td { border-bottom: 0; }
  & .ri .fi-h { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
  & .ri .fi-p > td { background: var(--color-raised); font-weight: 600; padding-top: 8px; padding-bottom: 8px; }
  & .ri .tb.fi > tbody > tr.fi-p:hover { background: none; }
  & .ri .fi-p .ic { width: 15px; height: 15px; color: var(--color-text-muted); }
  & .ri .fi-p .muted { font-weight: 400; font-size: .84rem; }
  & .ri .fi-j > td:first-child { padding-left: 8px; font-weight: 500; }
  & .ri .fi-j .fi-h .n { margin-left: 0; }
  & .ri .fi-j .xp { margin: -4px 0; flex: none; }
  & .ri .fi-j .xp .ic { width: 16px; height: 16px; transition: transform .15s ease-out; }
  & .ri .fi-j .xp[aria-expanded=true] .ic { transform: rotate(180deg); }
  & .ri .fi-m > td:first-child { padding-left: 44px; }   /* under the job title, past the fold button */
  & .ri .fi-m > td { font-size: .9rem; }
}
@media (max-width: 1080px) {
  .aldus .cols.brief-cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1080px) {
  .aldus {
    & :is(.cols, .cols.wide-rail, .cols.form-rail, .cols.even, .cols.duo, .cols.duo.jd, .cols.sixty, .cols.lead) { grid-template-columns: minmax(0, 1fr); }
    & .card.scroll { contain: none; min-height: 0; }
    & .card.scroll > :is(.tblw, .list) { max-height: 70vh; }
    /* the report editor (rule 71) has no page height to fill here: a fixed height, so Visual and Markdown scroll inside it */
    & .card.scroll > .rte { flex: none; height: 70vh; min-height: 22rem; }
    &.page.fill, & .page.fill { height: auto; display: grid; }
    & .page.fill > .cols, &.page.fill > .cols { grid-template-rows: none; }
    & .band { grid-template-columns: 1fr; }
    }
}
@media (max-width: 760px) {
  .aldus {
    & :is(.setup, .setup.three) { grid-template-columns: minmax(0, 1fr); }
    & .result { grid-template-columns: 1fr; }
    & .result dl { border: 0; padding: 0; grid-template-columns: 1fr 1fr; }
    &.page, & .page { padding-left: 16px; padding-right: 16px; }
    & .rte-doc, & .rte > textarea.inp.md { padding: 14px 16px 24px; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .aldus .st.run::before, .aldus .si .spin, .aldus .skel { animation: none; }
  .aldus.proj .bfl .xp .ic, .aldus .toc-r .xp .ic, .aldus .ri .fi-j .xp .ic, .aldus .fnotes > summary::before, .aldus .srcpop { transition: none; }
}

@keyframes ad-skel { 50% { opacity: .45; } }
