/* HireLink prototype design system: Board Pack (navy).
   Every screen opens on a navy masthead (title + key figures); the work sits on a white sheet lifted into it.

   Shared components (reuse these; do not restyle per page):
   Layout   .shell .rail > .rail-inner, .masthead > .masthead-bar (.crumbs .bell .topbar-user) + .masthead-head (.page-title,
            .masthead-figs > .fig[.fig-alert] dt/dd via ctx.setFigures), .content (the white sheet)
            | .public .public-panel .public-main .public-form
            .grid (12 col) + .span-2/3/4/5/6/7/8/9/12, .stack, .cluster, .page-head, .detail-head (HL.ui.detailHead), .panel, .panel-head, .sticky
   Type     .t-title (24) .t-body (16) .t-meta (13) .t-display (30), .serif (kept for names: weight + navy, same face), .muted, .num (lining figures)
   Actions  .btn + .btn-primary (navy) .btn-commit (green) .btn-secondary .btn-quiet .btn-danger .btn-sm .btn-block
            .blocked > .btn[disabled] + .blocked-reason (HL.ui.blocked), .icon-btn, .tag (e.g. "Your firm")
   Forms    .field .label .label-opt .input .hint .field-error, .check .check-grid, .choice-grid .choice, .form-row, .form-actions
            .stepper (ol > li[aria-current=step] / .is-done)
   Data     .tabs [role=tab] + .tab-panel; .table (fixed columns) with tr.is-current, tr[data-href], .cell-truncate, td.num, .table-actions
            .list .list-item.is-unread, .kv, .facts, .meta, .gbar (guarantee length, 3–12 months)
   Status   .pill + .pill-navy/.pill-green/.pill-amber/.pill-red/.pill-neutral (HL.ui.badge picks the tone)
   Signature .intro-stack > .intro-ref + .intro-card (.intro-name at display size), .intro-card-sm (picker card),
            .doc-marks .doc-mark, .contact-reveal > .contact-details + .plate (withheld bar; .is-revealed slides it away)
   Overlay  .dialog (native <dialog>, HL.ui.dialog), .toasts .toast-success/.toast-error/.toast-info, .empty
   Extras   .w-check/.w-xs/.w-sm/.w-md/.w-lg/.w-xl (fixed column widths on <th>), .action-bar, .lock-note,
            .terms > .terms-headline + .terms-rest, .progress > .progress-track > .progress-fill + .progress-ends, .meter
   Match    .match-figure(-lg/-sm) > .match-num + .match-of, .match-row, .match-reasons > .match-reason.is-met/.is-partial/.is-miss,
            .match-note, .match-block, .best-matches, .match-cell, col.col-match
*/

@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../assets/fonts/schibsted-grotesk-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../assets/fonts/schibsted-grotesk-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Navy: the house colour, owning the rail and the masthead */
  --navy-900: #0f2547;   /* rail, names, headings */
  --navy-800: #163063;   /* masthead, withheld bar */
  --navy: #1a3a6e;       /* primary buttons, links, focus, current-row rule */
  --navy-hover: #122d58;
  --navy-tint: #e6ecf5;
  --on-navy: #ffffff;
  --on-navy-muted: #b8c5dc;
  --on-navy-line: rgba(255, 255, 255, 0.14);
  --signal: #f0a04b;     /* attention on navy only: count badge, a figure that needs you */
  --marker: #e2654a;     /* the active rail item's marker */

  /* Ground and sheet */
  --ground: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f6f8fb;  /* toolbars, table heads, receded rows, dialog foot */
  --hairline: #dde2ea;
  --hairline-strong: #c3ccd9;
  --ink: #13203a;
  --muted: #45546b;
  --muted-2: #5b6b82;
  --neutral-tint: #e9edf3;

  /* State */
  --green: #2f7d63;
  --green-hover: #266a53;
  --green-ink: #22614c;
  --green-tint: #e2f1ea;
  --amber-ink: #8f4f00;
  --amber-tint: #fcefdb;
  --red-ink: #ad3824;
  --red-tint: #fbe7e2;
  --red-edge: #e6b9ae;

  /* Type: one grotesque; rank from size steps and weight */
  --font: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --fs-mast: 34px;
  --fs-fig: 30px;
  --fs-display: 30px;
  --fs-title: 24px;
  --fs-body: 16px;
  --fs-meta: 13px;
  --lh-title: 1.2;
  --lh-body: 1.5;

  /* Space and grid */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --gutter: 24px;
  --rail-w: 232px;
  --bar-h: 64px;
  --lift: 72px;          /* how far the sheet rises into the masthead */
  --content-max: 1240px;
  --row-h: 52px;
  --control-h: 40px;
  --radius: 6px;
  --radius-lg: 10px;

  /* Depth: navy-tinted, soft, offset downward */
  --shadow-sheet: 0 1px 2px rgba(15, 37, 71, 0.06), 0 24px 48px -30px rgba(15, 37, 71, 0.45);
  --shadow-card: 0 18px 40px -26px rgba(15, 37, 71, 0.5);
  --shadow-pop: 0 28px 60px -24px rgba(15, 37, 71, 0.5);
  --shadow-toast: 0 14px 30px -14px rgba(15, 37, 71, 0.4);
  --focus-ring: 0 0 0 2px #ffffff, 0 0 0 4px var(--navy);
  --focus-ring-navy: 0 0 0 2px var(--navy-800), 0 0 0 4px #ffffff;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-dialog: 200ms;
  --dur-reveal: 320ms;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-dialog: 0ms; --dur-reveal: 0ms; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; scrollbar-color: #b3bfd0 var(--ground); scrollbar-gutter: stable; }
body {
  margin: 0;
  min-width: 1280px;
  font: 400 var(--fs-body) / var(--lh-body) var(--font);
  color: var(--ink);
  background: var(--ground);
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: #c9d7ee; color: var(--navy-900); }
input, textarea { caret-color: var(--navy); }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy-900); }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
[hidden] { display: none !important; }

.icon { width: 20px; height: 20px; flex: none; }
.serif { font-weight: 700; color: var(--navy-900); }
.t-title { font: 700 var(--fs-title) / var(--lh-title) var(--font); letter-spacing: -0.015em; color: var(--navy-900); text-wrap: balance; }
.t-display { font: 700 var(--fs-display) / 1.15 var(--font); letter-spacing: -0.02em; color: var(--navy-900); }
.t-body { font-size: var(--fs-body); }
.t-meta { font-size: var(--fs-meta); line-height: 1.4; }
.muted { color: var(--muted-2); }
.num { font-variant-numeric: lining-nums; white-space: nowrap; }
.prose { max-width: 68ch; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip-link { position: absolute; left: var(--sp-4); top: -60px; z-index: 50; padding: var(--sp-2) var(--sp-4); background: var(--surface); color: var(--navy); font-weight: 600; border-radius: var(--radius); }
.skip-link:focus-visible { top: var(--sp-4); }

/* ---------- App shell: the navy L (rail + masthead) and the white sheet ---------- */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }

.rail { background: var(--navy-900); color: var(--on-navy-muted); }
.rail-inner {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 28px 0 0;
}
.rail-logo { display: block; width: max-content; margin: 0 28px var(--sp-6); border-radius: var(--radius); }
.rail-logo img { width: 96px; height: auto; }
.rail-logo:focus-visible { box-shadow: var(--focus-ring-navy); }
.rail-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.rail-link {
  position: relative; display: block;
  padding: 9px 16px;
  border-radius: var(--radius);
  color: var(--on-navy-muted); font-weight: 600; text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.rail-link:hover { color: var(--on-navy); background: rgba(255, 255, 255, 0.06); }
.rail-link[aria-current="page"] { color: var(--on-navy); background: rgba(255, 255, 255, 0.1); box-shadow: inset 3px 0 0 var(--marker); }
.rail-link:focus-visible { box-shadow: inset 0 0 0 2px var(--on-navy); }
.rail-me {
  margin-top: auto; padding: var(--sp-5) 28px;
  border-top: 1px solid var(--on-navy-line);
  display: flex; flex-direction: column; gap: 2px;
}
.rail-me-name { color: var(--on-navy); font-weight: 600; }
.rail-me-entity { color: var(--on-navy-muted); font-size: var(--fs-meta); }

.frame { display: flex; flex-direction: column; min-width: 0; }

.masthead { background: var(--navy-800); color: var(--on-navy); }
.masthead-bar {
  height: var(--bar-h);
  display: flex; align-items: center; gap: var(--sp-5);
  padding: 0 var(--sp-5) 0 var(--sp-6);
}
.crumbs { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: var(--sp-2); white-space: nowrap; overflow: hidden; font-size: 14px; }
.crumbs a { color: var(--on-navy-muted); text-decoration: none; border-radius: 3px; }
.crumbs a:hover { color: var(--on-navy); text-decoration: underline; }
.crumbs a:focus-visible { box-shadow: var(--focus-ring-navy); }
.crumb-sep { color: rgba(255, 255, 255, 0.35); }
.crumbs .crumb-sep:last-child { display: none; }
.bell {
  position: relative; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--on-navy); border: 1px solid rgba(255, 255, 255, 0.28);
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.bell:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.5); color: var(--on-navy); }
.bell:focus-visible { box-shadow: var(--focus-ring-navy); }
.bell-count {
  position: absolute; top: -6px; right: -8px;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; border: 2px solid var(--navy-800);
  background: var(--signal); color: var(--navy-900);
  font-size: 12px; font-weight: 800; line-height: 18px; text-align: center;
  font-variant-numeric: lining-nums;
}
.topbar-user { display: flex; align-items: center; gap: var(--sp-3); padding-left: var(--sp-5); border-left: 1px solid var(--on-navy-line); }
.topbar-name { font-weight: 600; }
.masthead .btn-quiet { color: var(--on-navy-muted); }
.masthead .btn-quiet:hover { color: var(--on-navy); background: rgba(255, 255, 255, 0.1); }
.masthead .btn-quiet:focus-visible { box-shadow: var(--focus-ring-navy); }

.masthead-head {
  max-width: calc(var(--content-max) + 2 * var(--sp-6));
  padding: var(--sp-2) var(--sp-6) calc(var(--lift) + 28px);
  display: flex; flex-direction: column; gap: 20px;
}
.page-title {
  min-width: 0;
  font: 700 var(--fs-mast) / 1.15 var(--font); letter-spacing: -0.02em;
  color: var(--on-navy);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* .page-title.is-crumb keeps the same size, so moving between screens never shifts the title. */
.masthead-figs { display: flex; flex-wrap: wrap; gap: var(--sp-3) 56px; }
.fig { display: flex; flex-direction: column-reverse; gap: 2px; }
.fig dt { font-size: var(--fs-meta); color: var(--on-navy-muted); }
.fig dd { font-size: var(--fs-fig); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; color: var(--on-navy); }
.fig-alert dd { color: var(--signal); }

.content {
  position: relative;
  width: calc(100% - 2 * var(--sp-5)); max-width: var(--content-max);
  margin: calc(-1 * var(--lift)) var(--sp-5) var(--sp-8);
  padding: var(--sp-5) var(--sp-5) var(--sp-6);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sheet);
}
.content:focus-visible { box-shadow: var(--shadow-sheet); }
@media (max-width: 1399px) {
  :root { --rail-w: 212px; }
  .rail-logo { margin-left: var(--sp-5); }
  .rail-me { padding-left: var(--sp-5); padding-right: var(--sp-5); }
  .content .table th.w-md { width: 136px; } .content .table th.w-lg { width: 192px; }
  .masthead-head { padding-left: var(--sp-5); padding-right: var(--sp-5); }
  .masthead-bar { padding-left: var(--sp-5); }
  .content { width: calc(100% - 2 * var(--sp-4)); margin-left: var(--sp-4); margin-right: var(--sp-4); padding: var(--sp-4) var(--sp-4) var(--sp-5); }
}

/* ---------- Grid and layout ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); align-items: start; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; } .span-12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: var(--sp-5); }
.stack-tight { display: flex; flex-direction: column; gap: var(--sp-2); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.sticky { position: sticky; top: var(--sp-5); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); margin-bottom: var(--sp-5); min-height: var(--control-h); }
.page-head-lead { color: var(--muted); }
.detail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-5); margin-bottom: var(--sp-5); padding-bottom: var(--sp-5); border-bottom: 1px solid var(--hairline); }
.detail-head-text { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.detail-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); color: var(--muted); }
.detail-head-actions { flex: none; display: flex; align-items: center; gap: var(--sp-3); }

.panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: var(--sp-5) var(--sp-5); }
.panel-flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.panel-title { font-size: var(--fs-body); font-weight: 700; color: var(--navy-900); }
.panel-flush > .panel-head { margin: 0; padding: 14px var(--sp-5); border-bottom: 1px solid var(--hairline); }
/* One sheet: inside it, sections are ruled and headed, never boxed. Side columns sit on a flat tint. */
.content .panel { background: transparent; border: 0; border-top: 1px solid var(--hairline); border-radius: 0; padding: var(--sp-5) 0 0; }
.content .panel-flush { padding: 0; overflow: visible; }
.content .panel-flush > .panel-head { padding: var(--sp-4) 0 var(--sp-3); border-bottom: 0; }
.content > .panel:first-child, .content > .stack > .panel:first-child, .content > .grid > [class^="span-"] > .panel:first-child { border-top: 0; padding-top: 0; }
.content aside.panel, .content .panel.sticky { background: var(--surface-2); border: 0; border-radius: var(--radius-lg); padding: var(--sp-5); }
.content form.panel[role="search"] { background: var(--surface-2); border: 0; border-radius: var(--radius-lg); padding: var(--sp-4) var(--sp-5); }
.content .list { border: 0; border-top: 1px solid var(--hairline); border-radius: 0; }
.content .table { border-bottom: 1px solid var(--hairline); }
.section-title { font: 700 var(--fs-body) / 1.4 var(--font); color: var(--navy-900); margin: var(--sp-6) 0 var(--sp-3); }
.section-title:first-child { margin-top: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: var(--control-h); padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--navy); color: var(--on-navy); }
.btn-primary:hover { background: var(--navy-hover); color: var(--on-navy); }
.btn-commit { background: var(--green); color: var(--on-navy); }
.btn-commit:hover { background: var(--green-hover); color: var(--on-navy); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--hairline-strong); }
.btn-secondary:hover { border-color: var(--muted-2); color: var(--ink); background: var(--surface-2); }
.btn-quiet { background: transparent; color: var(--navy); padding: 0 var(--sp-3); }
.btn-quiet:hover { background: var(--navy-tint); color: var(--navy-900); }
.btn-danger { background: var(--surface); color: var(--red-ink); border-color: var(--red-edge); }
.btn-danger:hover { background: var(--red-tint); color: var(--red-ink); }
.btn-on-navy { background: var(--surface); color: var(--navy-900); }
.btn-on-navy:hover { background: var(--navy-tint); color: var(--navy-900); }
.btn-ghost-navy { background: transparent; color: var(--on-navy); border-color: rgba(255, 255, 255, 0.45); }
.btn-ghost-navy:hover { background: rgba(255, 255, 255, 0.1); color: var(--on-navy); }
.btn-sm { height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-meta); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] {
  background: var(--neutral-tint); color: var(--muted-2); border-color: transparent; cursor: not-allowed;
}
.blocked { display: inline-flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.blocked-reason { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-meta); font-weight: 600; color: var(--muted); }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--neutral-tint); color: var(--ink); }
.icon-btn[aria-pressed="true"] { color: var(--navy); }
.tag, .pill { width: max-content; }
.tag {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  height: 24px; padding: 0 var(--sp-2);
  border: 1px solid var(--hairline-strong); border-radius: 4px;
  font-size: var(--fs-meta); font-weight: 600; color: var(--muted); white-space: nowrap;
}

/* ---------- Status pills: a word on its tint ---------- */
.pill {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 10px; border-radius: 4px;
  font-size: var(--fs-meta); font-weight: 700; line-height: 1; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.pill-navy { background: var(--navy-tint); color: var(--navy); }
.pill-green { background: var(--green-tint); color: var(--green-ink); }
.pill-amber { background: var(--amber-tint); color: var(--amber-ink); }
.pill-red { background: var(--red-tint); color: var(--red-ink); }
.pill-neutral { background: var(--neutral-tint); color: var(--muted); }
.text-amber { color: var(--red-ink); font-weight: 700; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.label { font-size: var(--fs-meta); font-weight: 600; color: var(--muted); padding: 0; }
.label-opt { font-weight: 400; color: var(--muted-2); margin-left: var(--sp-1); }
.input {
  width: 100%; min-height: var(--control-h); padding: 7px var(--sp-3);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline-strong); border-radius: var(--radius);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.input:hover { border-color: var(--muted-2); }
.input:focus-visible { border-color: var(--navy); }
.input::placeholder { color: var(--muted-2); }
.input[readonly] { background: var(--surface-2); }
.input[disabled] { background: var(--neutral-tint); color: var(--muted-2); cursor: not-allowed; }
.input[aria-invalid="true"] { border-color: var(--red-ink); }
textarea.input { resize: vertical; line-height: var(--lh-body); }
select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2345546b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
.hint { font-size: var(--fs-meta); color: var(--muted-2); }
.field-error { display: flex; gap: var(--sp-1); font-size: var(--fs-meta); font-weight: 600; color: var(--red-ink); }
.form-stack { display: flex; flex-direction: column; gap: var(--sp-5); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-actions { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-2); }
.form-actions-split { justify-content: space-between; }

.check { display: inline-flex; align-items: flex-start; gap: var(--sp-2); cursor: pointer; flex-wrap: wrap; }
.check > span { flex: 1; min-width: 0; line-height: 1.4; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy); flex: none; }
.check .field-error { flex-basis: 100%; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2) var(--sp-4); padding-top: var(--sp-1); }
input[type="radio"] { accent-color: var(--navy); }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.choice {
  position: relative; display: flex; flex-direction: column; gap: var(--sp-2);
  padding: var(--sp-5); background: var(--surface);
  border: 1px solid var(--hairline-strong); border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.choice:hover { border-color: var(--muted-2); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-title { font: 700 var(--fs-body) / 1.3 var(--font); color: var(--navy-900); padding-right: var(--sp-6); }
.choice-text { font-size: var(--fs-meta); color: var(--muted); }
.choice-mark { position: absolute; top: var(--sp-4); right: var(--sp-4); width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--hairline-strong); display: grid; place-items: center; color: transparent; }
.choice-mark .icon { width: 14px; height: 14px; }
.choice:has(input:checked) { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: #f8fafd; }
.choice:has(input:checked) .choice-mark { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.choice:has(input:focus-visible) { box-shadow: var(--focus-ring); }

.stepper { display: flex; gap: var(--sp-2); counter-reset: step; margin-bottom: var(--sp-6); }
.stepper li { flex: 1; display: flex; flex-direction: column; gap: var(--sp-2); font-size: var(--fs-meta); font-weight: 600; color: var(--muted-2); }
.stepper li::before { content: ""; height: 4px; border-radius: 2px; background: var(--neutral-tint); transition: background-color var(--dur-fast) var(--ease-out); }
.stepper li.is-done { color: var(--muted); }
.stepper li.is-done::before { background: var(--navy); }
.stepper li[aria-current="step"] { color: var(--navy-900); font-weight: 700; }
.stepper li[aria-current="step"]::before { background: var(--navy); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: var(--sp-5); border-bottom: 1px solid var(--hairline); margin-bottom: var(--sp-5); }
.tabs [role="tab"] {
  position: relative; padding: var(--sp-3) 0; margin-bottom: -1px;
  background: none; border: 0; border-bottom: 2px solid transparent;
  font-weight: 600; color: var(--muted-2); cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--navy-900); border-bottom-color: var(--navy); }
.tab-count { margin-left: var(--sp-1); font-size: var(--fs-meta); color: var(--muted-2); font-variant-numeric: lining-nums; }

/* ---------- Tables: fixed column cells, rows restyle in place ---------- */
.table { width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--surface); font-variant-numeric: lining-nums; }
.table th {
  height: 40px; padding: 0 var(--sp-3); text-align: left; vertical-align: middle;
  font-size: 12px; font-weight: 600; color: var(--muted-2); letter-spacing: 0.01em;
  background: var(--surface-2);
  border-bottom: 1px solid var(--hairline); white-space: nowrap;
}
.table td { height: var(--row-h); padding: 10px var(--sp-3); vertical-align: middle; border-bottom: 1px solid #edf0f5; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; }
.table .cell-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .cell-name { font-weight: 600; }
.table .cell-name.serif, .table .serif { font-weight: 700; color: var(--navy-900); }
.table .cell-sub { display: block; font-size: var(--fs-meta); color: var(--muted-2); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-actions { display: flex; justify-content: flex-end; align-items: center; gap: var(--sp-2); }
.table tbody tr { transition: background-color var(--dur-fast) var(--ease-out); }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: #f7f9fc; }
.table td:first-child { position: relative; }
.table tr.is-current td { background: var(--navy-tint); color: var(--ink); }
.table-recede td { background: var(--surface-2); color: var(--muted); }
.table-recede tr.is-current td { color: var(--ink); }
.row-link { color: inherit; text-decoration: none; border-radius: 3px; }
.row-link:hover { color: var(--navy); text-decoration: underline; }

/* Guarantee length as a short ruled bar: 3 to 12 months on a fixed 12-step scale */
.gbar { display: block; position: relative; width: 96px; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--neutral-tint); }
.gbar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--g, 6) / 12 * 100%); border-radius: 2px; background: var(--navy); }

/* ---------- List (notifications, queues) ---------- */
.list { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg); overflow: hidden; }
.list-item {
  position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) 128px 20px; align-items: center; gap: var(--sp-4);
  min-height: 64px; padding: var(--sp-3) var(--sp-5);
  background: var(--surface-2); color: var(--muted);
  border-top: 1px solid var(--hairline); text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.list > li:first-child > .list-item { border-top: 0; }
.list-item:hover { background: var(--surface); color: var(--ink); }
.list-item.is-unread { background: var(--surface); color: var(--ink); }
.list-item.is-unread .list-icon { position: relative; }
.list-item.is-unread .list-icon::after { content: ""; position: absolute; top: 1px; right: 1px; width: 9px; height: 9px; border-radius: 50%; background: var(--navy); box-shadow: 0 0 0 2px var(--surface); }
.list-item:focus-visible { box-shadow: inset 0 0 0 2px var(--navy); }
.list-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--neutral-tint); color: var(--muted); }
.list-item.is-unread .list-icon { background: var(--navy-tint); color: var(--navy); }
.list-text { min-width: 0; }
.list-item.is-unread .list-text { font-weight: 600; }
.list-time { font-size: var(--fs-meta); color: var(--muted-2); text-align: right; white-space: nowrap; font-variant-numeric: lining-nums; }
.list-go { color: var(--muted-2); }
.list-go .icon { width: 18px; height: 18px; }

/* ---------- Key-value, facts, meta ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) var(--sp-4); }
.kv dt { font-size: var(--fs-meta); color: var(--muted-2); align-self: center; }
.kv dd { text-align: right; font-weight: 600; font-variant-numeric: lining-nums; }
.meta { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6); }
.meta div { display: flex; flex-direction: column; gap: 2px; }
.meta dt { font-size: var(--fs-meta); color: var(--muted-2); }
.meta dd { font-weight: 600; }

/* ---------- The profile sheet (referral, entity, candidate): a presented page with a navy head rule ---------- */
.intro-stack { position: relative; }
.intro-ref { margin-bottom: var(--sp-4); font-size: var(--fs-meta); color: var(--muted); }
.intro-ref-name { font: 700 var(--fs-body) / 1.3 var(--font); color: var(--navy-900); }
.intro-card { position: relative; padding: var(--sp-5) 0 0; background: transparent; border-top: 1px solid var(--hairline); }
.intro-name { font: 700 var(--fs-display) / 1.15 var(--font); letter-spacing: -0.02em; color: var(--navy-900); text-wrap: balance; }
.intro-sub { margin-top: var(--sp-1); color: var(--muted); }
.facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--sp-4);
  margin: var(--sp-5) 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}
.tab-panel > .facts:first-child { margin-top: 0; border-top: 0; }
.facts div { padding: var(--sp-3) 0; }
.facts dt { font-size: var(--fs-meta); color: var(--muted-2); }
.facts dd { font-weight: 700; font-size: 17px; color: var(--navy-900); font-variant-numeric: lining-nums; }
.doc-marks { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.doc-mark {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 var(--sp-3);
  background: var(--green-tint); color: var(--green-ink);
  font-size: var(--fs-meta); font-weight: 600; border-radius: 4px;
}
.doc-mark .icon { width: 16px; height: 16px; stroke-width: 2; }
.doc-mark-pending { background: var(--neutral-tint); color: var(--muted); }
.doc-marks-note { margin-top: var(--sp-2); font-size: var(--fs-meta); color: var(--muted-2); }

/* Small picker card (refer picker) */
.intro-card-sm {
  position: relative; display: flex; flex-direction: column; gap: var(--sp-1);
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.intro-card-sm .intro-name { font-size: var(--fs-body); letter-spacing: 0; padding-right: var(--sp-6); }
.intro-card-sm .intro-sub { font-size: var(--fs-meta); margin: 0; }
.intro-card-sm input[type="checkbox"] { position: absolute; top: var(--sp-4); right: var(--sp-4); width: 18px; height: 18px; margin: 0; accent-color: var(--navy); }
.intro-card-sm:hover { border-color: var(--hairline-strong); }
.intro-card-sm:has(input:checked) { border-color: var(--navy); background: #f8fafd; box-shadow: inset 0 0 0 1px var(--navy); }
.intro-card-sm:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.intro-card-sm.is-disabled { background: var(--surface-2); cursor: not-allowed; color: var(--muted); }
.intro-card-sm.is-disabled .intro-name { color: var(--muted); }
.intro-card-reason { margin-top: var(--sp-2); font-size: var(--fs-meta); font-weight: 600; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); }

/* AI match score: the figure over "/100", the band as a word on its pill, plain-word reasons */
.match-figure { white-space: nowrap; color: var(--navy-900); }
.match-figure-lg .match-num { font: 700 var(--fs-title) / var(--lh-title) var(--font); letter-spacing: -0.015em; }
.match-figure-sm .match-num { font: 700 var(--fs-body) / 1.3 var(--font); }
.match-of { font: 600 var(--fs-meta) / 1.4 var(--font); color: var(--muted); }
.match-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.match-reasons { display: flex; flex-direction: column; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; color: var(--ink); }
.match-reason { display: flex; align-items: flex-start; gap: var(--sp-2); }
.match-reason .icon { width: 16px; height: 16px; margin-top: calc((1lh - 16px) / 2); }
.match-reason.is-met .icon { color: var(--green); }
.match-reason.is-partial .icon, .match-reason.is-miss .icon { color: var(--muted-2); }
.match-note { font-size: var(--fs-meta); line-height: 1.4; color: var(--muted-2); }
.match-block { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-5); padding: var(--sp-4); background: var(--surface-2); border-radius: var(--radius); }
.match-cell { justify-content: flex-end; flex-wrap: nowrap; }
.match-block .section-title { margin-bottom: 0; }
.table col.col-match { width: 64px; }
.table td.cell-match { padding-left: var(--sp-1); padding-right: var(--sp-2); }
.best-matches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); }
.intro-card-rank { margin-right: var(--sp-2); color: var(--muted-2); }
.intro-card-sm .match-row { margin-top: var(--sp-3); }
.intro-card-sm .match-reasons { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--neutral-tint); font-size: var(--fs-meta); line-height: 1.4; }

/* The withheld bar: contact details stay under navy until hire. Nothing else uses it. */
.contact-reveal { position: relative; overflow: hidden; margin-top: var(--sp-5); border-radius: var(--radius); }
.contact-details { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); padding: var(--sp-3) var(--sp-4); background: var(--green-tint); border-radius: var(--radius); }
.contact-details dt { font-size: var(--fs-meta); color: var(--green-ink); }
.contact-details dd { font-weight: 700; color: var(--ink); }
.plate {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  min-height: 56px; padding: var(--sp-3) var(--sp-5);
  background: var(--navy-800); color: var(--on-navy); border-radius: var(--radius);
}
.plate-label { display: inline-flex; align-items: center; gap: var(--sp-2); font: 700 var(--fs-body) / 1.2 var(--font); }
.plate-label .icon { width: 18px; height: 18px; }
.plate-note { font-size: var(--fs-meta); font-weight: 700; color: var(--signal); }
.contact-reveal > .plate { position: absolute; inset: 0; transition: clip-path var(--dur-reveal) var(--ease-out), opacity var(--dur-reveal) var(--ease-out); clip-path: inset(0 0 0 0); }
.contact-reveal:not(.is-revealed) > .contact-details { visibility: hidden; }
.contact-reveal.is-revealed > .plate { clip-path: inset(0 0 0 100%); opacity: 0; pointer-events: none; }

/* ---------- Dialog ---------- */
.dialog {
  width: 520px; max-width: calc(100vw - 64px); max-height: calc(100vh - 96px);
  padding: 0; border: 0; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-pop);
}
.dialog-wide { width: 720px; }
.dialog[open] { animation: dialog-in var(--dur-dialog) var(--ease-out); }
.dialog::backdrop { background: rgba(15, 37, 71, 0.5); }
.dialog[open]::backdrop { animation: fade-in var(--dur-dialog) var(--ease-out); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.dialog-form { display: flex; flex-direction: column; max-height: inherit; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-5) var(--sp-5) var(--sp-3); }
.dialog-title { font: 700 18px / 1.3 var(--font); color: var(--navy-900); }
.dialog-body { display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-2) var(--sp-5) var(--sp-5); overflow-y: auto; }
.dialog-foot { display: flex; justify-content: flex-end; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--hairline); background: var(--surface-2); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: var(--sp-4); right: var(--sp-5); z-index: 100; display: flex; flex-direction: column; gap: var(--sp-2); width: 380px; }
.toast {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) 32px; align-items: start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2) var(--sp-3) var(--sp-4);
  border: 1px solid; border-radius: var(--radius);
  box-shadow: var(--shadow-toast);
  animation: dialog-in var(--dur-dialog) var(--ease-out);
}
.toast > .icon { margin-top: 6px; }
.toast-text { padding-top: 4px; font-weight: 600; }
.toast-close { color: inherit; }
.toast-success { background: var(--green-tint); color: var(--green-ink); border-color: #b9dccb; }
.toast-error { background: var(--red-tint); color: var(--red-ink); border-color: var(--red-edge); }
.toast-info { background: var(--surface); color: var(--ink); border-color: var(--hairline-strong); }
.toast-success .toast-close:hover { background: rgba(47, 125, 99, 0.12); color: var(--green-ink); }
.toast-error .toast-close:hover { background: rgba(173, 56, 36, 0.1); color: var(--red-ink); }

/* ---------- Empty state ---------- */
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-4); padding: var(--sp-7) var(--sp-6); background: var(--surface-2); border: 1px dashed var(--hairline-strong); border-radius: var(--radius-lg); }
.empty-text { color: var(--muted); max-width: 60ch; }

/* ---------- Extras ---------- */
.icon-btn[aria-pressed="true"] .icon, .btn[aria-pressed="true"] .icon { fill: currentColor; }
.table th.w-xs { width: 96px; } .table th.w-sm { width: 128px; } .table th.w-md { width: 160px; }
.table th.w-lg { width: 208px; } .table th.w-xl { width: 256px; }
.table th.w-check { width: 56px; }
.table th.w-act { width: 144px; }
/* Tabular digits only where no comma or period sits in the figure (this face gives tnum punctuation full width) */
.match-num, time.num, [data-members] td.num, .tab-count, .meter-text { font-variant-numeric: tabular-nums lining-nums; }
.action-bar {
  position: sticky; bottom: var(--sp-4); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  margin-top: var(--sp-5); padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-5);
  background: var(--navy-800); color: var(--on-navy); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}
.stack > .action-bar { margin-top: 0; }
.action-bar-count { font-weight: 600; color: var(--on-navy); font-variant-numeric: lining-nums; }
.action-bar .btn-primary { background: var(--surface); color: var(--navy-900); }
.action-bar .btn-primary:hover { background: var(--navy-tint); color: var(--navy-900); }
.action-bar .btn:focus-visible { box-shadow: var(--focus-ring-navy); }
.action-bar .btn[disabled] { background: rgba(255, 255, 255, 0.14); color: var(--on-navy-muted); }
.action-bar .blocked-reason, .action-bar .muted, .action-bar .hint { color: var(--on-navy-muted); }
.lock-note { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-meta); font-weight: 600; color: var(--muted); }
.lock-note .icon { width: 16px; height: 16px; }
/* Fee terms in a narrow column (HL.ui.terms): the figure large, the rest beneath */
.terms { display: flex; flex-direction: column; gap: 2px; }
.terms-headline { font: 700 var(--fs-fig) / 1.1 var(--font); letter-spacing: -0.02em; color: var(--navy-900); }
.terms-rest { color: var(--muted); }
/* Guarantee progress: hire date → guarantee end */
.progress { display: flex; flex-direction: column; gap: var(--sp-2); }
.progress-track { height: 6px; background: var(--neutral-tint); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--navy); border-radius: 3px; }
.progress-ends { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-meta); color: var(--muted-2); font-variant-numeric: lining-nums; }
.progress-ends b { display: block; color: var(--ink); font-weight: 600; }
.progress-ends > :last-child { text-align: right; }
.meter { display: inline-flex; align-items: center; gap: var(--sp-3); white-space: nowrap; }
.meter .progress-track { width: 48px; flex: none; }
.meter .progress-fill { display: block; }
.meter-text { font-variant-numeric: lining-nums; }

/* ---------- Public pages: navy panel (5 of 12 columns) + white form column ---------- */
.public { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); min-height: 100vh; background: var(--surface); }
.public-panel {
  grid-column: span 5;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-7);
  padding: var(--sp-7) var(--sp-8) var(--sp-8);
  background: var(--navy-800); color: var(--on-navy-muted);
}
.public-logo { display: block; width: max-content; border-radius: var(--radius); }
.public-logo img { width: 120px; height: auto; }
.public-logo:focus-visible { box-shadow: var(--focus-ring-navy); }
.public-purpose { max-width: 20ch; font: 600 30px / 1.2 var(--font); letter-spacing: -0.02em; color: var(--on-navy); text-wrap: balance; }
.public-main { grid-column: span 7; display: flex; align-items: center; padding: var(--sp-8); background: var(--ground); }
.public-main:focus-visible { box-shadow: none; }
.public-form { width: 100%; max-width: 520px; padding: var(--sp-6); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sheet); }
.public-form-wide { max-width: 640px; }
.public-head { margin-bottom: var(--sp-5); }
.public-head .t-title + p { margin-top: var(--sp-2); color: var(--muted); }
.public-foot { margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--hairline); color: var(--muted); }
.public-panel .btn-on-navy:focus-visible, .public-panel .btn-ghost-navy:focus-visible { box-shadow: var(--focus-ring-navy); }

/* Walkthrough (index): one statement at a time with step dots */
.walk { display: flex; flex-direction: column; gap: var(--sp-6); }
.walk-step { min-height: 236px; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--sp-4); }
.walk-title { font: 700 30px / 1.2 var(--font); letter-spacing: -0.02em; color: var(--on-navy); text-wrap: balance; }
.walk-text { max-width: 40ch; color: var(--on-navy-muted); }
.walk-controls { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.walk-dots { display: flex; gap: var(--sp-1); }
.walk-dot { width: 32px; height: 32px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; border-radius: 50%; }
.walk-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.7); transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), width var(--dur-fast) var(--ease-out); }
.walk-dot:hover::before { border-color: var(--on-navy); }
.walk-dot[aria-current="step"]::before { background: var(--on-navy); border-color: var(--on-navy); width: 22px; border-radius: 5px; }
.walk-dot:focus-visible { box-shadow: 0 0 0 2px var(--on-navy); }
