:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #fbfcfe;
  --text: #17212b;
  --muted: #52606d;
  --line: #d9e0e8;
  --brand: #00274c;
  --brand-2: #006f78;
  --brand-soft: #eaf2f8;
  --maize: #ffcb05;
  --maize-soft: #fff4c1;
  --accent: #00545b;
  --focus: #007680;
  --control-border: #7b8d9f;
  --danger: #992f2f;
  --warn: #7d6200;
  --success: #27623a;
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-condensed: var(--font-sans);
  --page-shell-width: 78rem;
  --data-shell-width: 112.5rem;
  --reading-width: 46rem;
  --page-shell-gutter: 2.5rem;
  --shadow: none;
  --radius: 12px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

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

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

a:hover {
  text-decoration: underline;
}

a:focus-visible,
summary:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 200;
  padding: 0.6rem 0.9rem;
  background: var(--brand);
  color: white;
  border-radius: 0 0 10px 10px;
}

.skip-link:focus {
  top: 0;
}

.container {
  width: min(var(--page-shell-width), calc(100% - var(--page-shell-gutter)));
  margin: 0 auto;
}

/* Keep scientific workspaces wide without stretching narrative pages or branding. */
.page-data main > .container,
.page-detail main > .container {
  width: min(var(--data-shell-width), calc(100% - var(--page-shell-gutter)));
}

.um-banner-logo {
  display: block;
  width: 13.4rem;
  max-height: none;
  height: auto;
  flex: 0 0 auto;
}

.um-banner-logo-frame {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  line-height: 0;
}

.site-header {
  background: var(--surface);
  border-top: 5px solid var(--maize);
  border-bottom: 1px solid var(--line);
}

.masthead {
  min-height: 5.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.masthead-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.portal-identity {
  max-width: 12rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.portal-identity h1 {
  margin: 0;
  color: var(--brand);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.portal-identity h1 a {
  color: inherit;
  text-decoration: none;
}

.portal-identity p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.portal-nav-toggle {
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--surface);
  color: var(--brand);
}

.release-strip {
  border-top: 1px solid var(--line);
  background: #f4f7fa;
}

.release-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.15rem 1.5rem;
  padding-block: 0.3rem;
  font-size: 0.78rem;
}

.release-date {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
}

.release-badge-label {
  color: var(--muted);
}

.release-panel-title {
  color: var(--brand);
  font-weight: 600;
}

.release-panel-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.release-panel-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding-block: 0.15rem;
}

a.release-panel-stat {
  color: inherit;
  text-decoration: none;
}

a.release-panel-stat:hover,
a.release-panel-stat:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.release-panel-stat-label {
  color: var(--muted);
}

.release-panel-stat-value {
  color: var(--brand);
  font-weight: 700;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 1rem;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-block: 0.7rem;
  border-bottom: 2px solid transparent;
  color: var(--brand);
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
}

.nav a.active,
.nav a:hover {
  border-bottom-color: var(--brand-2);
  color: var(--accent);
  text-decoration: none;
}

.notice {
  background: var(--maize-soft);
  border: 1px solid #eddc8e;
  color: #5a4a00;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin: 0.25rem 0 0.9rem;
}

.notice.notice-compact {
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
  margin-top: 0.15rem;
}

main {
  min-height: 60vh;
  padding: 2.5rem 0 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.2rem;
}

.card + .card {
  margin-top: 1rem;
}

/* Keep stacked-card spacing out of grid rows so sibling cards share the same top edge. */
.hero > .card + .card,
.link-grid > .card + .card,
.download-grid > .card + .card,
.summary-grid > .card + .card,
.legend-grid > .card + .card,
.plot-workspace > .card + .card,
.plot-reference-grid > .card + .card {
  margin-top: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(320px, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.hero.hero-single {
  grid-template-columns: minmax(0, 1fr);
}

.hero.hero-single > .card {
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.page-header.card {
  margin-bottom: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.hero h2,
.page-header h2 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  color: var(--brand);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 750;
  line-height: 1.15;
}

.page-header p {
  max-width: var(--reading-width);
}

.page-header-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
  gap: 2rem;
  align-items: start;
}

.page-header-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page-header-pane {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-width: 0;
}

.page-header-pane > * {
  margin-top: 0;
  margin-bottom: 0;
}

.page-header-copy > :first-child,
.page-header-side > :first-child {
  margin-top: 0;
}

.page-header-copy > :last-child,
.page-header-side > :last-child {
  margin-bottom: 0;
}

.page-header-side {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: flex-start;
  padding-left: 1.5rem;
  border-left: 1px solid var(--line);
}

.page-header-side h3 {
  margin: 0;
  color: var(--brand);
  font-size: 1.05rem;
}

.page-header-side p {
  margin: 0;
}

.page-header-side .button-row {
  display: grid;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

.page-header-side .button-row .button,
.page-header-side .button-row button {
  width: 100%;
}

.page-content-card.card {
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.page-content-heading {
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.page-content-heading h2 {
  margin: 0;
  color: var(--brand);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.15;
}

.page-content-body > :first-child {
  margin-top: 0;
}

.page-content-body > :last-child {
  margin-bottom: 0;
}

.kpi-grid,
.link-grid,
.summary-grid,
.legend-grid,
.method-grid {
  display: grid;
  gap: 1rem;
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.link-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.download-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.85fr);
  gap: 1rem;
  align-items: stretch;
  margin-top: 1rem;
}

.summary-grid,
.legend-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.method-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.hero > .card,
.link-grid > .card,
.download-grid > .card,
.method-grid > .info-block,
.plot-card,
.plot-compare,
.plot-reference {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.hero > .card > :first-child,
.link-grid > .card > :first-child,
.download-grid > .card > :first-child,
.method-grid > .info-block > :first-child,
.plot-card > :first-child,
.plot-compare > :first-child,
.plot-reference > :first-child {
  margin-top: 0;
}

.hero > .card > :last-child,
.link-grid > .card > :last-child,
.download-grid > .card > :last-child,
.method-grid > .info-block > :last-child,
.plot-card > :last-child,
.plot-compare > :last-child,
.plot-reference > :last-child {
  margin-bottom: 0;
}

.hero > .card .button-row:last-child,
.link-grid > .card > .button:last-child {
  margin-top: auto;
  padding-top: 1rem;
}

.download-grid > .card > .key-points,
.download-grid > .card > .list-clean {
  margin-top: 0.75rem;
  padding-left: 1.1rem;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.kpi .label,
.stat .label,
.info-block h3,
.plot-legend h3,
.section-label {
  color: var(--muted);
  font-size: 0.88rem;
}

.kpi .value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--brand);
  line-height: 1.05;
}

.kpi .value a {
  color: inherit;
  text-decoration: none;
}

.kpi .value a:hover,
.kpi .value a:focus-visible {
  text-decoration: underline;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 1rem;
}

.button,
button,
select,
input[type="text"],
input[type="search"],
textarea {
  font: inherit;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: white;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-condensed);
  font-weight: 600;
}

.button.secondary,
button.secondary {
  background: white;
  color: var(--brand);
}

.button.tertiary,
button.tertiary {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: #b8cee4;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.filters-shell {
  display: grid;
  gap: 1rem;
}

.filters.filters-primary {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  margin-bottom: 0;
}

.filters.filters-primary > div {
  min-width: 0;
}

.filters-primary .filter-search,
.filters-primary .filter-trait,
.filters-primary .filter-top {
  grid-column: span 2;
}

.filters-primary .filter-search-column,
.filters-primary .filter-trait-type,
.filters-primary .filter-cohort,
.filters-primary .filter-method {
  grid-column: span 1;
}

.filters > div > label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.filters input:not([type="checkbox"]):not([type="radio"]),
.filters select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.58rem 0.7rem;
  border: 1px solid var(--control-border);
  border-radius: 10px;
  background: white;
}

.autocomplete-shell {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 40;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  max-height: min(18rem, 40vh);
  overflow-y: auto;
}

.autocomplete-item {
  display: grid;
  gap: 0.1rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  cursor: pointer;
}

.autocomplete-item.active,
.autocomplete-item:hover {
  background: var(--brand-soft);
}

.autocomplete-primary {
  font-weight: 600;
  color: var(--text);
}

.autocomplete-meta {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.checkbox-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0;
  font-weight: 600;
}

.checkbox-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  min-height: 1rem;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--brand);
}

.filters-group {
  align-self: end;
}

.filters-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.filters-toolbar .filters-group {
  align-self: auto;
  flex: 1 1 24rem;
}

.filters-actions {
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: flex-start;
  gap: 0.55rem;
}

.filters-actions .button-row {
  margin-top: 0;
}

.filters-toolbar .filters-actions {
  flex: 1 1 22rem;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  font-size: 0.8rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f3f6f9;
  color: var(--text);
}

.badge.warn {
  background: #fff6d8;
  border-color: #efdc8d;
  color: var(--warn);
}

.badge.danger {
  background: #fde8e8;
  border-color: #efb0b0;
  color: var(--danger);
}

.badge.success {
  background: #e8f6ea;
  border-color: #b7debf;
  color: var(--success);
}

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

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

.table-wrap-scroll {
  max-height: min(72vh, 48rem);
  overflow: auto;
}

.table-wrap.compact table {
  min-width: 720px;
}

.scores-table-shell {
  display: grid;
  gap: 0.75rem;
}

.scores-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.scores-pagination label {
  font-weight: 700;
}

.scores-pagination select {
  width: auto;
  min-width: 5.5rem;
}

.scores-loading-row td {
  padding: 1rem;
  color: var(--muted);
}

.scores-table th,
.scores-table td {
  vertical-align: top;
}

.scores-col-code {
  width: 7.5rem;
}

.scores-col-trait {
  min-width: 15rem;
}

.scores-col-cohort,
.scores-col-method {
  width: 5.5rem;
}

.scores-col-source {
  width: 9rem;
}

.scores-col-metric {
  width: 6rem;
}

.scores-col-flags {
  width: 9.5rem;
}

.scores-col-links {
  width: 11.5rem;
}

.scores-link-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  align-content: flex-start;
}

.scores-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.85rem;
  padding: 0.18rem 0.55rem;
  border: 1px solid #d4dee8;
  border-radius: 999px;
  background: #f6fbff;
  color: var(--accent);
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
}

.scores-link:hover {
  background: #eef5fb;
}

.overview-col-code {
  width: 12rem;
}

.overview-col-trait {
  width: 22rem;
}

.overview-code-head,
.overview-code-cell {
  width: 12rem;
}

.overview-group-meta {
  display: block;
  margin-top: 0.2rem;
}

.overview-trait-head,
.overview-trait-cell {
  width: 22rem;
}

.overview-trait-main,
.overview-trait-subline {
  display: block;
}

.overview-trait-main {
  font-weight: 600;
  line-height: 1.35;
}

.overview-trait-subline {
  margin-top: 0.2rem;
  max-width: 24rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.overview-variants {
  margin-top: 0.45rem;
}

.overview-variants summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  list-style: none;
}

.overview-variants summary::-webkit-details-marker {
  display: none;
}

.overview-variants summary::before {
  content: "+";
  color: var(--brand-2);
  font-weight: 700;
}

.overview-variants[open] summary::before {
  content: "-";
}

.overview-variant-list {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.4rem;
}

.overview-variant-item {
  display: grid;
  gap: 0.12rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.overview-variant-code {
  width: fit-content;
}

.overview-variant-subline,
.overview-variant-source {
  display: block;
  line-height: 1.4;
}

.trait-note {
  margin-top: 0.35rem;
}

.page-help {
  margin-top: 0.8rem;
}

.trait-note summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  list-style: none;
}

.trait-note summary::-webkit-details-marker {
  display: none;
}

.trait-note summary::before {
  content: "+";
  color: var(--brand-2);
  font-weight: 700;
}

.trait-note[open] summary::before {
  content: "-";
}

.trait-note-body {
  margin-top: 0.45rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  max-width: 44rem;
}

.page-help-body {
  display: grid;
  gap: 0.55rem;
  max-width: 56rem;
}

.page-help-body p {
  margin: 0;
}

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

th,
td {
  padding: 0.72rem 0.78rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead th {
  position: sticky;
  top: 0;
  background: #eef4f9;
  color: var(--brand);
  z-index: 2;
  box-shadow: inset 0 -1px 0 var(--line);
}

.table-sort {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  text-align: left;
  border-radius: 0;
}

.table-sort:hover {
  background: transparent;
  color: var(--accent);
}

.table-sort[data-active="true"] {
  color: var(--accent);
}

.table-sort-indicator {
  flex: 0 0 auto;
  font-size: 0.8rem;
  color: var(--muted);
}

tbody tr:nth-child(even) {
  background: #fbfcfe;
}

tbody tr:hover {
  background: #f2f8fd;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.stat,
.info-block,
.plot-legend,
.callout {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  background: white;
}

.stat .value {
  display: block;
  color: var(--brand);
  font-weight: 700;
  margin-top: 0.2rem;
  overflow-wrap: anywhere;
}

.detail-primary-action {
  margin-top: 1rem;
}

.detail-secondary-links {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.detail-secondary-links .section-label {
  display: block;
  margin-bottom: 0.5rem;
}

.detail-link-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.4rem 1rem;
  padding-left: 1rem;
}

.detail-link-list > li + li {
  margin-top: 0;
}

.score-summary-table {
  min-width: 0;
  table-layout: fixed;
}

.score-summary-table th,
.score-summary-table td {
  overflow-wrap: anywhere;
}

.score-summary-table th:first-child,
.score-summary-table td:first-child {
  width: 8rem;
}

.risk-strata-control-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem 1rem;
  align-items: end;
  margin-top: 0.95rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--line);
}

.risk-strata-control-meta {
  display: grid;
  gap: 0.3rem;
  align-content: start;
}

.risk-strata-control-meta .section-label,
.risk-strata-control-meta p {
  margin: 0;
}

.risk-strata-control-bar .phewas-view-switch {
  grid-column: auto;
  justify-self: end;
}

.risk-strata-view-panel {
  margin-top: 0.95rem;
}

.risk-strata-figure-panel {
  display: grid;
  gap: 0.75rem;
}

.risk-strata-plot-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: space-between;
}

.risk-strata-plot-shell {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.risk-strata-plot-scroll {
  overflow-x: hidden;
  padding: 0.6rem;
}

#risk-strata-plot-root {
  min-height: 28rem;
}

#risk-strata-plot-root svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.risk-strata-plot-empty {
  padding: 1rem;
  color: var(--muted);
}

.info-block h3,
.plot-legend h3 {
  margin: 0 0 0.45rem;
  color: var(--brand);
  font-size: 1rem;
}

.list-clean {
  margin: 0;
  padding-left: 1rem;
}

.list-clean > li + li {
  margin-top: 0.4rem;
}

.site-footer {
  --focus: var(--maize);
  border-top: 6px solid var(--maize);
  background: #001a33;
  padding: 2rem 0;
  color: #c8d5df;
}

.footer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
}

.footer-brand {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 750;
}

.footer-affiliation {
  margin-bottom: 0.6rem;
  font-size: 0.82rem;
}

.footer-org-line {
  max-width: var(--reading-width);
  margin-bottom: 0;
  font-size: 0.78rem;
}

.site-footer a {
  color: #fff;
  text-decoration: underline;
}

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

.site-footer h2 {
  margin: 0 0 0.7rem;
  color: var(--maize);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer-contact {
  font-size: 0.86rem;
}

.footer-contact p {
  margin: 0.6rem 0 0;
}

.page-meta {
  display: flex;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  color: var(--muted);
}

.empty-state {
  padding: 1rem;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.small {
  font-size: 0.92rem;
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95em;
}

.legacy-status {
  background: white;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

hr.soft {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1rem 0;
}

.reading-width {
  max-width: var(--reading-width);
}

.download-exports-card {
  margin-top: 1rem;
}

.download-details > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--brand);
}

.download-details[open] > summary {
  margin-bottom: 0.85rem;
}

.key-points {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
}

.key-points > li + li {
  margin-top: 0.35rem;
}

.phewas-view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0;
  padding: 0.45rem;
  width: min(100%, 24rem);
  border: 1px solid #bfd0e3;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbfe 0%, #eef4f9 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.phewas-control-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.75rem 1rem;
  align-items: end;
  margin-top: 0.95rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--line);
}

.phewas-control-meta,
.phewas-view-switch {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  max-width: 100%;
}

.phewas-control-meta {
  align-content: start;
}

.phewas-control-meta #phewas-count {
  margin: 0;
}

.phewas-view-switch {
  grid-column: 2;
  justify-self: center;
  justify-items: center;
  text-align: center;
}

.phewas-view-tab {
  border: 1px solid #cfdae6;
  border-radius: 12px;
  background: white;
  color: var(--brand);
  font: inherit;
  font-family: var(--font-condensed);
  font-weight: 700;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.phewas-view-tab:hover {
  background: #f4f8fc;
  border-color: #bccfe1;
}

.phewas-view-tab[aria-selected="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
  box-shadow: 0 10px 22px rgba(12, 61, 117, 0.16);
}

.phewas-view-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.phewas-view-panel {
  margin-top: 1rem;
}

.plot-section {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.plot-start {
  display: grid;
  gap: 1rem;
  border-color: #d7e2ec;
  background: linear-gradient(135deg, #fffef7 0%, #f7fbff 100%);
}

.plot-card-intro {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 0;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--line);
}

.plot-card-intro .phewas-view-switch {
  justify-items: center;
  text-align: center;
}

.plot-card-intro .phewas-view-tabs {
  justify-self: center;
}

.plot-start-header h3 {
  margin: 0 0 0.35rem;
  color: var(--brand);
}

.plot-start-kicker {
  margin: 0 0 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
}

.plot-start-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.plot-start-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.plot-start-step-number {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-weight: 700;
}

.plot-start-steps li div {
  display: grid;
  gap: 0.2rem;
}

.plot-start-steps li strong {
  color: var(--ink);
}

.plot-start-steps li div span {
  color: var(--muted);
}

.phewas-model-strip {
  display: grid;
  gap: 0.35rem;
  margin: 0.75rem 0 0.9rem;
}

.phewas-model-strip .badges {
  margin: 0;
}

.plot-stack {
  display: grid;
  gap: 1rem;
  align-items: stretch;
}

.plot-compare {
  position: static;
  border-color: #c9d7e5;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f8fc 100%);
}

.plot-card,
.plot-compare {
  gap: 0.85rem;
}

.plot-card h3 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  color: var(--brand);
}

.plot-compare h3 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  color: var(--brand);
}

.exclusion-definition-card {
  border: 1px solid #d5e1ec;
  border-radius: 12px;
  background: #f6faff;
  padding: 0.8rem 0.9rem;
  margin-top: 1rem;
}

.exclusion-definition-card p:last-child {
  margin-bottom: 0;
}

.plot-compare h4 {
  margin: 0;
  color: var(--brand);
}

.plot-compare-header {
  display: grid;
  gap: 0.3rem;
}

.plot-compare-gated {
  border: 1px dashed #c9d7e5;
  border-radius: 12px;
  background: #fbfcfe;
  padding: 0.8rem 0.9rem;
}

.plot-compare-gated p:last-child {
  margin-bottom: 0;
}

.plot-compare-link-wrap {
  margin: 0;
}

.plot-compare-forest-shell {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 0.35rem 0.5rem 0.35rem;
  overflow-x: auto;
}

.plot-compare-forest-shell svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 720px;
}

.plot-compare-forest-note {
  fill: #52616f;
  font-size: 12px;
}

.plot-reference-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.plot-reference h3,
.plot-reference h4 {
  margin-top: 0;
}

.plot-reference h3 {
  margin-bottom: 0.35rem;
  color: var(--brand);
}

.plot-reference h4 {
  margin: 0 0 0.45rem;
  color: var(--ink);
  font-size: 1rem;
}

.plot-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.plot-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.plot-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}

.plot-chip input {
  margin: 0;
}

.phewas-plot-shell {
  flex-shrink: 0;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  overflow: hidden;
}

.phewas-plot-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.75rem;
}

#phewas-plot-root {
  min-width: 100%;
  width: fit-content;
  margin: 0 auto;
}

.phewas-plot-empty {
  padding: 1rem;
  color: var(--muted);
}

.phewas-plot-scroll svg {
  display: block;
  width: auto;
  max-width: none;
  height: auto;
}

.phewas-tooltip {
  position: absolute;
  z-index: 20;
  max-width: 320px;
  pointer-events: none;
  background: rgba(19, 32, 43, 0.96);
  color: white;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  font-size: 0.88rem;
  line-height: 1.35;
}

.phewas-tooltip.pinned {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.phewas-tooltip a {
  color: #fff3a8;
  text-decoration: underline;
}

.phewas-tooltip strong {
  display: block;
  margin-bottom: 0.3rem;
}

.legend-swatch {
  width: 1rem;
  height: 1rem;
  display: inline-block;
  margin-top: 0.15rem;
  border-radius: 3px;
}

.category-key {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.category-key-item {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.88rem;
}

.phewas-description-head,
.phewas-description-cell {
  width: 18rem;
  max-width: 18rem;
  vertical-align: top;
}

.phewas-description-toggle {
  display: block;
}

.phewas-description-toggle summary {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
  cursor: pointer;
  list-style: none;
}

.phewas-description-toggle summary::-webkit-details-marker {
  display: none;
}

.phewas-description-preview {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phewas-description-expander {
  flex: 0 0 auto;
  color: var(--brand);
  font-weight: 700;
}

.phewas-description-full {
  margin-top: 0.4rem;
  overflow-wrap: anywhere;
}

.phewas-description-toggle[open] .phewas-description-expander {
  color: var(--accent);
}

.method-block h3 {
  margin: 0 0 0.6rem;
  color: var(--brand);
  font-size: 1.1rem;
}

.method-block {
  padding: 1.5rem 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.method-block p,
.method-block ul {
  margin-top: 0;
}

.method-block p + p,
.method-block p + ul,
.method-block ul + p {
  margin-top: 0.85rem;
}

.method-page {
  display: grid;
  gap: 1.15rem;
  max-width: var(--reading-width);
}

.method-page p,
.method-page li {
  line-height: 1.65;
}

.method-intro {
  display: grid;
  gap: 0.95rem;
  font-size: 1.01rem;
}

.method-intro p {
  margin: 0;
}

.method-callouts {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(16rem, 0.95fr);
  gap: 1rem;
  align-items: start;
}

.method-summary {
  background: var(--surface);
}

.method-summary .key-points {
  margin-top: 0.6rem;
}

.method-toc {
  background: var(--surface);
}

.method-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.method-toc-list li + li {
  border-top: 1px solid var(--line);
}

.method-toc-list a {
  display: block;
  padding: 0.5rem 0;
  font-weight: 600;
  color: var(--brand);
}

.method-toc-list a:hover {
  color: var(--accent);
  text-decoration: none;
}

.method-toc-list li:first-child a {
  padding-top: 0;
}

.method-toc-list li:last-child a {
  padding-bottom: 0;
}

.method-page section[id] {
  scroll-margin-top: 1.25rem;
}

.method-sources {
  margin-top: 0;
}

@media (max-width: 1100px) {
  .masthead {
    flex-wrap: wrap;
    padding-block: 0.75rem;
    gap: 0.5rem 1rem;
  }

  .masthead .nav {
    flex: 0 0 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.5rem;
    padding-top: 0.5rem;
  }

  .masthead .nav a {
    border-bottom: 1px solid var(--line);
  }

  .masthead .nav a.active {
    border-bottom-color: var(--brand-2);
  }

  .page-header-side {
    padding: 1rem 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .hero,
  .page-header-layout,
  .plot-stack,
  .plot-reference-grid,
  .method-grid,
  .phewas-control-bar,
  .risk-strata-control-bar {
    grid-template-columns: 1fr;
  }

  .plot-start-steps {
    grid-template-columns: 1fr;
  }

  .download-grid,
  .filters.filters-primary {
    grid-template-columns: 1fr;
  }

  .method-callouts {
    grid-template-columns: 1fr;
  }

  .phewas-view-switch {
    grid-column: 1;
  }

  .risk-strata-control-bar .phewas-view-switch {
    justify-self: start;
  }

  .filters-primary .filter-search,
  .filters-primary .filter-trait,
  .filters-primary .filter-top,
  .filters-primary .filter-search-column,
  .filters-primary .filter-trait-type,
  .filters-primary .filter-cohort,
  .filters-primary .filter-method {
    grid-column: auto;
  }

  .plot-compare {
    position: static;
  }
}

@media (max-width: 840px) {
  :root {
    --page-shell-gutter: 1.5rem;
  }

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

  .filters-toolbar .filters-actions {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
  }

  table {
    min-width: 760px;
  }

}

/* Shared prose stays readable while tables retain their own horizontal viewport. */
h2, h3, h4 {
  color: var(--brand);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.page-home .hero p,
.page-home .hero ul,
.page-home .hero ol {
  max-width: var(--reading-width);
}

.page-header-copy a:not(.button),
.page-header > p a:not(.button),
.reading-width a:not(.button),
.page-home .hero a:not(.button),
.footer-org-line a {
  text-decoration: underline;
}

::selection {
  color: var(--brand);
  background: var(--maize);
}

@media (max-width: 720px) {
  .masthead-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .masthead .um-banner-logo {
    width: 9.75rem;
  }

  .portal-identity {
    max-width: none;
    padding: 0;
    border: 0;
  }

  .portal-identity h1 {
    font-size: 0.93rem;
  }

  .portal-identity p {
    display: none;
  }

  .release-panel {
    justify-content: flex-start;
    padding-block: 0.4rem;
  }

  .release-panel-stats {
    gap: 1.25rem;
  }

  .footer-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
