/* debates.css */

/* ── Entry modal overlay ─────────────────────────────────────── */
.dbt-entry-overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(15,23,42,0.7); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}

.dbt-entry-card {
    background: white; border-radius: 20px;
    padding: 2rem 2rem 1.5rem;
    max-width: 480px; width: 100%;
    box-shadow: 0 24px 60px rgba(15,23,42,0.3);
    position: relative;
    animation: dbt-card-in 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes dbt-card-in {
    from { opacity: 0; transform: scale(0.92) translateY(16px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.dbt-entry-close {
    position: absolute; top: 1rem; right: 1rem;
    background: #f1f5f9; border: none; border-radius: 50%;
    width: 32px; height: 32px; font-size: 1.25rem; line-height: 1;
    cursor: pointer; color: #64748b; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.dbt-entry-close:hover { background: #e2e8f0; }

.dbt-entry-eyebrow {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--accent, #0ea5e9); margin: 0 0 0.625rem;
}
.dbt-entry-title {
    font-size: 1.35rem; font-weight: 800; color: #0f172a; margin: 0 0 0.5rem; line-height: 1.3;
}
.dbt-entry-question {
    font-size: 0.9rem; color: #64748b; margin: 0 0 1.25rem; line-height: 1.5;
}
.dbt-entry-pick {
    font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: #94a3b8; margin: 0 0 0.625rem;
}
.dbt-entry-stances {
    display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem;
}
.dbt-entry-stance-btn {
    flex: 1; min-width: 100px;
    background: var(--stance-color, #6366f1); color: white; border: none; border-radius: 10px;
    padding: 0.75rem 1rem; font-size: 0.9rem; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: opacity 0.15s, transform 0.1s;
}
.dbt-entry-stance-btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.dbt-entry-stance-btn:active { transform: translateY(0); }

.dbt-entry-observe {
    display: block; width: 100%; background: none; border: none;
    color: #94a3b8; font-size: 0.82rem; cursor: pointer; font-family: inherit;
    padding: 0.5rem 0; text-align: center; transition: color 0.15s;
}
.dbt-entry-observe:hover { color: #475569; }

/* ── Page layout ─────────────────────────────────────────────── */
.dbt-page { max-width: 720px; margin: 0 auto; padding: 1.25rem 0 1rem; }

/* ── Hero ────────────────────────────────────────────────────── */
.dbt-hero { margin-bottom: 1rem; }
.dbt-hero-title { font-size: 1.75rem; font-weight: 800; color: #0f172a; margin: 0 0 0.375rem; }
.dbt-hero-sub   { color: #64748b; font-size: 0.9rem; line-height: 1.55; max-width: 520px; margin: 0; }

/* ── Next Up spotlight ───────────────────────────────────────── */
.dbt-next-up {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
    border-radius: 14px;
    padding: 1.125rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    color: white;
}
.dbt-next-up-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #93c5fd;
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.dbt-next-up-body { flex: 1; min-width: 0; }
.dbt-next-up-who  { font-size: 0.75rem; font-weight: 600; color: #bfdbfe; margin-bottom: 0.15rem; }
.dbt-next-up-title { font-size: 0.95rem; font-weight: 700; line-height: 1.35; margin-bottom: 0.3rem; }
.dbt-next-up-meta {
    font-size: 0.8rem;
    color: #93c5fd;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.3rem;
}
.dbt-next-up-note {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dbt-next-up-cta {
    flex-shrink: 0;
    align-self: center;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.35);
    color: white;
    border-radius: 8px;
    padding: 0.5rem 0.875rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.15s;
}
.dbt-next-up-cta:hover { background: rgba(255,255,255,0.25); }

@media (max-width: 500px) {
    .dbt-next-up {
        flex-direction: column;
        gap: 0.75rem;
    }
    .dbt-next-up-cta {
        align-self: flex-start;
    }
}

/* ── Note line on conversation rows ─────────────────────────── */
.dbt-conv-note {
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.4;
    margin-top: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Loading / empty ─────────────────────────────────────────── */
.dbt-loading { color: #94a3b8; padding: 3rem; text-align: center; font-size: 0.9rem; }
.dbt-empty {
    color: #94a3b8; padding: 2rem; text-align: center; font-size: 0.875rem;
    background: white; border-radius: 12px; border: 1px solid #e2e8f0;
}
.dbt-empty-first {
    padding: 2.5rem 1.5rem; text-align: center;
    background: white; border-radius: 12px; border: 1.5px dashed #e2e8f0; margin-bottom: 0.75rem;
    color: #64748b;
}
.dbt-empty-q { font-size: 1rem; font-weight: 600; color: #0f172a; margin: 0 0 0.5rem; }

/* ── Debate cards (list) ─────────────────────────────────────── */
.dbt-list { display: flex; flex-direction: column; gap: 0.75rem; }

.dbt-card {
    background: white; border-radius: 14px; border: 1.5px solid #e2e8f0;
    padding: 1.25rem 1.375rem; cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.dbt-card:hover {
    border-color: #93c5fd; box-shadow: 0 4px 16px rgba(59,130,246,0.12);
    transform: translateY(-1px);
}

.dbt-card-meta {
    display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.625rem; flex-wrap: wrap;
}
.dbt-live-indicator {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em;
    color: #dc2626; background: #fef2f2; border-radius: 5px; padding: 0.2rem 0.5rem;
}
.dbt-live-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #dc2626;
    animation: dbt-pulse 1.4s ease infinite;
}
@keyframes dbt-pulse {
    0%,100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.5); opacity: 0.5; }
}
.dbt-upcoming-label { font-size: 0.73rem; color: #b45309; font-weight: 600; }
.dbt-scope-tag {
    font-size: 0.63rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
    border-radius: 4px; padding: 0.15rem 0.45rem;
}
.dbt-scope-local   { background: #f0fdf4; color: #166534; }
.dbt-scope-state   { background: #eff6ff; color: #1e40af; }
.dbt-scope-federal { background: #faf5ff; color: #6b21a8; }
.dbt-card-count    { font-size: 0.78rem; color: #94a3b8; margin-left: auto; }

.dbt-card-title { font-size: 1.05rem; font-weight: 700; color: #0f172a; margin: 0 0 0.35rem; }
.dbt-card-q     { font-size: 0.875rem; color: #64748b; margin: 0 0 0.875rem; line-height: 1.45; }
.dbt-card-cta   { font-size: 0.85rem; font-weight: 700; color: #3b82f6; }

/* ── Topbar ──────────────────────────────────────────────────── */
.dbt-topbar {
    display: flex; align-items: center;
    margin-bottom: 0.6rem; gap: 0.35rem;
}
.dbt-back-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: none; border: none; color: #64748b;
    font-size: 0.8rem; font-weight: 500; cursor: pointer;
    padding: 0; font-family: inherit; transition: color 0.15s;
    flex-shrink: 0;
}
.dbt-back-btn:hover { color: #0f172a; }

/* Chat title: never shown (tabs serve as context) */
.dbt-chat-title { display: none; }

/* Topbar right-side action group */
.dbt-topbar-actions {
    display: flex; align-items: center; gap: 0.05rem; flex-shrink: 0;
}

/* View tab strip — desktop only */
.dbt-view-tabs--desktop {
    display: flex; background: #f1f5f9; border-radius: 8px; padding: 2px; gap: 2px;
    flex-shrink: 0; margin-left: auto;
}

/* View toggle button — mobile only */
.dbt-more-btn {
    display: none;
    background: #f1f5f9; border: none; border-radius: 8px; cursor: pointer;
    padding: 0.25rem 0.55rem; font-size: 0.76rem; font-weight: 600;
    color: #0f172a; font-family: inherit; transition: background 0.15s;
    align-items: center; flex-shrink: 0;
}
.dbt-more-btn:active { background: #e2e8f0; }

.dbt-save-research-btn {
    background: none; border: none; cursor: pointer; padding: 4px 6px;
    color: #94a3b8; font-size: 1rem; line-height: 1; transition: color 0.15s;
    flex-shrink: 0;
}
.dbt-save-research-btn:hover { color: #475569; }
.dbt-save-research-btn--saved { color: var(--accent, #42c8c1); }
.dbt-save-research-btn--saved:hover { color: var(--accent, #42c8c1); opacity: 0.8; }

@media (max-width: 639px) {
    .dbt-view-tabs--desktop { display: none !important; }
    .dbt-more-btn { display: inline-flex; align-items: center; justify-content: center; }
    .dbt-scoreboard { display: none; }
    .dbt-debate-header .dbt-debate-title { display: none; }
}

/* ── Action sheet (mobile slide-up) ─────────────────────────── */
.dbt-action-sheet {
    position: fixed; inset: 0; z-index: 8500;
    background: rgba(15,23,42,0.45); backdrop-filter: blur(2px);
    display: flex; align-items: flex-end; justify-content: center;
}
.dbt-action-sheet-inner {
    background: white; border-radius: 20px 20px 0 0;
    padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 1rem);
    width: 100%; max-width: 480px;
    animation: dbt-sheet-in 0.22s cubic-bezier(0.34,1.2,0.64,1);
}
@keyframes dbt-sheet-in {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
.dbt-action-sheet-handle {
    width: 36px; height: 4px; background: #e2e8f0; border-radius: 2px;
    margin: 0.6rem auto 0.4rem;
}
.dbt-action-sheet-title {
    font-size: 0.72rem; font-weight: 700; color: #94a3b8;
    text-align: center; text-transform: uppercase; letter-spacing: 0.1em;
    padding: 0.2rem 1.25rem 0.6rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dbt-action-item {
    display: flex; align-items: center; gap: 0.9rem;
    width: 100%; background: none; border: none; cursor: pointer;
    padding: 0.9rem 1.5rem; font-size: 0.95rem; font-weight: 500;
    color: #0f172a; font-family: inherit; text-align: left;
    transition: background 0.1s;
}
.dbt-action-item:active { background: #f1f5f9; }
.dbt-action-item i { width: 1.1rem; text-align: center; color: #64748b; font-size: 1rem; }
.dbt-action-divider { border: none; border-top: 1px solid #f1f5f9; margin: 0.2rem 0; }
.dbt-action-item--cancel {
    color: #94a3b8; font-weight: 400; justify-content: center;
    font-size: 0.9rem; padding-top: 0.7rem; padding-bottom: 0.7rem;
}
.dbt-action-item--view { justify-content: space-between; }
.dbt-action-check { color: #1d4ed8; font-size: 0.85rem; opacity: 0; transition: opacity 0.1s; }
.dbt-action-check--active { opacity: 1; }

.dbt-vtab {
    background: none; border: none; border-radius: 6px;
    padding: 0.25rem 0.6rem; font-size: 0.76rem; font-weight: 600;
    cursor: pointer; font-family: inherit; color: #64748b; transition: all 0.15s;
}
.dbt-vtab.active { background: white; color: #0f172a; box-shadow: 0 1px 4px rgba(15,23,42,0.1); }

/* ── Debate header ───────────────────────────────────────────── */
.dbt-debate-header { margin-bottom: 0.5rem; }
.dbt-debate-title  { font-size: 1rem; font-weight: 800; color: #0f172a; margin: 0 0 0.25rem; line-height: 1.3; }
.dbt-debate-q      { display: none; } /* subtitle duplicates title; hidden to save screen space */

/* Scoreboard */
.dbt-scoreboard { margin-bottom: 0.5rem; }
.dbt-score-bar {
    display: flex; height: 8px; border-radius: 4px; overflow: hidden;
    background: #e2e8f0; gap: 2px; margin-bottom: 0.375rem;
}
.dbt-score-seg  { border-radius: 3px; min-width: 4px; transition: width 0.4s ease; }
.dbt-score-legend { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.dbt-score-item { display: flex; align-items: center; gap: 0.275rem; font-size: 0.78rem; color: #64748b; }
.dbt-score-dot  { width: 8px; height: 8px; border-radius: 50%; }

/* Chat session tabs (multi-session debates) */
.dbt-chat-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.dbt-chat-tab {
    background: white; border: 1.5px solid #e2e8f0; border-radius: 7px;
    padding: 0.3rem 0.75rem; font-size: 0.8rem; font-weight: 500;
    cursor: pointer; font-family: inherit; color: #64748b;
    display: inline-flex; align-items: center; gap: 0.35rem; transition: all 0.15s;
}
.dbt-chat-tab.active { background: #1d4ed8; border-color: #1d4ed8; color: white; }
.dbt-tab-live {
    width: 6px; height: 6px; border-radius: 50%; background: #ef4444;
    animation: dbt-pulse 1.4s ease infinite;
}

/* ── Resources bar ───────────────────────────────────────────── */
.dbt-resources {
    background: #fffbeb; border: 1.5px solid #fde68a;
    border-radius: 8px; padding: 0.4rem 0.75rem;
    margin-bottom: 0.5rem;
}
.dbt-resources-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 0.625rem; }
.dbt-res-type {
    font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
    background: #fde68a; color: #92400e; border-radius: 4px; padding: 0.2rem 0.5rem;
}
.dbt-res-link {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: #1d4ed8; color: white; text-decoration: none;
    border-radius: 7px; padding: 0.35rem 0.875rem; font-size: 0.85rem; font-weight: 600;
    transition: background 0.15s;
}
.dbt-res-link:hover { background: #1e40af; }
.dbt-res-agenda { font-size: 0.82rem; color: #92400e; margin: 0; width: 100%; line-height: 1.4; }

/* ── Messages (bubble layout) ────────────────────────────────── */
.dbt-messages { min-height: 60px; margin-bottom: 0.5rem; }

/* Chat view: fixed height from JS; position:relative anchors the absolute compose bar */
#dbtChatView.dbt-dm-view {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Prevent page scroll while a chat is open */
body.dbt-in-chat { overflow: hidden; }

/* Topbar, header, resources strip, replay bar: never grow or shrink */
#dbtChatView.dbt-dm-view > .dbt-topbar,
#dbtChatView.dbt-dm-view > .dbt-debate-header,
#dbtChatView.dbt-dm-view > .dbt-resources,
#dbtChatView.dbt-dm-view > .dbt-replay-bar {
    flex: 0 0 auto;
}

/* Chat panel: fill ALL remaining height; padding-bottom set by JS = compose height */
.dbt-dm-view #dbtChatPanel {
    flex: 1 1 0px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Debate reading/tree wrapper: fills remaining space and scrolls when in fullscreen mode */
.dbt-dm-view #dbtDebateWrapper.dbt-debate-fullscreen {
    flex: 1 1 0px;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

/* Messages: scroll container inside the panel */
.dbt-dm-view .dbt-messages {
    flex: 1 1 0px;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    display: flex; flex-direction: column;
    gap: 0.5rem; padding: 0.75rem 0.75rem 1rem;
    background: #f8fafc;
    margin-bottom: 0;
}

/* Slide-in animation when entering a debate/chat from the list */
@keyframes dbt-view-enter {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}
#dbtChatView.dbt-view-entering {
    animation: dbt-view-enter 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes dbt-slide-in {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Message bubble ───────────────────────────────────────────── */
.dbt-msg {
    display: flex; flex-direction: column;
    max-width: 82%; align-self: flex-start;
    background: none; border: none; border-left: none; border-radius: 0;
    padding: 0; margin: 0;
    animation: dbt-slide-in 0.2s ease;
}
.dbt-msg--self  { align-self: flex-end; }
.dbt-msg--reply { margin-left: 1.5rem; max-width: 78%; }
.dbt-msg--pinned .dbt-msg-bubble-inner { background: #fffbeb !important; border-color: #f59e0b !important; }
.dbt-msg:hover { box-shadow: none; }

.dbt-msg-header {
    display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap;
    font-size: 0.7rem; color: #94a3b8;
    padding: 0 0.5rem; margin-bottom: 0.2rem;
}
.dbt-msg--self .dbt-msg-header { flex-direction: row-reverse; }
.dbt-msg-stance {
    font-size: 0.63rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    padding: 0.12rem 0.45rem; border-radius: 4px;
}
.dbt-msg-name  { font-size: 0.72rem; font-weight: 600; color: #475569; }
.dbt-msg-time  { font-size: 0.68rem; color: #94a3b8; margin-left: auto; }
.dbt-msg--self .dbt-msg-time { margin-left: 0; margin-right: auto; }
.dbt-kb-badge  {
    font-size: 0.63rem; background: #fefce8; color: #854d0e;
    border: 1px solid #fde68a; border-radius: 4px; padding: 0.1rem 0.35rem; font-weight: 700;
}

/* Bubble body */
.dbt-msg-bubble-inner {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid var(--sc, #e2e8f0);
    border-radius: 4px 10px 10px 4px;
    padding: 0.6rem 0.85rem;
    word-break: break-word;
}
.dbt-msg--self .dbt-msg-bubble-inner {
    background: var(--primary, #191E39); color: #fff;
    border-color: var(--primary, #191E39);
    border-left-color: var(--primary, #191E39);
    border-radius: 10px 4px 4px 10px;
}
.dbt-msg-text  { color: inherit; line-height: 1.55; margin: 0; font-size: 0.9rem; }
.dbt-msg--self .dbt-msg-text { color: #fff; }
.dbt-msg-source {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.72rem; font-weight: 700;
    color: var(--blue, #1a7a76);
    background: rgba(66,200,193,0.1);
    border: 1px solid rgba(66,200,193,0.25);
    padding: 2px 8px; border-radius: 4px;
    margin-top: 6px; text-decoration: none;
}
.dbt-msg-source a { color: inherit; text-decoration: none; }
.dbt-msg-source a:hover { text-decoration: underline; }
.dbt-msg--self .dbt-msg-source { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.25); }
.dbt-msg--self .dbt-msg-source a { color: inherit; }

/* Actions — revealed on hover/touch */
.dbt-msg-actions {
    display: flex; gap: 0.5rem; align-items: center;
    padding: 0.2rem 0.4rem 0;
    opacity: 0; transition: opacity 0.15s;
}
.dbt-msg:hover .dbt-msg-actions,
.dbt-msg:focus-within .dbt-msg-actions { opacity: 1; }
@media (hover: none) { .dbt-msg-actions { opacity: 1; } }
.dbt-msg--self .dbt-msg-actions { flex-direction: row-reverse; }

/* Nested replies */
.dbt-msg-replies {
    display: flex; flex-direction: column; gap: 0.4rem;
    margin-top: 0.5rem;
}

.dbt-upvote-btn {
    display: inline-flex; align-items: center; gap: 3px;
    background: white; border: 1px solid var(--border, #e2e8f0); border-radius: 99px;
    padding: 3px 10px; font-size: 0.75rem; cursor: pointer; color: var(--text-muted, #64748b);
    transition: all 0.15s; font-family: inherit; font-weight: 700;
}
.dbt-upvote-btn--has { border-color: var(--accent); color: var(--blue); background: rgba(66,200,193,0.08); }
.dbt-upvote-btn--on  { border-color: var(--accent); color: var(--blue); background: rgba(66,200,193,0.15); }
.dbt-upvote-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.dbt-upvote-btn:disabled { opacity: 0.45; cursor: default; }

.dbt-reply-btn {
    background: none; border: none; font-size: 0.78rem; cursor: pointer;
    color: #94a3b8; font-family: inherit; padding: 0; transition: color 0.15s;
}
.dbt-reply-btn:hover { color: #3b82f6; }

.dbt-clip-btn {
    background: none; border: none; font-size: 0.8rem; cursor: pointer;
    color: #cbd5e1; font-family: inherit; padding: 0 0.1rem; transition: color 0.15s;
}
.dbt-clip-btn:hover { color: #6366f1; }
.dbt-clip-btn--saved { color: #6366f1 !important; }

.dbt-elevate-btn {
    background: none; border: 1.5px solid #0ea5e9; border-radius: 5px;
    padding: 0.15rem 0.5rem; font-size: 0.73rem; font-weight: 700;
    color: #0ea5e9; cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.dbt-elevate-btn:hover { background: #0ea5e9; color: white; }

/* ── Argument map (stance-column layout) ─────────────────────── */
.dbt-argtree-header { margin-bottom: 1rem; }
.dbt-argtree-hint { font-size: 0.82rem; color: var(--text-muted); margin: 0; line-height: 1.45; }

.dbt-argtree { padding-bottom: 2rem; }

.dbt-tree-empty {
    padding: 2.5rem; text-align: center; color: var(--text-muted);
    background: white; border-radius: 12px; border: 1.5px dashed var(--border);
}

/* ── SVG deliberation tree ───────────────────────────────── */
.dbt-delib-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0 0 0.75rem;
}

.dbt-delib-scroll {
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.dbt-tree-svg {
    display: block;
    border-radius: 8px;
}

.dbt-tree-svg rect { transition: opacity 0.12s; }
.dbt-tree-svg g:hover rect:not([rx="8"]):not([width="4"]):not([rx="2"]) { opacity: 0.88; }

/* Legacy stance-columns kept for any fallback use */
.dbt-stance-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    align-items: start;
}

@media (min-width: 640px) {
    .dbt-stance-columns { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

.dbt-stance-col { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }

.dbt-stance-col-header {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.125rem;
}

.dbt-stance-col-count {
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.65;
}

.dbt-tnode { margin-bottom: 0; }

.dbt-tcard {
    background: white;
    border-left: 3px solid var(--border);
    border-radius: 0 8px 8px 0;
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    transition: box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(25,30,57,0.06);
    font-size: 0.82rem;
}
.dbt-tcard:hover { box-shadow: 0 3px 10px rgba(25,30,57,0.1); }
.dbt-tcard--reply {
    background: #fafafa;
    border-left-width: 2px;
    font-size: 0.78rem;
}

.dbt-tcard-top {
    display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.3rem; flex-wrap: wrap;
}
.dbt-tcard-name   { font-size: 0.75rem; font-weight: 600; color: var(--primary); }
.dbt-tcard-up     { font-size: 0.72rem; color: var(--text-muted); margin-left: auto; }
.dbt-tcard-text   { font-size: 0.8rem; color: #334155; line-height: 1.45; margin: 0 0 0.2rem; }
.dbt-tcard-replies { font-size: 0.68rem; color: var(--text-muted); font-style: italic; }

.dbt-tchildren {
    margin-left: 0.75rem;
    padding-left: 0.5rem;
    border-left: 1.5px solid var(--border);
    margin-top: 0.375rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

/* ── Compose (sticky) ────────────────────────────────────────── */
.dbt-compose {
    background: white; border: 1.5px solid #e2e8f0; border-radius: 14px;
    padding: 0.875rem 1rem; position: sticky; bottom: 70px;
    box-shadow: 0 -4px 24px rgba(15,23,42,0.1); margin-top: 0.75rem;
}

.dbt-reply-banner {
    display: flex; justify-content: space-between; align-items: center;
    background: #eff6ff; border-radius: 7px; padding: 0.35rem 0.75rem;
    margin-bottom: 0.5rem; font-size: 0.82rem; color: #1d4ed8; font-weight: 500;
}
.dbt-reply-banner button {
    background: none; border: none; cursor: pointer; color: #94a3b8;
    font-size: 1.1rem; line-height: 1; padding: 0;
}

.dbt-compose-row {
    display: flex; align-items: flex-start; gap: 0.5rem;
}

/* Stance pill row — below textarea, hidden for DMs */
.dbt-compose-meta {
    display: flex; align-items: center; gap: 0.5rem;
    margin-top: 0.4rem;
}

.dbt-stance-badge {
    white-space: nowrap;
    border: 1.5px solid #e2e8f0; border-radius: 20px;
    padding: 0.2rem 0.65rem; font-size: 0.75rem; font-weight: 600;
    color: #64748b; background: #f8fafc; cursor: pointer; font-family: inherit;
    transition: all 0.15s;
}
.dbt-stance-badge:hover { border-color: #94a3b8; background: white; }

.dbt-compose-textarea {
    flex: 1; border: 1.5px solid #e2e8f0; border-radius: 10px;
    padding: 0.5rem 0.75rem; font-family: inherit; font-size: 16px;
    resize: none; outline: none; transition: border-color 0.15s;
    color: #0f172a; min-height: 42px; line-height: 1.5;
    field-sizing: content; max-height: 140px;
}
.dbt-compose-textarea:focus { border-color: #3b82f6; }

.dbt-compose-send {
    flex-shrink: 0; align-self: flex-start; margin-top: 0.35rem;
    background: #1d4ed8; color: white; border: none; border-radius: 10px;
    padding: 0.45rem 1rem; font-size: 0.875rem; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: background 0.15s;
    display: flex; align-items: center; justify-content: center; gap: 0.3rem;
}
.dbt-compose-send:hover    { background: #1e40af; }
.dbt-compose-send:disabled { opacity: 0.55; cursor: not-allowed; }
.dbt-send-icon { display: none; font-size: 0.8rem; }
.dbt-send-text { display: inline; }

.dbt-compose-auth {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.dbt-compose-auth p { font-size: 0.875rem; color: #64748b; margin: 0; }
.dbt-compose-auth-btn {
    background: #1d4ed8; color: white; text-decoration: none;
    border-radius: 9px; padding: 0.45rem 1rem; font-size: 0.875rem; font-weight: 700;
    white-space: nowrap; transition: background 0.15s;
}
.dbt-compose-auth-btn:hover { background: #1e40af; }

/* ── Elevate picker ──────────────────────────────────────────── */
.dbt-elevate-picker { margin: 0.5rem 0 0.125rem; }
.dbt-ep-wrap { background: #f8fafc; border: 1.5px solid #0ea5e9; border-radius: 10px; padding: 0.875rem; }
.dbt-ep-hint { color: #64748b; font-size: 0.78rem; margin: 0 0 0.5rem; }
.dbt-ep-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; min-height: 1rem; margin-bottom: 0.5rem; }
.dbt-ep-chip {
    display: inline-flex; align-items: center; gap: 0.25rem;
    background: #0ea5e9; color: white; border-radius: 999px;
    padding: 0.2rem 0.6rem; font-size: 0.75rem; font-weight: 600;
}
.dbt-ep-chip button { background: none; border: none; color: white; cursor: pointer; font-size: 0.85rem; padding: 0; }
.dbt-ep-search {
    width: 100%; box-sizing: border-box; border: 1.5px solid #e2e8f0; border-radius: 7px;
    padding: 0.375rem 0.625rem; font-family: inherit; font-size: 0.85rem; outline: none;
    margin-bottom: 0.25rem;
}
.dbt-ep-search:focus { border-color: #0ea5e9; }
.dbt-ep-results {
    list-style: none; padding: 0; margin: 0 0 0.5rem; max-height: 120px; overflow-y: auto;
    border: 1.5px solid #e2e8f0; border-radius: 7px; background: white;
}
.dbt-ep-results:empty { display: none; }
.dbt-ep-result { padding: 0.4rem 0.75rem; cursor: pointer; font-size: 0.84rem; }
.dbt-ep-result:hover { background: #f1f5f9; }
.dbt-ep-no-result { padding: 0.4rem 0.75rem; color: #94a3b8; font-size: 0.84rem; }
.dbt-ep-footer { display: flex; gap: 0.5rem; }
.dbt-ep-confirm {
    background: #0ea5e9; color: white; border: none; border-radius: 7px;
    padding: 0.4rem 0.875rem; font-size: 0.82rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.dbt-ep-confirm:disabled { opacity: 0.6; cursor: not-allowed; }
.dbt-ep-cancel {
    background: none; border: 1.5px solid #e2e8f0; border-radius: 7px;
    padding: 0.4rem 0.75rem; font-size: 0.82rem; cursor: pointer; font-family: inherit; color: #64748b;
}

/* ── List source filters ─────────────────────────────────────── */
.dbt-list-filters {
    display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.dbt-list-filter {
    background: white; border: 1.5px solid #e2e8f0; border-radius: 20px;
    padding: 0.3rem 0.85rem; font-size: 0.8rem; font-weight: 600;
    cursor: pointer; font-family: inherit; color: #64748b;
    display: inline-flex; align-items: center; gap: 0.3rem; transition: all 0.15s;
}
.dbt-list-filter:hover { border-color: #93c5fd; color: #1d4ed8; }
.dbt-list-filter.active {
    background: #1d4ed8; border-color: #1d4ed8; color: white;
}

/* ── Source type badge & info bar ────────────────────────────── */
.dbt-src-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.67rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
    border-radius: 5px; padding: 0.2rem 0.5rem;
}
.dbt-src-badge--platform   { background: #eff6ff; color: #1d4ed8; }
.dbt-src-badge--youtube    { background: #fef2f2; color: #dc2626; }
.dbt-src-badge--meeting    { background: #f0fdf4; color: #166534; }
.dbt-src-badge--committee  { background: #faf5ff; color: #7e22ce; }
.dbt-src-badge--external   { background: #fff7ed; color: #c2410c; }

.dbt-src-archived {
    font-size: 0.72rem; color: #94a3b8; font-style: italic;
}
.dbt-src-location {
    font-size: 0.8rem; color: #64748b;
    display: inline-flex; align-items: center; gap: 0.25rem;
}
.dbt-src-icon { font-size: 0.85rem; color: #64748b; }

.dbt-archived-label {
    font-size: 0.72rem; color: #94a3b8; font-style: italic;
}

/* ── Timestamp pill on messages ──────────────────────────────── */
.dbt-msg-offset {
    display: inline-flex; align-items: center; gap: 0.2rem;
    background: #f1f5f9; color: #64748b; border-radius: 20px;
    padding: 0.1rem 0.45rem; font-size: 0.68rem; font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ── Replay bar ──────────────────────────────────────────────── */
.dbt-replay-bar {
    background: #0f172a; border-radius: 10px;
    padding: 0.625rem 1rem; margin-bottom: 0.875rem;
}
.dbt-replay-inner {
    display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap;
    color: #94a3b8; font-size: 0.8rem;
}
.dbt-replay-label { color: #64748b; font-size: 0.78rem; white-space: nowrap; }
#dbtReplayCount   { font-size: 0.78rem; color: #94a3b8; white-space: nowrap; }
.dbt-replay-slider {
    flex: 1; min-width: 80px; accent-color: #3b82f6; cursor: pointer; height: 4px;
}
.dbt-replay-btn {
    background: #1d4ed8; color: white; border: none; border-radius: 7px;
    padding: 0.3rem 0.75rem; font-size: 0.8rem; font-weight: 700;
    cursor: pointer; font-family: inherit; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 0.3rem; transition: background 0.15s;
}
.dbt-replay-btn:hover { background: #1e40af; }
.dbt-replay-btn--playing { background: #dc2626; }
.dbt-replay-btn--playing:hover { background: #b91c1c; }

/* ── Segments / Topics panel ─────────────────────────────────── */
.dbt-seg-header { margin-bottom: 0.875rem; }
.dbt-seg-hint { font-size: 0.82rem; color: #94a3b8; margin: 0; line-height: 1.45; }

.dbt-seg-list { display: flex; flex-direction: column; gap: 0.625rem; margin-bottom: 1rem; }

.dbt-seg-card {
    background: white; border: 1.5px solid #e2e8f0; border-radius: 12px;
    padding: 0.875rem 1rem; transition: border-color 0.15s, box-shadow 0.15s;
}
.dbt-seg-card:hover { border-color: #93c5fd; box-shadow: 0 3px 10px rgba(59,130,246,0.1); }

.dbt-seg-card-header {
    display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.4rem;
}
.dbt-seg-title  { font-size: 0.95rem; font-weight: 700; color: #0f172a; flex: 1; margin: 0; }
.dbt-seg-range  { font-size: 0.72rem; color: #94a3b8; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dbt-seg-jump-btn {
    background: #eff6ff; color: #1d4ed8; border: none; border-radius: 6px;
    padding: 0.2rem 0.55rem; font-size: 0.73rem; font-weight: 700;
    cursor: pointer; font-family: inherit; white-space: nowrap; transition: background 0.15s;
}
.dbt-seg-jump-btn:hover { background: #dbeafe; }

.dbt-seg-summary { font-size: 0.82rem; color: #475569; line-height: 1.45; margin: 0 0 0.5rem; }

.dbt-seg-topics { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.dbt-seg-topic-wrap { display: inline-flex; align-items: center; gap: 0.15rem; }
.dbt-seg-topic-kb-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    color: #16a34a; font-size: 0.6rem;
    opacity: 0.6; transition: opacity 0.15s;
    text-decoration: none;
}
.dbt-seg-topic-kb-link:hover { opacity: 1; }
.dbt-seg-topic-chip {
    display: inline-flex; align-items: center; gap: 0.25rem;
    background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0;
    border-radius: 20px; padding: 0.2rem 0.6rem; font-size: 0.73rem; font-weight: 600;
    cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.dbt-seg-topic-chip:hover { background: #dcfce7; border-color: #86efac; }

.dbt-seg-empty {
    color: #94a3b8; font-size: 0.875rem; text-align: center; padding: 2rem;
    background: white; border-radius: 12px; border: 1.5px dashed #e2e8f0;
}

/* Moderator segment creation form */
.dbt-seg-create {
    background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 12px;
    padding: 1rem; margin-top: 1rem; display: flex; flex-direction: column; gap: 0.625rem;
}
.dbt-seg-create-title {
    font-size: 0.85rem; font-weight: 700; color: #0f172a;
}
.dbt-seg-input {
    width: 100%; box-sizing: border-box; border: 1.5px solid #e2e8f0; border-radius: 8px;
    padding: 0.45rem 0.75rem; font-family: inherit; font-size: 0.875rem; outline: none;
    color: #0f172a; transition: border-color 0.15s;
}
.dbt-seg-input:focus { border-color: #3b82f6; }
.dbt-seg-textarea {
    width: 100%; box-sizing: border-box; border: 1.5px solid #e2e8f0; border-radius: 8px;
    padding: 0.45rem 0.75rem; font-family: inherit; font-size: 0.875rem; outline: none;
    color: #0f172a; resize: vertical; transition: border-color 0.15s;
}
.dbt-seg-textarea:focus { border-color: #3b82f6; }
.dbt-seg-topics-row { display: flex; flex-direction: column; gap: 0.375rem; }
.dbt-seg-range-row {
    display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap;
}
.dbt-seg-range-row label {
    display: flex; align-items: center; gap: 0.35rem;
    font-size: 0.8rem; color: #64748b; font-weight: 500;
}
.dbt-seg-num {
    border: 1.5px solid #e2e8f0; border-radius: 6px;
    padding: 0.3rem 0.5rem; font-family: inherit; font-size: 0.85rem;
    width: 90px; outline: none; color: #0f172a;
}
.dbt-seg-num:focus { border-color: #3b82f6; }
.dbt-seg-add-btn {
    background: #0ea5e9; color: white; border: none; border-radius: 7px;
    padding: 0.4rem 0.875rem; font-size: 0.82rem; font-weight: 700;
    cursor: pointer; font-family: inherit; align-self: flex-start; transition: background 0.15s;
}
.dbt-seg-add-btn:hover { background: #0284c7; }

/* ── KB Claims drawer ────────────────────────────────────────── */
.dbt-claims-backdrop {
    position: fixed; inset: 0; z-index: 8000;
    background: rgba(15,23,42,0.4); backdrop-filter: blur(2px);
}
.dbt-claims-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 8001;
    width: min(480px, 100vw); background: white;
    box-shadow: -8px 0 40px rgba(15,23,42,0.18);
    display: flex; flex-direction: column; overflow: hidden;
    animation: dbt-drawer-in 0.25s cubic-bezier(0.34,1.2,0.64,1);
}
@keyframes dbt-drawer-in {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
.dbt-claims-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid #e2e8f0; flex-shrink: 0;
}
.dbt-claims-drawer-title {
    font-size: 1rem; font-weight: 700; color: #0f172a; line-height: 1.3;
    flex: 1; margin-right: 0.5rem;
}
.dbt-claims-drawer-close {
    background: #f1f5f9; border: none; border-radius: 50%;
    width: 30px; height: 30px; font-size: 1.2rem; line-height: 1;
    cursor: pointer; color: #64748b; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: background 0.15s;
}
.dbt-claims-drawer-close:hover { background: #e2e8f0; }
.dbt-claims-drawer-hint {
    padding: 0.625rem 1.25rem; font-size: 0.78rem; color: #94a3b8;
    border-bottom: 1px solid #f1f5f9; flex-shrink: 0; line-height: 1.45;
}
.dbt-claims-body {
    flex: 1; overflow-y: auto; padding: 0.875rem 1.25rem; display: flex; flex-direction: column; gap: 0.75rem;
}
.dbt-claims-empty {
    color: #94a3b8; font-size: 0.875rem; text-align: center; padding: 2rem;
}

/* Individual claim cards inside drawer */
.dbt-claim-card {
    background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 12px;
    padding: 0.875rem 1rem;
}
.dbt-claim-header {
    display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.5rem; flex-wrap: wrap;
}
.dbt-claim-text {
    font-size: 0.9rem; color: #0f172a; line-height: 1.5; margin: 0 0 0.375rem;
}
.dbt-claim-note {
    font-size: 0.8rem; color: #64748b; font-style: italic; margin: 0 0 0.5rem; line-height: 1.4;
}
.dbt-claim-source {
    display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.375rem;
}
.dbt-claim-src-chat { font-size: 0.75rem; color: #64748b; }
.dbt-claim-offset {
    font-size: 0.7rem; background: #eff6ff; color: #1d4ed8; border-radius: 4px;
    padding: 0.1rem 0.4rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.dbt-claim-ctx-btn {
    background: #1d4ed8; color: white; border: none; border-radius: 6px;
    padding: 0.25rem 0.65rem; font-size: 0.75rem; font-weight: 700;
    cursor: pointer; font-family: inherit; margin-left: auto; transition: background 0.15s;
    white-space: nowrap;
}
.dbt-claim-ctx-btn:hover { background: #1e40af; }

/* Veracity badges */
.dbt-claim-veracity {
    font-size: 0.67rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    border-radius: 4px; padding: 0.15rem 0.45rem;
}
.dbt-veracity-true         { background: #d1fae5; color: #065f46; }
.dbt-veracity-mostly_true  { background: #d1fae5; color: #065f46; }
.dbt-veracity-disputed     { background: #fff7ed; color: #9a3412; }
.dbt-veracity-false        { background: #fee2e2; color: #991b1b; }
.dbt-veracity-misleading   { background: #fef3c7; color: #92400e; }
.dbt-veracity-unverified   { background: #f1f5f9; color: #475569; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
    .dbt-compose     { bottom: 60px; }
    .dbt-entry-card  { padding: 1.5rem 1.25rem 1.25rem; }
    .dbt-entry-title { font-size: 1.15rem; }
    .dbt-msg--reply  { margin-left: 1rem; }
    .dbt-tchildren   { margin-left: 0.75rem; padding-left: 0.625rem; }
    .dbt-claims-drawer { width: 100vw; }
    .dbt-seg-range-row { gap: 0.5rem; }
}

/* ── Rep Sessions Panel ──────────────────────────────────────── */
.dbt-rep-sessions {
    margin: 0 0 1.25rem;
    background: #f0f4ff;
    border: 1px solid #c7d7f9;
    border-radius: 0.75rem;
    overflow: hidden;
}
.dbt-rep-sessions-head {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #1e3a5f;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.dbt-rep-sessions-head i { font-size: 0.85rem; opacity: 0.85; }

.dbt-rep-session-card {
    padding: 1rem 1rem 0.875rem;
    border-top: 1px solid #c7d7f9;
}
.dbt-rep-session-card:first-of-type { border-top: none; }

.dbt-rep-session-meta {
    display: flex; align-items: center; gap: 1rem;
    font-size: 0.75rem; color: #4b6ca8;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}
.dbt-rep-session-meta i { margin-right: 0.25rem; opacity: 0.75; }
.dbt-rep-session-official { font-weight: 600; }

.dbt-rep-session-title {
    font-size: 0.95rem; font-weight: 700;
    color: #1e3a5f; margin-bottom: 0.2rem;
}
.dbt-rep-session-topic {
    font-size: 0.825rem; color: #374151; margin-bottom: 0.35rem;
}
.dbt-rep-session-note {
    font-size: 0.78rem; color: #6b7280;
    background: #fff; border-left: 3px solid #2563eb;
    padding: 0.35rem 0.6rem; border-radius: 0 0.25rem 0.25rem 0;
    margin-bottom: 0.5rem;
}

.dbt-rep-session-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem;
}
.dbt-rep-session-loc {
    font-size: 0.75rem; color: #6b7280;
}
.dbt-rep-session-loc i { margin-right: 0.2rem; }

.dbt-rep-session-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.775rem; font-weight: 600;
    padding: 0.3rem 0.75rem; border-radius: 9999px;
    background: #fff; border: 1.5px solid #2563eb; color: #2563eb;
    cursor: pointer; transition: background 0.15s, color 0.15s;
}
.dbt-rep-session-btn:hover { background: #2563eb; color: #fff; }
.dbt-rep-session-btn--confirmed { border-color: #10b981; color: #10b981; }
.dbt-rep-session-btn--confirmed:hover { background: #10b981; color: #fff; }

/* ── DM (rep chat) card variant ─────────────────────────────────── */
.dbt-card--dm { border-left: 3px solid #2563eb; }
.dbt-card--dm .dbt-card-cta { color: #2563eb; }

/* ── DM view — chat window styling ──────────────────────────────── */

.dbt-dm-row {
    display: flex; align-items: flex-end; gap: 0.5rem;
    max-width: 85%;
}
.dbt-dm-row.dbt-dm--mine {
    align-self: flex-end; flex-direction: row-reverse;
    max-width: 75%;
}
.dbt-dm-row.dbt-dm--official { align-self: flex-start; }
.dbt-dm-row.dbt-dm--other   { align-self: flex-start; }

.dbt-dm-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: #d1d5db; color: #374151;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700;
}
.dbt-dm-avatar--official {
    background: #1e40af; color: #fff; font-size: 0.65rem;
}

.dbt-dm-bubble-wrap { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.dbt-dm-name {
    font-size: 0.7rem; font-weight: 600; color: #6b7280;
    padding: 0 0.5rem;
}
.dbt-dm-bubble {
    padding: 0.55rem 0.85rem;
    border-radius: 16px;
    font-size: 0.875rem; line-height: 1.45;
    word-break: break-word;
}
.dbt-dm--official .dbt-dm-bubble {
    background: #1e40af; color: #fff;
    border-bottom-left-radius: 4px;
}
.dbt-dm--mine .dbt-dm-bubble {
    background: #2563eb; color: #fff;
    border-bottom-right-radius: 4px;
}
.dbt-dm--other .dbt-dm-bubble {
    background: #fff; color: #111827;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}
.dbt-dm-time {
    font-size: 0.68rem; color: #9ca3af;
    padding: 0 0.5rem;
    align-self: flex-end;
}
.dbt-dm--mine .dbt-dm-time { text-align: right; }

/* ── Compose: absolutely anchored to bottom of chat view ─────── */
.dbt-dm-view .dbt-compose {
    position: absolute !important;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    border: none;
    border-top: 1px solid #e5e7eb;
    border-radius: 0;
    box-shadow: 0 -2px 8px rgba(15,23,42,0.06);
    background: #fff;
    padding: 0.5rem 0.75rem;
    margin-top: 0;
}
.dbt-dm-view .dbt-compose-row {
    gap: 0.4rem;
    align-items: flex-end;
}
.dbt-dm-view .dbt-compose-textarea {
    border-radius: 20px;
    padding: 0.5rem 0.9rem;
    font-size: 16px;
    min-height: unset;
    max-height: 120px;
    resize: none;
    background: #f3f4f6;
    border-color: transparent;
}
.dbt-dm-view .dbt-compose-textarea:focus { border-color: #2563eb; background: #fff; }
.dbt-dm-view .dbt-compose-send {
    border-radius: 50%; width: 38px; height: 38px; padding: 0;
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    margin-top: 0;
}
.dbt-dm-view .dbt-send-icon { display: block; }
.dbt-dm-view .dbt-send-text { display: none; }

/* ── Chat list section headers ──────────────────────────────────── */
.dbt-list-section-head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 0.85rem 0.25rem 0.3rem;
    background: none;
}
.dbt-list-section-head i { font-size: 0.7rem; }
.dbt-live-pulse {
    color: #dc2626;
    animation: dbt-pulse 1.4s ease infinite;
}

/* ── Conversation list container ─────────────────────────────────── */
.dbt-conv-list {
    background: var(--card, #fff);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 1rem;
}

/* ── DM Conversation List — flush rows with dividers ─────────────── */
.dbt-conv-row {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid rgba(25,30,57,0.06);
    border-radius: 0;
    cursor: pointer;
    background: transparent;
    transition: background 0.1s;
    text-decoration: none;
}
.dbt-conv-row:last-child { border-bottom: none; }
.dbt-conv-row:hover { background: rgba(25,30,57,0.03); }

.dbt-conv-avatar {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: #fff;
}
.dbt-conv-avatar--official  { background: #1d4ed8; }
.dbt-conv-avatar--meeting   { background: #0f766e; }
.dbt-conv-avatar--video     { background: #dc2626; }
.dbt-conv-avatar--platform  { background: #7c3aed; }
.dbt-conv-avatar--bot       { }
.dbt-conv-avatar--org-logo  { background: #fff; border: 1px solid #e2e8f0; overflow: hidden; }
.dbt-rep-dm-avatar--org-logo { background: #fff; border: 1px solid #e2e8f0; overflow: hidden; }
.dbt-conv-org-img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.dbt-conv-avatar--topic { background: #0f766e; }
.dbt-conv-badge--ai {
    background: rgba(15,118,110,0.12); color: #0f766e;
    font-size: 0.6rem; font-weight: 800; letter-spacing: 0.05em;
    padding: 0.1rem 0.45rem; border-radius: 9999px;
}
.dbt-conv-row--topic { text-decoration: none; display: flex; align-items: center; }
.dbt-conv-row--topic:hover { background: #f8fafc; }
.dbt-conv-row--topic .dbt-conv-name { color: #111827; }
.dbt-conv-row--topic .dbt-conv-chevron { font-size: 0.65rem; color: #94a3b8; }

/* ── Bot intro message area ──────────────────────────────────────── */
.dbt-bot-intro { padding-bottom: 0.25rem; }
.dbt-dm-bubble--bot {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #065f46;
}
.dbt-bot-suggests {
    display: flex; flex-direction: column; gap: 0.4rem;
    padding: 0.5rem 0.75rem 0.5rem 3rem;
}
.dbt-bot-suggest {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.82rem; color: var(--accent, #42c8c1);
    background: rgba(66,200,193,0.08);
    border-radius: 9999px;
    padding: 0.3rem 0.8rem;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s;
}
.dbt-bot-suggest:hover { background: rgba(66,200,193,0.16); }

/* ── My Chats subheads ───────────────────────────────────────────── */
.dbt-my-chats-subhead {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.72rem; font-weight: 600;
    color: #94a3b8;
    padding: 0.55rem 1rem 0.3rem;
    background: transparent;
    letter-spacing: 0.03em;
}
.dbt-my-chats-subhead--first { padding-top: 0.75rem; }
.dbt-my-chats-subhead i { font-size: 0.68rem; }

/* ── Signed-out gate ─────────────────────────────────────────────── */
.dbt-my-chats-gate {
    display: flex; flex-direction: column; align-items: center;
    gap: 0.65rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
}
.dbt-my-chats-gate-icon {
    font-size: 2.25rem;
    color: #cbd5e1;
}
.dbt-my-chats-gate-text {
    font-size: 0.9rem; color: #64748b; line-height: 1.45;
    max-width: 240px;
}
.dbt-my-chats-gate-btn {
    margin-top: 0.25rem;
    padding: 0.55rem 1.4rem;
    background: var(--accent, #42c8c1);
    color: #fff; font-size: 0.875rem; font-weight: 700;
    border: none; border-radius: 9999px; cursor: pointer;
    transition: opacity 0.15s;
}
.dbt-my-chats-gate-btn:hover { opacity: 0.88; }

.dbt-conv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.dbt-conv-row-top { display: flex; align-items: center; gap: 0.4rem; }
.dbt-conv-ts {
    margin-left: auto;
    font-size: 0.68rem;
    color: var(--text-muted, #9ca3af);
    white-space: nowrap;
    font-weight: 400;
    flex-shrink: 0;
}
.dbt-conv-name {
    font-size: 0.925rem; font-weight: 700; color: #111827;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1; min-width: 0;
}
.dbt-conv-sub {
    font-size: 0.78rem; color: #6b7280;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dbt-conv-preview {
    font-size: 0.8rem; color: #9ca3af;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dbt-conv-chevron {
    color: #d1d5db; font-size: 0.75rem; flex-shrink: 0; margin-left: 0.25rem;
}

.dbt-conv-badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem; border-radius: 9999px; white-space: nowrap; flex-shrink: 0;
}
.dbt-conv-badge--live     { background: rgba(66,200,193,0.2); color: var(--blue); }
.dbt-conv-badge--open     { background: rgba(66,200,193,0.15); color: var(--blue); }
.dbt-conv-badge--scheduled { background: rgba(25,30,57,0.08); color: var(--primary); }
.dbt-conv-badge--archived  { background: #f3f4f6; color: #6b7280; }
.dbt-conv-badge--joined    { background: rgba(66,200,193,0.12); color: var(--blue); }
.dbt-conv-sub--activity    { color: #9ca3af; font-size: 0.74rem; }

/* ── Rep session DM header ───────────────────────────────────────── */
.dbt-rep-dm-header {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff; border-bottom: 1px solid #e5e7eb;
}
.dbt-rep-dm-avatar {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: #fff;
}
.dbt-rep-dm-info { flex: 1; min-width: 0; }
.dbt-rep-dm-name  { font-size: 0.95rem; font-weight: 700; color: #111827; }
.dbt-rep-dm-title { font-size: 0.78rem; color: #6b7280; }

/* ── Rep session info block inside DM view ───────────────────────── */
.dbt-rep-session-info {
    margin: 0.75rem;
    background: #eff6ff;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex; flex-direction: column; gap: 0.35rem;
}
.dbt-rep-session-info-row { font-size: 0.825rem; color: #1d4ed8; display: flex; align-items: center; gap: 0.45rem; }
.dbt-rep-session-info-row i { width: 14px; text-align: center; }
.dbt-rep-session-info-note {
    margin-top: 0.35rem; font-size: 0.78rem; color: #374151;
    border-top: 1px solid #bfdbfe; padding-top: 0.35rem;
}
.dbt-rep-session-empty {
    margin: 0.75rem; padding: 0.75rem 1rem;
    background: #f8fafc; border-radius: 10px;
    font-size: 0.825rem; color: #6b7280;
    display: flex; align-items: flex-start; gap: 0.5rem;
}
.dbt-rep-session-empty i { color: #2563eb; margin-top: 0.1rem; flex-shrink: 0; }

/* ── Meeting position panel ──────────────────────────────────────── */
.dbt-position-panel {
    margin: 0 0.75rem 0.75rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 14px 16px;
}
.dbt-position-header { margin-bottom: 10px; }
.dbt-position-title {
    font-size: 13px; font-weight: 700; color: #1d4ed8;
    display: flex; align-items: center; gap: 6px;
}
.dbt-position-sub { font-size: 11.5px; color: #374151; margin-top: 2px; display: block; }
.dbt-stance-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.dbt-stance-btn {
    padding: 6px 14px; border-radius: 99px; border: 1.5px solid #d1d5db;
    background: white; font-size: 12.5px; font-weight: 600; cursor: pointer;
    color: #374151; transition: all .15s;
}
.dbt-stance-btn:hover { border-color: #1d4ed8; color: #1d4ed8; }
.dbt-stance-btn[data-stance="support"].active { background: #dcfce7; border-color: #16a34a; color: #16a34a; }
.dbt-stance-btn[data-stance="oppose"].active  { background: #fee2e2; border-color: #dc2626; color: #dc2626; }
.dbt-stance-btn[data-stance="neutral"].active { background: #f3f4f6; border-color: #6b7280; color: #374151; }
.dbt-position-submit-btn {
    padding: 7px 18px; border-radius: 8px; border: none;
    background: #1d4ed8; color: white; font-size: 13px; font-weight: 600; cursor: pointer;
    flex-shrink: 0;
}
.dbt-position-submit-btn:disabled { opacity: 0.65; cursor: default; }
.dbt-position-submitted {
    margin: 0 0.75rem 0.75rem;
    background: #dcfce7; border: 1px solid #86efac; border-radius: 12px;
    padding: 12px 16px; font-size: 13px; color: #15803d;
    display: flex; align-items: center; gap: 8px;
}
.dbt-position-submitted i { font-size: 15px; flex-shrink: 0; }

/* ── Board Decision record ───────────────────────────────────────── */
.dbt-decision-record {
    margin: 0 0.75rem 0.75rem;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 14px 16px;
}
.dbt-decision-record-title {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: #92400e; margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}
.dbt-decision-item { margin-bottom: 10px; }
.dbt-decision-item:last-child { margin-bottom: 0; }
.dbt-decision-outcome {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px;
}
.dbt-decision-badge {
    font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
    text-transform: uppercase;
}
.dbt-decision-passed    { background: #dcfce7; color: #16a34a; }
.dbt-decision-failed    { background: #fee2e2; color: #dc2626; }
.dbt-decision-tabled    { background: #fef9c3; color: #854d0e; }
.dbt-decision-withdrawn { background: #f3f4f6; color: #6b7280; }
.dbt-decision-item-title { font-size: 13px; font-weight: 600; color: #111827; flex: 1; }
.dbt-decision-date { font-size: 11px; color: #6b7280; }
.dbt-decision-rationale {
    margin: 0; padding: 8px 12px;
    background: white; border-left: 3px solid #f59e0b;
    border-radius: 0 8px 8px 0;
    font-size: 13px; color: #374151; line-height: 1.6; font-style: italic;
}

/* ── Mobile: DM bubbles use full available width ─────────────── */
@media (max-width: 480px) {
    .dbt-dm-row         { max-width: 92%; }
    .dbt-dm-row.dbt-dm--mine { max-width: 88%; }
    .dbt-dm-view .dbt-messages { padding: 0.5rem; }
}

.dbt-decision-author { font-size: 11px; color: #6b7280; margin-top: 4px; }

/* ── Meeting Prep View ───────────────────────────────────────── */
.dbt-mtg-info-card {
    background: white;
    border: 1px solid var(--border, rgba(25,30,57,0.12));
    border-radius: 10px;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
}
.dbt-mtg-info-row {
    font-size: 0.82rem;
    color: #475569;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    line-height: 1.4;
}
.dbt-mtg-info-row:last-child { margin-bottom: 0; }
.dbt-mtg-info-row i { margin-top: 0.15rem; flex-shrink: 0; color: #94a3b8; }

.dbt-mtg-section {
    margin-bottom: 1.25rem;
}
.dbt-mtg-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #94a3b8;
    margin-bottom: 0.6rem;
}
.dbt-mtg-notes-hint { font-weight: 400; text-transform: none; letter-spacing: 0; }

.dbt-mtg-agenda {
    margin: 0;
    padding-left: 1.1rem;
    list-style: disc;
}
.dbt-mtg-agenda li {
    font-size: 0.875rem;
    color: #1e293b;
    line-height: 1.5;
    margin-bottom: 0.35rem;
}
.dbt-mtg-agenda li:last-child { margin-bottom: 0; }

.dbt-mtg-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.dbt-mtg-topic-pill {
    background: rgba(66, 200, 193, 0.12);
    color: #0f766e;
    border: 1px solid rgba(66, 200, 193, 0.3);
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: inherit;
    transition: background 0.15s;
}
.dbt-mtg-topic-pill:hover { background: rgba(66, 200, 193, 0.22); }

.dbt-mtg-notes-empty {
    font-size: 0.82rem;
    color: #94a3b8;
    font-style: italic;
    padding: 0.25rem 0;
}

.dbt-mtg-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}
.dbt-mtg-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    background: var(--accent, #42c8c1);
    color: white;
    border: none;
    transition: opacity 0.15s;
}
.dbt-mtg-action-btn:hover { opacity: 0.88; }
.dbt-mtg-action-btn--secondary {
    background: none;
    color: var(--accent, #42c8c1);
    border: 1.5px solid var(--accent, #42c8c1);
}

/* ── Chat list tab nav ───────────────────────────────────────────────── */
.dbt-list-tab-nav {
    display: flex;
    gap: 0;
    align-items: center;
    background: var(--card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 3px;
    margin: 0.75rem 0 0.75rem;
    flex-shrink: 0;
}
.dbt-list-tab {
    flex: 1;
    border: none;
    background: none;
    padding: 0.45rem 0.4rem;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted, #9ca3af);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1;
}
.dbt-list-tab.active {
    background: var(--primary, #1d3a6b);
    color: #fff;
}
.dbt-list-tab:not(.active):hover { color: var(--text); }
/* ── Floating Action Button ─────────────────────────────────────────────── */
.dbt-fab {
    position: fixed;
    bottom: 5.5rem;
    right: 1.25rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--primary, #1d3a6b);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(29,58,107,0.35);
    transition: background 0.15s, transform 0.1s;
    z-index: 100;
}
.dbt-fab:hover { background: #15306a; transform: scale(1.05); }

/* ── Chats tab empty-state CTA ──────────────────────────────────────────── */
.dbt-chats-cta {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--muted, #9ca3af);
}
.dbt-chats-cta p {
    font-size: 0.875rem;
    margin: 0 0 0.75rem;
}
.dbt-chats-cta-btn {
    background: var(--primary, #1d4ed8);
    color: white;
    border: none;
    border-radius: 9px;
    padding: 0.5rem 1.1rem;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: opacity 0.15s;
}
.dbt-chats-cta-btn:hover { opacity: 0.88; }

/* ── Community avatar ────────────────────────────────────────────────────── */
.dbt-conv-avatar--community {
    background: rgba(66,200,193,0.18);
    color: var(--blue, #1a7a76);
}

/* ── Public tab toolbar (New Discussion button) ─────────────────────────── */
.dbt-public-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0 0.25rem;
}

.dbt-new-disc-btn {
    background: var(--accent, #42C8C1);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: opacity 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.dbt-new-disc-btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.dbt-new-disc-btn:active { transform: translateY(0); }
.dbt-new-disc-btn--guest {
    background: var(--primary, #191E39);
    opacity: 0.7;
}

/* ── New Discussion modal form ───────────────────────────────────────────── */
.dbt-newdisc-card {
    max-width: 440px;
}

/* ── New private discussion type picker ─────────────────────── */
.dbt-disc-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.dbt-disc-type-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 12px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.14s, background 0.14s;
    font-family: inherit;
}
.dbt-disc-type-tile:hover:not(:disabled) {
    border-color: var(--accent, #42C8C1);
    background: #fff;
}
.dbt-disc-type-tile--soon { opacity: 0.55; cursor: default; }
.dbt-disc-type-icon { font-size: 1.3rem; margin-bottom: 2px; }
.dbt-disc-type-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.dbt-disc-type-sub {
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.3;
}
.dbt-soon-badge {
    font-size: 0.62rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #64748b;
    padding: 1px 5px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── User search results ────────────────────────────────────── */
.dbt-user-results {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
    max-height: 200px;
    overflow-y: auto;
}
.dbt-user-searching {
    font-size: 0.8rem;
    color: #64748b;
    padding: 6px 2px;
}
.dbt-user-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.12s, border-color 0.12s;
    width: 100%;
}
.dbt-user-result:hover:not(:disabled) { background: #fff; border-color: var(--accent); }
.dbt-user-result-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.85rem;
    flex-shrink: 0;
}
.dbt-user-result-name  { font-size: 0.85rem; font-weight: 700; color: #0f172a; flex: 1; }
.dbt-user-result-username { font-size: 0.75rem; color: #64748b; }

/* ── Invite chips (group members) ───────────────────────────── */
.dbt-invite-chips {
    display: flex; flex-wrap: wrap; gap: 5px;
    min-height: 0;
}
.dbt-invite-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: #e0f2fe; color: #0369a1;
    border-radius: 99px; padding: 3px 8px 3px 10px;
    font-size: 0.78rem; font-weight: 600;
}
.dbt-invite-chip button {
    background: none; border: none; cursor: pointer;
    color: #0369a1; font-size: 0.9rem; line-height: 1;
    padding: 0 2px; opacity: 0.7;
}
.dbt-invite-chip button:hover { opacity: 1; }

/* ── DM / Group thread rows ─────────────────────────────────── */
.dbt-conv-badge--dm    { background: rgba(37,99,235,0.1); color: #2563eb; }
.dbt-conv-badge--group { background: rgba(8,145,178,0.1); color: #0891b2; }

.dbt-newdisc-form {
    display: flex;
    flex-direction: column;
}

.dbt-newdisc-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.3rem;
    display: block;
}

.dbt-newdisc-input,
.dbt-newdisc-textarea {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: #0f172a;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.dbt-newdisc-input:focus,
.dbt-newdisc-textarea:focus {
    border-color: var(--accent, #42C8C1);
    background: white;
}
.dbt-newdisc-textarea {
    resize: vertical;
    min-height: 64px;
}

.dbt-newdisc-error {
    background: #fee2e2;
    color: #991b1b;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

/* ── Community badge ─────────────────────────────────────────────────────── */
.dbt-conv-badge--community {
    background: rgba(66,200,193,0.15);
    color: var(--accent, #0ea5e9);
}

/* ── Desktop chat: revert to max-height, sticky compose, no body lock ─────── */
@media (min-width: 641px) {
    body.dbt-in-chat { overflow: auto; }

    #dbtChatView.dbt-dm-view {
        position: static;
        display: block;
        height: auto !important;
        overflow: visible;
    }

    .dbt-dm-view #dbtChatPanel {
        display: block;
        flex: none;
        min-height: 0;
        padding-bottom: 0 !important;
        overflow: visible;
    }

    .dbt-dm-view .dbt-messages {
        display: block;
        flex: none;
        min-height: 120px;
        max-height: calc(100vh - 280px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 0.5rem;
    }

    .dbt-dm-view .dbt-compose {
        position: sticky !important;
        bottom: 0;
        border-radius: 0 0 14px 14px;
        border: 1.5px solid #e2e8f0;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -4px 24px rgba(15,23,42,0.1);
        margin-top: 0;
    }
}

/* ── Markdown prose inside bot / AI bubbles ─────────────────────────────── */
.dbt-md-content { font-size: 0.9rem; line-height: 1.65; }

.dbt-md-content p { margin: 0 0 0.6em; }
.dbt-md-content p:last-child { margin-bottom: 0; }

.dbt-md-content h2.dbt-md-h,
.dbt-md-content h3.dbt-md-h,
.dbt-md-content h4.dbt-md-h,
.dbt-md-content h5.dbt-md-h {
    margin: 0.75em 0 0.3em;
    font-weight: 700;
    line-height: 1.3;
    color: inherit;
}
.dbt-md-content h2.dbt-md-h { font-size: 1.05em; }
.dbt-md-content h3.dbt-md-h { font-size: 0.97em; }
.dbt-md-content h4.dbt-md-h,
.dbt-md-content h5.dbt-md-h { font-size: 0.92em; text-transform: uppercase; letter-spacing: 0.04em; }

.dbt-md-content ul.dbt-md-ul,
.dbt-md-content ol.dbt-md-ol {
    margin: 0.4em 0 0.6em;
    padding-left: 1.4em;
}
.dbt-md-content li { margin-bottom: 0.2em; }

.dbt-md-content code.dbt-md-code {
    background: rgba(15,23,42,0.07);
    border-radius: 4px;
    padding: 0.1em 0.35em;
    font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.85em;
    word-break: break-all;
}

.dbt-dm-bubble--bot .dbt-md-content code.dbt-md-code,
.dbt-md-content pre.dbt-md-pre code {
    background: rgba(0,0,0,0.08);
}

.dbt-md-content pre.dbt-md-pre {
    background: rgba(15,23,42,0.06);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    margin: 0.5em 0;
    font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.82em;
    line-height: 1.55;
    white-space: pre;
}

.dbt-md-content hr.dbt-md-hr {
    border: none;
    border-top: 1px solid rgba(15,23,42,0.15);
    margin: 0.75em 0;
}

.dbt-md-content a {
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
}

/* AI bubble gets a slightly different bg to distinguish from user notes */
.dbt-dm-bubble--bot.dbt-md-content {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #bae6fd;
    color: #0c4a6e;
    max-width: 90%;
}

/* ── DebataBot thinking dots ──────────────────────────────────────── */
.dbt-ai-thinking {
    display: flex; align-items: center; gap: 5px;
    padding: 10px 14px;
}
.dbt-ai-thinking span {
    display: inline-block;
    width: 7px; height: 7px; border-radius: 50%;
    background: #0d9488;
    animation: dbt-ai-bounce 1.2s infinite ease-in-out both;
}
.dbt-ai-thinking span:nth-child(2) { animation-delay: .2s; }
.dbt-ai-thinking span:nth-child(3) { animation-delay: .4s; }
@keyframes dbt-ai-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: .5; }
    40%            { transform: scale(1);   opacity: 1;  }
}

/* Model tag below AI answer bubble */
.dbt-ai-model-tag {
    font-size: 0.68rem; color: #94a3b8;
    margin-top: 3px; padding-left: 2px;
}

/* ── Skeleton loading rows ──────────────────────────────────────────────── */
@keyframes dbt-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.dbt-skel-list {
    background: var(--card, #fff);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}
.dbt-skel-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(25,30,57,0.06);
}
.dbt-skel-row:last-child { border-bottom: none; }
.dbt-skel-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 800px 100%;
    animation: dbt-shimmer 1.4s infinite linear;
}
.dbt-skel-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.dbt-skel-line {
    border-radius: 4px;
    height: 11px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 800px 100%;
    animation: dbt-shimmer 1.4s infinite linear;
}
.dbt-skel-name { width: 55%; }
.dbt-skel-sub  { width: 80%; opacity: 0.6; }
