/* Leaf Box v2.2 — recoverable, bounded mobile header. The heading must never
   become a one-character-wide column after browser/app background transitions. */
.topbar .heading { word-break:normal; overflow-wrap:normal; }
@media (max-width:800px) {
  .app-shell { min-width:0; max-width:100%; }
  .main { min-width:0; width:100%; }
  .topbar {
    box-sizing:border-box;
    display:grid;
    grid-template-columns:44px minmax(0,1fr) auto;
    align-items:center;
    justify-content:stretch;
    gap:8px;
    min-width:0;
    width:100%;
    max-width:100%;
    flex-wrap:nowrap!important;
    overflow-wrap:normal;
  }
  .topbar .topbar-banner { grid-column:1 / -1; }
  .topbar .menu-button { grid-column:1; grid-row:1; width:44px; min-width:44px; margin:0; order:initial; }
  .topbar .heading {
    grid-column:2;grid-row:1;
    display:block;
    width:100%; min-width:0; max-width:100%;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
    overflow-wrap:normal!important;word-break:normal!important;
    flex:none;line-height:1.25;
  }
  .topbar .heading small {
    display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  }
  .topbar .top-right {
    grid-column:3;grid-row:1;
    display:flex;align-items:center;justify-content:flex-end;
    flex-wrap:nowrap;min-width:0;width:max-content;max-width:100%;margin:0;gap:6px;
  }
  .topbar .top-right > * {flex-shrink:0}
  .topbar .online-members-control {min-width:0;}
  .topbar .online-members-toggle {box-sizing:border-box;}
}
@media (max-width:560px) {
  /* Keep online presence accessible via its icon, reserving room for the title. */
  .topbar .online-members-toggle {width:40px;min-width:40px;min-height:44px;justify-content:center;padding:7px!important;}
  .topbar .online-members-toggle [data-online-count] {display:none!important;}
  .topbar .heading small {display:none;}
  .topbar {padding-inline:max(9px,env(safe-area-inset-left));gap:6px;}
  .topbar .top-right {gap:4px;}
  .topbar .top-right > .lb-notification-bell,
  .topbar .top-right > .top-profile {width:42px;min-width:42px;max-width:42px;}
}
@media (max-width:335px) {
  .topbar .online-members-control {display:none;}
  .topbar .heading {font-size:16px!important;}
}
/* Hide nothing else and retain the top bar's existing decorative banner layer. */
