.entry-paths {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,18rem),1fr));gap:1rem}
.entry-path,.mon-card {border:1px solid var(--md-default-fg-color--lightest);border-radius:.5rem;padding:1rem}
.team {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,9rem),1fr));gap:.7rem}
.mon-card h3 {margin:.3rem 0}
.mon-card img {width:112px;height:112px;object-fit:contain;image-rendering:pixelated;display:block;margin:auto}
.md-typeset .mon-card dl {margin:.5rem 0;font-size:.8rem}
.md-typeset .mon-card dt {font-weight:700;margin-top:.35rem}
.md-typeset .mon-card dd {margin:0}
.md-typeset .mon-card ul {padding-left:1rem;margin:.5rem 0;font-size:.8rem}
.icon {width:32px;height:32px;image-rendering:pixelated;vertical-align:middle}
.trainer-party {font-size:.85rem}
.md-typeset table:not([class]) {font-size:.75rem}
.md-typeset .tabbed-labels {max-width:100%}
@media(min-width:76.25em) {.md-grid {max-width:84rem}}
@media(max-width:30em) {.mon-card img {width:96px;height:96px}.team {grid-template-columns:1fr}}

/* Ordinary teams stay compact; boss cards retain their separate presentation. */
.trainer-team { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .5rem; }
.trainer-mon { border: 1px solid var(--md-default-fg-color--lightest); border-radius: .3rem; padding: .5rem; }
.trainer-mon img { image-rendering: pixelated; vertical-align: middle; margin-right: .35rem; }
.md-typeset .trainer-mon p { margin: .35rem 0; font-size: .75rem; }
.md-typeset .trainer-mon details { margin: .3rem 0 0; font-size: .7rem; }

/* Reference pages only: shared 0-255 scale, independent of each species. */
.pokemon-identity { display:flex; align-items:center; gap:1rem; flex-wrap:wrap; }
.reference-sprite { width:160px; height:160px; image-rendering:pixelated; object-fit:contain; flex:none; }
.base-stats { max-width:32rem; }
.stat-row { display:grid; grid-template-columns:4rem 2rem minmax(0,1fr); align-items:center; gap:.5rem; margin:.45rem 0; font-size:.8rem; }
.stat-row strong { text-align:right; font-variant-numeric:tabular-nums; }
.stat-track { display:block; height:.65rem; background:var(--md-default-fg-color--lightest); border-radius:.15rem; overflow:hidden; }
.stat-fill { display:block; height:100%; background:var(--stat-tier-color); }
.reference-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:1rem; align-items:start; }
.reference-column { min-width:0; }
@media(min-width:76.25em) { .reference-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* Value tiers supplement the authoritative numeric stat and fixed bar length. */
.stat-tier-red { --stat-tier-color:#ff6b6b; }
.stat-tier-dark-orange { --stat-tier-color:#df8431; }
.stat-tier-yellow { --stat-tier-color:#f2cf4a; }
.stat-tier-light-green { --stat-tier-color:#9bd66f; }
.stat-tier-dark-green { --stat-tier-color:#43aa78; }
.stat-tier-blue { --stat-tier-color:#64b5f6; }

/* Paired change sections share the current-reference responsive grid. */
.md-typeset .changes-column > h3:first-child { margin-top:0; }

.pokemon-identity figure { margin:0; }
.pokemon-identity figcaption { text-align:center; font-size:.75rem; }
.form-sprite { display:block; max-width:100%; }

/* Cosmetic Unown forms share data and stay compact without scripting. */
.unown-gallery { display:grid; grid-template-columns:repeat(auto-fit,80px); gap:.5rem; }
.unown-gallery figure { margin:0; text-align:center; }
.unown-gallery img { display:block; width:80px; height:80px; image-rendering:pixelated; }
.unown-gallery figcaption { font-size:.75rem; }

/* Battle reference prototype: scoped badges and compact, scrollable indexes. */
.battle-badge { display:inline-block; border:1px solid var(--md-default-fg-color--light); border-radius:.2rem; padding:.08rem .35rem; font-size:.72rem; line-height:1.4; white-space:nowrap; }
.battle-category { color:var(--md-default-fg-color); }
[class*="battle-type-"] { color:#fff; background:var(--battle-type-color,#555); }
.battle-type-normal { --battle-type-color:#626252; }
.battle-type-fire { --battle-type-color:#a33d16; }
.battle-type-water { --battle-type-color:#2854aa; }
.battle-type-electric { --battle-type-color:#725700; }
.battle-type-grass { --battle-type-color:#377026; }
.battle-type-ice { --battle-type-color:#286969; }
.battle-type-fighting { --battle-type-color:#a22c28; }
.battle-type-poison { --battle-type-color:#853085; }
.battle-type-ground { --battle-type-color:#765c21; }
.battle-type-flying { --battle-type-color:#62508f; }
.battle-type-psychic { --battle-type-color:#ad2852; }
.battle-type-bug { --battle-type-color:#59620d; }
.battle-type-rock { --battle-type-color:#73641d; }
.battle-type-ghost { --battle-type-color:#594572; }
.battle-type-dragon { --battle-type-color:#5928bc; }
.battle-type-dark { --battle-type-color:#594538; }
.battle-type-steel { --battle-type-color:#535365; }
.battle-index { max-width:100%; }
.battle-index .battle-badge { font-size:.65rem; }
.md-typeset .battle-index table:not([class]) td { padding:.45em .65em; vertical-align:middle; }
.md-typeset .battle-changes table:not([class]) td { padding:.5em .75em; vertical-align:top; }
.md-typeset .battle-changes table:not([class]) td:first-child { min-width:7rem; }

/* Machine acquisition references: bounded scrolling on narrow screens. */
.machine-table,.machine-changes { max-width:100%; }
.md-typeset .machine-table table:not([class]),.md-typeset .machine-changes table:not([class]) { width:100%; }
.md-typeset .machine-table table:not([class]) td,.md-typeset .machine-changes table:not([class]) td { padding:.5em .7em; vertical-align:top; }
.md-typeset .machine-table table:not([class]) td:first-child { white-space:nowrap; }
.md-typeset .machine-table table:not([class]) td:last-child { min-width:14rem; }
.md-typeset .machine-hms table:not([class]) td:last-child { min-width:6rem; white-space:nowrap; }
.md-typeset .machine-changes table:not([class]) td { min-width:9rem; }

/* Encounters reuse the reference grid breakpoint and native Material tabs.
   One location's native radio controls select every method/subarea together. */
.encounter-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:1rem; align-items:start; }
.encounter-column { min-width:0; }
.encounter-column h4 { margin-top:0; }
.encounter-column .md-typeset__scrollwrap { margin-inline:0; }
.encounter-column .md-typeset__table { display:block; }
.encounter-column table:not([class]) { width:100%; }
.md-typeset .encounter-column table:not([class]) th,
.md-typeset .encounter-column table:not([class]) td { padding:.5em .6em; }
.encounter-location > .tabbed-set > .tabbed-content { display:none; }
.encounter-variant { display:none; }
.encounter-location:has(> .tabbed-set > input:nth-of-type(1):checked) .encounter-variant[data-difficulties~="easy"],
.encounter-location:has(> .tabbed-set > input:nth-of-type(2):checked) .encounter-variant[data-difficulties~="normal"],
.encounter-location:has(> .tabbed-set > input:nth-of-type(3):checked) .encounter-variant[data-difficulties~="challenge"] { display:block; }
@media(min-width:76.25em) {
  .encounter-grid--2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .encounter-grid--3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
/* Keep the selected difficulty visible while browsing a location's floors. */
.encounter-location > .tabbed-set { position:sticky; top:2.4rem; z-index:2; background:var(--md-default-bg-color); }
.encounter-location h3[id] { scroll-margin-top:5.5rem; }

/* Battle selectors control whole teams, including paired opponents and branches. */
.battle-card { margin:1rem 0 1.5rem; padding:.6rem .8rem; border:1px solid var(--md-default-fg-color--lightest); border-radius:.35rem; min-width:0; }
.battle-card--story { border-left:3px solid var(--md-accent-fg-color); }
.md-typeset .battle-card h3 { margin:.15rem 0 .5rem; }
.md-typeset .battle-card > p { font-size:.75rem; margin:.4rem 0; }
.battle-team { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr)); gap:.6rem; align-items:stretch; }
.battle-mon { min-width:0; border:1px solid var(--md-default-fg-color--lightest); border-radius:.25rem; padding:.5rem; font-size:.72rem; overflow-wrap:anywhere; }
.battle-mon-identity { display:flex; align-items:center; gap:.35rem; min-height:2rem; }
.battle-mon-identity img { image-rendering:pixelated; display:block; flex:none; }
.battle-mon-identity strong { flex:1; line-height:1.3; }
.battle-mon-identity > span { white-space:nowrap; font-variant-numeric:tabular-nums; }
.md-typeset .battle-mon dl { display:grid; grid-template-columns:2.8rem minmax(0,1fr); gap:.1rem .3rem; margin:.4rem 0; }
.md-typeset .battle-mon dt { margin:0; font-weight:400; color:var(--md-default-fg-color--light); }
.md-typeset .battle-mon dd { margin:0; }
.md-typeset .battle-mon ul.battle-moves { margin:.4rem 0 0; padding:0; display:block; list-style:none; }
.md-typeset .battle-moves li { margin:0; line-height:1.4; }
.md-typeset .battle-opponent { margin:.4rem 0; font-size:.75rem; }
.battle-boss .battle-team { grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr)); }
.battle-boss .battle-mon-identity { flex-wrap:wrap; }
.battle-boss .battle-mon-identity img { width:112px; height:112px; object-fit:contain; }
.md-typeset .battle-ivs { font-size:.65rem; margin:.5rem 0 0; }
@media(max-width:30em) {
  .battle-card { padding:.5rem; margin-inline:0; }
  .battle-team,.battle-boss .battle-team { grid-template-columns:minmax(0,1fr); }
}
.battle-card > .tabbed-set > .tabbed-content,.battle-boss > .tabbed-set > .tabbed-content { display:none; }
.battle-variant { display:none; }
.battle-card:has(> .tabbed-set > input:nth-of-type(1):checked) > .battle-variant[data-difficulties~="easy"],
.battle-card:has(> .tabbed-set > input:nth-of-type(2):checked) > .battle-variant[data-difficulties~="normal"],
.battle-card:has(> .tabbed-set > input:nth-of-type(3):checked) > .battle-variant[data-difficulties~="challenge"],
.battle-boss:has(> .tabbed-set > input:nth-of-type(1):checked) > .battle-variant[data-difficulties~="easy"],
.battle-boss:has(> .tabbed-set > input:nth-of-type(2):checked) > .battle-variant[data-difficulties~="normal"],
.battle-boss:has(> .tabbed-set > input:nth-of-type(3):checked) > .battle-variant[data-difficulties~="challenge"] { display:block; }
.battle-portrait { image-rendering:pixelated; object-fit:contain; }

/* Major inline teams share the dedicated boss sprite and card language. */
.battle-card--story .battle-team { grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr)); }
.battle-card--story .battle-mon-identity { flex-wrap:wrap; }
.battle-card--story .battle-mon-identity img { width:112px; height:112px; object-fit:contain; }
.nature-help { position:relative; font:inherit; color:inherit; cursor:help; border:0; border-bottom:1px dotted var(--md-default-fg-color--light); padding:0; background:transparent; text-align:left; }
.nature-help:focus-visible { outline:2px solid var(--md-accent-fg-color); outline-offset:2px; }
.nature-tip { display:none; position:absolute; bottom:calc(100% + .3rem); left:0; z-index:5; width:max-content; max-width:12rem; padding:.25rem .4rem; border:1px solid var(--md-default-fg-color--light); border-radius:.2rem; background:var(--md-default-bg-color); color:var(--md-default-fg-color); font-size:.65rem; box-shadow:0 2px 5px #0005; }
.nature-help:hover .nature-tip,.nature-help:focus .nature-tip { display:block; }
@media(max-width:30em) { .battle-card--story .battle-team { grid-template-columns:minmax(0,1fr); } }

/* Curated progression tables keep each source and its gate on the same row. */
.important-items-table { min-width:0; max-width:100%; }
.important-items-table .md-typeset__scrollwrap { margin-inline:0; overflow-x:auto; }
.important-items-table .md-typeset__table { display:block; overflow:visible; }
.md-typeset .important-items-table table:not([class]) { display:table; width:100%; max-width:none; overflow:visible; }
.md-typeset .important-items-table table:not([class]) th,
.md-typeset .important-items-table table:not([class]) td { padding:.5em .65em; vertical-align:top; }
.md-typeset .important-items-table table:not([class]) td:first-child { min-width:7rem; }
.md-typeset .important-items-table table:not([class]) td:nth-child(2) { min-width:13rem; }
.md-typeset .important-items-table table:not([class]) td:nth-child(3) { min-width:11rem; }
.md-typeset .important-items-table table:not([class]) td:nth-child(4) { min-width:5.5rem; }
.md-typeset .important-items-hms table:not([class]) td:first-child { min-width:3rem; }
.md-typeset .important-items-hms table:not([class]) td:nth-child(2) { min-width:5rem; }
.md-typeset .important-items-hms table:not([class]) td:nth-child(3) { min-width:15rem; }
.md-typeset .important-items-hms table:not([class]) td:nth-child(4) { min-width:8rem; }
@media(max-width:30em) {
  .md-typeset .important-items-table table:not([class]) th:first-child,
  .md-typeset .important-items-table table:not([class]) td:first-child {
    position:sticky; left:0; z-index:1; background:var(--md-default-bg-color);
    box-shadow:1px 0 var(--md-default-fg-color--lightest);
  }
}
.important-items-scroll-hint { color:var(--md-default-fg-color--light); }
@media(min-width:30.01em) { .important-items-scroll-hint { display:none; } }

/* Source-driven inventory/badge icons stay subordinate to searchable labels. */
.md-typeset .progression-item-icon { width:24px; height:24px; object-fit:contain; image-rendering:pixelated; vertical-align:middle; margin-right:.2em; }
.md-typeset .progression-badge-icon { width:20px; height:20px; object-fit:contain; image-rendering:pixelated; vertical-align:middle; margin-right:.2em; }
.md-typeset .important-items-grid table:not([class]) { table-layout:fixed; }
.md-typeset .important-items-grid table:not([class]) th:first-child,
.md-typeset .important-items-grid table:not([class]) td:first-child { width:28%; min-width:0; overflow-wrap:break-word; }
.md-typeset .important-items-grid table:not([class]) td:nth-child(2) { min-width:0; overflow-wrap:break-word; }
.progression-overview { max-width:100%; min-width:0; }
.progression-overview td:nth-child(4) { white-space:nowrap; }
@media(max-width:30em) {
  .md-typeset .important-items-grid table:not([class]) th:first-child,
  .md-typeset .important-items-grid table:not([class]) td:first-child { width:40%; }
}
