@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* Brand tokens, from the ACS Branding Guideline (Branding 2.0):
   Indigo #551F75, Mauve #805798, Heather #AA8FBA, Cool Grey #DADADA,
   Snow White #F4F4F4, Poppins type. The guideline asks for approved
   colours only and no patterns or gradients. Status colours (green,
   amber, red) are functional and sit outside the brand palette. */
:root {
    --brand-purple: #551f75;
    --brand-purple-dark: #3f1558;
    --brand-lilac: #f1eaf5;
    --brand-lilac-deep: #e5d6ec;
    --brand-mauve: #805798;
    --brand-heather: #aa8fba;
    --brand-cool-grey: #dadada;
    --page-background: #f4f4f4;
    --surface: #ffffff;
    --surface-soft: #faf9fb;
    --design-line: #e7e0eb;
    --design-radius: 12px;
    --design-radius-small: 8px;
    --design-shadow: 0 8px 26px rgba(85, 31, 117, .06);
    --ink: #2f2733;
    --muted: #6b6370;
    --green: #24845c;
    --green-bg: #e8f5ec;
    --amber: #b87918;
    --amber-bg: #fff4df;
    --red: #bc5148;
    --red-bg: #fbeae7;
    --critical: #7a1620;
    --critical-bg: #f6dbdd;
    --oncall: #1b5e8a;
    --oncall-bg: #dfeefb;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-width: 320px;
    background: var(--page-background);
    color: var(--ink);
    font-family: 'Poppins', sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
a { color: var(--brand-purple); }

.app-shell { min-height: 100vh; display: flex; }

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--design-line);
    padding: 28px 16px 18px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.brand { display: block; padding: 0 10px 24px; text-decoration: none; }
.brand-logo { display: block; width: 150px; height: auto; }
.brand-mark {
    width: 40px; height: 40px; flex-shrink: 0;
    background: var(--brand-purple); color: #fff;
    border-radius: 50%; display: grid; place-items: center;
    font-weight: 700; font-size: 15px;
}
.brand span { display: block; color: var(--muted); font-size: 11px; font-weight: 500; margin-top: 10px; letter-spacing: .2px; }

.workspace-label { padding: 0 13px 10px; color: var(--muted); font-size: 11px; letter-spacing: 1.1px; font-weight: 700; text-transform: uppercase; }
.primary-nav { display: grid; gap: 4px; }
.nav-item {
    appearance: none; border: 0; background: transparent;
    color: #6d6870; display: flex; align-items: center; text-align: left;
    gap: 12px; border-radius: var(--design-radius-small); padding: 12px 13px;
    font-size: 13px; font-family: 'Poppins', sans-serif; text-decoration: none;
}
.nav-item:hover, .nav-item.active { background: var(--brand-lilac); color: var(--brand-purple); }
.nav-item.active { font-weight: 700; }
.nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item.nav-subitem { padding-left: 33px; font-size: 12px; }
.nav-item.nav-subitem .nav-icon { width: 15px; height: 15px; }

.nav-group { display: grid; gap: 4px; }
.nav-row { display: flex; align-items: stretch; gap: 2px; }
.nav-row .nav-item { flex: 1; min-width: 0; }
.nav-toggle {
    appearance: none; border: 0; background: transparent; color: #6d6870;
    display: flex; align-items: center; justify-content: center;
    width: 30px; border-radius: var(--design-radius-small); cursor: pointer; flex-shrink: 0;
}
.nav-toggle:hover { background: var(--brand-lilac); color: var(--brand-purple); }
.nav-toggle .chevron { width: 14px; height: 14px; transition: transform 0.15s ease; }
.nav-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.nav-subgroup { display: none; gap: 4px; }
.nav-subgroup.open { display: grid; }

.sidebar-footer { margin-top: auto; display: grid; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 14px 8px 0; border-top: 1px solid var(--design-line); color: var(--muted); }
.user-chip > div:nth-child(2) { flex: 1; min-width: 0; }
.user-chip strong { display: block; font-size: 12px; color: var(--ink); }
.user-chip span { display: block; font-size: 11px; margin-top: 2px; text-transform: capitalize; }
.avatar {
    width: 32px; height: 32px; flex-shrink: 0;
    background: var(--brand-lilac-deep); color: var(--brand-purple);
    border-radius: 50%; display: grid; place-items: center;
    font-size: 11px; font-weight: 700;
}
.logout-form button {
    width: 100%; background: transparent; border: 1px solid var(--design-line);
    color: var(--muted); border-radius: var(--design-radius-small);
    padding: 9px; font-size: 11px;
}
.logout-form button:hover { border-color: var(--brand-lilac-deep); color: var(--brand-purple); }

/* Main content */
.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    min-height: 74px; padding: 14px 42px; background: var(--surface);
    border-bottom: 1px solid var(--design-line); box-shadow: 0 2px 12px rgba(86, 32, 117, .035);
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.crumb { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; }
.crumb strong { color: var(--brand-purple); font-weight: 600; }

.page-wrap { max-width: 1100px; margin: 0 auto; padding: 34px 42px 60px; width: 100%; }
.page-wrap.wide { max-width: 1560px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 26px; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: 1.4px; font-size: 11px; font-weight: 700; color: var(--brand-purple); margin-bottom: 8px; display: block; }
h1 { font: 700 26px 'Poppins', sans-serif; letter-spacing: -.3px; }
h2 { font: 600 15px 'Poppins', sans-serif; }
.page-header p { font-size: 13px; color: var(--muted); margin-top: 6px; }

.portal-footer {
    max-width: 1100px; margin: 0 auto; padding: 20px 42px 28px;
    border-top: 1px solid var(--design-line); display: flex; align-items: center;
    gap: 10px; color: var(--muted); font-size: 11px; flex-wrap: wrap;
}
.portal-footer strong { color: var(--brand-purple); font-size: 11px; }

/* Buttons */
.button {
    border-radius: 24px; border: 1px solid transparent; padding: 11px 18px;
    display: inline-flex; align-items: center; gap: 8px; font-size: 12px;
    font-weight: 700; white-space: nowrap; font-family: 'Poppins', sans-serif;
    text-decoration: none;
}
.button-dark { background: var(--brand-purple); color: #fff; }
.button-dark:hover { background: var(--brand-purple-dark); }
.button-outline { color: var(--brand-purple); background: var(--surface); border-color: var(--brand-heather); }
.button-outline:hover { background: var(--brand-lilac); }
.button[disabled] { opacity: .5; cursor: not-allowed; }

/* Cards / panels */
.summary-grid, .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-card, .summary-card, .panel {
    background: var(--surface); border: 1px solid var(--design-line);
    border-radius: var(--design-radius); box-shadow: var(--design-shadow);
    padding: 18px 20px;
}
.summary-card h2 { margin-bottom: 10px; }
.summary-card p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.summary-card strong { font: 700 22px 'Poppins', sans-serif; color: var(--brand-purple); }

/* Portal module tiles — the homepage's entry points into each section */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 26px; }
.portal-tile {
    display: block; background: var(--surface); border: 1px solid var(--design-line);
    border-radius: var(--design-radius); box-shadow: var(--design-shadow);
    padding: 20px 22px; text-decoration: none; color: inherit;
    transition: border-color .15s ease, transform .15s ease;
}
.portal-tile:hover { border-color: var(--brand-purple); transform: translateY(-2px); }
.portal-tile .tile-icon {
    width: 34px; height: 34px; border-radius: 10px; background: var(--brand-lilac);
    color: var(--brand-purple); display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.portal-tile .tile-icon svg { width: 18px; height: 18px; }
.portal-tile h2 { font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.portal-tile .tile-stat { font-size: 12px; color: var(--muted); }
.portal-tile .tile-link { font-size: 11px; font-weight: 700; color: var(--brand-purple); margin-top: 10px; display: block; }

/* Tables */
.table-panel { background: var(--surface); border: 1px solid var(--design-line); border-radius: var(--design-radius); box-shadow: var(--design-shadow); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left; text-transform: uppercase; letter-spacing: .7px;
    font-size: 11px; font-weight: 700; color: var(--muted); padding: 13px 16px;
    white-space: nowrap; background: var(--surface-soft); color: #8b828f;
}
td { border-top: 1px solid var(--design-line); padding: 13px 16px; font-size: 12px; color: #4b444e; white-space: nowrap; }
tbody tr:hover { background: var(--surface-soft); }
td a { text-decoration: none; font-weight: 600; }

/* Actions register — wraps instead of forcing a horizontal scrollbar;
   table-layout: fixed makes the <th> width attributes actually apply. */
.actions-table { table-layout: fixed; }
.actions-table td, .actions-table th { white-space: normal; word-break: break-word; vertical-align: top; }
.quality-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.quality-dot.green { background: var(--green); }
.quality-dot.amber { background: var(--amber); }
.quality-dot.red { background: var(--red); }
/* Critical never relies on colour alone — always paired with a "Critical"
   text chip wherever it's shown (see .critical-chip), not just this dot. */
.quality-dot.critical { background: var(--critical); box-shadow: 0 0 0 2px var(--critical-bg); }

/* Status pills */
.status-pill { display: inline-flex; align-items: center; justify-content: center; border-radius: 20px; padding: 5px 10px; font-size: 11px; line-height: 1; font-weight: 700; white-space: nowrap; text-transform: capitalize; }
.status-pill.open, .status-pill.amber { color: var(--amber); background: var(--amber-bg); }
.status-pill.closed, .status-pill.green { color: var(--green); background: var(--green-bg); }
.status-pill.overdue, .status-pill.red { color: var(--red); background: var(--red-bg); }
.status-pill.critical { color: var(--critical); background: var(--critical-bg); }
.status-pill.lilac { color: var(--brand-purple); background: var(--brand-lilac); }
.status-pill.grey { color: #6d6870; background: #efeef0; }

.critical-chip { display: inline-flex; align-items: center; gap: 3px; color: var(--critical); background: var(--critical-bg); border-radius: 20px; padding: 3px 9px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.critical-chip::before { content: "\26A0"; }

/* Oncall — a distinct colour from red/amber/green/critical so an
   oncall-coded action reads as "time-boxed and from out of hours,"
   never as "the same as a bad score." */
.chip-oncall { background: var(--oncall-bg); color: var(--oncall); }

/* Category chips */
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; background: var(--brand-lilac); color: var(--brand-purple); border-radius: 20px; padding: 5px 11px; font-size: 11px; font-weight: 600; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .wide-field { grid-column: span 2; }
label { display: grid; gap: 6px; color: #6d6870; font-size: 11px; font-weight: 600; }
input, select, textarea {
    width: 100%; border: 1px solid var(--design-line); border-radius: var(--design-radius-small);
    background: #fff; color: var(--ink); padding: 10px 12px; font-size: 12px;
    outline-color: var(--brand-purple); font-family: 'Poppins', sans-serif;
}
textarea { min-height: 90px; resize: vertical; }
textarea.textarea-compact { min-height: 40px; }
fieldset { border: 1px solid var(--design-line); border-radius: var(--design-radius-small); padding: 12px 14px; }
legend { padding: 0 6px; font-size: 11px; font-weight: 700; color: var(--brand-purple); }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.checkbox-field { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 400; font-size: 12px; }
.checkbox-field input { width: auto; accent-color: var(--brand-purple); }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Auth */
.auth-shell { min-height: 100vh; display: grid; place-items: center; background: var(--page-background); }
.auth-card {
    width: min(380px, 92vw); background: var(--surface); border: 1px solid var(--design-line);
    border-radius: var(--design-radius); box-shadow: var(--design-shadow); padding: 34px 30px; text-align: center;
}
.auth-logo { display: block; width: 190px; height: auto; margin: 0 auto 14px; }
.auth-card h1 { font-size: 18px; }
.auth-card h2 { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 6px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; text-align: left; margin-top: 24px; }
.auth-card .button { justify-content: center; margin-top: 4px; }

.error {
    color: var(--red); background: var(--red-bg); border-radius: var(--design-radius-small);
    padding: 10px 13px; font-size: 12px;
}

/* Case detail: stage timeline */
.stage-timeline { display: grid; gap: 0; }
.stage-step { display: grid; grid-template-columns: 32px 1fr; gap: 14px; padding-bottom: 22px; position: relative; }
.stage-step:not(:last-child)::before {
    content: ''; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--design-line);
}
.stage-marker {
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    font-size: 12px; font-weight: 700; z-index: 1; background: var(--surface-soft); color: var(--muted); border: 2px solid var(--design-line);
}
.stage-step.completed .stage-marker { background: var(--green-bg); color: var(--green); border-color: var(--green-bg); }
.stage-step.current .stage-marker { background: var(--brand-purple); color: #fff; border-color: var(--brand-purple); }
.stage-body { padding-top: 4px; }
.stage-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.stage-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.stage-step.upcoming .stage-title { color: var(--muted); }
.stage-narrative { font-size: 12px; color: #4b444e; margin-top: 10px; line-height: 1.6; white-space: pre-wrap; }
.stage-form { margin-top: 14px; display: grid; gap: 12px; }
.evidence-list { margin-top: 10px; display: grid; gap: 6px; }
.evidence-item { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #574b5b; background: var(--surface-soft); border-radius: var(--design-radius-small); padding: 8px 10px; }

.related-cases-panel ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.related-cases-panel li { border-top: 1px solid var(--design-line); padding-top: 8px; font-size: 12px; }
.related-cases-panel li:first-child { border-top: 0; padding-top: 0; }

.note { color: var(--muted); font-size: 12px; line-height: 1.5; }

@media (max-width: 900px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 14px 16px; }
    .primary-nav { display: flex; overflow-x: auto; }
    .sidebar-footer { display: none; }
    .page-wrap { padding: 24px 18px 40px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .wide-field { grid-column: span 1; }
}

/* Floating panel — stays in view while the page scrolls, for actions that
   can happen at any point in a case's lifecycle rather than at one fixed
   place (e.g. escalations). A native <details> element: no JS needed,
   click the summary to open/close. */
.floating-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 40;
    width: 360px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
    background: var(--surface);
    border: 1px solid var(--design-line);
    border-radius: var(--design-radius);
    box-shadow: 0 16px 48px rgba(86, 32, 117, .22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.floating-panel > summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 12px;
    color: var(--brand-purple);
    background: var(--brand-lilac);
}
.floating-panel > summary::-webkit-details-marker { display: none; }

/* A <summary> styled to look like a button (e.g. a "Not done" toggle
   sitting next to a real button) — list-style alone doesn't remove
   the marker in Chrome/Safari, so both are needed. */
.summary-button { list-style: none; }
.summary-button::-webkit-details-marker { display: none; }

/* Raise-a-case bubble picker — opens inline instead of navigating to a
   separate page; the summary is styled as the trigger button itself. */
.bubble-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.bubble { animation: bubble-in .15s ease; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.floating-panel > summary::before {
    content: '⚠';
    display: inline-grid;
    place-items: center;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--surface);
    font-size: 11px;
}
.floating-panel[open] > summary::after { content: '(click to collapse)'; margin-left: auto; font-weight: 400; color: var(--brand-mauve); font-size: 11px; }
.floating-panel:not([open]) > summary::after { content: '(click to expand)'; margin-left: auto; font-weight: 400; color: var(--brand-mauve); font-size: 11px; }
.floating-panel-badge {
    background: var(--surface);
    color: var(--brand-purple);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}
.floating-panel-body {
    padding: 16px;
    overflow-y: auto;
}

/* Recruitment & Compliance */
.pipeline-board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.pipeline-stage {
    display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--design-line); border-radius: var(--design-radius-small);
    padding: 12px; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none;
}
.pipeline-stage strong { font: 700 20px 'Poppins', sans-serif; color: var(--brand-purple); min-height: 24px; }
.pipeline-stage.active, .pipeline-stage:hover { border-color: var(--brand-purple); background: var(--brand-lilac); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.filter-bar input[type="search"] { width: auto; flex: 1; min-width: 200px; }
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--design-line); border-radius: 20px; padding: 3px; }
.segmented a { padding: 6px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.segmented a.active { background: var(--brand-purple); color: #fff; }
.progress-mini { display: inline-block; width: 60px; height: 6px; background: var(--brand-lilac); border-radius: 3px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.progress-mini span { display: block; height: 100%; background: var(--green); }

.pipeline-stepper { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.pipeline-stepper li { display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); position: relative; }
.pipeline-stepper li:not(:last-child)::after { content: ''; position: absolute; top: 14px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; background: var(--design-line); }
.pipeline-stepper .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--surface-soft); border: 2px solid var(--design-line); }
.pipeline-stepper li.completed .dot { background: var(--green-bg); border-color: var(--green-bg); color: var(--green); }
.pipeline-stepper li.current .dot { background: var(--brand-purple); border-color: var(--brand-purple); color: #fff; }
.pipeline-stepper li.current { color: var(--ink); }

.recruit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.recruit-side .form-grid.single-column, .form-grid.single-column { grid-template-columns: 1fr; }
.next-step { border-left: 4px solid var(--brand-purple); }
.blocker-list { margin: 0 0 4px 18px; font-size: 12px; color: var(--amber); display: grid; gap: 3px; }
.secondary-actions { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--design-line); }
.secondary-actions > details { flex: 1 1 260px; }
details > summary { cursor: pointer; font-size: 11px; font-weight: 600; color: var(--brand-purple); }
details[open] > summary { margin-bottom: 10px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input[type="text"] { width: auto; flex: 1; min-width: 180px; }
.inline-form select { width: auto; }
.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.callout-muted { background: var(--surface-soft); font-size: 12px; }
.record-row { border-top: 1px solid var(--design-line); padding: 10px 0; font-size: 12px; }
.record-row:first-of-type { border-top: 0; padding-top: 0; }
.link-button { background: none; border: 0; padding: 0; color: var(--red); font-size: 11px; cursor: pointer; font-family: inherit; }
.text-red { color: var(--red); }

.check-category { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 16px 0 8px; }
.check-category:first-of-type { margin-top: 0; }
.check-card { border: 1px solid var(--design-line); border-radius: var(--design-radius-small); margin-bottom: 8px; background: var(--surface); }
.check-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; color: var(--ink); font-size: 12px; list-style: none; }
.check-card > summary::-webkit-details-marker { display: none; }
.check-card[open] > summary { margin-bottom: 0; border-bottom: 1px solid var(--design-line); background: var(--surface-soft); border-radius: var(--design-radius-small) var(--design-radius-small) 0 0; }
.check-card:target { border-color: var(--brand-purple); }
.check-meta { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.check-body { padding: 14px; }
.check-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 12px; margin: 0; }
.check-facts dt { color: var(--muted); font-weight: 600; font-size: 11px; }
.check-facts dd { margin: 0; overflow-wrap: anywhere; }
.gap-warning { background: var(--amber-bg); color: var(--amber); border-radius: var(--design-radius-small); padding: 10px 13px; font-size: 12px; margin-bottom: 12px; }
.gap-warning ul { margin: 6px 0 0 18px; }
.activity-log { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 12px; max-height: 520px; overflow-y: auto; }
.activity-log li { border-top: 1px solid var(--design-line); padding-top: 8px; display: grid; gap: 2px; }
.activity-log li:first-child { border-top: 0; padding-top: 0; }
.activity-log strong { text-transform: capitalize; }

@media (max-width: 1100px) {
    .recruit-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .pipeline-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pipeline-stepper { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px; }
    .pipeline-stepper li::after { display: none; }
    .check-card > summary { flex-direction: column; align-items: flex-start; }
}

/* Candidate link: staff side */
.link-reveal { background: var(--green-bg); border-radius: var(--design-radius-small); padding: 12px 14px; margin-bottom: 14px; display: grid; gap: 6px; font-size: 12px; }
.link-reveal input { font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.inline-label { display: flex; align-items: center; gap: 8px; }
.candidate-said { background: var(--brand-lilac); border-radius: var(--design-radius-small); padding: 10px 12px; margin-bottom: 10px; font-size: 12px; display: grid; gap: 6px; justify-items: start; }

/* Candidate link: the candidate's own page (/apply/<token>) */
.apply-shell { min-height: 100vh; background: var(--page-background); }
.apply-header { display: flex; align-items: center; gap: 12px; padding: 16px 24px; background: var(--surface); border-bottom: 1px solid var(--design-line); }
.apply-header strong { display: block; font-size: 13px; color: var(--ink); }
.apply-header span { display: block; font-size: 11px; color: var(--muted); }
.apply-main { max-width: 760px; margin: 0 auto; padding: 28px 16px 60px; display: grid; gap: 16px; }
.apply-intro h1 { font-size: 22px; margin-bottom: 8px; }
.apply-intro p { font-size: 13px; line-height: 1.6; color: #4b444e; margin-bottom: 6px; }
.notice { color: var(--green); background: var(--green-bg); border-radius: var(--design-radius-small); padding: 10px 13px; font-size: 12px; }
.apply-progress { display: flex; flex-wrap: wrap; gap: 6px; }
.apply-progress a { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--design-line); border-radius: 20px; padding: 6px 12px; font-size: 11px; font-weight: 600; color: var(--brand-purple); text-decoration: none; }
.apply-section h2 { margin-bottom: 8px; }
.apply-section > .note { margin-bottom: 14px; line-height: 1.6; font-size: 12px; }
.apply-subform { border-top: 1px solid var(--design-line); padding-top: 14px; margin-top: 14px; }
.apply-subform h3 { font-size: 13px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.apply-history { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.apply-history li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; background: var(--surface-soft); border-radius: var(--design-radius-small); padding: 10px 12px; font-size: 12px; }
.apply-doc { border-top: 1px solid var(--design-line); padding: 14px 0 4px; display: grid; gap: 8px; }
.apply-doc:first-of-type { border-top: 0; padding-top: 0; }
.apply-doc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.apply-doc input[type="file"] { width: auto; flex: 1; min-width: 200px; }
@media (max-width: 600px) {
    .apply-header { padding: 14px 16px; }
    .apply-doc-head { flex-direction: column; align-items: flex-start; }
}

/* Settings > Recruitment / Compliance */
.settings-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.settings-jump a { background: var(--surface); border: 1px solid var(--design-line); border-radius: 20px; padding: 6px 12px; font-size: 11px; font-weight: 600; color: var(--brand-purple); text-decoration: none; }
.settings-section { margin-bottom: 22px; scroll-margin-top: 16px; }
.settings-section > h2 { margin-bottom: 6px; }
.settings-section > .note { margin-bottom: 14px; line-height: 1.6; }
.row-muted { opacity: .6; }
.field-label { display: block; color: #6d6870; font-size: 11px; font-weight: 600; }

/* Referee form (/reference/<token>) */
.mode-choice { display: grid; gap: 8px; margin-bottom: 6px; }
.ref-heading { font-size: 13px; margin: 20px 0 10px; }
body[data-mode="upload"] .form-only { display: none; }
body[data-mode="upload"] .upload-optional { display: none; }
.ref-question { display: grid; }

/* References: staff panel and queue */
.reference-panel { display: grid; gap: 10px; margin-bottom: 10px; }
.reference-referee { font-size: 12px; }
.reference-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; }
.reference-state p { flex-basis: 100%; }
.reference-response { background: var(--surface-soft); border-radius: var(--design-radius-small); padding: 12px; font-size: 12px; }
.reference-response .check-facts { grid-template-columns: minmax(140px, 40%) 1fr; }
.reference-actions { display: grid; gap: 8px; }
.reference-flag { background: var(--red-bg); color: var(--ink); border-left: 4px solid var(--red); border-radius: var(--design-radius-small); padding: 12px 14px; font-size: 12px; display: grid; gap: 6px; }
.reference-flag > strong { color: var(--red); }
.queue-item { margin-bottom: 12px; }
.queue-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; font-size: 12px; }
.email-preview { display: grid; gap: 8px; margin-top: 12px; }
.email-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; align-items: start; font-size: 11px; color: var(--muted); font-weight: 600; }
.email-row:not(:has(span)) { grid-template-columns: 1fr auto; }
.email-row textarea { font-family: inherit; min-height: 160px; }
@media (max-width: 600px) {
    .email-row { grid-template-columns: 1fr; }
}

/* Summary cards are whole-card links: no underline, lift on hover. */
a.summary-card { text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
a.summary-card:hover { border-color: var(--brand-heather); box-shadow: 0 10px 28px rgba(85, 31, 117, .10); }
a.summary-card h2 { color: var(--brand-purple); }

/* Logo symbol in the candidate and referee page headers. */
.brand-symbol { width: 36px; height: 36px; flex-shrink: 0; object-fit: contain; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Sign-off review (recruitment) */
.signoff-panel { border-left: 4px solid var(--brand-heather); }
.signoff-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.signoff-sub { font-size: 13px; margin: 18px 0 8px; color: var(--brand-purple); }
.signoff-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.signoff-checklist li { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; font-size: 12px; align-items: baseline; }
.signoff-checklist li.done .tick { color: var(--green); font-weight: 700; }
.signoff-checklist li.open .tick { color: var(--amber); font-weight: 700; }
.concern-card { border: 1px solid var(--design-line); border-radius: var(--design-radius-small); padding: 12px 14px; margin-bottom: 10px; }
.concern-card.pending { border-left: 4px solid var(--amber); }
.concern-card.decided { border-left: 4px solid var(--brand-heather); }
.concern-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.concern-title { display: block; font-size: 13px; margin: 6px 0 2px; }
.concern-decision { margin-top: 8px; font-size: 12px; display: grid; gap: 4px; }
.concern-form { margin-top: 8px; }
.concern-form summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--brand-purple); }
.concern-form form { margin-top: 10px; display: grid; gap: 10px; }
.concern-form label, .signoff-panel form label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; }
.signoff-panel textarea, .signoff-panel input[type=text], .signoff-panel select { width: 100%; }
.inline-check { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.inline-check input { width: auto; }
.senior-chip { background: var(--red-bg); color: var(--red); margin-left: 4px; }
.raise-concern { margin-top: 4px; }
.signoff-record { font-size: 12px; display: grid; gap: 4px; background: var(--surface-soft); border-radius: var(--design-radius-small); padding: 10px 12px; }
.signoff-panel .status-pill { text-transform: none; }

/* Induction feedback and candidate updates (recruitment) */
.feedback-card { border: 1px solid var(--design-line); border-radius: var(--design-radius-small); padding: 12px 14px; margin-bottom: 10px; font-size: 12px; display: grid; gap: 6px; }
.feedback-card.needs_support { border-left: 4px solid var(--red); }
.feedback-card.on_track { border-left: 4px solid var(--amber); }
.feedback-card.confident { border-left: 4px solid var(--green); }
.feedback-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.feedback-card .status-pill, #updates .status-pill { text-transform: none; }
.candidate-request { background: var(--amber-bg); border-radius: var(--design-radius-small); padding: 10px 12px; margin: 8px 0; font-size: 12px; display: grid; gap: 6px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input[type=text] { flex: 1; }
.update-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.email-preview { background: var(--surface-soft); border-radius: var(--design-radius-small); padding: 10px 12px; margin-top: 8px; font-size: 12px; }
.email-preview pre { white-space: pre-wrap; font: inherit; margin: 8px 0 0; }
.candidate-request-banner { border-left: 4px solid var(--amber); }
.progress-steps { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.progress-steps li { font-size: 13px; color: var(--muted); padding-left: 22px; position: relative; }
.progress-steps li::before { content: '○'; position: absolute; left: 0; }
.progress-steps li.done { color: var(--green); }
.progress-steps li.done::before { content: '✓'; }
.progress-steps li.current { color: var(--brand-purple); font-weight: 700; }
.progress-steps li.current::before { content: '●'; }

/* New starters (office team handover) */
.starter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.starter-card { border-left: 4px solid var(--design-line); }
.starter-card.needs_support { border-left-color: var(--red); }
.starter-card.on_track { border-left-color: var(--amber); }
.starter-card.confident { border-left-color: var(--green); }
.starter-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.starter-top h2 { font-size: 15px; margin-bottom: 2px; }
.starter-top h2 a { text-decoration: none; }
.starter-training { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.starter-training li.done { color: var(--green); }
.starter-feedback { margin-top: 12px; display: grid; gap: 6px; font-size: 12px; }
.starter-card .status-pill { text-transform: none; }
.add-reference { margin-top: 14px; border-top: 1px solid var(--design-line); padding-top: 10px; }

/* Documents to sign */
.doc-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--design-line); }
.doc-main { display: grid; gap: 3px; font-size: 12px; }
.doc-main strong { font-size: 13px; }
.doc-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.doc-actions .status-pill { text-transform: none; }
.doc-approve, .doc-send { display: grid; gap: 8px; margin: 0 0 10px; }
.doc-send .inline-form { flex-wrap: wrap; }
.sign-document { white-space: pre-wrap; font-size: 14px; line-height: 1.7; }
.sign-pad-wrap { display: grid; gap: 6px; margin: 12px 0; }
.sign-pad { width: 100%; height: 200px; border: 2px dashed var(--brand-heather); border-radius: var(--design-radius-small); background: #fff; touch-action: none; }

/* Recruiter: worklists, pre-screen and application form (migration 062) */
[hidden] { display: none !important; }
.form-grid > label { align-content: start; }
.recruit-main { display: flex; flex-direction: column; }
.recruit-main > .next-step { order: -3; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head .status-pill, .next-action, .flag-list .status-pill { text-transform: none; }
.plain-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; font-size: 12px; }
.input-short { width: 110px; }
.input-medium { width: 200px; max-width: 100%; }

.worklist-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.worklist-card {
    display: grid; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--design-line);
    border-left: 4px solid var(--brand-purple); border-radius: var(--design-radius); box-shadow: var(--design-shadow); text-decoration: none; color: var(--ink);
}
.worklist-card strong { font: 700 26px 'Poppins', sans-serif; color: var(--brand-purple); line-height: 1.1; }
.worklist-card .worklist-title { font-size: 13px; font-weight: 600; }
.worklist-card.empty { border-left-color: var(--design-line); }
.worklist-card.empty strong { color: var(--muted); }
.worklist-card.active, .worklist-card:hover { background: var(--brand-lilac); border-color: var(--brand-purple); }
a.next-action { text-decoration: none; }
a.next-action:hover { filter: brightness(.96); }

.contact-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.quick-log { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.quick-log button {
    border: 1px solid var(--brand-heather); background: var(--surface); color: var(--brand-purple); border-radius: 20px;
    padding: 6px 11px; font-size: 11px; font-weight: 600;
}
.quick-log button:hover { background: var(--brand-lilac); }
.contact-log { list-style: none; padding: 0; margin: 0 0 4px; display: grid; gap: 6px; font-size: 12px; }
.contact-log li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.contact-log .status-pill { text-transform: none; }
.message-box { margin-top: 12px; }
.message-template { display: grid; gap: 6px; margin-bottom: 12px; }
.message-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; }
.message-template textarea, .link-reveal textarea { font-size: 12px; line-height: 1.5; min-height: 0; background: var(--surface-soft); }

.prescreen-result, .ps-summary { display: flex; gap: 14px; align-items: flex-start; margin: 14px 0 10px; padding: 12px 14px; background: var(--surface-soft); border-radius: var(--design-radius-small); }
.prescreen-result-text { display: grid; gap: 4px; font-size: 12px; min-width: 0; }
.score-badge { display: grid; place-items: center; align-content: center; width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; border: 3px solid currentColor; background: var(--surface); }
.score-badge strong { font: 700 16px 'Poppins', sans-serif; line-height: 1; }
.score-badge span { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; }
.score-badge.green { color: var(--green); }
.score-badge.amber { color: var(--amber); }
.score-badge.red { color: var(--red); }
.score-badge.grey { color: var(--brand-heather); }
.flag-list { display: grid; gap: 4px; margin-bottom: 12px; font-size: 12px; }
.flag-line { display: block; font-size: 12px; padding: 5px 9px; border-radius: 6px; }
.flag-line.red { color: var(--red); background: var(--red-bg); font-weight: 600; }
.flag-line.amber { color: var(--amber); background: var(--amber-bg); }
.flag-line.grey { color: #6d6870; background: #efeef0; }
.answers-list { grid-template-columns: minmax(160px, 38%) 1fr; margin-bottom: 4px; }
.answers-list dd { white-space: pre-wrap; }
.answers-wrap { margin-top: 4px; }

.prescreen-form { margin-top: 14px; border-top: 1px solid var(--design-line); padding-top: 12px; }
.prescreen-form > summary, .message-box > summary { font-size: 12px; }
.ps-q { display: grid; grid-template-columns: minmax(200px, 40%) 1fr; gap: 6px 16px; padding: 10px 0; border-top: 1px solid var(--design-line); align-items: start; }
.check-category + .ps-q { border-top: 0; padding-top: 2px; }
.ps-q-text { display: grid; gap: 3px; font-size: 12px; }
.ps-q-text strong { color: var(--ink); }
.ps-q-input { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pill-options { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-option { display: inline-flex; cursor: pointer; }
.pill-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.pill-option span {
    border: 1px solid var(--design-line); background: var(--surface); color: #4b444e; border-radius: 20px;
    padding: 7px 12px; font-size: 12px; font-weight: 500; transition: background .1s, border-color .1s;
}
.pill-option:hover span { border-color: var(--brand-heather); }
.pill-option input:checked + span { background: var(--brand-purple); border-color: var(--brand-purple); color: #fff; }
.pill-option input:focus-visible + span { outline: 2px solid var(--brand-purple); outline-offset: 2px; }
.cv-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--design-line); font-size: 12px; }
.cv-row input[type="file"] { width: auto; }

/* Queries to a manager (migration 064) */
.query-thread { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; }
.query-thread li { background: var(--surface-soft); border-radius: var(--design-radius-small); padding: 10px 12px; font-size: 12px; border-left: 3px solid var(--brand-heather); }
.query-thread li.answer { background: var(--green-bg); border-left-color: var(--green); }
.query-thread li.closed { background: #efeef0; border-left-color: #b9b4bd; }
.query-thread p { margin-top: 4px; white-space: pre-wrap; line-height: 1.6; color: var(--ink); }
.query-form { margin-top: 10px; }
.query-form .form-actions { margin-top: 10px; }
.query-new { margin-top: 6px; }

/* Training calendar (migration 063) */
.status-pill.plain { text-transform: none; }
.pre-wrap { white-space: pre-wrap; font-size: 12px; line-height: 1.6; }
.link-button-plain { color: var(--brand-purple); text-decoration: underline; }
.month-heading { margin: 18px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.session-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.session-card {
    display: flex; gap: 14px; align-items: stretch; padding: 14px 16px; background: var(--surface); border: 1px solid var(--design-line);
    border-radius: var(--design-radius); box-shadow: var(--design-shadow); text-decoration: none; color: var(--ink);
}
.session-card:hover { border-color: var(--brand-purple); }
.session-card.today { border-left: 4px solid var(--brand-purple); }
.session-date { display: grid; place-items: center; align-content: center; min-width: 56px; padding: 6px; background: var(--brand-lilac); border-radius: var(--design-radius-small); color: var(--brand-purple); }
.session-date strong { font: 700 22px 'Poppins', sans-serif; line-height: 1; }
.session-date span { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
.session-body { display: grid; gap: 3px; min-width: 0; font-size: 13px; }
.session-counts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; font-size: 12px; }
.date-list { display: grid; gap: 8px; margin-top: 6px; }
.date-row { display: flex; align-items: center; gap: 10px; }
.date-row input { width: 200px; }
.attend-facts dd { font-size: 16px; font-weight: 600; }
.attend-decline > summary { font-size: 14px; padding: 6px 0; }
.attend-decline form { margin-top: 10px; }

/* Candidate application form: one group of questions per page, sized for a phone */
.appform .appform-main { max-width: 620px; gap: 14px; }
.appform-card { padding: 24px 22px; display: grid; gap: 14px; }
.appform-card h1 { font-size: 22px; }
.appform-lead { font-size: 14px; line-height: 1.6; color: #4b444e; }
.appform-sub { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.appform-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; line-height: 1.5; color: #4b444e; }
.appform .note { font-size: 12px; line-height: 1.5; }
.appform input, .appform select, .appform textarea { font-size: 16px; padding: 12px 13px; }
.appform input[type="radio"], .appform input[type="checkbox"] { width: 20px; height: 20px; padding: 0; flex-shrink: 0; accent-color: var(--brand-purple); }
.appform-cta { justify-content: center; padding: 14px 20px; font-size: 15px; width: 100%; }
.appform-actions { display: grid; gap: 10px; margin-top: 6px; }
.appform-later { background: none; border: 0; color: var(--brand-purple); font-size: 13px; font-weight: 600; padding: 6px; text-decoration: underline; }
.appform-tick { width: 52px; height: 52px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: grid; place-items: center; font-size: 26px; font-weight: 700; }
.appform-progress { display: grid; gap: 8px; }
.appform-progress-text { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--muted); }
.appform-progress-text a { color: var(--brand-purple); }
.appform-dots { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.appform-dots li { flex: 1; }
.appform-dots a { display: block; height: 6px; border-radius: 3px; background: var(--brand-lilac-deep); }
.appform-dots li.done a { background: var(--green); }
.appform-dots li.current a { background: var(--brand-purple); }
.appform .q { display: grid; gap: 6px; margin-bottom: 4px; }
.appform .q-label { display: block; font-size: 15px; font-weight: 600; color: var(--ink); padding: 0; line-height: 1.4; }
.appform .q-hint { font-size: 13px; color: var(--muted); line-height: 1.5; }
.appform .req { color: var(--red); }
.appform form { display: grid; gap: 16px; }
.choice-list { display: grid; gap: 8px; margin-top: 4px; }
.choice-list.choice-row { grid-template-columns: 1fr 1fr; }
.choice { display: flex; align-items: center; gap: 12px; border: 1px solid var(--design-line); border-radius: 10px; padding: 13px 14px; background: var(--surface); font-size: 15px; font-weight: 500; color: var(--ink); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--brand-purple); background: var(--brand-lilac); }
.choice.choice-inline { border: 0; padding: 4px 0; background: none; align-items: flex-start; font-size: 14px; line-height: 1.5; font-weight: 400; }
.choice.choice-inline:has(input:checked) { background: none; }
.month-year { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.appform-subform { border-top: 1px solid var(--design-line); padding-top: 16px; }
.appform-subform > fieldset.plain-fieldset { display: grid; gap: 16px; }
.appform .apply-history li { font-size: 14px; }
.review-block { border-top: 1px solid var(--design-line); padding-top: 14px; display: grid; gap: 8px; }
.review-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.review-head a { font-size: 13px; font-weight: 600; }
.review-list { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 0; font-size: 14px; }
.review-list dt { color: var(--muted); font-size: 12px; margin-top: 8px; }
.review-list dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-list dd.review-empty { color: var(--amber); }
.review-list dd.review-blank { color: var(--muted); }
.appform-sign { background: var(--surface-soft); border: 1px solid var(--design-line); border-radius: var(--design-radius-small); padding: 16px; }
.appform .gap-warning { font-size: 14px; display: grid; gap: 6px; line-height: 1.5; }
.appform .gap-warning a { color: inherit; font-weight: 600; }

@media (max-width: 900px) {
    .worklist-grid { grid-template-columns: 1fr 1fr; }
    .ps-q { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .appform-card { padding: 20px 16px; }
    .choice-list.choice-row { grid-template-columns: 1fr; }
}

/* Training: requests for another date, moving people, locations (migration 066) */
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.request-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; font-size: 13px; }
.request-row > div:first-child { display: grid; gap: 4px; }
.request-actions { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.request-actions details summary { cursor: pointer; font-size: 13px; padding: 9px 0; }
.request-actions details[open] summary { padding-bottom: 6px; }

/* Key facts strip on a candidate (migration 067) */
.key-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.key-fact { background: var(--surface); border: 1px solid var(--design-line); border-left: 4px solid var(--design-line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; align-content: start; }
.key-fact.wide { grid-column: span 2; }
.key-fact-label { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.key-fact strong { font-size: 13px; line-height: 1.35; }
.key-fact .note { font-size: 11px; line-height: 1.4; }
.key-fact.red { border-left-color: var(--red); background: var(--red-bg); }
.key-fact.red strong { color: var(--red); }
.key-fact.amber { border-left-color: var(--amber); }
.key-fact.amber strong { color: var(--amber); }
.key-fact.green { border-left-color: var(--green); }
.key-fact.lilac { border-left-color: var(--brand-purple); }
.key-fact.grey strong { color: var(--muted); font-weight: 500; }
.callout-alert { border-left: 4px solid var(--red); background: var(--red-bg); font-size: 13px; }
.flag-line.lilac { color: var(--brand-purple); background: var(--brand-lilac); }
.pitch-box { background: var(--brand-lilac); border-radius: 10px; padding: 12px 14px; margin: 10px 0 14px; font-size: 13px; display: grid; gap: 6px; }
.pitch-box p { margin: 0; line-height: 1.55; }
@media (max-width: 600px) { .key-fact.wide { grid-column: span 1; } }

/* Messages to candidates (migration 068) */
.message-draft { border: 1px solid var(--design-line); border-radius: 10px; padding: 12px 14px; margin-top: 10px; background: var(--surface-soft); display: grid; gap: 6px; }
.message-draft form { display: grid; gap: 8px; }
.message-draft textarea { font-family: inherit; font-size: 13px; line-height: 1.5; width: 100%; }
.message-draft input[type="text"] { font-weight: 600; width: 100%; }
.message-meta { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.message-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.message-actions .quick-log { margin-left: auto; }
.message-history { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; font-size: 13px; }
.message-history li { border-top: 1px solid var(--design-line); padding-top: 6px; }
.message-history summary { cursor: pointer; }
.message-history p.pre-wrap { background: var(--surface-soft); border-radius: 8px; padding: 10px 12px; margin-top: 6px; }
/* Keeps a wide table inside a panel from stretching the whole page on a tablet. */
.recruit-main > * { min-width: 0; }

/* The interview form: a page of its own, sized for a tablet (migration 069) */
.interview-shell { min-height: 100vh; background: var(--surface-soft); }
.interview-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--design-line); font-size: 13px; }
.interview-bar a { font-weight: 600; }
.interview-main { max-width: 860px; margin: 0 auto; padding: 20px 16px 60px; display: grid; gap: 16px; }
.interview-main form { display: grid; gap: 16px; }
.iv-head h1 { font-size: 24px; margin: 4px 0; }
.iv-section h2 { margin-bottom: 4px; }
.iv-q { border-top: 1px solid var(--design-line); padding: 14px 0 4px; display: grid; gap: 8px; }
.iv-section .iv-q:first-of-type { border-top: 0; }
.iv-question { font-size: 16px; font-weight: 600; line-height: 1.4; }
.iv-q textarea { width: 100%; font-family: inherit; font-size: 15px; line-height: 1.5; min-height: 96px; }
.iv-score .pill-option span { padding: 9px 14px; font-size: 13px; }
.iv-answer { background: var(--surface-soft); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.question-row { border-top: 1px solid var(--design-line); padding: 14px 0; }
.settings-section .question-row:first-of-type { border-top: 0; padding-top: 4px; }
@media print {
    .interview-bar, .form-actions, #save-state { display: none; }
    .interview-shell { background: none; }
}
.signature-thumb { display: block; max-height: 54px; max-width: 240px; background: #fff; border: 1px solid var(--design-line); border-radius: 6px; padding: 2px 6px; margin-bottom: 4px; }

/* Importing candidates (migration 071) */
.drop-zone { display: grid; justify-items: center; gap: 8px; padding: 28px 16px; border: 2px dashed var(--brand-heather); border-radius: 14px; background: var(--surface-soft); text-align: center; }
.drop-zone.over { border-color: var(--brand-purple); background: var(--brand-lilac); }
.drop-zone .notice, .drop-zone .error { margin: 0; }
.paste-helper textarea { width: 100%; }

/* Monthly reports */
.trend { font-size: 11px; font-weight: 600; margin-right: 4px; }
.trend.good { color: var(--green); }
.trend.bad { color: var(--red); }
.report-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 22px; }
.report-funnel { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-funnel td { padding: 5px 6px; border: 0; }
.report-funnel td:first-child { width: 38%; }
.report-funnel td:last-child { width: 40px; text-align: right; font-weight: 600; }
.report-funnel .bar { display: block; height: 10px; border-radius: 5px; background: var(--brand-purple); min-width: 2px; }
@media (max-width: 900px) { .report-columns { grid-template-columns: minmax(0, 1fr); } }
@media print {
    .no-print, .sidebar, .portal-sidebar, .portal-footer { display: none !important; }
}

/* Menu sections */
.nav-section { padding: 14px 13px 6px; color: var(--muted); font-size: 10.5px; letter-spacing: 1.1px; font-weight: 700; text-transform: uppercase; }
.primary-nav > .nav-section:first-child { padding-top: 0; }
.case-filter-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.case-filter-form label { flex: 1 1 150px; min-width: 150px; }
.case-filter-form label select, .case-filter-form label input { width: 100%; }
/* Tick boxes and round buttons inside a choice keep their own size wherever the choice is used. */
.choice input[type="radio"], .choice input[type="checkbox"] { width: auto; flex: none; margin: 0; }

/* Questions on a document to sign (partials/doc-form-fields.ejs) */
.doc-question { padding: 12px 0; border-top: 1px solid var(--design-line); }
.doc-question:first-of-type { border-top: 0; }
.doc-question fieldset { border: 0; padding: 0; margin: 0; }
.doc-question legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.doc-question .choice { display: flex; flex-wrap: wrap; gap: 8px 18px; border: 0; padding: 0; background: none; }
.doc-question .choice-stacked { flex-direction: column; align-items: flex-start; }
.doc-question .choice .checkbox-field { margin: 0; font-weight: 500; }
.doc-question .doc-detail { display: block; margin-top: 8px; font-size: 13px; }

/* Interview form: groups of questions the interviewer chooses from (migration 092). */
.iv-group { border-top: 1px solid var(--design-line); margin-top: 14px; padding-top: 10px; }
.iv-group-title { font-size: 14px; margin: 0 0 4px; }
.iv-group-title .note { font-weight: 400; margin-left: 6px; }
.iv-pick { padding: 8px 0; }
.iv-pick-label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.iv-pick-label input[type="checkbox"] { width: 18px; height: 18px; min-width: 18px; margin: 3px 0 0; padding: 0; flex: none; }
.iv-pick-label .iv-question { flex: 1 1 auto; min-width: 0; margin: 0; }
.iv-pick-body { margin: 8px 0 4px 26px; }
.iv-suits { flex: none; white-space: nowrap; }
.iv-suits-care { background: var(--brand-lilac-deep); }
.iv-suits-work { background: var(--brand-lilac); }

/* Risk register (migration 093). */
.status-pill.risk-pill-low { color: var(--green); background: var(--green-bg); }
.status-pill.risk-pill-medium { color: var(--amber); background: var(--amber-bg); }
.status-pill.risk-pill-high { color: #b3540f; background: #ffe6cf; }
.status-pill.risk-pill-critical { color: #fff; background: var(--red); }
.risk-score { display: inline-flex; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.risk-score.risk-low { color: var(--green); background: var(--green-bg); }
.risk-score.risk-medium { color: var(--amber); background: var(--amber-bg); }
.risk-score.risk-high { color: #b3540f; background: #ffe6cf; }
.risk-score.risk-critical { color: #fff; background: var(--red); }
.risk-score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.risk-score-box { border: 1px solid var(--design-line); border-radius: 12px; padding: 14px; display: grid; gap: 8px; align-content: start; }
.risk-score-box h3 { margin: 0; font-size: 14px; }
.risk-score-box label { display: grid; gap: 4px; font-size: 13px; }
.risk-big { font-size: 34px; font-weight: 700; line-height: 1; }
.risk-box-low { background: var(--green-bg); } .risk-box-medium { background: var(--amber-bg); }
.risk-box-high { background: #ffe6cf; } .risk-box-critical { background: var(--red-bg); }
.risk-live { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-radius: 8px; background: #efeef0; }
.risk-live strong { font-size: 22px; }
.risk-live-low { background: var(--green-bg); color: var(--green); } .risk-live-medium { background: var(--amber-bg); color: var(--amber); }
.risk-live-high { background: #ffe6cf; color: #b3540f; } .risk-live-critical { background: var(--red); color: #fff; }
.risk-control { border-top: 1px solid var(--design-line); padding: 12px 0; }
table.risk-heat { border-collapse: separate; border-spacing: 5px; min-width: 620px; }
table.risk-heat th { font-size: 12px; font-weight: 600; text-align: center; background: none; border: 0; padding: 4px 6px; }
table.risk-heat td { padding: 0; border: 0; }
.risk-cell { display: grid; place-items: center; gap: 2px; padding: 12px 6px; border-radius: 10px; text-decoration: none; border: 1px solid transparent; opacity: 0.55; }
.risk-cell strong { font-size: 18px; } .risk-cell span { font-size: 11px; }
.risk-cell.has-risks { opacity: 1; border-color: currentColor; font-weight: 700; }
.risk-cell-low { color: var(--green); background: var(--green-bg); } .risk-cell-medium { color: var(--amber); background: var(--amber-bg); }
.risk-cell-high { color: #b3540f; background: #ffe6cf; } .risk-cell-critical { color: #9b2c22; background: #f6cfc9; }
.risk-score-box .status-pill { justify-self: start; }
.risk-filter input[type="search"] { flex: 1 1 200px; width: auto; }
.risk-filter select { width: auto; flex: 0 1 190px; }

/* Candidate page: one step at a time. Each section is a row that folds; the
   step in hand is open, finished steps show their result on one line. */
.now-box .eyebrow { margin-bottom: 4px; }
.fold { background: var(--surface); border: 1px solid var(--design-line); border-radius: var(--design-radius); margin-bottom: 8px; min-width: 0; }
.fold > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); border-radius: var(--design-radius); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover { background: var(--surface-soft); }
.fold > summary::after { content: ''; flex: none; width: 7px; height: 7px; margin: 0 4px 3px 2px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.fold[open] > summary::after { transform: rotate(-135deg); margin-bottom: -3px; }
.fold[open] > summary { margin-bottom: 0; border-bottom: 1px solid var(--design-line); border-radius: var(--design-radius) var(--design-radius) 0 0; }
.fold-text { display: grid; gap: 1px; flex: 1; min-width: 0; }
.fold-summary { font-size: 12px; font-weight: 400; color: var(--muted); }
.fold > summary .status-pill { flex: none; text-transform: none; max-width: 55%; white-space: normal; text-align: right; }
.fold-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; line-height: 1; border: 2px solid var(--design-line); background: var(--surface-soft); color: var(--muted); }
.fold-done .fold-mark { background: var(--green-bg); border-color: var(--green-bg); color: var(--green); }
.fold-done .fold-mark::before { content: '\2713'; }
.fold-now .fold-mark { background: var(--brand-purple); border-color: var(--brand-purple); }
.fold-now .fold-mark::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.fold-attention .fold-mark { background: var(--amber-bg); border-color: var(--amber); color: var(--amber); }
.fold-attention .fold-mark::before { content: '!'; font-weight: 700; }
.fold-now { border-left: 4px solid var(--brand-purple); }
.fold-attention { border-left: 4px solid var(--amber); }
.fold-later:not([open]) { background: transparent; border-style: dashed; }
.fold-later:not([open]) .fold-title { color: var(--muted); }
.fold-body { padding: 16px 18px 18px; }
.fold-body > .panel { border: 0; box-shadow: none; padding: 0; margin: 0 !important; background: transparent; border-radius: 0; }
.fold-body > .panel h2 { display: none; }
.fold-group { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 14px 0 8px; }
.fold-tools { display: flex; justify-content: flex-end; margin: -8px 0 8px; }
.fold-tools .link-button { font-size: 12px; }

.recruit-side > .panel { margin-bottom: 12px; padding: 14px 16px; }
.side-fold > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--ink); margin: 0; }
.side-fold > summary::-webkit-details-marker { display: none; }
.side-fold > summary::after { content: ''; flex: none; width: 6px; height: 6px; margin-bottom: 3px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.side-fold[open] > summary::after { transform: rotate(-135deg); margin-bottom: -3px; }
.side-fold > summary > span:first-child { flex: 1; }
.side-fold[open] > summary { margin-bottom: 10px; }
.side-fold[open] .side-phone { display: none; }
.side-contact { display: flex; gap: 8px; margin-bottom: 12px; }
.side-contact .button { flex: 1; text-align: center; }
.recruit-side .key-facts { grid-template-columns: 1fr; gap: 6px; margin: 0; }
.recruit-side .key-fact { padding: 7px 10px; }
.recruit-side .key-fact.wide { grid-column: auto; }
.side-jump { list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; }
.side-jump a { display: flex; align-items: baseline; gap: 8px; padding: 5px 6px; border-radius: 6px; font-size: 12px; color: var(--ink); text-decoration: none; }
.side-jump a:hover { background: var(--surface-soft); }
.side-jump .jump-title { flex: 1; }
.side-jump .note { font-size: 11px; text-align: right; }
.side-jump .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--design-line); align-self: center; }
.side-jump .jump-done .dot { background: var(--green); border-color: var(--green); }
.side-jump .jump-now .dot { background: var(--brand-purple); border-color: var(--brand-purple); }
.side-jump .jump-attention .dot { background: var(--amber); border-color: var(--amber); }
.side-jump .jump-later .jump-title { color: var(--muted); }
@media (min-width: 1101px) {
    .recruit-side { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow-y: auto; }
}
@media (max-width: 1100px) {
    /* On a narrow screen the contact row sits above the work and the rest below it. */
    .recruit-layout { gap: 10px; }
    .recruit-side { display: contents; }
    .recruit-side > .panel { order: 2; margin-bottom: 0; }
    .recruit-side > #details { order: -1; }
}
@media (max-width: 600px) {
    .fold > summary { padding: 11px 12px; gap: 9px; }
    .fold > summary .status-pill { max-width: 46%; }
    .fold-body { padding: 14px 12px 16px; }
}

/* Changing one employment history entry */
.edit-entry { border: 1px solid var(--brand-purple); border-left-width: 4px; border-radius: var(--design-radius-small); padding: 14px 16px; margin-bottom: 14px; background: var(--surface-soft); }
.edit-entry h3 { margin-bottom: 4px; }
.row-editing td { background: var(--brand-lilac); }
.row-actions { white-space: nowrap; }
.row-actions form { display: inline; margin-left: 10px; }
.row-actions a.link-button { font-size: 11px; }

/* References: what the candidate said beside what the referee says */
.claim-box { background: var(--brand-lilac); border-left: 4px solid var(--brand-purple); border-radius: var(--design-radius-small); padding: 12px 14px; margin-bottom: 14px; display: grid; gap: 4px; }
.claim-compare { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--design-line); display: grid; gap: 8px; justify-items: start; }
.claim-compare .table-scroll { width: 100%; }
.claim-compare tr.differs td { background: var(--amber-bg); font-weight: 600; }

/* Reminders due, at the top of the recruitment page */
.reminder-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 7px 0; border-top: 1px solid var(--design-line); font-size: 13px; }
.reminder-line > span:nth-child(2) { flex: 1; min-width: 180px; }
.reminder-line form { margin: 0; }
.reminder-line .link-button { font-size: 12px; }
