.chat-thread[hidden], .chat-thread [hidden] { display: none !important; }
.chat-thread { min-width: 0; display: grid; gap: 9px; margin-top: 12px; }
.chat-thread h4 { margin: 0; }
.chat-thread [data-thread-status], .chat-thread time { color: var(--chat-muted, #58624e); font-size: 12px; }
.chat-thread [data-thread-list] {
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-height: clamp(140px, 38vh, 350px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 9px;
    border: 1px solid var(--chat-border, #d5ddcd);
    border-radius: 10px;
    background: var(--chat-surface, #fffdf7);
}
.chat-bubble {
    width: fit-content;
    max-width: 85%;
    padding: 8px 11px;
    border-radius: 12px 12px 12px 4px;
    background: var(--chat-selected, #edf2e8);
    overflow-wrap: anywhere;
}
.chat-bubble-mine {
    align-self: flex-end;
    border-radius: 12px 12px 4px 12px;
    background: #dbead6;
    color: #234432;
}
.chat-bubble :is(strong,time) { display: block; }
.chat-bubble p { margin: 3px 0; white-space: pre-wrap; }
.chat-bubble-mine time { color: #405a43; }
.chat-thread form { display: grid; gap: 8px; }
.chat-thread textarea {
    width: 100%; box-sizing: border-box; resize: vertical; min-height: 64px;
    padding: 9px; border: 1px solid var(--chat-border, #aebda6); border-radius: 8px;
    background: var(--chat-surface, #fffdf7); color: inherit; font: inherit;
}
.chat-thread button { justify-self: start; }
.chat-thread [data-thread-feedback]:empty { display: none; }
.admin-chat-unread { color: var(--chat-ink); font-weight: 700; }
