/*
 * NIHR design system for the HealthTech Research Centre: In Vitro Diagnostics site.
 *
 * Built from the Figma file "HealthTech Bridge — Imperial Redesign" (NIHR pages)
 * and the NIHR brand guidelines. Used by templates/base.html (public pages) and
 * templates/Dashboard/base_nihr.html (signed-in pages), and templates/auth_nihr.html
 * (account pages).
 *
 * Archia is licensed through NIHR comms for this site only: do not copy the
 * font files anywhere else. Inclusive Sans is under the SIL Open Font Licence
 * (fonts/inclusive-sans/OFL.txt).
 */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Archia";
  src: url("../fonts/archia/Archia-Regular.18d27b32dd5a.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archia";
  src: url("../fonts/archia/Archia-SemiBold.df82ac305aea.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archia";
  src: url("../fonts/archia/Archia-Bold.5084e667edd4.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inclusive Sans";
  src: url("../fonts/inclusive-sans/InclusiveSans-latin.60306f4597dc.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  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: "Inclusive Sans";
  src: url("../fonts/inclusive-sans/InclusiveSans-latin-ext.46753a8bbb76.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* ← and →, which Google's subsets leave out; cut from the full font (same licence). */
@font-face {
  font-family: "Inclusive Sans";
  src: url("../fonts/inclusive-sans/InclusiveSans-arrows.73072dc61985.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+2190, U+2192;
}

/* ---------- Tokens ---------- */
:root {
  --navy: #1c285e;
  --navy-hover: #182250;
  --navy-active: #16204b;
  --navy-row-hover: #2a3570;
  --coral: #fc5d5d;
  --off-black: #3c3c3c;
  --placeholder: #5a5a5a;
  --putty: #faf4eb;
  --steel: #c5dce5;
  --steel-60: #dceaef;
  --lilac: #c4c5ff;
  --lilac-tint: #f3f3ff;
  --glove-blue: #c7e9ff;
  --pending: #8396b0;
  --sunshine: #ffe626;
  --focus-text: #003078;
  --teal: #0a5766;
  /* Hairlines that need to show on white (Steel is too pale there). */
  --rule: rgba(60, 60, 60, 0.2);
  /* Errors: nihr.ac.uk's danger colour (7.4:1 on white). */
  --error: #aa2a16;
  --navy-25: rgba(28, 40, 94, 0.25);
  --navy-35: rgba(28, 40, 94, 0.35);

  --font-display: "Archia", "Inclusive Sans", Arial, sans-serif;
  --font-text: "Inclusive Sans", Arial, sans-serif;

  --shadow-card: 0 3px 8px rgba(0, 0, 0, 0.15);
  --shadow-soft: 0 3px 4px rgba(0, 0, 0, 0.15);
  --shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.15);
  --shadow-bar: 0 -3px 8px rgba(0, 0, 0, 0.12);

  --page-gutter: clamp(20px, 4.17vw, 60px);
  --content-max: 1320px;
  --section-y: 80px;
  --block-gap: 44px;
  --ease: 180ms ease;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
/* No smooth scrolling: a long glide to a link's target loses people using a magnifier. */
html {
  -webkit-text-size-adjust: 100%;
}
/* Font sizes are in rem so that the Display settings text size (and the browser's own
   text size) reach every piece of text. body is the query container for the layout
   breakpoints in "Responsive". */
body {
  margin: 0;
  background: #fff;
  color: var(--off-black);
  font: 400 1rem/1.5 var(--font-text);
  overflow-wrap: break-word;
  container-type: inline-size;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--navy);
  font-family: var(--font-display);
}
p,
ul,
ol,
figure {
  margin: 0;
}
img {
  max-width: 100%;
}
/* Links as on nihr.ac.uk: the underline keeps its place, and hover only turns it coral and
   thicker, so the text never moves. */
a {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-thickness: 0.125rem;
  text-underline-offset: 0.28125rem;
}
a:hover {
  text-decoration-color: var(--coral);
  text-decoration-thickness: 0.1875rem;
}
button,
input {
  font: inherit;
}
[hidden] {
  display: none !important;
}

/* Focus: taken from the live nihr.ac.uk theme (the brand PDFs define no states). */
:focus-visible {
  outline: 3px solid var(--sunshine);
  outline-offset: 0;
}
a:focus-visible {
  outline: 3px solid transparent;
  background-color: var(--sunshine);
  color: var(--focus-text);
  box-shadow: 0 0 0 4px var(--sunshine), 0 2px 0 4px var(--focus-text);
  text-decoration-color: var(--focus-text);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -10rem;
  left: 16px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}
.skip-link:focus {
  top: 16px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--page-gutter));
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  border: 0;
  border-radius: 0;
  font: 700 0.9375rem/1 var(--font-text);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--ease), color var(--ease);
}
.btn::after {
  content: "\2192";
  content: "\2192" / "";
  transition: transform var(--ease);
}
.btn:hover {
  text-decoration: none;
}
.btn:hover::after {
  transform: translateX(3px);
}
.btn--plain::after {
  content: none;
}
.btn--primary {
  background: var(--navy);
  color: #fff;
}
.btn--primary:hover {
  background: var(--navy-hover);
  color: #fff;
}
.btn--primary:active {
  background: var(--navy-active);
}
.btn--secondary {
  background: var(--lilac);
  color: var(--navy);
}
.btn--secondary:hover {
  background: var(--navy);
  color: #fff;
}
.btn--inverse {
  background: #fff;
  color: var(--navy);
}
.btn--inverse:hover {
  background: var(--glove-blue);
  color: var(--navy);
}
.btn--outline {
  padding: 9px 14px;
  border: 1.5px solid var(--navy);
  background: transparent;
  color: var(--navy);
}
.btn--outline::after {
  content: none;
}
.btn--outline:hover {
  background: var(--navy);
  color: #fff;
}
.btn--app {
  min-height: 48px;
  padding: 0 20px;
  font-size: 1rem;
}
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn[disabled]:hover::after {
  transform: none;
}
.btn:focus-visible {
  outline: 3px solid transparent;
  background: var(--sunshine);
  color: var(--focus-text);
  box-shadow: inset 0 -2px 0 var(--focus-text);
}

/* A text link with the coral arrow in front ("Link" in Figma). */
.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
}
.link:hover {
  text-decoration: none;
}
.link__arrow {
  color: var(--coral);
}
.link__text {
  text-decoration: underline;
  text-decoration-thickness: 0.125rem;
  text-underline-offset: 0.28125rem;
}
.link:hover .link__text {
  text-decoration-color: var(--coral);
  text-decoration-thickness: 0.1875rem;
}
.link:focus-visible {
  box-shadow: 0 0 0 6px var(--sunshine), 0 2px 0 6px var(--focus-text);
}
.link:focus-visible .link__text {
  text-decoration-color: var(--focus-text);
}

/* A button that looks like a plain underlined link (log out, read bio). */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 0.125rem;
  text-underline-offset: 0.28125rem;
  cursor: pointer;
}
.link-button:hover {
  text-decoration-color: var(--coral);
  text-decoration-thickness: 0.1875rem;
}
.link-button:focus-visible {
  outline: 3px solid transparent;
  background: var(--sunshine);
  color: var(--focus-text);
  box-shadow: 0 0 0 4px var(--sunshine), 0 2px 0 4px var(--focus-text);
}

/* ---------- Shared pieces ---------- */
.keyline-heading {
  display: flex;
  gap: 16px;
}
.keyline-heading::before {
  content: "";
  flex: 0 0 4px;
  background: var(--coral);
}
.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  line-height: 1.4;
}
.chip {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--navy);
  border-radius: 999px;
  color: var(--navy);
  font-size: 0.8125rem;
  line-height: 1.4;
}
.chip--filled {
  background: var(--navy);
  color: #fff;
}

/* ---------- Public header (brand architecture p.26) ---------- */
.site-topbar {
  background: #fff;
}
.site-topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 24px;
}
/* The logo file has ~11px of clear space before the N; let it sit in the gutter so the N
   lines up with the nav and the page content. */
.site-logo {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  margin-left: -11px;
  line-height: 0;
}
.site-logo img {
  display: block;
  height: auto;
}
.menu-button {
  display: none;
  flex: none;
}
/* NIHR website and Log in, top right (brand architecture p.26: extra UI top right). */
.site-topbar__actions {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-topbar__actions .btn {
  min-height: 2.75rem;
  padding: 0 1.25rem;
  font-size: 1rem;
}

/* The navy bar: the specialism descriptor on the left, the page links on the right
   (as on the HRC Network site). Below 1180px it becomes two rows. */
.site-navbar {
  background: var(--navy);
  color: #fff;
}
.site-bar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 2.5rem;
  min-height: 3.75rem;
}
/* Block, not flex, so the space after the colon survives; centred in the bar. */
.site-descriptor {
  align-self: center;
  color: #fff;
  font: 600 1.125rem/1.3 var(--font-display);
  white-space: nowrap;
}
.site-nav {
  display: flex;
  align-items: stretch;
}
.site-nav__links {
  display: flex;
  gap: 2.25rem;
}
.site-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  color: #fff;
  font: 700 1.0625rem/1 var(--font-display);
  text-decoration: none;
  white-space: nowrap;
}
/* The coral bar marks the current page on the bottom edge of the navy bar. */
.site-nav__link::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ease);
}
.site-nav__link:hover {
  color: #fff;
  text-decoration: none;
}
.site-nav__link:hover::before,
.site-nav__link[aria-current="page"]::before {
  transform: scaleX(1);
}
/* The mobile menu's copy of the top bar's actions; hidden on desktop. */
.site-nav__actions {
  display: none;
}
.site-nav__exit,
.site-nav__exit:hover {
  color: #fff;
}
.site-nav__exit:focus-visible {
  color: var(--focus-text);
}
/* ---------- Sections ---------- */
.section {
  padding-block: var(--section-y);
}
.section > .wrap {
  display: flex;
  flex-direction: column;
  gap: var(--block-gap);
}
.section--putty {
  background: var(--putty);
}
.section--steel {
  background: var(--steel-60);
}
.section--graphic {
  position: relative;
  overflow: hidden;
}
.section--graphic > .wrap {
  position: relative;
  z-index: 1;
}
.section-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.section-head__title {
  font: 600 2rem/1.1 var(--font-display);
}
.section-head__standfirst {
  max-width: 45rem;
  color: var(--off-black);
  font: 400 1.25rem/1.4 var(--font-display);
}
.section-head__standfirst--navy {
  color: var(--navy);
}
.section-head__legend {
  font-size: 0.875rem;
  line-height: normal;
}

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--section-y);
  overflow: hidden;
  background: var(--steel-60);
}
.hero .wrap {
  display: flex;
  align-items: center;
  gap: 64px;
}
.hero__copy {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  min-width: 0;
}
.hero__title {
  font: 600 3rem/1.05 var(--font-display);
}
.hero__standfirst {
  max-width: 37.5rem;
  color: var(--off-black);
  font: 400 1.25rem/1.4 var(--font-display);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  padding-top: 8px;
}
.hero__actions .link {
  font-size: 0.9375rem;
}
.hero__media {
  position: relative;
  flex: 0 0 520px;
  height: 400px;
}
/* Graphic: coral arc behind the top right of the photo. */
.hero__arc {
  position: absolute;
  top: -17.75%;
  left: 32.31%;
  z-index: 0;
  width: 78.85%;
  height: auto;
  pointer-events: none;
}
.hero__photo {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

/* ---------- Tool finder ---------- */
.finder {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 40px 24px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
  list-style: none;
}
.stepper__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--off-black);
  font-size: 0.9375rem;
  line-height: 1.2;
  text-align: center;
}
.stepper__marker {
  display: flex;
  align-items: center;
  width: 100%;
}
.stepper__line {
  flex: 1 1 0;
  height: 2px;
  background: var(--steel);
}
.stepper__step:first-child .stepper__line:first-child,
.stepper__step:last-child .stepper__line:last-child {
  visibility: hidden;
}
.stepper__num {
  display: grid;
  flex: none;
  place-content: center;
  width: 2rem;
  height: 2rem;
  border: 1.5px solid var(--steel);
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  font: 700 0.875rem/1 var(--font-text);
}
.stepper__step.is-current,
.stepper__step.is-done {
  color: var(--navy);
}
.stepper__step.is-current {
  font-weight: 700;
}
.stepper__step.is-current .stepper__num,
.stepper__step.is-done .stepper__num {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}
.stepper__step.is-done .stepper__line,
.stepper__step.is-current .stepper__line:last-child,
.stepper__step.is-done + .stepper__step .stepper__line:first-child,
.stepper__step.is-current + .stepper__step .stepper__line:first-child {
  background: var(--coral);
}
.finder__panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.finder__question {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.finder__title {
  font: 700 1.375rem/1.2 var(--font-display);
}
.finder__title:focus {
  outline: 0;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.tiles--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 20px 22px;
  border: 1px solid var(--steel);
  background: #fff;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--ease);
}
.tile:hover {
  border-color: var(--navy);
}
.tile input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.tile__icon {
  display: block;
  flex: none;
}
.tile__label {
  color: var(--navy);
  font-weight: 700;
}
.tile:has(input:checked) {
  padding: 23px 19px 21px;
  border: 2px solid var(--navy);
  background: var(--lilac-tint);
}
.tile:has(input:checked)::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  background: url("../img/nihr/icon-check.45de97ff150a.svg") center / 22px 22px no-repeat;
}
.tile:has(input:focus-visible) {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--sunshine);
}
.finder__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}
.finder__summary {
  color: var(--off-black);
}
.results {
  display: flex;
  flex-direction: column;
}
.result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--navy);
}
.result:first-child {
  margin-top: 0;
}
.result__name {
  color: var(--navy);
  font: 600 2rem/1.1 var(--font-display);
}
.result__full {
  margin-top: -8px;
  color: var(--off-black);
  font: 400 1.25rem/1.4 var(--font-display);
}
.result__text {
  max-width: 37.5rem;
}

/* ---------- How to use ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  padding: 0;
  list-style: none;
}
.steps__item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--navy);
}
.steps__num {
  color: var(--navy);
  font: 600 2.5rem/1 var(--font-display);
}
.steps__title {
  font: 600 1.25rem/1.2 var(--font-display);
}

/* ---------- Published tools ---------- */
.tool-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  min-height: 578px;
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow-card);
}
.tool-card__icon {
  display: block;
}
.tool-card__names {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 76px;
}
.tool-card__name {
  font: 600 2rem/1.1 var(--font-display);
}
.tool-card__full {
  color: var(--off-black);
  font: 400 1.25rem/1.4 var(--font-display);
}
.stat {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--coral);
  color: var(--navy);
}
.stat__num {
  font: 600 3rem/1 var(--font-display);
  white-space: nowrap;
}
.stat__label {
  flex: 1 1 0;
  min-width: 0;
  font-weight: 700;
}
/* Card footer: the action, then the year and status as plain text under a hairline, so the
   card opens with its title rather than a label. */
.card-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--steel);
}
.card-foot--row {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 20px;
}
.card-foot__meta {
  color: var(--off-black);
  font-size: 0.875rem;
  line-height: 1.4;
}

/* ---------- Our research ---------- */
.research-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.research-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-height: 305px;
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow-card);
}
.research-card__title {
  font: 700 1.375rem/1.2 var(--font-display);
}
.research-card .link {
  padding-block: 4px;
}

/* ---------- Team ---------- */
.team {
  display: grid;
  /* Five equal columns across the whole container (capped columns left the row 74px
     short of the right edge at 1440px). */
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 32px 24px;
  padding: 0;
  list-style: none;
}
.person {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
/* The tint fills the slot while a lazy photo loads, so the row reads as photo frames,
   not gaps. Photos are opaque, so it never shows once loaded. */
.person__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--putty);
}
.person__name {
  color: var(--navy);
  font: 700 1rem/1.5 var(--font-text);
}
/* Show the whole job title: clamping to two lines cut titles off on narrow screens
   and with larger text spacing (WCAG 1.4.10 / 1.4.12). min-height keeps short
   titles lined up with two-line ones. */
.person__role {
  min-height: 3em;
}
.person__links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  /* At the bottom of the card, so a row's links line up when a title runs to 3 lines. */
  margin-top: auto;
}
.person__links a,
.person__links .link-button {
  padding-block: 5px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
}
.bio-row {
  grid-column: 1 / -1;
}
/* Without JavaScript every bio stays visible under its person. */
.js .person__bio:not(.is-open),
.no-js [data-bio-toggle],
.no-js [data-bio-close],
.no-js .section--finder {
  display: none;
}
.no-js .person__bio {
  margin-top: 8px;
}
.person__bio {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  max-width: 72ch;
  padding-top: 24px;
  border-top: 1px solid var(--navy);
}
.person__bio-name {
  color: var(--navy);
  font: 700 1.25rem/1.2 var(--font-display);
}
.person__bio .btn {
  margin-top: 4px;
}

/* ---------- Contact ---------- */
/* Graphic: the official coral gradient bar along the top edge, on the right, closing the
   page (as on the NIHR website's panels). Decorative only. */
.contact {
  position: relative;
}
.contact::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 40%;
  height: 8px;
  background: url("../img/nihr/gradient-coral-bar.fc0b458f72c5.webp") 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}
/* ---------- Home page graphics ---------- */
/* Official NIHR brand toolkit assets (grain included), placed by the product owner in
   Figma ("Home · Graphics (draft)"); colours checked against the brand guidelines: coral
   with the blue family. Each sits inside its section's .wrap, behind the content (the
   wrap is its stacking context, see .section--graphic), so it moves with the content
   at any width. Decorative only: hidden on narrow screens and in high contrast. */
.gfx {
  position: absolute;
  z-index: -1;
  background: center / contain no-repeat;
  pointer-events: none;
}
/* "Which tool": the coral arc, turned, bottom-left, peeking out under the finder. */
.gfx--finder-arc {
  bottom: calc(4px - var(--section-y));
  left: 13px;
  width: 340px;
  height: 340px;
  background-image: url("../img/nihr/hero-arc-coral.73dca1fe63f8.webp");
  transform: rotate(180deg);
}
/* "Published tools": a light blue ring, top-left, framing the heading: its opening
   (about 32% of its width as a radius, so 335px) clears the heading and standfirst
   (at most 288px from its centre) with room to spare. */
.gfx--tools-ring {
  top: calc(-373px - var(--section-y));
  left: -268px;
  width: 1040px;
  height: 1040px;
  background-image: url("../img/nihr/ring-lightblue.1f12e9bbc250.webp");
  transform: rotate(-22deg);
}
/* "Our team": the blue burst corner at the top, pinned to the content's right edge (not
   the screen's), so it sits above the last photo column at every width. */
.gfx--team-burst {
  top: calc(0px - var(--section-y));
  right: calc(var(--page-gutter) - 40px);
  width: 200px;
  height: 184px;
  background-image: url("../img/nihr/burst-corner-blue.131e1c67289f.webp");
  transform: scale(-1, -1);
}
@media (max-width: 767.98px) {
  .gfx {
    display: none;
  }
}
/* A larger Display settings text size makes the heading outgrow the ring's opening. */
html[data-text-size] .gfx--tools-ring {
  display: none;
}
.contact .wrap {
  flex-direction: row;
  align-items: flex-start;
  gap: 64px;
}
.contact__copy {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  min-width: 0;
}
.contact__social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.contact__social a {
  font-weight: 700;
}
.contact__details {
  display: flex;
  flex: 0 0 520px;
  flex-direction: column;
  gap: 16px;
  padding-left: 32px;
  border-left: 3px solid var(--coral);
}
.contact__org,
.contact__email {
  color: var(--navy);
  font-weight: 700;
}
.contact__details address {
  font-style: normal;
}
.contact__funder {
  font-size: 0.8125rem;
  line-height: 1.4;
}

/* ---------- Public footer ---------- */
.site-footer {
  padding-block: var(--section-y);
  background: var(--navy);
  color: #fff;
}
.site-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: var(--block-gap);
}
.site-footer__cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 48px;
}
.site-footer__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.site-footer__col--brand {
  gap: 16px;
}
.site-footer__logo {
  display: block;
  height: auto;
}
.site-footer__desc {
  max-width: 20rem;
  font-weight: 700;
}
.site-footer__title {
  color: #fff;
  font: 700 1.375rem/1.2 var(--font-display);
}
.site-footer address {
  max-width: 18.75rem;
  font-style: normal;
}
.site-footer a {
  color: #fff;
}
.site-footer a:hover {
  color: #fff;
}
.site-footer__email {
  font-weight: 700;
}
.site-footer__legal {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 0.8125rem;
  line-height: 1.4;
}

/* ---------- Cookie notice ----------
   At the top of the page, in the normal flow (not fixed), so it can never cover what
   someone is tabbing to or reading, at any text size (WCAG 2.4.11). */
.cookie-banner {
  padding-block: 20px;
  border-bottom: 4px solid var(--coral);
  background: var(--navy);
  color: #fff;
}
.cookie-banner .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.cookie-banner a {
  color: #fff;
}
.cookie-banner .btn::after {
  color: var(--coral);
}
.cookie-banner form {
  flex: none;
  margin: 0;
}

/* ---------- Signed-in app shell ---------- */
.nihr-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--steel);
  background: #fff;
}
.app-identity {
  display: flex;
  flex: none;
  align-items: center;
  gap: 16px;
}
.app-identity__logo {
  display: block;
  line-height: 0;
}
.app-identity__logo img {
  display: block;
  height: auto;
}
.app-identity__rule {
  width: 1px;
  height: 28px;
  background: var(--navy-25);
}
.app-identity__descriptor {
  color: var(--navy);
  font-size: 1rem;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}
.app-identity__descriptor b {
  font-weight: 700;
}
.app-controls {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-width: 0;
  padding-left: 48px;
}
.app-controls .link,
.app-controls .link-button {
  padding-block: 12px;
  font-size: 1rem;
  line-height: 1.4;
  white-space: nowrap;
}
.app-controls form {
  margin: 0;
}
.app-controls__divider {
  flex: none;
  width: 1px;
  height: 20px;
  background: var(--navy-25);
}
/* The Display settings button stays hidden until its script runs; so does the divider after it. */
.app-controls [hidden] + .app-controls__divider {
  display: none;
}
.app-descbar {
  display: none;
}
.app-menu-button {
  display: none;
  flex: none;
}
.app-body {
  display: flex;
  flex: 1 0 auto;
}

.app-sidebar {
  display: flex;
  flex: 0 0 16.5rem;
  flex-direction: column;
  padding: 28px 16px 24px;
  background: var(--navy);
  color: #fff;
}
.app-sidebar__account,
.app-sidebar__exit {
  display: none;
}
.app-nav,
.app-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.app-nav__link,
.app-nav__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  border: 0;
  background: none;
  color: #fff;
  font: 400 1rem/1.25 var(--font-text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.app-nav__link:hover,
.app-nav__toggle:hover {
  background: var(--navy-row-hover);
  color: #fff;
  text-decoration: none;
}
/* Groups of links: a rule between them. The rule only ever means "next group of links".
   12 + 12 matches the old 24px spacer, so the sidebar keeps its height. */
.app-nav__group + .app-nav__group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
}
/* Group label ("Tools"): the group's name, so it is the strongest text in the column after
   the pill. Archia 600 (preloaded, the site's display-heading weight) against the links'
   Inclusive Sans 400 sets it apart by weight and typeface, not colour, so it holds in High
   contrast, greyscale and forced colours. Sentence case, no letter-spacing, not a link, no
   hover. Top padding 8px + the group's 12px puts 20px above it; 0 below + the link's 12px
   puts 12px under it, so it reads with its links. 16px left lines up with the link text. */
.app-nav__label {
  padding: 0 16px 8px;
  color: #fff;
  font: 600 1rem/1.3 var(--font-display);
}
/* You are here: this page ("page") or inside this section ("true"), one white pill with a
   4px coral bar. Coral is the site's accent; the public nav marks its current page in coral
   too (a bottom bar on desktop, a left bar in the phone menu). Not Sunshine: Sunshine means
   keyboard focus on this site. Keep the coral at full strength: it is only about 3:1 against
   the white pill (the pill and bold text carry the state; the bar is a second cue). Plain
   info/warning flashes (.message) share this bar; errors use --error, not coral.
   Must sit after :hover (or the pill turns navy on hover) and before :focus-visible
   (or focus loses its Sunshine fill). The bar becomes a system-colour bar in forced
   colours; padding-left is 16px minus the bar, so the text doesn't move. */
.app-nav__link[aria-current] {
  padding-left: 12px;
  border-left: 4px solid var(--coral);
  background: #fff;
  color: var(--navy);
  font-weight: 700;
}
/* Inside a section the pill links back to the section, so show that on hover.
   Not on "page": that would invite a pointless reload. */
.app-nav__link[aria-current="true"]:hover {
  text-decoration: underline;
}
.app-nav__link:focus-visible,
.app-nav__toggle:focus-visible,
.app-nav__sublink:focus-visible {
  outline: 3px solid transparent;
  background: var(--sunshine);
  color: var(--focus-text);
  box-shadow: inset 0 -2px 0 var(--focus-text);
}
/* Focus on the current link: drop the coral bar while focused, so focus is one unbroken
   Sunshine fill and the inset underline runs the full width. Text stays put. */
.app-nav__link[aria-current]:focus-visible {
  padding-left: 16px;
  border-left-width: 0;
}
/* A status line, not a link: no link padding; 16px keeps it aligned with the link text.
   At the bottom of the sidebar (margin-top: auto in its flex column), and kept in view at
   the bottom of the screen while a long page scrolls (sticky), until the sidebar ends. */
.app-sidebar__signed-in {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 24px 16px;
  background: var(--navy);
  color: rgba(255, 255, 255, 0.8);
}

/* Capped like the public pages (--content-max), so on a very wide screen a magnifier
   user doesn't pan far to the right to find a page's other half. */
.app-main {
  --app-margin: 40px;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: var(--block-gap);
  min-width: 0;
  padding-top: 40px;
}
.app-main > * {
  margin-inline: var(--app-margin);
}
/* The cap is on what main holds, not main itself, so the full-bleed steel band on a
   first-run dashboard still reaches the edge. :where() keeps it weaker than any
   component's own max-width. */
:where(.app-main > :not(.tools-band)) {
  max-width: var(--content-max);
}
.app-main > .tools-band {
  margin-inline: 0;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}
.page-head__title {
  font: 600 3rem/1.2 var(--font-display);
}
.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  list-style: none;
}
.message {
  padding: 16px 20px;
  border-left: 4px solid var(--coral);
  background: var(--putty);
}

.app-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
  padding: 16px 40px;
  border-top: 1px solid var(--steel);
}
.app-footer__name {
  font-size: 0.8125rem;
  line-height: 1.4;
}
.app-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.app-footer__links a {
  display: inline-block;
  padding-block: 12px;
}

/* ---------- Dashboard ---------- */
.firstrun {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 48px;
  background: var(--putty);
}
.firstrun__title {
  font: 600 1.75rem/1.25 var(--font-display);
}
.firstrun p {
  max-width: 47.5rem;
}
/* The welcome's steps: one column at every width (beats each .steps override). */
.firstrun .steps {
  grid-template-columns: 1fr;
  align-self: stretch;
  max-width: 47.5rem;
}
.tools-band {
  display: grid;
  flex: 1 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  align-items: start;
  gap: 24px;
  padding: 48px 40px;
  background: var(--steel);
}
.app-tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.app-tool-card__title {
  font: 700 1.375rem/1.2 var(--font-display);
}
.app-tool-card__fact {
  color: var(--navy);
  font-size: 0.875rem;
  font-weight: 700;
}
.app-tool-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding-top: 4px;
}
.app-tool-card__actions .btn {
  justify-content: flex-start;
  min-width: 220px;
}
.app-tool-card__actions .link {
  padding-block: 8px;
}

.projects {
  padding: 0;
  list-style: none;
}
/* Batch 11: the facts (name, then counts) come before Continue in the source, so
   phones and screen readers get them first; on wider rows Continue sits beside the
   name, centred against it (align-items: center keeps the 48px button level with a
   one-line name), and a long name wraps instead of pushing it down. */
.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name action"
    "meta extra";
  align-items: center;
  gap: 16px 24px;
  padding-block: 24px;
  border-bottom: 1px solid var(--steel);
}
.project__name {
  grid-area: name;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: normal;
}
.project__meta-sep {
  margin-inline: 0.5em;
}
.project__meta,
.project__next,
.project__done {
  line-height: 1.25;
}
.project__meta {
  grid-area: meta;
}
.project__action {
  grid-area: action;
}
.hub-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Forms ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field__after {
  font-size: 0.9375rem;
}
/* Secondary text grey from nihr.ac.uk (7:1 on white). */
.field__hint {
  margin-bottom: 4px;
  color: #505a5f;
  font-size: 0.9375rem;
  line-height: 1.4;
}
.field__hint-list {
  margin: 4px 0 8px;
  padding-left: 20px;
}
.field__hint-list li + li {
  margin-top: 4px;
}
/* A field plus a line under it (e.g. "Forgot password?"). */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form__legal {
  color: var(--off-black);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.form__legal a {
  white-space: nowrap;
}
/* Input with a "Show" button joined to its right edge (as on GOV.UK). */
.field__control {
  display: flex;
}
.field__control .field__input {
  flex: 1 1 auto;
  min-width: 0;
}
/* Lift the focused input so its ring isn't covered by the Show button. */
.field__control .field__input:focus {
  position: relative;
  z-index: 1;
}
.field__toggle {
  flex: none;
  min-width: 72px;
  margin-left: -2px;
  padding: 0 16px;
  border: 2px solid var(--off-black);
  background: #fff;
  color: var(--navy);
  font: 700 1rem/1 var(--font-text);
  cursor: pointer;
}
.field__toggle:hover {
  background: var(--glove-blue);
}
.field__toggle:focus-visible {
  outline: 3px solid var(--sunshine);
  outline-offset: 0;
  box-shadow: inset 0 0 0 2px var(--off-black);
  position: relative;
}
.field--error .field__toggle {
  border-color: var(--error);
}
.field__label {
  color: var(--navy);
  font-weight: 700;
}
.field__input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid var(--off-black);
  border-radius: 0;
  background: #fff;
  color: var(--off-black);
  font: 400 1rem/1.5 var(--font-text);
}
/* Inclusive Sans draws a very small password dot; Verdana's is clearly visible.
   "Show" turns the field into type="text", which goes back to the site font. */
.field__input[type="password"] {
  font-family: Verdana, "DejaVu Sans", sans-serif;
  letter-spacing: 0.12em;
}
/* Edge adds its own eye icon; the Show button already does that job (as GOV.UK). */
.field__input::-ms-reveal,
.field__input::-ms-clear {
  display: none;
}
/* Focus: a Sunshine ring plus a thicker dark border, so it shows on white too. */
.field__input:focus {
  outline: 3px solid var(--sunshine);
  outline-offset: 0;
  box-shadow: inset 0 0 0 2px var(--off-black);
}
.field--error {
  padding-left: 16px;
  border-left: 4px solid var(--error);
}
.field--error .field__input {
  border-color: var(--error);
}
.field__error {
  color: var(--error);
  font-weight: 700;
}
/* GOV.UK-style error summary: heading, then each problem. */
.error-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  border: 3px solid var(--error);
  color: var(--off-black);
}
/* The ring the Display settings panel uses (a navy outline in a Sunshine halo): the
   global Sunshine outline alone is about 1.27:1 on white. */
.error-summary:focus {
  outline: 3px solid var(--focus-text);
  outline-offset: 2px;
  box-shadow: 0 0 0 7px var(--sunshine);
}
.error-summary__title {
  color: var(--off-black);
  font: 600 1.25rem/1.3 var(--font-display);
}
.error-summary__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  list-style: none;
}
.error-summary__list a {
  color: var(--error);
  font-weight: 700;
  line-height: 1.4;
}
.message--success {
  border-left-color: var(--teal);
}
.prose {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Long email addresses must wrap on phones instead of widening the page. */
.prose strong,
.message,
a[href^="mailto:"] {
  overflow-wrap: anywhere;
}
.form--spaced {
  margin-top: 8px;
}
.btn--block {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
}

/* Messages after an action (Dashboard/base_nihr.html). A message about one field is
   shown by the field, which can leave the list empty. */
.messages:empty {
  display: none;
}
.message--error {
  border-left-color: var(--error);
}
.field__select {
  width: 100%;
}
.field__textarea {
  min-height: 8rem;
  resize: vertical;
}
.field__file {
  max-width: 100%;
  padding: 4px 0;
  font: inherit;
}
.field__file::file-selector-button {
  margin-right: 16px;
  padding: 11px 16px;
  border: 2px solid var(--navy);
  background: #fff;
  color: var(--navy);
  font: 700 1rem/1 var(--font-text);
  cursor: pointer;
}
.field__file:hover::file-selector-button {
  background: var(--glove-blue);
}
.field--error .field__file::file-selector-button {
  border-color: var(--error);
}
/* A form on its own on a signed-in page: a readable line length. */
.app-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 40rem;
  padding-bottom: 40px;
}
.form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}
.btn--danger {
  background: var(--error);
  color: #fff;
}
.btn--danger:hover {
  background: #8a2212;
  color: #fff;
}
.link-button--danger {
  color: var(--error);
}

/* ---------- Project pages (Dashboard/Projects: project, paper, start questionnaire) ---------- */
.hub-head {
  align-items: flex-start;
}
.hub-head__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.hub-head__meta {
  color: var(--navy);
  font-size: 1.125rem;
}
.hub-description {
  max-width: 47.5rem;
}
.hub-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding-top: 32px;
  border-top: 1px solid var(--steel);
}
.hub-step--last {
  padding-bottom: 40px;
}
.hub-step__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 600 1.75rem/1.25 var(--font-display);
}
/* The step number: a navy disc, as the stepper on the home page. */
.hub-step__num {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font: 700 1.125rem/1 var(--font-text);
}
.hub-step__subtitle {
  font: 700 1.25rem/1.3 var(--font-display);
}
.paper-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr));
  gap: 24px;
  width: 100%;
  padding: 0;
  list-style: none;
}
.paper-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border-top: 4px solid var(--coral);
  background: #fff;
  box-shadow: var(--shadow-soft);
  scroll-margin-top: 24px;
}
/* The paper just added (the page opens at #paper-<id>). */
.paper-card:target {
  box-shadow: 0 0 0 3px var(--lilac), var(--shadow-soft);
}
.paper-card__title {
  font: 700 1.375rem/1.25 var(--font-display);
}
.paper-card__meta,
.file-list__meta,
.saved-reports__date {
  color: #505a5f;
  font-size: 0.9375rem;
}
.tool-statuses {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 40rem;
  padding: 0;
  list-style: none;
}
.tool-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 16px;
  padding-top: 12px;
  border-top: 1px solid var(--steel);
}
.tool-status__name {
  color: var(--navy);
  font-weight: 700;
}
.tool-status__actions {
  display: flex;
  flex-wrap: wrap;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-items: center;
  gap: 8px 20px;
}
/* A tool not yet started has a summary on the paper page: keep Start beside all three rows. */
.tool-status:has(> .field__hint) .tool-status__actions {
  grid-row: 1 / span 3;
}
/* The status is written out; the dot only repeats it (empty, half, full). */
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
}
.status::before {
  content: "";
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid var(--navy);
  border-radius: 50%;
}
.status--in-progress::before {
  background: linear-gradient(90deg, var(--navy) 50%, transparent 50%);
}
.status--completed::before {
  background: var(--navy);
}
.add-paper {
  width: 100%;
  max-width: 40rem;
}
.add-paper__row {
  display: flex;
  gap: 8px;
}
.add-paper__row .field__input {
  flex: 1 1 auto;
  min-width: 0;
}
.saved-reports {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  list-style: none;
}
.saved-reports__date {
  display: block;
}
.hub-delete {
  padding: 8px 0 40px;
}
.hub-delete .link-button,
.file-list .link-button {
  display: inline-block;
  padding-block: 8px;
}
.all-questionnaires {
  width: 100%;
}
.all-questionnaires__toggle {
  padding-block: 8px;
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
}
.questionnaire-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
  padding: 0;
  list-style: none;
}
.questionnaire-list__meta {
  display: block;
  color: #505a5f;
  font-size: 0.9375rem;
}
.paper-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px 32px;
}
.paper-actions .link-button {
  padding-block: 13px;
}
.disclosure__summary {
  list-style: none;
}
.disclosure__summary::-webkit-details-marker {
  display: none;
}
.disclosure__body {
  margin-top: 16px;
  padding: 24px;
  background: var(--putty);
}
.file-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  list-style: none;
}
.file-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
}
.upload {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 40rem;
}
/* "Are you sure?" (Dashboard/_confirm_dialog.html). */
.app-dialog,
.app-main > .app-dialog {
  width: min(32rem, calc(100% - 32px));
  max-width: none;
  margin: auto;
  padding: 32px;
  border: 0;
  color: var(--off-black);
  box-shadow: var(--shadow-hover);
}
.app-dialog::backdrop {
  background: rgba(28, 40, 94, 0.6);
}
.app-dialog__title {
  margin-bottom: 12px;
  font: 600 1.5rem/1.3 var(--font-display);
}
.app-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}
/* Start a questionnaire: radio buttons. */
.chosen-paper {
  font-size: 1.125rem;
}
.chosen-paper__change {
  margin-left: 12px;
  font-weight: 700;
}
.choice-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.choice-group.field--error {
  padding-left: 16px;
  border-left: 4px solid var(--error);
}
.choice-group__legend {
  margin-bottom: 8px;
  padding: 0;
  color: var(--navy);
  font: 600 1.375rem/1.3 var(--font-display);
}
.choice-group--nested {
  margin-top: 8px;
}
.choice-group__project {
  margin-bottom: 4px;
  padding: 0;
  color: var(--navy);
  font-weight: 700;
}
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}
.choice__input {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  accent-color: var(--navy);
}
.choice__label {
  cursor: pointer;
}
/* Radios, checkboxes and disclosure summaries get the Display settings panel's ring
   (a navy outline in a Sunshine halo, as .ds-option input below): the global Sunshine
   outline alone is about 1.27:1 on white. A summary with its own focus style keeps it. */
.choice__input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus-text);
  outline-offset: 2px;
  box-shadow: 0 0 0 7px var(--sunshine);
}
/* A Yes/No answer: the whole 44px row, radio and gap included, selects it (WCAG 2.5.8),
   for a head pointer, a mouse grid or a shaky hand. The label's box covers the row. */
.q__choices .choice {
  position: relative;
}
.q__choices .choice__label::before {
  content: "";
  position: absolute;
  inset: 0;
}

/* ---------- Build B: questionnaires ---------- */
/* Dashboard/Tools/questionnaire_category.html and questionnaire_finish.html: one page per
   category with every question on it, a section nav, AI drafts and Check and finish. */
.q-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.q-meta {
  color: var(--navy);
  font-size: 1.125rem;
}
.q-intro {
  max-width: 47.5rem;
}
.q-ai {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 24px;
  background: var(--putty);
}
.q-ai__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}
.q-ai__row form {
  margin: 0;
}
.q-ai__left {
  color: var(--navy);
  font-weight: 700;
}
.q-ai__status {
  font-weight: 700;
}
/* Kept rendered (visually hidden) while empty, so screen readers already know the
   live region when its first status is written into it. */
.q-ai__status:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
.q-ai__line--drafts {
  font-weight: 700;
}
.q-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--lilac);
  color: var(--navy);
  font: 700 0.8125rem/1.4 var(--font-text);
  white-space: nowrap;
  vertical-align: 0.1em;
}
.q-layout {
  display: grid;
  grid-template-columns: 17.5rem minmax(0, 1fr);
  align-items: start;
  gap: 48px;
  padding-bottom: 40px;
}

/* Section nav: a sticky column here, a disclosure on narrow screens (the @container below). */
.q-nav {
  position: sticky;
  top: 24px;
  min-width: 0;
}
.q-nav__summary {
  display: none;
}
.q-nav__list {
  padding: 0;
  border-top: 1px solid var(--steel);
  list-style: none;
}
.q-nav__link {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  min-height: 44px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--steel);
  color: var(--navy);
  text-decoration: none;
}
.q-nav__link:hover .q-nav__name {
  text-decoration: underline;
  text-decoration-color: var(--coral);
}
.q-nav__link[aria-current="page"] {
  background: var(--lilac-tint);
  box-shadow: inset 4px 0 0 var(--navy);
  font-weight: 700;
}
.q-nav__count {
  color: #505a5f;
  font-size: 0.9375rem;
  white-space: nowrap;
}
.q-nav__link[aria-current="page"] .q-nav__count {
  color: var(--navy);
}
.q-nav__link:focus-visible .q-nav__count {
  color: var(--focus-text);
}
.q-nav__link--done .q-nav__tick::before {
  content: "";
  display: block;
  width: 1.125rem;
  height: 1.125rem;
  transform: translateY(0.15em);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='11' fill='%231c285e'/%3E%3Cpath d='M6 11.5l3.2 3.2L16 8.5' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.q-nav__drafts {
  padding: 12px 8px 0;
  font-weight: 700;
}
.q-nav__drafts a {
  display: inline-block;
  padding-block: 4px;
}
.q-nav__finish {
  display: flex;
  margin-top: 12px;
  border-top: 1px solid var(--steel);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 0.125rem;
  text-underline-offset: 0.28125rem;
}
.q-nav__finish:hover {
  text-decoration-color: var(--coral);
}

/* The answers. */
.q-form {
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-width: 0;
  max-width: 52rem;
}
.q-form__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
}
.q-form__title {
  font: 600 1.75rem/1.25 var(--font-display);
}
.q-form__count {
  color: #505a5f;
}
/* The category's progress as a bar (25 Nov 2026): full width under the title and count. */
.q-form__bar {
  flex-basis: 100%;
  width: 100%;
  height: 8px;
  border: 0;
  background: var(--steel-60);
  color: var(--navy);
  appearance: none;
}
.q-form__bar::-webkit-progress-bar {
  background: var(--steel-60);
}
.q-form__bar::-webkit-progress-value {
  background: var(--navy);
}
.q-form__bar::-moz-progress-bar {
  background: var(--navy);
}
@media (forced-colors: active) {
  .q-form__bar {
    border: 1px solid CanvasText;
    forced-color-adjust: none;
    background: Canvas;
    color: Highlight;
  }
  .q-form__bar::-webkit-progress-bar {
    background: Canvas;
  }
  .q-form__bar::-webkit-progress-value {
    background: Highlight;
  }
  .q-form__bar::-moz-progress-bar {
    background: Highlight;
  }
}
/* Sub-topics on this page: a closed list of links, each with its answered count. */
.q-jump__summary {
  display: list-item;
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
}
.q-jump__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
}
.q-jump__count {
  color: #505a5f;
  white-space: nowrap;
}
.q-definition__summary,
.q__comments-summary,
.q-check__summary {
  display: list-item;
  padding-block: 10px;
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
}
/* Check and finish scrolls the category it reopens to the top (js/nihr_app.js). */
.q-check__summary {
  scroll-margin-top: 24px;
}
.q-definition__body {
  max-width: 47.5rem;
  padding: 20px 24px;
  background: var(--putty);
}
.q-section {
  --q-section-gap: 28px;
  display: flex;
  flex-direction: column;
  gap: var(--q-section-gap);
}
.q-section__title {
  padding-top: 24px;
  border-top: 1px solid var(--steel);
  font: 700 1.25rem/1.3 var(--font-display);
}
/* A section heading on a questionnaire page (Batch 19, QS-6): a heavier navy rule and
   more room above, so where one section ends and the next begins is plain among 50
   look-alike questions. Linkable (#s-<id>), so it keeps clear of the top of the screen
   as .q does. Check and finish's headings are not in a .q-section and stay as above. */
.q-section > .q-section__title {
  margin-top: 16px;
  border-top: 2px solid var(--navy);
  color: var(--navy);
  font-size: 1.375rem;
  scroll-margin-top: 24px;
}
/* "These questions count towards ...", under a section the screen order moved: it
   belongs to the heading, so it sits close to it rather than a question's gap away. */
/* 8px below the heading: take back most of the .q-section gap. */
.q-section__title + .q-section__counts,
.q-section__title + .q-section__progress {
  margin: calc(8px - var(--q-section-gap)) 0 0;
}
.q {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  scroll-margin-top: 24px;
}
.q--draft {
  padding-left: 16px;
  border-left: 4px solid var(--lilac);
}
/* The question a link opened (#q-<id>: Check and finish, Next unanswered), so it can be
   found among look-alike questions. A still rule, no animation; a border, so forced
   colours keep it. */
.q:target {
  padding-left: 16px;
  border-left: 4px solid var(--navy);
}
/* An AI draft opened from "AI drafts to check" keeps its own lilac rule: that is the
   cue that it is a draft, and the user came to check exactly this one. */
.q--draft:target {
  border-left-color: var(--lilac);
}
/* A legend is as wide as its longest word unless capped: at 200% text on a phone,
   "validated/standardized/optimized?" made the page 591px wide (WCAG 1.4.10). */
.q__legend {
  max-width: 100%;
  margin-bottom: 4px;
  padding: 0;
  overflow-wrap: break-word;
  color: var(--off-black);
  font-weight: 700;
  line-height: 1.5;
}
/* POCKET's question is a label, a flex item of .q: take the gap back so it sits as
   close to its box as a legend does. */
.q__label {
  margin-bottom: -4px;
}
.q__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0 32px;
}
.q__textarea {
  min-height: 6rem;
}
.q__comments .q__textarea {
  margin-top: 4px;
}
.q__draft-actions .link-button {
  display: inline-block;
  padding-block: 8px;
}
.q-skip {
  padding: 12px 16px;
  border-left: 4px solid var(--pending);
  background: var(--steel-60);
}
.q-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  padding-top: 24px;
  border-top: 1px solid var(--steel);
}
/* How far the sticky bar reaches past the answers: into the gap beside the section nav
   here, to the page edges in one column (the @container below). */
.q-form {
  --q-bar-bleed: 24px;
}
/* Save and its "taking longer" line. Usually no box of its own, so they lay out with
   Next unanswered and the line takes a row of its own after both. At a larger text
   size on a shorter screen it becomes the bar that sticks, on its own (below), so the
   sticky part of these rules only applies then. */
.q-actions__save {
  display: contents;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-inline: calc(-1 * var(--q-bar-bleed));
  padding: 12px var(--q-bar-bleed);
  border-top: 1px solid var(--steel);
  background: #fff;
  box-shadow: var(--shadow-bar);
}
.q-actions__stalled {
  flex-basis: 100%;
  order: 1;
  margin: 0;
}
/* Save and continue stays in view while answering, at every width, when the screen is
   tall enough for it (rem in a media query follows the browser's default font size, not
   the Display settings text size: 512px at the usual 16px).
   static/js/questionnaire.js keeps room for it so it never covers the focused field
   (WCAG 2.2 Focus Not Obscured). */
@media (min-height: 32rem) {
  .q-actions {
    position: sticky;
    bottom: 0;
    z-index: 1;
    margin-inline: calc(-1 * var(--q-bar-bleed));
    padding: 12px var(--q-bar-bleed);
    background: #fff;
    box-shadow: var(--shadow-bar);
  }
}
/* At a larger Display settings text size on a narrow screen the whole bar wraps to two
   rows (Next unanswered under Save) and would cover more than about 15% of a shorter
   screen. There only Save and its "taking longer" line stick, and Next unanswered stays
   at the end of the answers, after Save. Where the bar fits on one row (73px, from
   about 520px wide at 125%, 600px at 150%, 750px at 200%) the whole bar stays.
   Each size has its own fixed height limit: the measured two-row bar at 390px wide
   divided by 0.15 (125%: 119px, 150%: 125px, 200%: 169px, as Save wraps there). Fixed,
   not measured live, so the bar never jumps between the two as the page changes
   (owner decision O-9). Save alone is 72px (105px at 200% under about 420px wide,
   where it wraps; see the next rule). Without JavaScript data-text-size is never set,
   so the whole bar shows. These follow only the Display settings text size, not the
   browser's own font size setting. */
@media (max-width: 559.98px) and (min-height: 32rem) and (max-height: 799.98px) {
  html[data-text-size="125"] .q-actions {
    display: contents;
  }
  html[data-text-size="125"] .q-actions__save {
    display: flex;
  }
  html[data-text-size="125"] .q-actions > .link {
    align-self: flex-start;
  }
}
@media (max-width: 639.98px) and (min-height: 32rem) and (max-height: 839.98px) {
  html[data-text-size="150"] .q-actions {
    display: contents;
  }
  html[data-text-size="150"] .q-actions__save {
    display: flex;
  }
  html[data-text-size="150"] .q-actions > .link {
    align-self: flex-start;
  }
}
@media (max-width: 767.98px) and (min-height: 32rem) and (max-height: 1129.98px) {
  html[data-text-size="200"] .q-actions {
    display: contents;
  }
  html[data-text-size="200"] .q-actions__save {
    display: flex;
  }
  html[data-text-size="200"] .q-actions > .link {
    align-self: flex-start;
  }
}
/* At 200% on a phone under about 420px wide Save wraps to two lines, and even Save alone
   (105px) covers more than 15% of a screen under 700px tall. There nothing sticks: the
   whole bar stays at the end of the answers, as it was before it became sticky. */
@media (max-width: 419.98px) and (max-height: 699.98px) {
  html[data-text-size="200"] .q-actions {
    display: flex;
    position: static;
    margin-inline: 0;
    padding: 24px 0 0;
    background: none;
    box-shadow: none;
  }
  html[data-text-size="200"] .q-actions__save {
    display: contents;
  }
  html[data-text-size="200"] .q-actions > .link {
    align-self: auto;
  }
}

/* Check and finish. */
.q-finish {
  gap: 20px;
}
.q-check__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 12px 24px;
}
.q-finish__form {
  margin-top: 12px;
}
.q-warning {
  padding: 12px 16px;
  border-left: 4px solid var(--navy);
  background: var(--putty);
  font-weight: 700;
}

/* One column up to 75rem, so a landscape iPad (1024 to 1194px) gets the width of the
   page for the answers rather than about 350px beside the section nav. */
@container (max-width: 74.9375rem) {
  .q-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .q-nav {
    position: static;
  }
  .q-nav__details {
    border: 2px solid var(--navy);
  }
  .q-nav__summary {
    display: list-item;
    min-height: 48px;
    padding: 12px 16px;
    color: var(--navy);
    font-weight: 700;
    cursor: pointer;
  }
  .q-nav__where {
    margin-left: 8px;
    color: #505a5f;
    font-weight: 400;
  }
  .q-nav__list,
  .q-nav__drafts {
    margin-inline: 16px;
  }
  .q-nav__finish {
    margin: 12px 16px 16px;
    padding-inline: 8px;
  }
  /* The sticky save bar reaches the page edges. */
  .q-form {
    --q-bar-bleed: var(--app-margin);
  }
}

/* ---------- Account pages (auth_nihr.html: log in) ---------- */
.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
/* In the page flow here (not fixed), so it never covers the form. */
.auth-page .cookie-banner {
  position: static;
  max-height: none;
  box-shadow: none;
}
/* The header is the same as on every other page. The space below it is kept compact
   so log in fits a 1440x900 laptop screen with its footer (the footer used to sit a
   few pixels into view and looked cut off). Longer forms scroll. */
.auth-main {
  display: flex;
  flex: 1 0 auto;
  justify-content: center;
  align-items: flex-start;
  padding: 16px var(--page-gutter) 24px;
  background: var(--steel-60);
}
.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 30rem;
  padding: 28px 40px;
  background: #fff;
  box-shadow: var(--shadow-card);
}
/* 32px from the heading to the first action, 32px above the main button. */
.auth-panel__title {
  margin-bottom: 8px;
  font: 600 2rem/1.2 var(--font-display);
}
.form > .btn {
  margin-top: 8px;
}
.auth-panel__foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.auth-panel__foot a {
  white-space: nowrap;
}
.sso {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Google's neutral sign-in button: grey border, near-black text, the G mark. */
.btn--sso {
  width: 100%;
  min-height: 48px;
  gap: 12px;
  border: 1px solid #747775;
  background: #fff;
  color: #1f1f1f;
  font-size: 1rem;
  font-weight: 500;
}
.btn--sso::after {
  content: none;
}
.btn--sso:hover {
  background: #f2f2f2;
  color: #1f1f1f;
}
.btn--sso__mark {
  flex: none;
  width: 20px;
  height: 20px;
}
/* "or use your email address" between two hairlines, nearer the form. */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-block: -4px;
  color: var(--off-black);
  font-size: 0.875rem;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1 1 0;
  border-top: 1px solid var(--rule);
}
.auth-footer {
  padding-block: 14px;
  background: var(--navy);
  color: #fff;
  font-size: 0.8125rem;
}
/* Links and the legal line on one row where they fit. */
.auth-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 24px;
}
.auth-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.auth-footer a,
.auth-footer a:hover {
  color: #fff;
}
.auth-footer a:focus-visible {
  color: var(--focus-text);
}
/* ---------- Text pages (Documents/accessibility_statement.html) ---------- */
.doc-head {
  padding-block: 56px;
  background: var(--steel-60);
}
.doc-head__title {
  font: 600 3rem/1.1 var(--font-display);
}
.doc {
  max-width: 45rem;
}
.doc h2 {
  margin: 48px 0 16px;
  font: 600 2rem/1.2 var(--font-display);
}
.doc h3 {
  margin: 32px 0 12px;
  font: 700 1.375rem/1.25 var(--font-display);
}
.doc p,
.doc ul {
  margin-bottom: 16px;
}
.doc ul {
  padding-left: 1.5em;
}
.doc li + li {
  margin-top: 8px;
}
.doc__address {
  margin-bottom: 16px;
  font-style: normal;
}
/* Privacy policy cookie table: three short columns that fit a phone without scrolling.
   Words stay whole; "cookie_accepted" may break only at its <wbr>. */
.doc__table {
  width: 100%;
  margin-bottom: 16px;
  border-collapse: collapse;
}
.doc__table caption {
  margin-bottom: 8px;
  font-weight: 700;
  text-align: left;
}
.doc__table th,
.doc__table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
/* Cookie names are row headers, in ordinary text so the table stays as narrow as before. */
.doc__table tbody th {
  font-weight: 400;
}
.doc__table thead th {
  border-bottom: 2px solid var(--navy);
  color: var(--navy);
}
/* A fact the client has to supply: visible on purpose, so it can't go live unnoticed. */
.placeholder {
  padding: 0 4px;
  border: 2px dashed #000;
  background: var(--sunshine);
  color: #000;
  font-weight: 700;
}
@media (forced-colors: active) {
  .placeholder {
    border-color: CanvasText;
  }
}

/* ---------- Display settings panel (_display_settings_panel.html) ---------- */
/* The footer buttons look like the links beside them. */
.ds-trigger {
  font-weight: 400;
  text-align: left;
}
.site-footer .ds-trigger,
.auth-footer .ds-trigger,
.site-nav__actions .ds-trigger {
  color: #fff;
}
.site-footer .ds-trigger:focus-visible,
.auth-footer .ds-trigger:focus-visible,
.site-nav__actions .ds-trigger:focus-visible {
  color: var(--focus-text);
}
.app-footer .ds-trigger {
  padding-block: 12px;
}

/* ---------- Back to top (_back_to_top.html) ----------
   js/back_to_top.js removes [hidden] once the visitor has scrolled half a screen on a
   long page, and sets how much of the bar is filled. A 56px square navy button, like
   the site's other buttons, with a 2px white edge so it still stands out over the navy
   footer. Sized in px, not rem: it holds no text, and at the larger Display settings
   text sizes a bigger button would only cover more of the page. */
.btt {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  background: var(--navy);
  box-shadow: 0 0 0 2px #fff, var(--shadow-hover);
  color: #fff;
  animation: btt-in var(--ease) both;
}
@keyframes btt-in {
  from {
    opacity: 0;
  }
}
.btt:hover {
  background: var(--navy-hover);
}
/* The progress bar: a 4px coral line along the bottom edge (like the coral keylines),
   on a faint track, filling left to right as the page scrolls. */
.btt__progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
}
.btt__bar {
  display: block;
  height: 100%;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 120ms linear;
}
.btt__arrow {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Focus: the Sunshine fill of the site's links, and a dark outline just outside it.
   The extra specificity beats the stronger-focus and forced-colours offsets, and the stronger-focus white for the footers it sits
   in (it floats over the page, which is mostly white). */
.btt:focus-visible {
  background: var(--sunshine);
  box-shadow: 0 0 0 2px #fff;
  color: var(--focus-text);
  outline: 3px solid var(--focus-text);
}
html body .btt.btt:focus-visible {
  outline-color: var(--focus-text) !important;
  outline-offset: 4px !important;
}
/* Leave room for it when the browser scrolls a focused element into view: its 24px
   inset, its 56px and a gap. */
html.has-btt {
  scroll-padding-bottom: 96px;
}
@media (forced-colors: active) {
  .btt {
    border: 2px solid LinkText;
  }
  .btt__progress {
    forced-color-adjust: none;
    background: GrayText;
  }
  .btt__bar {
    forced-color-adjust: none;
    background: CanvasText;
  }
}
@media print {
  .btt {
    display: none !important;
  }
}
/* A sheet on the right, full height, so the page behind shows each change. Capped at
   640px so at the larger text sizes the page still shows beside it. */
.ds-dialog {
  width: min(30rem, 100%, 640px);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0 0 0 auto;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-left: 4px solid var(--coral);
  background: #fff;
  color: var(--off-black);
}
.ds-dialog::backdrop {
  background: rgba(28, 40, 94, 0.25);
}
.ds-dialog__inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100%;
  padding: 0 32px 32px;
}
/* The head is one row: Close, then the status line beside it (or below it when the
   sheet is narrow). The title above it scrolls away, so the part that sticks stays
   short. Its own top padding means nothing scrolls past above it when it sticks. */
.ds-dialog__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: -12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  background: #fff;
}
/* Close and the status stay in view while the sheet scrolls (at a large text size the
   options run to several screens), when the screen is tall enough for it. */
@media (min-height: 32rem) {
  .ds-dialog__head {
    position: sticky;
    top: 0;
    z-index: 1;
  }
}
/* On a phone at the two largest text sizes the head would cover a fifth of the screen
   or more, so there it scrolls with the options (the script then repeats each
   message under the changed option). */
@media (max-width: 600px) {
  html[data-text-size="150"] .ds-dialog__head,
  html[data-text-size="200"] .ds-dialog__head {
    position: static;
  }
}
/* Names each change ("Text size: Larger. Saved."). No height is kept for it: beside
   Close it adds none, and below Close it moves the options once, after a change the
   visitor has just made. */
.ds-dialog__status {
  flex: 1 1 12rem;
  margin: 0;
  color: var(--navy);
  font-weight: 700;
}
/* The same message, under the changed option, when the status is out of view. */
.ds-dialog__echo {
  margin: 0;
  color: var(--navy);
  font-weight: 700;
}
.ds-dialog__title {
  padding-top: 32px;
  font: 600 2rem/1.2 var(--font-display);
}
.ds-dialog__close {
  min-height: 44px;
}
.ds-group {
  margin: 0;
  padding: 0;
  border: 0;
}
.ds-group__legend {
  margin-bottom: 12px;
  padding: 0;
  color: var(--navy);
  font: 700 1.25rem/1.3 var(--font-display);
}
.ds-choices {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ds-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
}
.ds-choice input,
.ds-option input {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  accent-color: var(--navy);
  cursor: pointer;
}
.ds-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
/* Checkbox, then its label, then the hint lined up under the label. */
.ds-option {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  align-items: start;
}
.ds-option input {
  margin-top: 0.125rem;
}
.ds-option__label {
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
}
.ds-option__hint {
  grid-column: 2;
  color: #505a5f;
  font-size: 0.9375rem;
  line-height: 1.4;
}
.ds-choice input:focus-visible,
.ds-option input:focus-visible {
  outline: 3px solid var(--focus-text);
  outline-offset: 2px;
  box-shadow: 0 0 0 7px var(--sunshine);
}
.ds-dialog__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
html.ds-contrast .ds-option__hint {
  color: var(--navy);
}

/* ---------- Build C: reports ---------- */
/* Report pages (Tools/report.html, Projects/project_report.html): summary, actions, text version. */
.report-head {
  align-items: flex-start;
}
.report-head__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.report-head__meta {
  color: var(--navy);
  font-size: 1.125rem;
  overflow-wrap: anywhere;
}
.report-status {
  align-self: flex-start;
  padding: 4px 12px;
  border-left: 4px solid var(--navy);
  background: var(--steel-60);
  color: var(--navy);
  font-weight: 700;
}
.report-summary {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 47.5rem;
}
.report-summary__item {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--steel);
}
.report-summary__item .report-head__meta {
  margin-top: -16px;
  font-size: 1rem;
}
.report-summary__title {
  font: 600 1.75rem/1.25 var(--font-display);
  overflow-wrap: anywhere;
}
.report-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.report-block__title {
  color: var(--navy);
  font: 600 1.5rem/1.3 var(--font-display);
}
.report-score__overall {
  font-size: 1.25rem;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
}
.report-table th,
.report-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.report-table thead th {
  border-bottom: 2px solid var(--navy);
  color: var(--navy);
}
.report-table tbody th {
  font-weight: 700;
}
.report-table ul {
  padding-left: 1.25em;
}
/* The project summary can have a column per questionnaire: it alone may scroll sideways. */
.report-table__wrap {
  max-width: 100%;
  overflow-x: auto;
}
.gap-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  list-style: none;
}
.gap-list__summary {
  padding-block: 8px;
  color: var(--navy);
  font: 700 1rem/1.5 var(--font-text);
}
.qa__question:focus-visible {
  outline: 3px solid transparent;
  background: var(--sunshine);
  color: var(--focus-text);
  box-shadow: 0 0 0 4px var(--sunshine), 0 2px 0 4px var(--focus-text);
}
.gap-list__questions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 12px;
  padding: 16px 16px 16px 2.25em;
  background: var(--putty);
}
/* "6 questions have no answer." A notice, not an error, so navy rather than coral. */
.report-warning {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 16px 20px;
  border-left: 4px solid var(--navy);
  background: var(--lilac-tint);
}
.report-warning a {
  font-weight: 700;
}
.report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}
.report-actions-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.report-actions__save .link-button {
  padding-block: 12px;
}
.report-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 47.5rem;  /* the same reading width as .report-summary above it */
  padding: 32px 0 40px;
  border-top: 1px solid var(--steel);
}
.report-text__report {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.report-text__heading {
  font: 600 1.375rem/1.3 var(--font-display);
}
.report-text__section {
  margin-top: 8px;
  color: var(--navy);
  font: 700 1.125rem/1.3 var(--font-display);
}
/* Collapsible categories (js/report_sections.js): the heading holds a full-width button
   with the category's name, its answered count and a chevron; a rule between categories. */
.report-text__count {
  margin-top: -8px;
  font-size: 0.9375rem;
}
.report-text__group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.report-text__group--collapsible {
  gap: 0;
  border-bottom: 1px solid var(--rule);
}
.report-text__group--collapsible .report-text__section {
  margin-top: 0;
}
.report-text__group--collapsible .report-text__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
}
/* hidden="until-found" keeps the answers findable with the browser's Find: it must not be
   display: none (the [hidden] rule above), only skipped. */
.report-text__body[hidden="until-found"] {
  display: block !important;
  padding-bottom: 0 !important;
  content-visibility: hidden;
}
.report-text__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 44px;
  padding: 16px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.report-text__toggle-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.report-text__toggle-count {
  color: var(--off-black);
  font: 400 0.9375rem/1.4 var(--font-text);
}
.report-text__toggle:hover .report-text__toggle-name {
  text-decoration: underline;
  text-decoration-color: var(--coral);
  text-decoration-thickness: 0.1875rem;
  text-underline-offset: 0.28125rem;
}
.report-text__chevron {
  flex: none;
  width: 10px;
  height: 10px;
  margin: 0 6px 4px 0;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.report-text__toggle[aria-expanded="true"] .report-text__chevron {
  margin-bottom: -4px;
  transform: rotate(-135deg);
}
@media (prefers-reduced-motion: reduce) {
  .report-text__chevron {
    transition: none;
  }
}
@media print {
  .report-text__toggle-all,
  .report-text__chevron {
    display: none !important;
  }
  .report-text__body[hidden] {
    display: flex !important;
    content-visibility: visible;
  }
}
.report-table--qa td:last-child {
  width: 30%;
}
/* Each question is its row's header (read with its answer), in ordinary text. */
.report-table--qa tbody th {
  font-weight: 400;
}
/* Written answers (POCKET): each question is a heading with the answer under it at
   full width, not squeezed into a 30% column. */
.report-qa {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}
.report-qa__question {
  color: var(--off-black);
  font: 700 1rem/1.5 var(--font-text);
}
.report-qa__answer {
  max-width: 47.5rem;
}

/* "Send to the NIHR IVD team" (_send_to_team_dialog.html, send_report.html). */
.send-report__intro {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Why there is no Send button (no consent yet): the intro's gap, so it doesn't run on.
   The page version (send_report.html) already spaces it in .app-form. */
.app-dialog .send-report__consent {
  margin-top: 12px;
}
.send-consent {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 24px 0 0;
  padding: 0;
  border: 0;
}
.send-consent__legend {
  margin-bottom: 4px;
  padding: 0;
  color: var(--navy);
  font-weight: 700;
}
.send-report .choice {
  align-items: flex-start;
}
.send-report .choice__input {
  margin-top: 2px;
}

/* Project report select. */
.report-select__group + .report-select__group {
  margin-top: 16px;
}
.report-select__all {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--steel);
}
.report-select .choice {
  align-items: flex-start;
}
.report-select .choice__input {
  margin-top: 2px;
}
.empty-state {
  max-width: 47.5rem;
  padding-bottom: 40px;
}
.empty-state a {
  font-weight: 700;
}

/* The Reports page: a table, stacked cards on narrow screens. */
.report-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 24px;
}
.report-filters .field {
  flex: 0 1 18rem;
  min-width: 0;
}
/* No width: 100%: as a flex item of .app-main it stretches between the page margins. */
.reports-table {
  margin-bottom: 40px;
  border-collapse: collapse;
}
/* break-word, not anywhere: a word breaks only when it can't fit a line on its own, and
   short columns keep the width of their longest word ("November", "Mark as reviewed"),
   so nothing splits mid-word at 1024px. The report name may still break anywhere: it
   takes the slack, so a very long word there can't push the table wider than the page. */
.reports-table th,
.reports-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}
.reports-table thead th {
  border-bottom: 2px solid var(--navy);
  color: var(--navy);
}
/* min-width: "anywhere" lets the name shrink to almost nothing, and the auto layout
   then gives its width to the one-line Date and Action columns, so the column that
   tells reports apart is the narrowest. 12rem keeps it readable and grows with the
   text size; the cards below drop it. */
.reports-table__report {
  min-width: 12rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
/* In the table layout a date ("23 November 2026,") and each action stay on one line;
   the cards below let them wrap again, for 320px at large text sizes. */
.reports-table__nowrap {
  white-space: nowrap;
}
.reports-table__kind {
  display: block;
  color: #505a5f;
  font-weight: 400;
  font-size: 0.9375rem;
}
.reports-table__actions {
  white-space: normal;
}
.reports-table__actions a {
  display: inline-block;
  margin-right: 16px;
  padding-block: 4px;
  font-weight: 700;
  white-space: nowrap;
}
.reports-table__actions .link-button {
  white-space: nowrap;
}
/* "Send to the NIHR IVD team" may wrap between words: on one line it would take a fifth
   of the table at 1024px. */
.reports-table__actions .reports-table__send {
  white-space: normal;
}
/* Fixed lines: View and Download, then Send, then Delete on its own with a gap, so it
   is not pressed for Send. */
.reports-table__action-line {
  display: block;
}
.reports-table__action-line--apart {
  margin-top: 8px;
}
.reports-table__delete {
  color: var(--error);
}

/* Tool About pages (Tools/landing.html). */
.landing {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-bottom: 40px;
}
.landing__intro {
  max-width: 47.5rem;
  font-size: 1.25rem;
}
/* Batch 11: questionnaires in progress (the project page's tool rows) above
   "Start from a project". With none, the button alone looks as before. */
.landing__start {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
/* The In progress list's last row has no bottom border, so Start from a project gets
   24px above it and reads as its own action, not another row's button. */
.landing__progress + .btn {
  margin-top: 8px;
}
.landing__columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
}
.landing__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.landing__section + .landing__section {
  margin-top: 32px;
}
.landing__title {
  font: 600 1.75rem/1.25 var(--font-display);
}
.landing__subtitle {
  margin-top: 8px;
  color: var(--navy);
  font: 700 1.125rem/1.3 var(--font-display);
}
.qa {
  border-bottom: 1px solid var(--steel);
}
.qa__question {
  padding-block: 12px;
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
}
.qa__answer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
}
.landing__figure {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
.landing__figure img {
  max-width: 100%;
  height: auto;
}
.landing__figure figcaption {
  font-size: 0.9375rem;
}
.landing__licence {
  font-size: 0.875rem;
}

/* Contacts. */
.contact-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 0 32px;
  padding: 0 0 40px;
  list-style: none;
}
.contact-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-block: 16px;
  border-bottom: 1px solid var(--steel);
}
.contact-row__photo {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--steel-60);  /* fills the circle while the photo loads */
}
.contact-row__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.contact-row__name {
  font: 700 1.125rem/1.3 var(--font-display);
}
.contact-row__role {
  font-size: 0.9375rem;
}
.contact-row__email {
  font-weight: 700;
  overflow-wrap: anywhere;
}

@container (max-width: 56.25rem) {
  .landing__columns {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Report tables become stacked cards up to 56.25rem: five columns don't fit a tablet
     or a large text size without squeezing every word (role="table" etc. in the
     templates keep the table semantics that display: block removes). */
  .reports-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .reports-table,
  .reports-table tbody,
  .reports-table tr,
  .reports-table th,
  .reports-table td {
    display: block;
  }
  /* The border is the card's edge in High contrast (--rule turns navy) and forced
     colours, where the shadow goes. */
  .reports-table__row {
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--rule);
    background: #fff;
    box-shadow: var(--shadow-soft);
  }
  .reports-table th,
  .reports-table td {
    padding: 4px 0;
    border: 0;
  }
  .reports-table__report {
    min-width: 0;
  }
  .reports-table td[data-label]::before {
    content: attr(data-label) ": ";
    /* Screen readers already announce the column header; skip the visible label. */
    content: attr(data-label) ": " / "";
    font-weight: 700;
  }
  .reports-table__actions {
    padding-top: 8px;
  }
  /* Cards may wrap anything: at 320px and 200% text "Send to the NIHR IVD team" or a
     date is wider than the card. */
  .reports-table__nowrap,
  .reports-table__actions a,
  .reports-table__actions .link-button {
    white-space: normal;
  }
}

@container (max-width: 37.5rem) {
  .report-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .report-actions .btn {
    white-space: normal;
    text-align: center;
  }
  .report-filters .field {
    flex-basis: 100%;
  }
}

/* ---------- Responsive ---------- */
/* The breakpoints are container queries on body (see "Base") in rem, not px media queries.
   rem here follows the root font size, so when someone picks a larger text size in Display
   settings (or in their browser) the page switches to the narrower layout, exactly as it
   does when they zoom. At the default size 1rem = 16px, so the widths are the old ones
   (measured inside the scrollbar rather than including it). */
/* The dashboard header's descriptor needs 1324px on one line; wrap it, then hide it. */
@container (max-width: 82.6875rem) {
  .app-identity__descriptor {
    white-space: normal;
  }
  .app-identity__descriptor b {
    display: block;
  }
}

@container (max-width: 73.75rem) {
  /* Two rows, as on the HRC Network site: descriptor, coral hairline, then links. */
  .site-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .site-descriptor {
    align-self: stretch;
    padding-block: 0.875rem 0.75rem;
    border-bottom: 1px solid rgba(252, 93, 93, 0.6);
    white-space: normal;
  }
  .site-nav {
    min-height: 3.25rem;
  }
  .site-nav__links {
    gap: 2rem;
  }
  .app-identity__rule,
  .app-identity__descriptor {
    display: none;
  }
  .team {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@container (max-width: 68.75rem) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero .wrap {
    gap: 40px;
  }
  .hero__media {
    flex-basis: 420px;
    height: 340px;
  }
  .contact__details {
    flex-basis: 420px;
  }
  .site-footer__cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container (max-width: 63.9375rem) {
  .app-header {
    padding: 16px 20px;
  }
  /* Let the logo shrink on narrow phones so the Menu button stays on screen. */
  .app-identity,
  .app-identity__logo {
    flex: 0 1 auto;
    min-width: 0;
  }
  .app-controls {
    display: none;
  }
  .app-menu-button {
    display: inline-flex;
  }
  .app-descbar {
    display: block;
    padding: 12px 20px;
    background: var(--navy);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.4;
  }
  .app-descbar__second {
    display: block;
  }
  .app-body {
    flex-direction: column;
  }
  .js .app-sidebar {
    display: none;
  }
  .js .app-sidebar.is-open {
    display: flex;
  }
  .app-sidebar {
    flex-basis: auto;
    padding: 0 0 24px;
  }
  .app-sidebar__account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  }
  .app-sidebar__account .name {
    font-weight: 700;
  }
  .app-sidebar__account-links {
    display: flex;
    gap: 20px;
  }
  .app-sidebar__account a,
  .app-sidebar__account .link-button {
    color: #fff;
    font-weight: 400;
  }
  /* White text would vanish on the Sunshine focus block; use the focus text colour. */
  .app-sidebar__account a:focus-visible,
  .app-sidebar__account .link-button:focus-visible {
    color: var(--focus-text);
  }
  /* Groups sit 24px apart with the rule in the middle; the exit links, which leave
     the service, get a rule of their own. */
  .app-nav__group {
    padding: 12px;
  }
  .app-nav__group + .app-nav__group {
    margin-top: 0;
  }
  .app-sidebar__signed-in {
    display: none;
  }
  .app-sidebar__exit {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 28px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.4);
  }
  .app-sidebar__exit a {
    color: #fff;
  }
  .app-sidebar__exit .link__text {
    color: #fff;
  }
  .app-main {
    --app-margin: 20px;
    gap: 32px;
    padding-top: 32px;
  }
  .firstrun {
    padding: 24px 20px;
  }
  .tools-band {
    padding: 32px 20px;
  }
  .app-footer {
    padding: 8px 20px 16px;
  }
}

@container (max-width: 56.25rem) {
  /* A container query can't restyle body itself, so the spacing tokens are set on its children. */
  body > * {
    --section-y: 56px;
    --block-gap: 32px;
  }
  .menu-button {
    display: inline-flex;
    min-height: 44px;
  }
  .no-js .menu-button {
    display: none;
  }
  /* Logo and Menu in the white bar; the descriptor stays in the navy bar below. */
  .site-topbar .wrap {
    padding-block: 16px;
  }
  .site-topbar__actions {
    display: none;
  }
  /* A zero basis lets the logo shrink instead of pushing Menu onto the next line; the cap
     stops the link (and its focus fill) stretching past the image. */
  .site-logo {
    flex: 1 1 0;
    max-width: 288px;
    margin-left: -10px;
  }
  .menu-button {
    margin-left: auto;
  }
  .site-logo img {
    width: 100%;
    max-width: 298px;
  }
  .site-descriptor {
    padding-block: 0.75rem;
    border-bottom: 0;
    font-size: 0.9375rem;
  }
  .site-descriptor__second {
    display: block;
  }
  .site-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-height: 0;
    padding-block: 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }
  .js .site-nav {
    display: none;
  }
  .js .site-nav.is-open {
    display: flex;
  }
  .site-nav__links {
    flex-direction: column;
    gap: 0;
  }
  .site-nav__link {
    padding-block: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }
  .site-nav__link::before {
    display: none;
  }
  /* The menu marks the current page with a coral bar on the left instead. */
  .site-nav__link[aria-current="page"] {
    padding-left: 16px;
    box-shadow: inset 4px 0 0 var(--coral);
  }
  .site-nav__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding-top: 20px;
  }
  .hero .wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 40px;
  }
  .hero__title {
    font-size: 2.25rem;
  }
  .hero__standfirst,
  .section-head__standfirst {
    font-size: 1.125rem;
  }
  .hero__media {
    flex: none;
    height: auto;
    /* Room above the photo for the arc, which rises 17.75% of the photo's height. */
    margin-top: 13.7%;
    aspect-ratio: 13 / 10;
  }
  .section-head__title {
    font-size: 1.75rem;
  }
  .finder {
    padding: 24px 20px 20px;
  }
  .tiles,
  .tiles--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  /* An odd last tile takes the whole row instead of sitting alone beside a gap. */
  .tiles > .tile:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .stepper__step {
    font-size: 0.8125rem;
  }
  /* minmax(0, …) so a long word can't stop the column shrinking on a phone. */
  .tool-cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .tool-card p,
  .stat__label {
    overflow-wrap: anywhere;
  }
  .tool-card {
    min-height: 0;
  }
  .tool-card__names {
    min-height: 0;
  }
  .research-cards {
    grid-template-columns: 1fr;
  }
  .research-card {
    min-height: 0;
  }
  .team {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .contact .wrap {
    flex-direction: column;
    gap: 40px;
  }
  .contact__details {
    flex-basis: auto;
    padding: 24px 0 0;
    border-top: 3px solid var(--coral);
    border-left: 0;
  }
  .page-head__title,
  .doc-head__title {
    font-size: 2.25rem;
  }
  .doc-head {
    padding-block: 40px;
  }
  .doc h2 {
    font-size: 1.75rem;
  }
  .tools-band {
    grid-template-columns: 1fr;
  }
  .pipeline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }
}

@container (max-width: 37.5rem) {
  .site-topbar .wrap {
    gap: 12px;
  }
  /* Long legal link text must wrap on narrow or enlarged layouts. */
  .form__legal a {
    white-space: normal;
  }
  /* On phones the panel is the page: full width, lined up with the header. */
  .auth-main {
    padding: 0;
    background: #fff;
  }
  .auth-panel {
    max-width: none;
    padding: 32px var(--page-gutter);
    box-shadow: none;
  }
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero__actions .link {
    align-self: flex-start;
  }
  .steps {
    grid-template-columns: 1fr;
  }
  .team {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 16px;
  }
  .site-footer {
    padding-top: 64px;
  }
  .site-footer__cols {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .stat__num {
    font-size: 2.5rem;
  }
  .finder__actions .btn {
    flex: 1 1 auto;
  }
  .app-tool-card__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .app-tool-card__actions .btn {
    min-width: 0;
  }
  /* Project pages: one column, the main buttons full width. */
  .tool-status {
    grid-template-columns: minmax(0, 1fr);
  }
  .tool-status__actions,
  .tool-status:has(> .field__hint) .tool-status__actions {
    grid-column: 1;
    grid-row: auto;
  }
  .tool-status__actions .btn {
    flex: 1 1 auto;
  }
  .add-paper__row,
  .form__actions,
  .paper-actions,
  .app-dialog__actions {
    flex-direction: column;
    align-items: stretch;
  }
  /* The timeout dialog's buttons sit in their own forms: stretch them too. */
  .app-dialog__actions > form {
    display: flex;
    flex-direction: column;
  }
  .form__actions .link,
  .paper-actions .link-button {
    align-self: flex-start;
  }
  .hub-step__action {
    align-self: stretch;
  }
  .hub-step__action .btn,
  .disclosure__summary {
    width: 100%;
  }
  .hub-step__title {
    font-size: 1.5rem;
  }
}

/* Very narrow: a phone with a larger text size (Display settings or the browser's), or
   a phone under 320px. Everything goes to one column and long button or link text wraps.
   19.99rem, not 20rem, so a 320px phone at normal text size keeps its usual layout. */
@container (max-width: 19.99rem) {
  .tiles,
  .tiles--3,
  .team {
    grid-template-columns: 1fr;
  }
  .pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 12px;
  }
  .btn,
  .site-nav__link,
  .form__legal a,
  .auth-panel__foot a,
  .stat__num {
    white-space: normal;
  }
  .btn {
    line-height: 1.25;
    text-align: center;
  }
  .stat {
    flex-wrap: wrap;
  }
  /* Three steps don't fit side by side here, so stack them: number, then label, one
     step per row (the connecting lines are dropped). */
  .stepper {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .stepper__step {
    flex-direction: row;
    gap: 12px;
    text-align: left;
  }
  .stepper__marker {
    width: auto;
  }
  .stepper__line {
    display: none;
  }
  /* Last resort for a single long word ("Recommended") on the narrowest screens. */
  .stepper__label {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .auth-panel {
    padding-inline: 16px;
  }
  /* Big headings: smaller steps, and long words hyphenate rather than run off the page. */
  h1,
  h2,
  h3,
  .ds-group__legend {
    hyphens: auto;
    overflow-wrap: anywhere;
  }
  .hero__title,
  .page-head__title,
  .doc-head__title {
    font-size: 1.875rem;
  }
  .section-head__title,
  .result__name,
  .tool-card__name,
  .auth-panel__title,
  .doc h2,
  .ds-dialog__title {
    font-size: 1.5rem;
  }
  .stat__num,
  .steps__num {
    font-size: 2rem;
  }
  .ds-dialog__inner {
    padding: 0 16px 24px;
  }
  .ds-dialog__title {
    padding-top: 24px;
  }
}

/* Reduce animation: follows the device unless the visitor has chosen in Display settings
   (ds-reduce-motion turns it on, ds-allow-motion keeps animation despite the device). */
@media (prefers-reduced-motion: reduce) {
  html:not(.ds-allow-motion) *,
  html:not(.ds-allow-motion) *::before,
  html:not(.ds-allow-motion) *::after {
    transition: none !important;
    animation: none !important;
  }
}
html.ds-reduce-motion *,
html.ds-reduce-motion *::before,
html.ds-reduce-motion *::after {
  transition: none !important;
  animation: none !important;
}

/* ---------- Display settings: what each choice does ----------
   The inline script in each layout's head sets these on <html> before the page paints.
   They only restyle; they never change the content or its ARIA. */

/* Text size. Everything is sized in rem, so this reaches all text, and the container
   queries above switch to the narrower layouts as the text grows. */
html[data-text-size="125"] {
  font-size: 125%;
}
html[data-text-size="150"] {
  font-size: 150%;
}
html[data-text-size="200"] {
  font-size: 200%;
}
/* With larger text the roles wrap anyway, so don't reserve two lines. */
html[data-text-size] .person__role {
  min-height: 0;
}

/* Text spacing at the WCAG 2.2 success criterion 1.4.12 values. */
html.ds-spacing body,
html.ds-spacing body * {
  line-height: 1.5 !important;
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}
html.ds-spacing p:not(:last-child) {
  margin-bottom: 2em !important;
}

/* Underline all links, including navigation and links styled as buttons. */
html.ds-underline a,
html.ds-underline a:hover,
html.ds-underline a .link__text {
  text-decoration-line: underline !important;
  text-decoration-thickness: 0.125rem;
  text-underline-offset: 0.2em;
}

/* High contrast: NIHR navy (13.9:1) on white, no tints behind text, no shadows, heavier
   borders. Colours are not inverted. Turned on automatically by the head script when the
   device asks for more contrast, unless the visitor has turned it off. */
html.ds-contrast {
  --off-black: #1c285e;
  --placeholder: #1c285e;
  --steel: #1c285e;
  --steel-60: #fff;
  --putty: #fff;
  --rule: #1c285e;
  --navy-25: #1c285e;
  --navy-35: #1c285e;
  --pending: #5a5a5a;
  --shadow-card: none;
  --shadow-soft: none;
  --shadow-hover: none;
  --shadow-bar: none;
}
html.ds-contrast .tools-band,
html.ds-contrast .section--steel,
html.ds-contrast .hero,
html.ds-contrast .auth-main {
  background: #fff;
}
html.ds-contrast .finder,
html.ds-contrast .tool-card,
html.ds-contrast .research-card,
html.ds-contrast .app-tool-card,
html.ds-contrast .auth-panel,
html.ds-contrast .firstrun,
html.ds-contrast .app-dialog,
html.ds-contrast .message {
  border: 2px solid var(--navy);
}
html.ds-contrast .message {
  border-left-width: 6px;
}
html.ds-contrast .tile,
html.ds-contrast .chip,
html.ds-contrast .btn--outline,
html.ds-contrast .btn--outline-light,
html.ds-contrast .stepper__num {
  border-width: 2px;
}
html.ds-contrast .result,
html.ds-contrast .steps__item,
html.ds-contrast .card-foot,
html.ds-contrast .person__bio,
html.ds-contrast .project,
html.ds-contrast .app-header,
html.ds-contrast .app-footer,
html.ds-contrast .auth-panel__foot,
html.ds-contrast .divider::before,
html.ds-contrast .divider::after,
html.ds-contrast .app-nav__group + .app-nav__group,
html.ds-contrast .app-sidebar__exit,
html.ds-contrast .app-sidebar__account {
  border-width: 2px;
}
html.ds-contrast .btn--secondary {
  border: 2px solid var(--navy);
}
/* The loading tint turns white here, so frame the photo slots or they read as gaps. */
html.ds-contrast .person__photo,
html.ds-contrast .contact-row__photo {
  outline: 1px solid var(--navy);
  outline-offset: -1px;
}
html.ds-contrast .field__hint {
  color: var(--navy);
}
html.ds-contrast .app-nav__sublink,
html.ds-contrast .app-nav__label,
html.ds-contrast .app-sidebar__signed-in {
  color: #fff;
}
html.ds-contrast .app-nav__sub ul,
html.ds-contrast .app-nav__group + .app-nav__group,
html.ds-contrast .app-sidebar__exit,
html.ds-contrast .app-sidebar__account,
html.ds-contrast .site-footer__legal {
  border-color: #fff;
}
html.ds-contrast .site-nav__link {
  border-color: #fff;
}
html.ds-contrast .gfx,
html.ds-contrast .hero__arc,
html.ds-contrast .contact::before {
  display: none;
}

/* Stronger focus outline: a 4px ring set 3px away, on top of the usual Sunshine fill.
   Dark on light backgrounds, white on navy ones (so it stands apart from the Sunshine fill). */
/* Greyscale (Display settings). A filter on the root element doesn't create a
   containing block, so fixed and sticky parts still work. Dialogs sit in the top
   layer, so they get the filter as well. */
html.ds-greyscale,
html.ds-greyscale dialog,
html.ds-greyscale dialog::backdrop {
  filter: grayscale(1);
}
html.ds-focus :focus-visible,
html.ds-focus .field__input:focus {
  outline: 4px solid var(--focus-text) !important;
  outline-offset: 3px !important;
}
html.ds-focus .site-navbar :focus-visible,
html.ds-focus .site-footer :focus-visible,
html.ds-focus .auth-footer :focus-visible,
html.ds-focus .app-sidebar :focus-visible,
html.ds-focus .cookie-banner :focus-visible {
  outline-color: #fff !important;
}

/* Windows High Contrast and other forced colours: the system already sets the colours, so
   the High contrast option is hidden, and focus uses the system highlight colour. */
@media (forced-colors: active) {
  .ds-option--contrast {
    display: none;
  }
  :focus-visible,
  .field__input:focus {
    outline: 3px solid Highlight !important;
    outline-offset: 2px !important;
  }
  html.ds-focus :focus-visible,
  html.ds-focus .field__input:focus {
    outline: 4px solid Highlight !important;
    outline-offset: 3px !important;
  }
  .ds-choice input,
  .ds-option input {
    forced-color-adjust: auto;
  }
  .status::before,
  .hub-step__num {
    forced-color-adjust: none;
    border-color: CanvasText;
  }
  .app-dialog {
    border: 2px solid CanvasText;
  }
  /* Filled buttons are only a background, which forced colours removes. */
  .btn:not(.btn--outline) {
    border: 2px solid ButtonText;
  }
  /* The current category's tint and inset bar both go; a border takes the bar's place. */
  .q-nav__link[aria-current="page"] {
    border-left: 4px solid CanvasText;
  }
}

/* ---------- Build A: navigation & hub ---------- */
/* Breadcrumb (Dashboard/_breadcrumbs.html): the trail, or on a phone one link back. */
.breadcrumbs {
  margin-bottom: calc(16px - var(--block-gap));
}
.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  overflow-wrap: anywhere;
}
.breadcrumbs__item + .breadcrumbs__item::before {
  content: "\203A";
  content: "\203A" / "";
  margin-inline: 10px;
  color: #505a5f;
}
.breadcrumbs__item a {
  display: inline-block;
  padding-block: 10px;
  color: var(--navy);
}
.breadcrumbs__back {
  display: none;
  padding-block: 10px;
}
/* Project and paper pages: navy, not coral, so cards don't compete with alerts or the
   sidebar's "you are here" bar. */
.paper-card {
  border-top-color: var(--navy);
}
.paper-card__upload {
  align-self: flex-start;
}
.hub-step__note {
  max-width: 40rem;
}
.project__name {
  font-family: var(--font-text);
}

@container (max-width: 37.5rem) {
  .breadcrumbs__list {
    display: none;
  }
  .breadcrumbs__back {
    display: inline-flex;
  }
  .paper-card__upload.btn {
    align-self: stretch;
  }
  /* Batch 11: one column, Continue full width under the counts. */
  .project {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "name"
      "meta"
      "action"
      "extra";
  }
  /* Batch 13: name, type/size/date and Delete stack the same way in every row, so
     the Delete links line up however long the name is. */
  .file-list__item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ---------- B0b: One-press submit, questionnaire timeout save, POST-only questionnaire delete ---------- */
/* A pressed button (js/one_press_submit.js) stays focusable and looks the same (no
   faded .btn: "Saving…" / "Sending…" must stay readable); only the pointer says the
   page is busy. */
[data-one-press-pending] [aria-disabled="true"] {
  cursor: progress;
}
[data-one-press-pending] .btn[aria-disabled="true"] {
  opacity: 1;
}

/* ---------- B3: Category pages, uploads, AI disclosure and status, delete dialogs ---------- */
/* The AI panel's one status line, when drafting failed or never started. */
.q-ai__status--failed {
  color: var(--error);
}
/* "Uploading…" by the Upload button (js/nihr_app.js). */
.upload__status {
  font-weight: 700;
}
/* As .q-ai__status:empty: rendered but visually hidden until "Uploading…" goes in. */
.upload__status:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
/* Delete dialogs name what goes; a long name wraps. */
.confirm__item {
  overflow-wrap: anywhere;
}
.app-dialog .confirm__item {
  margin-bottom: 8px;
}

/* ---------- B2: Profile and Change password (researchers and staff) ---------- */
/* A failure looks different from a success, not only by colour: a white box with a full
   border (a success is the filled putty box), as well as its own alert region and a
   hidden "Error:" (Dashboard/base_nihr.html). */
.message--error {
  border: 2px solid var(--error);
  border-left-width: 6px;
  background: #fff;
  font-weight: 700;
}
html.ds-contrast .message--error {
  border-color: var(--error);
}
/* Profile's consent question: the long label wraps beside the top of its box. */
.profile-consent {
  margin-top: 0;
}
.profile-consent .choice {
  align-items: flex-start;
}
.profile-consent .choice__input {
  margin-top: 2px;
}
/* How the user logs in (email address, Change password), under the form. */
.profile-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.profile-login__list {
  margin: 0;
}
.profile-login__list dt {
  color: var(--navy);
  font-weight: 700;
}
.profile-login__list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* ---------- B4a: Error pages, timed-out form, Terms and conditions, footers, cookie notice cut down ---------- */
/* The cookie notice is one sentence, a link and Continue: one slim row at every width,
   so the page (and Log in) starts close to the top on a phone. The button wraps under
   the sentence when there is no room beside it (large text, 400% zoom). */
.cookie-banner {
  padding-block: 12px;
}
.cookie-banner .wrap {
  flex-wrap: wrap;
  gap: 12px 24px;
}
.cookie-banner__text {
  flex: 1 1 12em;
  margin: 0;
  font-size: 0.9375rem;
}

/* ---------- B5a: Staff review: Shared reports page (without changing Delete) ---------- */
/* Shared reports (Dashboard/Admin/admin_dashboard.html): two sections, each a heading over
   a Reports-page table (stacked cards on narrow screens). */
.shared-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.shared-section__title {
  font: 600 1.75rem/1.25 var(--font-display);
}
.shared-section .reports-table,
.shared-section .empty-state {
  margin-bottom: 0;
  padding-bottom: 0;
}
/* Mark as reviewed sits beside View, the same size and weight as the links. */
.shared-review {
  display: inline-block;
}
.shared-review .link-button {
  min-height: 24px; /* WCAG 2.5.8 target size */
  padding-block: 4px;
  text-align: left;
}
/* "Mark as new", under the confirmation after Mark as reviewed. */
.shared-review--undo {
  display: block;
  margin-bottom: 16px;
}
/* H3 (magnifier): capped, so a row's title and its View and Mark as reviewed sit about
   900px apart at most, within one 200% Magnifier view of a 1920 screen, instead of
   across the whole page. The title column takes what is left. In px, not rem: the
   Display text size scales the root font, and the people who enlarge text are the ones
   the cap is for. A table never shrinks below its content, so large text still fits. */
.shared-section .reports-table {
  max-width: 900px;
}
/* The row under the pointer or holding focus is tinted, so it can be followed across to
   its actions without drifting to the row above. Colour only adds to the focus ring and
   the rules; nothing depends on it. */
.shared-section .reports-table__row:hover,
.shared-section .reports-table__row:focus-within {
  background: var(--lilac-tint);
}
/* The report the team email linked to (#report-<pk>): a navy rule down its left edge,
   no animation. A border, so it shows in High contrast and forced colours too. */
.shared-section .reports-table__row:target {
  border-left: 4px solid var(--navy);
  scroll-margin-top: 24px;
}
@media (forced-colors: active) {
  .shared-section .reports-table__row:hover,
  .shared-section .reports-table__row:focus-within {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
}
/* "Reviewed 3 November 2026 by staff@..." (Admin/admin_user_reports.html): the text sits
   in its own span, so it is a real flex item of the inline-flex .status, and the address
   may break anywhere. Otherwise its full width sets the column's minimum and the page
   scrolls sideways at 1024px or with large text (WCAG 1.4.10). */
.status__text {
  min-width: 0;
}
.status__email {
  overflow-wrap: anywhere;
}
/* "Last saved 24 November 2026" (Batch 11 tool rows): the line may wrap before the
   phrase, never inside it. */
.status__date {
  white-space: nowrap;
}
/* At a larger Display settings text size on a narrow screen there is no room to keep it
   whole: let it wrap, so the page never scrolls sideways. Long answer labels too. */
html[data-text-size] .status__date {
  white-space: normal;
}
html[data-text-size] .choice__label {
  min-width: 0;
  overflow-wrap: anywhere;
}
/* A person's email address under their name (Admin/admin_user_reports.html), on its
   own line in the wrapping page head. */
.shared-person__email {
  flex-basis: 100%;
  overflow-wrap: anywhere;
}

/* ---------- B7: Report page and PDF ---------- */
/* Download PDF follows the overall score, before the category table. */
.report-block > .report-actions-group {
  margin-block: 4px 12px;
}
.report-text__comments {
  max-width: 45rem;
  overflow-wrap: anywhere;
}

/* ---------- B8a: Home steps, Access buttons, Contacts mailbox ---------- */
/* Tool finder: a question with no answer gets the GOV.UK error pattern (summary + inline). */
.finder__field {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.finder__field--error {
  padding-left: 16px;
  border-left: 4px solid var(--error);
}
/* The error summary link focuses an option by script; show its tile even after a mouse click. */
.finder__field--error .tile:has(input:focus) {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--sunshine);
}
/* Contacts: the team mailbox above the people. */
.contacts-mailbox {
  overflow-wrap: anywhere;
}
.contacts-mailbox a {
  font-weight: 700;
}

/* ---- GENERATED by scripts/css_container_fallback.py: do not edit below ---- */
@supports not (container-type: inline-size) {
  @media (max-width: 1199px) {
    .q-layout {
      grid-template-columns: minmax(0, 1fr);
      gap: 24px;
    }
    .q-nav {
      position: static;
    }
    .q-nav__details {
      border: 2px solid var(--navy);
    }
    .q-nav__summary {
      display: list-item;
      min-height: 48px;
      padding: 12px 16px;
      color: var(--navy);
      font-weight: 700;
      cursor: pointer;
    }
    .q-nav__where {
      margin-left: 8px;
      color: #505a5f;
      font-weight: 400;
    }
    .q-nav__list,
    .q-nav__drafts {
      margin-inline: 16px;
    }
    .q-nav__finish {
      margin: 12px 16px 16px;
      padding-inline: 8px;
    }
    /* The sticky save bar reaches the page edges. */
    .q-form {
      --q-bar-bleed: var(--app-margin);
    }
  }
  @media (max-width: 900px) {
    .landing__columns {
      grid-template-columns: minmax(0, 1fr);
    }
    /* Report tables become stacked cards up to 56.25rem: five columns don't fit a tablet
       or a large text size without squeezing every word (role="table" etc. in the
       templates keep the table semantics that display: block removes). */
    .reports-table thead {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
    }
    .reports-table,
    .reports-table tbody,
    .reports-table tr,
    .reports-table th,
    .reports-table td {
      display: block;
    }
    /* The border is the card's edge in High contrast (--rule turns navy) and forced
       colours, where the shadow goes. */
    .reports-table__row {
      padding: 16px;
      margin-bottom: 16px;
      border: 1px solid var(--rule);
      background: #fff;
      box-shadow: var(--shadow-soft);
    }
    .reports-table th,
    .reports-table td {
      padding: 4px 0;
      border: 0;
    }
    .reports-table__report {
      min-width: 0;
    }
    .reports-table td[data-label]::before {
      content: attr(data-label) ": ";
      /* Screen readers already announce the column header; skip the visible label. */
      content: attr(data-label) ": " / "";
      font-weight: 700;
    }
    .reports-table__actions {
      padding-top: 8px;
    }
    /* Cards may wrap anything: at 320px and 200% text "Send to the NIHR IVD team" or a
       date is wider than the card. */
    .reports-table__nowrap,
    .reports-table__actions a,
    .reports-table__actions .link-button {
      white-space: normal;
    }
  }
  @media (max-width: 600px) {
    .report-actions {
      flex-direction: column;
      align-items: stretch;
    }
    .report-actions .btn {
      white-space: normal;
      text-align: center;
    }
    .report-filters .field {
      flex-basis: 100%;
    }
  }
  @media (max-width: 1323px) {
    .app-identity__descriptor {
      white-space: normal;
    }
    .app-identity__descriptor b {
      display: block;
    }
  }
  @media (max-width: 1180px) {
    /* Two rows, as on the HRC Network site: descriptor, coral hairline, then links. */
    .site-bar {
      flex-direction: column;
      align-items: stretch;
      gap: 0;
    }
    .site-descriptor {
      align-self: stretch;
      padding-block: 0.875rem 0.75rem;
      border-bottom: 1px solid rgba(252, 93, 93, 0.6);
      white-space: normal;
    }
    .site-nav {
      min-height: 3.25rem;
    }
    .site-nav__links {
      gap: 2rem;
    }
    .app-identity__rule,
    .app-identity__descriptor {
      display: none;
    }
    .team {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }
  @media (max-width: 1100px) {
    .steps {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .hero .wrap {
      gap: 40px;
    }
    .hero__media {
      flex-basis: 420px;
      height: 340px;
    }
    .contact__details {
      flex-basis: 420px;
    }
    .site-footer__cols {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  @media (max-width: 1023px) {
    .app-header {
      padding: 16px 20px;
    }
    /* Let the logo shrink on narrow phones so the Menu button stays on screen. */
    .app-identity,
    .app-identity__logo {
      flex: 0 1 auto;
      min-width: 0;
    }
    .app-controls {
      display: none;
    }
    .app-menu-button {
      display: inline-flex;
    }
    .app-descbar {
      display: block;
      padding: 12px 20px;
      background: var(--navy);
      color: #fff;
      font-size: 0.875rem;
      font-weight: 700;
      line-height: 1.4;
    }
    .app-descbar__second {
      display: block;
    }
    .app-body {
      flex-direction: column;
    }
    .js .app-sidebar {
      display: none;
    }
    .js .app-sidebar.is-open {
      display: flex;
    }
    .app-sidebar {
      flex-basis: auto;
      padding: 0 0 24px;
    }
    .app-sidebar__account {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 12px 20px;
      padding: 20px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    }
    .app-sidebar__account .name {
      font-weight: 700;
    }
    .app-sidebar__account-links {
      display: flex;
      gap: 20px;
    }
    .app-sidebar__account a,
    .app-sidebar__account .link-button {
      color: #fff;
      font-weight: 400;
    }
    /* White text would vanish on the Sunshine focus block; use the focus text colour. */
    .app-sidebar__account a:focus-visible,
    .app-sidebar__account .link-button:focus-visible {
      color: var(--focus-text);
    }
    /* Groups sit 24px apart with the rule in the middle; the exit links, which leave
       the service, get a rule of their own. */
    .app-nav__group {
      padding: 12px;
    }
    .app-nav__group + .app-nav__group {
      margin-top: 0;
    }
    .app-sidebar__signed-in {
      display: none;
    }
    .app-sidebar__exit {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 12px;
      padding: 12px 28px 0;
      border-top: 1px solid rgba(255, 255, 255, 0.4);
    }
    .app-sidebar__exit a {
      color: #fff;
    }
    .app-sidebar__exit .link__text {
      color: #fff;
    }
    .app-main {
      --app-margin: 20px;
      gap: 32px;
      padding-top: 32px;
    }
    .firstrun {
      padding: 24px 20px;
    }
    .tools-band {
      padding: 32px 20px;
    }
    .app-footer {
      padding: 8px 20px 16px;
    }
  }
  @media (max-width: 900px) {
    /* A container query can't restyle body itself, so the spacing tokens are set on its children. */
    body > * {
      --section-y: 56px;
      --block-gap: 32px;
    }
    .menu-button {
      display: inline-flex;
      min-height: 44px;
    }
    .no-js .menu-button {
      display: none;
    }
    /* Logo and Menu in the white bar; the descriptor stays in the navy bar below. */
    .site-topbar .wrap {
      padding-block: 16px;
    }
    .site-topbar__actions {
      display: none;
    }
    /* A zero basis lets the logo shrink instead of pushing Menu onto the next line; the cap
       stops the link (and its focus fill) stretching past the image. */
    .site-logo {
      flex: 1 1 0;
      max-width: 288px;
      margin-left: -10px;
    }
    .menu-button {
      margin-left: auto;
    }
    .site-logo img {
      width: 100%;
      max-width: 298px;
    }
    .site-descriptor {
      padding-block: 0.75rem;
      border-bottom: 0;
      font-size: 0.9375rem;
    }
    .site-descriptor__second {
      display: block;
    }
    .site-nav {
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      min-height: 0;
      padding-block: 0 20px;
      border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    .js .site-nav {
      display: none;
    }
    .js .site-nav.is-open {
      display: flex;
    }
    .site-nav__links {
      flex-direction: column;
      gap: 0;
    }
    .site-nav__link {
      padding-block: 14px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    .site-nav__link::before {
      display: none;
    }
    /* The menu marks the current page with a coral bar on the left instead. */
    .site-nav__link[aria-current="page"] {
      padding-left: 16px;
      box-shadow: inset 4px 0 0 var(--coral);
    }
    .site-nav__actions {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 20px;
      padding-top: 20px;
    }
    .hero .wrap {
      flex-direction: column;
      align-items: stretch;
      gap: 40px;
    }
    .hero__title {
      font-size: 2.25rem;
    }
    .hero__standfirst,
    .section-head__standfirst {
      font-size: 1.125rem;
    }
    .hero__media {
      flex: none;
      height: auto;
      /* Room above the photo for the arc, which rises 17.75% of the photo's height. */
      margin-top: 13.7%;
      aspect-ratio: 13 / 10;
    }
    .section-head__title {
      font-size: 1.75rem;
    }
    .finder {
      padding: 24px 20px 20px;
    }
    .tiles,
    .tiles--3 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }
    /* An odd last tile takes the whole row instead of sitting alone beside a gap. */
    .tiles > .tile:last-child:nth-child(odd) {
      grid-column: 1 / -1;
    }
    .stepper__step {
      font-size: 0.8125rem;
    }
    /* minmax(0, …) so a long word can't stop the column shrinking on a phone. */
    .tool-cards {
      grid-template-columns: minmax(0, 1fr);
    }
    .tool-card p,
    .stat__label {
      overflow-wrap: anywhere;
    }
    .tool-card {
      min-height: 0;
    }
    .tool-card__names {
      min-height: 0;
    }
    .research-cards {
      grid-template-columns: 1fr;
    }
    .research-card {
      min-height: 0;
    }
    .team {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .contact .wrap {
      flex-direction: column;
      gap: 40px;
    }
    .contact__details {
      flex-basis: auto;
      padding: 24px 0 0;
      border-top: 3px solid var(--coral);
      border-left: 0;
    }
    .page-head__title,
    .doc-head__title {
      font-size: 2.25rem;
    }
    .doc-head {
      padding-block: 40px;
    }
    .doc h2 {
      font-size: 1.75rem;
    }
    .tools-band {
      grid-template-columns: 1fr;
    }
    .pipeline {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      width: 100%;
    }
  }
  @media (max-width: 600px) {
    .site-topbar .wrap {
      gap: 12px;
    }
    /* Long legal link text must wrap on narrow or enlarged layouts. */
    .form__legal a {
      white-space: normal;
    }
    /* On phones the panel is the page: full width, lined up with the header. */
    .auth-main {
      padding: 0;
      background: #fff;
    }
    .auth-panel {
      max-width: none;
      padding: 32px var(--page-gutter);
      box-shadow: none;
    }
    .hero__actions {
      flex-direction: column;
      align-items: stretch;
    }
    .hero__actions .link {
      align-self: flex-start;
    }
    .steps {
      grid-template-columns: 1fr;
    }
    .team {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 28px 16px;
    }
    .site-footer {
      padding-top: 64px;
    }
    .site-footer__cols {
      grid-template-columns: 1fr;
      gap: 32px;
    }
    .stat__num {
      font-size: 2.5rem;
    }
    .finder__actions .btn {
      flex: 1 1 auto;
    }
    .app-tool-card__actions {
      flex-direction: column;
      align-items: stretch;
    }
    .app-tool-card__actions .btn {
      min-width: 0;
    }
    /* Project pages: one column, the main buttons full width. */
    .tool-status {
      grid-template-columns: minmax(0, 1fr);
    }
    .tool-status__actions,
    .tool-status:has(> .field__hint) .tool-status__actions {
      grid-column: 1;
      grid-row: auto;
    }
    .tool-status__actions .btn {
      flex: 1 1 auto;
    }
    .add-paper__row,
    .form__actions,
    .paper-actions,
    .app-dialog__actions {
      flex-direction: column;
      align-items: stretch;
    }
    /* The timeout dialog's buttons sit in their own forms: stretch them too. */
    .app-dialog__actions > form {
      display: flex;
      flex-direction: column;
    }
    .form__actions .link,
    .paper-actions .link-button {
      align-self: flex-start;
    }
    .hub-step__action {
      align-self: stretch;
    }
    .hub-step__action .btn,
    .disclosure__summary {
      width: 100%;
    }
    .hub-step__title {
      font-size: 1.5rem;
    }
  }
  @media (max-width: 319.84px) {
    .tiles,
    .tiles--3,
    .team {
      grid-template-columns: 1fr;
    }
    .pipeline {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      row-gap: 12px;
    }
    .btn,
    .site-nav__link,
    .form__legal a,
    .auth-panel__foot a,
    .stat__num {
      white-space: normal;
    }
    .btn {
      line-height: 1.25;
      text-align: center;
    }
    .stat {
      flex-wrap: wrap;
    }
    /* Three steps don't fit side by side here, so stack them: number, then label, one
       step per row (the connecting lines are dropped). */
    .stepper {
      grid-template-columns: minmax(0, 1fr);
      gap: 8px;
    }
    .stepper__step {
      flex-direction: row;
      gap: 12px;
      text-align: left;
    }
    .stepper__marker {
      width: auto;
    }
    .stepper__line {
      display: none;
    }
    /* Last resort for a single long word ("Recommended") on the narrowest screens. */
    .stepper__label {
      min-width: 0;
      overflow-wrap: anywhere;
    }
    .auth-panel {
      padding-inline: 16px;
    }
    /* Big headings: smaller steps, and long words hyphenate rather than run off the page. */
    h1,
    h2,
    h3,
    .ds-group__legend {
      hyphens: auto;
      overflow-wrap: anywhere;
    }
    .hero__title,
    .page-head__title,
    .doc-head__title {
      font-size: 1.875rem;
    }
    .section-head__title,
    .result__name,
    .tool-card__name,
    .auth-panel__title,
    .doc h2,
    .ds-dialog__title {
      font-size: 1.5rem;
    }
    .stat__num,
    .steps__num {
      font-size: 2rem;
    }
    .ds-dialog__inner {
      padding: 0 16px 24px;
    }
    .ds-dialog__title {
      padding-top: 24px;
    }
  }
  @media (max-width: 600px) {
    .breadcrumbs__list {
      display: none;
    }
    .breadcrumbs__back {
      display: inline-flex;
    }
    .paper-card__upload.btn {
      align-self: stretch;
    }
    /* Batch 11: one column, Continue full width under the counts. */
    .project {
      grid-template-columns: minmax(0, 1fr);
      grid-template-areas:
        "name"
        "meta"
        "action"
        "extra";
    }
    /* Batch 13: name, type/size/date and Delete stack the same way in every row, so
       the Delete links line up however long the name is. */
    .file-list__item {
      flex-direction: column;
      align-items: flex-start;
      gap: 4px;
    }
  }
}
/* ---- END GENERATED ---- */
