/* Conversation navigation. */
.sidebar {
    width: 280px;
    min-height: 0;
    display: flex;
    flex: 0 0 280px;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
    padding: 12px;
    border-right: 1px solid var(--border-color);
    background: var(--bg-sidebar);
    transition: margin-left 220ms cubic-bezier(0.2, 0, 0, 1), transform 220ms cubic-bezier(0.2, 0, 0, 1);
    z-index: 20;
}

.sidebar.collapsed {
    margin-left: -280px;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.brand {
    display: flex;
    align-items: center;
    min-height: 35px;
    gap: 10px;
    padding: 0 4px;
}

.brand-icon {
    width: 29px;
    height: 29px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(15, 143, 112, 0.22);
}

.brand-text {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.brand-text h2 {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.brand-text .badge {
    color: var(--text-subtle);
    font-size: 10.5px;
    font-weight: 450;
    white-space: nowrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 39px;
    gap: 10px;
    padding: 0 12px;
    border: 0;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 130ms ease, transform 130ms ease;
}

.primary-btn {
    background: var(--bg-elevated);
    box-shadow: inset 0 0 0 1px var(--border-strong);
    color: var(--text-main);
}

.primary-btn:hover {
    background: var(--bg-hover);
    box-shadow: inset 0 0 0 1px var(--border-strong);
}

.sidebar-section {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    gap: 7px;
}

.history-section {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.history-section:hover { scrollbar-color: var(--border-strong) transparent; }

.section-title {
    padding: 10px 8px 6px;
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 7px;
    position: relative;
    min-height: 43px;
    padding: 9px 7px 9px 11px;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    transition: background-color 120ms ease, color 120ms ease;
}

.history-item:hover,
.history-item.active {
    background: var(--bg-hover);
    color: var(--text-main);
}

.history-item.active {
    background: var(--accent-soft);
    box-shadow: inset 3px 0 0 var(--accent);
    color: var(--text-main);
    font-weight: 600;
}

.history-content {
    min-width: 0;
    flex: 1;
}

.history-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-meta {
    display: none;
}

.history-delete {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-subtle);
    cursor: pointer;
    opacity: 0;
    transition: opacity 120ms ease, color 120ms ease, background-color 120ms ease;
}

.history-item:hover .history-delete,
.history-item:focus-within .history-delete { opacity: 1; }
.history-delete:hover { background: var(--bg-active); color: #ef4444; }
.history-empty { padding: 8px; color: var(--text-subtle); font-size: 12px; }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 19;
    opacity: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.42);
    transition: opacity 180ms ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
