.app-header .app-brand .brand-mark.brand-logo-active {
  width:40px;
  height:40px;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}

.app-header .app-brand .brand-mark.brand-logo-active img {
  width:100%;
  height:100%;
  object-fit:contain;
  padding:0;
}

.chat-header-copy {
  display:grid;
  gap:2px;
  min-width:0;
}

.chat-header-copy strong,
.chat-header-copy span {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Mobile fine-tuning: remove top ghost space and align the drawer masthead. */
@media (max-width:720px) {
  .chat-app,
  .chat-app.sidebar-collapsed {
    grid-template-rows:minmax(0,1fr);
  }

  .chat-view,
  .connections-view,
  .account-view {
    grid-row:1!important;
  }

  .chat-header {
    margin:0;
    min-height:60px;
    padding:7px 14px 8px 60px;
  }

  .menu-toggle {
    top:calc(env(safe-area-inset-top) + 8px);
    left:12px;
  }

  .chat-view::before {
    inset:60px 0 0;
  }

  .message-stream {
    padding-top:10px;
  }

  .app-sidebar {
    padding-top:calc(72px + env(safe-area-inset-top));
  }

  .app-sidebar::before {
    height:calc(64px + env(safe-area-inset-top));
  }

  .chat-app:has(.app-sidebar.open) .app-brand {
    top:calc(env(safe-area-inset-top) + 12px);
    left:16px;
  }

  .chat-app:has(.app-sidebar.open) .app-brand .brand-mark {
    width:34px;
    height:34px;
  }

  .chat-app:has(.app-sidebar.open) .workspace-switcher {
    top:calc(env(safe-area-inset-top) + 8px);
    left:64px;
    width:min(calc(88vw - 80px),280px);
    height:46px;
    align-content:center;
    justify-items:end;
    gap:2px;
    padding:4px 8px;
  }

  .chat-app:has(.app-sidebar.open) .workspace-switcher span {
    font-size:.58rem;
    line-height:1.05;
  }

  .chat-app:has(.app-sidebar.open) .workspace-switcher strong {
    font-size:.78rem;
    line-height:1.15;
  }

  .app-sidebar .new-chat-button {
    margin-top:10px;
  }

  /* Structural fix: keep the desktop header out of the mobile grid entirely. */
  .app-header {
    position:fixed!important;
    inset:0 auto auto 0!important;
    width:0!important;
    height:0!important;
    min-height:0!important;
    padding:0!important;
    margin:0!important;
    overflow:visible!important;
    display:block!important;
    background:transparent!important;
    box-shadow:none!important;
    pointer-events:none;
  }

  .menu-toggle {
    position:fixed!important;
    z-index:140!important;
    pointer-events:auto;
  }

  .app-brand,
  .workspace-switcher {
    display:none!important;
  }

  .chat-app:has(.app-sidebar.open) .app-brand {
    position:fixed!important;
    z-index:145!important;
    display:flex!important;
    pointer-events:none;
  }

  .chat-app:has(.app-sidebar.open) .workspace-switcher {
    position:fixed!important;
    z-index:145!important;
    display:grid!important;
    pointer-events:none;
  }

  .chat-header {
    position:relative;
    top:0;
  }

  /* Final mobile composition: hamburger and conversation identity share one row. */
  .app-header {
    width:100%!important;
  }

  .chat-header {
    min-height:58px!important;
    height:58px;
    display:flex;
    align-items:center;
    gap:10px;
    padding:0 14px 0 60px!important;
  }

  .menu-toggle {
    top:9px!important;
    left:12px!important;
    width:40px!important;
    height:40px!important;
  }

  .assistant-avatar {
    width:40px!important;
    height:40px!important;
    flex:0 0 40px;
  }

  .chat-view::before {
    inset:58px 0 0!important;
  }

  /* Keep the drawer masthead visible and avoid display/layout conflicts. */
  .app-brand,
  .workspace-switcher {
    display:flex!important;
    visibility:hidden;
    opacity:0;
  }

  .workspace-switcher {
    display:grid!important;
  }

  .chat-app:has(.app-sidebar.open) .app-brand,
  .chat-app:has(.app-sidebar.open) .workspace-switcher {
    visibility:visible;
    opacity:1;
  }

  .chat-app:has(.app-sidebar.open) .app-brand {
    top:12px!important;
    left:16px!important;
  }

  .chat-app:has(.app-sidebar.open) .workspace-switcher {
    top:7px!important;
    left:62px!important;
    width:min(calc(88vw - 76px),284px)!important;
    height:48px!important;
  }

  /* Use every available pixel at the bottom of the drawer. */
  .app-sidebar {
    padding-bottom:0!important;
  }

  .sidebar-bottom {
    margin-left:-16px;
    margin-right:-16px;
    padding:8px 16px max(2px,env(safe-area-inset-bottom));
  }
}
