/* ChatCard adapted to the existing Django chat, without demo data. */
.workspace-chat.chat-card { --chat-surface:var(--card); --chat-ink:var(--foreground); --chat-muted:var(--muted-foreground); --chat-input:var(--muted); --chat-border:var(--border); }
.workspace-chat.chat-card .workspace-chat-panel { width:min(36rem,calc(100vw - 2rem)); height:min(600px,calc(100dvh - 6rem)); max-height:calc(100dvh - 6rem); border:1px solid var(--chat-border); border-radius:1rem; background:var(--chat-surface); color:var(--chat-ink); padding:0; box-shadow:0 16px 50px color-mix(in srgb, var(--shadow-color) 9.4%, transparent); }
.workspace-chat.chat-card .workspace-chat-head { display:flex; align-items:center; min-height:74px; padding:12px 16px; border-bottom:1px solid var(--chat-border); background:var(--chat-surface); }
.workspace-chat.chat-card .workspace-chat-brand { gap:12px; }
.workspace-chat.chat-card .workspace-chat-head span { margin:0; padding:0; }
.workspace-chat.chat-card .workspace-chat-head span::before { content:none; }
.workspace-chat.chat-card .workspace-chat-team-avatar { width:40px; height:40px; flex:0 0 40px; background:var(--primary); color:var(--primary-foreground); font-size:18px; font-weight:500; }
.workspace-chat.chat-card .workspace-chat-team-avatar::after { content:none; }
.workspace-chat.chat-card .workspace-chat-heading strong { color:var(--chat-ink); font-size:16px; font-weight:500; line-height:1.5; }
.workspace-chat.chat-card .workspace-chat-heading span { color:var(--chat-muted); font-size:14px; font-weight:400; line-height:1.5; }
.workspace-chat.chat-card .workspace-chat-more { padding:0; color:var(--chat-muted); font-size:22px; }
.workspace-chat.chat-card .workspace-chat-close { position:static; width:28px; height:28px; margin:0; clip:auto; overflow:visible; background:transparent; color:var(--chat-muted); }
.workspace-chat.chat-card .workspace-chat-directory { background:var(--chat-surface); border-color:var(--chat-border); }
.workspace-chat.chat-card .workspace-chat-select { background:var(--chat-input); color:var(--chat-ink); border-color:var(--chat-border); font-weight:400; }
.workspace-chat.chat-card .workspace-chat-messages { display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; gap:16px; padding:16px; background:var(--chat-surface); overflow-y:auto; }
.workspace-chat.chat-card .workspace-chat-message,
.workspace-chat.chat-card .workspace-chat-message.is-mine { display:grid; flex:0 0 auto; grid-template-columns:36px minmax(0,1fr); width:100%; gap:12px; align-items:start; }
.workspace-chat.chat-card .workspace-chat-message .workspace-chat-avatar { display:grid; width:36px; height:36px; grid-column:1; grid-row:1; align-self:start; box-shadow:none; border:0; font-weight:500; }
.workspace-chat.chat-card .workspace-chat-message > div,
.workspace-chat.chat-card .workspace-chat-message.is-mine > div { grid-column:2; grid-row:1; min-width:0; max-width:none; width:100%; justify-self:stretch; padding:0; border:0; border-radius:0; box-shadow:none; background:transparent; color:var(--chat-ink); }
.workspace-chat.chat-card .workspace-chat-meta { display:flex; flex-wrap:wrap; justify-content:flex-start; align-items:baseline; gap:8px; margin:0 0 4px; }
.workspace-chat.chat-card .workspace-chat-meta strong { font-size:16px; font-weight:500; color:var(--chat-ink); }
.workspace-chat.chat-card .workspace-chat-meta span { font-size:14px; font-weight:400; color:var(--chat-muted); }
.workspace-chat.chat-card .workspace-chat-message p { margin:0; font-size:16px; font-weight:400; line-height:1.5; color:var(--chat-ink); overflow-wrap:anywhere; }
.workspace-chat.chat-card .workspace-chat-compose { position:relative; display:grid; grid-template-columns:minmax(0,1fr) 42px; grid-template-rows:auto; align-items:end; gap:8px; flex:0 0 auto; margin:0; padding:16px; border:0; border-radius:0; box-shadow:none; background:var(--chat-surface); }
.workspace-chat.chat-card .workspace-chat-compose textarea { grid-column:1; grid-row:1; width:100%; height:44px; min-height:44px; max-height:120px; margin:0; padding:11px 46px 11px 16px; border:0; border-radius:8px; font:inherit; font-size:14px; line-height:22px; resize:none; background:var(--chat-input); color:var(--chat-ink); }
.workspace-chat.chat-card .workspace-chat-compose textarea::placeholder { color:var(--chat-muted); }
.workspace-chat.chat-card .workspace-chat-compose > button[type=submit] { grid-column:2; grid-row:1; width:42px; height:44px; padding:10px; border:0; border-radius:8px; box-shadow:none; background:var(--chat-input); color:var(--chat-muted); }
.workspace-chat.chat-card .workspace-chat-compose > .chat-card-emoji-toggle { position:absolute; right:70px; bottom:22px; display:grid; place-items:center; width:32px; height:32px; padding:4px; border:0; border-radius:50%; background:transparent; color:var(--chat-muted); cursor:pointer; }
.workspace-chat.chat-card .chat-card-emoji-toggle svg { width:22px; height:22px; }
.workspace-chat.chat-card .workspace-chat-tools { display:none; position:absolute; right:66px; bottom:66px; padding:6px; gap:4px; border:1px solid var(--chat-border); border-radius:10px; background:var(--chat-surface); box-shadow:0 8px 24px color-mix(in srgb, var(--shadow-color) 9.4%, transparent); }
.workspace-chat.chat-card.show-emojis .workspace-chat-tools { display:flex; }
.workspace-chat.chat-card .workspace-chat-tools button { display:none; }
.workspace-chat.chat-card .workspace-chat-tools .chat-emoji-button { display:grid; place-items:center; width:30px; height:32px; }
.workspace-chat.chat-card button:hover { filter:brightness(.95); }
.workspace-chat.chat-card button:focus-visible,
.workspace-chat.chat-card textarea:focus-visible { outline:2px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset:2px; }
.workspace-chat.chat-card .workspace-chat-error:empty { display:none; }
.workspace-chat.chat-card .workspace-chat-empty { color:var(--chat-muted); font-weight:400; }
@media(max-width:600px) { .workspace-chat.chat-card .workspace-chat-panel { width:calc(100vw - 1.5rem); height:min(600px,calc(100dvh - 6rem)); } }

/* Integrated chat: no launcher button, no visible scrollbars, and clear message sides. */
.workspace-chat.chat-card {
    right: 1.5rem;
    bottom: 1.5rem;
    width: min(36rem, calc(100vw - 2rem));
}

.workspace-chat.chat-card .workspace-chat-toggle {
    display: inline-flex !important;
}

.workspace-chat.chat-card.is-open .workspace-chat-toggle {
    display: none !important;
}

.workspace-chat.chat-card.is-closed {
    width: auto;
}

.workspace-chat.chat-card.is-closed .workspace-chat-toggle {
    display: inline-flex !important;
}

.workspace-chat.chat-card .workspace-chat-panel {
    position: static;
    display: none !important;
    width: 100%;
    height: min(600px, calc(100dvh - 3rem));
    max-height: calc(100dvh - 3rem);
}

.workspace-chat.chat-card.is-open .workspace-chat-panel {
    display: flex !important;
}

.workspace-chat.chat-card .workspace-chat-close {
    display: grid;
    position: static;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    clip: auto;
    overflow: visible;
    border: 0;
    background: transparent;
    color: var(--chat-muted);
}

.workspace-chat.chat-card.is-closed .workspace-chat-panel {
    display: none !important;
}

.workspace-chat.chat-card .workspace-chat-brand {
    gap: 0;
}

.workspace-chat.chat-card .workspace-chat-heading span {
    display: none;
}

.workspace-chat.chat-card .workspace-chat-more {
    display: none;
}

.workspace-chat.chat-card .workspace-chat-team-icon {
    width: 1.55rem;
    height: 1.55rem;
}

.workspace-chat.chat-card .workspace-chat-messages,
.workspace-chat.chat-card .workspace-chat-conversations {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.workspace-chat.chat-card .workspace-chat-messages::-webkit-scrollbar,
.workspace-chat.chat-card .workspace-chat-conversations::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.workspace-chat.chat-card .workspace-chat-message {
    grid-template-columns: 36px minmax(0, 1fr) !important;
    align-items: start;
}

.workspace-chat.chat-card .workspace-chat-message:not(.is-mine) > div {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: auto;
    max-width: 80%;
    justify-self: start !important;
    text-align: left;
}

.workspace-chat.chat-card .workspace-chat-message.is-mine {
    grid-template-columns: minmax(0, 1fr) 36px !important;
}

.workspace-chat.chat-card .workspace-chat-message.is-mine .workspace-chat-avatar {
    grid-column: 2 !important;
    grid-row: 1 !important;
}

.workspace-chat.chat-card .workspace-chat-message.is-mine > div {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: auto;
    max-width: 80%;
    justify-self: end !important;
    text-align: right;
}

.workspace-chat.chat-card .workspace-chat-message.is-mine .workspace-chat-meta {
    justify-content: flex-end;
}

.workspace-chat.chat-card .workspace-chat-message p {
    margin: 0;
}

@media(max-width:600px) {
    .workspace-chat.chat-card {
        right: .75rem;
        bottom: .75rem;
        width: calc(100vw - 1.5rem);
    }

    .workspace-chat.chat-card .workspace-chat-panel {
        width: 100%;
        height: min(600px, calc(100dvh - 1.5rem));
        max-height: calc(100dvh - 1.5rem);
    }
}
