/* Sanctuary399: anchored world labels and separate, usable portrait HUD lanes. */
body #s333-screen-labels,
body #s333-objective-owners,
body #s263-public-bases,
body #sanctuary-building-rings268 {
  z-index:8!important;
}
body #s333-screen-labels .s333-level.s338-lifted::before {display:none!important}

/* The dungeon owns a chat entry in gameplay and its results toolbar. Returning
   home automatically restores the world launcher when the iframe is removed. */
body:has(#sanctuary-dungeon-frame244) > [data-sanctuary-world-chat-launch] {
  display:none!important;
}
body:has(#sanctuary-dungeon-frame244) #sanctuarySummonOrders387,
html[data-sanctuary-modal253="open"] #sanctuarySummonOrders387 {display:none!important}

/* Real event feedback sits immediately below the identity/objective cluster. */
body #sanctuary-v21-moments {
  top:var(--s399-feedback-top,calc(env(safe-area-inset-top) + 150px))!important;
  bottom:auto!important;
  width:min(calc(100vw - 112px),280px)!important;
  max-width:280px!important;
  z-index:95!important;
}
body #sanctuary-v21-moments .sanctuary-v21-moment {
  max-width:100%;box-sizing:border-box;
  padding:7px 10px!important;font-size:11px!important;
  letter-spacing:.035em!important;
  overflow:hidden;text-overflow:ellipsis;
}
body:has(#sanctuary-dungeon-frame244) #sanctuary-v21-moments,
html[data-sanctuary-modal253="open"] #sanctuary-v21-moments {display:none!important}

/* Home/Gear and companion health occupy one row above the skill wheel. */
#root .sanctuary-hud259 .combat-dock {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-areas:"companions home" "wheel wheel";
  align-items:end!important;
  width:min(240px,calc(100vw - 24px))!important;
  gap:10px 8px!important;
}
#root .sanctuary-hud259 .combat-dock.hidden {display:none!important}
#root .sanctuary-hud259.strategic-world-hud .combat-dock {display:none!important}
#root .sanctuary-hud259 .combat-dock > .combat-wheel {
  grid-area:wheel;justify-self:end;
}
#root .sanctuary-hud259 .combat-dock > .home-utility56 {
  grid-area:home;display:flex!important;flex-direction:row!important;
  align-items:center!important;gap:8px!important;margin:0!important;
}
#root .sanctuary-hud259 .home-utility56 > button {
  width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
  flex:0 0 44px!important;margin:0!important;
}
#root .sanctuary-hud259 .combat-dock > .s399-companions {
  grid-area:companions;display:flex!important;gap:5px!important;
  align-items:center!important;justify-content:flex-end!important;
  margin:0!important;min-width:0!important;
}
#root .sanctuary-hud259 .s399-companions > div {
  width:33px!important;max-width:33px!important;padding:2px!important;
  box-sizing:border-box!important;flex:0 0 33px!important;
}
#root .sanctuary-hud259 .s399-companions > div > div:first-child {
  width:27px!important;height:27px!important;
}
#root .sanctuary-hud259 .s399-companions img {width:22px!important;height:22px!important;object-fit:contain}

body #sanctuarySummonOrders387.s399-summon-orders {
  right:max(10px,env(safe-area-inset-right))!important;
  bottom:calc(var(--hud140-safe-bottom,12px) + var(--hud140-wheel,198px) + 66px)!important;
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
  width:min(320px,calc(100vw - 24px))!important;
  max-height:30dvh;overflow:auto;box-sizing:border-box;
  padding:7px!important;gap:5px!important;
}
body #sanctuarySummonOrders387.s399-summon-orders button {
  min-height:44px!important;min-width:0;padding:7px 5px!important;
  font:650 12px/1.2 system-ui!important;
}
body #sanctuarySummonOrders387.s399-summon-orders button[aria-pressed="true"] {
  background:#375f50!important;color:#fff3c4!important;border-color:#e4c579!important;
  box-shadow:inset 0 0 0 1px #e4c579;
}
@media(max-width:360px) {
  #root .sanctuary-hud259 .combat-dock {width:220px!important}
  #root .sanctuary-hud259 .s399-companions {gap:3px!important}
  #root .sanctuary-hud259 .s399-companions > div {width:30px!important;max-width:30px!important;flex-basis:30px!important}
}
@media(max-height:560px) and (orientation:landscape) {
  #root .sanctuary-hud259 .combat-dock {gap:6px!important;width:220px!important}
  body #sanctuarySummonOrders387.s399-summon-orders {bottom:calc(var(--hud140-safe-bottom,7px) + 218px)!important}
}
