/* Удобство на телефоне. Подключается последним; копия лежит в squad94-android/app/src/main/assets */
@media (max-width: 820px) {
  /* .main.voice-main (display: flex) оставался поверх списка после «назад» и делил экран пополам */
  .app:not(.in-chat) > .main { display: none !important; }
  .app { -webkit-tap-highlight-color: transparent; }
  .icon-btn { min-width: 40px; min-height: 40px; flex: none; }
  .back { min-width: 44px; min-height: 44px; }
  button { touch-action: manipulation; }
  input, textarea, select { font-size: 16px !important; }

  /* Список: разделы одной лентой, чтобы чаты были сразу видны */
  .home-navs { flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 4px 8px 8px; gap: 4px; flex: none; }
  .home-nav { flex: none; flex-direction: column; justify-content: center; gap: 4px; min-width: 70px; max-width: 92px; min-height: 58px; padding: 6px; font-size: 11.5px; }
  .home-nav > .grow { flex: none; max-width: 100%; }
  .side .chips { padding: 4px 12px 8px; }
  button.chip { min-height: 36px; padding-inline: 13px; flex: none; }
  .side .item { min-height: 42px; }
  .side .list > .item:not(.room) { min-height: 60px; }
  .side .sec button { min-width: 40px; min-height: 36px; display: grid; place-items: center; }
  .searchbtn { min-height: 44px; }
  .side .item, .hexbtn, .msg { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .me-bar { padding: 6px 8px; }
  .me-bar .icon-btn { width: 42px; height: 42px; }
  .me-bar .split-arrow { width: 28px; height: 42px; margin-left: -6px; }
  .me-bar > .grow { min-width: 0; overflow: hidden; }

  /* Чат */
  .react { min-height: 32px; padding: 3px 10px; font-size: 15px; }
  .thread-link { min-height: 34px; }
  .msg .opt { min-height: 42px; }
  .composer { gap: 0 !important; }
  .composer textarea { min-width: 0; }
  .sendbtn { flex: none; min-width: 42px; min-height: 42px; }

  /* Друзья: кнопка «Добавить» не обрезается */
  .head .fr-tabs { min-width: 0; flex: 1; gap: 0; }
  .fr-tabs button { min-height: 40px; padding: 5px 6px; font-size: 12px; flex: none; }

  /* Эфир: все кнопки в одну строку */
  .stage-bar .seg button, .stage-btn { min-width: 42px; min-height: 40px; display: grid; place-items: center; }
  :has(> .ctl.end) { gap: 5px !important; padding-inline: 4px !important; flex-wrap: nowrap !important; }
  .ctl { width: 40px !important; height: 48px !important; flex: none; }
  .ctl-arrow { width: 22px; }
  .ctl.end { width: 46px !important; }

  /* Меню и эмодзи выезжают снизу, под большой палец */
  #overlays > .menu, #overlays > .picker, .stage > .menu, .stage > .picker {
    left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important;
    width: 100% !important; max-width: none !important; max-height: 72dvh !important;
    overflow-y: auto; overscroll-behavior: contain; padding: 20px 12px 14px !important;
    border-radius: 22px 22px 0 0 !important; box-shadow: 0 0 0 200vmax #0008 !important; animation: sheet-up .16s ease-out;
  }
  #overlays > .menu::before, #overlays > .picker::before { content: ""; position: absolute; top: 8px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 9px; background: var(--faint); opacity: .6; }
  #overlays > .menu > button, #overlays > .picker .um { min-height: 48px; font-size: 16px; padding: 8px 12px; gap: 14px; }
  .menu-react { justify-content: space-between; }
  .menu-react button { min-width: 44px; min-height: 44px; font-size: 24px; justify-content: center; }
  #overlays > .picker:not(.umenu, .xpicker, .soundboard) { grid-template-columns: repeat(8, 1fr); }
  #overlays > .picker:not(.umenu, .xpicker, .soundboard) button { height: 44px; font-size: 24px; }
  .drawer.members-drawer { width: min(320px, 86vw); }
  .drawer .icon-btn { min-width: 44px; min-height: 44px; }

  /* Окна */
  .overlay { padding: 10px; }
  .modal { max-height: 94dvh; }
  .modal-head .icon-btn, .sqset-close { min-width: 44px; min-height: 44px; }
  .modal-body { overscroll-behavior: contain; }
  .modal .btn, .set-nav button, .admin-nav button { min-height: 44px; }
  .btn.small { min-height: 36px; }
}
@keyframes sheet-up { from { translate: 0 60px; opacity: .3; } }
@media (max-width: 375px) { .ctl { width: 36px !important; } .ctl-arrow { width: 18px; } }
