/* Phone layout and reduced-motion overrides. Keep this file last. */

@media (max-width:760px){
  .paper{width:100%;padding:12px 28px 16px;max-height:none}
  .room{padding:0}
  .pc{width:100%;border-radius:0;padding:max(8px,env(safe-area-inset-top,0px)) 8px 0;max-height:none;box-shadow:none}
  .scene,.kbd,.mug{display:none}
  .well{padding:6px;border-radius:12px}
  .screen{border-radius:10px}
  .chin{height:52px}
  .badge small{display:none}
  .power{width:34px;height:34px}

  /* Stack icons above hero in a single column; use flex so each section
     sizes to its content (icons) or takes the remaining space (hero). */
  .desk-main{display:flex;flex-direction:column;min-height:0}
  .icons{
    flex-shrink:0;
    flex-direction:row;flex-wrap:wrap;justify-content:flex-start;
    gap:2px;padding:8px 6px 0;height:auto;overflow-y:visible
  }
  .ico{width:calc(25% - 2px)}
  .ico .glyph{width:32px;height:32px}
  .ico .lbl{font-size:10.5px;white-space:normal;overflow-wrap:anywhere}
  /* Hero takes the rest of the vertical space and scrolls if needed */
  .hero{flex:1;min-height:0;overflow:hidden;align-self:auto;padding:14px 16px 20px}

  /* Windows: fill the screen edge-to-edge, scroll their body */
  .win{
    left:0!important;top:0!important;
    right:0;bottom:0;
    width:100%!important;max-height:none!important;
    height:100%;border-left:none;border-right:none
  }
  /* Window body: scroll vertically, never clip horizontally */
  .body{
    padding:14px 14px 20px;
    overflow-x:hidden;
    overflow-y:auto;
    word-break:break-word;
    overflow-wrap:anywhere
  }
  /* role summary: allow .when to wrap so it doesn't blow past the edge */
  details.role summary{grid-template-columns:2.2em 1fr;gap:4px 8px}
  details.role summary .when{grid-column:2;white-space:normal;font-size:12px}

  .tray .avail,.tray .reload-hint{display:none}
  #bootscreen{padding:18px;font-size:12.5px}

  /* Hire wizard: title must wrap, not clip */
  .wiz-page h2{overflow-wrap:break-word;word-break:break-word;font-size:22px}
  .wiz-page p{overflow-wrap:break-word}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important}
}
