/**
 * Hearth — центр коммуникаций.
 *
 * Дизайн-философия:
 *   • Карточки разного размера по важности (L/M/S) — глаз сразу видит что важно.
 *   • Calm-tech: spacing щедрый, тени мягкие, никаких агрессивных красных всполохов.
 *   • Glassmorphism subtle (backdrop-filter blur где можно).
 *   • Acent-цвет — для активного фильтра, важных событий, mood-broadcast (V2).
 *   • Цветовые акценты по filter-tone (now/pulse/people/decisions).
 */

/* ── Root ────────────────────────────────────────────────────────────── */
.hearth-root {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 0;
    gap: 0;
    color: var(--text, #e5e7eb);
    overflow: hidden;
}

/* ── Headline (AI-style сводка) ─────────────────────────────────────── */
.hearth-headline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(180deg,
        rgba(var(--accent-rgb), 0.05) 0%,
        rgba(var(--accent-rgb), 0.02) 100%);
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
    transition: background 0.3s;
}
.hearth-headline.is-active {
    background: linear-gradient(180deg,
        rgba(var(--accent-rgb), 0.12) 0%,
        rgba(var(--accent-rgb), 0.04) 100%);
}
.hearth-headline.is-quiet {
    background: linear-gradient(180deg,
        rgba(127, 127, 127, 0.04) 0%,
        rgba(127, 127, 127, 0.01) 100%);
}
/* Karma-meter — donut + легенда. */
.hearth-karma {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.hearth-karma__svg {
    flex-shrink: 0;
    display: block;
    overflow: visible;
}
.hearth-karma__seg {
    transition: stroke-width 0.2s ease, opacity 0.2s ease;
    cursor: help;
}
.hearth-karma__seg:hover {
    stroke-width: 9;
    opacity: 1;
}
.hearth-karma__center {
    font-size: 13px;
    font-weight: 700;
    fill: var(--text, #f3f4f6);
    font-family: ui-sans-serif, system-ui, sans-serif;
}
.hearth-karma__legend {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
    line-height: 1.3;
    color: var(--text-muted, #9ca3af);
    min-width: 0;
}
.hearth-karma__legend-row {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.hearth-karma__legend-row.is-empty .hearth-karma__legend-label {
    font-style: italic;
}
.hearth-karma__dot {
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.hearth-karma__legend-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-muted, #9ca3af);
}
.hearth-karma__legend-val {
    font-weight: 700;
    color: var(--text, #e5e7eb);
    font-variant-numeric: tabular-nums;
}
.hearth-headline__text {
    flex: 1;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text, #e5e7eb);
    padding-top: 4px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* M9: кнопка «Скопировать дайджест внимания» */
.hearth-digest-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    background: none;
    border-radius: 6px;
    color: var(--ui-text-muted, rgba(255, 255, 255, 0.55));
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.hearth-digest-btn:hover {
    background: var(--ui-hover, rgba(255, 255, 255, 0.08));
    color: var(--ui-text, rgba(255, 255, 255, 0.9));
}
.hearth-digest-btn.is-ok { color: #10b981; }
.hearth-digest-btn.is-err { color: #ef4444; }
.hearth-digest-btn i,
.hearth-digest-btn svg { width: 15px; height: 15px; }

/* ── Filter pills ────────────────────────────────────────────────────── */
.hearth-pills {
    display: flex;
    gap: 6px;
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
    overflow-x: auto;
    scrollbar-width: none;
}
.hearth-pills::-webkit-scrollbar { display: none; }

.hearth-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    background: transparent;
    border-radius: 999px;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
}
.hearth-pill i { width: 13px; height: 13px; opacity: 0.85; }
.hearth-pill:hover {
    border-color: var(--border-strong, rgba(255,255,255,0.16));
    color: var(--text, #f3f4f6);
    transform: translateY(-1px);
}
.hearth-pill.is-active {
    color: var(--accent-contrast, #0a0a0a);
    background: var(--accent, hsl(73, 70%, 45%));
    border-color: var(--accent, hsl(73, 70%, 45%));
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.35);
}
.hearth-pill.is-active i { opacity: 1; }
.hearth-pill.is-v2 { opacity: 0.5; }
.hearth-pill.is-v2.is-active { opacity: 1; }

.hearth-pill__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: rgba(255,255,255,0.15);
    color: inherit;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}
.hearth-pill.is-active .hearth-pill__count {
    background: rgba(0, 0, 0, 0.25);
    color: var(--accent-contrast, #0a0a0a);
}
.hearth-pill--now:not(.is-active) .hearth-pill__count {
    background: #ef4444;
    color: #fff;
}

/* Красная точка-индикатор непрочитанного на pill'е (когда она не активна). */
.hearth-pill { position: relative; }
.hearth-pill__dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    pointer-events: none;
    box-shadow: 0 0 0 2px var(--bg, #0f1115);
    animation: hearth-pill-dot-pulse 1.6s ease-in-out infinite;
}
@keyframes hearth-pill-dot-pulse {
    0%, 100% { box-shadow: 0 0 0 2px var(--bg, #0f1115), 0 0 0 0 rgba(239,68,68,0.55); }
    60%      { box-shadow: 0 0 0 2px var(--bg, #0f1115), 0 0 0 4px rgba(239,68,68,0); }
}
@media (prefers-reduced-motion: reduce) { .hearth-pill__dot { animation: none; } }
html.light .hearth-pill__dot { box-shadow: 0 0 0 2px #ffffff; }

/* ── Stream container ────────────────────────────────────────────────── */
.hearth-stream {
    flex: 1;
    overflow-y: auto;
    padding: 8px 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

.hearth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    color: var(--text-muted, #9ca3af);
}
.hearth-loading i { width: 24px; height: 24px; }
.hearth-spin {
    animation: hearth-spin 1s linear infinite;
}
@keyframes hearth-spin {
    to { transform: rotate(360deg); }
}

.hearth-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted, #9ca3af);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.hearth-empty__icon {
    width: 40px;
    height: 40px;
    color: rgba(var(--accent-rgb), 0.5);
    margin-bottom: 8px;
}
.hearth-empty__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text, #e5e7eb);
}
.hearth-empty__sub {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    max-width: 240px;
    line-height: 1.4;
}

/* ── Card ───────────────────────────────────────────────────────────── */
.hearth-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border, rgba(255,255,255,0.06));
    background: rgba(127,127,127,0.04);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    flex-shrink: 0;
}
.hearth-card:hover {
    background: rgba(127,127,127,0.10);
    border-color: var(--border-strong, rgba(255,255,255,0.14));
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

/* L — большая карточка для непрочитанного (важное) */
.hearth-card.is-l {
    background: linear-gradient(135deg,
        rgba(var(--accent-rgb), 0.08) 0%,
        rgba(var(--accent-rgb), 0.02) 100%);
    border-color: rgba(var(--accent-rgb), 0.25);
}
.hearth-card.is-l:hover {
    background: linear-gradient(135deg,
        rgba(var(--accent-rgb), 0.14) 0%,
        rgba(var(--accent-rgb), 0.05) 100%);
    border-color: rgba(var(--accent-rgb), 0.45);
    box-shadow: 0 6px 24px rgba(var(--accent-rgb), 0.15);
}
.hearth-card.is-l .hearth-card__thumb {
    width: 64px;
    height: 64px;
}
.hearth-card.is-l .hearth-card__preview {
    -webkit-line-clamp: 3;
            line-clamp: 3;
    font-size: 13px;
}

/* S — компактная карточка для прочитанного (тихий поток) */
.hearth-card.is-s {
    padding: 8px 10px;
    opacity: 0.82;
}
.hearth-card.is-s:hover { opacity: 1; }
.hearth-card.is-s .hearth-card__thumb {
    width: 36px;
    height: 36px;
}
.hearth-card.is-s .hearth-card__preview {
    -webkit-line-clamp: 1;
            line-clamp: 1;
    font-size: 11px;
    opacity: 0.85;
}

/* Thumb (превью сабъекта) */
.hearth-card__thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: rgba(127,127,127,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #9ca3af);
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.2);
}
.hearth-card__thumb--placeholder i { width: 18px; height: 18px; }

/* Main column */
.hearth-card__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}
.hearth-card__row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.hearth-card__avatar {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent, hsl(73, 70%, 35%));
    color: var(--accent-contrast, #0a0a0a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}
.hearth-card__author {
    font-size: 12px;
    font-weight: 600;
    color: var(--text, #f3f4f6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}
.hearth-card__subj {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(127,127,127,0.15);
    color: var(--text-muted, #9ca3af);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}
.hearth-card.is-l .hearth-card__subj {
    background: rgba(var(--accent-rgb), 0.18);
    color: var(--accent, hsl(73, 70%, 55%));
}
.hearth-card__subj-icon { width: 10px; height: 10px; }

/* M6: reason-бейдж — почему карточка здесь. */
.hearth-card__reason {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(127,127,127,0.12);
    color: var(--text-muted, #9ca3af);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.hearth-card__reason i { width: 10px; height: 10px; }
.hearth-card.is-s .hearth-card__reason-label { display: none; }
.hearth-card__reason--mention {
    background: rgba(var(--accent-rgb), 0.18);
    color: var(--accent, hsl(73, 70%, 55%));
}
.hearth-card__reason--dm { background: rgba(59,130,246,0.16); color: #60a5fa; }
.hearth-card__reason--assistant_result { background: rgba(168,85,247,0.16); color: #c084fc; }
.hearth-card__reason--decision_review { background: rgba(234,179,8,0.16); color: #eab308; }
html.light .hearth-card__reason { background: rgba(0,0,0,0.05); color: #6b7280; }

.hearth-card__time {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-muted, #6b7280);
    flex-shrink: 0;
    white-space: nowrap;
}
.hearth-card__preview {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
            line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}
.hearth-card.is-l .hearth-card__preview {
    color: var(--text, #e5e7eb);
}

/* Unread bubble */
.hearth-card__unread {
    align-self: flex-start;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 11px;
    background: var(--accent, hsl(73, 70%, 45%));
    color: var(--accent-contrast, #0a0a0a);
    font-size: 11px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.4);
}

/* Inline actions (Open / Mark read) */
.hearth-card__actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 6px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed rgba(var(--accent-rgb), 0.15);
    justify-content: flex-end;
}
.hearth-card.is-s .hearth-card__actions { display: none; }

.hearth-card__act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    transition: all 0.15s;
}
.hearth-card__act:hover {
    background: rgba(var(--accent-rgb), 0.15);
    border-color: rgba(var(--accent-rgb), 0.4);
    color: var(--accent, hsl(73, 70%, 55%));
}
.hearth-card__act i { width: 14px; height: 14px; }

/* ── Light theme ─────────────────────────────────────────────────────── */
html.light .hearth-root { color: #111827; }
html.light .hearth-headline { border-bottom-color: rgba(0,0,0,0.06); }
html.light .hearth-headline__text { color: #111827; }
html.light .hearth-karma__center { fill: #111827; }
html.light .hearth-karma__legend-label { color: #6b7280; }
html.light .hearth-karma__legend-val { color: #111827; }
html.light .hearth-pills { border-bottom-color: rgba(0,0,0,0.06); }
html.light .hearth-pill {
    border-color: rgba(0,0,0,0.1);
    color: #6b7280;
}
html.light .hearth-pill:hover { color: #111827; border-color: rgba(0,0,0,0.2); }
html.light .hearth-pill__count { background: rgba(0,0,0,0.08); }

html.light .hearth-card {
    background: #ffffff;
    border-color: rgba(0,0,0,0.08);
}
html.light .hearth-card:hover {
    background: rgba(0,0,0,0.02);
    border-color: rgba(0,0,0,0.16);
}
html.light .hearth-card__author { color: #111827; }
html.light .hearth-card__subj { background: rgba(0,0,0,0.06); color: #6b7280; }
html.light .hearth-card__preview { color: #4b5563; }
html.light .hearth-card.is-l .hearth-card__preview { color: #111827; }
html.light .hearth-empty__title { color: #111827; }
html.light .hearth-empty__sub { color: #6b7280; }
html.light .hearth-card__act { border-color: rgba(0,0,0,0.1); color: #6b7280; }

/* ── People V1: header + DM card + empty CTA + picker + drawer ────────── */
.hearth-people-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
    margin-bottom: 4px;
}
.hearth-people-header__title {
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.hearth-people-header__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(var(--accent-rgb), 0.15);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    color: var(--accent, hsl(73, 70%, 55%));
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.hearth-people-header__cta:hover {
    background: rgba(var(--accent-rgb), 0.25);
    border-color: rgba(var(--accent-rgb), 0.5);
}
.hearth-people-header__cta i { width: 13px; height: 13px; }

.hearth-empty__cta {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(var(--accent-rgb), 0.15);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    color: var(--accent, hsl(73, 70%, 55%));
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.hearth-empty__cta:hover { background: rgba(var(--accent-rgb), 0.25); }
.hearth-empty__cta i { width: 14px; height: 14px; }

.hearth-card--dm {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}
.hearth-card--dm .hearth-card__main { flex: 1; min-width: 0; }
.hearth-card__avatar--dm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}
.hearth-card__avatar--dm img,
.hearth-dm-drawer__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
.hearth-card__placeholder {
    color: var(--text-muted, rgba(255,255,255,0.4));
    font-style: italic;
}

/* ── User picker modal ─────────────────────────────────────────────── */
.hearth-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: hearth-fade-in 0.15s ease;
}
@keyframes hearth-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.hearth-picker {
    width: min(440px, 92vw);
    max-height: 80vh;
    background: var(--bg, #1f2937);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.hearth-picker__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
}
.hearth-picker__header-icon { width: 18px; height: 18px; color: var(--accent, hsl(73,70%,55%)); }
.hearth-picker__title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #e5e7eb);
}
.hearth-picker__close {
    background: transparent;
    border: 0;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}
.hearth-picker__close:hover { color: var(--text, #e5e7eb); background: rgba(255,255,255,0.05); }
.hearth-picker__close i { width: 16px; height: 16px; }
.hearth-picker__search {
    position: relative;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
}
.hearth-picker__search-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-muted, #9ca3af);
}
.hearth-picker__input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 8px;
    padding: 8px 10px 8px 32px;
    color: var(--text, #e5e7eb);
    font-size: 13px;
    outline: none;
}
.hearth-picker__input:focus { border-color: rgba(var(--accent-rgb), 0.5); }
.hearth-picker__list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 6px 10px;
}
.hearth-picker__loading,
.hearth-picker__empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted, #9ca3af);
    font-size: 13px;
}
.hearth-picker__row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text, #e5e7eb);
    text-align: left;
    transition: background 0.12s;
}
.hearth-picker__row:hover { background: rgba(255,255,255,0.05); }
.hearth-picker__row.is-loading { opacity: 0.5; pointer-events: none; }
.hearth-picker__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.hearth-picker__row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.hearth-picker__row-login {
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #e5e7eb);
}
.hearth-picker__row-name {
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hearth-picker__badge {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(var(--accent-rgb), 0.18);
    color: var(--accent, hsl(73,70%,55%));
    font-weight: 700;
}

/* ── DM drawer ─────────────────────────────────────────────────────── */
.hearth-dm-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--hearth-dm-width, 340px);
    max-width: 100%;
    background: var(--bg, #1f2937);
    border-left: 1px solid var(--border, rgba(255,255,255,0.08));
    box-shadow: -16px 0 40px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    z-index: 5;
    animation: hearth-drawer-slide 0.2s ease;
}
.hearth-dm-drawer__resizer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -3px;
    width: 6px;
    cursor: ew-resize;
    z-index: 6;
}
.hearth-dm-drawer__resizer:hover,
.hearth-dm-drawer__resizer.is-dragging {
    background: linear-gradient(90deg, transparent, var(--accent, hsl(73, 70%, 45%)) 50%, transparent);
}
body.hearth-dm-drawer-resizing {
    cursor: ew-resize !important;
    user-select: none !important;
}
@keyframes hearth-drawer-slide {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
.hearth-dm-drawer__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
    flex-shrink: 0;
}
.hearth-dm-drawer__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}
.hearth-dm-drawer__title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #e5e7eb);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hearth-dm-drawer__notify {
    background: transparent;
    border: 0;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.hearth-dm-drawer__notify:hover {
    color: var(--text, #e5e7eb);
    background: rgba(255,255,255,0.05);
}
.hearth-dm-drawer__notify.is-mentions { color: var(--accent, #d4ff26); }
.hearth-dm-drawer__notify.is-muted    { color: #f59e0b; }
.hearth-dm-drawer__notify i { width: 16px; height: 16px; }

/* Слайдер плотности сообщений в шапке DM-drawer'а. */
.hearth-dm-drawer__density {
    -webkit-appearance: none;
    appearance: none;
    width: 70px;
    height: 14px;
    margin: 0 4px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
}
.hearth-dm-drawer__density::-webkit-slider-runnable-track {
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.12);
}
.hearth-dm-drawer__density::-moz-range-track {
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.12);
}
.hearth-dm-drawer__density::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent, #d4ff26);
    border: 0;
    margin-top: -3.5px;
    cursor: pointer;
    transition: transform 0.15s;
}
.hearth-dm-drawer__density::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent, #d4ff26);
    border: 0;
    cursor: pointer;
}
.hearth-dm-drawer__density:hover::-webkit-slider-thumb { transform: scale(1.2); }
html.light .hearth-dm-drawer__density::-webkit-slider-runnable-track,
html.light .hearth-dm-drawer__density::-moz-range-track {
    background: rgba(0,0,0,0.12);
}

.hearth-dm-drawer__close {
    background: transparent;
    border: 0;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}
.hearth-dm-drawer__close:hover { color: var(--text, #e5e7eb); background: rgba(255,255,255,0.05); }
.hearth-dm-drawer__close i { width: 16px; height: 16px; }
.hearth-dm-drawer__body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.hearth-dm-drawer__body .comments-thread {
    flex: 1;
    min-height: 0;
    background: transparent;
}
/* Внутри DM-drawer своя шапка — скрываем шапку CommentsThread. */
.hearth-dm-drawer__body .comments-thread__header { display: none; }
.hearth-dm-drawer__error {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted, #9ca3af);
    font-size: 13px;
}

/* Light-theme overrides */
html.light .hearth-picker {
    background: #fff;
    border-color: rgba(0,0,0,0.1);
}
html.light .hearth-picker__title,
html.light .hearth-picker__row-login { color: #111827; }
html.light .hearth-picker__input {
    background: #f9fafb;
    border-color: rgba(0,0,0,0.1);
    color: #111827;
}
html.light .hearth-picker__row:hover { background: rgba(0,0,0,0.04); }
html.light .hearth-dm-drawer {
    background: #fff;
    border-left-color: rgba(0,0,0,0.1);
}
html.light .hearth-dm-drawer__title { color: #111827; }
html.light .hearth-people-header__title { color: #6b7280; }

/* ── People M6: групповые чаты ─────────────────────────────────────── */
.hearth-card--group .hearth-card__main { flex: 1; min-width: 0; }
.hearth-card__avatar--group {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}
.hearth-card__avatar--group i { width: 18px; height: 18px; }
.hearth-card__meta {
    font-size: 11px;
    color: var(--text-muted, rgba(255,255,255,0.4));
    margin-top: 2px;
}
.hearth-dm-drawer__avatar--group {
    border-radius: 10px !important;
}
.hearth-dm-drawer__avatar--group i { width: 18px; height: 18px; }

/* Поповер управления участниками группы */
.hearth-group-members-popover {
    z-index: 10000;
    min-width: 220px;
    max-width: 300px;
    background: var(--panel-bg, #1f2430);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
    padding: 8px;
    color: var(--text, #e5e7eb);
}
.hearth-group-members-popover .hgm-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, rgba(255,255,255,0.45));
    padding: 4px 6px 8px;
}
.hearth-group-members-popover .hgm-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 240px;
    overflow-y: auto;
}
.hearth-group-members-popover .hgm-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    border-radius: 8px;
}
.hearth-group-members-popover .hgm-row:hover { background: rgba(255,255,255,0.05); }
.hearth-group-members-popover .hgm-login { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hearth-group-members-popover .hgm-role {
    font-size: 10px;
    color: rgba(var(--accent-rgb), 0.9);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.hearth-group-members-popover .hgm-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border: none; background: none; cursor: pointer;
    color: var(--text-muted, rgba(255,255,255,0.4));
    border-radius: 6px;
}
.hearth-group-members-popover .hgm-remove:hover { background: rgba(239,68,68,0.18); color: #ef4444; }
.hearth-group-members-popover .hgm-remove i { width: 14px; height: 14px; }
.hearth-group-members-popover .hgm-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
    padding-top: 8px;
}
.hearth-group-members-popover .hgm-add,
.hearth-group-members-popover .hgm-leave {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    padding: 7px 8px;
    border-radius: 8px;
    border: 1px solid var(--border, rgba(255,255,255,0.12));
    background: rgba(255,255,255,0.04);
    color: var(--text, #e5e7eb);
    cursor: pointer;
}
.hearth-group-members-popover .hgm-add:hover { background: rgba(var(--accent-rgb), 0.2); }
.hearth-group-members-popover .hgm-leave:hover { background: rgba(239,68,68,0.18); color: #ef4444; }
.hearth-group-members-popover .hgm-add i,
.hearth-group-members-popover .hgm-leave i { width: 14px; height: 14px; }

html.light .hearth-group-members-popover { background: #fff; color: #111827; }

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .hearth-pill, .hearth-card { transition: none; }
    .hearth-spin { animation: none; }
}
