/* ═══════════════════════════════════════════════════════════════════════
   NOCTURNE — тема оформления Coffevarka (десктоп-веб).
   Накладывается ПОВЕРХ style.css. Переопределяет токены и доводит компоненты
   под макет «Coffevarka Web». Тёмная, компактная, акцент-blurple.
   ═══════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── Токены (единые для любой темы: Nocturne — dark-only) ─── */
:root,
[data-theme="dark"],
[data-theme="light"] {
    --bg-primary:        #161826;   /* основные панели */
    --bg-secondary:      #101120;   /* рейл / глубокая колонка */
    --bg-tertiary:       #232532;   /* surface: карточки, инпуты */
    --bg-message-own:    #423a6a;   /* accent-800 */
    --bg-message-other:  #292b31;   /* neutral-900 */
    --bg-input:          #232532;
    --bg-hover:          rgba(233, 233, 237, 0.05);
    --bg-card:           #232532;

    --text-primary:      #e9e9ed;
    --text-secondary:    #9397ab;   /* neutral-500 */
    --text-muted:        #75798c;   /* neutral-600 */

    --accent:            #9184d9;   /* blurple */
    --accent-dim:        color-mix(in srgb, #9184d9 14%, transparent);
    --accent-2:          #a7a1db;

    --border:            rgba(233, 233, 237, 0.10);
    --danger:            #e0566a;
    --success:           #7cc77a;
    --shadow:            rgba(0, 0, 0, 0.55);
    --scrollbar-thumb:   #3f424d;   /* neutral-800 */

    --msg-meta-own:      rgba(210, 206, 253, 0.75); /* accent-300 */
    --msg-check-own:     #b5abfc;

    --chat-bg-a:         #161826;
    --chat-bg-b:         #1b1d2e;
    --chat-dot:          rgba(255, 255, 255, 0.04);

    --radius-bubble:     16px;

    /* Nocturne-шкала для точечных правил */
    --n100:#f3f5fe; --n200:#e1e4f0; --n300:#cfd3e5; --n400:#b2b6c9;
    --n500:#9397ab; --n600:#75798c; --n700:#595d6c; --n800:#3f424d; --n900:#292b31;
    --a200:#e7e5fe; --a300:#d2cefd; --a400:#b5abfc; --a700:#5d5294; --a800:#423a6a; --a900:#2b2741;
    --nocturne-section:#1e1b3a;
}

/* ─── Типографика Inter ─── */
body, input, textarea, button, select,
.chat-item-name, .message-text, .panel-header, .feed-post-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
body { background: var(--bg-primary); color: var(--text-primary); }

/* ─── Скруглённо-квадратные аватары (радиус ≈ 30%) ─── */
.avatar,
.avatar img,
.avatar.avatar-coffee svg,
.nav-rail-avatar,
.chip-avatar,
.profile-avatar-wrapper .avatar {
    border-radius: 30% !important;
}
.avatar { background: linear-gradient(150deg, var(--a700), var(--a900)); color: var(--a200); }
.avatar .online-dot { background: var(--a400); border-color: var(--bg-primary); }

/* ─── Пузыри сообщений: обводка + фирменные цвета текста ─── */
.message { box-shadow: none; }
.message.own {
    background: var(--bg-message-own);
    box-shadow: inset 0 0 0 1px var(--a700);
    color: var(--a200);
}
.message.other {
    background: var(--bg-message-other);
    box-shadow: inset 0 0 0 1px var(--n800);
    color: var(--n200);
}
.message.own .message-text  { color: var(--a200); }
.message.other .message-text { color: var(--n200); }
.message.own .message-time  { color: var(--msg-meta-own); }
.message-check.read { color: var(--accent); }

/* ─── Нав-рейл: активный пункт — акцент, компактная плашка ─── */
#nav-rail { background: color-mix(in srgb, var(--n900) 45%, transparent); border-right: 1px solid var(--border); }
.nav-rail-item { color: var(--n500); border-radius: 12px; }
.nav-rail-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-rail-item.active { color: var(--a300); background: var(--accent-dim); }
.nav-rail-item.active .nav-rail-icon { color: var(--a300); }
.nav-rail-danger:hover { color: var(--danger); }

/* ─── Строки списка чатов ─── */
.chat-item.active,
.chat-item.selected { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.chat-item:hover { background: var(--bg-hover); }
.chat-item-name { color: var(--n100); font-weight: 500; }
.chat-item-time { color: var(--n600); }
.chat-item-preview { color: var(--n600); }
/* бейдж непрочитанного — акцентная пилюля */
.chat-item .unread-badge,
.unread-badge,
.badge-unread {
    background: color-mix(in srgb, var(--accent) 20%, transparent) !important;
    box-shadow: inset 0 0 0 1px var(--a800);
    color: var(--a300) !important;
}

/* ─── Заголовки колонок «Чаты / Лента / Звонки» — тонкое начертание ─── */
.list-title, .column-title, .sidebar-title, .panel-title,
h1.section-title, .screen-title {
    font-weight: 300;
    letter-spacing: -.03em;
    color: var(--n100);
}

/* ─── Шапка панели разговора ─── */
.panel-header { background: var(--bg-primary); border-bottom: 1px solid var(--border); }

/* ─── Инпуты / поля / поиск ─── */
input, textarea, .search-input, .composer-input, .msg-input, .input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    caret-color: var(--accent);
}
input:focus, textarea:focus, .search-input:focus { border-color: var(--accent); outline: none; }
::placeholder { color: var(--n600); }

/* ─── Кнопки в стиле Nocturne (контурный акцент) ─── */
.btn-primary {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid var(--accent);
    color: var(--a300);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.btn-passkey { border: 1px solid var(--border); color: var(--a300); background: var(--bg-tertiary); }
.btn-send {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    border: 1px solid var(--accent);
    color: var(--a300);
}
.btn-send:hover { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.btn-ghost { color: var(--a300); }

/* ─── Чипы-фильтры (Все / Личные / …) ─── */
.chip, .filter-chip, .tab-chip, .pill {
    border-radius: 9px;
    border: 1px solid var(--border);
    color: var(--n400);
    background: transparent;
}
.chip.active, .filter-chip.active, .tab-chip.active, .pill.active {
    color: var(--a300);
    border-color: var(--accent);
    background: var(--accent-dim);
}

/* ─── Ленты/карточки постов ─── */
.feed-post, .card, .post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
}

/* ─── Скроллбары ─── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ─── Разделители-секции (мини-капс) ─── */
.section-header, .list-section-title {
    font: 500 10px/1 ui-monospace, Menlo, monospace;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--n700);
}

/* ═══════════ ЛЕНТА: правая панель каналов ═══════════ */
.feed-layout { display: flex; height: 100%; width: 100%; min-height: 0; }
.feed-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.feed-col .panel-body { flex: 1; overflow-y: auto; }

.feed-channels {
    width: 306px;
    flex: none;
    border-left: 1px solid var(--border);
    background: color-mix(in srgb, var(--n900) 35%, transparent);
    overflow-y: auto;
    padding: 16px 0 18px;
}

/* поиск по каналам */
.fc-search {
    display: flex; align-items: center; gap: 8px;
    margin: 0 16px 6px;
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--n600);
}
.fc-search:focus-within { border-color: var(--accent); }
.fc-search input {
    flex: 1; min-width: 0; border: none; background: transparent; outline: none;
    color: var(--text-primary); font-size: 14px; padding: 0;
}
.fc-search input::placeholder { color: var(--n600); }

/* заголовок секции */
.fc-section {
    padding: 14px 18px 8px;
    font: 500 9.5px/1 ui-monospace, Menlo, monospace;
    letter-spacing: .14em; text-transform: uppercase; color: var(--n700);
}

/* строка канала */
.fc-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 16px; cursor: pointer; border: none; background: transparent;
    width: 100%; text-align: left;
}
.fc-item:hover { background: var(--bg-hover); }
.fc-item .fc-ava {
    width: 36px; height: 36px; flex: none; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font: 500 12px/1 'Inter', sans-serif; overflow: hidden;
}
.fc-item .fc-ava.plain {
    background: var(--n900); box-shadow: inset 0 0 0 1px var(--n800); color: var(--n400);
}
.fc-item .fc-ava.grad {
    background: linear-gradient(150deg, var(--a700), var(--a900)); color: var(--a200);
}
.fc-item .fc-ava img { width: 100%; height: 100%; object-fit: cover; }
.fc-item .fc-info { flex: 1; min-width: 0; }
.fc-item .fc-name {
    font: 500 13.5px/1.2 'Inter', sans-serif; color: var(--n100);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fc-item .fc-meta { font: 400 11px/1 'Inter', sans-serif; color: var(--n700); margin-top: 4px; }

/* бейдж «свежее» у подписки */
.fc-fresh {
    flex: none; padding: 3px 8px; border-radius: 9px;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    box-shadow: inset 0 0 0 1px var(--a800);
    font: 500 10.5px/1 'Inter', sans-serif; color: var(--a300);
}

/* кнопка «Подписаться» / «Вы подписаны» */
.fc-sub {
    flex: none; padding: 6px 11px; border-radius: 8px; cursor: pointer;
    font: 500 11.5px/1 'Inter', sans-serif;
    border: 1px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--a300);
}
.fc-sub:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.fc-sub.subscribed {
    border-color: var(--n800); background: transparent; color: var(--n500); cursor: default;
}
.fc-empty { padding: 4px 18px 8px; font-size: 12px; color: var(--n700); }

/* Десктоп: лента — две колонки (посты + панель каналов справа) */
@media (min-width: 1041px) {
    #panel-feed { width: 726px; max-width: calc(100vw - 90px); }
}
/* На узких экранах — одна колонка, правую панель прячем */
@media (max-width: 1040px) {
    .feed-channels { display: none; }
    .feed-col { flex: 1; }
}

/* ═══════════ БАРИСТА — ИИ-помощник ═══════════ */
#panel-barista { display: flex; flex-direction: column; }
@media (min-width: 1041px) { #panel-barista { width: 460px; } }

.barista-header { display: flex; align-items: center; gap: 10px; }
.barista-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.barista-title h2 { margin: 0; font-size: 16px; font-weight: 500; color: var(--n100); }
.barista-ava {
    width: 38px; height: 38px; flex: none; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
    background: linear-gradient(150deg, var(--a700), var(--a900));
    box-shadow: inset 0 0 0 1px var(--a700);
}
.barista-sub { font-size: 11px; color: var(--n600); margin-top: 2px; }
.barista-plus {
    flex: none; padding: 6px 12px; border-radius: 9px; cursor: pointer;
    font: 500 12px/1 'Inter', sans-serif; color: var(--a300);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid var(--accent);
}
.barista-plus.active { background: var(--accent-dim); }

.barista-body {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
}
.barista-msg {
    max-width: 82%; padding: 10px 13px; border-radius: 14px;
    font-size: 14px; line-height: 1.45; white-space: normal; word-wrap: break-word;
}
.barista-user {
    align-self: flex-end; background: var(--a800);
    box-shadow: inset 0 0 0 1px var(--a700); color: var(--a200);
    border-bottom-right-radius: 5px;
}
.barista-bot {
    align-self: flex-start; background: var(--n900);
    box-shadow: inset 0 0 0 1px var(--n800); color: var(--n200);
    border-bottom-left-radius: 5px;
}
.barista-typing { color: var(--n600); }

.barista-action {
    align-self: flex-start; width: 82%;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), var(--bg-card));
    border: 1px solid var(--a800); border-radius: 14px; padding: 12px 14px;
}
.barista-action .ba-head { font: 500 13px/1.2 'Inter', sans-serif; color: var(--n100); display: flex; gap: 6px; }
.barista-action .ba-preview { font-size: 13px; color: var(--n300); margin: 7px 0 11px; }
.barista-action .ba-buttons { display: flex; gap: 8px; }
.ba-confirm, .ba-cancel {
    padding: 7px 14px; border-radius: 9px; cursor: pointer; font: 500 12.5px/1 'Inter', sans-serif;
}
.ba-confirm { border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--a300); }
.ba-confirm:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.ba-cancel { border: 1px solid var(--n800); background: transparent; color: var(--n500); }
.barista-action.ba-done { opacity: 0.85; }
.ba-result { font-size: 12.5px; color: var(--n500); }
.ba-result.ok { color: var(--a300); }

.barista-composer {
    flex: none; display: flex; gap: 8px; padding: 12px;
    border-top: 1px solid var(--border); background: var(--bg-primary);
}
.barista-composer input {
    flex: 1; min-width: 0; padding: 11px 14px; border-radius: 19px;
    background: var(--bg-input); border: 1px solid var(--border);
    color: var(--text-primary); font-size: 14px; outline: none;
}
.barista-composer input:focus { border-color: var(--accent); }
.barista-composer .btn-send {
    width: 40px; height: 40px; flex: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* Пейволл Бариста+ */
.barista-paywall {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(5, 6, 12, 0.7); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.barista-paywall.hidden { display: none; }
.barista-paywall-card {
    position: relative; width: 360px; max-width: 100%;
    background: var(--bg-card); border: 1px solid var(--a800); border-radius: 20px;
    padding: 26px 24px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.barista-paywall-close {
    position: absolute; top: 12px; right: 14px; border: none; background: transparent;
    color: var(--n600); font-size: 16px; cursor: pointer;
}
.barista-paywall-ava {
    width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 18px; font-size: 30px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(150deg, var(--a700), var(--a900)); box-shadow: inset 0 0 0 1px var(--a700);
}
.barista-paywall-card h3 { margin: 0; font-size: 22px; font-weight: 600; color: var(--n100); }
.barista-paywall-sub { color: var(--n500); font-size: 13px; margin: 4px 0 16px; }
.barista-paywall-list { list-style: none; padding: 0; margin: 0 0 16px; text-align: left; }
.barista-paywall-list li { font-size: 13.5px; color: var(--n200); padding: 6px 0; border-bottom: 1px solid var(--border); }
.barista-paywall-price { font-size: 20px; font-weight: 600; color: var(--a300); margin-bottom: 14px; }
.barista-paywall-note { font-size: 11px; color: var(--n700); margin-top: 10px; }
.nav-rail-barista.active, .nav-rail-barista:hover { color: var(--a300); }

/* «Бариста подскажет» в композере + курсор стриминга */
.barista-suggest-btn { color: var(--a400) !important; }
.barista-suggest-btn:hover { color: var(--a300) !important; background: var(--accent-dim); border-radius: 10px; }
.barista-suggest-btn.barista-suggest-loading { animation: baristaPulse 0.7s ease-in-out infinite; }
@keyframes baristaPulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }
.barista-streaming::after {
    content: '▍'; color: var(--a400); margin-left: 1px;
    animation: baristaBlink 1s steps(2, jump-none) infinite;
}
@keyframes baristaBlink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* «Бариста подскажет» — только для Бариста+ (у остальных кнопки нет) */
#btn-barista-suggest { display: none; }
body.barista-premium #btn-barista-suggest { display: inline-flex; }

/* ═══════════ Остывающие сообщения (веб) ═══════════ */
.cooling-wrap { position: relative; display: inline-flex; }
#btn-cooling.active { color: var(--a400) !important; }
.cooling-menu {
    position: absolute; bottom: 48px; left: 0; z-index: 60;
    background: var(--bg-card); border: 1px solid var(--n800); border-radius: 12px;
    padding: 6px; min-width: 190px; box-shadow: 0 12px 32px var(--shadow);
}
.cooling-menu.hidden { display: none; }
.cooling-menu-title {
    font: 500 10px/1 ui-monospace, Menlo, monospace; letter-spacing: .12em;
    text-transform: uppercase; color: var(--n700); padding: 6px 8px 8px;
}
.cooling-opt {
    display: block; width: 100%; text-align: left; padding: 8px 10px;
    border: none; background: transparent; color: var(--n200);
    font-size: 13.5px; border-radius: 8px; cursor: pointer;
}
.cooling-opt:hover { background: var(--bg-hover); }
.cooling-opt.sel { color: var(--a300); background: var(--accent-dim); }
.message.cooling { position: relative; overflow: hidden; }
.message.cooling .cooling-bar {
    position: absolute; top: 0; left: 0; height: 2px;
    background: var(--accent); border-radius: 2px; transition: width 1s linear;
}
.message.cooling .cooling-flame {
    position: absolute; bottom: 3px; right: 6px; font-size: 10px; opacity: .7;
}

/* ===== Медиа-листалка (просмотр фото/видео со свайпом и скачиванием) ===== */
.media-viewer {
    position: fixed; inset: 0; z-index: 3000;
    background: rgba(8, 9, 16, 0.94);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    animation: mvFade .18s ease;
    user-select: none;
}
@keyframes mvFade { from { opacity: 0 } to { opacity: 1 } }
.media-viewer .mv-top {
    position: absolute; top: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px calc(14px + env(safe-area-inset-top));
    padding-top: max(14px, env(safe-area-inset-top));
    background: linear-gradient(rgba(0,0,0,.5), transparent);
    z-index: 2;
}
.media-viewer .mv-counter {
    color: #fff; font-size: 14px; font-weight: 600; letter-spacing: .3px;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.media-viewer .mv-actions { display: flex; gap: 10px; margin-left: auto; }
.media-viewer .mv-btn {
    width: 40px; height: 40px; border-radius: 50%;
    border: none; cursor: pointer;
    background: rgba(255,255,255,.12); color: #fff;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.media-viewer .mv-btn:hover { background: rgba(255,255,255,.22); }
.media-viewer .mv-btn svg { width: 22px; height: 22px; fill: currentColor; }
.media-viewer .mv-stage {
    max-width: 92vw; max-height: 86vh;
    display: flex; align-items: center; justify-content: center;
}
.media-viewer .mv-stage img,
.media-viewer .mv-stage video {
    max-width: 92vw; max-height: 86vh;
    border-radius: 10px; object-fit: contain;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.media-viewer .mv-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 52px; height: 52px; border-radius: 50%;
    border: none; cursor: pointer; z-index: 2;
    background: rgba(255,255,255,.1); color: #fff;
    font-size: 30px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.media-viewer .mv-nav:hover { background: rgba(255,255,255,.2); }
.media-viewer .mv-prev { left: 16px; }
.media-viewer .mv-next { right: 16px; }
@media (max-width: 640px) {
    /* На телефоне вместо стрелок — свайп; стрелки прячем, они мешают */
    .media-viewer .mv-nav { display: none !important; }
    .media-viewer .mv-stage,
    .media-viewer .mv-stage img,
    .media-viewer .mv-stage video { max-width: 100vw; max-height: 82vh; }
}

/* ===================== Музыка ===================== */
.music-layout { display: flex; flex-direction: column; height: 100%; }
.music-header { display: flex; align-items: center; gap: 12px; }
.music-header h2 { flex: 1; }
.music-upload-btn {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--accent, #9184D9); color: #fff; border: none;
    border-radius: 11px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.music-upload-btn svg { fill: #fff; }
.music-upload-btn:hover { filter: brightness(1.08); }
.music-tabs { display: flex; gap: 8px; padding: 4px 16px 10px; }
.music-tab {
    background: none; border: none; color: #9aa0b4; font-size: 14px; font-weight: 600;
    padding: 7px 14px; border-radius: 10px; cursor: pointer; transition: .13s;
}
.music-tab:hover { color: #e7e8ee; }
.music-tab.active { background: rgba(145,132,217,.16); color: #b3a9ec; }
.music-search-wrap {
    display: flex; align-items: center; gap: 9px; margin: 0 16px 10px;
    background: #1e2030; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; padding: 9px 13px;
}
.music-search-wrap svg { fill: #6b7085; flex-shrink: 0; }
.music-search-wrap input { flex: 1; background: none; border: none; color: #e7e8ee; font-size: 14px; outline: none; }
.music-list { padding: 0 10px 20px; }

.mtrack {
    display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px;
    cursor: pointer; transition: background .12s;
}
.mtrack:hover { background: rgba(255,255,255,.045); }
.mtrack:hover .mtrack-play { opacity: 1; }
.mtrack-cover {
    width: 48px; height: 48px; border-radius: 10px; flex-shrink: 0; position: relative; overflow: hidden;
    background: linear-gradient(135deg,#2a2d40,#20222f); display: flex; align-items: center; justify-content: center;
}
.mtrack-cover img { width: 100%; height: 100%; object-fit: cover; }
.mtrack-cover svg { width: 22px; height: 22px; fill: #6b7085; }
.mtrack-play {
    position: absolute; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .12s;
}
.mtrack-play svg { width: 22px; height: 22px; fill: #fff; }
.mtrack-info { flex: 1; min-width: 0; }
.mtrack-title { font-size: 14.5px; font-weight: 600; color: #eceef6; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtrack-title .mver { width: 15px; height: 15px; fill: #fff; background: var(--accent,#9184D9); border-radius: 50%; padding: 2px; flex-shrink: 0; }
.mtrack-artist { font-size: 12.5px; color: #9aa0b4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtrack-dur { font-size: 12px; color: #6b7085; flex-shrink: 0; }
.mtrack-btn { background: none; border: none; padding: 7px; border-radius: 8px; cursor: pointer; flex-shrink: 0; }
.mtrack-btn svg { width: 18px; height: 18px; fill: #6b7085; transition: fill .12s; }
.mtrack-btn:hover svg { fill: #e7e8ee; }
.mtrack-save.on svg { fill: #e0596b; }

.music-empty { text-align: center; color: #6b7085; padding: 46px 20px; font-size: 14px; }
.music-spin { width: 24px; height: 24px; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--accent,#9184D9); border-radius: 50%; animation: mspin .7s linear infinite; margin: 40px auto; }
@keyframes mspin { to { transform: rotate(360deg); } }

/* Плейлисты */
.music-new-pl { display: block; width: calc(100% - 8px); margin: 4px; background: rgba(145,132,217,.12); color: #b3a9ec; border: 1px dashed rgba(145,132,217,.4); border-radius: 12px; padding: 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.mpl { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; cursor: pointer; }
.mpl:hover { background: rgba(255,255,255,.045); }
.mpl-cover { width: 48px; height: 48px; border-radius: 10px; background: linear-gradient(135deg,var(--accent,#9184D9),#6b5fb8); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mpl-cover svg { width: 22px; height: 22px; fill: #fff; }
.mpl-title { font-size: 14.5px; font-weight: 600; color: #eceef6; }
.mpl-pub { font-size: 10.5px; color: #7fd3a6; background: rgba(120,200,160,.14); padding: 2px 7px; border-radius: 6px; margin-left: 4px; }
.mpl-sub { font-size: 12.5px; color: #9aa0b4; }
.mpl-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.mpl-head h3 { font-size: 17px; }
.mpl-head span { color: #9aa0b4; font-size: 13px; }
.mpl-del { margin-left: auto; background: rgba(224,89,107,.14); color: #e0596b; border: none; border-radius: 9px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; }

.music-popup { position: fixed; z-index: 4000; background: #242637; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 6px; min-width: 190px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.music-popup button { display: block; width: 100%; text-align: left; background: none; border: none; color: #e7e8ee; font-size: 13.5px; padding: 9px 11px; border-radius: 8px; cursor: pointer; }
.music-popup button:hover { background: rgba(255,255,255,.06); }

/* Нижний плеер */
#music-player {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 900;
    background: rgba(30,32,48,.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.1); border-radius: 16px;
    box-shadow: 0 14px 40px rgba(0,0,0,.5);
    display: flex; align-items: center; gap: 14px; padding: 10px 14px; max-width: 900px; margin: 0 auto;
}
.mp-cover { width: 46px; height: 46px; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: linear-gradient(135deg,#2a2d40,#20222f); display: flex; align-items: center; justify-content: center; }
.mp-cover img { width: 100%; height: 100%; object-fit: cover; }
.mp-cover svg { width: 20px; height: 20px; fill: #6b7085; }
.mp-info { min-width: 0; width: 150px; }
.mp-title { font-size: 13.5px; font-weight: 600; color: #eceef6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-artist { font-size: 12px; color: #9aa0b4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-controls { display: flex; align-items: center; gap: 4px; }
.mp-btn { background: none; border: none; cursor: pointer; padding: 6px; border-radius: 50%; display: flex; }
.mp-btn svg { width: 22px; height: 22px; fill: #e7e8ee; }
.mp-play { background: var(--accent,#9184D9); padding: 9px; }
.mp-play svg { fill: #fff; width: 20px; height: 20px; }
.mp-seek { flex: 1; display: flex; align-items: center; gap: 9px; }
.mp-seek span { font-size: 11px; color: #9aa0b4; width: 34px; text-align: center; flex-shrink: 0; }
#mp-bar { flex: 1; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 3px; background: rgba(255,255,255,.16); cursor: pointer; }
#mp-bar::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--accent,#9184D9); }
#mp-bar::-moz-range-thumb { width: 13px; height: 13px; border: none; border-radius: 50%; background: var(--accent,#9184D9); }
.mp-close svg { width: 18px; height: 18px; fill: #6b7085; }
body.has-music-player #app { padding-bottom: 78px; }
@media (max-width: 640px) {
    #music-player { flex-wrap: wrap; gap: 8px; left: 8px; right: 8px; bottom: 66px; padding: 9px 12px; }
    .mp-info { width: auto; flex: 1; }
    .mp-seek { order: 3; width: 100%; flex-basis: 100%; }
}


/* ─── Кнопки под сообщением бота (как inline-клавиатура в Telegram) ─── */
.message:has(.msg-buttons) { max-width: min(440px, 88%); }
.msg-buttons { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; min-width: min(250px, 62vw); }
.msg-buttons-row { display: flex; gap: 6px; }
.msg-button {
    flex: 1 1 0; min-width: 0;
    padding: 8px 10px; border-radius: 10px;
    background: var(--accent-dim); color: var(--a300);
    border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
    font: inherit; font-size: 13px; font-weight: 600; line-height: 1.25;
    text-align: center; text-decoration: none; cursor: pointer;
    overflow-wrap: anywhere;
    transition: background .15s ease, transform .1s ease;
}
.msg-button:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); color: var(--a200); }
.msg-button:active { transform: scale(.98); }
.msg-button:disabled { opacity: .55; cursor: progress; }
.msg-button-link::after { content: " ↗"; opacity: .6; }


/* ─── Чат с ботом: «Меню» с командами вместо вложений, голосовых и остывания ─── */
.bot-menu-btn {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
    height: 38px; padding: 0 12px; margin-right: 6px;
    border-radius: 19px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    background: var(--accent-dim); color: var(--a300);
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.bot-menu-btn:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }
#message-input-area.bot-chat #btn-barista-suggest,
#message-input-area.bot-chat #cooling-wrap { display: none !important; }
/* скрепку и голосовые оставляем ботам, которые принимают файлы (например, «Помощь») */
#message-input-area.bot-chat:not(.bot-media) #btn-attach,
#message-input-area.bot-chat:not(.bot-media) #btn-voice { display: none !important; }
#message-input-area:not(.bot-chat) #btn-bot-menu { display: none; }
.bot-menu-popover { min-width: 260px; max-width: 320px; }
.bot-menu-popover .apps-menu-name { display: flex; flex-direction: column; gap: 1px; }
.bot-menu-desc { font-size: 12px; color: var(--text-secondary); font-weight: 400; }

/* Профиль бота: команды */
.bot-commands { display: flex; flex-direction: column; gap: 4px; }
.bot-command-row {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
    width: 100%; padding: 8px 10px; border-radius: 10px;
    background: transparent; border: none; color: var(--text-primary);
    font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.bot-command-row:hover { background: var(--bg-hover); }
.bot-command-row span { font-size: 12px; color: var(--text-secondary); }

/* Строка настроек-ссылка (Панель поддержки) выглядит как кнопка */
a.settings-row-btn { text-decoration: none; box-sizing: border-box; }
