/* =============================================================================
   Migration Suite — Design System
   -----------------------------------------------------------------------------
   The single, canonical stylesheet for the dmweb SPA: tokens + base + shared
   components. LOAD-BEARING since 2026-06-13 — the shell (index.html) links it
   render-blocking before app.css, so every in-shell route inherits it; the
   styleguide (../design-system/styleguide.html) renders from this same file.
   Tweak a value HERE and both the app and the styleguide retune together.

   Cascade contract: this file loads FIRST. app.css (cross-route glue),
   sidebar.css (chrome layout) and routes/<route>.css (page-specific) load
   after and may override deliberately. The standalone pages (login.html,
   help.html, api-reference.html) do NOT link it — login is pre-auth minimal,
   help is deliberately warm-styled.

   --- Curated to feedback (2026-06-08) -------------------------------------
   Captured from the live UI as "liked, make it canonical": sidebar nav +
   selection + active-cycle dot; the tier-cascade "Applies to" selector;
   check-type pills; dialog title/subtitle/rule-number + icon close/save;
   collapsible sections; object-row inline icons + counters; the "⋯" kebab and
   its dropdown menu (now THE reusable menu); file rows with status spinners;
   drag-and-drop drop targets; the transform/validate run-bar.
   Adjusted per feedback: disclosure triangle on the LEFT; lighter list-row
   titles; run-bar squared at the top inside a card; subtle borders between file
   rows; and — globally — icon buttons are BORDERLESS, with hover showing only a
   touch of color + a subtle background (never a border).

   Layers, top to bottom:
     1. Tokens         9. Overlays (dialog, menu, tooltip)
     2. Reset / base   10. Disclosure / collapsible
     3. Layout         11. Sidebar navigation
     4. Forms          12. Tier cascade ("Applies to")
     5. Buttons        13. File / list rows + status spinners
     6. Feedback       14. Run bar (pipeline stages)
     7. Data display   15. Utilities + keyframes
     8. (overlays)     16. Reports (the reporting standard, IN174)
   ========================================================================== */

/* 1. TOKENS ================================================================ */
:root {
  /* --- Core palette (the established 10; unchanged) --- */
  --fg: #1d1f23;            /* primary text */
  --muted: #6b7280;         /* secondary text, labels, meta */
  --muted-soft: #9ca3af;    /* a step softer: the key/value table's labels */
  --mono-fg: #656974;       /* inline IDs and keys (.mono): the SAP field name's #3f4451 at 80% on --card, 5.5:1 (5.1:1 on --surface-info) */
  --bg: #f7f7f8;            /* app background / selected-row tint / icon hover */
  --card: #ffffff;          /* surface: cards, header, sidebar, dialogs */
  --border: #e3e5ea;        /* hairline dividers + control borders */
  --border-hover: #c3c8d1;  /* input/control hover border — a subtle step up from --border, not the strong --muted */
  --accent: #0f62fe;        /* primary action / links / active state */
  --accent-hover: #0050d4;  /* accent pressed/hover (solid fills) */
  --link-soft: #3468cc;     /* a softer accent for quiet links ("Learn more"): --accent 60% toward --muted, 5.3:1 on --card, 4.9:1 on --surface-info */
  --ok: #168f4b;            /* success */
  --err: #c0392b;           /* error / destructive */
  --warn: #b07d00;          /* warning / attention */

  /* --- Surfaces --- */
  --surface-hover: #f3f4f6; /* neutral row/link hover */
  --surface-sunken: #fafbfc;/* nested panels, open rows, table head zebra */
  --surface-info: #f3f6fb;  /* informational band / menu-item hover / summary */
  --row-hover: #f7f8fa;     /* canonical interactive-row hover wash (distinct from --surface-sunken, which is the resting/open-row + zebra tint) */
  --control-disabled: #b8c0cc;
  --control-disabled-fg: #b9bdc5;
  --hover-strong: #e5e7eb;

  /* --- Reading palette: the help page's warm, low-contrast tints. docs.css
     applies them under .docs-warm (help.html's <main>); the app does not use
     them. --- */
  --reading-fg: #2b2d33;
  --reading-muted: #6e7681;
  --reading-border: #ecebe5;
  --reading-border-soft: #f2f0ea;
  --reading-hover: #efece6;       /* TOC link hover */
  --reading-code-bg: #f7f5f1;
  --reading-code-fg: #41454d;
  --reading-head-bg: #faf8f4;     /* table header band */
  --reading-zebra: #fdfcf9;       /* even table rows */
  --reading-quote-bar: #dbd8d0;
  --reading-quote-bg: #faf9f5;

  /* --- Accent variants --- */
  --accent-soft-bg: #f0f4ff;        /* download tiles */
  --accent-soft-bg-hover: #e3ebff;
  --accent-soft-border: #cdd9f9;
  --accent-icon-hover-bg: #eff4ff;  /* icon-button hover wash (accent intent) */
  --accent-chip-bg: #dbeafe;
  --accent-chip-fg: #1e40af;
  --accent-chip-border: #bfdbfe;
  --accent-wash: rgba(15, 98, 254, 0.06);   /* drop-target fill, faint */
  --accent-tint: rgba(15, 98, 254, 0.08);   /* lit cascade segment */
  --accent-tint-strong: rgba(15, 98, 254, 0.18); /* origin cascade segment */

  /* --- Status-soft --- */
  --ok-soft-bg: #ecfdf5;    --ok-soft-fg: #065f46;
  /* Moss: the done / active-cycle green of the project and ETL cycle pages
     (their Active title pill) and the sidebar's Active pill. */
  --moss-soft-bg: #e3ecd5;  --moss-soft-fg: #4b6b32;  --moss-soft-border: #b7cb96;
  --err-soft-bg: #fff5f5;   --err-soft-border: #f5c2c2;  --err-strong: #a52a1c;
  --sev-error-bg: #fde2e1;
  --sev-warning-bg: #fcefd4; --sev-warning-border: #fbe0b0;
  --sev-info-bg: #e5e7eb;

  /* --- Pipeline stage semantics (used by run-bars, stage spinners, stage nav) --- */
  --stage-assess-bg: #dbeafe;    --stage-assess-fg: #1d4ed8;     /* blue */
  --stage-transform-bg: #fdecd2; --stage-transform-fg: #b9770e;  /* amber */
  --stage-validate-bg: #d9f3e4;  --stage-validate-fg: var(--ok); /* green */
  --run-bar-bg: #eef0f3;

  /* --- Report tokens (IN174 FE-25, the reporting standard): exactly these
     fifteen, light only until the suite has a dark theme. Hex values, never
     var(), so tests/unit/test_report_theme.py reads them with a regex and the
     PDF theme (_shared/report/theme.py) is pinned to the same values. Chart
     text, ink, lines, surfaces and status colours are the suite's own. --- */
  --rp-grid: #eef0f3;   /* grid lines, bar tracks */
  --rp-axis: #c3c8d1;   /* axis lines and ticks */
  --rp-h1: #edf5ff;     /* magnitude, light to dark */
  --rp-h2: #d0e2ff;
  --rp-h3: #a6c8ff;
  --rp-h4: #78a9ff;
  --rp-h5: #4589ff;
  --rp-h6: #0f62fe;     /* = --accent */
  --rp-h7: #0043ce;
  --rp-h8: #002d9c;
  --rp-pat-match: #168f4b;    /* Match (= --ok) */
  --rp-pat-hidden: #0f7b8a;   /* Hidden characters (a warning that counts as a match) */
  --rp-pat-spaces: #6929c4;   /* Spaces trimmed */
  --rp-pat-case: #b07d00;     /* Capitalization (= --warn) */
  --rp-pat-other: #c0392b;    /* Other difference (= --err) */
  --rp-pat-notfound: #4b5563; /* Not found */

  /* --- Rules card and range runs (moved in from the workspace panel) --- */
  --rules-sev-warning: #c98a1a; /* a rule's warning outcome dot */
  --rules-sev-info: #5b7fb0;    /* info outcome */
  --rules-sev-pass: #3a9d5d;    /* passed */
  --muted-faint: #c2c7d0;       /* faint grey: a placeholder dash, a rule not run */
  --range-band: #eef4fc;        /* a selected or pending row's band */

  /* --- Elevation --- */
  --backdrop: rgba(0, 0, 0, 0.3);
  --shadow-menu: 0 6px 20px rgba(20, 24, 33, 0.14);
  --shadow-dialog: 0 14px 48px rgba(20, 24, 33, 0.28);
  --shadow-tooltip: 0 6px 18px rgba(0, 0, 0, 0.20);
  /* The styleguide's close/cancel icon as a mask (paint it with a background
     color): the clear cross of every search input uses it. */
  --icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
  /* Filter: a soft funnel (rounded corners and stem); Clear filter: a circle with a diagonal line (mask
     images, painted currentColor). */
  --icon-filter: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 4h15a1 1 0 0 1 .78 1.63L14 13.5V19a1 1 0 0 1-.55.9l-2 1A1 1 0 0 1 10 20v-6.5L3.72 5.63A1 1 0 0 1 4.5 4z'/%3E%3C/svg%3E");
  --icon-filter-clear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cline x1='18.4' y1='5.6' x2='5.6' y2='18.4'/%3E%3C/svg%3E");
  --tooltip-bg: #4a4f57;
  --tooltip-width: 320px; /* tooltips are uniformly wide — set the block width, not just a cap */

  /* --- Typography --- */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --lh: 1.45;

  /* THE type scale: FOUR sizes only (uniformized 2026-07-18) — 18 titles,
     14 headings+body, 12 all secondary text, 10 all chip/badge-tier text.
     The seven token names remain (too many call sites to rename) but they
     collapse onto the four values: h2 joins body, sm joins meta, micro
     joins nano. Pick by SEMANTICS; the value follows. */
  --fs-h1: 18px;   /* page title / login heading */
  --fs-h2: 14px;   /* card / section / dialog heading (one step above body, semibold) */
  --fs-body: 12px; /* body copy, inputs, the platform default */
  --fs-sm: 12px;   /* buttons, labels, status, nav, row titles */
  --fs-meta: 12px; /* secondary detail, counts, subtitles */
  --fs-micro: 10px;/* chips, badges, pills, table headers, file dates */
  --fs-nano: 10px; /* sidebar/tiny section labels */

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* --- Spacing (4/6/8/12/16/20/24/32) --- */
  --sp-1: 4px;  --sp-2: 6px;  --sp-3: 8px;  --sp-4: 12px;
  --sp-5: 16px; --sp-6: 20px; --sp-7: 24px; --sp-8: 32px;
  /* The one space between cards, side by side in a grid and stacked. */
  --card-gap: var(--sp-6);
  /* The one space between a page's tab bar and the first card below it. */
  --tabs-gap: var(--sp-6);
  /* A card introduction's width: half a full-width card, never under 420px
     (all of a narrow card). */
  --card-sub-max: max(50%, min(100%, 420px));
  /* The one space from a card introduction to the content under it (the
     selector row, a toolbar, a table). Every intro, in and outside a .card,
     reads it. */
  --card-sub-below: var(--sp-8);
  /* The one space from a card's selector row (its filters, search, toggles)
     to the content under it: the same as above the row. */
  --card-filters-below: var(--card-sub-below);
  /* A card introduction's type: the soft look of the object page's Conversion
     plan card. Every intro (.card-sub, .dc-card-sub) reads these two. */
  --card-sub-fs: var(--fs-sm);
  --card-sub-color: var(--muted);
  /* A settings row's control column: the right two thirds of the row. */
  --set-control-w: 66.667%;

  /* --- Radii --- */
  --r-sm: 4px;     /* inputs, buttons, icon-button hover pill */
  --r-md: 6px;     /* nav links, menus, lanes/sub-cards, tooltips */
  --r-lg: 8px;     /* cards, dialogs, collapsible sections */
  --r-pill: 999px; /* pills, dots, accent bars */

  /* --- Structure --- */
  --sidebar-w: 200px;
  --header-h: 50px; /* the app shell's top bar, bottom border included (sidebar.css) */
  --content-max: 720px;
  --content-max-wide: 1100px;
  /* Scroll-past room under every page's last block, so the last section can
     be scrolled up into the middle of the viewport (the project overview's
     runway, on every route). */
  --page-pad-bottom: 50vh;

  --t-fast: 0.12s;

  /* --- Scrollbars (IN126): one bar for every scrollable element, see 2. --- */
  --scrollbar-thumb: var(--border-hover);  /* resting thumb */
  --scrollbar-thumb-hover: var(--muted);   /* hovered or dragged thumb */
  --scrollbar-track: transparent;          /* the track shows the surface */
}

/* 2. RESET / BASE ========================================================== */
*, *::before, *::after { box-sizing: border-box; }

/* One scrollbar for every scrollable element (IN126). On `*`, not :root,
   because scrollbar-width does not inherit. A bar hidden on purpose (the
   overlay scrollbars in sidebar.css, the data viewer's tab strip) sets
   `scrollbar-width: none` at higher specificity; no other sheet sets its own
   bar (tests/frontend/scrollbar-convention.test.js). */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }
/* Fallback for engines without scrollbar-color (Safari). Kept behind
   @supports because Chromium ignores every ::-webkit-scrollbar rule on an
   element that carries a standard scrollbar property anyway. */
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: var(--scrollbar-track); }
  ::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb); border-radius: var(--r-pill);
    border: 2px solid transparent; background-clip: padding-box;
  }
  ::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-thumb-hover); }
  ::-webkit-scrollbar-corner { background: transparent; }
}

/* Suppress the browser's default focus ring (the dark rounded box Chrome draws
   on buttons/links/any focusable element). Focus styling is opt-in: only the
   explicit :focus / :focus-visible rules in this stylesheet apply. */
:focus, :focus-visible { outline: none; }
::-moz-focus-inner { border: 0; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  color: var(--fg);
  background: var(--bg);
  line-height: var(--lh);
}

h1 { margin: 0; font-size: var(--fs-h1); font-weight: var(--fw-semibold); }
h2 { margin: 0 0 var(--sp-5); font-size: var(--fs-h2); font-weight: var(--fw-semibold); }
h3 { margin: 0; font-size: var(--fs-h2); font-weight: var(--fw-semibold); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* A link styled as a button is a button: no text underline on hover, whatever
   its variant. Every button class belongs here (button-link-hover.test.js). */
a:is(.btn-quiet, .btn-secondary, .btn-ghost, .btn-danger, .icon-btn, .kebab-btn):hover { text-decoration: none; }

/* The one platform monospace: code, IDs and technical keys. kbd and samp too,
   so none falls back to the browser's own monospace. */
code, pre, kbd, samp, .mono { font-family: var(--font-mono); }
/* An inline ID or technical key (.mono) reads medium weight in --mono-fg (the
   SAP field name's colour, a touch lighter). Zero
   specificity, so a route class sets its own colour or weight; where the
   context colours the text (a link, a button, a header, a selected or active
   row or tab, a status, error text, a badge, chip or pill) the key keeps that
   colour. Code blocks (pre), inline code and the data grid are not .mono and
   stay as they are. .mono is the READ-ONLY display of a value: a field typed
   into never renders mono (see the form controls, section 4). */
:where(.mono) { color: var(--mono-fg); font-weight: var(--fw-medium); font-size: var(--fs-micro); }
/* An inline value (a span) sits in a very soft box, the hint that it is a
   code value: the --surface-hover tint (--mono-fg on it 5.0:1), no border,
   the small radius, a hair of padding. Inline, so it never grows a row; clone
   keeps the box on each line of a wrapped value. A block or cell carrying
   .mono (li, p, td) takes the font and colour only. */
:where(span.mono) {
  background: var(--surface-hover); border-radius: var(--r-sm); padding: 1px var(--sp-1);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
:where(a, button, th, h1, h2, h3, h4, .status, .text-ok, .text-err, .callout.err, .toast,
  .tab, .is-active, .is-selected, [aria-selected="true"], [aria-current],
  [class*="badge"], [class*="chip"], [class*="pill"]) :where(.mono),
:where(a, button, th, h1, h2, h3, h4):where(.mono) { color: inherit; }
/* In a badge, chip or pill the value is already in a box: no second one. */
:where([class*="badge"], [class*="chip"], [class*="pill"]) :where(span.mono) { background: none; padding: 0; }

/* "Eyebrow": a quiet small label — muted, semibold, SENTENCE CASE (no uppercase,
   no tracking, per feedback). Shared by table headers, sidebar section labels,
   lane headings, menu headings, dialog sub-headings — all kept consistent. */
.eyebrow {
  font-size: var(--fs-micro);
  color: var(--muted);
  font-weight: var(--fw-semibold);
}

/* Canonical list-row title. Lighter than a card heading — per feedback the
   object rows should match this rules-row weight, NOT a bold 14/600. */
.row-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
  color: var(--fg);
  letter-spacing: -0.005em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 3. LAYOUT ================================================================ */
/* Fixed-viewport shell (sidebar.js): only <main> scrolls; header + sidebar fixed. */
body.app-shell { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
body.app-shell header { flex: 0 0 auto; position: relative; z-index: 50; }
body.app-shell .shell { flex: 1 1 auto; min-height: 0; align-items: stretch; overflow: hidden; }
body.app-shell main { overflow-y: auto; min-height: 0; }

header {
  padding: 10px var(--sp-8); /* 18px→10px, ~20% shorter (sidebar.css overrides this in the shell — keep the two in sync) */
  border-bottom: 1px solid var(--border);
  background: var(--card);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-7);
}
header .sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
header .brand { display: flex; align-items: center; gap: var(--sp-4); }
header .brand .brand-logo { width: auto; display: block; }
header .brand .brand-sub {
  font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--muted);
  padding-left: var(--sp-4); border-left: 1px solid var(--border); white-space: nowrap;
}

.shell { display: flex; align-items: flex-start; }
/* <main> is the app's scroller (sidebar.css), so its bottom padding is inside
   the scroll area: every route gets the same runway; a route sheet sets no
   #appRoot bottom padding of its own. */
main { flex: 1; min-width: 0; padding: var(--sp-7) var(--sp-7) var(--page-pad-bottom); }
main > * { max-width: var(--content-max); margin-left: auto; margin-right: auto; }
main.wide > * { max-width: var(--content-max-wide); }
/* The Settings column as a shared opt-in (D11): a page wraps its cards in one
   div.page-column, a 720px column that starts at the shared 1100px content
   span, the x the header breadcrumb sits at. The declarations are
   routes/settings.css's `#appRoot > *` unchanged; the five route sheets keep
   their copies. A page-level <dialog> stays outside the wrapper so its
   top-layer centering is untouched. (0,1,1) out-ranks `main > *`. */
main > .page-column {
  max-width: 720px;
  margin-left: max(0px, calc((100% - 1100px) / 2));
  margin-right: 0;
}
/* The page title above the cards: a bare shared h1 (and any lead line under
   it), copied unchanged from routes/project-settings.css. */
.ps-page-head { margin: 0 0 12px; }

/* Breadcrumb page title — the <h1> the router renders into the page <header>
   (it replaced the header tab bar and wears its styling): pill-shaped
   segments, <project> / <etl> / <page>, with the current page in accent.
   Centered in the header via the `header .page-crumb` context rule so the
   styleguide specimen can render it inline. */
.page-crumb h1 {
  display: flex; align-items: center; gap: 2px;
  font-size: var(--fs-sm); font-weight: var(--fw-regular); min-width: 0;
}
/* In the header the crumb bar mirrors the content column's geometry — it spans
   the area above `main` (200px sidebar + main's side padding) and centers a
   box of the content max-width inside it, so the first pill's left edge lines
   up with the content cards below. The wrapper is click-transparent. */
header .page-crumb {
  position: absolute; top: 50%; transform: translateY(-50%);
  left: calc(var(--sidebar-w) + var(--sp-7)); right: calc(var(--sp-7) + var(--chat-w, 0px));
  display: flex; justify-content: center;
  pointer-events: none;
  transition: right 160ms ease;
}
header .page-crumb h1 {
  width: 100%; max-width: 1100px; /* the shared content width (routes/objects.css) */
  justify-content: flex-start;
  pointer-events: auto;
}
/* On quality the environment label (.env-badge, injected by sidebar.js) hangs
   from the header's top edge as a tab, centred over the content column (the
   span between the sidebar and the chat panel that the crumb also measures
   from). Absolute, so the header keeps its height and the crumb its plain look
   and place; the crumb sits on the header's middle. The tab is a fixed 72px
   by 20px, so it reaches lower than the crumb pill's top: it is drawn ON the
   crumb (stacked above the crumb bar and the cog slot) and lets clicks
   through, so a long crumb runs underneath with every segment clickable. */
header > .env-badge-top {
  position: absolute; top: 0; z-index: 2;
  left: calc((var(--sidebar-w) + 100% - var(--chat-w, 0px)) / 2);
  transform: translateX(-50%);
  width: 72px; margin: 0; padding: var(--sp-1) 0; line-height: 1.2; text-align: center;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  pointer-events: none;
  transition: left 160ms ease;
}
/* Pull the first pill's padding out of the line so its TEXT (not its hover
   pill) sits flush with the content boxes' left border. */
header .page-crumb h1 > :first-child { margin-left: -8px; }

.page-crumb .crumb-ctx, .page-crumb .crumb-cur {
  display: inline-flex; align-items: center;
  padding: 4px 8px; border-radius: 6px; /* the old header tab-button chrome, half the padding */
  color: var(--fg); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 40ch;
}
a.crumb-ctx:hover, a.crumb-ctx:focus-visible {
  background: #f3f4f6; color: var(--fg); text-decoration: none; outline: none;
}
.page-crumb .crumb-cur { font-weight: var(--fw-semibold); color: var(--accent); }
/* The page's open tab as the last segment: it takes the accent and the page
   leaf before it reads as context. */
.page-crumb h1:has(.crumb-tab) .crumb-cur:not(.crumb-tab) { color: var(--fg); }
/* The leaf's page toggle (Objects ⇄ Rules): the whole current-page pill is a
   <button> that swaps straight to its sibling page on click. */
.page-crumb button.crumb-cur {
  background: transparent; border: 0; font: inherit; cursor: pointer;
}
.page-crumb button.crumb-cur:hover:not(:disabled) { filter: none; background: #f3f4f6; }
.page-crumb .crumb-swap { width: 12px; height: 12px; margin-left: var(--sp-2); flex: 0 0 auto; opacity: 0.7; }
/* Onward navigation hints after the leaf (e.g. Objects / Rules on the cycle
   overview) — grey filled pills, borderless, darkening on hover. */
.page-crumb .crumb-hint {
  background: #f3f4f6; border: 0; color: var(--muted);
  margin-left: var(--sp-2);
}
/* Extra breathing room between the breadcrumb and the first onward hint. */
.page-crumb :not(.crumb-hint) + .crumb-hint { margin-left: var(--sp-5); }
a.crumb-hint:hover, a.crumb-hint:focus-visible { background: #e8eaee; color: var(--fg); }
/* The ETL segment's quiet ETLnn prefix — when a cycle has a description the
   description reads as the segment's name and the number drops to this
   secondary label (same size, muted + regular weight). */
.page-crumb .crumb-desc { color: var(--muted); font-weight: var(--fw-regular); margin-right: var(--sp-1); }
.page-crumb .crumb-cur .crumb-desc { color: inherit; opacity: 0.55; }
.page-crumb .crumb-sep { color: var(--muted); opacity: 0.45; user-select: none; }

/* Project Settings shortcut in the header, at the breadcrumb's height. It
   borrows the crumb-link chrome (pill, --fs-sm) but a muted tone, a leading cog,
   and its isolated position mark it as a control set apart from the breadcrumb
   nav, not a crumb segment. Appearance is header-independent so the styleguide
   can show it inline; only the positioning below is header-scoped. */
.header-settings {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 4px 8px; border-radius: 6px;
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  color: var(--muted); white-space: nowrap; cursor: pointer; text-decoration: none;
}
.header-settings:hover, .header-settings:focus-visible {
  background: #f3f4f6; color: var(--fg); text-decoration: none; outline: none;
}
.header-settings svg { width: 14px; height: 14px; flex: 0 0 auto; }
.header-settings[hidden] { display: none; }
/* Pinned to the RIGHT EDGE OF THE CONTENT COLUMN (where the page cards end), not
   the far edge of the header. The slot mirrors the breadcrumb's geometry — it
   spans the area above `main` and centers a box of the shared content width — so
   the cog rides that box's right edge. Slot + box are click-transparent (the
   crumb sits behind them); only the cog anchor takes pointer events. */
header .header-settings-slot {
  position: absolute; top: 50%; transform: translateY(-50%);
  left: calc(var(--sidebar-w) + var(--sp-7)); right: calc(var(--sp-7) + var(--chat-w, 0px));
  display: flex; justify-content: center;
  pointer-events: none; z-index: 1;
  transition: right 160ms ease;
}
header .header-settings-box {
  width: 100%; max-width: 1100px; /* the shared content width (routes/*.css) */
  display: flex; justify-content: flex-end;
  pointer-events: none;
}
header .header-settings-box > .header-settings { pointer-events: auto; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-5); margin-bottom: var(--card-gap);
}
.card h2 { margin: 0 0 var(--sp-3); }
/* The introduction under a card title: at most half of a full-width card, so it
   reads as a short subtitle, never under 420px so a narrow card keeps a usable
   line. The title's bottom margin is the space above it; it adds none, and
   says so: a <p> intro otherwise keeps the browser's 1em top margin. */
.card .card-sub { color: var(--card-sub-color); font-size: var(--card-sub-fs); margin-top: 0; margin-bottom: var(--card-sub-below); max-width: var(--card-sub-max); }
/* A hint or note (<p class="hint">): secondary text, 12px muted at regular weight. */
.hint { color: var(--muted); font-size: var(--fs-meta); font-weight: var(--fw-regular); }

/* Settings rows (.set-group): the title on the left of the head row, its
   control in the right column (.set-head-control), and the help text
   (.set-group-sub) and the status line below the control in that same column,
   never across the row. A row without a head control keeps its help text full
   width. The route sheets keep the rest of the row (dividers, type, inputs). */
.set-group-head .set-head-control { margin-left: auto; flex: 0 0 var(--set-control-w); }
.set-group:has(> .set-group-head > .set-head-control) .set-group-sub,
.set-group:has(> .set-group-head > .set-head-control) > .status { margin-left: auto; max-width: var(--set-control-w); }

/* Group title: an h2.seg-title above a run of cards or stats titles the group
   (the Usage page's Script runs / LLM usage bands, the styleguide's sections);
   the cards under it keep their own card-head titles. */
.seg-title { margin: 0 0 var(--sp-4); font-size: var(--fs-h2); font-weight: var(--fw-semibold); }

/* Card / section header with an optional trailing action (an add or upload
   button). The title sits at its natural position and defines the row height;
   the action is taken out of flow and vertically centered on the title, so its
   presence (or a taller button) never pushes the title down. */
.card-head {
  position: relative;
  margin: 0 0 var(--sp-3);
}
.card-head > h2, .card-head > h3, .card-head > h4 { margin: 0; }
.card-head > button, .card-head > .card-head-action {
  position: absolute; top: 50%; right: 0; transform: translateY(-50%);
}
.card-head > button[hidden], .card-head > .card-head-action[hidden] { display: none !important; }
/* Help for a card: an inline "Learn more" at the end of its intro text
   (.card-sub), opening the help chapter (help.html#<chapter>) in a new tab.
   The card head carries no help icon. */
/* "Learn more" never underlines: it rests in the softer --link-soft (5.3:1 on
   --card) and on hover or focus takes the full --accent (5.0:1); keyboard
   focus keeps the accent ring. */
.help-more { color: var(--link-soft); text-decoration: none; white-space: nowrap; }
.help-more:hover, .help-more:focus { text-decoration: none; }
.help-more:hover, .help-more:focus-visible { color: var(--accent); }
.help-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

/* Lane / sub-card: a lighter card used inside a card (workspace lanes). Square
   any edge that fuses to a sibling control (e.g. the run-bar below). */
.lane {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3);
}
.lane > h4, .lane-head h4 {
  margin: 0; font-size: var(--fs-meta); font-weight: var(--fw-semibold); color: var(--muted);
}
/* Lane heading row: label fills it; a trailing quiet "+" sits at the right edge. */
.lane-head { display: flex; align-items: center; gap: var(--sp-3); }
.lane-head h4 { flex: 1 1 auto; min-width: 0; }

/* Tab strip — an underlined row of view tabs sitting on a hairline, the active
   one underlined in accent over the line. Canonical since 2026-07-21 (was the
   duplicated .eov-tab / .od-tab / .ps-tab); the cycle overview, object page and
   project settings all render `<div class="tabs" role="tablist"> <button
   class="tab">…`. A page toggles the active tab with `.classList.toggle("is-active")`. */
.tabs {
  display: flex; align-items: flex-end; gap: var(--sp-2);
  border-bottom: 1px solid var(--border); margin: 0 0 var(--tabs-gap);
}
.tab {
  appearance: none; background: transparent; border: 0; cursor: pointer;
  font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium);
  color: var(--muted); padding: var(--sp-3) 14px; text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  /* Match the base `button` radius so the active accent underline curls the same
     way whether the tab is a <button> (in-page tabs) or an <a> (settings subnav,
     which carries no button radius of its own) — keeps both renders identical. */
  border-radius: var(--r-sm);
}
/* text-decoration stays off on hover too — the tab may be an <a> (settings
   subnav), which the base `a:hover` would otherwise underline. */
.tab:hover { color: var(--fg); text-decoration: none; }
.tab.is-active { color: var(--fg); border-bottom-color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r-sm); }
/* Set apart at the right end of the strip: a regular .tab in a lighter weight,
   or a kebab menu (.menu-wrap.tabs-aside) holding the views that are not the
   page's own (the Audit trail on the project, cycle and object pages). The
   kebab centres on the tabs' text line rather than sitting on the hairline. */
.tabs > .tabs-aside { margin-left: auto; }
.tab.tabs-aside { font-weight: var(--fw-regular); white-space: nowrap; }
.tabs > .menu-wrap { align-self: center; }

/* Empty-state hint — the shared "nothing here yet" placeholder: the column
   profile placeholder's grammar promoted to one component. A quiet centred
   card: optional sequence chip, icon (stroke 1.4, one glyph per location),
   short title, one-line sub and at most one CTA (the quiet accent button,
   contributor-gated by the host). Borderless by default; `.drop` adds the
   dashed outline, which means "drop files here", so a host sets it only
   where this user can drop files on the hint (the source and load lanes, for
   a contributor). Built by ws-panel's buildWsHint
   and the rules pages' tier empty states. */
.ws-hint {
  border: 0; border-radius: var(--r-md); background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; padding: 34px 24px; min-height: 170px;
  color: var(--muted);
}
.ws-hint.drop { border: 1px dashed var(--border); }
/* display: flex above would beat the hidden attribute: a host toggles the
   placeholder with `hidden` (an empty list), so keep it hidden. */
.ws-hint[hidden] { display: none; }
.ws-hint .ws-hint-ic { width: 32px; height: 32px; color: #b9bdc6; flex: 0 0 auto; }
.ws-hint-title { font-size: var(--fs-body); font-weight: var(--fw-medium); color: #808795; }
.ws-hint-sub { font-size: var(--fs-sm); max-width: 46ch; margin: 0; line-height: 1.5; }
.ws-hint-step {
  font-size: var(--fs-micro); letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: var(--fw-semibold); color: #9aa1ad; margin-bottom: -2px;
}
.ws-hint > .ws-hint-cta { margin-top: 2px; }
/* .compact: the placeholder in a slim side card (the object page's Column
   profile card): a smaller icon, title and sub. */
.ws-hint.compact { padding: 26px 16px; min-height: 150px; }
.ws-hint.compact .ws-hint-ic { width: 26px; height: 26px; }
.ws-hint.compact .ws-hint-title { font-size: var(--fs-sm); }
.ws-hint.compact .ws-hint-sub { font-size: var(--fs-micro); max-width: 26ch; }

/* "Not applicable this cycle" marker bar (H53 STAGE 2). A compact, content-
   width, left-aligned bar shown wherever a stage is out of scope for the cycle:
   the object page's rule tabs (above the rule list) and the source-data lane.
   Unlike .ws-hint it never fills its container, so it reads as an inline marker
   over the content that follows. The bar itself mimics the stage strip's n/a
   cell (a dashed outline over a bare background) so the marker and the strip read
   as one "not applicable" state; the icon is just the n/a stage glyph, a
   horizontal dash. */
.scope-na-bar {
  display: flex; width: fit-content; max-width: 100%;
  align-items: center; gap: 10px;
  /* A clear, symmetric break above and below the marker: two card paddings
     (2 x --sp-5 = 32px) on each side. */
  margin: calc(var(--sp-5) * 2) 0;
  padding: 8px 12px;
  border: 1px dashed var(--border); border-radius: var(--r-md);
  background: transparent; color: var(--muted);
}
.scope-na-ico {
  /* Just the horizontal dash (the na stage glyph), no cell around it. Kept as
     soft as the bar's dashed edges (same tone as the border), with extra room on
     each side so the dash sits clear of the bar edge and the text. */
  flex: 0 0 auto; margin: 0 6px;
  color: var(--border); font-size: 20px; line-height: 1;
}
.scope-na-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.scope-na-title { font-size: var(--fs-body); font-weight: var(--fw-medium); color: #808795; }
.scope-na-sub { font-size: var(--fs-sm); color: var(--muted); }

#sidebarHost { flex: 0 0 var(--sidebar-w); align-self: stretch; min-height: 0; }

/* --- Docked side panel -------------------------------------------------- *
   A panel that docks to the right of the shell and slides open/shut rather
   than mounting and unmounting (K3, the assistant). `.side-panel` owns the
   open/collapse mechanics, the edge rail tab and the close chevron, and the
   narrow-viewport overlay; a consumer supplies its own content and drives
   --panel-w / --panel-open-w (each default to 380px) from whatever governs
   its own layout (chat-panel.css bridges these off the body-level --chat-w /
   --chat-open-w the shell also reads to inset the header, see there). Tokens
   only, no colours of its own, so a second docked panel reuses the same
   chrome instead of defining it again. Promoted from chat-panel.css once the
   assistant panel shipped (K3, 2026-09-23): it had no owner here before that,
   deliberately, on the grounds that promoting unproven chrome into a
   load-bearing file was a bet not worth making until the panel survived. */
.side-panel {
  flex: 0 0 var(--panel-w, 380px);
  min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  position: relative;
  background: var(--bg);
  font-size: var(--fs-sm);
  color: var(--fg);
  transition: flex-basis 160ms ease;
  overflow: hidden;
}
.side-panel.is-collapsed { flex-basis: var(--panel-w, 40px); }

/* The panel opens by sliding in, not by growing: a flex child only stretches
   to the column while its cross size is auto, so pinning the contents to the
   open width at every frame is what stops them re-wrapping as the column
   animates. Once fully closed they are hidden (not just clipped), which is
   what takes them out of the tab order and off a screen reader; `is-closing`
   is the length of the slide (put on and taken off by the consumer), so the
   contents ride the column out instead of vanishing on the first frame. */
.side-panel > :not(.side-panel-rail) { width: var(--panel-open-w, 380px); }
.side-panel.is-collapsed:not(.is-closing) > :not(.side-panel-rail) { visibility: hidden; }

/* The lip: one control that opens and closes the panel. Shut, it sits on the
   WINDOW's right edge; open, it moves in to --panel-lip-open-right (the
   consumer's own landmark, the chat's input box). Its height is
   --panel-lip-bottom from the window's floor, the middle of the window when a
   consumer sets none. Fixed rather than a flex child: closed there is no
   column to sit in. It is the same element in both states and only its icon
   changes (the consumer swaps it, with its tooltip and aria-expanded). */
.side-panel-rail {
  position: fixed;
  bottom: var(--panel-lip-bottom, 50%);
  transform: translateY(50%);
  width: 24px; height: 44px;
  padding: 0;
  cursor: pointer;
  align-items: center; justify-content: center;
  right: 0;
  z-index: 40;
}
.side-panel:not(.is-collapsed) .side-panel-rail { right: var(--panel-lip-open-right, 0); }
/* Edged on three sides, rounded on the left and square against the window's
   edge, so it reads as a handle of the panel behind that edge, and on screen
   in every state. Written on `.side-panel .side-panel-rail` because
   `.icon-btn`, further down this file at the same one-class specificity,
   would otherwise put back its all-round radius, its transparent border and
   its inline-flex display. */
.side-panel .side-panel-rail {
  display: flex;
  background: var(--card);
  border: 1px solid var(--border); border-right: 0;
  border-radius: var(--r-md) 0 0 var(--r-md);
}
/* Open, the lip sits inside the panel: just the chevron on its background. */
.side-panel:not(.is-collapsed) .side-panel-rail { background: transparent; border-color: transparent; }

/* Below a narrow viewport a docked column leaves the content nothing to live
   in, so the panel overlays it instead of squeezing it: parked off the right
   edge when shut, flush with it when open, positioned in both states or a
   close would have nothing to animate from. A transform is avoided because it
   would make the panel the containing block for the two fixed controls and
   carry them off screen with it. A consumer still decides whether it docks
   at all below this width (chat-panel.css zeroes the body-level width var
   here so the shell stops squeezing for it). */
@media (max-width: 900px) {
  .side-panel {
    position: fixed;
    top: 0; bottom: 0;
    right: calc(-1 * var(--panel-open-w, 380px));
    width: min(380px, 100vw);
    z-index: 40;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
    transition: right 160ms ease;
  }
  .side-panel:not(.is-collapsed) { right: 0; }
}

/* 4. FORMS ================================================================= */
/* Muted label color adopted from the live SPA (review 2026-06-12) — the SPA's
   quiet form labels are canonical; data, not chrome, carries the contrast. */
label {
  display: block; font-size: var(--fs-sm); font-weight: var(--fw-medium);
  color: var(--muted); margin-bottom: var(--sp-2);
}
/* A field label reads like a table header (the `th` size and weight), as the
   filter bar's do. A label wrapping a checkbox or radio is an option, not a
   field title, and keeps the size above; :where() holds this at element
   weight, so a route sheet's own label rule still wins. */
label:where(:not(:has(> input[type="checkbox"], > input[type="radio"]))) {
  font-size: var(--fs-micro); font-weight: var(--fw-semibold);
}
/* Inside a label the hint keeps the label's size (inherit beats the bare .hint 12px). */
label .hint { font-size: inherit; font-weight: var(--fw-regular); color: var(--muted); }
label .req  { color: var(--err); font-weight: var(--fw-bold); }

/* `input:where([type="date"])` keeps date at ELEMENT-level specificity (0,0,1);
   the other listed types sit at (0,1,1) via their attribute selector. That
   matters because a date input must carry type="date", so a naive
   `input[type="date"]` (0,1,1) would outrank the app's quiet/inline date
   controls (.eov-hero-date, .od-date, .eo-dates-input — all class-styled at
   (0,1,0)) and force a box onto them. At element level, those deliberate
   deviations win; only a bare, unstyled date field falls back to this box.
   The app's own date and month fields are text inputs enhanced by
   components/date-picker.js; this box is the fallback for a bare one. */
input[type="text"], input[type="number"], input[type="email"],
input[type="password"], input[type="search"], input:where([type="date"]), select, textarea {
  width: 100%; padding: var(--sp-3) 10px; font-size: var(--fs-sm); font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: #fff; color: var(--fg);
  transition: border-color var(--t-fast);
}
/* Date inputs render a touch taller (the native picker box), and
   line-height: normal still left them 2px over the text field: they take the
   text field's height outright (one line, its padding, its 1px border), at
   zero specificity so a page's own sizing wins. */
input:where([type="date"]) { height: calc(1lh + 2 * var(--sp-3) + 2px); }
/* An editable field never takes the read-only .mono look, inside a .mono
   cell or carrying .mono itself: the UI font, --fg, regular weight, so an
   editable SAP field or service reads like any other input. After the field
   rule above, whose font-family: inherit would otherwise pull the mono in. */
.mono input, .mono textarea, .mono select, input.mono, textarea.mono, select.mono {
  font-family: var(--font-sans); color: var(--fg); font-weight: var(--fw-regular);
}
/* The native calendar button reads as an icon-btn: muted until the field is
   hovered or focused, a pointer over it. Zero specificity, so the quiet inline
   dates that hide it (.eov-hero-date, .od-date) keep doing so. */
input:where([type="date"])::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: 0.55; transition: opacity var(--t-fast);
}
input:where([type="date"]):where(:hover, :focus)::-webkit-calendar-picker-indicator { opacity: 1; }
input:where([type="date"]):disabled::-webkit-calendar-picker-indicator { cursor: not-allowed; opacity: 0.35; }
/* Hover nudges the border to --border-hover (a subtle step up from --border,
   not the strong --muted), but at deliberately LOW specificity (:where() adds
   none, so this stays element-level): any page that gives an input its own
   hover treatment — the ETL overview's quiet inline dates (.eov-hero-date),
   click-to-edit fields — keeps winning. The :where(:not(.invalid)) also leaves
   an invalid field's red border on hover. */
input:hover:where(:not(:focus)):where(:not(:disabled)):where(:not(.invalid)),
select:hover:where(:not(:focus)):where(:not(:disabled)),
textarea:hover:where(:not(:focus)):where(:not(:disabled)) { border-color: var(--border-hover); }
/* Focus mirrors hover: the same subtle --border-hover, no accent ring — the
   caret + active field already signal focus; the border just stays consistent
   with the hover step (kept at element specificity so page-level focus
   treatments still win). */
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--border-hover); }
input:disabled, select:disabled, textarea:disabled {
  background: var(--bg); color: var(--muted); cursor: not-allowed;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
/* The clear cross of a search input: the browser's own drawing is swapped for
   the styleguide close icon in icon-btn gray (fg while the field is hovered
   or focused), on every search input, not per page. Firefox draws no cross. */
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; margin-left: 4px; cursor: pointer;
  background-color: var(--muted);
  -webkit-mask: var(--icon-close) center / 100% 100% no-repeat; mask: var(--icon-close) center / 100% 100% no-repeat;
}
input[type="search"]:hover::-webkit-search-cancel-button,
input[type="search"]:focus::-webkit-search-cancel-button { background-color: var(--fg); }
input.invalid { border-color: var(--err); background: var(--err-soft-bg); }
input[type="file"] { width: 100%; font-size: var(--fs-body); padding: var(--sp-2) 0; }

/* Checkboxes -----------------------------------------------------------------
   ONE custom control for the whole app, forced here so no page sets its own
   size or colour. A small (14px) rounded box that fills with the accent when
   checked and shows a centred SVG tick (the border-rotate trick drifts the mark
   to the bottom-right corner, so the tick is a background image centred by
   background-position). The mixed state is a centred dash.

   The quiet variant (grey) is for secondary / reveal toggles that should
   recede: apply the .dm-check--quiet modifier, or use one of the shared
   reveal-row containers (.show-inactive-row, .ov-og-oos-row, .activation-inline,
   .profile-empty-check), which adopt it automatically. */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  flex: none; box-sizing: border-box;
  width: 14px; height: 14px; margin: 0; vertical-align: middle;
  border: 1.5px solid var(--border-hover); border-radius: 4px;
  background: #fff center / 12px 12px no-repeat; cursor: pointer;
  transition: background-color var(--t-fast), border-color var(--t-fast);
}
input[type="checkbox"]:checked {
  background-color: var(--accent); border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3.8 7.2 L6.1 9.5 L10.2 4.6'/%3E%3C/svg%3E");
}
input[type="checkbox"]:indeterminate {
  background-color: var(--accent); border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cline x1='4' y1='7' x2='10' y2='7' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="checkbox"]:disabled { opacity: 0.45; cursor: not-allowed; }
/* Quiet variant: the checked box drops to muted grey (the tick stays white). */
input[type="checkbox"].dm-check--quiet:checked,
input[type="checkbox"].dm-check--quiet:indeterminate,
.show-inactive-row input[type="checkbox"]:checked,
.show-inactive-row input[type="checkbox"]:indeterminate,
.ov-og-oos-row input[type="checkbox"]:checked,
.ov-og-oos-row input[type="checkbox"]:indeterminate,
.activation-inline input[type="checkbox"]:checked,
.activation-inline input[type="checkbox"]:indeterminate,
.profile-empty-check input[type="checkbox"]:checked,
.profile-empty-check input[type="checkbox"]:indeterminate {
  background-color: var(--muted); border-color: var(--muted);
}

.field { margin-bottom: var(--sp-5); }
.field:last-child { margin-bottom: 0; }
.row { display: flex; gap: var(--sp-4); align-items: center; }
.row > * { flex: 1; }
/* Side by side every field sits on one line: none keeps the stacked bottom
   margin (only the last one dropped it, which pushed it off the line). */
.row > .field { margin-bottom: 0; }

/* --- Integrated (click-to-edit) controls -------------------------------- *
   Display and edit are ONE control — no separate edit mode to toggle. Mirrors
   the rules-modal title: the value reads as plain text; hovering hints a subtle
   gray surface; focusing turns it into an edit field (blue-tinted). Put it on a
   contenteditable element; an empty one shows its data-placeholder in muted
   italic. There's no border shift, so the surrounding layout never jumps.     */
.editable {
  cursor: text; padding: 1px var(--sp-1); margin: -1px -4px;
  border-radius: var(--r-sm); outline: none; transition: background var(--t-fast);
}
.editable:hover { background: rgba(0, 0, 0, 0.05); }
.editable:focus, .editable.editing { background: rgba(59, 130, 246, 0.10); }
.editable:empty::before { content: attr(data-placeholder); color: var(--muted); font-style: italic; }

/* Edit-in-place row: a display value that swaps for an input + save/cancel
   icon buttons while editing (sidebar ETL rename, file rename). The input wears
   the click-to-edit look of .editable above (no border, the gray wash on hover,
   the blue wash while focused), so every edit in place reads one way;
   save/cancel are icon-btns tinted green/red on hover. */
.edit-row { display: inline-flex; align-items: center; gap: var(--sp-2); }
.edit-row input {
  flex: 1 1 auto; min-width: 0; padding: 3px 7px; font-size: var(--fs-sm);
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg);
  outline: none; transition: background var(--t-fast);
}
.edit-row input:hover { background: rgba(0, 0, 0, 0.05); }
.edit-row input:focus { background: rgba(59, 130, 246, 0.10); }

/* Key/value table: the Owners card's look, used wherever a card lists facts
   (the object page's Owners, Object and File cards, Data compare's run and
   system facts). A table.own-table on the `dense headerless` presets: a soft
   label column (.own-label, regular weight, --muted-soft, so the values carry
   the row) beside values that wrap. A value that can change is its own
   click-to-edit control: an input.editable for free text, a
   button.editable-pick (quiet value, chevron on hover) for a pick, an unset
   pick showing an italic .own-placeholder. Every control shares one 20px
   height, so the rows line up. A card head with a trailing kebab is .own-head. */
/* A real input as a click-to-edit control (an autocomplete can drop its
   suggestions under it): no box, the .editable washes on hover and focus.
   It sits on the text line in any table or form, not only an own-table: the
   .editable padding (input.editable at 0,1,1 comes after input[type="text"],
   so its padding wins over the form field's) and the one 20px control height. */
input.editable {
  border: 0; outline: none; width: 100%; background: transparent;
  padding: 1px var(--sp-1); height: 20px; box-sizing: border-box;
}
input.editable::placeholder { color: var(--muted); font-style: italic; }
.own-table { margin-top: var(--sp-2); }
/* Right under a card's introduction the intro's own --card-sub-below is the whole space. */
.card-sub + .own-table { margin-top: 0; }
.own-table td:not(.own-label) { white-space: normal; }
/* 140px fits "Owner NTT DATA" on one line; the label tops its row when a long
   value wraps. */
.own-table .own-label { width: 140px; font-size: var(--fs-sm); color: var(--muted-soft); font-weight: var(--fw-regular); white-space: nowrap; vertical-align: top; }
.own-table .editable { height: 20px; box-sizing: border-box; display: inline-flex; align-items: center; }
/* An input indents its text a touch further than a picker button: pulled back
   so every value starts at the same x (the -3px pull plus its 4px .editable
   padding puts the text 1px in, as before). It sizes to its content (120px
   where field-sizing is unsupported, enough for "add a name"). */
.own-table input.editable { margin-left: -3px; font-size: var(--fs-sm); width: 120px; }
@supports (field-sizing: content) {
  .own-table input.editable { width: auto; field-sizing: content; min-width: 90px; }
}
.own-head { display: flex; align-items: center; justify-content: space-between; }
.own-head .kebab-btn { margin-top: -2px; }
button.editable-pick {
  cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: 0; color: var(--fg);
  font: inherit; font-size: var(--fs-sm);
}
button.editable-pick:hover:not(:disabled) { filter: none; background: rgba(0, 0, 0, 0.05); color: var(--fg); }
.editable-pick svg { width: 12px; height: 12px; color: var(--muted); opacity: 0; transition: opacity var(--t-fast); }
.editable-pick:hover svg, .editable-pick[aria-expanded="true"] svg { opacity: 1; }
.editable-pick .own-placeholder { color: var(--muted); font-style: italic; font-weight: var(--fw-regular); }
.edit-row input.invalid { border-color: var(--err); background: var(--err-soft-bg); }

/* Inline rename (components/inline-rename.js): a name swapped for an editor in
   its own place. The input wears the click-to-edit look above (the name's own
   font, no border, the blue wash while focused) and is sized to the typed name:
   the sizer's hidden ::after holds the text (data-value) in the input's font and
   padding and sets the one grid column, which the input fills. A name wider than
   its row stops at the row and scrolls inside the input. Save / cancel sit on
   the input's right, tinted green / red on hover like .edit-row's. Scoped two
   classes deep so it outranks the base input[type="text"] box. */
.inline-rename {
  display: inline-flex; align-items: center; gap: 2px;
  min-width: 0; max-width: 100%; vertical-align: middle; cursor: default;
}
.inline-rename-grow {
  display: inline-grid; grid-template-columns: minmax(0, auto);
  flex: 0 1 auto; min-width: 0; margin: -1px 0 -1px -4px;
}
.inline-rename-grow::after {
  content: attr(data-value) " "; grid-area: 1 / 1;
  visibility: hidden; white-space: pre; overflow: hidden; height: 0;
  font: inherit; padding: 0 var(--sp-1);
}
.inline-rename .inline-rename-input {
  grid-area: 1 / 1; width: 100%; min-width: 4ch; margin: 0; padding: 1px var(--sp-1);
  font: inherit; color: var(--fg); background: transparent;
  border: 0; border-radius: var(--r-sm); outline: none; box-shadow: none;
  transition: background var(--t-fast); user-select: text; cursor: text;
}
.inline-rename .inline-rename-input:hover { background: rgba(0, 0, 0, 0.05); }
.inline-rename .inline-rename-input:focus { background: rgba(59, 130, 246, 0.10); }
.inline-rename .inline-rename-input.invalid { background: var(--err-soft-bg); box-shadow: inset 0 0 0 1px var(--err); }
.inline-rename .inline-rename-input:disabled { background: transparent; color: var(--muted); cursor: default; }
.inline-rename .icon-btn { flex: 0 0 auto; padding: 2px; }
.inline-rename .icon-btn svg { width: 14px; height: 14px; }

/* Date picker (components/date-picker.js): a text input you type a date or a
   month into ("3-11-2026", "jun 2026"), with flatpickr's calendar (or, for a
   month, its month grid: .dm-month-picker) as the popover. The field is the
   base text box, kept to a date's width. The popover is the .menu surface
   (card, hairline border, --r-md, --shadow-menu): a month and year header
   with quiet prev/next steps, then the weekdays (Monday first) and the days,
   or the twelve months in a 3 x 4 grid. Hover is the menu row's gray, the
   picked day or month the pressed .seg-pill's accent tint, today a hairline
   ring, the neighbouring months' days muted. flatpickr's own stylesheet is not
   loaded, so everything it draws is declared here; flatpickr sizes the box
   from the day grid (an inline width, hence content-box), the component
   places it (--dp-top / --dp-left) and flatpickr toggles .open. */
input:where(.date-picker) { max-width: 10rem; }
.flatpickr-calendar.dm-date-picker {
  display: none; position: fixed; z-index: 200; box-sizing: content-box;
  top: var(--dp-top, 0); left: var(--dp-left, 0); right: auto;
  width: 210px; padding: var(--sp-2); background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-menu);
  font-size: var(--fs-sm); line-height: 1.4; text-align: center; touch-action: manipulation;
}
.flatpickr-calendar.dm-date-picker.open { display: block; }
.dm-date-picker:focus { outline: none; }
.dm-date-picker .flatpickr-months { position: relative; display: flex; height: 28px; }
.dm-date-picker .flatpickr-month { position: relative; flex: 1; height: 28px; user-select: none; }
.dm-date-picker .flatpickr-current-month {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 0.5ch;
  font-weight: var(--fw-semibold);
}
.dm-date-picker .flatpickr-monthDropdown-months,
.dm-date-picker .numInputWrapper > span,
.dm-month-picker .flatpickr-current-month .cur-month { display: none; }
.dm-date-picker .numInputWrapper { display: inline-block; width: 5ch; }
/* Two classes deep so it outranks the base input[type="number"] box. */
.dm-date-picker .flatpickr-current-month input.cur-year {
  width: 100%; height: auto; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; color: var(--fg); font: inherit; text-align: left;
  appearance: textfield; -moz-appearance: textfield; cursor: text;
}
.dm-month-picker .flatpickr-current-month input.cur-year { text-align: center; }
.dm-date-picker .flatpickr-current-month input.cur-year::-webkit-inner-spin-button,
.dm-date-picker .flatpickr-current-month input.cur-year::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.dm-date-picker .flatpickr-prev-month,
.dm-date-picker .flatpickr-next-month {
  position: absolute; top: 0; z-index: 1; display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--r-sm); color: var(--muted); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.dm-date-picker .flatpickr-prev-month { left: 0; }
.dm-date-picker .flatpickr-next-month { right: 0; }
.dm-date-picker .flatpickr-prev-month:hover,
.dm-date-picker .flatpickr-next-month:hover { background: var(--surface-hover); color: var(--fg); }
.dm-date-picker .flatpickr-prev-month svg,
.dm-date-picker .flatpickr-next-month svg { width: 10px; height: 10px; fill: currentColor; }
.dm-date-picker .flatpickr-prev-month.flatpickr-disabled,
.dm-date-picker .flatpickr-next-month.flatpickr-disabled { visibility: hidden; }
.dm-date-picker .flatpickr-innerContainer,
.dm-date-picker .flatpickr-rContainer { display: block; }
/* The day grid: seven 30px columns, Monday first. */
.dm-date-picker .flatpickr-weekdays { display: flex; align-items: center; height: 24px; margin-top: var(--sp-2); }
.dm-date-picker .flatpickr-weekdaycontainer { display: flex; flex: 1; }
.dm-date-picker span.flatpickr-weekday {
  flex: 1; color: var(--muted); font-size: var(--fs-micro); font-weight: var(--fw-semibold); cursor: default;
}
.dm-date-picker .flatpickr-days { display: flex; overflow: hidden; }
.dm-date-picker .dayContainer { display: flex; flex-wrap: wrap; width: 210px; min-width: 210px; max-width: 210px; outline: none; }
.dm-date-picker .flatpickr-day {
  flex: 0 0 30px; box-sizing: border-box; width: 30px; height: 30px; line-height: 28px;
  border: 1px solid transparent; border-radius: var(--r-sm); color: var(--fg);
  cursor: pointer; user-select: none; transition: background var(--t-fast);
}
.dm-date-picker .flatpickr-day.prevMonthDay,
.dm-date-picker .flatpickr-day.nextMonthDay { color: var(--muted); }
.dm-date-picker .flatpickr-day.hidden { visibility: hidden; }
/* The month grid (kind "month"): three months a row. */
.dm-date-picker .flatpickr-monthSelect-months {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-top: var(--sp-2); outline: none;
}
.dm-date-picker .flatpickr-monthSelect-month {
  padding: var(--sp-3) 0; border: 1px solid transparent; border-radius: var(--r-sm);
  color: var(--fg); cursor: pointer; user-select: none; transition: background var(--t-fast);
}
/* Shared states of a day and a month. */
.dm-date-picker .flatpickr-day:hover, .dm-date-picker .flatpickr-day:focus,
.dm-date-picker .flatpickr-monthSelect-month:hover,
.dm-date-picker .flatpickr-monthSelect-month:focus { background: var(--surface-hover); outline: none; }
.dm-date-picker .flatpickr-day.today,
.dm-date-picker .flatpickr-monthSelect-month.today { border-color: var(--border); }
.dm-date-picker .flatpickr-day.selected, .dm-date-picker .flatpickr-day.selected:hover,
.dm-date-picker .flatpickr-monthSelect-month.selected,
.dm-date-picker .flatpickr-monthSelect-month.selected:hover {
  background: var(--accent-tint); color: var(--accent); font-weight: var(--fw-medium); border-color: transparent;
}
.dm-date-picker .flatpickr-day.flatpickr-disabled,
.dm-date-picker .flatpickr-monthSelect-month.flatpickr-disabled { opacity: 0.35; cursor: not-allowed; background: transparent; }

/* 5. BUTTONS =============================================================== */
/* Regular buttons are TEXT-ONLY (icons live on .btn-quiet below, not here).
   Adopted from the live SPA (review 2026-06-12): solid borderless accent fill,
   9px 16px footprint, and hover dims the whole fill via brightness(0.96) —
   the brightness filter is canonical for the primary button. Quiet controls
   that must NOT dim (icon buttons, menu items, link buttons, the filter bar)
   reset it with filter: none on their own hover rules. */
button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  background: var(--accent); color: #fff; border: 0;
  padding: 9px 16px; border-radius: var(--r-sm); font-size: var(--fs-sm);
  font-family: inherit; font-weight: var(--fw-medium); cursor: pointer;
}
button:hover:not(:disabled) { filter: brightness(0.96); }
button:disabled { background: var(--control-disabled); cursor: not-allowed; }

/* Two sizes, each in the filled and the quiet family (the styleguide's button
   roster): LARGE, the modal size, is the bare `button` above; its bordered
   variants (.secondary, .ghost, .btn-quiet) pad 1px less for their 1px
   border, so every large button stands the same height. COMPACT, the filter
   bar and card size, is one rule further down (button.compact,
   .btn-quiet.compact, the filter bar's buttons, a card head's labelled
   buttons), the height of a filter bar input. */
button.secondary, .btn-secondary {
  background: transparent; color: var(--accent); border: 1px solid var(--border);
}
button.secondary, button.ghost { padding: 8px 15px; }
button.secondary:hover:not(:disabled), .btn-secondary:hover:not(:disabled) {
  filter: none; background: var(--accent-icon-hover-bg); border-color: var(--accent); color: var(--accent);
}
/* A link that acts as a button. The colours above already apply to any element
   carrying .btn-secondary; an anchor gets the box here and the compact size
   from the compact rule below. Use this only where the target is a real
   destination (it keeps the href, so middle-click and cmd-click still open a
   tab); a control that acts on the page stays a <button>. */
a.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); text-decoration: none;
}
a.btn-secondary:hover { text-decoration: none; }
/* The ghost, large and compact, is the muted button: an action that steps
   back, --muted text that turns --fg on the hover wash. */
button.ghost, .btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
button.ghost:hover:not(:disabled) { filter: none; background: var(--surface-hover); border-color: var(--border); color: var(--fg); }
button.danger, .btn-danger { background: var(--err); }

/* Filter bar (usage dashboards) — adopted verbatim from the live SPA (review
   2026-06-12): a flex bar of stacked label+control pairs. The labels read
   like table headers (the `th` size, colour and weight). The bar's own
   buttons are exactly as tall as its inputs and selects (same font, vertical
   padding and 1px border, transparent on the filled one) and hover by color
   swap (no dim); the ghost variant is white with a hairline border.
   The label and input rules skip a dropdown menu's checkbox rows (a
   `label.menu-item` holding an `input[type=checkbox]`), so a .menu opened from
   the bar keeps the menu and checkbox look instead of the bar's text boxes. */
.filters { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: flex-end; }
.filters label:not(.menu-item) {
  display: flex; flex-direction: column; font-size: var(--fs-micro);
  font-weight: var(--fw-semibold); color: var(--muted); gap: var(--sp-2); margin-bottom: 0;
}
.filters input:not([type="checkbox"]), .filters select {
  /* One line plus the 4px padding and 1px border on each side: a date input
     and a select would otherwise each draw a box of their own height. */
  height: calc(1lh + 10px);
  font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-regular); padding: 4px 8px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: #fff; color: var(--fg); min-width: 130px; width: auto;
}
/* Sized by the compact button rule (with the quiet buttons below). */
.filters button {
  background: var(--accent); color: #fff; border: 1px solid transparent;
  border-radius: var(--r-sm); cursor: pointer;
}
.filters button:hover:not(:disabled) { filter: none; background: var(--accent-hover); }
.filters button.ghost { background: #fff; color: var(--muted); border: 1px solid var(--border); }
.filters button.ghost:hover:not(:disabled) { filter: none; background: var(--surface-hover); color: var(--fg); }
/* An inline segmented control in the bar: its buttons fit inside the .seg's
   1px border, so the strip stands as tall as the inputs. A quiet checkbox
   (label.filters-check) sits beside its text on the inputs' line. Filters
   apply as they change: the bar carries no Apply or Reset. */
.filters .seg > button.seg-btn { height: calc(1lh + 8px); }
.filters label.filters-check { flex-direction: row; align-items: center; gap: var(--sp-2); height: calc(1lh + 10px);
  font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--fg); }
/* Larger bar (.filters.filters--lg): the object page's Source data search box
   (#odWsCard .ws-ptier-search) for every control: 12px text at line-height
   1.45, 6px 8px padding, a 220px search that may shrink to 180px. The
   segmented control and quiet checkbox grow to the same height. */
.filters.filters--lg input:not([type="checkbox"]), .filters.filters--lg select {
  line-height: 1.45; height: calc(1lh + 14px); padding: 6px 8px;
}
.filters.filters--lg label:has(> input[type="search"]) { flex: 0 1 220px; min-width: 180px; }
.filters.filters--lg label > input[type="search"] { width: 100%; min-width: 0; }
.filters.filters--lg > input[type="search"] { flex: 0 1 220px; min-width: 180px; }
.filters.filters--lg .seg > button.seg-btn { line-height: 1.45; height: calc(1lh + 12px); }
/* A dropdown trigger (ghost button + caret opening a .menu) stands as tall. */
.filters.filters--lg button.ghost { display: inline-flex; align-items: center; gap: var(--sp-2);
  line-height: 1.45; height: calc(1lh + 14px); padding: 6px 8px; font-size: var(--fs-sm); }
.filters.filters--lg label.filters-check { line-height: 1.45; height: calc(1lh + 14px); }

/* --- Icon buttons -------------------------------------------------------- *
   THE rule (per feedback): an icon button is BORDERLESS at rest. On hover it
   gets a touch of color + a subtle background + a subtle border. The border is
   reserved as transparent at rest (so revealing it on hover causes no 1px
   layout jump) and simply colored in on hover — matching the objects-page "⋯".
   Variants only change the hover color/wash/border color.                    */
.icon-btn, .add-btn, .kebab-btn {
  background: transparent; color: var(--muted);
  border: 1px solid transparent; /* reserved; invisible until hover */
  padding: var(--sp-1) var(--sp-2); cursor: pointer; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
/* A held-off icon button (aria-disabled="true", which keeps its tip) never
   hovers: every icon-button hover skips it as it skips :disabled. */
.icon-btn:hover:not(:disabled, [aria-disabled="true"]) {
  filter: none; background: var(--surface-hover); color: var(--fg); border-color: var(--border);
}
/* Kebab "more" trigger — adopted from the live object-row obj-more: hover/open
   hovers (and stays while its menu is open) like every icon button. */
.kebab-btn:hover:not(:disabled, [aria-disabled="true"]),
.kebab-btn[aria-expanded="true"] {
  filter: none; background: var(--surface-hover); color: var(--fg); border-color: var(--border);
}
/* Fixed footprint (matches the live obj-more) so the kebab never makes a list
   row taller than its disclosure chevron / pills. */
.kebab-btn { width: 30px; height: 22px; padding: 0; }
.kebab-btn svg { width: 18px; height: 18px; }
/* Every icon button hovers alike (owner's decision): the grey wash, the
   reserved border coloured in and the fg icon, whatever its intent (add,
   delete, an edit flow's save and cancel). */
.icon-btn.accent:hover:not(:disabled, [aria-disabled="true"]),
.add-btn:hover:not(:disabled, [aria-disabled="true"]),
.add-btn[aria-expanded="true"] {
  filter: none; background: var(--surface-hover); color: var(--fg); border-color: var(--border);
}
/* Destructive intent: transparent at rest (no background, no border) and
   hovering like every icon button. (Text deletes, the danger menu items, keep
   the pale pink hover; see below.) The explicit rest rule is required because the shared `.danger` class also matches
   the filled `button.danger` rule, whose (0,1,1) specificity would otherwise
   paint a solid red fill + border here; `.icon-btn.danger` (0,2,0) overrides it
   back. */
.icon-btn.danger, .btn-quiet.danger { background: transparent; border-color: transparent; }
.icon-btn.danger:hover:not(:disabled, [aria-disabled="true"]) { filter: none; background: var(--surface-hover); color: var(--fg); border-color: var(--border); }
.icon-btn svg, .add-btn svg, .kebab-btn svg { width: 16px; height: 16px; display: block; }
.icon-btn:disabled, .add-btn:disabled, .kebab-btn:disabled,
.icon-btn:disabled:hover,
.icon-btn[aria-disabled="true"], .add-btn[aria-disabled="true"], .kebab-btn[aria-disabled="true"],
.icon-btn[aria-disabled="true"]:hover, .add-btn[aria-disabled="true"]:hover, .kebab-btn[aria-disabled="true"]:hover { background: transparent; border-color: transparent; opacity: 0.4; cursor: not-allowed; }
/* The small icon button rides inline beside a label or a pill (the rules
   dialog's re-author and suggest buttons): a 22px box, a 13px glyph. */
.icon-btn.sm { width: 22px; height: 22px; padding: 0; }
.icon-btn.sm svg { width: 13px; height: 13px; }
/* .spinning: a refresh at work. The glyph turns; held disabled, it fades
   less than a plain disabled button and shows the progress cursor. */
.icon-btn.spinning svg { animation: spin 1s linear infinite; }
.icon-btn.spinning:disabled { opacity: 0.6; cursor: progress; }

/* The "+" add control renders a glyph; size it down a touch. */
.add-btn { font-size: var(--fs-h1); line-height: 1; }
.add-btn svg { width: 13px; height: 13px; }

/* --- Quiet icon+text button --------------------------------------------- *
   A labelled action that is BORDERLESS at rest — just an icon + text, no
   background — and picks up the same subtle hover as .icon-btn (touch of color
   + faint background + a border reserved transparent at rest). The text-bearing
   sibling of .icon-btn; use it where a filled button would be too heavy.       */
.btn-quiet {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: transparent; color: var(--muted); border: 1px solid transparent;
  padding: 8px 10px; border-radius: var(--r-sm); line-height: normal;
  font-size: var(--fs-sm); font-family: inherit; font-weight: var(--fw-medium); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.btn-quiet svg { width: 13px; height: 13px; flex: 0 0 auto; display: block; }
.btn-quiet:hover:not(:disabled) { background: var(--surface-hover); color: var(--fg); border-color: var(--border); }
.btn-quiet.accent { color: var(--accent); }
.btn-quiet.accent:hover:not(:disabled) { background: var(--accent-icon-hover-bg); color: var(--accent); border-color: var(--accent); }
.btn-quiet.danger { color: var(--err); }
/* COMPACT size, the filter bar and card size: one line plus 4px padding and
   1px border on each side, the height of a filter bar input. A card head's
   labelled buttons take it without a class (the head centres them out of
   flow, so they never grow its row), as does a quiet table-cell add-on
   (.cell-hover-act), which has to fit its row, and a.btn-secondary, the
   secondary as a link; elsewhere add .compact. There is no compact primary:
   cards do not carry one (the filter bar's own button aside). */
button.compact, .btn-quiet.compact, .filters button,
.card-head > button:not(.icon-btn, .kebab-btn, .add-btn), .btn-quiet.cell-hover-act, a.btn-secondary {
  height: calc(1lh + 10px); padding: 4px 12px; gap: 6px;
  font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium);
}
.btn-quiet.compact svg { width: 12px; height: 12px; }
/* The compact danger is muted: white fill, red border and text, a pale red
   wash on hover (the large danger in a dialog stays the solid red). The quiet
   compact delete keeps no border. */
button.danger.compact:not(.btn-quiet), .card-head > button.danger:not(.btn-quiet) { background: #fff; border: 1px solid var(--err); color: var(--err); }
button.danger.compact:not(.btn-quiet):hover:not(:disabled), .card-head > button.danger:not(.btn-quiet):hover:not(:disabled) {
  filter: none; background: var(--err-soft-bg);
}
.btn-quiet.danger:hover:not(:disabled) { background: var(--err-soft-bg); color: var(--err); border-color: transparent; }
/* The disabled variant: one look for every size of a button that cannot be
   used now, whatever its colour family (primary, secondary, ghost, danger,
   accent): no fill, the disabled grey text, the hairline, the not-allowed
   cursor, so only the size differs between large and compact. A held-off
   button (aria-disabled="true", which keeps its tip and focus) reads the same
   and does not hover. The borderless large primary and danger draw the
   hairline as an inset shadow, so the box keeps its size. After every
   coloured variant, so none of their colours wins. A primary that carries a
   route class falls back to button:disabled's grey fill. */
button:not([class]):is(:disabled, [aria-disabled="true"]), button:not([class])[aria-disabled="true"]:hover,
button.danger:not(.compact, .btn-quiet, .icon-btn, .kebab-btn, .add-btn, .menu-item):is(:disabled, [aria-disabled="true"]),
button.danger:not(.compact, .btn-quiet, .icon-btn, .kebab-btn, .add-btn, .menu-item)[aria-disabled="true"]:hover {
  background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--control-disabled-fg); filter: none; cursor: not-allowed;
}
button.compact:not(.btn-quiet):disabled, .card-head > button:not(.btn-quiet, .icon-btn, .kebab-btn, .add-btn):disabled,
button.danger.compact:not(.btn-quiet):disabled,
button.secondary:disabled, .btn-secondary:disabled, button.ghost:disabled, .btn-ghost:disabled,
:is(button.compact:not(.btn-quiet), .card-head > button:not(.btn-quiet, .icon-btn, .kebab-btn, .add-btn),
  button.secondary, .btn-secondary, button.ghost, .btn-ghost):is([aria-disabled="true"], [aria-disabled="true"]:hover) {
  background: transparent; border: 1px solid var(--border); box-shadow: none; color: var(--control-disabled-fg); filter: none; cursor: not-allowed;
}
.btn-quiet:disabled, .btn-quiet[aria-disabled="true"], .btn-quiet[aria-disabled="true"]:hover { background: transparent; border-color: transparent; color: var(--control-disabled-fg); cursor: not-allowed; }
/* Segmented control: two or three views of one thing, side by side in one
   bordered strip (the Billing tab's Project + WBS | Lines). A role="group"
   of real buttons, the chosen one aria-pressed="true" on the info wash. The
   (0,4,1) hover out-ranks the filled button:hover:not(:disabled) (0,2,1). */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.seg > button.seg-btn, .seg > button.seg-btn:hover:not(:disabled) {
  background: var(--card); color: var(--muted); border: 0; border-radius: 0; filter: none;
  padding: 3px 10px; font: inherit; font-size: var(--fs-sm); cursor: pointer;
}
.seg > button.seg-btn + button.seg-btn { border-left: 1px solid var(--border); }
.seg > button.seg-btn:hover:not(:disabled) { color: var(--fg); }
.seg > button.seg-btn[aria-pressed="true"] { background: var(--surface-info); color: var(--fg); font-weight: var(--fw-semibold); }
/* The pill variant (.seg-pill): a 24px rounded strip of compact segments, for
   a view filter inside a panel (All, Data only, Errors only) or a row of icon
   toggles (the field scope filter). A pressed segment takes the accent tint,
   or the error tint with .bad (Errors only, Out of scope). A .seg-icon segment
   is a fixed 34px holding a 12px glyph. Segments may toggle independently;
   aria-pressed carries each one's state. */
.seg.seg-pill { height: 24px; flex: 0 0 auto; align-items: stretch; border-radius: var(--r-pill); }
.seg.seg-pill > button.seg-btn, .seg.seg-pill > button.seg-btn:hover:not(:disabled) {
  padding: 0 var(--sp-4); font-size: var(--fs-meta); line-height: 1; white-space: nowrap;
}
.seg.seg-pill > button.seg-btn:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--bg); }
.seg.seg-pill > button.seg-btn[aria-pressed="true"],
.seg.seg-pill > button.seg-btn[aria-pressed="true"]:hover:not(:disabled) {
  background: var(--accent-tint); color: var(--accent); font-weight: var(--fw-medium);
}
.seg.seg-pill > button.seg-btn.bad[aria-pressed="true"],
.seg.seg-pill > button.seg-btn.bad[aria-pressed="true"]:hover:not(:disabled) { background: var(--sev-error-bg); color: var(--err); }
.seg.seg-pill > button.seg-btn:disabled { color: var(--control-disabled-fg); cursor: default; }
.seg.seg-pill > button.seg-btn.seg-icon, .seg.seg-pill > button.seg-btn.seg-icon:hover:not(:disabled) { width: 34px; padding: 0; }
.seg-btn.seg-icon svg { width: 12px; height: 12px; display: block; }

/* Quiet affordance: an icon button that is invisible until its row/group is
   hovered or focused (delete/more/upload on file rows, "+" on lane headings). */
.is-quiet { opacity: 0; transition: opacity var(--t-fast); }
:hover > .is-quiet, :focus-within > .is-quiet,
.is-quiet[aria-expanded="true"] { opacity: 1; }

/* 6. FEEDBACK ============================================================== */
.status { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--sp-4); min-height: 18px; }
.status.ok { color: var(--ok); } .status.err { color: var(--err); } .status.warn { color: var(--warn); }

/* Informational callout / section divider: left accent bar + tinted band. */
.callout, .action-desc, .section-divider {
  background: var(--surface-info); border-left: 3px solid var(--accent);
  padding: 10px 14px; font-size: var(--fs-sm); color: var(--fg);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; margin-bottom: var(--sp-5);
}
.section-divider { padding: var(--sp-2) var(--sp-4); font-size: var(--fs-meta); font-weight: var(--fw-semibold); margin: var(--sp-4) 0 var(--sp-3); }
.callout.ok   { border-left-color: var(--ok);   background: var(--ok-soft-bg); }
.callout.warn { border-left-color: var(--warn); background: var(--sev-warning-bg); }
.callout.err  { border-left-color: var(--err);  background: var(--err-soft-bg); }
.callout:empty, .action-desc:empty { display: none; }

pre.err-detail {
  background: var(--err-soft-bg); border: 1px solid var(--err-soft-border); color: var(--err);
  padding: 10px 12px; border-radius: var(--r-sm); font-size: var(--fs-meta);
  white-space: pre-wrap; word-break: break-word; max-height: 200px; overflow: auto;
}
/* Code: the sunken surface an open row wears, so a block inside an expanded
   row reads as part of it; muted text; an even 10px inset on every side. */
pre.code {
  background: var(--surface-sunken); border: 1px solid var(--border); color: var(--muted);
  border-radius: var(--r-sm); padding: 10px; font-size: var(--fs-meta);
  white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow: auto;
}

/* Toast (no live equivalent yet — defined for uniformity). */
.toast {
  position: fixed; right: var(--sp-6); bottom: var(--sp-6); z-index: 6000;
  display: inline-flex; align-items: center; gap: var(--sp-3);
  padding: 10px 14px; max-width: 360px; background: var(--fg); color: #fff;
  border-radius: var(--r-md); font-size: var(--fs-sm); box-shadow: var(--shadow-dialog);
}
.toast.ok { background: var(--ok); } .toast.err { background: var(--err); }
.toast.warn { background: var(--warn); color: var(--fg); }

/* 7. DATA DISPLAY ========================================================== */
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
/* Rule: filtering never moves a column. While a filter is on, table-core.js
   holds each header at its laid-out width (--held-w) and marks the table; it
   lays out on those widths instead of refitting to the rows left. */
table.is-width-held { table-layout: fixed; }
table.is-width-held th { width: var(--held-w, auto); }
/* Cell padding is two tokens: the vertical one so a preset changes a number
   and the header filter card can anchor to the label's bottom edge (top: 100%
   of a positioned th is its padding edge); the horizontal one so the rhythm
   between columns is one number too (8px a side, so neighbouring content
   sits 16px apart). Every row's end cells inset 16px instead, card or not,
   so the first label lines up with a card heading and a table nested deeper
   (a lane, a settings group) reads the same. */
table { --cell-py: 9px; --cell-px: 8px; --head-gap: 10px; }
th, td { text-align: left; padding: var(--cell-py) var(--cell-px); border-top: 1px solid var(--border); vertical-align: middle; }
th:first-child, td:first-child { padding-left: var(--sp-5); }
th:last-child, td:last-child { padding-right: var(--sp-5); }
th { font-size: var(--fs-micro); color: var(--muted); font-weight: var(--fw-semibold); border-top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* The end column: it takes the row's spare width and sits its content flush
   right, so the columns before it hug their text and it rests against the
   last column (the rule lists' Status beside the ID). */
td.cell-end, th.cell-end { width: 100%; text-align: right; }
/* Its row's other cells keep one line: the end column would otherwise squeeze
   them to their narrowest and wrap every title and badge. */
tr:has(> .cell-end) > :not(.cell-end) { white-space: nowrap; }
/* A long one-line text would then push the table past its box, so a
   .cell-clip in such a row stops at half the table's width (its wrapper is
   the size container) and clips; it sits inline, so a badge before it keeps
   its place on the line. The reveal on hover still lifts the cap. */
:has(> table .cell-end) { container-type: inline-size; }
tr:has(> .cell-end) .cell-clip { display: inline-block; vertical-align: top; max-width: 50cqi; }
/* A table sitting directly in a section card runs edge to edge by DEFAULT —
   the row separator lines reach the card's borders (the objects page's row
   list and the rules tiers set this house style). The bleed cancels the
   card's --sp-5 padding; the end cells' own 16px inset (above) puts the text
   back under the heading. margin-inline only, so a table's own top/bottom
   margins survive. Direct child on purpose: nested tables (overlay/profile
   grids inside a card's subtree) keep normal geometry. The `scroll` preset
   below keeps the bleed: the negative margin equals the card padding, so
   the card's overflow box clips nothing. */
.card > table { width: calc(100% + 2 * var(--sp-5)); margin-inline: calc(-1 * var(--sp-5)); }
.empty { color: var(--muted); font-size: var(--fs-sm); padding: var(--sp-3) 0; }

/* --- Table presets + the shared table grammar (J1, spa-table-primitive.md) --
   The LOOK of every SPA table lives here, usable with or without table-core.js
   (the JS reads a look, it never sets one). One `data-table` attribute on the
   <table>, space-separated tokens, each matched with [data-table~=]. */
/* dense: the rollup rhythm, 5px vertical padding (the base is 9px); cells
   never wrap, a long value widens the table (pair with `scroll`) instead of
   growing the row. */
[data-table~="dense"] { --cell-py: 5px; }
[data-table~="dense"] th, [data-table~="dense"] td { white-space: nowrap; }
/* compact: the admin-list rhythm (workstreams, roles): 2px, so a row is its
   tallest control (a kebab, a select) plus a hairline of air. */
[data-table~="compact"] { --cell-py: 2px; }
/* A compact button in a compact row's cell (a row's Remove or Revert): the text line, so the row
   keeps the list's height. No fixed calc(1lh + 10px) height, no block padding, and the 1px border
   cancelled by the margin. */
[data-table~="compact"] td > .btn-quiet.compact { height: auto; padding-top: 0; padding-bottom: 0; margin: -1px 0; }
/* headerless: a row list with no <thead>; the first row has no line above it. */
[data-table~="headerless"] tbody tr:first-child td { border-top: 0; }
/* scroll: cells never wrap (a long value widens the table instead of the row
   growing taller, whatever the density token) and the card scrolls sideways
   instead of the page. Nothing else: the edge-to-edge bleed above survives an
   overflow box (the table starts exactly at the card's padding edge, which is
   the clip edge), so a scrolling card looks like every other card. */
[data-table~="scroll"] th, [data-table~="scroll"] td { white-space: nowrap; }
.card:has(> table[data-table~="scroll"]) { overflow-x: auto; }
/* fit: the table takes its content's width instead of the card's, so the
   columns sit together on the left and the spare room is on the right. It
   keeps the card's left bleed; (0,2,1) out-ranks .card > table's width. */
table[data-table~="fit"], .card > table[data-table~="fit"] { width: auto; }
/* profile: the load file profile's table look (the workspace's table.profile-cols, which takes it
   by its class), for any table that lists fields: a shaded header row with its line inset, the
   technical name in semibold tabular figures, a readable label muted after it. */
:is([data-table~="profile"], table.profile-cols) th { background: #fafbfd; box-shadow: inset 0 -1px 0 var(--border); }
/* The same look names an SAP field anywhere else: .field-name, its readable
   label after it in .field-label (monospace stays for code and IDs). */
:is([data-table~="profile"], table.profile-cols) .col-name strong, .field-name { font-family: var(--font-sans);
  font-weight: var(--fw-semibold); color: #3f4451; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
:is([data-table~="profile"], table.profile-cols) .col-name .lbl, .field-label { color: var(--muted); font-weight: 400; margin-left: 8px; }
/* The data preview's error look (the workspace data viewer takes it by its own classes), for any
   table that marks a failing value: .cell-error is the failing cell (the soft error fill, its ring,
   the strong error text), .name-error the name in front of it (error colour, a dot before it).
   The extra :not() and the doubled class keep the viewer's own precedence over its focus wash and
   its hint marks now the rule sits in an earlier sheet. */
:is(.dm-dv-row .dm-dv-cell.dm-dv-cell--error:not(.dm-dv-gutter), .cell-error) { background: var(--err-soft-bg);
  box-shadow: inset 0 0 0 1px var(--err-soft-border); color: var(--err-strong); border-radius: 5px; }
:is(.dm-dv-hcell.dm-dv-hcell--error .dm-dv-hname.dm-dv-hname, .name-error) { color: var(--err); }
:is(.dm-dv-hcell.dm-dv-hcell--error .dm-dv-hname.dm-dv-hname, .name-error)::before { content: "●";
  font-size: 7px; margin-right: 3px; vertical-align: 1px; color: var(--err); }
/* bleed: the card-table geometry (edge to edge; the end cells' 16px inset is
   the base rule's) for a table nested deeper than a card's direct child,
   such as inside a settings group whose own dividers already run to the
   card edges. Same numbers as `.card > table` above. */
table[data-table~="bleed"] { width: calc(100% + 2 * var(--sp-5)); margin-inline: calc(-1 * var(--sp-5)); }
/* Stacked identity cell: a primary line over a muted meta line (name over
   email, a name over a date). Sort reads the primary, search reads both. The
   primary may be an anchor (row-as-link pages, where the whole row opens the
   page): it reads as plain text and never underlines, since the row's wash is
   the hover; the base `a:hover` would underline it, so the rule says none.
   Keyboard focus takes the sort headers' ring, and the row takes a pointer. */
.cell-primary { display: inline-block; font-weight: var(--fw-medium); color: var(--fg); text-decoration: none; }
a.cell-primary:hover { text-decoration: none; }
a.cell-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
/* A row that opens something looks clickable: the pointer and the --row-hover wash. One rule for
   every table: table-core marks a row tr.is-clickable when its table has onRowClick (a component
   host's handler), and a row whose name is a .cell-primary link qualifies on its own. A plain row
   (no handler, no link) is named by neither and keeps the arrow. :where() keeps it at zero
   specificity, so a page's selected or open row state still wins. */
:where(tr.is-clickable, tr:has(> td a.cell-primary)) { cursor: pointer; }
:where(tr.is-clickable, tr:has(> td a.cell-primary)):hover { background: var(--row-hover); }
.cell-meta { display: block; font-size: var(--fs-meta); color: var(--muted); }
/* A quiet note on the primary's own line: italic, muted, meta size (the rule
   title beside an Audit trail sentence). */
.cell-aside { font-size: var(--fs-meta); color: var(--muted); font-style: italic; margin-left: var(--sp-2); }
/* table-group: a one-level group band inside a tbody (a workstream, a sheet),
   one cell spanning every column. The ETL roster's band adopted: a sunken
   strip framed by the hairline pair, a quiet spaced micro label in muted so
   the rows under it lead; the count rides in .table-group-meta. Painted by
   attach's groupBy, or host-rendered on a presets-only table. With the
   collapsed border model the band's bottom line and the next row's top line
   are one. */
tr.table-group > td {
  padding-block: 4px; background: var(--surface-sunken);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-size: var(--fs-micro); font-weight: var(--fw-semibold); letter-spacing: 0.04em; color: var(--muted);
}
.table-group-meta { font-weight: var(--fw-regular); }
/* Header gap: the column header's text sits exactly --head-gap (10px) above
   the first body row's text in every preset, a regular row or a band: the
   header cells pad half the gap less the 1px line under them, the first shown
   body row pads the other half on top. Only the first row: every other row
   keeps its preset's padding, every other band its 4px. The first shown row
   skips a [hidden] row and a folded band's row (tr.is-group-collapsed). A
   table without a <thead> (headerless, an external header) is untouched.
   Zero-specificity first-row match, so a route's own cell padding wins; the
   band form matches the band rule's (0,1,2) and comes after it. */
thead th { padding-bottom: calc(var(--head-gap) / 2 - 1px); }
:where(thead + tbody > tr:nth-child(1 of :not([hidden], .is-group-collapsed))) > td,
tr:where(thead + tbody > :nth-child(1 of :not([hidden], .is-group-collapsed))).table-group > td {
  padding-top: calc(var(--head-gap) / 2);
}
/* A band that folds and carries actions (groupBy.collapsible / .actions): the
   canonical disclosure leads the label (an 18px box so the band keeps its
   height), the whole band is the fold target, and the actions (a quiet
   compact button such as Create rule) sit at the band's end, shown while the
   band is hovered or holds focus. A folded band's rows stay in the body as
   tr.is-group-collapsed so their listeners survive; they are not shown. */
tr.table-group:has(> td > .table-group-toggle) { cursor: pointer; user-select: none; }
tr.table-group > td:has(> .table-group-toggle) { padding-left: calc(var(--sp-5) - 4px); }
tr.table-group > td > .table-group-toggle { width: 18px; height: 18px; margin: -2px 2px -2px 0; vertical-align: middle; }
tr.table-group > td > .table-group-toggle svg { width: 13px; height: 13px; }
tr.table-group > td:has(> .table-group-actions) { position: relative; }
.table-group-actions {
  position: absolute; right: var(--sp-5); top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: var(--sp-2);
  letter-spacing: normal; opacity: 0; transition: opacity var(--t-fast);
}
tr.table-group:is(:hover, :focus-within) .table-group-actions { opacity: 1; }
tr.table-group.is-collapsed .table-group-actions { visibility: hidden; }
tr.is-group-collapsed { display: none; }
/* Drag handle: a row the person reorders by hand (the rule lists' run order)
   carries a .drag-handle (the six-dot grip) as the first child of its first
   cell. It is laid over the cell's 16px leading inset, so the text starts at
   the same x as a row without one and as the band label above. Only the
   handle is draggable, so a click on the row still opens it. The dragged row
   is tr.is-dragging; an .is-drag-off ancestor (a filtered or sorted view, a
   read-only lock) hides the handles and keeps their slot. */
td:has(> .drag-handle) { position: relative; }
.drag-handle {
  position: absolute; left: 0; top: 0; bottom: 0; width: var(--sp-5);
  display: flex; align-items: center; justify-content: center;
  cursor: grab; color: var(--muted); opacity: 0.35; touch-action: none;
  transition: opacity var(--t-fast), color var(--t-fast);
}
.drag-handle:hover { opacity: 1; color: var(--fg); }
.drag-handle:active { cursor: grabbing; }
.drag-handle svg { width: 12px; height: 12px; display: block; pointer-events: none; }
tr.is-dragging { opacity: 0.4; background: var(--accent-wash); }
.is-drag-off .drag-handle { visibility: hidden; }
/* The trailing actions slot (a kebab per row): tight, right-aligned, so every
   row's trigger lines up under the header; excluded from sort and search, and
   a click inside it never counts as a row click (table-core.js). */
th.actions-col, td.actions-col { text-align: right; width: 1%; white-space: nowrap; }
/* A fit column: only as wide as its widest cell, on one line, so a short
   value (a count) sits left beside the column before it. */
th.col-fit, td.col-fit { width: 1%; white-space: nowrap; }
/* The leading pick column (a checkbox per row, a select-all or nothing in
   the header): the 14px box in a 16px gutter each side, and the column after
   it drops its left padding, so a row reads [16][box][16][label] and the
   label sits where a first column's would in a table without one (16px in).
   One width, the box plus its gutters, so a fixed-layout table needs no pin
   of its own. The box is a block, so the cell's middle alignment centres it
   exactly (an inline box rides the line's baseline and sits a few px high). */
th.pick-col, td.pick-col { width: calc(14px + 2 * var(--sp-5)); padding-left: var(--sp-5); padding-right: var(--sp-5); white-space: nowrap; vertical-align: middle; }
th.pick-col + th, td.pick-col + td { padding-left: 0; }
.pick-col > input[type="checkbox"] { display: block; }
/* Range select (components/range-select.js): the pending run of a Shift-click
   or a drag, previewed before it is set. A row in the run takes the selection
   band (white when the run deselects); the element that will show the value
   takes the accent tint (a muted box for a checkbox); the anchor, the item the
   run starts from, carries a short accent bar just left of it. While a run
   shows, the host's committed state fades back (data-range-previewing names
   the host, for its own finishing touches). */
tr.is-range-preview > td { background: var(--range-band); }
tr.is-range-preview.is-range-remove > td { background: var(--card); }
.is-range-preview .is-range-value { background: var(--accent-tint); color: var(--accent); }
.is-range-preview input.is-range-value { background: none; opacity: 0.4; }
.is-range-anchor:not(tr) { position: relative; overflow: visible; }
.is-range-anchor:not(tr)::before, tr.is-range-anchor > td:first-child::before {
  content: ""; position: absolute; top: 50%; left: -5px; transform: translateY(-50%);
  height: 12px; width: 3px; border-radius: 999px; background: var(--accent);
}
tr.is-range-anchor > td:first-child { position: relative; }
tr.is-range-anchor > td:first-child::before { left: 4px; }
/* Clipped cell text: .cell-clip is a one-line box that clips with an ellipsis.
   When the text really is cut, tooltip.js marks the box .is-clipped while the
   pointer is over it (measured, so a name that shows in full never pops a
   panel) and the box floats its whole text over the row while hovered: the
   cell anchors the panel and lets it escape. The trigger is the box, never
   its cell: a sibling in the same cell (the object page's row "view" button)
   stays hoverable and clickable, where a cell-hover panel would cover it. A
   host adds the class to the box and nothing else, or data-clip-trigger="tail"
   beside it to open the reveal from the ellipsis only (the load order cards,
   whose name is a link's label first). No containment here: a
   column with no width would collapse to nothing; a host that wants its
   column to give way when the table is constrained adds `contain: inline-size`
   beside a cell width (the object page's lanes do) and the reveal lifts it.
   The panel's left and top are --clip-left / --clip-top, which tooltip.js
   measures as it marks the box, so the revealed text starts exactly where the
   clipped text did in any column; a page sets no position of its own, and no
   clip of its own on the box (overflow, white-space, max-width): that rule
   would outrank this reveal and keep the panel cut. --clip-max holds the
   panel inside the viewport; a long name with no break (a URL) wraps
   anywhere rather than run past the panel. */
.cell-clip {
  display: block; max-width: 100%; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
:where(td, th):has(.cell-clip) { position: relative; overflow: visible; }
.cell-clip.is-clipped:hover {
  position: absolute; left: var(--clip-left, 0px); top: var(--clip-top, 0px); z-index: 6;
  width: max-content; max-width: var(--clip-max, min(560px, 88vw));
  overflow: visible; white-space: normal; overflow-wrap: anywhere; contain: none;
  padding: 5px;
  background: var(--card, #fff); border: 1px solid var(--border); border-radius: 6px;
  box-shadow: var(--shadow-menu, 0 6px 20px rgba(16, 24, 40, 0.16));
}
/* The panel is always the card's white: a clip box that is also a control keeps its page's own
   hover wash at rest (the mapping table's click-to-edit cells), and that rule, later in the
   cascade, would otherwise paint the open panel see-through. [class] lifts this one paint
   property above any page's two-class hover rule; the reveal's layout stays in the rule above. The
   panel paints at once: a control's background transition would fade it in from see-through. */
.cell-clip.is-clipped[class]:hover { background: var(--card); transition: none; }
/* Cell actions: a data cell stays one line, value or not. An action on the
   value lives in the row's td.actions-col, or is a hover add-on on the cell:
   .cell-hover-act (a button or link, a direct child of the td) is laid over
   the cell's right edge, out of the flow, so it takes no width and the row
   never grows; it shows while the row is hovered or holds focus (keyboard),
   above a clipped value's reveal, and stays shown while a disclosure it
   opens is open (aria-expanded="true"). A missing value reads as a muted
   .cell-empty placeholder ("No source"), never a sentence with a link in it.
   tests/frontend/cell-actions.test.js holds this; no other sheet declares
   .cell-hover-act. */
.cell-empty { color: var(--muted); }
:where(td):has(> .cell-hover-act) { position: relative; }
.cell-hover-act {
  position: absolute; right: var(--sp-2); top: 50%; transform: translateY(-50%); z-index: 7;
  max-width: calc(100% - 2 * var(--sp-2)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--card); box-shadow: -12px 0 8px -4px var(--card);
  opacity: 0; pointer-events: none; transition: opacity var(--t-fast);
}
tr:hover > td > .cell-hover-act, tr:focus-within > td > .cell-hover-act,
td > .cell-hover-act[aria-expanded="true"] { opacity: 1; pointer-events: auto; }
/* Search toolbar above a table: a fixed-width search input, left-aligned.
   (0,2,1) so it out-ranks the input[type="search"] base rule, which would
   otherwise force width:100% and its own padding. */
.table-toolbar { display: flex; align-items: center; gap: var(--sp-3); margin: 0 0 14px; }
.table-toolbar input[type="search"] { width: 260px; max-width: 100%; flex: 0 0 auto; padding: 8px 10px; font-size: var(--fs-sm); border-radius: 4px; }
/* Count marker beside a card title: "(12)", or "(3 of 12)" while filtered. */
.table-count { color: var(--muted); font-weight: var(--fw-regular); font-size: var(--fs-sm); }
/* Sort chrome: table-core.js wraps a sortable header's label in a real
   <button> (keyboard for free) and keeps aria-sort on the th. The button is
   reset to read as the header itself; the arrow is a ::after glyph, hidden at
   rest (opacity, so it keeps its box and nothing shifts on reveal), shown on
   hover or keyboard focus, solid on the active column. The (0,3,2) hover rule
   out-specifies the global filled button:hover:not(:disabled) (0,2,1). */
th > button.th-sort, th > button.th-sort:hover:not(:disabled) {
  background: transparent; border: 0; padding: 0; margin: 0; box-shadow: none; filter: none;
  font: inherit; color: inherit; letter-spacing: inherit; text-align: inherit; cursor: pointer;
  border-radius: 2px;
}
/* The label box: the sort button, or on a column that filters but does not
   sort the focusable span.th-label table-core.js wraps the text in. Both are
   inline-flex so the sort arrow and the filter mark sit beside the text as
   flex items, reversed on a .num header so the label stays flush right. */
th > button.th-sort, th > span.th-label { display: inline-flex; align-items: center; gap: 4px; vertical-align: top; white-space: nowrap; }
th.num > button.th-sort, th.num > span.th-label { flex-direction: row-reverse; }
/* The arrow is a fixed 8x4 box (a border triangle with no bottom edge) that
   ascending flips in place with a transform, so its geometry never changes
   with the state. A flex container's baseline comes from its main-start item,
   which under row-reverse (.num headers) is the arrow, not the label: a box
   that changed per state moved the label with it on every click. The button's
   vertical-align: top takes that baseline out of the placement altogether. It
   is exactly one line tall, so its label sits where plain header text sits,
   in either direction. */
th > button.th-sort::after {
  content: ""; flex: none; width: 0; height: 0;
  border: 4px solid transparent; border-bottom-width: 0; border-top-color: currentColor;
  opacity: 0;
}
/* The arrow's 12px (gap + box) overhangs into the cell padding instead of
   widening the header, so a column stays as wide as its label and the sort
   chrome never makes a table scroll (the usage rollups tipped over by a few
   px). Text headers overhang to the right, .num headers (arrow before the
   label) to the left; cells carry --cell-px (8px) each side, so the overhang
   never reaches a neighbour's content. Headers with a filter card keep the
   reserved width: their funnel mark sits beyond the arrow and would collide. */
th:not(.has-filter) > button.th-sort::after { margin-right: -12px; }
th.num:not(.has-filter) > button.th-sort::after { margin-right: 0; margin-left: -12px; }
th[aria-sort="ascending"] > button.th-sort::after { transform: scaleY(-1); opacity: 1; }
th[aria-sort="descending"] > button.th-sort::after { opacity: 1; }
th[aria-sort="none"]:not(.has-filter) > button.th-sort:hover::after,
th[aria-sort="none"]:not(.has-filter) > button.th-sort:focus-visible::after { opacity: 0.5; }
/* A column with a filter card sorts from the card (.th-filter-sort): a click
   on its header label opens the card, so the label shows a pointer and its
   text darkens a step on hover and while the card is open (halfway to --fg). */
th.has-filter > span.th-label { cursor: pointer; }
/* After a pointer press in the header (th.is-pointer, table-core.js) its
   label, boxes and buttons show no focus ring, the Shift of a Shift-click
   included; a real key brings the rings back. */
th.has-filter.is-pointer :focus-visible { outline: none; }
th.has-filter:not([aria-sort="ascending"], [aria-sort="descending"]) > button.th-sort:hover:not(:disabled),
th.has-filter:not([aria-sort="ascending"], [aria-sort="descending"]) > span.th-label:hover,
th.has-filter.filter-open:not([aria-sort="ascending"], [aria-sort="descending"]) > button.th-sort,
th.has-filter.filter-open:not([aria-sort="ascending"], [aria-sort="descending"]) > span.th-label {
  color: color-mix(in srgb, var(--muted), var(--fg) 55%);
}
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--fg); }
th > button.th-sort:focus-visible, th > span.th-label:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
/* Column filters (columnFilters: true): table-core.js gives each filterable
   header a hover card (.th-filter) holding its search input, shown while the
   library holds th.filter-open (pointer over the label or anywhere in the
   header, or keyboard focus inside it). Anchored 2px under the label (the
   th's padding edge minus its --cell-py bottom padding), its edge flush with
   the label's: left on a text column, right on a .num one, stepped by the
   wider end-cell inset and pulled to zero after a pick column. z-index
   matches .menu, above the header/sidebar chrome. */
th.has-filter { position: relative; }
th > .th-filter {
  display: none; position: absolute; top: calc(100% - var(--cell-py) + 2px); left: var(--cell-px); z-index: 100;
  min-width: 200px; padding: var(--sp-2); background: #fff;
  border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-menu);
  font-weight: var(--fw-regular); text-align: left;
}
/* table-core.js measures where the header text starts as the card opens and
   sets --th-filter-left (and --th-filter-right: auto), so the card's left edge
   sits under the text on every column, a right-aligned one too. The values
   after the comma are the fallbacks before that measure. */
th > .th-filter { left: var(--th-filter-left, var(--cell-px)); right: var(--th-filter-right, auto); }
th:first-child > .th-filter { left: var(--th-filter-left, var(--sp-5)); }
th.pick-col + th > .th-filter { left: var(--th-filter-left, 0); }
th.num > .th-filter { left: var(--th-filter-left, auto); right: var(--th-filter-right, var(--cell-px)); }
th.num:last-child > .th-filter { right: var(--th-filter-right, var(--sp-5)); }
th.filter-open > .th-filter { display: block; }
/* Value-list filter (th data-filter="values" / "yesno"): one checkbox row per
   value, its row count on the right, a Clear icon at the top left. The label
   may hold a host element (a pill, a glyph) in place of its text. A long list
   scrolls inside the card as a section (.so-scroll, set by table-core.js);
   past the column's threshold a search box tops it, and a muted note says
   when no value matches. The top row is a regular input's height. The list
   runs up to its divider and is nine and a half rows tall, so a list that scrolls shows the
   next row cut through its middle: the hint that there is more. */
th > .th-filter--values { width: max-content; max-width: 280px; padding: 0 0 var(--sp-1); }
/* The text card is the value card's top row alone (table-core.js). */
th > .th-filter--text { width: max-content; max-width: 280px; padding: 0; }
/* While a filter is typed the card keeps the width it had (table-core.js). */
th > .th-filter--values.is-width-held { width: var(--card-w); }
th > .th-filter--values input.th-filter-search {
  display: block; width: 100%; min-width: 0; margin: 0; height: calc(1lh + 2 * var(--sp-3) + 2px);
  padding: var(--sp-3); font-size: var(--fs-sm); font-weight: var(--fw-regular);
  border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: none; box-shadow: none; outline: none;
}
th > .th-filter--values input.th-filter-search[hidden] { display: none; }
/* will-change: the card opens hidden, so without the hint the browser builds
   the list's scroll layer, and draws the rows below the fold, on the first
   wheel: a hiccup at the start of every first scroll. */
.th-filter-options {
  max-height: calc(var(--sp-1) + 9.5 * (var(--fs-sm) * var(--lh) + 2 * var(--sp-1)));
  padding: var(--sp-1) 0; overscroll-behavior: contain; will-change: scroll-position;
}
.th-filter-option[hidden], .th-filter-none[hidden] { display: none; }
.th-filter-none { padding: var(--sp-1) var(--sp-3); color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-regular); }
.th-filter-option {
  display: flex; align-items: center; gap: var(--sp-2); margin: 0; padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--fg); text-transform: none; letter-spacing: 0;
  white-space: nowrap; cursor: pointer; user-select: none;
}
.th-filter-option:hover { background: var(--row-hover); }
/* A value revealed whole (.cell-clip, tooltip.js) lies over the list's section
   bar (.soy-track, z 7 in the card), not under it. */
.th-filter-options .cell-clip.is-clipped:hover { z-index: 8; }
/* A Shift-click run (built into table-core.js): the options it will set take the selection
   band, as table rows do; the anchor's bar sits inside the scrolling list. */
.th-filter-option.is-range-preview { background: var(--range-band); }
.th-filter-option.is-range-preview.is-range-remove { background: var(--surface-hover); }
/* ...and a run that clears shows its boxes as they will be: ticked ones read
   empty while the run is previewed. */
.th-filter-option.is-range-remove input.col-filter-option:checked {
  background-color: var(--card); border-color: var(--border-hover); background-image: none;
}
.th-filter-option.is-range-anchor::before { left: 4px; }
.th-filter-option input { margin: 0; flex: none; }
.th-filter-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.th-filter-count { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
/* A list that scrolls shows the section bar (14px) on its right edge: the
   counts step in past it so the bar never covers a number. */
.th-filter-options .th-filter-option { padding-right: var(--sp-5); }
/* The card's top row (div.th-filter-head, table-core.js): the filter box on
   the left, the column's Sort button on the right. On a value card the row
   carries the divider the search box had; a short list hides its search box,
   and Sort stays on the right. */
.th-filter-head { display: flex; align-items: center; gap: var(--sp-2); }
th > :is(.th-filter--values, .th-filter--text) > .th-filter-head { align-items: stretch; gap: 0; }
th > .th-filter--values > .th-filter-head { border-bottom: 1px solid var(--border); }
th > .th-filter--values > .th-filter-head input.th-filter-search { flex: 1; width: auto; height: calc(1lh + 2 * var(--sp-3) + 1px); border-bottom: 0; }
/* The text card's box: the value search's borderless look, and no native
   clear cross (the filter icon clears it). */
th > .th-filter--text > .th-filter-head input.col-filter {
  flex: 1; width: auto; min-width: 0; margin: 0; height: calc(1lh + 2 * var(--sp-3) + 1px);
  padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-regular);
  border: 0; border-radius: 0; background: none; box-shadow: none; outline: none;
}
th > .th-filter--text > .th-filter-head input.col-filter::-webkit-search-cancel-button { display: none; }
/* Sort: a quiet button, no border but a divider line on its left, with the
   header's sort triangle after the word. It cycles ascending, descending, then the default order;
   data-sort-dir mirrors the th's aria-sort, the triangle half shown while
   the column is unsorted. */
.th-filter-sort, .th-filter-sort:hover:not(:disabled), .th-filter-sort:disabled {
  display: inline-flex; align-items: center; gap: var(--sp-1); flex: none; margin: 0 0 0 auto;
  padding: var(--sp-1) var(--sp-4); border: 0; border-left: 1px solid var(--border); border-radius: 0;
  background: none; box-shadow: none; filter: none; color: var(--fg);
  font-size: var(--fs-sm); font-weight: var(--fw-regular); white-space: nowrap; cursor: pointer;
}
/* Restated on hover: the base hover selector (0,3,0) outranks this one, and
   the padding it would bring back moved the button on every hover. */
th > :is(.th-filter--values, .th-filter--text) .th-filter-sort,
th > :is(.th-filter--values, .th-filter--text) .th-filter-sort:hover:not(:disabled), th > :is(.th-filter--values, .th-filter--text) .th-filter-sort:disabled { min-height: calc(1lh + 2 * var(--sp-3) + 1px); padding: 0 var(--sp-5);
  border-radius: 0 var(--r-md) 0 0; }
.th-filter-sort:hover:not(:disabled) { background: var(--row-hover); }
/* A column that does not sort shows Sort disabled, greyed as Clear is. */
.th-filter-sort:disabled { color: var(--muted-soft); cursor: default; }
/* A list too short for a filter box shows a muted "Filter" in its place,
   in the placeholder's colour and the box's padding. */
.th-filter-hint {
  flex: 1; display: flex; align-items: center; padding: 0 var(--sp-3);
  color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-regular); white-space: nowrap;
}
th > .th-filter--values input.th-filter-search:not([hidden]) + .th-filter-hint { display: none; }
/* The filter icon: the value card's first button, left of the filter box or
   "Filter", with no divider line, its corner following the card's radius.
   It is Clear: while nothing is ticked it is disabled and shows a muted
   funnel; once something is ticked it shows the clear sign (a circle with a
   diagonal line) and clears on a click (aria-label and data-tip name it).
   Every state repeats the layout, so neither button:disabled's fill nor a
   hover rule moves it. */
.th-filter-clear, .th-filter-clear:hover:not(:disabled), .th-filter-clear:disabled {
  display: inline-flex; align-items: center; justify-content: center; flex: none; margin: 0;
  min-height: calc(1lh + 2 * var(--sp-3) + 1px); padding: 0 var(--sp-1) 0 var(--sp-3);
  border: 0; border-radius: var(--r-md) 0 0 0;
  background: none; box-shadow: none; filter: none; color: var(--fg); font-size: var(--fs-sm); cursor: pointer;
}
.th-filter-clear:hover:not(:disabled) { background: var(--row-hover); }
.th-filter-clear:disabled { color: var(--muted); cursor: default; }
/* A disabled button swallows the press, and focus would then leave the
   header and close the card: disabled Sort and Clear let it through to the
   card, whose mousedown keeps focus where it is. */
.th-filter :is(.th-filter-sort, .th-filter-clear):disabled { pointer-events: none; }
.th-filter-clear:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.th-filter-clear::before {
  content: ""; width: 14px; height: 14px; background-color: currentColor;
  -webkit-mask: var(--icon-filter-clear) center / 100% 100% no-repeat; mask: var(--icon-filter-clear) center / 100% 100% no-repeat;
}
.th-filter-clear:disabled::before {
  -webkit-mask: var(--icon-filter) center / 100% 100% no-repeat; mask: var(--icon-filter) center / 100% 100% no-repeat;
}
/* After the icon, the filter box and the hint start a step in. */
th > .th-filter--values > .th-filter-head input.th-filter-search, th > .th-filter--values .th-filter-hint { padding-left: var(--sp-2); }
.th-filter-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.th-filter-sort::after {
  content: ""; flex: none; width: 0; height: 0;
  border: 4px solid transparent; border-bottom-width: 0; border-top-color: currentColor; opacity: 0.5;
}
.th-filter-sort[data-sort-dir="ascending"]::after { transform: scaleY(-1); opacity: 1; }
.th-filter-sort[data-sort-dir="descending"]::after { opacity: 1; }
/* Filter mark: a small funnel on the outer side of the label (after the text,
   before it on a .num header) shown whenever the column's filter entry is
   non-blank, card open or closed (typing already filters). Painted in the
   muted gray explicitly, not currentColor, so a sorted column (th color: fg)
   does not darken it. It keeps its box when hidden, so nothing shifts. */
th.has-filter > button.th-sort::before, th.has-filter > span.th-label::before {
  content: ""; order: 1; flex: none; width: 10px; height: 10px; visibility: hidden;
  background: var(--muted);
  -webkit-mask: var(--icon-filter) center / 100% 100% no-repeat; mask: var(--icon-filter) center / 100% 100% no-repeat;
}
th.has-filter.filtered > button.th-sort::before,
th.has-filter.filtered > span.th-label::before { visibility: visible; }
/* Filtered but not sorted: the arrow is hidden, so the funnel moves onto its
   box (gap 4 + arrow 8) and sits where the arrow would. Sorted, both show.
   Only the funnel moves: the arrow's own box never changes with the state. */
th.has-filter.filtered:not([aria-sort="ascending"], [aria-sort="descending"]) > button.th-sort::before { margin-left: -12px; }
th.num.has-filter.filtered:not([aria-sort="ascending"], [aria-sort="descending"]) > button.th-sort::before { margin-left: 0; margin-right: -12px; }
/* Status rows painted by table-core.js (loading / error / empty / no match)
   when the host owns no empty elements of its own. */
tr.table-status > td { color: var(--muted); font-size: var(--fs-sm); }
tr.table-status[data-status="error"] > td { color: var(--err); }
/* The live region table-core.js prepends as a visually hidden caption. */
caption.table-live { caption-side: top; text-align: left; }

/* Data-grid column header (the in-place data viewer) — adopted from the live
   objects page (review 2026-06-12). A dense three-line header cell: SAP
   structure name (accent, uppercase + tracked — structure names are
   intrinsically uppercase codes, a deliberate exception), technical field
   name (bold), human label (muted). The grid body is monospace 10px. */
.dm-dv-grid { font-family: var(--font-mono); font-size: var(--fs-nano); line-height: 1.2; }
.dm-dv-rowhead { background: #fafbfd; border-bottom: 1px solid var(--border); }
.dm-dv-hcell {
  padding: 3px 6px; border-right: 1px solid #eef0f4;
  display: flex; flex-direction: column; gap: 1px; overflow: hidden;
}
.dm-dv-hgroup {
  font-weight: var(--fw-semibold); color: var(--accent); font-size: 8px;
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.dm-dv-hname { font-weight: var(--fw-bold); color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-dv-hlabel { font-weight: var(--fw-regular); color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Pill: rounded status tag. Neutral by default, because a plain pill is a
   count or a label and must not read as a link; a pill that carries a verdict
   says so with a modifier. This is the only copy: app.css used to hold a
   second one that loaded later and won (the trap the table copy fell into). */
.pill { display: inline-block; font-size: var(--fs-micro); padding: 2px var(--sp-3); border-radius: var(--r-pill); background: var(--surface-hover); color: var(--fg); }
.pill.ok, .pill.good { background: var(--moss-soft-bg); color: var(--moss-soft-fg); } /* the direct copy pill's moss */
.pill.bad { background: var(--err-soft-bg); color: var(--err); }
.pill.warn { background: var(--sev-warning-bg); color: var(--warn); }
/* A pill that acts (a column's rule count, which opens its rules) is a
   button: it keeps the pill's look and dims on hover like a filled button. */
button.pill { padding: 1px 7px; font-weight: var(--fw-semibold); line-height: 1.4; }

/* Role pill (D10, promoted from the three route-sheet copies in
   project-settings.css, settings.css and account.css, which stay until they
   are touched): a role as a pill. With an invisible <select class="rp-overlay">
   inside, the pill sizes to its label and the native select drives the change;
   .is-static is the read-only pill. Variants per role. */
.role-pill { position: relative; display: inline-flex; align-items: center; padding: 1px 8px;
  border-radius: 10px; font-size: var(--fs-micro); font-weight: 500; letter-spacing: 0.02em; cursor: pointer;
  background: var(--surface-hover); color: var(--fg); }
.role-pill .rp-label { pointer-events: none; }
.role-pill .rp-label::first-letter { text-transform: uppercase; }
.role-pill.is-static { cursor: default; }
.role-pill .rp-overlay { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0;
  cursor: pointer; border: 0; padding: 0; margin: 0; appearance: none; -webkit-appearance: none; font: inherit; }
.role-pill:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.role-pill.role-viewer { background: #e2e8f0; color: #475569; }
.role-pill.role-contributor { background: var(--accent-chip-bg); color: var(--accent-chip-fg); }
.role-pill.role-admin, .role-pill.role-owner { background: #e0e7ff; color: #3730a3; }
.role-pill.role-global-admin { background: var(--surface-hover); color: var(--fg); }

/* Badge: small emphasis chip — sentence case (no uppercase, per feedback),
   with the FIRST LETTER capitalized (review 2026-06-12: "Error", not "error"). */
.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: var(--fs-micro); font-weight: var(--fw-semibold); }
.badge::first-letter { text-transform: uppercase; }
.badge.sev-error { background: var(--sev-error-bg); color: var(--err); }
.badge.sev-warning { background: var(--sev-warning-bg); color: var(--warn); }
/* The info badge and the Off pill (an alias pages still use) wear the neutral pill's colours. */
.badge.sev-info, .pill.off { background: var(--surface-hover); color: var(--fg); }
.badge.subtle { background: #eef2f7; color: var(--fg); font-weight: var(--fw-medium); }
.badge.edited { background: var(--moss-soft-bg); color: var(--moss-soft-fg); font-weight: var(--fw-medium); }
/* History chips: an audit action as a pill, first shared by the rule history
   modal and the Audit trail. Create and restore wear the direct copy pill's
   moss (as does the "Edited via UI" badge), update is blue, delete red, revert
   amber; any other action is the neutral chip.
   Sentence case with a first-letter cap, like .badge. */
.history-chip {
  display: inline-block; font-size: var(--fs-micro); font-weight: 600; padding: 2px 8px;
  border-radius: 999px; background: var(--surface-hover); color: var(--muted); white-space: nowrap;
}
.history-chip::first-letter { text-transform: uppercase; }
.history-chip-create { background: var(--moss-soft-bg); color: var(--moss-soft-fg); }
.history-chip-update { background: var(--accent-chip-bg); color: var(--accent-chip-fg); }
.history-chip-delete { background: #fee2e2; color: #991b1b; }
.history-chip-restore { background: var(--moss-soft-bg); color: var(--moss-soft-fg); }
.history-chip-revert { background: var(--sev-warning-bg); color: var(--warn); }

/* Environment badge: loud header-chrome marker for non-production stacks
   (sidebar.js injects it on quality; on the app shell it also takes
   .env-badge-top, the tab on the header's top edge, see the header rules).
   Adopted verbatim from the live SPA (review 2026-06-12) as THE deliberate
   uppercase exception: a warning wants to shout; everything else stays
   sentence case. */
.env-badge {
  display: inline-block; margin-left: 10px; padding: 2px 9px;
  border-radius: var(--r-pill); background: #fde047; color: #713f12;
  font-size: var(--fs-micro); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: 0.04em;
  vertical-align: middle; line-height: 1.6;
}

/* Object tag: small outlined pill flag on object/file rows — adopted from the
   live objects page (review 2026-06-12), uppercase by design (it renders codes
   and flags). .obj-tag-custom is the custom-loadsheet marker: a compact
   circular "C" in the warning badge's colours, without the outline. */
.obj-tag {
  display: inline-block; font-size: var(--fs-nano); font-weight: var(--fw-bold); line-height: 1;
  padding: 4px 9px; border-radius: var(--r-pill); border: 1.5px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.obj-tag.obj-tag-custom {
  box-sizing: border-box; width: 16px; height: 16px; padding: 0; border: 0;
  background: var(--sev-warning-bg); color: var(--warn);
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; letter-spacing: 0;
}
/* The marker's place in running text (a table cell, a lane line, a card row):
   the .c-badge wrapper, which also carries its data-tip. A small gap before
   the text it leads and a 1px lift onto the text's centre. A host that shows
   the marker bare (a filter toggle) leaves the wrapper out. */
.c-badge { display: inline-flex; margin-right: var(--sp-1); transform: translateY(-1px); }

/* Progress bar: quiet meter for progress rollups (project/cycle overviews,
   C4 progress reporting). Track rides the run-bar grey; the fill is the ETL
   cycle roster's soft yellow (--sev-warning-border) while under way (review
   2026-07-16 — progress is status semantics, not an action, so it doesn't
   wear accent) and its moss (--moss-soft-border) at completion (add .done). Blocked is NEVER encoded in the bar — surface it beside the % as a
   pill/count (spec: a flag, not a deduction). Pair with a tabular-nums %
   label. */
.progress-bar {
  height: 6px; border-radius: var(--r-pill); background: var(--run-bar-bg);
  overflow: hidden;
}
.progress-bar > i {
  display: block; height: 100%; border-radius: inherit;
  background: var(--sev-warning-border); transition: width 0.3s ease;
}
.progress-bar.done > i { background: var(--moss-soft-border); }
@media (prefers-reduced-motion: reduce) { .progress-bar > i { transition: none; } }
/* The pair in a row (the ETL cycle page's group rows, the Reconcile load files list): the bar takes
   the room, the micro % trails it at a fixed width so the numbers align down a list. The fill reads
   --progress (set with style.setProperty), so a script never writes the bar's width itself. */
.progress-pair { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.progress-pair > .progress-bar { flex: 1 1 auto; }
.progress-pair > .progress-bar > i { width: var(--progress, 0%); }
.progress-pair > .progress-pct { flex: 0 0 44px; font-size: var(--fs-micro); }
/* The % label riding next to a bar. */
.progress-pct {
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  font-variant-numeric: tabular-nums; text-align: right;
}
.progress-pct.muted { color: var(--muted); font-weight: var(--fw-regular); }

/* Status dot: bare colored dot (sidebar active-cycle, adoption status). */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; vertical-align: middle; }
/* The platform's status colours: active is the done moss and pending the
   under-way yellow (the progress bar and cycle roster fills), blocked the
   stage strip's red, validating the accent with a pulse. */
.dot.ok { background: var(--moss-soft-border); } .dot.warn { background: var(--sev-warning-border); }
.dot.err { background: var(--err); } .dot.busy { background: var(--accent); animation: dm-pulse 1.2s infinite; }

/* Check-type pill: interactive category pill. Cool-only palette — warm tones
   (red/amber/green) stay reserved for severity. The full taxonomy below. */
.check-type-pill {
  /* inline-block (not flex): ::first-letter is inert on flex containers. */
  display: inline-block; padding: 1px var(--sp-3);
  border-radius: 10px; font-size: var(--fs-micro); font-weight: var(--fw-medium);
  letter-spacing: 0.02em; background: #eef2f7; color: var(--fg);
}
.check-type-pill:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.check-type-pill::first-letter { text-transform: uppercase; } /* matches .badge (2026-06-12) */
.check-type-pill.ck-mandatory        { background: #e2e8f0; color: #475569; } /* slate */
.check-type-pill.ck-format           { background: #dbeafe; color: #1e40af; } /* blue */
.check-type-pill.ck-allowed_values   { background: #e0e7ff; color: #3730a3; } /* indigo */
.check-type-pill.ck-regex            { background: #ede9fe; color: #6d28d9; } /* purple */
.check-type-pill.ck-uniqueness       { background: #cffafe; color: #155e75; } /* cyan */
.check-type-pill.ck-cross_field      { background: #e0f2fe; color: #075985; } /* sky */
.check-type-pill.ck-cross_sheet      { background: #ddd6fe; color: #5b21b6; } /* violet */
.check-type-pill.ck-cross_object_ref { background: #f3e8ff; color: #7e22ce; } /* lavender */
.check-type-pill.ck-structural       { background: #fef3c7; color: #92400e; } /* amber (structural only) */
.check-type-pill.ck-value_map        { background: #cffafe; color: #155e75; } /* cyan, shared with uniqueness (2026-06-12) */
.check-type-pill.ck-direct_copy      { background: #e3ecd5; color: #4b6b32; } /* moss — adopted from the live SPA (2026-06-12) */
.check-type-pill.ct-auto, .check-type-pill.deriving { background: #eef2f7; color: var(--muted); font-style: italic; }
/* A transformation type's icon before its label (rule-type-icons.js), sized to the text. */
.check-type-pill .ct-icon { display: inline-flex; vertical-align: -0.125em; }
.check-type-pill .rt-icon { width: 1em; height: 1em; flex: none; margin-right: 4px; vertical-align: -0.125em; }

/* Download / result links: accent-soft tiles. */
.downloads a, a.download-tile {
  display: block; padding: var(--sp-2) var(--sp-3); background: var(--accent-soft-bg);
  border: 1px solid var(--accent-soft-border); border-radius: var(--r-sm);
  color: var(--accent); text-decoration: none; margin-bottom: var(--sp-1); font-size: var(--fs-sm);
}
.downloads a:hover, a.download-tile:hover { background: var(--accent-soft-bg-hover); text-decoration: none; }

/* Inline count cluster: small icon + number, repeated (object-row L3 counts). */
.count-group { display: inline-flex; align-items: center; gap: var(--sp-4); font-size: var(--fs-meta); color: var(--muted); }
.count-group .cnt { display: inline-flex; align-items: center; gap: 5px; }
.count-group .cnt svg { width: 13px; height: 13px; display: block; }

/* 8/9. OVERLAYS — dialog, menu, tooltip =================================== */
dialog { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 0; background: var(--card); color: var(--fg); }
/* showModal() focuses the dialog itself; suppress the resulting focus ring on
   the container (the "dark edge"). Interactive children keep their own rings. */
dialog:focus, dialog:focus-visible { outline: none; }
dialog::backdrop { background: var(--backdrop); }

.dialog-head { display: flex; align-items: center; gap: var(--sp-3); padding: 14px 18px; border-bottom: 1px solid var(--border); }
.dialog-head h3 { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Muted markers riding inline after the title: area label + rule number. The
   title itself stays subtle-but-present; the meta recedes. */
.dialog-head h3 .rule-meta { color: var(--muted); font-weight: var(--fw-regular); font-size: var(--fs-sm); margin-left: var(--sp-1); }
.dialog-head h3 .rule-num  { color: var(--muted); font-weight: var(--fw-medium);  font-size: var(--fs-sm); margin-left: var(--sp-2); }
/* The dialog title is click-to-edit: give it the .editable control (§4) —
   display and edit integrated in one element, no border shift so the header
   never jumps. */
/* Standard-dialog convention: save / cancel / delete / close live in the HEADER
   as icon-btns (see §5). A dialog whose work ends in one flow action (Load all,
   Run) may add the footer row below (.dialog-foot); the compact .confirm-dialog
   keeps its own actions row. */
.dialog-head-actions { display: flex; gap: var(--sp-1); align-items: center; }
.dialog-body { padding: var(--sp-5) 18px; overflow: auto; max-height: 70vh; }
.dialog-body.roomy { padding-top: var(--sp-8); padding-bottom: var(--sp-8); }
/* The footer row (owner's decision, 2026-10-17): the flow's actions under the body, the primary on the
   right; .foot-start puts a secondary action on the left. */
.dialog-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-3);
  padding: 14px 18px; border-top: 1px solid var(--border); }
.dialog-foot[hidden] { display: none; }
.dialog-foot .foot-start { margin-right: auto; }
/* A dialog with a footer opens its body with .dialog-intro: one or two muted
   lines right under the header divider saying what the flow does. */
.dialog-intro { margin: 0 0 var(--sp-4); color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; }
.dialog-intro:last-child { margin-bottom: 0; }

/* Standard dialog sizes: every page <dialog> carries exactly one width class
   and never sets its own width, height, margin or position; showModal() centres
   it. A 16px gutter holds on a narrow screen. .dialog-tall adds a fixed height,
   so a dialog whose content loads or switches does not jump. DMConfirm
   (components/confirm.js) is a .confirm-dialog.dialog-sm. */
dialog:is(.dialog-sm, .dialog-md, .dialog-lg, .dialog-xl, .dialog-full) {
  max-width: calc(100vw - 32px); max-height: calc(100vh - 32px);
}
dialog.dialog-sm { width: 440px; }
dialog.dialog-md { width: 560px; }
dialog.dialog-lg { width: 720px; }
dialog.dialog-xl { width: 960px; }
dialog.dialog-full { width: calc(100vw - 32px); height: calc(100vh - 32px); }
dialog.dialog-tall { height: min(86vh, calc(100vh - 32px)); }
/* .dialog-fill lays the dialog out as a column: the body takes the height
   left between the head and the foot and scrolls there, up to the dialog's
   own cap, instead of the body's 70vh cap (the workspace's picker, profile,
   data viewer and split dialogs, the lineage full screen). */
dialog.dialog-fill[open] { display: flex; flex-direction: column; overflow: hidden; }
dialog.dialog-fill > .dialog-body { flex: 1 1 auto; min-height: 0; max-height: none; }

.confirm-dialog { padding: var(--sp-6); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); }
.confirm-dialog .actions { display: flex; gap: var(--sp-3); justify-content: flex-end; margin-top: var(--sp-5); }
/* The parts DMConfirm (components/confirm.js) paints inside the compact
   confirm: a muted body that keeps its line breaks, a one-field prompt input,
   and the grouped item lines (D7) that scroll inside the dialog instead of
   growing it past the viewport. [hidden] has to out-specify the element
   display of button and input, since the component toggles parts by it. */
.confirm-dialog [hidden] { display: none; }
.confirm-dialog .confirm-body { margin: var(--sp-2) 0 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; white-space: pre-line; }
.confirm-dialog .confirm-input { margin: var(--sp-4) 0 0; }
.confirm-dialog .confirm-items { margin: var(--sp-4) 0 0; max-height: min(40vh, 280px); overflow-y: auto; font-size: var(--fs-sm); line-height: 1.5; }
.confirm-items .confirm-group + .confirm-group { margin-top: var(--sp-3); }
.confirm-items .confirm-group-label { margin: 0; font-weight: var(--fw-semibold); }
.confirm-items .confirm-lines { margin: 2px 0 0; padding: 0 0 0 var(--sp-5); color: var(--muted); }
.confirm-items .confirm-lines li { overflow-wrap: anywhere; }

/* Field grid ("Applies to" detail): muted label column + value column. */
.field-grid { display: grid; grid-template-columns: 80px 1fr; gap: var(--sp-2) var(--sp-4); align-items: baseline; }
.field-grid .fg-label { color: var(--muted); font-size: var(--fs-meta); font-weight: var(--fw-semibold); }
.field-grid .fg-value { font-size: var(--fs-sm); }
.field-grid .fg-empty { color: var(--muted); font-style: italic; }

/* --- Menu: THE reusable dropdown (generalized from the "⋯" kebab menu). ---
   Trigger it with a .kebab-btn (icon-btn). Anchor a relatively-positioned
   wrapper (.menu-wrap) and drop this absolutely beneath it, right edge aligned
   to the trigger. Used for object/file actions and intended for any contextual
   action list across the app. */
.menu-wrap { position: relative; display: inline-flex; }
.menu {
  /* Anchored to .menu-wrap and opening downward, right-aligned to the trigger.
     z-index 100 lifts the menu ABOVE the header/sidebar chrome (both at z-index
     50) — at 50 it tied with them and lost to later-painted chrome. */
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 100;
  min-width: 180px; padding: var(--sp-1); background: var(--card);
  border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-menu);
}
/* Menu heading — sentence case, first letter capitalized (review 2026-06-12:
   "Validation reports", not "VALIDATION REPORTS"). */
.menu-head {
  font-size: var(--fs-micro); font-weight: var(--fw-semibold); color: var(--muted);
  padding: 2px 6px 6px;
}
.menu-head::first-letter { text-transform: uppercase; }
.menu-item {
  /* Block layout (mirrors the live .obj-menu-item / .ws-menu-item) so a wrapped
     multi-line label keeps the same left padding on every line. */
  display: block; width: 100%; text-align: left; padding: var(--sp-3) 10px;
  background: transparent; color: var(--muted); border: 0; border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: var(--fw-regular); cursor: pointer;
}
/* :not(:disabled) lifts this to (0,3,0) so it out-specifies the global filled
   `button:hover:not(:disabled)` (0,2,1) that would otherwise wash these <button>
   menu rows in accent-blue. Soft neutral gray, not the bluish --surface-info. */
.menu-item:hover:not(:disabled) { filter: none; background: var(--surface-hover); }
/* Subtle danger — mirrors .btn-quiet.danger: red icon + text on a transparent
   ground, soft-red wash on hover. The `background`/`border-color` resets and the
   :not(:disabled) on hover are REQUIRED to out-specify the filled `button.danger`
   rule (0,1,1 at rest / 0,3,1 on hover) that would otherwise paint a solid red
   fill here and a dark --err-strong fill on hover (same trap as .icon-btn.danger). */
.menu-item.danger { color: var(--err); background: transparent; border-color: transparent; }
.menu-item.danger:hover:not(:disabled) { color: var(--err); background: var(--err-soft-bg); }
/* A held-off row (D7): `aria-disabled="true"`, never `disabled`, so arrow keys
   and Tab still reach it and tooltip.js shows its tip on focus; a truly
   disabled row reads the same. Faded rather than the global filled-gray
   button:disabled; the :hover forms out-specify the rows' own hover washes. */
.menu-item:disabled, .menu-item[aria-disabled="true"], .menu-item[aria-disabled="true"]:hover {
  background: transparent; color: var(--muted); opacity: 0.45; cursor: not-allowed;
}
.menu-sep { height: 1px; margin: var(--sp-1) 2px; background: var(--border); }
/* An item with a count (a load file's Versions): the label on the left, the
   count a .pill on the right. The pill takes the hairline grey, so it stays
   visible on the item's own hover wash. */
.menu-item.menu-item-count { display: flex; align-items: center; gap: var(--sp-4); }
.menu-item-count > .pill { flex: 0 0 auto; margin-left: auto; min-width: 18px; padding: 1px 7px; text-align: center;
  background: var(--border); color: var(--muted); font-weight: var(--fw-semibold); line-height: 1.4; }
/* Floating menu (.menu-float): a portaled .menu the component places itself
   (left/top/min-width from the anchor's getBoundingClientRect), so no parent
   overflow clips it; DMComponents.Autocomplete appends it to <body> or the
   open <dialog> (to share its top layer). It keeps the menu's z-index, shadow
   and surface, and scrolls past a fixed height. */
.menu.menu-float { position: fixed; right: auto; top: auto; max-height: 280px; overflow-y: auto; }
/* Pick rows (.menu-pick): a menu row that pairs a technical key (mono) with a
   muted description, an optional leading tag and a trailing marker
   (.menu-aside, e.g. the "not in scope" badge). .active is the row the arrow
   keys reached, read like a hovered one; .scope-out fades the text of a row
   that stays pickable. .plain on the menu is for name-only catalogs: the key
   reads in the description style instead. */
.menu-item.menu-pick { display: flex; align-items: baseline; gap: var(--sp-3); padding: var(--sp-2) 10px; }
.menu-pick.active { background: var(--surface-hover); }
.menu-pick .menu-key { font-family: var(--font-mono); font-weight: var(--fw-semibold); font-size: var(--fs-meta); color: var(--fg); white-space: nowrap; }
.menu-pick .menu-desc { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu.plain .menu-pick .menu-key { font-family: inherit; font-weight: var(--fw-regular); font-size: var(--fs-sm); color: var(--muted); }
.menu-pick.scope-out .menu-key, .menu-pick.scope-out .menu-desc { opacity: 0.55; }
.menu-pick .menu-aside { margin-left: auto; flex: none; white-space: nowrap; }

/* Tooltip: dark, compact, shadowed. THE single source of truth for the tip
   skin — the CSS-hover styleguide specimen (.tooltip) and the runtime JS tip
   (.dm-tooltip, driven by tooltip.js) render from the SAME declarations so they
   can never drift. tooltip.js injects no styles of its own. */
.tooltip-host { position: relative; display: inline-flex; }
.tooltip, .dm-tooltip {
  /* Hug the content, but never grow past a comfortable reading width: short
     tips are only as wide as their text; long ones wrap at the cap. */
  white-space: normal; width: max-content; max-width: min(var(--tooltip-width), 90vw);
  background: var(--tooltip-bg); color: #fff; font-size: var(--fs-micro);
  line-height: 1.45; padding: var(--sp-3) 10px; border-radius: var(--r-md);
  box-shadow: var(--shadow-tooltip); pointer-events: none;
}
/* Long tooltips lead with a title line (semibold, body size), the body follows
   beneath. ONE title treatment for every tip — the dark tips here and the light
   .stg-tip card all render the header identically. */
.tooltip-title, .dm-tooltip-title {
  display: block; font-weight: var(--fw-semibold); font-size: var(--fs-micro);
  margin-bottom: var(--sp-1);
}
/* CSS-hover specimen (styleguide): anchored above its host, revealed on hover. */
.tooltip {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 60;
  opacity: 0; visibility: hidden;
}
.tooltip-host:hover .tooltip { opacity: 1; visibility: visible; }
/* Runtime JS tip (tooltip.js): viewport-fixed, JS sets top/left, fades in. */
.dm-tooltip {
  position: fixed; z-index: 1000; top: 0; left: 0;
  opacity: 0; visibility: hidden; transition: opacity 0.14s ease;
}
.dm-tooltip.is-visible { opacity: 1; visibility: visible; }
/* Short single-line label tips ("Close", "More actions") get a tighter pad. */
.dm-tooltip.is-compact { padding: 5px 9px; }
.dm-tooltip-title[hidden] { display: none; }
.dm-tooltip-body { display: block; white-space: pre-line; }

/* Rich hover CARD skin (light): the shared base for the two floating cards that
   carry structured content a flat tip can't — the stage hover card (.stg-tip,
   stage-strip.css) and tooltip.js's hover card (.dm-tip-card, below).
   They live in per-route stylesheets that never load together, so the skin lives
   here, once; each route file keeps only its own inner-content rules. Same tokens
   as the dark tip (radius, shadow, micro text) on a light surface. */
.tip-card {
  position: fixed; z-index: 1000; width: max-content; max-width: 360px;
  white-space: normal; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3);
  box-shadow: var(--shadow-tooltip); pointer-events: none; font-size: var(--fs-micro);
}
/* tooltip.js's hover card: one floating .dm-tip-card on the .tip-card skin,
   shown at once over a [data-tip-card] trigger (its hidden .tip-card-src child
   is the content) or by DMTooltip.showCard(anchor, html, opts). */
.tip-card-src { display: none; }
.dm-tip-card { top: var(--tip-top, 0); left: var(--tip-left, 0); visibility: hidden; }
.dm-tip-card.is-visible { visibility: visible; }
/* The rules card: a compact list of the rules on a field, one per line, in tier
   groups (Project / Object / General), with a run-outcome mark per rule. Used
   by the profile tables' Rules cells and a failing column name. */
.dm-tip-card .rules-tip-head, .dm-tip-card .rules-tip-empty { display: block; color: var(--muted); margin-bottom: 4px; }
.dm-tip-card .rules-tip-row { display: flex; align-items: baseline; gap: 6px; padding: 1px 0; white-space: nowrap; }
.dm-tip-card .rules-tip-seg { display: block; margin: var(--sp-3) 0 1px; color: var(--muted); font-size: var(--fs-nano); font-weight: 600; }
.dm-tip-card .rules-tip-none { display: block; padding: 1px 0; color: var(--muted); font-style: italic; }
.dm-tip-card .rules-tip-id { color: var(--muted); font-variant-numeric: tabular-nums; }
.dm-tip-card .rules-tip-title { color: var(--fg); }
/* Trailing meta on a row-level finding's row: failing-row count + the columns the rule reads. */
.dm-tip-card .rules-tip-rl-meta { color: var(--muted); }
.dm-tip-card .rules-tip-foot { display: block; margin-top: var(--sp-1); padding-top: var(--sp-1); border-top: 1px solid var(--border); color: var(--muted); font-style: italic; }
.rules-sev { font-size: 9px; }
.rules-sev-error { color: var(--err); }
.rules-sev-warning { color: var(--rules-sev-warning); }
.rules-sev-info { color: var(--rules-sev-info); }
.rules-sev-pass { color: var(--rules-sev-pass); }
.rules-sev-none { color: var(--muted-faint); }
/* The chart cell card (report-charts.js, markMatrix cellCard): the field in the
   head, a step up the scale, then a small two-row table, the values below each
   other in the table rows' own font and size. A spaces or case
   change is marked (.diff-mark) in the tone, the pattern's colour; a plain
   difference wears the data preview's error look (.name-error, .cell-error). */
.report-cell-card-head { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--fg); margin-bottom: var(--sp-2); }
/* The subtitle under it (a Data compare value card: the difference type), muted and a step smaller, its
   dot first (the legend's swatch, painted by data-token). The head's gap moves below it. */
.report-cell-card-head:has(+ .report-cell-card-sub) { margin-bottom: 2px; }
.report-cell-card-sub { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-micro); margin-bottom: var(--sp-2); }
.report-cell-card-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
/* Its own size and lines: not the page table's full width or every-row rule. */
.report-cell-card-table { width: auto; border-collapse: collapse; }
.report-cell-card-table :is(th, td) { border-top: 0; }
.report-cell-card-table th {
  text-align: left; font-weight: var(--fw-regular); color: var(--muted);
  padding: 3px var(--sp-3) 3px 0; vertical-align: baseline; white-space: nowrap;
}
.report-cell-card-table td { padding: 3px 0; color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; vertical-align: baseline; }
.report-cell-card-table tr + tr :is(th, td) { border-top: 1px solid var(--border); }
/* A marked change in a value (the cell card, the Data compare record tables): bold, in the tone an
   ancestor's data-tone names, on a faint wash of it. An empty value's "(empty)" muted. */
[data-tone="--rp-pat-spaces"] { --diff-mark: var(--rp-pat-spaces); }
[data-tone="--rp-pat-case"] { --diff-mark: var(--rp-pat-case); }
[data-tone="--rp-pat-hidden"] { --diff-mark: var(--rp-pat-hidden); }
/* A plain Difference: the differing characters marked in red (and, for a value SAP cut short, the
   missing count after the SAP value, .diff-cut). */
.diff-err { --diff-mark: var(--err); }
/* Drawn from the token alone, so it reads with a light fill (Data compare's palette) as with a deep
   one: most of the fill as the tint, the text, the ring and the name's dot darkened toward --fg. */
.diff-mark {
  color: color-mix(in srgb, var(--diff-mark) 35%, var(--fg)); font-weight: var(--fw-bold);
  background: color-mix(in srgb, var(--diff-mark) 70%, transparent); border-radius: 2px;
  padding: 0 calc(var(--sp-1) / 2);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--diff-mark) 55%, var(--fg));
}
/* Capitalization: only the tint behind the differing letters; the text keeps the row's colour and
   weight, no ring (the box is the spaces' look, around their dots). */
[data-tone="--rp-pat-case"] .diff-mark { color: inherit; font-weight: inherit; box-shadow: none; padding: 0; }
/* Hidden characters (a no-break space, a soft hyphen, a zero-width one): each drawn as a small dotted
   box around a visible stand-in, a faint tint, its code point and name on hover. */
.diff-mark.diff-hidden {
  font-weight: var(--fw-regular); box-shadow: none; padding: 0 1px; margin: 0 1px;
  background: color-mix(in srgb, var(--diff-mark) 15%, transparent);
  outline: 1px dotted color-mix(in srgb, var(--diff-mark) 80%, var(--fg)); outline-offset: -1px;
}
/* The name in front of a marked value: the error's dot (.name-error), in the tone. */
.name-mark::before { content: "●"; font-size: 7px; margin-right: 3px; vertical-align: 1px; color: color-mix(in srgb, var(--diff-mark) 70%, var(--fg)); }
.diff-empty { color: var(--muted); font-style: italic; }

/* 10. DISCLOSURE / COLLAPSIBLE ============================================= */
/* Canonical disclosure: a chevron on the LEFT of the title that rotates 90°
   when its container opens (per feedback — triangle leads the title). */
.disclosure {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; background: transparent; color: var(--muted);
  border: 1px solid transparent; border-radius: var(--r-sm); cursor: pointer;
}
/* padding: 0 because the base button's 9px 16px would leave the 22px box no
   room for its chevron. It hovers like every icon button: the grey wash, the
   reserved border coloured in, the fg icon (no dimming). */
.disclosure:hover:not(:disabled) { filter: none; background: var(--surface-hover); color: var(--fg); border-color: var(--border); }
.disclosure svg { width: 15px; height: 15px; display: block; transition: transform var(--t-fast); }
.is-open > .disclosure svg, .disclosure.is-open svg { transform: rotate(90deg); }
/* The history chevron: the rule history modal's expander (rules.js), also the
   leading cell of every Audit trail row (history.js). The disclosure's quiet
   22px box with a 14px glyph. The modal rotates it from its entry's .is-open;
   a row's button carries .is-open itself. */
.history-expand {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; background: transparent; color: var(--muted);
  border: 1px solid transparent; border-radius: var(--r-sm); cursor: pointer;
}
.history-expand:hover:not(:disabled) { filter: none; background: var(--surface-hover); color: var(--fg); border-color: var(--border); }
.history-expand svg { width: 14px; height: 14px; display: block; transition: transform var(--t-fast); }
.history-expand.is-open svg { transform: rotate(90deg); }

/* Collapsible section (e.g. rules tiers): bordered card, sticky header with the
   chevron leading, title + count, actions trailing. */
.collapsible { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); margin-bottom: var(--sp-6); overflow: hidden; }
.collapsible > .collapsible-head {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-4);
  cursor: pointer; user-select: none; position: sticky; top: 0; z-index: 10;
  background: var(--card); border-bottom: 1px solid var(--border);
}
.collapsible.collapsed > .collapsible-head { border-bottom: 0; }
.collapsible.collapsed > .collapsible-body { display: none; }
.collapsible-head .title { font-weight: var(--fw-semibold); font-size: var(--fs-h2); letter-spacing: -0.01em; }
.collapsible-head .count { color: var(--muted); font-size: var(--fs-sm); }
.collapsible-head .head-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; }
.collapsible-body { padding: 0; }

/* List rows inside a collapsible / list (rule rows, object rows): no chrome,
   hairline-separated, hover wash, open state tints. The chevron leads (left). */
.list-row { border: 0; border-bottom: 1px solid var(--border); background: #fff; cursor: pointer; transition: background 0.1s; }
.list-row:last-child { border-bottom: 0; }
.list-row.is-open { background: var(--surface-sunken); }

/* Platform default — the canonical interactive-row hover wash. Any row that
   opts in — a `data-row` attribute, or the .list-row primitive — gets it for
   free, so a new row list needs NO per-page :hover rule. Kept at :where()-zero
   specificity (only the :hover pseudo-class counts) so a page can still
   override for an open/active/selected resting state at normal specificity
   (e.g. .list-row.is-open above still wins when a sunken row is hovered). */
:where([data-row], .list-row):hover { background: var(--row-hover); }
.list-row .row-top { display: flex; align-items: center; gap: var(--sp-2); padding: 10px var(--sp-7); }
.list-row .row-id { color: var(--muted); font-family: var(--font-mono); font-size: var(--fs-micro); opacity: 0.7; }
.list-row .row-id:hover { color: var(--accent); opacity: 1; }

/* 11. SIDEBAR NAVIGATION =================================================== */
/* The 200px sidebar's selectors, captured as a reusable nav vocabulary. */
.nav { background: var(--card); border-right: 1px solid var(--border); padding: 12px 0; font-size: var(--fs-meta); }
.nav-label { font-size: var(--fs-meta); color: var(--muted); font-weight: var(--fw-semibold); padding: var(--sp-1) 14px; }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list li { padding: var(--sp-1) calc(14px - var(--sp-2)); margin: 0 var(--sp-2); border-radius: var(--r-md); cursor: pointer; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-list li:hover { background: var(--surface-hover); }
/* Subtle selection — a quiet gray fill, not an accent block. */
.nav-list li.is-selected { background: var(--bg); }
/* Nested child (ETL cycle): indented, muted, with a rounded accent bar when
   active and a moss "Active" pill (the ETL cycle page title's tokens) when
   it's the active cycle. Rows are inset --sp-2 from the edges, --r-md round. */
.nav-list li.nav-child { position: relative; margin-left: 16px; padding-left: 14px; color: var(--muted); border-radius: var(--r-md); }
.nav-list li.nav-child.is-selected { color: var(--fg); }
.nav-list li.nav-child.is-selected::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 3px; background: var(--accent); border-radius: var(--r-pill); }
.nav-list li.nav-child.is-active { padding-right: 64px; }
.nav-list li.nav-child.is-active::after { content: "Active"; position: absolute; right: var(--sp-2); top: 50%; transform: translateY(-50%); padding: 2px var(--sp-3); border-radius: var(--r-pill); background: var(--moss-soft-bg); color: var(--moss-soft-fg); font-size: var(--fs-micro); line-height: 1.4; }

/* 12. TIER CASCADE ("Applies to" selector) ================================ */
/* Chevron-shaped segments in one bordered strip: General → Object → Project.
   General is text-only; Object/Project tint when "lit", stronger when "origin"
   (the rule's own level); a disabled-for-project segment goes muted + struck. */
.cascade { display: inline-flex; align-items: stretch; height: 30px; font-size: var(--fs-sm); border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; color: var(--muted); }
.cascade-seg { display: inline-flex; align-items: center; background: transparent; color: inherit; border: 0; padding: 0 18px 0 14px; font: inherit; cursor: pointer; position: relative; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); margin-right: -10px; }
.cascade-seg:first-child { width: 100px; justify-content: center; padding: 0; }
.cascade-seg + .cascade-seg { padding-left: 22px; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); }
.cascade-seg:last-child { padding-right: 16px; margin-right: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%); }
.cascade-seg:first-child:last-child { padding: 0; clip-path: none; }
/* State model (mirrors rules.js): `origin` = the segment the rule lives on;
   `lit` = the origin AND every segment DOWNSTREAM of it (so the origin is also
   lit). General as lit-only shows just fg color; Object/Project lit get the
   medium tint; any origin gets the strong tint. Specificity is split first-
   child vs not, and origin/disabled are declared AFTER lit so they win where
   they coexist (origin always also carries lit). */
.cascade-seg:first-child.lit { color: var(--fg); }
.cascade-seg:not(:first-child).lit { background: var(--accent-tint); color: var(--fg); }
.cascade-seg:first-child.origin,
.cascade-seg:not(:first-child).origin { background: var(--accent-tint-strong); color: var(--accent); font-weight: var(--fw-semibold); cursor: default; }
.cascade-seg:not(.origin):not(:first-child):hover { background: var(--accent-wash); }
.cascade-seg.disabled-for-project,
.cascade-seg.disabled-for-project.lit,
.cascade-seg.disabled-for-project.origin { background: transparent; color: var(--muted); font-weight: var(--fw-regular); text-decoration: line-through; }
/* A level the rule cannot move to (a transformation rule is project-only, an
   object type outside the catalog has no object level): faded, not clickable,
   no hover wash. The segment is a disabled button. */
.cascade-seg.locked,
.cascade-seg.locked.lit { background: transparent; color: var(--muted); cursor: not-allowed; opacity: 0.55; }
.cascade-seg.locked:not(.origin):not(:first-child):hover { background: transparent; }

/* 13. FILE / LIST ROWS + STATUS SPINNERS =================================== */
/* Workspace file rows (source / transformed / reports). Filenames read as
   plain text (not blue links) with a hover underline; trailing actions are
   quiet (hover-revealed). Per feedback: a SUBTLE border now separates rows. */
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.file-row { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm); padding: var(--sp-2) 0; border-top: 1px solid var(--border); }
.file-row:first-child { border-top: 0; }
.file-row a, .file-row .file-name { flex: 1 1 auto; min-width: 0; color: var(--fg); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row a:hover { text-decoration: underline; }
.file-row .file-meta { font-size: var(--fs-micro); color: var(--muted); white-space: nowrap; }
/* Status slot (20px): indeterminate spinner, determinate upload ring, or icon. */
.status-slot { flex: 0 0 auto; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }

/* Indeterminate spinner — tint via --spin-color (accent for profiling, ok for
   validation). */
.spinner { width: 13px; height: 13px; border-radius: 50%; border: 2px solid #c7d0dd; border-top-color: var(--spin-color, var(--accent)); animation: ws-spin 0.7s linear infinite; }
.spinner.ok { --spin-color: var(--ok); }
.spinner.warn { --spin-color: var(--warn); } /* a transform generating its load file */
.spinner.lg { width: 30px; height: 30px; border-width: 3px; }
/* Determinate upload ring — fills clockwise to --pct%. */
.upload-ring { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--pct, 0) * 1%), #c7d0dd 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px)); }

/* Drop target: while a file is dragged over a lane it lights up as a receiver —
   dashed accent border + faint accent wash + inset ring. Toggle via JS. */
.dropzone { position: relative; }
.dropzone.is-dragover { border-color: var(--accent); border-style: dashed; background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent); }
.dropzone.is-dragover * { pointer-events: none; }
/* The "drop a file" hint is an OPAQUE overlay covering the whole lane — incl.
   the run-bar — so nothing underneath shows through it while dragging. */
.drop-hint { display: none; }
.dropzone.is-dragover .drop-hint {
  display: flex; align-items: center; justify-content: center;
  position: absolute; inset: 0; z-index: 2; border-radius: inherit;
  background: var(--accent-soft-bg); color: var(--accent);
  font-size: var(--fs-sm); font-weight: var(--fw-medium); text-align: center; padding: 0 var(--sp-4);
}

/* 14. RUN BAR (pipeline stages) =========================================== */
/* A full-width action bar fused to the BOTTOM of a lane/card: it breaks out of
   the lane padding to span edge-to-edge and sits on the card's bottom border.
   Per feedback: TOP corners are square (only the bottom corners follow the
   card's radius); separated from content above by a single quiet hairline.
   Resting state is a neutral grey; on hover it takes its stage color —
   amber for transform, green for validate. */
.run-bar {
  margin: 0 calc(-1 * var(--sp-4)) calc(-1 * var(--sp-4));
  width: auto; height: 33px; border: 0; border-top: 1px solid var(--border);
  border-radius: 0 0 var(--r-md) var(--r-md); /* square top, rounded bottom */
  display: flex; align-items: center; justify-content: center; gap: var(--sp-3);
  background: var(--run-bar-bg); color: var(--fg);
  font-size: var(--fs-meta); font-weight: var(--fw-semibold); letter-spacing: 0.02em;
  cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
}
.run-bar svg { width: 15px; height: 15px; }
/* Keep the top hairline neutral on hover — otherwise the global button:hover
   rule recolors it to accent blue. */
.run-bar:not(:disabled):hover { filter: none; border-color: var(--border); }

/* Pipeline stage selector (rules-page top bar) — adopted from the live SPA
   (review 2026-06-12), restyled in the same review: NO shadow/lift (keeps
   "shadows only on transient overlays" intact); the active stage instead
   fills with its tint and carries a thin (0.5px), lightened border in its own
   icon color (50% currentColor — reserved transparent at rest, so no jump).
   Each stage owns a hue: assessment blue, transformation amber, validation
   green. */
.stage-nav { display: inline-flex; align-items: center; gap: 0; }
/* Regular button proportions — icon + area name inline (2026-07-16; formerly
   44px icon-only circles). */
.stage {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  gap: 10px; padding: 0 14px 0 0; background: transparent;
  border: 0.5px solid transparent; border-radius: var(--r-sm); color: var(--muted); cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.stage .stage-label { font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap; }
/* The icon owns the button's left end as a full-height square block — only
   that block carries the stage tint when active; the label half of the button
   stays on white. Its padding (not the button's) sets the control height. */
.stage svg {
  width: 18px; height: 18px; display: block; flex: 0 0 auto;
  box-sizing: content-box; padding: 7px;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  background: transparent; transition: background 0.16s ease;
}
/* No background change on hover — the buttons sit on the grey page, where the
   global button:hover brightness filter would grey the active stage's white
   fill into the page. Hover speaks through color only (the per-stage hue
   rules below out-rank the plain --fg fallback). */
.stage:hover { color: var(--fg); }
.stage:hover:not(:disabled) { filter: none; }
.stage.is-active { background: #fff; border-color: color-mix(in srgb, currentColor 50%, transparent); }
.stage-assessment:hover                { color: var(--stage-assess-fg); }
.stage-assessment.is-active            { color: var(--stage-assess-fg); }
.stage-assessment.is-active svg        { background: var(--stage-assess-bg); }
.stage-transformation:hover            { color: var(--stage-transform-fg); }
.stage-transformation.is-active        { color: var(--stage-transform-fg); }
.stage-transformation.is-active svg    { background: var(--stage-transform-bg); }
.stage-validation:hover                { color: var(--stage-validate-fg); }
.stage-validation.is-active            { color: var(--stage-validate-fg); }
.stage-validation.is-active svg        { background: var(--stage-validate-bg); }
.stage-link { width: 38px; height: 2px; border-radius: 1px; background: var(--border); margin: 0 6px; pointer-events: none; } /* 48→38px */
.run-bar.transform:not(:disabled):hover { filter: none; background: var(--stage-transform-bg); color: var(--stage-transform-fg); border-color: var(--border); }
.run-bar.validate:not(:disabled):hover  { filter: none; background: var(--stage-validate-bg);  color: var(--stage-validate-fg); border-color: var(--border); }
.run-bar:disabled { color: var(--control-disabled-fg); background: #f6f7f9; cursor: not-allowed; }

/* Clickable summary block (e.g. "View rules ›"): edge-to-edge inside a lane,
   hairlined top/bottom, hover wash, with a hover-revealed accent affordance. */
.linked-block { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 calc(-1 * var(--sp-4)) var(--sp-3); padding: var(--sp-2) var(--sp-4); cursor: pointer; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); transition: background var(--t-fast); }
.linked-block:hover, .linked-block:focus-visible { background: var(--surface-hover); outline: none; }
.linked-block .link-cue { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap; opacity: 0; transition: opacity var(--t-fast); }
.linked-block:hover .link-cue, .linked-block:focus-visible .link-cue { opacity: 1; }

/* 14b. ADMIN LISTS (members, domains) ====================================== */
/* The management-card grammar Settings (Domains) and Project settings
   (Members, API keys) shared from their route sheets, moved here unchanged
   (D10) so the Custom Objects pages build from the same pieces. Below the
   card tables' own look (§7), so it keeps the order it had as a route sheet.
   .m-row / .m-add are JS hooks; the add row is the one place .m-add styles. */
/* Right-aligned toolbar sitting just above the table: holds the "+" add
   trigger, lined up over the rows' right-hand ✕ / kebab column. */
.m-toolbar { display: flex; align-items: center; justify-content: flex-end; margin: 0 0 4px; }
/* Without a visible "+" the toolbar takes no room, so the table keeps the intro's spacing. */
.m-toolbar:not(:has(> :not([hidden]))) { display: none; }
.m-toolbar .add-btn { padding: 4px 8px; }
.m-toolbar .add-btn svg { width: 17px; height: 17px; }
/* The identity cell (a member's td.m-id, a domain's td.d-main) takes the
   width and caps it at zero so its text still truncates (a table cell
   otherwise grows to its no-wrap content); the role cell keeps its 140px
   column. */
td.m-id { width: 100%; max-width: 0; }
td.d-main { width: 100%; max-width: 0; }
/* A one-line identity inside td.m-id: the name, the muted email on the same
   baseline, then any pill, each text part truncating. Project overview's
   member line (routes/project-overview.css), copied unchanged (D11); that
   sheet keeps its copy. */
.ov-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: var(--sp-3); }
.ov-title { white-space: nowrap; }
.ov-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
td.m-role { width: 140px; white-space: nowrap; }
/* Inline add row: its fields sit a touch tighter so the editable row matches
   the height of the read-only rows around it. */
.m-add .m-id input { width: 100%; padding: 6px 8px; font-size: var(--fs-sm); }
.m-role select { padding: 6px 8px; font-size: var(--fs-sm); }
/* The quiet ✕ in a row's actions cell: remove, or cancel an add row. The
   icon button's look, on the toolbar ＋'s footprint (a 17px icon in
   4px 8px padding), so the ✕ column lines up under the ＋. */
.m-remove {
  display: inline-flex; align-items: center; justify-content: center;
  width: calc(17px + 2 * 8px + 2px); height: calc(17px + 2 * 4px + 2px); padding: 0;
  background: transparent; color: var(--muted); border: 1px solid transparent;
  border-radius: var(--r-sm); font-size: 12px; line-height: 1; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.m-remove:hover { background: var(--surface-hover); color: var(--fg); border-color: var(--border); }
/* The leading disclosure column, and the detail row a row inserts under
   itself (the same card-table grammar, dense). Below 640px the detail table
   stacks: each cell on its own line, captioned by its column name
   (data-label). */
td.d-toggle { width: 22px; padding-right: 0; }
tr.d-types-row > td.d-types-cell { padding-left: 38px; background: var(--surface-sunken); }
table.d-types { width: 100%; }
.d-types-msg { font-size: var(--fs-sm); }
.d-types-msg.status { margin: 0; display: inline-block; }
.d-types-retry { margin-left: 8px; }
.d-types-note { font-size: var(--fs-meta); margin-top: 6px; }
@media (max-width: 640px) {
  table.d-types thead { display: none; }
  table.d-types tr, table.d-types td { display: block; }
  table.d-types td.num { text-align: left; }
  table.d-types td::before { content: attr(data-label) ": "; color: var(--muted); }
  table.d-types td.cell-primary::before { content: none; }
}

/* 15. UTILITIES + KEYFRAMES ================================================ */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--card-gap); }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.text-ok { color: var(--ok); } .text-err { color: var(--err); } .text-warn { color: var(--warn); }
.tabular { font-variant-numeric: tabular-nums; }
/* Visually hidden, still read by assistive tech (live regions, labels). */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@keyframes dm-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes ws-spin { to { transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeletons (C6): a glowing block where a value from the API is still
   loading. A page's getHtml() paints its static shell with these in every
   data-slot; DMSkeleton (dm-skeleton.js) builds them and swaps the content in.
   The light band sweeps left to right; it shows from the first paint, with no
   delay or fade, and under reduced motion it stays a still block. Shapes are
   modifiers of the one base, so they share its sweep. A route sizes nothing:
   it picks a modifier, or sets --skel-h / --skel-size on its own container. */
.skel {
  display: inline-block; vertical-align: middle;
  width: 3ch; height: 0.8em; border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--border) 25%, var(--surface-hover) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: dm-skel 1.4s ease-in-out infinite;
}
.skel.skel-sm { width: 7ch; }
.skel.skel-md { width: 10ch; }
.skel.skel-lg { width: 14ch; }
.skel.skel-full { width: 100%; }
/* A box that fills its container: a chart, a progress line. */
.skel.skel-block { display: block; width: 100%; height: var(--skel-h, 1lh); }
/* A thin pill: progress and Gantt bars. */
.skel.skel-bar { width: 40%; height: 6px; border-radius: var(--r-pill); }
/* A square: stage cells, icons. */
.skel.skel-square { width: var(--skel-size, 1lh); height: var(--skel-size, 1lh); flex: 0 0 auto; }
.skel.skel-square + .skel.skel-square { margin-left: var(--sp-1); }
/* A row made of skeletons stays inert: no hover wash, no pointer. */
.skel-row { pointer-events: none; }
.skel-row:hover, :where([data-row], .list-row).skel-row:hover { background: transparent; }
@keyframes dm-skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* 16. REPORTS (the reporting standard, IN174) ============================== *
   Report pages (the Data compare Results view first) share one look: cards on
   a 12-column grid (12 / 6 / 4) with equal heights per row, KPI tiles that
   wrap, dense single-line tables edge to edge in their card, D3 charts drawn
   by components/report-charts.js (DMComponents.ReportChart) in the --rp-*
   tokens, a grouped legend that doubles as the selection, the shared
   tooltip on every mark, and a Chart/Table toggle on every chart (the .seg
   control). The container is the measure, never the viewport, so a report
   fits whatever column hosts it: no sideways scroll from 390 to 1920 px. */
.report { container-type: inline-size; display: flex; flex-direction: column; gap: var(--card-gap); min-width: 0; }
.report-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--card-gap); align-items: stretch; min-width: 0; }
.report-grid > * { grid-column: span 12; min-width: 0; }
.report-grid > .span-6 { grid-column: span 6; }
.report-grid > .span-4 { grid-column: span 4; }
@container (max-width: 899px) {
  .report-grid > .span-6, .report-grid > .span-4 { grid-column: span 12; }
}
.report-card { display: flex; flex-direction: column; min-width: 0; margin: 0; }
.report-card-head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3); min-width: 0; }
.report-card-head > h3 { margin: 0; font-size: var(--fs-h2); flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* KPI tiles: wrap, never squeeze; the reserved height keeps the row still
   while the run read lands. */
.report-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-4); min-width: 0; }
.report-kpi {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5); min-height: 92px; min-width: 0;
  display: flex; flex-direction: column; justify-content: center; gap: var(--sp-1);
}
.report-kpi-label { font-size: var(--fs-meta); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-kpi-value { font-size: var(--fs-h1); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-kpi.is-gauge { padding: var(--sp-2) var(--sp-4); }

/* The chart component's frame. Its height is reserved by the host
   (--chart-h) so nothing moves when the data lands. */
.report-chart { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; min-height: var(--chart-h, 0); }
.report-chart-bar { display: flex; align-items: flex-start; gap: var(--sp-4); flex-wrap: wrap; min-width: 0; }
.report-chart-bar > .seg { margin-left: auto; }
.report-chart-body { min-width: 0; overflow: hidden; }
.report > .tabs { flex-wrap: wrap; }
.report table th { overflow: hidden; text-overflow: ellipsis; }
/* A host card's chart slot: its height is reserved before the data lands. */
.report-chart-host { min-width: 0; min-height: var(--chart-h, 120px); }
.report-kpi.is-gauge .report-chart-host { --chart-h: 76px; display: flex; justify-content: center; }
.report-kpi.is-gauge .report-chart { align-items: center; }
/* An in-cell bar with its value, right-aligned in a numeric cell. */
.report-inbar { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); min-width: 0; }
.report-inbar > .report-stack { max-width: 80px; }
.report-chart-body > svg { display: block; width: 100%; height: auto; overflow: visible; }
.report-chart svg text { font-family: var(--font-sans); font-size: var(--fs-micro); fill: var(--muted); }
.report-chart svg text.report-value { fill: var(--fg); font-variant-numeric: tabular-nums; }
/* Bar rows (hbars, stackbars): the label and the value at the small size, the row lighter on hover. */
.report-chart svg text.report-row-label { font-size: var(--fs-sm); fill: var(--fg); }
.report-chart svg .report-hrow text.report-value { font-size: var(--fs-sm); }
.report-chart svg .report-hrow:hover .report-bar { filter: brightness(1.06); }
/* A row that opens something (onRowClick): its label and bars one target, the pointer over all of it
   (its children too, over the [data-tip] default cursor below), the row wash on hover, a focus ring. */
.report-chart svg .report-hrow.is-clickable, .report-chart svg .report-hrow.is-clickable * { cursor: pointer; }
.report-chart svg .report-hrow.is-clickable:hover > rect.report-hit { fill: var(--row-hover); }
.report-chart svg .report-hrow.is-clickable:focus-visible > rect.report-hit { stroke: var(--accent); stroke-width: 2; }
/* markMatrix: a record row is one band behind its head and cells, lit with the table's row hover wherever
   the pointer is on it; the pointer over all of it (g.report-row outranks the [data-tip] default cursor below). */
.report-chart svg .report-row > rect.report-row-band { fill: transparent; }
.report-chart svg .report-row:hover > rect.report-row-band { fill: var(--row-hover); }
.report-chart svg g.report-row, .report-chart svg g.report-row * { cursor: pointer; }
.report-chart svg text.report-gauge-value { font-size: var(--fs-h1); font-weight: var(--fw-semibold); fill: var(--fg); }
.report-chart svg .report-track { fill: var(--rp-grid); }
.report-chart svg .report-gridline { stroke: var(--rp-grid); }
.report-chart svg .report-axis { stroke: var(--rp-axis); }
.report-chart svg [data-tip] { cursor: default; }
.report-chart svg .report-cell:focus-visible > rect.report-hit { stroke: var(--accent); stroke-width: 2; }
.report-chart svg rect.report-hit { fill: transparent; }
.report-chart svg .report-col-head { cursor: pointer; }
.report-chart svg .report-col-head:hover text, .report-chart svg .report-col-head.is-focused text { fill: var(--accent); }
.report-chart svg .report-row-head { cursor: pointer; }
.report-chart svg .report-row-head:hover text { fill: var(--accent); }

/* The grouped legend, which is also the selection: each item is a toggle
   button (aria-pressed). Colour always comes with the shape and the text. */
.report-legend { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); min-width: 0; }
.report-legend-group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); min-width: 0; }
.report-legend-label { font-size: var(--fs-micro); color: var(--muted); }
.report-legend-item {
  display: inline-flex; align-items: center; gap: var(--sp-2); background: none; border: 0;
  padding: 2px var(--sp-1); border-radius: var(--r-sm); font: inherit; font-size: var(--fs-meta);
  color: var(--fg); cursor: pointer; white-space: nowrap;
}
.report-legend-item:hover { background: var(--surface-hover); }
.report-legend-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.report-legend-item[aria-pressed="false"] { color: var(--muted); }
.report-legend-item[aria-pressed="false"] .report-swatch { opacity: 0.3; }
.report-swatch { width: 10px; height: 10px; flex: 0 0 auto; display: inline-block; }
.report-swatch.shape-square, .report-swatch.shape-bar { border-radius: 1px; }
.report-swatch.shape-circle { border-radius: 50%; }
.report-swatch.shape-triangle { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.report-swatch.shape-diamond { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.report-swatch.shape-dash { height: 3px; border-radius: 1px; }
.report-swatch.shape-none { background: transparent !important; border: 1px solid var(--rp-axis); }

/* Pattern and magnitude fills for HTML marks (swatches, in-cell stacks): the
   data-token attribute names the --rp-* token, so a script never writes a
   colour. */
[data-token="--rp-grid"] { background: var(--rp-grid); }
[data-token="--rp-h1"] { background: var(--rp-h1); } [data-token="--rp-h2"] { background: var(--rp-h2); }
[data-token="--rp-h3"] { background: var(--rp-h3); } [data-token="--rp-h4"] { background: var(--rp-h4); }
[data-token="--rp-h5"] { background: var(--rp-h5); } [data-token="--rp-h6"] { background: var(--rp-h6); }
[data-token="--rp-h7"] { background: var(--rp-h7); } [data-token="--rp-h8"] { background: var(--rp-h8); }
[data-token="--rp-pat-match"] { background: var(--rp-pat-match); }
[data-token="--rp-pat-hidden"] { background: var(--rp-pat-hidden); }
[data-token="--rp-pat-spaces"] { background: var(--rp-pat-spaces); }
[data-token="--rp-pat-case"] { background: var(--rp-pat-case); }
[data-token="--rp-pat-other"] { background: var(--rp-pat-other); }
[data-token="--rp-pat-notfound"] { background: var(--rp-pat-notfound); }
svg [data-token] { background: none; }

/* An in-cell 100% stack (a field's pattern split in a list or table cell). */
.report-stack { display: flex; height: 6px; border-radius: var(--r-pill); overflow: hidden; background: var(--rp-grid); min-width: 40px; flex: 1 1 auto; }
.report-stack > i { display: block; height: 100%; }
/* A status dot always travels with its text. */
.report-dot { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-meta); color: var(--muted); white-space: nowrap; }
.report-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--rp-axis)); flex: 0 0 auto; }
.report-dot.is-ok { --dot: var(--rp-pat-match); }
.report-dot.is-diff { --dot: var(--rp-pat-other); }
.report-dot.is-warn { --dot: var(--rp-pat-case); }
.report-dot.is-off { --dot: var(--rp-axis); }

/* Report tables: one line per cell with an ellipsis, no bold, edge to edge. */
.report table td, .report table th { white-space: nowrap; }
.report table td { max-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: var(--fw-regular); }
/* A cell whose text is a .cell-clip box clips in that box, so the cell itself stays open: the box's
   hover float (the whole text) then lies over the next cells instead of being cut at this one's edge. */
.report table td:has(.cell-clip) { overflow: visible; }
.report table td .cell-primary { font-weight: var(--fw-regular); }
.report table { table-layout: fixed; width: 100%; }
.report .card > table { width: calc(100% + 2 * var(--sp-5)); }
@container (max-width: 599px) { .report table .col-low { display: none; } }

/* Run facts, the header of a report. */
.report-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: var(--sp-2) var(--sp-5); margin: 0; min-width: 0; }
.report-facts > div { min-width: 0; }
.report-facts dt { font-size: var(--fs-meta); color: var(--muted); }
.report-facts dd { margin: 0; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; min-width: 0; }
.report-head > select { min-width: 0; max-width: 100%; flex: 1 1 260px; }
.report-actions { display: inline-flex; gap: var(--sp-2); flex-wrap: wrap; margin-left: auto; }

/* List, list and detail panes (Sheet details): three columns on a wide
   report, the first list as a select above the rest on a medium one, all
   stacked on a narrow one (measured on the report, not the viewport). */
.report-panes { display: grid; grid-template-columns: minmax(160px, 220px) minmax(200px, 280px) minmax(0, 1fr); gap: var(--sp-4); align-items: start; min-width: 0; }
.report-panes > * { min-width: 0; }
.report-pane-select { display: none; width: 100%; }
@container (max-width: 959px) {
  .report-panes { grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); }
  .report-panes > .report-pane-list.is-first { display: none; }
  .report-pane-select { display: block; grid-column: 1 / -1; }
}
@container (max-width: 599px) {
  .report-panes { grid-template-columns: minmax(0, 1fr); }
}
.report-list { list-style: none; margin: 0; padding: 0; }
.report-list-item {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-width: 0;
  background: none; border: 0; border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3);
  font: inherit; font-size: var(--fs-sm); color: var(--fg); text-align: left; cursor: pointer;
}
.report-list-item:hover { background: var(--row-hover); }
.report-list-item[aria-selected="true"], .report-list-item[aria-pressed="true"] { background: var(--surface-info); }
.report-list-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.report-list-name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-list-meta { flex: 0 0 auto; font-size: var(--fs-meta); color: var(--muted); font-variant-numeric: tabular-nums; }
.report-list-item .report-stack { flex: 0 0 56px; }

/* The matrix's toolbar and field window control. */
.report-toolbar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; min-width: 0; margin-bottom: var(--sp-3); }
.report-toolbar input[type="search"] { flex: 1 1 160px; min-width: 0; max-width: 260px; }
.report-toolbar select { min-width: 0; }
.report-window, .report-pager { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-meta); color: var(--muted); white-space: nowrap; max-width: 100%; min-width: 0; }
.report-window-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.report-pager { margin-left: auto; }
