
/* Rebuild 36: safe UI-only window improvements, based directly on Rebuild 34. */
/* Let normal tool windows use the full viewport and layer above the turn tracker. */
.tool-panel:not(.hidden) {
  max-height: calc(100dvh - 50px) !important;
  z-index: 120000 !important;
}
/* Keep standard close/collapse controls visible while their panel scrolls. */
.tool-panel:not(.hidden) > .panel-close-btn:not(.panel-close-inline) {
  position: sticky !important;
  top: 0 !important;
  right: auto !important;
  align-self: flex-end !important;
  margin-bottom: -34px !important;
  z-index: 120100 !important;
}
.tool-panel:not(.hidden) > .panel-collapse-btn:not(.panel-collapse-inline) {
  position: sticky !important;
  top: 0 !important;
  right: auto !important;
  align-self: flex-end !important;
  transform: translateX(-42px) !important;
  margin-bottom: -34px !important;
  z-index: 120099 !important;
}
.tool-panel.panel-collapsed > .panel-collapse-btn:not(.panel-collapse-inline) {
  transform: translateX(-42px) rotate(180deg) !important;
}
/* Word/rules reference becomes a compact top card. Backdrop remains tap-to-close. */
#rulesReferenceOverlay {
  align-items: flex-start !important;
  justify-content: center !important;
  padding: 8px !important;
  background: rgba(2,6,23,.46) !important;
}
#rulesReferenceCard {
  width: min(560px, calc(100vw - 16px));
  max-height: min(72dvh, 620px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 1px solid rgba(148,163,184,.38);
  border-radius: 12px;
  background: rgba(15,23,42,.985);
  box-shadow: 0 18px 55px rgba(0,0,0,.62);
}
#rulesReferenceBody { overflow-y:auto !important; min-height:0; }

/* CHARACTER DESIGN 123 — the persistent character identity banner (SHEETS 288: the close/collapse controls are now in the standard panel header above it). */
#csPlayHeader .cs-play-identity-row {
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
}
#csPlayHeader .cs-play-identity-row > .cs-play-identity {
  flex:1 1 auto !important;
  min-width:0 !important;
}
