/* =========================
   Chat page
   ========================= */

.dj-chat{
    margin-top: 14px;
}

.dj-chat-head{
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.dj-chat-title{
    margin: 0;
    font-size: 18px;
    letter-spacing: -0.01em;
}

.dj-chat-meta{
    font-size: 13px;
    color: var(--dj-muted);
}

/* Log container */
.dj-chat-log{
    margin-top: 14px;
    border: 1px solid var(--dj-border);
    background: var(--dj-surface-soft);
    border-radius: 18px;
    padding: 14px;
    max-height: 420px;
    overflow-y: auto;
}

/* Make keyboard focus visible when tabbing into the log */
.dj-chat-log:focus{
    outline: none;
}
.dj-chat-log:focus-visible{
    box-shadow: 0 0 0 4px rgba(239, 77, 69, 0.12);
    border-color: rgba(239, 77, 69, 0.55);
}

/* Message list */
.dj-chat-list{
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

/* Message bubble */
.dj-chat-msg{
    background: var(--dj-surface);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    padding: 10px 12px;
    box-shadow: 0 1px 10px rgba(0,0,0,0.03);
}

.dj-chat-msg-text{
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.55;
    font-size: 14px;
}

/* Message meta (timestamp) */
.dj-chat-msg-meta{
    margin-top: 6px;
    font-size: 12px;
    color: var(--dj-muted);
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Composer */
.dj-chat-compose{
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
}

@media (max-width: 520px){
    .dj-chat-compose{
        grid-template-columns: 1fr;
    }
}

/* Use your existing textarea styling, just a more chat-friendly height */
.dj-chat-compose .dj-textarea{
    min-height: 88px;
    max-height: 160px;
}

/* Action row */
.dj-chat-actions{
    margin-top: 14px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.dj-chat-actions .dj-btn{
    width: auto;
}

.dj-chat-empty{
    color: var(--dj-muted);
    font-size: 14px;
    margin: 0;
    padding: 8px 2px;
}

/* Small hint text */
.dj-chat-hint{
    margin-top: 10px;
    color: var(--dj-muted);
    font-size: 13px;
    line-height: 1.55;
}

/* Danger button variant (uses your accent red) */
.dj-btn-danger{
    border-color: rgba(239, 77, 69, 0.40);
    background: rgba(239, 77, 69, 0.06);
    color: var(--dj-text);
}

.dj-btn-danger:hover{
    border-color: rgba(239, 77, 69, 0.60);
    box-shadow: 0 8px 18px rgba(0,0,0,0.06);
}

/* Status area consistent with your patterns */
.dj-chat-status{
    margin-top: 12px;
}

.dj-chat-status[aria-live]{
    min-height: 20px; /* stops layout jump when text appears */
}