/* Site-wide AI panel (ai-panel.js). Same look as the in-tool panel (styles.css .drawer-copilot,
   .copilot-expand-tab); here it is fixed to the right edge on every signed-in page, below the
   topbar, and pushes page / tool content left while open. Kept in its own file to stay out of
   styles.css. */
:root { --ai-panel-w: 340px; --ai-panel-top: var(--topbar-h, 60px); }

#drawer-copilot.ai-site-panel {
  position: fixed;
  top: var(--ai-panel-top);
  right: 0;
  bottom: 0;
  width: var(--ai-panel-w);
  max-height: none;
  z-index: 130; /* above the tool drawer (120) */
  border-left: 1px solid var(--border);
  border-top: none;
  box-shadow: -6px 0 18px rgba(15, 23, 42, 0.06);
}
#drawer-copilot.ai-site-panel.collapsed {
  width: 0;
  box-shadow: none;
}
#btn-expand-copilot.copilot-expand-tab {
  position: fixed;
  right: 0;
  top: 50%;
  z-index: 131;
}

/* Content makes room for the open panel (pages and the tool drawer). */
body.ai-panel-open #view-dashboard,
body.ai-panel-open #view-workspace {
  margin-right: var(--ai-panel-w);
  width: auto;
}
body.ai-panel-open #view-workspace .workspace-main { min-width: 0; }
body.ai-panel-open #tool-drawer,
body.ai-panel-open #drawer-backdrop {
  right: var(--ai-panel-w);
  width: auto;
  max-width: none;
}

@media (max-width: 900px) {
  :root { --ai-panel-w: 100vw; }
  #drawer-copilot.ai-site-panel { max-height: none; }
  body.ai-panel-open #view-dashboard,
  body.ai-panel-open #view-workspace { margin-right: 0; }
  body.ai-panel-open #tool-drawer,
  body.ai-panel-open #drawer-backdrop { right: 0; }
}
