/* Shared layout limits for the browser interface. Keep wide data tables scrollable inside their panels. */
.web .shell > main { min-width: 0; }
.web :is(.table, .tier-scroll) { max-width: 100%; }
.web dialog { max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
.web :is(.me-grid, .gear-grid, .plan-goals) { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.web .eg-teams { grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.web .zz-rooms { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.web .zz-enemy > div { min-width: 0; overflow-wrap: anywhere; }
.web .zt-rooms { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.web .zt-room { min-width: 0; }
.web .zt-squad { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.web .zt-member { min-width: 0; overflow-wrap: anywhere; }
.web .zt-member img { max-width: 100%; height: auto; aspect-ratio: 1; }

@media (max-width: 900px) {
  #tierBoard .tier-matrix { min-width: 0; }
  #tierBoard .tier-head { display: none; }
  #tierBoard .tier-band { grid-template-columns: minmax(0, 1fr); }
  #tierBoard .tier-band h2 {
    justify-content: start; padding: 8px 12px; border-right: 0;
    border-bottom: 1px solid var(--band-line); font-size: 24px;
  }
  #tierBoard .tier-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 7px 8px; gap: 5px 8px; }
  #tierBoard .rank-label { grid-column: 1 / -1; justify-content: start; padding: 2px 4px; font-size: 22px; }
  #tierBoard .tier-cell { padding: 3px 4px 7px; border: 0; }
  #tierBoard .tier-cell:empty { display: none; }
  #tierBoard .tier-cell::before {
    content: attr(aria-label); grid-column: 1 / -1; color: #e6d7ed; font-size: 12px;
  }
  .tier-modes button { overflow-wrap: anywhere; }
}

@media (max-width: 520px) {
  #tierBoard .tier-row { grid-template-columns: minmax(0, 1fr); }
  .web .mobile-quick { height: auto; flex-wrap: wrap; justify-content: center; gap: 0 7px; }
  .web .mobile-quick :is(a,button) { min-height: 40px; padding-inline: 4px; }
  .web .shell > aside { column-gap: 7px; padding-inline: 10px; }
  .web .header-tools .web-account { max-width: none; }
}

@media (max-height: 490px) and (orientation: landscape) {
  .web .shell > aside { position: relative; }
  .web aside:has(#mobileMenu[aria-expanded=true]) .menu { max-height: 65vh; }
}

@media (pointer: coarse) {
  .web .tier-unit-info { min-width: 34px; min-height: 34px; bottom: 38px; }
  .web #tierBoard .tier-unit-info { bottom: 43px; }
  .web :is(#tierBoard,.character-directory) .unit-caption { padding-inline: 4px; }
  .web .tier-preview-dismiss { min-width: 40px; min-height: 40px; }
}
