
:root {
  --font: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Trebuchet MS", "Avenir Next", "Segoe UI", "PingFang SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --shadow2: 0 6px 18px rgba(0,0,0,.10);
  --container: 1180px;
  --tone-1: #2f988b;
  --tone-2: #5d7fda;
  --tone-3: #c87432;
  --tone-4: #9071cf;
  --tone-5: #57a85d;
  --tone-6: #bf6f8a;
  --tone-7: #7a8592;
  --tone-8: #329bc2;
  --tone-9: #9f8d30;
  --tone-10: #9f5bb6;
  --tone-11: #2f8386;
  --tone-12: #c96557;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--fg);
  background: var(--bg);
  background-image:
    radial-gradient(circle at top left, color-mix(in oklab, var(--accent) 12%, transparent) 0, transparent 28%),
    radial-gradient(circle at right 10% top 12%, color-mix(in oklab, var(--chip) 75%, white 25%) 0, transparent 22%);
  line-height: 1.55;
}

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

.container { width: min(var(--container), calc(100% - 40px)); margin: 0 auto; }

.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 92%, black 8%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  padding: 10px 0;
}
.brand {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
  max-width: max-content;
  overflow: visible;
  z-index: 2;
}
.brand:hover { text-decoration: none; }
.brand-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  padding: 4px 7px 4px 4px;
  border: 1px solid color-mix(in oklab, var(--border) 86%, transparent);
  border-radius: 8px;
  background: color-mix(in oklab, var(--panel) 80%, transparent);
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 0;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 55%, white 45%));
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .8px;
  box-shadow: var(--shadow2);
}
.brand-logo {
  height: 46px;
  max-width: 46px;
  width: auto;
  border-radius: 0;
  object-fit: contain;
  flex: 0 0 auto;
}
.brand-text {
  display: grid;
  gap: 1px;
  min-width: 0;
  width: max-content;
  max-width: none;
  overflow: visible;
}
.brand-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  line-height: 1.05;
  letter-spacing: .2px;
  overflow: visible;
  white-space: nowrap;
}
.brand-sub {
  display: grid;
  gap: 0;
  max-width: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: 0;
  overflow: visible;
  white-space: nowrap;
}
.brand-sub-line {
  display: block;
}

.nav {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  min-width: 0;
}
.nav a,
.nav-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 650;
  font-size: 14px;
  padding: 8px 8px;
  border-radius: 10px;
  white-space: nowrap;
  line-height: 1.1;
  flex: 0 0 auto;
}
.nav a:hover,
.nav-menu-trigger:hover { background: var(--chip); text-decoration: none; }
.nav a.is-active,
.nav-menu-trigger.is-active {
  background: color-mix(in oklab, var(--accent) 14%, white 86%);
  color: color-mix(in oklab, var(--accent) 78%, black 22%);
}
.nav-menu {
  position: relative;
  flex: 0 0 auto;
}
.nav-menu-trigger::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: .72;
}
.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 80;
  display: grid;
  width: 168px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}
.nav-dropdown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}
.nav-menu:hover .nav-dropdown,
.nav-menu:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown a {
  display: block;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.1;
  white-space: nowrap;
}
.nav-dropdown a:hover {
  background: var(--chip);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  z-index: 2;
}
.search { position: relative; min-width: 0; }
.search input {
  width: clamp(130px, 14vw, 200px); max-width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--fg);
  outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 20%, transparent); }

.search-dropdown {
  position: absolute; top: 44px; right: 0;
  width: min(520px, 70vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow2);
  overflow: hidden;
}
.search-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--chip); }
.search-type { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.search-label { font-weight: 650; }

.nav-toggle { display: none; border: 1px solid var(--border); background: var(--panel); color: var(--fg); border-radius: 12px; padding: 8px 10px; }
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .3px;
  white-space: nowrap;
  line-height: 1;
  min-width: 42px;
  flex: 0 0 auto;
}
.lang-switch a:hover { text-decoration: none; background: var(--chip); }
.lang-switch a.is-active {
  background: color-mix(in oklab, var(--accent) 15%, white 85%);
  color: color-mix(in oklab, var(--accent) 78%, black 22%);
}

@media (max-width: 1120px) {
  .header-inner { gap: 10px; }
  .brand-logo { height: 42px; max-width: 42px; }
  .brand-title { font-size: 14px; }
  .brand-sub { font-size: 9.5px; }
  .nav { gap: 5px; }
  .nav a,
  .nav-menu-trigger { padding: 8px 6px; font-size: 13px; }
  .search input { width: 120px; }
}

main.container { padding: 22px 0 30px; }

.hero {
  border-radius: 22px;
  overflow: hidden;
  min-height: 260px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero-overlay { background: linear-gradient(120deg, rgba(6,22,13,.72), rgba(7,34,19,.24)); height: 100%; }
.hero-content { padding: 34px; color: #fff; max-width: 100%; }
.hero-fullname {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0;
  max-width: min(760px, 100%);
  overflow-wrap: anywhere;
}
.hero-content h1 {
  margin: 0 0 10px;
  font-size: 29px;
  line-height: 1.08;
  letter-spacing: 0;
  font-family: var(--font-display);
  white-space: nowrap !important;
  word-break: keep-all;
  overflow-wrap: normal;
  display: inline-block;
  width: max-content;
  max-width: none;
}
.hero-content p { margin: 0 0 16px; line-height: 1.5; opacity: .92; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-note { margin-top: 10px; font-size: 12px; opacity: .75; }
.hero-eyebrow {
  display: inline-flex;
  padding: 6px 10px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.hero-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.hero-kpi {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.hero-kpi:hover {
  text-decoration: none;
  transform: translateY(-2px);
  background: rgba(255,255,255,.18);
  box-shadow: 0 10px 24px rgba(0,0,0,.16);
}
.hero-kpi strong { font-size: 22px; line-height: 1; }
.hero-kpi span { font-size: 12px; opacity: .82; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: 1fr 1fr 1fr; }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
}
.card-title { font-weight: 800; margin-bottom: 6px; }
.card-sub { color: var(--muted); font-size: 13px; margin-bottom: 12px; line-height: 1.5; }
.page-intro {
  margin: 0;
  color: var(--muted);
  max-width: 900px;
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.feature-card {
  position: relative;
  overflow: hidden;
}
.link-card:hover {
  text-decoration: none;
  box-shadow: var(--shadow2);
}
.feature-card::after {
  content: "";
  position: absolute;
  inset: auto -18px -26px auto;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--chip) 60%, transparent);
}

.cards { display: grid; gap: 10px; }
.mini-card { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 10px; border-radius: 14px; border: 1px solid var(--border); background: color-mix(in oklab, var(--panel) 90%, var(--chip) 10%); }
.mini-card:hover { box-shadow: var(--shadow2); text-decoration: none; }
.mini-icon img { width: 72px; height: 48px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); }
.mini-title { font-weight: 800; }
.mini-desc { color: var(--muted); font-size: 12px; margin-top: 3px; }

.accordion .acc { border: 1px solid var(--border); border-radius: 14px; background: var(--panel); margin-bottom: 10px; overflow: hidden; }
.accordion summary { padding: 10px 12px; cursor: pointer; font-weight: 750; }
.acc-body { padding: 10px 12px; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.pill { display: inline-flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--chip); }
.pill:hover { text-decoration: none; box-shadow: var(--shadow2); }
.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.chip-link {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 90%, var(--chip) 10%);
  font-weight: 750;
  white-space: nowrap;
  flex: 0 0 auto;
}
.chip-link:hover {
  text-decoration: none;
  box-shadow: var(--shadow2);
}
.chip-link.is-active {
  background: color-mix(in oklab, var(--accent) 14%, white 86%);
  border-color: color-mix(in oklab, var(--accent) 24%, var(--border) 76%);
  color: color-mix(in oklab, var(--accent) 78%, black 22%);
}
.filter-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-form .input {
  flex: 1 1 320px;
  min-width: min(320px, 100%);
}

.page { display: grid; gap: 16px; min-width: 0; }
.page h1 { margin: 0; }
.page-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; min-width: 0; }
.release-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.metric-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 88%, var(--chip) 12%);
}
.metric-eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.metric-value {
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}
.metric-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.stats { display: flex; gap: 10px; }
.stat { background: var(--chip); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; min-width: 90px; text-align: center; }
.stat-num { font-weight: 900; font-size: 20px; }
.stat-label { color: var(--muted); font-size: 12px; }
.keyval-list {
  display: grid;
  gap: 10px;
}
.keyval-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 90%, var(--chip) 10%);
}
.keyval-key {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .35px;
  text-transform: uppercase;
}
.keyval-value {
  font-weight: 650;
  min-width: 0;
}

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 620px; }
.table.compact { min-width: 420px; }
.table th, .table td { padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { text-align: left; color: var(--muted); font-weight: 800; font-size: 12px; letter-spacing: .4px; text-transform: uppercase; }
.table tr:hover td { background: color-mix(in oklab, var(--chip) 65%, transparent); }

.row-link { display: flex; justify-content: space-between; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--panel); margin-bottom: 10px; }
.row-link:hover { text-decoration: none; box-shadow: var(--shadow2); }
.row-title { font-weight: 850; }
.row-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.row-meta { display: grid; gap: 4px; align-content: start; text-align: right; }

.badge { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; border-radius: 999px; background: var(--accent); color: white; font-weight: 800; font-size: 12px; }
.badge.soft { background: var(--chip); color: var(--fg); border: 1px solid var(--border); font-weight: 800; }
.badge.warn {
  background: #b7791f;
  color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  flex: 0 0 auto;
  min-height: 42px;
}
.btn:hover { box-shadow: var(--shadow2); text-decoration: none; }
.btn.small { padding: 7px 10px; border-radius: 10px; font-size: 13px; min-height: 34px; }
.btn.primary { background: var(--accent); color: white; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.disabled, .btn:disabled { opacity: .45; pointer-events: none; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 8px 0 12px; }
.input { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel); color: var(--fg); min-width: 220px; }
.input.multiline {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  font-family: var(--mono);
  line-height: 1.5;
}
.label { font-weight: 800; font-size: 13px; margin: 6px 0 6px; display: block; }
.label.inline { display: flex; align-items: center; gap: 10px; }
.form { display: grid; gap: 10px; }

.muted { color: var(--muted); }
.empty-state {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: color-mix(in oklab, var(--panel) 92%, var(--chip) 8%);
  color: var(--muted);
}

.list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.notice {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--accent) 28%, transparent);
  background: color-mix(in oklab, var(--chip) 82%, white 18%);
}
.notice.danger {
  border-color: rgba(171, 58, 58, .22);
  background: rgba(171, 58, 58, .08);
}

.code { font-family: var(--mono); font-size: 12px; background: color-mix(in oklab, var(--panel) 70%, black 10%); border: 1px solid var(--border); padding: 12px; border-radius: 12px; overflow-x: auto; }
.seq {
  font-family: var(--mono);
  font-size: 12px;
  background: color-mix(in oklab, var(--panel) 75%, black 6%);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  max-width: 100%;
  line-height: 1.65;
}

.viz-grid { align-items: start; }
.home-viz-grid > .card {
  height: 100%;
}
.home-viz-wide {
  margin-top: 16px;
}
.chart-space { margin-bottom: 16px; }

.donut-card {
  display: flex;
  flex-direction: column;
}

.species-viz-grid {
  align-items: stretch;
}

.species-viz-grid > .donut-card {
  height: 100%;
}

.species-viz-grid .donut-shell {
  min-height: 178px;
  margin-bottom: 8px;
}

.species-viz-grid .donut-chart {
  width: min(188px, 66%);
}

.species-viz-grid > .donut-card:first-child .compact-legend {
  min-height: 232px;
}

.species-viz-grid > .donut-card:nth-child(2) .compact-legend {
  min-height: 328px;
}

.species-viz-grid .family-more-panel {
  margin-top: auto;
}

.donut-shell {
  display: grid;
  place-items: center;
  min-height: 220px;
  margin: 4px 0 12px;
}

.donut-chart {
  position: relative;
  width: min(220px, 72%);
  aspect-ratio: 1;
  border-radius: 50%;
  isolation: isolate;
  --donut-active-start: 0%;
  --donut-active-end: 0%;
  --donut-active-color: transparent;
  background: var(--donut-gradient);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 12px 24px rgba(0,0,0,.08);
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}

.donut-chart.is-donut-hot {
  cursor: pointer;
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 16px 34px rgba(9, 25, 29, .16);
  filter: saturate(1.04);
}

.donut-chart::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.05);
  transition: opacity .18s ease, filter .22s ease, transform .22s ease;
  background:
    conic-gradient(
      transparent 0 var(--donut-active-start),
      color-mix(in oklab, white 22%, var(--donut-active-color)) var(--donut-active-start) var(--donut-active-end),
      transparent var(--donut-active-end) 100%
    );
  -webkit-mask: radial-gradient(farthest-side, transparent 51.5%, #000 52.75%, #000 98%, transparent 100%);
  mask: radial-gradient(farthest-side, transparent 51.5%, #000 52.75%, #000 98%, transparent 100%);
}

.donut-chart.is-donut-hot::before {
  opacity: 1;
  filter:
    drop-shadow(0 0 18px color-mix(in oklab, white 42%, var(--donut-active-color)))
    drop-shadow(0 10px 18px color-mix(in oklab, white 58%, var(--donut-active-color)));
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  background:
    radial-gradient(circle at top, color-mix(in oklab, white 42%, transparent), transparent 56%),
    var(--panel);
  box-shadow: inset 0 0 0 1px var(--border);
  pointer-events: none;
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 52%;
  height: 52%;
  transform: translate(-50%, -50%);
  z-index: 2;
  padding: 0;
  border-radius: 50%;
  box-sizing: border-box;
  text-align: center;
  pointer-events: none;
  overflow: hidden;
}

.donut-center strong {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-block;
  width: max-content;
  max-width: none;
  font-size: clamp(20px, 6vw, 40px);
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin: 0;
  text-align: center;
  transform: translate(-50%, -50%);
}

.donut-center span {
  position: absolute;
  top: calc(50% + var(--donut-sub-offset, 16px));
  left: 50%;
  display: inline-block;
  width: max-content;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
  line-height: 1.15;
  max-width: 100%;
  text-align: center;
  margin: 0;
  white-space: nowrap;
  transform: translateX(-50%);
}

.stack-meter {
  display: flex;
  width: 100%;
  min-height: 44px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 88%, var(--chip) 12%);
}

.stack-meter-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 8px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.stack-meter-segment:hover {
  text-decoration: none;
  filter: brightness(1.03);
}
.species-stack-meter {
  min-height: 38px;
}
.species-stack-meter .stack-meter-segment {
  min-width: 0;
  padding: 8px 6px;
}
.species-stack-meter .stack-meter-segment span {
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
.stack-meter.icon-stack {
  min-height: 56px;
}
.stack-meter-segment.icon-only {
  min-width: 32px;
  padding: 6px;
}
.stack-meter-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
}

.legend-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.compact-legend {
  gap: 8px;
  margin-top: 0;
}

.legend-item {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}
.legend-list.icon-legend .legend-item {
  grid-template-columns: 20px 1fr auto auto;
}
.legend-link:hover {
  text-decoration: none;
  box-shadow: var(--shadow2);
  background: color-mix(in oklab, var(--panel) 92%, var(--chip) 8%);
}

.legend-item.is-donut-active {
  transform: translateX(4px);
  background: color-mix(in oklab, var(--panel) 80%, var(--legend-tone-color, var(--accent)) 20%);
  border-color: color-mix(in oklab, var(--border) 60%, var(--legend-tone-color, var(--accent)) 40%);
  box-shadow: 0 10px 22px rgba(0,0,0,.08);
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.legend-item.is-donut-active .legend-dot {
  transform: scale(1.18);
  box-shadow: 0 0 0 4px color-mix(in oklab, white 78%, var(--legend-tone-color, var(--accent)));
}

.family-more-panel {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in oklab, var(--panel) 94%, var(--chip) 6%);
  overflow: hidden;
}

.family-more-panel summary {
  cursor: pointer;
  font-weight: 750;
  padding: 10px 12px;
}

.legend-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
}

.legend-label {
  min-width: 0;
  font-weight: 700;
}

.home-browse-grid > .card {
  height: 100%;
}

.browse-home-card {
  display: flex;
  flex-direction: column;
}

.home-preview-list {
  display: grid;
  gap: 10px;
  min-height: 320px;
  align-content: start;
}

.home-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 90%, var(--chip) 10%);
}

.home-preview-row:hover {
  text-decoration: none;
  box-shadow: var(--shadow2);
}

.home-preview-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.home-preview-main strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-mini-card {
  padding: 12px;
}

.preview-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  font-weight: 800;
  color: color-mix(in oklab, var(--fg) 82%, var(--accent) 18%);
}

.preview-more:hover {
  text-decoration: none;
}

.bar-list {
  display: grid;
  gap: 10px;
}

.spacious-bars {
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.3fr) minmax(140px, 2fr) auto;
  gap: 12px;
  align-items: center;
}
.bar-row-link {
  display: block;
  color: inherit;
  padding: 2px 0;
  border-radius: 12px;
}
.bar-row-link:hover {
  text-decoration: none;
}
.bar-row-link:hover .bar-row,
.bar-row-link.is-active .bar-row {
  background: color-mix(in oklab, var(--chip) 78%, white 22%);
  border-color: color-mix(in oklab, var(--accent) 20%, var(--border) 80%);
}
.bar-row-link .bar-row {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.species-composition-row {
  grid-template-columns: minmax(170px, 1.35fr) minmax(260px, 3fr) auto;
}

.compact-bars .bar-row {
  grid-template-columns: minmax(120px, 1.2fr) minmax(120px, 1.8fr) auto;
}

.analysis-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.analysis-panel {
  min-width: 0;
}

.analysis-panel .bar-row,
.analysis-panel.compact-bars .bar-row,
.analysis-panel .compact-bars .bar-row {
  grid-template-columns: minmax(92px, 1fr) minmax(96px, 1.6fr) auto;
  gap: 10px;
}

.bar-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
  font-size: 13px;
  font-weight: 700;
  min-height: 34px;
  align-content: center;
}

.bar-meta a {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  position: relative;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in oklab, var(--chip) 85%, white 15%);
  border: 1px solid var(--border);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
}

.bar-value {
  min-width: 48px;
  text-align: right;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.tone-1 { background: linear-gradient(90deg, #267e78, #3da99c); }
.tone-2 { background: linear-gradient(90deg, #4a6ac7, #6989e2); }
.tone-3 { background: linear-gradient(90deg, #ad5c2b, #d07b36); }
.tone-4 { background: linear-gradient(90deg, #7a5ab5, #9a79d5); }
.tone-5 { background: linear-gradient(90deg, #3f8a45, #61b35f); }
.tone-6 { background: linear-gradient(90deg, #a14f6e, #c56f8d); }
.tone-7 { background: linear-gradient(90deg, #56616f, #7d8895); }
.tone-8 { background: linear-gradient(90deg, #1f7ea1, #3ea5c9); }
.tone-9 { background: linear-gradient(90deg, #7d6d1a, #a69534); }
.tone-10 { background: linear-gradient(90deg, #7f3e91, #a75fbb); }
.tone-11 { background: linear-gradient(90deg, #236c6d, #328b8d); }
.tone-12 { background: linear-gradient(90deg, #b34e41, #cf6d5f); }

.legend-dot.tone-1, .stack-meter-segment.tone-1 { background: linear-gradient(90deg, #267e78, #3da99c); }
.legend-dot.tone-2, .stack-meter-segment.tone-2 { background: linear-gradient(90deg, #4a6ac7, #6989e2); }
.legend-dot.tone-3, .stack-meter-segment.tone-3 { background: linear-gradient(90deg, #ad5c2b, #d07b36); }
.legend-dot.tone-4, .stack-meter-segment.tone-4 { background: linear-gradient(90deg, #7a5ab5, #9a79d5); }
.legend-dot.tone-5, .stack-meter-segment.tone-5 { background: linear-gradient(90deg, #3f8a45, #61b35f); }
.legend-dot.tone-6, .stack-meter-segment.tone-6 { background: linear-gradient(90deg, #a14f6e, #c56f8d); }
.legend-dot.tone-7, .stack-meter-segment.tone-7 { background: linear-gradient(90deg, #56616f, #7d8895); }
.legend-dot.tone-8, .stack-meter-segment.tone-8 { background: linear-gradient(90deg, #1f7ea1, #3ea5c9); }
.legend-dot.tone-9, .stack-meter-segment.tone-9 { background: linear-gradient(90deg, #7d6d1a, #a69534); }
.legend-dot.tone-10, .stack-meter-segment.tone-10 { background: linear-gradient(90deg, #7f3e91, #a75fbb); }
.legend-dot.tone-11, .stack-meter-segment.tone-11 { background: linear-gradient(90deg, #236c6d, #328b8d); }
.legend-dot.tone-12, .stack-meter-segment.tone-12 { background: linear-gradient(90deg, #b34e41, #cf6d5f); }

.heatmap-wrap {
  overflow-x: auto;
}

.heatmap-grid {
  display: grid;
  gap: 8px;
  align-items: stretch;
}

.heatmap-corner,
.heatmap-col,
.heatmap-total,
.heatmap-row-label,
.heatmap-row-total {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 88%, var(--chip) 12%);
}

.heatmap-col {
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  min-height: 108px;
}

.heatmap-corner,
.heatmap-total {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.heatmap-row-label {
  display: grid;
  gap: 2px;
  align-content: center;
  min-width: 0;
}

.heatmap-row-label a {
  font-weight: 800;
}

.heatmap-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--accent) 20%, var(--border) 80%);
  background: color-mix(in oklab, var(--accent) var(--shade), white);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.heatmap-row-total {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.phylo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.phylo-strip.compact {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.phylo-node {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 88%, var(--chip) 12%);
}
.phylo-node:hover {
  text-decoration: none;
  box-shadow: var(--shadow2);
}

.phylo-node.is-active {
  border-color: color-mix(in oklab, var(--accent) 38%, var(--border) 62%);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 24%, transparent);
  background: color-mix(in oklab, var(--accent) 10%, white);
}

.phylo-node.has-hits {
  background: color-mix(in oklab, var(--chip) 72%, white 28%);
}

.phylo-name {
  font-weight: 800;
}

.phylo-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--chip) 82%, white 18%);
}

.phylo-fill {
  height: 100%;
  border-radius: inherit;
}

.phylo-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.annotation-flow-list {
  display: grid;
  gap: 12px;
}

.annotation-flow {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 88%, var(--chip) 12%);
}

.flow-step {
  display: grid;
  gap: 2px;
  min-width: 110px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.flow-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 900;
  padding: 0 2px;
}

.pathway-reaction-map {
  overflow: hidden;
}

.reaction-kpi {
  display: grid;
  gap: 2px;
  min-width: 118px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 88%, var(--chip) 12%);
  text-align: center;
}

.reaction-kpi strong {
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
}

.reaction-kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reaction-section-list {
  display: grid;
  gap: 14px;
}

.reaction-section {
  display: grid;
  gap: 10px;
}

.reaction-section-title {
  color: color-mix(in oklab, var(--fg) 82%, var(--accent) 18%);
  font-size: 13px;
  font-weight: 900;
}

.reaction-step-list {
  display: grid;
  gap: 12px;
}

.reaction-step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 91%, var(--chip) 9%);
}

.reaction-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--accent) 14%, white 86%);
  color: color-mix(in oklab, var(--accent) 72%, black 28%);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.reaction-flow {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(210px, .9fr) minmax(180px, 1.1fr);
  gap: 12px;
  align-items: stretch;
  min-width: 0;
}

.compound-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.compound-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 112px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.compound-card.product {
  background: color-mix(in oklab, var(--panel) 86%, var(--chip) 14%);
}

.compound-role {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.compound-name {
  font-weight: 850;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.compound-formula {
  color: color-mix(in oklab, var(--fg) 72%, var(--muted) 28%);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.compound-svg {
  display: block;
  width: 100%;
  height: 132px;
  object-fit: contain;
  padding: 7px;
  border-radius: 10px;
  border: 1px solid color-mix(in oklab, var(--border) 82%, transparent 18%);
  background: #fff;
}

.compound-structure {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.compound-structure-note {
  color: color-mix(in oklab, var(--muted) 82%, var(--fg) 18%);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.enzyme-node {
  position: relative;
  display: grid;
  align-items: center;
  min-width: 0;
}

.enzyme-arrow {
  position: absolute;
  left: -10px;
  right: -10px;
  top: 50%;
  height: 3px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 32%, var(--border) 68%);
  transform: translateY(-50%);
}

.enzyme-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -1px;
  width: 10px;
  height: 10px;
  border-top: 3px solid color-mix(in oklab, var(--accent) 36%, var(--border) 64%);
  border-right: 3px solid color-mix(in oklab, var(--accent) 36%, var(--border) 64%);
  transform: translateY(-50%) rotate(45deg);
}

.enzyme-box {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  min-width: 0;
  align-content: center;
  min-height: 112px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--accent) 24%, var(--border) 76%);
  background: color-mix(in oklab, var(--panel) 84%, white 16%);
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
}

.enzyme-label {
  color: color-mix(in oklab, var(--fg) 86%, var(--accent) 14%);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.3;
}

.enzyme-family-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.enzyme-family-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--chip) 70%, white 30%);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.enzyme-family-chip:hover {
  text-decoration: none;
  box-shadow: var(--shadow2);
}

.enzyme-family-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.reaction-function {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.family-pathway-map .section-head {
  margin-bottom: 10px;
}

.family-pathway-list {
  display: grid;
  gap: 12px;
}

.family-pathway-row {
  display: grid;
  grid-template-columns: minmax(190px, 260px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 90%, var(--chip) 10%);
}

.family-pathway-head {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.family-pathway-name {
  font-weight: 850;
  line-height: 1.25;
}

.family-pathway-name:hover {
  color: color-mix(in oklab, var(--accent) 76%, black 24%);
}

.family-pathway-count {
  color: var(--muted);
  font-size: 12px;
}

.family-pathway-stages {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.family-stage {
  display: grid;
  grid-template-columns: minmax(126px, 168px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.family-stage-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.family-stage.is-other .family-stage-label {
  color: color-mix(in oklab, var(--muted) 72%, var(--fg) 28%);
}

.family-pathway-families {
  display: flex;
  align-items: stretch;
  gap: 22px;
  min-width: 0;
  overflow-x: auto;
  padding: 4px 6px 8px 2px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.family-node {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
  min-width: 112px;
  max-width: 190px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-weight: 800;
  scroll-snap-align: start;
}

.family-node:hover {
  text-decoration: none;
  box-shadow: var(--shadow2);
}

.family-node:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -19px;
  width: 16px;
  height: 2px;
  background: color-mix(in oklab, var(--accent) 28%, var(--border) 72%);
  transform: translateY(-50%);
}

.family-node:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 50%;
  right: -20px;
  width: 7px;
  height: 7px;
  border-top: 2px solid color-mix(in oklab, var(--accent) 28%, var(--border) 72%);
  border-right: 2px solid color-mix(in oklab, var(--accent) 28%, var(--border) 72%);
  transform: translateY(-50%) rotate(45deg);
}

.family-node.is-current {
  border-color: color-mix(in oklab, var(--accent) 42%, var(--border) 58%);
  background: color-mix(in oklab, var(--accent) 14%, white 86%);
  color: color-mix(in oklab, var(--accent) 72%, black 28%);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 18%, transparent);
}

.family-node-name {
  min-width: 0;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.family-node-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.family-node.is-current .family-node-count {
  background: color-mix(in oklab, var(--accent) 18%, white 82%);
  color: color-mix(in oklab, var(--accent) 72%, black 28%);
}

/* Tool form helpers */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.checkbox-grid input[type="checkbox"] { width: 16px; height: 16px; }

@media (min-width: 720px) {
  .checkbox-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .checkbox-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.cat-head { display: grid; grid-template-columns: 140px 1fr; gap: 14px; align-items: start; }
.cat-icon img { width: 140px; height: 94px; border-radius: 16px; object-fit: cover; border: 1px solid var(--border); }

.pathway-tree { display: grid; gap: 12px; }
.path-link { display: inline-flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--chip); margin-right: 10px; margin-bottom: 8px;}
.path-link:hover { text-decoration: none; box-shadow: var(--shadow2); }
.path-link.child { background: color-mix(in oklab, var(--chip) 55%, var(--panel) 45%); }
.path-children { padding-left: 14px; border-left: 3px solid var(--border); }
.icon img { width: 44px; height: 30px; border-radius: 10px; border: 1px solid var(--border); object-fit: cover; }

.steps { display: grid; gap: 10px; margin-top: 10px; }
.step { display: flex; gap: 10px; align-items: center; }
.footer { margin-top: 26px; border-top: 1px solid var(--border); background: color-mix(in oklab, var(--bg) 95%, black 5%); }
.footer-inner { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; padding: 18px 0; align-items: center;}
.footer-title { font-weight: 900; }
.footer-text { color: var(--muted); font-size: 12px; margin-top: 3px; }
.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 700;
}
.footer-links a {
  color: color-mix(in oklab, var(--fg) 85%, var(--accent) 15%);
}
.footer-sponsors { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.footer-affiliation {
  min-width: 210px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in oklab, var(--panel) 90%, white 10%);
  padding: 8px 12px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  text-align: left;
}
.footer-affiliation-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex: 0 0 auto;
}
.sponsor { height: 38px; border-radius: 10px; border: 1px solid var(--border); background: white; padding: 6px; }
.footer-bottom { padding: 12px 0; text-align: center; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.page-info { color: var(--muted); font-size: 13px; }
.job-actions,
.job-status {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-actions .btn,
.job-actions .btn,
.filters .btn,
.chip-row .chip-link {
  max-width: 100%;
}

.card.link {
  transition: transform .18s ease, box-shadow .18s ease;
}
.card.link:hover {
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: var(--shadow2);
}

@media (max-width: 980px) {
  .grid.two { grid-template-columns: 1fr; }
  .grid.three { grid-template-columns: 1fr; }
  .grid.four { grid-template-columns: 1fr 1fr; }
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand toggle" "actions actions" "nav nav";
    min-height: 0;
  }
  .brand { grid-area: brand; }
  .brand-logo { height: 42px; max-width: 42px; }
  .header-actions {
    grid-area: actions;
    justify-self: stretch;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }
  .lang-switch { justify-self: end; width: fit-content; }
  .nav-toggle { grid-area: toggle; display: inline-flex; }
  .nav {
    grid-area: nav;
    display: none;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-top: 6px;
  }
  .nav.open { display: flex; }
  .nav-menu {
    width: 100%;
  }
  .nav-menu-trigger {
    width: fit-content;
  }
  .nav-dropdown {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav-dropdown::before {
    display: none;
  }
  .nav-dropdown a {
    display: block;
  }
  .search input { width: 100%; max-width: 100%; }
  .cat-head { grid-template-columns: 1fr; }
  .cat-icon img { width: 100%; height: 140px; }
  .table { min-width: 540px; }
  .hero-kpis { grid-template-columns: 1fr 1fr; }
  .section-head { flex-direction: column; }
  .home-viz-wide { margin-top: 0; }
  .bar-row,
  .compact-bars .bar-row {
    grid-template-columns: minmax(110px, 1.2fr) minmax(120px, 1.8fr) auto;
  }
  .species-composition-row {
    grid-template-columns: minmax(120px, 1.1fr) minmax(140px, 1.9fr) auto;
  }
  .analysis-split {
    grid-template-columns: 1fr;
  }
  .analysis-panel .bar-row,
  .analysis-panel.compact-bars .bar-row,
  .analysis-panel .compact-bars .bar-row {
    grid-template-columns: minmax(88px, 1fr) minmax(92px, 1.4fr) auto;
  }
  .family-pathway-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .reaction-step {
    grid-template-columns: 1fr;
  }
  .reaction-flow {
    grid-template-columns: 1fr;
  }
  .enzyme-node {
    min-height: 86px;
  }
  .enzyme-arrow {
    left: 50%;
    right: auto;
    top: -4px;
    bottom: -4px;
    width: 3px;
    height: auto;
    transform: translateX(-50%);
  }
  .enzyme-arrow::after {
    top: auto;
    bottom: -1px;
    right: 50%;
    transform: translateX(50%) rotate(135deg);
  }
  .reaction-function {
    grid-column: 1;
  }
  .family-stage {
    grid-template-columns: 1fr;
  }
  .family-stage-label {
    padding-left: 2px;
  }
}

@media (max-width: 640px) {
  .container { width: min(var(--container), calc(100% - 24px)); }
  .hero-content { padding: 24px; }
  .hero-content h1 { font-size: 30px; white-space: normal !important; width: auto; }
  .hero-kpis { grid-template-columns: 1fr; }
  .grid.four { grid-template-columns: 1fr; }
  .footer-inner { align-items: flex-start; }
  .stats { width: 100%; flex-wrap: wrap; }
  .brand-logo,
  .brand-mark { height: 48px; width: 48px; }
  .keyval-row { grid-template-columns: 1fr; }
  .bar-row,
  .compact-bars .bar-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .filter-form .input {
    min-width: 0;
    width: 100%;
  }
  .bar-value {
    text-align: left;
    min-width: 0;
  }
  .bar-meta {
    min-height: 0;
  }
  .family-pathway-families {
    gap: 18px;
  }
  .family-node {
    min-width: 104px;
    max-width: 160px;
  }
  .family-node:not(:last-child)::after {
    right: -16px;
    width: 13px;
  }
  .family-node:not(:last-child)::before {
    right: -17px;
  }
}
