/* ============================================================
 * The Assistant sidebar (static/assistant_sidebar.js). It wears the Plan drawer's sheet (.plan-drawer-sheet in
 * style.css) so the chat's rows, buttons and tokens look the same, and it sits BESIDE the page as a flex column
 * of #app: the page shrinks, nothing is covered, no scrim. Up to 860px it is a full-width sheet instead.
 * Colours come from the theme variables only, so light and dark both work.
 * ============================================================ */
.asst { flex: 0 0 var(--asst-w, 380px); width: var(--asst-w, 380px); min-width: 0; position: relative; display: flex; height: 100vh; border-left: 1px solid var(--border); background: var(--bg-alt); }
.asst[hidden] { display: none; }
.asst .asst-sheet.plan-drawer-sheet { position: relative; inset: auto; flex: 1 1 auto; width: auto; min-width: 0; max-height: none; border: 0; border-radius: 0; box-shadow: none; padding: 16px 16px 0; gap: 10px; }
.asst-title { margin: 0; font-size: 15px; }
.asst-tabs { align-self: flex-start; }
.asst-tabs button[hidden] { display: none; }
.asst-pane { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1 1 auto; }
.asst-pane[hidden], .asst-ctx[hidden] { display: none; }
.asst-ctx { display: flex; flex-direction: column; gap: 4px; }
.asst-chip { align-self: flex-start; max-width: 100%; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); color: var(--text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asst-refused[hidden] { display: none; }
.asst-resize { position: absolute; left: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 2; }
.asst-resize:hover, .asst-resize:focus-visible { background: var(--accent-fill); opacity: 0.45; outline: none; }

/* Beside a Plan page the docked inspector would make three columns. While the sidebar is open, the Plan pane yields
   when it is only showing "select a row" or its own suggestions; a real inspector (a row, a picker) takes the room and
   the sidebar steps aside until it closes. */
body.asst-open .plan-view > .plan-drawer:has(.plan-suggest-pane, .plan-pane-empty) { display: none !important; }
body.asst-open:has(#plan-drawer:not(.hidden):not(:has(.plan-suggest-pane, .plan-pane-empty))) #asst-sidebar { display: none; }

/* The floating Suggest button (suggest-widget.js, fixed bottom right) would sit on the sidebar's input: clear it. */
@media (min-width: 861px) { body.asst-open :is(.egsw-btn, .feature-request-fab) { right: calc(var(--asst-w, 380px) + 20px) !important; } }

/* ---- the chat inside the Ask Claude tab (static/plan_assistant.js) ---- */
.pa { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1 1 auto; }
.pa-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pa-pill button[aria-pressed="true"] { font-weight: 600; }
.pa-pagetag { align-self: flex-end; margin-bottom: -6px; max-width: 88%; text-align: right; overflow-wrap: anywhere; }
.pa-mac .pa-note { margin-top: 0; padding-bottom: 12px; font-size: 12px; }

/* ---- phone: a full-width sheet over the page; it closes when you navigate ---- */
@media (max-width: 860px) {
  .asst { position: fixed; inset: 0; z-index: 510; width: auto; height: auto; flex: none; border-left: 0; }
  .asst-resize { display: none; }
  body.asst-open :is(.egsw-btn, .feature-request-fab) { display: none !important; }
  .asst .asst-sheet.plan-drawer-sheet { padding: 14px 14px 0; }
  .asst .pa-top .btn { min-height: 32px; }
}
