/* Compact team access on narrow screens; all frames reuse the native atlas.
   Desktop party strips and the existing combat input positions stay intact. */
#team-mobile-toggle,.team-mobile-toolbar,.team-mobile-note,.battle-team-name,.battle-team-health { display:none; }
#team-mobile-panel { display:contents; }
@media(max-width:900px), (pointer:coarse) and (max-width:1200px) and (max-height:600px) {
 /* The shared readout keeps move names and status details. A viewport bound
    replaces its desktop bottom anchor, which could put its top above zero. */
 body.native-ui.teams-battle .local-party-preview {
  position:fixed;top:8px;bottom:auto;left:8px;right:auto;transform:none;
  min-width:0;width:min(270px,calc(100% - 16px));max-width:calc(100% - 16px);
  max-height:calc(100% - 16px);overflow-y:auto;overscroll-behavior:contain;pointer-events:auto;
 }
 body.native-ui.teams-battle:has(#team-mobile-panel[hidden]) .local-party-preview { display:none!important; }
 body.native-ui.teams-battle #team-mobile-toggle {
  display:block;position:absolute;left:8px;top:104px;width:180px;min-height:34px;
  padding:9px 18px;pointer-events:auto;z-index:7;border:0;
  font:10px/13px 'Pixelify Sans',sans-serif;color:#fff4dc;text-shadow:1px 1px #07191c;
  white-space:normal;text-align:center;cursor:pointer;
 }
 body.native-ui.teams-battle #team-mobile-panel {
  display:grid;position:absolute;left:8px;top:104px;width:min(390px,calc(100% - 16px));
  max-height:calc(100% - 112px);grid-template-rows:auto auto minmax(0,1fr);gap:4px;
  padding:13px 20px 15px;pointer-events:auto;z-index:9;overflow:hidden;color:#fff4dc;
 }
 body.native-ui.teams-battle #team-mobile-panel[hidden] { display:none!important; }
 body.native-ui.teams-battle #team-mobile-toggle[aria-expanded=true] { visibility:hidden; }
 body.native-ui.teams-battle:has(#online-status:not([hidden])) #team-mobile-toggle { top:140px; }
 body.native-ui.teams-battle:has(#online-status:not([hidden])) #team-mobile-panel { left:144px;width:min(390px,calc(100% - 152px)); }
 body.native-ui.teams-battle .team-mobile-toolbar { display:flex;gap:5px;align-items:center;justify-content:space-between;min-width:0; }
 body.native-ui.teams-battle .team-mobile-tabs { display:flex;gap:3px;min-width:0; }
 body.native-ui.teams-battle .team-mobile-toolbar button {
  min-height:29px;min-width:70px;padding:8px 14px;border:0;font:10px/13px 'Pixelify Sans',sans-serif;
  color:#fff4dc;text-shadow:1px 1px #07191c;cursor:pointer;
 }
 body.native-ui.teams-battle .team-mobile-tabs button[aria-selected=true] { color:#ffe277; }
 body.native-ui.teams-battle .team-mobile-note { display:block;margin:0;font:10px/12px 'Pixelify Sans',sans-serif;text-align:left;color:#e5edd8; }
 body.native-ui.teams-battle #team-mobile-panel .battle-team-row {
  position:static;display:block;min-height:0;max-height:132px;overflow-y:auto;overflow-x:hidden;
  padding:0 3px 2px 0;scrollbar-width:thin;
 }
 body.native-ui.teams-battle #team-mobile-panel .battle-team-row[hidden] { display:none!important; }
 body.native-ui.teams-battle #team-mobile-panel .battle-team-label { display:none; }
 body.native-ui.teams-battle #team-mobile-panel .battle-team-members { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px 7px;padding:0; }
 body.native-ui.teams-battle #team-mobile-panel .battle-team-member {
  display:grid;grid-template-columns:32px minmax(0,1fr);grid-template-rows:14px 15px 15px;
  gap:1px 3px;align-items:center;width:auto;height:58px;min-width:0;padding:2px 0 8px;
  background-size:32px 32px;background-position:left 17px;opacity:1;
 }
 body.native-ui.teams-battle #team-mobile-panel .battle-team-member img { grid-column:1;grid-row:2/4;width:24px;height:24px;margin:0 4px; }
 body.native-ui.teams-battle #team-mobile-panel .battle-team-name {
  display:block;grid-column:1/-1;grid-row:1;font:10px/13px 'Pixelify Sans',sans-serif;
  text-align:left;white-space:nowrap;color:#fff4dc;text-shadow:1px 1px #07191c;
 }
 body.native-ui.teams-battle #team-mobile-panel .battle-team-health {
  display:block;grid-column:2;grid-row:2;font-size:9px;line-height:12px;text-align:left;white-space:nowrap;
  color:#fff4dc;text-shadow:1px 1px #07191c;
 }
 body.native-ui.teams-battle #team-mobile-panel .battle-team-member .local-member-energy {
  position:static;grid-column:2;grid-row:3;min-height:0;font-size:8px;line-height:11px;
  text-align:left;white-space:nowrap;
 }
 body.native-ui.teams-battle #team-mobile-panel .battle-team-meter { left:3px;right:3px;bottom:2px;height:4px; }
 body.native-ui.teams-battle #team-mobile-panel .battle-team-key { left:2px;top:17px;right:auto; }
 body.native-ui.teams-battle #team-mobile-panel .battle-team-member.fainted img { filter:grayscale(1);opacity:.5; }
 body.native-ui.teams-battle #team-mobile-panel .battle-team-member:disabled { cursor:default; }
}
