:root {
  /* Texas A&M palette: Aggie Maroon + white; neutrals and accents from the secondary palette */
  --maroon: #500000;
  --maroon-dark: #3c0000;
  --maroon-light: #732f2f;
  --ink: #202020;
  --muted: #3e3e3e;
  --grey: #707070;
  --faint: #d1d1d1;
  --beige: #d6d3c4;
  --accent: var(--maroon);
  --accent-soft: #f2f0ea;
  --correct: #2ca02c;
  --wrong: #d62728;
  --never: #e0a800;
  --nodet: #9e9e9e;
  --slide-w: 1280px;
  --slide-h: 720px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #202020;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  overflow: hidden;
}

.stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--slide-w);
  height: var(--slide-h);
  transform-origin: center center;
}

.slide {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fff;
  padding: 0 64px 64px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.head {
  margin: 0 -64px 18px;
  padding: 14px 64px 12px;
  background: var(--maroon);
  color: #fff;
  font-family: "Oswald", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
  border-bottom: 5px solid var(--maroon-dark);
}

h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 18px;
  font-weight: 700;
  color: var(--maroon);
}

h2 { font-size: 22px; margin: 0 0 10px; color: var(--accent); }
h3 { font-size: 18px; margin: 0 0 8px; }

p, li { font-size: 21px; line-height: 1.45; }
ul { margin: 0; padding-left: 26px; }
li { margin-bottom: 10px; }
li::marker { color: var(--accent); }

.body { flex: 1; min-height: 0; display: flex; gap: 36px; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.col.narrow { flex: 0 0 34%; }
.center { align-items: center; justify-content: center; }

.figure { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.figure img { max-width: 100%; max-height: 100%; object-fit: contain; }
.caption { font-size: 15px; color: var(--muted); margin-top: 6px; text-align: center; }

.box {
  background: var(--accent-soft);
  border-left: 5px solid var(--accent);
  padding: 16px 20px;
  border-radius: 4px;
  margin-bottom: 16px;
}
.box p, .box li { font-size: 19px; margin: 0 0 6px; }

.cite { color: var(--muted); font-size: 15px; background: #fff6d6; padding: 0 4px; border-radius: 3px; }
.tag {
  display: inline-block;
  font-size: 14px;
  padding: 3px 10px;
  margin: 0 6px 6px 0;
  border-radius: 999px;
  background: var(--faint);
  color: var(--muted);
}

table { border-collapse: collapse; width: 100%; font-size: 18px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--faint); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.best td { background: var(--accent-soft); font-weight: 600; }

.ok { color: var(--correct); font-weight: 700; }
.bad { color: var(--wrong); font-weight: 700; }
.hold { color: var(--never); font-weight: 700; }

.eq {
  font-family: "Cambria Math", "STIX Two Math", Georgia, serif;
  font-size: 30px;
  text-align: center;
  margin: 6px 0 14px;
}

.rq { display: flex; gap: 14px; margin-bottom: 14px; }
.rq .label {
  flex: 0 0 64px; height: 44px; border-radius: 6px; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 20px; display: flex; align-items: center; justify-content: center;
}
.rq p { margin: 4px 0 0; }

.pipeline { display: flex; align-items: stretch; gap: 0; margin: 10px 0 18px; }
.stagebox {
  flex: 1; border: 2px solid var(--accent); border-radius: 8px; padding: 12px 10px; text-align: center;
  background: #fff;
}
.stagebox b { display: block; font-size: 19px; margin-bottom: 4px; }
.stagebox span { font-size: 15px; color: var(--muted); }
.stagebox.focus { background: var(--accent); color: #fff; }
.stagebox.focus span { color: #dbe7f6; }
.arrow { flex: 0 0 34px; display: flex; align-items: center; justify-content: center; font-size: 26px; color: var(--accent); }

.footer {
  position: absolute; left: 64px; right: 64px; bottom: 20px;
  display: flex; justify-content: space-between; font-size: 13px; color: var(--muted);
  border-top: 2px solid var(--maroon); padding-top: 8px;
}

/* Title slide */
.title-slide { justify-content: center; padding-left: 96px; background: var(--maroon); color: #fff; border-left: 18px solid var(--maroon-dark); }
.title-slide .section { font-size: 15px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--beige); margin-bottom: 10px; }
.title-slide h1 { font-family: "Oswald", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 46px; max-width: 1020px; margin-bottom: 18px; color: #fff; }
.title-slide .subtitle { font-size: 24px; color: var(--beige); max-width: 900px; margin: 0 0 48px; }
.title-slide .authors { font-size: 22px; margin: 0; }
.title-slide .affil { font-size: 18px; color: var(--faint); margin: 6px 0 0; }
.title-slide li { color: #fff; }
.title-slide li::marker { color: var(--beige); }

/* Outcome bars (slide 8) */
.bars { width: 100%; }
.barrow { display: flex; align-items: center; margin-bottom: 12px; }
.barlabel { flex: 0 0 170px; font-size: 18px; }
.bar { flex: 1; display: flex; height: 36px; border-radius: 4px; overflow: hidden; }
.seg { display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; color: #fff; }
.seg.correct, .matrix td.correct { background: var(--correct); }
.seg.wrong, .matrix td.wrong { background: var(--wrong); }
.seg.never, .matrix td.never { background: var(--never); }
.seg.no_detection, .matrix td.no_detection { background: var(--nodet); }
.legend { display: flex; gap: 18px; font-size: 15px; color: var(--muted); margin: 4px 0 0 170px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Outcome matrix (slide 9) */
.matrix { width: auto; font-size: 12px; border-collapse: separate; border-spacing: 2px 1px; }
.matrix th { font-size: 11px; padding: 2px 6px; text-align: center; border: 0; text-transform: none; letter-spacing: 0; }
.matrix th:first-child { text-align: left; }
.matrix td { padding: 0 6px; border: 0; height: 14px; line-height: 13px; }
.matrix td.name { white-space: nowrap; color: var(--ink); padding-right: 10px; }
.matrix td:not(.name) { width: 92px; text-align: center; color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Sparse text slides: larger type for the room */
.roomy p, .roomy li { font-size: 25px; }
.roomy .box p, .roomy .box li { font-size: 22px; }
.roomy h2 { font-size: 25px; }
.roomy table { font-size: 21px; }
.roomy .rq p { font-size: 24px; }

/* Figure placeholder, status badges, agent cards */
.placeholder {
  flex: 1; min-height: 0; border: 2px dashed var(--grey); border-radius: 8px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--muted); font-size: 18px; padding: 20px;
}
.status { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.status.done { background: #e3f3e3; color: #1e7a1e; }
.status.plan { background: var(--faint); color: var(--muted); }
.status.pre { background: var(--beige); color: var(--maroon); }
.agents { display: flex; gap: 18px; margin: 4px 0 22px; }
.agent { flex: 1; border: 2px solid var(--accent); border-radius: 10px; padding: 16px 18px; background: #fff; }
.agent h3 { color: var(--accent); font-size: 21px; margin-bottom: 4px; }
.agent p { font-size: 19px; margin: 0; color: var(--ink); }
.agent .who { font-size: 15px; color: var(--muted); margin-top: 8px; }
.agentlist .item { margin-bottom: 14px; }
.agentlist h3 { font-size: 21px; margin: 0 0 2px; color: var(--accent); }
.agentlist p { font-size: 18px; margin: 0; line-height: 1.4; }
.refs li { font-size: 18px; line-height: 1.4; margin-bottom: 14px; }
.steps { justify-content: center; }
.steps .box { padding: 10px 14px; margin-bottom: 10px; }
.steps .box h3 { font-size: 17px; margin-bottom: 2px; }
.steps .box p { font-size: 16px; line-height: 1.35; margin: 0; }
.demogrid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px 16px; }
.demogrid .cell { min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.demogrid h3 { font-size: 16px; margin: 0 0 4px; color: var(--maroon); }
.demogrid img { flex: 1; min-height: 0; max-width: 100%; object-fit: contain; object-position: left top; border: 1px solid var(--faint); }
.evalgrid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px 28px; }
.evalgrid .cell { min-height: 0; display: flex; flex-direction: column; }
.evalgrid h3 { font-size: 18px; margin: 0 0 2px; }
.evalgrid img { flex: 1; min-height: 0; max-width: 100%; object-fit: contain; object-position: left top; }
.detailgrid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px 20px; margin-bottom: 8px; }
.detailgrid .cell { min-height: 0; display: flex; flex-direction: column; }
.detailgrid h3 { font-size: 15px; margin: 0 0 2px; color: var(--maroon); }
.detailgrid .cell a { flex: 1; min-height: 0; display: flex; }
.detailgrid img { flex: 1; min-height: 0; min-width: 0; max-width: 100%; object-fit: contain; object-position: center top; }
.recovery-plots { flex: 1; min-height: 0; display: grid; grid-template-rows: 1fr 1fr; gap: 8px; }
.recovery-plots .cell { min-height: 0; display: flex; flex-direction: column; }
.recovery-plots h3 { font-size: 14px; margin: 0 0 2px; color: var(--maroon); }
.recovery-plots .cell a { flex: 1; min-height: 0; display: flex; }
.recovery-plots img { flex: 1; min-height: 0; min-width: 0; max-width: 100%; object-fit: contain; object-position: center top; }
.rank-panel { flex: 0 0 40%; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.rank-panel h2 { margin: 0 0 2px; font-size: 14px; flex: 0 0 auto; }
.rank-table { width: 100%; font-size: 10.5px; border-collapse: collapse; flex: 0 0 auto; }
.rank-table th, .rank-table td { padding: 1px 4px; border-bottom: 1px solid #eee; line-height: 1.2; }
.rank-table th { font-size: 9.5px; color: var(--muted); text-transform: uppercase; }
.rank-table td.num, .rank-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank-table tr.truth td:first-child { color: var(--correct); font-weight: 700; }
.rank-table tr.best td { background: #f3ece4; }
.rank-note { font-size: 10px; color: var(--muted); margin: 3px 0 6px; flex: 0 0 auto; }
.rank-summary { padding: 8px 10px; margin: 0; flex: 0 0 auto; }
.rank-summary p { font-size: 12px; margin: 0 0 3px; }
.rank-summary p:last-child { margin: 0; }
.muted { color: var(--grey); font-weight: 700; }
.matrix td:not(.name) { padding: 0; }
.cell-link { display: block; height: 100%; padding: 0 6px; color: inherit; text-decoration: none; }

.hint { position: fixed; right: 14px; bottom: 10px; font-size: 12px; color: #707070; font-family: sans-serif; }

/* Overview page */
.overview { background: var(--accent-soft); overflow: auto; height: auto; min-height: 100%; padding: 40px; }
.overview h1 { color: var(--maroon); font-size: 34px; }
.overview ol { columns: 2; font-size: 20px; }
.overview a { color: var(--accent); text-decoration: none; }
.overview a:hover { text-decoration: underline; }

/* Conference backup index */
.backup-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 10px 16px;
  align-content: start;
}
.backup-grid .box { margin: 0; padding: 12px 16px; }
.backup-grid h3 { font-size: 18px; margin: 0 0 4px; }
.backup-grid h3 a { color: var(--maroon); text-decoration: none; }
.backup-grid h3 a:hover { text-decoration: underline; }
.backup-grid p { font-size: 15px; line-height: 1.35; margin: 0 0 4px; color: var(--muted); }
.backup-grid p a { color: var(--accent); text-decoration: none; }
.backup-grid p a:hover { text-decoration: underline; }
.backup-sub { font-size: 14px !important; }
.slide a { color: var(--accent); }

/* Tiny manuscript link in the footer (not part of the spoken slide). */
.ms-link {
  color: var(--grey);
  text-decoration: none;
  font-size: 12px;
  margin-left: 10px;
  opacity: 0.75;
}
.ms-link:hover { color: var(--maroon); opacity: 1; text-decoration: underline; }

/* Keyword chips */
.kwrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.kw {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--accent-soft);
  border: 1.5px solid var(--maroon);
  color: var(--maroon);
}
.kw.mute { border-color: var(--grey); color: var(--muted); background: #f7f7f7; font-weight: 600; }
.kw.ok { border-color: var(--correct); color: #1e7a1e; background: #eef7ee; }
.prompt {
  font-size: 15px;
  color: var(--muted);
  border-top: 2px solid var(--faint);
  padding-top: 8px;
  margin-top: 8px;
}
.prompt b { color: var(--maroon); }

/* Dense multi-plot packs for conference module slides */
.pack {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 10px 14px;
  align-content: stretch;
}
.pack.pack-det {
  grid-template-columns: 1.35fr 0.9fr;
  grid-template-rows: 1.15fr 1fr;
}
.pack.pack-dx {
  grid-template-columns: 0.9fr 1.15fr;
  grid-template-rows: minmax(0, 0.95fr) minmax(0, 1.15fr);
}
.pack.pack-rec {
  grid-template-columns: 0.85fr 1.2fr;
  grid-template-rows: minmax(0, 1.15fr) minmax(0, 0.95fr);
}
.pack .cell {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.pack .cell h3 {
  font-size: 13px;
  margin: 0 0 3px;
  color: var(--maroon);
  flex: 0 0 auto;
  line-height: 1.2;
}
.pack .cell img {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}
.pack .span2 { grid-column: 1 / -1; }
.pack .side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  justify-content: flex-start;
}
.pack .side .box { margin: 0; padding: 10px 12px; flex: 0 0 auto; }
.pack .side .box h3 { font-size: 15px; margin: 0 0 2px; }
.pack .side .box p, .pack .side .box li { font-size: 14px; margin: 0 0 2px; line-height: 1.3; }
.pack .side ul { margin: 0; padding-left: 18px; }
.pack .side .grow-fig {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.pack .side .grow-fig img {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: contain;
}
.pack .mini-eval {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px 10px;
  flex: 1;
  min-height: 0;
}
.pack .mini-eval .m {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.pack .mini-eval h4 {
  font-size: 12px;
  margin: 0 0 1px;
  color: var(--muted);
  font-weight: 600;
  flex: 0 0 auto;
}
.pack .mini-eval img {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: contain;
  object-position: left center;
}

/* HERA sandbox: fill height, larger photo */
.hera-slide .body { gap: 24px; }
.hera-slide .hera-left {
  flex: 0 0 32%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.hera-slide .hera-left .figure {
  flex: 1 1 auto;
  min-height: 260px;
}
.hera-slide .hera-left .figure img {
  object-fit: cover;
  object-position: center;
  width: 100%;
  height: 100%;
  max-height: none;
}
.hera-slide .hera-left ul { flex: 0 0 auto; }
.hera-slide .hera-tags { flex: 0 0 auto; margin-top: 8px; }
.hera-slide .hera-right {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.hera-slide .hera-right .figure { flex: 1; min-height: 0; }

/* Three-study cards stretch to fill */
.studies-slide .body { align-items: stretch; gap: 16px; }
.studies-slide .study-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.studies-slide .study-col .box {
  flex: 1;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 20px 18px 18px;
}
.studies-slide .study-col .box h3 { font-size: 19px; margin-bottom: 12px; }
.studies-slide .study-col .box p { font-size: 16px; margin: 0 0 9px; line-height: 1.35; }
.studies-slide .study-col .box .ask {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--faint);
  font-size: 16px;
}
.studies-slide .study-note {
  flex: 0 0 auto;
  font-size: 15px;
  color: var(--muted);
  margin: 10px 0 0;
}

/* Manuscript pages (not in SLIDES nav) */
body.manuscript {
  background: var(--accent-soft);
  overflow: auto;
  height: auto;
  min-height: 100%;
  padding: 40px 48px 80px;
  color: var(--ink);
}
body.manuscript .ms {
  max-width: 820px;
  margin: 0 auto;
  background: #fff;
  padding: 36px 44px;
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
body.manuscript h1 { font-size: 28px; margin: 0 0 6px; }
body.manuscript .ms-meta { color: var(--muted); font-size: 15px; margin: 0 0 24px; }
body.manuscript h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--maroon);
  margin: 22px 0 8px;
  border-bottom: 2px solid var(--beige);
  padding-bottom: 4px;
}
body.manuscript p, body.manuscript li { font-size: 17px; line-height: 1.5; }
body.manuscript ul { padding-left: 22px; }
body.manuscript a { color: var(--accent); }
body.manuscript .back { display: inline-block; margin-bottom: 18px; font-size: 14px; }

@media print {
  html, body { background: #fff; overflow: visible; }
  .stage { position: static; transform: none !important; }
  .slide { box-shadow: none; }
  .hint { display: none; }
}
