/* Messenger header, tidy (Claude Code 2026-11-14). Owner (photo of the Messenger header): "which one can hide please hide
   it, keep for future update". Hidden only — the markup and code stay in MessengerScreen.js for a later update:
   - the technical subtitle "Direct Wi-Fi · Option 1 Auto-Absorb (0.5s) · Option 2 P2P Relay … · Option 3 QR & Sound Wave"
   - the four mode pills (Wi-Fi Online (ms) · Opt 1 Auto-Absorb · Opt 2 P2P Relay · Opt 3 QR & Sound Wave)
   - the Friend Code pill next to the title
   Nothing is lost: the offline queue still works and its bar still appears when messages are waiting; QR & Sound Wave
   opens from the chat's own QR buttons; the Friend Code (copy / rename) is in Add Friend.
   To bring any of them back, delete its selector below. */
.lx-msg-topbar .lx-msg-brand-sub,
.lx-msg-topbar .lx-msg-modes,
.lx-msg-topbar .lx-msg-mycode {
  display: none !important;
}
.lx-msg-topbar .lx-msg-brand-text h2 { margin: 0; }

/* Phones / narrow screens: the one-column body grew to its longest line (696 px inside a 324 px screen), cutting off
   New Group, QR / Sound and the Friends · Groups · Nearby tabs. Keep every column inside the screen. The two-emoji icons
   (➕👤, 👥✨, 📲🔊) wrapped onto two lines over their labels — keep them on one line. */
@media (max-width: 820px) {
  .lx-msg-body { grid-template-columns: minmax(0, 1fr); }
  .lx-msg-sidebar, .lx-msg-main { min-width: 0; }
}
.lx-side-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lx-side-btn { min-width: 0; }
.lx-side-btn span.ic { white-space: nowrap; }

/* Phones / small tablets — an OPEN chat (found in the 2026-11-14 chat test at 360×720):
   - the chat header squeezed the name block to 0 px, so ← Chats, the avatar, the name, + Member, Voice, Video and
     Group Call were drawn on top of each other → name row first, call buttons on their own row underneath;
   - the open chat was 830 px tall on a 720 px screen, so the message box sat under the bottom bar → the chat now fills
     exactly the space between the app header and the bottom bar: messages scroll, the message box stays in view;
   - the Messenger title bar is hidden while a chat is open (← Chats goes back to the list, where it shows again);
   - the composer's tool buttons stay on one row and slide sideways instead of taking four rows. */
@media (max-width: 820px) {
  .lx-msg-shell[data-mobile-pane="chat"] {
    height: calc(100dvh - 90px - var(--nav-h, 66px) - 12px);
    min-height: 380px;
    gap: 0;
  }
  .lx-msg-shell[data-mobile-pane="chat"] .lx-msg-topbar { display: none; }
  .lx-msg-shell[data-mobile-pane="chat"] .lx-msg-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .lx-msg-shell[data-mobile-pane="chat"] .lx-msg-main { flex: 1 1 auto; min-height: 0; }
  .lx-msg-shell[data-mobile-pane="chat"] .lx-chat-stream { flex: 1 1 auto; min-height: 0; padding: 10px; }

  .lx-chat-header { flex-wrap: wrap; padding: 8px 10px; row-gap: 6px; }
  .lx-chat-peer { flex: 1 1 100%; min-width: 0; gap: 8px; }
  .lx-chat-peer .lx-avatar { flex: 0 0 auto; }
  .lx-mobile-back { flex: 0 0 auto; white-space: nowrap; min-height: 36px; }
  .lx-chat-peer-info { flex: 1 1 auto; min-width: 0; }
  .lx-chat-peer-info h3, .lx-chat-peer-info p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lx-chat-callbar { flex: 1 1 100%; display: flex; gap: 6px; }
  .lx-chat-callbar .lx-call-btn:not([hidden]) { flex: 1 1 0; min-width: 0; justify-content: center; white-space: nowrap; padding: 7px 6px; min-height: 36px; }

  .lx-chat-composer { padding: 8px 10px; gap: 6px; }
  .lx-composer-tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .lx-composer-tools::-webkit-scrollbar { display: none; }
  .lx-composer-tools .lx-tool-btn { flex: 0 0 auto; white-space: nowrap; }
  .lx-composer-row { gap: 6px; }
  .lx-composer-input { min-width: 0; font-size: 16px; }   /* 16 px: iPhone does not zoom the page when typing */
  .lx-send-btn { flex: 0 0 auto; white-space: nowrap; padding: 9px 14px; }
}
@media (max-width: 820px) {
  /* four call keys on a 300 px row: smaller keys; if a phone's large text still does not fit, the row slides sideways */
  .lx-chat-callbar { overflow-x: auto; scrollbar-width: none; gap: 5px; }
  .lx-chat-callbar::-webkit-scrollbar { display: none; }
  .lx-chat-callbar .lx-call-btn:not([hidden]) { flex: 1 0 auto; font-size: 0.72rem; padding: 7px 8px; gap: 3px; }
}
@media (max-width: 820px) {
  /* an open chat already leaves room for the bottom bar; the page (96 px), the app (104 px) and this screen (88 px) each
     added the same room again → 200 px of empty scroll, and sending a message scrolled the chat's header off screen */
  body:has(.lx-msg-shell[data-mobile-pane="chat"]) { padding-bottom: 0; }
  body:has(.lx-msg-shell[data-mobile-pane="chat"]) .app { padding-bottom: 0; min-height: 0; }
  #v-messenger:has(.lx-msg-shell[data-mobile-pane="chat"]) { padding-bottom: 0; }
}
/* the technical "via" label under each message (⚡ Opt 1 Auto-Absorb (0.5s) · 📶 Direct Wi-Fi · P2P Relay) — hidden like
   the header pills; the message time stays */
.lx-msg-foot .lx-msg-via { display: none; }
/* the waiting-messages bar (shown only while offline) filled a third of a phone screen with technical text — one line
   now: "📦 … (1 waiting)" + Clear. Hidden, kept for later: the "Scanning every 0.8s …" hint, Force Auto-Absorb Flush
   (sending is automatic when the connection returns) and Relay via Nearby Peer. */
#lxOutboxBarHint, #lxFlushNowBtn, #lxRelayViaPeerBtn { display: none !important; }
.lx-outbox-bar:not([hidden]) { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; }
.lx-outbox-bar > div:first-child { min-width: 0; font-size: 0.8rem; }
.lx-outbox-actions { flex: 0 0 auto; }
/* 2026-11-14 — read chats in my own language (messenger-translate.js): "My language" picker = first key of the chat
   header's key row (on the name row it squeezed the chat name to "G…" on a phone), and a small "🌐 Original" key under
   a translated message */
.lx-tr-lang {
  flex: 0 0 auto; max-width: 150px; min-height: 34px; padding: 4px 8px;
  border-radius: 10px; border: 1px solid rgba(212, 175, 55, 0.45); background: rgba(15, 27, 51, 0.85); color: #f4f7fb;
  font: inherit; font-size: 0.8rem; cursor: pointer; text-overflow: ellipsis;
}
.lx-tr-lang option { background: #0f1b33; color: #f4f7fb; }
@media (max-width: 820px) { .lx-chat-callbar .lx-tr-lang { flex: 0 0 auto; max-width: 120px; min-height: 36px; font-size: 0.74rem; } }
.lx-tr-key {
  display: inline-block; margin-top: 5px; padding: 2px 8px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(212, 175, 55, 0.35); background: rgba(212, 175, 55, 0.12); color: rgba(244, 247, 251, 0.85);
  font: inherit; font-size: 0.7rem; line-height: 1.5;
}
.lx-tr-key:hover { background: rgba(212, 175, 55, 0.22); }
