/* PokéPark UI v4.2 — National Pokédex, five-action mobile dock and role dialogue system */

@font-face {
  font-family: "Onest PokePark";
  src: url("/assets/v4.2/fonts/Onest-Variable.ttf") format("truetype-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ui-font: "Onest PokePark", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --ui-display: "Onest PokePark", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
}

html,
body,
button,
input,
select,
textarea,
.inventory-v2741,
.inventory-item-dialog-v2741 { font-family: var(--ui-font) !important; }

/* National Pokédex filters */
.pokedex-toolbar {
  grid-template-columns: minmax(260px,.92fr) minmax(430px,1.08fr);
  align-items: stretch;
}

.pokedex-search,
.pokedex-filter-tabs { align-self: end; }

.pokedex-scroll-filter {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 118px minmax(0,1fr);
  gap: 9px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--theme-border);
  border-radius: 16px;
  background: color-mix(in srgb,var(--theme-surface-soft) 78%,transparent);
  box-shadow: 0 1px 0 var(--ui-highlight) inset;
}

.pokedex-scroll-filter > header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 5px 2px 5px 5px;
}

.pokedex-scroll-filter > header span { min-width: 0; }
.pokedex-scroll-filter > header small {
  display: block;
  color: var(--theme-muted);
  font-size: .52rem;
  font-weight: 820;
  letter-spacing: .12em;
}
.pokedex-scroll-filter > header b {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--theme-text);
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pokedex-scroll-filter > header nav { display: flex; gap: 5px; }
.pokedex-scroll-filter > header nav button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--theme-border);
  border-radius: 9px;
  background: var(--theme-card);
  color: var(--theme-muted);
  font-size: 1.1rem;
  line-height: 1;
}
.pokedex-scroll-filter > header nav button:hover { color: var(--theme-accent); border-color: color-mix(in srgb,var(--theme-accent) 38%,var(--theme-border)); }

.pokedex-scroll-track {
  display: flex;
  gap: 7px;
  min-width: 0;
  padding: 1px 1px 4px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-color: color-mix(in srgb,var(--theme-accent) 35%,transparent) transparent;
  scrollbar-width: thin;
}
.pokedex-scroll-track::-webkit-scrollbar { height: 5px; }
.pokedex-scroll-track::-webkit-scrollbar-track { background: transparent; }
.pokedex-scroll-track::-webkit-scrollbar-thumb { border-radius: 999px; background: color-mix(in srgb,var(--theme-accent) 35%,transparent); }

.pokedex-generation-track > button {
  position: relative;
  flex: 0 0 134px;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  min-height: 58px;
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid var(--theme-border);
  border-radius: 13px;
  background:
    radial-gradient(circle at 100% 0%,color-mix(in srgb,var(--theme-accent) 11%,transparent),transparent 52%),
    var(--theme-card);
  color: var(--theme-text);
  text-align: left;
}
.pokedex-generation-track > button::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -25px;
  width: 62px;
  height: 62px;
  border: 1px solid color-mix(in srgb,var(--theme-accent) 13%,transparent);
  border-radius: 50%;
}
.pokedex-generation-track > button small { grid-column: 1 / -1; color: var(--theme-muted); font-size: .47rem; font-weight: 800; letter-spacing: .08em; }
.pokedex-generation-track > button b { margin-top: 3px; font-size: .7rem; }
.pokedex-generation-track > button em { align-self: end; color: var(--theme-muted); font-size: .58rem; font-style: normal; font-weight: 800; }
.pokedex-generation-track > button.is-all { flex-basis: 158px; }
.pokedex-generation-track > button:hover { transform: translateY(-1px); border-color: color-mix(in srgb,var(--theme-accent) 40%,var(--theme-border)); }
.pokedex-generation-track > button.is-active {
  border-color: color-mix(in srgb,var(--theme-accent) 62%,var(--theme-border));
  background:
    radial-gradient(circle at 100% 0%,color-mix(in srgb,var(--theme-accent) 24%,transparent),transparent 58%),
    color-mix(in srgb,var(--theme-accent) 9%,var(--theme-card));
  color: var(--theme-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb,var(--theme-accent) 9%,transparent),0 8px 18px rgba(7,57,74,.08);
}

.pokedex-type-filter-v42 { grid-template-columns: 118px minmax(0,1fr); }
.pokedex-type-track > button {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--theme-border);
  border-radius: 12px;
  background: var(--theme-card);
  color: var(--theme-muted);
}
.pokedex-type-track > button > i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--type-chip);
  box-shadow: 0 0 0 4px color-mix(in srgb,var(--type-chip) 14%,transparent);
}
.pokedex-type-track > button > .ui-icon { width: 16px; height: 16px; color: var(--type-chip); }
.pokedex-type-track > button b { font-size: .64rem; white-space: nowrap; }
.pokedex-type-track > button:hover { transform: translateY(-1px); color: var(--theme-text); border-color: color-mix(in srgb,var(--type-chip) 45%,var(--theme-border)); }
.pokedex-type-track > button.is-active {
  border-color: color-mix(in srgb,var(--type-chip) 65%,var(--theme-border));
  background: color-mix(in srgb,var(--type-chip) 10%,var(--theme-card));
  color: color-mix(in srgb,var(--type-chip) 72%,var(--theme-text));
  box-shadow: 0 0 0 2px color-mix(in srgb,var(--type-chip) 8%,transparent);
}

.pokedex-card-number { display: flex; align-items: center; gap: 6px; }
.pokedex-card-number small {
  padding: 3px 5px;
  border-radius: 6px;
  background: color-mix(in srgb,var(--species-accent) 10%,var(--theme-card));
  color: var(--theme-muted);
  font: 750 .42rem/1 var(--ui-font);
  letter-spacing: .04em;
}

/* Wide, centered library and inventory on desktop */
@media (min-width: 801px) {
  .game-screen .side-panel:is(.is-pokedex-panel,.is-pokedex-detail,.is-inventory-panel) {
    position: fixed !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    left: 50% !important;
    width: min(1180px,calc(100vw - 132px)) !important;
    height: min(820px,calc(100dvh - 92px)) !important;
    max-width: none !important;
    max-height: none !important;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%,-46%) scale(.985) !important;
    transition: opacity 180ms ease,transform 220ms cubic-bezier(.2,.8,.2,1) !important;
  }
  .game-screen .side-panel:is(.is-pokedex-panel,.is-pokedex-detail,.is-inventory-panel).is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%,-50%) scale(1) !important;
  }
  .game-screen .side-panel.is-pokedex-detail { width: min(1040px,calc(100vw - 132px)) !important; }
  .game-screen .side-panel.is-inventory-panel { width: min(1100px,calc(100vw - 132px)) !important; height: min(760px,calc(100dvh - 92px)) !important; }
  .pokedex-grid-v41 { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .inventory-v2741__items { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 10px; }
  .inventory-item-v2741 { min-height: 166px; grid-template-rows: 72px minmax(58px,auto) 20px; padding: 9px; border-radius: 16px; }
  .inventory-item-v2741__art { width: 72px; height: 72px; }
  .inventory-item-v2741__art .item-icon { width: 59px; height: 59px; }
  .inventory-item-v2741__name b { font-size: .67rem; }
  .inventory-v2741__categories { gap: 8px; }
  .inventory-v2741__categories button { min-height: 58px; border-radius: 14px; }
  .inventory-v2741__categories .inventory-category-icon,
  .inventory-v2741__categories .inventory-ui-icon { width: 24px; height: 24px; }
  .inventory-v2741__categories button > span { font-size: .52rem; }
}

.inventory-item-v2741__name { display: grid; align-content: start; gap: 2px; min-width: 0; }
.inventory-item-v2741__name > em { overflow: hidden; color: var(--inv-blue); font-size: .44rem; font-style: normal; font-weight: 820; letter-spacing: .06em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.inventory-item-v2741__name > small { display: -webkit-box; overflow: hidden; color: var(--inv-muted); font-size: .48rem; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.inventory-v2741.is-list .inventory-item-v2741__name > small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 801px) and (max-width: 1120px) {
  .pokedex-grid-v41 { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .inventory-v2741__items { grid-template-columns: repeat(5,minmax(0,1fr)); }
}

/* Role-based visual-novel dialogue */
.dialogue-layer { --dialogue-accent:#2b8fd6; }
.dialogue-layer[data-dialogue-role="captain"] { --dialogue-accent:#247fc7; --dialogue-bg:url('/assets/v4.2/dialogue/dialogue-captain.webp'); }
.dialogue-layer[data-dialogue-role="trainer"] { --dialogue-accent:#e86462; --dialogue-bg:url('/assets/v4.2/dialogue/dialogue-trainer.webp'); }
.dialogue-layer[data-dialogue-role="system"] { --dialogue-accent:#4a93d2; --dialogue-bg:url('/assets/v4.2/dialogue/dialogue-system.webp'); }

.dialogue-layer .dialogue-shade {
  background: color-mix(in srgb,var(--ui-overlay) 86%,transparent) !important;
  backdrop-filter: blur(7px) saturate(.82);
}

.dialogue-layer .dialogue-card {
  isolation: isolate;
  grid-template-columns: 230px minmax(0,1fr) 170px;
  grid-template-rows: minmax(220px,auto) 66px;
  gap: 0 18px;
  width: min(1040px,calc(100vw - 48px));
  min-height: 350px;
  max-height: min(76dvh,620px);
  padding: 0 20px 14px 0;
  overflow: hidden !important;
  border-color: color-mix(in srgb,var(--dialogue-accent) 34%,var(--theme-border)) !important;
  border-radius: 28px !important;
  background:
    linear-gradient(90deg,color-mix(in srgb,var(--theme-card) 18%,transparent),var(--ui-glass-strong) 33% 100%),
    var(--dialogue-bg) center/cover no-repeat !important;
}
.dialogue-layer .dialogue-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(105deg,color-mix(in srgb,var(--dialogue-accent) 7%,transparent),transparent 45%),linear-gradient(180deg,transparent 72%,color-mix(in srgb,var(--dialogue-accent) 5%,var(--theme-card)));
  pointer-events: none;
}
.dialogue-layer .dialogue-card::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: 71px;
  left: 250px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg,var(--dialogue-accent) var(--dialogue-progress),color-mix(in srgb,var(--dialogue-accent) 12%,transparent) var(--dialogue-progress));
  box-shadow: 0 0 10px color-mix(in srgb,var(--dialogue-accent) 20%,transparent);
}

.dialogue-layer .dialogue-portrait {
  position: relative;
  left: auto;
  bottom: auto;
  grid-column: 1;
  grid-row: 1 / 3;
  justify-self: stretch;
  width: 230px;
  height: 340px;
  margin: 0;
  align-self: end;
  overflow: visible;
  border: 0;
  border-radius: 0 0 0 28px;
  background: linear-gradient(90deg,color-mix(in srgb,var(--dialogue-accent) 18%,transparent),transparent) !important;
}
.dialogue-layer .dialogue-portrait > i {
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  filter: drop-shadow(0 18px 18px rgba(3,31,48,.25));
}
.dialogue-layer .dialogue-portrait > span {
  right: 18px;
  bottom: 15px;
  left: 18px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  background: color-mix(in srgb,var(--dialogue-accent) 82%,#173c55) !important;
  font-size: .56rem;
  letter-spacing: .07em;
}

.dialogue-layer .dialogue-copy {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  min-width: 0;
  padding: 30px 4px 18px;
}
.dialogue-layer .dialogue-copy header { align-items: start; }
.dialogue-layer .dialogue-copy header small { color: var(--dialogue-accent); font-size: .64rem; font-weight: 850; letter-spacing: .1em; }
.dialogue-layer .dialogue-copy h2 { margin-top: 5px; font: 780 1.45rem/1.05 var(--ui-display); letter-spacing: -.025em; }
.dialogue-layer .dialogue-copy > p { min-height: 108px; margin: 26px 0 18px; color: var(--theme-text); font-size: .96rem; font-weight: 520; line-height: 1.65; }
.dialogue-layer .dialogue-hint { color: var(--theme-muted); font-size: .6rem; }
.dialogue-layer #dialogueSound {
  min-height: 36px;
  border: 1px solid var(--theme-border);
  border-radius: 11px;
  background: color-mix(in srgb,var(--theme-card) 80%,transparent);
  color: var(--theme-muted);
}

.dialogue-layer .dialogue-listener {
  grid-column: 3;
  grid-row: 1;
  align-self: end;
  justify-self: center;
  height: 238px;
  padding: 0;
  opacity: .95;
}
.dialogue-layer .dialogue-listener > i { width: 154px; height: 226px; filter: drop-shadow(0 12px 13px rgba(4,31,49,.16)); }
.dialogue-layer .dialogue-actions {
  grid-column: 2 / 4;
  display: grid;
  grid-template-columns: minmax(110px,.42fr) minmax(190px,.72fr);
  justify-content: end;
  align-items: end;
  gap: 9px;
  padding-top: 16px;
  margin: 0;
}
.dialogue-layer .dialogue-actions button {
  min-height: 48px;
  border: 1px solid var(--theme-border);
  border-radius: 14px !important;
  background: color-mix(in srgb,var(--theme-card) 86%,transparent);
  color: var(--theme-muted);
  font-size: .7rem;
  font-weight: 800;
}
.dialogue-layer #dialogueNext {
  border-color: color-mix(in srgb,var(--dialogue-accent) 70%,var(--theme-border));
  background: linear-gradient(180deg,color-mix(in srgb,var(--dialogue-accent) 82%,#fff 18%),var(--dialogue-accent));
  color: #fff;
  box-shadow: 0 11px 24px color-mix(in srgb,var(--dialogue-accent) 22%,transparent);
}

/* Five-action mobile dock */
@media (max-width: 800px) {
  .game-screen .mobile-dock {
    z-index: 74 !important;
    left: max(8px,env(safe-area-inset-left)) !important;
    right: max(8px,env(safe-area-inset-right)) !important;
    bottom: max(7px,env(safe-area-inset-bottom)) !important;
    display: grid !important;
    grid-template-columns: repeat(5,minmax(0,1fr)) !important;
    height: 76px !important;
    padding: 6px 7px !important;
    overflow: visible !important;
    border-radius: 24px !important;
    background: color-mix(in srgb,var(--ui-glass-strong) 94%,transparent) !important;
    box-shadow: 0 16px 44px rgba(0,20,33,.32),0 1px 0 rgba(255,255,255,.12) inset !important;
  }
  .game-screen .mobile-dock button {
    position: relative;
    display: grid !important;
    place-items: center;
    align-content: center;
    gap: 3px !important;
    min-width: 0;
    min-height: 62px;
    padding: 4px 2px !important;
    border: 1px solid transparent !important;
    border-radius: 16px !important;
    background: transparent !important;
    color: var(--theme-muted) !important;
  }
  .game-screen .mobile-dock button > span { display: grid; place-items: center; width: 31px; height: 31px; }
  .game-screen .mobile-dock .mobile-nav-icon { width: 29px; height: 29px; overflow: visible; }
  .game-screen .mobile-dock button > b { max-width: 100%; color: currentColor; font-size: .52rem !important; font-weight: 750; letter-spacing: -.01em; text-transform: none; white-space: nowrap; }
  .game-screen .mobile-dock button:is(:hover,.is-active,.is-menu-open) {
    border-color: color-mix(in srgb,var(--theme-accent) 20%,transparent) !important;
    background: color-mix(in srgb,var(--theme-accent) 9%,transparent) !important;
    color: var(--theme-accent) !important;
  }
  .game-screen .mobile-dock .mobile-dock-primary {
    --nav-accent:#e9fbff;
    width: 68px;
    height: 74px;
    min-height: 74px;
    justify-self: center;
    margin-top: -18px;
    border: 5px solid color-mix(in srgb,var(--ui-glass-strong) 96%,transparent) !important;
    border-radius: 24px !important;
    background: linear-gradient(155deg,#35b8e8,#157ac0) !important;
    color: #fff !important;
    box-shadow: 0 13px 25px rgba(13,113,170,.34),0 2px 0 rgba(255,255,255,.24) inset !important;
  }
  .game-screen .mobile-dock .mobile-dock-primary > span { width: 35px; height: 35px; }
  .game-screen .mobile-dock .mobile-dock-primary .mobile-nav-icon { width: 34px; height: 34px; }
  .game-screen .mobile-dock .mobile-dock-primary > b { color: #fff; }
  .game-screen .mobile-dock .mobile-dock-primary > i {
    position: absolute;
    top: 5px;
    right: 7px;
    display: grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #ef5860;
    color: #fff;
    font-size: .52rem;
    font-style: normal;
    font-weight: 850;
  }

  .game-screen .side-panel,
  .game-screen .side-panel:is(.is-inventory-panel,.is-pokedex-panel,.is-pokedex-detail),
  .game-screen .chat-panel { bottom: calc(91px + env(safe-area-inset-bottom)) !important; }

  .game-screen .world-rail {
    position: absolute !important;
    z-index: 73 !important;
    top: auto !important;
    right: max(9px,env(safe-area-inset-right)) !important;
    bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    left: max(9px,env(safe-area-inset-left)) !important;
    display: grid !important;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 7px !important;
    width: auto !important;
    max-height: min(58dvh,430px);
    padding: 10px !important;
    overflow: auto;
    border-radius: 22px !important;
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px) scale(.98) !important;
    transition: opacity 160ms ease,transform 200ms ease !important;
  }
  .game-screen .world-rail.is-desktop-menu-open {
    opacity: 1;
    pointer-events: auto;
    transform: none !important;
  }
  .game-screen .world-rail button { min-height: 68px; }
  .game-screen .world-rail button span .ui-icon { width: 24px; height: 24px; }
  .game-screen .world-rail button b { font-size: .56rem; }

  .pokedex-scroll-filter { grid-template-columns: 1fr; gap: 4px; padding: 6px; }
  .pokedex-scroll-filter > header { flex-direction: row; align-items: center; padding: 2px 2px 4px 4px; }
  .pokedex-scroll-filter > header nav button { width: 36px; height: 34px; }
  .pokedex-generation-track > button { flex-basis: 128px; min-height: 56px; }
  .pokedex-type-track > button { min-height: 44px; }
  .pokedex-toolbar { grid-template-columns: 1fr; }
  .pokedex-filter-tabs { min-width: 0; overflow-x: auto; grid-template-columns: repeat(4,94px); }
  .pokedex-search { min-height: 48px; }
  .pokedex-card-number small { display: none; }

  .dialogue-layer .dialogue-card {
    grid-template-columns: 98px minmax(0,1fr);
    grid-template-rows: minmax(178px,auto) auto;
    gap: 0 10px;
    width: calc(100vw - 12px);
    min-height: 250px;
    max-height: calc(100dvh - 94px);
    padding: 9px 10px 10px 0;
    overflow: auto !important;
    border-radius: 22px !important;
  }
  .dialogue-layer .dialogue-card::after { right: 10px; bottom: 63px; left: 108px; }
  .dialogue-layer .dialogue-portrait {
    position: relative;
    left: auto;
    bottom: auto;
    grid-column: 1;
    grid-row: 1;
    width: 98px;
    height: 170px;
    margin: 0;
    align-self: start;
    justify-self: stretch;
  }
  .dialogue-layer .dialogue-portrait > span { right: 4px; bottom: 3px; left: 4px; padding: 5px 3px; font-size: .43rem; }
  .dialogue-layer .dialogue-copy { grid-column: 2; grid-row: 1; padding: 12px 0; }
  .dialogue-layer .dialogue-copy header { gap: 5px; }
  .dialogue-layer .dialogue-copy header small { font-size: .48rem; }
  .dialogue-layer .dialogue-copy h2 { font-size: 1.05rem; }
  .dialogue-layer .dialogue-copy > p { min-height: 76px; margin: 16px 0 9px; font-size: .76rem; line-height: 1.52; }
  .dialogue-layer .dialogue-hint { font-size: .5rem; }
  .dialogue-layer #dialogueSound { min-width: 38px; width: 38px; padding: 0; }
  .dialogue-layer #dialogueSound b { display: none; }
  .dialogue-layer .dialogue-listener { display: none; }
  .dialogue-layer .dialogue-actions { grid-column: 1 / 3; grid-row: 2; grid-template-columns: .7fr 1.3fr; padding: 13px 0 0 9px; margin: 0; }
  .dialogue-layer .dialogue-actions button { min-height: 46px; font-size: .6rem; }
}

@media (max-width: 430px) {
  .game-screen .mobile-dock { height: 70px !important; padding-inline: 5px !important; }
  .game-screen .mobile-dock button { min-height: 57px; }
  .game-screen .mobile-dock button > span { width: 27px; height: 27px; }
  .game-screen .mobile-dock .mobile-nav-icon { width: 26px; height: 26px; }
  .game-screen .mobile-dock button > b { font-size: .46rem !important; }
  .game-screen .mobile-dock .mobile-dock-primary { width: 62px; height: 69px; min-height: 69px; border-radius: 22px !important; }
  .game-screen .side-panel,
  .game-screen .side-panel:is(.is-inventory-panel,.is-pokedex-panel,.is-pokedex-detail),
  .game-screen .chat-panel { bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
  .game-screen .world-rail { bottom: calc(85px + env(safe-area-inset-bottom)) !important; }
  .pokedex-library-title p { display: none; }
  .pokedex-generation-track > button { flex-basis: 122px; }
}

/* v4.9 — inventory as an item-first game catalogue. */
.inventory-v49 { gap: 8px; }
.inventory-head-v49 { min-height: 58px; padding-block: 4px 7px; }
.inventory-title-v49 > span { width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(145deg,color-mix(in srgb,var(--theme-accent) 13%,var(--theme-card)),color-mix(in srgb,var(--theme-accent) 4%,var(--theme-card))); box-shadow: inset 0 1px rgba(255,255,255,.45),0 7px 18px color-mix(in srgb,var(--theme-accent) 10%,transparent); }
.inventory-title-v49 h2 { font-size: 22px; letter-spacing: -.025em; }
.inventory-title-v49 em { display: block; margin-top: 3px; color: var(--theme-muted); font-size: 9px; font-style: normal; font-weight: 750; }
.inventory-toolbar-v49 { grid-template-columns: minmax(0,1fr) 168px 76px; min-height: 40px; }
.inventory-search-v49 { position: relative; border-color: color-mix(in srgb,var(--theme-accent) 18%,var(--theme-border)); background: color-mix(in srgb,var(--theme-card) 82%,transparent); box-shadow: inset 0 1px rgba(255,255,255,.35); }
.inventory-search-v49:focus-within { border-color: color-mix(in srgb,var(--theme-accent) 68%,var(--theme-border)); box-shadow: 0 0 0 3px color-mix(in srgb,var(--theme-accent) 10%,transparent); }
.inventory-search-v49 input[type="search"]::-webkit-search-cancel-button { display: none; }
.inventory-search-v49 > button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: color-mix(in srgb,var(--theme-muted) 8%,transparent); color: var(--theme-muted); cursor: pointer; }
.inventory-search-v49 > button:hover { background: color-mix(in srgb,var(--theme-accent) 10%,transparent); color: var(--theme-accent); }
.inventory-search-v49 > button svg { width: 15px; height: 15px; }
.inventory-layout-v49 { display: grid; grid-template-columns: 1fr; grid-template-rows: auto minmax(0,1fr); gap: 7px; }
.inventory-v49 .inventory-categories-v49 { display: grid; grid-template-columns: repeat(10,minmax(0,1fr)); gap: 4px; padding: 4px; overflow: visible; border-radius: 14px; }
.inventory-v49 .inventory-categories-v49 > button { display: grid; grid-template-columns: 22px minmax(0,1fr); grid-template-rows: 1fr; gap: 5px; width: 100%; min-height: 37px; padding: 4px 7px; border-radius: 10px; text-align: center; }
.inventory-v49 .inventory-categories-v49 > button::after { display: none; }
.inventory-v49 .inventory-categories-v49 > button svg { width: 19px; height: 19px; }
.inventory-v49 .inventory-categories-v49 > button span { font-size: 8px; }
.inventory-v49 .inventory-categories-v49 > button i { position: absolute; top: 1px; right: 2px; min-width: 15px; height: 15px; padding: 0 3px; background: color-mix(in srgb,currentColor 9%,var(--theme-card)); font-size: 7px; }
.inventory-v49 .inventory-categories-v49 > button.is-active { box-shadow: inset 0 -2px var(--theme-accent),0 3px 10px color-mix(in srgb,var(--theme-accent) 8%,transparent); }
.inventory-catalog-v49 { border-radius: 16px; background: color-mix(in srgb,var(--theme-card) 72%,transparent); }
.inventory-catalog-v49 > header { min-height: 45px; padding: 5px 9px 5px 12px; }
.inventory-catalog-v49 > header > span b { font-size: 12px; }
.inventory-overview-v49 { display: flex; gap: 4px; }
.inventory-catalog-v49 > header .inventory-overview-v49 > em { display: grid; grid-template-columns: 16px auto; grid-template-rows: auto auto; align-items: center; gap: 0 4px; min-width: 88px; padding: 4px 7px; border: 1px solid color-mix(in srgb,var(--theme-border) 82%,transparent); border-radius: 10px; background: color-mix(in srgb,var(--theme-surface-soft) 76%,transparent); }
.inventory-overview-v49 svg { grid-row: 1/3; width: 15px; height: 15px; color: var(--theme-accent); }
.inventory-overview-v49 b { color: var(--theme-text); font-size: 10px; line-height: 1; }
.inventory-overview-v49 small { color: var(--theme-muted); font-size: 6.5px; font-weight: 750; line-height: 1.1; }
.inventory-content-v49 { padding: 8px; }
.inventory-v49 .inventory-items-v49 { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; padding: 0 1px 8px; }
.inventory-v49 .inventory-item-v49 {
  --rarity-color:#8ba0ad;
  isolation: isolate;
  display: grid;
  grid-template-rows: minmax(0,1fr) 30px;
  gap: 2px;
  min-height: 170px;
  height: 170px;
  padding: 7px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb,var(--rarity-color) 25%,var(--theme-border));
  border-radius: 17px;
  background: linear-gradient(155deg,color-mix(in srgb,var(--rarity-color) 5%,var(--theme-card)),var(--theme-card) 64%);
  box-shadow: 0 7px 18px rgba(4,34,51,.055),inset 0 1px rgba(255,255,255,.45);
  color: var(--theme-text);
}
.inventory-v49 .inventory-item-v49.rarity-uncommon { --rarity-color:#45ad73; }
.inventory-v49 .inventory-item-v49.rarity-rare { --rarity-color:#3f91e7; }
.inventory-v49 .inventory-item-v49.rarity-epic { --rarity-color:#8d61e1; }
.inventory-v49 .inventory-item-v49.rarity-legendary { --rarity-color:#e4a92f; }
.inventory-v49 .inventory-item-v49.rarity-quest { --rarity-color:#22a4b8; }
.inventory-v49 .inventory-item-v49.rarity-starter { --rarity-color:#ee7651; }
.inventory-v49 .inventory-item-v49::before,.inventory-v49 .inventory-item-v49::after { display: none !important; content: none !important; }
.inventory-v49 .inventory-item-v49:hover,.inventory-v49 .inventory-item-v49:focus-visible { z-index: 4; border-color: color-mix(in srgb,var(--rarity-color) 62%,var(--theme-border)); box-shadow: 0 12px 28px rgba(3,28,45,.14),0 0 0 2px color-mix(in srgb,var(--rarity-color) 10%,transparent); transform: translateY(-2px); }
.inventory-item-type-v49 { position: absolute; z-index: 4; top: 7px; left: 7px; display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid color-mix(in srgb,var(--rarity-color) 20%,var(--theme-border)); border-radius: 9px; background: color-mix(in srgb,var(--theme-card) 88%,transparent); color: var(--rarity-color); box-shadow: 0 3px 10px rgba(4,34,51,.06); }
.inventory-item-type-v49 svg { width: 16px; height: 16px; }
.inventory-item-rarity-v49 { top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border: 0; background: color-mix(in srgb,var(--rarity-color) 8%,var(--theme-card)); color: var(--rarity-color); font-size: 7px; letter-spacing: .02em; }
.inventory-item-rarity-v49 > i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb,currentColor 10%,transparent); }
.inventory-item-art-v49 { position: relative; width: 100%; height: 126px; overflow: hidden; border: 0; border-radius: 13px; background: radial-gradient(circle at 50% 53%,color-mix(in srgb,var(--rarity-color) 13%,var(--theme-card)),transparent 63%); box-shadow: none; }
.inventory-item-art-v49::before { content:""; position: absolute; z-index: -1; inset: 24% 16% 11%; border-radius: 50%; background: var(--rarity-color); filter: blur(24px); opacity: .08; }
.inventory-item-art-v49::after { content:""; position: absolute; z-index: 2; inset: -42% auto -42% -58%; width: 34%; background: linear-gradient(90deg,transparent,rgba(255,255,255,.38),transparent); opacity: 0; transform: skewX(-18deg); pointer-events: none; }
.inventory-item-v49:is(.rarity-uncommon,.rarity-rare,.rarity-epic,.rarity-legendary) .inventory-item-art-v49::after { opacity: .32; animation: inventory-rarity-sheen-v49 5.8s ease-in-out infinite; }
@keyframes inventory-rarity-sheen-v49 { 0%,64% { left:-58%; } 84%,100% { left:132%; } }
.inventory-item-art-v49 .item-icon,.inventory-item-art-v49 .item-icon img { width: 112px; height: 112px; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(4,31,46,.12)); transition: transform 180ms ease; }
.inventory-item-v49:hover .inventory-item-art-v49 .item-icon,.inventory-item-v49:focus-visible .inventory-item-art-v49 .item-icon { transform: translateY(-2px) scale(1.035); }
.inventory-item-art-v49 > em { right: 3px; bottom: 3px; display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 3px; min-width: 43px; padding: 5px 7px; border: 2px solid color-mix(in srgb,var(--theme-card) 92%,transparent); border-radius: 11px; background: color-mix(in srgb,#0d3048 94%,transparent); color: #fff; font-size: 12px; line-height: 1; box-shadow: 0 4px 12px rgba(2,24,39,.18); }
.inventory-item-art-v49 > em small { color: rgba(255,255,255,.65); font-size: 5px; font-weight: 900; letter-spacing: .06em; }
.inventory-item-favorite-v49 { position: absolute; z-index: 3; left: 5px; bottom: 5px; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 8px; background: color-mix(in srgb,#f0bc32 16%,var(--theme-card)); color: #d89a08; }
.inventory-item-favorite-v49 svg { width: 14px; height: 14px; }
.inventory-item-copy-v49 { display: grid; place-items: center; min-height: 28px; padding: 0 4px; }
.inventory-item-copy-v49 > b { display: -webkit-box; overflow: hidden; font-size: 11px; line-height: 1.16; text-align: center; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.inventory-item-tooltip-v49 { position: absolute; z-index: 12; inset: 5px; display: grid; grid-template-rows: auto auto 1fr auto; align-content: start; gap: 6px; padding: 12px; overflow: hidden; border: 1px solid color-mix(in srgb,var(--rarity-color) 30%,var(--theme-border)); border-radius: 14px; background: color-mix(in srgb,var(--theme-card) 94%,transparent); box-shadow: 0 12px 30px rgba(2,23,38,.2); opacity: 0; transform: scale(.96); pointer-events: none; text-align: left; backdrop-filter: blur(15px); transition: opacity 130ms ease,transform 130ms ease; }
.inventory-item-tooltip-v49 small { color: var(--rarity-color); font-size: 7px; font-weight: 950; letter-spacing: .05em; text-transform: uppercase; }
.inventory-item-tooltip-v49 b { display: -webkit-box; overflow: hidden; color: var(--theme-text); font-size: 10px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.inventory-item-tooltip-v49 em { display: -webkit-box; overflow: hidden; color: var(--theme-muted); font-size: 8px; font-style: normal; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.inventory-item-tooltip-v49 > i { align-self: end; color: var(--theme-accent); font-size: 7px; font-style: normal; font-weight: 900; }
.inventory-item-v49:hover .inventory-item-tooltip-v49,.inventory-item-v49:focus-visible .inventory-item-tooltip-v49 { opacity: 1; transform: scale(1); }
.inventory-v49.is-list .inventory-items-v49 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.inventory-v49.is-list .inventory-item-v49 { grid-template-columns: 82px minmax(0,1fr); grid-template-rows: 1fr; min-height: 92px; height: 92px; padding: 5px 9px; }
.inventory-v49.is-list .inventory-item-art-v49 { width: 80px; height: 80px; }
.inventory-v49.is-list .inventory-item-art-v49 .item-icon,.inventory-v49.is-list .inventory-item-art-v49 .item-icon img { width: 74px; height: 74px; }
.inventory-v49.is-list .inventory-item-copy-v49 { justify-items: start; padding-left: 7px; }
.inventory-v49.is-list .inventory-item-copy-v49 > b { font-size: 12px; text-align: left; }
.inventory-v49.is-list .inventory-item-type-v49 { display: none; }
.inventory-v49.is-list .inventory-item-rarity-v49 { top: 8px; }
.inventory-empty-v49 { min-height: 190px; margin-top: 24px; }

@media (max-width: 800px) {
  .inventory-v49 { gap: 7px; }
  .inventory-head-v49 { min-height: 54px; padding-right: 46px; }
  .inventory-title-v49 em { font-size: 7px; }
  .inventory-toolbar-v49 { grid-template-columns: minmax(0,1fr) 42px; }
  .inventory-layout-v49 { display: flex; flex-direction: column; gap: 6px; }
  .inventory-v49 .inventory-categories-v49 { display: flex; gap: 5px; padding: 4px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; }
  .inventory-v49 .inventory-categories-v49 > button { flex: 0 0 82px; width: 82px; min-height: 38px; scroll-snap-align: start; }
  .inventory-catalog-v49 > header { min-height: 40px; }
  .inventory-overview-v49 { display: none; }
  .inventory-content-v49 { padding: 6px; }
  .inventory-v49 .inventory-items-v49 { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .inventory-v49 .inventory-item-v49 { grid-template-rows: minmax(0,1fr) 30px; min-height: 151px; height: 151px; padding: 6px; }
  .inventory-item-art-v49 { height: 110px; }
  .inventory-item-art-v49 .item-icon,.inventory-item-art-v49 .item-icon img { width: 96px; height: 96px; }
  .inventory-item-rarity-v49 { top: 6px; right: 6px; font-size: 6px; }
  .inventory-item-type-v49 { top: 6px; left: 6px; width: 24px; height: 24px; }
  .inventory-item-copy-v49 > b { font-size: 10px; }
  .inventory-item-tooltip-v49 { display: none; }
  .inventory-v49.is-list .inventory-items-v49 { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .inventory-wallet-v49 > span { min-height: 32px; }
  .inventory-v49 .inventory-item-v49 { min-height: 145px; height: 145px; }
  .inventory-item-art-v49 { height: 104px; }
  .inventory-item-art-v49 .item-icon,.inventory-item-art-v49 .item-icon img { width: 90px; height: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  .inventory-item-art-v49::after { animation: none !important; opacity: 0 !important; }
  .inventory-item-v49,.inventory-item-v49 .item-icon,.inventory-item-tooltip-v49 { transition: none !important; }
}

/* v4.5 — generation-scoped Pokédex, six-slot team and owned Pokémon dashboard. */
.pokedex-generation-track > button { min-width: 142px; }
.pokedex-generation-track > button.is-active { box-shadow: 0 7px 18px color-mix(in srgb,var(--theme-accent) 15%,transparent),inset 0 -3px 0 var(--theme-accent); }
.pokedex-results-meta > span { letter-spacing: .01em; }
.dex-detail-v43 .dex-visual::before {
  width: min(320px,76%);
  border-radius: 38%;
  background:
    radial-gradient(circle at 50% 50%,transparent 0 43%,color-mix(in srgb,var(--dex-accent) 8%,transparent) 44% 45%,transparent 46%),
    linear-gradient(135deg,color-mix(in srgb,var(--dex-accent) 7%,transparent),transparent 48%,color-mix(in srgb,var(--dex-accent-2) 6%,transparent));
  transform: translate(-50%,-50%) rotate(var(--species-angle));
  animation: none !important;
}
.dex-innate-card > img { width: 48px !important; height: 48px !important; }

@media (min-width: 801px) {
  .game-screen .side-panel.is-team-panel { width: min(900px,calc(100vw - 132px)); height: min(720px,calc(100dvh - 92px)); }
  .game-screen .side-panel.is-center-panel { width: min(1040px,calc(100vw - 132px)); height: min(760px,calc(100dvh - 92px)); }
  .game-screen .side-panel.is-pokemon-detail-panel { width: min(1200px,calc(100vw - 110px)); height: min(790px,calc(100dvh - 72px)); }
}

.team-window-v45,.center-window-v45,.pokemon-instance-v45 { min-width: 0; color: var(--theme-text); }
.team-window-v45,.center-window-v45 { display: grid; gap: 10px; height: 100%; min-height: 0; }
.team-window-v45 { grid-template-rows: auto auto minmax(0,1fr) auto; }
.center-window-v45 { grid-template-rows: auto auto minmax(0,1fr); }
.team-head-v45,.center-head-v45 { padding: 2px 4px 9px; border-bottom: 1px solid var(--theme-border); cursor: grab; }
.team-head-v45:active,.center-head-v45:active,.pokemon-detail-head-v45:active { cursor: grabbing; }
.team-grid-v45 { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; min-height: 0; overflow: auto; padding: 2px; }
.team-slot-v45 {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto auto auto;
  min-width: 0;
  min-height: 244px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb,var(--species-accent,var(--theme-accent)) 28%,var(--theme-border));
  border-radius: 21px;
  background:
    radial-gradient(circle at 78% 18%,color-mix(in srgb,var(--species-accent,var(--theme-accent)) 14%,transparent),transparent 34%),
    linear-gradient(150deg,color-mix(in srgb,var(--species-accent,var(--theme-accent)) 4%,var(--theme-card)),var(--theme-card) 58%);
  box-shadow: 0 8px 25px rgba(7,39,56,.08);
}
.team-slot-v45::after { content: ""; position: absolute; right: -40px; top: 38px; width: 120px; height: 120px; border: 1px solid color-mix(in srgb,var(--species-accent,var(--theme-accent)) 11%,transparent); border-radius: 50%; pointer-events: none; }
.team-slot-v45.is-lead { border-color: color-mix(in srgb,var(--species-accent,var(--theme-accent)) 70%,var(--theme-border)); box-shadow: 0 10px 28px color-mix(in srgb,var(--species-accent,var(--theme-accent)) 16%,transparent),inset 0 3px var(--species-accent,var(--theme-accent)); }
.team-slot-v45 > header { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 0; }
.team-slot-v45 > header span { color: var(--theme-muted); font-size: .58rem; font-weight: 900; }
.team-slot-v45 > header small { padding: 4px 7px; border-radius: 999px; background: color-mix(in srgb,var(--species-accent,var(--theme-accent)) 10%,var(--theme-card)); color: var(--species-accent,var(--theme-accent)); font-size: .48rem; font-weight: 900; }
.team-slot-main-v45 { position: relative; z-index: 1; display: grid; grid-template-rows: 115px auto; min-width: 0; padding: 0 10px 5px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.team-slot-art-v45 { display: grid; place-items: center; min-height: 0; }
.team-slot-portrait-v45 { width: 126px; height: 112px; overflow: visible; filter: drop-shadow(0 11px 9px rgba(1,30,44,.22)); }
.team-slot-portrait-v45 img { width: 100%; height: 100%; object-fit: contain; }
.team-slot-copy-v45 { min-width: 0; }
.team-slot-copy-v45 > b { display: block; overflow: hidden; font-size: .9rem; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.team-slot-copy-v45 > b i { margin-left: 4px; color: #efb51c; font-style: normal; }
.team-slot-copy-v45 > em { display: flex; justify-content: center; margin-top: 4px; font-style: normal; }
.team-slot-copy-v45 > small { display: block; margin-top: 4px; color: var(--theme-muted); font-size: .52rem; text-align: center; }
.team-slot-progress-v45 { display: grid; gap: 3px; padding: 0 10px 7px; }
.team-slot-progress-v45 > span { display: flex; justify-content: space-between; color: var(--theme-muted); font-size: .43rem; }
.team-slot-progress-v45 > i { height: 5px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb,var(--theme-text) 7%,transparent); }
.team-slot-progress-v45 > i em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--species-accent,var(--theme-accent)),#66d1df); }
.team-slot-stats-v45 { display: grid; grid-template-columns: 1fr 1fr; margin: 0 10px 8px; border: 1px solid var(--theme-border); border-radius: 11px; background: color-mix(in srgb,var(--theme-surface-soft) 82%,transparent); }
.team-slot-stats-v45 span { display: flex; align-items: center; justify-content: space-between; min-width: 0; padding: 5px 7px; }
.team-slot-stats-v45 span + span { border-left: 1px solid var(--theme-border); }
.team-slot-stats-v45 small { color: var(--theme-muted); font-size: .41rem; }
.team-slot-stats-v45 b { color: var(--species-accent,var(--theme-accent)); font-size: .68rem; }
.team-slot-v45 > footer { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr auto; gap: 5px; padding: 0 8px 8px; }
.team-slot-v45 > footer :is(button,span),.team-slot-v45.is-empty > button { display: grid; place-items: center; min-height: 28px; padding: 0 7px; border: 1px solid var(--theme-border); border-radius: 9px; background: var(--theme-surface-soft); color: var(--theme-muted); font-size: .46rem; font-weight: 850; }
.team-slot-v45 > footer span { color: var(--species-accent,var(--theme-accent)); }
.team-slot-v45.is-empty { place-items: center; grid-template-rows: auto 1fr auto auto; border-style: dashed; background: color-mix(in srgb,var(--theme-surface-soft) 70%,transparent); box-shadow: none; color: var(--theme-muted); }
.team-slot-v45.is-empty::after { right: 50%; top: 50%; transform: translate(50%,-50%); }
.team-slot-v45.is-empty > header { width: 100%; }
.team-slot-v45.is-empty > i { align-self: end; display: grid; place-items: center; width: 62px; height: 62px; border: 1px dashed var(--theme-border); border-radius: 22px; background: var(--theme-card); }
.team-slot-v45.is-empty > i .ui-icon { width: 28px; height: 28px; }
.team-slot-v45.is-empty > div { z-index: 1; text-align: center; }
.team-slot-v45.is-empty > div b { display: block; color: var(--theme-text); font-size: .7rem; }
.team-slot-v45.is-empty > div small { display: block; margin-top: 3px; font-size: .48rem; }
.team-slot-v45.is-empty > button { z-index: 1; min-width: 110px; margin: 8px 8px 10px; color: var(--theme-accent); cursor: pointer; }
.team-summary-v45 { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 7px; }
.team-summary-v45 > span { display: grid; place-items: center; min-height: 46px; border: 1px solid var(--theme-border); border-radius: 13px; background: var(--theme-surface-soft); }
.team-summary-v45 small { color: var(--theme-muted); font-size: .48rem; }
.team-summary-v45 b { font-size: 1rem; }

.center-grid-v45 { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-content: start; gap: 9px; min-height: 0; overflow: auto; padding: 2px 3px 8px 2px; }
.center-card-v45 { position: relative; display: grid; grid-template-rows: auto auto auto auto; min-width: 0; min-height: 278px; overflow: hidden; border: 1px solid color-mix(in srgb,var(--species-accent,var(--theme-accent)) 24%,var(--theme-border)); border-radius: 20px; background: radial-gradient(circle at 25% 32%,color-mix(in srgb,var(--species-accent,var(--theme-accent)) 13%,transparent),transparent 34%),var(--theme-card); }
.center-card-v45.is-lead { box-shadow: inset 0 3px var(--species-accent,var(--theme-accent)); }
.center-card-v45 > header { display: flex; align-items: center; justify-content: space-between; padding: 8px 9px 0; }
.center-card-v45 > header small { color: var(--species-accent,var(--theme-accent)); font-size: .47rem; font-weight: 900; }
.center-card-v45 > header span { color: var(--theme-muted); font-size: .5rem; font-weight: 850; }
.center-main-v45 { display: grid; grid-template-columns: 112px minmax(0,1fr); align-items: center; min-width: 0; padding: 3px 9px 1px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.center-art-v45 { display: grid; place-items: center; }
.center-portrait-v45 { width: 110px; height: 112px; overflow: visible; filter: drop-shadow(0 9px 8px rgba(4,32,46,.2)); }
.center-portrait-v45 img { width: 100%; height: 100%; object-fit: contain; }
.center-copy-v45 { min-width: 0; }
.center-copy-v45 > b { display: block; overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.center-copy-v45 > b i { color: #efb51c; font-style: normal; }
.center-copy-v45 > em { display: flex; margin-top: 5px; font-style: normal; }
.center-copy-v45 > small { display: block; margin-top: 5px; color: var(--theme-muted); font-size: .48rem; }
.center-copy-v45 > code { display: block; overflow: hidden; margin-top: 6px; color: color-mix(in srgb,var(--species-accent,var(--theme-accent)) 72%,var(--theme-text)); font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: .45rem; text-overflow: ellipsis; white-space: nowrap; }
.center-potential-v45 { display: grid; gap: 4px; margin: 0 10px 9px; }
.center-potential-v45 > span { display: flex; justify-content: space-between; color: var(--theme-muted); font-size: .43rem; }
.center-potential-v45 > i { height: 6px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb,var(--theme-text) 7%,transparent); }
.center-potential-v45 > i em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--species-accent,var(--theme-accent)),#5ed3b4); }
.center-actions-v45 { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; padding: 0 8px 8px; }
.center-actions-v45 button { min-height: 29px; padding: 0 6px; border: 1px solid var(--theme-border); border-radius: 9px; background: var(--theme-surface-soft); color: var(--theme-muted); font-size: .46rem; font-weight: 850; }
.center-actions-v45 button.is-primary { color: var(--species-accent,var(--theme-accent)); border-color: color-mix(in srgb,var(--species-accent,var(--theme-accent)) 38%,var(--theme-border)); }
.center-actions-v45 button.is-evolve { color: #8a61d6; }

.pokemon-instance-v45 { height: 100%; min-height: 0; }
.pokemon-detail-head-v45 { padding: 2px 4px 8px; cursor: grab; }
.pokemon-instance-grid-v45 { display: grid; grid-template-columns: minmax(390px,.88fr) minmax(0,1.12fr); gap: 10px; min-height: 0; }
.pokemon-instance-left-v45,.pokemon-instance-right-v45 { display: grid; align-content: start; gap: 9px; min-width: 0; }
.pokemon-detail-hero-v45 { grid-template-columns: 165px minmax(0,1fr); min-height: 192px; padding: 12px; overflow: hidden; background: radial-gradient(circle at 22% 48%,color-mix(in srgb,var(--species-accent) 15%,transparent),transparent 35%),var(--theme-card); }
.pokemon-detail-art-v45 { display: grid; place-items: center; }
.pokemon-detail-portrait-v45 { width: 166px; height: 166px; overflow: visible; filter: drop-shadow(0 14px 12px rgba(2,28,42,.22)); }
.pokemon-detail-portrait-v45 img { width: 100%; height: 100%; object-fit: contain; }
.pokemon-genome-card-v45 { grid-template-columns: 150px minmax(0,1fr) 42px; margin: 0; padding: 11px; background: linear-gradient(120deg,color-mix(in srgb,#24b9cf 10%,var(--theme-card)),color-mix(in srgb,#6a5cdb 5%,var(--theme-card))); }
.pokemon-genome-card-v45 > img { width: 148px; height: 62px; object-fit: contain; }
.pokemon-genome-card-v45 b { overflow-wrap: anywhere; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: .78rem; letter-spacing: .04em; }
.pokemon-genome-card-v45 code { display: block; margin-top: 3px; color: var(--theme-muted); font-size: .5rem; }
.pokemon-trait-grid-v45 { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin: 0; }
.pokemon-trait-grid-v45 article { min-height: 66px; padding: 9px; }
.pokemon-trait-grid-v45 b { font-size: .66rem; }
.pokemon-trait-grid-v45 span { font-size: .47rem; }
.pokemon-instance-v45 .pokemon-detail-section { margin-top: 0; padding: 10px; }
.pokemon-effective-stats-v45 { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 5px; }
.pokemon-stat-tile-v45 { min-width: 0; padding: 7px 5px !important; text-align: center; }
.pokemon-stat-tile-v45 small { overflow: hidden; font-size: .46rem; text-overflow: ellipsis; white-space: nowrap; }
.pokemon-stat-tile-v45 b { font-size: .9rem; }
.pokemon-stat-tile-v45 span { font-size: .4rem; }
.pokemon-gene-grid-v45 { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
.pokemon-gene-tile-v45 { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px; padding: 7px; border: 1px solid var(--theme-border); border-radius: 10px; background: var(--theme-surface-soft); }
.pokemon-gene-tile-v45 span { overflow: hidden; color: var(--theme-muted); font-size: .48rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.pokemon-gene-tile-v45 b { font-size: .64rem; }
.pokemon-gene-tile-v45 b small { color: var(--theme-muted); font-size: .4rem; }
.pokemon-gene-tile-v45 > i { grid-column: 1/-1; height: 5px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb,var(--theme-text) 7%,transparent); }
.pokemon-gene-tile-v45 > i em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#48c778,var(--species-accent,var(--theme-accent))); }
.pokemon-mastery-section-v45 { min-height: 0; }
.pokemon-detail-actions-v45 { margin-top: 0; }

/* Inventory: two balanced navigation rows, consistent art and a useful empty state. */
.inventory-v45 { position: relative; isolation: isolate; }
.inventory-v45::before,.inventory-v45::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.inventory-v45::before { left: -30px; bottom: -44px; width: 190px; height: 140px; border: 1px solid color-mix(in srgb,var(--inv-blue) 10%,transparent); border-radius: 58% 42% 0 0; transform: rotate(12deg); }
.inventory-v45::after { right: 5%; top: 74px; width: 160px; height: 160px; background: radial-gradient(circle,color-mix(in srgb,var(--inv-blue) 5%,transparent),transparent 68%); }
.inventory-v45 .inventory-v2740__categories { grid-template-columns: repeat(5,minmax(96px,1fr)); gap: 5px; }
.inventory-v45 .inventory-v2740__categories button { grid-template-columns: 30px minmax(0,1fr); grid-template-rows: 1fr; justify-items: start; min-height: 43px; padding: 5px 9px; }
.inventory-v45 .inventory-v2740__categories button > span { font-size: .5rem; }
.inventory-v45 .inventory-v2740__categories .inventory-category-icon,.inventory-v45 .inventory-v2740__categories .inventory-ui-icon { width: 26px; height: 26px; }
.inventory-v45 .inventory-v2740__items { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.inventory-v45 .inventory-item-v2740 { grid-template-rows: 70px minmax(30px,auto) 22px; min-height: 136px; padding: 8px; }
.inventory-v45 .inventory-item-v2740__art { width: 70px; height: 70px; }
.inventory-v45 .inventory-item-v2740__art .item-icon,.inventory-v45 .inventory-item-v2740__art .item-graphic-base { width: 59px; height: 59px; object-fit: contain; }
.inventory-v45 .inventory-item-v2740__name b { font-size: .6rem; }
.inventory-v45 .inventory-item-v2741__name > small { font-size: .46rem; }
.inventory-empty-v45 { align-self: center; justify-self: center; width: min(430px,86%); min-height: 220px; padding: 24px; border: 1px solid color-mix(in srgb,var(--inv-blue) 18%,var(--inv-line)); border-radius: 24px; background: radial-gradient(circle at 18% 14%,color-mix(in srgb,var(--inv-blue) 10%,transparent),transparent 30%),var(--inv-card); box-shadow: 0 16px 40px rgba(7,42,61,.08); text-align: center; }
.inventory-empty-v45 > span { display: grid; place-items: center; width: 66px; height: 66px; border: 1px solid var(--inv-line); border-radius: 22px; background: color-mix(in srgb,var(--inv-blue) 7%,var(--inv-soft)); color: var(--inv-blue); }
.inventory-empty-v45 > span .inventory-ui-icon { width: 34px; height: 34px; opacity: 1; }
.inventory-empty-v45 > small { color: var(--inv-blue); font-size: .48rem; font-weight: 900; letter-spacing: .11em; }
.inventory-empty-v45 > b { font-size: 1rem; }
.inventory-empty-v45 > p { max-width: 330px; margin: 0; color: var(--inv-muted); font-size: .62rem; line-height: 1.45; }
.inventory-empty-v45 > button { min-height: 34px; margin-top: 5px; padding: 0 14px; border: 1px solid color-mix(in srgb,var(--inv-blue) 35%,var(--inv-line)); border-radius: 11px; background: color-mix(in srgb,var(--inv-blue) 8%,var(--inv-card)); color: var(--inv-blue); font-size: .54rem; font-weight: 850; cursor: pointer; }

@media (max-width: 1000px) and (min-width: 801px) {
  .team-grid-v45,.center-grid-v45 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pokemon-instance-grid-v45 { grid-template-columns: minmax(330px,.9fr) minmax(0,1.1fr); }
  .pokemon-trait-grid-v45 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pokemon-effective-stats-v45 { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 800px) {
  .game-screen .side-panel:is(.is-team-panel,.is-center-panel,.is-pokemon-detail-panel) { width: auto; }
  .team-grid-v45,.center-grid-v45 { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; overflow: visible; }
  .team-slot-v45 { min-height: 218px; }
  .team-slot-main-v45 { grid-template-rows: 94px auto; padding-inline: 6px; }
  .team-slot-portrait-v45 { width: 96px; height: 92px; }
  .team-slot-copy-v45 > b { font-size: .72rem; }
  .team-slot-stats-v45 { margin-inline: 6px; }
  .team-slot-v45 > footer { grid-template-columns: 1fr; }
  .team-summary-v45 { grid-template-columns: 1fr 1fr; }
  .team-summary-v45 .panel-primary { grid-column: 1/-1; }
  .center-card-v45 { min-height: 244px; }
  .center-main-v45 { grid-template-columns: 84px minmax(0,1fr); padding-inline: 6px; }
  .center-portrait-v45 { width: 84px; height: 92px; }
  .center-copy-v45 > code { display: none; }
  .center-actions-v45 { grid-template-columns: 1fr; }
  .pokemon-instance-grid-v45 { grid-template-columns: 1fr; }
  .pokemon-detail-hero-v45 { grid-template-columns: 116px minmax(0,1fr); min-height: 148px; }
  .pokemon-detail-portrait-v45 { width: 118px; height: 118px; }
  .pokemon-genome-card-v45 { grid-template-columns: 105px minmax(0,1fr) 36px; }
  .pokemon-genome-card-v45 > img { width: 102px; }
  .pokemon-trait-grid-v45 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pokemon-effective-stats-v45,.pokemon-gene-grid-v45 { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .inventory-v45 .inventory-v2740__categories { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .inventory-v45 .inventory-v2740__categories button { flex: 0 0 94px; grid-template-columns: 25px minmax(0,1fr); }
  .inventory-v45 .inventory-v2740__items { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .inventory-empty-v45 { min-height: 190px; padding: 18px; }
}

@media (max-width: 430px) {
  .team-slot-v45 { min-height: 206px; border-radius: 17px; }
  .team-slot-copy-v45 > small,.team-slot-progress-v45 { display: none; }
  .team-slot-stats-v45 { margin-top: 4px; }
  .team-slot-stats-v45 span { display: grid; padding: 4px 5px; text-align: center; }
  .center-grid-v45 { grid-template-columns: 1fr; }
  .pokemon-detail-hero-v45 { grid-template-columns: 98px minmax(0,1fr); padding: 8px; }
  .pokemon-detail-portrait-v45 { width: 100px; height: 105px; }
  .pokemon-detail-hero-v45 h2 { font-size: 1.1rem; }
  .pokemon-genome-card-v45 { grid-template-columns: 82px minmax(0,1fr) 32px; padding: 8px; }
  .pokemon-genome-card-v45 > img { width: 80px; height: 54px; }
  .pokemon-genome-card-v45 b { font-size: .62rem; }
  .pokemon-trait-grid-v45,.pokemon-effective-stats-v45,.pokemon-gene-grid-v45 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .inventory-v45 .inventory-item-v2740 { min-height: 124px; }
  .inventory-v45 .inventory-item-v2740__art { width: 62px; height: 62px; }
  .inventory-v45 .inventory-item-v2740__art .item-icon,.inventory-v45 .inventory-item-v2740__art .item-graphic-base { width: 52px; height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .pokedex-scroll-track { scroll-behavior: auto; }
  .game-screen .side-panel:is(.is-pokedex-panel,.is-pokedex-detail,.is-inventory-panel),
  .game-screen .world-rail { transition-duration: 1ms !important; }
}

/* v4.3 — compact Russian Pokédex dossier and mobile HUD polish */
.quest-widget-journal { display: none; }
.pokedex-nav-device img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 4px 5px rgba(4,30,42,.2)); }

.pokedex-library { gap: 9px; }
.pokedex-library-head {
  grid-template-columns: minmax(0,1fr) 220px;
  min-height: 104px;
  padding: 14px 64px 14px 16px;
  border-radius: 20px;
  cursor: grab;
  user-select: none;
}
.pokedex-library-head.is-dragging,
.dex-detail-head.is-dragging { cursor: grabbing; }
.pokedex-library-title { grid-template-columns: 68px minmax(0,1fr); gap: 12px; }
.pokedex-library-mark { width: 68px; height: 68px; border: 0; background: rgba(239,253,255,.09); }
.pokedex-library-mark img { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0,12,21,.3)); }
.pokedex-library-title h2 { margin: 4px 0 0; font-size: clamp(2rem,3vw,2.8rem); }
.pokedex-library-title small { font-size: .56rem; }
.pokedex-progress { padding: 10px 12px 9px; border-radius: 15px; }
.pokedex-progress > i { height: 6px; }
.pokedex-progress-next { grid-column: 1/-1; margin-top: 1px; color: rgba(226,246,248,.62); font-size: .5rem !important; }

.pokedex-toolbar { grid-template-columns: minmax(260px,.72fr) minmax(460px,1.28fr); gap: 7px; }
.pokedex-search { min-height: 42px; border-radius: 13px; }
.pokedex-filter-tabs { padding: 3px; border-radius: 13px; }
.pokedex-filter-tabs button { min-height: 34px; font-size: .63rem; }
.pokedex-scroll-filter { grid-template-columns: 96px minmax(0,1fr); gap: 6px; padding: 5px; border-radius: 14px; }
.pokedex-scroll-filter > header { gap: 4px; padding: 3px; }
.pokedex-scroll-filter > header small { font-size: .46rem; }
.pokedex-scroll-filter > header b { font-size: .62rem; }
.pokedex-scroll-filter > header nav { gap: 4px; }
.pokedex-scroll-filter > header nav button { width: 30px; height: 27px; border-radius: 8px; }
.pokedex-generation-track > button { flex-basis: 123px; min-height: 49px; padding: 6px 8px; border-radius: 11px; }
.pokedex-generation-track > button.is-all { flex-basis: 146px; }
.pokedex-generation-track > button em { position: relative; z-index: 1; }
.pokedex-generation-track > button em span { color: var(--theme-accent); }
.pokedex-type-filter-v42 { grid-template-columns: 96px minmax(0,1fr); }
.pokedex-type-track > button { min-height: 38px; padding: 0 9px; border-radius: 10px; }
.pokedex-filter-type-icon { width: 18px; height: 18px; object-fit: contain; }
.pokedex-filter-type-icon.is-device { width: 22px; height: 22px; }
.pokedex-type-track > button > .pokedex-filter-type-icon { filter: drop-shadow(0 2px 3px color-mix(in srgb,var(--type-chip) 28%,transparent)); }
.pokedex-results-meta { min-height: 20px; }

.pokedex-grid-v41 { gap: 8px; }
.pokedex-grid-v41 .pokedex-species-card { min-height: 122px; grid-template-columns: 94px minmax(0,1fr); padding: 13px 10px 9px; overflow: hidden; }
.pokedex-grid-v41 .pokedex-species-card::before {
  background:
    radial-gradient(circle at var(--species-spot-x) var(--species-spot-y),color-mix(in srgb,var(--species-accent) 22%,transparent),transparent 32%),
    linear-gradient(var(--species-angle),color-mix(in srgb,var(--species-accent-2) 10%,transparent),transparent 52%),
    linear-gradient(135deg,var(--ui-highlight),transparent 55%);
}
.pokedex-grid-v41 .pokedex-species-card::after {
  left: 16px;
  bottom: 2px;
  width: 82px;
  height: 82px;
  border: 0;
  border-radius: 0;
  background: var(--species-type-icon) center/contain no-repeat;
  box-shadow: none;
  opacity: .075;
  transform: rotate(var(--species-angle));
}
.pokedex-card-art { position: relative; z-index: 1; width: 91px; height: 91px; overflow: visible; }
.pokedex-home-portrait { overflow: visible; }
.pokedex-home-portrait img { width: 100%; height: 100%; object-fit: contain; }
.pokedex-grid-v41 .pokedex-species-card.is-locked .pokedex-home-portrait img { filter: saturate(.76) drop-shadow(0 8px 8px rgba(0,20,29,.15)); }
.pokedex-grid-v41 .pokedex-species-card > em.is-caught { background: color-mix(in srgb,#55bd69 15%,var(--theme-card)); color: color-mix(in srgb,#44a95a 80%,var(--theme-text)); }

.dex-detail-v43 { display: grid; grid-template-rows: auto minmax(0,1fr); height: 100%; min-height: 0; gap: 9px; }
.dex-detail-v43 .dex-detail-head { position: relative; top: auto; margin: 0; min-height: 62px; padding: 7px 54px 7px 7px; cursor: grab; user-select: none; }
.dex-detail-v43 .dex-detail-head > span small { font-size: .55rem; }
.dex-detail-v43 .dex-detail-head h2 { margin-top: 2px; font-size: 1.65rem; }
.dex-detail-v43 .dex-detail-head > button { min-height: 38px; }
.dex-dossier-grid { display: grid; grid-template-columns: minmax(0,.93fr) minmax(0,1.07fr); gap: 9px; min-height: 0; }
.dex-dossier-left,
.dex-dossier-right { display: grid; gap: 9px; min-width: 0; min-height: 0; }
.dex-dossier-left { grid-template-rows: minmax(0,1fr) 250px; }
.dex-dossier-right { grid-template-rows: auto minmax(0,1fr) auto; align-content: stretch; }
.dex-detail-v43 .dex-hero-card { display: grid; grid-template-rows: auto minmax(190px,1fr) auto auto; min-height: 0; padding: 9px; overflow: hidden; }
.dex-detail-v43 .dex-hero-card::before {
  height: 100%;
  background:
    radial-gradient(circle at var(--species-spot-x) var(--species-spot-y),color-mix(in srgb,var(--species-accent) 21%,transparent),transparent 35%),
    linear-gradient(var(--species-angle),color-mix(in srgb,var(--species-accent-2) 14%,transparent),transparent 55%);
  opacity: 1;
}
.dex-detail-v43 .dex-hero-card::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 68px;
  width: 170px;
  height: 170px;
  background: var(--species-type-icon) center/contain no-repeat;
  opacity: .06;
  pointer-events: none;
}
.dex-detail-v43 .dex-visual-tabs { z-index: 2; align-items: center; margin-bottom: 5px; }
.dex-detail-v43 .dex-visual-tabs > em { margin-left: auto; padding: 5px 8px; border-radius: 9px; background: color-mix(in srgb,var(--dex-accent) 11%,var(--theme-card)); color: var(--dex-accent); font-size: .56rem; font-style: normal; font-weight: 800; }
.dex-detail-v43 .dex-visual { min-height: 190px; overflow: visible; border-radius: 15px; background: radial-gradient(circle at 50% 58%,color-mix(in srgb,var(--dex-accent) 20%,transparent),transparent 58%),color-mix(in srgb,var(--theme-surface-soft) 78%,transparent); }
.dex-detail-v43 .dex-main-portrait { width: min(250px,80%); height: min(250px,100%); overflow: visible; }
.dex-detail-v43 .dex-main-portrait img { width: 100%; height: 100%; object-fit: contain; }
.dex-detail-v43 .dex-identity { grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; padding: 6px 2px 3px; }
.dex-detail-v43 .dex-identity p { display: grid; gap: 2px; min-width: 0; }
.dex-detail-v43 .dex-identity p b { overflow: hidden; color: var(--theme-text); font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.dex-detail-v43 .dex-identity p span { color: var(--theme-muted); font-size: .54rem; }

.dex-detail-v43 .dex-physical-profile { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; margin-top: 4px; }
.dex-detail-v43 .dex-physical-profile > article { grid-template-columns: 25px minmax(0,1fr); min-height: 49px; gap: 5px; padding: 5px; border-radius: 10px; }
.dex-detail-v43 .dex-physical-profile > article > img,
.dex-detail-v43 .dex-size-frequency-card header img { width: 22px; height: 22px; }
.dex-detail-v43 .dex-physical-profile article small { font-size: .43rem !important; }
.dex-detail-v43 .dex-physical-profile article b { margin-top: 1px; font-size: .7rem; }
.dex-detail-v43 .dex-physical-profile article em { font-size: .46rem; white-space: nowrap; }
.dex-detail-v43 .dex-physical-profile .dex-size-range-card { grid-column: auto; grid-template-columns: 25px minmax(0,1fr); }
.dex-detail-v43 .dex-physical-profile .dex-size-frequency-card { grid-column: 1/-1; display: grid; grid-template-columns: 95px minmax(0,1fr); align-items: center; min-height: 54px; padding: 5px 7px; }
.dex-detail-v43 .dex-size-frequency-card header { grid-template-columns: 24px minmax(0,1fr); gap: 4px; margin: 0; }
.dex-detail-v43 .dex-size-distribution { height: 44px; gap: 3px; }
.dex-detail-v43 .dex-size-frequency b { font-size: .45rem; }
.dex-detail-v43 .dex-size-frequency small { font-size: .42rem !important; }

.dex-detail-v43 .dex-stats-card { min-height: 0; padding: 10px 11px; }
.dex-detail-v43 .dex-stats-card > header { margin-bottom: 5px; }
.dex-detail-v43 .dex-stats-card > header b { font-size: 1rem; }
.dex-detail-v43 .dex-stat-row { grid-template-columns: 94px 27px minmax(0,1fr); min-height: 22px; gap: 5px; margin: 2px 0; }
.dex-detail-v43 .dex-stat-row > span b { font-size: .59rem; }
.dex-detail-v43 .dex-stat-row > strong { font-size: .67rem; }
.dex-detail-v43 .dex-stat-row > em { grid-column: 3; grid-row: 1; height: 5px; }
.dex-detail-v43 .dex-stats-card > footer { gap: 4px; margin-top: 4px; }
.dex-detail-v43 .dex-stats-card > footer span { padding: 4px 5px; border-radius: 8px; }
.dex-detail-v43 .dex-stats-card > footer b { font-size: .61rem; }

.dex-detail-v43 .dex-section { min-height: 0; padding: 10px; overflow: visible; }
.dex-detail-v43 .dex-section > header { margin-bottom: 7px; }
.dex-detail-v43 .dex-section > header h3 { font-size: 1rem; }
.dex-detail-v43 .dex-section > header em { font-size: .52rem; }
.dex-detail-v43 .dex-evolution-chain { gap: 5px; overflow-x: auto; }
.dex-detail-v43 .dex-evolution-chain button { grid-template-columns: 44px minmax(68px,1fr); min-width: 130px; padding: 5px; }
.dex-detail-v43 .dex-evo-portrait { width: 44px; height: 44px; overflow: visible; }
.dex-detail-v43 .dex-evo-portrait img { width: 100%; height: 100%; }
.dex-detail-v43 .dex-evolution-chain button span em { max-width: 102px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dex-detail-v43 .dex-form-list { margin-top: 5px; }
.dex-detail-v43 .dex-form-list span { padding: 4px 6px; font-size: .5rem; }

.dex-detail-v43 .dex-skills-section { display: grid; grid-template-rows: auto minmax(0,1fr); }
.dex-detail-v43 .dex-skills-grid { grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; gap: 6px; }
.dex-detail-v43 .dex-skill-card { position: relative; grid-template-columns: 44px minmax(0,1fr); min-height: 64px; padding: 6px; overflow: visible; }
.dex-detail-v43 .dex-skill-card > span:first-child { width: 42px; height: 42px; border-radius: 10px; }
.dex-detail-v43 .dex-skill-card b { font-size: .63rem; }
.dex-detail-v43 .dex-skill-card small,
.dex-detail-v43 .dex-skill-card em { font-size: .48rem; }
.dex-skill-tooltip {
  position: absolute;
  z-index: 30;
  right: 0;
  bottom: calc(100% + 7px);
  display: grid;
  width: min(280px,75vw);
  padding: 10px;
  border: 1px solid color-mix(in srgb,var(--dex-accent) 45%,var(--theme-border));
  border-radius: 13px;
  background: color-mix(in srgb,var(--ui-glass-strong) 97%,var(--theme-card));
  color: var(--theme-text);
  box-shadow: 0 18px 38px rgba(2,25,37,.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px) scale(.98);
  transition: opacity 130ms ease,transform 150ms ease;
}
.dex-skill-tooltip small { color: var(--dex-accent) !important; font-weight: 850; }
.dex-skill-tooltip b { margin-top: 2px; font-size: .75rem !important; }
.dex-skill-tooltip p { margin: 5px 0; color: var(--theme-muted); font-size: .6rem; line-height: 1.42; }
.dex-skill-tooltip em { color: var(--dex-accent) !important; font-size: .52rem !important; }
.dex-skill-card:hover .dex-skill-tooltip,
.dex-skill-card:focus-visible .dex-skill-tooltip,
.dex-skill-card.is-active:focus .dex-skill-tooltip { opacity: 1; transform: none; }
.dex-passive-strip { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.dex-passive-strip > article { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 7px; min-height: 66px; padding: 7px; border: 1px solid var(--theme-border); border-radius: 13px; background: var(--theme-card); }
.dex-passive-strip svg { width: 26px; height: 26px; color: var(--dex-accent); }
.dex-passive-strip span { min-width: 0; }
.dex-passive-strip small { color: var(--dex-accent); font-size: .46rem !important; font-weight: 850; }
.dex-passive-strip b { display: block; margin: 1px 0 2px; overflow: hidden; font-size: .61rem; text-overflow: ellipsis; white-space: nowrap; }
.dex-passive-strip p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--theme-muted); font-size: .49rem; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

@media (min-width: 801px) {
  .game-screen .side-panel:is(.is-pokedex-panel,.is-pokedex-detail) {
    top: calc(50% + var(--panel-drag-y,0px)) !important;
    left: calc(50% + var(--panel-drag-x,0px)) !important;
  }
  .game-screen .side-panel.is-pokedex-detail { width: min(1120px,calc(100vw - 104px)) !important; height: min(820px,calc(100dvh - 24px)) !important; }
  .game-screen .side-panel.is-pokedex-detail #sidePanelContent { padding-bottom: 0; overflow: hidden; }
  .game-screen .side-panel.is-pokedex-detail > .panel-close { top: 11px; right: 11px; width: 40px; height: 40px; }
  .dex-detail-v43 .dex-physical-profile .dex-size-frequency-card { display: none; }
}

@media (max-width: 800px) {
  .game-screen .quest-widget {
    top: max(112px,calc(env(safe-area-inset-top) + 106px)) !important;
    right: max(7px,env(safe-area-inset-right)) !important;
    left: auto !important;
    display: block !important;
    width: 112px !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 !important;
    border-radius: 18px !important;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .game-screen .quest-widget > :not(.quest-widget-journal) { display: none !important; }
  .game-screen .quest-widget > .quest-widget-journal {
    display: grid !important;
    grid-template-columns: 36px minmax(0,1fr);
    align-items: center;
    gap: 7px;
    min-height: 58px;
    padding: 7px;
    border: 1px solid color-mix(in srgb,var(--theme-accent) 28%,var(--theme-border));
    border-radius: 17px;
    background: color-mix(in srgb,var(--ui-glass-strong) 95%,transparent);
    color: var(--theme-text);
    box-shadow: 0 10px 24px rgba(3,27,39,.22),0 1px var(--ui-highlight) inset;
    backdrop-filter: blur(16px) saturate(1.12);
  }
  .quest-widget-journal > span:first-child { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: color-mix(in srgb,var(--theme-accent) 13%,var(--theme-card)); }
  .quest-widget-journal .mobile-nav-icon { width: 26px; height: 26px; }
  .quest-widget-journal > span:last-child { min-width: 0; }
  .quest-widget-journal b,
  .quest-widget-journal small { display: block; }
  .quest-widget-journal b { font-size: .67rem; }
  .quest-widget-journal small { margin-top: 2px; color: var(--theme-muted); font-size: .44rem !important; line-height: 1.2; }

  .game-screen .mobile-dock { height: 66px !important; padding: 5px 6px !important; border-radius: 22px !important; }
  .game-screen .mobile-dock button { min-height: 54px; border-radius: 15px !important; }
  .game-screen .mobile-dock button > span { width: 29px; height: 29px; }
  .game-screen .mobile-dock .mobile-nav-icon { width: 27px; height: 27px; }
  .game-screen .mobile-dock button > b { font-size: .48rem !important; }
  .game-screen .mobile-dock button:is(.is-active,.is-menu-open)::after { content: ""; position: absolute; bottom: 2px; width: 18px; height: 3px; border-radius: 999px; background: currentColor; opacity: .78; }
  .game-screen .mobile-dock .mobile-dock-primary { width: 62px; height: 68px; min-height: 68px; margin-top: -15px; border-width: 4px !important; border-radius: 21px !important; }

  .game-screen .interaction-card {
    right: max(8px,env(safe-area-inset-right)) !important;
    bottom: calc(91px + env(safe-area-inset-bottom)) !important;
    left: auto !important;
    width: min(226px,calc(100vw - 16px)) !important;
    min-height: 54px !important;
    grid-template-columns: 38px minmax(0,1fr) auto !important;
    gap: 6px !important;
    padding: 6px !important;
    border-radius: 17px !important;
  }
  .game-screen .interaction-card__visual { width: 38px !important; height: 38px !important; }
  .game-screen .interaction-card__title { font-size: .62rem !important; }
  .game-screen .interaction-card__meta { display: none !important; }
  .game-screen .interaction-card__cta { min-width: 90px !important; height: 42px !important; padding: 0 8px !important; border-radius: 13px !important; }
  .game-screen .interaction-card__key { display: none !important; }
  .game-screen .interaction-card__action-label { font-size: .56rem !important; }

  .pokedex-library-head { grid-template-columns: minmax(0,1fr) 116px; min-height: 82px; padding: 9px 42px 9px 9px; border-radius: 16px; cursor: default; }
  .pokedex-library-title { grid-template-columns: 46px minmax(0,1fr); gap: 7px; }
  .pokedex-library-mark { width: 46px; height: 46px; border-radius: 13px; }
  .pokedex-library-mark img { width: 51px; height: 51px; }
  .pokedex-library-title small { font-size: .43rem; }
  .pokedex-library-title h2 { font-size: 1.55rem; }
  .pokedex-progress { gap: 2px 5px; padding: 6px; border-radius: 11px; }
  .pokedex-progress span small { font-size: .42rem; }
  .pokedex-progress span b { font-size: .82rem; }
  .pokedex-progress > strong { font-size: .61rem; }
  .pokedex-progress-next { display: none; }
  .pokedex-toolbar { grid-template-columns: 1fr; }
  .pokedex-filter-tabs { grid-template-columns: repeat(4,90px); overflow-x: auto; }
  .pokedex-scroll-filter,
  .pokedex-type-filter-v42 { grid-template-columns: 1fr; }
  .pokedex-scroll-filter > header { flex-direction: row; }
  .pokedex-generation-track > button { flex-basis: 116px; }
  .pokedex-type-track > button { min-height: 37px; }
  .pokedex-grid-v41 { grid-template-columns: 1fr; }
  .pokedex-grid-v41 .pokedex-species-card { min-height: 108px; grid-template-columns: 82px minmax(0,1fr); }
  .pokedex-card-art { width: 80px; height: 80px; }

  .dex-detail-v43 { height: auto; }
  .dex-detail-v43 .dex-detail-head { position: sticky; top: -1px; z-index: 20; grid-template-columns: auto minmax(0,1fr) auto; cursor: default; }
  .dex-detail-v43 .dex-detail-head > span small { font-size: .44rem; }
  .dex-detail-v43 .dex-detail-head h2 { font-size: 1.25rem; }
  .dex-dossier-grid { grid-template-columns: 1fr; }
  .dex-dossier-left { grid-template-rows: auto auto; }
  .dex-dossier-right { grid-template-rows: auto auto auto; }
  .dex-detail-v43 .dex-hero-card { grid-template-rows: auto 230px auto auto; }
  .dex-detail-v43 .dex-visual { min-height: 230px; }
  .dex-detail-v43 .dex-physical-profile { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dex-detail-v43 .dex-physical-profile .dex-size-range-card { grid-column: 1/-1; }
  .dex-detail-v43 .dex-skills-grid { grid-template-columns: 1fr; }
  .dex-passive-strip { grid-template-columns: 1fr; }

  .game-screen .side-panel.is-quest-panel #sidePanelContent { padding: 2px 1px 8px; }
  .game-screen .side-panel.is-quest-panel .panel-lead { display: none; }
  .game-screen .side-panel.is-quest-panel .discovery-score { margin-bottom: 8px; }
  .game-screen .side-panel.is-quest-panel .quest-chain { gap: 6px; }
  .game-screen .side-panel.is-quest-panel .quest-card { min-height: 64px; padding: 8px; border-radius: 13px; }
  .game-screen .side-panel.is-quest-panel .quest-card > i { width: 34px; height: 34px; }
  .game-screen .side-panel.is-quest-panel .quest-card small { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
}

@media (max-width: 430px) {
  .game-screen .mobile-dock { height: 64px !important; }
  .game-screen .side-panel,
  .game-screen .side-panel:is(.is-inventory-panel,.is-pokedex-panel,.is-pokedex-detail),
  .game-screen .chat-panel { bottom: calc(89px + env(safe-area-inset-bottom)) !important; }
  .game-screen .world-rail { bottom: calc(90px + env(safe-area-inset-bottom)) !important; }
  .game-screen .interaction-card { bottom: calc(94px + env(safe-area-inset-bottom)) !important; }
  .pokedex-library-head { grid-template-columns: minmax(0,1fr) 104px; }
  .pokedex-library-title h2 { font-size: 1.38rem; }
}

/* v4.4 — evolution economy, innate abilities and movable social windows */
.panel-window-grip {
  position: absolute;
  z-index: 12;
  top: 5px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 74px;
  height: 18px;
  transform: translateX(-50%);
  cursor: grab;
  touch-action: none;
}
.panel-window-grip i { width: 34px; height: 4px; border-radius: 999px; background: color-mix(in srgb,var(--theme-muted) 38%,transparent); }
.panel-window-grip:hover i { background: color-mix(in srgb,var(--theme-accent) 70%,var(--theme-muted)); }
.panel-window-grip.is-dragging { cursor: grabbing; }

@media (min-width: 801px) {
  .game-screen .side-panel.is-user-positioned,
  .game-screen .side-panel.is-user-positioned.is-open,
  .game-screen .side-panel:is(.is-pokedex-panel,.is-pokedex-detail,.is-inventory-panel).is-user-positioned,
  .game-screen .side-panel:is(.is-pokedex-panel,.is-pokedex-detail,.is-inventory-panel).is-user-positioned.is-open {
    position: fixed !important;
    top: var(--panel-user-top,8px) !important;
    right: auto !important;
    bottom: auto !important;
    left: var(--panel-user-left,8px) !important;
    transform: none !important;
    transition: opacity 160ms ease,box-shadow 160ms ease !important;
  }
}

.pokedex-generation-track > button[data-progress-label] { overflow: visible; }
.pokedex-generation-track > button[data-progress-label]::before {
  content: attr(data-progress-label);
  position: absolute;
  z-index: 45;
  left: 50%;
  bottom: calc(100% + 7px);
  width: max-content;
  max-width: 210px;
  padding: 7px 9px;
  border: 1px solid var(--theme-border);
  border-radius: 10px;
  background: color-mix(in srgb,var(--ui-glass-strong) 97%,var(--theme-card));
  color: var(--theme-text);
  box-shadow: 0 12px 26px rgba(1,28,40,.22);
  font-size: .56rem;
  font-weight: 760;
  line-height: 1.25;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%,5px);
  transition: opacity 120ms ease,transform 120ms ease;
}
.pokedex-generation-track > button[data-progress-label]:hover::before,
.pokedex-generation-track > button[data-progress-label]:focus-visible::before { opacity: 1; transform: translate(-50%,0); }
.pokedex-type-track { gap: 5px; }
.pokedex-type-track > button { min-height: 34px; gap: 5px; padding: 0 7px; border-radius: 9px; }
.pokedex-type-track > button b { font-size: .55rem; }
.pokedex-filter-type-icon { width: 16px; height: 16px; }
.pokedex-filter-type-icon.is-device { width: 19px; height: 19px; }

.dex-detail-v43 .dex-dossier-right { grid-template-rows: auto auto auto; align-content: start; }
.dex-detail-v43 .dex-visual { position: relative; isolation: isolate; }
.dex-detail-v43 .dex-visual::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 55%;
  width: min(330px,78%);
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb,var(--dex-accent) 22%,transparent);
  border-radius: 50%;
  background:
    radial-gradient(circle,transparent 48%,color-mix(in srgb,var(--dex-accent) 9%,transparent) 49% 50%,transparent 51%),
    conic-gradient(from var(--species-angle),transparent 0 12%,color-mix(in srgb,var(--dex-accent-2) 13%,transparent) 12% 22%,transparent 22% 64%,color-mix(in srgb,var(--dex-accent) 10%,transparent) 64% 72%,transparent 72%);
  transform: translate(-50%,-50%);
  pointer-events: none;
}

.dex-detail-v43 .dex-evolution-section { display: grid; gap: 6px; }
.dex-detail-v43 .dex-evolution-section > header { margin-bottom: 0; }
.dex-detail-v43 .dex-evolution-chain { min-height: 48px; padding-bottom: 1px; }
.dex-detail-v43 .dex-evolution-chain button { min-width: 116px; grid-template-columns: 38px minmax(62px,1fr); min-height: 46px; }
.dex-detail-v43 .dex-evo-portrait { width: 38px; height: 38px; }
.dex-evolution-options { display: grid; gap: 6px; }
.dex-evolution-options.is-branching { grid-template-columns: repeat(4,minmax(0,1fr)); }
.dex-evolution-option {
  display: grid;
  grid-template-columns: minmax(134px,.72fr) minmax(0,1.28fr);
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 5px;
  border: 1px solid color-mix(in srgb,var(--dex-accent) 22%,var(--theme-border));
  border-radius: 12px;
  background: color-mix(in srgb,var(--dex-accent) 3.5%,var(--theme-card));
}
.dex-evolution-option > button {
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) 10px;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--theme-text);
  text-align: left;
}
.dex-evolution-option-portrait { width: 38px; height: 38px; overflow: visible; }
.dex-evolution-option-portrait img { width: 100%; height: 100%; object-fit: contain; }
.dex-evolution-option > button span { min-width: 0; }
.dex-evolution-option > button small { display: block; color: var(--dex-accent); font-size: .42rem; font-weight: 850; }
.dex-evolution-option > button b { display: block; overflow: hidden; font-size: .6rem; text-overflow: ellipsis; white-space: nowrap; }
.dex-evolution-option > button em { display: block; overflow: hidden; margin-top: 2px; color: var(--theme-muted); font-size: .44rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.dex-evolution-option > button > i { color: var(--dex-accent); font-size: 1rem; font-style: normal; }
.dex-evolution-costs { display: flex; flex-wrap: wrap; gap: 3px; min-width: 0; }
.dex-evolution-resource,
.dex-evolution-condition {
  display: grid;
  grid-template-columns: 20px minmax(0,1fr) auto;
  align-items: center;
  gap: 3px;
  min-width: 78px;
  min-height: 26px;
  padding: 2px 5px 2px 3px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: var(--theme-surface-soft);
  color: var(--theme-muted);
}
.dex-evolution-resource.is-ready { border-color: color-mix(in srgb,#40b772 48%,var(--theme-border)); color: #35a968; }
.dex-evolution-resource-icon { display: grid; place-items: center; width: 20px; height: 20px; }
.dex-evolution-resource-icon > :is(svg,img),
.dex-evolution-resource-icon .item-graphic-base { width: 20px; height: 20px; object-fit: contain; }
.dex-evolution-resource-icon .item-species-badge { display: none; }
.dex-evolution-resource b,
.dex-evolution-condition b { overflow: hidden; font-size: .43rem; text-overflow: ellipsis; white-space: nowrap; }
.dex-evolution-resource em { font-size: .42rem; font-style: normal; font-weight: 850; }
.dex-evolution-condition { grid-template-columns: 16px minmax(0,1fr); }
.dex-evolution-condition .ui-icon { width: 14px; height: 14px; color: var(--dex-accent); }
.dex-evolution-options.is-branching .dex-evolution-option { grid-template-columns: 1fr; align-content: start; padding: 4px; }
.dex-evolution-options.is-branching .dex-evolution-option > button { grid-template-columns: 34px minmax(0,1fr) 8px; }
.dex-evolution-options.is-branching .dex-evolution-option-portrait { width: 34px; height: 34px; }
.dex-evolution-options.is-branching .dex-evolution-costs { gap: 2px; }
.dex-evolution-options.is-branching .dex-evolution-resource,
.dex-evolution-options.is-branching .dex-evolution-condition { flex: 1 1 43px; grid-template-columns: 17px 1fr; min-width: 0; min-height: 21px; padding: 1px 3px; }
.dex-evolution-options.is-branching .dex-evolution-resource-icon,
.dex-evolution-options.is-branching .dex-evolution-resource-icon > :is(svg,img),
.dex-evolution-options.is-branching .dex-evolution-resource-icon .item-graphic-base { width: 17px; height: 17px; }
.dex-evolution-options.is-branching .dex-evolution-resource b,
.dex-evolution-options.is-branching .dex-evolution-condition b { display: none; }
.dex-evolution-options.is-branching .dex-evolution-resource em { font-size: .38rem; text-align: right; }
.dex-evolution-final { padding: 7px 9px; border: 1px dashed color-mix(in srgb,var(--dex-accent) 30%,var(--theme-border)); border-radius: 10px; color: var(--theme-muted); font-size: .55rem; font-weight: 750; }

.dex-detail-v43 .dex-skills-section { grid-template-rows: auto auto; padding: 8px 10px; }
.dex-detail-v43 .dex-skills-section > header { margin-bottom: 5px; }
.dex-detail-v43 .dex-skills-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
.dex-detail-v43 .dex-skill-card { grid-template-columns: 36px minmax(0,1fr); min-height: 52px; gap: 5px; padding: 5px; border-radius: 11px; }
.dex-detail-v43 .dex-skill-card > span:first-child { width: 34px; height: 34px; border-radius: 9px; }
.dex-detail-v43 .dex-skill-card b { font-size: .56rem; }
.dex-detail-v43 .dex-skill-card small,
.dex-detail-v43 .dex-skill-card em { font-size: .41rem; }
.dex-detail-v43 .dex-skill-card i { min-width: 0; }
.dex-detail-v43 .dex-skill-card i > :is(small,b,em) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dex-system-strip { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,.7fr); gap: 6px; }
.dex-system-strip > article {
  position: relative;
  display: grid;
  grid-template-columns: 43px minmax(0,1fr);
  align-items: center;
  gap: 8px;
  min-height: 68px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid var(--theme-border);
  border-radius: 13px;
  background: var(--theme-card);
}
.dex-system-strip > article::after { content: ""; position: absolute; right: -24px; bottom: -28px; width: 74px; height: 74px; border: 1px solid color-mix(in srgb,var(--dex-accent) 12%,transparent); border-radius: 50%; }
.dex-system-strip > article > :is(img,svg) { width: 42px; height: 42px; object-fit: contain; color: var(--dex-accent); filter: drop-shadow(0 5px 7px rgba(4,35,50,.14)); }
.dex-system-strip span { min-width: 0; }
.dex-system-strip small { color: var(--dex-accent); font-size: .43rem !important; font-weight: 900; letter-spacing: .055em; }
.dex-system-strip b { display: block; margin: 2px 0; overflow: hidden; font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.dex-system-strip p { margin: 0; color: var(--theme-muted); font-size: .48rem; line-height: 1.35; }
.dex-energy-card p { display: flex; flex-wrap: wrap; gap: 3px; }
.dex-energy-card p em { padding: 2px 5px; border-radius: 999px; background: color-mix(in srgb,var(--dex-accent) 9%,var(--theme-surface-soft)); color: color-mix(in srgb,var(--dex-accent) 76%,var(--theme-text)); font-size: .4rem; font-style: normal; font-weight: 800; }

/* Clearer inventory rarity and navigation hierarchy. */
.inventory-item-v2741::after {
  content: attr(data-rarity-label);
  position: absolute;
  z-index: 3;
  top: 7px;
  right: 7px;
  padding: 3px 5px;
  border-radius: 6px;
  background: color-mix(in srgb,var(--inv-text) 5%,var(--inv-card));
  color: var(--inv-muted);
  font-size: .42rem;
  font-weight: 850;
  line-height: 1;
}
.inventory-item-v2741.rarity-uncommon::after { color:#2d9c61; background:color-mix(in srgb,#48ac75 10%,var(--inv-card)); }
.inventory-item-v2741.rarity-rare::after { color:#337fcf; background:color-mix(in srgb,#4b91e6 10%,var(--inv-card)); }
.inventory-item-v2741.rarity-epic::after { color:#7650ca; background:color-mix(in srgb,#8a61df 11%,var(--inv-card)); }
.inventory-item-v2741.rarity-legendary::after { color:#b17a12; background:linear-gradient(90deg,color-mix(in srgb,#ffd96b 18%,var(--inv-card)),color-mix(in srgb,#f195c7 12%,var(--inv-card))); }
.inventory-item-v2741__art { border: 1px solid color-mix(in srgb,var(--inv-line) 72%,transparent); box-shadow: 0 7px 16px rgba(12,52,72,.07); }
.inventory-item-v2741__name > em { color: var(--inv-muted); font-size: .43rem; font-weight: 780; text-transform: uppercase; letter-spacing: .04em; }
.inventory-item-v2741__name > small { display: -webkit-box; overflow: hidden; color: var(--inv-muted); font-size: .46rem; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.inventory-rarity-label { color: var(--action-blue,var(--theme-accent)); font-weight: 850; }
.inventory-v2741__categories { position: relative; z-index: 2; padding: 3px; border: 1px solid color-mix(in srgb,var(--inv-line) 72%,transparent); border-radius: 15px; background: color-mix(in srgb,var(--inv-soft) 72%,transparent); }
.inventory-v2741__categories button.is-active { background: var(--inv-card); box-shadow: 0 5px 12px rgba(12,50,70,.08),inset 0 -2px 0 color-mix(in srgb,var(--inv-blue) 70%,transparent); }

/* Team cards read like compact player cards instead of form rows. */
.game-screen .side-panel.is-team-panel { width: min(640px,calc(100vw - 126px)); }
.team-window-v2737 { gap: 8px; }
.team-roster-v2737 { gap: 6px; }
.team-roster-card-v2737 { min-height: 78px; border-radius: 17px; background: linear-gradient(105deg,color-mix(in srgb,var(--theme-accent) 4%,var(--theme-card)),var(--theme-card) 58%); }
.team-roster-card-v2737::after { content: ""; position: absolute; left: 58px; bottom: -42px; width: 120px; height: 120px; border: 1px solid color-mix(in srgb,var(--theme-accent) 8%,transparent); border-radius: 50%; pointer-events: none; }
.team-roster-main-v2737 { position: relative; z-index: 1; grid-template-columns: 70px minmax(0,1fr) auto; gap: 10px; }
.team-roster-portrait-v2737 { width: 68px; height: 68px; overflow: visible; filter: drop-shadow(0 8px 7px rgba(4,31,43,.17)); }
.team-roster-copy-v2737 > span b { font-size: .84rem; }
.team-roster-main-v2737 > strong { padding: 6px; border-radius: 10px; background: color-mix(in srgb,var(--theme-accent) 8%,var(--theme-surface-soft)); }
.team-roster-actions-v2737 button:hover { color: var(--theme-accent); border-color: color-mix(in srgb,var(--theme-accent) 35%,var(--theme-border)); }

/* Chat: stronger social hierarchy and a reliable composer. */
.game-screen .chat-panel.chat-messenger { border-color: color-mix(in srgb,var(--theme-accent) 16%,var(--theme-border)); box-shadow: 0 24px 62px rgba(0,24,37,.3),0 1px var(--ui-highlight) inset; }
.game-screen .chat-head { min-height: 54px; padding: 6px 7px 6px 9px; border-bottom: 1px solid color-mix(in srgb,var(--theme-border) 72%,transparent); }
.game-screen .chat-title-icon { background: linear-gradient(145deg,color-mix(in srgb,var(--theme-accent) 18%,var(--theme-card)),color-mix(in srgb,var(--theme-accent) 7%,var(--theme-surface-soft))); }
.game-screen .chat-tabs { gap: 4px; padding: 4px; border: 1px solid var(--theme-border); border-radius: 14px; background: color-mix(in srgb,var(--theme-surface-soft) 82%,transparent); }
.game-screen .chat-tabs button { min-height: 39px; border-radius: 10px; }
.game-screen .chat-tabs button.is-active { background: var(--theme-card); color: var(--theme-accent); box-shadow: 0 4px 10px rgba(8,50,70,.09); }
.game-screen .chat-tab-icon { display: grid; place-items: center; width: 22px; height: 22px; }
.game-screen .chat-tab-icon .ui-icon { width: 18px; height: 18px; }
.game-screen .chat-messenger-layout { border-radius: 15px; }
.game-screen .chat-message { border-radius: 12px; }
.game-screen .chat-message:hover { background: color-mix(in srgb,var(--theme-accent) 4%,transparent); }
.game-screen #chatForm { grid-template-columns: 40px minmax(0,1fr) 46px !important; gap: 5px !important; min-height: 54px; padding: 5px !important; border: 1px solid color-mix(in srgb,var(--theme-border) 92%,transparent) !important; border-radius: 16px !important; background: color-mix(in srgb,var(--theme-input) 92%,transparent) !important; }
.game-screen #chatForm:focus-within { border-color: color-mix(in srgb,var(--theme-accent) 58%,var(--theme-border)) !important; box-shadow: 0 0 0 3px color-mix(in srgb,var(--theme-accent) 9%,transparent); }
.game-screen #chatForm textarea { min-height: 42px !important; max-height: 92px !important; padding: 11px 7px 8px !important; font-size: 12px !important; line-height: 1.4 !important; }
.game-screen .chat-composer-tool { width: 40px !important; height: 42px !important; border-radius: 12px !important; }
.game-screen .chat-send-button { width: 46px !important; height: 42px !important; border-radius: 13px !important; background: linear-gradient(145deg,#36a9eb,#147fc7) !important; box-shadow: 0 7px 14px rgba(22,132,198,.22); }
.game-screen .chat-send-button .ui-icon { width: 20px; height: 20px; }
.game-screen .chat-online-sidebar { border-left: 1px solid var(--theme-border); background: color-mix(in srgb,var(--theme-surface-soft) 72%,transparent); }

@media (prefers-reduced-motion: no-preference) {
  .dex-detail-v43 .dex-visual::before { animation: dex-species-aura 18s linear infinite; }
  @keyframes dex-species-aura { to { transform: translate(-50%,-50%) rotate(360deg); } }
}

@media (max-width: 800px) {
  .panel-window-grip { display: none; }
  .pokedex-generation-track > button[data-progress-label]::before { display: none; }
  .dex-detail-v43 .dex-dossier-right { grid-template-rows: auto auto auto; }
  .dex-evolution-options.is-branching { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dex-evolution-option { grid-template-columns: 1fr; }
  .dex-detail-v43 .dex-skills-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dex-system-strip { grid-template-columns: 1fr; }
  .dex-system-strip > article { min-height: 72px; }
  .inventory-item-v2741::after { top: 5px; right: 5px; font-size: .36rem; }
  .inventory-item-v2741__name > small { -webkit-line-clamp: 1; }
  .game-screen .side-panel.is-team-panel { width: auto; }
  .team-roster-main-v2737 { grid-template-columns: 58px minmax(0,1fr); }
  .team-roster-portrait-v2737 { width: 56px; height: 56px; }
  .team-roster-main-v2737 > strong { grid-column: 2; justify-self: start; }
  .game-screen #chatForm { grid-template-columns: 36px minmax(0,1fr) 42px !important; min-height: 50px; }
  .game-screen #chatForm textarea { min-height: 38px !important; font-size: 11px !important; }
  .game-screen .chat-composer-tool { width: 36px !important; height: 38px !important; }
  .game-screen .chat-send-button { width: 42px !important; height: 38px !important; }
}

@media (max-width: 430px) {
  .dex-evolution-options.is-branching { grid-template-columns: 1fr; }
  .dex-detail-v43 .dex-skills-grid { grid-template-columns: 1fr 1fr; }
  .dex-detail-v43 .dex-skill-card { grid-template-columns: 32px minmax(0,1fr); min-height: 49px; }
  .dex-detail-v43 .dex-skill-card > span:first-child { width: 31px; height: 31px; }
  .inventory-v2741__categories { padding: 2px; border-radius: 12px; }
  .team-roster-actions-v2737 button,
  .team-roster-actions-v2737 span { min-width: 46px; padding-inline: 4px; }
}

/* v4.5 final ownership: these rules must remain after the v4.4 compatibility layer. */
.dex-detail-v43 .dex-visual::before {
  border-radius: 38%;
  background:
    radial-gradient(circle at 50% 50%,transparent 0 43%,color-mix(in srgb,var(--dex-accent) 8%,transparent) 44% 45%,transparent 46%),
    linear-gradient(135deg,color-mix(in srgb,var(--dex-accent) 7%,transparent),transparent 48%,color-mix(in srgb,var(--dex-accent-2) 6%,transparent));
  transform: translate(-50%,-50%) rotate(var(--species-angle));
  animation: none !important;
}

@media (min-width: 801px) {
  .game-screen .side-panel.is-team-panel { width: min(900px,calc(100vw - 132px)); height: min(720px,calc(100dvh - 92px)); }
  .game-screen .side-panel.is-center-panel { width: min(1040px,calc(100vw - 132px)); height: min(760px,calc(100dvh - 92px)); }
  .game-screen .side-panel.is-pokemon-detail-panel { width: min(1200px,calc(100vw - 110px)); height: min(790px,calc(100dvh - 72px)); }
}

@media (max-width: 800px) {
  .game-screen .side-panel:is(.is-team-panel,.is-center-panel,.is-pokemon-detail-panel) { width: auto; }
}

/* v4.6 — active companions, Pokécenter storage and compact training dossier */
.team-window-v46,.center-window-v46,.pokemon-instance-v46 { display: grid; min-height: 0; height: 100%; color: var(--theme-text); }
.team-window-v46 { grid-template-rows: auto auto minmax(0,1fr) auto; gap: 8px; }
.center-window-v46 { grid-template-rows: auto auto auto minmax(0,1fr); gap: 7px; }
.team-head-v46,.center-head-v46,.pokemon-detail-head-v46 { padding: 3px 5px 9px; border-bottom: 1px solid var(--theme-border); cursor: grab; }
.team-grid-v46 { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; min-height: 0; overflow: auto; padding: 2px; }
.team-slot-v46 { position: relative; display: grid; grid-template-rows: auto minmax(0,1fr) auto; min-width: 0; min-height: 205px; overflow: hidden; border: 1px solid color-mix(in srgb,var(--species-accent,var(--theme-accent)) 26%,var(--theme-border)); border-radius: 20px; background: radial-gradient(circle at 50% 38%,color-mix(in srgb,var(--species-accent,var(--theme-accent)) 15%,transparent),transparent 36%),linear-gradient(155deg,var(--theme-card),color-mix(in srgb,var(--species-accent,var(--theme-accent)) 4%,var(--theme-card))); box-shadow: 0 9px 24px rgba(7,39,56,.08); }
.team-slot-v46::after { content: ""; position: absolute; right: -32px; top: 23px; width: 100px; height: 100px; border: 1px solid color-mix(in srgb,var(--species-accent,var(--theme-accent)) 14%,transparent); border-radius: 50%; pointer-events: none; }
.team-slot-v46.is-lead { border-color: color-mix(in srgb,var(--species-accent,var(--theme-accent)) 72%,var(--theme-border)); box-shadow: inset 0 3px var(--species-accent,var(--theme-accent)),0 12px 28px color-mix(in srgb,var(--species-accent,var(--theme-accent)) 14%,transparent); }
.team-slot-v46 > header,.center-card-v46 > header { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 8px 9px 0; }
.team-slot-v46 > header span,.center-card-v46 > header span { color: var(--theme-muted); font-size: .5rem; font-weight: 900; }
.team-slot-v46 > header small,.center-card-v46 > header small { color: var(--species-accent,var(--theme-accent)); font-size: .46rem; font-weight: 900; }
.team-slot-main-v46 { position: relative; z-index: 1; display: grid; grid-template-rows: 108px auto; min-width: 0; padding: 0 8px 5px; border: 0; background: transparent; color: inherit; text-align: center; cursor: pointer; }
.team-slot-art-v46 { display: grid; place-items: center; min-height: 0; }
.team-slot-portrait-v46 { width: 116px; height: 108px; overflow: visible; filter: drop-shadow(0 10px 9px rgba(1,30,44,.2)); }
.team-slot-portrait-v46 img { width: 100%; height: 100%; object-fit: contain; }
.team-slot-copy-v46 { display: grid; justify-items: center; min-width: 0; gap: 4px; }
.team-slot-copy-v46 > b { max-width: 100%; overflow: hidden; font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.team-slot-copy-v46 > b i,.center-copy-v46 > b i { color: #efb51c; font-style: normal; }
.team-slot-copy-v46 > em,.center-copy-v46 > em { display: flex; font-style: normal; }
.team-slot-copy-v46 > small { color: var(--theme-muted); font-size: .45rem; }
.team-slot-v46 > footer { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 0 7px 7px; }
.team-slot-v46 > footer :is(button,span) { display: grid; place-items: center; min-height: 28px; padding: 0 5px; border: 1px solid var(--theme-border); border-radius: 9px; background: var(--theme-surface-soft); color: var(--theme-muted); font-size: .43rem; font-weight: 900; }
.team-slot-v46 > footer span:first-child { color: var(--species-accent,var(--theme-accent)); }
.team-slot-v46 > footer .danger,.pokemon-detail-actions-v46 .danger { color: #d95d6a; }
.team-slot-v46.is-empty { place-items: center; grid-template-rows: auto 1fr auto; border-style: dashed; background: color-mix(in srgb,var(--theme-surface-soft) 76%,transparent); box-shadow: none; }
.team-slot-v46.is-empty::after { right: 50%; top: 48%; transform: translate(50%,-50%); }
.team-slot-v46.is-empty > header { width: 100%; }
.team-slot-v46.is-empty > i { z-index: 1; align-self: end; display: grid; place-items: center; width: 58px; height: 58px; border: 1px dashed var(--theme-border); border-radius: 20px; background: var(--theme-card); color: var(--theme-muted); }
.team-slot-v46.is-empty > i .ui-icon { width: 27px; height: 27px; }
.team-slot-v46.is-empty > div { z-index: 1; align-self: start; padding: 8px 8px 18px; text-align: center; }
.team-slot-v46.is-empty b { display: block; font-size: .65rem; }
.team-slot-v46.is-empty small { display: block; margin-top: 3px; color: var(--theme-muted); font-size: .43rem; line-height: 1.3; }
.team-note-v46,.center-note-v46 { margin: 0; padding: 8px 10px; border: 1px solid color-mix(in srgb,var(--theme-accent) 14%,var(--theme-border)); border-radius: 12px; background: color-mix(in srgb,var(--theme-accent) 4%,var(--theme-surface-soft)); color: var(--theme-muted); font-size: .5rem; line-height: 1.35; }

.center-grid-v46 { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; min-height: 0; overflow: auto; padding: 2px; }
.center-card-v46 { position: relative; display: grid; grid-template-rows: auto minmax(0,1fr) auto; min-width: 0; min-height: 190px; overflow: hidden; border: 1px solid color-mix(in srgb,var(--species-accent,var(--theme-accent)) 24%,var(--theme-border)); border-radius: 18px; background: radial-gradient(circle at 28% 39%,color-mix(in srgb,var(--species-accent,var(--theme-accent)) 14%,transparent),transparent 34%),var(--theme-card); }
.center-card-v46.is-lead { box-shadow: inset 0 3px var(--species-accent,var(--theme-accent)); }
.center-main-v46 { display: grid; grid-template-columns: 92px minmax(0,1fr); align-items: center; min-width: 0; padding: 3px 8px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.center-art-v46 { display: grid; place-items: center; }
.center-portrait-v46 { width: 92px; height: 94px; overflow: visible; filter: drop-shadow(0 9px 8px rgba(4,32,46,.18)); }
.center-portrait-v46 img { width: 100%; height: 100%; object-fit: contain; }
.center-copy-v46 { min-width: 0; }
.center-copy-v46 > b { display: block; overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.center-copy-v46 > small,.center-copy-v46 > code { display: block; overflow: hidden; margin-top: 5px; color: var(--theme-muted); font-size: .43rem; text-overflow: ellipsis; white-space: nowrap; }
.center-copy-v46 > code { color: color-mix(in srgb,var(--species-accent,var(--theme-accent)) 72%,var(--theme-text)); font-family: ui-monospace,SFMono-Regular,Consolas,monospace; }
.center-actions-v46 { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; padding: 0 7px 7px; }
.center-actions-v46 button { min-height: 27px; padding: 0 5px; border: 1px solid var(--theme-border); border-radius: 9px; background: var(--theme-surface-soft); color: var(--theme-muted); font-size: .43rem; font-weight: 900; }
.center-actions-v46 button.is-primary { color: var(--species-accent,var(--theme-accent)); }
.center-actions-v46 button.is-evolve { color: #8459d6; }

.pokemon-instance-v46 { grid-template-rows: auto minmax(0,1fr); gap: 8px; }
.pokemon-detail-head-v46 { display: flex; align-items: center; justify-content: space-between; }
.pokemon-instance-grid-v46 { display: grid; grid-template-columns: 310px minmax(0,1fr); gap: 9px; min-height: 0; overflow: hidden; }
.pokemon-instance-left-v46,.pokemon-instance-right-v46 { display: grid; align-content: start; gap: 8px; min-width: 0; min-height: 0; }
.pokemon-instance-right-v46 { overflow: auto; padding-right: 2px; }
.pokemon-detail-hero-v46 { display: grid; grid-template-columns: 126px minmax(0,1fr); align-items: center; min-height: 150px; padding: 10px; overflow: hidden; border: 1px solid color-mix(in srgb,var(--species-accent) 25%,var(--theme-border)); border-radius: 19px; background: radial-gradient(circle at 25% 50%,color-mix(in srgb,var(--species-accent) 16%,transparent),transparent 38%),var(--theme-card); }
.pokemon-detail-art-v46 { display: grid; place-items: center; }
.pokemon-detail-portrait-v46 { width: 128px; height: 130px; overflow: visible; filter: drop-shadow(0 12px 10px rgba(2,28,42,.2)); }
.pokemon-detail-portrait-v46 img { width: 100%; height: 100%; object-fit: contain; }
.pokemon-detail-hero-v46 h2 { max-width: 100%; overflow: hidden; margin: 3px 0 5px; font-size: 1.25rem; text-overflow: ellipsis; white-space: nowrap; }
.pokemon-detail-hero-v46 small { color: var(--species-accent,var(--theme-accent)); font-size: .46rem; font-weight: 900; }
.pokemon-detail-hero-v46 p,.pokemon-detail-hero-v46 em { margin: 5px 0 0; color: var(--theme-muted); font-size: .47rem; font-style: normal; }
.pokemon-detail-hero-v46 .pokemon-exp-track { height: 6px; margin-top: 8px; }
.pokemon-genome-v46 { display: grid; grid-template-columns: 112px minmax(0,1fr); align-items: center; min-height: 78px; padding: 8px 10px; border: 1px solid var(--theme-border); border-radius: 16px; background: linear-gradient(120deg,color-mix(in srgb,#24b9cf 10%,var(--theme-card)),color-mix(in srgb,#6a5cdb 6%,var(--theme-card))); }
.pokemon-genome-v46 > img { width: 110px; height: 58px; object-fit: contain; }
.pokemon-genome-v46 small { display: block; color: var(--theme-muted); font-size: .43rem; font-weight: 900; }
.pokemon-genome-v46 b { display: block; overflow-wrap: anywhere; margin-top: 3px; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: .68rem; }
.pokemon-genome-v46 p { margin: 4px 0 0; color: var(--theme-muted); font-size: .42rem; line-height: 1.3; }
.pokemon-facts-v46 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pokemon-facts-v46 article { display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; gap: 6px; min-width: 0; min-height: 51px; padding: 7px; border: 1px solid var(--theme-border); border-radius: 12px; background: var(--theme-card); }
.pokemon-facts-v46 article > i { font-style: normal; font-size: 1rem; text-align: center; }
.pokemon-facts-v46 small,.pokemon-facts-v46 b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pokemon-facts-v46 small { color: var(--theme-muted); font-size: .4rem; font-weight: 900; }
.pokemon-facts-v46 b { margin-top: 2px; font-size: .53rem; }
.pokemon-detail-actions-v46 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pokemon-detail-actions-v46 :is(button,span) { display: grid; place-items: center; min-height: 34px; padding: 0 8px; border: 1px solid var(--theme-border); border-radius: 10px; background: var(--theme-surface-soft); color: var(--theme-muted); font-size: .46rem; font-weight: 900; }
.pokemon-active-state-v46 { color: var(--species-accent,var(--theme-accent)) !important; }
.pokemon-evolution-v46 { min-height: 72px; margin: 0; padding: 11px 12px; border-color: color-mix(in srgb,#8a63da 30%,var(--theme-border)); background: radial-gradient(circle at 16% 50%,color-mix(in srgb,#8a63da 12%,transparent),transparent 34%),linear-gradient(135deg,color-mix(in srgb,#f9f4ff 55%,var(--theme-card)),var(--theme-card)); }
.pokemon-evolution-v46 b { font-size: .78rem; }
.pokemon-evolution-v46 b i { color: #8a63da; font-style: normal; }
.pokemon-evolution-v46 button { min-width: 126px; min-height: 40px; box-shadow: 0 8px 20px rgba(93,59,176,.2); }
.pokemon-training-v46 { margin: 0; padding: 10px; }
.pokemon-training-v46 .pokemon-section-title { margin-bottom: 8px; }
.pokemon-training-v46 .pokemon-section-title p { margin: 3px 0 0; color: var(--theme-muted); font-size: .43rem; }
.pokemon-training-v46 .pokemon-section-title > strong { display: flex; gap: 4px; width: auto; min-width: 48px; padding: 5px 8px; }
.pokemon-training-v46 .pokemon-section-title > strong img { width: 25px; height: 25px; }
.pokemon-effective-stats-v46 { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.pokemon-stat-tile-v46 { display: grid; grid-template-columns: 28px minmax(0,1fr) 26px; align-items: center; gap: 6px; min-width: 0; padding: 7px; border: 1px solid var(--theme-border); border-radius: 11px; background: var(--theme-surface-soft); }
.pokemon-stat-tile-v46 > svg { width: 25px; height: 25px; color: var(--species-accent,var(--theme-accent)); }
.pokemon-stat-tile-v46 > span { display: grid; min-width: 0; }
.pokemon-stat-tile-v46 small { overflow: hidden; color: var(--theme-muted); font-size: .4rem; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.pokemon-stat-tile-v46 b { font-size: .72rem; }
.pokemon-stat-tile-v46 em { color: var(--theme-muted); font-size: .38rem; font-style: normal; }
.pokemon-stat-tile-v46 span > i { height: 4px; margin-top: 3px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb,var(--theme-text) 7%,transparent); }
.pokemon-stat-tile-v46 span > i u { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--species-accent,var(--theme-accent)),#54c988); text-decoration: none; }
.pokemon-stat-tile-v46 > button { display: grid; place-items: center; width: 26px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: var(--species-accent,var(--theme-accent)); color: #fff; font-weight: 900; }
.pokemon-stat-tile-v46 > button:disabled { background: color-mix(in srgb,var(--theme-muted) 18%,var(--theme-card)); color: var(--theme-muted); }
.pokemon-mastery-section-v46 { margin: 0; padding: 0; overflow: hidden; }
.pokemon-mastery-section-v46 .pokemon-mastery-head { padding: 9px 10px; background: color-mix(in srgb,var(--theme-accent) 5%,var(--theme-card)); }
.pokemon-mastery-section-v46 .pokemon-mastery-head span b { color: var(--theme-text); font-size: .7rem; }
.pokemon-mastery-section-v46 .pokemon-mastery-head span p { color: var(--theme-muted); }
.pokemon-mastery-section-v46 .pokemon-mastery-head > strong { min-width: 54px; padding: 6px 8px; font-size: 1rem; }
.pokemon-mastery-section-v46 .pokemon-mastery-next { padding: 5px 10px; background: var(--theme-surface-soft); color: var(--theme-muted); }
.pokemon-mastery-section-v46 .pokemon-mastery-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; padding: 8px; }
.pokemon-mastery-section-v46 .pokemon-mastery-card { grid-template-columns: 43px minmax(0,1fr); gap: 6px; padding: 6px; border-color: var(--theme-border); background: var(--theme-card); }
.pokemon-mastery-section-v46 .pokemon-mastery-icon,.pokemon-mastery-section-v46 .pokemon-mastery-art,.pokemon-mastery-section-v46 .pokemon-mastery-art img { width: 42px; height: 42px; }
.pokemon-mastery-section-v46 .pokemon-mastery-copy > b { color: var(--theme-text); font-size: .58rem; }
.pokemon-mastery-section-v46 .pokemon-mastery-copy > small,.pokemon-mastery-section-v46 .pokemon-mastery-copy > em { color: var(--theme-muted); font-size: .38rem; }
.pokemon-mastery-section-v46 .pokemon-mastery-copy > p { display: none; }
.pokemon-mastery-section-v46 .pokemon-mastery-ranks { margin: 2px 0; }
.pokemon-mastery-section-v46 .pokemon-mastery-ranks i { width: 13px; height: 4px; }
.pokemon-mastery-section-v46 .pokemon-mastery-card > button { grid-column: 1/-1; min-height: 27px; font-size: .43rem; }

@supports (content-visibility:auto) { .pokedex-species-card { content-visibility: auto; contain-intrinsic-size: 122px; } }

@media (min-width: 801px) {
  .game-screen .side-panel.is-team-panel { width: min(760px,calc(100vw - 132px)); height: min(610px,calc(100dvh - 92px)); }
  .game-screen .side-panel.is-center-panel { width: min(960px,calc(100vw - 132px)); height: min(720px,calc(100dvh - 92px)); }
  .game-screen .side-panel.is-pokemon-detail-panel { width: min(1000px,calc(100vw - 110px)); height: min(720px,calc(100dvh - 72px)); }
}

@media (max-width: 800px) {
  .team-grid-v46,.center-grid-v46 { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; overflow: visible; }
  .team-window-v46,.center-window-v46,.pokemon-instance-v46 { height: auto; }
  .team-slot-v46 { min-height: 170px; border-radius: 16px; }
  .team-slot-main-v46 { grid-template-rows: 76px auto; padding-inline: 5px; }
  .team-slot-portrait-v46 { width: 82px; height: 78px; }
  .team-slot-copy-v46 > b { font-size: .64rem; }
  .team-slot-copy-v46 > small { font-size: .4rem; }
  .team-slot-v46 > footer { grid-template-columns: 1fr; }
  .team-slot-v46 > footer :is(button,span) { min-height: 25px; font-size: .39rem; }
  .team-slot-v46.is-empty > i { width: 50px; height: 50px; }
  .team-note-v46 { display: none; }
  .center-card-v46 { min-height: 174px; border-radius: 16px; }
  .center-main-v46 { grid-template-columns: 72px minmax(0,1fr); padding-inline: 5px; }
  .center-portrait-v46 { width: 74px; height: 78px; }
  .center-copy-v46 > b { font-size: .63rem; }
  .center-copy-v46 > code { display: none; }
  .center-actions-v46 { grid-template-columns: 1fr; }
  .center-note-v46 { font-size: .43rem; }
  .pokemon-instance-grid-v46 { grid-template-columns: 1fr; overflow: visible; }
  .pokemon-instance-right-v46 { overflow: visible; }
  .pokemon-detail-hero-v46 { grid-template-columns: 108px minmax(0,1fr); min-height: 132px; padding: 8px; }
  .pokemon-detail-portrait-v46 { width: 108px; height: 112px; }
  .pokemon-effective-stats-v46 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pokemon-mastery-section-v46 .pokemon-mastery-grid { grid-template-columns: 1fr; }
  .pokemon-evolution-v46 { align-items: stretch; }

  .pokedex-library-head { grid-template-columns: 1fr !important; min-height: 0; gap: 7px; padding: 10px 42px 10px 10px; }
  .pokedex-library-title { grid-template-columns: 48px minmax(0,1fr); }
  .pokedex-library-title h2 { margin-top: 1px; font-size: 1.42rem; line-height: 1; }
  .pokedex-library-title small { font-size: .4rem; }
  .pokedex-progress { grid-template-columns: minmax(0,1fr) auto; min-height: 43px; padding: 6px 8px; }
  .pokedex-progress-next { display: block; }
  .pokedex-toolbar { grid-template-columns: 1fr; }
  .pokedex-filter-tabs { grid-template-columns: repeat(4,minmax(88px,1fr)); }
  .pokedex-scroll-filter,.pokedex-type-filter-v42 { grid-template-columns: 1fr; padding: 4px; }
  .pokedex-scroll-filter > header { flex-direction: row; min-height: 31px; }
  .pokedex-generation-track > button { flex-basis: 110px; min-width: 110px; min-height: 45px; }
  .pokedex-type-track > button { min-height: 34px; }
}

@media (max-width: 480px) {
  .pokedex-grid-v41 { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
  .pokedex-grid-v41 .pokedex-species-card { grid-template-columns: 1fr; grid-template-rows: auto 82px auto auto; align-content: start; min-height: 162px; padding: 7px; border-radius: 15px; text-align: center; }
  .pokedex-grid-v41 .pokedex-species-card::after { left: 50%; bottom: 40px; width: 68px; height: 68px; transform: translateX(-50%) rotate(var(--species-angle)); }
  .pokedex-grid-v41 .pokedex-card-number { position: relative; inset: auto; justify-self: stretch; display: flex; justify-content: space-between; font-size: .47rem; }
  .pokedex-grid-v41 .pokedex-card-art { justify-self: center; width: 82px; height: 82px; }
  .pokedex-grid-v41 .pokedex-card-copy { display: grid; justify-items: center; min-width: 0; }
  .pokedex-grid-v41 .pokedex-card-copy > small,.pokedex-grid-v41 .pokedex-card-copy > i { display: none; }
  .pokedex-grid-v41 .pokedex-card-copy > b { max-width: 100%; overflow: hidden; font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
  .pokedex-grid-v41 .pokedex-card-types { justify-content: center; }
  .pokedex-grid-v41 .pokedex-species-card > em { position: relative; inset: auto; justify-self: center; max-width: 100%; padding: 3px 6px; font-size: .34rem; }
  .pokedex-results-meta small { display: none; }
  .pokemon-genome-v46 { grid-template-columns: 92px minmax(0,1fr); }
  .pokemon-genome-v46 > img { width: 90px; }
  .pokemon-facts-v46 { grid-template-columns: 1fr 1fr; }
  .pokemon-detail-actions-v46 { grid-template-columns: 1fr; }
  .pokemon-evolution-v46 { flex-direction: row; }
  .pokemon-evolution-v46 button { min-width: 94px; padding-inline: 7px; }
}

/* v4.7 — carried team is a compact read-only roster; storage stays inside the city facility. */
.team-window-v47 {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  gap: 13px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  color: var(--theme-text);
}
.team-window-v47::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -18px;
  background: linear-gradient(145deg,color-mix(in srgb,var(--theme-card) 76%,transparent),color-mix(in srgb,var(--theme-surface-soft) 88%,transparent)),url("/assets/v4.7/ui/team-background.svg") center/cover no-repeat;
  opacity: .78;
  pointer-events: none;
}
.team-head-v47 {
  min-height: 58px;
  margin: 0;
  padding: 7px 9px 10px;
  border-bottom: 1px solid color-mix(in srgb,var(--theme-accent) 18%,var(--theme-border));
}
.team-head-v47 > span { gap: 10px; }
.team-head-v47 .panel-ui-icon { width: 32px; height: 32px; }
.team-head-v47 small { font-size: 10px; letter-spacing: .11em; }
.team-head-v47 h2 { margin-top: 2px; font-size: 22px; line-height: 1.05; }
.team-head-v47 > em {
  min-width: 58px;
  padding: 8px 11px;
  border: 1px solid color-mix(in srgb,var(--theme-accent) 20%,var(--theme-border));
  border-radius: 999px;
  background: color-mix(in srgb,var(--theme-card) 84%,transparent);
  color: var(--theme-accent);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}
.team-grid-v47 {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  grid-template-rows: repeat(2,minmax(0,1fr));
  gap: 10px;
  min-height: 0;
  padding: 2px;
  overflow: auto;
}
.team-slot-v47 {
  position: relative;
  min-width: 0;
  min-height: 164px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb,var(--species-accent,var(--theme-accent)) 30%,var(--theme-border));
  border-radius: 20px;
  background: radial-gradient(circle at 50% 42%,color-mix(in srgb,var(--species-accent,var(--theme-accent)) 18%,transparent),transparent 41%),linear-gradient(150deg,color-mix(in srgb,var(--theme-card) 94%,transparent),color-mix(in srgb,var(--species-accent,var(--theme-accent)) 5%,var(--theme-card)));
  box-shadow: 0 10px 24px rgba(6,38,56,.1);
}
.team-slot-v47::after {
  content: "";
  position: absolute;
  right: -31px;
  bottom: -31px;
  width: 92px;
  height: 92px;
  border: 9px solid color-mix(in srgb,var(--species-accent,var(--theme-accent)) 8%,transparent);
  border-radius: 50%;
  pointer-events: none;
}
.team-slot-v47.is-lead {
  border-color: color-mix(in srgb,var(--species-accent,var(--theme-accent)) 74%,var(--theme-border));
  box-shadow: inset 0 3px var(--species-accent,var(--theme-accent)),0 12px 28px color-mix(in srgb,var(--species-accent,var(--theme-accent)) 18%,transparent);
}
.team-slot-main-v47 {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 88px auto;
  width: 100%;
  height: 100%;
  padding: 0 9px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: center;
}
.team-slot-main-v47 > header,.team-slot-v47.is-empty > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  color: var(--theme-muted);
  font-size: 10px;
  font-weight: 900;
}
.team-slot-main-v47 > header small,.team-slot-v47.is-empty > header small {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--species-accent,var(--theme-accent));
  font-size: 9px;
  font-weight: 900;
}
.team-slot-main-v47 > header .pokemon-ui-icon-v47 { width: 14px; height: 14px; }
.team-slot-art-v47 { display: grid; place-items: center; min-height: 0; }
.team-slot-portrait-v47 { width: 108px; height: 94px; overflow: visible; filter: drop-shadow(0 10px 8px rgba(2,31,46,.2)); }
.team-slot-portrait-v47 img { width: 100%; height: 100%; object-fit: contain; }
.team-slot-copy-v47 { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.team-slot-copy-v47 > b { max-width: 100%; overflow: hidden; font-size: 15px; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.team-slot-copy-v47 > b i { color: #eeb41c; font-style: normal; }
.team-slot-copy-v47 > em { display: flex; font-style: normal; }
.team-slot-copy-v47 > small { color: var(--theme-muted); font-size: 11px; font-weight: 750; }
.team-slot-v47.is-empty {
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  padding: 0 10px 10px;
  border-style: solid;
  border-color: color-mix(in srgb,var(--theme-muted) 18%,var(--theme-border));
  background: color-mix(in srgb,var(--theme-card) 56%,transparent);
  box-shadow: none;
}
.team-slot-v47.is-empty::after { display: none; }
.team-empty-mark-v47 {
  align-self: center;
  justify-self: center;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: color-mix(in srgb,var(--theme-surface-soft) 76%,transparent);
  color: color-mix(in srgb,var(--theme-muted) 44%,transparent);
}
.team-empty-mark-v47 .pokemon-ui-icon-v47 { width: 38px; height: 38px; }
.pokemon-ui-icon-v47 { width: 24px; height: 24px; fill: none; color: currentColor; }

/* Detailed instance card: readable information density and vector-only facts. */
.pokemon-instance-v47 { gap: 10px; }
.pokemon-detail-head-v47 { min-height: 42px; }
.pokemon-detail-head-v47 > span { font-size: 10px; letter-spacing: .08em; }
.pokemon-instance-grid-v47 { grid-template-columns: 330px minmax(0,1fr); gap: 11px; }
.pokemon-detail-hero-v47 { min-height: 158px; }
.pokemon-detail-hero-v47 small { font-size: 10px; }
.pokemon-detail-hero-v47 p,.pokemon-detail-hero-v47 em { font-size: 11px; }
.pokemon-genome-v47 {
  grid-template-columns: 128px minmax(0,1fr);
  min-height: 84px;
  padding: 9px 11px;
  overflow: hidden;
  background: radial-gradient(circle at 18% 50%,color-mix(in srgb,#25bfd8 18%,transparent),transparent 42%),linear-gradient(120deg,color-mix(in srgb,#24b9cf 9%,var(--theme-card)),color-mix(in srgb,#6a5cdb 7%,var(--theme-card)));
}
.pokemon-genome-visual-v47 {
  position: relative;
  display: block;
  width: 120px;
  height: 62px;
  overflow: hidden;
  border-radius: 12px;
  -webkit-mask-image: linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent);
  mask-image: linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent);
}
.pokemon-genome-visual-v47::after {
  content: "";
  position: absolute;
  inset: 4px auto 4px 50%;
  width: 1px;
  background: linear-gradient(transparent,#eaffff,transparent);
  box-shadow: 0 0 10px #60dff1;
  animation: genome-scan-v47 2.6s ease-in-out infinite;
}
.pokemon-genome-visual-v47 > img {
  width: 310px;
  max-width: none;
  height: 62px;
  object-fit: fill;
  animation: genome-flow-v47 5.2s linear infinite alternate;
}
.pokemon-genome-v47 small { font-size: 10px; letter-spacing: .08em; }
.pokemon-genome-v47 b { margin-top: 5px; font-size: 13px; letter-spacing: .055em; }
.pokemon-facts-v47 { gap: 8px; }
.pokemon-facts-v47 article { grid-template-columns: 34px minmax(0,1fr); min-height: 60px; gap: 8px; padding: 9px; border-radius: 14px; }
.pokemon-facts-v47 article > i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: color-mix(in srgb,var(--species-accent,var(--theme-accent)) 9%,var(--theme-surface-soft)); color: var(--species-accent,var(--theme-accent)); }
.pokemon-facts-v47 article > i .pokemon-ui-icon-v47 { width: 23px; height: 23px; }
.pokemon-facts-v47 small { font-size: 9px; }
.pokemon-facts-v47 b { font-size: 11px; }
.pokemon-detail-actions-v47 { gap: 8px; }
.pokemon-detail-actions-v47 :is(button,span) { display: flex; flex-direction: row; gap: 7px; min-height: 40px; font-size: 10px; }
.pokemon-detail-actions-v47 .pokemon-ui-icon-v47,.pokemon-detail-actions-v47 .ui-icon { width: 18px; height: 18px; }
.pokemon-evolution-v47 { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 10px; min-height: 82px; }
.pokemon-evolution-v47 > i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: color-mix(in srgb,#8a63da 12%,var(--theme-card)); color: #8a63da; }
.pokemon-evolution-v47 > i .pokemon-ui-icon-v47 { width: 26px; height: 26px; }
.pokemon-evolution-v47 > div > small { font-size: 9px; }
.pokemon-evolution-v47 > div > b { font-size: 14px; }
.pokemon-evolution-v47 > div > span { font-size: 11px; }
.pokemon-evolution-v47.is-final { grid-template-columns: 42px minmax(0,1fr); }
.pokemon-training-v47 .pokemon-section-title small { font-size: 9px; }
.pokemon-training-v47 .pokemon-section-title b { font-size: 14px; }
.pokemon-training-v47 .pokemon-section-title p { font-size: 10px; }
.pokemon-stat-tile-v47 { grid-template-columns: 30px minmax(0,1fr) 30px; gap: 7px; min-height: 61px; padding: 8px; border-radius: 13px; }
.pokemon-stat-tile-v47 > svg { width: 27px; height: 27px; }
.pokemon-stat-tile-v47 small { font-size: 9px; }
.pokemon-stat-tile-v47 b { font-size: 14px; }
.pokemon-stat-tile-v47 em { font-size: 9px; }
.pokemon-stat-tile-v47 > button { width: 30px; height: 31px; }
.pokemon-stat-tile-v47 > button .pokemon-ui-icon-v47 { width: 17px; height: 17px; }
.pokemon-mastery-section-v47 .pokemon-mastery-head { min-height: 60px; padding: 10px 12px; }
.pokemon-mastery-section-v47 .pokemon-mastery-head span > small { font-size: 9px; }
.pokemon-mastery-section-v47 .pokemon-mastery-head span > b { font-size: 14px; }
.pokemon-mastery-section-v47 .pokemon-mastery-head > strong { display: flex; align-items: center; gap: 7px; min-width: 94px; padding: 6px 9px; }
.pokemon-mastery-section-v47 .pokemon-mastery-head > strong > .pokemon-ui-icon-v47 { width: 24px; height: 24px; }
.pokemon-mastery-section-v47 .pokemon-mastery-head > strong > span { display: grid; }
.pokemon-mastery-section-v47 .pokemon-mastery-head > strong small,.pokemon-mastery-section-v47 .pokemon-mastery-head > strong em { font-size: 8px; }
.pokemon-mastery-section-v47 .pokemon-mastery-next { padding: 7px 11px; font-size: 10px; }
.pokemon-mastery-section-v47 .pokemon-mastery-copy > b { font-size: 11px; }
.pokemon-mastery-section-v47 .pokemon-mastery-copy > small,.pokemon-mastery-section-v47 .pokemon-mastery-copy > em { font-size: 9px; }
.pokemon-mastery-section-v47 .pokemon-mastery-card > button { min-height: 31px; font-size: 9px; }

@keyframes genome-flow-v47 { from { transform: translateX(-18px); } to { transform: translateX(-168px); } }
@keyframes genome-scan-v47 { 0%,100% { opacity: .25; transform: translateX(-38px); } 50% { opacity: .95; transform: translateX(38px); } }

@media (min-width: 801px) {
  .game-screen .side-panel.is-team-panel { width: min(700px,calc(100vw - 132px)); height: min(510px,calc(100dvh - 92px)); }
  .game-screen .side-panel.is-pokemon-detail-panel { width: min(1010px,calc(100vw - 110px)); height: min(720px,calc(100dvh - 72px)); }
}

@media (max-width: 800px) {
  .game-screen .side-panel.is-team-panel {
    top: max(66px,calc(env(safe-area-inset-top) + 58px)) !important;
    bottom: auto !important;
    height: auto !important;
    max-height: calc(100dvh - 154px - env(safe-area-inset-bottom)) !important;
  }
  .game-screen .side-panel.is-team-panel #sidePanelContent {
    max-height: calc(100dvh - 178px - env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
  }
  .team-window-v47 { height: auto; overflow: hidden; }
  .team-window-v47::before { inset: 0; border-radius: 17px; }
  .team-grid-v47 { grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: none; gap: 8px; overflow: visible; }
  .team-slot-v47 { min-height: 146px; border-radius: 17px; }
  .team-slot-main-v47 { grid-template-rows: auto 72px auto; padding-inline: 7px; }
  .team-slot-portrait-v47 { width: 88px; height: 78px; }
  .team-head-v47 h2 { font-size: 20px; }
  .pokemon-instance-grid-v47 { grid-template-columns: 1fr; }
  .pokemon-genome-v47 { grid-template-columns: 120px minmax(0,1fr); }
}

@media (max-width: 480px) {
  .team-head-v47 { min-height: 53px; padding-right: 40px; }
  .team-head-v47 .panel-ui-icon { width: 27px; height: 27px; }
  .team-head-v47 small { font-size: 9px; }
  .team-head-v47 h2 { font-size: 18px; }
  .team-head-v47 > em { min-width: 48px; padding: 6px 8px; font-size: 11px; }
  .team-slot-v47 { min-height: 132px; }
  .team-slot-main-v47 { grid-template-rows: auto 64px auto; padding-bottom: 8px; }
  .team-slot-main-v47 > header,.team-slot-v47.is-empty > header { min-height: 27px; font-size: 9px; }
  .team-slot-main-v47 > header small,.team-slot-v47.is-empty > header small { font-size: 8px; }
  .team-slot-portrait-v47 { width: 78px; height: 68px; }
  .team-slot-copy-v47 { gap: 3px; }
  .team-slot-copy-v47 > b { font-size: 13px; }
  .team-slot-copy-v47 > small { font-size: 10px; }
  .team-empty-mark-v47 { width: 50px; height: 50px; }
  .team-empty-mark-v47 .pokemon-ui-icon-v47 { width: 33px; height: 33px; }
  .pokemon-detail-head-v47 > span { display: none; }
  .pokemon-detail-hero-v47 { grid-template-columns: 102px minmax(0,1fr); }
  .pokemon-genome-v47 { grid-template-columns: 104px minmax(0,1fr); }
  .pokemon-genome-visual-v47 { width: 98px; }
  .pokemon-genome-v47 b { font-size: 11px; }
  .pokemon-facts-v47 article { grid-template-columns: 28px minmax(0,1fr); min-height: 55px; padding: 7px; }
  .pokemon-facts-v47 article > i { width: 28px; height: 28px; }
  .pokemon-facts-v47 article > i .pokemon-ui-icon-v47 { width: 20px; height: 20px; }
  .pokemon-evolution-v47 { grid-template-columns: 34px minmax(0,1fr) auto; gap: 7px; }
  .pokemon-evolution-v47 > i { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .pokemon-genome-visual-v47::after,.pokemon-genome-visual-v47 > img { animation: none !important; }
}

/* v4.8 — centered game windows, rebuilt inventory, quest journal and polished roster. */
@media (min-width: 801px) {
  .game-screen .side-panel:is(.is-team-panel,.is-inventory-panel,.is-quest-panel,.is-pokemon-detail-panel,.is-center-panel),
  .game-screen .side-panel:is(.is-team-panel,.is-inventory-panel,.is-quest-panel,.is-pokemon-detail-panel,.is-center-panel).is-open {
    position: fixed !important;
    top: calc(50% + var(--panel-drag-y,0px)) !important;
    right: auto !important;
    bottom: auto !important;
    left: calc(50% + var(--panel-drag-x,0px)) !important;
    transform: translate(-50%,-50%) !important;
  }
  .game-screen .side-panel.is-team-panel { width: min(690px,calc(100vw - 120px)) !important; height: min(470px,calc(100dvh - 84px)) !important; }
  .game-screen .side-panel.is-inventory-panel { width: min(1040px,calc(100vw - 104px)) !important; height: min(690px,calc(100dvh - 72px)) !important; }
  .game-screen .side-panel.is-quest-panel { width: min(900px,calc(100vw - 118px)) !important; height: min(700px,calc(100dvh - 74px)) !important; }
  .game-screen .side-panel.is-pokemon-detail-panel { width: min(1060px,calc(100vw - 90px)) !important; height: min(730px,calc(100dvh - 54px)) !important; }
}

.team-head-v48 { padding-right: 64px; }
.team-grid-v48 { overflow: hidden; }
.team-slot-v48 { min-height: 158px; border-radius: 17px; }
.team-slot-v48.is-empty {
  grid-template-rows: auto minmax(0,1fr) auto;
  padding: 0 11px 11px;
  overflow: hidden;
  border-style: solid;
  border-color: color-mix(in srgb,var(--theme-muted) 15%,var(--theme-border));
  background:
    linear-gradient(135deg,transparent 0 48%,color-mix(in srgb,var(--theme-muted) 5%,transparent) 49% 51%,transparent 52%),
    color-mix(in srgb,var(--theme-card) 65%,transparent);
  background-size: 22px 22px,auto;
}
.team-slot-v48.is-empty > header small { color: color-mix(in srgb,var(--theme-muted) 72%,var(--theme-text)); letter-spacing: .08em; }
.team-empty-mark-v48 {
  position: relative;
  width: 66px;
  height: 66px;
  border: 1px solid color-mix(in srgb,var(--theme-muted) 16%,var(--theme-border));
  background: color-mix(in srgb,var(--theme-card) 86%,transparent);
  box-shadow: 0 8px 24px color-mix(in srgb,var(--theme-text) 6%,transparent),inset 0 1px var(--ui-highlight);
}
.team-empty-mark-v48::before,.team-empty-mark-v48::after { content: ""; position: absolute; z-index: -1; border: 1px solid color-mix(in srgb,var(--theme-muted) 13%,transparent); border-radius: 50%; }
.team-empty-mark-v48::before { inset: -9px; }
.team-empty-mark-v48::after { inset: -18px; }
.team-empty-mark-v48 > i { position: absolute; right: -3px; bottom: 2px; width: 9px; height: 9px; border-radius: 50%; background: var(--theme-accent); box-shadow: -15px 6px color-mix(in srgb,var(--theme-accent) 45%,transparent),-29px 3px color-mix(in srgb,var(--theme-accent) 20%,transparent); }
.team-slot-v48.is-empty > p { margin: 0; color: var(--theme-muted); font-size: 10px; font-weight: 750; text-align: center; }

/* Inventory v4.8 */
.inventory-v48 { display: flex; flex-direction: column; gap: 9px; min-height: 0; height: 100%; overflow: hidden; color: var(--theme-text); }
.inventory-head-v48 { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 62px; padding: 7px 58px 9px 5px; border-bottom: 1px solid color-mix(in srgb,var(--theme-accent) 15%,var(--theme-border)); cursor: grab; }
.inventory-title-v48 { display: flex; align-items: center; gap: 11px; min-width: 0; }
.inventory-title-v48 > span { display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid color-mix(in srgb,var(--theme-accent) 22%,var(--theme-border)); border-radius: 14px; background: color-mix(in srgb,var(--theme-accent) 8%,var(--theme-card)); color: var(--theme-accent); }
.inventory-title-v48 > span svg { width: 25px; height: 25px; }
.inventory-title-v48 small,.inventory-title-v48 h2 { display: block; }
.inventory-title-v48 small { color: var(--theme-muted); font-size: 9px; font-weight: 900; letter-spacing: .09em; }
.inventory-title-v48 h2 { margin: 2px 0 0; font-size: 23px; line-height: 1; }
.inventory-wallet-v48 { display: flex; gap: 7px; }
.inventory-wallet-v48 > span { display: grid; grid-template-columns: 21px minmax(34px,auto) 24px; align-items: center; gap: 5px; min-height: 37px; padding: 4px 5px 4px 9px; border: 1px solid var(--theme-border); border-radius: 13px; background: color-mix(in srgb,var(--theme-card) 88%,transparent); }
.inventory-wallet-v48 svg { width: 19px; height: 19px; }
.inventory-wallet-v48 .is-coins > svg { color: #e7ae21; }
.inventory-wallet-v48 .is-gems > svg { color: #42a3ed; }
.inventory-wallet-v48 b { font-size: 12px; text-align: center; }
.inventory-wallet-v48 button { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 8px; background: color-mix(in srgb,var(--theme-accent) 10%,var(--theme-surface-soft)); color: var(--theme-accent); }
.inventory-wallet-v48 button svg { width: 14px; height: 14px; }
.inventory-toolbar-v48 { display: grid; grid-template-columns: minmax(0,1fr) 170px 82px; gap: 8px; min-height: 42px; }
.inventory-search-v48,.inventory-sort-v48 { display: grid; align-items: center; min-width: 0; border: 1px solid var(--theme-border); border-radius: 13px; background: color-mix(in srgb,var(--theme-surface-soft) 82%,transparent); }
.inventory-search-v48 { grid-template-columns: 22px minmax(0,1fr) auto; gap: 7px; padding: 0 10px; }
.inventory-search-v48 svg,.inventory-sort-v48 svg { width: 18px; height: 18px; color: var(--theme-muted); }
.inventory-search-v48 input,.inventory-sort-v48 select { min-width: 0; height: 40px; border: 0; outline: 0; background: transparent; color: var(--theme-text); font: inherit; font-size: 11px; font-weight: 750; }
.inventory-search-v48 input::placeholder { color: color-mix(in srgb,var(--theme-muted) 72%,transparent); }
.inventory-search-v48 kbd { padding: 3px 6px; border: 1px solid var(--theme-border); border-radius: 7px; background: var(--theme-card); color: var(--theme-muted); font: 800 10px/1 Onest,sans-serif; }
.inventory-sort-v48 { grid-template-columns: 20px minmax(0,1fr) 16px; gap: 4px; padding: 0 8px; }
.inventory-sort-v48 select { appearance: none; cursor: pointer; }
.inventory-view-v48 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border: 1px solid var(--theme-border); border-radius: 13px; background: var(--theme-surface-soft); }
.inventory-view-v48 button { display: grid; place-items: center; min-width: 0; border: 0; border-radius: 9px; background: transparent; color: var(--theme-muted); }
.inventory-view-v48 button.is-active { background: var(--theme-card); color: var(--theme-accent); box-shadow: 0 3px 10px rgba(8,44,64,.09); }
.inventory-view-v48 svg { width: 18px; height: 18px; }
.inventory-layout-v48 { display: grid; grid-template-columns: 164px minmax(0,1fr); gap: 10px; min-height: 0; flex: 1; }
.inventory-v48 .inventory-categories-v48 { align-content: start; display: grid; grid-template-columns: minmax(0,1fr); gap: 4px; min-width: 0; min-height: 0; padding: 7px; overflow-x: hidden; overflow-y: auto; border: 1px solid var(--theme-border); border-radius: 16px; background: color-mix(in srgb,var(--theme-surface-soft) 72%,transparent); }
.inventory-v48 .inventory-categories-v48 > button { position: relative; display: grid; grid-template-columns: 25px minmax(0,1fr) auto; grid-template-rows: 1fr; justify-items: stretch; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 39px; padding: 5px 8px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--theme-muted); text-align: left; }
.inventory-categories-v48 > button:hover { background: color-mix(in srgb,var(--theme-card) 78%,transparent); color: var(--theme-text); }
.inventory-categories-v48 > button.is-active { border-color: color-mix(in srgb,var(--theme-accent) 35%,var(--theme-border)); background: color-mix(in srgb,var(--theme-accent) 8%,var(--theme-card)); color: var(--theme-accent); box-shadow: inset 3px 0 var(--theme-accent); }
.inventory-categories-v48 > button svg { width: 21px; height: 21px; }
.inventory-categories-v48 > button span { overflow: hidden; font-size: 10px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.inventory-categories-v48 > button i { display: grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 999px; background: color-mix(in srgb,var(--theme-muted) 9%,transparent); color: currentColor; font-size: 9px; font-style: normal; font-weight: 900; }
.inventory-catalog-v48 { display: grid; grid-template-rows: auto minmax(0,1fr); min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--theme-border); border-radius: 17px; background: color-mix(in srgb,var(--theme-card) 64%,transparent); }
.inventory-catalog-v48 > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 7px 11px; border-bottom: 1px solid var(--theme-border); }
.inventory-catalog-v48 > header small,.inventory-catalog-v48 > header b { display: block; }
.inventory-catalog-v48 > header small { color: var(--theme-accent); font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.inventory-catalog-v48 > header b { margin-top: 2px; font-size: 14px; }
.inventory-catalog-v48 > header > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.inventory-catalog-v48 > header em { padding: 4px 7px; border-radius: 999px; background: var(--theme-surface-soft); color: var(--theme-muted); font-size: 9px; font-style: normal; font-weight: 800; }
.inventory-content-v48 { min-height: 0; overflow: auto; padding: 9px; }
.inventory-items-v48 { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); align-content: start; gap: 8px; }
.inventory-v48 .inventory-item-v48 { position: relative; display: grid; grid-template-rows: 96px auto auto; align-content: start; width: auto; min-width: 0; min-height: 194px; height: auto; padding: 8px; overflow: hidden; border: 1px solid color-mix(in srgb,var(--rarity-color,var(--theme-accent)) 22%,var(--theme-border)); border-radius: 15px; background: linear-gradient(155deg,color-mix(in srgb,var(--theme-card) 96%,transparent),color-mix(in srgb,var(--rarity-color,var(--theme-accent)) 4%,var(--theme-card))); color: var(--theme-text); text-align: left; box-shadow: 0 6px 17px rgba(5,37,54,.06); transition: transform 130ms ease,border-color 130ms ease,box-shadow 130ms ease; }
.inventory-item-v48:hover,.inventory-item-v48:focus-visible { z-index: 2; border-color: color-mix(in srgb,var(--rarity-color,var(--theme-accent)) 58%,var(--theme-border)); box-shadow: 0 12px 26px rgba(4,34,51,.12); transform: translateY(-2px); }
.inventory-item-rarity-v48 { position: absolute; z-index: 3; top: 7px; right: 7px; padding: 3px 6px; border-radius: 999px; background: color-mix(in srgb,var(--rarity-color,var(--theme-accent)) 10%,var(--theme-card)); color: var(--rarity-color,var(--theme-muted)); font-size: 8px; font-weight: 900; }
.inventory-item-art-v48 { position: relative; display: grid; place-items: center; width: 100%; height: 92px; margin: 0; border: 0; border-radius: 12px; background: radial-gradient(circle,color-mix(in srgb,var(--rarity-color,var(--theme-accent)) 12%,transparent),transparent 64%); }
.inventory-item-art-v48 .item-icon,.inventory-item-art-v48 .item-icon img { width: 86px; height: 86px; object-fit: contain; }
.inventory-item-art-v48 > em { position: absolute; right: 1px; bottom: 1px; min-width: 29px; padding: 4px 6px; border: 2px solid var(--theme-card); border-radius: 999px; background: #173e58; color: #fff; font-size: 10px; font-style: normal; font-weight: 900; text-align: center; }
.inventory-item-copy-v48 { display: grid; min-width: 0; gap: 2px; padding: 0 2px; }
.inventory-item-copy-v48 > em { color: var(--theme-muted); font-size: 8px; font-style: normal; font-weight: 850; text-transform: uppercase; }
.inventory-item-copy-v48 > b { overflow: hidden; font-size: 12px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.inventory-item-copy-v48 > small { display: -webkit-box; overflow: hidden; color: var(--theme-muted); font-size: 9px; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.inventory-item-rights-v48 { align-self: end; justify-self: start; display: flex; gap: 3px; min-height: 18px; margin-top: 4px; }
.inventory-item-rights-v48 > i { display: inline-flex; align-items: center; gap: 2px; min-width: 0; padding: 2px 4px; border: 1px solid var(--theme-border); border-radius: 6px; background: var(--theme-surface-soft); color: var(--theme-muted); font-size: 8px; font-style: normal; }
.inventory-item-rights-v48 svg { width: 12px; height: 12px; }
.inventory-v48.is-list .inventory-items-v48 { grid-template-columns: 1fr 1fr; }
.inventory-v48.is-list .inventory-item-v48 { grid-template-columns: 72px minmax(0,1fr) auto; grid-template-rows: 1fr; align-items: center; min-height: 86px; }
.inventory-v48.is-list .inventory-item-art-v48 { width: 68px; height: 68px; }
.inventory-v48.is-list .inventory-item-art-v48 .item-icon,.inventory-v48.is-list .inventory-item-art-v48 .item-icon img { width: 64px; height: 64px; }
.inventory-v48.is-list .inventory-item-rarity-v48 { display: none; }
.inventory-v48.is-list .inventory-item-rights-v48 { align-self: center; }
.inventory-empty-v48 { grid-column: 1/-1; align-self: center; justify-self: center; width: min(360px,100%); min-height: 230px; margin-top: 50px; padding: 24px; border: 1px dashed var(--theme-border); border-radius: 20px; background: color-mix(in srgb,var(--theme-surface-soft) 62%,transparent); text-align: center; }
.inventory-battle-readonly-v48 { min-height: 46px; margin: 0; padding: 7px 10px; }
.inventory-item-dialog-v48 { width: min(720px,calc(100vw - 24px)); max-height: min(660px,calc(100dvh - 24px)); border-radius: 22px; }
.inventory-item-dialog-head-v48 { grid-template-columns: 150px minmax(0,1fr) auto; gap: 14px; min-height: 190px; padding: 16px; }
.inventory-item-dialog-head-v48 .inventory-item-dialog-v2740__art { width: 142px; height: 142px; border-radius: 22px; }
.inventory-item-dialog-head-v48 .item-icon,.inventory-item-dialog-head-v48 .item-icon img { width: 132px; height: 132px; object-fit: contain; }
.inventory-item-dialog-head-v48 h3 { font-size: 24px; }
.inventory-item-dialog-head-v48 p { font-size: 12px; line-height: 1.45; }
.inventory-mechanic-v48 { display: flex; align-items: center; gap: 7px; margin-top: 9px; padding: 8px 9px; border-radius: 11px; background: color-mix(in srgb,var(--theme-accent) 7%,var(--theme-surface-soft)); color: var(--theme-text); font-size: 10px; }
.inventory-mechanic-v48 svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--theme-accent); }

/* Pokémon evolution and skill points v4.8 */
.pokemon-detail-head-v47 { padding-right: 56px; }
.pokemon-detail-head-v47 > span { margin-right: 0; padding: 6px 10px; border-radius: 999px; background: color-mix(in srgb,var(--theme-accent) 8%,var(--theme-surface-soft)); color: var(--theme-accent); }
.pokemon-evolution-v48 { grid-template-columns: 126px minmax(0,1fr) auto; gap: 11px; padding: 9px 11px; }
.pokemon-evolution-pair-v48 { display: grid; grid-template-columns: 50px 18px 50px; align-items: center; gap: 2px; min-width: 0; }
.pokemon-evolution-pair-v48 > i { display: grid; place-items: center; width: 50px; height: 50px; overflow: hidden; border: 1px solid color-mix(in srgb,#8a63da 20%,var(--theme-border)); border-radius: 14px; background: color-mix(in srgb,#8a63da 7%,var(--theme-card)); }
.pokemon-evolution-pair-v48 > em { color: #8a63da; font-size: 18px; font-style: normal; font-weight: 900; text-align: center; }
.pokemon-evolution-portrait-v48,.pokemon-evolution-portrait-v48 img { width: 48px; height: 48px; object-fit: contain; }
.pokemon-evolution-pair-v48.is-final { grid-template-columns: 50px; }
.pokemon-mastery-head-v48 { display: grid; grid-template-columns: minmax(0,1fr) 154px; align-items: center; gap: 12px; }
.pokemon-mastery-head-v48 > span p { margin: 3px 0 0; color: var(--theme-muted); font-size: 9px; }
.pokemon-skill-points-v48 { display: grid !important; grid-template-columns: 28px minmax(0,1fr); align-items: center; gap: 8px; min-width: 0 !important; padding: 7px 9px !important; border: 1px solid color-mix(in srgb,var(--theme-accent) 22%,var(--theme-border)); border-radius: 13px !important; background: color-mix(in srgb,var(--theme-accent) 6%,var(--theme-card)) !important; color: var(--theme-accent) !important; box-shadow: none !important; }
.pokemon-skill-points-v48 > span { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 0 6px; min-width: 0; }
.pokemon-skill-points-v48 small { grid-column: 1; overflow: hidden; color: var(--theme-muted); font-size: 8px !important; text-overflow: ellipsis; white-space: nowrap; }
.pokemon-skill-points-v48 b { grid-column: 2; grid-row: 1/3; color: var(--theme-text); font-size: 20px !important; line-height: 1; }
.pokemon-skill-points-v48 em { grid-column: 1; color: var(--theme-muted); font-size: 8px !important; font-style: normal; }

/* Quest journal v4.8 */
.quest-journal-v48 { display: grid; grid-template-rows: auto auto auto minmax(0,1fr); gap: 9px; min-height: 0; height: 100%; overflow: hidden; color: var(--theme-text); }
.quest-journal-head-v48 { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 62px; padding: 6px 58px 9px 6px; border-bottom: 1px solid var(--theme-border); cursor: grab; }
.quest-journal-head-v48 > span { display: flex; align-items: center; gap: 10px; }
.quest-journal-head-v48 > span > svg { width: 34px; height: 34px; color: var(--theme-accent); }
.quest-journal-head-v48 small,.quest-journal-head-v48 h2,.quest-journal-head-v48 b { display: block; }
.quest-journal-head-v48 small { color: var(--theme-muted); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.quest-journal-head-v48 h2 { margin: 2px 0 0; font-size: 23px; line-height: 1; }
.quest-journal-head-v48 > div { max-width: 230px; min-width: 0; padding: 7px 10px; border: 1px solid color-mix(in srgb,var(--theme-accent) 20%,var(--theme-border)); border-radius: 12px; background: color-mix(in srgb,var(--theme-accent) 6%,var(--theme-card)); }
.quest-journal-head-v48 > div b { overflow: hidden; margin-top: 2px; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.quest-journal-summary-v48 { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.quest-journal-summary-v48 article { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 8px 11px; border: 1px solid var(--theme-border); border-radius: 14px; background: var(--theme-card); }
.quest-journal-summary-v48 small { color: var(--theme-muted); font-size: 9px; font-weight: 900; }
.quest-journal-summary-v48 b { color: var(--theme-accent); font-size: 18px; }
.quest-journal-tabs-v48 { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; padding: 4px; border: 1px solid var(--theme-border); border-radius: 14px; background: var(--theme-surface-soft); }
.quest-journal-tabs-v48 button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 37px; border: 0; border-radius: 10px; background: transparent; color: var(--theme-muted); font-size: 10px; font-weight: 850; }
.quest-journal-tabs-v48 button.is-active { background: var(--theme-card); color: var(--theme-accent); box-shadow: 0 4px 12px rgba(7,41,59,.09); }
.quest-journal-tabs-v48 i { min-width: 20px; padding: 2px 5px; border-radius: 999px; background: color-mix(in srgb,currentColor 9%,transparent); font-size: 8px; font-style: normal; }
.quest-journal-scroll-v48 { min-height: 0; overflow: auto; padding-right: 2px; }
.quest-journal-group-v48 + .quest-journal-group-v48 { margin-top: 12px; }
.quest-journal-group-v48 > h3,.quest-locations-v48 > h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 6px; color: var(--theme-text); font-size: 12px; }
.quest-journal-group-v48 > h3 span { display: grid; place-items: center; min-width: 21px; height: 21px; border-radius: 999px; background: var(--theme-surface-soft); color: var(--theme-muted); font-size: 9px; }
.quest-journal-group-v48 > div { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.quest-journal-card-v48 { display: grid; grid-template-columns: 46px minmax(0,1fr); gap: 9px; min-width: 0; min-height: 150px; padding: 9px; border: 1px solid var(--theme-border); border-radius: 16px; background: var(--theme-card); }
.quest-journal-card-v48.is-active { border-color: color-mix(in srgb,var(--theme-accent) 26%,var(--theme-border)); }
.quest-journal-card-v48.is-tracked { border-color: var(--theme-accent); box-shadow: inset 3px 0 var(--theme-accent),0 8px 20px color-mix(in srgb,var(--theme-accent) 10%,transparent); }
.quest-journal-card-v48.is-locked { opacity: .6; }
.quest-journal-icon-v48 { display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden; border-radius: 13px; background: color-mix(in srgb,var(--theme-accent) 8%,var(--theme-surface-soft)); color: var(--theme-accent); }
.quest-journal-icon-v48 > :is(i,svg),.quest-journal-icon-v48 .ui-icon { width: 28px; height: 28px; }
.quest-journal-icon-v48 img { width: 42px; height: 42px; object-fit: contain; }
.quest-journal-copy-v48 { display: grid; align-content: start; min-width: 0; }
.quest-journal-copy-v48 > small { color: var(--theme-accent); font-size: 8px; font-weight: 900; letter-spacing: .04em; }
.quest-journal-copy-v48 > b { overflow: hidden; margin-top: 2px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.quest-journal-copy-v48 > p { display: -webkit-box; min-height: 27px; margin: 4px 0 6px; overflow: hidden; color: var(--theme-muted); font-size: 10px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.quest-journal-progress-v48 { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 7px; }
.quest-journal-progress-v48 > i { height: 6px; overflow: hidden; border-radius: 999px; background: var(--theme-surface-soft); }
.quest-journal-progress-v48 > i u { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--theme-accent),#64cc88); text-decoration: none; }
.quest-journal-progress-v48 > em { color: var(--theme-muted); font-size: 8px; font-style: normal; font-weight: 800; }
.quest-journal-copy-v48 > footer { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px; margin-top: 7px; }
.quest-journal-copy-v48 > footer > span { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; color: var(--theme-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.quest-journal-copy-v48 > footer > span svg { flex: 0 0 auto; width: 14px; height: 14px; }
.quest-journal-copy-v48 > footer button { display: flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 8px; border: 1px solid var(--theme-border); border-radius: 9px; background: var(--theme-surface-soft); color: var(--theme-muted); font-size: 8px; font-weight: 900; }
.quest-journal-copy-v48 > footer button.is-active { border-color: var(--theme-accent); background: color-mix(in srgb,var(--theme-accent) 9%,var(--theme-card)); color: var(--theme-accent); }
.quest-journal-copy-v48 > footer button svg { width: 14px; height: 14px; }
.quest-locations-v48 { margin-top: 14px; }
.quest-locations-v48 > div { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.quest-locations-v48 article { display: grid; grid-template-columns: 27px minmax(0,1fr); align-items: center; gap: 7px; min-width: 0; min-height: 47px; padding: 7px; border: 1px solid var(--theme-border); border-radius: 12px; background: var(--theme-surface-soft); }
.quest-locations-v48 article > i { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: var(--theme-card); color: var(--theme-muted); font-size: 9px; font-style: normal; font-weight: 900; }
.quest-locations-v48 article.is-done > i { color: #43ae6d; }
.quest-locations-v48 b,.quest-locations-v48 small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quest-locations-v48 b { font-size: 10px; }.quest-locations-v48 small { margin-top: 2px; color: var(--theme-muted); font-size: 8px; }
.quest-journal-empty-v48 { display: grid; justify-items: center; gap: 7px; padding: 36px; border: 1px dashed var(--theme-border); border-radius: 17px; color: var(--theme-muted); text-align: center; }
.quest-journal-empty-v48 svg { width: 34px; height: 34px; }.quest-journal-empty-v48 b { color: var(--theme-text); }

.quest-widget-collapse { position: absolute; z-index: 5; top: 8px; right: 8px; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid color-mix(in srgb,var(--theme-accent) 18%,var(--theme-border)); border-radius: 9px; background: color-mix(in srgb,var(--theme-card) 90%,transparent); color: var(--theme-muted); cursor: pointer; }
.quest-widget-collapse span { display: block; font-size: 18px; line-height: 1; transition: transform 160ms ease; }
.game-screen .quest-widget.is-collapsed { width: 116px !important; min-height: 58px !important; padding: 0 !important; overflow: visible !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.game-screen .quest-widget.is-collapsed > :not(.quest-widget-journal,.quest-widget-collapse) { display: none !important; }
.game-screen .quest-widget.is-collapsed > .quest-widget-journal { display: grid !important; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 6px; min-height: 56px; padding: 7px 30px 7px 7px; border: 1px solid color-mix(in srgb,var(--theme-accent) 26%,var(--theme-border)); border-radius: 16px; background: color-mix(in srgb,var(--ui-glass-strong) 95%,transparent); color: var(--theme-text); box-shadow: 0 10px 24px rgba(3,27,39,.2); backdrop-filter: blur(14px); }
.game-screen .quest-widget.is-collapsed .quest-widget-journal > span:first-child { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: color-mix(in srgb,var(--theme-accent) 11%,var(--theme-card)); }
.game-screen .quest-widget.is-collapsed .quest-widget-journal > span:first-child svg { display: block; width: 18px !important; height: 18px !important; min-width: 18px; min-height: 18px; color: var(--theme-accent); }
.game-screen .quest-widget.is-collapsed .quest-widget-journal > span:last-child { min-width: 0; }.game-screen .quest-widget.is-collapsed .quest-widget-journal b,.game-screen .quest-widget.is-collapsed .quest-widget-journal small { display: block; }
.game-screen .quest-widget.is-collapsed .quest-widget-journal b { font-size: 10px; }.game-screen .quest-widget.is-collapsed .quest-widget-journal small { display: none; }
.game-screen .quest-widget.is-collapsed .quest-widget-collapse span { transform: rotate(180deg); }

@media (max-width: 800px) {
  .inventory-v48 { height: auto; min-height: 0; overflow: visible; }
  .inventory-head-v48 { min-height: 55px; padding: 5px 48px 7px 3px; cursor: default; }
  .inventory-title-v48 > span { width: 38px; height: 38px; }
  .inventory-title-v48 h2 { font-size: 19px; }.inventory-title-v48 small { font-size: 8px; }
  .inventory-wallet-v48 { gap: 4px; }.inventory-wallet-v48 > span { grid-template-columns: 17px minmax(24px,auto); min-height: 34px; padding: 4px 7px; }.inventory-wallet-v48 button { display: none; }
  .inventory-toolbar-v48 { grid-template-columns: minmax(0,1fr) 42px; }.inventory-sort-v48 { display: none; }.inventory-search-v48 kbd { display: none; }
  .inventory-layout-v48 { display: flex; flex-direction: column; overflow: visible; }
  .inventory-v48 .inventory-categories-v48 { display: flex; flex: 0 0 auto; gap: 5px; padding: 5px; overflow-x: auto; overflow-y: hidden; }
  .inventory-v48 .inventory-categories-v48 > button { flex: 0 0 84px; width: auto; grid-template-columns: 21px minmax(0,1fr); grid-template-rows: 1fr; min-height: 38px; padding: 5px 7px; }
  .inventory-categories-v48 > button span { font-size: 9px; }.inventory-categories-v48 > button i { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 3px; font-size: 7px; }
  .inventory-catalog-v48 { overflow: visible; }.inventory-catalog-v48 > header { min-height: 43px; }.inventory-catalog-v48 > header > div { display: none; }
  .inventory-content-v48 { overflow: visible; padding: 6px; }.inventory-items-v48 { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
  .inventory-v48 .inventory-item-v48 { grid-template-rows: 82px auto auto; min-height: 148px; padding: 6px; border-radius: 14px; }
  .inventory-item-art-v48 { height: 80px; }.inventory-item-art-v48 .item-icon,.inventory-item-art-v48 .item-icon img { width: 74px; height: 74px; }
  .inventory-item-copy-v48 > b { font-size: 11px; }.inventory-item-copy-v48 > small { -webkit-line-clamp: 1; }
  .inventory-item-rights-v48 { display: none; }.inventory-item-rarity-v48 { top: 5px; right: 5px; font-size: 7px; }
  .inventory-v48.is-list .inventory-items-v48 { grid-template-columns: 1fr; }
  .inventory-item-dialog-head-v48 { grid-template-columns: 104px minmax(0,1fr); min-height: 140px; padding: 12px; }.inventory-item-dialog-head-v48 .inventory-item-dialog-v2740__art { width: 100px; height: 100px; }.inventory-item-dialog-head-v48 .item-icon,.inventory-item-dialog-head-v48 .item-icon img { width: 94px; height: 94px; }.inventory-item-dialog-head-v48 > strong { grid-column: 1/-1; justify-self: end; }

  .game-screen .side-panel.is-quest-panel { top: max(60px,calc(env(safe-area-inset-top) + 54px)) !important; bottom: calc(88px + env(safe-area-inset-bottom)) !important; height: auto !important; }
  .quest-journal-v48 { height: auto; overflow: visible; }.quest-journal-head-v48 { min-height: 54px; padding: 5px 46px 7px 3px; cursor: default; }.quest-journal-head-v48 h2 { font-size: 19px; }.quest-journal-head-v48 > div { display: none; }
  .quest-journal-summary-v48 article { min-height: 44px; padding: 6px 8px; }.quest-journal-summary-v48 small { font-size: 7px; }.quest-journal-summary-v48 b { font-size: 14px; }
  .quest-journal-scroll-v48 { overflow: visible; }.quest-journal-group-v48 > div { grid-template-columns: 1fr; }.quest-journal-card-v48 { min-height: 134px; }
  .quest-locations-v48 > div { grid-template-columns: 1fr 1fr; }
  .game-screen .quest-widget .quest-widget-collapse { display: none !important; }

  .pokemon-evolution-v48 { grid-template-columns: 116px minmax(0,1fr); }.pokemon-evolution-v48 > button { grid-column: 1/-1; min-height: 36px; }.pokemon-mastery-head-v48 { grid-template-columns: minmax(0,1fr) 142px; }
  .team-head-v48 { padding-right: 46px; }.team-grid-v48 { overflow: visible; }.team-slot-v48.is-empty > p { font-size: 9px; }
}

@media (max-width: 430px) {
  .inventory-head-v48 { align-items: flex-start; }.inventory-title-v48 small { max-width: 134px; }.inventory-wallet-v48 { padding-top: 2px; }.inventory-wallet-v48 > span { grid-template-columns: 15px minmax(18px,auto); gap: 2px; padding-inline: 5px; }.inventory-wallet-v48 b { font-size: 10px; }
  .inventory-v48 .inventory-item-v48 { min-height: 142px; }.inventory-item-copy-v48 > em { font-size: 7px; }.inventory-item-copy-v48 > b { font-size: 10px; }
  .quest-journal-tabs-v48 button { font-size: 9px; }.quest-journal-card-v48 { grid-template-columns: 40px minmax(0,1fr); min-height: 128px; padding: 7px; }.quest-journal-icon-v48 { width: 38px; height: 38px; }.quest-journal-copy-v48 > footer { grid-template-columns: 1fr; }.quest-journal-copy-v48 > footer button { justify-content: center; }
  .quest-locations-v48 > div { grid-template-columns: 1fr; }
  .pokemon-evolution-v48 { grid-template-columns: 104px minmax(0,1fr); }.pokemon-evolution-pair-v48 { grid-template-columns: 42px 16px 42px; }.pokemon-evolution-pair-v48 > i,.pokemon-evolution-portrait-v48,.pokemon-evolution-portrait-v48 img { width: 42px; height: 42px; }.pokemon-mastery-head-v48 { grid-template-columns: 1fr 124px; }.pokemon-skill-points-v48 { grid-template-columns: 23px minmax(0,1fr); padding: 6px 7px !important; }.pokemon-skill-points-v48 small { font-size: 7px !important; }.pokemon-skill-points-v48 b { font-size: 17px !important; }
}

/* v4.9 cascade anchors — intentionally last so legacy inventory layers cannot restore the rail or verbose cards. */
.inventory-v49 .inventory-layout-v49 { display:grid; grid-template-columns:1fr; grid-template-rows:auto minmax(0,1fr); gap:7px; overflow:hidden; }
.inventory-v49 .inventory-categories-v49 { display:grid; grid-template-columns:repeat(10,minmax(0,1fr)); gap:4px; padding:4px; overflow:visible; }
.inventory-v49 .inventory-categories-v49 > button { display:grid; grid-template-columns:22px minmax(0,1fr); grid-template-rows:1fr; gap:5px; width:100%; min-height:37px; padding:4px 7px; }
.inventory-v49 .inventory-categories-v49 > button span { font-size:8px; }
.inventory-v49 .inventory-categories-v49 > button i { position:absolute; top:1px; right:2px; min-width:15px; height:15px; padding:0 3px; font-size:7px; }
.inventory-v49 .inventory-catalog-v49 { overflow:hidden; }
.inventory-v49 .inventory-content-v49 { overflow:auto; padding:8px; }
.inventory-v49 .inventory-items-v49 { grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; padding:0 1px 8px; }
.inventory-v49 .inventory-item-v49 { grid-template-rows:minmax(0,1fr) 30px; gap:2px; min-height:170px; height:170px; padding:7px; overflow:hidden; border-radius:17px; }
.inventory-v49 .inventory-item-art-v49 { width:100%; height:126px; border:0; border-radius:13px; box-shadow:none; }
.inventory-v49 .inventory-item-art-v49 .item-icon,.inventory-v49 .inventory-item-art-v49 .item-icon img { width:112px; height:112px; }
.inventory-v49 .inventory-item-copy-v49 { display:grid; place-items:center; min-height:28px; padding:0 4px; }
.inventory-v49 .inventory-item-copy-v49 > b { display:-webkit-box; font-size:11px; line-height:1.16; text-align:center; white-space:normal; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.inventory-v49 .inventory-item-rarity-v49 { top:8px; right:8px; font-size:7px; }
.inventory-v49.is-list .inventory-items-v49 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.inventory-v49.is-list .inventory-item-v49 { grid-template-columns:82px minmax(0,1fr); grid-template-rows:1fr; min-height:92px; height:92px; padding:5px 9px; }
.inventory-v49.is-list .inventory-item-art-v49 { width:80px; height:80px; }
.inventory-v49.is-list .inventory-item-art-v49 .item-icon,.inventory-v49.is-list .inventory-item-art-v49 .item-icon img { width:74px; height:74px; }
.inventory-v49.is-list .inventory-item-copy-v49 { justify-items:start; }
.inventory-v49.is-list .inventory-item-copy-v49 > b { font-size:12px; text-align:left; }

@media (max-width:800px) {
  .inventory-v49 .inventory-layout-v49 { display:flex; flex-direction:column; gap:6px; overflow:visible; }
  .inventory-v49 .inventory-categories-v49 { display:flex; gap:5px; padding:4px; overflow-x:auto; overflow-y:hidden; }
  .inventory-v49 .inventory-categories-v49 > button { flex:0 0 82px; width:82px; min-height:38px; }
  .inventory-v49 .inventory-catalog-v49 { overflow:visible; }
  .inventory-v49 .inventory-content-v49 { overflow:visible; padding:6px; }
  .inventory-v49 .inventory-items-v49 { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .inventory-v49 .inventory-item-v49 { grid-template-rows:minmax(0,1fr) 30px; min-height:151px; height:151px; padding:6px; }
  .inventory-v49 .inventory-item-art-v49 { width:100%; height:110px; }
  .inventory-v49 .inventory-item-art-v49 .item-icon,.inventory-v49 .inventory-item-art-v49 .item-icon img { width:96px; height:96px; }
  .inventory-v49.is-list .inventory-items-v49 { grid-template-columns:1fr; }
}

@media (max-width:430px) {
  .inventory-v49 .inventory-item-v49 { min-height:145px; height:145px; }
  .inventory-v49 .inventory-item-art-v49 { height:104px; }
  .inventory-v49 .inventory-item-art-v49 .item-icon,.inventory-v49 .inventory-item-art-v49 .item-icon img { width:90px; height:90px; }
}

/* v5.6 — the mobile carried team is a fixed 2x3 board: header and all six slots stay visible. */
@media (max-width:800px) {
  .game-screen .side-panel.is-team-panel,
  .game-screen .side-panel.is-team-panel.is-open {
    top:max(56px,calc(env(safe-area-inset-top) + 52px))!important;
    right:max(6px,env(safe-area-inset-right))!important;
    bottom:calc(72px + env(safe-area-inset-bottom))!important;
    left:max(6px,env(safe-area-inset-left))!important;
    width:auto!important;
    height:auto!important;
    max-width:none!important;
    max-height:none!important;
    padding:8px!important;
    overflow:hidden!important;
  }
  .game-screen .side-panel.is-team-panel #sidePanelContent {
    width:100%;
    height:100%!important;
    min-height:0;
    max-height:none!important;
    padding:0!important;
    overflow:hidden!important;
    overscroll-behavior:none;
  }
  .team-window-v56 {
    grid-template-rows:52px minmax(0,1fr)!important;
    gap:6px!important;
    width:100%;
    height:100%!important;
    min-height:0;
    overflow:hidden!important;
  }
  .team-window-v56::before { inset:0; border-radius:16px; }
  .team-head-v56 {
    position:relative;
    z-index:3;
    min-height:0!important;
    height:52px;
    padding:4px 48px 6px 4px!important;
    cursor:default;
  }
  .team-head-v56 > span { min-width:0; gap:8px; }
  .team-head-v56 .panel-ui-icon { flex:0 0 auto; width:28px; height:28px; }
  .team-head-v56 small { overflow:hidden; font-size:8px; text-overflow:ellipsis; white-space:nowrap; }
  .team-head-v56 h2 { margin-top:1px; font-size:18px; }
  .team-head-v56 > em { flex:0 0 auto; min-width:48px; padding:6px 8px; font-size:11px; }
  .team-grid-v56 {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:repeat(3,minmax(0,1fr))!important;
    gap:6px!important;
    width:100%;
    height:100%;
    min-height:0;
    padding:1px!important;
    overflow:hidden!important;
  }
  .team-slot-v56 {
    width:100%;
    height:auto!important;
    min-width:0;
    min-height:0!important;
    border-radius:15px!important;
  }
  .team-slot-main-v56 {
    grid-template-rows:clamp(22px,3.4dvh,28px) minmax(0,1fr) auto!important;
    width:100%;
    height:100%;
    min-height:0;
    padding:0 6px 6px!important;
    overflow:hidden;
  }
  .team-slot-main-v56 > header,
  .team-slot-v56.is-empty > header {
    min-height:clamp(22px,3.4dvh,28px)!important;
    font-size:clamp(8px,1.35vw,10px)!important;
  }
  .team-slot-main-v56 > header small,
  .team-slot-v56.is-empty > header small { font-size:clamp(7px,1.2vw,9px)!important; }
  .team-slot-art-v56 { min-height:0; overflow:hidden; }
  .team-slot-portrait-v56 {
    width:clamp(58px,11dvh,88px)!important;
    height:clamp(52px,9.5dvh,78px)!important;
  }
  .team-slot-copy-v56 { align-self:end; gap:2px!important; padding-bottom:1px; }
  .team-slot-copy-v56 > b { font-size:clamp(11px,2.1vw,14px)!important; }
  .team-slot-copy-v56 > small { margin:0; font-size:clamp(8px,1.45vw,10px)!important; }
  .team-slot-v56.is-empty {
    grid-template-rows:clamp(22px,3.4dvh,28px) minmax(0,1fr) 18px!important;
    padding:0 6px 6px!important;
  }
  .team-empty-mark-v56 {
    width:clamp(44px,8dvh,58px)!important;
    height:clamp(44px,8dvh,58px)!important;
  }
  .team-empty-mark-v56 .pokemon-ui-icon-v47 { width:60%; height:60%; }
  .team-slot-v56.is-empty > p { align-self:end; font-size:clamp(8px,1.25vw,9px)!important; line-height:1; }
}

@media (max-width:800px) and (max-height:650px) {
  .game-screen .side-panel.is-team-panel,
  .game-screen .side-panel.is-team-panel.is-open {
    top:max(48px,calc(env(safe-area-inset-top) + 44px))!important;
    bottom:calc(64px + env(safe-area-inset-bottom))!important;
    padding:6px!important;
  }
  .team-window-v56 { grid-template-rows:44px minmax(0,1fr)!important; gap:4px!important; }
  .team-head-v56 { height:44px; padding:3px 44px 4px 3px!important; }
  .team-head-v56 .panel-ui-icon { width:24px; height:24px; }
  .team-head-v56 small { font-size:7px; }
  .team-head-v56 h2 { font-size:16px; }
  .team-head-v56 > em { min-width:44px; padding:5px 7px; font-size:10px; }
  .team-grid-v56 { gap:4px!important; }
  .team-slot-main-v56 { grid-template-rows:22px minmax(0,1fr) auto!important; padding:0 5px 4px!important; }
  .team-slot-portrait-v56 { width:58px!important; height:48px!important; }
  .team-slot-copy-v56 { gap:1px!important; }
  .team-slot-copy-v56 > b { font-size:11px!important; }
  .team-slot-copy-v56 > small { font-size:8px!important; }
  .team-slot-v56.is-empty { grid-template-rows:22px minmax(0,1fr) 15px!important; padding:0 5px 4px!important; }
  .team-empty-mark-v56 { width:42px!important; height:42px!important; }
  .team-slot-v56.is-empty > p { font-size:8px!important; }
}

@media (max-width:800px) and (orientation:landscape) {
  .team-grid-v56 {
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
  }
}
