:root {
  --paper: #f7fafb;
  --ink: #142029;
  --muted: #5a6b76;
  --line: #d3e0e3;
  --panel: #ffffff;
  --steel: #1d6e9c;
  --steel-soft: #e7f2f8;
  --teal: #0f8f87;
  --teal-soft: #e3f5f2;
  --green: #18925a;
  --green-soft: #e8f7ee;
  --red: #cf4a5b;
  --red-soft: #fdeef0;
  --gold: #b8851c;
  --gold-soft: #fbf3e2;
  --violet: #5b62bd;
  --violet-soft: #eceefb;
  --takeaway: #1c3f56;
  --takeaway-soft: #eef6fa;
  --takeaway-warm: #f3fafa;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  padding: 0;
  background: #e7eef0;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.15;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

sub,
sup {
  line-height: 0;
}

.page-shell {
  width: min(1180px, calc(100vw - 16px));
  aspect-ratio: 36 / 47;
  display: grid;
  grid-template-rows: 168px minmax(0, 1fr) 92px;
  gap: 12px;
  padding: 18px 22px 16px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 251, 0.98)),
    var(--paper);
  box-shadow:
    inset 0 0 0 1px rgba(211, 224, 227, 0.95),
    0 16px 48px rgba(20, 32, 41, 0.16);
  margin: 8px auto;
}

/* ============================ HEADER ============================ */
.poster-header {
  min-height: 0;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr) 226px;
  grid-template-rows: auto auto;
  column-gap: 16px;
  row-gap: 2px;
  align-items: center;
}

.header-logos--left {
  grid-row: 1;
  grid-column: 1;
}

.header-title {
  grid-row: 1;
  grid-column: 2;
}

.header-logos--right {
  grid-row: 1;
  grid-column: 3;
}

/* Author byline + equal-contribution note span the full header width on their
   own row, so the long single-line byline never collides with the side logos. */
.header-credits {
  grid-row: 2;
  grid-column: 1 / -1;
  text-align: center;
}

.header-logos {
  display: grid;
  gap: 12px;
  align-content: center;
}

.header-logos--left {
  justify-items: start;
}

.header-logos--right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.header-marks {
  display: grid;
  gap: 8px;
  justify-items: center;
  align-content: center;
}

.logo--ccf {
  width: 92px;
}

.logo {
  object-fit: contain;
}

.logo--cwru {
  width: 268px;
}

.logo--miccai {
  width: 168px;
}

.logo--nsf {
  width: 56px;
}

.logo--poster-qr {
  width: 74px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.poster-qr-callout {
  width: 108px;
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #2b4250;
  font-size: 0.56rem;
  line-height: 1.05;
  font-weight: 860;
  text-align: center;
}

.header-title {
  min-width: 0;
  text-align: center;
}

.header-title h1,
.header-title .subtitle {
  position: relative;
  top: 6px;
  margin: 0;
  color: #102633;
  font-family: var(--sans);
  line-height: 0.94;
  font-weight: 920;
  letter-spacing: 0;
  text-wrap: balance;
}

.header-title h1 {
  font-size: 2.34rem;
}

.subtitle {
  margin: 9px 0 0;
  color: var(--steel);
  font-size: 1.18rem;
  font-weight: 880;
  letter-spacing: 0.01em;
}

.authors {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.04;
  font-weight: 740;
  text-align: center;
  white-space: nowrap;
}

.authors a,
.authors span:not([aria-hidden]) {
  color: inherit;
}

.authors-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 640;
  text-align: center;
}

.authors a {
  text-decoration: none;
  cursor: pointer;
  transition:
    color 140ms ease,
    text-decoration-color 140ms ease;
}

.authors a:hover,
.authors a:focus-visible {
  color: var(--steel);
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.authors a:focus-visible {
  outline: 2px solid rgba(29, 110, 156, 0.34);
  outline-offset: 2px;
  border-radius: 4px;
}

/* The centered max-content + nowrap author line clips off the right edge on
   phones; let it wrap to the viewport instead. */
@media (max-width: 760px) {
  .authors {
    left: auto;
    width: auto;
    transform: none;
    white-space: normal;
    text-align: center;
  }
}

/* ============================= MAIN ============================= */
.poster-main {
  min-height: 0;
  display: grid;
}

.poster-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
  grid-template-rows: minmax(0, 0.92fr) minmax(0, 1.08fr) minmax(0, 0.94fr) auto;
  grid-template-areas:
    "problem benchmark"
    "method headline"
    "findings findings"
    "takeaway takeaway";
  gap: 12px;
}

.panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: 9px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(28, 50, 60, 0.07);
  overflow: hidden;
}

.panel h2 {
  margin: 0;
  padding: 8px 11px;
  border-radius: 8px;
  background: #eaf2f4;
  color: #16323f;
  font-size: 1.04rem;
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: 0;
}

.panel figure {
  min-width: 0;
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
  justify-items: center;
  overflow: hidden;
}

.panel figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.panel figcaption {
  color: #3f5159;
  font-size: 0.62rem;
  line-height: 1.12;
  font-weight: 660;
  text-align: left;
}

.panel ul {
  margin: 0;
  padding-left: 1rem;
  color: #33454d;
  font-size: 0.74rem;
  line-height: 1.2;
  font-weight: 560;
}

.panel li + li {
  margin-top: 0.3rem;
}

.panel li strong {
  color: #14252e;
  font-weight: 900;
}

.panel li em {
  font-style: italic;
  color: var(--steel);
  font-weight: 760;
}

/* accent borders by color class */
.panel--blue {
  border-top: 6px solid var(--steel);
}

.panel--purple {
  border-top: 6px solid var(--violet);
}

.panel--green {
  border-top: 6px solid var(--green);
}

.panel--red {
  border-top: 6px solid var(--red);
}

.panel--gold {
  border-top: 6px solid var(--gold);
}

/* ---- PROBLEM ---- */
.panel--problem {
  grid-area: problem;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.factor-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.factor-strip p:nth-child(5) {
  grid-column: 1 / -1;
}

.factor-strip p {
  min-width: 0;
  margin: 0;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--steel-soft);
  border: 1px solid rgba(29, 110, 156, 0.18);
}

.factor-strip p > span,
.factor-strip p > strong {
  display: block;
}

.factor-strip p > span {
  color: #0f5d86;
  font-size: 0.42rem;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.factor-strip p > strong {
  margin-top: 4px;
  color: #15303d;
  font-size: 0.62rem;
  line-height: 1.04;
  font-weight: 880;
}

/* ---- BENCHMARK ---- */
.panel--benchmark {
  grid-area: benchmark;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.panel--benchmark figure {
  padding: 4px;
  border-radius: 8px;
  background: #fafcfc;
  border: 1px solid rgba(211, 224, 227, 0.8);
}

/* ---- METHOD ---- */
.panel--method {
  grid-area: method;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

.method-lede {
  margin: 0;
  color: #33454d;
  font-size: 0.74rem;
  line-height: 1.2;
  font-weight: 580;
}

.method-lede strong {
  color: #14252e;
  font-weight: 900;
}

.method-lede em {
  font-style: italic;
  font-weight: 760;
}

.formula {
  min-width: 0;
  margin: 0;
  padding: 9px 8px;
  border-radius: 8px;
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px rgba(24, 146, 90, 0.2);
  color: #11281c;
  font-size: 0.7rem;
  line-height: 1.05;
  font-weight: 760;
  text-align: center;
  overflow-x: auto;
}

.formula .katex {
  display: inline-block;
  white-space: nowrap;
}

.method-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.method-tags span {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #0f5e3a;
  font-size: 0.56rem;
  line-height: 1;
  font-weight: 900;
}

.method-tags .katex {
  display: inline-block;
  white-space: nowrap;
}

/* ---- HEADLINE ---- */
.panel--headline {
  grid-area: headline;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.panel--headline figure {
  padding: 4px;
  border-radius: 8px;
  background: #fafcfc;
  border: 1px solid rgba(211, 224, 227, 0.8);
}

.split-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.split-comparison p {
  min-width: 0;
  margin: 0;
  padding: 8px 9px;
  border-radius: 8px;
  font-weight: 820;
  text-align: center;
}

.split-comparison p > span,
.split-comparison p > strong {
  display: block;
}

.split-comparison p > span {
  font-size: 1.12rem;
  line-height: 1;
  font-weight: 950;
}

.split-comparison p > strong {
  margin-top: 4px;
  font-size: 0.56rem;
  line-height: 1.1;
  font-weight: 800;
}

.is-loser {
  background: var(--red-soft);
  color: #8a2f3c;
}

.is-winner {
  background: var(--steel-soft);
  color: #0d4f74;
}

/* ---- shared metric grid ---- */
.metric-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.metric-grid p {
  min-width: 0;
  margin: 0;
  padding: 7px 7px;
  border-radius: 8px;
  background: var(--takeaway);
  color: #eaf5f4;
  text-align: center;
}

.metric-grid > p > strong,
.metric-grid > p > span {
  display: block;
}

.metric-grid > p > strong {
  color: #8fe0d4;
  font-size: 1.04rem;
  line-height: 1;
  font-weight: 950;
}

.metric-grid > p > span {
  margin-top: 5px;
  color: #d3e6e6;
  font-size: 0.46rem;
  line-height: 1.12;
  font-weight: 720;
}

.source-note {
  margin: 0;
  color: #46585f;
  font-size: 0.6rem;
  line-height: 1.16;
  font-weight: 600;
}

.source-note strong {
  color: #1b3340;
  font-weight: 900;
}

/* ---- FINDINGS ---- */
.panel--findings {
  grid-area: findings;
  grid-template-rows: auto minmax(0, 1fr);
}

.findings-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.finding-card {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 5px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--gold-soft);
  border: 1px solid rgba(184, 133, 28, 0.24);
}

.finding-card--quiet {
  background: #f3f6f7;
  border-color: rgba(211, 224, 227, 0.95);
}

.finding-card h3 {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #1c2c34;
  font-size: 0.7rem;
  line-height: 1.02;
  font-weight: 920;
}

.finding-card h3 span {
  flex: none;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--gold);
  color: #ffffff;
  font-size: 0.5rem;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0.03em;
}

.finding-card--quiet h3 span {
  background: var(--takeaway);
}

.finding-card p {
  margin: 0;
  align-self: center;
  color: #36474e;
  font-size: 0.64rem;
  line-height: 1.18;
  font-weight: 600;
}

.finding-card p strong {
  color: #15252d;
  font-weight: 900;
}

.finding-card .katex {
  display: inline-block;
  white-space: nowrap;
}

/* ---- TAKEAWAY ---- */
.panel--takeaway {
  grid-area: takeaway;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 5px 14px;
  align-content: start;
  border-color: rgba(28, 63, 86, 0.26);
  border-top: 6px solid var(--takeaway);
  background:
    linear-gradient(180deg, var(--takeaway-soft), var(--takeaway-warm) 72%, #ffffff),
    #ffffff;
}

.panel--takeaway h2 {
  grid-column: 1 / -1;
  background:
    linear-gradient(90deg, rgba(29, 110, 156, 0.16), rgba(15, 143, 135, 0.14)),
    var(--takeaway-soft);
  color: #12303f;
}

.panel--takeaway .takeaway-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.takeaway-list li {
  min-width: 0;
  padding-left: 15px;
  color: #2f414b;
  font-size: 0.66rem;
  line-height: 1.16;
  font-weight: 660;
  position: relative;
}

.takeaway-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.34em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--takeaway);
}

.takeaway-list strong {
  color: #142a37;
  font-weight: 930;
}

.takeaway-card {
  min-width: 0;
  align-self: center;
  display: grid;
  align-items: center;
  padding: 10px 13px;
  border-radius: 14px;
  background: var(--takeaway);
  border: 1px solid rgba(143, 224, 212, 0.24);
}

.takeaway-card p {
  margin: 0;
  color: #e8f4f3;
  font-size: 0.7rem;
  line-height: 1.18;
  font-weight: 760;
}

.takeaway-card strong {
  color: #8fe0d4;
  font-weight: 950;
}

.acknowledgement {
  grid-column: 1 / -1;
  margin: 0;
  color: #5e6f78;
  font-size: 0.5rem;
  line-height: 1.12;
  font-weight: 620;
}

.acknowledgement strong {
  color: #52606b;
  font-weight: 900;
}

/* ============================ FOOTER ============================ */
.poster-footer {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.35fr);
  gap: 12px;
}

.cta-card,
.quickstart {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(28, 45, 52, 0.07);
}

.cta-card {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 14px;
  text-decoration: none;
}

.cta-card__meta {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.cta-card__chip {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eaf2f4;
  color: #173b48;
  font-size: 0.74rem;
  line-height: 1;
  font-weight: 900;
}

.cta-card__chip img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.cta-card__url {
  display: block;
  min-width: 0;
  color: #2c4150;
  font-size: 0.78rem;
  line-height: 1.08;
  font-weight: 880;
  overflow-wrap: anywhere;
}

.cta-card__qr {
  width: 58px;
  height: 58px;
  padding: 3px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.cta-card--github {
  background: linear-gradient(180deg, #ffffff 0%, #f4f8f8 100%);
}

.quickstart {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--takeaway);
  color: #e6f1f0;
}

.quickstart code {
  display: block;
  color: #8fe5d2;
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.18;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================ PRINT ============================ */
@page {
  size: 36in 47in;
  margin: 0;
}

@media print {
  body {
    background: #ffffff;
  }

  .page-shell {
    width: 36in;
    height: 47in;
    margin: 0;
    box-shadow: none;
  }
}

/* ======================== SMALL SCREEN ======================== */
@media (max-width: 900px) {
  .page-shell {
    width: min(760px, calc(100vw - 12px));
    grid-template-rows: auto auto auto;
    aspect-ratio: auto;
  }

  .poster-header,
  .poster-grid,
  .poster-footer {
    grid-template-columns: 1fr;
  }

  /* In the stacked mobile header, let the children flow in source order
     instead of the fixed two-row desktop placement. */
  .header-logos--left,
  .header-title,
  .header-logos--right,
  .header-credits {
    grid-row: auto;
    grid-column: auto;
  }

  .poster-grid {
    grid-template-areas:
      "problem"
      "benchmark"
      "method"
      "headline"
      "findings"
      "takeaway";
    grid-template-rows: auto;
  }

  .findings-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .panel--takeaway {
    grid-template-columns: 1fr;
  }

  .factor-strip,
  .metric-grid,
  .split-comparison {
    grid-template-columns: 1fr;
  }

  .header-logos {
    justify-items: center;
  }

  .header-logos--right {
    justify-content: center;
  }

  .header-title h1 {
    font-size: 1.9rem;
  }
}
