:root {
  --forest-950: #173326;
  --forest-800: #28543f;
  --forest-700: #35664f;
  --mint-500: #4ecfa0;
  --mint-200: #bfe9d7;
  --mint-100: #def2e8;
  --mist-100: #edf3ee;
  --warm-white: #fcfdfb;
  --sage-700: #52665a;
  --sage-500: #6f7f75;
  --sage-300: #bdcac1;
  --sage-200: #d6e0d8;
  --danger-700: #9f2924;
  --success-700: #21623e;
  --sans: "IBM Plex Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --shadow-card: 0 1.5rem 4rem rgba(29, 69, 49, 0.13), 0 0.25rem 1rem rgba(29, 69, 49, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  background: var(--mist-100);
}

body {
  min-height: 100vh;
  margin: 0;
  background: #f6f8f5;
  color: var(--forest-950);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1 {
  margin: 0 0 0.5rem;
  font-family: var(--serif);
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.page-shell {
  width: min(calc(100% - 2rem), 46rem);
  margin-inline: auto;
  padding-block: clamp(2rem, 6vw, 4rem);
}

.lede {
  margin: 0;
  color: var(--sage-700);
}

fieldset {
  margin: 0 0 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--sage-200);
  border-radius: 1rem;
}

legend {
  padding-inline: 0.4rem;
  font-weight: 650;
}

.field {
  margin-bottom: 1rem;
}

.field:last-child {
  margin-bottom: 0;
}

.reference-analyte-group,
.reference-report-metadata {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--sage-200);
}

.reference-analyte-group[hidden] {
  display: none;
}

[data-reference-result-details][hidden] {
  display: none;
}

.reference-analyte-group h2,
.reference-analyte-group h3,
.reference-report-metadata h2,
.reference-report-metadata h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--forest-950);
  font-size: 0.875rem;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--sage-300);
  border-radius: 0.75rem;
  background: var(--warm-white);
  color: var(--forest-950);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input::placeholder {
  color: #87958c;
  opacity: 1;
}

input[type="file"] {
  min-height: auto;
  padding: 0.55rem;
}

div.sample-type-choices {
  display: flex;
  min-height: 3.25rem;
  padding: 0.55rem;
  border: 1px solid var(--sage-300);
  border-radius: 0.75rem;
  background: var(--warm-white);
  gap: 0.55rem;
}

.sample-type-choices > div {
  display: flex;
  flex: 1;
}

.sample-type-choices label {
  display: flex;
  width: 100%;
  min-height: 2rem;
  margin: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 0.55rem;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.sample-type-choices label:has(input:checked) {
  background: var(--mint-100);
}

.sample-type-choices label:focus-within {
  box-shadow: inset 0 0 0 2px var(--forest-700);
}

.sample-type-choices input {
  width: auto;
  min-height: 0;
  margin: 0;
  accent-color: var(--forest-700);
}

input[type="file"]::file-selector-button {
  min-height: 2.6rem;
  margin-right: 0.75rem;
  padding: 0.55rem 0.85rem;
  border: 0;
  border-radius: 0.6rem;
  background: var(--mint-100);
  color: var(--forest-950);
  cursor: pointer;
  font-weight: 700;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--forest-700);
  box-shadow: 0 0 0 0.25rem rgba(78, 207, 160, 0.24);
  outline: none;
}

input[type="radio"]:focus,
input[type="checkbox"]:focus {
  box-shadow: none;
}

button {
  min-height: 3.25rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--forest-800);
  border-radius: 0.8rem;
  background: var(--forest-800);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

button:hover {
  border-color: var(--forest-950);
  background: var(--forest-950);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 0.2rem solid var(--mint-500);
  outline-offset: 0.2rem;
}

.help {
  margin-top: 0.25rem;
  color: var(--sage-700);
  font-size: 0.875rem;
}

.errors {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
  color: var(--danger-700);
  font-size: 0.9rem;
}

.messages {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.messages li {
  margin-bottom: 0.5rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--sage-300);
  border-radius: 0.75rem;
  background: var(--warm-white);
}

.messages .success {
  border-color: #96c9aa;
  color: var(--success-700);
}

.messages .error {
  border-color: #e0aaa6;
  color: var(--danger-700);
}

.note {
  padding: 0.7rem 0 0.7rem 1rem;
  border-left: 0.2rem solid var(--forest-700);
  color: var(--sage-700);
  font-size: 0.925rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.login-page {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.95) 0, rgba(255, 255, 255, 0.44) 27%, transparent 58%),
    linear-gradient(160deg, #f6f8f5 0%, var(--mist-100) 52%, #e5efe8 100%);
}

.login-page::before,
.login-page::after {
  position: fixed;
  z-index: 0;
  border: 1px solid rgba(53, 102, 79, 0.14);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.login-page::before {
  top: -7rem;
  left: -8rem;
  width: 19rem;
  height: 19rem;
  box-shadow: 0 0 0 2.4rem rgba(53, 102, 79, 0.035), 0 0 0 5rem rgba(53, 102, 79, 0.025);
}

.login-page::after {
  right: -7rem;
  bottom: -8rem;
  width: 17rem;
  height: 17rem;
  box-shadow: 0 0 0 2.1rem rgba(78, 207, 160, 0.06), 0 0 0 4.5rem rgba(53, 102, 79, 0.025);
}

.login-shell {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(calc(100% - 2rem), 29rem);
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  padding-block: max(1.5rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-bottom));
  flex-direction: column;
  justify-content: center;
}

.portal-brand {
  display: flex;
  margin: 0 0 1.4rem 0.25rem;
  align-items: center;
  gap: 0.8rem;
}

.portal-brand__mark {
  display: grid;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 0.95rem;
  background: var(--forest-800);
  box-shadow: 0 0.4rem 1rem rgba(23, 51, 38, 0.18);
  color: var(--mint-100);
  place-items: center;
}

.portal-brand__mark svg {
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.portal-brand__copy {
  display: grid;
  line-height: 1.05;
}

.portal-brand__copy strong {
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

.portal-brand__copy span {
  margin-top: 0.33rem;
  color: var(--sage-700);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.login-card {
  padding: clamp(1.35rem, 6vw, 2rem);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 1.75rem;
  background: rgba(252, 253, 251, 0.97);
  box-shadow: var(--shadow-card);
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--forest-700);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-card h1 {
  font-size: clamp(2.25rem, 10vw, 3rem);
}

.login-card .lede {
  max-width: 34ch;
}

.login-form {
  margin-top: 1.6rem;
}

.login-error {
  display: grid;
  margin: 1.1rem 0 0;
  padding: 1rem;
  border: 1px solid #ef6b64;
  border-left: 0.35rem solid #c62828;
  border-radius: 0.9rem;
  background: #fff0ef;
  box-shadow: 0 0.45rem 1.1rem rgba(198, 40, 40, 0.14);
  color: #991f1f;
  font-size: 0.9rem;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  line-height: 1.4;
}

.login-error__icon {
  display: grid;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: #c62828;
  box-shadow: 0 0.2rem 0.45rem rgba(198, 40, 40, 0.24);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  place-items: center;
}

.login-error strong,
.login-error > span:last-child > span {
  display: block;
}

.login-error strong {
  margin-bottom: 0.15rem;
  color: #7f1717;
  font-size: 0.95rem;
}

.login-form fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.login-form .field {
  margin-bottom: 1rem;
}

.login-form label {
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.login-form input {
  min-height: 3.75rem;
  padding-inline: 1rem;
  border-color: var(--sage-200);
  border-radius: 1rem;
  background: #f9fbf8;
  font-size: 1rem;
}

.login-form button {
  width: 100%;
  min-height: 3.75rem;
  margin-top: 0.25rem;
  border-radius: 1rem;
  box-shadow: 0 0.65rem 1.35rem rgba(40, 84, 63, 0.2);
}

.login-help {
  margin: 1.35rem auto 0;
  color: var(--sage-700);
  font-size: 0.82rem;
  line-height: 1.55;
  text-align: center;
}

.login-footer {
  margin: 1.25rem 1rem 0;
  color: var(--sage-700);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-align: center;
  text-transform: uppercase;
}

.session-actions {
  margin-top: 2rem;
}

.staff-session-bar {
  display: flex;
  margin-bottom: 1.25rem;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  color: var(--sage-700);
  font-size: 0.85rem;
}

.staff-session-bar form {
  margin: 0;
}

.staff-session-bar .session-logout {
  min-height: 2.65rem;
  padding: 0.5rem 0.9rem;
  border-color: var(--sage-300);
  background: var(--warm-white);
  color: var(--forest-800);
  white-space: nowrap;
}

.staff-session-bar .session-logout:hover {
  border-color: var(--forest-800);
  background: var(--mint-100);
  color: var(--forest-950);
}

.portal-card {
  padding: clamp(1.35rem, 5vw, 2rem);
  border: 1px solid var(--sage-200);
  border-radius: 1.5rem;
  background: var(--warm-white);
  box-shadow: 0 1rem 3rem rgba(29, 69, 49, 0.09);
}

.portal-card .lede {
  max-width: 56ch;
}

/* Nurse enrolment ------------------------------------------------------- */

.nurse-enrolment-page {
  background: #f8faf7;
}

.enrolment-shell {
  width: min(calc(100% - 2rem), 68rem);
  padding-block: clamp(1.25rem, 4vw, 3.5rem);
}

.enrolment-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.enrolment-header {
  padding: clamp(1rem, 3vw, 2rem) 0 0;
}

.enrolment-header .eyebrow {
  margin-bottom: 0.65rem;
  color: var(--forest-700);
}

.enrolment-header h1 {
  max-width: 15ch;
  color: var(--forest-950);
  font-size: clamp(2.7rem, 7vw, 4.4rem);
  line-height: 0.98;
}

.enrolment-header .lede {
  max-width: 48rem;
  color: var(--sage-700);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.enrolment-privacy-note {
  max-width: 52rem;
  margin: 2rem 0 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border: 0;
  border-left: 0.2rem solid var(--forest-700);
  border-radius: 0;
  background: transparent;
  color: var(--sage-700);
  font-size: 0.9rem;
  line-height: 1.65;
}

.enrolment-privacy-note strong {
  margin-right: 0.2rem;
  color: var(--forest-950);
}

.enrolment-form {
  margin-top: clamp(2.75rem, 6vw, 4.5rem);
  padding: 0;
}

.enrolment-section {
  margin: 0;
  padding: 0;
  border: 0;
}

.enrolment-section + .enrolment-section {
  margin-top: clamp(2.75rem, 6vw, 4.5rem);
  padding-top: 0;
  border-top: 0;
}

.enrolment-section + .enrolment-section legend {
  padding-top: clamp(2.75rem, 6vw, 4.5rem);
  border-top: 1px solid var(--sage-200);
}

.enrolment-section legend {
  display: grid;
  width: 100%;
  margin-bottom: 1.75rem;
  padding: 0;
  align-items: start;
  color: var(--forest-950);
  font-size: 1.2rem;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  gap: 0.35rem;
}

.enrolment-section legend > span:last-child {
  display: grid;
  gap: 0.08rem;
}

.enrolment-section legend small {
  color: var(--sage-500);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.enrolment-step {
  color: #79a18d;
  font-family: var(--serif);
  font-size: 3.25rem;
  font-weight: 400;
  letter-spacing: -0.08em;
  line-height: 0.8;
}

.enrolment-grid,
.result-field-grid {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem;
  row-gap: 1.25rem;
}

.result-field-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.enrolment-grid > .field,
.enrolment-grid > div > .field,
.result-field-grid > .field,
.result-field-grid > div > .field {
  margin-bottom: 0;
}

.enrolment-grid > div,
.result-field-grid > .field,
.result-field-grid > div {
  min-width: 0;
}

.enrolment-grid input,
.enrolment-grid select {
  height: 3.25rem;
  min-height: 3.25rem;
}

.result-field-grid__wide {
  grid-column: 1 / -1;
}

.enrolment-section-intro {
  max-width: 64ch;
  margin: -0.35rem 0 1.25rem;
  color: var(--sage-700);
  font-size: 0.9rem;
}

.result-condition-label {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--forest-950);
  font-size: 0.875rem;
  font-weight: 700;
}

.result-choice-grid {
  display: grid;
  padding: 0.35rem;
  border: 1px solid var(--sage-200);
  border-radius: 0.85rem;
  background: var(--warm-white);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 0.35rem;
}

.result-condition-field {
  margin-bottom: 0;
}

.result-choice-card {
  display: grid;
  min-height: 5.4rem;
  height: 100%;
  margin: 0;
  padding: 0.8rem 0.9rem;
  border: 0;
  border-radius: 0.6rem;
  align-items: center;
  background: transparent;
  cursor: pointer;
  grid-template-columns: 1.15rem minmax(0, 1fr);
  gap: 0.7rem;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}

.result-choice-card:hover {
  background: #f1f6f2;
}

.result-choice-card:focus-within {
  box-shadow: inset 0 0 0 2px var(--forest-700);
}

.result-choice-card.is-selected,
.result-choice-card:has(input:checked) {
  background: var(--mint-100);
  box-shadow: none;
}

.result-choice-card input {
  width: 1.1rem;
  height: 1.1rem;
  min-height: 0;
  margin: 0;
  accent-color: var(--forest-700);
}

.result-choice-card__copy {
  display: grid;
  gap: 0.25rem;
}

.result-choice-card__copy strong {
  font-size: 0.9rem;
}

.result-choice-card__copy small {
  color: var(--sage-700);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.4;
}

.result-details-panel {
  margin-top: 2rem;
  padding: 2rem 0 0;
  border: 0;
  border-top: 1px solid var(--sage-200);
  border-radius: 0;
  background: transparent;
}

.result-details-panel__sample {
  width: 100%;
}

.result-details-panel__sample .field {
  margin-bottom: 0;
}

.result-details-panel .reference-analyte-group,
.result-details-panel .reference-report-metadata {
  margin-top: 2rem;
  padding-top: 2rem;
}

.result-details-panel .reference-analyte-group .eyebrow {
  margin-bottom: 0.25rem;
  color: var(--forest-700);
}

.result-details-panel .reference-analyte-group h3,
.result-details-panel .reference-report-metadata h3 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.enrolment-submit {
  width: auto;
  min-height: 3.35rem;
  margin-top: 2.5rem;
  padding-inline: 1.35rem;
  border-radius: 0.7rem;
  box-shadow: none;
}

.enrolment-submit:disabled,
.enrolment-submit:disabled:hover {
  border-color: #91a399;
  background: #91a399;
  color: #f7faf8;
  cursor: not-allowed;
  transform: none;
}

.stacked-form {
  margin-top: 1.5rem;
}

.stacked-form button {
  width: 100%;
  margin-top: 0.35rem;
}

.field--error input,
.field--error select,
.field--error textarea {
  border-color: #d34b45;
  background: #fff8f7;
}

.form-alert,
.success-panel {
  margin-bottom: 1.25rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
}

.form-alert {
  border: 1px solid #e0aaa6;
  border-left: 0.3rem solid #c62828;
  background: #fff0ef;
  color: var(--danger-700);
}

.form-alert .errors {
  margin-bottom: 0;
}

.success-panel {
  display: grid;
  margin-top: 1.4rem;
  border: 1px solid #96c9aa;
  border-left: 0.3rem solid var(--success-700);
  background: #edf8f1;
  color: var(--success-700);
  gap: 0.2rem;
}

.credential-link {
  min-height: 7rem;
  resize: vertical;
  overflow-wrap: anywhere;
}

.pending-activations {
  min-width: 0;
  padding: 1.75rem 0 0;
  border: 0;
  border-top: 1px solid var(--sage-200);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.enrolment-followup-grid {
  display: grid;
  margin-top: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr));
  gap: 2rem;
}

.patient-flow-page {
  background:
    radial-gradient(circle at 12% 8%, rgba(78, 207, 160, 0.14), transparent 24rem),
    linear-gradient(155deg, #eef3ee 0%, #e4ece6 100%);
}

.patient-flow-shell {
  width: min(calc(100% - 2rem), 42rem);
  margin-inline: auto;
  padding-block: clamp(1rem, 4vw, 2.5rem);
}

.patient-flow-hero,
.patient-confirmation-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.4rem, 5vw, 2.75rem);
  background: linear-gradient(145deg, #28543f 0%, #4e8568 100%);
  color: #fff;
}

.patient-flow-hero {
  border-radius: 2rem 2rem 0 0;
}

.patient-flow-hero::before,
.patient-confirmation-hero::before,
.patient-flow-hero::after,
.patient-confirmation-hero::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.patient-flow-hero::before,
.patient-confirmation-hero::before {
  top: -9rem;
  right: -7rem;
  width: 22rem;
  height: 22rem;
}

.patient-flow-hero::after,
.patient-confirmation-hero::after {
  right: 3rem;
  bottom: -11rem;
  width: 19rem;
  height: 19rem;
}

.patient-flow-topbar {
  position: relative;
  z-index: 1;
  display: flex;
  margin-bottom: 2rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.patient-flow-topbar form {
  margin: 0;
}

.patient-flow-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.patient-flow-brand > span:last-child {
  display: grid;
  line-height: 1.05;
}

.patient-flow-brand strong {
  font-size: 0.95rem;
}

.patient-flow-brand small {
  margin-top: 0.3rem;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.patient-flow-brand__mark {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.12);
  place-items: center;
}

.patient-flow-brand__mark svg {
  width: 1.7rem;
  height: 1.7rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.patient-signout {
  min-height: 2.65rem;
  padding: 0.45rem 0.8rem;
  border-color: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  color: #fff;
  font-size: 0.78rem;
}

.patient-signout:hover {
  border-color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.2);
}

.patient-flow-kicker {
  position: relative;
  z-index: 1;
  margin: 0 0 0.6rem;
  color: var(--mint-200);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.patient-flow-hero h1,
.patient-confirmation-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 12ch;
  margin-bottom: 1rem;
  color: #fff;
  font-size: clamp(2.35rem, 10vw, 3.5rem);
}

.patient-flow-intro {
  position: relative;
  z-index: 1;
  max-width: 35ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1.03rem;
}

.patient-photo-checklist {
  position: relative;
  z-index: 1;
  display: grid;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
  gap: 0.7rem;
}

.patient-photo-checklist li {
  display: flex;
  align-items: flex-start;
  color: rgba(255, 255, 255, 0.82);
  gap: 0.65rem;
}

.patient-photo-checklist li span {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  flex: 0 0 auto;
  background: rgba(78, 207, 160, 0.2);
  color: #9ef0d0;
  font-size: 0.72rem;
  font-weight: 800;
  place-items: center;
}

.patient-privacy-note {
  position: relative;
  z-index: 1;
  display: flex;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  gap: 0.7rem;
}

.patient-privacy-note svg {
  width: 1.4rem;
  height: 1.4rem;
  flex: 0 0 auto;
  fill: none;
  stroke: #8eedc8;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.patient-flow-panel,
.patient-receipt {
  padding: clamp(1.4rem, 5vw, 2.75rem);
  border-radius: 0 0 2rem 2rem;
  background: var(--warm-white);
  box-shadow: var(--shadow-card);
}

.patient-flow-steps {
  display: flex;
  margin: 0 0 2.5rem;
  padding: 0;
  align-items: flex-start;
  justify-content: space-between;
  list-style: none;
}

.patient-flow-steps li {
  position: relative;
  display: grid;
  width: 5.5rem;
  justify-items: center;
  color: #98a69d;
  text-align: center;
  gap: 0.55rem;
}

.patient-flow-steps li:not(:last-child)::after {
  position: absolute;
  top: 1.3rem;
  left: calc(50% + 1.6rem);
  width: calc(100% - 0.7rem);
  height: 1px;
  background: var(--sage-200);
  content: "";
}

.patient-flow-steps li > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  border: 2px solid var(--sage-200);
  border-radius: 50%;
  background: var(--warm-white);
  color: var(--sage-700);
  font-weight: 800;
  place-items: center;
}

.patient-flow-steps small {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  line-height: 1.25;
  text-transform: uppercase;
}

.patient-flow-steps .is-complete {
  color: var(--mint-500);
}

.patient-flow-steps .is-complete > span {
  border-color: var(--mint-500);
  background: var(--mint-500);
  color: var(--forest-950);
}

.patient-flow-steps .is-complete::after {
  background: var(--mint-500);
}

.patient-flow-steps .is-current {
  color: var(--forest-800);
}

.patient-flow-steps .is-current > span {
  border-color: var(--forest-800);
  background: var(--forest-800);
  box-shadow: 0 0 0 0.35rem var(--sage-200);
  color: #fff;
}

.submission-form label {
  margin-bottom: 0.6rem;
  color: var(--sage-700);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.submission-form .field {
  margin-bottom: 1.5rem;
}

.submission-form input:not([type="file"]),
.submission-form textarea {
  min-height: 3.8rem;
  padding-inline: 1rem;
  border-color: var(--sage-200);
  border-radius: 1rem;
  background: #f9fbf8;
}

.submission-form textarea {
  min-height: 6rem;
}

.submission-form > button {
  display: flex;
  width: 100%;
  min-height: 3.8rem;
  margin-top: 0.4rem;
  border-radius: 1rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0.7rem 1.5rem rgba(40, 84, 63, 0.2);
  gap: 0.7rem;
}

.patient-photo-upload {
  display: grid;
  min-height: 13rem;
  padding: 1.4rem;
  border: 2px dashed var(--sage-200);
  border-radius: 1.5rem;
  align-content: center;
  justify-items: center;
  background: #fbfcfa;
  text-align: center;
}

.patient-photo-upload__prompt {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.45rem;
}

.patient-photo-upload__prompt[hidden] {
  display: none;
}

.patient-photo-upload__icon {
  display: grid;
  width: 4rem;
  height: 4rem;
  margin-bottom: 0.4rem;
  border-radius: 1.2rem;
  background: var(--mist-100);
  box-shadow: 0 0.35rem 0.8rem rgba(40, 84, 63, 0.1);
  color: var(--forest-700);
  place-items: center;
}

.patient-photo-upload__icon svg {
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.patient-photo-upload__prompt > span:not(.patient-photo-upload__icon) {
  color: var(--sage-700);
  font-size: 0.9rem;
}

.patient-photo-upload input[type="file"] {
  width: min(100%, 24rem);
  margin-top: 0.5rem;
  border: 0;
  background: transparent;
  color: var(--sage-700);
  font-size: 0.82rem;
}

.patient-photo-upload .help {
  max-width: 33rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
}

.patient-photo-upload.has-photo {
  min-height: 0;
  padding: 0.5rem;
  align-content: stretch;
  background: #f3f7f3;
}

.patient-photo-preview {
  display: grid;
  width: 100%;
  height: clamp(17rem, 58vh, 34rem);
  overflow: hidden;
  border-radius: 1rem;
  place-items: center;
}

.patient-photo-preview[hidden],
.patient-photo-actions[hidden] {
  display: none;
}

.patient-photo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.patient-photo-actions {
  display: grid;
  margin-top: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.submission-form .patient-photo-actions button {
  min-height: 3rem;
  padding: 0.65rem 0.85rem;
  border-color: var(--sage-300);
  background: var(--warm-white);
  color: var(--forest-800);
  box-shadow: none;
  font-size: 0.82rem;
}

.submission-form .patient-photo-actions button:hover {
  border-color: var(--forest-700);
  background: var(--mint-100);
}

.patient-photo-status {
  min-height: 1.2rem;
  margin: 0.55rem 0 0;
  color: var(--sage-700);
  font-size: 0.78rem;
  text-align: center;
}

.patient-photo-status:empty {
  display: none;
}

.patient-photo-status.is-error {
  color: var(--danger-700);
}

.patient-photo-field.field--error .patient-photo-upload {
  border-color: #d34b45;
  background: #fff8f7;
}

.patient-confirmation-page {
  background: linear-gradient(155deg, #183d2c 0%, #477d62 100%);
}

.patient-confirmation-hero {
  padding-bottom: clamp(2.2rem, 8vw, 4rem);
  border-radius: 2rem 2rem 0 0;
  background: transparent;
  text-align: center;
}

.patient-confirmation-hero .patient-flow-topbar {
  margin-bottom: 2.75rem;
  text-align: left;
}

.patient-submitted-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-bottom: 1.75rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(142, 237, 200, 0.4);
  border-radius: 999px;
  align-items: center;
  background: rgba(78, 207, 160, 0.16);
  color: #a8efd4;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.patient-submitted-pill::before {
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: #8eedc8;
  content: "";
}

.patient-completion-mark {
  position: relative;
  z-index: 1;
  display: grid;
  width: 6rem;
  height: 6rem;
  margin: 0 auto 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 1rem rgba(255, 255, 255, 0.04);
  color: #fff;
  place-items: center;
}

.patient-completion-mark svg {
  width: 3.5rem;
  height: 3.5rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.patient-confirmation-hero h1 {
  max-width: 14ch;
  margin-inline: auto;
}

.patient-confirmation-hero .patient-flow-intro {
  margin-inline: auto;
}

.patient-receipt {
  border-radius: 0 0 2rem 2rem;
}

.patient-receipt h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 7vw, 2.35rem);
  font-weight: 400;
}

.patient-receipt-details {
  margin: 1.5rem 0;
}

.patient-receipt-details > div {
  display: grid;
  padding: 1rem 0;
  border-top: 1px solid var(--sage-200);
  grid-template-columns: minmax(6rem, 0.7fr) 1.5fr;
  gap: 1rem;
}

.patient-receipt-details > div:last-child {
  border-bottom: 1px solid var(--sage-200);
}

.patient-receipt-details dt {
  color: var(--sage-500);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.patient-receipt-details dd {
  margin: 0;
  color: var(--forest-950);
  font-weight: 700;
}

.patient-next-note {
  display: grid;
  margin: 1.5rem 0 0;
  padding: 1rem;
  border: 1px solid var(--sage-200);
  border-radius: 1rem;
  background: #f8faf7;
  color: var(--sage-700);
  gap: 0.3rem;
}

.patient-next-note strong {
  color: var(--forest-700);
  font-size: 0.75rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.patient-receipt-actions {
  display: grid;
  margin-top: 1.5rem;
  justify-items: stretch;
  text-align: center;
  gap: 1rem;
}

.submission-history {
  margin-top: 2rem;
}

.submission-steps {
  display: grid;
  margin: 1.5rem 0;
  padding-left: 1.5rem;
  gap: 0.55rem;
}

.status-pill {
  display: inline-flex;
  min-height: 2rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  align-items: center;
  background: var(--mint-100);
  color: var(--forest-800);
  font-size: 0.82rem;
  font-weight: 700;
}

.sample-details {
  display: grid;
  margin: 1.5rem 0 0;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
}

.sample-details div {
  padding: 0.85rem;
  border-radius: 0.8rem;
  background: var(--mist-100);
}

.sample-details dt {
  color: var(--sage-700);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sample-details dd {
  margin: 0.2rem 0 0;
  color: var(--forest-950);
  font-weight: 700;
}

.activation-list {
  display: grid;
  padding: 0;
  list-style: none;
  gap: 0.75rem;
}

.activation-list li {
  display: flex;
  min-height: 3.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--sage-200);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.activation-list span {
  display: grid;
  gap: 0.1rem;
}

.activation-list a {
  font-weight: 700;
}

.button-row {
  display: flex;
  margin-top: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.button-link {
  display: inline-flex;
  min-height: 3.25rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--forest-800);
  border-radius: 0.8rem;
  align-items: center;
  justify-content: center;
  background: var(--forest-800);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.button-link:hover {
  border-color: var(--forest-950);
  background: var(--forest-950);
}

.button-link:focus-visible,
.text-link:focus-visible,
.page-actions a:focus-visible {
  outline: 0.2rem solid var(--mint-500);
  outline-offset: 0.2rem;
}

.text-link,
.page-actions a {
  color: var(--forest-800);
  font-weight: 700;
}

.page-actions {
  margin-top: 1.25rem;
}

.workspace-panel {
  display: flex;
  margin-top: 2rem;
  padding: 1.25rem;
  border: 1px solid var(--sage-200);
  border-radius: 1rem;
  align-items: center;
  justify-content: space-between;
  background: var(--warm-white);
  gap: 1rem;
}

.workspace-panel h2,
.workspace-panel p {
  margin: 0;
}

.workspace-panel h2 {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 400;
}

.workspace-panel .eyebrow {
  margin-bottom: 0.25rem;
}

.workspace-panel h2 + p {
  margin-top: 0.25rem;
  color: var(--sage-700);
}

.research-page {
  background:
    radial-gradient(circle at 92% 4%, rgba(78, 207, 160, 0.11), transparent 24rem),
    #f3f6f2;
}

.research-shell {
  width: min(calc(100% - 2rem), 76rem);
  margin-inline: auto;
  padding-block: clamp(1.5rem, 4vw, 3.5rem);
}

.research-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.research-header h1 {
  font-size: clamp(2.35rem, 6vw, 3.7rem);
}

.research-header .lede {
  max-width: 48rem;
}

.research-header form {
  margin: 0;
}

.research-signout {
  min-height: 2.85rem;
  padding: 0.55rem 1rem;
  border-color: var(--sage-300);
  background: var(--warm-white);
  box-shadow: none;
  color: var(--forest-800);
  white-space: nowrap;
}

.research-signout:hover {
  border-color: var(--forest-800);
  background: var(--mint-100);
  color: var(--forest-950);
}

.research-metrics {
  display: grid;
  margin: 2rem 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.research-metrics > div {
  display: grid;
  min-height: 7rem;
  padding: 1rem;
  border: 1px solid var(--sage-200);
  border-radius: 1.15rem;
  align-content: space-between;
  background: rgba(252, 253, 251, 0.92);
  box-shadow: 0 0.5rem 1.5rem rgba(29, 69, 49, 0.05);
}

.research-metrics span {
  color: var(--sage-700);
  font-size: 0.75rem;
  font-weight: 750;
}

.research-metrics strong {
  color: var(--forest-800);
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
}

.research-queue,
.research-photo-panel,
.research-submission-summary,
.research-result-panel {
  padding: clamp(1.1rem, 3vw, 1.75rem);
  border: 1px solid var(--sage-200);
  border-radius: 1.4rem;
  background: var(--warm-white);
  box-shadow: 0 1rem 2.5rem rgba(29, 69, 49, 0.07);
}

.research-queue-heading,
.research-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.research-queue h2,
.research-photo-panel h2,
.research-submission-summary h2,
.research-result-panel h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 400;
}

.research-study-filter {
  display: grid;
  min-width: min(100%, 15rem);
  gap: 0.35rem;
}

.research-study-filter label {
  margin: 0;
  color: var(--sage-700);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.research-study-filter select {
  min-height: 2.85rem;
  padding-block: 0.5rem;
  background: #f9fbf8;
}

.research-study-filter noscript button {
  width: 100%;
  min-height: 2.85rem;
}

.research-status-filters {
  display: flex;
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.35rem;
  overflow-x: auto;
  gap: 0.55rem;
  scrollbar-width: thin;
}

.research-status-filters a {
  display: inline-flex;
  min-height: 2.45rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--sage-200);
  border-radius: 999px;
  align-items: center;
  flex: 0 0 auto;
  background: #f8faf7;
  color: var(--sage-700);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  gap: 0.45rem;
}

.research-status-filters a span {
  display: grid;
  min-width: 1.4rem;
  min-height: 1.4rem;
  padding-inline: 0.3rem;
  border-radius: 999px;
  background: var(--sage-200);
  color: var(--forest-950);
  font-size: 0.68rem;
  place-items: center;
}

.research-status-filters a:hover,
.research-status-filters a.is-active {
  border-color: var(--forest-800);
  background: var(--forest-800);
  color: #fff;
}

.research-status-filters a.is-active span {
  background: var(--mint-200);
}

.research-status-filters a:focus-visible,
.research-table a:focus-visible,
.research-back-link a:focus-visible,
.research-pagination a:focus-visible {
  outline: 0.2rem solid var(--mint-500);
  outline-offset: 0.15rem;
}

.research-table-wrap {
  overflow-x: auto;
}

.research-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.research-table th,
.research-table td {
  padding: 0.9rem 0.75rem;
  border-bottom: 1px solid var(--sage-200);
  text-align: left;
  vertical-align: middle;
}

.research-table th {
  color: var(--sage-500);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.research-table tbody tr:hover {
  background: #f8faf7;
}

.research-table-action {
  text-align: right !important;
}

.research-table-action a,
.research-back-link a,
.research-pagination a {
  color: var(--forest-800);
  font-weight: 750;
}

.research-empty {
  padding-block: 2.5rem !important;
  color: var(--sage-700);
  text-align: center !important;
}

.status-pill--needs_review {
  background: #fff1c7;
  color: #7b4b00;
}

.status-pill--failed {
  background: #fff0ef;
  color: var(--danger-700);
}

.status-pill--analysing {
  background: #e7f1f7;
  color: #285a75;
}

.status-pill--withdrawn {
  background: #ecefed;
  color: #5c6861;
}

.research-pagination {
  display: flex;
  padding-top: 1.25rem;
  align-items: center;
  justify-content: center;
  color: var(--sage-700);
  font-size: 0.84rem;
  gap: 1rem;
}

.research-access-panel {
  margin-top: 1.25rem;
}

.research-detail-header {
  align-items: center;
}

.research-back-link {
  margin: 1.5rem 0;
}

.research-back-link a {
  text-decoration: none;
}

.research-detail-alert {
  margin-top: -0.35rem;
}

.research-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(18rem, 0.85fr);
  align-items: start;
  gap: 1.25rem;
}

.research-photo-frame {
  display: grid;
  min-height: 24rem;
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 1rem;
  background: #17231c;
  place-items: center;
}

.research-photo-stage {
  position: relative;
  display: grid;
  width: 100%;
  place-items: center;
}

.research-photo-stage--selectable {
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.research-photo-frame img {
  display: block;
  max-width: 100%;
  max-height: min(68vh, 46rem);
  border-radius: 0.55rem;
  object-fit: contain;
}

.research-roi-selection {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  min-width: 0.25rem;
  min-height: 0.25rem;
  border: 0.16rem solid #7dffca;
  background: rgba(78, 207, 160, 0.2);
  box-shadow: 0 0 0 0.1rem rgba(23, 51, 38, 0.75);
  cursor: move;
  touch-action: none;
}

.research-roi-selection--reference {
  z-index: 3;
  border-color: #ffd36e;
  border-style: dashed;
  background: rgba(255, 211, 110, 0.16);
  box-shadow: 0 0 0 0.1rem rgba(56, 38, 12, 0.78);
}

.research-roi-selection--active {
  z-index: 5;
  box-shadow:
    0 0 0 0.1rem rgba(23, 51, 38, 0.85),
    0 0 0 0.28rem rgba(255, 255, 255, 0.88);
}

.research-roi-selection:not(.research-roi-selection--active)
  .research-roi-handle {
  display: none;
}

.research-roi-selection[hidden] {
  display: none;
}

.research-roi-selection span {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  padding: 0.2rem 0.35rem;
  border-radius: 0.35rem;
  background: rgba(23, 51, 38, 0.86);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}

.research-roi-selection--reference span {
  background: rgba(255, 211, 110, 0.94);
  color: #3b2809;
}

.research-roi-selection:focus-visible {
  outline: 0.2rem solid #fff;
  outline-offset: 0.2rem;
}

.research-roi-handle {
  position: absolute;
  z-index: 3;
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  min-height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  touch-action: none;
}

.research-roi-handle::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.72rem;
  height: 0.72rem;
  border: 0.13rem solid #173326;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0.1rem #7dffca;
  content: "";
  transform: translate(-50%, -50%);
}

.research-roi-selection--reference .research-roi-handle::after {
  border-color: #3b2809;
  box-shadow: 0 0 0 0.1rem #ffd36e;
}

.research-roi-handle:hover,
.research-roi-handle:active {
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.research-roi-handle:focus-visible {
  outline: 0.18rem solid #fff;
  outline-offset: -0.2rem;
}

.research-roi-handle--nw {
  top: -1rem;
  left: -1rem;
  cursor: nwse-resize;
}

.research-roi-handle--ne {
  top: -1rem;
  right: -1rem;
  cursor: nesw-resize;
}

.research-roi-handle--sw {
  bottom: -1rem;
  left: -1rem;
  cursor: nesw-resize;
}

.research-roi-handle--se {
  right: -1rem;
  bottom: -1rem;
  cursor: nwse-resize;
}

.research-roi-selection--existing {
  border-color: #ffd36e;
  background: rgba(255, 211, 110, 0.16);
  cursor: default;
  pointer-events: none;
}

.research-image-meta {
  margin: 0.75rem 0 0;
  color: var(--sage-700);
  font-size: 0.78rem;
}

.research-image-meta--roi {
  color: #704300;
  font-weight: 700;
}

.research-roi-panel {
  margin-top: 1.25rem;
  padding: 1.1rem;
  border: 1px solid var(--sage-200);
  border-radius: 1rem;
  background: #f8faf7;
}

.research-roi-panel h3 {
  margin: 0;
  color: var(--forest-950);
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 400;
}

.research-roi-panel > p:not(.eyebrow) {
  margin: 0.45rem 0 0;
  color: var(--sage-700);
  font-size: 0.86rem;
}

.research-roi-panel form {
  margin-top: 1rem;
}

.research-roi-targets {
  display: grid;
  margin: 0;
  padding: 0;
  border: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.research-roi-targets legend {
  width: 100%;
  margin-bottom: 0.5rem;
  color: var(--forest-900);
  font-size: 0.76rem;
  font-weight: 800;
}

.research-roi-target {
  display: grid;
  min-height: 3.35rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--sage-300);
  border-radius: 0.72rem;
  background: var(--warm-white);
  box-shadow: none;
  color: var(--forest-900);
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  text-align: left;
}

.research-roi-target:hover:not(:disabled) {
  border-color: var(--forest-700);
  background: var(--mint-100);
  box-shadow: none;
  transform: none;
}

.research-roi-target[aria-pressed="true"] {
  border-color: var(--forest-800);
  background: var(--mint-100);
  box-shadow: inset 0 0 0 1px var(--forest-800);
}

.research-roi-target--reference[aria-pressed="true"] {
  border-color: #8a5a00;
  background: #fff7e4;
  box-shadow: inset 0 0 0 1px #8a5a00;
}

.research-roi-target--selected .research-roi-target__number {
  background: var(--forest-700);
  color: #fff;
}

.research-roi-target--reference.research-roi-target--selected
  .research-roi-target__number {
  background: #8a5a00;
}

.research-roi-target__number {
  display: grid;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--sage-200);
  color: var(--forest-800);
  place-items: center;
  font-size: 0.72rem;
  font-weight: 850;
}

.research-roi-target strong,
.research-roi-target small {
  display: block;
}

.research-roi-target strong {
  font-size: 0.76rem;
  line-height: 1.2;
}

.research-roi-target small {
  margin-top: 0.15rem;
  color: var(--sage-700);
  font-size: 0.62rem;
  line-height: 1.25;
}

.research-reference-note {
  margin: 0.7rem 0 1rem;
  padding: 0.7rem 0.8rem;
  border-left: 0.2rem solid #d99a21;
  border-radius: 0.45rem;
  background: #fff8e9;
  color: #67450a;
  font-size: 0.72rem;
  line-height: 1.45;
}

.research-roi-errors {
  margin-bottom: 1rem;
}

.research-roi-errors[hidden],
.research-analysis-progress[hidden] {
  display: none;
}

.research-analysis-progress {
  margin-bottom: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--sage-200);
  border-radius: 0.85rem;
  background: var(--warm-white);
}

.research-analysis-progress__track {
  position: relative;
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--sage-200);
}

.research-analysis-progress__track span {
  position: absolute;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--forest-700), var(--mint-500));
  animation: research-analysis-loading 1.15s ease-in-out infinite;
}

.research-analysis-progress p {
  margin: 0.55rem 0 0;
  color: var(--sage-700);
  font-size: 0.76rem;
  text-align: center;
}

.research-photo-stage--busy {
  cursor: wait;
  opacity: 0.82;
  pointer-events: none;
}

@keyframes research-analysis-loading {
  from {
    transform: translateX(-115%);
  }

  to {
    transform: translateX(345%);
  }
}

.research-roi-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 0.75rem;
}

.research-roi-actions button {
  min-height: 3rem;
  padding: 0.65rem 0.85rem;
  box-shadow: none;
  font-size: 0.82rem;
}

.research-roi-clear {
  border-color: var(--sage-300);
  background: var(--warm-white);
  color: var(--forest-800);
}

.research-roi-clear:hover:not(:disabled) {
  border-color: var(--forest-700);
  background: var(--mint-100);
}

.research-roi-actions button:disabled {
  border-color: var(--sage-200);
  background: #e9eeea;
  box-shadow: none;
  color: var(--sage-500);
  cursor: not-allowed;
}

.research-roi-status {
  min-height: 1.25rem;
  margin: 0.65rem 0 0;
  color: var(--sage-700);
  font-size: 0.76rem;
  text-align: center;
}

.research-roi-coordinates {
  margin-top: 0.9rem;
  border-top: 1px solid var(--sage-200);
  padding-top: 0.8rem;
}

.research-roi-coordinates summary {
  color: var(--forest-800);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 750;
}

.research-roi-coordinates > p,
.research-roi-noscript {
  margin: 0.4rem 0 0;
  color: var(--sage-700);
  font-size: 0.75rem;
}

.research-roi-coordinate-group {
  margin-top: 0.75rem;
}

.research-roi-coordinate-group + .research-roi-coordinate-group {
  padding-top: 0.75rem;
  border-top: 1px solid var(--sage-200);
}

.research-roi-coordinate-group h4 {
  margin: 0;
  color: var(--forest-900);
  font-size: 0.72rem;
}

.research-roi-coordinate-grid {
  display: grid;
  margin-top: 0.5rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.research-roi-coordinates .field {
  margin: 0;
}

.research-roi-coordinates label {
  color: var(--sage-700);
  font-size: 0.66rem;
}

.research-roi-coordinates input {
  min-height: 2.7rem;
  padding: 0.5rem 0.55rem;
  font-size: 0.78rem;
}

.research-photo-missing {
  margin-top: 1.25rem;
  padding: 2.5rem 1rem;
  border: 1px dashed var(--sage-300);
  border-radius: 1rem;
  background: #f8faf7;
  color: var(--sage-700);
  text-align: center;
}

.research-submission-summary dl {
  margin: 1.25rem 0 0;
}

.research-submission-summary dl > div {
  padding: 0.85rem 0;
  border-top: 1px solid var(--sage-200);
}

.research-submission-summary dl > div:last-child {
  border-bottom: 1px solid var(--sage-200);
}

.research-submission-summary dt {
  color: var(--sage-500);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.research-submission-summary dd {
  margin: 0.2rem 0 0;
  color: var(--forest-950);
  font-weight: 700;
}

.research-processing-note {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 0.9rem;
}

.research-processing-note {
  border: 1px solid #ebd49d;
  background: #fffaf0;
}

.research-processing-note strong {
  color: var(--forest-700);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.research-processing-note p {
  margin: 0.35rem 0 0;
  color: var(--sage-700);
  overflow-wrap: anywhere;
}

.research-processing-note--ready {
  border-color: #a8d2b8;
  background: #eff8f2;
}

.research-result-panel {
  margin-top: 1.25rem;
}

.research-result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.result-quantitation {
  display: inline-flex;
  min-height: 2.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  align-items: center;
  background: #e7f1eb;
  color: var(--forest-800);
  font-size: 0.75rem;
  font-weight: 800;
}

.result-quantitation--below_range,
.result-quantitation--above_range {
  background: #fff1c7;
  color: #7b4b00;
}

.result-quantitation--unmeasurable {
  background: #fff0ef;
  color: var(--danger-700);
}

.research-result-warning {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid #ebd49d;
  border-left: 0.3rem solid #bd7b12;
  border-radius: 0.9rem;
  background: #fffaf0;
}

.research-result-warning strong {
  color: #704300;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.research-result-warning p {
  max-width: 78ch;
  margin: 0.3rem 0 0;
  color: var(--sage-700);
}

.research-result-correction {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid #9bc8ad;
  border-left: 0.3rem solid var(--forest-700);
  border-radius: 0.9rem;
  background: #f1f8f3;
}

.research-result-correction strong {
  color: var(--forest-800);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.research-result-correction p {
  max-width: 78ch;
  margin: 0.3rem 0 0;
  color: var(--sage-700);
}

.research-result-overview {
  display: grid;
  margin-top: 1.25rem;
  grid-template-columns: minmax(15rem, 0.75fr) minmax(0, 1.6fr);
  gap: 1rem;
}

.research-result-primary {
  display: grid;
  min-height: 14rem;
  padding: 1.25rem;
  border-radius: 1rem;
  align-content: space-between;
  background: linear-gradient(145deg, #28543f, #467b60);
  color: #fff;
}

.research-result-primary > span {
  color: var(--mint-200);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.research-result-primary strong {
  font-family: var(--serif);
  font-size: clamp(2.15rem, 5vw, 3.4rem);
  font-weight: 400;
  line-height: 1;
}

.research-result-primary strong small {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 750;
}

.research-result-primary p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
}

.research-result-primary--status strong {
  font-family: var(--sans);
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 750;
}

.research-measurement-grid {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.research-measurement-grid > div {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--sage-200);
  border-radius: 1rem;
  background: #f8faf7;
}

.research-measurement-grid dt,
.research-result-provenance dt {
  color: var(--sage-500);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.research-measurement-grid dd {
  margin: 0.3rem 0 0;
  color: var(--forest-950);
  font-size: 1.15rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.research-measurement-grid small {
  display: block;
  margin-top: 0.25rem;
  color: var(--sage-700);
  font-size: 0.72rem;
}

.research-channel-card--red {
  border-top: 0.25rem solid #a54e49 !important;
}

.research-channel-card--green {
  border-top: 0.25rem solid #4f8065 !important;
}

.research-channel-card--blue {
  border-top: 0.25rem solid #557c9d !important;
}

.research-roi-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem !important;
  font-weight: 650 !important;
  line-height: 1.55;
}

.research-result-provenance {
  display: grid;
  margin: 1rem 0 0;
  padding: 1rem;
  border-radius: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #edf3ee;
  gap: 1rem;
}

.research-result-provenance dd {
  margin: 0.25rem 0 0;
  color: var(--forest-950);
  font-size: 0.82rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.research-correction-matrix {
  margin-top: 0.75rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--sage-200);
  border-radius: 0.9rem;
  background: #f8faf7;
}

.research-correction-matrix summary {
  color: var(--forest-800);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
}

.research-correction-matrix p {
  margin: 0.55rem 0;
  color: var(--sage-700);
  font-size: 0.75rem;
}

.research-correction-matrix table {
  border-collapse: collapse;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
}

.research-correction-matrix td {
  padding: 0.25rem 0.65rem 0.25rem 0;
}

.research-acceptance-container {
  margin-top: 1rem;
}

.research-acceptance-form {
  display: grid;
  padding: 1.1rem;
  border: 1px solid #9bc8ad;
  border-radius: 1rem;
  background: #f1f8f3;
  gap: 1rem;
}

.research-acceptance-form h3 {
  margin: 0;
  color: var(--forest-950);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
}

.research-acceptance-form > div:first-of-type > p:not(.eyebrow) {
  max-width: 78ch;
  margin: 0.35rem 0 0;
  color: var(--sage-700);
  font-size: 0.82rem;
}

.research-acceptance-confirmation {
  display: grid;
  min-height: 3.25rem;
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--sage-300);
  border-radius: 0.8rem;
  align-items: center;
  background: var(--warm-white);
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
}

.research-acceptance-confirmation input[type="checkbox"] {
  width: 1.35rem;
  min-height: 1.35rem;
  margin: 0;
  padding: 0;
  accent-color: var(--forest-700);
}

.research-acceptance-confirmation label {
  margin: 0;
  cursor: pointer;
  line-height: 1.35;
}

.research-acceptance-form > button {
  width: 100%;
}

.research-acceptance-errors,
.research-acceptance-progress {
  margin: 0;
}

.research-acceptance-errors[hidden],
.research-acceptance-progress[hidden] {
  display: none;
}

.research-acceptance-progress {
  padding: 0.8rem;
  border: 1px solid var(--sage-200);
  border-radius: 0.8rem;
  background: var(--warm-white);
}

.research-acceptance-progress p {
  margin: 0.5rem 0 0;
  color: var(--sage-700);
  font-size: 0.76rem;
  text-align: center;
}

.research-acceptance-state {
  display: grid;
  padding: 1rem;
  border: 1px solid #7eb894;
  border-left: 0.3rem solid var(--success-700);
  border-radius: 0.9rem;
  align-items: start;
  background: #edf8f1;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
}

.research-acceptance-state > span {
  display: grid;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--success-700);
  color: #fff;
  font-weight: 850;
  place-items: center;
}

.research-acceptance-state strong {
  color: var(--success-700);
}

.research-acceptance-state p {
  margin: 0.25rem 0 0;
  color: var(--sage-700);
  font-size: 0.8rem;
}

@media (max-width: 34rem) {
  .enrolment-card {
    border-radius: 0;
  }

  .enrolment-privacy-note {
    margin-inline: 0;
  }

  .enrolment-form {
    padding-inline: 0;
  }

  .enrolment-grid,
  .result-field-grid,
  .result-choice-grid {
    grid-template-columns: 1fr;
  }

  .result-choice-card {
    min-height: 4.8rem;
  }

  .enrolment-section legend {
    grid-template-columns: 3.7rem minmax(0, 1fr);
  }

  .enrolment-step {
    font-size: 2.75rem;
  }

  .enrolment-submit {
    width: 100%;
  }

  .patient-flow-shell {
    width: 100%;
    padding: 0;
  }

  .patient-flow-hero,
  .patient-confirmation-hero,
  .patient-flow-panel,
  .patient-receipt {
    border-radius: 0;
  }

  .patient-flow-topbar {
    margin-bottom: 1.6rem;
  }

  .patient-flow-steps li {
    width: 4.6rem;
  }

  .patient-flow-steps li:not(:last-child)::after {
    width: calc(100% - 0.25rem);
  }

  .patient-photo-upload {
    min-height: 12rem;
    padding: 1.1rem;
  }

  .patient-photo-upload.has-photo {
    padding: 0.5rem;
  }

  .patient-photo-preview {
    height: clamp(16rem, 62vh, 32rem);
  }

  .patient-receipt-details > div {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .workspace-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row .button-link {
    width: 100%;
  }

  .activation-list li {
    align-items: flex-start;
    flex-direction: column;
  }

  .staff-session-bar {
    align-items: flex-end;
    flex-direction: column;
  }
}

@media (min-width: 58.0625rem) {
  .enrolment-shell {
    width: min(calc(100% - 3rem), 68rem);
    padding-block: clamp(2rem, 4vw, 3.5rem);
  }

  .enrolment-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .enrolment-grid__name,
  .enrolment-grid__dob,
  .enrolment-grid__study,
  .enrolment-grid__cohort {
    grid-column: span 6;
  }
}

@media (max-width: 44rem) {
  .result-choice-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 58rem) {
  .research-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .research-detail-grid {
    grid-template-columns: 1fr;
  }

  .research-result-overview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 46rem) {
  .research-shell {
    width: min(calc(100% - 1rem), 76rem);
  }

  .research-header,
  .research-queue-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .research-header {
    gap: 1rem;
  }

  .research-signout {
    width: 100%;
  }

  .research-result-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .result-quantitation {
    align-self: flex-start;
  }

  .research-measurement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .research-result-provenance {
    grid-template-columns: 1fr;
  }

  .research-study-filter {
    width: 100%;
  }

  .research-table,
  .research-table tbody,
  .research-table tr,
  .research-table td {
    display: block;
    width: 100%;
  }

  .research-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .research-table tr {
    margin-bottom: 0.85rem;
    padding: 0.75rem;
    border: 1px solid var(--sage-200);
    border-radius: 0.9rem;
    background: #fbfcfa;
  }

  .research-table td {
    display: grid;
    padding: 0.5rem 0;
    border: 0;
    grid-template-columns: minmax(6rem, 0.75fr) 1.25fr;
    gap: 0.75rem;
  }

  .research-table td::before {
    color: var(--sage-500);
    content: attr(data-label);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }

  .research-table-action {
    display: block !important;
    padding-top: 0.8rem !important;
    border-top: 1px solid var(--sage-200) !important;
    text-align: left !important;
  }

  .research-table-action::before,
  .research-empty::before {
    content: none !important;
  }

  .research-empty {
    display: block !important;
  }

  .research-photo-frame {
    min-height: 15rem;
  }

  .research-roi-actions,
  .research-roi-coordinate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .research-roi-targets {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 24rem) {
  .patient-flow-hero,
  .patient-confirmation-hero,
  .patient-flow-panel,
  .patient-receipt {
    padding-inline: 1.1rem;
  }

  .patient-flow-brand strong {
    font-size: 0.82rem;
  }

  .patient-flow-brand small {
    font-size: 0.55rem;
  }

  .patient-signout {
    padding-inline: 0.65rem;
  }

  .login-shell {
    width: min(calc(100% - 1.25rem), 29rem);
  }

  .login-card {
    border-radius: 1.5rem;
  }
}

@media (max-height: 42rem) and (orientation: landscape) {
  .login-shell {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .research-analysis-progress__track span {
    width: 100%;
    animation: none;
  }
}

@media (forced-colors: active) {
  .portal-brand__mark,
  button {
    forced-color-adjust: none;
  }
}
