/* Shell navigation refinements.
   Keep global warning banners outside the workspace columns and use a compact,
   thin panel icon for both the main menu and AI analyst history menu. */

.app-shell {
  --shell-banner-offset: 0px;
}

.app-shell:has(> .severe-error-banner),
.app-shell:has(> .ai-runtime-guard-banner),
.app-shell:has(> .ai-usage-warning-banner) {
  --shell-banner-offset: 44px;
  min-height: 100vh;
  padding-top: var(--shell-banner-offset);
}

.app-shell:has(> .severe-error-banner):has(> .topbar),
.app-shell:has(> .ai-runtime-guard-banner):has(> .topbar),
.app-shell:has(> .ai-usage-warning-banner):has(> .topbar) {
  grid-template-rows: 56px minmax(0, 1fr) !important;
}

.app-shell > .severe-error-banner,
.app-shell > .ai-runtime-guard-banner,
.app-shell > .ai-usage-warning-banner {
  position: fixed !important;
  inset: 0 0 auto 0 !important;
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  z-index: 100 !important;
}

.app-shell:has(> .severe-error-banner) > .topbar,
.app-shell:has(> .ai-runtime-guard-banner) > .topbar,
.app-shell:has(> .ai-usage-warning-banner) > .topbar {
  top: var(--shell-banner-offset);
}

.app-shell:has(> .severe-error-banner) .sidebar,
.app-shell:has(> .ai-runtime-guard-banner) .sidebar,
.app-shell:has(> .ai-usage-warning-banner) .sidebar {
  top: var(--shell-banner-offset);
  height: calc(100vh - var(--shell-banner-offset));
}

/* Main left-menu toggle: compact, thin and fully inside its own column. */
.sidebar-edge-toggle {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 5px !important;
  background: transparent !important;
  color: #6b7280 !important;
  box-shadow: none !important;
  overflow: visible !important;
  z-index: 46 !important;
}

.sidebar-edge-toggle svg {
  display: none !important;
}

.sidebar-edge-toggle::before {
  content: "";
  position: absolute;
  inset: 2.5px;
  border: 1.25px solid currentColor;
  border-radius: 3.5px;
  box-sizing: border-box;
}

.sidebar-edge-toggle::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 9px;
  width: 1px;
  border-radius: 999px;
  background: currentColor;
}

.sidebar-edge-toggle:hover {
  background: rgba(15, 23, 42, 0.05) !important;
  color: #4b5563 !important;
}

.sidebar-edge-toggle.collapse {
  position: fixed !important;
  top: calc(var(--shell-banner-offset) + 10px) !important;
  right: auto !important;
  left: 212px !important;
}

.sidebar-edge-toggle.reveal {
  position: fixed !important;
  top: calc(var(--shell-banner-offset) + 10px) !important;
  left: 10px !important;
}

/* AI analyst history-menu toggle: same icon and no boundary overlap. */
.ai-sidebar-edge-toggle {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 5px !important;
  background: transparent !important;
  color: #6b7280 !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
  z-index: 30 !important;
}

.ai-sidebar-edge-toggle svg {
  display: none !important;
}

.ai-sidebar-edge-toggle::before {
  content: "";
  position: absolute;
  inset: 2.5px;
  border: 1.25px solid currentColor;
  border-radius: 3.5px;
  box-sizing: border-box;
}

.ai-sidebar-edge-toggle::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 9px;
  width: 1px;
  border-radius: 999px;
  background: currentColor;
}

.ai-sidebar-edge-toggle:hover {
  background: rgba(15, 23, 42, 0.05) !important;
  color: #4b5563 !important;
}

.ai-sidebar-edge-toggle.collapse {
  top: 10px !important;
  right: 8px !important;
  left: auto !important;
}

.ai-sidebar-edge-toggle.reveal {
  top: 10px !important;
  left: 8px !important;
  right: auto !important;
}
