/* ============================================================================
   Developer chat
   ========================================================================== */

/* --- Developer chat --- */
.chat-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    border: var(--border-width) solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
    height: calc(100vh - 180px);
    min-height: 500px;
}
.chat-sidebar {
    border-right: var(--border-width) solid var(--border);
    display: flex;
    flex-direction: column;
    background: var(--surface-alt);
}
.chat-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6) var(--space-7);
    border-bottom: var(--border-width) solid var(--border);
}
.chat-sidebar-list { flex: 1; overflow-y: auto; }
.chat-conv-item {
    padding: var(--space-5) var(--space-7);
    border-bottom: var(--border-width) solid var(--border-subtle);
    cursor: pointer;
    transition: background var(--transition-fast);
    position: relative;
}
.chat-conv-item:hover { background: var(--surface-hover); }
.chat-conv-item.active { background: var(--brand-soft); border-left: var(--border-accent) solid var(--brand); }
.chat-conv-title {
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: var(--space-12);
}
.chat-conv-meta { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }
.chat-conv-delete {
    position: absolute;
    top: var(--space-5);
    right: var(--space-5);
    background: none;
    border: none;
    color: var(--text-subtle);
    cursor: pointer;
    font-size: var(--text-sm);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-xs);
    opacity: 0;
    transition: opacity var(--transition), color var(--transition), background var(--transition);
}
.chat-conv-item:hover .chat-conv-delete { opacity: 1; }
.chat-conv-delete:hover { color: var(--danger-on-soft); background: var(--danger-soft); }

.chat-main { display: flex; flex-direction: column; min-height: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: var(--space-10); }

.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-body);
}
.chat-welcome-icon { font-size: var(--text-6xl); color: var(--border-strong); margin-bottom: var(--space-8); }
.chat-welcome h2 {
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    color: var(--text);
    margin-bottom: var(--space-3);
}
.chat-welcome p { font-size: var(--text-md); max-width: 420px; margin-bottom: var(--space-12); }
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    justify-content: center;
    max-width: 560px;
}
.chat-suggestion {
    background: var(--surface-sunken);
    border: var(--border-width) solid var(--border);
    border-radius: var(--radius-pill);
    padding: var(--space-3) var(--space-7);
    font-size: var(--text-sm);
    color: var(--text-body);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.chat-suggestion:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand-on-soft);
}

.chat-msg { display: flex; gap: var(--space-6); margin-bottom: var(--space-10); }
.chat-msg-avatar {
    width: var(--space-16);
    height: var(--space-16);
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-md);
    flex-shrink: 0;
}
.chat-msg-user .chat-msg-avatar { background: var(--neutral-soft); color: var(--text-body); }
.chat-msg-model .chat-msg-avatar { background: var(--brand); color: var(--text-inverse); }
.chat-msg-role {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--text-muted);
    margin-bottom: var(--space-1);
}
.chat-msg-content { font-size: var(--text-md); line-height: var(--leading-relaxed); color: var(--text-body); }
.chat-msg-user .chat-msg-content {
    background: var(--surface-sunken);
    padding: var(--space-5) var(--space-7);
    border-radius: var(--radius-lg);
    border-top-left-radius: var(--space-1);
}
.chat-msg-body { min-width: 0; max-width: 100%; }

.chat-typing { display: flex; gap: var(--space-2); padding: var(--space-4) 0; }
.chat-typing-dot {
    width: var(--space-3);
    height: var(--space-3);
    background: var(--text-muted);
    border-radius: var(--radius-circle);
    animation: typingBounce 1.2s ease-in-out infinite;
}
.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

.chat-input-area {
    border-top: var(--border-width) solid var(--border);
    padding: var(--space-7) var(--space-10);
    background: var(--surface-alt);
}
.chat-input-wrap { display: flex; gap: var(--space-4); align-items: flex-end; }
.chat-input {
    flex: 1;
    padding: var(--space-5) var(--space-7);
    border: var(--border-width) solid var(--border-strong);
    border-radius: var(--radius-lg);
    font-size: var(--text-md);
    color: var(--text);
    resize: none;
    max-height: 120px;
    line-height: var(--leading-normal);
    background: var(--surface);
    transition: border-color var(--transition);
}
.chat-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.chat-send-btn {
    width: var(--space-18);
    height: var(--space-18);
    border-radius: var(--radius-lg);
    border: none;
    background: var(--brand);
    color: var(--text-inverse);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    flex-shrink: 0;
}
.chat-send-btn:hover { background: var(--brand-hover); }
.chat-send-btn:disabled { background: var(--border-strong); cursor: not-allowed; }
.chat-input-hint { font-size: var(--text-2xs); color: var(--text-muted); margin-top: var(--space-3); text-align: right; }
.chat-input-hint kbd {
    background: var(--neutral-soft);
    color: var(--text-body);
    padding: var(--space-px) var(--space-3);
    border-radius: var(--radius-xs);
    font-size: var(--text-2xs);
    font-family: inherit;
}
