/* Public theme tokens. `branding.json` overrides these values before the directory
   renders. The defaults use University of Utah core colors without presenting this
   unofficial site as an official University property. */
:root {
  color-scheme: light;

  --brand-primary: #be0000;
  --brand-primary-dark: #890000;
  --brand-accent: #ffb81d;
  --brand-ink: #171717;
  --brand-muted: #5a5a5a;
  --brand-paper: #f7f7f5;
  --brand-line: #d9d9d6;

  /* Compatibility aliases keep the component styles semantic while the palette is
     configured by the published branding document. */
  --crimson: var(--brand-primary);
  --crimson-deep: var(--brand-primary-dark);
  --crimson-soft: var(--brand-primary);
  --crimson-tint: color-mix(in srgb, var(--brand-primary) 8%, white);
  --gold: var(--brand-accent);
  --gold-deep: #8a6413;
  --gold-tint: color-mix(in srgb, var(--brand-accent) 16%, white);
  --gray: var(--brand-muted);
  --ink: var(--brand-ink);
  --ink-soft: var(--brand-muted);
  --ink-muted: var(--brand-muted);
  --sand: color-mix(in srgb, var(--brand-primary) 5%, white);
  --sand-deep: var(--brand-line);
  --paper: var(--brand-paper);
  --white: #fff;
  --line: var(--brand-line);

  --shadow: 0 18px 55px rgb(78 78 78 / 12%);
  --radius: 20px;
  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    "Source Sans 3", "Avenir Next", Avenir, Montserrat, "Segoe UI", Inter, ui-sans-serif,
    -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--crimson);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgb(166 15 45 / 35%);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  padding: 0.7rem 1rem;
}

.skip-link:focus {
  top: 1rem;
}

.brand-bar {
  background: linear-gradient(90deg, var(--crimson) 0%, var(--crimson) 72%, var(--gold) 100%);
  height: 5px;
}

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  align-items: center;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 0.9rem 1.5rem;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  gap: 1rem;
  text-decoration: none;
}

.brand-mark {
  display: block;
  height: auto;
  max-height: 3.2rem;
  max-width: clamp(48px, 7vw, 96px);
  object-fit: contain;
}

.brand-rule {
  background: var(--line);
  height: 2.1rem;
  width: 1px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.97rem;
  letter-spacing: -0.015em;
}

.brand small {
  color: var(--ink-muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

nav {
  align-items: center;
  display: flex;
  gap: 0.2rem;
}

.header-actions {
  align-items: center;
  display: flex;
  gap: 1rem;
}

.nav-link,
.text-action {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  cursor: pointer;
}

.nav-link {
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 650;
  padding: 0.55rem 0.78rem;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--sand);
  color: var(--ink);
}

.official-site-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.48rem 0.75rem;
  text-decoration: none;
  white-space: nowrap;
}

.official-site-link:hover {
  background: var(--white);
  border-color: var(--sand-deep);
}

main {
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 0 1.5rem 5rem;
}

.hero {
  align-items: center;
  background:
    radial-gradient(circle at 9% 0%, rgb(255 255 255 / 78%), transparent 30%),
    linear-gradient(115deg, var(--crimson-tint) 0%, #f6ece4 52%, var(--gold-tint) 100%);
  border: 1px solid rgb(78 78 78 / 10%);
  border-radius: 24px;
  column-gap: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(1.4rem, 3vw, 2.1rem) clamp(1.4rem, 4vw, 2.6rem);
  position: relative;
  row-gap: 0.9rem;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.kicker {
  color: var(--crimson);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0 0 0.55rem;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 1;
  margin-bottom: 0.5rem;
  max-width: 890px;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  letter-spacing: -0.045em;
  line-height: 1.04;
  margin-bottom: 0.6rem;
}

h3,
h4 {
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.hero-lede {
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  margin-bottom: 0;
  max-width: 720px;
}

.freshness {
  align-items: center;
  color: var(--ink-soft);
  display: flex;
  font-size: 0.8rem;
  gap: 0.55rem;
}

.status-dot {
  background: var(--ink-muted);
  border: 4px solid rgb(111 111 111 / 18%);
  border-radius: 50%;
  height: 0.8rem;
  width: 0.8rem;
}

.freshness.is-current .status-dot {
  background: var(--gold);
  border-color: rgb(253 185 33 / 26%);
}

.freshness.is-stale .status-dot {
  background: var(--crimson);
  border-color: rgb(166 15 45 / 18%);
}

.metrics {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(5, 1fr);
  margin: 1.4rem 0 3.5rem;
  overflow: hidden;
}

.metric {
  align-items: baseline;
  border-left: 1px solid var(--line);
  display: flex;
  gap: 0.7rem;
  padding: 1.5rem clamp(1rem, 3vw, 2.2rem);
}

.metric:first-child {
  border-left: 0;
}

.metric-value {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 730;
  letter-spacing: -0.055em;
}

.metric-label {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.view {
  animation: reveal 280ms ease both;
}

.view[hidden] {
  display: none;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ask-answer[aria-busy="true"]::after {
    animation: none;
  }

  html,
  .carousel-track {
    scroll-behavior: auto;
  }

  .view {
    animation: none;
  }

  .carousel-dot {
    transition: none;
  }

  /* Rotation never starts under this preference, so the active dot stays a plain
     indicator rather than an empty countdown track. */
  .carousel-dots.is-rotating .carousel-dot.is-active {
    background: var(--crimson);
  }

  .carousel-dots.is-rotating .carousel-dot.is-active::after {
    animation: none;
  }
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.section-heading p:not(.kicker),
.expert-intro > p:last-child {
  color: var(--ink-soft);
  max-width: 700px;
}

.section-heading-spaced {
  margin-top: 5rem;
}

.text-action {
  color: var(--crimson);
  font-size: 0.86rem;
  font-weight: 720;
  padding: 0.4rem 0;
  white-space: nowrap;
}

.latest-grid,
.center-grid,
.researcher-grid {
  display: grid;
  gap: 1rem;
}

.latest-grid {
  grid-template-columns: repeat(3, 1fr);
}

.center-grid {
  grid-template-columns: repeat(2, 1fr);
}

.researcher-grid {
  grid-template-columns: repeat(2, 1fr);
}

.card,
.activity-record,
.center-hero,
.expert-group {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgb(78 78 78 / 6%);
}

.card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 1.4rem;
}

/* Centers carousel -------------------------------------------------------- */

.carousel {
  position: relative;
}

.carousel-track {
  display: grid;
  gap: 1rem;
  grid-auto-columns: calc((100% - 2rem) / 3);
  grid-auto-flow: column;
  overflow-x: auto;
  padding: 0.4rem 0.3rem 1.1rem;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.carousel-track:focus-visible {
  border-radius: var(--radius);
  outline: 2px solid var(--crimson);
  outline-offset: 4px;
}

.carousel-slide {
  scroll-snap-align: start;
}

.carousel-controls {
  display: flex;
  flex-shrink: 0;
  gap: 0.5rem;
}

.carousel-button {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-size: 1rem;
  height: 2.4rem;
  justify-content: center;
  width: 2.4rem;
}

.carousel-button:hover:not(:disabled) {
  background: var(--sand);
  border-color: var(--sand-deep);
}

.carousel-button:disabled {
  cursor: default;
  opacity: 0.35;
}

.carousel-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.4rem;
}

.carousel-dot {
  background: var(--line);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  height: 0.5rem;
  overflow: hidden;
  padding: 0;
  position: relative;
  transition: background 180ms ease, width 180ms ease;
  width: 0.5rem;
}

.carousel-dot.is-active {
  background: var(--crimson);
  width: 2.6rem;
}

/* The active dot doubles as a countdown. While the banner is rotating it drops back to a
   pale track and refills over exactly one interval, so the next move is visible before it
   happens; a bar frozen part-way is what a paused banner looks like. */
.carousel-dots.is-rotating .carousel-dot.is-active {
  background: var(--sand-deep);
}

.carousel-dots.is-rotating .carousel-dot.is-active::after {
  animation: carousel-countdown var(--carousel-delay, 6000ms) linear forwards;
  background: var(--crimson);
  border-radius: inherit;
  content: "";
  inset: 0;
  position: absolute;
  transform-origin: left center;
}

.carousel-dots.is-rotating.is-paused .carousel-dot.is-active::after {
  animation-play-state: paused;
}

@keyframes carousel-countdown {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

/* Health partners --------------------------------------------------------- */

.partner-summary {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.partner-summary-chip {
  align-items: baseline;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  gap: 0.6rem;
  padding: 1.1rem 1.2rem;
  text-align: left;
}

.partner-summary-chip:hover {
  border-color: var(--sand-deep);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  transition: 180ms ease;
}

.partner-summary-count {
  color: var(--ink);
  font-size: 1.9rem;
  font-weight: 730;
  letter-spacing: -0.05em;
}

.partner-summary-label {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.partner-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(3, 1fr);
}

.partner-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
}

.partner-card:hover {
  border-color: var(--sand-deep);
  box-shadow: 0 8px 30px rgb(78 78 78 / 7%);
}

.partner-card h3 {
  font-size: 0.98rem;
  margin: 0;
}

.partner-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.partner-card h3 a:hover {
  color: var(--crimson);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.partner-card p {
  color: var(--ink-soft);
  font-size: 0.83rem;
  margin: 0;
}

.partner-type {
  align-self: flex-start;
  background: var(--sand);
  border-radius: 999px;
  color: var(--crimson);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.6rem;
  text-transform: uppercase;
}

.partner-type-healthcare {
  background: var(--gold-tint);
  color: var(--gold-deep);
}

.partner-type-tribal,
.partner-type-federal {
  background: #ebe7e3;
  color: var(--gray);
}

.partner-centers {
  color: var(--ink-muted);
  font-size: 0.76rem;
  margin-top: auto;
  padding-top: 0.4rem;
}

.card:hover {
  border-color: var(--sand-deep);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  transition: 180ms ease;
}

.card-meta,
.record-meta,
.result-count,
.last-updated {
  color: var(--ink-muted);
  font-size: 0.77rem;
}

.card h3 {
  font-size: 1.25rem;
  margin: 0.65rem 0 0.6rem;
}

.card h3 a,
.activity-record h3 a {
  color: var(--ink);
  text-decoration: none;
}

.card h3 a:hover,
.activity-record h3 a:hover {
  color: var(--crimson);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.card p {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.card-footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
}

.card-footer button {
  background: transparent;
  border: 0;
  color: var(--crimson);
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 700;
  padding: 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.8rem;
}

.tag {
  background: var(--sand);
  border-radius: 999px;
  color: var(--crimson);
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
}

.empty-state {
  background: linear-gradient(145deg, #fff, var(--sand));
  border: 1px dashed var(--sand-deep);
  border-radius: var(--radius);
  max-width: 760px;
  padding: clamp(1.5rem, 5vw, 3.5rem);
}

.empty-state.compact {
  margin-top: 1rem;
  padding: 1.5rem;
}

.empty-index {
  color: var(--crimson-soft);
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 1.5rem;
}

.empty-state h3 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--ink-soft);
  margin-bottom: 0;
}

.filter-bar {
  align-items: end;
  background: var(--sand);
  border-radius: var(--radius);
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1.7fr 1fr 1fr;
  margin-bottom: 1rem;
  padding: 1rem;
}

label > span:not(.tag) {
  color: var(--ink-soft);
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  margin: 0 0 0.35rem 0.15rem;
}

input[type="search"],
select {
  background: var(--white);
  border: 1px solid var(--sand-deep);
  border-radius: 11px;
  color: var(--ink);
  min-height: 2.8rem;
  padding: 0.65rem 0.8rem;
  width: 100%;
}

.activity-list {
  display: grid;
  gap: 0.8rem;
}

.activity-record {
  padding: 1.35rem 1.5rem;
}

.activity-record h3 {
  font-size: 1.18rem;
  margin: 0.4rem 0;
}

.activity-record p {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin-bottom: 0;
  max-width: 860px;
}

#works-filters {
  grid-template-columns: 2fr repeat(4, 1fr);
}

.tools-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
}

.tool-card {
  min-height: 0;
}

.tool-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tool-category {
  background: var(--sand);
  border-radius: 999px;
  color: var(--crimson);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.55rem;
  text-transform: uppercase;
}

.tool-status {
  background: var(--gold-tint);
  border-radius: 999px;
  color: var(--gold-deep);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.55rem;
  text-transform: uppercase;
}

.tool-card h3 {
  font-size: 1.12rem;
}

.tool-footer {
  gap: 0.75rem;
}

.tool-repo {
  color: var(--crimson);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.tool-repo:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Caveats a reader needs before they draw a conclusion from a list, set apart from the
   list itself by the gold accent rather than by an alarm color. */
.callout {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 14px;
  margin-bottom: 1.4rem;
  padding: 1.1rem 1.3rem;
}

.callout h3 {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 0.6rem;
  text-transform: uppercase;
}

.callout ul {
  color: var(--ink-soft);
  font-size: 0.84rem;
  margin: 0;
  max-width: 860px;
  padding-left: 1.1rem;
}

.callout li + li {
  margin-top: 0.35rem;
}

.callout strong {
  color: var(--ink);
}

.works-list {
  display: grid;
  gap: 0.8rem;
}

.work-record {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgb(78 78 78 / 6%);
  padding: 1.35rem 1.5rem;
}

.work-record h3 {
  font-size: 1.15rem;
  margin: 0.45rem 0 0.5rem;
}

.work-record h3 a {
  color: var(--ink);
  text-decoration: none;
}

.work-record h3 a:hover {
  color: var(--crimson);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.work-record .record-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.work-type {
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.55rem;
  text-transform: uppercase;
}

.work-type-article {
  background: var(--sand);
  color: var(--crimson);
}

.work-type-preprint {
  background: var(--gold-tint);
  color: var(--gold-deep);
}

.work-authors {
  color: var(--ink-soft);
  font-size: 0.84rem;
  margin: 0 0 0.55rem;
}

.work-authors .network-author {
  color: var(--crimson);
}

.work-authors .muted {
  color: #8f8a86;
}

.work-abstract {
  color: var(--ink-soft);
  display: -webkit-box;
  font-size: 0.88rem;
  margin: 0;
  max-width: 900px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.work-record.is-expanded .work-abstract {
  display: block;
  overflow: visible;
}

.work-abstract.is-missing {
  color: #8f8a86;
  font-style: italic;
}

.work-toggle {
  font-size: 0.78rem;
  margin-top: 0.4rem;
}

.work-ids {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.work-ids a {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--crimson);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  text-decoration: none;
}

.work-ids a:hover {
  border-color: var(--crimson);
}

.match-reason {
  color: var(--crimson);
  font-size: 0.76rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.work-people {
  color: var(--ink-muted);
  font-size: 0.76rem;
  margin: 0.7rem 0 0;
}

.works-more {
  display: flex;
  justify-content: center;
  margin-top: 1.2rem;
}

.works-more button {
  background: var(--white);
  border: 1px solid var(--sand-deep);
  border-radius: 999px;
  color: var(--crimson);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.7rem 1.6rem;
}

.works-more button:hover {
  background: var(--sand);
}

.compact-select {
  min-width: 260px;
}

.center-hero {
  background:
    linear-gradient(120deg, rgb(255 255 255 / 96%), rgb(247 233 236 / 92%)),
    var(--white);
  padding: clamp(1.5rem, 5vw, 3rem);
}

.center-hero h3 {
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  margin: 0.4rem 0 0.8rem;
}

.center-summary {
  color: var(--ink-soft);
  font-size: 1rem;
  max-width: 840px;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.profile-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--crimson);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  text-decoration: none;
}

.profile-links a:hover {
  background: var(--sand);
}

.researcher-section {
  margin-top: 3rem;
}

.researcher-card {
  min-height: 245px;
}

.researcher-role {
  color: var(--crimson);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.expert-intro {
  max-width: 860px;
}

.expert-intro h2 {
  font-size: clamp(2.5rem, 6vw, 5.2rem);
}

.expert-intro em {
  color: var(--crimson);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.expert-form {
  margin: 2rem 0 1rem;
  max-width: 840px;
}

.search-shell {
  background: var(--white);
  border: 1px solid var(--sand-deep);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  padding: 0.4rem;
}

.search-shell input {
  border: 0;
  font-size: 1.05rem;
  min-height: 3.4rem;
}

.search-shell input:focus-visible {
  outline: 0;
}

.search-shell button {
  background: var(--crimson);
  border: 0;
  border-radius: 11px;
  color: var(--white);
  cursor: pointer;
  font-weight: 730;
  min-width: 110px;
  padding: 0.7rem 1.1rem;
}

.search-shell button:hover {
  background: var(--crimson-deep);
}

.inline-error,
.app-message {
  background: var(--crimson-tint);
  border: 1px solid #e3bcc4;
  border-radius: 12px;
  color: var(--crimson-deep);
  margin: 1rem 0;
  padding: 0.8rem 1rem;
}

/* The ask bar spans the full hero width beneath the title and the freshness badge. */
.ask-form {
  flex: 1 1 100%;
  margin-top: 1.2rem;
}

.ask-shell {
  max-width: 760px;
}

.ask-examples {
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.9rem;
  gap: 0.5rem;
  margin: 0.6rem 0 0;
}

/* A budget or rate-limit message is information, not failure, so it reads gold rather
   than crimson while keeping the same box as .inline-error. */
.inline-notice {
  background: var(--gold-tint);
  border: 1px solid var(--sand-deep);
  border-radius: 12px;
  color: var(--gold-deep);
  margin: 1rem 0;
  padding: 0.8rem 1rem;
}

.ask-answer {
  font-size: 1.06rem;
  line-height: 1.65;
  margin-top: 0.6rem;
  max-width: 70ch;
}

.ask-answer p {
  margin: 0 0 0.9rem;
}

.ask-answer[aria-busy="true"]::after {
  animation: ask-caret 1s steps(2) infinite;
  background: var(--crimson);
  content: "";
  display: inline-block;
  height: 1.05em;
  margin-left: 0.15rem;
  vertical-align: text-bottom;
  width: 2px;
}

@keyframes ask-caret {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

.ask-cite a,
.ask-cite {
  color: var(--crimson);
  font-weight: 700;
  padding-left: 0.1rem;
  text-decoration: none;
}

.ask-cite a:hover {
  text-decoration: underline;
}

.ask-citations {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.6rem;
}

.ask-citations-heading {
  font-size: 1rem;
  margin: 0;
}

.ask-citation h4 {
  font-size: 1rem;
  margin: 0 0 0.3rem;
}

.expert-group {
  margin-top: 1rem;
  padding: 1.4rem;
}

.expert-group > h3 {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.count-pill {
  background: var(--sand);
  border-radius: 999px;
  color: var(--crimson);
  font-size: 0.72rem;
  padding: 0.3rem 0.65rem;
}

.table-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 800px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #ece7e3;
  padding: 0.9rem 1rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink-muted);
  font-size: 0.69rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

td {
  font-size: 0.82rem;
}

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

.status-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.28rem 0.6rem;
  text-transform: uppercase;
}

/* Status uses the configured accent for a successful pull and the configured primary
   color for attention without adding a second, competing status palette. */
.status-ok {
  background: var(--gold-tint);
  color: var(--gold-deep);
}

.status-skipped {
  background: var(--sand);
  color: var(--gray);
}

.status-blocked,
.status-error {
  background: var(--crimson-tint);
  color: var(--crimson-deep);
}

.site-footer {
  background: var(--gray);
  border-top: 5px solid var(--crimson);
  color: #eae7e4;
}

.footer-inner {
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 2.6rem 1.5rem 2.8rem;
}

.footer-top {
  align-items: end;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
}

.site-footer p,
.footer-meta {
  color: #d6d1cd;
  font-size: 0.77rem;
  margin-bottom: 0;
}

.site-footer p {
  max-width: 540px;
}

.site-footer a {
  color: var(--gold);
}

.footer-meta {
  align-items: end;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-data-links {
  display: flex;
  gap: 0.75rem;
}

.site-footer .footer-colophon {
  border-top: 1px solid rgb(255 255 255 / 15%);
  margin-top: 2rem;
  max-width: none;
  padding-top: 1.2rem;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.9rem;
  }

  .header-actions {
    max-width: 100%;
  }

  nav {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 0.3rem;
  }

  .nav-link {
    white-space: nowrap;
  }

  .latest-grid,
  .researcher-grid,
  .tools-grid,
  .partner-grid {
    grid-template-columns: 1fr 1fr;
  }

  .carousel-track {
    grid-auto-columns: calc((100% - 1rem) / 2);
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .metric:nth-child(odd) {
    border-left: 0;
  }

  #works-filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 650px) {
  .header-inner,
  main,
  .footer-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .header-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .hero {
    padding: 1.4rem;
  }

  h1 {
    font-size: clamp(1.7rem, 7vw, 2.2rem);
  }

  .metrics,
  .latest-grid,
  .center-grid,
  .researcher-grid,
  .tools-grid,
  .partner-grid,
  .filter-bar,
  #works-filters {
    grid-template-columns: 1fr;
  }

  .carousel-track {
    grid-auto-columns: 100%;
  }

  .metrics {
    margin-bottom: 4rem;
  }

  .metric,
  .metric:nth-child(odd) {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 0.8rem;
  }

  .metric:first-child {
    border-top: 0;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 0.7rem;
  }

  .compact-select {
    min-width: 0;
    width: 100%;
  }

  .search-shell {
    align-items: stretch;
    flex-direction: column;
  }

  .search-shell button {
    min-height: 2.8rem;
  }

  .footer-top {
    align-items: start;
    flex-direction: column;
    gap: 1.5rem;
  }

  .footer-meta {
    align-items: start;
  }
}

/* Collaboration network. The graph canvas is drawn by the vendored Cytoscape build; the
   chrome around it is plain markup so identity never depends on reading a colour. */
#network-filters {
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
}

#np-filters {
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1.3fr;
}

.network-shell {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) 20rem;
  margin-bottom: 1.5rem;
}

.network-stage {
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--crimson) 5%, transparent), transparent 55%),
    var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 34rem;
  overflow: hidden;
  position: relative;
}

.network-graph {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

.network-tooltip {
  background: var(--ink);
  border-radius: 12px;
  color: var(--white);
  display: grid;
  font-size: 0.78rem;
  gap: 0.1rem;
  left: 0;
  max-width: 17rem;
  padding: 0.55rem 0.7rem;
  pointer-events: none;
  position: absolute;
  top: 0;
  z-index: 5;
}

.network-tooltip strong {
  font-size: 0.85rem;
}

.network-tooltip span {
  color: color-mix(in srgb, var(--white) 78%, transparent);
}

.network-reset {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  position: absolute;
  right: 0.9rem;
  top: 0.9rem;
  z-index: 4;
}

.network-reset:hover {
  border-color: var(--crimson);
  color: var(--crimson);
}

.network-side {
  display: grid;
  gap: 1rem;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}

.network-legend,
.network-detail {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.network-legend-title,
.network-detail h4 {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 0.6rem;
  text-transform: uppercase;
}

.network-chip {
  align-items: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-size: 0.82rem;
  gap: 0.55rem;
  padding: 0.3rem 0.45rem;
  text-align: left;
  width: 100%;
}

.network-chip:hover {
  background: var(--sand);
}

.network-chip[aria-pressed="true"] {
  background: var(--sand);
  border-color: var(--crimson);
  font-weight: 700;
}

.network-chip-name {
  flex: 1;
  min-width: 0;
}

.network-chip-count {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.network-swatch {
  border: 2px solid;
  border-radius: 50%;
  display: inline-block;
  flex: none;
  height: 0.95rem;
  width: 0.95rem;
}

.network-swatch.small {
  height: 0.7rem;
  width: 0.7rem;
}

.network-legend-note {
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.5;
  margin: 0.7rem 0 0;
  padding-top: 0.7rem;
}

.network-detail {
  overflow-y: auto;
}

.network-detail-empty {
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.6;
  margin: 0;
}

.network-detail-head {
  align-items: center;
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.network-detail-head div {
  display: grid;
}

.network-detail-head span {
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.network-detail-stats {
  color: var(--ink-soft);
  font-size: 0.78rem;
  margin: 0 0 0.5rem;
}

.network-partners {
  display: grid;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  max-height: 22rem;
  overflow-y: auto;
  padding: 0;
}

.network-partner {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-size: 0.81rem;
  gap: 0.5rem;
  padding: 0.3rem 0.35rem;
  text-align: left;
  width: 100%;
}

.network-partner:hover {
  background: var(--sand);
}

.network-partner-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.network-partner-weight {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.network-notes {
  background: var(--sand);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  padding: 0.9rem 1.1rem;
}

.network-notes summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
}

.network-notes p {
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.65;
  margin: 0.7rem 0 0;
}

.network-table-heading {
  margin: 0 0 0.2rem;
}

.network-table-note {
  color: var(--ink-soft);
  font-size: 0.8rem;
  margin: 0 0 0.75rem;
}

/* Networks +: fellows and residents are diamonds so they never rely on colour alone. */
.network-swatch.diamond {
  border-radius: 0.1rem;
  transform: rotate(45deg) scale(0.82);
}

.np-method h4 {
  font-size: 0.85rem;
  margin: 1rem 0 0.35rem;
}

.np-method table {
  font-size: 0.85rem;
}

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

.np-stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
}

.np-stat strong {
  display: block;
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
}

.np-stat span {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

@media (max-width: 1080px) {
  .network-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  #network-filters,
  #np-filters {
    grid-template-columns: 1fr 1fr;
  }

  .network-stage {
    min-height: 26rem;
  }
}
