.agent-msg { padding: 0.5rem 0.75rem; margin-bottom: 0.5rem; border-radius: 8px; }
/* User messages are written via textContent and need pre-wrap to preserve
   the user's own line breaks. Assistant messages render sanitized markdown
   HTML (<p>, <br>, <ul>, …) and must NOT have pre-wrap, or the inter-block
   whitespace from marked's output produces visible double spacing. */
.agent-msg-user { background: #e9f1ff; align-self: flex-end; white-space: pre-wrap; }
.agent-msg-assistant { background: #f4f4f4; }
.agent-panel { display: flex; flex-direction: column; }
@media (max-width: 576px) {
    .agent-panel { width: 94vw !important; right: 3vw !important; }
}
@media (prefers-reduced-motion: reduce) {
    .agent-panel { transition: none !important; }
}

/* Help widget — single FAB + popover menu replacing former
   IssuesWidget + AgentWidget bubbles (issue #627). */
.help-widget-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    min-height: 44px;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
    color: inherit;
}
.help-widget-menu-item:hover,
.help-widget-menu-item:focus {
    background: #f4f4f4;
    outline: none;
}
.help-widget-menu-item-primary {
    font-weight: 600;
}
@media (max-width: 576px) {
    .help-widget-menu {
        right: 0 !important;
        max-width: calc(100vw - 32px);
    }
}

/* Transcript view (/Agent/Conversation/{id}) — issue #632. Styled to match
   the live chat panel above so the user sees a familiar bubble layout. */
.agent-transcript {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 800px;
}
.agent-transcript-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
}
.agent-transcript-row-user {
    align-items: flex-end;
}
.agent-transcript-row-assistant {
    align-items: flex-start;
}
.agent-transcript .agent-msg {
    max-width: 90%;
}
.agent-transcript .agent-user-content p:last-child,
.agent-transcript .agent-assistant-content p:last-child {
    margin-bottom: 0;
}
/* Refusal bubbles dim into the page so the user can tell at a glance which
   turns the agent declined to answer. */
.agent-msg-refusal {
    background: #f8f8f8 !important;
    border: 1px dashed #ccc;
    color: #555;
}
.agent-handoff {
    border-top: 1px dotted #ccc;
    padding-top: 0.4rem;
    color: #444;
}
.agent-tool-calls summary {
    cursor: pointer;
}
.agent-tool-calls-list {
    list-style: none;
    padding-left: 0.25rem;
}
.agent-tool-calls-list li {
    margin-top: 0.25rem;
}
.agent-tool-args {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 0.25rem 0.4rem;
    margin-top: 0.15rem;
    margin-bottom: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.8em;
}
.agent-msg-time {
    margin-top: 0.15rem;
    padding: 0 0.5rem;
}
.agent-context-card > summary {
    cursor: pointer;
    padding: 0.4rem 0;
}
.agent-context-body {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 0;
}
