.agent-chat-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.agent-chat-sidebar {
    width: 260px;
    flex-shrink: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agent-chat-main {
    flex: 1;
    min-width: 0;
}

.agent-chat-intro {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.agent-chat-sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* .toggle-switch (toggle.css) already provides display/gap/cursor — this
   just sets the label text's size/color to match the sidebar's other
   secondary text. */
.agent-chat-show-hidden {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.agent-chat-conversation-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 60vh;
    overflow-y: auto;
}

.agent-chat-conversation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
}

.agent-chat-conversation-item:hover {
    background: var(--bg-light, #f2f2f2);
}

.agent-chat-conversation-item.active {
    background: var(--bg-light, #f2f2f2);
    border-color: var(--primary);
}

.agent-chat-conversation-item-text {
    min-width: 0;
    flex: 1;
}

.agent-chat-conversation-title {
    display: block;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-chat-conversation-item.hidden-conversation .agent-chat-conversation-title {
    color: var(--text-secondary);
    font-style: italic;
}

.agent-chat-conversation-time {
    display: block;
    font-size: 0.75em;
    color: var(--text-secondary);
}

.agent-chat-conversation-hide-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    opacity: 0;
    transition: opacity 0.15s;
}

.agent-chat-conversation-item:hover .agent-chat-conversation-hide-btn {
    opacity: 1;
}

.agent-chat-conversation-hide-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary, #222);
}

/* Stay visible while btnLoading's spinner is showing, even if the row is
   no longer hovered (opacity:0 would otherwise hide an in-flight request's
   only visual feedback). .spinner's own default border is white-on-white
   against this button's light background — override to a visible dark
   ring, matching this button's own text color instead of the white meant
   for .btn's solid-color buttons. */
.agent-chat-conversation-hide-btn:disabled {
    opacity: 1;
    cursor: default;
}

.agent-chat-conversation-hide-btn .spinner {
    border-color: rgba(0, 0, 0, 0.15);
    border-top-color: var(--text-secondary);
}

.agent-chat-conversation-empty {
    color: var(--text-secondary);
    font-size: 0.85em;
    padding: 8px 10px;
}

.agent-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 55vh;
    overflow-y: auto;
    padding: 4px;
    margin-bottom: 16px;
}

.agent-chat-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.agent-chat-bubble-user {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
    border-top-right-radius: 0;
}

.agent-chat-bubble-model {
    align-self: flex-start;
    background: var(--bg-light, #f2f2f2);
    color: var(--text-primary, #222);
    border: 1px solid var(--border-color);
    border-top-left-radius: 0;
}

.agent-chat-evidence {
    margin-top: 8px;
    padding: 8px 10px;
    border-left: 3px solid var(--primary);
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
    font-size: 0.92em;
    color: var(--text-secondary, #555);
}

.agent-chat-input-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

/* .btn's global width:100% becomes this button's flex-basis here (it has no
   flex property of its own), so it claims most of the row before shrinking —
   squeezing the textarea despite its flex:1. Give the button its natural
   content width instead. */
.agent-chat-input-row .btn {
    width: auto;
    flex-shrink: 0;
}

.agent-chat-input {
    flex: 1;
    resize: vertical;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font: inherit;
}
