:root {
  --species-bg: #0a1628;
  --species-ink: #e5edf7;
  --species-muted: #93a4b8;
  --species-soft: #c6d4e5;
  --species-line: rgba(147, 197, 253, 0.18);
  --species-line-strong: rgba(147, 197, 253, 0.34);
  --species-accent: #3b82f6;
}

* { box-sizing: border-box; }

html { background: var(--species-bg); }

.species-web-page {
  min-height: 100vh;
  margin: 0;
  background: var(--species-bg);
  color: var(--species-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: 0.75rem;
  z-index: 10000;
  transform: translateY(-150%);
  border-radius: 999px;
  background: #fff;
  color: #1d4ed8;
  padding: 0.75rem 1rem;
  font-weight: 850;
  text-decoration: none;
}

.skip-link:focus { transform: translateY(0); }

.species-web-main {
  padding: var(--ara-top-nav-height, 64px) 0 clamp(4rem, 8vw, 7rem);
}

.species-detail-width,
#tabOverview.species-tab-content,
.species-tab-body {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.species-status {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 4rem 0;
  color: var(--species-muted);
  text-align: center;
}

.species-web-hero {
  width: 100%;
  min-height: 300px;
  padding: clamp(4.5rem, 7vw, 6rem) clamp(1rem, 4vw, 4rem) clamp(3rem, 5vw, 4.5rem);
  border-bottom: 1px solid var(--species-line);
  background: #071426;
}

.species-web-hero.has-species-cover-hero {
  min-height: 0;
  padding: clamp(2rem, 4vw, 4rem) clamp(1rem, 4vw, 4rem);
  background: #071426;
}

.species-hero-shell {
  position: relative;
  width: min(1120px, 100%);
  min-height: auto;
  margin: 0 auto;
  overflow: hidden;
  border-top: 1px solid var(--species-line-strong);
  border-bottom: 1px solid var(--species-line-strong);
  padding: clamp(1.5rem, 3vw, 2.25rem) 0;
}

.species-hero-backdrop,
.species-hero-shade {
  display: none;
}

.species-hero-shell.has-species-cover {
  width: min(1280px, 100%);
  min-height: clamp(300px, 34vw, 430px);
  display: flex;
  align-items: flex-end;
  border: 0;
  border-radius: 0;
  padding: clamp(1.5rem, 3.5vw, 3rem);
  background: #071426;
}

.species-hero-shell.has-species-cover .species-hero-backdrop,
.species-hero-shell.has-species-cover .species-hero-shade {
  position: absolute;
  inset: 0;
  display: block;
}

.species-hero-shell.has-species-cover .species-hero-backdrop {
  background-image: var(--species-cover-image);
  background-position: center;
  background-size: cover;
}

.species-hero-shell.has-species-cover .species-hero-shade {
  background: rgba(4, 12, 24, 0.12);
}

.species-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.species-hero-pills:empty {
  display: none;
}

.species-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 980px;
}

.species-hero-shell.has-species-cover .species-hero-copy {
  max-width: min(760px, 100%);
  border: 1px solid rgba(219, 234, 254, 0.18);
  border-left: 4px solid rgba(96, 165, 250, 0.9);
  background: rgba(4, 12, 24, 0.78);
  padding: clamp(1rem, 2.4vw, 1.6rem);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.68),
    0 10px 32px rgba(0, 0, 0, 0.42);
}

.species-hero-kicker {
  margin: 0 0 0.65rem;
  color: #dbeafe;
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.species-hero-copy h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2.2rem, 4vw, 4rem);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.species-hero-copy p:last-child {
  max-width: 740px;
  margin: 0.85rem 0 0;
  color: rgba(239, 246, 255, 0.9);
  font-size: clamp(1rem, 1.25vw, 1.14rem);
  font-style: italic;
  line-height: 1.65;
}

.species-tab-bar {
  display: flex;
  gap: 1.35rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--species-line);
}

.species-profile-summary {
  padding-top: 1rem;
  color: #dbeafe;
  font-size: 1rem;
  line-height: 1.6;
}

.species-tab-btn {
  min-height: 48px;
  padding: 0 0.1rem;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--species-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
}

.species-tab-btn:hover,
.species-tab-btn.active {
  color: #fff;
  border-bottom-color: var(--species-accent);
}

.species-tab-content {
  padding-top: clamp(2rem, 4vw, 3.25rem);
}

.species-tab-body {
  display: block;
}

.species-article {
  max-width: 860px;
}

.species-article-wide,
.species-overview-article {
  max-width: 1120px;
}

.species-text-section {
  padding: 0 0 clamp(2rem, 4vw, 3rem);
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--species-line);
}

.species-text-section:last-child {
  margin-bottom: 0;
}

.species-text-section h2 {
  margin: 0 0 1rem;
  color: #fff;
  font-size: clamp(1.55rem, 2vw, 2.15rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0;
}

.species-subsection {
  margin-top: 1.6rem;
}

.species-subsection-grid {
  display: grid;
  gap: 1.6rem 2.5rem;
}

.species-text-section--with-subsections > .species-copy,
.species-text-section--with-subsections > .species-list,
.species-text-section--with-subsections > .species-fact-table {
  max-width: 860px;
}

.species-subsection h3 {
  margin: 0 0 0.65rem;
  color: #dbeafe;
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: 0;
}

.species-lead {
  margin: 0;
  color: #e5edf7;
  font-size: clamp(1.08rem, 1.4vw, 1.25rem);
  line-height: 1.75;
}

.species-copy,
.species-list {
  color: var(--species-soft);
  font-size: 1rem;
  line-height: 1.78;
}

.species-copy {
  margin: 1rem 0 0;
}

.species-profile-intro .species-lead {
  max-width: 900px;
  font-size: 0.95rem;
  line-height: 1.6;
}

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

.species-list li + li {
  margin-top: 0.55rem;
}

.species-fact-table {
  width: 100%;
  margin-top: 1.25rem;
  border-collapse: collapse;
  color: var(--species-soft);
  font-size: 0.98rem;
  line-height: 1.55;
}

.species-fact-table tr {
  border-top: 1px solid var(--species-line);
}

.species-fact-table tr:last-child {
  border-bottom: 1px solid var(--species-line);
}

.species-fact-table th,
.species-fact-table td {
  padding: 0.9rem 0;
  vertical-align: top;
  text-align: left;
}

.species-fact-table th {
  width: 220px;
  padding-right: 1.5rem;
  color: #8cc5ff;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.species-fact-table td {
  color: #e5edf7;
}

.species-overview-article .species-fact-table {
  display: block;
}

.species-overview-article .species-fact-table tbody {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2rem;
}

.species-overview-article .species-fact-table tr {
  display: grid;
  grid-template-columns: minmax(130px, 0.42fr) minmax(0, 1fr);
  align-items: start;
  min-width: 0;
}

.species-overview-article .species-fact-table tr:last-child {
  border-bottom: 0;
}

.species-overview-article .species-fact-table th {
  width: auto;
  min-width: 0;
}

.species-overview-article .species-profile-meta tbody {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.species-overview-article .species-profile-meta tr {
  grid-template-columns: 1fr;
}

.species-overview-article .species-profile-meta th,
.species-overview-article .species-profile-meta td {
  padding-right: 0;
}

.species-overview-article .species-profile-meta td {
  padding-top: 0.1rem;
}

.species-at-glance {
  padding-top: 0.25rem;
}

.species-at-glance .species-fact-table tbody {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.species-at-glance .species-fact-table tr {
  grid-template-columns: 1fr;
}

.species-at-glance .species-fact-table th,
.species-at-glance .species-fact-table td {
  padding-right: 0;
}

.species-at-glance .species-fact-table td {
  padding-top: 0.15rem;
}

.species-id-article .species-subsection-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.species-id-article .species-subsection {
  min-width: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--species-line);
}

.species-id-article .species-subsection h3 {
  color: #fff;
}

.species-id-article .species-subsection .species-copy,
.species-id-article .species-subsection .species-list,
.species-id-article .species-subsection .species-fact-table {
  font-size: 0.96rem;
}

.species-gallery-article {
  max-width: 1120px;
}

.species-gallery-header {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.species-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.species-gallery-card {
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--species-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.species-gallery-card:hover {
  border-color: rgba(59, 130, 246, 0.62);
  transform: translateY(-2px);
}

.species-gallery-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.species-gallery-card__image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #071426;
}

.species-gallery-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.species-gallery-card:hover .species-gallery-card__image img {
  transform: scale(1.045);
}

.species-gallery-card__meta {
  padding: 0.85rem;
}

.species-gallery-card__meta h3 {
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.species-gallery-card__meta p {
  margin: 0.35rem 0 0;
  overflow: hidden;
  color: var(--species-muted);
  font-size: 0.78rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.species-gallery-cover-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: calc(100% - 1.7rem);
  min-height: 42px;
  margin: 0 0.85rem 0.85rem;
  border: 1px solid rgba(96, 165, 250, 0.48);
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.18);
  color: #dbeafe;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
}

.species-gallery-cover-btn:hover:not(:disabled) {
  border-color: rgba(147, 197, 253, 0.88);
  background: rgba(59, 130, 246, 0.28);
}

.species-gallery-cover-btn:disabled {
  cursor: default;
  opacity: 0.78;
}

.species-gallery-cover-btn.is-current {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(22, 163, 74, 0.18);
  color: #bbf7d0;
}

.species-gallery-cover-btn .material-symbols-rounded {
  font-size: 1.05rem;
}

.species-gallery-empty {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 4rem 1rem;
  color: var(--species-muted);
  text-align: center;
}

.species-gallery-empty .material-symbols-rounded {
  color: rgba(147, 197, 253, 0.55);
  font-size: 3rem;
}

.species-heritage-article {
  max-width: 1120px;
}

.heritage-measure-section {
  padding-bottom: clamp(2.25rem, 4vw, 3.25rem);
}

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

.heritage-section-heading h2 {
  margin-bottom: 0;
}

.heritage-section-heading p {
  max-width: 360px;
  margin: 0;
  color: var(--species-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  text-align: right;
}

.heritage-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1.25rem 0 1rem;
}

.heritage-metric-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 150px;
  border: 1px solid var(--species-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: inherit;
  padding: 0.8rem;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.heritage-metric-card[href]:hover {
  border-color: rgba(59, 130, 246, 0.62);
  background: rgba(59, 130, 246, 0.08);
  transform: translateY(-2px);
}

.heritage-metric-card__media {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 0.7rem;
  background: #071426;
}

.heritage-metric-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.heritage-metric-card__fallback {
  display: grid;
  width: 100%;
  height: 100%;
  gap: 0.25rem;
  place-items: center;
  align-content: center;
  border: 1px dashed rgba(147, 197, 253, 0.24);
  background: #071426;
  color: rgba(147, 197, 253, 0.35);
}

.heritage-metric-card__fallback .material-symbols-rounded {
  font-size: 2rem;
}

.heritage-metric-card__fallback small,
.heritage-tree-card__fallback small {
  color: rgba(219, 234, 254, 0.64);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.heritage-metric-card > span {
  display: block;
  color: #8cc5ff;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.heritage-metric-card > strong {
  display: block;
  margin: auto 0;
  color: #e5edf7;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.heritage-metric-card > strong span,
.heritage-rank-value span {
  display: block;
  margin-top: 0.15rem;
  color: var(--species-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.heritage-metric-card > strong .heritage-value-metric {
  color: inherit;
}

.heritage-metric-card > strong .heritage-value-metric b {
  font-size: clamp(2.05rem, 3.2vw, 3.35rem);
  font-weight: 950;
  line-height: 0.9;
}

.heritage-metric-card > strong .heritage-value-metric {
  font-size: clamp(1rem, 1.3vw, 1.25rem);
  font-weight: 900;
}

.heritage-metric-card > strong .heritage-value-count {
  color: inherit;
  font-size: clamp(1rem, 1.3vw, 1.25rem);
  font-weight: 900;
}

.heritage-metric-card > strong .heritage-value-count b {
  display: block;
  font-size: clamp(2.05rem, 3.2vw, 3.35rem);
  font-weight: 950;
  line-height: 0.9;
}

.heritage-metric-card > strong .heritage-value-count span {
  display: block;
  margin-top: 0.2rem;
  color: var(--species-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.heritage-metric-card.is-leader {
  border-color: rgba(34, 197, 94, 0.32);
  background: rgba(22, 163, 74, 0.08);
}

.heritage-metric-card.is-leader > strong {
  color: #bbf7d0;
}

.heritage-metric-card.is-leader > strong .heritage-value-metric {
  font-size: clamp(0.92rem, 1.05vw, 1.08rem);
}

.heritage-metric-card.is-leader > strong .heritage-value-metric b {
  font-size: clamp(1.85rem, 2.35vw, 2.55rem);
}

.heritage-metric-card__tree {
  min-width: 0;
  margin-top: 0;
  padding-top: 0.75rem;
}

.heritage-metric-card__tree strong,
.heritage-metric-card__tree small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heritage-metric-card__tree strong {
  color: #fff;
  font-size: 0.86rem;
  line-height: 1.18;
}

.heritage-metric-card__tree small {
  margin-top: 0.2rem;
  color: var(--species-muted);
  font-size: 0.72rem;
}

.heritage-top-list {
  border-top: 1px solid var(--species-line);
}

.heritage-top-heading {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.35rem 0 0.55rem;
}

.heritage-top-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--species-line);
}

.heritage-top-heading h3 {
  margin: 0;
  color: #dbeafe;
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.heritage-rank-row {
  display: grid;
  grid-template-columns: 36px 42px minmax(0, 1fr) auto minmax(110px, auto);
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--species-line);
  padding: 0.8rem 0;
  color: inherit;
  text-decoration: none;
}

.heritage-rank-row:hover .heritage-rank-name strong {
  color: #93c5fd;
}

.heritage-rank-number {
  color: rgba(147, 197, 253, 0.75);
  font-size: 0.78rem;
  font-weight: 900;
}

.heritage-rank-photo {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(147, 197, 253, 0.26);
  border-radius: 999px;
  background: #071426;
  color: rgba(147, 197, 253, 0.45);
}

.heritage-rank-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.heritage-rank-photo .material-symbols-rounded {
  font-size: 1.15rem;
}

.heritage-rank-name {
  min-width: 0;
}

.heritage-rank-name strong,
.heritage-rank-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heritage-rank-name strong {
  color: #fff;
  font-size: 0.94rem;
  line-height: 1.2;
}

.heritage-rank-name small {
  margin-top: 0.2rem;
  color: var(--species-muted);
  font-size: 0.78rem;
}

.heritage-rank-type {
  border: 1px solid rgba(147, 197, 253, 0.2);
  border-radius: 999px;
  color: #bfdbfe;
  padding: 0.3rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 850;
  white-space: nowrap;
}

.heritage-rank-value {
  color: #e5edf7;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 0.98;
  text-align: right;
}

.heritage-rank-value .heritage-value-metric {
  color: inherit;
  font-weight: 950;
}

.heritage-rank-value .heritage-value-metric b {
  font-size: 1.2em;
  letter-spacing: 0;
}

.heritage-rank-value span:not(.heritage-value-metric) {
  color: #93c5fd;
  font-size: 0.78rem;
  font-weight: 850;
}

.heritage-empty-line {
  margin: 0;
  border-top: 1px solid var(--species-line);
  border-bottom: 1px solid var(--species-line);
  padding: 1rem 0;
  color: var(--species-muted);
}

.heritage-tree-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.heritage-tree-card {
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--species-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.heritage-tree-card:hover {
  border-color: rgba(59, 130, 246, 0.62);
  transform: translateY(-2px);
}

.heritage-tree-card.has-loaded-image {
  order: 1;
}

.heritage-tree-card.has-image-url {
  order: 2;
}

.heritage-tree-card.is-no-image {
  order: 3;
}

.heritage-tree-card.is-species-champion {
  order: 0;
  border-color: rgba(247, 200, 30, 0.9);
  box-shadow: 0 0 0 1px rgba(247, 200, 30, 0.42), 0 0 26px rgba(247, 200, 30, 0.22);
  animation: heritageChampionGlow 2.4s ease-in-out infinite;
}

.heritage-tree-card.is-species-champion:hover {
  border-color: #f7c81e;
  box-shadow: 0 0 0 1px rgba(247, 200, 30, 0.72), 0 0 34px rgba(247, 200, 30, 0.34);
}

.heritage-tree-card__image {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #071426;
}

.heritage-tree-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.heritage-tree-card:hover .heritage-tree-card__image img {
  transform: scale(1.045);
}

.heritage-tree-card__fallback {
  display: grid;
  width: 100%;
  height: 100%;
  gap: 0.4rem;
  place-items: center;
  align-content: center;
  border: 1px dashed rgba(147, 197, 253, 0.24);
  background: #071426;
  color: rgba(147, 197, 253, 0.35);
}

.heritage-tree-card__fallback .material-symbols-rounded {
  font-size: 2.4rem;
}

.heritage-tree-card__icon {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.heritage-tree-card__icon .material-symbols-rounded {
  font-size: 1rem;
}

@keyframes heritageChampionGlow {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(247, 200, 30, 0.36), 0 0 18px rgba(247, 200, 30, 0.16);
  }

  50% {
    box-shadow: 0 0 0 2px rgba(247, 200, 30, 0.78), 0 0 36px rgba(247, 200, 30, 0.34);
  }
}

.heritage-tree-card__body {
  padding: 0.85rem;
}

.heritage-tree-card__body h3 {
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heritage-tree-card__body p {
  margin: 0.35rem 0 0;
  overflow: hidden;
  color: var(--species-muted);
  font-size: 0.78rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid color-mix(in srgb, var(--cat-color, #93c5fd) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--cat-color, #93c5fd) 15%, transparent);
  color: #dbeafe;
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.category-pill.primary {
  color: #bbf7d0;
}

.category-pill .material-symbols-rounded {
  font-size: 1rem;
}

@media (max-width: 720px) {
  .species-web-hero {
    min-height: 0;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .species-tab-bar {
    overflow-x: auto;
  }

  .species-tab-btn {
    white-space: nowrap;
  }

  .species-fact-table th,
  .species-fact-table td {
    display: block;
    width: 100%;
    padding: 0;
  }

  .species-fact-table th {
    padding-top: 0.9rem;
  }

  .species-fact-table td {
    padding: 0.35rem 0 0.9rem;
  }

  .species-overview-article .species-fact-table tbody,
  .species-overview-article .species-profile-meta tbody,
  .species-at-glance .species-fact-table tbody,
  .species-id-article .species-subsection-grid {
    display: block;
  }

  .species-overview-article .species-fact-table tr,
  .species-at-glance .species-fact-table tr {
    display: block;
  }

  .species-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .heritage-section-heading {
    display: block;
  }

  .heritage-section-heading p {
    max-width: none;
    margin-top: 0.55rem;
    text-align: left;
  }

  .heritage-stat-grid {
    grid-template-columns: 1fr;
  }

  .heritage-rank-row {
    grid-template-columns: 28px 38px minmax(0, 1fr);
    gap: 0.75rem;
  }

  .heritage-rank-type,
  .heritage-rank-value {
    grid-column: 3;
    justify-self: start;
    text-align: left;
  }

  .heritage-tree-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 721px) and (max-width: 980px) {
  .species-overview-article .species-profile-meta tbody,
  .species-at-glance .species-fact-table tbody,
  .species-id-article .species-subsection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .species-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .heritage-stat-grid,
  .heritage-tree-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .heritage-metric-card.is-leader {
    grid-column: span 2;
  }
}
