:root {
  --bg-rgb: 7, 18, 22;
  --bg-2-rgb: 12, 35, 41;
  --rail-rgb: 10, 28, 34;
  --rail-2-rgb: 16, 46, 55;
  --surface-rgb: 13, 31, 36;
  --surface-2-rgb: 18, 43, 50;
  --surface-3-rgb: 25, 59, 65;
  --line-rgb: 91, 176, 183;
  --accent-rgb: 82, 223, 252;
  --pal-teal-rgb: 52, 180, 163;
  --pal-leaf-rgb: 143, 191, 91;
  --pal-gold-rgb: 229, 188, 108;
  --pal-ember-rgb: 201, 114, 79;
  --bg: #071216;
  --bg-2: #0c2329;
  --rail: #0a1c22;
  --rail-2: #102e37;
  --surface: rgba(var(--surface-rgb), 0.94);
  --surface-2: rgba(var(--surface-2-rgb), 0.92);
  --surface-3: rgba(var(--surface-3-rgb), 0.88);
  --ink-strong: #fff7df;
  --ink: #e9f4df;
  --muted: #a9baad;
  --muted-2: #7f958d;
  --line: rgba(var(--line-rgb), 0.15);
  --line-strong: rgba(var(--pal-gold-rgb), 0.32);
  --accent: #52dffc;
  --accent-soft: rgba(var(--accent-rgb), 0.14);
  --accent-strong: #a9f5ec;
  --accent-2: var(--gold);
  --leaf: #8fbf5b;
  --leaf-soft: rgba(var(--pal-leaf-rgb), 0.16);
  --leaf-strong: #c9e88f;
  --gold: #e5bc6c;
  --gold-soft: rgba(var(--pal-gold-rgb), 0.16);
  --ember: #c9724f;
  --ember-strong: #f2a28d;
  --focus: #66e4ff;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 14px 28px rgba(0, 0, 0, 0.24);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --font-head: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-body: "Segoe UI", "Trebuchet MS", "Gill Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color-scheme: dark;
  background:
    radial-gradient(circle at top left, rgba(var(--accent-rgb), 0.16), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(var(--pal-leaf-rgb), 0.08), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      135deg,
      rgba(var(--line-rgb), 0.025) 0,
      rgba(var(--line-rgb), 0.025) 4px,
      transparent 4px,
      transparent 16px
    );
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

select,
option,
optgroup {
  color-scheme: dark;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

code {
  padding: 0 0.35rem;
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}

.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;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px 12px;
  overflow: auto;
  background: linear-gradient(180deg, rgba(var(--rail-rgb), 0.98), rgba(var(--rail-2-rgb), 0.98));
  color: var(--ink);
  border-right: 1px solid rgba(var(--line-rgb), 0.1);
}

.rail-panel {
  margin-bottom: 10px;
  padding: 10px;
  background: rgba(var(--surface-2-rgb), 0.58);
  border: 1px solid rgba(var(--line-rgb), 0.08);
  border-radius: 10px;
}

.rail-panel--nav {
  display: grid;
  gap: 0;
}

.rail-panel--muted {
  background: rgba(var(--rail-2-rgb), 0.56);
}

.rail-footer-panel {
  margin-top: 8px;
}

.panel-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rail-game-logo-link {
  display: block;
  margin-bottom: 0;
  padding: 6px 4px 0;
  border-radius: 8px;
}

.rail-game-logo-link:hover,
.rail-game-logo-link:focus-visible {
  background: rgba(255, 255, 255, 0.03);
}

.rail-game-logo {
  display: block;
  width: min(100%, 124px);
  height: auto;
  margin: 0 auto;
}

.rail-game-logo-fallback,
.topbar-brand-mark,
.icon-fallback {
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--accent-strong);
}

.rail-game-logo-fallback {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  border: 1px solid rgba(var(--line-rgb), 0.12);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02) 44%, rgba(0, 0, 0, 0.24)),
    linear-gradient(180deg, rgba(var(--surface-3-rgb), 0.95), rgba(var(--surface-rgb), 0.9));
  letter-spacing: 0.08em;
}

.page-title,
.section-title,
.detail-title,
.module-title,
.pal-name {
  font-family: var(--font-head);
}

.nav {
  display: grid;
  gap: 3px;
}

.rail-menu-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 8px;
  background: rgba(var(--surface-2-rgb), 0.72);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.rail-menu-toggle svg {
  width: 18px;
  height: 18px;
  color: var(--accent-strong);
}

.rail-menu-toggle:hover,
.rail-menu-toggle:focus-visible {
  border-color: var(--line-strong);
  background: rgba(var(--surface-3-rgb), 0.92);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.2;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(var(--line-rgb), 0.12);
}

.nav-link.is-active {
  background: rgba(var(--accent-rgb), 0.14);
  border-color: rgba(var(--line-rgb), 0.14);
  color: var(--accent-strong);
  font-weight: 700;
}

.nav-link--muted {
  opacity: 0.68;
  cursor: default;
}

.nav-group {
  display: grid;
  gap: 3px;
}

.nav-group-summary {
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.nav-group-summary::-webkit-details-marker {
  display: none;
}

.nav-group-icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
  transition: transform 140ms ease, color 140ms ease;
}

.nav-group[open] .nav-group-icon {
  transform: rotate(90deg);
  color: var(--accent-strong);
}

.nav-sublist {
  display: grid;
  gap: 3px;
  margin-left: 10px;
  padding-left: 8px;
  border-left: 1px solid rgba(var(--line-rgb), 0.14);
}

.nav-sublink {
  min-height: 30px;
  padding-left: 9px;
  color: var(--muted);
  font-size: 0.84rem;
}

.nav-sublink.is-active {
  color: var(--accent-strong);
}

.rail-note {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.rail-meta {
  display: grid;
  gap: 8px;
}

.rail-meta-row {
  display: grid;
  gap: 3px;
}

.rail-meta-label {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rail-meta-value {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.rail-meta-link-list {
  display: grid;
  gap: 4px;
}

.rail-meta-link {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.rail-meta-link:hover,
.rail-meta-link:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
}

.workspace {
  min-width: 0;
  padding: 14px 18px 28px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(360px, 520px);
  gap: 14px;
  align-items: center;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: rgba(var(--bg-2-rgb), 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(var(--line-rgb), 0.1);
  border-radius: 12px;
}

.topbar-copy {
  min-width: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
}

.topbar-brand-mark {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.28));
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 1.3rem;
  line-height: 1.2;
}

.breadcrumb-link {
  color: var(--ink);
  text-decoration: none;
  transition: color 140ms ease;
}

.breadcrumb-link:hover,
.breadcrumb-link:focus-visible {
  color: var(--accent-strong);
}

.breadcrumb-link.is-current {
  color: var(--ink);
}

.breadcrumb-separator {
  color: var(--muted-2);
}

.topbar-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.command-search {
  position: relative;
  min-width: 0;
}

.command-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 6px 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(var(--line-rgb), 0.12);
  border-radius: 999px;
}

.command-search input,
.control-input,
.control-select {
  min-width: 0;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  background: transparent;
  border: 0;
  color: var(--ink);
}

.control-select option,
.control-select optgroup {
  background: var(--bg-2);
  color: var(--ink);
}

.control-select option:checked,
.control-select option:hover,
.control-select option:focus {
  background: rgb(var(--surface-3-rgb));
  color: var(--ink);
}

.command-search input::placeholder,
.control-input::placeholder {
  color: var(--muted-2);
}

.command-search-submit,
.button-quiet,
.table-sort {
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

.command-search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(var(--line-rgb), 0.12);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent-strong);
}

.command-search-submit:hover {
  background: rgba(var(--accent-rgb), 0.22);
  border-color: rgba(var(--line-rgb), 0.2);
}

.command-search-submit svg {
  width: 16px;
  height: 16px;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  gap: 6px;
  padding: 8px;
  background: rgba(var(--bg-2-rgb), 0.98);
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 16px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
}

.search-suggestions[hidden] {
  display: none !important;
}

.search-suggestion-list {
  display: grid;
  gap: 4px;
}

.search-suggestion {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.search-suggestion:hover,
.search-suggestion:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(var(--line-rgb), 0.16);
}

.search-suggestion-media,
.pal-icon-frame,
.preview-portrait,
.icon-fallback {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(var(--line-rgb), 0.12);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02) 44%, rgba(0, 0, 0, 0.24)),
    linear-gradient(180deg, rgba(var(--surface-3-rgb), 0.95), rgba(var(--surface-rgb), 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.search-suggestion-media,
.pal-icon-frame,
.icon-fallback {
  width: 40px;
  height: 40px;
}

.preview-portrait {
  width: 120px;
  height: 120px;
}

.search-suggestion-icon,
.pal-icon,
.preview-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.search-suggestion-icon,
.pal-icon {
  padding: 4px;
}

.preview-icon {
  padding: 12px;
}

.icon-fallback {
  color: var(--accent-strong);
  letter-spacing: 0.08em;
}

.search-suggestion-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.search-suggestion-main strong {
  font-size: 0.92rem;
  line-height: 1.25;
}

.search-suggestion-subtitle,
.search-suggestion-kind {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.search-suggestion-kind {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.search-suggestion-empty {
  padding: 8px 10px 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.content {
  animation: fade-in 220ms ease;
}

.wiki-main-header,
.surface,
.module {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.wiki-main-header,
.surface,
.module {
  padding: 16px;
}

.wiki-main-header {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
  gap: 18px;
  margin-bottom: 14px;
}

.wiki-status-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 12px;
  border: 1px solid rgba(var(--line-rgb), 0.1);
  border-radius: 12px;
  background: var(--surface-2);
}

.section-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-title,
.section-title,
.detail-title,
.module-title {
  margin: 0;
  letter-spacing: -0.02em;
}

.page-title {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1.08;
}

.page-title-stack {
  display: grid;
  gap: 6px;
}

.lede,
.detail-copy,
.meta-copy,
.section-note {
  color: var(--muted);
  line-height: 1.55;
}

.lede {
  max-width: 72ch;
  margin: 10px 0 0;
}

.summary-cluster,
.chip-row,
.toolbar-row,
.toolbar-main,
.toolbar-actions,
.module-head,
.workspace-footer-row,
.workspace-footer-links,
.element-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.summary-cluster {
  align-items: stretch;
}

.summary-tile {
  flex: 1 1 120px;
  min-width: 110px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.summary-tile--link {
  display: block;
  color: inherit;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.summary-tile--link:hover,
.summary-tile--link:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(var(--surface-2-rgb), 0.96);
}

.summary-tile strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.4rem;
}

.summary-tile span {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-tile p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.overview-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

.overview-start-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
}

.overview-start-copy {
  min-width: 0;
}

.overview-resource-panel {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(var(--line-rgb), 0.12);
  border-radius: 12px;
  background: rgba(var(--surface-2-rgb), 0.58);
}

.overview-resource-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.official-resource-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(var(--line-rgb), 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.028);
  color: inherit;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.official-resource-link:hover,
.official-resource-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(var(--pal-gold-rgb), 0.28);
  background: rgba(var(--pal-teal-rgb), 0.12);
}

.official-resource-icon-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 34px;
  border: 1px solid rgba(var(--pal-gold-rgb), 0.18);
  border-radius: 8px;
  background: rgba(4, 13, 17, 0.5);
  overflow: hidden;
}

.official-resource-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.official-resource-icon--wide {
  width: 44px;
  height: 24px;
}

.official-resource-icon--light {
  filter: brightness(0) invert(1);
}

.official-resource-badge {
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.official-resource-link strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
}

.official-resource-copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.official-resource-arrow {
  color: var(--gold);
  font-weight: 800;
}

.overview-version-panel {
  margin-bottom: 14px;
}

.overview-version-panel .section-head {
  align-items: flex-start;
}

.overview-version-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border-top: 1px solid rgba(var(--line-rgb), 0.12);
}

.overview-version-table {
  width: 100%;
  min-width: 680px;
  border-collapse: separate;
  border-spacing: 0;
}

.overview-version-table th,
.overview-version-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.1);
  text-align: left;
  vertical-align: middle;
}

.overview-version-table th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overview-version-table td {
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.35;
}

.overview-version-title-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.overview-version-title-cell strong {
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1rem;
}

.overview-version-current-pill {
  padding: 3px 7px;
  border: 1px solid rgba(var(--pal-leaf-rgb), 0.28);
  border-radius: 999px;
  background: rgba(var(--pal-leaf-rgb), 0.12);
  color: var(--leaf-strong);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overview-version-build-link,
.overview-version-diff-link {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.overview-version-build-link:hover,
.overview-version-build-link:focus-visible,
.overview-version-diff-link:hover,
.overview-version-diff-link:focus-visible {
  text-decoration: underline;
}

.overview-version-diff-muted {
  color: var(--muted);
}

.toolbar-shell {
  position: sticky;
  top: 76px;
  z-index: 20;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: rgba(var(--surface-rgb), 0.95);
  border: 1px solid rgba(var(--line-rgb), 0.12);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.toolbar-main {
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

.toolbar-meta {
  justify-content: flex-start;
  gap: 6px;
  margin-top: 8px;
}

.control-group {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 10px;
  flex: 0 0 auto;
}

.control-group--search {
  min-width: 180px;
  flex: 1 1 200px;
}

.control-label {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-group--search .control-input {
  min-width: 0;
  flex: 1 1 auto;
  padding-left: 0;
  padding-right: 0;
}

.control-select {
  min-width: 96px;
}

.button-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(var(--line-rgb), 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.button-quiet:hover {
  border-color: rgba(var(--line-rgb), 0.22);
  color: var(--ink);
}

.meta-pill,
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  line-height: 1;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

.meta-pill,
 .element-badge--fallback {
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--line-rgb), 0.12);
  color: var(--accent-strong);
}

.meta-pill--muted {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(var(--line-rgb), 0.12);
  color: var(--muted);
}

.meta-pill--night {
  background: rgba(var(--accent-rgb), 0.14);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  color: var(--accent-strong);
}

.filter-pill {
  background: rgba(var(--accent-rgb), 0.14);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  color: var(--accent-strong);
  font-weight: 700;
}

.element-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  min-height: 24px;
  padding: 0 12px 0 24px;
  border: 0;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  white-space: nowrap;
}

.element-badge--asset {
  background-image: var(--element-badge-image);
}

.element-badge--fallback {
  min-width: 72px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--line-rgb), 0.12);
  color: var(--accent-strong);
  text-shadow: none;
}

.element-badge--fire { box-shadow: inset 3px 0 0 #a74d39; }
.element-badge--water { box-shadow: inset 3px 0 0 #689aae; }
.element-badge--leaf,
.element-badge--grass { box-shadow: inset 3px 0 0 #5f8750; }
.element-badge--electric,
.element-badge--electricity { box-shadow: inset 3px 0 0 #c4a44a; }
.element-badge--ice { box-shadow: inset 3px 0 0 #8bbad0; }
.element-badge--ground,
.element-badge--earth { box-shadow: inset 3px 0 0 #8a6d4b; }
.element-badge--dark { box-shadow: inset 3px 0 0 #6c7e98; }
.element-badge--dragon { box-shadow: inset 3px 0 0 #8264a6; }
.element-badge--normal,
.element-badge--neutral { box-shadow: inset 3px 0 0 #7f715f; }

.page-grid {
  display: grid;
  gap: 12px;
}

.page-grid--detail {
  grid-template-columns: 1fr;
}

.breeding-recipes-layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.breeding-target-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 168px);
  overflow: auto;
  padding: 10px;
}

.breeding-target-list {
  display: grid;
  gap: 6px;
}

.breeding-target-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  width: 100%;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.breeding-target-item:hover,
.breeding-target-item:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(var(--line-rgb), 0.16);
}

.breeding-target-item.is-selected {
  background: rgba(var(--accent-rgb), 0.14);
  border-color: rgba(var(--line-rgb), 0.2);
}

.breeding-target-icon,
.breeding-detail-icon,
.breeding-parent-icon {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(var(--line-rgb), 0.12);
  border-radius: 8px;
  background: rgba(var(--bg-2-rgb), 0.88);
}

.breeding-target-icon,
.breeding-parent-icon {
  width: 42px;
  height: 42px;
}

.breeding-detail-icon {
  width: 76px;
  height: 76px;
}

.breeding-target-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
}

.breeding-target-copy strong,
.breeding-parent-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.breeding-target-copy span,
.breeding-parent-copy span,
.breeding-detail-subtitle,
.breeding-rank-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.breeding-recipe-detail {
  min-width: 0;
}

.breeding-detail-head {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.breeding-detail-title-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.breeding-detail-title {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.breeding-detail-title h1 {
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--font-head);
  font-size: clamp(1.55rem, 2vw, 2.1rem);
  line-height: 1.08;
}

.breeding-detail-subtitle,
.breeding-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.breeding-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.breeding-summary-tile {
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid rgba(var(--line-rgb), 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.breeding-summary-tile strong {
  color: var(--ink-strong);
  font-family: var(--font-head);
  font-size: 1.08rem;
  line-height: 1.1;
}

.breeding-summary-tile span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.breeding-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.breeding-tag,
.gender-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.gender-pill {
  border-color: rgba(var(--line-rgb), 0.28);
  color: var(--gold);
}

.breeding-recipe-table-wrap {
  overflow: auto;
  border: 1px solid rgba(var(--line-rgb), 0.1);
  border-radius: 8px;
}

.breeding-recipe-table {
  min-width: 560px;
}

.breeding-recipe-table th,
.breeding-recipe-table td {
  vertical-align: middle;
}

.breeding-parent-cell {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  color: var(--ink);
}

.breeding-parent-link:hover,
.breeding-parent-link:focus-visible {
  color: var(--accent-strong);
}

.breeding-parent-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.breeding-calculator-page {
  display: grid;
  gap: 16px;
}

.breeding-calculator-panel {
  display: grid;
  gap: 14px;
}

.breeding-calculator-actions {
  display: flex;
  justify-content: flex-start;
}

.breeding-calculator-clear:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.breeding-calculator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}

.breeding-pal-picker {
  position: relative;
  min-width: 0;
}

.breeding-pal-picker-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.breeding-pal-picker-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 7px 9px;
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  text-align: left;
}

.breeding-pal-picker-trigger:hover,
.breeding-pal-picker-trigger:focus-visible {
  border-color: rgba(var(--line-rgb), 0.24);
  background: rgba(255, 255, 255, 0.055);
}

.breeding-pal-picker-caret {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.breeding-pal-picker-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 45;
  overflow: hidden;
  border: 1px solid rgba(var(--line-rgb), 0.16);
  border-radius: 8px;
  background: rgba(var(--bg-2-rgb), 0.98);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38);
}

.breeding-pal-picker-search {
  width: calc(100% - 12px);
  height: 34px;
  margin: 6px 6px 0;
  padding: 0 10px;
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
}

.breeding-pal-picker-search::placeholder {
  color: var(--muted-2);
}

.breeding-pal-picker-list {
  display: grid;
  max-height: min(360px, 52vh);
  overflow: auto;
  padding: 6px;
}

.breeding-pal-picker-option {
  width: 100%;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.breeding-pal-picker-option:hover,
.breeding-pal-picker-option:focus-visible,
.breeding-pal-picker-option.is-selected {
  border-color: rgba(var(--line-rgb), 0.16);
  background: rgba(var(--accent-rgb), 0.14);
}

.breeding-pal-picker-option--clear {
  min-height: 38px;
  padding: 8px 10px;
  color: var(--muted);
}

.breeding-pal-picker-clear-label {
  font-size: 0.86rem;
  font-weight: 800;
}

.breeding-pal-picker-selected,
.breeding-pal-picker-option-content {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
}

.breeding-pal-picker-selected strong,
.breeding-pal-picker-option-content strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.breeding-pal-picker-placeholder {
  color: var(--muted);
  font-weight: 700;
}

.breeding-pal-picker-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.breeding-calculator-results {
  min-width: 0;
}

.location-page {
  display: grid;
  gap: 14px;
}

.location-page-head {
  padding-bottom: 14px;
}

.location-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.location-layout.is-location-sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.location-sidebar {
  display: grid;
  gap: 14px;
  align-content: start;
}

.location-sidebar[hidden] {
  display: none;
}

.location-sidebar-section + .location-sidebar-section {
  padding-top: 14px;
  border-top: 1px solid rgba(var(--line-rgb), 0.12);
}

.location-recent-pals {
  display: grid;
  gap: 8px;
}

.location-recent-pals[hidden] {
  display: none;
}

.location-recent-pals-title {
  color: var(--accent-2);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.location-recent-pals-list {
  display: grid;
  gap: 6px;
}

.location-recent-pal {
  width: 100%;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 8px;
  background: rgba(var(--bg-rgb), 0.24);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.location-recent-pal:hover,
.location-recent-pal:focus-visible {
  border-color: rgba(var(--line-rgb), 0.34);
  background: rgba(var(--surface-rgb), 0.72);
}

.location-recent-pal-content {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.location-recent-pal-content strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.location-filter-grid {
  display: grid;
  gap: 8px;
}

.location-control {
  width: 100%;
}

.location-source-toggles,
.location-time-toggles {
  display: grid;
  gap: 6px;
}

.location-time-toggles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.location-source-toggle,
.location-time-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(var(--line-rgb), 0.16);
  border-radius: 8px;
  background: rgba(var(--bg-rgb), 0.32);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
}

.location-source-toggle {
  justify-content: space-between;
  text-align: left;
}

.location-source-toggle:hover,
.location-source-toggle:focus-visible,
.location-time-toggle:hover,
.location-time-toggle:focus-visible {
  border-color: rgba(var(--line-rgb), 0.34);
  color: var(--ink);
}

.location-source-toggle[aria-pressed="true"],
.location-time-toggle[aria-pressed="true"] {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--ink);
}

.location-actions {
  display: flex;
  justify-content: flex-start;
}

.location-actions .button-quiet:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.location-map-panel {
  min-width: 0;
}

.location-map-panel-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 26px;
  margin-bottom: 10px;
}

.location-map-meta {
  display: none;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.location-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(var(--line-rgb), 0.2);
  border-radius: 8px;
  background: rgba(var(--bg-rgb), 0.42);
  color: var(--muted);
  cursor: pointer;
}

.location-sidebar-toggle:hover,
.location-sidebar-toggle:focus-visible {
  border-color: rgba(var(--line-rgb), 0.38);
  color: var(--ink);
}

.location-sidebar-toggle[aria-expanded="false"] {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--ink);
}

.location-sidebar-toggle-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1ch;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}

.location-map-viewport {
  position: relative;
  width: min(100%, calc(100vh - 270px), 920px);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), transparent 38%),
    rgba(var(--rail-rgb), 0.92);
  cursor: grab;
  touch-action: none;
}

.location-map-viewport.is-panning {
  cursor: grabbing;
}

.location-map-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

.location-map-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.location-map-image {
  object-fit: fill;
  user-select: none;
}

.location-map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  cursor: inherit;
}

.location-map-status {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 3;
  max-width: min(320px, calc(100% - 32px));
  padding: 11px 14px;
  border: 1px dashed rgba(var(--line-rgb), 0.22);
  border-radius: 8px;
  background: rgba(var(--bg-2-rgb), 0.9);
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.location-map-tooltip {
  position: absolute;
  z-index: 5;
  max-width: min(280px, calc(100% - 20px));
  padding: 10px 11px;
  border: 1px solid rgba(var(--line-rgb), 0.24);
  border-radius: 8px;
  background: rgba(var(--bg-rgb), 0.94);
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34);
}

.location-map-tooltip[hidden] {
  display: none;
}

.location-map-tooltip-head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 7px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.18);
}

.location-map-tooltip-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid rgba(var(--line-rgb), 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
}

.location-map-tooltip-icon img,
.location-map-tooltip-icon .icon-fallback {
  width: 100%;
  height: 100%;
}

.location-map-tooltip-icon img {
  object-fit: contain;
}

.location-map-tooltip-title {
  display: block;
  min-width: 0;
  color: var(--ink);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.location-map-tooltip-row {
  display: grid;
  grid-template-columns: minmax(58px, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.location-map-tooltip-row span:first-child {
  color: var(--accent-2);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
}

.location-map-tooltip-row span:last-child {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.location-map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: flex;
  gap: 6px;
  align-items: center;
}

.location-map-control {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(var(--line-rgb), 0.2);
  border-radius: 8px;
  background: rgba(var(--rail-rgb), 0.86);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.location-map-control:hover,
.location-map-control:focus-visible {
  border-color: rgba(var(--line-rgb), 0.38);
  background: rgba(var(--surface-rgb), 0.94);
}

.location-map-control:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.location-map-control-icon {
  width: 17px;
  height: 17px;
  display: block;
}

.breeding-calculator-results-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.breeding-calculator-results-head .module-title {
  margin: 3px 0 0;
}

.data-table.breeding-recipe-table.breeding-calculator-table {
  min-width: 760px;
}

.data-table.breeding-recipe-table.breeding-calculator-table:not(.breeding-equation-table) th,
.data-table.breeding-recipe-table.breeding-calculator-table:not(.breeding-equation-table) td {
  width: 33.333%;
}

.breeding-calculator-table td[rowspan] {
  vertical-align: top;
}

.breeding-path-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breeding-path-arrow {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(var(--line-rgb), 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  cursor: pointer;
}

.breeding-path-arrow svg {
  width: 20px;
  height: 20px;
}

.breeding-path-arrow:hover,
.breeding-path-arrow:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.72);
  color: var(--accent);
  outline: none;
}

.breeding-path-arrow:disabled {
  border-color: rgba(var(--line-rgb), 0.12);
  color: var(--muted-2);
  cursor: not-allowed;
  opacity: 0.45;
}

.breeding-path-counter {
  min-width: 220px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  text-align: center;
}

.data-table.breeding-recipe-table.breeding-shortest-table {
  min-width: 760px;
}

.data-table.breeding-recipe-table.breeding-shortest-table:not(.breeding-equation-table) th,
.data-table.breeding-recipe-table.breeding-shortest-table:not(.breeding-equation-table) td {
  width: 33.333%;
}

.breeding-planner-mode-switcher {
  margin-bottom: 12px;
}

.breeding-planner-target-grid {
  grid-template-columns: minmax(220px, 1fr);
}

.breeding-planner-required-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.breeding-planner-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.breeding-planner-summary-item {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(var(--line-rgb), 0.11);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
}

.breeding-planner-summary-item strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.96rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breeding-planner-summary-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.breeding-planner-table-wrap {
  max-height: min(640px, 70vh);
}

.breeding-equation-parent-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  min-width: 0;
}

.breeding-equation-parent-cell .breeding-parent-cell {
  flex: 0 1 auto;
  max-width: 100%;
}

.breeding-planner-required-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(var(--pal-gold-rgb), 0.28);
  border-radius: 999px;
  background: rgba(var(--pal-gold-rgb), 0.12);
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.breeding-planner-source-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(var(--pal-leaf-rgb), 0.28);
  border-radius: 999px;
  background: rgba(var(--pal-leaf-rgb), 0.12);
  color: var(--leaf-strong);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.data-table.breeding-recipe-table.breeding-equation-table {
  min-width: 900px;
}

.data-table.breeding-recipe-table.breeding-equation-table .breeding-equation-pal-col {
  width: calc((100% - 88px) / 3);
}

.data-table.breeding-recipe-table.breeding-equation-table .breeding-equation-operator-col {
  width: 44px;
}

.data-table.breeding-recipe-table.breeding-equation-table th:nth-child(1),
.data-table.breeding-recipe-table.breeding-equation-table td:nth-child(1),
.data-table.breeding-recipe-table.breeding-equation-table th:nth-child(3),
.data-table.breeding-recipe-table.breeding-equation-table td:nth-child(3),
.data-table.breeding-recipe-table.breeding-equation-table th:nth-child(5),
.data-table.breeding-recipe-table.breeding-equation-table td:nth-child(5) {
  width: calc((100% - 88px) / 3);
}

.data-table.breeding-recipe-table.breeding-equation-table .breeding-equation-operator-head,
.data-table.breeding-recipe-table.breeding-equation-table .breeding-equation-operator-cell {
  width: 44px;
  padding-left: 0;
  padding-right: 0;
  overflow: visible;
  text-align: center;
}

.data-table.breeding-recipe-table.breeding-equation-table thead th {
  text-align: center;
}

.breeding-equation-operator {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(var(--pal-gold-rgb), 0.24);
  border-radius: 999px;
  background: rgba(var(--pal-gold-rgb), 0.1);
  color: var(--gold);
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
}

@media (max-width: 860px) {
  .breeding-planner-required-grid,
  .breeding-planner-summary {
    grid-template-columns: 1fr;
  }
}

.preview-panel {
  min-width: 0;
}

.detail-copy {
  margin: 10px 0 0;
}

.wiki-entry {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.wiki-entry-head {
  margin-bottom: 12px;
}

.unit-entry-title {
  font-size: clamp(2.3rem, 4vw, 3.2rem);
  line-height: 1.06;
}

.wiki-entry-divider {
  height: 1px;
  margin-top: 4px;
  background: rgba(var(--line-rgb), 0.14);
}

.wiki-entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 392px);
  gap: 18px;
  align-items: start;
}

.detail-shell {
  min-width: 0;
}

.detail-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.pal-detail-section-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(280px, 1.15fr);
  gap: 12px;
  align-items: start;
}

.pal-detail-section-column {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.detail-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.wiki-infobox {
  position: sticky;
  top: 124px;
  display: grid;
  gap: 12px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid rgba(var(--line-rgb), 0.12);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.unit-infobox-header {
  display: grid;
  justify-items: center;
  text-align: center;
}

.unit-infobox-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.18rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.pal-infobox-portrait {
  width: 180px;
  height: 180px;
  justify-self: center;
}

.pal-infobox-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.unit-infobox-columns {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.unit-infobox-columns::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(var(--line-rgb), 0.1);
  transform: translateX(-50%);
  pointer-events: none;
}

.unit-infobox-column {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 0 8px;
}

.infobox-subsection {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(var(--line-rgb), 0.1);
}

.infobox-subsection--first {
  padding-top: 0;
  border-top: 0;
}

.infobox-list {
  display: grid;
  gap: 6px;
  margin: 0;
}

.infobox-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.infobox-row dt,
.infobox-row dd {
  margin: 0;
}

.infobox-row dt {
  color: var(--muted);
}

.infobox-row dd {
  color: var(--ink);
  font-weight: 700;
  text-align: right;
}

.infobox-row dd code {
  font-size: 0.8rem;
}

.preview-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.stat-tile {
  padding: 10px;
  border: 1px solid rgba(var(--line-rgb), 0.12);
  border-radius: 10px;
  background: var(--surface-2);
}

.stat-tile-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-tile-value {
  margin-top: 4px;
  font-family: var(--font-head);
  font-size: 1.08rem;
}

.inline-note,
.empty-state,
.loading-page,
.error-state {
  padding: 28px 18px;
  border: 1px dashed rgba(var(--line-rgb), 0.16);
  border-radius: 14px;
  background: rgba(var(--surface-2-rgb), 0.82);
  color: var(--muted);
  text-align: center;
}

.inline-note {
  padding: 12px 14px;
  text-align: left;
}

.inline-note--error {
  color: var(--ember-strong);
}

.module {
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.wiki-body-section {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid rgba(var(--line-rgb), 0.12);
  border-radius: 12px;
}

.module-head,
.section-head {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-note {
  font-size: 0.84rem;
}

.fact-list,
.active-skill-list,
.passive-skill-list,
.drop-list,
.partner-skill-levels {
  display: grid;
  gap: 8px;
  margin: 0;
}

.fact-row,
.active-skill-row,
.passive-skill-row,
.drop-row,
.partner-skill-level-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid rgba(var(--line-rgb), 0.12);
  border-radius: 10px;
  background: var(--surface-2);
}

.fact-row dt,
.fact-row dd,
.partner-skill-level-row dt,
.partner-skill-level-row dd {
  margin: 0;
}

.fact-row dt,
.partner-skill-level-row dt {
  color: var(--muted);
}

.fact-row dd,
.partner-skill-level-row dd {
  color: var(--ink);
  font-weight: 700;
}

.partner-skill-level-row dd {
  display: grid;
  gap: 3px;
  justify-items: end;
  text-align: right;
}

.partner-skill-level-part {
  display: block;
}

.partner-skill-level-label {
  color: var(--muted);
  font-weight: 600;
}

.partner-skill-card {
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(var(--line-rgb), 0.1), transparent 44%),
    radial-gradient(circle at 100% 0%, rgba(var(--accent-rgb), 0.1), transparent 46%),
    var(--surface-2);
}

.partner-skill-identity {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.partner-skill-rank-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.partner-skill-rank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  gap: 8px;
}

.partner-skill-rank-card {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(var(--line-rgb), 0.12);
  border-radius: 11px;
  background: rgba(var(--bg-rgb), 0.2);
}

.partner-skill-rank-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.partner-skill-metric-list {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.partner-skill-metric {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.partner-skill-metric-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.partner-skill-metric-value {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.15;
}

.drop-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  margin: 0;
}

.drop-tile {
  display: grid;
  gap: 8px;
  justify-items: center;
  align-content: start;
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(var(--line-rgb), 0.12), transparent 60%),
    var(--surface-2);
}

.drop-icon-frame {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(var(--line-rgb), 0.16);
  border-radius: 13px;
  background: rgba(var(--bg-rgb), 0.34);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.03);
}

.drop-icon {
  max-width: 46px;
  max-height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.drop-icon-fallback {
  color: var(--muted);
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 800;
}

.drop-tile-copy {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-width: 0;
  width: 100%;
  text-align: center;
}

.drop-name {
  min-width: 0;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.drop-meta {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.drop-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.active-skill-card-grid {
  display: grid;
  gap: 10px;
  margin: 0;
}

.active-skill-card {
  display: grid;
  gap: 11px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(var(--line-rgb), 0.13);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), transparent 42%),
    radial-gradient(circle at 100% 0%, rgba(var(--line-rgb), 0.11), transparent 42%),
    var(--surface-2);
}

.active-skill-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.active-skill-title-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.active-skill-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
}

.active-skill-title-cluster h3 {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.active-skill-element {
  justify-self: end;
  min-width: 0;
}

.active-skill-element .element-badge {
  min-width: 104px;
  min-height: 24px;
  font-size: 0.74rem;
}

.active-skill-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.active-skill-stat {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(var(--line-rgb), 0.11);
  border-radius: 10px;
  background: rgba(var(--bg-rgb), 0.18);
}

.active-skill-stat-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.active-skill-stat strong {
  color: var(--ink);
  font-weight: 800;
  line-height: 1;
}

.active-skill-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.passive-skill-row {
  display: inline-flex;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.passive-skill-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.passive-skill-rank-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.passive-skill-rank-icon-wrap::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  background: var(--passive-rank-color, #fff);
  -webkit-mask: var(--passive-rank-icon) center / contain no-repeat;
  mask: var(--passive-rank-icon) center / contain no-repeat;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.passive-skill-rank-icon {
  position: absolute;
  inset: 0;
  width: 24px;
  height: 24px;
  opacity: 0;
  image-rendering: pixelated;
}

.passive-rank-negative .passive-skill-rank-icon-wrap {
  transform: rotate(180deg);
}

.passive-skill-copy {
  min-width: 0;
}

.passive-skill-title-frame {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  isolation: isolate;
  min-height: 28px;
  margin: 0;
  padding: 4px 13px 4px 11px;
  overflow: hidden;
  border-left: 5px solid var(--passive-rank-left-border, rgba(255, 255, 255, 0.14));
  color: var(--passive-rank-text, var(--ink));
  box-shadow:
    inset 0 0 0 1px var(--passive-rank-border, rgba(255, 255, 255, 0.08)),
    inset 0 0 14px var(--passive-rank-glow, transparent);
}

.passive-skill-title-frame::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  pointer-events: none;
  border-radius: 0;
  background:
    linear-gradient(
      90deg,
      var(--passive-rank-surface, rgba(116, 98, 72, 0.44)),
      var(--passive-rank-surface-end, rgba(49, 43, 35, 0.3))
    ),
    linear-gradient(180deg, rgba(17, 17, 17, 0.53), rgba(17, 17, 17, 1)),
    var(--passive-skill-frame, none) center / 100% 100% no-repeat;
  opacity: 0.72;
}

.passive-rank-tier-3 .passive-skill-title-frame::before,
.passive-rank-tier-4 .passive-skill-title-frame::before {
  opacity: 0.96;
}

.passive-skill-copy h3 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.passive-skill-title-frame {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.passive-skill-name-text {
  position: relative;
  z-index: 1;
}

.passive-skill-title-frame > * {
  position: relative;
  z-index: 1;
}

.passive-skill-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.pal-summary-copy,
.partner-skill-copy {
  margin: 0;
}

.partner-skill-unlock-block {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--line-rgb), 0.12);
}

.partner-skill-unlock-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.unlock-requirement-grid {
  display: grid;
  gap: 10px;
}

.unlock-requirement-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.07), transparent 42%),
    rgba(var(--bg-rgb), 0.2);
}

.unlock-requirement-head {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.unlock-requirement-head h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1.03rem;
  letter-spacing: -0.01em;
  line-height: 1.16;
}

.unlock-requirement-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.unlock-requirement-stat {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(var(--line-rgb), 0.11);
  border-radius: 10px;
  background: rgba(var(--bg-rgb), 0.18);
}

.unlock-requirement-stat span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.unlock-requirement-stat strong {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 850;
  line-height: 1;
}

.acquisition-card {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(var(--line-rgb), 0.12), transparent 46%),
    rgba(var(--bg-rgb), 0.26);
}

.acquisition-card-head {
  display: grid;
  gap: 8px;
}

.acquisition-label {
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1.06rem;
  font-weight: 850;
  letter-spacing: -0.01em;
}

.acquisition-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.acquisition-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.acquisition-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.acquisition-stat {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(var(--line-rgb), 0.11);
  border-radius: 11px;
  background: rgba(var(--bg-rgb), 0.2);
}

.acquisition-stat-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.acquisition-stat strong {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1.1;
}

.acquisition-stat-detail {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.partner-skill-name {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}

.work-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 8px;
}

.work-detail-card {
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 84px;
  padding: 11px;
  border: 1px solid rgba(var(--line-rgb), 0.13);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.11), transparent 48%),
    rgba(var(--bg-rgb), 0.24);
}

.work-detail-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.work-detail-label {
  color: var(--ink);
  font-weight: 850;
  line-height: 1.15;
}

.work-detail-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.work-level-meter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.work-level-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.work-level-dot.is-active {
  background: rgba(var(--accent-rgb), 0.9);
}

.work-level--1 .work-level-dot.is-active {
  background: linear-gradient(135deg, #6aa889, #9fcf9a);
  box-shadow: 0 0 0 1px rgba(159, 207, 154, 0.28);
}

.work-level--2 .work-level-dot.is-active {
  background: linear-gradient(135deg, #58abc9, #8ed7e8);
  box-shadow: 0 0 0 1px rgba(142, 215, 232, 0.34), 0 0 8px rgba(88, 171, 201, 0.2);
}

.work-level--3 .work-level-dot.is-active {
  background: linear-gradient(135deg, #d2a34f, #f1d979);
  box-shadow: 0 0 0 1px rgba(241, 217, 121, 0.42), 0 0 10px rgba(210, 163, 79, 0.28);
}

.work-level--4 .work-level-dot.is-active {
  background: linear-gradient(135deg, #f06a52, #ffd36d);
  box-shadow: 0 0 0 1px rgba(255, 211, 109, 0.58), 0 0 13px rgba(240, 106, 82, 0.38);
}

.work-level-value {
  margin-left: 6px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-scroll {
  max-height: clamp(360px, 68vh, 820px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

.data-table {
  width: 100%;
  min-width: 1600px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.86rem;
}

.data-table.breeding-recipe-table {
  min-width: 560px;
  table-layout: fixed;
}

.breeding-recipe-table th:nth-child(1),
.breeding-recipe-table td:nth-child(1),
.breeding-recipe-table th:nth-child(2),
.breeding-recipe-table td:nth-child(2) {
  width: 50%;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 0;
  background: rgba(var(--surface-rgb), 0.98);
  border-bottom: 1px solid rgba(var(--line-rgb), 0.14);
  text-align: left;
}

.table-header-label {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 8px;
  border-right: 1px solid rgba(var(--line-rgb), 0.08);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.table-header--image .table-header-label {
  justify-content: center;
  padding-left: 6px;
  padding-right: 6px;
}

.table-sort {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-right: 1px solid rgba(var(--line-rgb), 0.08);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.table-sort-label {
  display: inline-flex;
  align-items: center;
}

.data-table thead th:last-child .table-sort {
  border-right: 0;
}

.data-table thead th:last-child .table-header-label {
  border-right: 0;
}

.table-header--number .table-sort {
  justify-content: center;
  gap: 6px;
  padding-left: 8px;
  padding-right: 8px;
}

.table-header--work-suitability .table-header-label {
  padding-left: 10px;
  padding-right: 10px;
}

.table-sort:hover,
.table-sort:focus-visible,
.table-sort.is-active {
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
}

.sort-indicator {
  color: var(--muted-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1em;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
}

.table-sort.is-active .sort-indicator {
  color: var(--accent-strong);
}

.data-row {
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.data-row:hover,
.data-row:focus-visible {
  background: rgba(var(--surface-2-rgb), 0.76);
}

.data-row.is-selected {
  background: rgba(var(--accent-rgb), 0.1);
  box-shadow: inset 3px 0 0 rgba(var(--accent-rgb), 0.56);
}

.data-table td,
.data-table tbody th {
  padding: 9px 10px;
  border-top: 1px solid rgba(var(--line-rgb), 0.08);
  color: var(--ink);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
}

.data-table tbody tr:first-child td,
.data-table tbody tr:first-child th {
  border-top: 0;
}

.is-sticky {
  position: sticky;
  left: 0;
  z-index: 2;
}

.data-table thead .is-sticky {
  z-index: 6;
}

.data-table tbody .is-sticky {
  background: inherit;
}

.image-column {
  width: 50px;
  padding-left: 6px;
  padding-right: 4px;
  text-align: center;
}

.image-column .pal-icon-frame {
  margin-left: auto;
  margin-right: auto;
}

.pal-cell-copy {
  min-width: 0;
}

.name-column {
  min-width: 220px;
  padding-left: 6px;
  text-align: left;
  vertical-align: middle;
}

.element-column {
  white-space: normal !important;
  text-align: left;
}

.pal-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 700;
}

.numeric-cell,
.number-column {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.data-table td.stat-tooltip-cell {
  position: relative;
  overflow: visible;
}

.data-table td.stat-tooltip-cell:hover,
.data-table td.stat-tooltip-cell:focus-within {
  z-index: 8;
}

.stat-tooltip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  cursor: help;
  transition: background 140ms ease, color 140ms ease;
}

.stat-tooltip-trigger:hover,
.stat-tooltip-trigger:focus-visible {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--ink-strong);
}

.stat-cell-value {
  position: relative;
  z-index: 1;
}

.stat-tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  z-index: 50;
  display: grid;
  width: 232px;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(var(--line-rgb), 0.2);
  border-radius: 13px;
  background:
    radial-gradient(circle at 82% 12%, rgba(var(--accent-rgb), 0.14), transparent 34%),
    rgba(var(--bg-rgb), 0.98);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  color: var(--ink);
  text-align: left;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -5px) scale(0.98);
  transition: opacity 140ms ease, transform 140ms ease;
}

.stat-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 10px;
  height: 10px;
  border-top: 1px solid rgba(var(--line-rgb), 0.2);
  border-left: 1px solid rgba(var(--line-rgb), 0.2);
  background: rgba(var(--bg-rgb), 0.98);
  transform: translateX(-50%) rotate(45deg);
}

.stat-tooltip-trigger:hover .stat-tooltip,
.stat-tooltip-trigger:focus-visible .stat-tooltip {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.stat-tooltip-trigger--infobox {
  min-width: 0;
  min-height: 0;
  padding: 0;
  line-height: inherit;
}

.stat-tooltip-trigger--infobox .stat-cell-value {
  text-decoration: underline dotted rgba(var(--accent-rgb), 0.85);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.stat-tooltip-trigger--infobox .stat-tooltip {
  left: auto;
  right: 0;
  transform: translateY(-5px) scale(0.98);
}

.stat-tooltip-trigger--infobox:hover .stat-tooltip,
.stat-tooltip-trigger--infobox:focus-visible .stat-tooltip {
  transform: translateY(0) scale(1);
}

.stat-tooltip-trigger--infobox .stat-tooltip::after {
  left: auto;
  right: 18px;
  transform: rotate(45deg);
}

.stat-tooltip-head,
.stat-tooltip-meta,
.stat-tooltip-range {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-tooltip-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat-tooltip-value {
  color: var(--ink-strong);
  font-size: 1.12rem;
}

.stat-tooltip-meta,
.stat-tooltip-range {
  color: var(--muted);
  font-size: 0.72rem;
}

.stat-tooltip-meta span:first-child {
  color: var(--accent-strong);
  font-weight: 800;
}

.stat-tooltip-scale {
  position: relative;
  display: block;
  height: 16px;
  margin: 1px 2px;
}

.stat-tooltip-track {
  position: absolute;
  top: 7px;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(var(--pal-gold-rgb), 0.22), rgba(var(--accent-rgb), 0.72) 62%, rgba(var(--accent-rgb), 0.86));
}

.stat-tooltip-marker {
  position: absolute;
  top: 1px;
  left: var(--stat-marker);
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink-strong);
  border-radius: 999px;
  background: var(--focus);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
  transform: translateX(-50%);
}

.stat-tooltip-range span:nth-child(2) {
  color: var(--muted);
}

.work-suitability-column {
  min-width: 240px;
  white-space: normal;
  text-align: left;
}

.work-suitability-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.work-suitability-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.14);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  color: var(--accent-strong);
  font-size: 0.75rem;
  line-height: 1;
}

.work-suitability-level {
  color: var(--accent-strong);
  font-weight: 700;
}

.work-suitability-empty {
  color: var(--muted);
}

.search-hit {
  padding: 0 0.08em;
  border-radius: 0.2em;
  background: rgba(var(--pal-gold-rgb), 0.22);
  color: var(--ink-strong);
}

.loading-page {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.loading-rune {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 2px solid rgba(var(--line-rgb), 0.14);
  border-top-color: var(--accent);
  animation: spin 850ms linear infinite;
}

.items-page-head {
  margin-bottom: 14px;
}

.item-type-panel {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(var(--surface-rgb), 0.95);
  border: 1px solid rgba(var(--line-rgb), 0.12);
  border-radius: 14px;
}

.content-mode-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 3px;
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 8px;
  background: rgba(var(--bg-rgb), 0.42);
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.item-type-tabs.content-mode-switcher {
  width: 100%;
}

.content-mode-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(var(--line-rgb), 0.08);
  border-radius: 6px;
  background: rgba(var(--rail-rgb), 0.86);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  transition: background 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.content-mode-option strong {
  color: var(--accent);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.content-mode-option:hover,
.content-mode-option:focus-visible {
  background: rgba(var(--surface-2-rgb), 0.92);
  color: var(--ink);
  outline: none;
}

.content-mode-option.is-active {
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.18), rgba(var(--pal-teal-rgb), 0.12));
  border-color: rgba(var(--accent-rgb), 0.42);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.18);
  color: var(--ink);
}

.items-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 14px;
  align-items: start;
}

.items-page--detail .items-layout {
  grid-template-columns: minmax(0, 1fr);
}

.items-table-panel {
  min-width: 0;
}

.item-data-table {
  min-width: 1040px;
}

.item-table-name-cell {
  text-align: left;
}

.item-table-name {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.items-list-panel {
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 132px);
  overflow: auto;
  padding: 10px;
}

.items-list {
  display: grid;
  gap: 8px;
}

.item-list-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 8px;
  border: 1px solid rgba(var(--line-rgb), 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.item-list-card:hover,
.item-list-card:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.12);
  outline: none;
}

.item-list-card.is-selected {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: rgba(var(--accent-rgb), 0.16);
}

.item-icon-frame {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.item-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.item-list-copy,
.item-pal-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.item-list-copy strong,
.item-pal-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-list-copy span,
.item-pal-copy span,
.item-tech-card span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.items-detail {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 104px;
}

.items-page--detail .items-detail {
  position: static;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.item-detail-toolbar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.item-detail-back {
  justify-self: start;
}

.wiki-entry-layout--item {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
}

.item-detail-main {
  gap: 14px;
}

.item-detail-infobox {
  align-self: start;
}

.item-detail-infobox .unit-infobox-columns {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.item-detail-infobox .unit-infobox-columns::before {
  display: none;
}

.item-detail-infobox .unit-infobox-column {
  padding: 0;
}

.item-detail-infobox .infobox-row {
  grid-template-columns: minmax(96px, 0.8fr) minmax(0, 1.2fr);
}

.item-detail-infobox .infobox-row dd {
  overflow-wrap: anywhere;
}

.item-infobox-icon {
  width: 132px;
  height: 132px;
  justify-self: center;
  border-radius: 10px;
}

.item-infobox-icon .item-icon {
  width: 108px;
  height: 108px;
}

.item-detail-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.items-page--detail .item-detail-head {
  grid-template-columns: 84px minmax(0, 1fr);
}

.item-detail-icon {
  width: 64px;
  height: 64px;
}

.item-detail-icon .item-icon {
  width: 52px;
  height: 52px;
}

.items-page--detail .item-detail-icon {
  width: 84px;
  height: 84px;
}

.items-page--detail .item-detail-icon .item-icon {
  width: 70px;
  height: 70px;
}

.item-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.item-stat-card {
  display: grid;
  grid-template-columns: minmax(92px, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(var(--line-rgb), 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.item-stat-card strong {
  color: var(--accent);
  font-size: 1rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.item-stat-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.item-detail-section {
  display: grid;
  gap: 10px;
}

.item-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.1);
}

.item-section-head h3 {
  margin: 0;
  font-size: 0.92rem;
}

.item-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}

.item-pal-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(var(--line-rgb), 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  text-decoration: none;
}

.item-pal-card:hover,
.item-pal-card:focus-visible {
  border-color: rgba(var(--line-rgb), 0.26);
  background: rgba(var(--accent-rgb), 0.1);
  outline: none;
}

.item-tech-list {
  display: grid;
  gap: 8px;
}

.item-effect-list {
  display: grid;
  gap: 8px;
}

.item-effect-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(var(--line-rgb), 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.item-effect-card strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.item-effect-card span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.item-tech-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(var(--line-rgb), 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.workspace-footer {
  margin-top: 28px;
}

.workspace-footer-row {
  justify-content: center;
  gap: 12px 16px;
  width: 100%;
}

.workspace-footer-links {
  justify-content: center;
}

.workspace-footer-meta {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: nowrap;
  text-align: center;
}

.meta-pill:hover,
.meta-pill:focus-visible {
  border-color: rgba(var(--line-rgb), 0.22);
  background: rgba(var(--accent-rgb), 0.2);
  color: var(--ink);
  transform: translateY(-1px);
}

.meta-pill.meta-pill--muted:hover,
.meta-pill.meta-pill--muted:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1220px) {
  .wiki-main-header {
    grid-template-columns: 1fr;
  }

  .breeding-recipes-layout {
    grid-template-columns: 1fr;
  }

  .location-layout {
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  }

  .items-layout {
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  }

  .breeding-target-panel {
    position: static;
    max-height: none;
  }

  .wiki-entry-layout {
    grid-template-columns: 1fr;
  }

  .wiki-infobox {
    position: static;
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(var(--line-rgb), 0.1);
  }

  .rail-panel--nav {
    gap: 10px;
  }

  .rail-menu-toggle {
    display: flex;
  }

  .rail-nav[data-collapsed="true"] {
    display: none;
  }

  .toolbar-shell {
    top: 10px;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 12px 12px 24px;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-brand {
    display: none;
  }

  .toolbar-main,
  .toolbar-actions {
    width: 100%;
  }

  .toolbar-main {
    flex-wrap: wrap;
    overflow: visible;
  }

  .toolbar-main .toolbar-actions {
    margin-left: 0;
  }

  .toolbar-meta,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-start-panel {
    grid-template-columns: 1fr;
  }

  .control-group {
    width: 100%;
  }

  .detail-module-grid,
  .pal-detail-section-grid,
  .unit-infobox-columns {
    grid-template-columns: 1fr;
  }

  .active-skill-card-head {
    grid-template-columns: 1fr;
  }

  .active-skill-element {
    justify-self: start;
  }

  .active-skill-stat-grid {
    grid-template-columns: 1fr;
  }

  .breeding-detail-title-row {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .breeding-detail-icon {
    width: 58px;
    height: 58px;
  }

  .breeding-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .breeding-calculator-grid {
    grid-template-columns: 1fr;
  }

  .location-layout {
    grid-template-columns: 1fr;
  }

  .items-layout,
  .item-stat-grid {
    grid-template-columns: 1fr;
  }

  .items-list-panel {
    position: static;
    max-height: none;
  }

  .items-detail {
    position: static;
  }

  .breeding-calculator-results-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .partner-skill-rank-grid {
    grid-template-columns: 1fr;
  }

  .unit-infobox-columns::before {
    display: none;
  }

  .pal-infobox-portrait {
    width: 150px;
    height: 150px;
  }

  .workspace-footer-row,
  .workspace-footer-links {
    justify-content: center;
  }
}
