/* Testcell — Section 508 / WCAG 2.1 AA.
   Every colour pair used for text was checked to at least 4.5:1 on its own
   background; status is never signalled by colour alone. */

:root {
	--ink:        #16202c;
	--ink-soft:   #4d5766;   /* 7.0:1 on white */
	--rule:       #d8dee7;
	--rule-soft:  #e9edf2;
	--bg:         #ffffff;
	--bg-tint:    #f5f7fa;
	--brand:      #123a5e;
	--brand-deep: #0d2b47;
	--link:       #10537f;   /* 6.4:1 on white */
	--link-hot:   #0b3c5d;
	--focus:      #b8500a;
	--ok-bg:      #e4f2e6;  --ok-ink:   #17512a;
	--warn-bg:    #fdf0d8;  --warn-ink: #6b4405;
	--bad-bg:     #fbe6e4;  --bad-ink:  #8a2118;
	--info-bg:    #e6eef6;  --info-ink: #123a5e;
	--mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
	--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0; background: var(--bg); color: var(--ink);
	font: 16px/1.6 var(--sans);
}
.wrap { width: min(1120px, 100% - 3rem); margin-inline: auto; }

/* ---------- focus: always visible, never removed ---------- */
:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
	border-radius: 2px;
}

/* ---------- skip link ---------- */
.skip-link {
	position: absolute; left: -9999px; top: 0; z-index: 100;
	background: var(--brand-deep); color: #fff; padding: .75rem 1.25rem;
	font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* visually hidden but readable by assistive tech */
.vh {
	position: absolute !important; width: 1px; height: 1px;
	padding: 0; margin: -1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- header ---------- */
.site-header { background: var(--brand-deep); color: #fff; }
.header-inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; padding: .9rem 0; }
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; }
.brand-mark { font-size: 1.6rem; line-height: 1; color: #8fc4ee; }
.brand-text { font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; display: flex; flex-direction: column; }
.brand-sub { display: block; font-weight: 400; font-size: .78rem; color: #c3d5e6; letter-spacing: .02em; }
.brand:hover .brand-text, .brand:focus .brand-text { text-decoration: underline; }

.nav { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0; }
.nav a { color: #e8f0f8; text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; font-weight: 500; }
.nav a:hover { text-decoration: underline; }
.nav a[aria-current="page"] { border-bottom-color: #8fc4ee; color: #fff; }

/* ---------- actor bar ---------- */
.actorbar { background: var(--bg-tint); border-bottom: 1px solid var(--rule); }
.actorbar-inner { padding: .7rem 0; }
.actor-form { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.actor-form label { font-weight: 600; font-size: .9rem; }
.actor-form select { padding: .35rem .5rem; font: inherit; font-size: .9rem; border: 1px solid #97a3b2; border-radius: 4px; background: #fff; color: var(--ink); }
.actor-form .hint { flex-basis: 100%; margin: .15rem 0 0; }

/* ---------- main ---------- */
main { display: block; padding: 2.25rem 0 3.5rem; }
main:focus { outline: none; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem); line-height: 1.22; letter-spacing: -.02em; margin: 0 0 .6rem; }
h2 { font-size: 1.22rem; letter-spacing: -.01em; margin: 2.2rem 0 .7rem; padding-bottom: .4rem; border-bottom: 1px solid var(--rule-soft); }
.lede { font-size: 1.05rem; color: var(--ink-soft); max-width: 68ch; margin: 0 0 1.4rem; }
a { color: var(--link); }
a:hover { color: var(--link-hot); }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--ink-soft); }
.muted-block { display: block; color: var(--ink-soft); font-size: .84rem; }
.nowrap { white-space: nowrap; }
.reqno { color: var(--ink-soft); font-weight: 500; }
.empty { background: var(--bg-tint); border: 1px dashed var(--rule); padding: 1.5rem; border-radius: 6px; }

/* ---------- stats ---------- */
.stat-row { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0 0 1.75rem; }
.stat { flex: 1 1 190px; background: var(--bg-tint); border: 1px solid var(--rule); border-left: 4px solid var(--brand); border-radius: 6px; padding: .9rem 1.1rem; }
.stat-num { display: block; font-size: 1.9rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.stat-label { display: block; font-size: .86rem; color: var(--ink-soft); }

/* ---------- flash / notices ---------- */
.flash { padding: .85rem 1.1rem; border-radius: 6px; margin: 0 0 1.5rem; border: 1px solid; }
.flash-success { background: var(--ok-bg);  color: var(--ok-ink);  border-color: #a9cfb2; }
.flash-error   { background: var(--bad-bg); color: var(--bad-ink); border-color: #e0a9a2; }
.notice { background: var(--info-bg); color: var(--info-ink); border: 1px solid #b7cadd; padding: .85rem 1.1rem; border-radius: 6px; }
.integrity { padding: .7rem 1rem; border-radius: 6px; border: 1px solid; font-size: .93rem; }
.integrity-ok  { background: var(--ok-bg);  color: var(--ok-ink);  border-color: #a9cfb2; }
.integrity-bad { background: var(--bad-bg); color: var(--bad-ink); border-color: #e0a9a2; }

/* ---------- error summary ---------- */
.errsum { border: 2px solid #b02a1d; background: #fdf3f2; border-radius: 6px; padding: 1rem 1.25rem; margin: 0 0 1.75rem; }
.errsum:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.errsum h2 { margin: 0 0 .5rem; font-size: 1.08rem; color: #8a2118; border: 0; padding: 0; }
.errsum ul { margin: 0; padding-left: 1.2rem; }
.errsum a { color: #8a2118; font-weight: 600; }

/* ---------- forms ---------- */
.form { max-width: 62rem; }
.field { margin: 0 0 1.35rem; }
.field-row { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.field-row > .field { flex: 1 1 240px; }
label, legend { display: block; font-weight: 600; margin-bottom: .3rem; }
fieldset { border: 1px solid var(--rule); border-radius: 6px; padding: .9rem 1.1rem 1rem; margin: 0 0 1.35rem; }
legend { padding: 0 .4rem; }
.req { color: #b02a1d; }
.hint { font-size: .87rem; color: var(--ink-soft); margin: 0 0 .4rem; }
.fielderr { font-size: .89rem; color: #8a2118; font-weight: 600; margin: 0 0 .35rem; }
input[type="text"], input[type="date"], select, textarea {
	width: 100%; font: inherit; color: var(--ink); background: #fff;
	padding: .55rem .65rem; border: 1px solid #6f7c8c; border-radius: 4px;
}
textarea { resize: vertical; }
.field-error input, .field-error select, .field-error textarea { border-color: #b02a1d; border-width: 2px; }
.radio { display: flex; align-items: flex-start; gap: .55rem; margin: .3rem 0; }
.radio input { margin-top: .35rem; }
.radio label { font-weight: 400; margin: 0; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: .5rem; }
.btn {
	display: inline-block; font: inherit; font-weight: 600; cursor: pointer;
	padding: .6rem 1.15rem; border-radius: 5px; border: 1px solid transparent;
	text-decoration: none; line-height: 1.3;
}
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-deep); color: #fff; }
.btn-quiet { background: #fff; color: var(--link); border-color: #9aa7b6; }
.btn-quiet:hover { background: var(--bg-tint); }

/* ---------- pills: text always present, colour is secondary ---------- */
.pill {
	display: inline-block; padding: .16rem .6rem; border-radius: 999px;
	font-size: .78rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
	border: 1px solid;
	background: var(--info-bg); color: var(--info-ink); border-color: #b7cadd;
}
.pill-approved, .pill-approve { background: var(--ok-bg);   color: var(--ok-ink);   border-color: #a9cfb2; }
.pill-returned, .pill-return  { background: var(--bad-bg);  color: var(--bad-ink);  border-color: #e0a9a2; }
.pill-draft                   { background: #eceff3;        color: #3f4a58;         border-color: #c8d0da; }
.pill-in-safety, .pill-in-readiness, .pill-in-schedule { background: var(--warn-bg); color: var(--warn-ink); border-color: #ddc08a; }

/* ---------- progress ---------- */
.progress { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: .75rem; counter-reset: step; }
.step { flex: 1 1 220px; display: flex; gap: .75rem; align-items: flex-start; background: var(--bg-tint); border: 1px solid var(--rule); border-top: 4px solid #b6c0cd; border-radius: 6px; padding: .8rem .95rem; }
.step-num { flex: 0 0 1.75rem; height: 1.75rem; border-radius: 50%; background: #b6c0cd; color: #23303f; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.step-label { display: block; font-weight: 600; }
.step-status { display: block; font-size: .85rem; color: var(--ink-soft); }
.step-complete { border-top-color: #2f7d47; } .step-complete .step-num { background: #2f7d47; color: #fff; }
.step-current  { border-top-color: #b8790a; } .step-current  .step-num { background: #b8790a; color: #fff; }
.step-returned { border-top-color: #b02a1d; } .step-returned .step-num { background: #b02a1d; color: #fff; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; margin: 0 0 1.5rem; }
.grid { width: 100%; border-collapse: collapse; font-size: .93rem; }
.grid caption { text-align: left; color: var(--ink-soft); font-size: .87rem; padding: 0 0 .6rem; }
.grid th, .grid td { text-align: left; vertical-align: top; padding: .6rem .7rem; border-bottom: 1px solid var(--rule-soft); }
.grid thead th { background: var(--bg-tint); border-bottom: 2px solid var(--rule); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: #3b4655; white-space: nowrap; }
.grid tbody tr:hover { background: #f9fbfd; }
/* A request number is one token; never let it break across lines. */
.grid tbody th.mono { white-space: nowrap; }

/* ---------- misc ---------- */
.cols { display: flex; flex-wrap: wrap; gap: 0 2.5rem; }
.cols > section { flex: 1 1 340px; min-width: 0; }
.deflist { margin: 0; }
.deflist dt { font-weight: 600; font-size: .84rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin-top: 1rem; }
.deflist dd { margin: .15rem 0 0; }
.crumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; padding: 0; font-size: .9rem; }
.crumb li + li::before { content: "/"; color: var(--ink-soft); margin-right: .5rem; }

.site-footer { border-top: 1px solid var(--rule); background: var(--bg-tint); padding: 1.75rem 0; color: var(--ink-soft); font-size: .9rem; }
.site-footer p { margin: .3rem 0; }
.footer-meta { font-size: .85rem; }

@media (prefers-reduced-motion: reduce) {
	* { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
