@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin.9ef356ea553a.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Fraunces;
  src: url("../fonts/fraunces-latin.069cb90e11a3.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page-bg: #f4f4f4;
  --surface: #fff;
  --text: #222222;
  --text-muted: #414141;
  --border: #ccd0d8;
  --control-border: #626879;
  --primary: #003f8b;
  --primary-hover: #004ead;
  --focus: #0d6cdd;
  --bar-bg: #000f46;
  --bar-text: #ffffff;
  --action: #47c8f0;
  --action-hover: #81daf5;
  --tint: #edf5fb;
  --title-font: Fraunces, Georgia, serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font: 1.0625rem/1.5 "Source Sans 3", system-ui, sans-serif;
}
a { color: var(--primary); text-underline-offset: .17em; }
a:hover { color: var(--primary-hover); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.25; overflow-wrap: anywhere; }
h1 { font: 450 clamp(2rem, 3.5vw, 2.875rem)/1.15 var(--title-font); letter-spacing: -.025em; color: var(--bar-bg); }
h2 { color: var(--bar-bg); font-size: 1.375rem; font-weight: 650; letter-spacing: -.018em; }
h3 { font-size: 1.05rem; font-weight: 650; }
.skip-link { position: fixed; z-index: 2; left: 1rem; top: .5rem; padding: .6rem 1rem; background: var(--surface); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
/* Shared workstation header */
.workbar { color: var(--bar-text); background: var(--bar-bg); border-bottom: 3px solid var(--action); }
.bar-inner { display: flex; align-items: center; justify-content: space-between; gap: .375rem 2rem; flex-wrap: wrap; max-width: 90rem; min-height: 5.25rem; margin: 0 auto; padding: .75rem 2rem; }
.bar-start, .user-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; min-width: 0; }
.service-name { display: grid; gap: .2rem; }
.institution { color: #d6e4f1; font-size: .8125rem; line-height: 1.2; }
.centre { font: 440 clamp(1.15rem, 2vw, 1.5rem)/1.2 var(--title-font); }
.bar-start .home-link { margin-left: .5rem; padding-left: 1.5rem; border-left: 1px solid #677390; }
.workbar a, .sign-out { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--bar-text); }
.workbar a:hover, .sign-out:hover { color: var(--action-hover); }
.workbar :focus-visible { outline-color: var(--action-hover); }
.home-link { font-weight: 650; text-underline-offset: .26em; }
.user-tools { font-size: .875rem; }
.operator { overflow-wrap: anywhere; }
.sign-out { padding: .45rem .75rem; border: 1px solid #9da9c3; border-radius: .3rem; background: transparent; }
.main, .sheet-column, .panel { min-width: 0; }
.main { max-width: 90rem; margin: 0 auto; padding: 2.25rem 2rem 3rem; }
.main:focus, .login-main:focus { outline: none; }
.page-heading { margin: 0 0 1.75rem; }
.page-heading p, .heading-meta { margin-top: .5rem; color: var(--text-muted); }
.heading-meta { display: flex; gap: .625rem 1rem; align-items: center; flex-wrap: wrap; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin: 0 0 1.25rem; font-size: .875rem; color: var(--text-muted); }
.breadcrumbs > * + *::before { content: "/"; display: inline-block; margin-right: .65rem; color: var(--control-border); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: .375rem; }
.panel + .panel { margin-top: 1.25rem; }
.section-header { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; padding: 1.2rem 1.5rem; }
.count, .muted { color: var(--text-muted); }
.count { font-size: .875rem; }
.field { min-width: 0; display: flex; flex-direction: column; gap: .375rem; }
label { font-size: .875rem; font-weight: 650; }
input:not([type=hidden]), select, textarea {
  min-width: 0; width: 100%; min-height: 2.75rem; padding: .55rem .75rem; border-radius: .375rem;
  border: 1px solid var(--control-border); color: var(--text); background: var(--surface);
}
input::placeholder { opacity: 1; color: var(--text-muted); }
.button { display: inline-flex; min-height: 2.75rem; align-items: center; justify-content: center; padding: .55rem 1.05rem; font-size: .9375rem; line-height: 1.3; font-weight: 650; text-decoration: none; border: 1px solid transparent; border-radius: .375rem; }
.primary { background: var(--action); color: var(--bar-bg); }
.primary:hover { background: var(--action-hover); color: var(--bar-bg); }
.subtle { background: var(--surface); border-color: var(--control-border); color: var(--text); }
.subtle:hover { background: var(--page-bg); color: var(--text); }
.search-form { display: flex; align-items: end; flex-wrap: wrap; gap: .875rem; padding: 1.5rem; border-bottom: 1px solid var(--border); }
.search-form .field:first-child { flex: 2 1 16rem; }
.search-form .field:nth-child(2) { flex: 1 1 8rem; }
.clear-filters, .inline-action { font-size: .875rem; font-weight: 600; }
.inline-action { position: relative; }
.clear-filters, .inline-action, .job-link { display: inline-flex; min-height: 2.75rem; align-items: center; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.table-scroll:focus-visible { outline-offset: -3px; }
table { width: 100%; border-spacing: 0; border-collapse: collapse; font-size: .875rem; text-align: left; }
thead { background: var(--bar-bg); }
thead th { font-size: .8125rem; font-weight: 650; color: #fff; }
td, th { padding: .8rem 1rem; border-top: 1px solid var(--border); overflow-wrap: anywhere; vertical-align: middle; }
td:first-child, th:first-child { padding-left: 1.5rem; }
td:last-child, th:last-child { padding-right: 1.5rem; }
tbody th { font-weight: 600; }
tbody tr:nth-child(even) { background: #f7f8fa; }
tbody tr:hover { background: var(--tint); }
.job-link { align-items: start; justify-content: center; flex-direction: column; gap: .1rem; text-decoration: none; }
.job-link > span:last-child { text-decoration: underline; }
.record-ref { display: block; color: var(--text-muted); font-size: .8125rem; font-weight: 500; white-space: nowrap; }
.status { display: inline-block; width: max-content; max-width: 100%; border-radius: 1rem; padding: .2rem .65rem; font-size: .8125rem; font-weight: 600; color: #334155; background: #f1f5f9; }
.status-submitted { color: #334155; background: #edf1f6; }
.status-in_progress { color: #1e40af; background: #eff6ff; }
.status-completed { color: #166534; background: #f0fdf4; }
.status-cancelled { color: #7a3425; background: #f9eee9; }
.pagination { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: flex-end; padding: 1rem 1.5rem; border-top: 1px solid var(--border); font-size: .875rem; }
.empty-state { padding: 1.5rem; border-top: 1px solid var(--border); }
.empty-state p, .panel-body > .muted { margin-top: .5rem; }
.empty-state p:first-child { margin-top: 0; }
.panel-body { padding: 1.5rem; }
.details-grid, .stacked-details { margin-top: 1.25rem; }
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 1.35rem; }
.full-width { grid-column: 1 / -1; }
dt { color: var(--text-muted); font-size: .875rem; font-weight: 600; }
dd { margin-top: .3rem; overflow-wrap: anywhere; }
.preserve { white-space: pre-line; overflow-wrap: anywhere; }
.sheet-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.scope-panel { border-top: 3px solid var(--primary); }
.scope-text { font-size: 1.25rem; line-height: 1.45; font-weight: 600; letter-spacing: -.015em; }
.stacked-details > div + div { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.login-main { padding: clamp(2rem, 8vh, 6rem) 1rem; }
.login-card { width: min(100%, 30rem); margin: 0 auto; border: 1px solid var(--border); border-top: 4px solid var(--bar-bg); background: var(--surface); }
.login-content { padding: clamp(1.25rem, 4vw, 2.5rem); }
.login-content > p { margin: .5rem 0 1.5rem; color: var(--text-muted); }
.login-content form { display: grid; gap: 1rem; }
.login-content .button { margin-top: .375rem; }
.form-alert { border: 1px solid #b42318; border-radius: .375rem; background: #fef2f2; padding: .875rem 1rem; color: #8d1a12; }
.form-alert ul { margin: .375rem 0 0; padding-left: 1.25rem; }
.field-errors { color: #a11b11; font-size: .875rem; }
.field-help { color: var(--text-muted); font-size: .875rem; }
/* Task home and assisted intake */
.home-content { max-width: 66rem; margin: clamp(0rem, 2.5vw, 2rem) auto 0; }
.task-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 1rem; }
.task { display: flex; gap: 1rem; align-items: center; min-height: 8rem; padding: 1.5rem; border: 1px solid var(--border); border-top: 3px solid var(--bar-bg); background: var(--surface); color: var(--text); text-decoration: none; }
.task:hover { border-color: var(--primary); background: var(--tint); }
.task:hover strong { text-decoration: underline; }
.task:focus-visible { outline-offset: -3px; }
.task-icon { display: grid; flex: 0 0 2.8rem; height: 2.8rem; place-items: center; color: var(--primary); background: var(--tint); border-radius: .325rem; }
.task-icon svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.task-description { display: grid; gap: .25rem; }
.task-description strong { color: var(--primary); font-size: 1.25rem; }
.task-description span { font-size: .9375rem; color: var(--text-muted); }
.task-arrow { margin-left: auto; font-size: 1.3rem; color: var(--primary); }
.sheet-action { margin-top: 1rem; }
.form-page { max-width: 58rem; margin-inline: auto; }
.form-grid { margin-top: 1.2rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.form-help { color: var(--text-muted); margin: .5rem 0 1.25rem; }
.intake-guidance { margin: 1rem 0; padding: .75rem 1rem; border-left: 3px solid var(--primary); background: var(--tint); }
.intake-guidance p { margin-top: .25rem; }
.form-alert + .panel { margin-top: 1rem; }
.field textarea { height: 4.6rem; resize: vertical; }
.required-mark { color: #a11b11; }
.item-entry { min-width: 0; padding: .8rem 1rem 1rem; margin: 1rem 0; border: 1px solid var(--border); border-radius: .3rem; }
.item-entry legend { font-size: 1rem; font-weight: 650; padding: 0 .35rem; }
.item-entry .form-grid { margin-top: .25rem; }
.remove-row { margin-top: .7rem; padding: .4rem .25rem; min-height: 2.75rem; color: #952718; border: 0; background: none; text-decoration: underline; text-underline-offset: .18em; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.session-form { max-width: 42rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.session-form .field + .field, .session-form + p, .panel-body p + h3 { margin-top: 1rem; }
.panel + .sheet-grid { margin-top: 1.25rem; }
.session-form .form-actions { align-items: center; }
.panel-body h2 + p { margin-top: .65rem; }
.session-items { margin: 1rem 0; padding: 0; list-style: none; }
.session-items li { padding: .75rem .9rem; overflow-wrap: anywhere; border-top: 1px solid var(--border); }
.session-items li:nth-child(odd) { background: var(--page-bg); }
.session-items li:last-child { border-bottom: 1px solid var(--border); }
.session-items li a { display: inline-block; padding-block: .3rem; font-weight: 650; }
.session-items li p { color: var(--text-muted); }
.notice { margin: 0 0 1.25rem; padding: .85rem 1rem; border: 1px solid #a8bdc8; border-left: 4px solid #436f80; border-radius: .3rem; color: #234757; background: #eff5f7; }
.notice-success { background: #e9f6ee; color: #1d5138; border-color: #a6c6b5; border-left-color: #336e51; }
.notice-warning, .notice-error { background: #fff3e9; color: #703718; border-color: #d5ae90; border-left-color: #995a30; }
@media (max-width: 63.99rem) {
  .main { padding: 1.5rem; }
  .bar-inner { padding-inline: 1.5rem; }
}
@media (max-width: 47.99rem) {
  .bar-inner { padding-inline: 1rem; }
  .main { padding: 1.5rem 1rem; }
  .page-heading { margin-bottom: 1.25rem; }
  .panel-body, .search-form, .section-header, .empty-state { padding: 1rem; }
  .search-form { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .search-form .clear-filters { justify-self: start; }
  .sheet-grid { grid-template-columns: minmax(0, 1fr); }
  .table-scroll table { min-width: 38rem; }
  .bar-start .home-link { margin-left: 0; padding-left: 0; border-left: 0; }
  .task { min-height: 6.5rem; padding: 1rem; gap: .75rem; }
  .task-icon { flex-basis: 2.4rem; height: 2.4rem; }
  .task-arrow { font-size: 1.1rem; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .bar-start, .user-tools { gap: .35rem .75rem; }
  .operator { max-width: 100%; }
  .home-content { margin-top: 0; }
}
