:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #5e6878;
  --line: #d8dee8;
  --line-strong: #aeb8c7;
  --surface: #ffffff;
  --surface-subtle: #f5f7fa;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eff6ff;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --success: #176b3a;
  --success-soft: #edf8f1;
  --focus: rgba(37, 99, 235, 0.32);
  --radius: 0.55rem;
}

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

[hidden] {
  display: none !important;
}

html {
  min-width: 20rem;
  background: var(--surface-subtle);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface-subtle);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

.container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 64rem;
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3rem) clamp(1rem, 4vw, 2.5rem) 4rem;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(23, 32, 51, 0.05);
}

.site-tabs-scroll {
  margin: calc(-1 * clamp(1.5rem, 5vw, 3rem)) calc(-1 * clamp(1rem, 4vw, 2.5rem)) clamp(2rem, 5vw, 3rem);
  padding: 0 0 0.4rem;
  overflow-x: auto;
}

.site-tabs {
  display: flex;
  width: max-content;
  min-width: 100%;
  gap: 0;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
}

.site-tabs a {
  flex: 0 0 auto;
  padding: 1rem 0.85rem 0.8rem;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
}

.site-tabs a:hover {
  color: var(--ink);
}

.site-tabs a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--accent-hover);
  font-weight: 700;
}

.site-tabs a::after,
.variant-nav a::after {
  content: attr(data-label);
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: 700;
  pointer-events: none;
}

/* Keep withdrawal visually separate while retaining right alignment where
   the tab row is wider than its contents. */
.site-tabs a:nth-last-child(2) {
  margin-right: auto;
}

.site-tabs a:last-child {
  margin-left: clamp(1.5rem, 4vw, 3rem);
}

.site-footer {
  margin-top: auto;
  padding-top: 3rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer .abandon-form,
.site-footer .button-link {
  min-height: 0;
  margin: 0;
  font-size: inherit;
}

h1,
h2 {
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 4vw, 2rem);
  letter-spacing: -0.02em;
}

h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.25rem;
}

p {
  margin: 0.75rem 0;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
}

code {
  padding: 0.1em 0.28em;
  border-radius: 0.25rem;
  background: var(--surface-subtle);
  font-size: 0.88em;
}

:where(a, button, input:not([type="radio"]):not([type="checkbox"]), select):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

fieldset {
  min-width: 0;
  margin: 1.5rem 0;
  padding: 1rem clamp(0.85rem, 3vw, 1.25rem) 1.25rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.15rem);
}

.consent-technical-note {
  font-size: 0.875rem;
  line-height: 1.45;
}

.consent-confirmation {
  margin-top: 1rem;
  border-color: var(--line);
}

legend {
  max-width: 100%;
  padding: 0 0.5rem;
  font-weight: 700;
  line-height: 1.35;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-height: 3rem;
  margin: 0.35rem 0;
  padding: 0.68rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}

.option:hover {
  border-color: var(--line);
  background: var(--surface-subtle);
}

.option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.option input {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.2rem 0 0;
  accent-color: var(--accent);
}

button {
  min-height: 2.75rem;
  margin: 1rem 0 0;
  padding: 0.62rem 1.05rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
}

button:hover {
  background: var(--accent-hover);
}

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

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.button-danger {
  background: var(--danger);
}

.button-danger:hover {
  background: #8f1c13;
}

.button-danger-link,
.button-danger-link:hover {
  color: var(--danger);
}

.withdraw-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0;
}

.withdraw-form input:not([type="hidden"]) {
  width: min(100%, 28rem);
}

.withdraw-form button {
  margin: 0;
}

.removal-code {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.removal-code-copy {
  margin: 0;
}

.withdraw-page {
  display: grid;
  gap: 1.5rem;
}

.withdraw-page h1,
.withdraw-page p {
  margin: 0;
}

.withdraw-page .withdraw-form {
  gap: 1rem;
}

.removal-code-panel {
  margin: 2rem 0 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.removal-code-panel h2 {
  margin-top: 0;
}

.removal-code code {
  padding: 0.4rem 0.55rem;
  font-size: clamp(0.9rem, 3vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  user-select: all;
}

.submission-metadata {
  display: grid;
  grid-template-columns: minmax(9rem, 0.7fr) minmax(0, 1.3fr);
  gap: 0.35rem 1rem;
  margin: 1rem 0;
}

.submission-metadata dt {
  color: var(--muted);
  font-weight: 700;
}

.submission-metadata dd {
  margin: 0;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.62rem 1.05rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: #e5e7eb;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.secondary-button:hover {
  color: var(--ink);
  background: #d1d5db;
}

.button-secondary {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface);
}

.button-secondary:hover {
  border-color: var(--ink);
  background: var(--surface-subtle);
}

.button-link {
  min-height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--accent);
  background: none;
  font-weight: 500;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.button-link:hover {
  color: var(--accent-hover);
  background: none;
}

.button-link:active {
  transform: none;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  max-width: 28rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--accent);
}

.progress {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}

.error {
  padding: 0.7rem 0.85rem;
  border-left: 4px solid var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
  font-weight: 700;
}

.empty-state {
  padding: 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-subtle);
}

/* Start and screening */

.colour-vision-question .option > span {
  min-width: 0;
  text-align: left;
}

#cvd-deficiency-type {
  display: grid;
  gap: 0.4rem;
  margin: 0.75rem 0 0.25rem;
  padding: 0.85rem;
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

#cvd-deficiency-type label {
  color: var(--muted);
}

#cvd-deficiency-type select {
  color: var(--muted);
  background: #e9edf3;
}

.cvd-type-selects {
  display: grid;
}

.cvd-type-selects select {
  grid-area: 1 / 1;
}

.cvd-type-select--enabled {
  visibility: hidden;
}

fieldset:has(input[data-reports-deficiency="true"]:checked) .cvd-type-select--disabled {
  visibility: hidden;
}

fieldset:has(input[data-reports-deficiency="true"]:checked) .cvd-type-select--enabled {
  visibility: visible;
}

fieldset:has(input[data-reports-deficiency="true"]:checked) #cvd-deficiency-type label,
fieldset:has(input[data-reports-deficiency="true"]:checked) #cvd-deficiency-type select {
  color: inherit;
}

fieldset:has(input[data-reports-deficiency="true"]:checked) #cvd-deficiency-type select {
  background: var(--surface);
}

.colour-vision-question.cvd-js .cvd-type-select--disabled {
  display: none;
}

.colour-vision-question.cvd-js .cvd-type-select--enabled {
  visibility: visible;
}

.colour-vision-question.cvd-js.cvd-has-deficiency #cvd-deficiency-type label,
.colour-vision-question.cvd-js.cvd-has-deficiency #cvd-deficiency-type select {
  color: inherit;
}

.colour-vision-question.cvd-js.cvd-has-deficiency #cvd-deficiency-type select {
  background: var(--surface);
}

.study-length {
  color: var(--muted);
}

.cvd-plate {
  width: min(100%, 20rem);
  margin: 1.25rem auto;
}

.cvd-plate img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
  background: var(--surface-subtle);
}

.cvd-response-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.cvd-response-form form {
  margin: 0;
}

.cvd-response-form button {
  margin-top: 1rem;
}

.number-entry {
  display: grid;
  gap: 0.35rem;
  max-width: 8rem;
}

.number-entry input {
  max-width: 8rem;
  font-variant-numeric: tabular-nums;
}

.answer-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
}

.skip-answer-form {
  display: none;
}

.answer-actions button {
  margin: 0;
}

/* Practice and trials */

.demo-chart {
  display: grid;
  gap: 0.65rem;
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.15rem);
  background: var(--surface-subtle);
}

.demo-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: var(--bar-width);
  min-width: 4rem;
  min-height: 2.75rem;
  margin: 0;
  padding: 0 0.75rem;
  border: 2px solid transparent;
  border-radius: 0.25rem;
  color: #fff;
  background: #416f9f;
  font-weight: 800;
}

.demo-bar:hover,
.demo-bar:focus-visible {
  border-color: #173b63;
  background: #365f8e;
}

.demo-bar.selected {
  border-color: #0c2f57;
  background: #28537f;
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.demo-practice:has(#demo-answer-1:checked) .demo-bar[for="demo-answer-1"],
.demo-practice:has(#demo-answer-2:checked) .demo-bar[for="demo-answer-2"],
.demo-practice:has(#demo-answer-3:checked) .demo-bar[for="demo-answer-3"],
.demo-practice:has(#demo-answer-4:checked) .demo-bar[for="demo-answer-4"] {
  border-color: #0c2f57;
  background: #28537f;
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.stimulus-wrap {
  position: relative;
  display: block;
  width: 100%;
  max-width: 921px;
  margin: 1rem auto;
}

.stimulus {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stimulus-svg svg {
  display: block;
  width: 100%;
  height: auto;
}

.hotspot {
  position: absolute;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0.2rem;
  background: transparent;
  cursor: not-allowed;
}

.hotspot:hover,
.hotspot:active {
  transform: none;
}

.hotspot:disabled {
  opacity: 1;
  cursor: not-allowed;
}

.stimulus-wrap:not(.active) .hotspot:hover {
  background: rgba(94, 104, 120, 0.1);
  outline: 2px dashed rgba(94, 104, 120, 0.55);
  outline-offset: 0;
}

.stimulus-wrap.active .hotspot {
  cursor: pointer;
}

.stimulus-wrap.active .hotspot:hover,
.stimulus-wrap.active .hotspot:focus-visible {
  background: rgba(29, 78, 216, 0.12);
  outline: 2px dashed rgba(29, 78, 216, 0.72);
  outline-offset: 0;
}

.stimulus-wrap.active .hotspot.selected {
  background: rgba(29, 78, 216, 0.18);
  outline: 2px solid rgba(29, 78, 216, 0.9);
  outline-offset: 0;
}

.trial-document:has(#answer-1:checked) .hotspot[data-option-number="1"],
.trial-document:has(#answer-2:checked) .hotspot[data-option-number="2"],
.trial-document:has(#answer-3:checked) .hotspot[data-option-number="3"],
.trial-document:has(#answer-4:checked) .hotspot[data-option-number="4"],
.trial-document:has(#answer-5:checked) .hotspot[data-option-number="5"],
.trial-document:has(#answer-6:checked) .hotspot[data-option-number="6"] {
  background: rgba(29, 78, 216, 0.18);
  outline: 2px solid rgba(29, 78, 216, 0.9);
  outline-offset: 0;
}

.stimulus-wrap .hotspot.hotspot--silent:hover,
.stimulus-wrap .hotspot.hotspot--silent:focus-visible,
.stimulus-wrap .hotspot.hotspot--silent.selected {
  background: transparent;
  outline: 0;
}

.trial-document .hotspot.hotspot--silent {
  /* Scatter points remain useful click targets, but revealing every point in
     the selected category would disclose the answer visually. */
  background: transparent !important;
  outline: 0 !important;
}

.trial-response-panel {
  display: grid;
  min-height: 18rem;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.15rem);
  background: var(--surface);
}

.ready-screen,
.trial-response-panel .answer-panel {
  grid-area: 1 / 1;
}

.ready-screen {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 1rem;
  background: var(--surface-subtle);
}

.ready-screen button {
  min-width: 9rem;
  margin: 0;
}

.answer-panel {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.15rem);
  background: var(--surface);
}

.trial-response-panel .answer-panel {
  margin: 0;
  border: 0;
  background: transparent;
}

.question {
  margin: 0 0 0.25rem;
  font-size: 1.08rem;
  font-weight: 750;
  line-height: 1.4;
}

.answer-actions {
  padding-top: 0.25rem;
}

.elapsed-timer {
  --elapsed-seconds: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  animation: elapsed-seconds 3600s steps(3600, end) forwards;
  counter-reset: elapsed-seconds var(--elapsed-seconds);
}

.elapsed-timer::before {
  content: counter(elapsed-seconds) " s";
}

.is-submitting .elapsed-timer {
  animation-play-state: paused;
}

.is-submitting {
  pointer-events: none;
}

.is-submitting button[type="submit"] {
  cursor: wait;
  opacity: 0.65;
}

html::before {
  content: "";
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 0;
  height: 0.2rem;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
}

html.enhanced-navigation-pending::before {
  width: 72%;
  opacity: 1;
  transition: width 8s cubic-bezier(0.1, 0.7, 0.2, 1), opacity 120ms ease;
}

@media (prefers-reduced-motion: reduce) {
  html.enhanced-navigation-pending::before {
    transition: none;
  }
}

@property --elapsed-seconds {
  syntax: "<integer>";
  initial-value: 0;
  inherits: false;
}

@keyframes elapsed-seconds {
  to {
    --elapsed-seconds: 3600;
  }
}

.completion-summary {
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  font-weight: 650;
}

/* Public study results */

.results-warning {
  margin: 0 0 1.5rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--danger);
  border-left-width: 4px;
  border-radius: var(--radius);
  color: var(--danger);
  background: var(--danger-soft);
  font-weight: 650;
}

.variant-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overscroll-behavior-inline: contain;
}

.table-scroll:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.data-table th,
.data-table td {
  padding: 0.62rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: #fafbfc;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table code {
  padding: 0;
  background: transparent;
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.responses-table {
  display: block;
  min-width: 0;
}

.response-table-scroll {
  overflow: visible;
  border: 0;
  background: transparent;
}

.responses-table thead {
  display: none;
}

.responses-table tbody {
  display: grid;
  gap: 1rem;
}

.response-card-grid .responses-table tbody {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  align-items: start;
}

.responses-table tr {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.responses-table td,
.responses-table tbody tr:last-child td {
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 0;
}

.responses-table td::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 0.18rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1.25;
  text-transform: uppercase;
}

.responses-table td[data-label="Figure"],
.responses-table td[data-label="Prompt"] {
  grid-column: 1 / -1;
}

.responses-table td[data-label="Figure"],
.responses-table td[data-label="Prompt"] {
  border-top: 1px solid var(--line);
}

.response-stimulus {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 0.75rem;
  border-radius: 0.35rem;
  background: var(--surface-subtle);
}

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

.participant-card {
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
}

.participant-card:hover {
  border-color: var(--accent);
  color: var(--ink);
  background: var(--accent-soft);
}

.participant-card__heading,
.participant-card__metrics {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.participant-card__heading {
  justify-content: space-between;
}

.participant-card__heading time,
.participant-card__metrics {
  color: var(--muted);
  font-size: 0.85rem;
}

.participant-card__action {
  color: var(--accent);
  font-weight: 700;
}

.back-link {
  margin: 0 0 1rem;
}

.participant-summary {
  color: var(--muted);
}

.pagination {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) 5rem;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  font-size: 0.9rem;
}

.pagination a,
.pagination > span:not(.pagination-status) {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  text-decoration: none;
}

.pagination > span[aria-disabled="true"] {
  color: var(--muted);
  background: var(--surface-subtle);
}

.pagination-status {
  color: var(--muted);
  text-align: center;
}

.response-question-pagination,
.overview-pagination {
  margin-bottom: 1rem;
}

.response-question-pagination--top,
.overview-pagination--top {
  margin: 1.25rem 0;
}

.status {
  display: inline-flex;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 750;
}

.status--correct {
  color: var(--success);
  background: var(--success-soft);
}

.status--incorrect {
  color: var(--danger);
  background: var(--danger-soft);
}

/* Stimulus validation overview */

.overview-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 1.25rem 0;
  padding: 0.65rem 0;
  background: var(--surface);
}

.methodology-introduction {
  margin-bottom: 1.5rem;
}

.methodology-introduction h2 {
  margin: 1.25rem 0 0.35rem;
}

.methodology-introduction p {
  margin: 0 0 0.65rem;
}

.variant-nav {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.variant-nav a {
  min-width: 2.2rem;
  padding: 0.32rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--surface);
  text-align: center;
  text-decoration: none;
}

.variant-nav a:hover,
.variant-nav a[aria-current="page"] {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  font-weight: 750;
}

.variant-nav a::after {
  font-weight: 750;
}

.overview-review-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 650;
  cursor: pointer;
}

.overview-review-toggle:hover,
.overview-review-toggle:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.overview-review-toggle:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.overview-review-toggle input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--accent);
}

.overview-section {
  margin: 0 0 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.overview-section:first-child {
  border-top: 0;
}

.overview-section h2 {
  margin: 0 0 0.4rem;
}

.section-description {
  max-width: 60rem;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.overview-table-scroll {
  border-color: var(--line-strong);
}

.stim-grid,
.stim-pairs {
  width: 100%;
  min-width: 52rem;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--surface);
}

.stim-grid th,
.stim-grid td,
.stim-pairs th,
.stim-pairs td {
  padding: 0.75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.stim-grid th,
.stim-pairs th {
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 0.82rem;
}

.stim-grid tr > :first-child,
.stim-pairs tr > :first-child {
  width: 9rem;
}

.stim-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
}

.stim-card {
  min-width: 0;
  height: 100%;
  padding: 0.75rem;
  background: var(--surface);
}

.stim-level {
  margin: 0 0 0.45rem;
  font-weight: 750;
}

.stim-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--surface-subtle);
}

.stim-image > svg {
  display: block;
  width: 100%;
  height: 100%;
}

.response-stimulus > svg {
  display: block;
  width: 100%;
  height: auto;
}

.overview-stimulus-wrap {
  position: relative;
  display: block;
  max-width: 100%;
}

.overview-hotspot {
  position: absolute;
  display: none;
  border: 2px solid #c1121f;
  background: rgba(193, 18, 31, 0.12);
  pointer-events: none;
}

.overview-hotspot > span {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 100%;
  padding: 0.1rem 0.25rem;
  overflow: hidden;
  color: #fff;
  background: rgba(193, 18, 31, 0.92);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-controls:has(#show-area-boxes:checked) ~ .overview-catalogue .overview-hotspot {
  display: block;
}

.figure-description {
  margin: 0.6rem 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
}

.stim-meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.28rem 0.6rem;
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
}

.stim-meta dt {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.stim-meta dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 44rem) {
  html,
  body {
    background: var(--surface);
  }

  .container {
    padding: 1.25rem 1rem 3rem;
    box-shadow: none;
  }

  .site-tabs-scroll {
    margin: -1.25rem -1rem 2rem;
    padding-bottom: 0.4rem;
  }

  .site-tabs {
    padding-inline: 1rem;
  }

  .stim-grid,
  .stim-pairs {
    min-width: 46rem;
  }
}

@media (max-width: 31rem) {
  h1 {
    font-size: 1.55rem;
  }

  fieldset,
  .answer-panel {
    padding-inline: 0.75rem;
  }

  .answer-actions button {
    flex: 1 1 auto;
  }

}
