/* Phone tab bar (redesign 2026-11): Arrange, Mixer, Chat, Save As,
   Versions, each with an icon; the active view is gold. Phones only. */

.sw-tab-arrange,
.sw-tab-mixer {
  display: none;
}

@media (max-width: 760px) {
  html body .mobile-room-footer-actions.sw-phone-tabs {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 0.25rem !important;
    padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid rgba(241, 201, 121, 0.16);
    background: rgba(12, 11, 9, 0.96);
  }

  html body .mobile-room-footer-actions.sw-phone-tabs .sw-tab {
    display: grid !important;
    justify-items: center;
    align-content: center;
    gap: 0.2rem;
    min-width: 0 !important;
    height: 3.3rem !important;
    padding: 0.3rem 0.1rem !important;
    border: 0 !important;
    border-radius: 0.7rem !important;
    background: transparent !important;
    color: #c9c2b3 !important;
    font-size: 0.66rem !important;
    font-weight: 800 !important;
    white-space: nowrap;
  }

  html body .mobile-room-footer-actions.sw-phone-tabs .sw-tab::before {
    content: "";
    width: 1.35rem;
    height: 1.35rem;
    background: currentColor;
    -webkit-mask: var(--sw-tab-ico) center / contain no-repeat;
    mask: var(--sw-tab-ico) center / contain no-repeat;
  }

  html body .mobile-room-footer-actions.sw-phone-tabs .sw-tab[aria-pressed="true"] {
    background: rgba(241, 201, 121, 0.12) !important;
    color: #f1c979 !important;
  }

  html body .sw-tab-arrange { --sw-tab-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 6h11M3 12h18M3 18h8'/%3E%3C/svg%3E"); }
  html body .sw-tab-mixer { --sw-tab-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 4v16M12 4v16M18 4v16M4 14h4M10 8h4M16 12h4'/%3E%3C/svg%3E"); }
  html body #mobileChatBtn.sw-tab { --sw-tab-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M5 18l-1.5 3 4-1.6A9 9 0 1 0 5 18z'/%3E%3C/svg%3E"); }
  html body #mobilePublishBtn.sw-tab { --sw-tab-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h11l3 3v13H5Z'/%3E%3Cpath d='M8 4v5h7V4M8 20v-6h8v6'/%3E%3C/svg%3E"); }
  html body #mobileVersionsBtn.sw-tab { --sw-tab-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 3v12'/%3E%3Ccircle cx='18' cy='6' r='3'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Cpath d='M18 9a9 9 0 0 1-9 9'/%3E%3C/svg%3E"); }
}

/* Phones: the master OUT meter was wider than its box (the old minimum
   widths add up to about 357 px in a 264 px box) and got cut at the right.
   The volume slider now gives way and the meter keeps a readable width. */
@media (max-width: 760px) {
  html body .room-footer .master-vu {
    grid-template-columns: minmax(0, 1fr) auto minmax(3rem, 4.5rem) auto !important;
  }
}

/* Phones and tablets: Chat and Versions open above the bottom bar instead
   of over it, so Arrange, Mixer, Chat, Save As and Versions stay usable. */
@media (max-width: 1024px) {
  html body .mobile-room-footer-actions .sw-tab[aria-pressed="true"] {
    border-color: rgba(241, 201, 121, 0.6) !important;
    color: #f1c979 !important;
  }

  html body.mobile-chat-open .side.room-side {
    inset: 0 0 var(--sw-tabbar-space, 0px) 0 !important;
    height: auto !important;
  }

  html body.mobile-chat-open .room-chat-section {
    height: min(76dvh, 40rem, calc(100dvh - var(--sw-tabbar-space, 0px) - 1.5rem)) !important;
    min-height: 0 !important;
  }

  html body .mobile-sheet {
    inset: 0 0 var(--sw-tabbar-space, 0px) 0 !important;
  }

  html body .mobile-sheet .mobile-sheet-card {
    max-height: min(70dvh, 30rem, calc(100dvh - var(--sw-tabbar-space, 0px) - 1.6rem)) !important;
  }

  /* Chat header on one line: tabs, Files, then close at the right edge. */
  html body.mobile-chat-open .room-chat-section .room-panel-tabs-head {
    display: flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
  }

  html body.mobile-chat-open .room-chat-section .room-panel-tabs {
    margin-right: auto !important;
  }

  html body.mobile-chat-open .room-chat-section .mobile-chat-close {
    order: 9;
    width: 2.1rem !important;
    min-width: 2.1rem !important;
    height: 2.1rem !important;
    margin: 0 !important;
    padding: 0 !important;
    place-items: center !important;
    line-height: 1 !important;
  }
}
