.topbar-nav {
  display: inline-flex;
  gap: 6px;
}

.filter-counter {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.detail {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 24px 0;
}

/* A dual type puts its second colour behind the artwork; the text stays on
   the first colour, whose ink (--tink) it uses. */
.hero {
  --tc: var(--type-normal);
  --tc2: var(--tc);
  --tink: var(--ink-black);
  --tink2: var(--tink);
  --hink: var(--tink);
  --hbg: var(--tc);
  --split: 105deg, var(--tc) 0 50%, var(--tc2) 62% 100%;
  --split-dark: 105deg, color-mix(in oklab, var(--tc) 84%, black) 0 50%, color-mix(in oklab, var(--tc2) 84%, black) 62% 100%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 28px;
  color: var(--hink);
  background:
    radial-gradient(70% 90% at 78% 42%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 70%),
    linear-gradient(var(--split));
}

html.dark-mode .hero {
  background:
    radial-gradient(70% 90% at 78% 42%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 70%),
    linear-gradient(var(--split-dark));
}

/* Top right sits on the second colour in the two-column layout. */
.hero-share {
  --hink: var(--tink2);
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--hink) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hink) 22%, transparent);
  color: var(--hink);
  cursor: pointer;
  transition: background-color 0.15s;
}

.hero-share .icon {
  width: 19px;
  height: 19px;
}

.hero-share:hover {
  background: color-mix(in srgb, var(--hink) 24%, transparent);
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  right: 3%;
  width: 470px;
  height: 470px;
  margin-top: -255px;
  background: var(--hink);
  opacity: 0.09;
  -webkit-mask: var(--pokeball) center / contain no-repeat;
  mask: var(--pokeball) center / contain no-repeat;
  transform: rotate(-16deg);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "head art"
    "actions art";
  align-items: center;
  column-gap: 32px;
  min-height: 440px;
  padding: 44px 52px 84px;
}

.hero-head {
  grid-area: head;
  align-self: end;
  min-width: 0;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.dex-no {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.hero-gen {
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--hink) 14%, transparent);
  font-size: 12px;
  font-weight: 800;
}

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 4.6vw, 58px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.pokemon-genus {
  margin: 8px 0 0;
  font-size: 17px;
  font-weight: 600;
  opacity: 0.8;
}

.hero-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero .tag {
  height: 34px;
  padding: 0 16px 0 10px;
  gap: 7px;
  font-size: 12.5px;
  background: color-mix(in srgb, var(--hink) 16%, transparent);
  color: var(--hink);
  text-shadow: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hink) 22%, transparent);
}

.hero .tag::before {
  width: 20px;
  height: 20px;
  filter: none;
}

.hero-actions {
  grid-area: actions;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 26px;
}

.form-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
}

.form-picker label {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.8;
}

.hero .select-wrap {
  color: var(--hink);
}

.hero .select-wrap select {
  min-width: 220px;
  border: none;
  background: color-mix(in srgb, var(--hink) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hink) 22%, transparent);
  color: var(--hink);
  font-weight: 700;
}

.hero .select-wrap select option {
  color: var(--text);
  background: var(--surface);
}

.image-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--hink) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hink) 22%, transparent);
  color: var(--hink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.hero-btn .icon {
  width: 17px;
  height: 17px;
}

.hero-btn:hover {
  background: color-mix(in srgb, var(--hink) 24%, transparent);
}

.hero-btn.active {
  background: var(--hink);
  color: var(--hbg);
}

.hero-art {
  grid-area: art;
  position: relative;
  display: grid;
  place-items: center;
}

#pokemon-artwork {
  width: min(100%, 380px);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 22px 26px rgba(0, 0, 0, 0.25));
}

/* Animated and game sprites are small images: enlarge them to fill most of
   the artwork's space, keeping their pixels sharp. */
#pokemon-artwork[src$=".gif"],
#pokemon-artwork[src*="/sprites/pokemon/"]:not([src*="/other/"]) {
  padding: 4%;
  image-rendering: pixelated;
}

.detail-body {
  position: relative;
  margin-top: -48px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.card-row > .card {
  flex: 1 1 400px;
}

.matchups-list {
  display: flex;
  flex-direction: column;
}

.mu-group {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 10px 12px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.mu-group:first-child {
  padding-top: 0;
  border-top: none;
}

.mu-group:last-child {
  padding-bottom: 0;
}

.mu-label {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.mu-label::before {
  content: "";
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--weak);
}

.mu-resist .mu-label::before {
  background: var(--resist);
}

.mu-immune .mu-label::before {
  background: var(--immune);
}

.mu-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.mu-chip {
  height: 36px;
  padding: 0 5px 0 8px;
  gap: 6px;
  font-size: 11.5px;
}

.mu-chip::before {
  width: 19px;
  height: 19px;
}

.mu-x {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 26px;
  margin-left: 2px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: none;
  text-transform: none;
}

.mu-chip.x4 {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--weak);
}

.mu-chip.x4 .mu-x {
  background: var(--weak);
  color: #fff;
}

.mu-none {
  display: flex;
  align-items: center;
  height: 36px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.ability-notes {
  list-style: none;
  margin: 18px 0 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-2);
}

.ability-notes:empty {
  display: none;
}

.ability-notes li {
  display: flex;
  gap: 8px;
}

.ability-notes li::before {
  content: "!";
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--text);
  color: var(--surface);
  font-size: 11px;
  font-weight: 800;
}

.ability-notes b {
  color: var(--text);
}

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

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.stats-table th {
  width: 70px;
  padding: 7px 0;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.stats-table .stat-num {
  width: 52px;
  padding: 7px 14px 7px 0;
  text-align: right;
  font-size: 15px;
  font-weight: 800;
}

.stat-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.stat-value {
  height: 100%;
  border-radius: 999px;
}

.bst-row th,
.bst-row td {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  vertical-align: baseline;
}

.bst-row th {
  font-weight: 800;
  color: var(--text);
}

.bst-value {
  font-size: 18px !important;
}

.evolution-chain {
  overflow-x: auto;
  padding-bottom: 4px;
}

.evo-row {
  display: flex;
  align-items: center;
  width: max-content;
  margin: 0 auto;
}

.evo-step,
.evo-battle-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px;
  border-radius: 18px;
  color: var(--text);
  text-decoration: none;
}

.evo-step img,
.evo-battle-step img {
  width: 100px;
  height: 100px;
  padding: 11px;
  object-fit: contain;
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: transform 0.18s ease, background-color 0.15s;
}

.evo-step:hover img,
.evo-battle-step:hover img {
  transform: scale(1.06);
  background: var(--surface-3);
}

.evo-step span,
.evo-battle-step span {
  max-width: 120px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.evo-step.current img {
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent);
}

.evo-step.current span {
  color: var(--accent);
}

/* Battle-only forms (Mega/Gmax/…): temporary transformations, shown with a
   bidirectional arrow and a dashed outline to set them apart from evolutions. */
.evo-battle-step {
  border: 1.5px dashed var(--border-strong);
  background: none;
  cursor: pointer;
}

.evo-battle-step img {
  width: 90px;
  height: 90px;
}

.evo-battle-step:hover {
  border-color: var(--muted);
}

.evo-battle-step.current {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.evo-battle-step.current span {
  color: var(--accent);
}

.evo-forms-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 999px;
  border: 2px solid var(--surface);
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.evo-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 76px;
  padding: 0 4px;
  color: var(--muted);
}

.evo-arrow .icon {
  width: 22px;
  height: 22px;
}

.evo-trigger {
  display: inline-block;
  max-width: 124px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.evo-trigger::first-letter {
  text-transform: uppercase;
}

.evo-branch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.evo-branch:has(> .evo-branch-row:nth-child(5)) {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 4px 12px;
}

.evo-branch-row {
  display: flex;
  align-items: center;
}

/* Fixed-width leading arrow so branch nodes (e.g. Slowbro / Slowking) line up
   vertically regardless of trigger-text length. */
.evo-branch-row > .evo-arrow:first-child {
  width: 120px;
}

.no-evolution {
  margin: 8px 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.forms-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.forms-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.forms-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.form-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 100px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.form-step:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.form-step.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.form-step img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.form-step span {
  max-width: 124px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.ability-list {
  display: flex;
  flex-direction: column;
}

.ability {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.ability:first-child {
  padding-top: 0;
  border-top: none;
}

.ability:last-child {
  padding-bottom: 0;
}

.ability-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 800;
}

.hidden-ability {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ability-desc {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}

.profile {
  container-type: inline-size;
}

.profile-grid {
  display: grid;
  gap: 0 28px;
}

@container (min-width: 520px) {
  .profile-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.info-list {
  margin: 0;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.info-row dt {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.info-row dd {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.info-gender dd {
  flex: 0 1 170px;
}

.gender-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-3);
}

.gender-bar .male {
  background: var(--male);
}

.gender-bar .female {
  background: var(--female);
}

.gender-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 12.5px;
}

.gender-icon.male {
  color: var(--male);
}

.gender-icon.female {
  color: var(--female);
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "head"
      "art"
      "actions";
    min-height: 0;
    padding: 32px 32px 76px;
    text-align: center;
  }

  .hero {
    --split: 180deg, var(--tc) 0 30%, var(--tc2) 46% 100%;
    --split-dark: 180deg, color-mix(in oklab, var(--tc) 84%, black) 0 30%, color-mix(in oklab, var(--tc2) 84%, black) 46% 100%;
  }

  /* Stacked layout: the buttons sit on the second colour, the top on the first. */
  .hero-actions {
    --hink: var(--tink2);
    --hbg: var(--tc2);
    color: var(--hink);
  }

  .hero-share {
    --hink: var(--tink);
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
  }

  .hero::before {
    top: 150px;
    left: 50%;
    right: auto;
    width: 380px;
    height: 380px;
    margin: 0 0 0 -190px;
  }

  .hero-kicker,
  .hero-types,
  .image-controls,
  .form-picker {
    justify-content: center;
  }

  .hero-actions {
    align-items: center;
    margin-top: 6px;
  }

  #pokemon-artwork {
    width: min(76%, 320px);
  }
}

@media (max-width: 1040px) {
  .evolution-chain {
    overflow-x: visible;
  }

  .evo-row {
    flex-direction: column;
    width: auto;
  }

  .evo-arrow {
    padding: 2px 0;
  }

  .evo-arrow .icon {
    transform: rotate(90deg);
  }

  .evo-branch,
  .evo-branch:has(> .evo-branch-row:nth-child(5)) {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 8px 4px;
  }

  .evo-branch-row {
    flex-direction: column;
  }

  .evo-branch-row > .evo-arrow:first-child {
    width: auto;
  }
}

@media (max-width: 640px) {
  .detail {
    padding: 0;
  }

  .hero {
    border-radius: 0;
  }

  .hero-inner {
    padding: 22px 16px 64px;
  }

  .hero::before {
    top: 120px;
    width: 300px;
    height: 300px;
    margin-left: -150px;
  }

  .dex-no {
    font-size: 14px;
  }

  .pokemon-genus {
    margin-top: 6px;
    font-size: 15px;
  }

  .hero-types {
    margin-top: 14px;
  }

  #pokemon-artwork {
    width: min(64%, 240px);
  }

  .hero-actions {
    width: 100%;
  }

  .form-picker {
    width: 100%;
  }

  .form-picker .select-wrap {
    flex: 1;
  }

  .hero .select-wrap select {
    min-width: 0;
  }

  .hero-btn {
    height: 38px;
    padding: 0 14px;
  }

  .detail-body {
    margin-top: -36px;
    padding: 0 10px;
    gap: 12px;
  }

  .card-row {
    gap: 12px;
  }

  .card-row > .card {
    flex-basis: 100%;
  }

  .mu-group {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .mu-label {
    height: auto;
  }

  .mu-chip {
    height: 34px;
  }

  .evo-step,
  .evo-battle-step {
    padding: 6px;
  }

  .evo-step img,
  .evo-battle-step img {
    width: 84px;
    height: 84px;
    padding: 9px;
  }

  .evo-step span,
  .evo-battle-step span {
    max-width: 100px;
    font-size: 12.5px;
  }

  .evo-arrow {
    min-width: 56px;
  }

  .evo-trigger {
    max-width: 100px;
    font-size: 11px;
  }

  .form-step {
    min-width: 92px;
  }

}

html {
  scroll-padding-top: calc(var(--topbar-h) + 84px);
}

.context-bar {
  position: sticky;
  top: calc(var(--topbar-h) + 10px);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 7px 7px 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.context-game {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.context-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.context-game .select-wrap {
  min-width: 0;
}

.context-bar select {
  height: 38px;
  max-width: 300px;
  font-weight: 700;
}

.section-links {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.section-links a {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}

.section-links a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.section-links a.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.jump-wrap {
  display: none;
}

.game-note {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.era-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: -4px 0 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}

.era-note .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--muted);
}

.offense {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sub-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.offense-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  gap: 6px 12px;
  padding: 6px 0;
}

.offense-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}

.offense-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chart-link-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.chart-link-inline .icon {
  width: 15px;
  height: 15px;
}

.chart-link-inline:hover span {
  text-decoration: underline;
}

.moves-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.moves-tab {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 8px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.moves-tab .count {
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
}

.moves-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.moves-tab.active .count {
  background: var(--accent-soft);
  color: var(--accent);
}

.moves-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.moves-table th {
  padding: 0 8px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
}

.moves-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}

.moves-table tbody tr:last-child td {
  border-bottom: none;
}

.moves-table tbody tr:hover td {
  background: var(--surface-2);
}

.mv-lv {
  width: 64px;
  font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
}

.mv-name {
  font-weight: 700;
}

.mv-type {
  width: 108px;
}

.mv-type .tag {
  height: 22px;
  padding: 0 8px 0 4px;
  font-size: 10px;
}

.mv-type .tag::before {
  width: 14px;
  height: 14px;
}

.mv-cat {
  width: 48px;
}

.moves-table .mv-num {
  width: 52px;
  text-align: right;
  font-weight: 600;
}

.cat {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.cat svg {
  width: 16px;
  height: 16px;
}

.cat-physical {
  background: #fde4d8;
  color: #e4572e;
}

.cat-special {
  background: #dfe8fd;
  color: #3867d6;
}

.cat-status {
  background: var(--surface-3);
  color: var(--muted);
}

html.dark-mode .cat-physical {
  background: rgba(228, 87, 46, 0.2);
  color: #ff8a65;
}

html.dark-mode .cat-special {
  background: rgba(56, 103, 214, 0.24);
  color: #8fb0f5;
}

.loc-version + .loc-version {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.loc-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.loc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.loc:last-child {
  border-bottom: none;
}

.loc-area {
  font-size: 14px;
  font-weight: 700;
}

.loc-detail {
  font-size: 13px;
  color: var(--text-2);
}

details.more {
  margin-top: 6px;
}

details.more > summary {
  padding: 6px 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

details.more > summary::-webkit-details-marker {
  display: none;
}

details.more > summary::after {
  content: " ▾";
}

details.more[open] > summary::after {
  content: " ▴";
}

.entry {
  margin: 0 0 14px;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
}

.entry p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-2);
}

.entry footer {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.entry-list {
  margin-top: 12px;
}

.entry-list .entry {
  border-left-color: var(--border-strong);
}

.empty-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14px;
  color: var(--muted);
}

.empty-note + .entry {
  margin-top: 14px;
}

.unit-alt {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.info-catch dd {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.catch-chance {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .section-links {
    display: none;
  }

  .jump-wrap {
    display: inline-flex;
    margin-left: auto;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: calc(var(--topbar-h) + 72px);
  }

  .context-bar {
    top: calc(var(--topbar-h) + 6px);
    gap: 8px;
    padding: 6px;
    border-radius: 14px;
  }

  .context-label {
    padding-left: 6px;
  }

  .context-label span {
    display: none;
  }

  .context-game {
    flex: 1 1 auto;
    gap: 6px;
  }

  .context-game .select-wrap {
    flex: 1 1 auto;
  }

  .context-bar select {
    max-width: none;
  }

  .jump-wrap {
    flex: 0 0 132px;
  }

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

  .moves-tab {
    gap: 4px;
    padding: 0 4px;
    font-size: 12px;
  }

  .moves-table th,
  .moves-table td {
    padding-left: 4px;
    padding-right: 4px;
  }

  .moves-table td {
    font-size: 13px;
  }

  .mv-pp {
    display: none;
  }

  .mv-lv {
    width: 42px;
  }

  .mv-type,
  .mv-cat {
    width: 30px;
  }

  .moves-table th.mv-type,
  .moves-table th.mv-cat {
    font-size: 0;
  }

  .mv-type .tag {
    width: 22px;
    padding: 0;
    gap: 0;
    justify-content: center;
    font-size: 0;
  }

  .cat {
    width: 24px;
    height: 24px;
  }

  .moves-table .mv-num {
    width: 38px;
  }
}

.stat-extras {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
}

.stat-extras div {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.stat-extras dt {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.stat-extras dd {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 700;
}

.empty-hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.empty-hint .link-btn {
  padding: 0;
  font-size: 13px;
}

/* Type chart page */
.chart-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chart-hero h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.chart-intro {
  max-width: 640px;
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--text-2);
}

.calc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.calc-head select {
  height: 38px;
  max-width: 300px;
  font-weight: 700;
}

.type-picker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.type-pick {
  height: 34px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, box-shadow 0.15s;
}

.type-picker.has-pick .type-pick:not([aria-pressed="true"]) {
  opacity: 0.45;
}

.type-pick[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--tc);
}

.type-pick:disabled {
  opacity: 0.2 !important;
  cursor: not-allowed;
}

.calc-result {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.calc-empty {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.type-chart {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 2px;
}

.type-chart th,
.type-chart td {
  height: 32px;
  padding: 0;
  border-radius: 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.type-chart td {
  background: var(--surface-2);
}

.type-chart .tc-x2 {
  background: #16a34a;
  color: #fff;
}

.type-chart .tc-x05 {
  background: #e11d48;
  color: #fff;
}

.type-chart .tc-x0 {
  background: #334155;
  color: #fff;
}

.type-chart td.sel:not([class*="tc-x"]) {
  background: var(--accent-soft);
}

.type-chart th.sel .tc-icon {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}

.tc-corner {
  width: 32px;
}

.tc-icon {
  width: 24px;
  height: 24px;
  padding: 0;
  gap: 0;
  justify-content: center;
  vertical-align: middle;
  font-size: 0;
}

.tc-icon::before {
  width: 16px;
  height: 16px;
}

@media (max-width: 640px) {
  .chart-main {
    padding: 18px 10px 0;
    gap: 12px;
  }

  .chart-hero {
    padding: 0 6px;
  }

  .chart-intro {
    font-size: 14px;
  }

  .type-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .type-pick {
    height: 32px;
    font-size: 10.5px;
  }

  .chart-card {
    padding: 16px 8px;
  }

  .chart-card .card-head {
    padding: 0 8px;
  }

  .type-chart {
    border-spacing: 1px;
  }

  .type-chart th,
  .type-chart td {
    height: 20px;
    border-radius: 3px;
    font-size: 9px;
  }

  .tc-corner {
    width: 16px;
  }

  .tc-icon {
    width: 14px;
    height: 14px;
  }

  .tc-icon::before {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 360px) {
  .type-pick {
    gap: 3px;
    padding: 0 6px 0 4px;
    font-size: 10px;
    letter-spacing: 0.02em;
  }

  .type-pick::before {
    width: 14px;
    height: 14px;
  }
}
