* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f3f4f6;
  color: #111827;
  overflow-x: hidden;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.page-title {
  font-size: 2.8rem;
  margin: 0 0 24px;
  color: #111827;
  text-align: center;
}

.page-title-image-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0 1rem;
}

.page-title-image {
  width: min(700px, 78vw);
  height: auto;
  display: block;
}

h2 {
  margin: 0 0 12px;
  color: #111827;
}

/* Pokemon page filters */

.pokemon-page-filter-sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 0 10px;
}

.pokemon-page-filter-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  align-items: end;
  gap: 12px;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.pokemon-page-filter-field {
  display: flex;
  flex: 0 0 auto;
  min-width: 220px;
  flex-direction: column;
  gap: 6px;
}

.pokemon-page-filter-field label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #374151;
}

.pokemon-page-filter-sort-field {
  flex: 0 0 auto;
  min-width: 260px;
}

.pokemon-page-filter-field input,
.pokemon-page-filter-field select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  background: white;
}

.pokemon-page-filter-field input:focus,
.pokemon-page-filter-field select:focus,
.mini-dropdown-search:focus {
  outline: none;
  border-color: #9ca3af;
}

.pokemon-page-filter-help {
  margin: 12px 4px 20px;
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Generic cards */

.card {
  display: block;
  background: white;
  padding: 20px;
  border-radius: 16px;
  color: inherit;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  margin-bottom: 20px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.card p {
  margin: 10px 0;
  line-height: 1.4;
}

ul {
  padding-left: 20px;
}

/* Pokemon list */

.pokemon-row-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.pokemon-row-card {
  background: white;
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.15s ease;
  align-self: start;
  content-visibility: auto;
  contain-intrinsic-size: 560px;
  min-width: 0;
  max-width: 100%;
}

.pokemon-row-card:hover {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.pokemon-row-card.is-filter-hidden {
  display: none !important;
}

.pokemon-variant-panel {
  display: none;
}

.pokemon-variant-panel.is-active {
  display: block;
}

.pokemon-row-main-link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  color: inherit;
  min-width: 0;
  max-width: 100%;
}

.pokemon-row-image-wrap {
  width: 120px;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pokemon-row-image {
  width: 110px;
  height: 110px;
  object-fit: contain;
}

.pokemon-row-main {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.pokemon-row-main h2 {
  margin: 0 0 8px;
  font-size: 2rem;
  line-height: 1.1;
}

.pokemon-row-stats {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.pokemon-speed-stat.is-raised {
  color: #dc2626;
}

.pokemon-speed-stat.is-lowered {
  color: #2563eb;
}

.pokemon-speed-stage-controls {
  margin-left: auto;
  margin-right: 0;
  padding-top: 26px;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-align: center;
}

.pokemon-speed-stage-label {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
  color: #111827;
}

.pokemon-speed-stage-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.pokemon-speed-stage-button {
  width: 40px;
  height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #f9fafb;
  color: #111827;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.pokemon-speed-stage-button:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.pokemon-speed-stage-button:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

.pokemon-row-types {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  min-width: 120px;
}

/* Abilities section */

.pokemon-inline-abilities-section {
  margin-top: 14px;
  padding: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
}

.pokemon-inline-abilities-section h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.pokemon-inline-abilities-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.pokemon-inline-ability-card {
  display: block;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}

.pokemon-inline-ability-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.pokemon-inline-ability-card p {
  margin: 0;
  color: #4b5563;
  font-size: 0.88rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* Extra content */

.pokemon-row-extra {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pokemon-matchup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pokemon-matchup-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px 14px;
}

.pokemon-matchup-box h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.type-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
}

.type-chip small {
  font-size: 0.72rem;
  opacity: 0.95;
}

/* Moves dropdown */

.pokemon-data-dropdowns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pokemon-inline-details {
  flex: 1 1 100%;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
}

.pokemon-inline-details summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  user-select: none;
}

.pokemon-inline-panel {
  padding: 0 14px 14px;
  max-height: min(60vh, 420px);
  overflow: auto;
  max-width: 100%;
}

.pokemon-moves-status {
  margin: 0;
}

.mini-dropdown-search-wrap {
  margin-bottom: 12px;
}

.mini-dropdown-search {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 0.92rem;
  background: white;
}

.mini-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-move-card {
  display: block;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}

.mini-move-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.mini-move-card p {
  margin: 0;
  color: #4b5563;
  font-size: 0.88rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.mini-move-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.mini-move-badges .type-badge {
  min-width: 72px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.mini-move-badges .category-text-badge {
  min-width: 72px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.mini-move-badges .move-category-icon {
  width: 62px;
}

.mini-move-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  color: #4b5563;
  font-size: 0.82rem;
  font-weight: 700;
}

.mini-filter-empty {
  margin-top: 10px;
}

/* Form switcher */

.pokemon-form-switcher-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}

.pokemon-form-switcher-section h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.pokemon-form-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pokemon-form-switch-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  color: #111827;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pokemon-form-switch-button:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.pokemon-form-switch-image {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Shared helpers */

.mini-muted {
  color: #6b7280;
  font-size: 0.88rem;
}

.mini-slot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Pokemon detail */

.pokemon-detail-hero {
  display: flex;
  align-items: center;
  gap: 24px;
}

.pokemon-detail-image-wrap {
  width: 180px;
  min-width: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pokemon-detail-image {
  max-width: 160px;
  max-height: 160px;
  object-fit: contain;
}

.pokemon-detail-hero-main {
  flex: 1;
}

.pokemon-detail-hero-main h1 {
  margin-bottom: 12px;
}

.pokemon-detail-form-label {
  margin-top: 0;
  margin-bottom: 12px;
}

/* Move list rows */

.move-row-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.move-row-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  background: white;
  border-radius: 18px;
  padding: 18px 20px;
  color: inherit;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.move-row-main {
  flex: 1;
}

.move-row-main h2 {
  margin: 0 0 10px;
  font-size: 2rem;
  line-height: 1.1;
}

.move-row-badges {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.move-row-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.move-stat-box {
  background: #f3f4f6;
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 90px;
  text-align: center;
}

.move-stat-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.move-stat-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
}

.move-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.move-detail-grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

/* Ability page */

.ability-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}

.ability-page-subtitle {
  margin-top: -12px;
  color: #6b7280;
  max-width: 700px;
}

.ability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.ability-card {
  display: block;
  background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 18px;
  color: inherit;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.ability-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.ability-card-top h2 {
  margin: 0;
  font-size: 1.5rem;
}

.ability-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #111827;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.ability-card-effect {
  margin: 0 0 14px;
  color: #374151;
  line-height: 1.5;
}

.ability-preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ability-preview-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 0.82rem;
  font-weight: 700;
}

.ability-preview-more {
  background: #dbeafe;
  color: #1d4ed8;
}

/* Badges */

.type-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
  text-align: center;
  min-width: 90px;
}

.category-text-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 90px;
  background: #7f8c8d;
  color: white;
}

.move-category-icon {
  display: inline-block;
  width: 72px;
  height: auto;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}

.move-category-icon-large {
  width: 84px;
}

/* Pokemon type colours */

.type-fire { background: #ff3b30; }
.type-flying { background: #8bd1ff; }
.type-dark { background: #111111; }
.type-grass { background: #43a047; }
.type-ghost { background: #6c5ce7; }
.type-steel { background: #7f8c8d; }
.type-water { background: #3498db; }
.type-electric { background: #f1c40f; }
.type-ice { background: #7ed6df; }
.type-fighting { background: #c0392b; }
.type-poison { background: #8e44ad; }
.type-ground { background: #856326; }
.type-rock { background: #c29238; }
.type-bug { background: #7cb342; }
.type-psychic { background: #ff5c8a; }
.type-dragon { background: #3f51b5; }
.type-fairy { background: #ff9ff3; }
.type-normal { background: #b0b0b0; }

/* Footer */

.site-footer {
  margin-top: 32px;
  padding: 24px;
  background: #111827;
  color: #e5e7eb;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}

.site-footer p {
  margin: 0 0 8px;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

/* Responsive */

@media (max-width: 1080px) {
  .pokemon-page-filter-bar {
    display: flex;
    flex-wrap: nowrap;
  }
}

@media (max-width: 1100px) {
  .pokemon-row-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .mini-card-grid {
    grid-template-columns: 1fr;
  }

  .pokemon-page-filter-bar {
    display: flex;
    flex-wrap: nowrap;
  }
}

@media (max-width: 900px) {
  .pokemon-row-main-link,
  .move-row-card,
  .pokemon-detail-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .pokemon-row-main-link {
    align-items: center;
    text-align: center;
  }

  .pokemon-row-image-wrap {
    margin: 0 auto;
  }

  .pokemon-row-main,
  .pokemon-row-stats {
    text-align: center;
  }

  .pokemon-speed-stage-controls {
    margin-left: auto;
    margin-right: auto;
    padding-top: 0;
  }

  .pokemon-matchup-grid,
  .ability-grid {
    grid-template-columns: 1fr;
  }

  .pokemon-row-types {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    min-width: auto;
  }

  .move-row-stats {
    justify-content: flex-start;
  }

  .pokemon-row-main h2 {
    font-size: 1.8rem;
  }

  .move-row-main h2,
  .ability-card-top h2 {
    font-size: 1.4rem;
  }

  .pokemon-detail-image-wrap {
    width: 140px;
    min-width: 140px;
  }

  .pokemon-detail-image {
    max-width: 130px;
    max-height: 130px;
  }
}


[hidden] {
  display: none !important;
}

/* Shared site header and navigation */

.site-header {
  margin-bottom: 18px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 0 18px;
}

.site-nav-link,
.page-subnav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: white;
  color: #111827;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.site-nav-link:hover,
.page-subnav-link:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.site-nav-link.is-active,
.page-subnav-link.is-active {
  background: #111827;
  border-color: #111827;
  color: white;
}

.page-subnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 0 16px;
}

/* Shared filter bars */

.page-filter-sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 0 10px;
}

.page-filter-bar {
  display: grid;
  gap: 12px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.page-filter-bar--entity {
  grid-template-columns: 1fr 1fr 260px;
}

.page-filter-field--full {
  grid-column: 1 / -1;
}

.page-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-filter-field label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #374151;
}

.page-filter-field input,
.page-filter-field select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  background: white;
}

.page-filter-help {
  margin: 12px 4px 20px;
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* One-page entity lists */

.entity-row-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.entity-row-card {
  display: block;
  background: white;
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  content-visibility: auto;
  contain-intrinsic-size: 380px;
  align-self: start;
  min-width: 0;
  max-width: 100%;
}

.entity-row-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.entity-row-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.entity-row-header h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.entity-effect-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
}

.entity-effect-box p {
  margin: 0;
  line-height: 1.5;
  color: #374151;
  overflow-wrap: anywhere;
}

.entity-meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.move-row-stats--left {
  justify-content: flex-start;
}

.learnt-by-section {
  margin-top: 16px;
}

.learnt-by-details {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
}

.learnt-by-summary,
.pokemon-inline-details summary,
.learner-summary {
  position: relative;
  list-style: none;
}

.learnt-by-summary::-webkit-details-marker,
.pokemon-inline-details summary::-webkit-details-marker,
.learner-summary::-webkit-details-marker {
  display: none;
}

.learnt-by-summary,
.pokemon-inline-details summary {
  display: block;
  cursor: pointer;
  padding: 12px 42px 12px 14px;
  font-weight: 700;
  user-select: none;
}

.learner-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 12px 44px 12px 14px;
  cursor: pointer;
  user-select: none;
}

.learnt-by-summary::after,
.pokemon-inline-details summary::after,
.learner-summary::after {
  content: "▾";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: #4b5563;
  transition: transform 0.15s ease;
}

.learnt-by-details[open] > .learnt-by-summary::after,
.pokemon-inline-details[open] > summary::after,
.learner-details[open] > .learner-summary::after {
  transform: translateY(-50%) rotate(180deg);
}

.learnt-by-panel {
  padding: 0 14px 14px;
}

.learner-dropdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 12px;
  align-items: start;
}

.learner-details {
  width: 100%;
  max-width: 100%;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  align-self: start;
}

.learner-summary-image {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.learner-summary-name {
  min-width: 0;
  font-weight: 700;
  flex: 1;
}

.learner-loaded-card-wrap {
  padding: 0 12px 12px;
}

.learner-loaded-card-wrap > [data-loader-target] {
  margin-top: 10px;
}

.learner-loaded-card-wrap > [data-loader-target] > .pokemon-row-card {
  width: 100%;
  margin-bottom: 0;
}

.learner-details--loaded[open] > .learner-summary {
  display: none;
}

.learner-details--loaded[open] > .learner-loaded-card-wrap {
  padding: 0;
}

.learner-details--loaded[open] > .learner-loaded-card-wrap > [data-loader-target] {
  margin-top: 0;
}

.learner-details--loaded[open] > .learner-loaded-card-wrap > [data-loader-target] > .pokemon-row-card {
  box-shadow: none;
  border: 0;
  border-radius: 0;
  padding: 16px 20px;
  width: 100%;
  margin: 0;
  min-height: 0 !important;
  position: relative;
  content-visibility: visible;
  contain-intrinsic-size: auto;
}

.learner-collapse-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: white;
  color: #4b5563;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  z-index: 6;
}

.learner-collapse-button:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.learner-collapse-button:focus {
  outline: none;
  border-color: #6b7280;
}

.entity-row-card--item .entity-row-header {
  align-items: center;
}

.item-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.item-heading-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.item-icon-inline {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.entity-row-card--item {
  padding: 14px 16px;
}

.entity-row-card--item .entity-row-main {
  gap: 10px;
}

.entity-row-card--item .entity-effect-box {
  padding: 12px;
}

.item-heading-stack {
  gap: 6px;
}

/* Item page tabs */

.item-subnav {
  margin-top: -4px;
}

/* Responsive overrides */

@media (max-width: 1100px) {
  .pokemon-row-list,
  .entity-row-list {
    grid-template-columns: 1fr;
  }

  .page-filter-bar--entity {
    grid-template-columns: 1fr 1fr;
  }

  .page-filter-sort-field,
  .page-filter-field--full {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .page-filter-bar--entity {
    grid-template-columns: 1fr;
  }

  .learner-dropdown-grid {
    grid-template-columns: 1fr;
  }

  .learner-details {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .entity-row-header h2 {
    font-size: 1.45rem;
  }
}


/* Final fixed-width Pokemon filter row override */

.pokemon-page-filter-bar,
.pokemon-page-filter-sticky .pokemon-page-filter-bar {
  display: grid !important;
  grid-auto-flow: column !important;
  grid-auto-columns: minmax(220px, 1fr) !important;
  align-items: end !important;
  gap: 12px !important;
  overflow-x: auto !important;
}

.pokemon-page-filter-bar::-webkit-scrollbar {
  height: 10px;
}

.pokemon-page-filter-bar::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}

.pokemon-page-filter-bar > .pokemon-page-filter-field {
  min-width: 220px !important;
}

.pokemon-page-filter-bar > .pokemon-page-filter-sort-field {
  min-width: 260px !important;
}

.pokemon-page-filter-bar > .pokemon-page-filter-field,
.pokemon-page-filter-bar > .pokemon-page-filter-sort-field {
  width: auto !important;
}

/* Single-column list option for moves and abilities */

.entity-row-list--single {
  grid-template-columns: 1fr;
}

.entity-row-list--single .entity-row-card {
  content-visibility: auto;
  contain-intrinsic-size: 420px;
}

/* Inline subnav inside the item search bubble */

.page-filter-inline-subnav {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.page-filter-inline-subnav .page-subnav-link {
  border: 1px solid #d1d5db;
  background: #f9fafb;
}

.page-filter-inline-subnav .page-subnav-link.is-active {
  background: #111827;
  border-color: #111827;
  color: white;
}

/* Learnt-by grid fills the bubble width cleanly */

.learnt-by-panel [data-learners-target] {
  display: block;
  width: 100%;
}

.learner-dropdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 12px;
}

@media (max-width: 1100px) {
  .entity-row-list--single {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .learner-dropdown-grid {
    grid-template-columns: 1fr;
  }
}

/* Pokemon page: keep the filter row on one line but fill the full bar width */

.page-filter-bar--pokemon,
.page-filter-sticky .page-filter-bar--pokemon,
.pokemon-page-filter-bar,
.pokemon-page-filter-sticky .pokemon-page-filter-bar {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(220px, 1fr)) minmax(260px, 1.1fr) !important;
  align-items: end !important;
  gap: 12px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

.page-filter-bar--pokemon > .page-filter-field,
.pokemon-page-filter-bar > .pokemon-page-filter-field {
  min-width: 220px !important;
  width: 100% !important;
}

.page-filter-bar--pokemon > .page-filter-sort-field,
.pokemon-page-filter-bar > .pokemon-page-filter-sort-field,
.pokemon-page-filter-bar > .pokemon-page-filter-field.pokemon-page-filter-sort-field {
  min-width: 260px !important;
  width: 100% !important;
}

.page-filter-bar--pokemon::-webkit-scrollbar,
.pokemon-page-filter-bar::-webkit-scrollbar {
  height: 10px;
}

.page-filter-bar--pokemon::-webkit-scrollbar-thumb,
.pokemon-page-filter-bar::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}

@media (max-width: 980px) {
  .page-filter-bar--pokemon,
  .page-filter-sticky .page-filter-bar--pokemon,
  .pokemon-page-filter-bar,
  .pokemon-page-filter-sticky .pokemon-page-filter-bar {
    grid-template-columns: repeat(4, minmax(220px, 1fr)) !important;
  }
}

/* Pokemon page: equal-height cards only when collapsed */
.pokemon-row-list {
  align-items: start;
}

.pokemon-row-card {
  align-self: start;
}

/* Mobile filter dropdown + readability sizing */
.mobile-filter-dropdown {
  margin: 0;
}

.mobile-filter-summary {
  display: none;
}

.mobile-filter-summary::-webkit-details-marker {
  display: none;
}

@media (max-width: 700px) {
  body {
    font-size: 18px;
  }

  main {
    padding: 18px;
  }

  .mobile-filter-dropdown {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
  }

  .mobile-filter-summary {
    display: block;
    list-style: none;
    cursor: pointer;
    padding: 14px 44px 14px 14px;
    font-size: 1.05rem;
    font-weight: 800;
    position: relative;
  }

  .mobile-filter-summary::after {
    content: "▾";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #4b5563;
    transition: transform 0.15s ease;
  }

  .mobile-filter-dropdown[open] > .mobile-filter-summary::after {
    transform: translateY(-50%) rotate(180deg);
  }

  .mobile-filter-dropdown > .page-filter-bar {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  .page-filter-bar--pokemon,
  .page-filter-sticky .page-filter-bar--pokemon,
  .pokemon-page-filter-bar,
  .pokemon-page-filter-sticky .pokemon-page-filter-bar,
  .page-filter-bar--entity {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    overflow: visible !important;
  }

  .page-filter-bar--pokemon > .page-filter-field,
  .pokemon-page-filter-bar > .pokemon-page-filter-field,
  .page-filter-bar--pokemon > .page-filter-sort-field,
  .pokemon-page-filter-bar > .pokemon-page-filter-sort-field,
  .pokemon-page-filter-bar > .pokemon-page-filter-field.pokemon-page-filter-sort-field,
  .page-filter-bar--entity > .page-filter-field,
  .page-filter-bar--entity > .page-filter-sort-field {
    min-width: 0 !important;
    width: 100% !important;
  }

  .page-filter-field label,
  .pokemon-page-filter-field label {
    font-size: 0.98rem;
  }

  .page-filter-field input,
  .page-filter-field select,
  .pokemon-page-filter-field input,
  .pokemon-page-filter-field select,
  .mini-dropdown-search {
    font-size: 1rem;
    min-height: 46px;
  }

  .mini-card-grid,
  .learner-dropdown-grid {
    grid-template-columns: 1fr !important;
  }

  .pokemon-row-image-wrap {
    width: 150px;
    min-width: 150px;
  }

  .pokemon-row-image {
    width: 140px;
    height: 140px;
  }

  .learner-summary {
    min-height: 72px;
    gap: 12px;
  }

  .learner-summary-image {
    width: 52px;
    height: 52px;
  }

  .pokemon-form-switch-image {
    width: 36px;
    height: 36px;
  }

  .move-category-icon {
    width: 82px;
  }

  .mini-move-badges .move-category-icon {
    width: 82px;
  }

  .mini-move-card p,
  .pokemon-inline-ability-card p,
  .entity-effect-box p,
  .pokemon-row-stats,
  .move-stat-value,
  .move-stat-label,
  .mini-muted,
  .ability-preview-pill,
  .type-badge,
  .category-text-badge {
    font-size: 0.98rem;
  }

  .move-row-main h2,
  .ability-card-top h2,
  .entity-row-header h2,
  .pokemon-row-main h2 {
    font-size: 1.7rem;
  }

  .entity-row-list,
  .entity-row-card,
  .entity-row-main,
  .learnt-by-section,
  .learnt-by-details,
  .learnt-by-panel {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .page-filter-inline-subnav .page-subnav-link {
    flex: 1 1 calc(50% - 10px);
    min-width: 0;
    text-align: center;
  }
}
