/*
 * The assistants' shared panel (@web/components/Assistant): the card that
 * Max and Parker both fill, its header band, and the header's buttons.
 *
 * Every selector sits under .assistant-root so nothing here reaches the
 * page. What an assistant puts inside the card is its own stylesheet's
 * (Operator's `operator.css`; Parker's rules in `chat.css`): this is only
 * what they have in common.
 *
 * The card, its extent and its motion are the shell's (`ShellFrame`'s
 * `panel`, with `panelResizing` mid-drag, and its resize handle,
 * `panelResizer`).
 */

/*
 * Layout follows the panel's own size, page or panel alike. Container
 * queries can't use variables, so an assistant's breakpoints repeat as
 * literals against the `assistant` container.
 */
.assistant-root {
    container: assistant / size;
    display: flex;
    flex-direction: column;
    position: relative;
    flex: 1;
    height: 100%;
    min-height: 0;
    color: var(--chat-fg);
}

.assistant-root.assistant-panel--resizing {
    user-select: none;
}

/* ─── Header ─── */

/* Frosted: a transcript that scrolls behind it shows through. As tall as the
   page's title bar, so the two line up. `--chat-header-h` is set by a chat
   whose transcript runs under the header; otherwise the band is in flow. */
.assistant-root .assistant-header {
    height: var(--context-bar-height, 56px);
    position: relative;
    z-index: 3;
    flex: none;
    margin-bottom: calc(-1 * var(--chat-header-h, 0px));
    border-bottom: 1px solid var(--chat-border);
    /* The chat's own background, not white: the management portal and RAMP
       have a dark mode, and Platform Admin's white is `--chat-bg` there too. */
    background: color-mix(in srgb, var(--chat-bg) 72%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
}

/* Borderless, a fill on hover; the transparent border keeps their size. */
.assistant-root .assistant-header > .bp5-button,
.assistant-root .assistant-header > .bp5-popover-target > .bp5-button {
    min-width: 32px;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 8px;
}

/* Icon-only buttons are square, so the gaps between icons read even. */
.assistant-root .assistant-header .bp5-button:not(:has(.bp5-button-text)) {
    padding: 0;
}

.assistant-root .assistant-header > .bp5-button:hover,
.assistant-root .assistant-header > .bp5-popover-target > .bp5-button:hover {
    background: var(--chat-subtle);
}

/* Icons take the label's colour, so icon-only and labelled buttons match. */
.assistant-root .assistant-header .bp5-button {
    color: var(--chat-fg);
}

.assistant-root .assistant-header .bp5-button .bp5-icon {
    color: inherit;
}

/* The title takes the header's spare room, truncated to it. */
.assistant-root .assistant-header-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--chat-size-body, 14px);
}
