/* Native conversation presentation is coordinated by Core, not a second shell. */
.vis-ui .premium-shell #header-context-host { min-width: 0; }
.core-drawer-tools, #drawer-context-host { display: none; }
.vis-ui .app-shell .visuai-shell-menu { display: none; }
.vis-ui .sidebar .core-nav-section { flex: 0 0 auto; margin: 4px 0; min-width: 0; }
.vis-ui .sidebar .core-nav-section > summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; min-height: 44px; padding: 10px 12px; cursor: pointer;
  font-size: 12px; font-weight: 650; color: var(--vis-ink, #192743); border-radius: 12px;
}
.vis-ui .sidebar .core-nav-section > summary::-webkit-details-marker { display: none; }
.vis-ui .sidebar .core-nav-section > summary svg { width: 16px; height: 16px; flex: none; transition: transform .18s ease; }
.vis-ui .sidebar .core-nav-section[open] > summary svg { transform: rotate(90deg); }
.vis-ui .sidebar .core-nav-section > summary:hover { background: rgba(103,143,255,.09); }
.vis-ui .sidebar .core-nav-section > summary:focus-visible { outline: 2px solid #678fff; outline-offset: -2px; }
.vis-ui .sidebar .core-nav-section .nav-button { width: 100%; }
/* Context keeps its controller when moving to the shared drawer in chat. */
@media (max-width: 600px) {
  .vis-ui .premium-shell #header-context-host { grid-column: 1 / -1; grid-row: 2; }
}
/* Chat occupies the same Core viewport on desktop, tablet and mobile. */
@media (min-width: 0px) {
  html.visuai-fullscreen-chat, html.visuai-fullscreen-chat body { height: 100%; overflow: hidden; overscroll-behavior: none; }
  .vis-ui .app-shell.visuai-chat-active {
    position: fixed; top: var(--visuai-viewport-top, 0px); inset-inline: 0;
    width: 100%; height: var(--visuai-viewport-height, 100dvh); min-height: 0;
    margin: 0; padding: 0; overflow: hidden;
  }
  .vis-ui .app-shell.visuai-chat-active > .client-header,
  .vis-ui .app-shell.visuai-chat-active .main > .topbar,
  .vis-ui .app-shell.visuai-chat-active > .mobile-nav { display: none; }
  .vis-ui .app-shell.visuai-chat-active > .main {
    display: flex; flex-direction: column; width: 100%; max-width: none; height: 100%;
    min-width: 0; min-height: 0; padding: 0; margin: 0; overflow: hidden;
  }
  .vis-ui .app-shell.visuai-chat-active .main .page,
  .vis-ui .app-shell.visuai-chat-active .main .page.visuai-page {
    position: relative; display: flex; flex-direction: column; flex: 1 1 0;
    width: 100%; max-width: none; height: 100%; min-height: 0;
    padding: 0; margin: 0; overflow: hidden;
  }
  .vis-ui .app-shell.visuai-chat-active .vh-hub--client.vh--conversation > .vh-header { display: none; }
  .vis-ui .app-shell.visuai-chat-active #visucio-plugin-root {
    display: flex; flex-direction: column; flex: 1 1 0;
    width: 100%; height: 100%; min-height: 0; max-width: none;
    margin: 0; padding: 0; border: 0; border-radius: 0;
  }
  .vis-ui .app-shell.visuai-chat-active .vh--integrated.vh--conversation {
    flex: 1 1 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0;
  }
  .vis-ui .visuai-chat-active .visuai-shell-menu {
    position: absolute; top: calc(8px + env(safe-area-inset-top, 0px)); left: 12px;
    display: inline-flex; width: 44px; height: 44px; z-index: 2;
  }
  .vis-ui .visuai-chat-active .page:has(.vai-shell) > .visuai-shell-menu { display: none; }
  .vis-ui .visuai-chat-active .page:has(> .visuai-shell-menu):not(:has(.vai-shell)) { padding-top: calc(60px + env(safe-area-inset-top, 0px)); }
  .vis-ui .visuai-chat-active .page > .empty-state { margin: auto; padding: 64px 24px; overflow: auto; }
  .vis-ui .visuai-chat-active #drawer-context-host { display: block; flex: 0 0 auto; margin: 0 0 8px; }
  .vis-ui .visuai-chat-active #client-context-slot { width: 100%; }
  .vis-ui .visuai-chat-active .core-drawer-tools { display: flex; justify-content: flex-end; gap: 8px; flex: 0 0 auto; margin: 0 0 6px; }
  .visuai-fullscreen-chat .pwa-install-chip { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .vis-ui .sidebar .core-nav-section > summary svg { transition: none; }
}

/* Staff and client navigation retain one shared, accessible drawer in chat. */
.vis-ui .app-shell .core-chat-drawer-close { display: none; }
.vis-ui .app-shell.visuai-chat-active > .sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 110;
  width: min(320px, 88vw); height: var(--visuai-viewport-height, 100dvh);
  max-height: var(--visuai-viewport-height, 100dvh); padding: 22px 18px;
  display: flex; flex-direction: column; background: var(--vis-surface);
  transform: translateX(-105%); visibility: hidden;
  transition: transform .22s ease, visibility .22s;
}
.vis-ui .app-shell.visuai-chat-active > .sidebar.open { transform: translateX(0); visibility: visible; }
.vis-ui .app-shell.visuai-chat-active > .sidebar .nav { flex: 1 1 0; overflow-y: auto; }
.vis-ui .app-shell.visuai-chat-active .core-chat-drawer-close { display: inline-flex; flex: 0 0 44px; align-self: flex-end; }
.vis-ui .app-shell.visuai-chat-active > .drawer-backdrop.open { display: block; position: fixed; inset: 0; z-index: 100; background: rgb(10 17 32 / 28%); backdrop-filter: blur(3px); }
@media (prefers-reduced-motion: reduce) {
  .vis-ui .app-shell.visuai-chat-active > .sidebar { transition: none; }
}

/* Desktop keeps the actual, permission-filtered Core navigation beside chat.
 * Its existing context, theme and notifications remain in the same sidebar. */
@media (min-width: 1024px) {
  .vis-ui .app-shell.visuai-chat-active {
    display: grid; grid-template-columns: 252px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 0;
  }
  .vis-ui .app-shell.visuai-chat-active > .sidebar {
    position: relative; inset: auto; grid-column: 1; grid-row: 1; width: 252px;
    height: 100%; max-height: 100%; padding: 20px 14px 14px;
    transform: none; visibility: visible; transition: none; z-index: 1;
    border-right: 1px solid var(--vis-line, rgba(148,171,210,.2)); border-radius: 0;
  }
  .vis-ui .app-shell.visuai-chat-active > .main {
    grid-column: 2; grid-row: 1; width: 100%; min-width: 0;
  }
  .vis-ui .app-shell.visuai-chat-active :is(.core-chat-drawer-close,#client-menu-close,.visuai-shell-menu) { display: none; }
  .vis-ui .app-shell.visuai-chat-active > .drawer-backdrop { display: none; }
  .vis-ui .app-shell.visuai-chat-active .premium-menu-heading { min-height: 44px; padding: 0 10px 14px; }
  .vis-ui .app-shell.visuai-chat-active #client-context-select { min-width: 0; padding-inline: 12px; }
  .vis-ui .app-shell.visuai-chat-active #client-context-select .context-switcher-label { display: none; }
  .vis-ui .app-shell.visuai-chat-active .sidebar-footer { flex: 0 0 auto; margin-top: 12px; }
  .vis-ui .app-shell.visuai-chat-active .sidebar .nav { overscroll-behavior: contain; scrollbar-width: thin; }
}
