/* Explore right panel true reset
   Clean replacement for the old stacked patch file.
   Loaded after explore.css, so this file intentionally owns the panel layout. */

:root{
  --explorePanelGap: 12px;
  --explorePanelPad: 12px;
  --explorePanelRadius: 18px;
  --exploreFooterNav: 38px;
  --explorePip: 10px;
  --explorePipGap: 5px;
  --exploreLabelCol: 54px;
}

/* parent column sizing + swarm gap */
.panelWrap{
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: clamp(340px, 27vw, 410px);
  gap: 0;
  padding-right: 0;
  overflow: visible;
}

.swarm{
  right: calc(clamp(340px, 27vw, 410px) + 22px);
}

/* one clean card model */
#bodPanel.bodPanel{
  margin-top: 0;
  padding: var(--explorePanelPad);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--explorePanelGap);
  height: auto;
  max-height: calc(100dvh - 84px);
  min-height: 0;
  overflow: hidden;
  container-type: normal;
}

#bodPanel[hidden]{ display:none !important; }

#bodPanel .bodPanelMain{
  display: flex;
  flex-direction: column;
  gap: var(--explorePanelGap);
  min-height: 0;
}

#bodPanel .bodMedia,
#bodPanel .bodPanelBody,
#bodPanel .bodFooterRail{
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}

#bodPanel .bodMedia{
  aspect-ratio: 1 / 1;
  min-height: 0;
  border-radius: 16px;
  overflow: hidden;
}

#bodPanel .bodMedia video,
#bodPanel .bodMedia img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#bodPanel .bodPanelBody{
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

#bodPanel .bodInfo{
  flex: 0 0 auto;
  min-height: 0;
  padding: 0;
  gap: 8px;
}

#bodPanel .bodBrand{ margin: 0 !important; }
#bodPanel #bodFaction{ display: none; }
#bodPanel .bodHeadingRow{
  margin-top: 0 !important;
  gap: 10px !important;
}
#bodPanel .bodName{
  margin: 0 !important;
  font-size: 18px;
  line-height: 1.08;
}
#bodPanel .bodRole--heading{
  margin-top: 0 !important;
  align-self: center !important;
}
#bodPanel .bodDesc{
  margin: 0 !important;
  line-height: 1.35;
}
#bodPanel .bodGameplay,
#bodPanel .bodShadeLord,
#bodPanel .buddiUpAddRow{
  margin-top: 0;
}

#bodPanel .kitDrawer{
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  width: 100%;
  margin: 0;
  padding: 10px 12px 12px;
  box-sizing: border-box;
  max-height: min(28dvh, 240px);
  min-height: 0;
  overflow: auto;
  flex: 0 0 auto;
}

#bodPanel .kitRows,
#bodPanel .kitTabs,
#bodPanel .kitTabPanel{
  min-height: 0;
}

#bodPanel .kitTabBar{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
}

#bodPanel .kitTabBtn{
  min-width: 0;
  padding: 7px 10px;
  font-size: 11px;
}

/* footer rail: no line, no absolute positioning */
#bodPanel .bodFooterRail{
  flex: 0 0 auto;
  padding-top: 2px;
}

#bodPanel .bodFooterLine{
  display: none;
}

#bodPanel .bodFooterNavRow{
  display: grid;
  grid-template-columns: var(--exploreFooterNav) minmax(0,1fr) var(--exploreFooterNav);
  align-items: center;
  gap: 10px;
}

#bodPanel .miniNav{
  position: static;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  width: var(--exploreFooterNav);
  height: var(--exploreFooterNav);
  min-width: var(--exploreFooterNav);
  min-height: var(--exploreFooterNav);
  margin: 0;
  justify-self: center;
  flex: 0 0 var(--exploreFooterNav);
}

#bodPanel .pipStats{
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#bodPanel .pipRow{
  width: 100%;
  max-width: none;
  min-width: 0;
  display: grid;
  grid-template-columns: var(--exploreLabelCol) minmax(0,1fr);
  align-items: center;
  gap: 8px;
}

#bodPanel .pipLabel{
  min-width: 0;
  font-size: 10px;
  letter-spacing: .16em;
}

#bodPanel .pips{
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--explorePipGap);
  flex-wrap: nowrap;
  overflow: hidden;
}

#bodPanel .pip{
  width: var(--explorePip);
  height: var(--explorePip);
  min-width: var(--explorePip);
  min-height: var(--explorePip);
  flex: 0 0 var(--explorePip);
  border-radius: 999px;
}

/* tighten chip rows so inner boxes use the card width better */
#bodPanel .bodShadeLord,
#bodPanel .kitDrawer,
#bodPanel .bodGameplay{
  width: 100%;
  max-width: none;
}

/* stable scrollbars only inside the middle box */
#bodPanel .kitDrawer,
#bodPanel .kitTabPanel{
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.28) transparent;
}
#bodPanel .kitDrawer::-webkit-scrollbar,
#bodPanel .kitTabPanel::-webkit-scrollbar{
  width: 8px;
}
#bodPanel .kitDrawer::-webkit-scrollbar-track,
#bodPanel .kitTabPanel::-webkit-scrollbar-track{
  background: transparent;
}
#bodPanel .kitDrawer::-webkit-scrollbar-thumb,
#bodPanel .kitTabPanel::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.22);
  border-radius: 999px;
}

/* shorter laptop windows */
@media (max-height: 940px){
  .panelWrap{
    width: clamp(328px, 27vw, 388px);
  }
  .swarm{
    right: calc(clamp(328px, 27vw, 388px) + 20px);
  }
  #bodPanel.bodPanel{
    max-height: calc(100dvh - 72px);
    gap: 10px;
    padding: 10px;
  }
  #bodPanel .bodName{ font-size: 17px; }
  #bodPanel .bodDesc{ font-size: 13px; }
  #bodPanel .kitDrawer{ max-height: min(24dvh, 200px); }
}

@media (max-height: 820px){
  :root{
    --exploreFooterNav: 36px;
    --explorePip: 9px;
    --explorePipGap: 4px;
    --exploreLabelCol: 58px;
  }

  #bodPanel.bodPanel{
    max-height: calc(100dvh - 64px);
    padding: 9px;
    gap: 9px;
  }

  #bodPanel .bodName{ font-size: 16px; }
  #bodPanel .bodDesc{ font-size: 12.5px; }
  #bodPanel .kitDrawer{ max-height: min(21dvh, 164px); padding: 9px 10px 10px; }
  #bodPanel .kitTabBtn{ padding: 6px 8px; font-size: 10px; }
}


/* v17 polish restoration: smaller faction mark, tighter add button, pill tabs */
#bodPanel #bodFactionLogoOverlay{
  top: 10px;
  left: 10px;
  height: clamp(18px, 2.1vw, 24px);
  max-height: 24px;
  max-width: 22%;
  image-rendering: auto;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.52));
}

#bodPanel .buddiUpAddRow{
  margin: 0 0 2px 0 !important;
}

#bodPanel .buddiUpAddBtn{
  padding: 4px 10px !important;
  min-height: 0 !important;
  font-size: 10px !important;
  line-height: 1 !important;
  font-weight: 400 !important;
  letter-spacing: .05em !important;
  gap: 2px !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent),
    0 6px 14px rgba(0,0,0,.12) !important;
}

#bodPanel .buddiUpBtnLabel{
  font-size: 10px !important;
  letter-spacing: .08em !important;
}

#bodPanel .buddiUpChev{
  font-size: 10px !important;
  line-height: 1 !important;
  font-weight: 400 !important;
}

#bodPanel .kitTabBar{
  gap: 10px;
}

#bodPanel .kitTabBtn{
  min-height: 40px;
  padding: 0 12px !important;
  border-radius: 999px !important;
  background: rgba(0,0,0,.16) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 11px !important;
  letter-spacing: .12em !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
}

#bodPanel .kitTabBtn.isActive,
#bodPanel .kitTabBtn[aria-selected="true"]{
  background: color-mix(in srgb, var(--accent) 8%, rgba(0,0,0,.14)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent),
    0 0 10px color-mix(in srgb, var(--accent) 12%, transparent) !important;
}

@media (max-height: 820px){
  #bodPanel #bodFactionLogoOverlay{
    top: 9px;
    left: 9px;
    height: 20px;
    max-height: 20px;
  }

  #bodPanel .buddiUpAddBtn{
    padding: 4px 9px !important;
    font-size: 9px !important;
  }

  #bodPanel .buddiUpBtnLabel,
  #bodPanel .buddiUpChev{
    font-size: 9px !important;
  }

  #bodPanel .kitTabBtn{
    min-height: 36px;
    padding: 0 10px !important;
    font-size: 10px !important;
  }
}

/* v20 selector-corrected polish: restore larger smooth faction logo, old add button feel, tighter tab pills */
#bodPanel #bodFactionLogoOverlay{
  top: 12px !important;
  left: 12px !important;
  height: clamp(26px, 4.8vw, 40px) !important;
  width: auto !important;
  max-width: 30% !important;
  max-height: 40px !important;
  object-fit: contain !important;
  image-rendering: auto !important;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,.58)) !important;
  opacity: 0.98 !important;
}

#bodPanel .buddiUpAddBtn{
  min-height: 24px !important;
  padding: 3px 10px !important;
  font-size: 10px !important;
  line-height: 1 !important;
  font-weight: 400 !important;
  letter-spacing: .08em !important;
  font-weight: 400 !important;
  gap: 0 !important;
}

#bodPanel .buddiUpBtnLabel{
  margin-left: 7px !important;
  font-size: 10px !important;
  letter-spacing: .08em !important;
  font-weight: 400 !important;
}

#bodPanel .buddiUpChev{
  font-size: 10px !important;
  line-height: 1 !important;
  font-weight: 400 !important;
}

#bodPanel .kitTabBar{
  gap: 8px !important;
}

#bodPanel .kitTabBtn{
  min-height: 0 !important;
  height: 34px !important;
  padding: 0 10px !important;
  line-height: 1 !important;
  font-size: 10px !important;
  letter-spacing: .11em !important;
  border-radius: 999px !important;
}

@media (max-height: 820px){
  #bodPanel #bodFactionLogoOverlay{
    top: 10px !important;
    left: 10px !important;
    height: clamp(24px, 4.4vw, 36px) !important;
    max-height: 36px !important;
  }

  #bodPanel .buddiUpAddBtn{
    min-height: 22px !important;
    padding: 3px 9px !important;
    font-size: 9px !important;
    font-weight: 400 !important;
  }

  #bodPanel .buddiUpBtnLabel,
  #bodPanel .buddiUpChev{
    font-size: 9px !important;
  }

  #bodPanel .kitTabBtn{
    height: 32px !important;
    padding: 0 9px !important;
    font-size: 9.5px !important;
  }
}

/* v22 polish: restore ShadeLord identity card look, tighten pills */
#bodPanel .kitTabPanel[data-tab-panel="identity"]{
  padding: 0 !important;
  overflow: visible !important;
}

#bodPanel .identityCard{
  width: 100%;
  box-sizing: border-box;
  padding: 12px 12px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02));
}

#bodPanel .identityHero{
  display: flex;
  align-items: center;
  gap: 10px;
}

#bodPanel .identityPortrait{
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  line-height: 1;
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.10);
  background:
    radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--identityAccent, var(--accent, #8fa3bb)) 42%, rgba(255,255,255,.06)) 0%, rgba(255,255,255,.05) 22%, transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 0 0 1px color-mix(in srgb, var(--identityAccent, var(--accent, #8fa3bb)) 12%, transparent),
    0 0 16px color-mix(in srgb, var(--identityAccent, var(--accent, #8fa3bb)) 18%, transparent);
}

#bodPanel .identityMeta{
  min-width: 0;
}

#bodPanel .identityKicker{
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.66);
  line-height: 1.2;
}

#bodPanel .identityName{
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.18;
  font-weight: 600;
  color: rgba(255,255,255,0.94);
}

#bodPanel .identityChips{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

#bodPanel .identityChip{
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.035);
  font-size: 12px;
  line-height: 1;
  color: rgba(255,255,255,0.9);
}

#bodPanel .identityTone{
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.42;
  color: rgba(255,255,255,0.82);
}

#bodPanel .kitTabBar{
  gap: 8px !important;
}

#bodPanel .kitTabBtn{
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 9px !important;
  font-size: 10px !important;
  line-height: 1 !important;
}

#bodPanel .buddiUpAddBtn,
#bodPanel .addToSlotBtn,
#bodPanel [class*="addToSlot"]{
  font-weight: 400 !important;
}

@media (max-height: 820px){
  #bodPanel .identityCard{
    padding: 11px 11px 9px;
  }
  #bodPanel .identityPortrait{
    width: 54px;
    height: 54px;
    flex-basis: 54px;
    border-radius: 13px;
    font-size: 21px;
  }
  #bodPanel .identityName{
    font-size: 13px;
  }
  #bodPanel .identityChip{
    min-height: 22px;
    padding: 0 9px;
    font-size: 11px;
  }
  #bodPanel .kitTabBtn{
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 8px !important;
    font-size: 9.5px !important;
  }
}


/* v23 spacing + window polish */
.panelWrap{
  top: 10px;
}

#bodPanel.bodPanel{
  align-self: flex-start;
}

#bodPanel .kitTabBar{
  margin-bottom: 8px !important;
}

#bodPanel .identityPortrait{
  position: relative;
  isolation: isolate;
  overflow: visible;
}

#bodPanel .identityPortrait::before{
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle,
    color-mix(in srgb, var(--identityAccent, var(--accent, #8fa3bb)) 34%, rgba(255,255,255,.12)) 0%,
    color-mix(in srgb, var(--identityAccent, var(--accent, #8fa3bb)) 18%, transparent) 34%,
    rgba(0,0,0,0) 72%);
  filter: blur(10px);
  opacity: .62;
  z-index: -1;
  pointer-events: none;
}

#bodPanel .pip{
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

#bodPanel .pip.isOn,
#bodPanel .pip.active,
#bodPanel .pip[data-active="true"],
#bodPanel .pip[aria-pressed="true"]{
  box-shadow: 0 0 4px currentColor;
}

#bodPanel .pipRow:hover .pip.isOn,
#bodPanel .pipRow:hover .pip.active,
#bodPanel .pipRow:hover .pip[data-active="true"],
#bodPanel .pipRow:hover .pip[aria-pressed="true"]{
  box-shadow: 0 0 6px currentColor, 0 0 12px color-mix(in srgb, currentColor 48%, transparent);
  transform: translateY(-.5px);
}

@media (max-height: 820px){
  .panelWrap{ top: 8px; }
  #bodPanel .kitTabBar{ margin-bottom: 7px !important; }
  #bodPanel .identityPortrait::before{ inset: -10px; filter: blur(9px); opacity: .58; }
}


/* === v25: give footer pips a little more horizontal breathing room === */
#bodPanel .bodFooterNavRow{
  gap: 12px;
}
#bodPanel .pipStats{
  padding: 0 2px;
}
#bodPanel .pipRow{
  gap: 10px;
}

/* === v26: reopen the footer pip lane so dots stop feeling horizontally compressed === */
#bodPanel .bodFooterNavRow{
  grid-template-columns: 32px minmax(0,1fr) 32px;
  gap: 8px;
}

#bodPanel .miniNav{
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  flex: 0 0 32px;
}

#bodPanel .pipStats{
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
}

#bodPanel .pipRow{
  grid-template-columns: var(--exploreLabelCol) minmax(0,1fr);
  gap: 6px;
}

#bodPanel .pips{
  gap: 6px;
  justify-content: flex-start;
  overflow: visible;
}

#bodPanel .pip{
  flex: 0 0 var(--explorePip);
}

/* === v27: center the pip track within the footer lane === */
#bodPanel .pipRow{
  grid-template-columns: var(--exploreLabelCol) minmax(0,1fr);
  gap: 8px;
}

#bodPanel .pips{
  justify-content: center;
  width: 100%;
}

/* === Explore right panel mobile stack pass === */
@media (max-width: 1100px) and (orientation: portrait) {
  .panelWrap{
    width:100%;
    max-width:none;
    min-width:0;
    overflow:visible;
  }

  .swarm{
    right:auto;
  }

  #bodPanel.bodPanel{
    max-height:none;
    height:auto;
  }

  #bodPanel .bodMedia{
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 760px) {
  .panelWrap{
    width:100%;
  }

  #bodPanel .bodHeadingRow{
    align-items:flex-start;
    flex-wrap:wrap;
  }

  #bodPanel .bodName{
    font-size:17px;
  }

  #bodPanel .pipRow{
    grid-template-columns: 50px minmax(0,1fr);
    gap:6px;
  }
}
