/* ============================================================
   ProAudit "Audit Journal" components — pa-* classes
   The ONLY place primitives are styled. Page CSS = layout only.
   RULE (normative, also for CLAUDE.md): raw color values are allowed
   ONLY in proaudit-theme.css and this file — never in pa-pages/*.css,
   .razor.css, or markup.
   ============================================================ */

/* ---------- 01 Masthead ---------- */
.pa-eyebrow { font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--pa-orange-deep); margin-bottom: 6px; }
.pa-page-title { font-family: var(--pa-font-display); font-size: 2.1rem; font-weight: 700; letter-spacing: -.01em; margin: 0 0 4px; color: var(--pa-ink); }
.pa-page-sub { font-size: .9rem; color: var(--pa-muted); margin: 0; }
.pa-masthead { margin-bottom: 26px; }
.pa-section-label { font-size: .64rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--pa-faint); border-bottom: 1px solid var(--pa-hair); padding-bottom: 7px; margin-bottom: 18px; display: flex; align-items: baseline; gap: 8px; }
.pa-section-label .pa-section-num { font-family: var(--pa-font-numeric); color: var(--pa-orange-text); }

/* ---------- 02 Buttons ---------- */
.pa-btn { font-family: var(--pa-font-body); font-size: .84rem; font-weight: 700; border-radius: var(--pa-radius); padding: 10px 22px; cursor: pointer; border: none; transition: all var(--pa-dur-fast) ease; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.pa-btn--primary { background: var(--pa-orange); color: var(--pa-orange-fg); box-shadow: var(--pa-shadow-btn); }
.pa-btn--primary:hover { background: var(--pa-orange-hover); }
.pa-btn--secondary { background: var(--pa-card); color: var(--pa-ink); border: 1px solid var(--pa-hair-strong); font-weight: 600; }
.pa-btn--secondary:hover { border-color: var(--pa-orange-deep); }
.pa-btn--ghost { font-family: var(--pa-font-display); font-style: italic; background: transparent; color: var(--pa-orange-deep); font-weight: 400; font-size: .92rem; padding: 10px 12px; }
.pa-btn--ghost:hover { color: var(--pa-orange-text); }
.pa-btn--danger { background: transparent; color: var(--pa-bad-fg); border: 1px solid rgba(192, 88, 74, .45); font-weight: 600; }
.pa-btn--danger:hover { background: var(--pa-bad-bg); }
.pa-btn:disabled, .pa-btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.pa-btn--sm { padding: 6px 14px; font-size: .78rem; border-radius: var(--pa-radius-sm); }
.pa-btn--icon { width: 38px; height: 38px; padding: 0; justify-content: center; }

/* ---------- 03 Pills ---------- */
.pa-pill { font-size: .7rem; font-weight: 600; padding: 4px 12px; border-radius: 100px; border: 1.5px solid; display: inline-block; line-height: 1.35; }
.pa-pill--ok { border-color: var(--pa-ok-border); background: var(--pa-ok-bg); color: var(--pa-ok-fg); }
.pa-pill--warn { border-color: var(--pa-warn-border); background: var(--pa-warn-bg); color: var(--pa-warn-fg); }
.pa-pill--bad { border-color: var(--pa-bad-border); background: var(--pa-bad-bg); color: var(--pa-bad-fg); }
.pa-pill--neutral { border-color: var(--pa-hair-strong); background: var(--pa-card); color: var(--pa-neutral-fg); }
.pa-pill--info { border-color: var(--pa-info-border); background: var(--pa-info-bg); color: var(--pa-info-fg); }
.pa-pill--adas { border-color: var(--pa-adas-border); background: var(--pa-adas-bg); color: var(--pa-adas-fg); }
.pa-tier-chip { display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }
.pa-tier-chip svg { width: 11px; height: 11px; flex-shrink: 0; }

/* ---------- 04 Cards ---------- */
.pa-card { background: var(--pa-card); border: 1px solid var(--pa-hair); border-radius: var(--pa-radius); padding: 18px 20px; position: relative; }
.pa-card--feature { border-top: 3px solid var(--pa-orange); }
/* Impact-tier left-accent edges (finding cards). Mapping:
   ADAS → adas · High → bad · Moderate → warn · Low → info ·
   Advisory → neutral · Compliant/Pass → ok */
.pa-card--accent-adas    { border-left: 3px solid var(--pa-adas-border); }
.pa-card--accent-bad     { border-left: 3px solid var(--pa-bad-border); }
.pa-card--accent-warn    { border-left: 3px solid var(--pa-warn-border); }
.pa-card--accent-info    { border-left: 3px solid var(--pa-info-border); }
.pa-card--accent-neutral { border-left: 3px solid var(--pa-hair-strong); }
.pa-card--accent-ok      { border-left: 3px solid var(--pa-ok-border); }
.pa-card-num { font-family: var(--pa-font-numeric); position: absolute; top: 16px; right: 18px; font-size: .72rem; font-weight: 700; color: var(--pa-orange-text); }
.pa-card-title { font-family: var(--pa-font-display); font-size: 1.05rem; font-weight: 600; margin: 0 0 6px; color: var(--pa-ink); }
.pa-card-body { font-size: .82rem; color: var(--pa-muted); margin: 0; line-height: 1.5; }
.pa-kpi-label { font-size: .64rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--pa-faint); }
.pa-kpi-value { font-family: var(--pa-font-numeric); font-size: 1.7rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--pa-ink); }
.pa-kpi-delta { font-size: .76rem; color: var(--pa-teal-deep); font-weight: 600; margin-top: 2px; }
.pa-kpi-delta--down { color: var(--pa-bad-fg); }

/* ---------- 05 Forms ---------- */
.pa-field { margin-bottom: 0; }
.pa-label { display: block; font-size: .76rem; font-weight: 700; margin-bottom: 6px; color: var(--pa-ink); }
.pa-input { width: 100%; font-family: var(--pa-font-body); font-size: .86rem; color: var(--pa-ink); background: var(--pa-card); border: 1px solid var(--pa-hair-strong); border-radius: var(--pa-radius-sm); padding: 9px 12px; outline: none; transition: border-color var(--pa-dur-fast) ease, box-shadow var(--pa-dur-fast) ease; }
.pa-input:focus { border-color: var(--pa-orange); box-shadow: var(--pa-focus-ring); }
.pa-input--error { border-color: var(--pa-bad-border); box-shadow: 0 0 0 3px rgba(192, 88, 74, .14); }
/* Quantity stepper. A new primitive: nothing in pa-* covered a numeric stepper, and every other
   numeric field in this feature is free text. Checking a row seeds 1; the arrows move by the unit
   the operation actually bills in, which is why the unit rides inside the control. */
.pa-step{display:inline-flex;align-items:stretch;border:1px solid var(--pa-hair-strong);
  border-radius:var(--pa-radius-sm);background:var(--pa-card);overflow:hidden;
  transition:border-color var(--pa-dur-fast) ease,opacity var(--pa-dur-fast) ease}
.pa-step:focus-within{border-color:var(--pa-orange);box-shadow:var(--pa-focus-ring)}
.pa-step-btn{width:28px;border:none;background:transparent;color:var(--pa-orange-deep);
  font-family:var(--pa-font-body);font-size:1rem;font-weight:700;line-height:1;cursor:pointer;
  padding:0;transition:background var(--pa-dur-fast) ease}
.pa-step-btn:hover{background:var(--pa-orange-tint)}
.pa-step-btn:disabled{color:var(--pa-hair-strong);cursor:not-allowed;background:transparent}
.pa-step-input{width:46px;border:none;background:transparent;text-align:center;
  font-family:var(--pa-font-numeric);font-variant-numeric:tabular-nums;font-size:.86rem;
  font-weight:600;color:var(--pa-ink);padding:6px 0;outline:none}
.pa-step-unit{display:flex;align-items:center;padding:0 9px 0 3px;font-size:.7rem;font-weight:600;
  color:var(--pa-faint-decor);border-left:1px solid var(--pa-hair);background:var(--pa-card-tint)}
.pa-chip{font-family:var(--pa-font-body);font-size:.74rem;font-weight:600;color:var(--pa-muted);
  background:transparent;border:1px solid var(--pa-hair-strong);border-radius:100px;
  padding:6px 13px;cursor:pointer;transition:all var(--pa-dur-fast) ease;white-space:nowrap}
.pa-chip:hover{border-color:var(--pa-orange-deep);color:var(--pa-ink)}
.pa-chip[aria-pressed="true"]{background:var(--pa-orange-tint);border-color:var(--pa-orange);
  color:var(--pa-orange-deep)}
.pa-help { font-size: .72rem; color: var(--pa-faint); margin-top: 5px; }
.pa-error { font-size: .72rem; color: var(--pa-bad-fg); font-weight: 600; margin-top: 5px; }
.pa-check { display: inline-flex; gap: 8px; align-items: center; font-size: .84rem; cursor: pointer; color: var(--pa-ink); }
.pa-check-box { width: 17px; height: 17px; border: 1.5px solid var(--pa-hair-strong); border-radius: 4px; background: var(--pa-card); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pa-check--on .pa-check-box { background: var(--pa-orange); border-color: var(--pa-orange); color: var(--pa-orange-fg); font-size: .7rem; font-weight: 800; }
.pa-toggle { width: 38px; height: 21px; border-radius: 100px; background: var(--pa-hair-strong); position: relative; transition: background var(--pa-dur-fast) ease; flex-shrink: 0; cursor: pointer; }
.pa-toggle::after { content: ''; position: absolute; width: 17px; height: 17px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: left var(--pa-dur-fast) ease; box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.pa-toggle--on { background: var(--pa-teal); }
.pa-toggle--on::after { left: 19px; }

/* ---------- 06 Tabs ---------- */
.pa-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--pa-hair); }
.pa-tab { font-family: var(--pa-font-body); font-size: .84rem; font-weight: 600; color: var(--pa-muted); background: transparent; border: none; padding: 9px 16px 11px; cursor: pointer; position: relative; }
.pa-tab:hover { color: var(--pa-ink); }
.pa-tab--active { color: var(--pa-ink); }
.pa-tab--active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2.5px; background: var(--pa-orange); border-radius: 2px; }
.pa-tab-count { font-family: var(--pa-font-numeric); font-size: .68rem; color: var(--pa-orange-deep); margin-left: 5px; }

/* Anchor variant of .pa-tab, for tab strips that NAVIGATE between sibling
   routes rather than swapping panels in one document (see RouteTabs.razor).
   .pa-tab was authored for <button>, so an <a> has to be given back everything
   a button gets for free. Measured in the browser, not guessed — every
   declaration here closes a real computed-style difference:
     - display/align/justify/vertical-align: MudBlazor's reset makes every
       <button> an inline-flex centred box.
     - line-height: that same reset sets `inherit`; an anchor would otherwise
       compute `normal` and render a shorter box, misaligning the
       .pa-tab--active underline against a neighbouring button strip.
     - letter-spacing: the UA stylesheet resets form controls to `normal`,
       so a button does NOT inherit the page's tracking but an anchor does —
       worth ~1.4px of width per tab.
     - text-decoration: no underline.
   Anchor-scoped on purpose: every existing button.pa-tab strip stays
   byte-identical. */
a.pa-tab { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; box-sizing: border-box; text-align: center; line-height: inherit; letter-spacing: normal; text-decoration: none; }

/* Route-backed strips sit directly under a page masthead and own the gap to
   the content below; in-page strips are spaced by their own page stylesheet. */
.pa-tabs--route { margin: 0 0 22px; }

/* ---------- 07 Data grid ---------- */
/* .pa-num is also a standalone numeral utility (Outfit + tabular figures)
   for counts/amounts outside tables — VINs, KPI digits, money chips. */
.pa-num { font-family: var(--pa-font-numeric); font-variant-numeric: tabular-nums; }
.pa-mono { font-family: var(--pa-font-mono); }
.pa-grid-scroll { overflow-x: auto; }
.pa-grid { width: 100%; border-collapse: collapse; background: var(--pa-card); border: 1px solid var(--pa-hair); border-radius: var(--pa-radius); overflow: hidden; font-size: .84rem; }
.pa-grid thead th { text-align: left; font-size: .76rem; font-weight: 700; color: var(--pa-thead-fg); padding: 10px 14px; border-bottom: 1px solid var(--pa-hair-strong); background: var(--pa-thead-bg); white-space: nowrap; }
.pa-grid thead th.pa-sorted { color: var(--pa-ink); }
.pa-grid thead th.pa-sorted::after { content: ' ↓'; color: var(--pa-orange-deep); }
/* Ascending variant of the sorted-header marker (precedent: .pa-num).
   Added for the Users-family migration; any sortable pa-grid can use it. */
.pa-grid thead th.pa-sorted--asc::after { content: ' ↑'; }
/* Native-button reset for sortable pa-grid headers — the <button> inside a
   <th> inherits the thead typography so sort targets stay keyboard-real.
   Added ONCE for the Users-family migration (pa-grid consumers reuse it). */
.pa-grid thead th .pa-sort-btn { background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.pa-grid thead th .pa-sort-btn:hover { color: var(--pa-ink); }
.pa-grid td { padding: 11px 14px; border-bottom: 1px solid var(--pa-row-border); color: var(--pa-ink); }
.pa-grid tbody tr:hover td { background: var(--pa-row-hover); }
.pa-grid tbody tr.pa-selected td { background: var(--pa-row-selected); }
.pa-grid tbody tr.pa-selected td:first-child { box-shadow: inset 3px 0 0 var(--pa-orange); }
.pa-grid .pa-num { font-variant-numeric: tabular-nums; font-weight: 600; }
.pa-grid .pa-rowact { color: var(--pa-orange-deep); font-weight: 600; font-size: .78rem; cursor: pointer; }
.pa-grid-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 4px 0; font-size: .78rem; color: var(--pa-muted); }
.pa-pager { display: flex; gap: 4px; }
.pa-page-btn { font-family: var(--pa-font-numeric); min-width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--pa-hair-strong); background: var(--pa-card); color: var(--pa-ink); font-size: .76rem; font-weight: 600; cursor: pointer; }
.pa-page-btn--current { background: var(--pa-ink); color: var(--pa-card); border-color: var(--pa-ink); }

/* ---------- 08 Callouts ---------- */
.pa-callout { border-radius: var(--pa-radius); padding: 13px 16px; font-size: .84rem; display: flex; gap: 10px; align-items: flex-start; border: 1px solid; margin-bottom: 10px; }
.pa-callout b, .pa-callout strong { font-weight: 700; }
.pa-callout--info { background: var(--pa-info-bg); border-color: #c6d2e2; color: #2c4664; }
.pa-callout--success { background: var(--pa-ok-bg); border-color: #b5e3dc; color: #00554f; }
.pa-callout--warning { background: var(--pa-warn-bg); border-color: #ecd3b2; color: #6e4416; }
.pa-callout--danger { background: var(--pa-bad-bg); border-color: #e8c5bd; color: #7c3328; }

.inbox-type-correction {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 260px) auto;
  align-items: end; gap: 12px; padding: 14px; margin-bottom: 14px;
}
.inbox-type-copy { display: grid; gap: 3px; min-width: 0; }
.inbox-type-help { color: var(--pa-faint); font-size: .76rem; }
.inbox-type-rerun-offer {
  grid-column: 1 / -1; display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
}
@media (max-width: 768px) {
  .inbox-type-correction { grid-template-columns: 1fr; }
  .inbox-type-rerun-offer { align-items: stretch; flex-direction: column; }
}

/* ---------- 09 Dialog ---------- */
.pa-dialog { background: var(--pa-card); border-radius: 14px; box-shadow: var(--pa-shadow-dialog); overflow: hidden; max-width: 640px; width: 100%; }
.pa-dialog--sm { max-width: 420px; }
.pa-dialog--lg { max-width: 920px; }
.pa-dialog-head { padding: 20px 24px 0; }
.pa-dialog-title { font-family: var(--pa-font-display); font-size: 1.3rem; font-weight: 700; margin: 0 0 4px; color: var(--pa-ink); }
.pa-dialog-body { padding: 12px 24px 20px; font-size: .86rem; color: var(--pa-muted); line-height: 1.55; }
.pa-dialog-foot { padding: 14px 24px 20px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--pa-hair); background: var(--pa-card-tint); }
@media (max-width: 480px) { .pa-dialog, .pa-dialog--sm, .pa-dialog--lg { max-width: 100vw; border-radius: 0; } }

/* ---------- 10 Empty state ---------- */
.pa-empty { text-align: center; padding: 44px 20px; background: var(--pa-card); border: 1px dashed var(--pa-hair-strong); border-radius: var(--pa-radius); }
/* The glyph is --pa-orange-deep, NOT --pa-orange. On --pa-empty's own --pa-card
   surface, --pa-orange measures 2.47:1 and --pa-orange-deep 4.62:1 (Chrome
   computed styles, 2026-08-05) — axe-core flags the former at SERIOUS on the
   CRM company detail route. Do not "restore the brand orange" here: every other
   orange TEXT in this file (.pa-eyebrow, .pa-btn--ghost, .pa-tab-count,
   .pa-rowact, .pa-helplink, .pa-rich-body a) is orange for the same reason, and
   half the ~45 callsites render the glyph WITHOUT aria-hidden, so it is read
   text, not decoration. Every callsite is a direct child of .pa-empty, so the
   measured backdrop is --pa-card everywhere; the one modifier that clears it
   (.pa-history-empty, background: transparent) sits inside a .pa-card and
   resolves to the same value.
   The warning this comment ended with — that --pa-orange-deep drops to 4.27:1 on
   --pa-paper — CAME TRUE on 2026-08-06: .pa-eyebrow and .pa-helplink render on
   the page background, and Chrome measured both at exactly 4.27:1 on the ProAudit
   dashboard and /admin/logs. All six normal-size orange text primitives listed
   above were briefly moved to a --pa-orange-deep-aa twin, and then that twin was
   retired the same day: it was not in ProAuditLayout's white-label override block, so
   it rendered ProEstimate's orange on a branded tenant. Its value was promoted into
   --pa-orange-deep itself, which is 4.80:1 on --pa-paper and clears AA on all three
   house surfaces. So everything here reads the base token, branding flows through, and
   THIS glyph is fine either way — 2rem is "large text", where the bar is 3:1. */
.pa-empty-glyph { font-family: var(--pa-font-display); font-style: italic; font-size: 2rem; color: var(--pa-orange-deep); margin-bottom: 8px; }
.pa-empty-title { font-family: var(--pa-font-display); font-size: 1.15rem; margin: 0 0 6px; color: var(--pa-ink); }
.pa-empty-text { font-size: .84rem; color: var(--pa-muted); margin: 0 0 16px; }

/* ---------- 10b Rich content body (help center) ----------
   Typeset prose for sanitized stored HTML rendered at the help-reader sink:
   rule Explanation (LIBRARY vocabulary — lib-callout/lib-key-procedure/etc.,
   sanitized by ILibraryHtmlSanitizer) AND authored article BodyHtml (HELP
   vocabulary — help-callout/help-steps/etc., sanitized by IHelpHtmlSanitizer).
   Both content-class families are a SEEDED / STORED DB CONTRACT (the sanitizer
   allow-lists) and CANNOT be renamed here. Adapted from .liby-drawer-body-rich
   but scoped under .pa-rich-body so the help reader is decoupled from the
   library page CSS (whose rules are scoped under .liby-drawer-body-rich and
   therefore never reach a bare lib-callout on a help page). */
.pa-rich-body { display: block; color: var(--pa-ink); }
.pa-rich-body > :first-child { margin-top: 0; }
.pa-rich-body > :last-child { margin-bottom: 0; }
.pa-rich-body p { margin: 0 0 1.1em; font-size: .9375rem; line-height: 1.72; color: var(--pa-ink); }
.pa-rich-body h2 { font-size: 1.18rem; font-weight: 700; line-height: 1.25; letter-spacing: -.008em; color: var(--pa-ink); margin: 1.9em 0 .55em; padding-bottom: .35em; border-bottom: 1px solid var(--pa-hair); }
.pa-rich-body h3 { font-size: 1.0625rem; font-weight: 700; line-height: 1.25; letter-spacing: -.008em; color: var(--pa-ink); margin: 1.75em 0 .5em; padding-bottom: .35em; border-bottom: 1px solid var(--pa-hair); }
.pa-rich-body h4 { font-size: .9375rem; font-weight: 700; font-style: italic; line-height: 1.3; color: var(--pa-ink); margin: 1.5em 0 .4em; }
.pa-rich-body ul { margin: 0 0 1.1em; padding: 0; list-style: none; }
.pa-rich-body ul > li { position: relative; padding-left: 1.25em; margin-bottom: .45em; font-size: .9375rem; line-height: 1.65; color: var(--pa-ink); }
.pa-rich-body ul > li::before { content: ''; position: absolute; left: 0; top: .58em; width: 5px; height: 5px; background: var(--pa-orange); border-radius: 1px; }
.pa-rich-body ol { margin: 0 0 1.1em; padding: 0; list-style: none; counter-reset: pa-rich-ol; }
.pa-rich-body ol > li { position: relative; padding-left: 1.75em; margin-bottom: .45em; font-size: .9375rem; line-height: 1.65; color: var(--pa-ink); counter-increment: pa-rich-ol; }
.pa-rich-body ol > li::before { content: counter(pa-rich-ol); position: absolute; left: 0; top: .05em; font-size: .78rem; font-variant-numeric: tabular-nums; color: var(--pa-orange-text); font-weight: 700; min-width: 1.25em; line-height: inherit; }
.pa-rich-body ul ul, .pa-rich-body ol ol, .pa-rich-body ul ol, .pa-rich-body ol ul { margin-top: .3em; margin-bottom: 0; }
.pa-rich-body blockquote { margin: 1.25em 0; padding: 12px 16px 12px 18px; border-left: 3px solid var(--pa-orange); background: var(--pa-card-tint); border-radius: 0 6px 6px 0; font-style: italic; font-size: .9375rem; line-height: 1.65; color: var(--pa-ink); }
.pa-rich-body blockquote p { margin: 0; font-style: inherit; font-size: inherit; line-height: inherit; color: inherit; }
.pa-rich-body a { color: var(--pa-orange-deep); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--pa-orange) 40%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.pa-rich-body a:hover { text-decoration-color: var(--pa-orange); text-decoration-thickness: 2px; }
.pa-rich-body code { font-size: .82em; background: var(--pa-thead-bg); border: 1px solid var(--pa-hair); padding: 1px 5px; border-radius: 3px; color: var(--pa-ink); }
.pa-rich-body pre { margin: 1.1em 0; padding: 12px 14px; background: var(--pa-thead-bg); border: 1px solid var(--pa-hair); border-radius: 6px; overflow-x: auto; font-size: .82rem; line-height: 1.55; color: var(--pa-ink); }
.pa-rich-body pre code { background: none; border: none; padding: 0; }
.pa-rich-body strong { font-weight: 700; color: var(--pa-ink); }
.pa-rich-body em { font-style: italic; }
.pa-rich-body hr { border: none; border-top: 1px solid var(--pa-hair); margin: 1.5em 0; }
.pa-rich-body table { width: 100%; border-collapse: collapse; font-size: .8125rem; margin: 1.1em 0; }
.pa-rich-body th { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--pa-thead-fg); padding: 7px 10px; border-bottom: 2px solid var(--pa-hair-strong); text-align: left; }
.pa-rich-body td { padding: 7px 10px; border-bottom: 1px solid var(--pa-hair); color: var(--pa-ink); vertical-align: top; line-height: 1.5; }
.pa-rich-body tr:last-child td { border-bottom: none; }

/* Library-vocabulary callouts (rule Explanation) — seeded/stored contract classes */
.pa-rich-body .lib-callout { margin: 1.1em 0; padding: 11px 15px; border-left: 3px solid var(--pa-hair-strong); background: var(--pa-thead-bg); border-radius: 0 6px 6px 0; font-size: .875rem; line-height: 1.6; color: var(--pa-ink); }
.pa-rich-body .lib-callout p { margin: 0; font-size: inherit; line-height: inherit; color: inherit; }
.pa-rich-body .lib-callout-warning { border-left-color: var(--pa-warn-border); background: var(--pa-warn-bg); color: var(--pa-warn-fg); }
.pa-rich-body .lib-callout-info { border-left-color: var(--pa-info-border); background: var(--pa-info-bg); color: var(--pa-info-fg); }
.pa-rich-body .lib-key-procedure { margin: 1.25em 0; padding: 13px 16px 13px 18px; border-left: 3px solid var(--pa-orange); background: var(--pa-orange-tint); border-radius: 0 8px 8px 0; font-size: .9375rem; font-weight: 600; line-height: 1.6; color: var(--pa-ink); }
.pa-rich-body .lib-key-procedure p { margin: 0; font-weight: inherit; color: inherit; }
.pa-rich-body blockquote.lib-source-quote { font-style: italic; }
.pa-rich-body .lib-source-attribution { display: block; margin-top: 1.4em; padding-top: 10px; border-top: 1px solid var(--pa-hair); font-size: .7rem; font-variant-caps: all-small-caps; letter-spacing: .1em; color: var(--pa-faint); line-height: 1.5; }
.pa-rich-body .lib-source-attribution em { font-style: normal; color: var(--pa-muted); }
.pa-rich-body p.lib-rule-lede { font-size: 1.0625rem; font-weight: 500; font-style: italic; line-height: 1.5; color: var(--pa-ink); padding-bottom: 1.1em; border-bottom: 1px solid var(--pa-hair); margin-bottom: 1.5em; }

/* Help-vocabulary content (authored article BodyHtml) — frozen sanitizer allow-list classes */
.pa-rich-body .help-callout { margin: 1.1em 0; padding: 11px 15px; border-left: 3px solid var(--pa-hair-strong); background: var(--pa-thead-bg); border-radius: 0 6px 6px 0; font-size: .875rem; line-height: 1.6; color: var(--pa-ink); }
.pa-rich-body .help-callout p { margin: 0 0 .5em; font-size: inherit; line-height: inherit; color: inherit; }
.pa-rich-body .help-callout p:last-child { margin-bottom: 0; }
.pa-rich-body .help-callout-info { border-left-color: var(--pa-info-border); background: var(--pa-info-bg); color: var(--pa-info-fg); }
.pa-rich-body .help-callout-warning { border-left-color: var(--pa-warn-border); background: var(--pa-warn-bg); color: var(--pa-warn-fg); }
.pa-rich-body .help-callout-tip { border-left-color: var(--pa-ok-border); background: var(--pa-ok-bg); color: var(--pa-ok-fg); }
.pa-rich-body .help-key-term { font-weight: 700; color: var(--pa-ink); }
.pa-rich-body ol.help-steps { counter-reset: pa-rich-ol; }
.pa-rich-body table.help-table { border: 1px solid var(--pa-hair); border-radius: var(--pa-radius); overflow: hidden; }

/* ---------- 11 Subject accents (Library / OEM-source family) ----------
   pa-subj-{EnumName} mirrors PositionStatementSubject exactly (rendered by
   LibrarySubjectStyles.ClassFor). Each class binds the generic
   --pa-subj-c / --pa-subj-bg pair — consumed by .pa-card--subj (left-edge
   stripe), .pa-pill--subj (chip tinting), and page-level liby-* rules
   (facet bars, drawer band, kicker color), exactly how the retired
   lib-subj-* set drove --subj-c / --subj-bg.
   Adding a new PositionStatementSubject enum value = ONE --pa-subj-* token
   in proaudit-theme.css + ONE class here. */
.pa-card--subj { border-left: 3px solid var(--pa-subj-c, var(--pa-hair-strong)); }
/* The LABEL is the subject colour mixed 65/35 toward --pa-ink, not the raw token.
   This pill puts the subject colour on a 10% tint of ITSELF, and at full strength
   11 of the 18 categories land under WCAG AA's 4.5:1 there — refinish-paint is
   2.98:1, headlamp-lighting 3.02:1.
   65/35 rather than the 70/30 the --pa-orange-tint chips use, because --pa-subj-bg
   is translucent: it composites over whatever is behind the pill, and on a
   --pa-paper page that ground is darker than the --pa-card fallback. Measured in
   Chrome, 70/30 left refinish-paint at 4.55:1 — passing, but on 0.05 of margin.
   65/35 gives 4.97:1 against the worst house ground while each category still
   reads as its own hue. The BORDER stays full strength: it is a 1px boundary, not
   text. Enforced by ThemeContrastContractTests, which asserts against the DARKEST
   house surface for exactly this reason. */
.pa-pill--subj {
  border-color: color-mix(in srgb, var(--pa-subj-c, var(--pa-hair-strong)) 45%, transparent);
  background: var(--pa-subj-bg, var(--pa-card));
  color: color-mix(in srgb, var(--pa-subj-c, var(--pa-neutral-fg)) 65%, var(--pa-ink));
}
.pa-subj-AdasCalibration           { --pa-subj-c: var(--pa-subj-adas-calibration);           --pa-subj-bg: color-mix(in srgb, var(--pa-subj-adas-calibration) 10%, transparent); }
.pa-subj-PrePostRepairScanning     { --pa-subj-c: var(--pa-subj-pre-post-repair-scanning);   --pa-subj-bg: color-mix(in srgb, var(--pa-subj-pre-post-repair-scanning) 10%, transparent); }
.pa-subj-StructuralRepair          { --pa-subj-c: var(--pa-subj-structural-repair);          --pa-subj-bg: color-mix(in srgb, var(--pa-subj-structural-repair) 10%, transparent); }
.pa-subj-CorrosionProtection       { --pa-subj-c: var(--pa-subj-corrosion-protection);       --pa-subj-bg: color-mix(in srgb, var(--pa-subj-corrosion-protection) 10%, transparent); }
.pa-subj-GlassReplacement          { --pa-subj-c: var(--pa-subj-glass-replacement);          --pa-subj-bg: color-mix(in srgb, var(--pa-subj-glass-replacement) 10%, transparent); }
.pa-subj-RefinishPaint             { --pa-subj-c: var(--pa-subj-refinish-paint);             --pa-subj-bg: color-mix(in srgb, var(--pa-subj-refinish-paint) 10%, transparent); }
.pa-subj-AirbagRestraintSystem     { --pa-subj-c: var(--pa-subj-airbag-restraint-system);    --pa-subj-bg: color-mix(in srgb, var(--pa-subj-airbag-restraint-system) 10%, transparent); }
.pa-subj-WheelAlignment            { --pa-subj-c: var(--pa-subj-wheel-alignment);            --pa-subj-bg: color-mix(in srgb, var(--pa-subj-wheel-alignment) 10%, transparent); }
.pa-subj-HybridEvProcedures        { --pa-subj-c: var(--pa-subj-hybrid-ev-procedures);       --pa-subj-bg: color-mix(in srgb, var(--pa-subj-hybrid-ev-procedures) 10%, transparent); }
.pa-subj-OneTimeUseParts           { --pa-subj-c: var(--pa-subj-one-time-use-parts);         --pa-subj-bg: color-mix(in srgb, var(--pa-subj-one-time-use-parts) 10%, transparent); }
.pa-subj-AdhesiveBonding           { --pa-subj-c: var(--pa-subj-adhesive-bonding);           --pa-subj-bg: color-mix(in srgb, var(--pa-subj-adhesive-bonding) 10%, transparent); }
.pa-subj-MechanicalProcedures      { --pa-subj-c: var(--pa-subj-mechanical-procedures);      --pa-subj-bg: color-mix(in srgb, var(--pa-subj-mechanical-procedures) 10%, transparent); }
.pa-subj-ToolEquipmentRequirements { --pa-subj-c: var(--pa-subj-tool-equipment-requirements); --pa-subj-bg: color-mix(in srgb, var(--pa-subj-tool-equipment-requirements) 10%, transparent); }
.pa-subj-MaterialSpecifications    { --pa-subj-c: var(--pa-subj-material-specifications);    --pa-subj-bg: color-mix(in srgb, var(--pa-subj-material-specifications) 10%, transparent); }
.pa-subj-HeadlampLighting          { --pa-subj-c: var(--pa-subj-headlamp-lighting);          --pa-subj-bg: color-mix(in srgb, var(--pa-subj-headlamp-lighting) 10%, transparent); }
.pa-subj-BumperEnergyAbsorption    { --pa-subj-c: var(--pa-subj-bumper-energy-absorption);   --pa-subj-bg: color-mix(in srgb, var(--pa-subj-bumper-energy-absorption) 10%, transparent); }
.pa-subj-PartsAndProcurement       { --pa-subj-c: var(--pa-subj-parts-and-procurement);      --pa-subj-bg: color-mix(in srgb, var(--pa-subj-parts-and-procurement) 10%, transparent); }
.pa-subj-GeneralCollisionRepair    { --pa-subj-c: var(--pa-subj-general-collision-repair);   --pa-subj-bg: color-mix(in srgb, var(--pa-subj-general-collision-repair) 10%, transparent); }

/* ---------- 12 Type utilities ---------- */
/* .pa-serif — display-serif markup utility (companion to .pa-num).
   Added for the report/audit shared-component migration (batch 13c-1,
   HealthScoreExplainModal dossier headings); any component that needs the
   display face on a non-primitive element combines this class in markup
   rather than declaring font-family in pa-pages css (contract-banned). */
.pa-serif { font-family: var(--pa-font-display); }

/* ---------- 13 Help links ----------
   Contextual deep-links into the help center (HelpTopicLink.razor). Deliberately
   NOT named .pa-link: there is no global anchor primitive in this system, and a
   generic name would let every anchor in the app claim it.

   Lives here (a primitive file) rather than in a pa-pages file for two reasons:
   pa-pages/*.css may not carry color at all (ProAuditThemeContractTests fails the
   build), and no single pa-pages file loads on every host surface these links
   appear on — the overlay and trial strip come from chrome.css, AccessRequired and
   Usage from settings.css, Seats and Subscriptions from billing.css. This file
   ships globally via ProAuditThemeAssets. Arrangement-only rules (margin, placement,
   zero color) still belong in the host's pa-pages file. */
.pa-helplink { font-family: var(--pa-font-body); font-size: .84rem; font-weight: 600; color: var(--pa-orange-deep); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--pa-orange) 40%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: pointer; }
.pa-helplink:hover { text-decoration-color: var(--pa-orange); text-decoration-thickness: 2px; }
.pa-helplink:focus-visible { outline: 2px solid var(--pa-orange); outline-offset: 2px; border-radius: 3px; }

/* Trailing marker. A glyph rather than an icon font so it inherits color and
   needs no asset; aria-hidden at the markup level. */
.pa-helplink__mark { font-family: var(--pa-font-numeric); margin-left: 4px; font-size: .78em; }

/* --hint: a quieter, secondary-line treatment for slots where the link is
   supporting text rather than an action. */
.pa-helplink--hint { font-size: .78rem; font-weight: 500; color: var(--pa-muted); text-decoration-color: color-mix(in srgb, var(--pa-muted) 40%, transparent); }
.pa-helplink--hint:hover { color: var(--pa-orange-deep); text-decoration-color: var(--pa-orange); }

/* --onbanner: LOAD-BEARING. Inside a tinted callout (.pa-callout--danger sits on
   var(--pa-bad-bg)) or the read-only access banner, --pa-orange-deep is unreadable.
   Inheriting currentColor guarantees the link carries the host callout's own
   foreground, whatever tint it is, and stays legible in every arm. Every link
   inside a tinted callout or the sticky access banner uses this variant. */
.pa-helplink--onbanner { color: currentColor; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.pa-helplink--onbanner:hover { color: currentColor; text-decoration-color: currentColor; text-decoration-thickness: 2px; }
.pa-helplink--onbanner:focus-visible { outline-color: currentColor; }

/* --btn: COMPOSES with the button primitive rather than redeclaring it. Markup is
   `pa-btn pa-btn--secondary pa-btn--sm pa-helplink pa-helplink--btn`; this variant
   only unwinds the underline the base help-link treatment adds. */
.pa-helplink--btn { text-decoration: none; }
.pa-helplink--btn:hover { text-decoration: none; }

/* ---------- Print (spec §4.0): hide chrome, ink on white ---------- */
@media print {
  .pa-sidebar, .pa-btn, .pa-pager, .pa-tabs { display: none !important; }
  .pa-layout, .pa-app { background: #fff !important; }
  .pa-card, .pa-grid { border-color: #bbb; box-shadow: none; }
}

/* ---------- Chrome: Warm Ink ---------- */
.pa-layout {
  --pa-sidebar-w: 240px;
  --pa-sidebar-w-collapsed: 64px;

  display: flex;
  min-height: 100vh;
  font-family: var(--pa-font-body);
}

.pa-layout--collapsed .pa-sidebar {
  width: var(--pa-sidebar-w-collapsed);
  min-width: var(--pa-sidebar-w-collapsed);
}

.pa-layout--collapsed .pa-main {
  margin-left: var(--pa-sidebar-w-collapsed);
}

.pa-layout--collapsed .pa-hide-collapsed {
  display: none;
}

.pa-layout--collapsed .pa-nav-item {
  justify-content: center;
  padding: 0.5rem;
}

.pa-layout--collapsed .pa-sidebar-logo {
  padding: 1.125rem 0.75rem;
  justify-content: center;
}

.pa-layout--collapsed .pa-logo-link {
  justify-content: center;
}

.pa-layout--collapsed .pa-collapse-btn {
  position: static;
  opacity: 1;
  margin-left: 0;
}

.pa-layout--collapsed .pa-sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.pa-layout--collapsed .pa-bottom-row {
  justify-content: center;
}

.pa-layout--collapsed .pa-sidebar-bottom {
  padding: 0.5rem;
}

.pa-sidebar {
  width: var(--pa-sidebar-w);
  min-width: var(--pa-sidebar-w);
  background: var(--pa-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.2s ease, min-width 0.2s ease;
}

/* AdminLayout and CrmLayout both restore the persisted rail state (collapsed or
   not) on first paint. Without this the width/margin transitions above and on
   .pa-main would animate that restore, so a returning user watches the rail
   slide shut from 240px every single page load. Each layout drops the class one
   render after the restored state has painted, so user-driven collapses still
   animate. Both put their <aside> and <main> as siblings, which the ~ needs.
   Must stay AFTER .pa-sidebar — same specificity, source order decides. */
.pa-sidebar--no-anim,
.pa-sidebar--no-anim ~ .pa-main {
  transition: none;
}

.pa-sidebar::-webkit-scrollbar { width: 4px; }
.pa-sidebar::-webkit-scrollbar-track { background: transparent; }
.pa-sidebar::-webkit-scrollbar-thumb { background: rgba(246, 241, 234, .1); border-radius: 2px; }
.pa-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(246, 241, 234, .2); }

.pa-sidebar-logo {
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid rgba(246, 241, 234, .1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pa-logo-link {
  display: flex !important;
  align-items: center;
  gap: 0.625rem;
  color: var(--pa-sidebar-text-bright) !important;
  text-decoration: none !important;
  transition: opacity 0.15s ease;
}

.pa-logo-link:hover { opacity: 0.85; }

.pa-logo-img { display: block; max-height: 32px; }

.pa-logo-symbol {
  height: 34px;
  width: auto;
  flex-shrink: 0;
}

.pa-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(246, 241, 234, .1);
  background: rgba(246, 241, 234, .04);
  color: var(--pa-sidebar-text);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  margin-left: auto;
}

.pa-collapse-btn:hover {
  color: var(--pa-sidebar-text-bright);
  background: rgba(246, 241, 234, .08);
  border-color: rgba(246, 241, 234, .15);
}

.pa-collapse-btn .mud-icon-root {
  font-size: 1rem;
}

.pa-logo-text { display: flex; flex-direction: column; min-width: 0; }
.pa-logo-name { font-family: var(--pa-font-display); font-size: 0.9375rem; font-weight: 700; color: var(--pa-sidebar-text-bright); letter-spacing: 0.01em; line-height: 1.2; }
/* Contrast: NOT --pa-sidebar-group (#8d8275). That token computes to 4.49:1 on
   --pa-sidebar (#211c16) and this text is 10px/700, which is not WCAG "large"
   (needs >= 18.66px bold), so the bar is 4.5:1 and it failed axe by a hundredth.
   #948979 is 4.92:1. Set here rather than on the token because seven other
   stylesheets read --pa-sidebar-group (crm-chrome, analytics, quick-audit,
   report-detail, chrome, admin-chrome) and bumping it would re-skin CRM.
   Per-channel delta from #8d8275 is (+7,+7,+4), under the visual baselines'
   ChannelDeltaThreshold of 12, so no snapshot pixel counts as differing. */
.pa-logo-tagline { font-size: 0.625rem; color: #948979; letter-spacing: 0.03em; }

.pa-sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.75rem 1rem;
}

.pa-nav-section-label {
  font-size: 0.625rem;
  font-weight: 700;
  color: #948979; /* see the .pa-logo-tagline note above — 4.92:1, not the 4.49:1 token */
  letter-spacing: .16em;
  padding: 1.25rem 0.625rem 0.375rem;
  text-transform: uppercase;
}

/* Two shapes share this label. The bare <div class="pa-nav-section-label"> is
   ProAuditLayout throughout, and CrmLayout's pinned TODAY heading, which is
   deliberately not a disclosure because it carries the tasks badge. The
   pa-nav-group variant below is admin's sidebar and CRM's six collapsible
   groups, where the first child of .pa-sidebar-nav may be a <details>. */
.pa-nav-section-label:first-child,
.pa-nav-group:first-child > summary {
  padding-top: 0.5rem;
}

/* ---------- Nav group: collapsible sidebar section ----------
   Native <details>/<summary> disclosure — the open/close costs zero JS and
   zero circuit round-trip. The <summary> carries .pa-nav-section-label, so it
   inherits that rule's type and corrected colour; everything here is the
   disclosure affordance on top.

   The group owning the active route is a HEADER, not a disclosure (plan
   decision P1): no chevron, default cursor, and it cannot be closed. That is
   what makes closed-by-default tolerable — the active row is always visible. */
.pa-nav-group {
  display: block;
}

.pa-nav-group > summary {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  border-radius: 6px;
  user-select: none;
  list-style: none; /* Firefox */
}

.pa-nav-group > summary::-webkit-details-marker { display: none; }
.pa-nav-group > summary::marker { content: ""; }

/* CSS triangle rather than an icon font: a <summary> should not depend on
   MudBlazor rendering inside it. */
.pa-nav-group > summary::after {
  content: "";
  margin-left: auto;
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.75;
  transition: transform 0.15s ease;
}

.pa-nav-group[open] > summary::after {
  transform: rotate(180deg);
}

.pa-nav-group:not(.pa-nav-group--active) > summary:hover {
  color: var(--pa-sidebar-text-bright);
}

/* The summary is now the keyboard-reachable control for the section. */
.pa-nav-group > summary:focus-visible {
  outline: 2px solid var(--pa-orange);
  outline-offset: -2px;
}

.pa-nav-group--active > summary {
  cursor: default;
}

.pa-nav-group--active > summary::after {
  display: none;
}

.pa-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: 8px;
  color: var(--pa-sidebar-text);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
  font-family: inherit;
}

.pa-nav-item:hover {
  color: var(--pa-sidebar-text-bright);
  background: rgba(246, 241, 234, .06);
}

.pa-nav-item.active {
  color: var(--pa-sidebar-text-bright);
  background: var(--pa-orange-tint);
}

.pa-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--pa-orange);
}

.pa-nav-icon {
  font-size: 1.125rem !important;
  opacity: 0.8;
  flex-shrink: 0;
}

.pa-nav-item.active .pa-nav-icon {
  opacity: 1;
  color: var(--pa-orange-text) !important;
}

.pa-nav-item--external {
  opacity: 0.72;
}

.pa-nav-item--external:hover {
  opacity: 1;
}

.pa-nav-icon--external {
  margin-left: auto;
  font-size: 0.75rem !important;
  opacity: 0.6;
}

.pa-layout--collapsed .pa-nav-icon--external {
  display: none;
}

/* ---------- Sidebar search launcher ----------
   Opens the global Command Palette (IPaletteService.Open) on click — the same
   overlay the Ctrl/⌘+K hotkey opens. A launcher, NOT an input: the real search
   field lives in the palette. Sits at the top of .pa-sidebar-nav, above the
   first group. Styled on the sidebar's own dark token family + the same
   translucent-paper mixes the nav rows use, so it reads as chrome. Must stay a
   plain <button> (no .pa-nav-item / <summary> / <details>) — the locked
   AdminLayout IA-tree test keys off those. */
.pa-sidebar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(246, 241, 234, .12);
  border-radius: 8px;
  background: rgba(246, 241, 234, .04);
  color: var(--pa-sidebar-text);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pa-sidebar-search:hover {
  color: var(--pa-sidebar-text-bright);
  background: rgba(246, 241, 234, .08);
  border-color: rgba(246, 241, 234, .2);
}

.pa-sidebar-search:focus-visible {
  outline: 2px solid var(--pa-orange);
  outline-offset: -2px;
}

.pa-sidebar-search-icon {
  font-size: 1.125rem !important;
  opacity: 0.8;
  flex-shrink: 0;
}

.pa-sidebar-search-label {
  flex: 1 1 auto;
  min-width: 0;
  opacity: 0.9;
}

.pa-sidebar-search-kbd {
  flex-shrink: 0;
  padding: 0.05rem 0.35rem;
  border: 1px solid rgba(246, 241, 234, .18);
  border-radius: 4px;
  font-size: 0.7rem;
  line-height: 1.4;
  /* WCAG AA: --pa-sidebar-group is 4.49:1 on the bare sidebar, and this kbd
     does not sit on the bare sidebar -- .pa-sidebar-search paints a 4% paper
     wash over it, dropping the real ratio to 4.06:1 (3.62:1 on hover). At
     0.7rem/11.2px this is not large text, so the bar is 4.5:1.
     --pa-sidebar-text clears every state: 9.31:1 bare, 8.42:1 default,
     7.51:1 hover. */
  color: var(--pa-sidebar-text);
}

/* Collapsed rail: icon only, centered (label + kbd carry pa-hide-collapsed). */
.pa-layout--collapsed .pa-sidebar-search {
  justify-content: center;
  padding: 0.5rem;
}

.pa-sidebar-bottom {
  border-top: 1px solid rgba(246, 241, 234, .1);
  padding: 0.75rem;
  margin-top: auto;
}

.pa-bottom-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.pa-profile-menu-wrap {
  flex: 1;
  min-width: 0;
}

.pa-bottom-bell {
  flex-shrink: 0;
}

.pa-bottom-row .mud-icon-button {
  color: var(--pa-sidebar-text) !important;
}

.pa-bottom-row .mud-icon-button:hover {
  color: var(--pa-sidebar-text-bright) !important;
  background: rgba(246, 241, 234, .06) !important;
}

.pa-login-btn {
  display: block;
  text-align: center;
  padding: 0.5rem 1rem;
  background: var(--pa-orange);
  color: var(--pa-orange-fg);
  font-weight: 600;
  font-size: 0.8125rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.pa-login-btn:hover {
  background: var(--pa-orange-hover);
}

.pa-main {
  flex: 1;
  min-width: 0; /* flex child must shrink below content min-width or wide grids blow out the viewport */
  margin-left: var(--pa-sidebar-w);
  background: var(--pa-paper);
  min-height: 100vh;
  transition: margin-left 0.2s ease;
}

@media (max-width: 768px) {
  .pa-sidebar {
    width: 100%;
    min-width: 100%;
    position: relative;
    height: auto;
    overflow-y: visible;
  }

  .pa-main {
    margin-left: 0;
  }

  .pa-layout {
    flex-direction: column;
  }
}

/* ---------- Lifecycle badge ----------
   Shared by rule admin tables + finding cards/modal (ProAuditFindingFlashCard,
   ProAuditFindingModal). Rescued from the retired proaudit-variables.css and
   re-expressed on the semantic token bands: warn for StaffOnly (attention),
   neutral for Draft (subdued), ok for Public. */
.pa-lc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.5625rem;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.pa-lc-badge svg {
  width: 0.75rem;
  height: 0.75rem;
  flex-shrink: 0;
}

.pa-lc-draft {
  background: var(--pa-card-tint);
  color: var(--pa-neutral-fg);
  border: 1px solid var(--pa-hair);
}

.pa-lc-staff-only {
  background: var(--pa-warn-bg);
  color: var(--pa-warn-fg);
  border: 1px solid color-mix(in srgb, var(--pa-warn-border) 45%, transparent);
}

.pa-lc-public {
  background: var(--pa-ok-bg);
  color: var(--pa-ok-fg);
  border: 1px solid color-mix(in srgb, var(--pa-ok-border) 45%, transparent);
}

/* ---------- Walkthrough button pulse ----------
   Applied by js/proaudit-animations.js when an accepted card flies to the
   walkthrough button. Rescued from the retired proaudit-variables.css;
   the legacy green glow is re-toned onto the teal success accent. */
@keyframes pa-walkthrough-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pa-teal) 70%, transparent), 0 0 8px color-mix(in srgb, var(--pa-teal) 30%, transparent); transform: scale(1); }
  25%  { box-shadow: 0 0 0 6px color-mix(in srgb, var(--pa-teal) 35%, transparent), 0 0 20px color-mix(in srgb, var(--pa-teal) 25%, transparent); transform: scale(1.08); }
  50%  { box-shadow: 0 0 0 12px color-mix(in srgb, var(--pa-teal) 15%, transparent), 0 0 12px color-mix(in srgb, var(--pa-teal) 10%, transparent); transform: scale(1.03); }
  100% { box-shadow: 0 0 0 20px transparent, 0 0 0 transparent; transform: scale(1); }
}

.walkthrough-pulse {
  animation: pa-walkthrough-pulse 0.9s ease-out !important;
}

@media (prefers-reduced-motion: reduce) {
  .walkthrough-pulse {
    animation: none !important;
  }
}

/* ScriptEditor full-viewport escape (/admin/proaudit/script-editor, AdminLayout).
   Scoped via :has(.se-root) so it only affects the script-editor page; lives
   here (not a pa-pages file) because the rule targets the layout's .pa-main,
   and this file loads on every admin/ProAudit route via ProAuditThemeAssets. */
.pa-main:has(.se-root) { min-height: 0 !important; height: 100vh; overflow: hidden; padding: 0 !important; }
