/* 臭潮图鉴 owns its catalog layout and game identity colors.
   Site foundations, the header, and opt-in controls live in /theme.css. */

.ld-page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.ld-page main {
  flex: 1 0 auto;
  width: var(--tool-workspace-width);
  min-width: 0;
  margin: 0 auto;
  padding: 0 0 var(--space-600);
}

.ld-page .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;
}

.ld-page summary { cursor: pointer; }

.ld-page summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

/* Season overview and directory navigation. */

.ld-intro {
  width: min(1120px, calc(100% - 48px));
  margin: var(--space-300) auto 0;
}

.ld-kicker {
  display: flex;
  align-items: center;
  gap: var(--space-75);
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.ld-season-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: var(--space-50) var(--space-100);
  border-radius: var(--radius-lg);
  background: var(--text);
  color: var(--panel);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

.ld-intro h2 {
  margin: var(--space-200) 0 var(--space-75);
  font-size: 30px;
  font-weight: 600;
  line-height: 36px;
  text-wrap: balance;
}

.ld-intro > p,
.ld-lead {
  max-width: 74ch;
  margin: var(--space-200) 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 24px;
}

.ld-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-100);
  margin-top: var(--space-300);
}

.ld-overview > div { min-width: 0; }

.ld-overview strong {
  display: block;
  font-size: 30px;
  font-weight: 600;
  line-height: 36px;
  font-variant-numeric: tabular-nums;
}

.ld-overview span {
  display: block;
  margin-top: var(--space-50);
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.ld-guide-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-75);
  padding: var(--space-200) 0 var(--space-300);
}

.ld-guide-nav .ui-button { white-space: nowrap; }

.ld-page .ld-guide-nav .ui-button[aria-current="page"],
.ld-page .ld-guide-nav .ui-button[aria-current="page"]:hover {
  border-color: var(--text);
  background: var(--text);
  color: var(--panel);
}

.ld-page .ld-guide-nav .ui-button[aria-current="page"]:focus-visible {
  outline-color: var(--focus-ring-on-dark);
  outline-offset: -4px;
}

.ld-guide-nav--footer {
  margin-top: var(--space-300);
  padding: var(--space-300) 0 0;
  border-top: 1px solid var(--line);
}

.ld-breadcrumbs {
  margin: 0 0 var(--space-200);
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.ld-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 32px;
  gap: var(--space-50) var(--space-75);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ld-breadcrumbs li {
  display: flex;
  align-items: center;
  overflow-wrap: anywhere;
}

.ld-breadcrumbs li + li::before {
  content: '/';
  margin-right: var(--space-75);
  color: var(--muted);
}

.ld-breadcrumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
}

.ld-static-hero { margin-bottom: var(--space-75); }

.ld-static-hero--entity { margin-bottom: var(--space-50); }

.ld-static-hero--entity .ld-lead { margin: var(--space-100) 0 var(--space-50); }

.ld-section {
  margin: var(--space-400) 0 var(--space-300);
  scroll-margin-top: var(--space-200);
}

.ld-section > h2 {
  margin: 0 0 var(--space-200);
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.ld-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-75);
}

.ld-link-row .ui-button {
  justify-content: flex-start;
  min-width: 0;
  text-align: left;
  overflow-wrap: anywhere;
}

.ld-link-row a > span {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ld-entity-card:hover { border-color: var(--text); }

/* All catalog routes share the calculators' wide desktop workspace. */

.ld-page .page-intro {
  display: flex;
  align-items: center;
  width: var(--tool-workspace-width);
  min-height: 64px;
  margin: 0 auto;
  padding-block: var(--space-100);
}

.ld-page .page-intro h1 {
  font-size: 24px;
  line-height: 32px;
}

.ld-page-heading { justify-content: space-between; gap: var(--space-200); }

.ld-page-heading h1 { min-width: 0; overflow-wrap: anywhere; }

.ld-page-heading--chips { gap: var(--space-75) var(--space-200); }

.ld-page-heading--chips .ld-chip-page-note {
  max-width: 64ch;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  text-align: right;
}

.ld-page-identity {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-100);
}

.ld-page-identity > img { width: 40px; height: 40px; object-fit: contain; }
.ld-page-identity .ld-facts { margin: 0; }

.ld-page .ld-breadcrumbs { margin-bottom: var(--space-75); }
.ld-page .ld-breadcrumbs a { min-height: 32px; }
.ld-overview-page .ld-reading-guide { margin-top: var(--space-300); }

.ld-season-workspace,
.ld-catalog-workspace {
  display: grid;
  align-items: start;
  gap: var(--space-200);
}

.ld-season-workspace { grid-template-columns: 224px minmax(0, 1fr) 288px; }
.ld-catalog-workspace { grid-template-columns: 224px minmax(0, 1fr); }

.ld-season-workspace > *,
.ld-catalog-workspace > * { min-width: 0; }

.ld-catalog-content > :first-child { margin-top: 0; }

.ld-content-description {
  max-width: 80ch;
  margin: 0 0 var(--space-300);
  color: var(--muted);
  font-size: 14px;
  line-height: 24px;
}

.ld-catalog-content .ld-catalog-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.ld-catalog-content .ld-entity-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.ld-catalog-content .ld-skill-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.ld-season-sidebar,
.ld-key-waves,
.ld-overview-card,
.ld-overview-mechanics {
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  background: var(--panel);
}

.ld-season-sidebar { padding: var(--space-100); }

.ld-season-heading {
  display: flex;
  align-items: center;
  gap: var(--space-75);
  padding: var(--space-75) var(--space-50) var(--space-200);
}

.ld-season-heading h2 {
  margin: 0;
  font-size: 15px;
  line-height: 24px;
}

.ld-season-heading .ld-season-pill { text-decoration: none; }

.ld-season-navigation { display: grid; gap: var(--space-50); }

.ld-season-navigation a {
  display: flex;
  align-items: center;
  gap: var(--space-75);
  min-height: 52px;
  padding: var(--space-75);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
}

.ld-season-navigation img,
.ld-season-nav-mark {
  flex: none;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.ld-season-nav-mark {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--text);
  color: var(--panel);
  font-size: 12px;
  font-weight: 600;
}

.ld-season-navigation a[aria-current] {
  background: var(--gold);
  color: var(--accent);
  font-weight: 600;
}

.ld-season-navigation a:hover { background: var(--panel2); }
.ld-season-navigation a[aria-current]:hover { background: var(--gold); }

.ld-workspace-tools,
.ld-season-switch {
  margin-top: var(--space-200);
  padding: var(--space-200) var(--space-50) 0;
  border-top: 1px solid var(--line);
}

.ld-workspace-tools h3,
.ld-season-switch h3,
.ld-pick-waves h3 {
  margin: 0 0 var(--space-75);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
}

.ld-workspace-tools > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-75);
  min-height: 36px;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  text-decoration: none;
}

.ld-workspace-tools > a:hover { color: var(--link); }

.ld-directory-heading,
.ld-key-waves-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-100);
}

.ld-directory-heading { padding: var(--space-75) 0 var(--space-200); }

.ld-directory-heading h2,
.ld-key-waves-heading h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
}

.ld-directory-heading > span,
.ld-key-waves-heading > span {
  flex: none;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.ld-overview-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-200);
}

.ld-overview-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ld-overview-card-main {
  flex: 1;
  padding: var(--space-200);
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-2xl);
}

.ld-overview-card-heading {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 20px;
  align-items: center;
  gap: var(--space-100);
}

.ld-overview-card-heading > img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.ld-overview-card h3,
.ld-overview-mechanics h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 26px;
}

.ld-overview-card-count {
  margin: var(--space-50) 0 0;
  color: var(--accent);
  font-size: 14px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}

.ld-overview-card-arrow {
  color: var(--link);
  font-size: 20px;
  line-height: 24px;
}

.ld-overview-card-description {
  min-height: 44px;
  margin: var(--space-100) 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 22px;
}

.ld-overview-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-50) var(--space-100);
  padding: var(--space-75) var(--space-200);
  border-top: 1px solid var(--line);
}

.ld-overview-shortcuts a,
.ld-pick-waves a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--link);
  font-size: 13px;
  line-height: 20px;
  text-decoration: none;
  text-underline-offset: 4px;
}

.ld-overview-shortcuts a:hover,
.ld-pick-waves a:hover { text-decoration: underline; }

.ld-overview-card:has(.ld-overview-card-main:hover),
.ld-overview-mechanics:has(.ld-overview-mechanics-main:hover) { border-color: var(--link); }

.ld-overview-mechanics { margin-top: var(--space-200); }

.ld-overview-mechanics-main {
  display: flex;
  align-items: center;
  gap: var(--space-200);
  padding: var(--space-200);
  border-radius: var(--radius-2xl);
  color: var(--text);
  text-decoration: none;
}

.ld-overview-mechanics-main img {
  flex: none;
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.ld-overview-mechanics-main > div { flex: 1; min-width: 0; }

.ld-overview-mechanics-main p {
  margin: var(--space-50) 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 22px;
}

.ld-key-waves { padding: var(--space-200); }

.ld-key-waves-description {
  margin: var(--space-100) 0 var(--space-75);
  color: var(--muted);
  font-size: 13px;
  line-height: 21px;
}

.ld-key-wave-list { margin: 0; padding: 0; list-style: none; }

.ld-key-wave-list a {
  display: block;
  padding: var(--space-75) 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.ld-key-wave-list a:hover h3 { color: var(--link); }

.ld-key-wave-title,
.ld-key-wave-lineup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-75);
}

.ld-key-wave-title h3 { flex: 1; margin: 0; font-size: 15px; line-height: 22px; }

.ld-key-wave-title > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}

.ld-key-wave-lineup { margin-top: var(--space-75); }
.ld-key-wave-portraits { display: flex; flex: none; gap: var(--space-50); }
.ld-key-wave-portraits img { width: 36px; height: 36px; object-fit: contain; }

.ld-key-wave-names {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.ld-all-waves.ui-button {
  justify-content: space-between;
  width: 100%;
  margin-top: var(--space-200);
}

.ld-pick-waves { margin-top: var(--space-200); }
.ld-pick-waves h3 { margin-bottom: 0; }
.ld-pick-waves > div { display: flex; flex-wrap: wrap; gap: var(--space-100); }

@media (min-width: 1024px) {
  body.ld-overview-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
    overflow: hidden;
  }

  .ld-overview-page #main-content {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
  }

  .ld-overview-page .ld-static {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: var(--space-200);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
  }

  .ld-overview-page .ld-breadcrumbs,
  .ld-overview-page .ld-reading-guide { flex: none; }

  .ld-overview-page .ld-season-workspace {
    flex: 1 0 auto;
    align-items: stretch;
  }

  .ld-overview-page .ld-season-directory {
    display: flex;
    flex-direction: column;
  }

  .ld-overview-page .ld-overview-cards { flex: 1; }
  .ld-overview-page .ld-key-waves { align-content: start; margin-bottom: 0; }
}

@media (max-width: 1199px) {
  .ld-season-workspace { grid-template-columns: 208px minmax(0, 1fr); }
  .ld-catalog-workspace { grid-template-columns: 208px minmax(0, 1fr); }
  .ld-season-workspace > .ld-season-sidebar { grid-row: span 2; }
  .ld-key-waves { grid-column: 2; }
  .ld-key-wave-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-200); }
}

@media (max-width: 899px) {
  .ld-season-workspace,
  .ld-catalog-workspace { grid-template-columns: minmax(0, 1fr); }
  .ld-season-workspace > .ld-season-sidebar { grid-row: auto; }
  .ld-season-heading { padding-bottom: var(--space-75); }
  .ld-season-navigation { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ld-workspace-tools { display: none; }
  .ld-key-waves { grid-column: auto; }
}

@media (max-width: 760px) {
  .ld-page { --tool-workspace-gutter: 12px; }
}

@media (max-width: 600px) {
  .ld-page-identity { gap: var(--space-75); }
  .ld-page-identity .ld-facts { flex-direction: column; align-items: flex-start; gap: var(--space-50); }
  .ld-season-navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ld-season-navigation a { min-height: 48px; }
  .ld-overview-cards { grid-template-columns: minmax(0, 1fr); }
  .ld-overview-card-description { min-height: 0; }
  .ld-overview-shortcuts a { min-height: 40px; padding-inline: var(--space-50); }
  .ld-overview-mechanics-main { gap: var(--space-100); }
  .ld-overview-mechanics h3 { font-size: 16px; line-height: 24px; }
  .ld-key-wave-list { grid-template-columns: minmax(0, 1fr); }
}

/* Catalog search, element filters, and the retained interactive hub. */

.ld-controls { margin: var(--space-200) 0 var(--space-75); }

.ld-control-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-200);
}

.ld-season-select {
  display: flex;
  align-items: center;
  gap: var(--space-75);
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.ld-season-select .ui-select { width: auto; }

.ld-tabs.ui-segmented {
  display: flex;
  padding: 0;
  gap: 0;
}

.ld-tabs.ui-segmented > .ui-button { white-space: nowrap; }

.ld-tabs.ui-segmented > .ui-button[aria-selected="true"]:not(:disabled):not([aria-disabled="true"]),
.ld-tabs.ui-segmented > .ui-button[aria-selected="true"]:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--text);
  color: var(--panel);
}

.ld-tabs.ui-segmented > .ui-button[aria-selected="true"]:focus-visible { outline-color: var(--focus-ring-on-dark); }

.ld-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-75);
  margin-top: var(--space-200);
}

.ld-search {
  flex: 1 1 300px;
  min-width: 0;
}

.ld-filters > label { min-width: 0; }

.ld-chip-filter { flex: 0 1 160px; }

.ld-catalog-search {
  display: block;
  margin: 0 0 var(--space-100);
}

.ld-catalog-search input.ui-input { max-width: 560px; }

.ld-catalog-search-bar { margin-bottom: var(--space-300); }

.ld-catalog-search-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-100);
  min-height: 24px;
  margin-bottom: var(--space-75);
}

.ld-catalog-search-meta .ld-boss-filter__status { margin: 0; }

.ld-clear { white-space: nowrap; }

.ld-boss-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-100);
  margin: var(--space-200) 0;
}

.ld-boss-filter.ui-card { padding: var(--space-200); }

.ld-boss-filter__label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.ld-boss-filter__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-75);
}

.ld-boss-filter .ld-boss-filter__button.ui-button {
  gap: var(--space-75);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.ld-boss-filter .ld-boss-filter__button.ui-button[aria-pressed="true"]:not(:disabled):not([aria-disabled="true"]),
.ld-boss-filter .ld-boss-filter__button.ui-button[aria-pressed="true"]:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--text);
  background: var(--text);
  color: var(--panel);
}

.ld-boss-filter .ld-boss-filter__button.ui-button[aria-pressed="true"]:focus-visible {
  outline-color: var(--focus-ring-on-dark);
  outline-offset: -4px;
}

.ld-boss-filter__button small {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
}

.ld-boss-filter__button[aria-pressed="true"]:not(:disabled):not([aria-disabled="true"]) small { color: var(--panel); }

.ld-boss-filter__swatch {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.ld-boss-filter__clear { margin-left: auto; }

.ld-boss-filter__status,
.ld-status {
  min-height: 20px;
  margin: var(--space-100) 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}

.ld-empty {
  margin: var(--space-200) 0;
  padding: var(--space-400) var(--space-200);
  border: 1px dashed var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  color: var(--muted);
  font-size: 16px;
  line-height: 24px;
  text-align: center;
}

/* List cards keep game portraits, quality names, and effect labels together. */

.ld-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.ld-card h3,
.ld-card h4 { margin: 0; }

.ld-card h3 {
  font-size: 16px;
  line-height: 24px;
  overflow-wrap: anywhere;
}

.ld-catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-200);
}

.ld-chip {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100%;
}

.ld-chip-top {
  display: grid;
  gap: var(--space-100);
}

.ld-card-heading {
  display: flex;
  align-items: center;
  gap: var(--space-100);
}

.ld-chip .ld-card-heading {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 56px;
}

.ld-chip-image {
  flex: none;
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.ld-chip-title {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 56px;
  overflow-wrap: anywhere;
}

.ld-chip-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-50);
  min-height: 24px;
  margin: 0;
}

.ld-chip-tags .ld-badge {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ld-chip .ld-quality { font-weight: 700; }

.ld-chip-tags .ld-effect-tag { font-weight: 500; }

.ld-description {
  color: var(--text);
  font-size: var(--text-body-size, 15px);
  line-height: var(--text-body-leading, 1.7);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.ld-chip > .ld-description {
  flex: 1 1 auto;
  margin: var(--space-200) 0;
  color: var(--text);
  font-size: 14px;
  line-height: 24px;
}

.ld-chip-meta {
  display: grid;
  align-content: start;
  gap: var(--space-50);
  margin-top: auto;
  padding-top: var(--space-100);
  border-top: 1px solid var(--line);
}

.ld-chip-footer {
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}

.ld-chip-meta .ld-text-link { margin-top: 0; }

.ld-text-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: var(--space-75);
  min-height: 40px;
  color: var(--link);
  font-size: 14px;
  line-height: 20px;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 55%, transparent);
  text-underline-offset: 3px;
}

.ld-text-link { margin-top: var(--space-100); }

.ld-evolution-link {
  display: inline-flex;
  max-width: 100%;
  margin: 0 var(--space-100) var(--space-200) 0;
  vertical-align: top;
}

.ld-evolution-link a {
  justify-content: flex-start;
  max-width: 100%;
  text-align: left;
}

.ld-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-50);
  min-height: 24px;
  padding: var(--space-50) var(--space-75);
  border: 1px solid var(--line);
  border-radius: var(--space-50);
  background: var(--panel2);
  color: var(--text);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
  text-decoration: none;
}

.ld-badge[href]:hover { border-color: var(--text); }

.ld-accent {
  border-color: #bbddc8;
  background: #e4f4eb;
  color: #286445;
}

.ld-element {
  border-color: #c2dfd4;
  background: #e4f3ef;
  color: #276856;
}

.ld-quality-blue {
  border-color: #bdd9f4;
  background: #edf6ff;
  color: #245c8d;
}

.ld-quality-gold {
  border-color: #e8d28d;
  background: #fff7e2;
  color: #785b0c;
}

.ld-quality-colorful {
  border-color: #d7c4eb;
  background: linear-gradient(110deg, #f1eaff, #e6f6ff 50%, #fff1db);
  color: #6b3e85;
}

.ld-effect-tag {
  border-color: var(--line);
  background: var(--panel2);
  color: var(--muted);
}

.ld-danger-tag {
  border-color: #edd7b4;
  background: #fff5e6;
  color: #885218;
}

.ld-small {
  font-size: 12px;
  line-height: 20px;
}

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

.ld-entity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-100);
}

.ld-entity-card {
  display: flex;
  align-items: center;
  gap: var(--space-100);
  color: var(--text);
  text-decoration: none;
}

.ld-entity-card img {
  flex: none;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.ld-entity-card > div { min-width: 0; }

.ld-entity-card h2,
.ld-entity-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  overflow-wrap: anywhere;
}

.ld-entity-card p {
  margin: var(--space-50) 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
  overflow-wrap: anywhere;
}

.ld-card-arrow {
  flex: none;
  margin-left: auto;
  color: var(--link);
}

.ld-boss-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-75);
}

.ld-boss-card-title .ld-element {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
}

.ld-boss-card-title .ld-element::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--ld-element-color);
}

.ld-wave-badge {
  background: var(--panel);
  color: var(--muted);
}

.ld-element-2 {
  --ld-element-color: #3f9df0;
  background: var(--ld-element-color);
}

.ld-element-3 {
  --ld-element-color: #ef6a4c;
  background: var(--ld-element-color);
}

.ld-element-4 {
  --ld-element-color: #54b26a;
  background: var(--ld-element-color);
}

.ld-element-5 {
  --ld-element-color: #dfa614;
  background: var(--ld-element-color);
}

.ld-element-6 {
  --ld-element-color: #a5793f;
  background: var(--ld-element-color);
}

#element-2 .ld-entity-card,
.ld-entity-card[data-boss-element="2"] { background: #e5f3fb; }

#element-3 .ld-entity-card,
.ld-entity-card[data-boss-element="3"] { background: #fdecea; }

#element-4 .ld-entity-card,
.ld-entity-card[data-boss-element="4"] { background: #e7f6ea; }

#element-5 .ld-entity-card,
.ld-entity-card[data-boss-element="5"] { background: #fff6dc; }

#element-6 .ld-entity-card,
.ld-entity-card[data-boss-element="6"] { background: #f6efe3; }

.ld-boss-tags,
.ld-wave-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-50);
  margin-top: var(--space-75);
}

/* Reading notes and wave list entry points. Detailed skill/table styles follow. */

.ld-callout {
  margin: 0 0 var(--space-200);
  padding: var(--space-200);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel2);
  color: var(--text);
  font-size: 14px;
  line-height: 24px;
}

.ld-callout p {
  max-width: 74ch;
  margin: 0;
}

.ld-callout p + p { margin-top: var(--space-100); }

.ld-reading-guide { margin: 0 0 var(--space-300); }

.ld-reading-guide h2 {
  margin: 0 0 var(--space-100);
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
}

.ld-reading-guide p {
  max-width: 74ch;
  margin: var(--space-75) 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 24px;
}

.ld-reading-guide .ld-link-row { margin-top: var(--space-200); }

#ld-ranks,
#ld-elements,
[id^="element-"] { scroll-margin-top: var(--space-200); }

.ld-wave-index {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-75);
  margin: var(--space-300) 0;
}

.ld-wave-index .ui-button {
  width: 40px;
  padding: 0;
  font-variant-numeric: tabular-nums;
}

.ld-static-wave {
  margin-bottom: var(--space-200);
  scroll-margin-top: var(--space-200);
}

.ld-section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-100);
}

.ld-section-heading h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.ld-section-heading > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
}

.ld-wave-boss + .ld-wave-boss { margin-top: var(--space-300); }

.ld-wave-boss-link {
  display: flex;
  align-items: center;
  gap: var(--space-75);
  margin: var(--space-200) 0 var(--space-100);
  color: var(--link);
  text-decoration: none;
}

.ld-wave-boss-link img {
  flex: none;
  object-fit: contain;
}

.ld-wave-boss-link h3 {
  min-width: 0;
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  overflow-wrap: anywhere;
}

.ld-wave-boss-link > span {
  flex: none;
  font-size: 14px;
  line-height: 20px;
}

.ld-element-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-100);
}

.ld-element-guide h3 {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
}

.ld-chip-results:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
  border-radius: var(--radius-lg);
}

@media (min-width: 1024px) {
  body.ld-chip-workspace-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
    overflow: hidden;
  }

  .ld-chip-workspace-page #main-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
  }

  .ld-chip-workspace-page .ld-static {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: var(--space-200);
  }

  .ld-chip-workspace-page .ld-breadcrumbs { flex: none; }

  .ld-chip-workspace-page .ld-catalog-workspace {
    flex: 1;
    min-height: 0;
    align-items: stretch;
  }

  .ld-chip-workspace-page .ld-season-sidebar {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .ld-chip-workspace-page .ld-catalog-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-100);
    min-height: 0;
  }

  .ld-chip-workspace-page .ld-catalog-content > .ld-content-description,
  .ld-chip-workspace-page .ld-chip-categories {
    flex: none;
    margin: 0;
  }

  .ld-chip-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    gap: var(--space-200);
    flex: none;
  }

  .ld-chip-toolbar--search { grid-template-columns: minmax(0, 560px); }

  .ld-chip-workspace-page .ld-catalog-search-bar {
    display: flex;
    flex: none;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--space-75);
    margin: 0;
  }

  .ld-chip-workspace-page .ld-catalog-search {
    flex: 1;
    min-width: 0;
    margin: 0;
  }

  .ld-chip-workspace-page .ld-catalog-search-meta { flex-wrap: nowrap; min-height: 0; margin: 0; gap: var(--space-75); }
  .ld-chip-workspace-page [data-catalog-status]:empty { display: none; }
  .ld-chip-workspace-page [data-catalog-clear] { min-height: 32px; padding: var(--space-50) var(--space-75); font-size: 12px; }
  .ld-chip-workspace-page .ld-empty { flex-basis: 100%; margin: 0; padding: var(--space-200); }

  .ld-chip-workspace-page .ld-chip-results {
    flex: 1;
    min-height: 0;
    padding: var(--space-50);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    container-type: size;
    container-name: ld-chip-results;
    scroll-padding-block: var(--space-50);
  }

  .ld-chip-workspace-page .ld-catalog-grid {
    --ld-chip-rows: 3;
    gap: var(--space-100);
    grid-auto-rows: minmax(max-content, calc((100cqh - (var(--ld-chip-rows) - 1) * 12px) / var(--ld-chip-rows)));
  }

  .ld-chip-workspace-page .ld-chip {
    padding: var(--space-100);
  }

  .ld-chip-workspace-page .ld-chip-top { gap: 6px; }
  .ld-chip-workspace-page .ld-chip .ld-card-heading { grid-template-columns: 44px minmax(0, 1fr) auto; gap: var(--space-75); min-height: 44px; }
  .ld-chip-workspace-page .ld-chip-image { width: 44px; height: 44px; }
  .ld-chip-workspace-page .ld-chip-title { min-height: 44px; }
  .ld-chip-workspace-page .ld-chip-tags { min-height: 24px; }
  .ld-chip-workspace-page .ld-chip .ld-badge { min-height: 24px; padding: 3px 6px; font-size: 12px; line-height: 16px; }
  .ld-chip-workspace-page .ld-chip > .ld-description { margin-block: var(--space-75); font-size: 15px; line-height: 23px; text-wrap: pretty; }

  .ld-chip-workspace-page .ld-chip-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-50) var(--space-75);
    padding-top: var(--space-75);
  }

  .ld-chip-workspace-page .ld-chip-meta .ld-text-link { min-height: 24px; font-size: 13px; }

  .ld-chip-workspace-page :is(.ld-chip-results, .ld-season-sidebar)::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
}

@container ld-chip-results (max-height: 620px) {
  .ld-chip-workspace-page .ld-catalog-grid { --ld-chip-rows: 2; }
}

@container ld-chip-results (max-height: 380px) {
  .ld-chip-workspace-page .ld-catalog-grid { --ld-chip-rows: 1; }
}

@media (max-width: 1023px) {
  .ld-page-heading--chips { flex-direction: column; align-items: flex-start; gap: var(--space-50); }
  .ld-page-heading--chips .ld-chip-page-note { max-width: none; text-align: left; }
  .ld-chip-toolbar { display: grid; gap: var(--space-100); }
}

/* The retained hub expands skills and comparison tables on demand. */

.ld-pet-list,
.ld-wave-list {
  display: grid;
  gap: var(--space-100);
}

.ld-pet.ui-card,
.ld-wave.ui-card { padding: 0; }

.ld-pet-summary,
.ld-wave-summary {
  display: flex;
  align-items: center;
  gap: var(--space-100);
  padding: var(--space-200);
  list-style: none;
}

.ld-pet-summary::-webkit-details-marker,
.ld-wave-summary::-webkit-details-marker { display: none; }

.ld-pet-summary::after,
.ld-wave-summary::after {
  content: '+';
  flex: none;
  margin-left: auto;
  color: var(--muted);
  font-size: 24px;
  line-height: 24px;
}

details[open] > .ld-pet-summary::after,
details[open] > .ld-wave-summary::after { content: '−'; }

.ld-portrait {
  flex: none;
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.ld-chip-symbol,
.ld-pet-symbol {
  display: grid;
  flex: none;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel2);
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.ld-pet-name { min-width: 0; }

.ld-pet-name > span {
  display: block;
  margin-top: var(--space-50);
  overflow-wrap: anywhere;
}

.ld-pet-tags {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: var(--space-50);
  margin-left: auto;
}

.ld-wave-number {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--panel2);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ld-wave-title { min-width: 0; }

.ld-wave-title > span {
  display: block;
  margin-top: var(--space-50);
}

.ld-wave-portraits {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-25);
}

.ld-wave-portrait {
  flex: none;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.ld-key-waves {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-75);
  margin-bottom: var(--space-200);
}

/* Entity details, skill parameters, and complete numeric tables. */

.ld-detail-body {
  padding: var(--space-200);
  border-top: 1px solid var(--line);
}

.ld-evolutions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-200);
  margin-bottom: var(--space-200);
}

.ld-evolution-form {
  display: grid;
  justify-items: center;
  gap: var(--space-50);
  min-width: 64px;
  margin: 0;
}

.ld-evolution-image {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.ld-evolution-form figcaption {
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.ld-skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: var(--space-200);
}

.ld-skill { min-width: 0; }

.ld-skill h3,
.ld-skill h4 {
  margin: var(--space-75) 0 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
  overflow-wrap: anywhere;
}

.ld-skill--embedded h4 { margin-top: 0; }

.ld-skill-note {
  max-width: 74ch;
  margin: 0 0 var(--space-200);
  color: var(--muted);
  font-size: 14px;
  line-height: 24px;
}

.ld-skill-detail-group { margin-top: var(--space-200); }

.ld-skill-detail-group + .ld-skill-detail-group {
  padding-top: var(--space-200);
  border-top: 1px solid var(--line);
}

.ld-skill-values {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
}

.ld-skill-values > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: baseline;
  gap: var(--space-200);
  padding: var(--space-75) 0;
  border-bottom: 1px solid var(--line);
}

.ld-skill-values > div:last-child { border-bottom: 0; }

.ld-skill-values dt {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.ld-skill-values dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.ld-skill-values > .ld-effect-row {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-75);
}

.ld-effect-row dt {
  color: var(--text);
  font-weight: 600;
}

.ld-effect-row dd {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  text-align: left;
}

.ld-skill-effect + .ld-skill-effect { margin-top: var(--space-200); }

.ld-skill-effect h5 {
  margin: 0 0 var(--space-75);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.ld-skill .ld-description {
  margin: var(--space-100) 0;
  font-size: 16px;
  line-height: 24px;
}

.ld-skill-effect .ld-description { margin: var(--space-75) 0; }

.ld-eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
}

.ld-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-75);
}

.ld-previous {
  margin-top: var(--space-200);
  font-size: 14px;
  line-height: 20px;
}

.ld-previous > summary,
.ld-ranks > summary {
  min-height: 40px;
  padding: var(--space-75) 0;
  color: var(--link);
}

.ld-previous .ld-skill { margin-top: var(--space-100); }

.ld-ranks {
  margin-top: var(--space-200);
  font-size: 14px;
  line-height: 20px;
}

.ld-rank-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-100);
  padding-top: var(--space-200);
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}

.ld-stat-note {
  max-width: 74ch;
  margin: 0 0 var(--space-200);
  font-size: 16px;
  line-height: 24px;
}

.ld-boss + .ld-boss {
  margin-top: var(--space-300);
  padding-top: var(--space-300);
  border-top: 1px solid var(--line);
}

.ld-boss-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-100);
}

.ld-boss-portrait {
  flex: none;
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.ld-boss-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-100);
  margin: var(--space-200) 0;
}

.ld-boss-stats > div { min-width: 0; }

.ld-boss-stats dt {
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
}

.ld-boss-stats dd {
  margin: var(--space-50) 0 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.ld-matchup {
  max-width: 74ch;
  margin: var(--space-75) 0;
  color: var(--text);
  font-size: 16px;
  line-height: 24px;
}

.ld-boss-tips.ui-card {
  margin: var(--space-200) 0 var(--space-300);
  border-left: 4px solid var(--accent);
  background: var(--panel2);
  box-shadow: none;
}

.ld-boss-tips h2,
.ld-boss-tips h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
}

.ld-boss-tips ul {
  max-width: 74ch;
  margin: var(--space-100) 0 0;
  padding-left: var(--space-300);
}

.ld-boss-tips li {
  margin: var(--space-75) 0;
  font-size: 16px;
  line-height: 24px;
}

.ld-boss-comparison.ui-card {
  margin: var(--space-200) 0;
  padding: 0;
  box-shadow: none;
}

.ld-boss-comparison > summary {
  min-height: 40px;
  padding: var(--space-100) var(--space-200);
  color: var(--link);
  font-size: 14px;
  line-height: 20px;
}

.ld-comparison-body { padding: 0 var(--space-200) var(--space-200); }

.ld-table-shell {
  min-width: 0;
  max-width: 100%;
}

.ld-table-hint {
  display: none;
  margin: 0 0 var(--space-75);
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
}

.ld-comparison-scroll.ui-card {
  max-width: 100%;
  padding: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--muted) var(--panel2);
  scrollbar-width: thin;
  box-shadow: none;
}

.ld-comparison-scroll:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.ld-comparison-table {
  width: 100%;
  min-width: 420px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}

.ld-comparison-table th,
.ld-comparison-table td {
  padding: var(--space-100) var(--space-200);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  text-align: right;
  vertical-align: top;
  white-space: nowrap;
}

.ld-comparison-table th:first-child,
.ld-comparison-table td:first-child { text-align: left; }

.ld-comparison-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel2);
  color: var(--muted);
  font-weight: 600;
}

.ld-comparison-table tbody th { font-weight: 600; }

.ld-comparison-table tbody tr:last-child > * { border-bottom: 0; }

.ld-comparison-table .is-current > * {
  background: var(--text);
  color: var(--panel);
  font-weight: 600;
}

.ld-current-mark {
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
}

.ld-full-stats { min-width: 560px; }

.ld-entity-heading {
  display: flex;
  align-items: center;
  gap: var(--space-200);
  margin: var(--space-50) 0 var(--space-300);
}

.ld-entity-heading > img {
  flex: none;
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.ld-entity-heading > div { min-width: 0; }

.ld-entity-meta {
  display: flex;
  align-items: center;
  gap: var(--space-75);
  margin-bottom: var(--space-75);
}

.ld-entity-heading h1,
.ld-entity-heading h2 {
  margin: 0 0 var(--space-75);
  color: var(--text);
  font-size: 30px;
  font-weight: 600;
  line-height: 36px;
  overflow-wrap: anywhere;
}

.ld-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: var(--space-200);
}

.ld-form-section {
  min-width: 0;
  scroll-margin-top: var(--space-200);
}

.ld-form-heading {
  display: flex;
  align-items: center;
  gap: var(--space-100);
  margin-bottom: var(--space-200);
  padding-bottom: var(--space-200);
  border-bottom: 1px solid var(--line);
}

.ld-form-heading img {
  flex: none;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.ld-form-heading h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .ld-table-hint { display: block; }
  .ld-comparison-table th:first-child,
  .ld-comparison-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    box-shadow: 1px 0 0 var(--line);
  }
  .ld-comparison-table thead th:first-child { z-index: 3; }
}

@media (max-width: 600px) {
  .ld-detail-body { padding: var(--space-100); }
  .ld-skill-grid,
  .ld-form-grid,
  .ld-rank-list,
  .ld-boss-stats { grid-template-columns: 1fr; }
  .ld-boss-stats > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-200);
    padding: var(--space-100) var(--space-200);
  }
  .ld-boss-stats dd { margin: 0; }
  .ld-boss-portrait {
    width: 60px;
    height: 60px;
  }
  .ld-entity-heading { gap: var(--space-100); }
  .ld-entity-heading > img {
    width: 72px;
    height: 72px;
  }
  .ld-entity-heading h1,
  .ld-entity-heading h2 {
    font-size: 24px;
    line-height: 32px;
  }
  .ld-form-section.ui-card { padding: var(--space-200); }
}

@media (max-width: 900px) {
  .ld-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .ld-intro { width: calc(100% - 24px); }
  .ld-guide-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-right: var(--space-300);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  .ld-guide-nav.is-at-end {
    -webkit-mask-image: none;
    mask-image: none;
  }
  .ld-guide-nav::-webkit-scrollbar { display: none; }
  .ld-guide-nav .ui-button { flex: 0 0 auto; }
  .ld-guide-nav .ui-button:focus-visible { outline-offset: -3px; }
  .ld-guide-nav .nav-scroll-end {
    flex: 0 0 32px;
    width: 32px;
    height: 1px;
  }
}

@media (max-width: 600px) {
  .ld-intro h2 {
    font-size: 24px;
    line-height: 32px;
  }
  .ld-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-75);
  }
  .ld-overview strong {
    font-size: 24px;
    line-height: 32px;
  }
  .ld-control-top {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-100);
  }
  .ld-season-select { align-self: flex-start; }
  .ld-tabs { width: 100%; }
  .ld-tabs.ui-segmented > .ui-button { padding: var(--space-75) var(--space-50); }
  .ld-search { flex-basis: 100%; }
  .ld-chip-filter { flex: 1 1 120px; }
  .ld-filters .ld-clear { margin-left: auto; }
  .ld-catalog-grid,
  .ld-entity-grid,
  .ld-element-guide { grid-template-columns: 1fr; }
  .ld-reading-guide.ui-card { padding: var(--space-200); }
  .ld-boss-filter { align-items: flex-start; }
  .ld-boss-filter__label { width: 100%; }
  .ld-boss-filter__clear { margin-left: 0; }
  .ld-section { margin-top: var(--space-300); }
  .ld-pet { position: relative; }
  .ld-pet-summary {
    flex-wrap: wrap;
    gap: var(--space-100);
    padding-right: var(--space-400);
  }
  .ld-pet-name { width: calc(100% - 64px); }
  .ld-pet-tags { margin-left: var(--space-700); }
  .ld-pet-summary::after {
    position: absolute;
    top: var(--space-300);
    right: var(--space-100);
  }
  .ld-wave-summary {
    position: relative;
    flex-wrap: wrap;
    padding-right: var(--space-400);
  }
  .ld-wave-portraits { gap: 0; }
  .ld-wave-portrait {
    width: 32px;
    height: 32px;
  }
  .ld-wave-title {
    flex-basis: 100%;
    margin-left: 52px;
  }
  .ld-wave-summary::after {
    position: absolute;
    top: var(--space-300);
    right: var(--space-100);
  }
  .ld-wave-summary > .ld-accent { display: none; }
}
