/* Keep the spirit-root shell stationary; only its content may scroll if needed. */
#game-root .cave-panel:has(.spirit-root-panel:not([hidden])) {
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
#game-root .cave-panel:has(.spirit-root-panel:not([hidden])) > .feature-page-heading {
  flex:none;
}
#game-root .cave-panel:has(.spirit-root-panel:not([hidden])) > [data-role="cave-content"] {
  display:flex;
  flex:1;
  flex-direction:column;
  min-height:0;
  overflow:hidden;
}
#game-root .cave-panel:has(.spirit-root-panel:not([hidden])) .cave-module-grid {
  flex:none;
}
#game-root .cave-panel .spirit-root-panel:not([hidden]) {
  flex:1;
  min-height:0;
  align-content:start;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  overflow-anchor:none;
}
#game-root .spirit-root-panel .spirit-root-table :is(th,td) {
  padding-top:10px;
  padding-bottom:10px;
}

/* The current companion is a complete fixed sheet; the bonds list remains scrollable. */
#game-root .page-panel.companion-page {
  grid-template-rows:36px 42px minmax(0,1fr);
  row-gap:14px;
  overflow:hidden;
}
#game-root .page-panel.companion-page > :is(.feature-page-heading,.companion-tabs) {
  margin:0;
}
#game-root .companion-page .companion-content--current {
  padding:10px;
  overflow:hidden;
}
#game-root .companion-page .companion-content--known {
  overflow-y:auto;
  overscroll-behavior:contain;
}
#game-root .companion-current-summary {
  grid-template-columns:132px minmax(0,1fr);
  gap:12px;
  align-items:start;
}
#game-root .companion-current-portrait {
  width:132px;
  height:184px;
  aspect-ratio:auto;
}
#game-root .companion-current-copy h3 { padding-bottom:7px; }
#game-root .companion-current-copy .companion-info-row {
  min-height:35px;
  padding:5px 0;
  line-height:24px;
}
#game-root .companion-page :is(.companion-attribute-section,.companion-kungfu-section,.companion-equipment-section) {
  margin-top:17px;
  padding:17px 8px 8px;
}
#game-root .companion-attribute-grid > div { padding:7px 3px; }
#game-root .companion-page .companion-slot-card {
  min-height:98px;
  padding:6px 3px;
  gap:5px;
}
#game-root .companion-page .reserved-slot-card__icon {
  width:36px;
  height:36px;
  min-width:36px;
}
#game-root .companion-page .reserved-slot-card__content { gap:3px; }
#game-root .companion-page .reserved-slot-card__name {
  white-space:normal;
  overflow-wrap:anywhere;
  text-overflow:clip;
  font-size:13px;
  line-height:18px;
}

/* Character creation uses text choices until dedicated selection portraits are ready. */
#game-root .create-form .gender-portrait,
#game-root .network-character-create__portrait { display:none!important; }
