.res-figure {
  display: grid;
  grid-template-columns: minmax(0, 21rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  margin: 1.75rem 0;
  padding: 1rem;
  border: 1px solid var(--c-line);
  border-radius: 14px;
  background: var(--surface);
}

.res-figure--wide { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }

.res-figure--chart {
  grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr);
  align-items: center;
}
.res-figure.res-figure--chart img.res-chart { max-width: 100%; width: 100%; }
.res-figure--chart figcaption { font-size: 0.95rem; }
@media (max-width: 767.98px) {
  .res-figure--chart { grid-template-columns: minmax(0, 1fr); }
}

.res-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.res-figure img.res-chart {
  max-width: 21rem;
  margin: 0 auto;
  background: #fff;
}

.res-figure figcaption {
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--c-text-2);
}
.res-figure figcaption strong { display: block; margin-bottom: 0.3rem; color: var(--c-text); }

.res-figure-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.75rem 0;
}
.res-figure-pair .res-figure {
  display: block;
  margin: 0;
}
.res-figure-pair .res-figure img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  max-width: none;
  background: #0b1418;
}
.res-figure-pair .res-figure img.res-chart { background: #fff; }
.res-figure-pair .res-figure figcaption { padding-top: 0.8rem; }

@media (max-width: 719.98px) {
  .res-figure,
  .res-figure--wide { grid-template-columns: minmax(0, 1fr); gap: 0.8rem; }
  .res-figure-pair { grid-template-columns: minmax(0, 1fr); }
}

.res-figure { scroll-margin-top: 100px; }

.res-system { --sys: #0f766e; }
.res-system[data-part="inhibition"] { --sys: #9a5b00; }
html[data-theme="dark"] .res-system { --sys: #49c5b6; }
html[data-theme="dark"] .res-system[data-part="inhibition"] { --sys: #e6b060; }

.res-systems-nav { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0 0 3.5rem; }
.res-systems-nav a[data-part="detect"]     { --sys: #0f766e; }
.res-systems-nav a[data-part="inhibition"] { --sys: #9a5b00; }
html[data-theme="dark"] .res-systems-nav a[data-part="detect"]     { --sys: #49c5b6; }
html[data-theme="dark"] .res-systems-nav a[data-part="inhibition"] { --sys: #e6b060; }
.desc .res-systems-nav a {
  flex: 1 1 14rem;
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 1rem 1.4rem; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--sys) 40%, transparent);
  border-left: 6px solid var(--sys);
  background: color-mix(in srgb, var(--sys) 5%, transparent);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.desc .res-systems-nav a:hover,
.desc .res-systems-nav a:focus-visible {
  background: color-mix(in srgb, var(--sys) 12%, transparent);
  border-color: var(--sys);
}
.res-systems-nav-name {
  font-family: "Changa", sans-serif; font-weight: 800; font-size: 1.4rem;
  line-height: 1.2; color: var(--sys);
}

.res-system { scroll-margin-top: 100px; }
.res-system + .res-system { margin-top: 5.5rem; }
.res-system-head { margin-bottom: 2.5rem; }
.res-system-num {
  display: block;
  font-family: "Changa", sans-serif; font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--sys); opacity: 0.85;
}
.desc .res-system > .res-system-head .res-system-title:not(#res-x) {
  margin: 0.15rem 0 0;
  font-family: "Changa", sans-serif; font-weight: 800;
  font-size: 2.6rem; line-height: 1.1;
  color: var(--sys);
}
.desc .res-system > .res-system-head .res-system-title:not(#res-x)::before { content: none; }

.res-system { counter-reset: res-part; }

.res-part {
  --stage: #3f7d1c;
  counter-increment: res-part;
  margin-bottom: 4.5rem;
}
.res-part[data-assay="swarming"]  { --stage: #1e8a55; }
.res-part[data-assay="biofilm"]   { --stage: #6a4fb3; }
.res-part[data-assay="pyocyanin"] { --stage: #1f72a8; }
.res-part[data-assay="overall"]   { --stage: #a8571f; }
html[data-theme="dark"] .res-part                          { --stage: #a0e860; }
html[data-theme="dark"] .res-part[data-assay="swarming"]  { --stage: #4fd48f; }
html[data-theme="dark"] .res-part[data-assay="biofilm"]   { --stage: #b39ddb; }
html[data-theme="dark"] .res-part[data-assay="pyocyanin"] { --stage: #5bb6e6; }
html[data-theme="dark"] .res-part[data-assay="overall"]   { --stage: #e8a05b; }

.res-system[data-part="detect"] .res-part { --stage: #0f766e; }
.res-system[data-part="detect"] .res-part[data-assay="timecourse"] { --stage: #0e7490; }
html[data-theme="dark"] .res-system[data-part="detect"] .res-part { --stage: #4fd4c8; }
html[data-theme="dark"] .res-system[data-part="detect"] .res-part[data-assay="timecourse"] { --stage: #5bc8e6; }

.desc .res-part > h3:not(#res-x) {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0 0 0.9rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--c-line);
  font-size: 2rem;
  color: var(--stage);
}
.desc .res-part > h3:not(#res-x)::before {
  content: counter(res-part, decimal-leading-zero);
  position: static;
  width: auto;
  height: auto;
  background: none;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--stage);
  opacity: 0.8;
}
.desc .res-part > h3:not(#res-x)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 3.5rem;
  height: 3px;
  border-radius: 2px;
  background: var(--stage);
}

.res-part[data-assay="overview"],
.res-part[data-assay="overall"] { counter-increment: none; }
.desc .res-part[data-assay="overview"] > h3:not(#res-x)::before,
.desc .res-part[data-assay="overall"] > h3:not(#res-x)::before { content: none; }

.res-part[data-assay="overview"] > p {
  margin: 0;
  padding: 0 1.4rem;
  border-left: 3px solid var(--stage);
  background: color-mix(in srgb, var(--stage) 6%, transparent);
  font-size: 1.04rem;
}
.res-part[data-assay="overview"] > p:first-of-type { padding-top: 1.2rem; border-top-right-radius: 12px; }
.res-part[data-assay="overview"] > p:last-of-type  { padding-bottom: 1.2rem; border-bottom-right-radius: 12px; }
.res-part[data-assay="overview"] > p + p { padding-top: 0.9rem; }

.res-part .res-figure {
  border-top: 3px solid color-mix(in srgb, var(--stage) 70%, transparent);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.res-part .res-figure:hover { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22); }
.res-part .res-figure figcaption strong { color: var(--stage); }

.desc .res-part a[href^="#fig-"] {
  color: var(--stage);
  text-decoration: none;
  border-bottom: 1px dotted color-mix(in srgb, var(--stage) 60%, transparent);
}
.desc .res-part a[href^="#fig-"]:hover { border-bottom-style: solid; }

.res-part .res-figure:target { animation: res-part-found 1.6s ease-out; }
@keyframes res-part-found {
  0%, 30% { border-color: var(--stage); box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage) 35%, transparent); }
  100%    { box-shadow: 0 0 0 3px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .res-part .res-figure:target { animation: none; border-color: var(--stage); }
  .res-part .res-figure { transition: none; }
}

@media (max-width: 575.98px) {
  .desc .res-part > h3:not(#res-x) { font-size: 1.6rem; }
  .res-part[data-assay="overview"] > p { padding-left: 1rem; padding-right: 1rem; }
}

.res-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0;
  padding: 0;
  list-style: none;
}
.res-readout > li {
  flex: 1 1 8rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--stage) 4%, transparent);
}
.res-readout > li.res-readout-lead {
  flex: 1.7 1 15rem;
  border-color: color-mix(in srgb, var(--stage) 55%, transparent);
  background: color-mix(in srgb, var(--stage) 10%, transparent);
}
.res-readout-k {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--c-text);
}
.res-readout-lead .res-readout-k { font-size: 1.65rem; color: var(--stage); }
.res-readout-src {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-3);
}
.res-readout-lead .res-readout-src { color: color-mix(in srgb, var(--stage) 80%, var(--c-text-2)); }
.res-readout-v {
  display: block;
  margin-top: 0.55rem;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}
.res-readout-lead .res-readout-v { font-size: 2.1rem; color: var(--stage); }
.res-readout-n {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--c-text-2);
}
@media (max-width: 575.98px) {
  .res-readout > li, .res-readout > li.res-readout-lead { flex: 1 1 100%; }
  .res-readout-lead .res-readout-v { font-size: 1.8rem; }
}
.res-readout:has(> li:nth-child(4)) > li { flex: 1 1 10rem; }
.res-readout:has(> li:nth-child(4)) > li.res-readout-lead { flex: 1.3 1 13rem; }
.res-readout:has(> li:nth-child(4)) .res-readout-v { font-size: 1.05rem; white-space: nowrap; }
.res-readout:has(> li:nth-child(4)) .res-readout-lead .res-readout-v { font-size: 1.7rem; }
@media (max-width: 720px) {
  .res-readout:has(> li:nth-child(4)) > li,
  .res-readout:has(> li:nth-child(4)) > li.res-readout-lead { flex: 1 1 100%; }
}

.res-refs { margin-top: 5rem; }
.res-refs h2 { margin-bottom: 1.25rem; font-size: 1.6rem; }
