/* ==========================================================================
   HireFlow — dashboard design system (black & white, one AI accent)
   Primarily black/white, information-dense, minimal — the one hue in the
   whole system is a low-saturation indigo reserved exclusively for
   AI-authored content (match score, AI assessment, the AI badge); status
   colors (green/amber/red) are a separate, deliberately desaturated axis
   that never reads as "the brand's color." Borders + whitespace carry
   structure; shadows are almost invisible. Space Grotesk carries headings,
   IBM Plex Sans carries body/UI, JetBrains Mono stays for anything
   columnar/data-like (candidate/role tables, keyword lists, file paths).
   Every animation here moves transform/opacity only, gated on
   prefers-reduced-motion, and stays in the 150–220ms range.
   ========================================================================== */

:root {
  /* Neutral ramp — ONE ordered scale, light to dark. Before this pass the
     stylesheet carried 200 distinct hex values (170 of them neutrals): ~30
     near-identical off-whites and ~40 mid-greys differing by a channel or
     two, each written in isolation rather than picked from a scale. Nothing
     lined up because nothing was the same colour twice. Every hardcoded
     value was mapped onto its nearest step here by luminance; the seven
     steps that already existed keep their exact values, so anything that
     was already reading a token is unaffected. Pick from this ramp — do
     not introduce a new grey. */
  --paper-raised: #FFFFFF;  /* raised surfaces: cards, dialogs, nav        */
  --paper:        #F9FAFB;  /* page canvas                                 */
  --surface:      #F3F4F6;  /* recessed: table stripes, hovers, inset wells */
  --rule:         #E5E7EB;  /* default hairline                            */
  --rule-strong:  #111111;  /* container edge, input outline — near-black  */
  --rule-mid:     #D1D5DB;  /* was --rule-strong: mid separator            */
  --ink-400:      #9CA3AF;  /* disabled text, decorative icons             */
  --ink-muted:    #868D95;  /* placeholder, metadata (was #8A8A8A — same
                               luminance, re-tinted so the one pure grey in
                               the file joins the blue-grey family)        */
  --ink-soft:     #6B7280;  /* secondary text — 4.8:1 on paper            */
  --ink-600:      #4B5563;  /* body text on tinted surfaces                */
  --ink-700:      #374151;  /* strong secondary, dark-surface body         */
  --ink-800:      #1F2937;  /* dark surface background                     */
  --ink-900:      #111827;  /* deepest surface                             */
  --ink:          #111111;  /* primary text, the one interactive accent    */
  --on-accent:    #FFFFFF;

  /* Status "soft tag" palette — light tint bg + dark saturated text + a
     matching pale border, exact values given by the product owner.
     "Good Fit" (renamed from "Awaiting Form response") reuses green, the
     same "cleared the bar" color Active/Approved already use elsewhere.
     "Dropped" is gray, not red — it no longer reads as the same outcome
     as "Not suitable." */
  --green-bg: #F0FDF4; --green-ink: #166534; --green-border: #BBF7D0;
  --brass-bg: #FEF3C7; --brass-ink: #92400E; --brass-border: #FDE68A;
  --amber-bg: #FFFBEB; --amber-ink: #92400E; --amber-border: #FDE68A;
  --brick-bg: #FEF2F2; --brick-ink: #B91C1C; --brick-border: #FECACA;
  --gray-bg: #F3F4F6; --gray-ink: #4B5563; --gray-border: #E5E7EB;

  /* Solid status inks. Both were REFERENCED but never DECLARED — --brick in
     six places (including the thin left-border error accent this file's own
     header describes as a core decision) and --green in one. An invalid
     var() makes the browser drop the entire declaration, so every one of
     those error accents has been rendering as no border at all. Declared
     here against the existing -ink values so the "inked, not bright" status
     axis is unchanged. */
  --brick: #B91C1C;
  --green: #166534;

  /* AI accent — the one hue in the system. Used only for AI-authored
     content (match score, AI assessment, the AI badge); never for chrome,
     buttons, or navigation. */
  --ai: #6D5DFB;
  --ai-ink: #6557D9;

  --focus: #111111;
  --focus-hover: #2A2A2A;
  /* The focus RING, deliberately a separate token from --focus, which is
     the primary-action fill. They shared one value until the tier work;
     a visible ring that is not the same ink as a filled button is easier
     to see on top of one. */
  --focus-ring: #4B5563;

  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Inter (confirmed explicitly) — replaces IBM Plex Sans as the body/UI
     face for the modern-SaaS pass; -apple-system/system-ui fallback covers
     "or system sans-serif" if the Google Fonts request ever fails. */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Courier New", monospace;

  /* Radius scale. Buttons moved off full-pill to rounded-lg (confirmed
     explicitly, part of the modern-SaaS pass) — chips, stamps, and the
     row-menu kebab trigger keep the pill shape (their own explicit
     border-radius, not inherited from the shared button rule below), same
     "soft-pill for a toggle/badge, rounded-rect for an action" split
     Linear/Vercel-style products actually use. */
  --radius-sm: 8px;   /* small inner elements */
  --radius: 12px;     /* controls (design.md)  */
  --radius-lg: 18px;  /* panels   (design.md)  */
  --radius-xl: 24px;  /* shell    (design.md)  */
  --radius-pill: 999px;  /* compact actions and statuses */

  /* Cards float — a soft two-layer ambient shadow (a tight contact shadow
     plus a wider diffuse one), not the near-invisible hairline this used
     to be. Borders still do most of the work on dense areas (tables,
     dialogs); shadow is what makes a card read as "raised" the way every
     control in the reference panel does. */
  /* Elevation — five steps, one tint. The file previously carried 43
     bespoke shadows across TWELVE different shadow colours (rgba(30,37,44),
     rgba(25,31,37), rgba(29,33,38), rgba(36,42,48)…) with blurs up to 80px.
     Big diffuse shadows on flat panels are the loudest "generic SaaS" tell
     there is; borders carry structure here, elevation is reserved for
     things that genuinely float above the page. Everything casts the same
     near-black. */
  --shadow-none:  none;
  --shadow-sm:    0 1px 2px rgba(17, 17, 17, 0.05);
  --shadow-card:  0 1px 2px rgba(17, 17, 17, 0.04), 0 14px 52px rgba(17, 17, 17, 0.07);
  --shadow-hover: 0 1px 2px rgba(17, 17, 17, 0.04), 0 4px 12px rgba(17, 17, 17, 0.07);
  --shadow-pop:   0 2px 4px rgba(17, 17, 17, 0.04), 0 8px 24px rgba(17, 17, 17, 0.09);
  --shadow-modal: 0 8px 16px rgba(17, 17, 17, 0.06), 0 24px 56px rgba(17, 17, 17, 0.13);
  --shadow-sticky: 0 -1px 0 var(--rule);

  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  /* design.md: 100ms press, 180ms hover, 260ms entrance. Transform and
     opacity only, gated on prefers-reduced-motion. */
  --dur-press: 100ms;
  --dur-hover: 180ms;
  --dur-enter: 260ms;

  /* Spacing scale — 4px base unit. Additive: nothing existing reads off
     these yet (every margin/padding/gap elsewhere in this file is still a
     one-off px value), so introducing them changes nothing until a rule
     opts in. Used first by the Settings page's own rules below. */
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;

  /* Type scale — nine steps. The file previously used 25 distinct sizes,
     seven of them half-pixel (12.5, 11.5, 13.5, 10.5, 9.5, 8.5, 14.5), and
     redefined single selectors at four different sizes
     (dialog#bgv-drawer .drawer__name was 24, 26, 27 and 24px in four
     places). Half-pixel type renders inconsistently across platforms and
     is a reliable sign nobody chose a scale. Sizes below 11px were rounded
     up rather than preserved — 8px body text is not readable. */
  --text-xs:   11px;   /* metadata, table meta, timestamps */
  --text-sm:   12px;   /* secondary text, chips, labels    */
  --text-md:   13px;   /* dense body, table cells          */
  --text-base: 15px;   /* body (design.md)                   */
  --text-lg:   17px;   /* section heading                    */
  --text-xl:   18px;   /* dialog title                     */
  --text-2xl:  22px;   /* drawer name                      */
  --text-3xl:  26px;   /* large numerals, drawer name        */
  --text-4xl:  32px;   /* display (design.md)                */
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  /* Reverted to scrollbar-gutter (confirmed explicitly) — overflow-y:scroll
     forced a visible thumb/track on every page regardless of whether
     there was anything to scroll, and that permanent gutter is also what
     exposed a separate real bug (nav's white background stopping short
     of the true edge, fixed via .nav's own box-shadow below). This still
     reserves the gutter's width unconditionally — no page-to-page width
     shift switching between a short settings tab and a tall one — it
     just doesn't draw a track/thumb when there's genuinely nothing to
     scroll. */
  scrollbar-gutter: stable;
}

/* Themed scrollbar (confirmed explicitly) — every scroll surface in this
   app (the page itself, every dialog, the template/compose-email
   preview panes) was rendering the raw OS/browser default: a plain gray
   bar that belongs to no design system and reads as "assembled," not
   "designed" — the exact tell a rounded modal's own edge just made
   obvious. Applied globally (not just html) so a dialog's internal
   scroll (dialog { max-height: 85vh; overflow-y: auto } elsewhere in
   this file) matches too. Firefox/modern Chrome via scrollbar-color,
   Safari/older Chrome via the WebKit pseudo-elements — same thin
   pill-shaped thumb either way, just two different APIs for it. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--rule-mid) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background-color: var(--rule-mid);
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--ink-muted); }

/* Monochrome wash (ink, not the AI hue) at top right — visible, not just
   theoretically present at an opacity nobody can actually see. The purple
   accent stays reserved exclusively for AI-authored content (match score,
   AI badge, AI assessment); the ambient page canvas itself stays
   black/white, on every page (login included — nothing overrides this
   here). */
body {
  /* Plain paper. The 14%-black radial wash that used to sit here read as a
     grey smear across the top of every page and contradicts an editorial
     white canvas; the dot matrix at the bottom of this file is the texture
     now. */
  background: var(--paper);
}

@media (prefers-reduced-motion: no-preference) {
  .stamp, .banner { transition: opacity 180ms ease, transform 180ms ease; }
}

/* ---------- entrance / scroll-triggered reveal ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 420ms ease-out, transform 420ms var(--ease-standard);
  }
  .reveal.is-visible { opacity: 1; transform: translateY(0); }
}

/* ---------- skeleton loading placeholder ---------- */

@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  display: inline-block;
  height: 13px;
  width: 100%;
  max-width: 150px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--rule) 25%, var(--rule-mid) 50%, var(--rule) 75%);
  background-size: 200% 100%;
  vertical-align: middle;
}
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: skeleton-shimmer 1.6s ease-in-out infinite; }
}

a { color: var(--focus); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

/* Sentence case, not shouting caps (confirmed explicitly, part of the
   modern-SaaS pass) — global, since every form label in the app used the
   same uppercase treatment and a mix of cased/uncased labels side by side
   would read as unfinished, not deliberate. */
label {
  display: block;
  font-size: var(--text-md);
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink-700);
  margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="url"],
input[type="search"],
input[type="email"],
/* tel and month were missing, so every phone field and every employment
   period on the verification form rendered as a raw browser input beside
   correctly styled siblings. */
input[type="tel"],
input[type="month"],
select,
textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 9px 11px;
  min-height: 40px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--ink); }

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

textarea { font-family: var(--font-mono); font-size: var(--text-md); resize: vertical; }

.field { margin-bottom: 18px; }
.field__hint { font-size: var(--text-sm); color: var(--ink-soft); margin-top: 5px; }
.field__hint--pre { white-space: pre-wrap; }

/* A compact list of many checkboxes (e.g. "assign recruiter(s)") — the
   existing .field--checkbox is a single full-width on/off switch, sized
   for one high-stakes toggle, not a list of several plain choices.
   Capped and scrollable, not free to grow with the directory — a company
   with 3 recruiters and one with 50 must produce the same dialog height;
   same max-height+scroll idiom .template-editor__preview already uses for
   the same reason. */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  max-height: 190px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper);
}
.checkbox-list__empty { font-size: var(--text-md); color: var(--ink-soft); }
.checkbox-list__search { margin-bottom: var(--space-xs); }
.checkbox-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  cursor: pointer;
}
.checkbox-list__item:hover { background: var(--paper); }
.checkbox-list__item input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.checkbox-list__item-email { font-size: var(--text-sm); color: var(--ink-muted); margin-left: auto; padding-left: var(--space-sm); }

/* The HTML `hidden` attribute is display:none in the USER-AGENT
   stylesheet, and any author rule setting display beats it — so the
   `button { display: inline-flex }` below silently un-hid every hidden
   button in the app ("Clear filters" showing with no filters active was
   one). This restores the attribute's meaning for everything at once;
   without it every case has to be patched by hand, one selector at a
   time, and the ones nobody noticed just stay broken. */
[hidden] { display: none !important; }

/* ---------- button system ---------- */
/* Flat, not gradient — hierarchy comes from fill/border/weight, not sheen.
   Primary = solid ink. Secondary = white + border. Tertiary = text only.
   Danger = light fill + muted-red border/text. Never make every action black. */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--focus);
  color: var(--on-accent);
  padding: 9px 18px;
  min-height: 40px;
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  button, .btn { transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 120ms ease; }
}
button:hover, .btn:hover {
  background: var(--focus-hover);
  box-shadow: var(--shadow-hover);
}
button:active, .btn:active { box-shadow: none; transform: scale(0.97); }
button:disabled, .btn:disabled { opacity: 0.45; cursor: default; box-shadow: none; }

.btn--outline {
  background: var(--paper-raised);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
}
.btn--outline:hover {
  background: var(--paper);
  border-color: var(--ink-muted);
  box-shadow: none;
}

.btn--danger {
  background: var(--paper-raised);
  color: var(--brick-ink);
  border: 1px solid color-mix(in srgb, var(--brick-ink) 55%, var(--rule-strong));
}
.btn--danger:hover {
  background: color-mix(in srgb, var(--brick-ink) 8%, var(--paper-raised));
  box-shadow: none;
}

.btn--success {
  background: var(--paper-raised);
  color: var(--green-ink);
  border: 1px solid color-mix(in srgb, var(--green-ink) 55%, var(--rule-strong));
}
.btn--success:hover {
  background: color-mix(in srgb, var(--green-ink) 8%, var(--paper-raised));
  box-shadow: none;
}

/* Tertiary — no fill, no heavy border, just text; for "View details →"
   style actions and de-emphasized links. */
.link-button, .btn--text {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  min-height: 0;
}
.link-button:hover, .btn--text:hover {
  color: var(--ink);
  background: none;
  box-shadow: none;
}
summary.link-button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  list-style: none;
}
summary.link-button::-webkit-details-marker { display: none; }
summary.link-button::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
details[open] > summary.link-button::before {
  transform: rotate(45deg);
}

.btn--icon {
  padding: 0;
  width: 34px;
  height: 34px;
  min-height: 0;
  flex: none;
}
.btn--sm { padding: 5px 12px; font-size: var(--text-md); min-height: 30px; }
.btn--icon.btn--sm { width: 30px; height: 30px; padding: 0; }

/* ---------- layout shell ---------- */

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-raised);
  /* z-index above the sticky table headers below (z-index: 2) so the two
     never visually fight where they meet — the nav is always on top. */
  position: sticky;
  top: 0;
  z-index: 10;
  /* Confirmed explicitly, a real gap: body's background is the root
     canvas, which browsers automatically extend under the scrollbar
     gutter — nav's own white background is not the root, so it stops
     exactly at the content edge, short of the true viewport edge by
     the gutter's width. Only became visible once overflow-y:scroll
     (above, on html) started permanently reserving that gutter instead
     of the OS's overlay-style scrollbar reserving none at all. A
     box-shadow paints past the element's own box without adding actual
     width/scroll area, so it can extend the white all the way to the
     real edge, right up to wherever the scrollbar itself draws (which
     is browser chrome, always on top regardless). 24px comfortably
     covers any browser's actual gutter width (this app's own thin
     custom one is 10px). */
  box-shadow: 24px 0 0 var(--paper-raised);
}

.nav__brand {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav__links { display: flex; gap: 22px; flex: 1; height: 100%; }
.nav__link {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 1px;
  border-bottom: 2px solid transparent;
}
@media (prefers-reduced-motion: no-preference) {
  .nav__link { transition: color 150ms ease, border-color 150ms ease; }
}
.nav__link:hover { color: var(--ink); }
.nav__link.is-active { color: var(--ink); font-weight: 700; border-bottom-color: var(--focus); }

.nav__batch-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  white-space: nowrap;
}
.nav__batch-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .nav__batch-status-dot { animation: nav-batch-pulse 2s ease-in-out infinite; }
}
@keyframes nav-batch-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink) 35%, transparent); }
  50% { opacity: 0.55; box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 0%, transparent); }
}

.nav__profile-wrap { position: relative; margin: 0; }

.nav__profile {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  font-family: inherit;
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  .nav__profile { transition: background-color 160ms var(--ease-standard), border-color 160ms var(--ease-standard); }
}
.nav__profile:hover { background: var(--paper-raised); border-color: var(--ink-muted); }
.nav__profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
}
.nav__profile-name {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--ink);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: capitalize;
}
.nav__profile-chevron { flex: none; color: var(--ink-muted); }
@media (prefers-reduced-motion: no-preference) {
  .nav__profile-chevron { transition: transform 160ms var(--ease-standard); }
}
/* No JS needed — aria-expanded is already the source of truth dashboard.js
   toggles on open/close, this just reads it. */
.nav__profile[aria-expanded="true"] .nav__profile-chevron { transform: rotate(180deg); }

/* Anchored to the button that opens it (top right, matching where the
   button sits in the nav) rather than centered — a menu should scale from
   its trigger, not float in from nowhere. Stays in the DOM at all times
   ([hidden] only toggles at the JS layer in dashboard.js) so opacity/transform
   can actually transition instead of snapping with `display`. */
.nav__profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  min-width: 160px;
  padding: 6px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  box-shadow: var(--shadow-hover);
  transform-origin: top right;
  opacity: 0;
  transform: scale(0.95) translateY(-4px);
  visibility: hidden;
  pointer-events: none;
}
/* The little upward-pointing peak that visually welds the menu to the
   button it came from — border-top + border-left on a 45°-rotated square,
   same fill as the menu so the lower half it overlaps just blends in. */
.nav__profile-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  /* Nudged toward the avatar side of the trigger button rather than the
     name/chevron side — the button's width (and so exactly where its
     center sits under this fixed-position menu) varies with the length
     of each person's name, so this is a reasonable fixed offset, not a
     per-name-exact one; getting it pixel-perfect for every name would
     need JS-measured positioning, not worth it for a decorative arrow. */
  right: 28px;
  width: 11px;
  height: 11px;
  background: var(--paper-raised);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  transform: rotate(45deg);
}
@media (prefers-reduced-motion: no-preference) {
  .nav__profile-menu { transition: opacity 160ms var(--ease-standard), transform 160ms var(--ease-standard); }
}
.nav__profile-menu.is-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  visibility: visible;
  pointer-events: auto;
}
.nav__profile-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  /* Optically left-heavy on purpose: an icon + label reads as anchored to
     the left edge, not centered, so a touch more left padding than right
     keeps the icon from feeling cramped against the menu's own edge. */
  padding: 8px 12px 8px 10px;
  border: none;
  border-radius: var(--radius);
  background: none;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.nav__profile-menu-item svg { flex: none; color: var(--ink-soft); }
@media (prefers-reduced-motion: no-preference) {
  .nav__profile-menu-item svg { transition: color 160ms var(--ease-standard); }
}
/* Icon darkens along with the row on hover — the same "quieter → more
   present" hierarchy shift the rest of the app uses for hover state,
   monochrome rather than a red "destructive" tint (logging out is fully
   reversible, not a delete). */
.nav__profile-menu-item:hover { background: var(--paper); }
.nav__profile-menu-item:hover svg { color: var(--ink); }

.nav__logout { margin: 0; }

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 28px 80px;
}

@media (max-width: 640px) {
  .nav {
    flex-wrap: wrap;
    min-height: 0;
    gap: 10px 20px;
    padding: 12px 16px;
  }
  .nav__links { order: 3; flex-basis: 100%; height: auto; gap: 16px; overflow-x: auto; }
  .nav__link { flex: 0 0 auto; white-space: nowrap; }
  /* Name truncates awkwardly in the little room left at this width —
     the avatar alone still identifies "this is your account", the name
     is a nice-to-have that the full-width profile page always has room
     for anyway. */
  .nav__profile-wrap { margin-left: auto; }
  .nav__profile { padding: 3px; }
  .nav__profile-name { display: none; }
  .nav__logout { margin-left: auto; }
  .page { padding: 20px 16px 60px; }
  .card { padding: 18px 16px; }
  .filters .field { min-width: 0; flex: 1 1 100%; }
  /* Metrics wrap onto their own lines at this width — a left border/padding
     meant to separate side-by-side columns would just be a stray vertical
     mark with nothing beside it once stacked. */
  .metrics-row { gap: 20px 32px; }
  .metric { padding: 0; border-left: none; }
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.page-header__text { min-width: 0; }
.page-header__actions { display: flex; gap: 10px; flex-wrap: wrap; flex: none; }
.page-header button { margin-top: 0; }
.page-header h1 { font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.01em; }
.page-header p { color: var(--ink-soft); margin: 6px 0 0; font-size: var(--text-base); }

.auth-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* No background of its own — this used to paint a flat var(--paper) fill
     that covered the shared radial-wash gradient on <body>, making login
     the one page with a flatter canvas than Overview/Settings/Roles.
     Leaving it unset lets the same body background show through here too. */
  /* overflow-y: auto, not hidden — on a short/landscape mobile viewport the
     centered card can be taller than 100vh, and a hard overflow:hidden would
     clip it with no way to scroll to the hidden part. */
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px;
}

/* ---------- login (split panel: form + product video) ---------- */

.auth-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 960px;
  min-height: 580px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

.auth-panel__form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px 48px;
  min-width: 0;
}

/* Plain wordmark, not a badge — a bordered pill around bare text is what a
   placeholder logo looks like before real branding exists, and it also
   competes with the pill inputs/button below for the same shape language.
   One pill "moment" on this screen (the inputs, see below) reads as a
   choice; three unrelated elements all defaulting to the same stadium
   shape reads as undifferentiated. Part of the centered form block, not
   pinned to the top separately — one composed unit instead of two
   independent balance points. */
.auth-wordmark {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  letter-spacing: 0.01em;
  color: var(--ink);
  margin-bottom: 40px;
}

.auth-panel__form-inner {
  display: flex;
  flex-direction: column;
  max-width: 360px;
}
.auth-panel__form-inner h1 { font-size: var(--text-4xl); margin-bottom: 6px; }
.auth-panel__form-inner p { color: var(--ink-soft); font-size: var(--text-base); margin: 0 0 28px; }
.auth-panel__form-inner .banner { margin-bottom: 20px; }
.auth-panel__form-inner .field { margin-bottom: 18px; }
/* Filled, borderless pills — the login screen's own moment, distinct from
   the bordered inputs the rest of the app uses for dense data-entry forms
   (Settings, Add role). A first-impression screen can afford a softer,
   more consumer-facing feel; a form with a dozen fields can't — legibility
   there matters more than personality. */
.auth-panel__form-inner input {
  border: none;
  background: var(--paper);
  border-radius: var(--radius-pill);
  padding: 13px 20px;
}
.auth-panel__form-inner input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ink);
}
.auth-panel__form-inner button[type="submit"] { width: 100%; margin-top: 10px; }

.auth-panel__media { position: relative; background: var(--ink); }
.auth-panel__video { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (prefers-reduced-motion: reduce) {
  .auth-panel__video { display: none; }
}

@media (max-width: 760px) {
  .auth-panel { grid-template-columns: 1fr; min-height: 0; border-radius: var(--radius-lg); }
  .auth-panel__media { display: none; }
  .auth-panel__form { padding: 32px 24px; }
}

/* ---------- public apply page (templates/apply.html) ----------
   Black & white (confirmed explicitly, reverting an earlier navy-corporate
   pass) — stays aligned with the rest of the app's monochrome brand
   instead of its own separate accent color, and now the same
   var(--font-display) heading font as everywhere else too (a one-off
   Merriweather serif got reverted here for the same reason) — while
   keeping the corporate structural changes (sharp corners, section
   dividers, drag-drop resume). --apply-navy/-hover are named
   for history/minimal-diff — every rule below still just reads these two
   tokens, so this is the one place that ever needed to change to retheme
   the whole page. Every token is scoped under .apply-page so a future
   change to the dashboard's --ink/--radius/--rule tokens can never leak
   in here, and vice versa.
   Full-width single column, not login's 50/50 split panel — a real
   application form (6 fields, an expandable JD, a file picker) reads as
   a working page, not a login screen, and a split layout only ever left
   half the viewport to actually do anything. */
.apply-page {
  --apply-navy: var(--ink);
  --apply-navy-hover: var(--ink-800);
  --apply-border: var(--rule-strong);
  --apply-divider: var(--rule);
  --apply-label: var(--ink-700);
  --apply-muted: var(--ink-soft);
  --apply-radius: 4px;
  min-height: 100vh;
  background: var(--surface);
}
.apply-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--apply-divider);
  background: var(--paper-raised);
}
.apply-header__logo { display: block; height: 36px; width: auto; object-fit: contain; }
.apply-content { display: flex; justify-content: center; padding: 48px 24px 64px; }
.apply-card {
  width: 100%;
  max-width: 620px;
  background: var(--paper-raised);
  border: 1px solid var(--apply-border);
  border-top: 3px solid var(--apply-navy);
  border-radius: var(--apply-radius);
  /* Flat top corners — a differently-colored/-width top border still
     rounding into the 1px gray sides reads as a rendering glitch at the
     corner pixel, not a deliberate accent. Sharp top, soft bottom. */
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  box-shadow: none;
  padding: 40px 48px;
}
.apply-card label { font-size: var(--text-md); font-weight: 500; color: var(--apply-label); text-transform: none; }
.apply-card input {
  border: 1px solid var(--apply-border);
  background: var(--paper-raised);
  border-radius: var(--apply-radius);
  padding: 10px 14px;
  min-height: 44px;
  box-shadow: none;
}
.apply-card input:focus-visible {
  outline: none;
  border-color: var(--apply-navy);
  box-shadow: 0 0 0 1px var(--apply-navy);
}
.apply-card .field__hint { font-size: var(--text-sm); color: var(--apply-muted); }
.apply-card button[type="submit"] {
  width: 100%;
  margin-top: 6px;
  height: 48px;
  min-height: 48px;
  border-radius: var(--apply-radius);
  background: var(--apply-navy);
  color: var(--paper-raised);
  font-size: var(--text-base);
  font-weight: 500;
}
.apply-card button[type="submit"]:hover { background: var(--apply-navy-hover); box-shadow: none; }

.apply-role { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--apply-divider); }
.apply-role h1 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--apply-navy);
  margin-bottom: 6px;
}
.apply-role__meta {
  color: var(--apply-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}
/* Job description — a plain "Show more/Show less" text link, not an
   accordion header with a chevron (confirmed explicitly; a rotating icon
   read as too playful for this page's corporate register). Reused as-is
   for the recruiter-facing Open Roles JD dialog too (.jd-body only, no
   toggle there — a modal is already fully revealed, nothing to disclose). */
.jd-accordion { margin-top: 14px; }
.jd-accordion__toggle {
  display: inline-flex;
  padding: 0;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--apply-navy);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  min-height: 0;
}
/* Overrides the global button hover/press-down effects (button:hover's
   background, button:active's scale(0.97), near the top of this file) —
   this is a plain text link, not a button that should look pressable. */
.jd-accordion__toggle, .jd-accordion__toggle:hover, .jd-accordion__toggle:active {
  background: none;
  transform: none;
  transition: none;
  box-shadow: none;
  color: var(--apply-navy-hover);
}
.jd-accordion__panel[hidden] { display: none; }
.jd-accordion__panel-inner { padding: 4px 4px 16px; }
.jd-body { font-size: var(--text-base); line-height: 1.6; color: var(--ink-soft); white-space: pre-wrap; margin: 0; }

/* Section grouping — Personal information / Professional information /
   Resume read as distinct steps in a formal application, not one long
   undifferentiated field list. */
.apply-section-label {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--apply-muted);
  margin-bottom: 4px;
}
.apply-section-divider { border-top: 1px solid var(--apply-divider); margin: 24px 0; }

/* Phone — a country/dial-code select fused visually to the number input,
   read as one field even though it's two controls (recruiting worldwide
   means a bare local number with no country context isn't reliably
   callable). Explicit height match, not just "inherits the same input
   rule" — a <select>'s own line-height/UA padding can drift a pixel or
   two off a same-height <input> in some browsers otherwise. */
.apply-phone { display: flex; gap: 8px; }
.apply-phone select {
  flex: 0 0 auto;
  width: auto;
  max-width: 108px;
  height: 44px;
  min-height: 44px;
  border: 1px solid var(--apply-border);
  background: var(--paper-raised);
  border-radius: var(--apply-radius);
  padding: 10px 8px;
}
.apply-phone input { flex: 1; min-width: 0; height: 44px; }

/* Resume — a drag-and-drop zone standing in for the native file input
   (still visually hidden but functionally required), not a "Choose file"
   button — a corporate application form's one moment of real affordance
   is the file drop, and a bare button read as dated next to everything
   else on this page. */
.apply-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 24px;
  border: 2px dashed var(--apply-border);
  border-radius: var(--apply-radius);
  background: var(--paper-raised);
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  .apply-dropzone { transition: border-color 160ms ease, background-color 160ms ease; }
}
.apply-dropzone:hover, .apply-dropzone.is-dragover { border-color: var(--apply-navy); background: var(--paper); }
.apply-dropzone__icon { color: var(--apply-muted); }
.apply-dropzone__text { font-size: var(--text-base); color: var(--apply-label); }
.apply-dropzone__link { color: var(--apply-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.apply-dropzone__hint { font-size: var(--text-sm); color: var(--apply-muted); }
/* The empty prompt (icon/text/hint) and the selected-file row are
   mutually exclusive — [hidden] on the file row is the only state that
   needs JS to flip; the prompt just disappears once .has-file is set,
   no second hidden attribute to keep in sync. */
.apply-dropzone.has-file .apply-dropzone__icon,
.apply-dropzone.has-file .apply-dropzone__text,
.apply-dropzone.has-file .apply-dropzone__hint {
  display: none;
}
.apply-dropzone__file {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-md);
  color: var(--apply-label);
}
.apply-dropzone__file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.apply-dropzone__remove {
  padding: 0;
  background: none;
  border: none;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--apply-navy);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  min-height: 0;
}
.apply-dropzone__remove:hover, .apply-dropzone__remove:active { background: none; transform: none; box-shadow: none; color: var(--apply-navy-hover); }
#apply-resume {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* [hidden] must win over the flex display below — an ID selector's
   display:flex otherwise beats the attribute's default display:none on
   specificity alone, exactly the same bug .hireai__dialog hit earlier:
   the success message showed immediately on page load, before any
   submission, because "hidden" was never actually hiding it. */
#apply-success[hidden] { display: none; }
#apply-success { display: flex; flex-direction: column; align-items: flex-start; }
.apply-success__icon { color: var(--apply-navy); margin-bottom: 16px; }
#apply-success h1 { font-family: var(--font-display); color: var(--apply-navy); margin-bottom: 8px; }

@media (max-width: 640px) {
  .apply-header { padding: 18px 20px; }
  .apply-content { padding: 32px 16px 48px; }
  .apply-card { padding: 28px 24px; }
}

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

.banner {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border: 1px solid var(--brick);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-card);
  padding: 14px 16px 14px 18px;
  font-size: var(--text-base);
  color: var(--ink-soft);
  margin-bottom: 18px;
  display: none;
}
.banner.is-visible { display: block; }
/* A nudge, not a problem — the default border-left is --brick (reserved
   for errors elsewhere in this system); this variant swaps it for the
   one neutral interactive accent instead. */
.banner--info { border-left-color: var(--ink); }
.banner strong {
  display: block;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

/* ---------- compact system-status bar (Overview) ---------- */

.status-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 11px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  margin-bottom: 24px;
  font-size: var(--text-md);
}

.status-bar__dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: var(--text-md);
  color: var(--ink);
}
.status-bar__dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-muted);
}
.status-bar[data-state="running"] .status-bar__dot::before { background: var(--green-ink); }
.status-bar[data-state="running"] .status-bar__dot { color: var(--green-ink); }
.status-bar[data-state="stopped"] .status-bar__dot::before { background: var(--brick-ink); }
.status-bar[data-state="stopped"] .status-bar__dot { color: var(--brick-ink); }
@media (prefers-reduced-motion: no-preference) {
  .status-bar[data-state="running"] .status-bar__dot::before { animation: pulse 2s ease-in-out infinite; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--green-ink) 55%, transparent); }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px color-mix(in srgb, var(--green-ink) 0%, transparent); }
}

.status-bar__meta { color: var(--ink-soft); }
.status-bar__spacer { flex: 1; }
.status-bar button { padding: 7px 14px; font-size: var(--text-md); min-height: 32px; }

/* ---------- metrics row (Overview) ---------- */
/* A grid of small bordered cards, not a shared-divider strip (confirmed
   explicitly) — each number gets its own quiet card instead of leaning on
   a neighbor's border to read as separate. "Needs review" gets the same
   soft-amber tint the "Needs manual review" status tag uses elsewhere on
   this page, so the one metric that wants attention pops without a loud
   color the other five don't share. */

.metrics-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 900px) { .metrics-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .metrics-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper-raised);
}
.metric__value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.1;
}
.metric__label {
  font-size: var(--text-sm);
  color: var(--ink-soft);
  font-weight: 600;
}
.metric--attention { background: var(--amber-bg); border-color: var(--amber-border); }
.metric--attention .metric__value { color: var(--amber-ink); }
.metric--attention .metric__label { color: var(--amber-ink); }

/* ---------- cards / sections ---------- */

.card {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.card h2 { font-size: var(--text-lg); font-weight: 600; margin-bottom: 14px; }
.card__header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.card__header h2 { margin-bottom: 0; }
.card + .card { margin-top: 20px; }


/* Two intake channels — email polling and manual resume uploads — read as
   one subtle toolbar strip now (confirmed explicitly), not two separate
   bordered cards competing with the stat cards/filters below for
   attention. Same two .status-bar components, unchanged IDs/markup (JS
   still toggles data-state on each exactly as before) — only the visual
   weight moves: the row itself carries the one border/background, each
   .status-bar inside it goes borderless/transparent and shares the strip,
   split by a single divider. */
.intake-row {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper-raised);
}
.intake-row .status-bar {
  flex: 1;
  margin-bottom: 0;
  padding: 9px 16px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: var(--text-md);
}
.intake-row .status-bar:first-child { border-right: 1px solid var(--rule); }
@media (max-width: 900px) {
  .intake-row { flex-direction: column; }
  .intake-row .status-bar:first-child { border-right: none; border-bottom: 1px solid var(--rule); }
}

.settings-footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.card__intro { font-size: var(--text-md); color: var(--ink-soft); margin: 0 0 16px; }

/* Per-card Save button (Automation/Email Templates) — the shared
   `button, .btn { display: inline-flex; ... }` rule further down this
   file is unconditional author CSS, which beats the browser's own
   `[hidden] { display: none }` UA rule regardless of specificity (same
   cascade-origin gotcha as an unconditionally-styled <dialog>) — without
   this, the [hidden] attribute would do nothing and the button would
   render always-visible no matter its dirty state. */
#automation-save-btn[hidden], #templates-save-btn[hidden] { display: none; }

/* Only present in the DOM when that specific card actually has unsaved
   changes, so an empty :not([hidden]) match never happens; the
   margin/border only need to apply when it's actually shown. */
.card__save-row:has(button:not([hidden])) {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: flex-end;
}

.status-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.status-detail { font-size: var(--text-md); color: var(--ink-soft); margin: 10px 0 0; }
.status-detail:empty { display: none; }
.card-headline { font-size: var(--text-base); font-weight: 600; color: var(--ink); margin: 0 0 4px; }

.file-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.file-row__name { font-family: var(--font-mono); font-size: var(--text-md); min-width: 130px; }
.file-row__actions { display: flex; gap: 8px; margin-left: auto; }
.file-row__actions button { padding: 5px 12px; font-size: var(--text-md); }

@media (max-width: 480px) {
  .file-row { flex-direction: column; align-items: stretch; }
  .file-row__actions { margin-left: 0; }
  .file-row__actions button { flex: 1; }
}

.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 36px 0 12px;
}
.section-label:first-child { margin-top: 0; }
.section-desc { font-size: var(--text-md); color: var(--ink-soft); margin: -10px 0 16px; }

/* ---------- Settings page — structural pass, colors untouched ----------
   Spacing scale + hairline-only depth (no shadow), scoped to this one
   page via .page--settings (set on <main> by settings.html's main_class
   block) so the rest of the app's .card/dialog shadow treatment — a
   deliberate earlier choice, see --shadow-card's own comment — stays
   exactly as it is everywhere else. Every color below still reads from
   this file's existing --paper/--ink/--rule tokens; only the spacing
   values move onto the 4px-based --space-* scale and the shadow drops
   in favor of the border alone, the same hairline-only pattern already
   used elsewhere in this file (.file-row, .template-row, .stamp). */
.page--settings .card { box-shadow: none; padding: var(--space-lg); }
.page--settings .card + .card { margin-top: var(--space-lg); }
.page--settings .file-row { padding: var(--space-sm); gap: var(--space-sm); }
.page--settings .file-rows { gap: var(--space-xs); margin-top: var(--space-md); }

/* Section labels inside Settings read as real subheadings — bold,
   larger, a hairline rule underneath — instead of the small-caps mono
   eyebrow tag used elsewhere (.section-label stays exactly as it was on
   Requests, which still wants the quieter eyebrow treatment). */
.page--settings .section-label {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  margin: 0 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--rule);
}
.page--settings .section-label:not(:first-child) { margin-top: var(--space-xl); }

/* Left-sidebar category nav (Linear/Stripe-style settings pattern) —
   static/dashboard.js's settings-nav block shows one .settings-panel at a
   time; everything else on this page is unchanged markup, just grouped
   under whichever category it belongs to. 1400px (widened from 1080px,
   confirmed explicitly) — the Team & Access table's 7 real columns were
   cramped into the same narrow measure a 2-field form is comfortable at,
   leaving a wide dead gap on any screen wider than a laptop. */
.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: var(--space-xl); align-items: start; max-width: 1400px; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: var(--space-lg); }
.settings-nav__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius);
  background: none;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  min-height: 0;
  box-shadow: none;
}
.settings-nav__item:hover { background: var(--paper); color: var(--ink); box-shadow: none; }
.settings-nav__item.is-active { background: var(--ink); color: var(--on-accent); }
/* The generic a/button/input focus-visible rule (near the top of this
   file) draws a plain rectangular outline 2px outside the element — on a
   rounded, filled nav item that reads as a mismatched square ring around
   a round black pill (confirmed explicitly, visible in a screenshot).
   box-shadow always follows border-radius in every browser, unlike
   outline, so it draws a clean rounded ring instead: a paper-colored gap,
   then the focus ring. */
.settings-nav__item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--focus);
}
.settings-panels { min-width: 0; }
.settings-panel { display: none; flex-direction: column; }
.settings-panel.is-active { display: flex; }
@media (max-width: 860px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}

.page--settings .settings-footer { margin-top: var(--space-lg); padding-top: var(--space-md); display: flex; justify-content: flex-end; }

/* ---------- filters ---------- */
/* Two deliberate groups, not one flat row of whatever-width-content-gives —
   fields cluster and share the row's growth evenly on the left, actions
   stay a fixed, tightly-grouped unit pinned to the right. Without this,
   a <select> and a date input each size to their own native content width
   and the gap before the buttons ends up arbitrary instead of intentional. */
.filters {
  display: flex;
  align-items: flex-end;
  gap: 12px 20px;
  flex-wrap: wrap;
}
.filters__fields {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}
.filters .field { margin-bottom: 0; }
.filters .field--search { flex: 2 1 200px; min-width: 180px; }
.filters .field--compact { flex: 1 1 130px; min-width: 130px; max-width: 160px; }
.filters .field--range { flex: 1 1 180px; min-width: 180px; max-width: 220px; }

.filters__chips { margin-top: 12px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--rule); }

/* ---------- dual-handle Match % range slider ----------
   Two native <input type="range"> stacked on the same track — the
   standard lightweight way to build a min/max slider with no JS drag
   logic and no extra dependency. Each input keeps its own transparent
   track; only the thumb is visible, so both appear to share one line. */
.range-slider {
  position: relative;
  height: 24px;
  margin-top: 6px;
}
.range-slider__track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--rule-mid);
  border-radius: var(--radius-pill);
  transform: translateY(-50%);
}
.range-slider__fill {
  position: absolute;
  top: 50%;
  height: 4px;
  background: var(--ink);
  border-radius: var(--radius-pill);
  transform: translateY(-50%);
}
.range-slider input[type="range"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.range-slider input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--paper-raised);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.range-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--paper-raised);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.range-slider input[type="range"]::-webkit-slider-runnable-track { background: transparent; }
.range-slider input[type="range"]::-moz-range-track { background: transparent; }

/* ---------- candidate bulk-select ---------- */

.ledger__select-col { width: 36px; }
.ledger--candidates td:first-child, .ledger--candidates th:first-child { padding-right: 0; }
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
}
.bulk-actions span { font-size: var(--text-md); color: var(--ink-soft); font-weight: 500; }
.filters__chips-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
/* Small, clean toggle chip (confirmed explicitly) — light gray fill at
   rest, same fill but dark bold text when selected, not the previous
   solid-ink-invert + checkmark treatment. Weight alone carries "this is
   active" now that the fill doesn't change, which is why selected also
   gets a border — two signals, still no color dependency. Scoped to this
   one control rather than reskinning every button pill-shaped: the rest
   of the app's buttons stay the flatter 7-8px radius the design system
   already uses everywhere else. */
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--rule);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  min-height: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .chip { transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms ease; }
}
.chip:hover { background: var(--rule-mid); box-shadow: none; }
.chip:active { transform: scale(0.97); }
.chip.is-selected { background: var(--rule); color: var(--ink); font-weight: 700; border-color: var(--ink-muted); }
.chip.is-selected:hover { background: var(--rule-mid); }

/* ---------- ledger table ---------- */

/* separate, not collapse — position: sticky on thead th is unreliable
   (Chrome/Safari both mis-place stuck cells) inside a collapsed-border
   table, which is exactly the overlapping/floating header artifact this
   fixes. border-spacing: 0 keeps cells touching so this is a no-op
   visually: every border here is a bottom-only rule (no verticals, no
   adjacent top+bottom pair on the same edge), so nothing doubles up. */
.ledger { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--text-base); }
/* Candidates table keeps the default auto layout (unlike .ledger--roles
   below) — a forced min-width to give every column guaranteed room ended
   up needing more width than fit on a real screen, trading "header
   sometimes wraps" for "the whole table now needs horizontal scroll,"
   which is worse. nowrap on headers is the narrow fix for the actual
   complaint (a short header like "Match" wrapping to two lines while its
   neighbors don't) without forcing a table width the page doesn't have. */
.ledger thead th {
  text-align: left;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
  /* Sticks to the viewport under the 64px sticky nav. Requires that no
     ancestor (.table-wrap included) has a non-visible overflow — see the
     .table-wrap rule below. Opaque background so row content scrolling
     up underneath doesn't show through. Turns off for free on narrow
     screens — the media query below hides thead entirely in favor of the
     stacked-card layout, so there's nothing left to stick. */
  position: sticky;
  top: 64px;
  z-index: 2;
  background: var(--paper-raised);
}

@media (max-width: 640px) {
  /* Below this width .nav itself wraps onto a variable number of lines
     (see the .nav rule in that same media query) — its height is no
     longer the fixed 64px the table header's offset assumes. Rather than
     guess at a height that changes with content, the table header just
     stops sticking here; .ledger--candidates already loses its thead
     entirely at 720px, so this only ever affects .ledger--roles. */
  .ledger thead th { position: static; }
}
/* A long unbroken string (an email with no spaces, e.g.) has nowhere
   natural to break, so auto-layout would otherwise let it overflow into
   the next column instead of wrapping. */
.ledger tbody td:nth-child(1) { overflow-wrap: anywhere; }
.ledger tbody td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.ledger tbody tr:last-child td { border-bottom: none; }
.ledger tbody tr { background-color: transparent; }
@media (prefers-reduced-motion: no-preference) {
  .ledger tbody tr { transition: background-color 120ms ease; }
}
.ledger tbody tr:hover { background-color: var(--paper); }
.ledger tbody tr.is-clickable { cursor: pointer; }
/* Cleared every interview round, just waiting on the document-request
   click — highlighted (confirmed explicitly) so it reads at a glance.
   Green, not amber — amber is already "Needs manual review"'s color both
   on the status stamp and the stat card, and reusing it here would color-
   code this as the same kind of thing. Green reads as its own signal:
   this candidate is in a good place, one action away from done. */
.ledger--candidates tbody tr.is-awaiting-documents { background-color: var(--green-bg); }
.ledger--candidates tbody tr.is-awaiting-documents:hover { background-color: color-mix(in srgb, var(--green-bg) 60%, var(--green-border) 40%); }
.ledger td[data-numeric], .ledger th[data-numeric] { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.ledger__candidate-name { font-weight: 700; font-size: var(--text-base); color: var(--ink); }
.ledger__candidate-email { display: block; font-size: var(--text-sm); color: var(--ink-soft); margin-top: 2px; }
/* Generous row padding (confirmed explicitly) — scoped to candidates only,
   not every .ledger table (roles/users/requests didn't ask for this and
   stay at the tighter default). */
.ledger--candidates tbody td { padding: 16px 12px; }

.ledger__match { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ledger__match--high { font-weight: 700; color: var(--ai-ink); }
.ledger__match--low { color: var(--ink-soft); }

.ledger__experience-level { display: block; font-size: var(--text-md); color: var(--ink-soft); margin-top: 2px; }

/* Left unconstrained, Title/Budget wrap badly with real content ("Cybersecurity
   Engineer", "₹18–30 LPA") — fixed layout + explicit widths on the
   predictable columns. The job description isn't a column at all — it's a
   native title="" tooltip on the role name, hover to read it, which is what
   frees Title up to take the rest of the row. Full-width Title on a wide
   screen is correct, not a bug (confirmed explicitly, reverting a
   misdiagnosed "fix") — the actual complaint two messages back was the
   scrollbar/navbar gap, not this table. */
.ledger--roles { table-layout: fixed; min-width: 770px; }
/* middle, not the base ledger's top — every column here is single-line
   (unlike the candidates table's stacked Candidate/Experience cells, where
   top-align is what keeps multi-line text starting at a consistent
   baseline). The Edit/Deactivate/Delete buttons are visibly taller
   (min-height 30px) than the plain text/status pill beside them; anchored
   to the row's top edge, that height difference reads as the actions
   column sitting lower than everything else in the row. Centering all of
   them removes that without needing to fake a taller line-height on the
   text cells just to match. */
.ledger--roles tbody td { vertical-align: middle; }
.ledger--roles th:nth-child(1), .ledger--roles td:nth-child(1) { overflow: hidden; }
.ledger--roles td:nth-child(1) .link-button {
  color: var(--ink);
  font-size: var(--text-base);
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
}
.ledger--roles td:nth-child(1) .link-button:hover { text-decoration-color: var(--ink); }
/* Column order: Title, Department, Location, Budget, Status, actions —
   nth-child below must track that exact order (table-layout: fixed means
   every column's width comes from these rules, not its content, so an
   nth-child left pointing at the wrong column after reordering silently
   hands its width to the wrong thing instead of erroring). */
.ledger--roles th:nth-child(2), .ledger--roles td:nth-child(2) { width: 110px; }
.ledger--roles th:nth-child(3), .ledger--roles td:nth-child(3) { width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger--roles th:nth-child(4), .ledger--roles td:nth-child(4) { width: 90px; white-space: nowrap; }
.ledger--roles th:nth-child(5), .ledger--roles td:nth-child(5) { width: 90px; }
/* Share/Edit/Activate-Deactivate/Delete are all icon-only buttons now (see
   dashboard.js's renderRoles) — 4 × 30px .btn--icon + 3 × 8px gaps, plus
   the cell's own padding, is what this column actually needs; it used to
   be 250px wide to fit "Edit"/"Deactivate"/"Delete" as text on one line. */
.ledger--roles th:nth-child(6), .ledger--roles td:nth-child(6) { width: 170px; }
.ledger--roles .ledger__actions { flex-wrap: nowrap; white-space: nowrap; }
.ledger--roles .ledger__actions .btn--icon { padding: 0; }
.ledger__empty {
  padding: 48px 20px;
  text-align: center;
}
.ledger__empty-title { font-weight: 600; color: var(--ink); margin-bottom: 4px; font-size: var(--text-base); }
.ledger__empty-body { color: var(--ink-soft); font-size: var(--text-md); }
/* A <span>, not a <td> itself — display:flex directly on a table cell
   takes it out of normal table-cell layout, so it no longer stretches to
   match the row's height like its sibling <td>s do, and its border-bottom
   ends up sitting higher than the rest of the row's. Wrapping the flex
   layout in an inline child keeps the <td> a plain, normal-height cell. */
.ledger__actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; position: relative; }
/* flex-start, not flex-end: the note-badge (✎) is the one icon every row
   always renders (ai-badge/icon-link/compose/document-request are all
   conditional on that candidate's data). Anchoring the group to the right
   let a row with fewer icons show a gap on its left, so the always-present
   ✎ landed at a different x per row — the actual "ragged column" the
   alignment complaint was about. Left-anchoring puts ✎ at the same x on
   every row; the ragged edge moves to the right, away from where a
   top-to-bottom scan notices it. */
.ledger:not(.ledger--roles) .ledger__actions {
  flex-wrap: nowrap;
  white-space: nowrap;
  justify-content: flex-start;
}
/* Same height as .ai-badge — a 32x32 icon button next to it, not a bare
   glyph, so the two read as one action group rather than a real control
   sitting beside an unstyled afterthought. Transparent + no border at
   rest is deliberate: this is the secondary, quieter action next to AI. */
.ledger__icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  line-height: 1;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: var(--text-lg);
  border-radius: var(--radius-pill);
  background: transparent;
}
@media (prefers-reduced-motion: no-preference) {
  .ledger__icon-link { transition: background-color 160ms ease, color 160ms ease; }
}
.ledger__icon-link:hover, .ledger__icon-link:focus-visible { color: var(--ink); background: var(--paper); text-decoration: none; }

/* ---------- row "⋯" menu (Overview candidates) ---------- */
/* Every per-row action (note, AI reasoning, open email, compose, request
   documents) used to sit in the row permanently — confirmed explicitly
   this read as cluttered. Collapsed into one trigger; the actions
   themselves are unchanged (same buttons/classes/data, so every existing
   click handler still just works), only their container changes.
   Trigger stays always visible, not hover-only (confirmed explicitly,
   reversing an earlier pass) — a hidden-until-hover "⋯" isn't a
   discoverable affordance for someone who doesn't already know it's
   there to look for. */
.row-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-soft);
  font-size: var(--text-lg);
  line-height: 1;
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  .row-menu-trigger { transition: background-color 160ms ease, color 160ms ease; }
}
.row-menu-trigger:hover, .row-menu-trigger:focus-visible { background: var(--paper); color: var(--ink); }

.row-menu {
  display: none;
  flex-direction: column;
  gap: 1px;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 15;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  box-shadow: var(--shadow-hover);
}
.row-menu.is-open { display: flex; }
/* Added by dashboard.js only when opening downward would run the menu
   past the bottom of the viewport (rows near the end of a page/table) —
   anchors from the trigger's top edge instead of its bottom. */
.row-menu.row-menu--up { top: auto; bottom: calc(100% + 4px); }
/* Every action collapses to the same plain, full-width list-item shape in
   here regardless of which badge class it normally is elsewhere in the
   app — a mixed row of circular icon buttons stacked vertically would
   still read as icons bolted into a list, not a real menu. */
.row-menu .note-badge, .row-menu .ai-badge, .row-menu .compose-badge, .row-menu .ledger__icon-link {
  width: auto;
  height: auto;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
  font-weight: 500;
  white-space: nowrap;
}
.row-menu .note-badge.has-note { background: transparent; color: var(--ink); }
.row-menu__glyph { flex: none; width: 16px; text-align: center; font-size: var(--text-base); }

/* No overflow here by default. Any non-visible overflow-x makes this
   element the sticky containing block (browsers also force overflow-y to
   auto), so thead th { top: 64px } pins 64px into this wrap's own box and
   lands on top of short/empty table bodies — "No candidates yet" under
   the MATCH/EXPERIENCE headers. Candidates don't need X-scroll (they
   stack into cards before columns overflow); roles do, via --scroll.
   (Briefly needed --scroll here too when Recruiter/Interview/Panel were
   still inline table columns at 11 wide — the table overflowed past
   .card's edge at normal laptop widths. Moving those into the candidate
   drawer's own Pipeline section instead brought it back to its original
   9-column width, so the root problem is fixed and the workaround came
   back out rather than staying as unnecessary complexity.) */
.table-wrap { overflow: visible; }
.table-wrap--scroll { overflow-x: auto; }
/* Inside an X-scroller, viewport-sticky is impossible — top: 64px only
   mis-offsets the header into the body. Leave headers in normal flow. */
.table-wrap--scroll .ledger thead th { position: static; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 16px;
}
.pagination__info {
  font-size: var(--text-md);
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------- status badges ---------- */
/* Soft tag, not a giant solid pill — confirmed explicitly: a light tint
   background carries the outcome, dark text stays legible on it, and the
   badge stops competing for attention with everything else in the row.
   Title Case, not shouting caps — capitalize() rather than a stored-string
   rewrite, since poll.py's Status strings ("Not suitable for current
   position") are already correctly-cased English, just not per-word. */
.stamp {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 2px 9px;
  white-space: normal;
  line-height: 1.3;
}
.stamp--neutral { color: var(--ink-soft); background: color-mix(in srgb, currentColor 12%, var(--paper-raised)); border-color: var(--rule-strong); }
.stamp--green { color: var(--green-ink); background: var(--green-bg); border-color: var(--green-border); }
.stamp--brass { color: var(--brass-ink); background: var(--brass-bg); border-color: var(--brass-border); }
.stamp--amber { color: var(--amber-ink); background: var(--amber-bg); border-color: var(--amber-border); }
.stamp--brick { color: var(--brick-ink); background: var(--brick-bg); border-color: var(--brick-border); }
.stamp--gray { color: var(--gray-ink); background: var(--gray-bg); border-color: var(--gray-border); }
/* Joining date row in the BGV case panel: the date and its Change/Add link on one line; "Not recorded" in the
   exception colour, since retention needs it. */
.bgv-joining { display: inline-flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.bgv-joining--missing { color: var(--brick-ink); }

/* An editable status: the exact same .stamp pill, made real. Every
   property .stamp already sets (tint, shape, type) beats the plain
   `select` rule above on specificity alone — a class always outranks a
   bare element selector, regardless of source order — so this only needs
   to patch what .stamp never touches: the generic select's full-width
   sizing, a pointer cursor to earn back the affordance lost by not
   looking like a form field anymore, and the native dropdown arrow
   (confirmed explicitly, removed — a soft tag reads as a label first,
   the pointer cursor + hover darken is affordance enough that it's
   editable). */
select.stamp-select {
  width: auto;
  max-width: 100%;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  /* A long selected value (e.g. "Final Round Awaiting Feedback") in a
     column too narrow to fit it degrades to an ellipsis instead of
     clipping mid-word or forcing the column wider than its neighbors —
     the dropdown's own option list is unaffected, still shows the full
     text once opened. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* filter, not color-mix(currentColor...): a brightness dip works
   uniformly across every variant's own fill color without a per-variant
   override. */
select.stamp-select:hover { filter: brightness(0.96); }

/* Plain-text status label — no border/background/padding, unlike .stamp.
   Used where a status sits next to real buttons (Settings' Connection
   card) and a bordered box reads as one more clickable control instead of
   information. */
.status-text {
  font-size: var(--text-md);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.status-text::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
/* Subtle green bg only on the connected state (confirmed explicitly) — a
   real "you're good" signal earns a badge; the not-connected/neutral
   states stay plain text so this pop doesn't repeat for every state. */
.status-text--green { color: var(--green-ink); background: var(--green-bg); padding: 4px 10px; border-radius: var(--radius-pill); }
.status-text--brick { color: var(--brick-ink); }
.status-text--neutral { color: var(--ink-soft); }

/* Toast — ephemeral confirmation after saves/deletes/etc. Paper card +
   ink, not a dark snackbar: same raised surface language as .card so it
   reads as part of the system rather than a second chrome theme. Success
   stays monochrome (check mark); error gets the thin --brick left accent
   used elsewhere, never a full red-tinted box. */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(280px, calc(100vw - 32px));
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px 14px;
  background: var(--paper-raised);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.35;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  z-index: 40;
  overflow: hidden;
}
/* The UA stylesheet gives [popover] `inset: 0; margin: auto`, which fights
   the fixed bottom-centre placement above — top/right/margin are reset so
   the toast stays exactly where it was before it joined the top layer. */
#toast[popover] {
  top: auto;
  right: auto;
  margin: 0;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
  cursor: pointer;
}
.toast[data-variant="error"] {
  border: 1px solid var(--brick);
}
.toast[data-variant="progress"] {
  cursor: default;
}
.toast__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper-raised);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1;
}
.toast[data-variant="error"] .toast__icon {
  background: color-mix(in srgb, var(--brick) 14%, var(--paper-raised));
  color: var(--brick-ink);
}
.toast[data-variant="progress"] .toast__icon {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
}
.toast__msg { flex: 1; min-width: 0; }
.toast__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--ink);
  transform: scaleX(1);
  transform-origin: left center;
  opacity: 0.35;
}
.toast[data-variant="error"] .toast__progress {
  background: var(--brick);
  opacity: 0.55;
}
.toast[data-variant="progress"] .toast__progress {
  opacity: 0.85;
}
@media (prefers-reduced-motion: no-preference) {
  .toast {
    transition: opacity 200ms var(--ease-standard), transform 220ms var(--ease-standard);
  }
  .toast.is-visible:not([data-variant="progress"]) .toast__progress {
    animation: toast-progress 3.2s linear forwards;
  }
  .toast[data-variant="progress"] .toast__progress {
    transition: transform 120ms linear;
  }
}
@keyframes toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ---------- AI reasoning trigger ---------- */
/* Icon-only, same monochrome treatment as the email icon-link beside it —
   no purple, no label, just the sparkle glyph. Accessible name lives on
   the button (aria-label/title) since there's no visible text anymore. */
.ai-badge, .compose-badge, .view-request-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-soft);
  font-size: var(--text-lg);
  line-height: 1;
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  .ai-badge, .compose-badge, .view-request-badge { transition: background-color 160ms ease, color 160ms ease; }
}
.ai-badge:hover, .ai-badge:focus-visible, .compose-badge:hover, .compose-badge:focus-visible,
.view-request-badge:hover, .view-request-badge:focus-visible {
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
}
.ai-badge:active, .compose-badge:active, .view-request-badge:active { box-shadow: none; }

/* ---------- note trigger ---------- */
/* Same icon-button shape/size as .ai-badge beside it. "has-note" gives it
   a permanent, quiet tint (not just on hover) — the one visual difference
   between "no one has left a note here" and "there's context worth
   reading" ought to be visible before clicking, not only after. */
.note-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-soft);
  font-size: var(--text-lg);
  line-height: 1;
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  .note-badge { transition: background-color 160ms ease, color 160ms ease; }
}
.note-badge:hover, .note-badge:focus-visible { background: var(--paper); color: var(--ink); box-shadow: none; }
.note-badge:active { box-shadow: none; }
/* Solid ink fill, not a status-color tint — a brass/brick badge here would
   visually collide with the brass/brick Status stamp already sitting in
   the same row, reading as a second, competing status instead of separate
   metadata. Same "filled = on" language the status chips above this table
   already use for .chip.is-selected — borrowed from this exact page, not
   invented fresh. */
.note-badge.has-note { background: var(--ink); color: var(--on-accent); }
.note-badge.has-note:hover, .note-badge.has-note:focus-visible { background: var(--focus-hover); color: var(--on-accent); }

.ai-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ai-ink);
}

/* ---------- settings form ---------- */

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.settings-grid .field--full { grid-column: 1 / -1; }
/* A label that wraps to 2 lines next to one that doesn't (e.g. "Minimum
   match score" vs. "Rate limit per sender") otherwise pushes only its own
   input down — reserving 2 lines' worth of height for every paired label
   keeps both inputs in the row starting at the same height regardless of
   how long either label's text is. */
.settings-grid .field:not(.field--full) label { min-height: 3em; }
@media (max-width: 640px) { .settings-grid { grid-template-columns: 1fr; } }

.field--checkbox { margin-bottom: 14px; }
.field--checkbox label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-base);
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  margin-bottom: 0;
  cursor: pointer;
  position: relative;
}
.field--checkbox .field__hint { margin-left: 54px; margin-top: -2px; }

/* Bare native checkboxes read as unstyled/default-browser; a small custom
   switch reads as a deliberate on/off control instead. Sized a bit more
   substantial than a compact form-field toggle since this one carries a
   real decision (whether HireFlow emails anyone at all), not just a
   minor per-row preference. */
.field--checkbox input[type="checkbox"] {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  width: 44px;
  height: 24px;
  margin: 0;
  cursor: pointer;
}
.switch {
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--rule-mid);
  position: relative;
  transition: background 150ms ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 150ms ease;
}
input[type="checkbox"]:checked + .switch { background: var(--focus-hover); }
input[type="checkbox"]:checked + .switch::after { background: var(--on-accent); transform: translateX(20px); }
input[type="checkbox"]:focus-visible + .switch { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Master toggle only — larger (48px) with a soft green tint when ON
   (confirmed explicitly), so this one real decision (does HireFlow email
   anyone at all) reads as heavier than the identical-looking per-template
   toggles below it, which stay the default dark-ink ON state. */
#auto_reply_enabled { width: 48px; }
#auto_reply_enabled + .switch { width: 48px; }
#auto_reply_enabled:checked + .switch { background: var(--green-bg); }
#auto_reply_enabled:checked + .switch::after { background: var(--green-ink); transform: translateX(24px); }


/* ---------- template/keyword rows — compact, opens a popup to edit ---------- */

/* Grid, not flex space-between: with flex, the toggle's x-position was
   wherever "info" happened to end — which drifted row to row as the
   template name/excerpt text width changed, so the switches never lined
   up in a straight column. Fixed 44px/36px tracks (switch width, pencil
   icon-button width) pin the toggle and button to the same x on every
   row regardless of the name column's content. */
.template-row {
  display: grid;
  grid-template-columns: 1fr 44px 36px;
  align-items: center;
  gap: 16px;
  padding: 12px;
  margin: 0 -12px;
  border-top: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}
.template-row:first-of-type { border-top: none; padding-top: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .template-row { transition: background-color 120ms ease; }
}
.template-row:hover { background: var(--paper); }
/* Reuses .field--checkbox's own label/switch layout wholesale (same
   on/off control as "Send automatic replies" above) — just sitting
   inline in this row instead of stacked full-width, so its outer
   margin-bottom has to go. */
.template-row__toggle { margin-bottom: 0; justify-self: center; }
/* The pencil edit button (3rd grid column) — icon-only now, not the old
   "Edit" text button (confirmed explicitly). */
.template-row > .btn--icon { justify-self: center; }
.template-row__info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.template-row__name { font-size: var(--text-base); font-weight: 700; }
.template-row__excerpt {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

dialog#template-editor-dialog, dialog#role-jd-dialog, dialog#users-dialog, dialog#reason-dialog, dialog#role-form-dialog, dialog#confirm-dialog, dialog#note-dialog, dialog#compose-email-dialog,
dialog#role-request-form-dialog, dialog#role-request-view-dialog, dialog#resume-dialog, dialog#bgv-doc-dialog, dialog#joining-date-dialog {
  width: min(560px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius-xl);
  background: var(--paper-raised);
  color: var(--ink);
  padding: 26px 28px;
  box-shadow: var(--shadow-modal);
}
dialog#template-editor-dialog::backdrop, dialog#role-jd-dialog::backdrop, dialog#users-dialog::backdrop,
dialog#reason-dialog::backdrop, dialog#role-form-dialog::backdrop, dialog#confirm-dialog::backdrop, dialog#candidate-drawer::backdrop,
dialog#note-dialog::backdrop, dialog#compose-email-dialog::backdrop,
dialog#role-request-form-dialog::backdrop, dialog#role-request-view-dialog::backdrop, dialog#resume-dialog::backdrop, dialog#bgv-doc-dialog::backdrop,
dialog#joining-date-dialog::backdrop {
  background: rgba(17, 17, 17, 0.32);
}
#template-editor-title, #role-jd-dialog-title, #reason-dialog-title, #role-form-title, #confirm-dialog-title, #note-dialog-title, #compose-email-title,
#role-request-form-title, #role-request-view-title, #joining-date-title { font-size: var(--text-xl); margin: 0 0 14px; }
#resume-dialog-title { font-size: var(--text-xl); margin: 0 0 14px; }
#template-editor-hint, #note-dialog-subtitle, #joining-date-hint { margin: 0 0 14px; }

/* ---------- Per-role glance ---------- */
/* Sits above the JD in the role dialog. Flat and rule-separated, not a
   nested card — the dialog is already the elevated surface. */
.role-glance {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--rule);
}
.role-glance__figures { display: flex; gap: var(--space-lg); margin-bottom: var(--space-sm); }
.role-glance__figure { display: flex; flex-direction: column; gap: 2px; }
.role-glance__value { font-family: var(--font-display); font-size: var(--text-xl); color: var(--ink); }
.role-glance__label { font-size: var(--text-xs); color: var(--ink-muted); }
.role-glance__statuses { display: flex; flex-wrap: wrap; gap: 6px; }
.role-glance__empty { font-size: var(--text-md); color: var(--ink-muted); }

/* ---------- Resume preview ---------- */
/* Wider and taller than the shared dialog rule above, for the same
   reason #users-dialog is wider: this one exists to read a full page of
   A4, not to hold a form. The frame carries the container border so the
   document sits in a frame rather than bleeding into the dialog. */
dialog#resume-dialog { width: min(900px, 94vw); }
.resume-frame {
  width: 100%;
  height: min(70vh, 820px);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper);
}

/* ---------- Dashboard users dialog ---------- */
/* Wider than the other single-column dialogs sharing the base rule above
   — a list-beside-a-form layout needs the room a 560px dialog doesn't
   have. Same base look (border/radius/shadow/padding), just roomier. */
dialog#users-dialog { width: min(760px, 94vw); }

/* Same page-scoped, hairline-only depth call as the rest of Settings
   (see the .page--settings block above) — these two dialogs only ever
   open from this page, so restyling them by id doesn't touch any other
   page's dialogs (#confirm-dialog etc. stay on the shared shadow rule
   since they're reused app-wide). */
dialog#users-dialog, dialog#template-editor-dialog {
  box-shadow: none;
  padding: var(--space-xl);
}

.users-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
#users-dialog-title { font-size: var(--text-xl); margin: 0; }

.users-dialog__form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; row-gap: 20px; }
.users-dialog__form-grid label { text-transform: none; letter-spacing: normal; font-size: var(--text-md); font-weight: 500; margin-bottom: 6px; color: var(--ink); }
/* Was --radius-sm (8px) while every other input on this page (and the
   rest of the app) uses --radius (12px) — a pre-existing inconsistency,
   fixed while already touching this dialog for the same-radius-per-
   context principle the reference material calls for. */
.users-dialog__form-grid input, .users-dialog__form-grid select { height: 40px; border-radius: var(--radius); }
.users-dialog__form-grid input::placeholder { color: var(--ink-muted); opacity: 1; }

.users-dialog__footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--rule); }

@media (max-width: 640px) {
  .users-dialog__form-grid { grid-template-columns: 1fr; }
}

/* User column: avatar + name/email stack, reusing the exact identity
   pattern the candidates table already established (.ledger__candidate-*)
   rather than a parallel set of near-duplicate rules. */
.ledger--users .ledger__user-cell { display: flex; align-items: center; gap: 10px; }
.ledger--users .ledger__user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-soft);
}
.ledger--users .ledger__user-identity { min-width: 0; }
.users-count-hint { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rule); }

#template-editor-textarea, #note-dialog-textarea { width: 100%; margin-bottom: 16px; font-family: var(--font-body); font-size: var(--text-base); }
#template-editor-textarea.is-monospace { font-family: var(--font-mono); font-size: var(--text-md); }
/* Free-text notes, not code/templates — override the shared textarea rule
   below, which defaults to monospace for the columnar/data-editing cases
   (template source, JSON) that make up most of this app's textareas. */
#role-request-jd, #role-request-priority-notes, #role-request-view-reject-note {
  font-family: var(--font-body);
  font-size: var(--text-base);
}
.template-editor__actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- template editor: Edit/Preview tabs ---------- */
.template-editor__tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.template-editor__tab {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--rule-strong);
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 500;
  cursor: pointer;
  min-height: 0;
}
.template-editor__tab.is-active { background: var(--ink); color: var(--on-accent); border-color: var(--ink); }
.template-editor__preview {
  min-height: 180px;
  max-height: 320px;
  overflow-y: auto;
  padding: 16px;
  margin-bottom: 8px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  white-space: pre-wrap;
}
.template-editor__preview p { margin: 0 0 12px; }
.template-editor__preview p:last-child { margin-bottom: 0; }
.template-editor__preview-note { margin: 0 0 16px; font-size: var(--text-md); color: var(--ink-muted); }

/* ---------- compose email dialog ---------- */
.compose-email__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
#compose-email-title { margin: 0; font-weight: 700; }
/* Small plain gray "X", not the shared 34px bordered .btn--icon circle
   (confirmed explicitly too heavy for a close affordance in a compose
   window) — scoped to this one header so every other dialog's close
   button is untouched. */
.compose-email__header .btn--icon {
  width: 20px;
  height: 20px;
  min-height: 0;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: var(--text-md);
  box-shadow: none;
}
.compose-email__header .btn--icon:hover { color: var(--ink); background: transparent; box-shadow: none; }

/* Template + Cc as an equal 2-up row — both short fields, and pairing them
   frees up vertical room for the letter preview below without the dialog
   growing taller than the template editor's own single-column form.
   Labels/inputs already match the shared `label`/input rules (sentence-
   case, 40px) now that both went global in this same pass. */
.compose-email__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.compose-email__fields .field__hint { font-size: var(--text-xs); color: var(--ink-muted); }

/* A letterhead strip above the rendered body — reads unambiguously as "a
   real email," not a generic block of text, which matters here more than
   in the Settings template preview: Send dispatches this exact thing.
   White, not the page's own off-white (confirmed explicitly) — a "real
   email" reads as its own document, not a tinted panel. */
.compose-email__letter {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-raised);
}
/* Used standalone (not immediately followed by more dialog content, unlike
   the compose-email dialog's own usage) — e.g. the role-request view
   dialog, where a Priority notes field follows it. */
.compose-email__letter--spaced { margin-bottom: var(--space-md); }
/* Fixed label column, not per-row inline widths — guarantees the To and
   Subject values start at the exact same x position regardless of how
   long either label happens to be. */
.compose-email__letter-meta {
  display: grid;
  grid-template-columns: 60px 1fr;
  row-gap: 8px;
  column-gap: 12px;
  align-items: baseline;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--paper-raised);
}
.compose-email__letter-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}
/* The To value is an input now, but must not read as a form field
   sitting inside a letter — borderless until focused, same type size and
   baseline as the Subject line beside it. */
.compose-email__to-input {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 2px 6px;
  margin: -2px -6px;
  width: 100%;
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  color: var(--ink);
}
.compose-email__to-input:hover { border-color: var(--rule-mid); }
.compose-email__to-input:focus { border-color: var(--rule-strong); outline: none; background: var(--paper); }

/* Raw template text, so the mono face the rest of the app uses for
   machine-issued data applies here too — this is the string with its
   {name}/{role} placeholders still in it, not prose. */
/* Body face and the preview's own size/leading, deliberately: this box
   replaces the rendered preview in place, and the two must read as the
   same email in two states rather than as prose and its source code.
   (CLAUDE.md keeps --font-mono for machine-issued data; an email a
   recruiter is writing is language.) */
.compose-email__body-input {
  display: block;
  width: 100%;
  border: none;
  border-top: 1px solid var(--rule);
  padding: 16px;
  background: var(--paper);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  resize: vertical;
}
.compose-email__body-input:focus { outline: none; }
.compose-email__letter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 10px 16px;
  border-top: 1px solid var(--rule);
  background: var(--surface);
}
/* A sentence, so the body face. Not --brick: being mid-edit is a normal
   step, not an exception, and colouring it red every time someone edits
   spends the exception channel on routine work. The greyed Send button
   beside it already carries the signal; this only says what to do. */
/* --ink-600, not --ink-muted: at 13px the muted token measures 4.2:1 on
   this surface, under the 4.5:1 floor, and this line is the reason the
   Send button is disabled — the one sentence here that must be read. */
.compose-email__edited-flag { font-size: var(--text-md); color: var(--ink-600); }

.compose-email__letter .template-editor__preview {
  border: none;
  border-radius: 0;
  margin-bottom: 0;
  background: var(--paper-raised);
  /* Reserves scrollbar space up front so the preview's own width doesn't
     shift by a few pixels the moment content tall enough to scroll loads
     in — the space is there whether or not a scrollbar ends up drawn. */
  scrollbar-gutter: stable;
}
/* Real content missing, not the field left blank by a bug — say so in
   the same muted/italic voice used for empty states elsewhere, not plain
   body text that reads like content actually loaded. */
.template-editor__preview.is-empty { color: var(--ink-muted); font-style: italic; }

/* The base 60px label column (sized for "To"/"Subject") wraps a longer
   label like "Requested by" onto two lines — this modifier widens it for
   dialogs whose labels are real words, not short letterhead fields. */
.compose-email__letter-meta--wide { grid-template-columns: 124px 1fr; }

/* Close/Reject/Approve must stay reachable even once the recruiter
   dropdown/chips push this dialog's content past its 85vh max-height —
   without this, they scroll out of view behind the open dropdown and the
   only way to act on the request is to scroll the dialog itself first.
   Bleeds into the dialog's own 26px/28px padding so the bar sits flush
   and full-width at the bottom of the card while staying sticky within
   the dialog's own scroll container. */
#role-request-view-dialog .template-editor__actions {
  position: sticky;
  bottom: -26px;
  margin: 24px -28px -26px;
  padding: 16px 28px 26px;
  background: var(--paper-raised);
  border-top: 1px solid var(--rule);
}

/* ---------- recruiter multi-select (role request review) ---------- */
/* A directory can hold anywhere from a handful of recruiters to several
   dozen — the list itself lives in a dropdown (like the Cc autocomplete
   above), opened from the search input rather than permanently taking up
   dialog height, and the selection summary above it collapses to a count
   once it would otherwise dominate the dialog. */
.recruiter-select__summary {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-md);
  color: var(--ink-soft);
  margin-bottom: var(--space-xs);
}
.recruiter-select__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  max-height: 80px;
  overflow-y: auto;
  margin-bottom: var(--space-xs);
}
/* The `display: flex` above is only correct once shown — an attribute
   selector outranks the plain class it's paired with, so this wins over
   it and restores the browser's own [hidden] default instead of the
   dialog showing an "empty" flex box (or, for the dropdown below, the
   full recruiter list) before any interaction. */
.recruiter-select__summary[hidden], .recruiter-select__chips[hidden], .checkbox-list[hidden] { display: none; }
.recruiter-select__control { position: relative; }
.recruiter-select__input { padding-right: 32px; width: 100%; }
.recruiter-select__chevron {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 14px;
  height: 14px;
  color: var(--ink-soft);
  pointer-events: none;
  transform: translateY(-50%);
}
/* Same absolute-below-the-input idiom as .compose-email__cc-suggestions —
   opened on focus/input, closed on outside click (dashboard.js), not a
   permanently-visible list. */
.recruiter-select__dropdown {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--paper-raised);
  box-shadow: var(--shadow-hover);
}
.recruiter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 4px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  background: var(--paper);
  font-size: var(--text-md);
  color: var(--ink);
}
.recruiter-chip__avatar, .checkbox-list__item .recruiter-chip__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-soft);
}
.recruiter-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-height: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-soft);
  padding: 0;
  cursor: pointer;
}
.recruiter-chip__remove:hover { color: var(--ink); background: var(--rule); box-shadow: none; }
.checkbox-list__item { gap: var(--space-xs); }

/* Send stays inline-flex's own content width (never stretched) and lands
   flush right next to Cancel — both already true of every button/.btn in
   this app; nothing here needed a stretch/full-width override to undo. */
.compose-email__footer { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 16px; }

@media (max-width: 640px) {
  .compose-email__fields { grid-template-columns: 1fr; }
}

/* Cc autocomplete — a plain dropdown under the input, not a tokenized
   chip field: click a suggestion and its email is appended to the same
   text input, comma-separated, same as typing it by hand. */
.compose-email__cc-field { position: relative; }
.compose-email__cc-suggestions {
  position: absolute;
  z-index: 1;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-raised);
  box-shadow: var(--shadow-hover);
}
.compose-email__cc-suggestion {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-md);
}
.compose-email__cc-suggestion:hover, .compose-email__cc-suggestion.is-active { background: var(--paper); }
.compose-email__cc-suggestion-name { color: var(--ink); font-weight: 500; }
.compose-email__cc-suggestion-email { color: var(--ink-soft); font-size: var(--text-sm); }

/* ---------- confirm dialog (destructive actions) ---------- */

#confirm-dialog { width: min(420px, 90vw); }
#confirm-dialog p { font-size: var(--text-base); color: var(--ink-soft); margin: 0 0 20px; }

/* ---------- roles page ---------- */

.dropzone {
  border: 1.5px dashed var(--rule-strong);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: var(--text-md);
  margin-bottom: 18px;
  cursor: pointer;
}
.dropzone.is-dragover { border-color: var(--focus); color: var(--focus); background: var(--paper); }
.dropzone.is-loading { cursor: default; }
.dropzone input[type="file"] { display: none; }

.dropzone__spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid var(--rule-strong);
  border-top-color: var(--focus);
  border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  .dropzone__spinner { animation: dropzone-spin 700ms linear infinite; }
}
@keyframes dropzone-spin {
  to { transform: rotate(360deg); }
}
.dropzone__hint { display: block; font-size: var(--text-sm); margin-top: 4px; color: var(--ink-soft); }

/* Same spinner, button context — currentColor means it reads correctly on
   both a solid dark button and a light outline one with no extra variant. */
.btn__spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  .btn__spinner { animation: dropzone-spin 700ms linear infinite; }
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Mono is right for a list of short discrete phrases (keywords), wrong for
   flowing prose (a JD, an email template) — it reads noticeably bulkier. */
#role-jd { font-family: var(--font-body); font-size: var(--text-base); }

/* ---------- login: password show/hide toggle ---------- */

.password-field { position: relative; }
.password-field input { padding-right: 40px; }
.password-field .password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  border-radius: 50%;
  box-shadow: none;
  color: var(--ink-soft);
  cursor: pointer;
  min-height: 0;
  transition: color 0.15s ease;
}
.password-field .password-toggle:hover,
.password-field .password-toggle:active { background: none; box-shadow: none; }
.password-field .password-toggle:hover { color: var(--ink); }
.password-field .password-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.password-field .password-toggle[aria-pressed="true"] { color: var(--focus); }

/* ==========================================================================
   Candidate detail drawer — a right-anchored <dialog>, not a hand-rolled
   overlay: native <dialog> already gives focus-trapping, Escape-to-close,
   and a top-layer backdrop for free (the same reason role-jd-dialog and
   reason-dialog already use it), just positioned as a panel instead of a
   centered modal.
   ========================================================================== */

dialog#candidate-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  height: 100%;
  width: min(420px, 100vw);
  max-height: none;
  max-width: none;
  border: none;
  border-left: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: var(--shadow-modal);
  padding: 0;
  display: flex;
  flex-direction: column;
}
@media (prefers-reduced-motion: no-preference) {
  dialog#candidate-drawer {
    transform: translateX(100%);
    transition: transform 200ms var(--ease-standard);
  }
  dialog#candidate-drawer[open] { transform: translateX(0); }
}

.drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--rule);
}
.drawer__eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.drawer__name { font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.01em; }
.drawer__role { font-size: var(--text-base); color: var(--ink-soft); margin-top: 3px; }
.drawer__body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.drawer__section { padding: 18px 0; border-top: 1px solid var(--rule); }
.drawer__section:first-child { padding-top: 0; border-top: none; }
.drawer__section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.drawer__row { display: flex; justify-content: space-between; gap: 12px; font-size: var(--text-base); padding: 6px 0; }
.drawer__row-label { color: var(--ink-soft); }
.drawer__row-value { font-weight: 600; text-align: right; }

/* Pipeline section's own label/value layout — a fixed label column and a
   flexible value column, unlike .drawer__row's simple space-between pair,
   because a row here can hold an avatar cluster or a full-width input,
   not just a short right-aligned string. Each .pipeline-grid__row is
   display:contents so its two children slot directly into the grid
   instead of nesting a second box model inside it. */
/* Top-aligned, not centered — the drawer's own fixed width leaves the
   value column narrow enough (~195px) that the recruiter row's content
   genuinely needs 2-3 lines (avatar stack, then count+chevron, then the
   add control if it doesn't fit beside the stack); centering a short
   label against a value that tall floated it into the middle line
   instead of sitting level with the first one. The label gets a little
   top padding instead, to still land roughly center-of-first-line on the
   single-line Interview stage/Panel rows. */
.pipeline-grid { display: grid; grid-template-columns: 160px 1fr; align-items: start; row-gap: 24px; column-gap: 16px; }
.pipeline-grid__row { display: contents; }
.pipeline-grid__label { padding-top: 10px; font-size: var(--text-base); font-weight: 500; color: var(--ink-soft); }
.pipeline-grid__value { font-size: var(--text-base); font-weight: 400; color: var(--ink); min-width: 0; }

.drawer__role-recruiters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.drawer__role-recruiters-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* A compact stand-in for a profile photo — solid ink fill, same "who owns
   this" legibility a real avatar gives at a glance, without needing to
   store/fetch one. A paper-colored ring is what makes the overlap below
   read as a deliberate stack instead of two circles colliding. */
.recruiter-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--paper-raised);
  box-sizing: border-box;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.recruiter-avatar__initials {
  color: var(--on-accent);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: 0.02em;
}
/* The overflow count ("+7") when a role has more recruiters than fit
   inline — a tint, not a solid ink fill, so it reads as "N more," never
   as one more real person standing in the row. */
.recruiter-avatar--more {
  background: var(--rule);
}
.recruiter-avatar--more .recruiter-avatar__initials { color: var(--ink-soft); font-size: var(--text-sm); }

/* Overlapping stack, not an evenly-gapped row — this is the actual "how
   does 10-20 of these look" answer: a cohesive group at a glance, same
   idiom Linear/Ashby-style tools use for avatar collections, rather than
   a wall of separate circles. Only the collapsed summary's avatars stack
   this way; the expanded panel below lists them vertically instead, so
   its avatars keep the default non-overlapping spacing. */
.recruiter-avatar-stack { display: flex; align-items: center; }
.recruiter-avatar-stack .recruiter-avatar:not(:first-child) { margin-left: -12px; }

/* <details>/<summary> disclosure — click the avatar row to expand the
   full name list below it. Native, so keyboard/focus handling and
   toggling come for free; no positioning math or click-outside listener
   to maintain the way a hand-rolled popover would need. */
/* Sized to its own content, not forced to 100% — a rigid full-width row
   here pushed the "+ Add recruiter" control onto its own line even when
   there was plenty of room beside it. The expanded panel gets its own
   min-width below instead, so a short avatar row doesn't leave the name
   list looking cramped once opened. */
/* Full width of its grid cell, not sized to its own content — the panel
   below (a child) previously carried a min-width bigger than that cell
   actually is, which silently forced this element (and the whole flex
   row it sits in) wider than the drawer, pushing the panel's right edge
   past the visible drawer and forcing the page to scroll horizontally. */
.recruiter-list { width: 100%; min-width: 0; }
.recruiter-list__summary {
  /* Stacked, not a single wrapping row — the avatar stack alone can run
     close to the drawer's full value-column width, so the count+chevron
     line needs to sit cleanly below it rather than wrap into it
     mid-content. */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  cursor: pointer;
  list-style: none;
}
.recruiter-list__summary::-webkit-details-marker { display: none; }
/* Chevron lives on the count text itself, not on the summary — the
   summary stacks its two lines vertically now, and a ::after on it would
   land on its own third line instead of beside "N recruiters". */
.recruiter-list__count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-md);
  color: var(--ink-soft);
  white-space: nowrap;
}
.recruiter-list__count::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: rotate(45deg);
  transition: transform 150ms ease;
  flex-shrink: 0;
}
.recruiter-list[open] .recruiter-list__count::after { transform: rotate(-135deg); }
.recruiter-list__panel {
  margin-top: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper);
}
.recruiter-list__row { display: flex; align-items: center; gap: 10px; padding: 4px; }
.recruiter-list__row .recruiter-avatar { width: 28px; height: 28px; }
.recruiter-list__row .recruiter-avatar__initials { font-size: var(--text-xs); }
.recruiter-list__name { flex: 1; min-width: 0; font-size: var(--text-base); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recruiter-avatar__remove {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: var(--text-md);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.recruiter-avatar__remove:hover { background: var(--rule); color: var(--ink); }

/* The "add one more" control — sized and shaped to sit in the same row as
   the avatars it's adding to, deliberately a hollow/dashed ring rather
   than a solid fill so it never gets mistaken for one more assigned
   person. A plain native select, not a custom widget — its closed state
   is just a "+"; the real names only appear once it's opened. */
.drawer__role-recruiters-add {
  appearance: none;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px dashed var(--rule-strong);
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-size: var(--text-xl);
  line-height: 1;
  text-align: center;
  padding: 0;
  cursor: pointer;
}
.drawer__role-recruiters-add:hover { border-color: var(--ink); color: var(--ink); }

/* The roles table's own recruiter cell — the trigger and popover it opens
   are styled in dashboard-v2.css (.role-recruiters-trigger); this add
   button is the one piece of that cell still styled here. */
.role-recruiters__add {
  appearance: none;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px dashed var(--rule-strong);
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-size: var(--text-md);
  line-height: 1;
  text-align: center;
  padding: 0;
  cursor: pointer;
}
.role-recruiters__add:hover { border-color: var(--ink); color: var(--ink); }

/* Interview stage / panel — real form-input chrome (white fill, hairline
   border, chevron) instead of a .stamp pill, so they read as "a field you
   set," not a status readout. */
/* Qualified with the tag (input.pipeline-input, select.pipeline-input),
   not just the bare class — the global input[type="text"]/select base
   rule earlier in this file sets `background` as a shorthand, which is
   an attribute selector and therefore higher specificity than a lone
   class. A bare .pipeline-input lost that fight silently: background-
   color still applied (it was the last thing set, shorthand or not) but
   background-repeat/position from the shorthand's implicit reset
   (repeat/0%,0%) won over this rule's longhand values, tiling the
   chevron/magnifier icon across the whole field instead of pinning it to
   one spot on the right. */
input.pipeline-input,
select.pipeline-input {
  appearance: none;
  width: 100%;
  height: 40px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background-color: var(--paper-raised);
  background-repeat: no-repeat;
  background-position: right 14px center;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  /* A long selected value (a panel member's full name) degrades to an
     ellipsis instead of colliding with the icon in the drawer's fixed
     width — same defensive treatment select.stamp-select already uses
     elsewhere in this file for the identical reason. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
input.pipeline-input:hover,
select.pipeline-input:hover { border-color: var(--ink-muted); }
input.pipeline-input:focus-visible,
select.pipeline-input:focus-visible { border-color: var(--ink); outline: none; }
/* Chevron only makes sense on the real <select> (Interview stage) — the
   Panel field below is a search box now, so it gets a magnifier instead. */
select.pipeline-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236B6B6B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
input.pipeline-input {
  cursor: text;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' stroke='%236B6B6B' stroke-width='2' fill='none'/%3E%3Cpath d='M20 20l-3.5-3.5' stroke='%236B6B6B' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

@media (max-width: 480px) {
  .pipeline-grid { grid-template-columns: 1fr; row-gap: 8px; }
  .pipeline-grid__row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 16px; }
}
.drawer__footer { padding: 16px 24px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 12px; }

/* Match block uses the same ink/rule language as the rest of the
   dashboard — no purple left-bar or AI-ink percentage. A colored accent
   here read as a second brand hue against the B&W system; mono keeps the
   drawer continuous with Filters, stamps, and table chrome. */
.drawer__match {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.drawer__match-value {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.drawer__match-label { font-size: var(--text-sm); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }

.drawer__assessment {
  font-size: var(--text-base);
  color: var(--ink);
  line-height: 1.6;
  white-space: pre-wrap;
}
.drawer__note { font-size: var(--text-sm); color: var(--ink-muted); margin-top: 10px; }

/* ---------- pipeline stepper (candidate drawer) ----------
   A read of interview_stage as nodes-on-a-line, not a chart — there's
   nothing continuous/numeric here to plot, just a handful of discrete
   rounds. Strictly monochrome, three shape states rather than a color
   code: done = solid filled node, current = ring with a hollow (paper)
   center, upcoming = a fainter gray ring — "awaiting feedback" vs.
   "scheduled" is still distinguishable (the select right below spells it
   out), just not re-encoded a second time as a stepper color. Purely a
   live-updating summary — the actual edit happens through the select
   rendered just below it (see #drawer-interview-stage-cell). */
.pipeline-stepper { display: flex; align-items: flex-start; margin: 4px 0 20px; }
.pipeline-stepper__step {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.pipeline-stepper__step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 100%;
  height: 0;
  border-top: 2px dashed var(--rule-strong);
}
.pipeline-stepper__step.is-done:not(:last-child)::after { border-top-style: solid; border-top-color: var(--ink); }
.pipeline-stepper__dot {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper-raised);
  border: 2px solid var(--rule-strong);
  box-sizing: border-box;
}
.pipeline-stepper__step.is-done .pipeline-stepper__dot { background: var(--ink); border-color: var(--ink); }
.pipeline-stepper__step.is-current-scheduled .pipeline-stepper__dot,
.pipeline-stepper__step.is-current-awaiting .pipeline-stepper__dot { background: var(--paper-raised); border-color: var(--ink); }
.pipeline-stepper__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  text-align: center;
}
.pipeline-stepper__step.is-current-scheduled .pipeline-stepper__label,
.pipeline-stepper__step.is-current-awaiting .pipeline-stepper__label,
.pipeline-stepper__step.is-done .pipeline-stepper__label { color: var(--ink); font-weight: 700; }

/* ==========================================================================
   Responsive candidate table → stacked cards on mobile. Reuses the exact
   same <tr>/<td> markup dashboard.js already renders (each <td> carries a
   data-label) — no separate mobile markup, no duplicated render logic.
   ========================================================================== */

@media (max-width: 720px) {
  .ledger--candidates thead { display: none; }
  .ledger--candidates, .ledger--candidates tbody, .ledger--candidates tr, .ledger--candidates td {
    display: block;
    width: 100%;
  }
  .ledger--candidates tbody tr {
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: 4px 14px;
    margin-bottom: 12px;
  }
  .ledger--candidates tbody tr:hover { background: var(--paper-raised); }
  .ledger--candidates td {
    padding: 8px 0;
    border-bottom: 1px solid var(--rule);
  }
  .ledger--candidates tr td:last-child { border-bottom: none; }
  .ledger--candidates td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-muted);
    margin-bottom: 4px;
  }
  .ledger--candidates td[data-numeric] { text-align: left; }
  .ledger--candidates .ledger__actions { justify-content: flex-start; }
}

/* ==========================================================================
   HireAI — floating launcher + popup, reachable from any page (base.html)
   so every role keeps access regardless of which page they land on (a
   Hiring Manager never reaches /overview — see web/pages.py's
   _recruiting_user_or_redirect). Monochrome throughout, same tokens as
   every other dialog in this file — no AI-accent tint here, this is chrome,
   not AI-authored content.
   ========================================================================== */
/* A circle at rest — a full "Ask HireAI" pill sat wide and fixed over
   whatever page content happened to scroll under its bottom-right corner
   (a Settings card's own Save changes button, confirmed explicitly as a
   real collision). Same footprint as the icon alone, expanding into the
   original pill only on hover/focus so the label stays discoverable
   without permanently blocking anything under it. --radius-pill (999px)
   on a square box already renders as a circle — no separate circle token
   needed for the resting state. */
.hireai-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 52px;
  padding: 0 17px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-base);
  box-shadow: var(--shadow-hover);
  cursor: pointer;
  overflow: hidden;
  transition: gap var(--dur-hover) ease;
}
.hireai-launcher:hover { background: var(--focus-hover); }
.hireai-launcher:hover, .hireai-launcher:focus-visible { gap: 8px; }
.hireai-launcher svg { width: 18px; height: 18px; flex-shrink: 0; }
.hireai-launcher span {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width var(--dur-hover) ease, opacity var(--dur-hover) ease;
}
.hireai-launcher:hover span,
.hireai-launcher:focus-visible span {
  max-width: 140px;
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .hireai-launcher, .hireai-launcher span { transition: none; }
}

/* Setting `display` directly on the dialog (needed for the flex layout
   below) overrides the browser's own `dialog:not([open]) { display: none }`
   default — an ID selector beats that low-specificity UA rule even
   without !important. Without this line the dialog renders in normal
   page flow at all times, closed or not, with no backdrop, which is
   exactly the "shows up docked mid-page with no dimming" bug this was
   caught fixing. */
dialog#hireai-dialog:not([open]) { display: none; }
dialog#hireai-dialog {
  /* Claims a large, fairly fixed footprint (not the old shrink-to-fit
     sizing that left a cramped-looking popup on a short conversation) —
     asked for explicitly so this reads as a proper workspace rather than
     a small widget. Bubbles still cap their own line length (see
     .hireai__bubble-col) so text doesn't stretch edge-to-edge just
     because the dialog grew. */
  width: min(760px, 94vw);
  height: min(760px, 88vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-xl);
  background: var(--paper-raised);
  color: var(--ink);
  padding: 0;
  box-shadow: var(--shadow-modal);
}
dialog#hireai-dialog::backdrop {
  background: rgba(17, 17, 17, 0.4);
}

.hireai-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  padding: 22px 24px 20px 28px;
  border-bottom: 1px solid var(--rule);
}
.hireai-dialog__heading { display: flex; flex-direction: column; gap: 5px; }
.hireai-dialog__title-row { display: flex; align-items: center; gap: 10px; }
#hireai-dialog-title {
  font-size: var(--text-xl);
  margin: 0;
  font-family: var(--font-display);
}
.hireai-dialog__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 7px;
  border-radius: var(--radius-pill);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-soft);
}
.hireai-dialog__status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.hireai-dialog__subtitle {
  margin: 0;
  font-size: var(--text-md);
  color: var(--ink-muted);
}
/* Larger than the shared 34px .btn--icon, and a visibly lighter hover fill
   — this is the one always-visible exit affordance on the popup, worth a
   touch more presence than an inline dialog's secondary close button. */
#hireai-dialog-close { width: 38px; height: 38px; flex: none; }
#hireai-dialog-close:hover { background: var(--rule); border-color: var(--rule); }

.hireai {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 1rem;
  padding: 24px 28px;
  min-height: 0;
}

.hireai__messages-wrap { position: relative; flex: 1; min-height: 0; display: flex; }

.hireai__messages {
  display: flex;
  flex-direction: column;
  gap: 20px;
  /* Fills whatever space the now fixed-height dialog leaves it, rather
     than a vh-based cap — the dialog's own height is what bounds this. */
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-anchor: none;
  padding: 1.5rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  background: var(--paper);
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  .hireai__messages { scroll-behavior: auto; }
}

/* Fixed to the scroll container's own top edge (not scrolled content, a
   sibling layered over it) so it reads as "more above" only once there's
   something to scroll back to — toggled by static/hireai.js's scroll
   listener, never visible while already at the top. */
.hireai__scroll-fade {
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  height: 28px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(var(--paper), transparent);
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events: none;
}
.hireai__messages-wrap.is-scrolled .hireai__scroll-fade { opacity: 1; }

/* Vertically centered — a deliberate hero moment for the empty state, not
   the dead void the same centering caused before (see git history): the
   personalized greeting above the chips gives this space real content and
   weight, so centering it reads as intentional rather than empty. */
.hireai__suggestions { margin: auto 0; text-align: center; }
.hireai__greeting {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--ink);
  /* A login username like "nikhil" is lowercase by convention; this is
     purely a display transform (the underlying name/username is untouched)
     so a greeting still reads as a greeting, not a raw handle. */
  text-transform: capitalize;
}
.hireai__suggestions-label {
  margin: 0 0 10px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hireai__suggestions .chip-group { justify-content: center; }

.hireai__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.hireai__row--user { justify-content: flex-end; }
.hireai__row--assistant { justify-content: flex-start; }
@media (prefers-reduced-motion: no-preference) {
  .hireai__row { animation: hireai-row-in 150ms var(--ease-standard); }
}
@keyframes hireai-row-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hireai__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
}
.hireai__avatar svg { width: 18px; height: 18px; color: var(--ink); }

.hireai__bubble-col {
  display: flex;
  flex-direction: column;
  /* Capped in absolute px, not just %, so a line of body text stays a
     readable measure even as the dialog itself grows wider. */
  max-width: min(78%, 520px);
}
.hireai__row--user .hireai__bubble-col { align-items: flex-end; }
.hireai__row--assistant .hireai__bubble-col { align-items: flex-start; }

.hireai__bubble {
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  white-space: pre-wrap;
  line-height: 1.6;
}

.hireai__bubble--user {
  background: var(--ink);
  color: var(--on-accent);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg);
}

.hireai__bubble--assistant {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-sm);
}
/* Depth on hover comes from a border shift, not a shadow lift — Intercom
   and Linear both resist drop shadows on cards/bubbles and communicate
   depth through surface/border changes alone; this bubble follows suit
   rather than the app's usual --shadow-card treatment. */
@media (prefers-reduced-motion: no-preference) {
  .hireai__bubble--assistant { transition: border-color 160ms ease; }
}
.hireai__bubble--assistant:hover { border-color: var(--ink-muted); }

.hireai__timestamp {
  margin-top: 6px;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.hireai__typing { display: inline-flex; align-items: center; gap: 4px; padding: 3px 0; }
.hireai__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-muted); }
@media (prefers-reduced-motion: no-preference) {
  .hireai__dot { animation: hireai-typing 1.2s infinite ease-in-out; }
  .hireai__dot:nth-child(2) { animation-delay: 0.15s; }
  .hireai__dot:nth-child(3) { animation-delay: 0.3s; }
}
@keyframes hireai-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.hireai__composer { display: flex; flex: none; }

.hireai__input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex: 1;
  padding: 10px 10px 10px 20px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
}
.hireai__input-wrap:focus-within {
  border-color: var(--focus);
}

.hireai__input {
  flex: 1;
  padding: 8px 0;
  max-height: 130px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  border: none;
  background: transparent;
  resize: none;
  overflow-y: auto;
}
.hireai__input:focus-visible { outline: none; }

#hireai-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-height: 0;
  flex: none;
  padding: 0;
  border-radius: 50%;
}
#hireai-send-btn svg { width: 18px; height: 18px; }
#hireai-send-btn:active:not(:disabled) { transform: scale(0.93); }

.hireai__retry-btn {
  align-self: flex-start;
  margin-top: 8px;
  padding: 0;
  min-height: 0;
  border: none;
  background: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 640px) {
  dialog#hireai-dialog { width: 96vw; height: 92vh; }
  .hireai__bubble-col {
    max-width: 92%;
  }
}

.hireai__bubble--pending {
  color: var(--ink-soft);
}

.hireai__bubble--error {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border: 1px solid var(--brick);
  color: var(--ink-soft);
}

/* ==========================================================================
   Background verification (/bgv and the public declaration form)
   Composed almost entirely from the existing .page / .ledger / .drawer /
   .stamp / .apply-* system — what follows is only the handful of pieces
   with no equivalent yet. No new colors: every value below is an existing
   token. --ai is deliberately absent, since nothing on these surfaces is
   AI-authored.
   ========================================================================== */

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

/* --- BGV operations workspace ------------------------------------------ */

.page--bgv {
  max-width: 1500px;
  padding-top: 24px;
  padding-bottom: 96px;
}














.bgv-setup-warning { margin: 18px 0; }





.bgv-ready {
  margin-bottom: 20px;
  padding: 22px 24px 24px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  box-shadow: var(--shadow-card);
}

.bgv-ready__header,
.bgv-workspace__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.bgv-ready__header h2,
.bgv-workspace__header h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.bgv-ready__header p,
.bgv-workspace__header p {
  max-width: 64ch;
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: var(--text-md);
}

.bgv-ready__hint,
.bgv-results-count {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.page--bgv .bgv-ready .file-rows { margin-top: 18px; }
.page--bgv .bgv-ready .file-row {
  padding: 13px 14px;
  border-color: var(--rule);
  background: var(--paper);
}
.page--bgv .bgv-ready .file-row__name { font-family: var(--font-body); font-weight: 600; }
.page--bgv .bgv-ready .bgv-block__meta { display: block; font-weight: 400; }

.bgv-workspace {
  overflow: visible;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  box-shadow: var(--shadow-card);
}

.bgv-workspace__header {
  padding: 26px 28px 20px;
  border-bottom: 1px solid var(--rule);
}

.bgv-results-count:not(:empty) {
  padding: 5px 9px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--ink-soft);
}

.page--bgv .bgv-filters {
  margin: 16px 20px 10px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.page--bgv .bgv-filters .filters__fields {
  display: grid;
  grid-template-columns: minmax(240px, 1.8fr) minmax(160px, 0.7fr) minmax(160px, 0.7fr) auto;
  gap: 10px;
  width: 100%;
}

.page--bgv .bgv-filters .field { min-width: 0; margin: 0; }
.page--bgv .bgv-filters label { color: var(--ink-soft); font-size: var(--text-sm); font-weight: 600; }
.page--bgv .bgv-filters input,
.page--bgv .bgv-filters select {
  border-color: transparent;
  background-color: var(--paper-raised);
  box-shadow: var(--shadow-sm);
}
.page--bgv .bgv-filters input:focus-visible,
.page--bgv .bgv-filters select:focus-visible { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.page--bgv .bgv-filters__clear { align-self: end; margin: 0 4px 10px; white-space: nowrap; }

.bgv-ledger-wrap { padding: 0 16px 8px; }
/* Keep the ledger on one column grid whether a queue group is open or
   closed. With automatic layout, expanding a group introduced the row's
   longer values into the width calculation and made every heading jump. */
.page--bgv #bgv-ledger { table-layout: fixed; }
.bgv-ledger__col--case { width: 11%; }
.bgv-ledger__col--candidate { width: 18%; }
.bgv-ledger__col--role { width: 19%; }
.bgv-ledger__col--stage { width: 15%; }
.bgv-ledger__col--next { width: 22%; }
.bgv-ledger__col--decision { width: 8%; }
.bgv-ledger__col--action { width: 7%; }
.page--bgv #bgv-ledger .ledger__candidate-email { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  /* The ledger becomes stacked cards at this breakpoint, so table-column
     sizing must stop participating in layout. */
  .bgv-ledger__columns { display: none; }
}
.page--bgv #bgv-ledger thead th { top: 64px; background: rgba(255, 255, 255, 0.97); }
.page--bgv #bgv-ledger tbody td { padding-top: 17px; padding-bottom: 17px; vertical-align: middle; }
.page--bgv #bgv-ledger tbody tr:hover { background: var(--surface); }
.page--bgv #bgv-ledger th:nth-child(6),
.page--bgv #bgv-ledger td:nth-child(6) { text-align: center; }
.page--bgv #bgv-ledger th:last-child,
.page--bgv #bgv-ledger td:last-child { text-align: right; }
.bgv-ledger__actions { display: inline-flex; }
.bgv-empty { margin: 6px 20px 20px; border-radius: var(--radius-lg); background: var(--surface); }

/* BGV case drawer: sensitive casework gets a wide, right-anchored panel
   instead of the generic centered dialog used by short confirmation forms. */
dialog#bgv-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(640px, 100vw);
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-left: 1px solid var(--rule);
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--shadow-modal);
  flex-direction: column;
}

dialog#bgv-drawer:not([open]) { display: none; }
dialog#bgv-drawer[open] { display: flex; }
dialog#bgv-drawer::backdrop { background: rgba(17, 20, 24, 0.34); }

@media (prefers-reduced-motion: no-preference) {
  dialog#bgv-drawer[open] { animation: bgv-drawer-enter 280ms cubic-bezier(0.16, 1, 0.3, 1); }
}

@keyframes bgv-drawer-enter {
  from { opacity: 0; transform: translateX(36px); }
  to { opacity: 1; transform: translateX(0); }
}

dialog#bgv-drawer > .drawer__header {
  padding: 24px 28px 20px;
  background: var(--paper-raised);
}
dialog#bgv-drawer .drawer__name { font-size: var(--text-3xl); letter-spacing: -0.035em; }
dialog#bgv-drawer > .drawer__body { padding: 18px; background: var(--surface); }
dialog#bgv-drawer .drawer__section {
  margin-bottom: 12px;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
}
dialog#bgv-drawer .drawer__section:first-child { padding-top: 20px; border-top: 1px solid var(--rule); }
dialog#bgv-drawer .drawer__section-title { margin-bottom: 16px; color: var(--ink); font-size: var(--text-sm); }

.bgv-progress-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bgv-progress-grid .drawer__row {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface);
}

.bgv-progress-grid .drawer__row-value { overflow-wrap: anywhere; text-align: left; }
.bgv-progress-grid__wide { grid-column: 1 / -1; }

.bgv-verdict-panel {
  border-color: var(--rule-strong) !important;
  background: var(--surface) !important;
}
.bgv-verdict-panel .field__hint { margin: -8px 0 18px; color: var(--ink-600); }
.bgv-verdict-panel textarea { font-family: var(--font-body); background: var(--paper-raised); }
.bgv-verdict-panel #bgv-verdict-save { width: 100%; }

.bgv-drawer__footer {
  flex-direction: row;
  justify-content: flex-end;
  background: var(--paper-raised);
}

dialog.bgv-manual-dialog {
  width: min(590px, calc(100vw - 32px));
  max-width: 590px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
}
dialog.bgv-manual-dialog:not([open]) { display: none; }
/* A column that never outgrows the screen: the header and the buttons stay put and the fields between them
   scroll. It used to be a plain block with overflow hidden, so on a short laptop screen the bottom of the
   dialog (including its buttons) was cut off with no way to reach it. */
dialog.bgv-manual-dialog[open] { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
dialog.bgv-manual-dialog .drawer__header,
dialog.bgv-manual-dialog .bgv-manual-dialog__footer { flex: 0 0 auto; }
dialog.bgv-manual-dialog .drawer__body { min-height: 0; }
/* A short screen (a phone on its side, a zoomed-in laptop): the header and the buttons would otherwise take most of
   the height and leave almost no room for the fields. Drop what is only decoration and tighten the spacing. */
@media (max-height: 480px) {
  dialog.bgv-manual-dialog .drawer__eyebrow,
  dialog.bgv-manual-dialog .drawer__role { display: none; }
  dialog.bgv-manual-dialog .drawer__header { padding: 12px 20px 10px; }
  dialog.bgv-manual-dialog .drawer__body { padding: 12px 20px 4px; }
  .bgv-manual-dialog__footer { padding: 10px 20px 12px; }
}
dialog.bgv-manual-dialog .drawer__header { padding: 24px 26px 20px; }
dialog.bgv-manual-dialog .drawer__body { padding: 22px 26px 8px; }
.bgv-manual-dialog__send {
  margin-top: 4px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--paper);
}
.bgv-manual-dialog__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 26px 22px;
}

@media (max-width: 1050px) {
  .page--bgv .bgv-filters .filters__fields { grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 0.55fr)); }
  .page--bgv .bgv-filters__clear { grid-column: 1 / -1; justify-self: end; margin: 0 4px 2px; }
}

@media (max-width: 760px) {
  .page--bgv { padding-top: 14px; padding-bottom: 72px; }
  .bgv-ready { padding: 20px 18px; }
  .bgv-ready__header,
  .bgv-workspace__header { align-items: flex-start; flex-direction: column; }
  .bgv-ready__hint { display: none; }
  .bgv-workspace { border-radius: var(--radius-lg); }
  .bgv-workspace__header { padding: 22px 18px 18px; }
  .page--bgv .bgv-filters { margin: 12px; }
  .page--bgv .bgv-filters .filters__fields { grid-template-columns: 1fr; }
  .page--bgv .bgv-filters__clear { grid-column: auto; justify-self: start; margin: 4px 0; }
  .bgv-ledger-wrap { padding: 0 12px 8px; }
  .page--bgv #bgv-ledger tbody tr {
    margin-bottom: 10px;
    padding: 6px 14px;
    border-color: var(--rule-strong);
    box-shadow: var(--shadow-card);
  }
  .page--bgv #bgv-ledger tbody td { width: 100%; padding: 9px 0; text-align: left; }
  .page--bgv #bgv-ledger tbody td:nth-child(6) { text-align: left; }
  .page--bgv #bgv-ledger td:last-child { width: 100%; text-align: left; }
  .page--bgv #bgv-ledger td:last-child .bgv-ledger__actions { width: 100%; }
  .page--bgv #bgv-ledger td:last-child .btn--sm { width: 100%; }
  dialog#bgv-drawer .drawer__section { padding: 17px; }
}

@media (max-width: 520px) {
  .bgv-progress-grid { grid-template-columns: 1fr; }
  .bgv-progress-grid__wide { grid-column: auto; }
  .bgv-drawer__footer { flex-wrap: wrap; }
  .bgv-drawer__footer button { flex: 1; }
  dialog.bgv-manual-dialog .drawer__header,
  dialog.bgv-manual-dialog .drawer__body,
  .bgv-manual-dialog__footer { padding-left: 20px; padding-right: 20px; }
}

/* Columnar cells that aren't match scores (reference number, days open) —
   .ledger__match carries the same treatment but means something specific. */
.bgv-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* One employment or reference inside the case drawer. A left rule rather
   than a card border, matching how .drawer__section already separates
   content without boxing it in. */
.bgv-block {
  border: 1px solid var(--rule-strong);
  padding: 2px 0 2px 12px;
  margin-bottom: 14px;
}
.bgv-block:last-child { margin-bottom: 0; }
.bgv-block__title { font-weight: 600; font-size: var(--text-md); color: var(--ink); }
.bgv-block__meta {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-soft);
  margin-top: 2px;
}
/* An advisory flag on a submission — sparing use of --brick as a thin left
   border, never a filled panel (a red-tinted alert box reads as
   generic/templated, which is why this system doesn't have one). */
.bgv-block--flagged { border-left-color: var(--brick-border); }
.bgv-block--flagged .bgv-block__meta { color: var(--brick-ink); }

/* Documents attached to an employment block. */
/* Previews, not links: HR is reading the case here, and bouncing them into
   Drive asks an account-permission question the server has already answered.
   Narrower than the verifier page's — this sits inside a drawer. */
.bgv-docs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.bgv-docs .bgv-doc iframe { height: 11rem; }
.bgv-docs__link { font-family: var(--font-mono); font-size: var(--text-sm); }

/* The case timeline. Mono for the timestamp column so events line up
   vertically the way the ledger's own columnar data does. */
.bgv-timeline { display: flex; flex-direction: column; gap: 10px; }
.bgv-timeline__row {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 10px;
  align-items: baseline;
}
.bgv-timeline__when {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.bgv-timeline__what { font-size: var(--text-md); color: var(--ink); line-height: 1.5; }
.bgv-timeline__actor { color: var(--ink-soft); }
@media (max-width: 560px) {
  .bgv-timeline__row { grid-template-columns: 1fr; gap: 2px; }
}

/* --- BGV candidate declaration form ------------------------------------
   A dedicated, trust-first long-form workspace. This intentionally does
   not inherit the public job application card treatment. */
.bgv-public {
  --bgvf-bg: var(--surface);
  --bgvf-surface: var(--paper-raised);
  --bgvf-surface-soft: var(--paper);
  --bgvf-sidebar: var(--surface);
  --bgvf-ink: var(--ink);
  --bgvf-muted: var(--ink-soft);
  --bgvf-faint: var(--ink-muted);
  --bgvf-border: var(--rule);
  --bgvf-border-strong: var(--rule-strong);
  --bgvf-accent: var(--ink);
  --bgvf-accent-hover: var(--focus-hover);
  --bgvf-accent-soft: var(--rule);
  /* Not var(--brick-ink) — dashboard-v2.css redefines that token to a
     lower-chroma oklch() red for the rest of the app's restrained palette,
     and on this error banner specifically it read as dark gray rather than
     an error, to a candidate filling in the form (confirmed report: typed
     errors were not registering as errors at all). var(--brick) (this
     file's own line ~62) holds that same original red and, unlike
     --brick-ink, is never redefined by dashboard-v2.css — so this stays a
     token reference, not a hardcoded hex, while still only affecting
     .bgv-public and leaving the rest of the dashboard's palette untouched. */
  --bgvf-danger: var(--brick);
  --bgvf-success: var(--green-ink);
  --bgvf-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  min-height: 100dvh;
  background:
    radial-gradient(circle at top right, rgba(17, 17, 17, 0.08), transparent 42%),
    var(--bgvf-bg);
  color: var(--bgvf-ink);
  color-scheme: light;
}

.bgv-public__header {
  height: 68px;
  padding: 0 clamp(20px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--bgvf-border);
  background: color-mix(in srgb, var(--bgvf-surface) 94%, transparent);
}
.bgv-public__logo { display: block; width: auto; height: 34px; object-fit: contain; }
.bgv-public__header-label {
  color: var(--bgvf-muted);
  font-size: var(--text-sm);
  font-weight: 650;
  letter-spacing: 0.045em;
}
.bgv-public__content {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(18px, 4vw, 48px) 80px;
}

.bgv-form-experience {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(290px, 0.74fr) minmax(0, 1.62fr);
  gap: clamp(20px, 3vw, 34px);
  align-items: start;
}
.bgv-form-overview {
  min-width: 0;
  position: sticky;
  top: 24px;
  padding: 34px 30px 28px;
  border: 1px solid var(--bgvf-border);
  border-radius: var(--radius-lg);
  background: var(--bgvf-sidebar);
}
.bgv-form-overview__intro { padding-bottom: 26px; border-bottom: 1px solid var(--bgvf-border-strong); }
.bgv-form-reference {
  margin: 0 0 12px;
  color: var(--bgvf-muted);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}
.bgv-form-overview h1,
.bgv-form-invalid h1,
.bgv-form-complete h1 {
  margin: 0;
  color: var(--bgvf-ink);
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-wrap: balance;
}
.bgv-form-overview__intro > p:last-child {
  max-width: 45ch;
  margin: 16px 0 0;
  color: var(--bgvf-muted);
  font-size: var(--text-base);
  line-height: 1.65;
  text-wrap: pretty;
}

.bgv-form-progress-summary { padding: 23px 0 16px; }
.bgv-form-progress-summary > div { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.bgv-form-progress-summary span { color: var(--bgvf-muted); font-size: var(--text-sm); font-weight: 600; }
.bgv-form-progress-summary strong {
  color: var(--bgvf-ink);
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.bgv-form-progress-summary progress {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.bgv-form-meter {
  display: block;
  width: 100%;
  height: 4px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--bgvf-border-strong);
}
.bgv-form-meter > span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--bgvf-accent);
  transform: scaleX(0.125);
  transform-origin: left center;
}

.bgv-public .bgv-rail { width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 2px; margin: 2px 0 24px; }
.bgv-public .bgv-rail__step {
  position: relative;
  width: 100%;
  min-height: 42px;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--bgvf-muted);
  font-family: var(--font-body);
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}
.bgv-public .bgv-rail__step:active { transform: translateY(1px); }
.bgv-public .bgv-rail__step:focus-visible { outline: 3px solid color-mix(in srgb, var(--bgvf-accent) 24%, transparent); outline-offset: 1px; }
.bgv-rail__marker {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--bgvf-border-strong);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bgvf-surface) 70%, transparent);
  color: var(--bgvf-faint);
  font-size: var(--text-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.bgv-public .bgv-rail__step.is-done .bgv-rail__marker { border-color: var(--bgvf-accent); color: var(--bgvf-accent); }
.bgv-public .bgv-rail__step.is-current { background: var(--bgvf-surface); color: var(--bgvf-ink); font-weight: 650; }
.bgv-public .bgv-rail__step.is-current .bgv-rail__marker { border-color: var(--bgvf-accent); background: var(--bgvf-accent); color: var(--paper); }
.bgv-rail__label { min-width: 0; font-size: var(--text-md); line-height: 1.3; }

.bgv-form-assurance { padding-top: 20px; border-top: 1px solid var(--bgvf-border-strong); }
.bgv-form-assurance strong { font-size: var(--text-md); color: var(--bgvf-ink); }
.bgv-form-assurance p { margin: 5px 0 0; color: var(--bgvf-muted); font-size: var(--text-sm); line-height: 1.55; }

.bgv-form-panel {
  min-width: 0;
  min-height: 720px;
  padding: 38px clamp(28px, 5vw, 56px) 0;
  overflow: clip;
  border: 1px solid var(--bgvf-border);
  border-radius: var(--radius-lg);
  background: var(--bgvf-surface);
  box-shadow: var(--shadow-card);
  scroll-margin-top: 20px;
}
.bgv-form-panel__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--bgvf-border);
  color: var(--bgvf-muted);
  font-size: var(--text-md);
  font-variant-numeric: tabular-nums;
}
.bgv-form-save-state { text-align: right; }
.bgv-form-save-state[data-state="saved"] { color: var(--bgvf-success); }
.bgv-form-save-state[data-state="warning"] { color: var(--bgvf-danger); }
.bgv-form-stage-heading { max-width: 620px; padding: 32px 0 28px; }
.bgv-form-stage-heading h2 {
  margin: 0;
  color: var(--bgvf-ink);
  font-family: var(--font-display);
  font-size: clamp(25px, 3vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.028em;
  text-wrap: balance;
}
.bgv-form-stage-heading p { max-width: 58ch; margin: 10px 0 0; color: var(--bgvf-muted); font-size: var(--text-base); line-height: 1.6; }

.bgv-public .bgv-fieldgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; }
.bgv-public .bgv-fieldgrid .field--wide { grid-column: 1 / -1; }
.bgv-public .field { min-width: 0; margin: 0; }
.bgv-public .field label,
.bgv-public .apply-section-label {
  display: block;
  margin: 0 0 8px;
  color: var(--bgvf-ink);
  font-size: var(--text-md);
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
}
/* Radios are excluded alongside checkboxes and files: this rule is for
   text-entry fields, and a radio caught by it renders as a full-width
   48px box with its label stranded to the side. The verifier's screen is
   the first public page here to use them. */
.bgv-public input:not([type="checkbox"]):not([type="file"]):not([type="radio"]),
.bgv-public select,
.bgv-public textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--bgvf-border-strong);
  border-radius: var(--radius);
  background: var(--bgvf-surface);
  color: var(--bgvf-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.4;
  box-shadow: inset 0 1px 1px rgba(17, 17, 17, 0.025), 0 1px 0 rgba(255, 255, 255, 0.9);
}
.bgv-public select {
  appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--bgvf-muted) 50%),
    linear-gradient(135deg, var(--bgvf-muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  cursor: pointer;
}
.bgv-public select option { background: var(--bgvf-surface); color: var(--bgvf-ink); }
.bgv-public textarea { min-height: 96px; resize: vertical; }
.bgv-public input::placeholder,
.bgv-public textarea::placeholder { color: var(--bgvf-faint); }
.bgv-public input:focus-visible,
.bgv-public select:focus-visible,
.bgv-public textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--bgvf-accent) 20%, transparent);
  outline-offset: 0;
  border-color: var(--bgvf-accent);
}
.bgv-public input[type="date"],
.bgv-public input[type="month"] { font-variant-numeric: tabular-nums; }
.bgv-public input[type="date"]::-webkit-calendar-picker-indicator,
.bgv-public input[type="month"]::-webkit-calendar-picker-indicator {
  margin: -5px -5px -5px 4px;
  padding: 7px;
  border-radius: var(--radius-sm);
  opacity: 0.62;
  cursor: pointer;
}
.bgv-public input:-webkit-autofill,
.bgv-public input:-webkit-autofill:hover,
.bgv-public input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--bgvf-ink);
  box-shadow: 0 0 0 1000px var(--bgvf-surface) inset;
}
.bgv-public [aria-invalid="true"] { border-color: var(--bgvf-danger) !important; }
.bgv-public .field__hint { margin: 6px 0 0; color: var(--bgvf-muted); font-size: var(--text-sm); line-height: 1.5; }

.bgv-public .field--checkbox { margin: 0 0 24px; }
.bgv-public .field--checkbox label {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0;
  padding: 14px 15px;
  border: 1px solid var(--bgvf-border);
  border-radius: var(--radius);
  background: var(--bgvf-surface-soft);
  cursor: pointer;
}
.bgv-public .field--checkbox input[type="checkbox"] {
  position: static;
  width: 18px;
  height: 18px;
  display: grid;
  place-content: center;
  flex: 0 0 18px;
  margin: 0;
  opacity: 1;
  appearance: none;
  border: 1px solid var(--bgvf-border-strong);
  border-radius: var(--radius-sm);
  background: var(--bgvf-surface);
  cursor: pointer;
}
.bgv-public .field--checkbox input[type="checkbox"]::before {
  width: 10px;
  height: 10px;
  content: "";
  background: var(--paper-raised);
  clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 18%, 84% 4%, 38% 70%);
  transform: scale(0.72);
  opacity: 0;
}
.bgv-public .field--checkbox input[type="checkbox"]:checked {
  border-color: var(--bgvf-accent);
  background: var(--bgvf-accent);
}
.bgv-public .field--checkbox input[type="checkbox"]:checked::before {
  transform: scale(1);
  opacity: 1;
}
.bgv-public .field--checkbox input[type="checkbox"]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--bgvf-accent) 20%, transparent);
  outline-offset: 2px;
}
.bgv-public .field--checkbox .field__hint { margin: 7px 0 0; padding-left: 0; }

.bgv-public .apply-section-label { margin-bottom: 18px; font-size: var(--text-lg); }
.bgv-public .bgv-ref-block { margin-top: 30px; padding-top: 28px; border-top: 1px solid var(--bgvf-border); }
.bgv-public .bgv-ref-block:first-of-type { margin-top: 6px; }
.bgv-public .bgv-ref-block > .apply-section-label { color: var(--bgvf-muted); font-size: var(--text-sm); }

.bgv-public .file-row {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(260px, 1.2fr);
  gap: 18px;
  align-items: center;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--bgvf-border);
  border-radius: 0;
  background: transparent;
}
.bgv-public .file-row:last-child { border-bottom: 0; }
.bgv-public .file-row__name { color: var(--bgvf-ink); font-family: var(--font-body); font-size: var(--text-md); font-weight: 600; }
.bgv-public .file-row__actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.bgv-public input[type="file"] { min-width: 0; max-width: 220px; color: var(--bgvf-muted); font-size: var(--text-xs); }
.bgv-public input[type="file"]::file-selector-button {
  margin-right: 8px;
  padding: 8px 11px;
  border: 1px solid var(--bgvf-border-strong);
  border-radius: var(--radius-sm);
  background: var(--bgvf-surface);
  color: var(--bgvf-ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 650;
  cursor: pointer;
}
.bgv-doc-row__state { flex: none; color: var(--bgvf-muted); font-family: var(--font-mono); font-size: var(--text-xs); }
.bgv-doc-row__state--done { color: var(--bgvf-success); }

.bgv-public .bgv-authorisation {
  max-height: 330px;
  margin-bottom: 16px;
  padding: 22px 24px;
  overflow-y: auto;
  border: 1px solid var(--bgvf-border);
  border-radius: var(--radius);
  background: var(--bgvf-surface-soft);
  color: var(--bgvf-ink);
  font-size: var(--text-md);
  line-height: 1.75;
  scrollbar-color: var(--bgvf-border-strong) transparent;
}
.bgv-public .bgv-authorisation p { margin: 0 0 14px; }
.bgv-public .bgv-authorisation p:last-child { margin-bottom: 0; }

/* Final declaration preview: a print-minded document rather than another
   input card. Its hierarchy follows the supplied CDF while improving scan,
   editability and small-screen behaviour. */
.bgv-preview__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 13px 15px;
  border: 1px solid var(--bgvf-border);
  border-radius: var(--radius);
  background: var(--bgvf-surface-soft);
}
.bgv-preview__toolbar > div { min-width: 0; display: grid; gap: 2px; }
.bgv-preview__toolbar strong { color: var(--bgvf-ink); font-size: var(--text-md); }
.bgv-preview__toolbar span { color: var(--bgvf-muted); font-size: var(--text-sm); line-height: 1.45; }
.bgv-preview__toolbar button,
.bgv-preview__edit {
  flex: none;
  border: 1px solid var(--bgvf-border-strong);
  border-radius: var(--radius-sm);
  background: var(--bgvf-surface);
  color: var(--bgvf-ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 650;
  cursor: pointer;
}
.bgv-preview__toolbar button { min-height: 34px; padding: 7px 11px; }
.bgv-preview__stage {
  padding: clamp(8px, 1.8vw, 16px);
  border: 1px solid var(--bgvf-border);
  border-radius: var(--radius);
  background: var(--surface);
}
.bgv-preview {
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-top: 3px solid var(--ink-900);
  border-radius: var(--radius-sm);
  background: var(--paper-raised);
  color: var(--ink-800);
  box-shadow: var(--shadow-card);
}
.bgv-preview__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px clamp(24px, 5vw, 42px) 27px;
  border-bottom: 1px solid var(--rule);
}
.bgv-preview__header img { width: auto; height: 32px; object-fit: contain; }
.bgv-preview__document-type { display: grid; gap: 4px; text-align: right; }
.bgv-preview__document-type span {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.bgv-preview__document-type strong { color: var(--ink-900); font-size: var(--text-lg); letter-spacing: -0.012em; }
.bgv-preview__identity {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 1fr);
  gap: 26px;
  padding: 25px clamp(24px, 5vw, 42px);
  background: var(--ink-900);
  color: var(--paper-raised);
}
.bgv-preview__identity > div { min-width: 0; display: grid; align-content: start; gap: 5px; }
.bgv-preview__identity span,
.bgv-preview__identity dt {
  color: var(--ink-400);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bgv-preview__identity > div strong { overflow-wrap: anywhere; font-size: var(--text-2xl); line-height: 1.3; letter-spacing: -0.025em; }
.bgv-preview__identity dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bgv-preview__identity dl div { min-width: 0; }
.bgv-preview__identity dt { margin-bottom: 5px; }
.bgv-preview__identity dd { margin: 0; overflow-wrap: anywhere; color: var(--surface); font-size: var(--text-sm); line-height: 1.45; }
.bgv-preview__section {
  margin: 0 clamp(24px, 5vw, 42px);
  padding: 30px 0 32px;
  border-bottom: 1px solid var(--rule);
  break-inside: avoid;
}
.bgv-preview__section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.bgv-preview__section-heading > div { display: flex; align-items: baseline; gap: 11px; }
.bgv-preview__section-heading span {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.08em;
}
.bgv-preview__section-heading h3 { margin: 0; color: var(--ink-900); font-size: var(--text-lg); line-height: 1.35; letter-spacing: -0.012em; }
.bgv-preview__edit { min-height: 28px; padding: 5px 9px; color: var(--ink-600); }
.bgv-preview__grid,
.bgv-preview__signature { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 30px; row-gap: 21px; }
.bgv-preview__field { min-width: 0; }
.bgv-preview__field--wide { grid-column: 1 / -1; }
.bgv-preview__field dt {
  margin: 0 0 5px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.065em;
  line-height: 1.4;
  text-transform: uppercase;
}
.bgv-preview__field dd { margin: 0; overflow-wrap: anywhere; color: var(--ink-800); font-size: var(--text-sm); font-weight: 550; line-height: 1.55; }
.bgv-preview__empty { color: var(--ink-400); font-weight: 450; }
.bgv-preview__not-applicable { margin: -2px 0 0; color: var(--ink-soft); font-size: var(--text-sm); font-style: italic; }
.bgv-preview__reference-list { display: grid; gap: 28px; }
.bgv-preview__reference + .bgv-preview__reference { padding-top: 26px; border-top: 1px dashed var(--rule); }
.bgv-preview__reference > p,
.bgv-preview__document-group > p {
  margin: 0 0 17px;
  color: var(--ink-700);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.bgv-preview__documents { display: grid; gap: 26px; }
.bgv-preview__document-row {
  min-height: 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--surface);
  color: var(--ink-600);
  font-size: var(--text-sm);
}
.bgv-preview__document-row:last-child { border-bottom: 0; }
.bgv-preview__document-row strong { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-muted); font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600; }
.bgv-preview__document-row i { width: 6px; height: 6px; border-radius: 50%; background: var(--rule-mid); }
.bgv-preview__document-row strong.is-uploaded { color: var(--green-ink); }
.bgv-preview__document-row strong.is-uploaded i { background: var(--green-ink); }
.bgv-preview__legal {
  padding-left: 17px;
  border: 1px solid var(--rule-strong);
  color: var(--ink-600);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--text-xs);
  line-height: 1.68;
}
.bgv-preview__legal p { margin: 0 0 12px; }
.bgv-preview__legal p:last-child { margin-bottom: 0; }
.bgv-preview__accepted {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 27px;
  padding: 13px 15px;
  border: 1px solid var(--green-border);
  background: var(--green-bg);
}
.bgv-preview__accepted > span { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 24px; border-radius: 50%; background: var(--green-ink); color: var(--paper-raised); font-size: var(--text-sm); }
.bgv-preview__accepted strong { display: block; color: var(--green-ink); font-size: var(--text-sm); }
.bgv-preview__accepted p { margin: 2px 0 0; color: var(--green-ink); font-size: var(--text-xs); line-height: 1.4; }
.bgv-preview__signature { padding-top: 4px; }
.bgv-preview__signature .bgv-preview__field:first-child dd {
  min-height: 32px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink-400);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--text-xl);
  font-style: italic;
}
.bgv-preview__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(24px, 5vw, 42px);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bgv-public .bgv-errors {
  display: block;
  margin: 0 0 24px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--bgvf-danger) 34%, var(--bgvf-border));
  border: 1px solid var(--bgvf-danger);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bgvf-danger) 5%, var(--bgvf-surface));
  color: var(--bgvf-danger);
}
.bgv-public .bgv-errors[hidden] { display: none; }
.bgv-public .bgv-errors strong { display: block; margin-bottom: 4px; color: var(--bgvf-ink); font-size: var(--text-md); }
.bgv-public .bgv-errors p { margin: 0; font-size: var(--text-md); }
.bgv-public .bgv-errors ul { margin: 7px 0 0; padding-left: 18px; }
.bgv-public .bgv-errors li { margin-bottom: 4px; color: var(--bgvf-danger); font-size: var(--text-md); }

.bgv-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 42px calc(clamp(28px, 5vw, 56px) * -1) 0;
  padding: 18px clamp(28px, 5vw, 56px);
  border-top: 1px solid var(--bgvf-border);
  background: color-mix(in srgb, var(--bgvf-surface) 94%, transparent);
}
.bgv-form-actions button {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 650;
  white-space: nowrap;
}
.bgv-form-actions button[hidden] { display: none; }
.bgv-form-actions button:disabled { cursor: wait; opacity: 0.62; }
.bgv-form-back { margin-right: auto; border: 1px solid var(--bgvf-border-strong); background: var(--bgvf-surface); color: var(--bgvf-ink); }
.bgv-form-next,
.bgv-form-submit { border: 1px solid var(--bgvf-accent); background: var(--bgvf-accent); color: var(--paper); }
.bgv-form-actions button:active { transform: translateY(1px); }
.bgv-form-actions button:focus-visible { outline: 3px solid color-mix(in srgb, var(--bgvf-accent) 24%, transparent); outline-offset: 2px; }

.bgv-form-skeleton { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 20px; }
.bgv-form-skeleton span { height: 72px; border-radius: var(--radius); background: var(--bgvf-surface-soft); }
@media (prefers-reduced-motion: no-preference) {
  .bgv-form-skeleton span {
    background: linear-gradient(100deg, var(--bgvf-surface-soft) 30%, var(--bgvf-surface) 48%, var(--bgvf-surface-soft) 66%);
    background-size: 220% 100%;
    animation: bgv-form-shimmer 1.3s linear infinite;
  }
}
@keyframes bgv-form-shimmer { to { background-position-x: -220%; } }

@keyframes bgv-form-surface-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bgv-form-fade-in {
  from { opacity: 0.55; }
  to { opacity: 1; }
}
@keyframes bgv-form-marker-enter {
  from { opacity: 0.65; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Neutralise global button hover styling on touch. Fine pointers receive
   the richer hover treatment in the gated block below. */
.bgv-public .bgv-rail__step:hover { background: transparent; color: var(--bgvf-muted); box-shadow: none; transform: none; }
.bgv-public .bgv-rail__step.is-current:hover { background: var(--bgvf-surface); color: var(--bgvf-ink); }
.bgv-form-next:hover,
.bgv-form-submit:hover { background: var(--bgvf-accent); border-color: var(--bgvf-accent); box-shadow: none; }
.bgv-form-back:hover { background: var(--bgvf-surface); color: var(--bgvf-ink); box-shadow: none; }

@media (prefers-reduced-motion: no-preference) {
  .bgv-form-overview,
  .bgv-form-invalid { animation: bgv-form-surface-enter 260ms var(--bgvf-ease-out) both; }
  .bgv-form-panel { animation: bgv-form-surface-enter 260ms 50ms var(--bgvf-ease-out) both; }
  .bgv-form-complete { animation: bgv-form-surface-enter 240ms var(--bgvf-ease-out) both; }
  .bgv-public .bgv-rail__step,
  .bgv-rail__marker,
  .bgv-public input:not([type="file"]),
  .bgv-public select,
  .bgv-public textarea,
  .bgv-public .field--checkbox label,
  .bgv-public input[type="file"]::file-selector-button,
  .bgv-form-actions button,
  .bgv-preview__toolbar button,
  .bgv-preview__edit {
    transition:
      background-color 160ms var(--bgvf-ease-out),
      border-color 160ms var(--bgvf-ease-out),
      color 160ms var(--bgvf-ease-out),
      box-shadow 160ms var(--bgvf-ease-out),
      opacity 140ms var(--bgvf-ease-out),
      transform 140ms var(--bgvf-ease-out);
  }
  .bgv-public .field--checkbox input[type="checkbox"]::before {
    transition: opacity 140ms var(--bgvf-ease-out), transform 140ms var(--bgvf-ease-out);
  }
  .bgv-form-meter > span { transition: transform 220ms cubic-bezier(0.77, 0, 0.175, 1); }
  .bgv-public.is-keyboard-nav .bgv-form-meter > span { transition: none; }
  .bgv-public input[type="date"]::-webkit-calendar-picker-indicator,
  .bgv-public input[type="month"]::-webkit-calendar-picker-indicator {
    transition: background-color 160ms var(--bgvf-ease-out), opacity 160ms var(--bgvf-ease-out);
  }
  .bgv-public .bgv-rail__step.is-current .bgv-rail__marker {
    animation: bgv-form-marker-enter 180ms var(--bgvf-ease-out) both;
  }
  .bgv-public.is-keyboard-nav .bgv-rail__step.is-current .bgv-rail__marker { animation: none; }
}

@media (hover: hover) and (pointer: fine) {
  .bgv-public .bgv-rail__step:hover { background: rgba(255, 255, 255, 0.7); color: var(--bgvf-ink); }
  .bgv-public input:not([type="checkbox"]):not([type="file"]):hover,
  .bgv-public select:hover,
  .bgv-public textarea:hover { border-color: var(--ink-400); }
  .bgv-public .field--checkbox label:hover { border-color: var(--bgvf-border-strong); background: var(--surface); }
  .bgv-public input[type="file"]::file-selector-button:hover { border-color: var(--bgvf-ink); transform: translateY(-1px); }
  .bgv-public input[type="date"]::-webkit-calendar-picker-indicator:hover,
  .bgv-public input[type="month"]::-webkit-calendar-picker-indicator:hover { background: var(--bgvf-accent-soft); opacity: 1; }
  .bgv-form-next:hover,
  .bgv-form-submit:hover { background: var(--bgvf-accent-hover); border-color: var(--bgvf-accent-hover); transform: translateY(-1px); }
  .bgv-form-back:hover { background: var(--bgvf-surface-soft); border-color: var(--bgvf-ink); transform: translateY(-1px); }
  .bgv-preview__toolbar button:hover,
  .bgv-preview__edit:hover { border-color: var(--bgvf-ink); background: var(--surface); transform: translateY(-1px); }
}

.bgv-form-load-error { padding: 24px; border: 1px solid var(--bgvf-border); border-radius: var(--radius); background: var(--bgvf-surface-soft); }
.bgv-form-load-error strong { display: block; color: var(--bgvf-ink); font-size: var(--text-lg); }
.bgv-form-load-error p { max-width: 52ch; margin: 7px 0 0; color: var(--bgvf-muted); font-size: var(--text-md); line-height: 1.55; }
.bgv-form-invalid,
.bgv-form-complete {
  width: min(100%, 680px);
  margin: clamp(42px, 9vw, 112px) auto 0;
  padding: clamp(32px, 6vw, 58px);
  border: 1px solid var(--bgvf-border);
  border-radius: var(--radius-lg);
  background: var(--bgvf-surface);
  box-shadow: var(--shadow-card);
}
.bgv-form-experience > .bgv-form-complete { grid-column: 1 / -1; }
.bgv-form-invalid__label { margin: 0 0 12px; color: var(--bgvf-danger); font-size: var(--text-sm); font-weight: 650; }
.bgv-form-invalid > p:last-child,
.bgv-form-complete > p { max-width: 58ch; margin: 16px 0 0; color: var(--bgvf-muted); font-size: var(--text-base); line-height: 1.65; }

@media (max-width: 900px) {
  .bgv-public__content { padding-top: 28px; }
  .bgv-form-experience { grid-template-columns: 1fr; }
  .bgv-form-overview { position: static; padding: 28px; }
  .bgv-form-overview__intro { max-width: 680px; }
  .bgv-form-overview h1 { max-width: 16ch; }
  .bgv-form-assurance { display: none; }
  .bgv-public .bgv-rail { max-width: 100%; flex-direction: row; gap: 8px; margin: 2px 0 0; padding: 4px; overflow-x: auto; scrollbar-width: thin; }
  .bgv-public .bgv-rail__step { width: auto; min-width: max-content; grid-template-columns: 27px auto; padding-right: 13px; background: rgba(255, 255, 255, 0.38); }
  .bgv-form-panel { min-height: 640px; }
}

@media (max-width: 640px) {
  .bgv-public__header { height: 60px; }
  .bgv-public__logo { height: 30px; }
  .bgv-public__header-label { font-size: var(--text-xs); }
  .bgv-public__content { padding: 18px 12px 48px; }
  .bgv-form-experience { gap: 14px; }
  .bgv-form-overview { padding: 23px 20px 18px; border-radius: var(--radius-lg); }
  .bgv-form-overview__intro { padding-bottom: 20px; }
  .bgv-form-overview h1 { font-size: var(--text-4xl); }
  .bgv-form-overview__intro > p:last-child { margin-top: 12px; font-size: var(--text-md); }
  .bgv-form-progress-summary { padding: 18px 0 12px; }
  .bgv-public .bgv-rail { padding-right: 20px; }
  .bgv-rail__label { font-size: var(--text-sm); }
  .bgv-form-panel { min-height: 580px; padding: 24px 20px 0; border-radius: var(--radius-lg); }
  .bgv-form-panel__topline { align-items: flex-start; gap: 10px; padding-bottom: 14px; font-size: var(--text-xs); }
  .bgv-form-stage-heading { padding: 24px 0 22px; }
  .bgv-form-stage-heading h2 { font-size: var(--text-3xl); }
  .bgv-form-stage-heading p { font-size: var(--text-md); }
  .bgv-public .bgv-fieldgrid,
  .bgv-form-skeleton { grid-template-columns: 1fr; }
  .bgv-public .bgv-fieldgrid { gap: 18px; }
  .bgv-public .bgv-ref-block { margin-top: 24px; padding-top: 23px; }
  .bgv-public .file-row { grid-template-columns: 1fr; gap: 8px; align-items: start; }
  .bgv-public .file-row__actions { align-items: flex-start; justify-content: flex-start; flex-direction: column; }
  .bgv-public input[type="file"] { max-width: 100%; }
  .bgv-public .bgv-authorisation { max-height: 300px; padding: 18px; }
  .bgv-preview__toolbar { align-items: flex-start; }
  .bgv-preview__toolbar span { display: none; }
  .bgv-preview__stage { margin-inline: -8px; padding: 6px; border-radius: var(--radius); }
  .bgv-preview__header { align-items: flex-start; padding: 23px 18px 21px; }
  .bgv-preview__header img { height: 27px; }
  .bgv-preview__document-type { max-width: 170px; }
  .bgv-preview__document-type strong { font-size: var(--text-sm); }
  .bgv-preview__identity { grid-template-columns: 1fr; gap: 20px; padding: 22px 18px; }
  .bgv-preview__identity > div strong { font-size: var(--text-xl); }
  .bgv-preview__section { margin-inline: 18px; padding-block: 26px 28px; }
  .bgv-preview__section-heading { margin-bottom: 20px; }
  .bgv-preview__section-heading > div { gap: 8px; }
  .bgv-preview__grid,
  .bgv-preview__signature { grid-template-columns: 1fr; row-gap: 18px; }
  .bgv-preview__document-row { align-items: flex-start; flex-direction: column; gap: 4px; padding-block: 8px; }
  .bgv-preview__footer { padding-inline: 18px; }
  .bgv-form-actions {
    margin: 34px -20px 0;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  }
  .bgv-form-actions button { flex: 1; padding-inline: 12px; }
  .bgv-form-back { flex: 0 0 auto !important; }
  .bgv-form-invalid,
  .bgv-form-complete { margin-top: 22px; padding: 30px 24px; border-radius: var(--radius-lg); }
}

@media (prefers-reduced-motion: reduce) {
  .bgv-public *,
  .bgv-public *::before,
  .bgv-public *::after { scroll-behavior: auto !important; }
  .bgv-form-overview,
  .bgv-form-panel,
  .bgv-form-invalid,
  .bgv-form-complete { animation: bgv-form-fade-in 140ms var(--bgvf-ease-out) both; }
}

@media print {
  .bgv-public.is-preview-step { background: var(--paper-raised); }
  .bgv-public.is-preview-step .bgv-public__header,
  .bgv-public.is-preview-step .bgv-form-overview,
  .bgv-public.is-preview-step .bgv-form-panel__topline,
  .bgv-public.is-preview-step .bgv-form-stage-heading,
  .bgv-public.is-preview-step .bgv-errors,
  .bgv-public.is-preview-step .bgv-preview__toolbar,
  .bgv-public.is-preview-step .bgv-preview__edit,
  .bgv-public.is-preview-step .bgv-form-actions { display: none !important; }
  .bgv-public.is-preview-step .bgv-public__content,
  .bgv-public.is-preview-step .bgv-form-panel { margin: 0; padding: 0; }
  .bgv-public.is-preview-step .bgv-form-experience { display: block; max-width: none; }
  .bgv-public.is-preview-step .bgv-form-panel,
  .bgv-public.is-preview-step .bgv-preview__stage,
  .bgv-public.is-preview-step .bgv-preview { min-height: 0; overflow: visible; border: 0; border-radius: 0; background: var(--paper-raised); box-shadow: none; }
  .bgv-public.is-preview-step .bgv-preview__stage { padding: 0; }
  .bgv-public.is-preview-step .bgv-preview__identity { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .bgv-public.is-preview-step .bgv-preview__section { break-inside: avoid-page; }
}

/* --- Google connections (Settings → Integrations) ----------------------
   One row per connection with what it powers and whether its grant is
   still usable. Composed from the existing .file-row / .stamp system. */
.connection-row__what {
  display: block;
  font-size: var(--text-sm);
  color: var(--ink-soft);
  margin-top: 2px;
  font-weight: 400;
}
/* Why a connection needs attention, in its own words. A thin --brick left
   border rather than a filled panel — this system's one rule about it. */
.connection-row__warning {
  display: block;
  border: 1px solid var(--brick-border);
  padding-left: 8px;
  margin-top: 6px;
  font-size: var(--text-sm);
  color: var(--brick-ink);
  font-weight: 400;
  max-width: 46ch;
}

/* No action is available on this case — an em dash rather than a disabled
   button, so the column still lines up without implying something is
   merely switched off. */
.bgv-ledger__no-action { color: var(--ink-muted); font-family: var(--font-mono); font-size: var(--text-sm); }

/* --- Plain-language guidance on /bgv ------------------------------------ */

/* "What to do next". The rows that need this person are the ones worth
   finding at a glance, so those read as ink and the rest recede — no new
   colour, just weight. */
.bgv-next { font-size: var(--text-md); color: var(--ink-soft); max-width: 30ch; }
.bgv-next--mine { color: var(--ink); font-weight: 600; }

.bgv-next-step {
  margin: 0 0 14px;
  font-size: var(--text-md);
  color: var(--ink-soft);
  border: 1px solid var(--rule-strong);
  padding-left: 10px;
}
.bgv-next-step--mine { color: var(--ink); font-weight: 600; border-left-color: var(--ink); }

/* A plain-words summary above the formal authorisation on the candidate
   form. It sits beside the legal text, never replaces it — the verbatim
   wording is what someone actually consents to. */
.bgv-plain-summary {
  border: 1px solid var(--ink);
  padding: 2px 0 2px 14px;
  margin-bottom: 16px;
  font-size: var(--text-base);
  line-height: 1.6;
}
.bgv-plain-summary strong { display: block; margin-bottom: 6px; }
.bgv-plain-summary ul { margin: 0 0 8px; padding-left: 18px; }
.bgv-plain-summary li { margin-bottom: 4px; }
.bgv-plain-summary span { color: var(--ink-soft); font-size: var(--text-md); }

/* --- /bgv: the page answers one question ------------------------------- */

.bgv-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.bgv-head h1 { margin: 0; }
.bgv-head__sub {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: var(--text-base);
  max-width: 58ch;   /* under 80 characters, per the type guidance */
}

/* The one loud thing on the page. A count set at display size, because
   "whose turn is it" is the only question someone opens this screen with;
   everything below is deliberately quieter than this. */
.bgv-turn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 0 20px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 26px;
}
.bgv-turn__what {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.bgv-turn__rest {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-base);
  max-width: 60ch;
}


/* The promise about who decides, placed where the decision is actually
   made rather than in a banner at the top of the page. */
.bgv-decision-note {
  margin: 0 0 14px;
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 54ch;
}

/* A visible tick, for agreeing to something rather than switching a
   setting on. .field--checkbox hides the native box and draws a switch —
   right for "send automatic replies", wrong for "I accept this
   declaration", where people expect a box they tick and where an
   invisible control is a blocker rather than a blemish. */
.field--tick { margin-bottom: 14px; }
.field--tick label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}
.field--tick input[type="checkbox"],
.field--tick input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 1px 0 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  flex-shrink: 0;
  accent-color: var(--ink);
  cursor: pointer;
}
.field--tick input[type="checkbox"]:focus-visible,
.field--tick input[type="radio"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* .stamp capitalizes every word, which suits one-word statuses ("Cleared",
   "Dropped") but turns a sentence-case phrase into "Waiting For
   Candidate". The verification stamps are phrases, so they keep their own
   casing. */
#bgv-ledger .stamp,
#bgv-drawer .stamp { text-transform: none; }

/* --- The verifier's screen ---------------------------------------------
   Someone else's employee, doing us a favour, probably on a phone, with
   no idea what HireFlow is. Narrow measure, large tap targets, and the
   claim they're being asked about stated before any input. */

/* What the candidate said, before we ask anything — read it, then answer. */
@media (max-width: 520px) {
}


/* The way out, folded away so it doesn't invite itself — but present,
   because forcing a yes/no from someone who can't answer manufactures an
   answer nobody gave. */

/* --- The checks board in the case drawer -------------------------------- */

.bgv-progress {
  margin: 0 0 14px;
  font-size: var(--text-md);
  color: var(--ink-soft);
  border: 1px solid var(--rule-strong);
  padding-left: 10px;
}
.bgv-progress--done { color: var(--green-ink); border-left-color: var(--green-border); }

.bgv-check__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Claimed against confirmed, side by side: the reader is checking a
   difference, not re-doing the comparison. */
.bgv-check__diff {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  margin-top: 8px;
  font-size: var(--text-sm);
}
.bgv-check__diff span:nth-child(odd) { color: var(--ink-muted); }
.bgv-check__diff span:nth-child(even) { font-family: var(--font-mono); color: var(--ink); }

.bgv-check__flag {
  margin-top: 8px;
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--brick-ink);
  max-width: 52ch;
}
.bgv-block .js-bgv-resolve { margin-top: 10px; }

/* Choosing one of three answers is the main act on the verifier's screen,
   so the options are real targets rather than a tight radio list: full
   width, generous hit area, and a visible selected state. */
/* The ring sits on the option, not the small control, so keyboard focus
   is visible at the size the option is actually clicked at. */

/* ==========================================================================
   The verifier's screen (/bgv/verify/{token})
   Not a user of this app: someone's former manager, on a phone, who owes
   us nothing and whose real first question is "is this real?". So the
   claim they are judging is the one loud thing, the answer is three large
   targets, and the legitimacy note sits at the end where it reassures
   without crowding the task.
   ========================================================================== */

.bgv-attest__content {
  max-width: 40rem;              /* ~70 characters at this size */
  margin: 0 auto;
  padding: 64px 24px 96px;
}
@media (max-width: 600px) { .bgv-attest__content { padding: 40px 20px 72px; } }

/* A verification letter's opening: who is asking, about whom. Compact on
   purpose — the particulars are stated once, in the record below, where
   they are also answered. Setting them twice is what squeezed that record
   into a reading-width column. */
.bgv-subject { margin: 0 0 44px; }
.bgv-subject__from {
  margin: 0 0 10px;
  font-size: var(--text-base);
  color: var(--bgvf-muted);
}
.bgv-subject__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--ink);
}
.bgv-subject__detail {
  margin: 10px 0 0;
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--bgvf-muted);
  max-width: 34rem;
}
/* The dates sit on their own line at reading sizes: a role, a company and
   a span of years is three facts, and running them together makes the
   reader parse punctuation instead of content. */
.bgv-subject__dates { display: block; font-variant-numeric: tabular-nums; }

.bgv-attest__ask { border: none; padding: 0; margin: 0 0 28px; }
.bgv-attest__ask legend {
  padding: 0;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--ink);
}

/* Three answers, sized to be tapped without aiming. */
.bgv-choice { margin-bottom: 10px; }
.bgv-choice label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper-raised);
  font-size: var(--text-lg);
  cursor: pointer;
  transition: border-color 120ms ease;
}
.bgv-choice label:hover { border-color: var(--ink-soft); }
.bgv-choice input[type="radio"] {
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  flex-shrink: 0;
  accent-color: var(--ink);
  cursor: pointer;
}
/* Chosen reads as chosen at a glance — weight and a doubled edge, no
   colour, because this system has none to spend here. */
.bgv-choice label:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  font-weight: 600;
}
.bgv-choice label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

.bgv-attest__hint { margin: 0 0 14px; font-size: var(--text-md); color: var(--ink-soft); }

.bgv-attest__optional { font-weight: 400; color: var(--ink-muted); }

.bgv-attest__actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 32px;
}
.bgv-attest__actions button[type="submit"] { min-width: 11rem; }
/* A quiet way out, not a competing button: it changes the question rather
   than doing anything irreversible. */
.bgv-attest__switch,
.bgv-attest__switch:hover,
.bgv-attest__switch:active {
  /* The global `button` rule paints a solid dark button on hover and
     scales it on press. This one is a text link that happens to be a
     <button> because it changes the form rather than navigating, so every
     interactive state has to opt out, not just the resting one. */
  background: none;
  border: none;
  box-shadow: none;
  transform: none;
  padding: 6px 0;
  min-height: 0;
  font-size: var(--text-base);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.bgv-attest__switch { color: var(--ink-soft); }
.bgv-attest__switch:hover { color: var(--ink); }
.bgv-attest__switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* "Is this real?" — answered where it reassures without crowding the task. */
.bgv-attest__note {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.bgv-attest__note p { margin: 0; font-size: var(--text-md); line-height: 1.7; color: var(--ink-soft); max-width: 62ch; }
.bgv-attest__note strong { color: var(--ink); font-weight: 600; }

.bgv-attest__message { padding: 40px 0; }
.bgv-attest__message h1 { font-size: clamp(26px, 4vw, 34px); margin: 0 0 12px; }
.bgv-attest__message p { color: var(--ink-soft); font-size: var(--text-lg); line-height: 1.7; max-width: 58ch; }

/* Speaking instead of typing. Sits on the label rather than floating over
   the textarea, so it never covers what someone is writing and stays
   reachable by keyboard in reading order. */
.bgv-mic {
  margin-left: 12px;
  padding: 4px 10px;
  min-height: 0;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  background: var(--paper-raised);
  color: var(--ink-soft);
  vertical-align: middle;
}
.bgv-mic:hover { background: var(--paper-raised); color: var(--ink); border-color: var(--ink-soft); box-shadow: none; }
/* Listening is the one moment on this page worth animating: it tells
   someone the microphone is actually on. Stopped for anyone who asked for
   less motion — the filled state still reads as active without it. */
.bgv-mic.is-listening,
.bgv-mic.is-listening:hover { background: var(--ink); color: var(--on-accent); border-color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .bgv-mic.is-listening { animation: bgv-mic-pulse 1.6s ease-in-out infinite; }
}
@keyframes bgv-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(17, 17, 17, 0.28); }
  50% { box-shadow: 0 0 0 5px rgba(17, 17, 17, 0); }
}
.bgv-mic__status { margin: 8px 0 0; font-size: var(--text-md); color: var(--ink-soft); min-height: 1em; }

/* Documents shown to the employer who is asked whether they are genuine.
   Served same-origin by HireFlow, which is what makes an inline frame
   possible at all — an embedded drive.google.com would be blocked by this
   app's own CSP. */
.bgv-docs-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.bgv-doc { margin: 0; }
.bgv-doc figcaption { font-size: var(--text-md); font-weight: 600; margin-bottom: 6px; }
.bgv-doc iframe {
  width: 100%;
  height: 15rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-raised);
}
.bgv-doc a { display: inline-block; margin-top: 6px; font-size: var(--text-md); }


/* What the employer actually answered, laid out as the table your own
   verification email uses. Unanswered fields are absent rather than blank:
   a row of dashes reads as a refusal, which is not what silence means. */
.bgv-answer { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: var(--text-md); }
.bgv-answer th {
  text-align: left;
  font-weight: 400;
  color: var(--ink-muted);
  padding: 4px 12px 4px 0;
  white-space: nowrap;
  vertical-align: top;
  width: 11rem;
}
.bgv-answer td { padding: 4px 0; color: var(--ink); vertical-align: top; }
/* Shown only where the two disagree — an identical value in both columns
   is noise the reader has to skip past. */
.bgv-answer__was {
  display: block;
  color: var(--brick-ink);
  font-size: var(--text-sm);
  margin-top: 1px;
}
.bgv-answer__notes {
  margin-top: 10px;
  padding-left: 10px;
  border: 1px solid var(--rule-strong);
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--ink-soft);
}

/* What the employer actually answered, laid out as the table your own
   verification email uses. Unanswered fields are absent rather than blank:
   a row of dashes reads as a refusal, which is not what silence means. */
.bgv-answer { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: var(--text-md); }
.bgv-answer th {
  text-align: left;
  font-weight: 400;
  color: var(--ink-muted);
  padding: 4px 12px 4px 0;
  white-space: nowrap;
  vertical-align: top;
  width: 11rem;
}
.bgv-answer td { padding: 4px 0; color: var(--ink); vertical-align: top; }
/* Shown only where the two disagree — an identical value in both columns
   is noise the reader has to skip past. */
.bgv-answer__was {
  display: block;
  color: var(--brick-ink);
  font-size: var(--text-sm);
  margin-top: 1px;
}
.bgv-answer__notes {
  margin-top: 10px;
  padding-left: 10px;
  border: 1px solid var(--rule-strong);
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--ink-soft);
}

/* --- The employer's particulars table -----------------------------------
   A transcription of the verification table Techjays HR sends by mail:
   Particulars | Profile Details | Your Verification Inputs. Keeping her
   three columns matters — the people filling this in have answered that
   sheet before, and recognising it is most of the instruction. On a phone
   each row stacks, because three columns at 380px is nobody's table. */
.bgv-table {
  border: 1px solid var(--bgvf-border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 22px;
}
.bgv-table__head {
  display: grid;
  grid-template-columns: 13rem 1fr 15rem;
  gap: 16px;
  padding: 10px 16px;
  background: var(--bgvf-surface);
  border-bottom: 1px solid var(--bgvf-border-strong);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  color: var(--bgvf-muted);
}
.bgv-row {
  display: grid;
  grid-template-columns: 13rem 1fr 15rem;
  gap: 16px;
  align-items: start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bgvf-border);
}
.bgv-row:last-child { border-bottom: 0; }
.bgv-row__label { font-size: var(--text-base); font-weight: 500; padding-top: 9px; }
/* The one place a required mark earns its keep: four rows out of fifteen,
   so the other eleven visibly cost nothing to skip. */
.bgv-row__req { color: var(--brick-ink); font-weight: 600; }
.bgv-row__claim {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  line-height: 1.5;
  padding-top: 10px;
  overflow-wrap: anywhere;
}
/* Absent, not empty. "Not given" is a fact about our records; a blank cell
   reads as a question the verifier has already failed to answer. */
.bgv-row__claim--none { color: var(--bgvf-faint); font-family: var(--font-body); font-style: italic; }
.bgv-row__answer { display: flex; flex-direction: column; gap: 8px; }
.bgv-yn { display: flex; gap: 8px; }
.bgv-yn label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--bgvf-border-strong);
  border-radius: var(--radius);
  background: var(--bgvf-surface);
  font-size: var(--text-base);
  cursor: pointer;
  transition: border-color 120ms ease;
}
.bgv-yn label:hover { border-color: var(--ink-soft); }
.bgv-yn input[type="radio"] {
  width: 16px; height: 16px; min-height: 0;
  margin: 0; padding: 0; border: none; border-radius: 0; background: none;
  flex-shrink: 0; accent-color: var(--ink); cursor: pointer;
}
.bgv-yn label:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  font-weight: 600;
}
.bgv-row__dates { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; }
.bgv-row__dates label { font-size: var(--text-md); color: var(--bgvf-muted); }
/* The documents row is the one that needs width, not a 15rem answer column. */
.bgv-row--docs { grid-template-columns: 13rem 1fr 15rem; }
.bgv-row--docs .bgv-docs-preview { margin-bottom: 0; }

@media (max-width: 760px) {
  .bgv-table__head { display: none; }
  .bgv-row, .bgv-row--docs { grid-template-columns: 1fr; gap: 8px; padding: 16px; }
  .bgv-row__label, .bgv-row__claim { padding-top: 0; }
  .bgv-row__claim::before {
    content: "We were told: ";
    font-family: var(--font-body);
    color: var(--bgvf-muted);
  }
  .bgv-row__claim--none::before { content: ""; }
}

/* --- The record ---------------------------------------------------------
   A transcription of the verification table Techjays HR sends by post:
   Particulars | Profile Details | Your Verification Inputs. Keeping her
   three columns matters — the people filling this in have answered that
   sheet before, and recognising it is most of the instruction.

   The reading column stays at 40rem; only the record widens. A fifteen-row
   three-column table in a column sized for one sentence is what produced
   "Senior Software Develope/r" wrapping mid-word. */
/* The record gets the window. A fifteen-row table in a 40rem column was
   what produced "Senior Software Develope/r" breaking mid-word; the cap
   here exists only so the answer column doesn't end up a metre from the
   label it belongs to on a very wide display. */
.bgv-attest__content:has(.bgv-layout) {
  max-width: 72rem;
  padding: 48px clamp(20px, 4vw, 56px) 96px;
}
/* Only the employer's record earns the whole window. A referee answers
   three radios and a comment box; stretching that across 108rem would be
   width spent on nothing. */
.bgv-attest__content:has(.bgv-table) { max-width: 108rem; }
.bgv-layout {
  display: grid;
  grid-template-columns: minmax(17rem, 20rem) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
/* Sticky, not fixed: it scrolls away with the page on a short window
   instead of trapping the reader in a viewport-height panel. */
.bgv-side { position: sticky; top: 32px; }
@media (max-width: 1080px) {
  .bgv-layout { grid-template-columns: 1fr; gap: 0; }
  .bgv-side { position: static; margin-bottom: 40px; }
}
.bgv-side__note {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--bgvf-border);
  font-size: var(--text-md);
  line-height: 1.65;
  color: var(--bgvf-muted);
}
.bgv-side__note p { margin: 0; }
.bgv-side__note strong { color: var(--ink); font-weight: 600; }
.bgv-work { min-width: 0; }
/* Prose still obeys a reading measure even though the record does not. */
.bgv-work .bgv-gate,
.bgv-work .bgv-record__hint,
.bgv-work #bgv-verify-optout,
.bgv-work #bgv-verify-main > .field { max-width: 44rem; }

.bgv-gate { border: none; padding: 0; margin: 0 0 48px; }
.bgv-gate legend {
  padding: 0;
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: clamp(19px, 2.2vw, 23px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.bgv-record, .bgv-exhibits { margin: 0 0 48px; }
.bgv-record__title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--ink);
}
.bgv-record__hint {
  margin: 0 0 20px;
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--bgvf-muted);
}

.bgv-table {
  border: 1px solid var(--bgvf-border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bgvf-surface);
}
.bgv-table__head {
  display: grid;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr) 18rem;
  gap: 28px;
  padding: 12px 22px;
  background: var(--bgvf-surface-soft);
  border-bottom: 1px solid var(--bgvf-border-strong);
  font-size: var(--text-md);
  color: var(--bgvf-muted);
}
.bgv-row {
  display: grid;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr) 18rem;
  gap: 28px;
  align-items: start;
  padding: 16px 22px;
  border-bottom: 1px solid var(--bgvf-border);
}
.bgv-row:last-child { border-bottom: 0; }
.bgv-row__label {
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.45;
  padding-top: 11px;
  color: var(--ink);
}
/* The word, not a red asterisk — that mark is unreadable as a label and is
   the commonest tell of a generated form. Four rows out of fifteen carry
   it, so the other eleven visibly cost nothing to skip. */
.bgv-row__req {
  display: block;
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--bgvf-muted);
}
/* Body font, not mono: these are names and addresses, and monospace broke
   them mid-word at any real column width. Tabular figures keep the dates
   and codes aligned without making prose look like a terminal. */
.bgv-row__claim {
  font-size: var(--text-base);
  line-height: 1.5;
  padding-top: 10px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
  color: var(--ink);
}
/* Absent, not empty. "Not given" is a fact about our records; a blank cell
   reads as a question the verifier has already failed to answer. */
.bgv-row__claim--none { color: var(--bgvf-faint); font-style: italic; }
.bgv-row__answer { display: flex; flex-direction: column; gap: 10px; }

.bgv-yn { display: flex; gap: 8px; }
.bgv-yn label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 10px;
  border: 1px solid var(--bgvf-border-strong);
  border-radius: var(--radius);
  background: var(--bgvf-surface);
  font-size: var(--text-base);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.bgv-yn label:hover { border-color: var(--ink-soft); background: var(--bgvf-surface-soft); }
.bgv-yn input[type="radio"] {
  width: 15px; height: 15px; min-height: 0;
  margin: 0; padding: 0; border: none; border-radius: 0; background: none;
  flex-shrink: 0; accent-color: var(--ink); cursor: pointer;
}
.bgv-yn label:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  font-weight: 600;
}
.bgv-yn label:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }

.bgv-row__dates { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; }
.bgv-row__dates label { font-size: var(--text-md); color: var(--bgvf-muted); }

/* --- The exhibits -------------------------------------------------------
   Lifted out of the table: a document is not a particular, and three
   answers squeezed into a 17rem cell pushed "No" and "I can't tell" out of
   reach — so nobody could report a forged document. */
.bgv-exhibits__ask { border: none; padding: 0; margin: 22px 0 0; }
.bgv-exhibits__ask legend {
  padding: 0;
  margin-bottom: 12px;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
}
.bgv-exhibits__ask legend .bgv-row__req { display: inline; margin-left: 8px; }
.bgv-yn--wide { max-width: 30rem; }
.bgv-yn--wide label { padding: 13px 14px; }

@media (max-width: 860px) {
  .bgv-table__head { display: none; }
  .bgv-row { grid-template-columns: 1fr; gap: 10px; padding: 18px; }
  .bgv-row__label, .bgv-row__claim { padding-top: 0; }
  .bgv-row__req { display: inline; margin-left: 8px; }
  /* On one column the value needs to say what it is, since the header row
     that named it is gone. */
  .bgv-row__claim::before { content: "We were told: "; color: var(--bgvf-muted); }
  .bgv-row__claim--none::before { content: ""; }
  .bgv-yn { flex-wrap: wrap; }
  .bgv-yn label { flex: 1 1 7rem; }
}

/* ==========================================================================
   Employment verifier — premium trust-first workspace
   The verifier is outside Techjays and doing us a favour. The interface
   prioritises legitimacy, fast comparison, and clear escape routes.
   ========================================================================== */
.bgv-attest {
  --bgvv-canvas: var(--surface);
  --bgvv-panel: var(--paper-raised);
  --bgvv-soft: var(--surface);
  --bgvv-ink: var(--ink-900);
  --bgvv-muted: var(--ink-soft);
  --bgvv-rule: var(--rule);
  --bgvv-rule-strong: var(--rule-strong);
  --bgvv-success: var(--green-ink);
  background:
    radial-gradient(circle at 76% 0%, rgba(29, 32, 36, 0.075), transparent 34rem),
    var(--bgvv-canvas);
}
.bgv-attest .bgv-public__header {
  position: relative;
  z-index: 4;
  height: 72px;
  border-color: rgba(205, 209, 213, 0.8);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.bgv-attest .bgv-public__logo { height: 32px; }
.bgv-verify__header-label { display: inline-flex; align-items: center; gap: 8px; letter-spacing: 0; }
.bgv-verify__header-label svg { color: var(--ink-soft); }

.bgv-attest__content:has(.bgv-layout) {
  width: min(100%, 1480px);
  max-width: 1480px;
  margin-inline: auto;
  padding: clamp(34px, 4.5vw, 68px) clamp(18px, 3.8vw, 54px) 112px;
}
.bgv-layout {
  display: grid;
  grid-template-columns: minmax(16.5rem, 18.5rem) minmax(0, 1fr);
  gap: clamp(20px, 2.8vw, 38px);
  align-items: start;
}
.bgv-side {
  position: sticky;
  top: 24px;
  overflow: hidden;
  padding: 29px 27px 25px;
  border: 1px solid rgba(205, 209, 213, 0.92);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.bgv-subject { margin: 0; }
.bgv-subject__from {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 21px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}
.bgv-subject__from span { width: 7px; height: 7px; border-radius: 50%; background: var(--bgvv-success); box-shadow: 0 0 0 4px rgba(47, 107, 81, 0.1); }
.bgv-subject__name {
  max-width: 10ch;
  color: var(--bgvv-ink);
  font-size: clamp(31px, 3vw, 40px);
  font-weight: 650;
  line-height: 0.98;
  letter-spacing: -0.048em;
  text-wrap: balance;
}
.bgv-subject__detail { margin-top: 15px; color: var(--ink-soft); font-size: var(--text-base); line-height: 1.58; }
.bgv-subject__dates { margin-top: 3px; color: var(--ink-muted); font-size: var(--text-md); }

.bgv-side__scope { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--bgvv-rule); }
.bgv-side__scope > p {
  margin: 0 0 13px;
  color: var(--ink-muted);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.bgv-side__scope ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.bgv-side__scope li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; align-items: center; min-height: 35px; }
.bgv-side__scope li span { color: var(--ink-400); font-family: var(--font-mono); font-size: var(--text-xs); }
.bgv-side__scope li strong { color: var(--ink-700); font-size: var(--text-sm); font-weight: 600; line-height: 1.35; }
.bgv-side__note {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  margin-top: 25px;
  padding: 18px 17px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  line-height: 1.6;
}
.bgv-side__note svg { margin-top: 2px; color: var(--ink-600); }
.bgv-side__note strong { color: var(--ink-800); }
.bgv-work {
  min-width: 0;
  padding: clamp(30px, 4vw, 52px);
  border: 1px solid rgba(205, 209, 213, 0.92);
  border-radius: var(--radius-lg);
  background: var(--bgvv-panel);
  box-shadow: var(--shadow-card);
}
.bgv-work .bgv-errors {
  margin-bottom: 24px;
  border-radius: var(--radius);
  border-color: var(--brick-border);
  background: var(--brick-bg);
  color: var(--brick-ink);
}
.bgv-work .bgv-gate { max-width: none; }
.bgv-gate {
  margin: 0 0 clamp(55px, 7vw, 86px);
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--bgvv-rule);
  border-radius: var(--radius-lg);
  background: var(--bgvv-soft);
}
.bgv-section-index {
  margin: 0 0 10px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bgv-gate legend {
  float: left;
  width: 100%;
  max-width: 27ch;
  margin: 0 0 22px;
  color: var(--bgvv-ink);
  font-size: clamp(23px, 2.35vw, 31px);
  font-weight: 620;
  line-height: 1.18;
  letter-spacing: -0.032em;
  text-wrap: balance;
}
.bgv-gate legend .bgv-section-index { display: block; margin-bottom: 10px; }
.bgv-gate__choices { clear: both; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bgv-gate .bgv-choice { margin: 0; }
.bgv-gate .bgv-choice label {
  min-height: 56px;
  padding: 14px 16px;
  border-color: var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink-600);
  font-size: var(--text-base);
  font-weight: 550;
}
.bgv-choice input[type="radio"],
.bgv-yn input[type="radio"] {
  appearance: none;
  border: 1.5px solid var(--ink-400);
  border-radius: 50%;
  background: var(--paper-raised);
  box-shadow: inset 0 0 0 3px var(--paper-raised);
}
.bgv-choice input[type="radio"]:checked,
.bgv-yn input[type="radio"]:checked { border-color: var(--ink-800); background: var(--ink-800); }
.bgv-gate .bgv-choice label:has(input:checked) {
  border-color: var(--ink-800);
  background: var(--ink-800);
  color: var(--paper-raised);
  box-shadow: var(--shadow-sm);
}
.bgv-gate .bgv-choice label:has(input:checked) input { border-color: var(--paper-raised); background: var(--paper-raised); box-shadow: inset 0 0 0 3px var(--ink-800); }

.bgv-record, .bgv-exhibits { margin: 0 0 clamp(60px, 7vw, 88px); }
.bgv-record__header {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(18rem, 1fr);
  gap: clamp(24px, 5vw, 76px);
  align-items: end;
  margin-bottom: 25px;
}
.bgv-record__title {
  max-width: 20ch;
  margin: 0;
  color: var(--bgvv-ink);
  font-size: clamp(23px, 2.3vw, 30px);
  font-weight: 620;
  line-height: 1.16;
  letter-spacing: -0.033em;
  text-wrap: balance;
}
.bgv-record__header .bgv-record__hint { margin: 0; color: var(--ink-soft); font-size: var(--text-md); line-height: 1.6; text-wrap: pretty; }

.bgv-table {
  margin: 0;
  overflow: clip;
  border-color: var(--bgvv-rule);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  box-shadow: var(--shadow-card);
}
.bgv-table__head {
  position: sticky;
  top: 0;
  z-index: 2;
  grid-template-columns: minmax(11.5rem, 14.5rem) minmax(0, 1fr) minmax(15rem, 17rem);
  gap: clamp(18px, 2.5vw, 34px);
  padding: 13px clamp(18px, 2.1vw, 26px);
  border-color: var(--rule-strong);
  background: rgba(243, 244, 245, 0.96);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.bgv-row {
  grid-template-columns: minmax(11.5rem, 14.5rem) minmax(0, 1fr) minmax(15rem, 17rem);
  gap: clamp(18px, 2.5vw, 34px);
  min-height: 78px;
  padding: 17px clamp(18px, 2.1vw, 26px);
  border-color: var(--rule);
  transition: background-color 160ms var(--bgvf-ease-out);
}
.bgv-row:focus-within { position: relative; z-index: 1; background: var(--paper); box-shadow: inset 3px 0 var(--ink-800); }
.bgv-row.is-confirmed { box-shadow: inset 3px 0 rgba(47, 107, 81, 0.62); }
.bgv-row.needs-correction { background: var(--brick-bg); box-shadow: inset 3px 0 rgba(142, 66, 66, 0.62); }
.bgv-row.has-correction { background: var(--paper); }
.bgv-row__label { padding-top: 9px; color: var(--ink-700); font-size: var(--text-md); font-weight: 620; line-height: 1.4; }
.bgv-row__req { margin-top: 3px; color: var(--ink-muted); font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.035em; text-transform: uppercase; }
.bgv-row__claim { padding-top: 9px; color: var(--ink-700); font-size: var(--text-md); font-weight: 500; line-height: 1.5; }
.bgv-row__claim--none { color: var(--ink-400); font-weight: 400; }
.bgv-row__answer { gap: 9px; }
.bgv-yn { gap: 7px; }
.bgv-yn label {
  min-height: 42px;
  padding: 9px 10px;
  border-color: var(--rule-strong);
  border-radius: var(--radius);
  color: var(--ink-600);
  font-size: var(--text-sm);
  font-weight: 550;
}
.bgv-yn label:has(input:checked) { border-color: var(--ink-800); background: var(--surface); color: var(--ink-800); box-shadow: inset 0 0 0 1px var(--ink-800); }
.bgv-yn input[type="radio"] { width: 14px; height: 14px; }
.bgv-row__fix,
.bgv-row__answer select,
.bgv-row__dates input {
  min-height: 42px !important;
  padding: 9px 11px !important;
  border-color: var(--rule-strong) !important;
  border-radius: var(--radius) !important;
  background-color: var(--paper-raised) !important;
  font-size: var(--text-sm) !important;
}
.bgv-row__fix:focus-visible,
.bgv-row__answer select:focus-visible,
.bgv-row__dates input:focus-visible { outline: 3px solid rgba(32, 35, 40, 0.13) !important; border-color: var(--ink-800) !important; }
.bgv-row__dates { gap: 8px; }
.bgv-row__dates label { color: var(--ink-soft); font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; }

.bgv-docs-preview { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 13px; margin: 0; }
.bgv-doc {
  overflow: hidden;
  border: 1px solid var(--bgvv-rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.bgv-doc figcaption {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--bgvv-rule);
  background: var(--paper-raised);
  color: var(--ink-700);
  font-size: var(--text-xs);
  font-weight: 650;
}
.bgv-doc figcaption a { display: inline-flex; align-items: center; gap: 5px; margin: 0; color: var(--ink-soft); font-size: var(--text-xs); font-weight: 600; text-decoration: none; }
.bgv-doc__frame { padding: 7px; }
/* The placeholder that stands where the preview will go, so the tile
   keeps its shape before anything is loaded. */
.bgv-doc__frame:has(> .bgv-doc__show) { display: grid; place-items: center; min-height: 120px; }
.bgv-doc__show {
  padding: 7px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  background: var(--paper-raised);
  color: var(--ink);
  font-size: var(--text-md);
}
.bgv-doc iframe { display: block; height: 13.5rem; border: 0; border-radius: var(--radius-sm); background: var(--rule); }
.bgv-exhibits__ask {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--bgvv-rule);
  border-radius: var(--radius);
  background: var(--bgvv-soft);
}
.bgv-exhibits__ask legend { margin: 0 0 12px; color: var(--ink-700); font-size: var(--text-md); }
.bgv-yn--wide { max-width: 31rem; }

.bgv-work #bgv-verify-main > .bgv-verify__notes { max-width: none; }
.bgv-verify__notes { margin-top: -15px !important; }
.bgv-verify__notes > label { margin-bottom: 4px !important; color: var(--ink-800) !important; font-size: var(--text-md) !important; }
.bgv-verify__notes > p { margin: 0 0 12px; color: var(--ink-soft); font-size: var(--text-sm); line-height: 1.5; }
.bgv-verify__notes textarea { min-height: 118px; border-radius: var(--radius); background: var(--paper); }
.bgv-attest__optional { margin-left: 5px; color: var(--ink-400); font-size: var(--text-xs); }

.bgv-attest__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 34px calc(clamp(30px, 4vw, 52px) * -1) calc(clamp(30px, 4vw, 52px) * -1);
  padding: 20px clamp(30px, 4vw, 52px);
  border-top: 1px solid var(--bgvv-rule);
  border-radius: 0 0 21px 21px;
  background: var(--paper);
}
.bgv-attest__actions > div { display: flex; align-items: center; gap: 18px; }
.bgv-attest__actions button[type="submit"] {
  min-width: 10.5rem;
  min-height: 45px;
  border-radius: var(--radius);
  background: var(--ink-900);
  font-size: var(--text-md);
  box-shadow: var(--shadow-sm);
}
.bgv-attest__actions button[type="submit"]::after { content: "→"; margin-left: 15px; font-size: var(--text-lg); }
.bgv-attest__actions > p { max-width: 27rem; margin: 0; color: var(--ink-soft); font-size: var(--text-xs); line-height: 1.5; text-align: right; }
.bgv-attest__actions > p span { color: var(--bgvv-success); font-weight: 700; }
.bgv-attest__switch { color: var(--ink-soft); font-size: var(--text-sm); }

.bgv-work #bgv-verify-optout { max-width: 38rem; margin: 0 auto 50px; }
.bgv-work #bgv-verify-optout .bgv-attest__ask {
  padding: 28px;
  border: 1px solid var(--bgvv-rule);
  border-radius: var(--radius-lg);
  background: var(--bgvv-soft);
}
.bgv-work #bgv-verify-optout .bgv-attest__ask legend { margin-bottom: 18px; font-size: var(--text-3xl); letter-spacing: -0.025em; }
.bgv-work #bgv-verify-optout .bgv-choice label { border-radius: var(--radius); font-size: var(--text-base); }

@media (prefers-reduced-motion: no-preference) {
  .bgv-side,
  .bgv-work { animation: bgv-verify-enter 320ms var(--bgvf-ease-out) both; }
  .bgv-work { animation-delay: 55ms; }
  .bgv-gate .bgv-choice label,
  .bgv-yn label,
  .bgv-doc,
  .bgv-doc figcaption a,
  .bgv-attest__actions button { transition: transform 150ms var(--bgvf-ease-out), border-color 160ms var(--bgvf-ease-out), background-color 160ms var(--bgvf-ease-out), color 160ms var(--bgvf-ease-out), box-shadow 160ms var(--bgvf-ease-out); }
}
@keyframes bgv-verify-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (hover: hover) and (pointer: fine) {
  .bgv-gate .bgv-choice label:hover { border-color: var(--ink-muted); transform: translateY(-1px); }
  .bgv-yn label:hover { border-color: var(--ink-400); background: var(--paper); transform: translateY(-1px); }
  .bgv-row:hover { background: var(--paper); }
  .bgv-doc:hover { border-color: var(--rule-strong); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
  .bgv-doc figcaption a:hover { color: var(--ink-800); }
  .bgv-doc__show:hover {
    border-color: var(--ink-900);
    color: var(--paper-raised);
    background: var(--ink-900);
  }
  .bgv-attest__actions button[type="submit"]:hover { background: var(--ink-800); transform: translateY(-1px); box-shadow: var(--shadow-hover); }
}
.bgv-doc__show:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ink-900) 18%, transparent);
  outline-offset: 3px;
}
.bgv-gate .bgv-choice label:active,
.bgv-yn label:active,
.bgv-attest__actions button:active { transform: translateY(1px); }

@media (max-width: 1120px) {
  .bgv-layout { grid-template-columns: 1fr; }
  .bgv-side {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(15rem, 0.9fr);
    gap: 22px 36px;
    margin: 0;
  }
  .bgv-side__scope { grid-column: 2; grid-row: 1; margin: 0; padding: 0 0 0 28px; border-top: 0; border-left: 1px solid var(--bgvv-rule); }
  .bgv-side__note { grid-column: 1 / -1; margin: 0; }
  .bgv-subject__name { max-width: 18ch; }
}

@media (max-width: 760px) {
  .bgv-attest .bgv-public__header { height: 62px; padding-inline: 18px; }
  .bgv-attest .bgv-public__logo { height: 29px; }
  .bgv-verify__header-label { font-size: var(--text-xs); }
  .bgv-attest__content:has(.bgv-layout) { padding: 18px 12px 72px; }
  .bgv-layout { gap: 12px; }
  .bgv-side { display: block; padding: 25px 21px 21px; border-radius: var(--radius-lg); }
  .bgv-subject__from { margin-bottom: 17px; }
  .bgv-subject__name { max-width: 14ch; font-size: var(--text-4xl); }
  .bgv-side__scope { margin-top: 23px; padding: 21px 0 0; border-top: 1px solid var(--bgvv-rule); border-left: 0; }
  .bgv-side__note { margin-top: 22px; }
  .bgv-work { padding: 24px 20px; border-radius: var(--radius-lg); }
  .bgv-gate { margin-bottom: 56px; padding: 21px 17px; border-radius: var(--radius); }
  .bgv-gate legend { font-size: var(--text-3xl); }
  .bgv-gate__choices { grid-template-columns: 1fr; gap: 8px; }
  .bgv-gate .bgv-choice label { min-height: 51px; }
  .bgv-record, .bgv-exhibits { margin-bottom: 60px; }
  .bgv-record__header { grid-template-columns: 1fr; gap: 13px; margin-bottom: 20px; }
  .bgv-record__title { font-size: var(--text-3xl); }
  .bgv-table { margin-inline: -8px; }
  .bgv-table__head { display: none; }
  .bgv-row { grid-template-columns: 1fr; gap: 13px; min-height: 0; padding: 20px 16px; }
  .bgv-row__label, .bgv-row__claim { padding-top: 0; }
  .bgv-row__req { display: inline-block; margin: 0 0 0 7px; }
  .bgv-row__claim::before { content: "Candidate said: "; color: var(--ink-muted); font-family: var(--font-body); font-weight: 450; }
  .bgv-row__claim--none::before { content: ""; }
  .bgv-yn { flex-wrap: nowrap; }
  .bgv-yn label { flex: 1; min-width: 0; }
  .bgv-docs-preview { grid-template-columns: 1fr; }
  .bgv-doc iframe { height: 20rem; }
  .bgv-exhibits__ask { padding: 15px; }
  .bgv-yn--wide { flex-wrap: wrap; }
  .bgv-yn--wide label { flex: 1 1 7rem; }
  .bgv-attest__actions {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    margin: 30px -20px -24px;
    padding: 17px 20px calc(17px + env(safe-area-inset-bottom));
    border-radius: 0 0 15px 15px;
  }
  .bgv-attest__actions > div { align-items: stretch; flex-direction: column; gap: 8px; }
  .bgv-attest__actions button[type="submit"] { width: 100%; }
  .bgv-attest__actions > p { max-width: none; text-align: left; }
  .bgv-attest__switch { align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  .bgv-attest .bgv-side,
  .bgv-attest .bgv-work { animation: none; }
}

/* --- The queue's group headers -----------------------------------------
   Whose turn it is, as the ledger's own structure. "Needs you" stays open;
   the two groups that are nobody's turn start closed, because a page that
   opens on forty rows makes someone hunt for their four. */
/* This is a section divider inside the ledger, not a raised action. Keep it
   visually integrated with the table and explicitly opt it out of the
   global button hover shadow/pressed scale. */
.ledger tbody tr.bgv-group td {
  padding: 10px 0 8px;
  border-bottom: 0;
  background: transparent;
}
.page--bgv #bgv-ledger tbody tr.bgv-group:hover { background: transparent; }
.bgv-group__toggle {
  display: flex;
  align-items: center;
  /* Explicit: the global button system centres its content, which put the
     group label in the middle of a full-width row. */
  justify-content: flex-start;
  text-align: left;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px 8px 9px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.bgv-group__toggle:hover {
  border-color: var(--rule-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
  transform: none;
}
.bgv-group__toggle:active {
  background: var(--surface);
  box-shadow: none;
  transform: none;
}
.bgv-group__toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.bgv-group__chevron {
  display: grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper-raised);
  color: var(--ink-soft);
}
.bgv-group__title { min-width: 0; }
.bgv-group__count {
  margin-left: auto;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .page--bgv #bgv-ledger tbody tr.bgv-group {
    margin: 6px 0 10px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .ledger tbody tr.bgv-group td { padding: 0; }
}

/* The orientation line. Deliberately not a number: the queue's own group
   headers already count what needs attention, and saying it twice — once
   at 86px — was the page answering one question with two answers. What no
   amount of table structure can show is that something has been sitting
   untouched since August, so that is what this carries. */
.bgv-turn__jump {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.bgv-turn__jump:hover { background: none; color: var(--ink); text-decoration-thickness: 2px; }
.bgv-turn__jump:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* A case that has needed a person for a fortnight is the failure this
   whole queue exists to prevent. The house style spends --brick on exactly
   this: a thin edge, never a filled panel. It is the only red on the page,
   which is what keeps it meaning something. */
.ledger tbody tr.bgv-row--stale > td { background: color-mix(in srgb, var(--brick) 6%, var(--paper-raised)); }
.ledger tbody tr.bgv-row--stale .bgv-next { color: var(--brick-ink); }

/* ==========================================================================
   BGV production finish
   One visual language across the HR queue, candidate form, and verifier
   workspace: cool graphite anchors, quiet white surfaces, and green only
   when the interface is reporting a successful state.
   ========================================================================== */

/* HR operations workspace */
.page--bgv {
  --bgv-canvas: var(--surface);
  --bgv-surface: var(--paper-raised);
  --bgv-soft: var(--surface);
  --bgv-graphite: var(--ink-800);
  --bgv-graphite-soft: var(--ink-800);
  --bgv-border: var(--rule);
  max-width: 1480px;
  padding-top: 34px;
}
.page--bgv .bgv-head {
  align-items: center;
  margin-bottom: 24px;
}
.page--bgv .bgv-head h1 {
  font-size: clamp(29px, 3vw, 38px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.045em;
}
.page--bgv .bgv-head__sub {
  max-width: 60ch;
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: var(--text-base);
  line-height: 1.55;
}
.page--bgv #bgv-add-manual {
  min-height: 42px;
  border-color: var(--bgv-graphite);
  background: var(--bgv-graphite);
  color: var(--paper);
  box-shadow: var(--shadow-sm);
}
.page--bgv #bgv-add-manual:hover {
  border-color: var(--bgv-graphite-soft);
  background: var(--bgv-graphite-soft);
  color: var(--paper-raised);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.page--bgv #bgv-add-manual:active { box-shadow: none; transform: translateY(1px); }

.page--bgv .bgv-turn {
  position: relative;
  gap: 2px;
  margin-bottom: 18px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: none;
  box-shadow: none;
}
.page--bgv .bgv-turn::after { display: none; }
.page--bgv .bgv-turn__what {
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
}
.page--bgv .bgv-turn__rest { color: var(--ink-soft); font-size: var(--text-md); }
.page--bgv .bgv-turn__jump,
.page--bgv .bgv-turn__jump:hover { color: var(--ink-800); }

.page--bgv .bgv-ready {
  padding: 16px 20px 18px;
  border-color: var(--bgv-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.page--bgv .bgv-ready .file-row {
  border-radius: var(--radius);
  background: var(--bgv-soft);
}
.page--bgv .bgv-ready .file-row + .file-row { margin-top: 7px; }

.page--bgv .bgv-workspace {
  border-color: var(--bgv-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.page--bgv .bgv-workspace__header {
  align-items: center;
  padding: 16px 20px 12px;
}
/* 22px section headings against a 24px page title is not a hierarchy step
   you can see. --text-lg is the scale's section role. */
.page--bgv .bgv-workspace__header h2 { font-size: var(--text-lg); }
.page--bgv .bgv-results-count:not(:empty) {
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  background: var(--bgv-soft);
  color: var(--ink-soft);
}
.page--bgv .bgv-filters {
  margin: 15px 16px 8px;
  padding: 13px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--bgv-soft);
}
.page--bgv .bgv-filters input,
.page--bgv .bgv-filters select {
  min-height: 44px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.page--bgv .bgv-ledger-wrap { padding: 0 16px 14px; }
.page--bgv #bgv-ledger thead th {
  padding-top: 12px;
  padding-bottom: 12px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.075em;
}
.page--bgv #bgv-ledger tbody td {
  padding-top: 18px;
  padding-bottom: 18px;
  border-color: var(--rule);
}
.page--bgv #bgv-ledger tbody tr.is-clickable:hover { background: var(--paper); }
.page--bgv #bgv-ledger .ledger__candidate-name { font-weight: 650; }
.page--bgv #bgv-ledger .ledger__candidate-email { margin-top: 4px; color: var(--ink-soft); }
.page--bgv .bgv-next { line-height: 1.5; }
.page--bgv .bgv-ledger__no-action {
  color: var(--ink-400);
  font-family: var(--font-body);
  font-size: var(--text-xs);
}
.page--bgv .bgv-group__toggle {
  border-color: var(--rule);
  background: var(--paper);
}
.page--bgv .bgv-group__toggle:hover { border-color: var(--rule-strong); background: var(--surface); }

/* Case drawer and manual case dialog */
dialog#bgv-drawer { width: min(690px, 100vw); background: var(--surface); }
dialog#bgv-drawer > .drawer__header {
  padding: 25px 28px 22px;
  border-bottom: 1px solid var(--rule);
}
dialog#bgv-drawer .drawer__eyebrow { color: var(--ink-soft); }
dialog#bgv-drawer .drawer__name { font-size: var(--text-3xl); font-weight: 650; }
dialog#bgv-drawer > .drawer__body { padding: 16px; background: var(--surface); }
dialog#bgv-drawer .drawer__section {
  margin-bottom: 10px;
  padding: 20px;
  border-color: var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
dialog#bgv-drawer .drawer__section-title {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}
.bgv-progress-grid .drawer__row {
  padding: 13px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
}
.bgv-progress-grid .drawer__row-label { font-size: var(--text-sm); }
.bgv-progress-grid .drawer__row-value { font-size: var(--text-md); }
dialog#bgv-drawer .bgv-verdict-panel {
  border-color: var(--rule-strong) !important;
  background: var(--surface) !important;
}
.bgv-drawer__footer { padding: 14px 20px; }
dialog.bgv-manual-dialog { border-radius: var(--radius-lg); }
dialog.bgv-manual-dialog .drawer__header { background: var(--paper); }
.bgv-manual-dialog__send { border: 1px solid var(--rule); background: var(--paper); }

/* Shared public portal shell */
.bgv-public {
  --bgvf-bg: var(--surface);
  --bgvf-surface-soft: var(--surface);
  --bgvf-border: var(--rule);
  --bgvf-border-strong: var(--rule-strong);
  --bgvf-faint: var(--ink-soft);
  background:
    radial-gradient(circle at 88% 0%, rgba(39, 45, 52, 0.075), transparent 32rem),
    var(--bgvf-bg);
}
.bgv-public__header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 70px;
  border-color: rgba(208, 213, 218, 0.88);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}
.bgv-public__logo { height: 32px; }
.bgv-public__header-label { color: var(--ink-600); letter-spacing: 0.025em; }
.bgv-public__content { width: min(100%, 1320px); }

/* Candidate declaration */
.bgv-form-experience { grid-template-columns: minmax(300px, 0.76fr) minmax(0, 1.62fr); }
.bgv-form-overview {
  top: 94px;
  border-color: var(--rule-strong);
  border-radius: var(--radius-lg);
  background: var(--paper);
  color: var(--ink-800);
  box-shadow: var(--shadow-card);
}
.bgv-form-overview__intro { border-color: var(--rule-strong); }
.bgv-form-overview .bgv-form-reference { color: var(--ink-soft); }
.bgv-form-overview h1 { color: var(--ink-800); font-weight: 650; }
.bgv-form-overview__intro > p:last-child { color: var(--ink-600); }
.bgv-form-overview .bgv-form-progress-summary span { color: var(--ink-soft); }
.bgv-form-overview .bgv-form-progress-summary strong { color: var(--ink-700); }
.bgv-form-overview .bgv-form-meter { background: var(--rule); }
.bgv-form-overview .bgv-form-meter > span { background: var(--ink-800); }
.bgv-form-overview .bgv-rail__step { color: var(--ink-soft); }
.bgv-form-overview .bgv-rail__marker {
  border-color: var(--rule-strong);
  background: var(--paper-raised);
  color: var(--ink-soft);
}
.bgv-form-overview .bgv-rail__step.is-done .bgv-rail__marker { border-color: var(--ink-600); color: var(--ink-700); }
.bgv-form-overview .bgv-rail__step.is-current { background: var(--paper-raised); color: var(--ink-800); }
.bgv-form-overview .bgv-rail__step.is-current .bgv-rail__marker {
  border-color: var(--ink-800);
  background: var(--ink-800);
  color: var(--paper-raised);
}
.bgv-form-overview .bgv-form-assurance { border-color: var(--rule-strong); }
.bgv-form-overview .bgv-form-assurance strong { color: var(--ink-700); }
.bgv-form-overview .bgv-form-assurance p { color: var(--ink-soft); }
.bgv-form-overview .bgv-rail__step:hover { background: var(--surface); color: var(--ink-800); }
.bgv-form-overview .bgv-rail__step.is-current:hover { background: var(--paper-raised); color: var(--ink-800); }

.bgv-form-panel {
  min-height: 700px;
  border-color: var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  scroll-margin-top: 92px;
}
.bgv-form-panel__topline { color: var(--ink-soft); }
.bgv-form-stage-heading { padding-top: 30px; }
.bgv-form-stage-heading h2 { font-weight: 650; }
.bgv-public input:not([type="checkbox"]):not([type="file"]):not([type="radio"]),
.bgv-public select,
.bgv-public textarea {
  border-color: var(--rule-strong);
  border-radius: var(--radius);
  background-color: var(--paper);
  box-shadow: var(--shadow-sm);
}
.bgv-public .field--tick {
  margin-bottom: 20px;
  padding: 14px 15px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
}
.bgv-public .field--tick label { margin: 0; }
.bgv-public .field--tick .field__hint { margin-left: 28px; }
.bgv-public .bgv-ref-block {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
}
.bgv-public .bgv-ref-block:first-of-type { margin-top: 8px; }
.bgv-public .bgv-ref-block > .apply-section-label { color: var(--ink-600); }
.bgv-public .bgv-ref-block .file-row { border-color: var(--rule); }
.bgv-public input[type="file"]::file-selector-button {
  border-radius: var(--radius);
  background: var(--paper-raised);
}
.bgv-doc-row__state--done { font-weight: 600; }
.bgv-public .bgv-authorisation { border-radius: var(--radius); background: var(--paper); }
.bgv-public .bgv-preview__identity {
  border-block: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink-800);
}
.bgv-public .bgv-preview__identity span,
.bgv-public .bgv-preview__identity dt { color: var(--ink-soft); }
.bgv-public .bgv-preview__identity dd { color: var(--ink-700); }
.bgv-plain-summary {
  padding: 15px 17px;
  border: 1px solid var(--rule);
  border: 1px solid var(--ink-800);
  border-radius: var(--radius);
  background: var(--paper);
}
.bgv-form-actions { background: rgba(255, 255, 255, 0.96); }
.bgv-form-next,
.bgv-form-submit { box-shadow: var(--shadow-sm); }
.bgv-form-next:hover,
.bgv-form-submit:hover { box-shadow: var(--shadow-hover); }
.bgv-form-invalid,
.bgv-form-complete {
  border-color: var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* External verifier */
.bgv-attest .bgv-public__header { z-index: 20; }
.bgv-attest__content:has(.bgv-layout) { max-width: 1440px; }
.bgv-attest .bgv-layout { grid-template-columns: minmax(17rem, 19rem) minmax(0, 1fr); gap: clamp(22px, 3vw, 40px); }
/* The rule above out-ranks the page's own mobile breakpoint (.bgv-layout, further up), so the two columns
   never stacked: on a phone the form was squeezed into a 48px strip beside the summary. Same specificity,
   later, so it wins. */
@media (max-width: 1120px) {
  .bgv-attest .bgv-layout { grid-template-columns: minmax(0, 1fr); }
}
.bgv-attest .bgv-side {
  top: 94px;
  border-color: var(--rule-strong);
  background: var(--paper);
  box-shadow: var(--shadow-card);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.bgv-attest .bgv-subject__from { color: var(--ink-soft); }
.bgv-attest .bgv-subject__name { color: var(--ink-800); }
.bgv-attest .bgv-subject__detail { color: var(--ink-600); }
.bgv-attest .bgv-subject__dates { color: var(--ink-soft); }
.bgv-attest .bgv-side__scope { border-color: var(--rule-strong); }
.bgv-attest .bgv-side__scope > p { color: var(--ink-soft); }
.bgv-attest .bgv-side__scope li {
  display: block;
  min-height: 0;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
}
.bgv-attest .bgv-side__scope li:last-child { border-bottom: 0; }
.bgv-attest .bgv-side__scope li strong { color: var(--ink-700); font-size: var(--text-sm); }
.bgv-attest .bgv-side__note { background: var(--surface); color: var(--ink-soft); }
.bgv-attest .bgv-side__note svg { color: var(--ink-600); }
.bgv-attest .bgv-side__note strong { color: var(--ink-700); }
.bgv-attest .bgv-work {
  border-color: var(--rule);
  box-shadow: var(--shadow-card);
}
.bgv-attest .bgv-gate {
  margin-bottom: clamp(48px, 5vw, 66px);
  border-color: var(--rule);
  background: var(--paper);
}
.bgv-attest .bgv-section-index {
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}
.bgv-attest .bgv-record,
.bgv-attest .bgv-exhibits { margin-bottom: clamp(52px, 6vw, 72px); }
.bgv-attest .bgv-record__header {
  display: block;
  max-width: 46rem;
  margin-bottom: 22px;
}
.bgv-attest .bgv-record__title { max-width: 24ch; }
.bgv-attest .bgv-record__header .bgv-record__hint { max-width: 62ch; margin-top: 10px; }
.bgv-attest .bgv-table { box-shadow: var(--shadow-card); }
.bgv-attest .bgv-table__head { background: var(--surface); }
.bgv-attest .bgv-row:focus-within { background: var(--paper); }
.bgv-attest .bgv-doc { box-shadow: none; }
.bgv-attest .bgv-exhibits__ask { background: var(--paper); }
.bgv-attest .bgv-attest__actions { background: var(--paper); }
.bgv-attest .bgv-attest__message {
  width: min(100%, 42rem);
  margin: 28px auto 0;
  padding: clamp(30px, 5vw, 48px);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  box-shadow: var(--shadow-card);
}

@media (max-width: 1120px) {
  .bgv-attest .bgv-side { top: auto; }
  .bgv-attest .bgv-side__scope { border-color: var(--rule-strong); }
}

@media (max-width: 900px) {
  .bgv-form-experience { grid-template-columns: 1fr; }
  .bgv-form-overview { top: auto; }
  .bgv-form-overview .bgv-rail__step { background: var(--surface); }
  .bgv-form-overview .bgv-rail__step.is-current { background: var(--paper-raised); }
}

@media (max-width: 760px) {
  .page--bgv { padding-top: 20px; }
  .page--bgv .bgv-head { align-items: stretch; flex-direction: column; gap: 16px; }
  .page--bgv #bgv-add-manual { align-self: flex-start; }
  .page--bgv .bgv-turn { padding: 0; }
  .page--bgv .bgv-workspace { border-radius: var(--radius-lg); }
  .page--bgv .bgv-workspace__header { padding: 21px 18px 18px; }
  .page--bgv .bgv-results-count:not(:empty) { align-self: flex-start; }
  .page--bgv .bgv-filters { margin: 10px; }
  .page--bgv #bgv-ledger thead,
  .page--bgv .bgv-ledger__columns { display: none; }
  .page--bgv #bgv-ledger,
  .page--bgv #bgv-ledger tbody,
  .page--bgv #bgv-ledger tr,
  .page--bgv #bgv-ledger td { display: block; width: 100%; }
  .page--bgv #bgv-ledger td[data-label]::before {
    display: block;
    margin-bottom: 4px;
    content: attr(data-label);
    color: var(--ink-muted);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  dialog#bgv-drawer > .drawer__body { padding: 10px; }
  dialog#bgv-drawer .drawer__section { padding: 17px; }
  .bgv-public__header { height: 62px; }
  .bgv-public .bgv-ref-block { padding: 16px; }
  .bgv-attest .bgv-side { background: var(--paper); }
  .bgv-attest .bgv-side__scope { border-color: var(--rule-strong); }
  .bgv-attest .bgv-row__claim::before { content: "Candidate said: "; }
}

@media (max-width: 520px) {
  .page--bgv #bgv-add-manual { width: 100%; }
  .page--bgv .bgv-turn__what { font-size: var(--text-base); }
  .bgv-public__header { padding-inline: 16px; }
  .bgv-public__logo { height: 28px; }
  .bgv-public__header-label { font-size: var(--text-xs); }
  .bgv-form-panel { border-radius: var(--radius-lg); }
  .bgv-public .bgv-ref-block { margin-inline: -4px; }
}

/* ==========================================================================
   BGV operations components
   A restrained command surface for the queue and a readable case-file
   drawer. Dark ink is reserved for the final primary action, never a card.
   ========================================================================== */

/* The filters work as one command bar. Internal dividers connect the fields
   without turning each input into its own floating card. */
.page--bgv .bgv-filters {
  margin: 16px 18px 10px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: var(--paper-raised);
  box-shadow:
    0 0 0 1px rgba(43, 49, 56, 0.1),
    0 4px 14px rgba(43, 49, 56, 0.04);
}
.page--bgv .bgv-filters .filters__fields {
  grid-template-columns: minmax(260px, 1.65fr) minmax(170px, 0.62fr) minmax(170px, 0.62fr) auto;
  gap: 0;
  align-items: stretch;
}
.page--bgv .bgv-filters .field {
  display: flex;
  min-height: 62px;
  margin: 0;
  padding: 9px 14px 8px;
  flex-direction: column;
  justify-content: center;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition:
    background-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.page--bgv .bgv-filters .field + .field { box-shadow: inset 1px 0 0 var(--rule); }
.page--bgv .bgv-filters .field:focus-within {
  background: var(--paper);
  box-shadow: inset 0 -2px 0 var(--ink-700);
}
.page--bgv .bgv-filters label {
  margin: 0 0 1px;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.015em;
  line-height: 1.2;
}
.page--bgv .bgv-filters input,
.page--bgv .bgv-filters select {
  width: 100%;
  min-height: 31px;
  padding: 2px 0 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  color: var(--ink-800);
  font-size: var(--text-base);
  font-weight: 530;
  box-shadow: none;
}
.page--bgv .bgv-filters input::placeholder { color: var(--ink-soft); font-weight: 450; }
.page--bgv .bgv-filters input:focus,
.page--bgv .bgv-filters input:focus-visible,
.page--bgv .bgv-filters select:focus,
.page--bgv .bgv-filters select:focus-visible {
  outline: 0;
  border: 0;
  box-shadow: none;
}
.page--bgv .bgv-filters__clear {
  align-self: stretch;
  min-height: 62px;
  margin: 0;
  padding: 0 15px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: inset 1px 0 0 var(--rule);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  transition:
    background-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.page--bgv .bgv-filters__clear:hover {
  background: var(--surface);
  color: var(--ink-800);
  box-shadow: inset 1px 0 0 var(--rule);
  transform: none;
}
.page--bgv .bgv-filters__clear:active { transform: translateY(1px); }

/* Queue groups are strong navigation rows, with an inner disclosure target
   and a compact count. They remain quiet enough not to compete with cases. */
.ledger tbody tr.bgv-group td { padding: 12px 0 10px; }
.page--bgv .bgv-group__toggle {
  min-height: 52px;
  padding: 8px 11px 8px 9px;
  gap: 11px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(43, 49, 56, 0.09);
  font-size: var(--text-base);
  font-weight: 650;
  transition:
    background-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.page--bgv .bgv-group__toggle:hover {
  border: 0;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(43, 49, 56, 0.14);
  transform: none;
}
.page--bgv .bgv-group__toggle:active { transform: translateY(0); }
.page--bgv .bgv-group__toggle[aria-expanded="true"] { background: var(--surface); }
.page--bgv .bgv-group__chevron {
  flex-basis: 32px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--paper-raised);
  color: var(--ink-600);
  box-shadow: inset 0 0 0 1px rgba(43, 49, 56, 0.1);
}
.page--bgv .bgv-group__chevron-mark {
  display: block;
  margin-top: -1px;
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: 1;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.page--bgv .bgv-group__toggle[aria-expanded="true"] .bgv-group__chevron-mark { transform: rotate(90deg); }
.page--bgv .bgv-group__count {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-soft);
  box-shadow: none;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 550;
}

/* Case file drawer */
dialog#bgv-drawer {
  width: min(760px, 100vw);
  border-left: 0;
  background: var(--paper-raised);
  box-shadow: var(--shadow-modal);
}
dialog#bgv-drawer::backdrop { background: rgba(23, 28, 33, 0.38); }
dialog#bgv-drawer > .drawer__header {
  min-height: 112px;
  padding: 25px 30px 23px;
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: inset 0 -1px 0 rgba(43, 49, 56, 0.1);
}
dialog#bgv-drawer .drawer__eyebrow {
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
dialog#bgv-drawer .drawer__name {
  font-size: var(--text-4xl);
  font-weight: 670;
  line-height: 1.1;
  letter-spacing: -0.042em;
}
dialog#bgv-drawer .drawer__role {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: var(--text-md);
  line-height: 1.45;
}
dialog#bgv-drawer #bgv-drawer-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-600);
  box-shadow:
    inset 0 1px 0 var(--paper-raised),
    0 0 0 1px rgba(43, 49, 56, 0.1);
  transition:
    background-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
dialog#bgv-drawer #bgv-drawer-close:hover {
  background: var(--surface);
  box-shadow: inset 0 1px 0 var(--paper-raised), 0 0 0 1px rgba(43, 49, 56, 0.14);
  transform: none;
}
dialog#bgv-drawer #bgv-drawer-close:active { transform: scale(0.96); }
dialog#bgv-drawer > .drawer__body {
  padding: 0 28px;
  scrollbar-color: var(--rule-mid) transparent;
  background: var(--paper-raised);
}
dialog#bgv-drawer .drawer__section {
  margin: 0;
  padding: 26px 0 28px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
dialog#bgv-drawer .drawer__section:first-child {
  padding-top: 26px;
  border-top: 0;
}
dialog#bgv-drawer .drawer__section-title {
  display: block;
  margin-bottom: 15px;
  color: var(--ink-700);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 650;
  letter-spacing: -0.01em;
  text-transform: none;
}
dialog#bgv-drawer .bgv-next-step {
  margin: -2px 0 12px;
  padding: 13px 15px;
  border-left: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-600);
  border: 1px solid var(--ink-400);
  font-size: var(--text-md);
  line-height: 1.45;
}
dialog#bgv-drawer .bgv-next-step--mine {
  background: var(--surface);
  color: var(--ink-800);
  border: 1px solid var(--ink-700);
  font-weight: 650;
}
dialog#bgv-drawer .bgv-progress-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--rule);
}
dialog#bgv-drawer .bgv-progress-grid .drawer__row {
  min-height: 72px;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  box-shadow: none;
}
dialog#bgv-drawer .bgv-progress-grid__wide {
  min-height: 58px;
  grid-column: 1 / -1;
}
dialog#bgv-drawer .bgv-progress-grid .drawer__row-label {
  color: var(--ink-muted);
  font-size: var(--text-xs);
  font-weight: 550;
}
dialog#bgv-drawer .bgv-progress-grid .drawer__row-value {
  color: var(--ink-800);
  font-size: var(--text-md);
  font-weight: 620;
  line-height: 1.4;
}

/* Verification requests and submitted records are structured evidence rows,
   not another layer of floating cards. */
dialog#bgv-drawer .bgv-progress {
  margin: -2px 0 14px;
  padding: 0;
  border: 0;
  color: var(--ink-soft);
  font-size: var(--text-md);
}
dialog#bgv-drawer #bgv-drawer-checks,
dialog#bgv-drawer #bgv-drawer-employments,
dialog#bgv-drawer #bgv-drawer-references {
  display: grid;
  gap: 8px;
}
dialog#bgv-drawer .bgv-block {
  margin: 0;
  padding: 15px 0;
  border-left: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
dialog#bgv-drawer .bgv-block:first-child { padding-top: 0; }
dialog#bgv-drawer .bgv-block:last-child { padding-bottom: 0; border-bottom: 0; }
dialog#bgv-drawer .bgv-block--flagged {
  padding-left: 12px;
  border: 1px solid var(--brick-border);
}
dialog#bgv-drawer .bgv-block__title { font-size: var(--text-base); font-weight: 650; }
dialog#bgv-drawer .bgv-block__meta {
  margin-top: 4px;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.45;
}
dialog#bgv-drawer .bgv-check__head { align-items: flex-start; }
dialog#bgv-drawer #bgv-drawer-send-checks { margin-top: 12px; }

dialog#bgv-drawer #bgv-drawer-declaration {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--rule);
}
dialog#bgv-drawer #bgv-drawer-declaration .drawer__row {
  display: block;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 0;
  background: var(--paper);
  box-shadow: none;
}
dialog#bgv-drawer #bgv-drawer-declaration .drawer__row-label {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-muted);
  font-size: var(--text-xs);
}
dialog#bgv-drawer #bgv-drawer-declaration .drawer__row-value {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink-800);
  font-size: var(--text-md);
  font-weight: 620;
  line-height: 1.4;
  text-align: left;
}

dialog#bgv-drawer .bgv-docs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 13px;
}
dialog#bgv-drawer .bgv-doc {
  padding: 8px;
  border: 0;
  border-radius: var(--radius);
  background: var(--paper-raised);
  box-shadow: inset 0 0 0 1px rgba(43, 49, 56, 0.1);
}
dialog#bgv-drawer .bgv-doc figcaption {
  min-height: 29px;
  margin: 0;
  padding: 3px 4px 8px;
  color: var(--ink-600);
  font-size: var(--text-xs);
}
dialog#bgv-drawer .bgv-doc iframe { height: 13rem; border-radius: var(--radius-sm); background: var(--rule); }
dialog#bgv-drawer .bgv-docs__link {
  margin: 0;
  padding: 8px 4px 2px;
  color: var(--ink-600);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-underline-offset: 3px;
}

/* The audit history is a rail: timestamps remain easy to scan while event
   descriptions get the width they need. */
dialog#bgv-drawer .bgv-timeline { gap: 0; }
dialog#bgv-drawer .bgv-timeline__row {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 15px;
  align-items: start;
}
dialog#bgv-drawer .bgv-timeline__when {
  padding-top: 1px;
  color: var(--ink-muted);
  font-size: var(--text-xs);
  line-height: 1.5;
}
dialog#bgv-drawer .bgv-timeline__what {
  position: relative;
  min-width: 0;
  padding: 0 0 17px 18px;
  border-left: 1px solid var(--rule);
  color: var(--ink-700);
  font-size: var(--text-sm);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
dialog#bgv-drawer .bgv-timeline__what::before {
  position: absolute;
  top: 4px;
  left: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-400);
  box-shadow: 0 0 0 3px var(--paper-raised);
  content: "";
}
dialog#bgv-drawer .bgv-timeline__row:last-child .bgv-timeline__what {
  padding-bottom: 0;
  border-left-color: transparent;
}
dialog#bgv-drawer .bgv-timeline__actor { color: var(--ink-muted); }

dialog#bgv-drawer .bgv-verdict-panel {
  padding: 23px;
  border: 0 !important;
  background: var(--paper) !important;
  box-shadow: inset 0 0 0 1px rgba(43, 49, 56, 0.1);
  margin: 20px 0 28px;
  border-radius: var(--radius);
}
dialog#bgv-drawer .bgv-verdict-panel .field { margin-bottom: 13px; }
dialog#bgv-drawer .bgv-verdict-panel label {
  color: var(--ink-600);
  font-size: var(--text-xs);
  font-weight: 650;
}
dialog#bgv-drawer .bgv-verdict-panel select,
dialog#bgv-drawer .bgv-verdict-panel textarea {
  border-color: var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  box-shadow: inset 0 1px 2px rgba(43, 49, 56, 0.025);
}
dialog#bgv-drawer .bgv-verdict-panel #bgv-verdict-save {
  min-height: 44px;
  border-radius: var(--radius);
  background: var(--ink-800);
  box-shadow: var(--shadow-sm);
}
dialog#bgv-drawer .bgv-verdict-panel #bgv-verdict-save:hover {
  background: var(--ink-700);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
dialog#bgv-drawer .bgv-verdict-panel #bgv-verdict-save:active {
  box-shadow: none;
  transform: translateY(1px);
}
dialog#bgv-drawer > .bgv-drawer__footer {
  min-height: 64px;
  padding: 11px 20px calc(11px + env(safe-area-inset-bottom));
  border-top: 0;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-sticky);
}

@media (max-width: 1050px) {
  .page--bgv .bgv-filters .filters__fields {
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 0.62fr));
  }
  .page--bgv .bgv-filters__clear {
    grid-column: 1 / -1;
    justify-self: end;
    min-height: 34px;
    padding-inline: 12px;
  }
}

@media (max-width: 760px) {
  .page--bgv .bgv-filters { margin: 10px; padding: 0; }
  .page--bgv .bgv-filters .filters__fields { grid-template-columns: 1fr; }
  .page--bgv .bgv-filters .field { min-height: 58px; }
  .page--bgv .bgv-filters .field + .field { box-shadow: inset 0 1px 0 var(--rule); }
  .page--bgv .bgv-filters__clear {
    grid-column: auto;
    justify-self: stretch;
    min-height: 42px;
    box-shadow: inset 0 1px 0 var(--rule);
  }
  .page--bgv .bgv-group__toggle { min-height: 50px; }
  dialog#bgv-drawer > .drawer__header { min-height: 100px; padding: 21px 20px 19px; }
  dialog#bgv-drawer .drawer__name { font-size: var(--text-3xl); }
  dialog#bgv-drawer > .drawer__body { padding: 0 18px; }
  dialog#bgv-drawer .drawer__section { padding: 22px 0 24px; }
  dialog#bgv-drawer .bgv-verdict-panel { padding: 18px; }
  dialog#bgv-drawer .bgv-progress-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dialog#bgv-drawer .bgv-progress-grid__wide { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  dialog#bgv-drawer #bgv-drawer-declaration,
  dialog#bgv-drawer .bgv-docs { grid-template-columns: 1fr; }
  dialog#bgv-drawer .bgv-timeline__row { grid-template-columns: 1fr; gap: 4px; }
  dialog#bgv-drawer .bgv-timeline__when { padding: 0 0 0 18px; }
  dialog#bgv-drawer .bgv-timeline__what { padding-bottom: 16px; }
}

@media (max-width: 420px) {
  dialog#bgv-drawer .bgv-progress-grid { grid-template-columns: 1fr; }
  dialog#bgv-drawer .bgv-progress-grid__wide { grid-column: auto; }
  dialog#bgv-drawer .drawer__section { padding: 20px 0 22px; }
  dialog#bgv-drawer .bgv-verdict-panel { padding: 16px; }
}

/* BGV exception-first review flow -------------------------------------- */
dialog#bgv-drawer .bgv-review-section { padding-top: 24px; }
.bgv-review-heading,
.bgv-verdict-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
dialog#bgv-drawer .bgv-review-heading .drawer__section-title,
dialog#bgv-drawer .bgv-verdict-heading .drawer__section-title { margin-bottom: 0; }
.bgv-review-source {
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 550;
}
.bgv-review-brief {
  margin-top: 15px;
  padding: 15px 16px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--ink-soft);
}
.bgv-review-status {
  color: var(--ink-800);
  font-size: var(--text-md);
  font-weight: 680;
}
.bgv-review-brief p {
  max-width: 65ch;
  margin: 5px 0 0;
  color: var(--ink-600);
  font-size: var(--text-md);
  line-height: 1.58;
}
.bgv-review-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.bgv-review-counts > div {
  display: flex;
  min-width: 0;
  padding: 13px 14px;
  align-items: baseline;
  gap: 8px;
}
.bgv-review-counts > div + div { border-left: 1px solid var(--rule); }
.bgv-review-counts strong {
  color: var(--ink-800);
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-variant-numeric: tabular-nums;
}
.bgv-review-counts span { color: var(--ink-soft); font-size: var(--text-xs); white-space: nowrap; }
.bgv-review-group { margin-top: 20px; }
.bgv-review-group h3 {
  margin: 0 0 7px;
  color: var(--ink-600);
  font-size: var(--text-sm);
  font-weight: 650;
}
.bgv-review-list { border-top: 1px solid var(--rule); }
.bgv-review-item {
  display: flex;
  width: 100%;
  min-height: 58px;
  padding: 10px 2px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink-800);
  text-align: left;
  box-shadow: none;
}
.bgv-review-item:hover {
  background: var(--paper);
  color: var(--ink-800);
  box-shadow: none;
  transform: none;
}
.bgv-review-item:active { background: var(--surface); transform: none; }
.bgv-review-item > span:first-child { min-width: 0; }
.bgv-review-item strong,
.bgv-review-item small { display: block; }
.bgv-review-item strong { font-size: var(--text-md); font-weight: 650; }
.bgv-review-item small {
  max-width: 54ch;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 450;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bgv-review-item__action {
  flex: none;
  color: var(--ink-600);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}

dialog#bgv-drawer #bgv-drawer-checks { display: block; }
.bgv-response {
  border-top: 1px solid var(--rule);
  background: var(--paper-raised);
}
.bgv-response:last-child { border-bottom: 1px solid var(--rule); }
.bgv-response > summary {
  display: flex;
  min-height: 66px;
  padding: 12px 4px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  cursor: pointer;
}
.bgv-response > summary::-webkit-details-marker { display: none; }
.bgv-response > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.bgv-response__identity { min-width: 0; }
.bgv-response__identity strong,
.bgv-response__identity small { display: block; }
.bgv-response__identity strong { color: var(--ink-800); font-size: var(--text-md); font-weight: 670; }
.bgv-response__identity small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 450;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bgv-response__body { padding: 2px 4px 20px; }
.bgv-response__contact { margin-bottom: 12px; color: var(--ink-soft); font-size: var(--text-xs); line-height: 1.5; overflow-wrap: anywhere; }
.bgv-response__was { display: block; }
.bgv-response__marks { display: flex; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.bgv-response--review > summary { border: 1px solid var(--brick-border); padding-left: 12px; }
.bgv-check__flag {
  max-width: none;
  margin: 0 0 7px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--brick-bg);
  color: var(--brick-ink);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.bgv-check__flag--resolved { background: var(--surface); color: var(--ink-soft); }
.bgv-answer-wrap { margin-top: 14px; }
.bgv-answer-wrap .bgv-answer {
  width: 100%;
  margin: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.bgv-answer-wrap .bgv-answer th,
.bgv-answer-wrap .bgv-answer td {
  width: auto;
  padding: 9px 10px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-700);
  line-height: 1.4;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}
.bgv-answer-wrap .bgv-answer thead th {
  padding-top: 8px;
  padding-bottom: 8px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 650;
}
.bgv-answer-wrap .bgv-answer tbody th {
  width: 28%;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 550;
}
.bgv-answer-wrap .bgv-answer tr.is-different td { background: var(--amber-bg); }
.bgv-answer__notes {
  margin-top: 14px;
  padding: 0;
  border-left: 0;
}
.bgv-answer__notes > span {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 650;
}
.bgv-answer__notes blockquote {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--ink-400);
  background: var(--surface);
  color: var(--ink-700);
  font-size: var(--text-sm);
  line-height: 1.55;
  white-space: pre-wrap;
}
.bgv-original-response { margin-top: 14px; }
.bgv-original-response > summary {
  width: fit-content;
  color: var(--ink-600);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
}
.bgv-original-response pre {
  max-height: 260px;
  margin: 10px 0 0;
  padding: 13px 14px;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-700);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.55;
  white-space: pre-wrap;
}
.bgv-response .js-bgv-resolve { margin-top: 14px; }
.bgv-resolution,
.bgv-change-email {
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(43, 49, 56, 0.08);
}
.bgv-resolution .field,
.bgv-change-email .field { margin-bottom: 11px; }
.bgv-resolution label,
.bgv-change-email label { color: var(--ink-600); font-size: var(--text-xs); font-weight: 650; }
.bgv-resolution select,
.bgv-resolution textarea,
.bgv-change-email input {
  margin-top: 5px;
  border-color: var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-raised);
  font-family: var(--font-body);
}
.bgv-resolution__actions { display: flex; justify-content: flex-end; gap: 8px; }
.bgv-resolution__actions .btn--text:hover { box-shadow: none; }
.bgv-response__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.bgv-change-email__hint { margin: 0 0 11px; color: var(--ink-soft); font-size: var(--text-xs); }

dialog#bgv-drawer .bgv-case-disclosure { padding: 0; }
.bgv-case-disclosure > summary {
  display: grid;
  min-height: 66px;
  padding: 14px 2px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  align-items: center;
  gap: 4px 18px;
  list-style: none;
  cursor: pointer;
}
.bgv-case-disclosure > summary::-webkit-details-marker { display: none; }
.bgv-case-disclosure > summary::after {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--ink-muted);
  content: "+";
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 400;
}
.bgv-case-disclosure[open] > summary::after { content: "−"; }
.bgv-case-disclosure > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.bgv-case-disclosure > summary span { color: var(--ink-700); font-size: var(--text-md); font-weight: 650; }
.bgv-case-disclosure > summary small { color: var(--ink-soft); font-size: var(--text-xs); font-weight: 450; }
.bgv-case-disclosure__body { padding: 2px 0 24px; }

.bgv-verdict-heading { margin-bottom: 14px; }
.bgv-decision-readiness {
  margin: -3px 0 16px;
  padding: 9px 11px;
  border: 1px solid var(--ink-400);
  background: var(--surface);
  color: var(--ink-600);
  font-size: var(--text-sm);
  line-height: 1.5;
}
#bgv-use-review-note {
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-600);
  font-size: var(--text-xs);
  font-weight: 600;
  box-shadow: none;
}
#bgv-use-review-note:hover { color: var(--ink-800); box-shadow: none; transform: none; }

@media (max-width: 560px) {
  .bgv-review-counts > div { padding: 11px 8px; flex-direction: column; gap: 2px; }
  .bgv-review-item { align-items: flex-start; }
  .bgv-review-item small { white-space: normal; }
  .bgv-review-item__action { display: none; }
  .bgv-response > summary { align-items: flex-start; }
  .bgv-response__identity small { white-space: normal; }
  .bgv-answer-wrap .bgv-answer,
  .bgv-answer-wrap .bgv-answer tbody,
  .bgv-answer-wrap .bgv-answer tr,
  .bgv-answer-wrap .bgv-answer th,
  .bgv-answer-wrap .bgv-answer td { display: block; width: 100%; }
  .bgv-answer-wrap .bgv-answer thead { display: none; }
  .bgv-answer-wrap .bgv-answer tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 0;
    border-bottom: 1px solid var(--rule);
  }
  .bgv-answer-wrap .bgv-answer tbody th {
    grid-column: 1 / -1;
    padding: 0 8px 7px;
    border: 0;
  }
  .bgv-answer-wrap .bgv-answer td { padding: 0 8px; border: 0; }
  .bgv-answer-wrap .bgv-answer td::before {
    display: block;
    margin-bottom: 3px;
    color: var(--ink-muted);
    content: attr(data-label);
    font-size: var(--text-xs);
    font-weight: 600;
  }
  .bgv-resolution__actions { align-items: stretch; flex-direction: column-reverse; }
  .bgv-resolution__actions button { width: 100%; }
}

/* --- Declared jobs beyond the verified window ---------------------------
   HR verifies the three most recent past employers. Everything older is
   kept as a record: six plain questions and one letter, nobody contacted.
   Saying so on the block itself is what stops a candidate hunting down a
   2011 manager's live work address for a job we will never write about. */
.bgv-public .bgv-tier-note {
  margin: 0 0 20px;
  padding: 10px 0 10px 14px;
  border: 1px solid var(--bgvf-border-strong);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--bgvf-muted);
  max-width: 46rem;
}
/* The form grows a job at a time instead of presenting ten empty blocks to
   someone who had two. */
.bgv-public .bgv-job-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--bgvf-border);
}
.bgv-doc-group__note {
  margin-left: 10px;
  font-weight: 400;
  font-style: italic;
  color: var(--bgvf-faint);
  text-transform: none;
  letter-spacing: 0;
}

/* --- The declaration form's employment block ----------------------------
   Eighteen fields in one grid, required and optional interleaved, gave a
   candidate no way to see what was actually needed. Three groups, in the
   order someone recalls a job: which company, what they did, who can
   confirm it. The headings are structure, not decoration — each names a
   question, and a group with no fields in it is not rendered at all. */
.bgv-public .bgv-fieldgroup + .bgv-fieldgroup {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--bgvf-border);
}
.bgv-public .bgv-fieldgroup__heading {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--bgvf-ink);
}
/* The word, not a red asterisk — matching the verifier screen, which
   dropped the asterisk as the commonest tell of a generated form. Sits
   after the label rather than inside it so it never breaks the line. */
.bgv-public .field__req {
  margin-left: 8px;
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--bgvf-muted);
  text-transform: none;
}
.bgv-public .bgv-job-actions__note {
  margin-left: auto;
  font-size: var(--text-md);
  color: var(--bgvf-muted);
}
@media (max-width: 620px) {
  .bgv-public .bgv-job-actions { flex-wrap: wrap; }
  .bgv-public .bgv-job-actions__note { margin-left: 0; flex-basis: 100%; }
}

/* --- Rhythm on the employment step -------------------------------------
   Tick box, type switch, first group heading: previously 20px, 0px, 0px —
   the heading sat flush against the select. One scale now: 26 below the
   tick box, 30 below the switch, matching the 30/26 the groups use. More
   above a heading than below it. */
.bgv-public .field--tick { margin-bottom: 26px; }
.bgv-public .bgv-employment-type { margin: 0 0 30px; }

/* Browser surfaces the design didn't draw but still ships: the caret and
   the selection highlight. Left at defaults they are the one thing on the
   page that belongs to no palette. */
.bgv-public input,
.bgv-public textarea,
.bgv-public select { caret-color: var(--bgvf-accent); }
.bgv-public ::selection {
  background: color-mix(in srgb, var(--bgvf-accent) 18%, var(--bgvf-surface));
  color: var(--bgvf-ink);
}

/* ==========================================================================
   BGV — docked verification brief, queue tabs, verdict cards
   The case panel was a modal (showModal()): a backdrop dimmed the queue and
   made it inert, so reading a brief meant losing the list you were working
   against. It is now opened with show() — same element, same markup, no
   backdrop and no inert page — and docks beside the table instead of over
   it. Below 1100px there is no room to sit alongside, so it falls back to
   the overlay it used to be.
   ========================================================================== */

dialog#bgv-drawer.bgv-panel {
  top: 64px;                       /* clears the sticky nav */
  height: auto;
  width: min(420px, 100vw);
  border-left: 1px solid var(--rule-strong);
  box-shadow: none;
}

/* .page is normally max-width:1440 and centred; while the panel is docked
   the page fills instead, so the content ends where the panel begins
   rather than floating in a gutter beside it on a wide screen. */
body.bgv-panel-open .page--bgv {
  max-width: none;
  margin: 0;
  padding-right: calc(min(420px, 100vw) + 24px);
}

@media (max-width: 1100px) {
  dialog#bgv-drawer.bgv-panel {
    top: 0;
    height: 100%;
    box-shadow: var(--shadow-modal);
  }
  body.bgv-panel-open .page--bgv { padding-right: 28px; }
}

/* Which row the open brief belongs to. A modal did not need this; a docked
   panel does, because the table stays visible beside it. */
/* Background only. bgv-row--stale already writes box-shadow on
   td:first-child for its overdue accent — marking "open" there too would
   have one silently overwrite the other on a row that is both. */
#bgv-ledger tr.is-open > td { background: var(--surface); }
#bgv-ledger tr.is-open .ledger__candidate-name { font-weight: 650; }

/* ---------- queue tabs ---------- */

.bgv-tabs {
  display: flex;
  gap: 2px;
  margin: 0 0 2px;
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  scrollbar-width: none;
}
.bgv-tabs::-webkit-scrollbar { display: none; }

.bgv-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 10px 14px;
  margin: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  min-height: 0;
}
.bgv-tab:hover { color: var(--ink); }
.bgv-tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }

.bgv-tab__count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.bgv-tab.is-active .bgv-tab__count { background: var(--ink); color: var(--on-accent); }

/* ---------- verdict cards ---------- */
/* Radio inputs, not a custom widget: this is one-of-three, so the native
   control keeps arrow-key navigation and screen-reader semantics for free.
   The input itself is hidden only visually. */

.bgv-verdict-choice {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.bgv-verdict-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper-raised);
  cursor: pointer;
}
.bgv-verdict-card:hover { border-color: var(--ink-muted); }
.bgv-verdict-card input { position: absolute; opacity: 0; pointer-events: none; }

.bgv-verdict-card__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.bgv-verdict-card__text strong { font-size: var(--text-md); font-weight: 600; color: var(--ink); }
.bgv-verdict-card__text small { font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.45; }

.bgv-verdict-card__icon { flex: none; margin-top: 1px; color: var(--ink-muted); }
.bgv-verdict-card:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.bgv-verdict-card:has(input:checked) .bgv-verdict-card__icon { color: var(--ink); }
/* Keyboard focus lands on the visually-hidden input, so the ring has to be
   drawn by the label around it. */
.bgv-verdict-card:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

.bgv-verdict-lock {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: var(--text-xs);
}
.bgv-verdict-lock svg { flex: none; }

/* --- docked-panel corrections -------------------------------------------
   These three only became wrong once the panel stopped being a full-width
   overlay: each was sized against the viewport, and the panel is now a
   fixed 420px at every viewport. */

/* Four columns inside 420px broke "Documents received" across three lines.
   The panel's width, not the window's, decides this. */
dialog#bgv-drawer.bgv-panel .bgv-progress-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
dialog#bgv-drawer.bgv-panel .bgv-progress-grid__wide { grid-column: 1 / -1; }

/* The queue loses ~440px when the panel opens, and seven columns do not
   fit in what is left — addresses were breaking mid-word. The reference
   number is the one column the panel itself already shows in its header,
   so it is the one to drop. */
body.bgv-panel-open #bgv-ledger th:first-child,
body.bgv-panel-open #bgv-ledger td:first-child { display: none; }
body.bgv-panel-open #bgv-ledger .ledger__candidate-email {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The launcher is fixed to the viewport's bottom-right, which is where the
   panel's own footer actions now are. */
body.bgv-panel-open .hireai-launcher { right: calc(min(420px, 100vw) + 24px); }
@media (max-width: 1100px) { body.bgv-panel-open .hireai-launcher { right: 24px; } }
@media (prefers-reduced-motion: no-preference) {
  .hireai-launcher { transition: right 200ms var(--ease-standard); }
}

/* Renders as a bare grey slab until JS writes a readiness sentence into
   it, which is most of the time the panel is open. */
.bgv-decision-readiness:empty { display: none; }

/* The description is the quiet half of the card; without an explicit
   weight it inherited the panel's and read as loud as the outcome name. */
.bgv-verdict-card__text small { font-weight: 400; }

/* With the panel docked the queue is ~900px, and a two-word name was
   breaking across lines while the role column kept slack. */
body.bgv-panel-open #bgv-ledger .ledger__candidate-name { white-space: nowrap; }

/* The generic button:hover paints --focus-hover (near-black) behind any
   <button>, which turned a hovered tab into a filled black block. A tab is
   not a button-shaped control; the underline carries its state. */
.bgv-tab:hover,
.bgv-tab:focus-visible { background: none; box-shadow: none; }
.bgv-tab:active { transform: none; }

/* ==========================================================================
   Editorial pass — crisp white, 1px near-black edges, sharp geometry.
   Replaces the periwinkle system. Containers and controls carry a near-black
   edge; separators inside them stay light, or the page becomes a grid of
   black lines. Panels have no shadow — the border is the structure.
   ========================================================================== */

/* Containers read as drawn boxes, not floating cards. */
.card,
.metric,
.table-wrap {
  border-color: var(--rule-strong);
  box-shadow: var(--shadow-card);
}
/* Nested regions and table rows stay flat and separate with rules — only
   top-level panels lift. */
.card .card,
.card .table-wrap { box-shadow: none; }

/* Column headers: sentence case. Tracked-out caps is the loudest
   "assembled from a template" tell in a data table, and it costs
   legibility at 11px for nothing. */
.ledger thead th {
  text-transform: none;
  letter-spacing: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-soft);
}

/* Data is mono: case numbers, emails, roles — anything machine-issued or
   columnar. Names stay in the body face; they are language, not data. */
.ledger__candidate-email,
.ledger--candidates td[data-label="Role"],
#bgv-ledger td[data-label="Role"] {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: -0.01em;
}

/* Denser rows — 48px rather than 64px. */
.ledger tbody td { padding-top: 12px; padding-bottom: 12px; }

/* Hover is a firm tint, not an inversion: the discrepancy edge and the
   status badges both sit inside the row, and inverting the row washes out
   exactly the two signals this table exists to surface. */
.ledger tbody tr.is-clickable:hover > td { background: var(--surface); }

/* Status marks: a thin edge and the status's own ink, no flat colour fill.
   "Documents received" should register, not shout. */
.stamp {
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  background: transparent;
  font-weight: 600;
}
.stamp--green  { color: var(--green-ink); }
.stamp--brass  { color: var(--brass-ink); }
.stamp--amber  { color: var(--amber-ink); }
.stamp--brick  { color: var(--brick-ink); }
.stamp--gray,
.stamp--neutral { color: var(--ink-soft); }

/* "Not decided" is an absence, not a status — an outlined control, in the
   page's own ink rather than a status colour. */
#bgv-ledger td[data-label="Decision"] .stamp--neutral {
  border-color: var(--rule-mid);
  color: var(--ink-soft);
  padding: 4px 10px;
}

/* Exception-first: a case whose verdict is a discrepancy carries the same
   brick edge an overdue case does, so the two kinds of "look at this" read
   as one channel. */
/* The whole row, not a stripe on its edge — a table row has no sensible
   "full border", so the tint is the row-level equivalent. */
#bgv-ledger tbody tr.bgv-row--discrepancy > td {
  background: color-mix(in srgb, var(--brick) 6%, var(--paper-raised));
}

/* Ready-to-start queue: a neutral edge, deliberately NOT indigo — indigo
   stays the exclusive signal for AI-authored content (match score, AI
   assessment, the AI badge), and this queue is eligibility, not AI output. */
.page--bgv .bgv-ready { border: 1px solid var(--ink); }

/* Case numbers are addressable: mono, and clickable with their full
   reference on hover. */
.bgv-mono { font-family: var(--font-mono); font-size: var(--text-xs); }

/* Editorial paper texture — a dot matrix at 2%, on its own fixed layer so
   it reads as the sheet rather than as scenery that scrolls, and so the
   opacity applies to the dots alone rather than to anything above them. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(var(--ink) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.02;
}

/* "Start verification" reveals an arrow on hover rather than carrying one
   permanently — a "→" baked into button text is chrome; one that appears on
   intent is feedback. Transform/opacity only, and it simply doesn't move
   under reduced motion. */
.page--bgv .bgv-ready .file-row button { position: relative; padding-right: 30px; }
.page--bgv .bgv-ready .file-row button::after {
  content: "→";
  position: absolute;
  right: 12px;
  opacity: 0;
  transform: translateX(-4px);
}
@media (prefers-reduced-motion: no-preference) {
  .page--bgv .bgv-ready .file-row button::after {
    transition: opacity 180ms var(--ease-standard), transform 180ms var(--ease-standard);
  }
}
.page--bgv .bgv-ready .file-row button:hover::after,
.page--bgv .bgv-ready .file-row button:focus-visible::after {
  opacity: 1;
  transform: translateX(0);
}

/* The case number is the case's address — clickable, and it carries its own
   metadata on hover via the native title tooltip (bgv.js supplies the text). */
#bgv-ledger .bgv-mono[title] {
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule-mid);
}

/* ==========================================================================
   Settings — "precision instrument" pass
   A control panel, not a consumer settings screen: an off-white navigation
   rail, section blocks bounded top and bottom only, mechanical toggles, and
   status carried by a dot plus a word rather than by coloured text.
   Colours map onto the existing ramp and status tokens — the brief names
   raw hex values, but re-introducing fifteen of them is the drift this
   stylesheet was normalized to remove.
   ========================================================================== */

/* --- navigation rail ---------------------------------------------------- */

.settings-layout { grid-template-columns: 240px 1fr; gap: 0; }

.settings-nav {
  gap: 0;
  padding: var(--space-xs) 0;
  background: var(--paper);
  border-right: 1px solid var(--rule);
  min-height: 100%;
}

.settings-nav__item {
  height: 40px;
  padding: 0 var(--space-md);
  justify-content: flex-start;
  border: 0;
  /* A rail item is a destination marker, not a button — the active one is
     marked at its edge rather than filled, so the rail stays quiet and the
     content area keeps the page's only solid black. */
  border-left: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--ink-soft);
  font-weight: 400;
  text-align: left;
}
.settings-nav__item:hover { background: none; color: var(--ink); }
.settings-nav__item.is-active {
  background: var(--surface);
  border-left-color: var(--ink);
  color: var(--ink);
  font-weight: 500;
}

/* --- content ------------------------------------------------------------ */

.page--settings .settings-panels { padding: var(--space-xl) var(--space-xxl); max-width: 1200px; }

/* Section blocks, not cards: bounded top and bottom so they read as bands
   of one continuous page. Left and right borders would make them cards
   again, which is the pattern this brief is written against. */
.page--settings .card {
  padding: var(--space-xl);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  box-shadow: var(--shadow-card);
  margin: 0;
}
.page--settings .card + .card { margin-top: var(--space-lg); }

.page--settings .section-label {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

/* --- status --------------------------------------------------------------
   A dot plus a word. The connected state no longer gets a tinted pill of
   its own: three states that look like three different kinds of object are
   harder to scan than three states that differ only by the colour of an
   8px dot. */

.page--settings .status-text {
  gap: var(--space-xs);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--ink);
  background: none;
  padding: 0;
  border-radius: 0;
}
/* flex: none is load-bearing — the dot is a flex child of an inline-flex
   row, so without it a long status string squeezes the dot from 8px to
   under 3px and the colour signal all but disappears. */
.page--settings .status-text::before { width: 8px; height: 8px; flex: none; }
.page--settings .status-text--green::before   { background: var(--green); }
.page--settings .status-text--brick::before   { background: var(--brick); }
.page--settings .status-text--neutral::before { background: var(--ink-400); }

/* Errors read as system output, not as form validation: monospace, on a
   faint tint, with the same thin brick edge used for attention everywhere
   else in this app. */
.page--settings .status-detail:not(:empty) {
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--brick);
  background: var(--brick-bg);
  color: var(--brick-ink);
  font-family: var(--font-mono);
  font-size: var(--text-md);
  line-height: 1.5;
}

/* --- mechanical toggle ---------------------------------------------------
   A square block that snaps between two seats, with the CURRENT state
   spelled out beside it. Two earlier attempts were wrong in ways worth
   recording: a pill with a round sliding knob is the stock component this
   page is trying not to look like, and a two-halves [ON][OFF] control reads
   as a segmented picker offering two choices when it is in fact one
   checkbox — so the half you were not in looked clickable and wasn't.
   Showing one word, the state you are in, removes that ambiguity.

   overflow:hidden is load-bearing: the block is square and the housing is
   rounded, so without it the block's corners sit outside the border. */

.page--settings .switch {
  position: relative;
  display: block;
  width: 52px;
  height: 28px;
  flex: none;
  border: 1px solid var(--rule-mid);
  border-radius: var(--radius-sm);
  background: var(--paper-raised);
  overflow: hidden;
}

/* The block. Square, not a knob. */
.page--settings .switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 2px;
  background: var(--ink-400);
  transform: none;
}

/* The state, in the seat the block is not occupying. */
.page--settings .switch::before {
  content: "OFF";
  position: absolute;
  top: 0;
  right: 5px;
  left: auto;
  display: flex;
  align-items: center;
  width: auto;
  height: 100%;
  border-radius: 0;
  background: none;
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.page--settings input[type="checkbox"]:checked + .switch {
  border-color: var(--ink);
  background: var(--paper-raised);
}
.page--settings input[type="checkbox"]:checked + .switch::after {
  background: var(--ink);
  transform: translateX(24px);
}
.page--settings input[type="checkbox"]:checked + .switch::before {
  content: "ON";
  right: auto;
  left: 6px;
  color: var(--ink);
}

@media (prefers-reduced-motion: no-preference) {
  .page--settings .switch::after {
    transition: transform var(--dur-hover) ease-in-out, background var(--dur-hover) ease-in-out;
  }
}

.page--settings input[type="checkbox"]:focus-visible + .switch {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* The master email switch keeps its heavier reading — this is the one
   decision that governs whether HireFlow emails anyone at all. */
.page--settings #auto_reply_enabled:checked + .switch { border-color: var(--green); }
.page--settings #auto_reply_enabled:checked + .switch::after { background: var(--green); }
.page--settings #auto_reply_enabled:checked + .switch::before { color: var(--green); }

/* --- rows ----------------------------------------------------------------
   File paths and connected inboxes are records, not cards. Divider rules,
   monospace for the machine-issued part, and no badges. */

.page--settings .file-row {
  padding: var(--space-sm) 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: none;
}
.page--settings .file-row__name,
.page--settings .file-row code { font-family: var(--font-mono); font-size: var(--text-md); color: var(--ink); }
/* A file's presence is one word, not a badge. */
.page--settings .file-row .stamp {
  border: 0;
  padding: 0;
  background: none;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
}
.page--settings .file-row .stamp--green { color: var(--green); }

/* --- actions -------------------------------------------------------------
   2px, as the brief specifies — almost sharp, but enough to read as a
   control rather than as a block of colour. */

.page--settings button,
.page--settings .btn { border-radius: var(--radius); }
.page--settings .btn--danger {
  border-color: var(--brick-border);
  color: var(--brick-ink);
  background: var(--paper-raised);
}
.page--settings .btn--danger:hover { background: var(--brick-bg); border-color: var(--brick); }
/* "Connect another inbox" adds something that is not there yet — a dashed
   edge says "empty slot" in a way a solid one does not. */
.page--settings #connect-inbox-btn,
.page--settings #add-user-btn {
  border: 1px dashed var(--rule-mid);
  background: none;
  color: var(--ink);
}
.page--settings #connect-inbox-btn:hover,
.page--settings #add-user-btn:hover { border-color: var(--ink); background: var(--paper); border-style: dashed; }

/* --- progressive disclosure --------------------------------------------- */

.page--settings details > summary { cursor: pointer; font-size: var(--text-md); font-weight: 500; color: var(--ink-600); }
.page--settings details > summary::marker { color: var(--ink-400); }
.page--settings details[open] > summary { margin-bottom: var(--space-sm); }

@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { border-right: 0; border-bottom: 1px solid var(--rule); flex-direction: row; overflow-x: auto; }
  .settings-nav__item { border-left: 0; border-bottom: 2px solid transparent; flex: 0 0 auto; }
  .settings-nav__item.is-active { border-left: 0; border-bottom-color: var(--ink); }
  .page--settings .settings-panels { padding: var(--space-lg) var(--space-md); }
}

/* Coarse pointers get 44px targets, per the brief's accessibility floor. */
@media (pointer: coarse) {
  .page--settings button,
  .page--settings .btn,
  .settings-nav__item { min-height: 44px; }
}

/* ==========================================================================
   Overview — signal discipline
   One row was carrying five parallel signal systems: Status, Stage, a
   status-coloured match number, a source badge, and "No role fit" — three
   of them wearing the same pill as the one real status. Only Status and
   Stage are statuses; the rest are facts about the row and now look like it.
   ========================================================================== */

/* An absence, not a state. */
.ledger__absent { color: var(--ink-400); font-style: normal; }

/* Provenance, as quiet metadata under the address. */
.ledger__source {
  display: block;
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

/* Match is one precise fact, not a number plus a second visualization of
   the same number. Tabular figures keep the percentages easy to scan. */
.ledger__match { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

/* Row actions must be discoverable without requiring hover. The menu itself
   remains collapsed, but its trigger is always present for mouse, keyboard,
   and touch users. */
.ledger tbody .row-menu-trigger { opacity: 1; }

/* A system message, not an alarm. The banner said "something has gone
   badly wrong" in a full red-tinted box for what is usually a routine
   reconnect — the thin --brick edge is the same attention channel used on
   overdue rows, at the same weight. */
.banner {
  border: 1px solid var(--rule);
  border: 1px solid var(--brick);
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: none;
}
.banner strong { color: var(--ink); }
.banner--info { border-left-color: var(--ink); }

/* Hierarchy in the stats row: "Needs review" is the one number that names
   an action, so it carries weight instead of sitting as the fifth of six
   identical tiles. */
.metrics-row { grid-template-columns: 1.4fr repeat(5, minmax(0, 1fr)); }
.metric--attention {
  grid-column: 1;
  grid-row: 1;
  background: var(--paper-raised);
  border-color: var(--ink);
}
.metric--attention .metric__value { font-size: var(--text-4xl); color: var(--ink); }
.metric--attention .metric__label { color: var(--ink-soft); }
@media (max-width: 900px) {
  .metrics-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric--attention { grid-column: auto; grid-row: auto; }
}
@media (max-width: 560px) {
  .metrics-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* A candidate already in background verification. The accent is the same
   attention channel --brick uses for overdue work, in ink rather than
   brick: this is "already in hand", not "something is wrong". Stage is in
   the tooltip; the verdict never appears here — that decision lives on
   /bgv, which is full-access-only. */
.ledger tbody tr.is-in-bgv > td { background: color-mix(in srgb, var(--ink) 4%, var(--paper-raised)); }
.ledger__bgv-tag {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 7px;
  border: 1px solid var(--rule-mid);
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* --- My interviews (a Panel Member's read-only page) -----------------------------------------------------------
   One panel per candidate, closed until opened; an open one lifts with the card shadow. The AI's own words carry the
   one AI hue. */
.interviews__empty { margin: 32px 0; color: var(--ink-soft); }
.interviews__list { display: flex; flex-direction: column; gap: 12px; }
.interview { border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--paper-raised); }
.interview[open] { border-color: var(--rule-mid); box-shadow: var(--shadow-card); }
.interview > summary {
  display: flex; min-height: 72px; padding: 14px 20px; align-items: center; justify-content: space-between;
  gap: 16px; list-style: none; cursor: pointer; border-radius: var(--radius-lg);
}
.interview > summary:hover { background: var(--surface); }
.interview > summary::-webkit-details-marker { display: none; }
.interview > summary::after {
  content: ""; flex: none; width: 8px; height: 8px; margin: 0 4px 3px 4px;
  border: solid var(--ink-soft); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.interview[open] > summary::after { margin-bottom: -3px; transform: rotate(-135deg); }
@media (prefers-reduced-motion: no-preference) {
  .interview > summary::after { transition: transform var(--dur-hover) var(--ease-standard); }
}
.interview > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.interview__identity { flex: 1 1 auto; min-width: 0; }
.interview__identity strong, .interview__identity small { display: block; }
.interview__identity strong { color: var(--ink-800); font-size: var(--text-md); font-weight: 670; }
.interview__identity small { margin-top: 4px; color: var(--ink-soft); font-size: var(--text-xs); overflow-wrap: anywhere; }
.interview__marks { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.interview__score { color: var(--ai-ink); font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 700; }
.interview__body { padding: 18px 20px 20px; border-top: 1px solid var(--rule); }
.interview__summary { max-width: 72ch; margin: 0 0 16px; line-height: 1.55; }
.interview__ai { display: block; margin-bottom: 4px; color: var(--ai-ink); font-size: var(--text-xs); font-weight: 650; }
.interview__facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 24px; margin: 0 0 20px;
  padding: 14px 16px; border-radius: var(--radius); background: var(--surface);
}
.interview__fact dt { color: var(--ink-soft); font-size: var(--text-xs); }
.interview__fact dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.interview__fact--stack dd { font-family: var(--font-mono); font-size: var(--text-sm); }
.interview__heading { margin: 0 0 4px; font-size: var(--text-md); font-weight: 650; }
.interview__feedback { padding: 10px 0; border-top: 1px solid var(--rule); }
.interview__feedback p { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.interview__feedback small, .interview__note { color: var(--ink-soft); font-size: var(--text-xs); }

/* A read-only account (core/access.py's Viewer) is never offered a control that would only be refused. The server
   enforces it; this is the page agreeing. */
body[data-read-only="true"] .js-write { display: none !important; }
body[data-read-only="true"] #delete-selected-btn { display: none !important; }
.role-recruiters-readonly { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); }
