/* Team meta: generous data density without shrinking the six-Pokemon identity. */
.teams-toolbar.is-meta {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.teams-toolbar.is-meta .team-meta-exact-filter {
  grid-column: span 2;
}

.team-meta-view-tabs {
  position: sticky;
  top: 68px;
  z-index: 8;
  display: flex;
  gap: 4px;
  margin: 0 0 22px;
  padding: 7px;
  overflow-x: auto;
  border: 1px solid #293044;
  border-radius: 8px;
  background: #090d18;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}

.team-meta-view-tabs button {
  min-width: max-content;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #b9c2d7;
  background: transparent;
  font: inherit;
  font-size: .9rem;
  font-weight: 650;
  cursor: pointer;
}

.team-meta-view-tabs button:hover {
  color: #fff;
  background: #151b29;
}

.team-meta-view-tabs button.active {
  color: #fff;
  border-color: #e63676;
  background: #271323;
}

.team-meta-results {
  display: grid;
  gap: 22px;
}

.team-meta-card,
.team-archetype-card {
  overflow: hidden;
  border: 1px solid #2b3347;
  border-radius: 8px;
  background: #0b101c;
  box-shadow: 0 15px 34px rgba(0, 0, 0, .2);
}

.team-meta-card > header,
.team-archetype-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  min-height: 86px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #242c3e;
}

.team-meta-card > header > div,
.team-archetype-card > header > div {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.team-meta-card h2,
.team-archetype-card h2 {
  margin: 0 0 6px;
  overflow: visible;
  color: #f7f9ff;
  font-size: 1.12rem;
  line-height: 1.35;
  letter-spacing: 0;
  white-space: normal;
}

.team-meta-card header p,
.team-archetype-card header p {
  margin: 0;
  color: #9faac1;
  font-size: .87rem;
}

.team-meta-usage {
  flex: 0 0 88px;
  color: #ffcf4d;
  font-size: 1.55rem;
  line-height: 1;
  text-align: right;
}

.team-meta-usage small {
  display: block;
  margin-top: 7px;
  color: #98a3b9;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.team-meta-six,
.team-archetype-core {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-height: 160px;
  padding: 14px 22px;
  background: #070b15;
}

.team-archetype-core {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  max-width: 900px;
  background: transparent;
}

.team-meta-six > div,
.team-archetype-core > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  padding: 3px 6px 9px;
  text-align: center;
}

.team-meta-six span,
.team-archetype-core span {
  min-height: 2.35em;
  color: #e9edfa;
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.18;
}

.team-meta-sprite,
.pokemon-sprite-fallback.team-meta-sprite {
  width: 112px;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .32));
}

.team-meta-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid #20283a;
  border-bottom: 1px solid #20283a;
}

.team-meta-metrics > div {
  min-width: 0;
  padding: 16px 12px;
  border-right: 1px solid #20283a;
  text-align: center;
}

.team-meta-metrics > div:last-child {
  border-right: 0;
}

.team-meta-metrics strong {
  display: block;
  margin-bottom: 4px;
  color: #fff;
  font-size: 1.08rem;
}

.team-meta-metrics span {
  display: block;
  color: #98a3b9;
  font-size: .75rem;
  line-height: 1.25;
}

.team-meta-card > footer,
.team-archetype-card > footer {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 54px;
  padding: 11px 24px;
  color: #aab3c8;
  font-size: .8rem;
}

.team-meta-card > footer a,
.team-archetype-card > footer a {
  margin-left: auto;
  color: #78b7ff;
  font-weight: 700;
}

.team-meta-actions,
.team-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.team-meta-card > footer .team-meta-actions a,
.team-card > footer .team-card-actions a {
  margin-left: 0;
}

.team-meta-card > footer .team-meta-guide-link {
  color: #72d9a5;
}

.team-meta-card .positive {
  color: #64dca3;
}

.team-meta-card .negative {
  color: #ff7c8f;
}

.team-core-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.team-core-card {
  border: 1px solid #2b3347;
  border-radius: 8px;
  background: #0b101c;
}

.team-core-card > header,
.team-core-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 10px 16px;
}

.team-core-card > header {
  border-bottom: 1px solid #252d40;
  color: #dfe5f3;
}

.team-core-card > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  min-height: 130px;
  padding: 12px;
}

.team-core-card > div > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
}

.team-core-meta-sprite,
.pokemon-sprite-fallback.team-core-meta-sprite {
  width: 86px;
  height: 86px;
  object-fit: contain;
}

.team-core-card small {
  min-height: 2.2em;
  color: #dfe5f3;
  font-size: .75rem;
  line-height: 1.1;
}

.team-core-card > footer {
  border-top: 1px solid #252d40;
  color: #9da8bf;
  font-size: .78rem;
}

.team-core-card > footer strong {
  color: #ffcf4d;
  font-size: 1rem;
}

.team-meta-methodology {
  margin-top: 26px;
  padding: 18px 0;
  border-top: 1px solid #2d3549;
  color: #9da8bf;
}

.team-meta-methodology strong {
  display: block;
  margin-bottom: 5px;
  color: #e7ebf5;
}

.team-meta-methodology p {
  max-width: 880px;
  margin: 0 0 8px;
  line-height: 1.55;
}

.team-meta-methodology span {
  font-size: .78rem;
}

.team-meta-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
}

.team-meta-pagination button {
  min-height: 40px;
  border: 1px solid #39445c;
  border-radius: 5px;
  padding: 8px 14px;
  color: #e8edf7;
  background: #111827;
  font: inherit;
  cursor: pointer;
}

.team-meta-pagination button:disabled {
  opacity: .4;
  cursor: default;
}

.team-meta-pagination span {
  color: #aab4c8;
  font-size: .8rem;
}

/* Composition and archetype detail pages. */
.team-meta-detail-page {
  min-height: calc(100vh - 140px);
  padding-top: 70px;
  color: #ecf0fa;
}

.team-meta-detail-loading {
  display: grid;
  min-height: 60vh;
  place-content: center;
  gap: 16px;
  color: #aab4c8;
  text-align: center;
}

.tmd-hero {
  padding: 46px 0 30px;
  border-bottom: 1px solid #283044;
  background: #080d17;
}

.tmd-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 22px;
  color: #91c5ff;
  font-size: .86rem;
  font-weight: 700;
}

.tmd-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
}

.tmd-heading-actions {
  display: grid;
  flex: 0 0 auto;
  gap: 10px;
  min-width: 190px;
}

.tmd-heading-actions .btn {
  justify-content: center;
  min-height: 42px;
}

.tmd-heading h1 {
  max-width: 880px;
  margin: 8px 0 8px;
  color: #fff;
  font-size: clamp(1.65rem, 2.7vw, 2.55rem);
  line-height: 1.14;
  letter-spacing: 0;
}

.tmd-heading p {
  margin: 0;
  color: #aab4c9;
  font-size: .95rem;
}

.tmd-window {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #38425b;
  border-radius: 5px;
  color: #fff;
  background: #111827;
  font: inherit;
}

.tmd-six {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-height: 210px;
  margin-top: 28px;
  border-top: 1px solid #252e42;
  border-bottom: 1px solid #252e42;
}

.tmd-six > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 14px 8px;
  text-align: center;
}

.tmd-core-six {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  max-width: 900px;
}

.tmd-six-sprite,
.pokemon-sprite-fallback.tmd-six-sprite {
  width: 144px;
  height: 144px;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .35));
}

.tmd-six strong {
  min-height: 2.35em;
  font-size: .9rem;
  line-height: 1.2;
}

.tmd-metrics {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  margin-top: 20px;
  border: 1px solid #2a3348;
  border-radius: 8px;
  background: #0c121f;
}

.tmd-metrics > div {
  min-width: 0;
  padding: 16px 8px;
  border-right: 1px solid #283147;
  text-align: center;
}

.tmd-metrics > div:last-child {
  border-right: 0;
}

.tmd-metrics strong {
  display: block;
  margin-bottom: 6px;
  color: #fff;
  font-size: 1.05rem;
}

.tmd-metrics span {
  color: #99a5bb;
  font-size: .75rem;
  line-height: 1.2;
}

.tmd-content {
  padding: 36px 0 70px;
}

.tmd-section {
  padding: 30px 0;
  border-bottom: 1px solid #262e41;
}

.tmd-section:first-child {
  padding-top: 0;
}

.tmd-section h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.tmd-section > p {
  max-width: 820px;
  margin: 0 0 20px;
  color: #9fa9bd;
  line-height: 1.55;
}

.tmd-subheading {
  margin-top: 28px !important;
}

.tmd-table-wrap {
  overflow-x: auto;
  border: 1px solid #2a3347;
  border-radius: 8px;
}

.tmd-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: #0b111d;
}

.tmd-table th,
.tmd-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #232c40;
  color: #dce2ef;
  font-size: .85rem;
  text-align: left;
}

.tmd-table th {
  color: #9da8bc;
  background: #101725;
  font-size: .75rem;
  text-transform: uppercase;
}

.tmd-table tr:last-child td {
  border-bottom: 0;
}

.tmd-table a {
  color: #81bdff;
  font-weight: 650;
}

.tmd-build-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tmd-build {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid #2b3449;
  border-radius: 8px;
  background: #0b111d;
}

.tmd-build-identity {
  text-align: center;
}

.tmd-build-sprite,
.pokemon-sprite-fallback.tmd-build-sprite {
  width: 94px;
  height: 94px;
  object-fit: contain;
}

.tmd-build-identity strong {
  display: block;
  color: #fff;
  font-size: .85rem;
}

.tmd-build-body h3 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 1rem;
}

.tmd-build-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.tmd-build-list > div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
}

.tmd-build-list dt {
  color: #8f9bb2;
  font-size: .75rem;
}

.tmd-build-list dd {
  margin: 0;
  color: #dbe1ed;
  font-size: .79rem;
  line-height: 1.35;
}

.tmd-composition-list {
  display: grid;
  gap: 14px;
}

.tmd-composition-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid #2b3448;
  border-radius: 8px;
  background: #0b111d;
}

.tmd-composition-pokemon {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.tmd-composition-pokemon > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tmd-related-sprite,
.pokemon-sprite-fallback.tmd-related-sprite {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.tmd-composition-pokemon small {
  min-height: 2.2em;
  color: #dce2ee;
  font-size: .75rem;
  line-height: 1.1;
}

.tmd-composition-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  text-align: center;
}

.tmd-composition-stats strong,
.tmd-composition-stats span {
  display: block;
}

.tmd-composition-stats strong {
  color: #fff;
  font-size: .92rem;
}

.tmd-composition-stats span {
  margin-top: 3px;
  color: #8f9bb2;
  font-size: .75rem;
}

.tmd-composition-row > a {
  grid-column: 2;
  color: #80bdff;
  font-size: .8rem;
  font-weight: 700;
  text-align: right;
}

.tmd-core-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  max-width: 860px;
  gap: 12px;
}

.tmd-core-block > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  border: 1px solid #2b3448;
  border-radius: 8px;
  background: #0b111d;
  text-align: center;
}

.tmd-core-block .tmd-build-sprite {
  width: 104px;
  height: 104px;
}

.tmd-core-block strong {
  min-height: 2.3em;
  font-size: .8rem;
}

.tmd-empty {
  padding: 22px 0;
  color: #929db3;
}

.tmd-warning {
  padding: 14px 16px;
  border-left: 3px solid #f0b735;
  color: #cbd2df;
  background: #17150f;
  font-size: .82rem;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .teams-toolbar.is-meta {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .team-meta-sprite,
  .pokemon-sprite-fallback.team-meta-sprite {
    width: 96px;
    height: 96px;
  }

  .team-meta-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .team-meta-metrics > div:nth-child(3) {
    border-right: 0;
  }

  .team-meta-metrics > div:nth-child(-n+3) {
    border-bottom: 1px solid #20283a;
  }

  .tmd-six-sprite,
  .pokemon-sprite-fallback.tmd-six-sprite {
    width: 112px;
    height: 112px;
  }

  .tmd-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tmd-metrics > div {
    border-bottom: 1px solid #283147;
  }

  .tmd-metrics > div:nth-child(3n) {
    border-right: 0;
  }

  .tmd-metrics > div:nth-last-child(-n+3) {
    border-bottom: 0;
  }

  .tmd-composition-row {
    grid-template-columns: 1fr;
  }

  .tmd-composition-row > a {
    grid-column: 1;
  }
}

@media (max-width: 680px) {
  .teams-toolbar.is-meta {
    grid-template-columns: 1fr;
  }

  .teams-toolbar.is-meta .team-meta-exact-filter {
    grid-column: auto;
  }

  .team-meta-view-tabs {
    top: 62px;
    margin-inline: -8px;
    border-radius: 0;
  }

  .team-meta-card > header,
  .team-archetype-card > header {
    min-height: 104px;
    padding: 16px;
  }

  .team-meta-card h2,
  .team-archetype-card h2 {
    font-size: .98rem;
  }

  .team-meta-usage {
    flex-basis: 68px;
    font-size: 1.25rem;
  }

  .team-meta-six {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 286px;
    padding: 10px 6px;
  }

  .team-meta-sprite,
  .pokemon-sprite-fallback.team-meta-sprite {
    width: 88px;
    height: 88px;
  }

  .team-meta-six span,
  .team-archetype-core span {
    font-size: .75rem;
  }

  .team-meta-metrics > div {
    min-height: 66px;
    padding: 12px 6px;
  }

  .team-meta-card > footer,
  .team-archetype-card > footer {
    flex-wrap: wrap;
    padding: 13px 16px;
  }

  .team-meta-card > footer a,
  .team-archetype-card > footer a {
    width: 100%;
    min-height: 40px;
    margin-left: 0;
    padding-top: 10px;
    border-top: 1px solid #293147;
  }

  .team-meta-actions,
  .team-card-actions {
    width: 100%;
    flex-wrap: wrap;
    margin-left: 0;
  }

  .team-meta-card > footer .team-meta-actions a,
  .team-card > footer .team-card-actions a {
    width: auto;
    flex: 1 1 150px;
  }

  .team-core-meta-grid,
  .tmd-build-grid {
    grid-template-columns: 1fr;
  }

  .tmd-hero {
    padding-top: 30px;
  }

  .tmd-heading {
    display: block;
  }

  .tmd-heading-actions {
    margin-top: 18px;
  }

  .tmd-window {
    width: 100%;
    margin-top: 20px;
  }

  .tmd-six {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 330px;
  }

  .tmd-six-sprite,
  .pokemon-sprite-fallback.tmd-six-sprite {
    width: 96px;
    height: 96px;
  }

  .tmd-six strong {
    font-size: .76rem;
  }

  .tmd-metrics strong {
    font-size: .94rem;
  }

  .tmd-metrics span {
    font-size: .75rem;
  }

  .tmd-build {
    grid-template-columns: 84px minmax(0, 1fr);
    padding: 14px;
  }

  .tmd-build-sprite,
  .pokemon-sprite-fallback.tmd-build-sprite {
    width: 78px;
    height: 78px;
  }

  .tmd-composition-pokemon {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 10px;
  }

  .tmd-related-sprite,
  .pokemon-sprite-fallback.tmd-related-sprite {
    width: 68px;
    height: 68px;
  }
}
