/* =================== Живой фон частиц (desktop) =================== */
#photon-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    /* Фон-заглушки не нужен — html несёт --t-bg снизу стека. */
}
@media screen and (max-width: 768px) {
    #photon-bg { display: none; }
}

/* Логотип-подложка на дашборде: над частицами (#photon-bg, z-index:-1),
   под карточками-плашками. По центру вьюпорта. */
#dash-logo-watermark {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 340px; max-width: 60vw;
    z-index: -1;
    opacity: 0.85;
    pointer-events: none;
    user-select: none; -webkit-user-select: none;
}

/* =================== In-app boot splash =================== */
/* Чёрный оверлей, покрывающий экран сразу после OS-splash PWA до того,
   как JS + DOM будут готовы. Убирается в window.load через класс .hidden.
   background совпадает с manifest.json background_color (#030508). */
.boot-splash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #030508;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.35s ease;
}
.boot-splash.hidden {
    opacity: 0;
    pointer-events: none;
}
.boot-splash-inner {
    text-align: center;
    user-select: none;
}
.boot-splash-logo {
    display: block;
    width: 128px;
    max-width: 50vw;
    height: auto;
    margin: 0 auto 18px;
    user-select: none;
    -webkit-user-select: none;
}
.boot-splash-title {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: #dde4f0;
}
.boot-splash-version {
    margin-top: 6px;
    font-size: 10px;
    letter-spacing: 1px;
    color: #5a6675;
    font-family: 'Roboto Mono', monospace;
}

/* ===========================================================
   Глобальный кастомный скроллбар (без стрелок-кнопок).
   Объявляем сам ::-webkit-scrollbar — иначе в некоторых ОС
   используется нативный OS-скроллбар со стрелками, и правило
   ::-webkit-scrollbar-button не применяется.
   =========================================================== */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
/* Кнопки-стрелки — наглухо убраны */
::-webkit-scrollbar-button,
::-webkit-scrollbar-button:vertical,
::-webkit-scrollbar-button:horizontal,
::-webkit-scrollbar-button:start,
::-webkit-scrollbar-button:end,
::-webkit-scrollbar-button:vertical:start,
::-webkit-scrollbar-button:vertical:end,
::-webkit-scrollbar-button:vertical:decrement,
::-webkit-scrollbar-button:vertical:increment,
::-webkit-scrollbar-button:horizontal:start,
::-webkit-scrollbar-button:horizontal:end,
::-webkit-scrollbar-button:horizontal:decrement,
::-webkit-scrollbar-button:horizontal:increment,
::-webkit-scrollbar-button:single-button,
::-webkit-scrollbar-button:double-button,
::-webkit-scrollbar-button:no-button,
::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
    background-image: none !important;
    -webkit-appearance: none !important;
    border: none !important;
}
::-webkit-scrollbar-thumb {
    background-clip: content-box;
    background-color: var(--t-scrollbar-thumb);
    border-radius: 4px;
}
::-webkit-scrollbar-track {
    background: var(--t-scrollbar-track);
    border-radius: 4px;
}
::-webkit-scrollbar-corner {
    background: transparent;
}
/* Firefox: тонкий скроллбар (не имеет кнопок-стрелок).
   Важно: применяем ТОЛЬКО к Firefox (через @supports -moz-appearance),
   чтобы в Chromium 121+ не отключить ::-webkit-scrollbar стили. */
@supports (-moz-appearance: none) {
    html {
        scrollbar-width: thin;
        scrollbar-color: var(--t-scrollbar-thumb) var(--t-scrollbar-track);
    }
}

:root {
    --bg-color: #030508;
    --foton-white: rgba(255, 255, 255, 0.9);
    --master-accent: #ffffff;
    --alisa-accent: #ff77ff;
    --evgeniy-accent: #77ffff;
    --anton-accent: #ffdd77;

    /* Тема: токены, переопределяются в body.light */
    --t-bg: #030508;
    --t-panel: #131313;
    --t-surface: rgba(255, 255, 255, 0.03);
    --t-surface-strong: rgba(255, 255, 255, 0.06);
    --t-text: #d1d1d1;
    --t-text-muted: #9a9a9a;
    --t-border: rgba(255, 255, 255, 0.07);
    --t-border-strong: rgba(255, 255, 255, 0.15);
    --t-scrollbar-track: #202020;
    --t-scrollbar-thumb: #d3d3d3;
    --t-chat-user-bg: #9900ff4d;
    --t-chat-user-text: #d1d1d1;
    --t-chat-foton-bg: rgba(0, 183, 255, 0.199);
    --t-chat-foton-text: #e0e0e0;
    --t-input-bg: rgba(255, 255, 255, 0.03);
    --t-input-bg-focus: rgba(255, 255, 255, 0.05);
    --t-input-border: #1a1a1a;
    --t-input-border-focus: #444;
    --t-input-gradient-end: #030508;
    --t-icon-invert: 0;
    /* Фирменный акцент (GREZZLY). Тёмная тема — светлее, ховер ещё светлее.
       Захардкоженные #bd0503 / rgba(189,5,3,…) заменены на var(--t-accent[-rgb]). */
    --t-accent: #f5322f;
    --t-accent-rgb: 245, 50, 47;
    --t-accent-hover: #ff6360;
}

/* ВАЖНО: дублируем селектор `:root:has(body.light)` потому что html — родитель
   body, и custom properties определённые ТОЛЬКО на body не доступны в html
   scope. Без `:has()`-варианта `html { background: var(--t-bg); }` всегда
   читал бы тёмный default из :root, и фон под canvas #photon-bg оставался
   бы чёрным даже в светлой теме. */
:root:has(body.light),
body.light {
    --t-bg: #f5f5f5;
    --t-panel: #ffffff;
    --t-surface: rgba(0, 0, 0, 0.03);
    --t-surface-strong: rgba(0, 0, 0, 0.06);
    --t-text: #1a1a1a;
    --t-text-muted: #6a6a6a;
    --t-border: rgba(0, 0, 0, 0.08);
    --t-border-strong: rgba(0, 0, 0, 0.18);
    --t-scrollbar-track: #e0e0e0;
    --t-scrollbar-thumb: #9a9a9a;
    --t-chat-user-bg: #e0c6ff;
    --t-chat-user-text: #2a0f4a;
    --t-chat-foton-bg: #dff1ff;
    --t-chat-foton-text: #0b2a3d;
    --t-input-bg: #e4e4e4;
    --t-input-bg-focus: #dcdcdc;
    --t-input-border: rgba(0, 0, 0, 0.18);
    --t-input-border-focus: rgba(0, 0, 0, 0.4);
    --t-input-gradient-end: #f5f5f5;
    --t-icon-invert: 0;
    /* Светлая тема — оставляем насыщенный тёмно-красный (читаем на белом). */
    --t-accent: #bd0503;
    --t-accent-rgb: 189, 5, 3;
    --t-accent-hover: #d8201e;
}
.overflow-hidden {
    overflow: hidden!important;
}
.panel-header {
    font-size: 16px;
    border-bottom: 1px solid #252525;
    padding-bottom: 12px;
    letter-spacing: 3px;
}

body.light #userInput { color: #1a1a1a; }
body.light #userInput::placeholder { color: #6a6a6a; }
body.light #userInput:focus {
    background: #e0c6ff;
    border-color: rgba(120, 70, 200, 0.45);
}

/* html несёт цвет фона-заглушку — нужен, чтобы при отключённом canvas
   (мобилка, ошибка JS) не было просвета. Body прозрачный — пропускает
   canvas #photon-bg с z-index:-1 сквозь себя. */
html {
    background: var(--t-bg);
    min-height: 100vh;
    transition: background 0.4s ease;
}
body {
    background: transparent;
    color: var(--t-text);
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    display: flex; flex-direction: column; height: 100vh; margin: 0;
    transition: color 0.4s ease;
    overflow-x: hidden;
    max-width: 100vw;
    overflow: hidden;
}
h1, h2, h3, h4, h5, h6 {
    font-family: 'Segoe UI Light', 'Helvetica Neue', sans-serif;
}
/* Базовые стили скроллбара объявлены глобально в начале файла. */

/* Бережная Линия */
#line {
    height: 2px; width: 100%; background: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4), 0 0 40px rgba(255, 255, 255, 0.2);
    position: absolute; top: 50%; opacity: 0.15; z-index: 1;
    transition: all 1.5s ease; pointer-events: none;
}

#chat-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    padding: 60px 10%;
    display: flex;
    flex-direction: column;
    gap: 30px;
    z-index: 1;
}


.msg {
    position: relative;
    max-width: 80%; padding: 20px 25px 30px; border-radius: 15px;
    line-height: 1.8; font-size: 14px; letter-spacing: 0.6px;
    opacity: 0; transform: translateY(10px);
    animation: emerge 0.8s forwards ease-out;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

@keyframes emerge { to { opacity: 1; transform: translateY(0); } }

.user {
    align-self: flex-end;
    color: var(--t-chat-user-text);
    background-color: var(--t-chat-user-bg);
}
.foton {
    align-self: flex-start;
    background: var(--t-chat-foton-bg);
    color: var(--t-chat-foton-text);
    border-radius: 15px;
}

/* Форматирование текста в сообщениях */
.msg strong { font-weight: 700; }
.msg em { font-style: italic; }
.msg del { text-decoration: line-through; opacity: 0.7; }
.msg code {
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}
.msg pre {
    background: rgba(255,255,255,0.06);
    padding: 12px 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}
.msg pre code {
    background: none;
    padding: 0;
    font-size: 0.88em;
    line-height: 1.5;
}

.msg ul, .msg ol {
    margin: 6px 0;
    padding-left: 24px;
}
.msg li {
    margin: 3px 0;
}

/* Индикатор загрузки */
.loading {
    align-self: flex-start; color: #555; font-style: italic;
    padding: 20px 25px;
}
.loading::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}
/* Панель профиля */
#profile-panel {
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    padding: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(25px);
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    cursor: pointer;
    z-index: 10;
}
#profile-panel > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* Цвет бордера — по статусу подписки. Цвета совпадают с кнопкой подписки
   в панели профиля: inactive=#b74141, standard=#2e7d4f, pro=#7a3fc8. */
#profile-panel.sub-inactive { border: 2px solid #b74141; }
#profile-panel.sub-standard { border: 2px solid #2e7d4f; }
#profile-panel.sub-pro { border: 2px solid #7a3fc8; }
#user-profile-details {
    position: fixed;
    top: 30px;
    bottom: 30px;
    right: -350px;
    transition: right 0.5s ease;
    width: 280px;
    min-width: 280px;
    overflow-x: unset;
    overflow-y: auto;
    background: var(--t-panel);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-right: 5px solid transparent;
    padding: 20px 25px; z-index: 100;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
#user-profile-details.active {
    right: 20px;
}
#user-profile-details::-webkit-scrollbar-track {
    margin-top: 20px;
    margin-bottom: 20px;
}
#profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}
#avatar-preview {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 12px;
}
#avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#avatar-preview .avatar-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
#avatar-preview .avatar-loader.active {
    opacity: 1;
}
#avatar-preview .avatar-loader::after {
    content: '';
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255,255,255,0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: avatar-spin 0.7s linear infinite;
}
@keyframes avatar-spin {
    to { transform: rotate(360deg); }
}
#avatar-upload-label {
    font-size: 13px;
    color: #666;
    cursor: pointer;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    transition: all 0.3s;
}
#avatar-upload-label:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}
.profile-field {
    margin-bottom: 20px;
}
.profile-tokens-block {
    margin: 10px 0;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.profile-tokens-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.profile-tokens-title {
    font-size: 9px;
    font-family: 'Roboto', sans-serif;
    color: #c7c7c7;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.profile-tokens-value {
    font-size: 12px;
    color: #c7c7c7;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.profile-tokens-value-row,
.dash-tokens-value-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tokens-buy-btn {
    width: 24px;
    height: 24px;
    min-width: 24px;
    box-sizing: border-box;
    border-radius: 5px;
    border: 1px solid #ff5555;
    background: rgba(255, 85, 85, 0.1);
    color: #ff5555;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, box-shadow 0.15s;
    flex: 0 0 auto;
    position: relative;
}
/* «+» — два бара в одном ::before через два linear-gradient */
.tokens-buy-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background:
        linear-gradient(currentColor, currentColor) center/12px 2px no-repeat,
        linear-gradient(currentColor, currentColor) center/2px 12px no-repeat;
}
.tokens-buy-btn:hover {
    background: rgba(255, 85, 85, 0.22);
    box-shadow: 0 0 10px rgba(255, 85, 85, 0.25);
}
body.light .tokens-buy-btn {
    background: rgba(255, 85, 85, 0.12);
}
body.light .tokens-buy-btn:hover {
    background: rgba(255, 85, 85, 0.22);
}

/* Универсальный кастомный тултип. Применяется к любому элементу
   с атрибутом data-tooltip. */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--t-panel);
    color: var(--t-text);
    padding: 10px 20px;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 100;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
body.light [data-tooltip]::after {
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
}
/* Кнопки в верхней строке панели «Мероприятия» и в шапке карточки группы
   стоят у границы контейнера с overflow:hidden — поэтому тултип сверху
   обрезается. Для этих случаев показываем тултип СНИЗУ.
   !important — чтобы переопределить любые более конкретные переопределения
   transform из базового правила или случайные стили. */
#events-panel > [data-tooltip]::after,
.pro-seats-add-btn[data-tooltip]::after,
.company-card-top-actions [data-tooltip]::after,
.events-item-print[data-tooltip]::after {
    bottom: auto !important;
    top: calc(100% + 10px) !important;
    transform: translateX(-50%) translateY(-4px) !important;
    z-index: 1000;
}
#events-panel > [data-tooltip]:hover::after,
#events-panel > [data-tooltip]:focus-visible::after,
.pro-seats-add-btn[data-tooltip]:hover::after,
.pro-seats-add-btn[data-tooltip]:focus-visible::after,
.company-card-top-actions [data-tooltip]:hover::after,
.company-card-top-actions [data-tooltip]:focus-visible::after,
.events-item-print[data-tooltip]:hover::after,
.events-item-print[data-tooltip]:focus-visible::after {
    transform: translateX(-50%) translateY(0) !important;
}
.profile-subscription-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 14px;
    cursor: pointer;
    text-align: left;
    transition: filter 0.2s;
    box-sizing: border-box;
}
.profile-subscription-btn:hover { filter: brightness(1.1); }
.profile-subscription-btn.status-inactive { background: #b74141; }
.profile-subscription-btn.status-standard { background: #2e7d4f; }
.profile-subscription-btn.status-pro { background: #7a3fc8; }
.profile-subscription-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    flex-shrink: 0;
}
.profile-subscription-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    min-width: 0;
    line-height: 1.25;
}
.profile-subscription-status-main {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.profile-subscription-status-sub {
    font-size: 10px;
    opacity: 0.85;
    margin-top: 2px;
}
.profile-subscription-status-sub:empty { display: none; }
.profile-field label {
    display: block;
    font-size: 12px;
    color: #c7c7c7;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}
.profile-field input,
.profile-field textarea {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s;
    font-family: inherit;
}
.profile-field input:focus,
.profile-field textarea:focus {
    border-color: rgba(255,255,255,0.3);
}
.profile-field textarea {
    resize: none;        /* высоту контролирует JS-автосайз по контенту */
    overflow: hidden;
    line-height: 1.4;
}
.profile-field-hint {
    margin: -2px 0 10px;
    font-size: 10px;
    line-height: 1.35;
    color: rgba(255,255,255,0.55);
}
.profile-field input.invalid {
    border-color: #ff4d4d;
}
.profile-field input.invalid:focus {
    border-color: #ff6b6b;
}
.profile-email-status {
    font-size: 11px;
    margin-top: 6px;
    min-height: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.profile-email-status.verified { color: #4caf50; }
.profile-email-status.unverified { color: #ff4d4d; }
.profile-email-instruction {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
    line-height: 1.45;
}
.email-verify-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.email-verify-modal.active { display: flex; }
.email-verify-modal-content {
    background: var(--t-panel, #111);
    border: 1px solid var(--t-border, rgba(255,255,255,0.1));
    border-radius: 15px;
    padding: 28px 25px 22px;
    max-width: 340px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    text-align: center;
}
.email-verify-modal-content h3 {
    color: #fff;
    margin: 0 0 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.email-verify-modal-content p {
    color: #c7c7c7;
    font-size: 12px;
    margin: 0 0 18px;
}
.email-verify-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 4px;
}
.email-verify-inputs input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 10px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s;
}
.email-verify-inputs input:focus {
    border-color: rgba(255,255,255,0.4);
}
.email-verify-error {
    color: #ff4d4d;
    font-size: 12px;
    min-height: 16px;
    margin-top: 10px;
}
.recovery-email-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 10px;
    outline: none;
    box-sizing: border-box;
    font-size: 14px;
    margin-bottom: 4px;
}
.recovery-email-input:focus { border-color: rgba(255,255,255,0.4); }
body.light .recovery-email-input {
    background: #ffffff;
    border-color: rgba(0,0,0,0.25);
    color: #222;
}
body.light .recovery-email-input:focus {
    border-color: rgba(var(--t-accent-rgb), 0.55);
    box-shadow: 0 0 0 3px rgba(var(--t-accent-rgb), 0.1);
}
.recovery-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.recovery-actions button { flex: 1; margin: 0; }
.msg .recovery-offer-btn {
    display: inline-block;
    width: auto;
    padding: 12px 28px;
    margin-top: 14px;
    background: linear-gradient(135deg, #9900ff 0%, #ff77ff 100%);
    border: none;
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(153, 0, 255, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.msg .recovery-offer-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(153, 0, 255, 0.55);
}
.msg .recovery-offer-btn:active { transform: translateY(0); }

/* Оффлайн-баннер */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(90deg, #8a1a1a 0%, #c44a00 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    animation: offline-slide-in 0.25s ease-out;
}
.offline-banner[hidden] { display: none; }
.offline-banner-text-short { display: none; }
.offline-banner-dot {
    width: 8px;
    height: 8px;
    background: #ffdd77;
    border-radius: 50%;
    box-shadow: 0 0 8px #ffdd77;
    animation: offline-pulse 1.5s infinite ease-in-out;
}
@keyframes offline-slide-in {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}
@keyframes offline-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
body.offline-mode { padding-top: 42px; }
body.light .msg .recovery-offer-btn {
    background: linear-gradient(135deg, #7a00cc 0%, #d946ef 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(122, 0, 204, 0.35);
}
body.light .msg .recovery-offer-btn:hover {
    box-shadow: 0 6px 22px rgba(122, 0, 204, 0.5);
}
body.light .email-verify-modal-content {
    background: #fff;
    border-color: rgba(0,0,0,0.1);
}
body.light .email-verify-modal-content h3 { color: #222; }
body.light .email-verify-modal-content p { color: #555; }
body.light .email-verify-inputs input {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.15);
    color: #222;
}
body.light .profile-email-instruction { color: #777; }
.profile-save-btn {
    margin-top: 8px;
    margin-bottom: 10px;
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: #c7c7c7;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
}
.profile-save-btn:hover:not(:disabled) {
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}
.profile-save-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
body.light .profile-save-btn:disabled {
    opacity: 0.4;
    color: #888;
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.15);
}
#profile-status {
    font-size: 13px;
    color: #555;
    text-align: center;
    min-height: 20px;
}
.profile-logout-btn {
    margin-top: 15px;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(255, 80, 80, 0.2);
    color: rgba(255, 80, 80, 0.5);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
}
.profile-logout-btn:hover {
    color: #ff5050;
    border-color: rgba(255, 80, 80, 0.5);
}
.profile-doc-links {
    margin-top: 10px;
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.4;
}
.profile-doc-links a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color 0.15s;
}
.profile-doc-links a:hover { color: var(--t-accent-hover); text-decoration: underline; }
.profile-doc-sep { margin: 0 6px; opacity: 0.5; }
body.light .profile-doc-links { color: rgba(0, 0, 0, 0.45); }
body.light .profile-doc-links a { color: rgba(0, 0, 0, 0.6); }
body.light .profile-doc-links a:hover { color: var(--t-accent-hover); }

/* Чекбокс «Принимаю условия» в форме авторизации. */
.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 2px 0 14px;
    padding: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--t-text-muted);
    cursor: pointer;
    user-select: none;
    position: relative;
}
.auth-terms-checkbox {
    margin: 2px 0 0;
    flex: 0 0 auto;
    cursor: pointer;
    accent-color: var(--t-accent);
}
.auth-terms-text { flex: 1 1 auto; }
.auth-terms-text a {
    color: var(--t-accent);
    text-decoration: underline;
}
body.light .auth-terms-text a { color: var(--t-accent); }
.auth-terms.show-tooltip::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.auth-terms.show-tooltip .auth-terms-checkbox {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
    border-radius: 2px;
    animation: auth-terms-shake 0.4s ease;
}
@keyframes auth-terms-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}
#profile-panel img {
    border-radius: 50%;
}

.closed {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--t-text-muted);
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    flex-shrink: 0;
}
.closed:hover {
    background: var(--t-input-bg-focus);
    color: var(--t-text);
}

/* Кнопка экспорта в Excel — слева от крестика закрытия панели «Мероприятия» */
#events-export-btn {
    position: absolute;
    top: 10px;
    right: 48px;
    width: 30px;
    height: 30px;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(var(--t-accent-rgb), 0.3);
    color: rgba(var(--t-accent-rgb), 0.75);
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    z-index: 5;
}
#events-export-btn:hover {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.6);
    box-shadow: 0 0 10px rgba(var(--t-accent-rgb), 0.15);
}
#events-export-btn > span { pointer-events: none; }

/* Кнопка календаря — левее кнопки экспорта */
#events-calendar-btn {
    position: absolute;
    top: 10px;
    right: 86px;
    width: 30px;
    height: 30px;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(var(--t-accent-rgb), 0.3);
    color: rgba(var(--t-accent-rgb), 0.75);
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    z-index: 5;
}
#events-calendar-btn:hover {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.6);
    box-shadow: 0 0 10px rgba(var(--t-accent-rgb), 0.15);
}
#events-calendar-btn > span { pointer-events: none; }

/* Модалка-календарь */
.calendar-modal-content {
    max-width: 920px;
    width: 100%;
    position: relative;
    overflow: hidden;
}
.calendar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-right: 40px;
}
.calendar-title {
    flex: 1;
    font-size: 16px;
    color: var(--t-text);
    text-transform: capitalize;
    text-align: center;
}
.calendar-nav-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--t-border);
    color: var(--t-text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}
.calendar-nav-btn:hover {
    background: var(--t-input-bg-focus);
    border-color: var(--t-border-strong);
}
.calendar-today-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(var(--t-accent-rgb), 0.35);
    color: rgba(var(--t-accent-rgb), 0.85);
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.calendar-today-btn:hover {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.65);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}
.calendar-weekday {
    text-align: center;
    font-size: 10px;
    color: var(--t-text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 4px 0;
}
/* Слайдер месяцев: viewport с overflow:hidden, внутри track с двумя сетками
   при переключении и одной в стационарном состоянии. */
.calendar-grid-viewport {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 600px;
}
.calendar-grid-track {
    display: flex;
    width: 100%;
    transition: transform 0.35s ease;
    will-change: transform;
}
.calendar-grid-track.no-anim { transition: none; }
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    flex: 0 0 100%;
    width: 100%;
}
.calendar-grid.loading { opacity: 0.45; }
.calendar-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--t-text-muted);
    font-size: 13px;
    padding: 40px 0;
}
.calendar-day {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 96px;
    overflow: visible;
    position: relative;
    min-width: 0;
}
.calendar-day.other-month {
    opacity: 0.4;
}
.calendar-day.today {
    border-color: rgba(var(--t-accent-rgb), 0.55);
    background: rgba(var(--t-accent-rgb), 0.05);
}
.calendar-day-num {
    font-size: 12px;
    font-weight: 600;
    color: var(--t-text);
    text-align: right;
    padding: 0 4px;
}
.calendar-day.today .calendar-day-num {
    color: var(--t-accent);
}
.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}
.calendar-event-tile {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    background: rgba(var(--t-accent-rgb), 0.14);
    border: 1px solid rgba(var(--t-accent-rgb), 0.3);
    border-radius: 4px;
    color: #cfe8ff;
    font-size: 11px;
    line-height: 1.25;
    cursor: pointer;
    text-align: left;
    overflow: hidden;
}
.calendar-event-tile.group {
    background: rgba(180, 140, 255, 0.14);
    border-color: rgba(180, 140, 255, 0.35);
    color: #e1d4ff;
}
.calendar-event-tile:hover {
    filter: brightness(1.25);
}
.calendar-day-md-wrap {
    position: absolute;
    top: 30px;
    left: 6px;
    right: 6px;
    z-index: 5;
    overflow: visible;
    pointer-events: none;
}
.calendar-event-tile.multiday {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    pointer-events: auto;
    flex-shrink: 0;
}
.calendar-event-tile.multiday-cont {
    border-left: 2px dashed rgba(var(--t-accent-rgb), 0.45);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.calendar-event-tile.multiday-cont.group {
    border-left-color: rgba(180, 140, 255, 0.45);
}
.calendar-event-tile.multiday-cont-end {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.calendar-event-tile .cal-ev-time {
    font-weight: 700;
    flex-shrink: 0;
    opacity: 0.85;
}
.calendar-event-tile .cal-ev-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* Тултип с деталями — поверх агенды «Сегодня» */
.calendar-tooltip {
    position: absolute;
    max-width: 280px;
    background: var(--t-panel);
    border: 1px solid var(--t-border-strong);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
    z-index: 30;
    font-size: 12px;
    color: var(--t-text);
    pointer-events: auto;
}
.calendar-tooltip-title {
    font-size: 14px;
    font-weight: 700;
    color: #e7e7e7;
    margin-bottom: 8px;
    padding-right: 72px;
    word-break: break-word;
}
.calendar-tooltip-print,
.calendar-tooltip-close {
    position: absolute;
    top: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--t-text-muted);
    border: 1px solid var(--t-border);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.calendar-tooltip-print { right: 44px; }
.calendar-tooltip-close { right: 8px; }
.calendar-tooltip-print:hover,
.calendar-tooltip-close:hover {
    background: var(--t-input-bg-focus);
    color: var(--t-text);
    border-color: var(--t-border-strong);
}
.calendar-tooltip-print svg,
.calendar-tooltip-close svg { display: block; }
body.light .calendar-tooltip-print,
body.light .calendar-tooltip-close { color: #556; border-color: #bcc3cc; }
body.light .calendar-tooltip-print:hover,
body.light .calendar-tooltip-close:hover { color: var(--t-accent-hover); border-color: var(--t-accent-hover); }
.calendar-tooltip-row {
    margin: 3px 0;
    word-break: break-word;
    white-space: pre-wrap;
}
.calendar-tooltip-label {
    color: #8a8a8a;
}
.calendar-tooltip-value {
    color: var(--t-text);
}

/* Анимация подсветки ячейки «сегодня» при клике на кнопку «Сегодня» */
@keyframes calendar-today-flash {
    0%   { box-shadow: 0 0 0 0 rgba(var(--t-accent-rgb), 0);   background: rgba(var(--t-accent-rgb), 0.05); }
    20%  { box-shadow: 0 0 0 6px rgba(var(--t-accent-rgb), 0.55); background: rgba(var(--t-accent-rgb), 0.18); }
    60%  { box-shadow: 0 0 0 2px rgba(var(--t-accent-rgb), 0.35); background: rgba(var(--t-accent-rgb), 0.12); }
    100% { box-shadow: 0 0 0 0 rgba(var(--t-accent-rgb), 0);   background: rgba(var(--t-accent-rgb), 0.05); }
}
.calendar-day.calendar-day-flash {
    animation: calendar-today-flash 1.4s ease-out 1;
}

/* Мини-агенда «Сегодня» — всплывает над сеткой */
.calendar-agenda {
    position: absolute;
    top: 60px;
    right: 16px;
    width: 280px;
    max-height: calc(100% - 80px);
    background: var(--t-panel);
    border: 1px solid var(--t-border-strong);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 12;
}
.calendar-agenda-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--t-border);
    padding-bottom: 8px;
}
.calendar-agenda-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--t-text);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}
.calendar-agenda-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--t-text-muted);
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    flex-shrink: 0;
}
.calendar-agenda-close:hover {
    background: var(--t-input-bg-focus);
    color: var(--t-text);
}
.calendar-agenda-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}
.calendar-agenda-empty {
    color: var(--t-text-muted);
    font-size: 12px;
    text-align: center;
    padding: 12px 0;
}
.calendar-agenda-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: rgba(var(--t-accent-rgb), 0.1);
    border: 1px solid rgba(var(--t-accent-rgb), 0.28);
    border-radius: 6px;
    color: #cfe8ff;
    font-size: 12px;
    cursor: pointer;
    text-align: left;
}
.calendar-agenda-row.group {
    background: rgba(180, 140, 255, 0.1);
    border-color: rgba(180, 140, 255, 0.32);
    color: #e1d4ff;
}
.calendar-agenda-row:hover { filter: brightness(1.2); }
.calendar-agenda-time {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.85;
}
.calendar-agenda-title-line {
    font-size: 13px;
    word-break: break-word;
}
.calendar-agenda-company {
    font-size: 10px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Поле ввода основного чата — визуально единое с групповым чатом */
#input-area {
    position: relative;
    bottom: 0;
    padding: 10px 14px;
    background: linear-gradient(to top, var(--t-input-gradient-end) 80%, transparent);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
    border-top: 1px solid var(--t-border);
    z-index: 20;
}
#userInput {
    flex: 1;
    background: var(--t-input-bg);
    color: var(--t-text);
    border: 1px solid var(--t-border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
    line-height: 1.4;
    transition: border-color 0.2s;
}
#userInput:focus { border-color: rgba(var(--t-accent-rgb), 0.4); }
#userInput:disabled { opacity: 0.4; cursor: not-allowed; }

.sendBtn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: #1f2e36;
    color: rgba(var(--t-accent-rgb), 0.8);
    border: 1px solid rgba(var(--t-accent-rgb), 0.25);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.sendBtn:hover:not(:disabled) {
    background: #476271;
    color: var(--t-accent);
}
.sendBtn:disabled { opacity: 0.4; cursor: not-allowed; }
.sendBtn.tokens-gated {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}
.sendBtn.tokens-gated:hover {
    background: transparent;
    color: inherit;
}
.sendBtn > img { width: 18px; height: 18px; object-fit: cover; }

.attachBtn,
.micBtn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: var(--t-surface);
    border: 1px solid var(--t-border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

/* Обёртка textarea с inline-кнопкой эмодзи. */
.textarea-emoji-wrap {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
}
.textarea-emoji-wrap > textarea { padding-right: 36px; }
.emoji-btn-inline {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--t-text-muted);
    opacity: 0.75;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: top 0.18s ease, bottom 0.18s ease, transform 0.18s ease, opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
    z-index: 2;
}
.emoji-btn-inline:hover,
.emoji-btn-inline.active { opacity: 1; color: var(--t-text); }
.emoji-btn-inline svg { width: 20px; height: 20px; }
/* После начала ввода уезжает в правый-нижний угол. */
.textarea-emoji-wrap.has-text .emoji-btn-inline {
    top: auto;
    bottom: 6px;
    transform: none;
}

/* Панель эмодзи — всплывает над инпутом. */
.emoji-picker {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    left: auto;
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--t-panel);
    border: 1px solid var(--t-border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    padding: 8px;
    z-index: 1000;
    box-sizing: border-box;
}
body.light .emoji-picker { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); }
.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 2px;
}
.emoji-picker-item {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.1s;
    -webkit-tap-highlight-color: transparent;
    min-width: 0;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.emoji-picker-item:hover { background: rgba(var(--t-accent-rgb), 0.15); }
body.light .emoji-picker-item:hover { background: rgba(var(--t-accent-rgb), 0.08); }
.attachBtn > img,
.micBtn > img {
    width: 18px;
    height: 18px;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.attachBtn:hover:not(:disabled),
.micBtn:hover:not(:disabled) { border-color: var(--t-border-strong); }
.attachBtn:hover:not(:disabled) > img,
.micBtn:hover:not(:disabled) > img { opacity: 1; }
.attachBtn:disabled,
.micBtn:disabled { opacity: 0.4; cursor: not-allowed; }
/* В светлой теме SVG иконки «скрепки» и «микрофона» захардкожены белым
   (stroke="#ffffff"). Инвертируем, чтобы они стали тёмными — в тон иконке
   динамика (.ttsToggleBtn), которая использует currentColor. */
body.light .attachBtn > img,
body.light .micBtn > img { filter: invert(1); }
/* При записи фон красный — иконка должна оставаться светлой для контраста. */
body.light .micBtn.recording > img { filter: none; }
.micBtn.recording {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.15);
    box-shadow: 0 0 12px rgba(255, 68, 68, 0.3);
    animation: mic-pulse 1.5s infinite;
}
.micBtn.recording > img { opacity: 1; }
@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 68, 68, 0.3); }
    50% { box-shadow: 0 0 25px rgba(255, 68, 68, 0.6); }
}

/* Drag & drop — подсветка распространяется на всё поле чата + инпут. */
#input-area.drag-over,
#chat-container.drag-over,
.group-chat-messages.drag-over,
.group-chat-input-area.drag-over {
    border: 2px dashed rgba(var(--t-accent-rgb), 0.4);
    background: rgba(var(--t-accent-rgb), 0.05);
}

/* Превью прикреплённых файлов */
#file-preview-bar {
    display: none;
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 0 8px 0;
    order: -1;
}
/* Стиль file-chip в чате Фотона — идентичен .gc-file-chip из групповых чатов */
.file-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--t-surface);
    border: 1px solid var(--t-border);
    border-radius: 16px;
    padding: 3px 8px 3px 3px;
    font-size: 11px;
    color: var(--t-text-muted);
    max-width: 180px;
}
.file-chip-thumb {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    object-fit: cover;
}
.file-chip-icon {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background: var(--t-surface-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    font-weight: 700;
    color: var(--t-text-muted);
}
.file-chip-name {
    white-space: normal;
    word-break: break-all;
}
.file-chip-remove {
    background: none;
    border: none;
    color: var(--t-text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    line-height: 1;
}
.file-chip-remove:hover { color: #ff5050; }

/* Вложения в сообщениях */
.msg-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.msg-attachment-img {
    max-width: 240px;
    max-height: 180px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    transition: border-color 0.3s;
}
.msg-attachment-img:hover { border-color: rgba(255,255,255,0.3); }


/* Галерея картинок (результат SEARCH_IMAGES) */
.msg .msg-image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}
.msg .msg-image {
    display: block;
    max-width: min(240px, 100%);
    max-height: 200px;
    width: auto;
    height: auto;
    margin: 0;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    cursor: zoom-in;
    background: rgba(255,255,255,0.02);
    object-fit: cover;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.msg .msg-image:hover {
    border-color: rgba(var(--t-accent-rgb), 0.55);
    box-shadow: 0 0 24px rgba(var(--t-accent-rgb), 0.18);
    transform: translateY(-1px);
}

/* Модалка просмотра картинок */
.image-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(5, 8, 16, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 40px 24px 60px;
    animation: imageModalFade 0.18s ease-out;
}
.image-modal.open { display: flex; }
@keyframes imageModalFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.image-modal-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    cursor: default;
    user-select: none;
    -webkit-user-drag: none;
}
.image-modal-caption {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    max-width: 90vw;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    text-align: center;
    line-height: 1.4;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    pointer-events: none;
}
.image-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--t-text-muted);
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    flex-shrink: 0;
}
.image-modal-close:hover {
    background: var(--t-input-bg-focus);
    color: var(--t-text);
}
.image-modal-download {
    position: absolute;
    top: 14px;
    right: 70px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.image-modal-download:hover {
    background: rgba(var(--t-accent-rgb), 0.22);
    border-color: rgba(var(--t-accent-rgb), 0.55);
    color: var(--t-accent);
}
body.image-modal-open { overflow: hidden; }
@media (max-width: 600px) {
    .image-modal { padding: 16px 8px 40px; }
    .image-modal-close { top: 8px; right: 8px; width: 36px; height: 36px; font-size: 22px; }
    .image-modal-download { top: 8px; right: 56px; width: 38px; height: 38px; font-size: 18px; }
    .image-modal-caption { font-size: 13px; bottom: 8px; }
}
.msg-attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(var(--t-accent-rgb), 0.08);
    border: 1px solid rgba(var(--t-accent-rgb), 0.2);
    border-radius: 10px;
    color: rgba(var(--t-accent-rgb), 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    margin: 4px 0;
}
.msg-attachment-link:hover {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.5);
    box-shadow: 0 0 15px rgba(var(--t-accent-rgb), 0.15);
}
.msg-attachment-link::before { content: '\1F4CE '; }
body.light .msg-attachment-link {
    background: rgba(var(--t-accent-rgb), 0.10);
    border-color: rgba(var(--t-accent-rgb), 0.35);
    color: var(--t-accent);
}
body.light .msg-attachment-link:hover {
    color: #083f65;
    border-color: rgba(var(--t-accent-rgb), 0.6);
    box-shadow: 0 0 15px rgba(var(--t-accent-rgb), 0.15);
}
.msg-file-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(var(--t-accent-rgb), 0.08);
    border: 1px solid rgba(var(--t-accent-rgb), 0.2);
    border-radius: 10px;
    color: rgba(var(--t-accent-rgb), 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    margin: 4px 0;
}
.msg-file-link:hover {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.5);
    box-shadow: 0 0 15px rgba(var(--t-accent-rgb), 0.15);
}
.msg-file-link::before { content: '\1F4CE '; }
.msg-file-link--external::before { content: '\1F517 '; }

/* Дата-разделитель в ленте сообщений */
.msg-date-divider {
    align-self: center;
    margin: 14px 0 6px;
    padding: 4px 14px;
    font-size: 12px;
    letter-spacing: 0.4px;
    color: var(--t-chat-foton-text, #d6d6d6);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    text-transform: lowercase;
    user-select: none;
    opacity: 0.75;
}
body.light .msg-date-divider {
    color: #4a4a4a;
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
    opacity: 0.85;
}

/* Метка времени сообщения в правом нижнем углу */
.msg-time {
    position: absolute;
    bottom: 6px;
    right: 12px;
    font-size: 11px;
    letter-spacing: 0.3px;
    opacity: 0.5;
    font-style: normal;
    pointer-events: none;
    user-select: none;
}
.msg.has-tts .msg-time {
    right: 42px;
}
/* При наличии кнопки копирования: сдвигаем время и tts левее */
.msg.has-copy .msg-time { right: 42px; }
.msg.has-copy.has-tts .msg-time { right: 74px; }
.msg.has-copy .msg-tts-btn { right: 40px; }
body.light .msg-time { opacity: 0.6; }

/* Кнопка озвучки в сообщении */
.msg-tts-btn {
    position: absolute;
    bottom: 4px;
    right: 8px;
    width: 26px;
    height: 26px;
    padding: 4px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.msg-tts-btn > img {
    width: 14px;
    height: 14px;
    filter: invert(1);
    opacity: 0.7;
}
.msg-tts-btn:hover {
    opacity: 0.8;
    border-color: rgba(var(--t-accent-rgb), 0.3);
}
.msg-tts-btn.playing {
    opacity: 1;
    border-color: rgba(var(--t-accent-rgb), 0.5);
    background: rgba(var(--t-accent-rgb), 0.1);
    animation: tts-pulse 1.5s infinite;
}
.msg-tts-btn.loading {
    opacity: 0.6;
}
.msg-tts-btn.loading::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--t-accent);
    animation: tts-spin 0.9s linear infinite;
    pointer-events: none;
}
body.light .msg-tts-btn.loading::before { border-top-color: var(--t-accent); }
body.light .msg-tts-btn {
    border-color: rgba(0,0,0,0.25);
    opacity: 0.55;
}
body.light .msg-tts-btn > img {
    filter: none;
    opacity: 0.85;
}
body.light .msg-tts-btn:hover {
    opacity: 0.9;
    border-color: rgba(30, 100, 160, 0.55);
}
@keyframes tts-pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(var(--t-accent-rgb), 0.2); }
    50% { box-shadow: 0 0 15px rgba(var(--t-accent-rgb), 0.4); }
}
@keyframes tts-spin {
    to { transform: rotate(360deg); }
}

/* Кнопка копирования сообщения в правом нижнем углу */
.msg-copy-btn {
    position: absolute;
    bottom: 4px;
    right: 8px;
    width: 26px;
    height: 26px;
    padding: 4px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    font: inherit;
    color: inherit;
    line-height: 0;
    box-shadow: none;
}
.msg-copy-btn > img {
    width: 14px;
    height: 14px;
    filter: invert(1);
    opacity: 0.7;
}
.msg-copy-btn:hover {
    opacity: 0.8;
    border-color: rgba(var(--t-accent-rgb), 0.3);
}
.msg-copy-btn.copied {
    opacity: 1;
    border-color: rgba(120, 220, 160, 0.6);
    background: rgba(120, 220, 160, 0.15);
}
body.light .msg-copy-btn {
    border-color: rgba(0,0,0,0.25);
    opacity: 0.55;
}
body.light .msg-copy-btn > img {
    filter: none;
    opacity: 0.85;
}
body.light .msg-copy-btn:hover {
    opacity: 0.9;
    border-color: rgba(30, 100, 160, 0.55);
}

/* Кнопка авто-озвучки — размер как у mic/attach, визуал как в групповом чате */
.ttsToggleBtn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: var(--t-surface);
    border: 1px solid var(--t-border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}
.ttsToggleBtn > img {
    width: 18px;
    height: 18px;
    object-fit: cover;
    filter: invert(1);
    opacity: 0.6;
    transition: opacity 0.2s;
}
.ttsToggleBtn:hover { border-color: var(--t-border-strong); }
.ttsToggleBtn:hover > img { opacity: 1; }
.ttsToggleBtn.active {
    border-color: rgba(var(--t-accent-rgb), 0.5);
    background: rgba(var(--t-accent-rgb), 0.1);
    box-shadow: 0 0 12px rgba(var(--t-accent-rgb), 0.25);
}
.ttsToggleBtn.active > img { opacity: 1; }
body.light .ttsToggleBtn > img { filter: none; }

/* Селектор голоса */
#tts-voice-select,
#ui-language-select {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.3s;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
#tts-voice-select:focus,
#ui-language-select:focus { border-color: rgba(255,255,255,0.3); }
#tts-voice-select option,
#ui-language-select option { background: #1a1a1a; color: #fff; }

/* Кастомный выпадающий список (подмена нативного <select>) */
.custom-select {
    position: relative;
    width: 100%;
}
.custom-select-trigger {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 10px 36px 10px 14px;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.3s;
    font-family: inherit;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus {
    border-color: rgba(255,255,255,0.3);
}
.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: var(--t-panel);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 6px;
    display: none;
    z-index: 150;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-height: 240px;
    overflow-y: auto;
}
.custom-select.open .custom-select-dropdown {
    display: block;
}
.custom-select.open-up .custom-select-dropdown {
    top: auto;
    bottom: calc(100% + 10px);
}
.custom-select-option {
    padding: 9px 12px;
    border-radius: 8px;
    color: #e7e7e7;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}
.custom-select-option:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.custom-select-option.selected {
    background: rgba(var(--t-accent-rgb), 0.12);
    color: #fff;
}

/* Контейнер кнопок: десктоп — вертикальная «пилюля» справа, по центру высоты */
#side-panel-btns {
    position: fixed;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 30px;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 50;
}
body.light #side-panel-btns {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

/* ==== Унифицированные стили для всех кнопок боковых панелей ==== */
#side-panel-btns > button {
    position: relative;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    padding: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(25px);
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
}
#side-panel-btns > button > img {
    height: unset;
    width: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}
#side-panel-btns > button:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}
body.light #side-panel-btns > button {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}
body.light #side-panel-btns > button:hover {
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 20px rgba(80, 120, 255, 0.2);
}

/* Тултипы кнопок таблетки: на десктопе — слева от кнопки в 10px (таблетка
   стоит вертикально у правого края). На мобилке (≤768px) правило не действует —
   работает базовый [data-tooltip]::after, показывающий тултип сверху. */
@media (min-width: 769px) {
    #side-panel-btns > button[data-tooltip]::after {
        bottom: auto;
        top: 50%;
        left: auto;
        right: calc(100% + 10px);
        transform: translateY(-50%) translateX(4px);
    }
    #side-panel-btns > button[data-tooltip]:hover::after,
    #side-panel-btns > button[data-tooltip]:focus-visible::after {
        transform: translateY(-50%) translateX(0);
    }
}

/* Переключатель темы */
#theme-toggle-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    padding: 0;
    background: var(--t-surface);
    border: 1px solid var(--t-border);
    backdrop-filter: blur(25px);
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
}
#theme-toggle-btn > img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    transition: transform 0.5s ease;
}
#theme-toggle-btn:hover {
    border-color: var(--t-border-strong);
    box-shadow: 0 0 20px rgba(255, 200, 80, 0.25);
}
body.light #theme-toggle-btn:hover {
    box-shadow: 0 0 20px rgba(80, 120, 255, 0.2);
}
body.light #theme-toggle-btn > img {
    transform: rotate(180deg);
}

/* Панель Души */


#soul-badge {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    box-sizing: border-box;
    background: #ff8c00;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.6);
    animation: soul-badge-pulse 1.8s ease-in-out infinite;
    pointer-events: none;
}
@keyframes soul-badge-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 140, 0, 0.5); transform: scale(1); }
    50%      { box-shadow: 0 0 18px rgba(255, 140, 0, 1);   transform: scale(1.08); }
}














/* Карточки кандидатов */












#soul-status {
    font-size: 13px;
    color: #555;
    text-align: center;
    min-height: 16px;
    transition: color 0.3s;
}

/* Панель Директив Фотона */






#additions-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 20px;
    border-right: 5px solid transparent;
    box-sizing: border-box;
}














/* Модальное окно директив */



#photon_soul-modal-text {
    color: #e0e0e0;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    word-break: break-word;
}
.photon_soul-modal-actions {
    display: flex;
    gap: 10px;
}
.photon_soul-modal-actions button {
    flex: 1;
    padding: 10px;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}
#photon_soul-modal-ok {
    border: 1px solid rgba(255, 100, 100, 0.2);
    color: rgba(255, 100, 100, 0.6);
}
#photon_soul-modal-ok:hover {
    color: #ff6464;
    border-color: rgba(255, 100, 100, 0.5);
}
#photon_soul-modal-ok.modal-ok-green {
    border-color: rgba(76, 175, 80, 0.35);
    color: rgba(76, 175, 80, 0.8);
}
#photon_soul-modal-ok.modal-ok-green:hover {
    color: #66bb6a;
    border-color: rgba(76, 175, 80, 0.6);
}
body.light #photon_soul-modal-ok.modal-ok-green {
    border-color: rgba(56, 142, 60, 0.35);
    color: #2e7d32;
}
body.light #photon_soul-modal-ok.modal-ok-green:hover {
    color: #1b5e20;
    border-color: rgba(56, 142, 60, 0.5);
}
#photon_soul-modal-cancel {
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.55);
}
#photon_soul-modal-cancel:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

/* Панель Идей и задач Фотона */






#candidates-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-right: 20px;
    border-right: 5px solid transparent;
    box-sizing: border-box;
}

















.candidate-tooltip {
    position: absolute;
    background: #ff6464;
    color: #fff;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.candidate-tooltip::after {
    content: '';
    position: absolute;
    top: -4px;
    left: 16px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #ff6464;
}

/* Модальное окно идей */




/* Панель Промпта Фотона */







#photon_soul-create-btn {
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(var(--t-accent-rgb), 0.2);
    color: rgba(var(--t-accent-rgb), 0.6);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
}
#photon_soul-create-btn:hover {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.5);
    box-shadow: 0 0 15px rgba(var(--t-accent-rgb), 0.1);
}
#photon_soul-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-right: 20px;
    border-right: 5px solid transparent;
    box-sizing: border-box;
}









/* Авторесайз textarea в мастер-панелях: скрываем скроллбар, высоту считает JS. */




























.photon_soul-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    /* 25000: выше .dash-sub-info-modal (20050) — чтобы подтверждение
       всегда было поверх любой основной модалки (продление роли,
       покупка слотов, плашка подписки и т.п.). */
    z-index: 25000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.photon_soul-modal.active {
    display: flex;
}
.photon_soul-modal-content {
    background: var(--t-panel);
    border: 1px solid var(--t-border);
    border-radius: 15px;
    padding: 25px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

/* Ручка ресайза для боковых панелей */


body.panel-resizing {
    cursor: ew-resize !important;
    user-select: none;
}
body.panel-resizing * {
    cursor: ew-resize !important;
}

/* Состояния цветового резонанса. Фон вешаем на HTML (body прозрачный,
   чтобы canvas #photon-bg с z-index:-1 был виден сквозь). */
html:has(body.master) { background: #000; }
body.master #line { opacity: 0.7; box-shadow: 0 0 40px #fff; }
html:has(body.alisa) { background: #120512; }
body.alisa #line { background: var(--alisa-accent); box-shadow: 0 0 30px var(--alisa-accent); opacity: 0.4; }
html:has(body.evgeniy) { background: #051212; }
body.evgeniy #line { background: var(--evgeniy-accent); box-shadow: 0 0 30px var(--evgeniy-accent); opacity: 0.4; }
html:has(body.anton) { background: #121205; }
body.anton #line { background: var(--anton-accent); box-shadow: 0 0 30px var(--anton-accent); opacity: 0.4; }

/* В светлой теме ролевые тёмные фоны сбрасываются на общий токен
   (на HTML, body остаётся transparent ради canvas #photon-bg).
   `!important` нужен потому что ролевые правила html:has(body.master) и т.п.
   объявлены выше с такой же специфичностью — без !important проигрывали по
   правилу «последнего в каскаде» только в части браузеров. */
html:has(body.light) { background: var(--t-bg) !important; }
body.light.master #line { box-shadow: 0 0 40px #000; }

/* ============ ПЛАНИРОВЩИК МЕРОПРИЯТИЙ ============ */

/* Кнопка вызова + бейдж */
#events-panel-btn {
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    padding: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(25px);
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
}
#events-panel-btn > img {
    height: 100%;
    object-fit: cover;
}
#events-panel-btn:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 0 20px rgba(255,255,255,0.15);
}
#events-badge {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    box-sizing: border-box;
    background: #ff8c00;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.6);
    animation: soul-badge-pulse 1.8s ease-in-out infinite;
    pointer-events: none;
}

/* Бэйдж кнопки чатов — идентичен events-badge */
#chats-badge {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    box-sizing: border-box;
    background: #ff8c00;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.6);
    animation: soul-badge-pulse 1.8s ease-in-out infinite;
    pointer-events: none;
}

/* Список групп в чат-модалке */
.gc-groups-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.gc-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--t-surface);
    border: 1px solid var(--t-border);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.gc-group-item:hover {
    background: var(--t-surface-strong);
    border-color: var(--t-border-strong);
}
.gc-group-item-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--t-text);
}
.gc-group-item-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    box-sizing: border-box;
    background: #6b7480;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
}
.gc-back-btn {
    background: none;
    border: none;
    color: var(--t-text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0 8px 0 0;
    line-height: 1;
    transition: color 0.2s;
}
.gc-back-btn:hover {
    color: var(--t-text);
}

/* Панель */
#events-panel {
    position: fixed;
    top: 30px;
    bottom: 30px;
    right: 20px;
    transform: translateX(calc(100% + 40px));
    transition: transform 0.5s ease;
    width: 450px;
    min-width: 450px;
    box-sizing: border-box;
    overflow: hidden;
    background: var(--t-panel);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 25px;
    z-index: 100;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
#events-panel.active {
    transform: translateX(0);
}
/* Когда панель доходит до 70px левого края экрана, пилюля управления прячется
   внутрь левого паддинга панели — освобождаем место и добавляем визуальный
   ритм слева. JS добавляет/снимает этот класс. */
#events-panel.has-inset-controls {
    padding-left: 70px;
    transition: transform 0.5s ease, padding 0.2s ease;
}
/* Пилюля кнопок управления панели «Планы» — снаружи, левее панели на 10px.
   Положение по горизонтали (right) задаёт JS, отслеживая ширину панели.
   top: 40px = panel.top (30) + 10px зазор. */
#events-panel-controls {
    position: fixed;
    top: 40px;
    z-index: 101;
    background: var(--t-panel);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
/* Видна, только когда панель «Планы» открыта (sibling combinator). */
#events-panel.active ~ #events-panel-controls {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.25s ease;
}
#events-panel-controls > button {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    margin: 0;
    width: 28px;
    height: 28px;
    min-width: 28px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
    border: 1px solid rgba(var(--t-accent-rgb), 0.3);
    color: rgba(var(--t-accent-rgb), 0.85);
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}
#events-panel-controls > button:hover {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.65);
    background: rgba(var(--t-accent-rgb), 0.08);
}
#events-panel-controls > button > svg { display: block; }
#events-panel-controls > button > span { pointer-events: none; line-height: 1; }
body.light #events-panel-controls {
    background: var(--t-panel);
    border-color: rgba(0, 0, 0, 0.08);
}
body.light #events-panel-controls > button {
    border-color: rgba(var(--t-accent-rgb), 0.35);
    color: rgba(var(--t-accent-rgb), 0.85);
}
body.light #events-panel-controls > button:hover {
    border-color: rgba(var(--t-accent-rgb), 0.65);
    background: rgba(var(--t-accent-rgb), 0.10);
}
/* Тултипы кнопок пилюли — справа, ровно по высоте кнопки, цвет в тон. */
#events-panel-controls > button[data-tooltip]::after {
    bottom: auto !important;
    top: 0 !important;
    left: calc(100% + 10px) !important;
    transform: translateX(-4px) !important;
    height: 28px !important;
    padding: 0 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
    background: var(--t-accent) !important;
    color: #ffffff !important;
}
#events-panel-controls > button[data-tooltip]:hover::after,
#events-panel-controls > button[data-tooltip]:focus-visible::after {
    transform: translateX(0) !important;
}
body.light #events-panel-controls > button[data-tooltip]::after {
    background: var(--t-accent) !important;
    color: #ffffff !important;
}

/* Левый ресайзер панели «Планы» (десктоп). На мобилке скрыт. */
#events-panel-resizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
    z-index: 1;
    background: transparent;
    transition: background 0.15s ease;
}
#events-panel-resizer:hover,
#events-panel.is-resizing #events-panel-resizer {
    background: rgba(var(--t-accent-rgb), 0.18);
}

/* Во время drag отключаем transition, чтобы ширина шла за курсором без лагов */
#events-panel.is-resizing {
    transition: none;
}
/* 2 карточки в ряд, когда панель >= 50% viewport (групповые и личные) */
#companies-list.cards-grid-2,
#events-list.cards-grid-2,
.events-past-archive-list.cards-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
/* В 2-колоночном режиме блок «Показать прошедшие» всегда тянется на всю ширину,
   чтобы быть строго под актуальными карточками. */
#events-list.cards-grid-2 .events-past-archive {
    grid-column: 1 / -1;
}
#events-create-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 8px 0 14px 0;
    background: transparent;
    border: 1px solid rgba(var(--t-accent-rgb), 0.2);
    color: rgba(var(--t-accent-rgb), 0.6);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
}
#events-create-btn:hover {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.5);
    box-shadow: 0 0 15px rgba(var(--t-accent-rgb), 0.1);
}

.events-field-label {
    font-size: 11px;
    color: var(--t-text);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 5px;
}
/* Пикер дней недели для «Повторяющегося» события */
.events-weekdays {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.events-weekday-btn {
    flex: 1 1 38px;
    min-width: 38px;
    padding: 8px 0;
    border-radius: 8px;
    border: 1px solid var(--t-border);
    background: transparent;
    color: var(--t-text-muted);
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.events-weekday-btn:hover:not(:disabled) { border-color: var(--t-border-strong); }
.events-weekday-btn.active {
    background: rgba(var(--t-accent-rgb), 0.18);
    border-color: rgba(var(--t-accent-rgb), 0.6);
    color: var(--t-accent);
    font-weight: 600;
}
.events-weekday-btn:disabled { opacity: 0.5; cursor: default; }
/* number-input без стрелок-спиннеров: для duration-min и других числовых
   полей внутри форм события. По умолчанию браузеры рисуют up/down кнопки,
   которые визуально шумят. */
.events-input[type="number"]::-webkit-outer-spin-button,
.events-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.events-input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
.events-field-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 6px;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}
body.light .events-field-hint { color: rgba(0, 0, 0, 0.55); }
.events-input {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s;
}
textarea.events-input {
    min-height: 46px;
    /* Высота выставляется JS-ом (auto-size под контент). Пользователю
       нужен resize только для ручной подстройки — но overflow:hidden
       убирает внутренний скроллбар: если JS поставил высоту правильно,
       скролл не нужен. */
    resize: vertical;
    overflow: hidden;
}
textarea.events-input:focus {
    /* На фокусе временно возвращаем скролл — при длинном вводе
       подгонка идёт через input-listener, но между кадрами может мелькать
       клип. Так визуально плавнее. */
    overflow: auto;
}
.events-input:focus {
    border-color: rgba(255,255,255,0.3);
}
.events-input[type="date"]::-webkit-calendar-picker-indicator,
.events-input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.8;
}
.events-input[type="date"]::-webkit-calendar-picker-indicator:hover,
.events-input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}
.events-form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.events-form-actions button {
    flex: 1;
    padding: 6px 10px;
    background: transparent;
    border-radius: 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    cursor: pointer;
}
#events-form-cancel {
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
}
#events-form-cancel:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}
#events-form-save {
    border: 1px solid rgba(100, 255, 150, 0.2);
    color: rgba(100, 255, 150, 0.6);
}
#events-form-save:hover:not(:disabled) {
    color: #64ff96;
    border-color: rgba(100, 255, 150, 0.5);
}
#events-form-save:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Список */
#events-list {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
    padding-right: 8px;
    scrollbar-gutter: stable;
}
#events-list > * { max-width: 100%; min-width: 0; }
/* Sentinel для lazy-пагинации списков — невидимый якорь у конца */
.list-load-sentinel {
    height: 1px;
    width: 100%;
    flex-shrink: 0;
    pointer-events: none;
}
.events-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
    min-width: 0;
    overflow-wrap: anywhere;
}
.events-item > * { min-width: 0; max-width: 100%; }
/* Плашка ближайшего группового мероприятия — тот же пульсирующий
   оранжевый glow, что и у бейджа на кнопке «Мероприятия». */
.events-item.events-item-nearest {
    animation: events-item-nearest-pulse 1.8s ease-in-out infinite;
    border-color: rgba(255, 140, 0, 0.55);
}
.events-item.events-item-nearest:hover {
    border-color: rgba(255, 140, 0, 0.8);
}
@keyframes events-item-nearest-pulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(255, 140, 0, 0.35);
        border-color: rgba(255, 140, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 140, 0, 0.75);
        border-color: rgba(255, 140, 0, 0.75);
    }
}
.events-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(var(--t-accent-rgb), 0.25);
}
.events-item.events-item-editing {
    cursor: default;
}
.events-item.events-item-editing:hover {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.07);
}
/* Крестик удаления в правом верхнем углу плашки личного мероприятия */
.events-item > .events-item-del {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: rgba(255, 120, 120, 0.55);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}
.events-item > .events-item-del:hover {
    color: #ff8a8a;
    background: rgba(255, 80, 80, 0.12);
}
.events-item > .events-item-print {
    position: absolute;
    top: 6px;
    right: 42px;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--t-text-muted);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}
.events-item > .events-item-print:hover {
    color: var(--t-text);
    background: rgba(120, 180, 255, 0.12);
}
.events-item > .events-item-print svg { display: block; }
body.light .events-item > .events-item-print { color: #668; }
body.light .events-item > .events-item-print:hover { color: var(--t-accent-hover); background: rgba(var(--t-accent-rgb), 0.08); }

/* Кнопка печати в шапке модалки редактирования мероприятия */
.companies-modal-header .companies-modal-print {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--t-text-muted);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}
.companies-modal-header .companies-modal-print:hover {
    background: var(--t-input-bg-focus);
    color: var(--t-text);
}
.companies-modal-header .companies-modal-print svg { display: block; }
body.light .companies-modal-header .companies-modal-print { color: #556; }
body.light .companies-modal-header .companies-modal-print:hover { color: var(--t-accent-hover); }

/* Заголовок плашки не заезжает под крестик/принтер */
.events-item > .events-item-title {
    padding-right: 74px;
}

/* Модалка редактирования личного мероприятия */
.personal-event-modal-content {
    max-width: 520px;
}
.personal-event-modal-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #e7e7e7;
    padding-right: 36px;
    word-break: break-word;
}
.personal-event-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.events-item-when {
    font-size: 12px;
    color: #c7c7c7;
    letter-spacing: 1px;
    text-transform: uppercase;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.events-item-type {
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #00a2ff;
    border: none;
    background: rgba(0, 162, 255, 0.12);
    border-radius: 5px;
    padding: 2px 7px;
    align-self: flex-start;
}
/* Клубное событие (read-only у обычных юзеров) — акцентный бейдж. */
.events-item-club-badge {
    color: var(--t-accent);
    background: rgba(var(--t-accent-rgb), 0.14);
}
.events-item-club-ro { cursor: pointer; }
select.events-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #c7c7c7 50%), linear-gradient(135deg, #c7c7c7 50%, transparent 50%);
    background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 28px;
}
select.events-input option {
    background: #111;
    color: #fff;
}

/* Events-form dropdown (initCustomSelect в js.js). Отдельный namespace,
   чтобы не конфликтовать с .custom-select из enhanceSelect (settings). */
.events-select {
    position: relative;
}
.events-select > select {
    display: none !important;
}
.events-select-button {
    width: 100%;
    text-align: left;
    cursor: pointer;
    position: relative;
    padding-right: 28px;
    font-size: 14px;
    font-family: inherit;
}
.events-select-button::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-right: 1px solid #c7c7c7;
    border-bottom: 1px solid #c7c7c7;
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
    transition: transform 0.2s;
}
.events-select.open .events-select-button::after {
    transform: translateY(-30%) rotate(-135deg);
}
.events-select-list {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 10px);
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    list-style: none;
    padding: 6px;
    margin: 0;
    z-index: 100;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}
.events-select.open .events-select-list {
    display: block;
}
.events-select.open-up .events-select-list {
    top: auto;
    bottom: calc(100% + 10px);
}
.events-select-option {
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: #c7c7c7;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}
.events-select-option:hover,
.events-select-option.selected {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.events-item-title {
    font-size: 17px;
    color: #e7e7e7;
    font-weight: 600;
    word-break: break-word;
    margin: 0px;
}
.events-item-field {
    font-size: 13px;
    color: #b5b5b5;
    word-break: break-word;
}
.events-item-field-label {
    color: #8a8a8a;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
}
.events-item-field-value {
    color: #e0e0e0;
}
.events-item-place,
.events-item-details {
    font-size: 13px;
    color: #9a9a9a;
    word-break: break-word;
    white-space: pre-wrap;
}
/* Ограничение описания события 2 строками */
.events-item-details {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}
.events-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.events-item-actions button {
    flex: 1;
    padding: 6px 10px;
    background: transparent;
    border-radius: 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    cursor: pointer;
    border: 1px solid rgba(255, 100, 100, 0.2);
    color: rgba(255, 100, 100, 0.5);
}
.events-item-actions button:hover {
    color: #ff6464;
    border-color: rgba(255, 100, 100, 0.4);
}
.events-item-actions .events-edit-btn {
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.55);
}
.events-item-actions .events-edit-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}
.events-item-editing .events-form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.events-item-editing .events-form-actions button {
    flex: 1;
    padding: 6px 10px;
    background: transparent;
    border-radius: 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    cursor: pointer;
}
.events-item-editing .events-edit-cancel {
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
}
.events-item-editing .events-edit-cancel:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}
.events-item-editing .events-edit-save {
    border: 1px solid rgba(100, 255, 150, 0.2);
    color: rgba(100, 255, 150, 0.6);
}
.events-item-editing .events-edit-save:hover:not(:disabled) {
    color: #64ff96;
    border-color: rgba(100, 255, 150, 0.5);
}
.events-item-editing .events-edit-save:disabled,
.events-item-editing .events-edit-cancel:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Прошедшие экземпляры в модалке группового мероприятия */
#company-event-reports-list.past-occurrences-mode {
    gap: 12px;
}
.company-past-occurrence-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.company-past-occurrence-item.empty {
    opacity: 0.55;
}
.company-past-occurrence-item .events-past-head {
    font-size: 11px;
    color: #9a9a9a;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    padding-bottom: 6px;
}
.company-past-occurrence-item .company-report-item {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Прошедшие экземпляры цикличных событий */
.events-past-occurrences {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.events-past-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 2px;
}
.events-past-item {
    padding: 6px 10px;
    border-left: 2px solid rgba(var(--t-accent-rgb),0.25);
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
}
.events-past-item.empty {
    border-left-color: rgba(255,255,255,0.12);
    opacity: 0.6;
}
.events-past-head {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}
.events-past-body {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    white-space: pre-wrap;
    word-break: break-word;
}
.events-past-item.empty .events-past-body {
    font-style: italic;
    color: rgba(255,255,255,0.4);
}
.events-past-iteration-plan {
    margin: 4px 0 8px;
    padding: 6px 9px;
    background: rgba(var(--t-accent-rgb), 0.06);
    border-left: 2px solid rgba(var(--t-accent-rgb), 0.35);
    border-radius: 4px;
}
.events-past-iteration-plan-label {
    font-size: 10.5px;
    color: rgba(var(--t-accent-rgb), 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.events-past-iteration-plan-body {
    font-size: 12.5px;
    color: rgba(255,255,255,0.85);
    white-space: pre-wrap;
    word-break: break-word;
}
.events-past-iteration-plan.empty .events-past-iteration-plan-body {
    font-style: italic;
    color: rgba(255,255,255,0.4);
}
body.light .events-past-iteration-plan {
    background: rgba(30, 100, 160, 0.05);
    border-left-color: rgba(30, 100, 160, 0.35);
}
body.light .events-past-iteration-plan-label { color: rgba(30, 100, 160, 0.75); }
body.light .events-past-iteration-plan-body { color: rgba(0,0,0,0.85); }
body.light .events-past-iteration-plan.empty .events-past-iteration-plan-body { color: rgba(0,0,0,0.4); }
body.light .events-past-occurrences {
    border-top-color: rgba(0,0,0,0.12);
}
body.light .events-past-title { color: rgba(0,0,0,0.5); }
body.light .events-past-item {
    background: rgba(0,0,0,0.03);
    border-left-color: rgba(30,100,160,0.35);
}
body.light .events-past-item.empty { border-left-color: rgba(0,0,0,0.15); }
body.light .events-past-head { color: rgba(0,0,0,0.55); }
body.light .events-past-body { color: rgba(0,0,0,0.85); }
body.light .events-past-item.empty .events-past-body { color: rgba(0,0,0,0.4); }

#events-empty {
    color: #7a7a7a;
    text-align: center;
    padding: 20px 0;
    font-size: 13px;
}

/* =========================================================
   СВЕТЛАЯ ТЕМА — точечные переопределения для элементов
   с жёстко зашитыми белыми/полу-прозрачными значениями.
   Цвета предварительные, легко править.
   ========================================================= */
body.light .msg code {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a1a;
}
body.light .msg pre {
    background: rgba(0, 0, 0, 0.04);
    color: #1a1a1a;
}
body.light .loading { color: #888; }

body.light #events-panel-btn,
body.light #profile-panel,
body.light #theme-toggle-btn {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}
body.light #profile-panel.sub-inactive { border-color: #b74141; }
body.light #profile-panel.sub-standard { border-color: #2e7d4f; }
body.light #profile-panel.sub-pro { border-color: #7a3fc8; }

body.light #tts-voice-select,
body.light #ui-language-select,
body.light .events-input,
body.light .events-select-button,
body.light .custom-select-trigger,
body.light .profile-field input,
body.light .profile-field textarea {
    background-color: #e4e4e4;
    color: #1a1a1a;
    border: 1px solid rgba(0, 0, 0, 0.2);
}
body.light .profile-field-hint {
    color: rgba(0,0,0,0.55);
}
/* Стрелка в триггере профильного enhanceSelect — тёмная для светлой темы */
body.light .custom-select-trigger {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
body.light #tts-voice-select option,
body.light #ui-language-select option {
    background: #ffffff;
    color: #1a1a1a;
}
body.light #tts-voice-select:focus,
body.light #ui-language-select:focus,
body.light .events-input:focus,
body.light .profile-field input:focus,
body.light .custom-select.open .custom-select-trigger,
body.light .custom-select-trigger:focus {
    background-color: #dcdcdc;
    border-color: rgba(0, 0, 0, 0.45);
}

/* Выпадающий список профильного селектора */
body.light .custom-select-dropdown {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}
body.light .custom-select-dropdown .custom-select-option {
    color: #1a1a1a;
}
body.light .custom-select-dropdown .custom-select-option:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #1a1a1a;
}
body.light .custom-select-dropdown .custom-select-option.selected {
    background: rgba(0, 162, 255, 0.15);
    color: #1a1a1a;
}
body.light .events-input::placeholder,
body.light .profile-field input::placeholder {
    color: #6a6a6a;
}
body.light select.events-input {
    background-image: linear-gradient(45deg, transparent 50%, #1a1a1a 50%), linear-gradient(135deg, #1a1a1a 50%, transparent 50%);
}
body.light select.events-input option {
    background: #ffffff;
    color: #1a1a1a;
}
body.light .events-input[type="date"]::-webkit-calendar-picker-indicator,
body.light .events-input[type="time"]::-webkit-calendar-picker-indicator {
    filter: none;
}
body.light .events-select-list {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}
body.light .events-select-option {
    color: #1a1a1a;
}
body.light .events-select-option:hover,
body.light .events-select-option.selected {
    background: rgba(0, 0, 0, 0.05);
    color: #000;
}
body.light .events-select-button::after {
    border-color: #1a1a1a;
}

/* Плашки (карточки) во всех боковых панелях */
body.light .events-item {
    background: #f3f3f3;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}


/* Инпуты и textarea внутри карточек — как основной инпут сообщений */


body.light .candidate-input::placeholder {
    color: #6a6a6a;
}



/* Тексты всех боковых панелей — единый тёмный цвет,
   кроме специальных бейджей (голубой "Повторяющийся" и т.п.)
   и текстов кнопок, которым даём собственные правила. */
body.light #user-profile-details,
body.light #user-profile-details *:not(button):not(.events-item-type),
body.light #events-panel,
body.light #events-panel *:not(button):not(.events-item-type):not(.events-tab-badge) {
    color: #1a1a1a;
}

body.light .profile-tokens-block {
    background: rgba(0, 0, 0, 0.045);
    border-color: rgba(0, 0, 0, 0.12);
}
body.light #user-profile-details .profile-subscription-btn,
body.light #user-profile-details .profile-subscription-btn *,
body.light .dash-tokens-sub-btn,
body.light .dash-tokens-sub-btn * {
    color: #ffffff !important;
}

/* Кнопка "Загрузить фото" — отдельная палитра: #444 / hover #1a1a1a */
body.light #avatar-upload-label {
    color: #444;
    border-color: rgba(0, 0, 0, 0.2);
}
body.light #avatar-upload-label:hover {
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.45);
}

/* === Кнопки действий в боковых панелях для светлой темы ===
   В тёмной теме они белые/светло-серые на прозрачном фоне,
   на светлом это теряется. Делаем их читаемыми. */

/* === Унифицированная палитра кнопок в светлой теме === */

/* "Нейтральные" — create / profile-save / cancel / edit */
body.light .profile-save-btn,
body.light #photon_soul-create-btn,
body.light #events-create-btn,
body.light #events-form-cancel,
body.light .events-item-editing .events-edit-cancel,
body.light .events-item-actions .events-edit-btn {
    color: #1a1a1a;
    border: 1px solid rgba(0, 0, 0, 0.35);
    background: rgba(0, 0, 0, 0.06);
}
body.light .profile-save-btn:hover:not(:disabled),
body.light #photon_soul-create-btn:hover,
body.light #events-create-btn:hover,
body.light #events-form-cancel:hover,
body.light .events-item-editing .events-edit-cancel:hover,
body.light .events-item-actions .events-edit-btn:hover {
    color: #ffffff;
    background: #1a1a1a;
    border-color: #1a1a1a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

/* "Сохранить" зелёный акцент */
body.light #events-form-save,
body.light .events-item-editing .events-edit-save {
    color: #1a7f3c;
    border: 1px solid rgba(26, 127, 60, 0.6);
    background: rgba(26, 127, 60, 0.16);
}
body.light #events-form-save:hover:not(:disabled),
body.light .events-item-editing .events-edit-save:hover:not(:disabled) {
    color: #ffffff;
    background: #1a7f3c;
    border-color: #1a7f3c;
    box-shadow: 0 2px 10px rgba(26, 127, 60, 0.25);
}

/* "Удалить/Выйти" красный акцент */
body.light .events-item-actions button:not(.events-edit-btn),
body.light .profile-logout-btn {
    color: #c42b2b;
    border: 1px solid rgba(196, 43, 43, 0.6);
    background: rgba(196, 43, 43, 0.14);
}
body.light .events-item-actions button:not(.events-edit-btn):hover,
body.light .profile-logout-btn:hover {
    color: #ffffff;
    background: #c42b2b;
    border-color: #c42b2b;
    box-shadow: 0 2px 10px rgba(196, 43, 43, 0.25);
}

body.light .closed > img { filter: invert(1); }
body.light #events-empty { color: #8a8a8a; }

/* === Календарь — светлая тема === */
body.light .calendar-day {
    background: #f8f8f8;
    border-color: rgba(0, 0, 0, 0.1);
}
body.light .calendar-day.other-month {
    opacity: 0.35;
}
body.light .calendar-day.today {
    border-color: var(--t-accent);
    background: rgba(10, 110, 189, 0.06);
}
body.light .calendar-day.today .calendar-day-num {
    color: var(--t-accent);
}
body.light .calendar-today-btn {
    color: var(--t-accent);
    border-color: rgba(10, 110, 189, 0.4);
}
body.light .calendar-today-btn:hover {
    color: #ffffff;
    background: var(--t-accent);
    border-color: var(--t-accent);
}
body.light .calendar-event-tile {
    background: rgba(10, 110, 189, 0.12);
    border-color: rgba(10, 110, 189, 0.35);
    color: #0a4a7a;
}
body.light .calendar-event-tile.group {
    background: rgba(110, 60, 200, 0.1);
    border-color: rgba(110, 60, 200, 0.35);
    color: #4a2a8a;
}
body.light .calendar-event-tile:hover {
    filter: brightness(0.92);
}
body.light .calendar-event-tile.multiday-cont {
    border-left-color: rgba(10, 110, 189, 0.35);
}
body.light .calendar-event-tile.multiday-cont.group {
    border-left-color: rgba(110, 60, 200, 0.35);
}
body.light .calendar-tooltip {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}
body.light .calendar-tooltip-title {
    color: #1a1a1a;
}
body.light .calendar-tooltip-label {
    color: #666;
}
body.light .calendar-agenda {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}
body.light .calendar-agenda-row {
    background: rgba(10, 110, 189, 0.1);
    border-color: rgba(10, 110, 189, 0.3);
    color: #0a4a7a;
}
body.light .calendar-agenda-row.group {
    background: rgba(110, 60, 200, 0.08);
    border-color: rgba(110, 60, 200, 0.3);
    color: #4a2a8a;
}
body.light .calendar-agenda-row:hover {
    filter: brightness(0.92);
}

/* === Планировщик: табы + группы — светлая тема === */
body.light .events-tabs {
    border-bottom-color: rgba(0, 0, 0, 0.15);
}
body.light .events-tab-badge {
    color: #ffffff;
}
body.light .events-tab-btn {
    color: rgba(0, 0, 0, 0.45);
}
body.light .events-tab-btn:hover {
    color: rgba(0, 0, 0, 0.7);
}
body.light .events-tab-btn.active {
    color: var(--t-accent);
    border-bottom-color: var(--t-accent);
}

/* Кнопка "Создать группу" */
body.light #companies-create-btn {
    color: #1a1a1a;
    border: 1px solid rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.04);
}
body.light #companies-create-btn:hover {
    color: var(--t-accent);
    background: rgba(var(--t-accent-rgb), 0.06);
    border-color: rgba(var(--t-accent-rgb), 0.5);
    box-shadow: 0 0 15px rgba(var(--t-accent-rgb), 0.12);
}

/* Карточки групп */
body.light .company-card {
    background: #f3f3f3;
    border: 1px solid rgba(0, 0, 0, 0.14);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
body.light .company-card-name {
    color: #1a1a1a;
}
body.light .company-card-section-title {
    color: #555;
}

/* Плашки мероприятий внутри карточек групп — белее, чтобы не сливались с фоном карточки */
body.light .company-card .events-item {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
body.light .company-card .events-item:hover {
    border-color: rgba(0, 0, 0, 0.25);
}

/* Кнопки внутри карточек (Создать мероприятие, Добавить участников) */
body.light .company-card-actions button {
    color: #1a1a1a;
    border: 1px solid rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.04);
}
body.light .company-card-actions button:hover {
    color: #ffffff;
    background: #1a1a1a;
    border-color: #1a1a1a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
body.light .company-past-toggle {
    color: #1a1a1a;
    border: 1px dashed rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.04);
}
body.light .company-past-toggle:hover {
    color: #ffffff;
    background: #1a1a1a;
    border-color: #1a1a1a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
body.light .company-past-toggle.open {
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.4);
    border-style: solid;
    background: rgba(0, 0, 0, 0.06);
}

/* Кнопка удаления группы */
body.light .company-card > .company-card-del {
    color: rgba(196, 43, 43, 0.55);
}
body.light .company-card > .company-card-del:hover {
    color: #c42b2b;
    background: rgba(196, 43, 43, 0.1);
}

/* Приглашения */
body.light .group-invite-item {
    background: #f3f3f3;
    border: 1px solid rgba(0, 0, 0, 0.14);
    color: #1a1a1a;
}
body.light .group-invite-item .gi-actions button {
    color: #1a1a1a;
    border: 1px solid rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.04);
}
body.light .group-invite-item .gi-actions button:first-child:hover {
    color: #ffffff;
    background: #1a7f3c;
    border-color: #1a7f3c;
}
body.light .group-invite-item .gi-actions button:last-child {
    color: #c42b2b;
    border-color: rgba(196, 43, 43, 0.5);
    background: rgba(196, 43, 43, 0.08);
}
body.light .group-invite-item .gi-actions button:last-child:hover {
    color: #ffffff;
    background: #c42b2b;
    border-color: #c42b2b;
}

/* Участники в карточке */
body.light .company-card-member span {
    color: #1a1a1a;
}
body.light .company-card-member.invited {
    opacity: 0.5;
}
body.light .company-card-member-remove {
    color: rgba(196, 43, 43, 0.6);
}
body.light .company-card-member-remove:hover {
    color: #c42b2b;
}
body.light .company-card-members-title {
    color: #555;
}

/* === Модальные окна === */
body.light .photon_soul-modal-content {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
body.light #photon_soul-modal-text {
    color: #1a1a1a;
}
/* OK — красный акцент (удалить), унифицирован с side-panel Delete */
body.light #photon_soul-modal-ok {
    color: #c42b2b;
    border: 1px solid rgba(196, 43, 43, 0.6);
    background: rgba(196, 43, 43, 0.14);
}
body.light #photon_soul-modal-ok:hover {
    color: #ffffff;
    background: #c42b2b;
    border-color: #c42b2b;
    box-shadow: 0 2px 10px rgba(196, 43, 43, 0.25);
}
/* Cancel — нейтральный, унифицирован с side-panel Neutral */
body.light #photon_soul-modal-cancel {
    color: #1a1a1a;
    border: 1px solid rgba(0, 0, 0, 0.35);
    background: rgba(0, 0, 0, 0.06);
}
body.light #photon_soul-modal-cancel:hover {
    color: #ffffff;
    background: #1a1a1a;
    border-color: #1a1a1a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

/* ============== Планировщик: табы Личные/Групповые ============== */
.events-tabs {
    display: flex;
    gap: 4px;
    margin: 0;
    border-bottom: 1px solid rgba(var(--t-accent-rgb), 0.15);
}
/* Неактивный таб занимает 30% ширины контейнера, активный — 70%. */
.events-tab-btn {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 8px;
    background: transparent;
    color: rgba(199, 199, 199, 0.6);
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    overflow: hidden;
    white-space: nowrap;
    transition: flex-grow 0.3s ease, color 0.2s, border-color 0.2s;
}
.events-tab-btn:hover { color: #c7c7c7; }
.events-tab-btn.active {
    flex: 2.2 1 0;
    color: var(--t-accent);
    border-bottom-color: rgba(var(--t-accent-rgb), 0.55);
}
.events-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    flex: 0 0 auto;
}
.events-tab-icon > svg { display: block; }
/* Текст таба виден только когда таб активен. */
.events-tab-label { display: none; }
.events-tab-btn.active .events-tab-label { display: inline; }
.events-tab-badge {
    display: inline-block;
    margin-left: 6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    box-sizing: border-box;
    background: #ff8c00;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    vertical-align: middle;
    letter-spacing: 0;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.6);
    animation: soul-badge-pulse 1.8s ease-in-out infinite;
}

#events-tab-personal-content,
#events-tab-group-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}
/* Скролл перенесён на сам #companies-list (см. ниже), чтобы поведение
   совпадало с #events-tab-personal-content: scrollbar-gutter резервируется
   только когда есть, что скроллить. Иначе при единственной группе появлялся
   ~15px отступ справа под scrollbar, которого нет. */

/* ============== Companies (группы) ============== */
#companies-create-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 8px 0 14px 0;
    background: transparent;
    border: 1px solid rgba(var(--t-accent-rgb), 0.2);
    color: rgba(var(--t-accent-rgb), 0.6);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
}
#companies-create-btn:hover {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.5);
    box-shadow: 0 0 15px rgba(var(--t-accent-rgb), 0.1);
}

#companies-list {
    /* Контейнер групп растягивается на свободное место родителя, скроллится
       по Y. Без padding-right и scrollbar-gutter — левый и правый отступы
       определяются только padding'ом #events-panel (25px), поэтому
       симметричны. При появлении scrollbar он займёт ~15px справа за счёт
       контента (вертикальная асимметрия только когда скролл реально есть). */
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
}
#companies-list > * { max-width: 100%; min-width: 0; }
/* 10px зазор между карточками и scroll-баром только когда скролл активен.
   Класс .has-vscroll навешивается JS-функцией _syncScrollPadding после
   проверки scrollHeight > clientHeight. Без скролла класса нет → левый
   и правый отступы у контейнера равны (оба = padding панели). */
#companies-list.has-vscroll {
    padding-right: 10px;
}

.company-card {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Шапка группы: аватар + имя + действия. Высота по контенту. */
.company-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Аватар группы */
.company-avatar {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
}
.company-avatar.editable { cursor: pointer; }
.company-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.company-avatar-upload {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
}
.company-avatar-upload img {
    width: 22px;
    height: 22px;
    opacity: 0.9;
}
.company-avatar.editable:hover .company-avatar-upload {
    display: flex;
}

/* Блок имени + метаданных */
.company-card-name-wrap {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-self: flex-start;
}
.company-card-name-row {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
}
.company-card-name-text {
    width: 80%;
    max-width: fit-content;
    font-size: 18px;
    font-weight: 600;
    color: #e7e7e7;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: manual;
}
.company-card-name-row .edit-name-btn {
    width: 20%;
    min-width: 25px;
    opacity: 0;
    transition: opacity .15s;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 14px;
    color: inherit;
    filter: brightness(0.7);
    align-self: flex-start;
    text-align: left;
}
.company-card-name-wrap:hover .edit-name-btn { opacity: 1; }
.company-card-name-row .edit-name-btn:hover { filter: brightness(1.2); }

.company-card-name-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.company-card-meta-line {
    font-size: 11px;
    color: var(--t-text-muted);
    line-height: 1.3;
    word-break: break-word;
}

/* Верхняя полоса: чат и удаление группы, над шапкой */
.company-card-top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}
.company-card-top-actions .company-card-chat-btn,
.company-card-top-actions .company-card-del {
    position: static;
    top: auto;
    right: auto;
}
.company-card-top-actions .company-card-chat-btn {
    position: relative; /* для бэйджа */
}
.company-card-top-actions .company-card-del {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: rgba(255, 120, 120, 0.6);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.company-card-top-actions .company-card-del:hover {
    color: #ff8a8a;
    background: rgba(255, 80, 80, 0.12);
}

.company-card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.company-card-actions button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    background: transparent;
    color: rgba(var(--t-accent-rgb), 0.6);
    border: 1px solid rgba(var(--t-accent-rgb), 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.25s;
}
.company-card-actions button:hover {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.5);
    box-shadow: 0 0 10px rgba(var(--t-accent-rgb), 0.08);
}
.company-card > .company-card-del {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: rgba(255, 120, 120, 0.55);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}
.company-card > .company-card-del:hover {
    color: #ff8a8a;
    background: rgba(255, 80, 80, 0.12);
}

/* Бейдж активного видеозвонка на плашке группы */
.company-call-badge {
    position: absolute;
    top: 8px;
    right: 40px;
    font-size: 16px;
    line-height: 1;
    animation: call-badge-pulse 1.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}
@keyframes call-badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Бейдж активного звонка в списке чатов */
.gc-call-badge {
    margin-left: auto;
    font-size: 14px;
    flex-shrink: 0;
    animation: call-badge-pulse 1.5s ease-in-out infinite;
}

/* Крестик удаления прошедшего мероприятия */
.past-event-del {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: rgba(255, 120, 120, 0.5);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}
.past-event-del:hover {
    color: #ff8a8a;
    background: rgba(255, 80, 80, 0.12);
}
body.light .past-event-del {
    color: rgba(196, 43, 43, 0.45);
}
body.light .past-event-del:hover {
    color: #c42b2b;
    background: rgba(196, 43, 43, 0.1);
}

.company-card-section-title {
    font-size: 10px;
    color: #9a9a9a;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 4px 0 2px 0;
}

.company-events-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
/* .company-event-item наследует раскладку от .events-item,
   добавляет только поведение клика, hover и бейдж роли */
.company-event-item {
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.company-event-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(var(--t-accent-rgb), 0.25);
}
.company-event-item.invited { opacity: 0.55; }
/* Прошедшие мероприятия (и личные, и групповые) — приглушённый вид */
.events-item.events-item-past {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.015);
    border-color: rgba(255, 255, 255, 0.05);
}
.events-item.events-item-past:hover {
    opacity: 0.85;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
}
.events-item-completed-badge {
    color: #9a9a9a !important;
    background: rgba(200, 200, 200, 0.10) !important;
}
/* Аккордеон «Показать прошедшие» */
.company-past-events {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}
.company-past-toggle {
    background: transparent;
    color: rgba(200, 200, 200, 0.6);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.company-past-toggle:hover {
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.03);
}
.company-past-toggle.open {
    border-style: solid;
    color: #e0e0e0;
}
.company-past-events-list,
.events-past-archive-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
/* Архив прошедших личных мероприятий */
.events-past-archive {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.events-past-archive-list {
    gap: 14px;
}
.company-event-item .company-event-role {
    display: inline-block;
    align-self: flex-start;
    font-size: 10px;
    color: #9a9a9a;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== Цветная шапка плашки события (по уровню сложности) ===== */
/* Покрываем padding (14px) + border (1px) у .events-item → margin -15px.
   border-radius совпадает с радиусом .events-item, чтобы фон точно покрывал
   правый/левый верхние углы без визуального gap.
   max-width: none переопределяет `.events-item > * { max-width: 100% }`,
   которое иначе ограничивает ширину шапки и блокирует negative margin. */
.events-item > .events-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -15px -15px 4px;
    padding: 7px 11px;
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s;
    max-width: none;
}
.events-item-header .events-item-title {
    flex: 1;
    margin: 0;
    font-size: 14px;
    color: #fff;
    line-height: 1.3;
    word-break: break-word;
    padding-right: 0;
}
.events-item-header-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    align-items: center;
}
.events-item-header .events-item-print,
.events-item-header .events-item-del {
    position: static;
    top: auto;
    right: auto;
    width: 26px;
    height: 26px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    z-index: auto;
}
.events-item-header .events-item-print {
    color: rgba(255, 255, 255, 0.78);
}
.events-item-header .events-item-print:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}
.events-item-header .events-item-print svg { display: block; }
.events-item-header .events-item-del {
    color: rgba(255, 220, 220, 0.78);
    font-size: 20px;
    line-height: 1;
}
.events-item-header .events-item-del:hover {
    background: rgba(255, 80, 80, 0.22);
    color: #fff;
}
/* Цвета по уровню сложности: simple — зелёный, complex — синий, rework — фиолетовый.
   Однородный фон (без градиента) — чтобы цвет ровно доходил до правого края. */
.events-item-header.difficulty-simple {
    background: rgba(76, 175, 80, 0.28);
    border-bottom-color: rgba(76, 175, 80, 0.45);
}
.events-item-header.difficulty-complex {
    background: rgba(33, 150, 243, 0.28);
    border-bottom-color: rgba(33, 150, 243, 0.45);
}
.events-item-header.difficulty-rework {
    background: rgba(156, 39, 176, 0.28);
    border-bottom-color: rgba(156, 39, 176, 0.45);
}
body.light .events-item-header.difficulty-simple {
    background: rgba(76, 175, 80, 0.18);
}
body.light .events-item-header.difficulty-complex {
    background: rgba(33, 150, 243, 0.16);
}
body.light .events-item-header.difficulty-rework {
    background: rgba(156, 39, 176, 0.16);
}
body.light .events-item-header .events-item-title { color: rgba(0,0,0,0.85); }
body.light .events-item-header .events-item-print { color: rgba(0,0,0,0.6); }
body.light .events-item-header .events-item-print:hover { color: var(--t-accent-hover); background: rgba(var(--t-accent-rgb),0.08); }
body.light .events-item-header .events-item-del { color: rgba(160,40,40,0.7); }
body.light .events-item-header .events-item-del:hover { color: #c63a3a; background: rgba(200,40,40,0.1); }

/* Шапка модалки события: однородный фон по difficulty (без градиента —
   чтобы цвет ровно доходил до правого края модалки). */
.companies-modal-header.difficulty-simple {
    background: rgba(76, 175, 80, 0.22);
}
.companies-modal-header.difficulty-complex {
    background: rgba(33, 150, 243, 0.22);
}
.companies-modal-header.difficulty-rework {
    background: rgba(156, 39, 176, 0.22);
}
.companies-modal-header.difficulty-simple,
.companies-modal-header.difficulty-complex,
.companies-modal-header.difficulty-rework {
    transition: background 0.25s;
}

/* Цветные bullet'ы в кастомных селектах с классом `with-bullets`.
   Bullet вставляется как реальный <span class="cs-bullet cs-bullet-X">
   через JS (см. initCustomSelect) — надёжнее, чем ::before по data-value.
   Размер кружка — 10×10, solid background, без обводки/тени. */
.cs-bullet {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: transparent;
    margin-right: 8px;
    vertical-align: middle;
    flex-shrink: 0;
}
.cs-bullet-simple  { background: #4caf50; }
.cs-bullet-complex { background: #2196f3; }
.cs-bullet-rework  { background: #9c27b0; }

.company-card-members {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.company-card-members-title {
    font-size: 10px;
    color: #9a9a9a;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.company-card-members-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.company-card-member {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 3px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    font-size: 12px;
    color: #c7c7c7;
    max-width: 180px;
}
.company-card-member.invited { opacity: 0.55; }
/* Бордер чипа участника по статусу подписки. Палитра — та же, что
   на #profile-panel.sub-* и .profile-subscription-btn.status-* */
.company-card-member.sub-status-inactive { border-color: #b74141; }
.company-card-member.sub-status-standard { border-color: #2e7d4f; }
.company-card-member.sub-status-pro { border-color: #7a3fc8; }

/* Блок назначения роли в модалке профиля участника. */
.mp-roles {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    font-size: 13px;
}
.mp-role-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.mp-role-row input[type=checkbox] { flex-shrink: 0; }
.mp-role-row input[type=checkbox]:disabled + span { opacity: 0.5; }
.mp-role-hint {
    font-size: 12px;
    color: var(--t-text-muted);
    padding-left: 24px;
    line-height: 1.35;
}
.mp-role-hint-noslots {
    padding-left: 0;
    color: #d1a040;
}
.company-card-member img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.company-card-member span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.company-card-member {
    position: relative;
}
.company-card-member-remove {
    background: transparent;
    color: var(--t-text-muted);
    border: none;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 0 4px;
    margin-left: 2px;
    border-radius: 3px;
    flex-shrink: 0;
}
.company-card-member-remove:hover {
    background: rgba(255, 80, 80, 0.15);
    color: #ff9999;
}

/* Уведомления/приглашения в табе Групповые */
#events-group-notifications {
    display: none; /* показывается из JS при наличии приглашений */
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}
.group-invite-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(var(--t-accent-rgb), 0.25);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    color: #e7e7e7;
}
.group-invite-item .gi-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}
.group-invite-item .gi-actions button {
    flex: 1;
    padding: 7px 10px;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.25s;
    border: 1px solid rgba(var(--t-accent-rgb), 0.25);
    color: rgba(var(--t-accent-rgb), 0.7);
}
.group-invite-item .gi-actions button:first-child:hover {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.55);
}
.group-invite-item .gi-actions button:last-child {
    color: rgba(255, 120, 120, 0.65);
    border-color: rgba(255, 120, 120, 0.25);
}
.group-invite-item .gi-actions button:last-child:hover {
    color: #ff8a8a;
    border-color: rgba(255, 120, 120, 0.55);
}

/* Модалки */
.companies-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
/* Поверх других .companies-modal — например, «Добавить участников»
   открывается поверх модалки редактирования события. */
.companies-modal.companies-modal-over {
    z-index: 10010;
    background: rgba(0, 0, 0, 0.5);
}
.companies-modal-content {
    background: var(--t-panel);
    border: 1px solid var(--t-border-strong);
    border-radius: 10px;
    padding: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    color: var(--t-text);
    position: relative;
    scrollbar-gutter: stable;
}
.companies-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--t-text-muted);
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    flex-shrink: 0;
}
.companies-modal-close:hover {
    background: var(--t-input-bg-focus);
    color: var(--t-text);
}
.company-event-files {
    margin: 6px 0 10px 0;
}
.company-event-files #company-event-files-list {
    margin-top: 6px;
    font-size: 12px;
}
.companies-modal-wide { max-width: 680px; }
.companies-modal-content.companies-modal-content-split {
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* В split-варианте overflow: hidden — scrollbar никогда не появится.
       Отменяем зарезервированный gutter, иначе он создаёт визуальный отступ
       справа у фоновых элементов (например, цветной шапки события). */
    scrollbar-gutter: auto;
}
.companies-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--t-border);
    flex-shrink: 0;
    /* Соответствует border-radius у .companies-modal-content (10px), чтобы
       background шапки заполнял верхние углы без визуального отступа. */
    border-radius: 10px 10px 0 0;
}
.companies-modal-content-split .companies-modal-header h3,
.companies-modal-content-split .companies-modal-header .personal-event-modal-title {
    margin: 0;
    font-size: 16px;
    padding-right: 0;
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
    color: var(--t-text);
}
.companies-modal-content h3,
.companies-modal-content h4 { color: var(--t-text); }
.companies-modal-content-split .companies-modal-close {
    position: static;
    top: auto;
    right: auto;
}
.companies-modal-body {
    padding: 16px 20px 20px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    scrollbar-gutter: stable;
}
.companies-modal-content h3 { margin: 0 0 14px 0; font-size: 16px; }
.companies-modal-content h4 { margin: 16px 0 8px 0; font-size: 14px; }
/* Footer модалки события — sticky-внизу (flex-shrink: 0 sibling body).
   Не скроллится с контентом; padding-bottom: 10px даёт 10px отступ от
   нижнего края модалки. Применяется и для групповой, и для личной модалки. */
.companies-modal-footer {
    flex-shrink: 0;
    padding: 12px 18px 10px;
    border-top: 1px solid var(--t-border);
    background: var(--t-panel);
    border-radius: 0 0 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.companies-modal-footer .companies-error:empty { display: none; }
.companies-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
/* Отступ между инпутом и кнопками в модалке создания группы */
#companies-create-modal .companies-modal-actions { margin-top: 10px; }
/* Отступ между плашкой результатов поиска и кнопками «Отмена»/«Сохранить»
   в модалке участников (прямой потомок — не трогаем ряд в invite-new-блоке) */
#company-members-modal .companies-modal-content > .companies-modal-actions { margin-top: 10px; }
.companies-modal-actions button {
    padding: 8px 16px;
    background: var(--t-surface-strong);
    color: var(--t-text);
    border: 1px solid var(--t-border);
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
}
.companies-modal-actions button:hover { background: var(--t-input-bg-focus); }
.companies-modal-actions .danger-btn {
    background: rgba(255, 80, 80, 0.12);
    border-color: rgba(255, 80, 80, 0.35);
    color: #ff9999;
    margin-right: auto;
}
.companies-modal-actions .danger-btn:hover {
    background: rgba(255, 80, 80, 0.35);
    color: #fff;
}
.companies-modal-actions .activate-btn {
    background: rgba(76, 175, 80, 0.12);
    border-color: rgba(76, 175, 80, 0.35);
    color: #7ee8a8;
}
.companies-modal-actions .activate-btn:hover {
    background: rgba(76, 175, 80, 0.25);
}
body.light .companies-modal-actions .activate-btn {
    background: rgba(56, 142, 60, 0.1);
    border-color: rgba(56, 142, 60, 0.3);
    color: #2e7d32;
}
body.light .companies-modal-actions .activate-btn:hover {
    background: rgba(56, 142, 60, 0.2);
}
.companies-error {
    color: #ff7777;
    font-size: 12px;
    margin-top: 8px;
    min-height: 14px;
}

/* Drag&drop роли */
.company-roles-section-title {
    margin: 16px 0 8px 0;
    font-size: 14px;
}
.company-roles {
    display: flex;
    gap: 8px;
    margin-top: 0;
    flex-wrap: wrap;
}
.company-role-col {
    flex: 1;
    min-width: 170px;
    background: var(--t-surface);
    border: 1px solid var(--t-border);
    border-radius: 6px;
    padding: 8px;
}
.company-role-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--t-text);
    margin-bottom: 6px;
    text-align: center;
    text-transform: uppercase;
}
.company-role-list {
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.company-role-list.drag-over {
    background: var(--t-input-bg-focus);
    border-radius: 4px;
}
.member-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: var(--t-surface-strong);
    border: 1px solid var(--t-border);
    border-radius: 4px;
    font-size: 12px;
    cursor: grab;
    user-select: none;
}
.member-chip.invited { opacity: 0.55; }
.member-chip img {
    width: 20px; height: 20px;
    border-radius: 50%;
    object-fit: cover;
}
.member-chip .chip-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-chip-remove {
    background: transparent;
    color: var(--t-text-muted);
    border: none;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 0 4px;
    margin-left: 2px;
    border-radius: 3px;
    flex-shrink: 0;
}
.member-chip-remove:hover {
    background: rgba(255, 80, 80, 0.15);
    color: #ff9999;
}

/* Members search modal */
.company-members-results {
    max-height: 320px;
    overflow-y: auto;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--t-border);
    border-radius: 5px;
    padding: 6px;
}
.company-member-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
}
.company-member-row:hover { background: var(--t-input-bg-focus); }
.company-member-row img {
    width: 28px; height: 28px;
    border-radius: 50%;
    object-fit: cover;
}
.company-member-row .cm-name { flex: 1; font-size: 13px; }
.company-member-row input[type="checkbox"] { cursor: pointer; }

/* Invite new user block */
.invite-new-user-block {
    background: var(--t-input-bg);
    border: 1px solid var(--t-border);
    border-radius: 5px;
    padding: 10px 12px;
    margin-top: 8px;
}
.invite-new-user-msg {
    font-size: 13px;
    color: var(--t-text-muted, #aaa);
    margin-bottom: 8px;
    line-height: 1.4;
}
.invite-new-user-block .events-input {
    margin-bottom: 6px;
}
.invite-new-user-error {
    color: #ff7777;
    font-size: 12px;
    min-height: 16px;
}

/* Файлы отчёта */
.company-event-report-files {
    margin: 6px 0 10px 0;
}
#company-event-attach-btn,
#company-event-report-attach-btn,
#company-event-add-members-btn {
    padding: 8px 16px;
    background: var(--t-surface-strong);
    border: 1px solid var(--t-border);
    color: var(--t-text);
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    margin-top: 4px;
}
#company-event-attach-btn:hover,
#company-event-report-attach-btn:hover,
#company-event-add-members-btn:hover {
    background: var(--t-input-bg-focus);
}
#company-event-add-members-btn { margin-top: 10px; }

/* Плашки прикреплённых файлов — стилистика member-chip */
.company-event-files #company-event-files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
}
.company-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px 5px 6px;
    background: var(--t-surface-strong);
    border: 1px solid var(--t-border);
    border-radius: 4px;
    font-size: 12px;
    max-width: 100%;
    user-select: none;
}
.company-file-chip .cf-icon {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    background: var(--t-surface);
    border: 1px solid var(--t-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: var(--t-text-muted);
    text-transform: uppercase;
    flex-shrink: 0;
}
.company-file-chip a.cf-name {
    color: var(--t-text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}
.company-file-chip a.cf-name:hover { text-decoration: underline; }
.company-file-chip-download { cursor: pointer; }
.company-file-chip-download:hover { background: var(--t-surface); }
.company-file-chip-download span.cf-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}
.company-file-chip .cf-remove {
    background: transparent;
    color: var(--t-text-muted);
    border: none;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 0 2px;
    border-radius: 3px;
}
.company-file-chip .cf-remove:hover {
    background: rgba(255, 80, 80, 0.15);
    color: #ff9999;
}
#company-event-report-files-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 3px;
    margin-top: 6px;
    font-size: 12px;
}
#company-event-report-files-list a {
    color: var(--t-text);
    text-decoration: underline;
}

/* Отчёты (список) — растёт по содержимому. Скролл делает сама модалка
   (companies-modal-body), чтобы пользователь не застревал в крошечном окне
   в 240px высотой, когда отчёт на полсотни строк. */
#company-event-reports-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.company-report-item {
    background: var(--t-surface);
    border: 1px solid var(--t-border);
    border-radius: 5px;
    padding: 8px 10px;
    font-size: 12px;
}
.company-report-item .cr-head {
    display: flex;
    justify-content: space-between;
    color: var(--t-text-muted);
    margin-bottom: 4px;
    font-size: 11px;
}
/* Текст отчёта: сохраняем переносы строк, отступы и пробелы ровно так,
   как ввёл автор. Без этого HTML склеивает всё в одну простыню. */
.company-report-item .cr-body {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

/* Push-уведомление о приглашении (persistent) */
.invitation-push-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
    pointer-events: none;
}
.invitation-push {
    background: var(--t-panel);
    border: 1px solid var(--t-border-strong);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    color: var(--t-text);
    font-size: 13px;
    pointer-events: auto;
    animation: invitation-push-in .25s ease-out;
}
@keyframes invitation-push-in {
    from { transform: translateX(-30px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}
.invitation-push-text { margin-bottom: 10px; line-height: 1.4; }
.invitation-push-actions { display: flex; gap: 6px; }
.invitation-push-actions button {
    flex: 1;
    padding: 7px 10px;
    border-radius: 4px;
    border: 1px solid var(--t-border);
    background: var(--t-surface-strong);
    color: var(--t-text);
    cursor: pointer;
    font-size: 12px;
}
.invitation-push-actions .accept-btn {
    background: rgba(90, 200, 130, 0.15);
    border-color: rgba(90, 200, 130, 0.4);
    color: #9be0b6;
}
.invitation-push-actions .decline-btn {
    background: rgba(255, 90, 90, 0.12);
    border-color: rgba(255, 90, 90, 0.35);
    color: #ff9999;
}
body.light .invitation-push {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.18);
}
body.light .invitation-push-actions .accept-btn {
    background: rgba(26, 127, 60, 0.14);
    border-color: rgba(26, 127, 60, 0.5);
    color: #1a7f3c;
}
body.light .invitation-push-actions .decline-btn {
    background: rgba(196, 43, 43, 0.1);
    border-color: rgba(196, 43, 43, 0.45);
    color: #c42b2b;
}

/* ===== Групповой чат ===== */

/* Кнопка чата в карточке группы */
.company-card-chat-btn {
    position: absolute;
    top: 6px;
    right: 40px;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: rgba(var(--t-accent-rgb), 0.55);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
    overflow: visible;
}
.company-card-chat-btn:hover:not(.disabled) {
    color: var(--t-accent);
    background: rgba(var(--t-accent-rgb), 0.12);
}
.company-card-chat-btn.disabled {
    opacity: 0.25;
    cursor: not-allowed;
}
/* Когда нет кнопки удаления — сдвигаем чат вправо */
.company-card-chat-btn.no-del {
    right: 8px;
}

/* Share-кнопка «Пригласить по ссылке» — рядом с чатом в .company-card-top-actions */
.company-card-share-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: rgba(var(--t-accent-rgb), 0.55);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.company-card-share-btn:hover {
    color: var(--t-accent);
    background: rgba(var(--t-accent-rgb), 0.12);
}

/* Подсветка карточки группы после успешного принятия приглашения по ссылке */
.company-card-highlight {
    animation: company-card-highlight-anim 2.4s ease-out;
    box-shadow: 0 0 0 2px rgba(var(--t-accent-rgb), 0.6), 0 0 24px rgba(var(--t-accent-rgb), 0.4);
}
@keyframes company-card-highlight-anim {
    0%   { box-shadow: 0 0 0 0 rgba(var(--t-accent-rgb), 0.0); }
    20%  { box-shadow: 0 0 0 3px rgba(var(--t-accent-rgb), 0.7), 0 0 28px rgba(var(--t-accent-rgb), 0.5); }
    100% { box-shadow: 0 0 0 0 rgba(var(--t-accent-rgb), 0.0); }
}

/* Модалка «Ссылка-приглашение в группу» (overlay из dash-sub-info-modal) */
.group-invite-link-content {
    max-width: 560px;
}
.group-invite-link-row {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}
.group-invite-link-input {
    flex: 1;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #cfe6ff;
    border: 1px solid rgba(var(--t-accent-rgb), 0.3);
    border-radius: 8px;
    font-size: 13px;
    font-family: monospace;
}
.group-invite-link-copy {
    padding: 9px 14px;
    background: transparent;
    color: rgba(var(--t-accent-rgb), 0.8);
    border: 1px solid rgba(var(--t-accent-rgb), 0.4);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: all 0.2s;
}
.group-invite-link-copy:hover:not(:disabled) {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.7);
    background: rgba(var(--t-accent-rgb), 0.1);
}
.group-invite-link-copy:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.group-invite-link-emails-label {
    margin: 6px 0 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}
.group-invite-link-emails-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}
.group-invite-link-emails-input:focus {
    outline: none;
    border-color: rgba(var(--t-accent-rgb), 0.5);
}
.group-invite-link-status {
    min-height: 18px;
    margin: 10px 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
}
.group-invite-link-status.ok { color: #8fe8a8; }
.group-invite-link-status.warn { color: #ffcf6b; }
.group-invite-link-status.error { color: #ff8a8a; }
.group-invite-link-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px;
}
.group-invite-link-send,
.group-invite-link-close {
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    border: 1px solid rgba(var(--t-accent-rgb), 0.4);
    background: transparent;
    color: rgba(var(--t-accent-rgb), 0.85);
    transition: all 0.2s;
}
.group-invite-link-send:hover:not(:disabled) {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.8);
    background: rgba(var(--t-accent-rgb), 0.1);
}
.group-invite-link-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.group-invite-link-close {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
}
.group-invite-link-close:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}
/* Светлая тема: без override ссылка/поля/«Закрыть» были белым по белому — невидимы */
body.light .group-invite-link-input,
body.light .group-invite-link-emails-input {
    background: rgba(0, 0, 0, 0.04);
    color: #1a1a1a;
}
body.light .group-invite-link-emails-input {
    border-color: rgba(0, 0, 0, 0.15);
}
body.light .group-invite-link-emails-label,
body.light .group-invite-link-status {
    color: rgba(0, 0, 0, 0.6);
}
body.light .group-invite-link-close {
    border-color: rgba(0, 0, 0, 0.2);
    color: rgba(0, 0, 0, 0.6);
}

/* Блок «пригласить по ссылке» внутри объединённой модалки участников */
.members-invite-link-block {
    margin-bottom: 6px;
}
.members-invite-link-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}
.members-invite-link-or {
    margin: 14px 0 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
}
body.light .members-invite-link-or {
    border-top-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.5);
}
body.light .group-invite-link-close:hover {
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.4);
}

/* Бэйдж непрочитанных */
.company-card-chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #6b7480;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    pointer-events: none;
}
.company-card-chat-badge.has-mention {
    background: #ff8c00;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.6);
    animation: soul-badge-pulse 1.8s ease-in-out infinite;
}

/* Модалка группового чата */
.group-chat-modal-content {
    background: var(--t-panel);
    border: 1px solid var(--t-border-strong);
    border-radius: 10px;
    width: 100%;
    max-width: 820px;
    height: 80vh;
    max-height: 700px;
    color: var(--t-text);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Шапка — текущий чат */
.group-chat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--t-border);
    flex-shrink: 0;
    background: rgba(255,255,255,0.02);
}
#group-chat-header-name {
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
/* Когда имя и статус обёрнуты в gc-header-info, роль flex:1 переходит к обёртке,
   а сам #group-chat-header-name внутри ведёт себя как обычный блок. */
.gc-header-info > #group-chat-header-name {
    flex: none;
    display: block;
    width: 100%;
}
.gc-header-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 2px;
}

/* Модалка с информацией о группе/пользователе. */
.gc-group-info-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 20070;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.gc-group-info-box {
    position: relative;
    background: var(--t-panel);
    border: 1px solid var(--t-border);
    border-radius: 14px;
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 22px 22px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    color: var(--t-text);
}
body.light .gc-group-info-box { background: #ffffff; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); }
.gc-group-info-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--t-text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
}
.gc-group-info-close:hover { color: var(--t-text); background: rgba(255, 255, 255, 0.08); }
body.light .gc-group-info-close:hover { background: rgba(0, 0, 0, 0.05); }
.gc-group-info-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.gc-group-info-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
}
.gc-group-info-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    word-break: break-word;
}
.gc-group-info-owner {
    font-size: 12px;
    color: var(--t-text-muted);
    text-align: center;
    margin-bottom: 14px;
}
.gc-group-info-members-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--t-text-muted);
    margin: 6px 0 8px;
}
.gc-group-info-members {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.gc-group-info-member {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s;
}
.gc-group-info-member:hover { background: rgba(var(--t-accent-rgb), 0.1); }
body.light .gc-group-info-member:hover { background: rgba(var(--t-accent-rgb), 0.07); }
.gc-group-info-member-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.gc-group-info-member-name {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gc-group-info-member-status {
    font-size: 11px;
    color: var(--t-text-muted);
    font-style: italic;
}
.gc-header-status {
    font-size: 11px;
    color: var(--t-text-muted);
    opacity: 0.85;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gc-header-status.is-online { color: #36d67b; opacity: 1; }
body.light .gc-header-status.is-online { color: #1e9a56; }
.gc-header-call-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--t-text-muted);
    border: none;
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    flex-shrink: 0;
    transition: color .15s, background .15s;
}
.gc-header-call-btn:hover {
    background: var(--t-input-bg-focus);
    color: #4caf50;
}

.gc-header-fullscreen-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--t-text-muted);
    border: none;
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    flex-shrink: 0;
    transition: color .15s, background .15s;
}
.gc-header-fullscreen-btn:hover {
    background: var(--t-input-bg-focus);
    color: var(--t-text);
}
.gc-header-fullscreen-btn.active {
    color: var(--t-accent);
    background: rgba(var(--t-accent-rgb), 0.12);
}

/* === Live-mode: кнопка в header чата с Фотоном === */
.gc-header-livemode-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--t-text-muted);
    border: none;
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    flex-shrink: 0;
    transition: color .15s, background .15s, transform .15s;
}
.gc-header-livemode-btn:hover {
    background: var(--t-input-bg-focus);
    color: #b08fff;
}
.gc-header-livemode-btn.is-active {
    color: #b08fff;
    background: rgba(176, 143, 255, 0.18);
    box-shadow: 0 0 0 1px rgba(176, 143, 255, 0.5) inset;
    animation: gc-livemode-btn-pulse 2s ease-in-out infinite;
}
@keyframes gc-livemode-btn-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(176, 143, 255, 0.5) inset; }
    50%      { box-shadow: 0 0 0 1px rgba(176, 143, 255, 0.9) inset,
                          0 0 12px rgba(176, 143, 255, 0.45); }
}

/* === Live-mode: PiP-превью с веб-камеры + transcript === */
.gc-livemode-pip {
    position: fixed;
    right: 24px;
    /* Под header-кнопками (.group-chat-header высота ≈48-56px) — чтобы не
       перекрывать send/attach/mic в инпуте и последние сообщения снизу.
       Перетаскивается мышью/тачем — юзер может вернуть в любой угол. */
    top: 72px;
    width: 240px;
    z-index: 10000;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4),
                0 0 0 2px rgba(176, 143, 255, 0.6) inset;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    display: flex;
    flex-direction: column;
}
.gc-livemode-pip:active { cursor: grabbing; }
.gc-livemode-pip video {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
    display: block;
    transform: scaleX(-1); /* зеркалим как в видеозвонках — привычнее */
}
.gc-livemode-pip-badge {
    position: absolute;
    left: 8px;
    top: 8px;
    padding: 3px 9px 3px 7px;
    background: rgba(176, 143, 255, 0.92);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    border-radius: 5px;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 5px;
}
.gc-livemode-pip-badge .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #ff5e5e;
    box-shadow: 0 0 6px rgba(255, 94, 94, 0.9);
    animation: gc-livemode-dot-blink 1.2s ease-in-out infinite;
}
@keyframes gc-livemode-dot-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.78); }
}
.gc-livemode-pip-transcript {
    flex: 1 0 auto;
    min-height: 38px;
    max-height: 96px;
    overflow: hidden;
    padding: 8px 12px 10px;
    background: rgba(12, 16, 21, 0.94);
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.gc-livemode-pip-transcript.kind-interim { color: rgba(255, 255, 255, 0.55); font-style: italic; }
.gc-livemode-pip-transcript.kind-trigger {
    color: #b08fff;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(var(--t-accent-rgb), 0.18), rgba(176, 143, 255, 0.25));
}
.gc-livemode-pip-transcript.kind-error { color: #ff8a8a; }
.gc-livemode-pip-close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    transition: background .15s;
}
.gc-livemode-pip-close:hover {
    background: rgba(0, 0, 0, 0.9);
}
@media (max-width: 480px) {
    .gc-livemode-pip { width: 180px; right: 12px; top: 64px; }
    .gc-livemode-pip-transcript { font-size: 11px; max-height: 72px; }
}

/* Fullscreen-режим модалки чатов */
#group-chat-modal.fullscreen {
    padding: 0;
}
#group-chat-modal.fullscreen .group-chat-modal-content {
    max-width: none;
    max-height: none;
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: none;
}
/* В fullscreen сайдбар держит фиксированную ширину — не тянется за экраном */
#group-chat-modal.fullscreen .group-chat-members {
    width: 280px;
    min-width: 280px;
    flex: 0 0 280px;
}
/* Основная область сообщений забирает оставшееся место — до правого края экрана */
#group-chat-modal.fullscreen .group-chat-main {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
}

.group-chat-header-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--t-text-muted);
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    flex-shrink: 0;
}
.group-chat-header-close:hover {
    background: var(--t-input-bg-focus);
    color: var(--t-text);
}

.group-chat-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Левая колонка — участники */
.group-chat-members {
    width: 30%;
    min-width: 180px;
    border-right: 1px solid var(--t-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
/* Подтон фона сайдбара — только на десктопе. На мобилке сайдбар — это
   выезжающая шторка, ей нужен сплошной цвет темы (см. mobile.css). */
@media (min-width: 769px) {
    .group-chat-members {
        background: rgba(255, 255, 255, 0.04);
    }
    body.light .group-chat-members {
        background: rgba(0, 0, 0, 0.035);
    }
}

/* Хаб-сайдбар: Фотон закреплён, группы скроллятся */
.chats-hub-sidebar {
    padding: 0;
}
.chats-hub-groups {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
    display: flex;
    flex-direction: column;
}

/* Поиск пользователя по phone/email — наверху списка чатов. */
.gc-chat-search-wrap {
    padding: 8px 10px 6px;
    border-bottom: 1px solid var(--t-border);
    flex-shrink: 0;
}
.gc-chat-search-input {
    width: 100%;
    padding: 8px 12px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid var(--t-border);
    background: var(--t-surface);
    color: var(--t-text);
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.gc-chat-search-input:focus { border-color: rgba(var(--t-accent-rgb), 0.55); }
body.light .gc-chat-search-input:focus { border-color: rgba(var(--t-accent-rgb), 0.55); }
.gc-chat-search-results {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
    max-height: 220px;
    overflow-y: auto;
}
.gc-chat-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s;
}
.gc-chat-search-row:hover {
    background: rgba(var(--t-accent-rgb), 0.1);
}
body.light .gc-chat-search-row:hover { background: rgba(var(--t-accent-rgb), 0.08); }
.gc-chat-search-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.gc-chat-search-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--t-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gc-chat-search-sub {
    font-size: 11px;
    color: var(--t-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gc-chat-search-empty {
    padding: 10px 8px;
    font-size: 12px;
    color: var(--t-text-muted);
    text-align: center;
}
.chats-hub-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
    min-height: 48px;
}
.chats-hub-tile:hover {
    background: var(--t-input-bg-focus);
}
.chats-hub-tile.active {
    background: rgba(var(--t-accent-rgb), 0.12);
}
.chats-hub-tile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.04);
}
/* Обёртка аватарки — позиционирует индикатор «в сети» в правом верхнем углу. */
.chats-hub-tile-avatar-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}
.chats-hub-online-dot {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #36d67b;
    border: 2px solid var(--t-panel);
    box-sizing: content-box;
    pointer-events: none;
    box-shadow: 0 0 6px rgba(54, 214, 123, 0.6);
    display: none;
}
.chats-hub-online-dot.online { display: block; }
body.light .chats-hub-online-dot { border-color: #ffffff; }
.chats-hub-tile-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    color: var(--t-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Обёртка имени + строки typing в тайле сайдбара. */
.chats-hub-tile-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
}
.chats-hub-tile-typing {
    font-size: 11px;
    font-style: italic;
    color: var(--t-text-muted);
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: transparent;
    min-height: 0;
    line-height: 1.1;
}
.chats-hub-tile-typing:empty { display: none; }

/* Кнопка-бэйдж активного видеозвонка в тайле группы (сайдбар чатов). */
.chats-hub-call-badge {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(54, 214, 123, 0.22);
    color: #36d67b;
    border: 1px solid rgba(54, 214, 123, 0.5);
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 0 8px rgba(54, 214, 123, 0.45);
    animation: chats-hub-call-pulse 1.6s ease-in-out infinite;
    transition: filter 0.15s;
}
.chats-hub-call-badge:hover { filter: brightness(1.12); }
body.light .chats-hub-call-badge {
    background: rgba(30, 154, 86, 0.18);
    color: #1e9a56;
    border-color: rgba(30, 154, 86, 0.5);
    box-shadow: 0 0 8px rgba(30, 154, 86, 0.35);
}
@keyframes chats-hub-call-pulse {
    0%, 100% { box-shadow: 0 0 6px rgba(54, 214, 123, 0.35); }
    50%      { box-shadow: 0 0 14px rgba(54, 214, 123, 0.85); }
}
.chats-hub-tile .gc-group-item-badge {
    position: static;
    background: #ff4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 9px;
    min-width: 18px;
    height: 18px;
    line-height: 14px;
    text-align: center;
    flex-shrink: 0;
}
.chats-hub-empty {
    text-align: center;
    color: var(--t-text-muted);
    padding: 16px;
    font-size: 13px;
}
.chats-hub-section-title {
    padding: 10px 12px 4px;
    font-size: 10px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--t-text-muted);
    opacity: 0.8;
    margin-top: 6px;
    border-top: 1px solid var(--t-border);
}
.chats-hub-dm-tile .chats-hub-tile-avatar {
    background: rgba(255,255,255,0.03);
}

/* Чат виден только когда он перенесён в модалку «Чаты» (chats-hub-mode).
   На главной всегда скрыт — там либо дашборд, либо auth-экран. */
body:not(.chats-hub-mode) #chat-container,
body:not(.chats-hub-mode) #input-area {
    display: none !important;
}
body:not(.dashboard-mode) #dashboard { display: none; }
body.dashboard-mode #auth-screen { display: none; }

/* Auth-экран: центрированная карточка поверх всего */
#auth-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #0a0d14 0%, #000 100%);
    z-index: 500;
    padding: 20px;
    box-sizing: border-box;
}
.auth-card {
    width: 100%;
    max-width: 360px;
    background: rgba(20, 22, 28, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(var(--t-accent-rgb), 0.14);
    border-radius: 18px;
    padding: 32px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(var(--t-accent-rgb), 0.06);
    animation: emerge 0.5s ease-out;
}
.auth-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 6px;
    text-align: center;
    margin: 0;
    color: #e7e7e7;
}
.auth-subtitle {
    font-size: 10px;
    letter-spacing: 3px;
    text-align: center;
    color: var(--t-text-muted);
    margin: 6px 0 24px;
    text-transform: uppercase;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.auth-field label {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--t-text-muted);
}
.auth-field input {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}
.auth-field input:focus {
    border-color: rgba(var(--t-accent-rgb), 0.5);
}
.auth-submit-btn {
    padding: 12px;
    background: transparent;
    color: rgba(var(--t-accent-rgb), 0.85);
    border: 1px solid rgba(var(--t-accent-rgb), 0.35);
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    transition: all 0.25s;
    margin-top: 4px;
}
.auth-submit-btn:hover:not(:disabled) {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.6);
    box-shadow: 0 0 16px rgba(var(--t-accent-rgb), 0.18);
}
.auth-submit-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}
.auth-error {
    min-height: 16px;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: #ff6b6b;
    text-align: center;
}
.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
}
.auth-link {
    background: none;
    border: none;
    color: var(--t-text-muted);
    font-size: 11px;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-decoration: none;
    padding: 4px;
    transition: color 0.2s;
}
.auth-link:hover {
    color: var(--t-accent);
    text-decoration: underline;
}
/* Светлая тема для auth-экрана */
body.light #auth-screen {
    background: radial-gradient(ellipse at center, #f5f7fb 0%, #dde1e8 100%);
}
body.light .auth-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 100, 180, 0.14);
}
body.light .auth-title { color: #1a1a1a; }
body.light .auth-field input {
    color: #1a1a1a;
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.25);
}
body.light .auth-field input:focus {
    border-color: rgba(var(--t-accent-rgb), 0.55);
    box-shadow: 0 0 0 3px rgba(var(--t-accent-rgb), 0.1);
}
body.light .auth-field label { color: rgba(0, 0, 0, 0.55); }

/* #dashboard — единственный скролл-контейнер дашборда: занимает весь вьюпорт
   (inset:0) и скроллит СВОЁ содержимое (панели + секция тренеров). Таблетка
   кнопок (#side-panel-btns) и фон (#photon-bg, #dash-logo-watermark, html-bg)
   позиционированы fixed — они вне этого скролла и всегда остаются на месте,
   сколько бы контента ни было. body заблокирован (overflow:hidden) — страница
   целиком не скроллится, двигается только внутренность #dashboard. */
#dashboard {
    position: absolute;
    inset: 0;
    padding: 30px 110px 96px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    /* не «пробрасывать» прокрутку на body / pull-to-refresh, и держать якорные
       скроллы выше нижнего края (за паддингом 96px). */
    overscroll-behavior: contain;
    scroll-padding-bottom: 96px;
}
.dash-grid {
    display: grid;
    gap: 16px;
    /* min(280px, 100%) — на узких экранах колонка никогда не превышает
       ширину вьюпорта, поэтому горизонтальный скролл не появляется. */
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    max-width: 1200px;
    margin: 0 auto;
    min-width: 0;
}
.dash-card {
    background: var(--t-panel);
    border: 1px solid var(--t-border);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 110px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    transition: border-color 0.25s, box-shadow 0.25s;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.dash-card:hover {
    border-color: var(--t-border-strong);
}
.dash-card[draggable="true"] { cursor: grab; }
.dash-card[draggable="true"]:active { cursor: grabbing; }
.dash-card.dash-dragging {
    opacity: 0.45;
    transform: scale(0.98);
}
.dash-card.dash-drag-over {
    border-color: var(--t-accent);
    box-shadow: 0 0 0 2px rgba(var(--t-accent-rgb), 0.35), 0 6px 20px rgba(0,0,0,0.25);
}
body.light .dash-card.dash-drag-over {
    border-color: var(--t-accent);
    box-shadow: 0 0 0 2px rgba(var(--t-accent-rgb), 0.35), 0 6px 20px rgba(0,0,0,0.08);
}
.dash-card-title {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--t-text-muted);
    margin: 0;
}
.dash-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--t-text-muted);
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.6;
}
.dash-empty {
    font-size: 13px;
    color: var(--t-text-muted);
    opacity: 0.7;
}

/* Карточка «Следующее событие» */
.dash-next-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--t-text);
    word-break: break-word;
}
.dash-next-when {
    font-size: 12px;
    color: var(--t-text-muted);
    letter-spacing: 0.5px;
}
.dash-next-countdown {
    margin-top: auto;
    padding-top: 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--t-accent);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.dash-next-group {
    font-size: 11px;
    color: var(--t-text-muted);
    opacity: 0.85;
}

/* Карточка «Сегодня» */
.dash-today-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dash-today-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 13px;
    color: var(--t-text);
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.dash-today-item:last-child { border-bottom: none; }
.dash-today-time {
    color: var(--t-accent);
    font-weight: 600;
    flex-shrink: 0;
    min-width: 40px;
}
.dash-today-title {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}
.dash-today-group {
    font-size: 11px;
    color: var(--t-text-muted);
    opacity: 0.8;
    flex-shrink: 0;
}

/* Карточка «Непрочитанные чаты» */
.dash-unread-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-gutter: stable;
    /* Тонкий скроллбар, чтобы не портить карточку визуально */
    scrollbar-width: thin;
}
.dash-unread-list::-webkit-scrollbar { width: 6px; }
.dash-unread-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}
body.light .dash-unread-list::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); }
.dash-unread-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.dash-unread-item:hover { background: var(--t-input-bg-focus); }
.dash-unread-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--t-text-muted);
}
.dash-unread-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dash-unread-avatar.is-group { background: rgba(var(--t-accent-rgb), 0.18); color: var(--t-accent); }
body.light .dash-unread-avatar { background: rgba(0, 0, 0, 0.06); }
body.light .dash-unread-avatar.is-group { background: rgba(var(--t-accent-rgb), 0.14); color: var(--t-accent); }
.dash-unread-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    color: var(--t-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-unread-count {
    font-size: 11px;
    font-weight: 700;
    background: #ff4444;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* Карточка «Приглашения» */
.dash-inv-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dash-inv-item {
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--t-border);
    border-radius: 8px;
}
.dash-inv-text {
    font-size: 13px;
    color: var(--t-text);
    word-break: break-word;
}
.dash-inv-sub {
    font-size: 11px;
    color: var(--t-text-muted);
    margin-top: 2px;
}
.dash-inv-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.dash-inv-btn {
    flex: 1;
    padding: 5px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}
.dash-inv-accept {
    color: rgba(120, 220, 160, 0.9);
    border: 1px solid rgba(120, 220, 160, 0.4);
}
.dash-inv-accept:hover {
    background: rgba(120, 220, 160, 0.12);
    color: #a8e8c0;
}
.dash-inv-decline {
    color: rgba(255, 120, 120, 0.85);
    border: 1px solid rgba(255, 120, 120, 0.35);
}
.dash-inv-decline:hover {
    background: rgba(255, 120, 120, 0.1);
    color: #ff9696;
}

/* Модалка «Баланс исчерпан» */
.tokens-depleted-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 20060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Подписка в модалке профиля участника: бейдж плана + срок действия. */
.mp-subscription {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}
.mp-subscription-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
}
.mp-subscription-badge.plan-pro { background: #7a3fc8; }
.mp-subscription-badge.plan-standard { background: #2e7d4f; }
.mp-subscription-badge.plan-inactive { background: #b74141; }
.mp-subscription-until {
    font-size: 12px;
    color: var(--t-text-muted);
}

/* Баланс токенов в модалке профиля участника. */
.mp-tokens {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
}
.mp-tokens-label { color: var(--t-text-muted); }
.mp-tokens-value { font-weight: 600; color: var(--t-text); }
.mp-tokens-value.is-red { color: #ff5555; }
.mp-tokens-value.is-orange { color: #f39c12; }
.mp-tokens-value.is-green { color: #2ecc71; }

/* ===================== Модалка выбора участников для выдачи Стандарт ===================== */
.seat-selection-content { max-width: 520px; }
.seat-selection-counter {
    margin: 4px 0 12px;
    font-size: 12px;
    color: var(--t-text-muted);
    letter-spacing: 0.3px;
}
.seat-selection-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 4px 2px;
    margin-bottom: 14px;
    border-top: 1px solid var(--t-border);
    border-bottom: 1px solid var(--t-border);
}
.seat-selection-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s;
}
.seat-selection-row:hover:not(.is-disabled) { background: rgba(var(--t-accent-rgb), 0.06); }
.seat-selection-row.is-disabled { opacity: 0.55; cursor: not-allowed; }
.seat-selection-row.is-at-limit { animation: seat-shake 0.35s ease; }
@keyframes seat-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}
.seat-selection-checkbox { width: 16px; height: 16px; accent-color: var(--t-accent); flex: 0 0 auto; }
.seat-selection-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    overflow: hidden; flex: 0 0 auto;
    background: rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px; color: var(--t-text-muted);
}
.seat-selection-avatar img { width: 100%; height: 100%; object-fit: cover; }
.seat-selection-info { flex: 1 1 auto; min-width: 0; }
.seat-selection-name {
    font-size: 14px;
    color: var(--t-text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.seat-selection-nick {
    font-size: 11px;
    color: var(--t-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.seat-selection-badge {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
}
.seat-selection-badge.plan-pro { background: #7a3fc8; }
.seat-selection-badge.plan-standard { background: #2e7d4f; }
.seat-selection-badge.plan-none { background: #b74141; }
.seat-selection-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.seat-selection-skip, .seat-selection-confirm {
    padding: 9px 18px;
    border-radius: 8px;
    border: 1px solid var(--t-border);
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}
.seat-selection-skip { background: transparent; color: var(--t-text-muted); }
.seat-selection-skip:hover { color: var(--t-text); border-color: var(--t-text-muted); }
.seat-selection-confirm {
    background: rgba(var(--t-accent-rgb), 0.14);
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.45);
}
.seat-selection-confirm:hover:not(:disabled) {
    background: rgba(var(--t-accent-rgb), 0.22);
    border-color: rgba(var(--t-accent-rgb), 0.7);
}
.seat-selection-confirm:disabled { opacity: 0.35; cursor: not-allowed; }
body.light .seat-selection-confirm {
    color: var(--t-accent);
    background: rgba(var(--t-accent-rgb), 0.1);
    border-color: rgba(var(--t-accent-rgb), 0.45);
}
body.light .seat-selection-confirm:hover:not(:disabled) {
    background: rgba(var(--t-accent-rgb), 0.18);
    border-color: rgba(var(--t-accent-rgb), 0.65);
}

/* ===================== Плашка «Доступно N» (ПРО, шапка панели Мероприятия) ===================== */
/* Сделана в стилистике кнопки «Календарь»: прозрачный фон, голубая рамка,
   скругления, hover-glow. Видна только на табе «Групповые» для ПРО. */
#events-panel > #pro-seats-plaque {
    position: absolute;
    top: 10px;
    right: 122px;
    height: 30px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px 0 10px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid rgba(var(--t-accent-rgb), 0.3);
    color: rgba(var(--t-accent-rgb), 0.85);
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2px;
    line-height: 1;
    z-index: 5;
    white-space: nowrap;
    transition: all 0.25s;
}
#events-panel > #pro-seats-plaque:hover {
    border-color: rgba(var(--t-accent-rgb), 0.6);
    color: var(--t-accent);
}
body.light #events-panel > #pro-seats-plaque {
    border-color: rgba(var(--t-accent-rgb), 0.35);
    color: rgba(var(--t-accent-rgb), 0.85);
}
body.light #events-panel > #pro-seats-plaque:hover {
    border-color: rgba(var(--t-accent-rgb), 0.6);
    color: var(--t-accent);
}
.pro-seats-plaque-text { flex: 0 0 auto; }
#pro-seats-plaque-count {
    font-weight: 700;
    margin: 0 2px 0 3px;
}

/* Тултип у «+» плашки «Доступно» — полностью клонирует стилистику [data-tooltip]::after,
   чтобы выглядеть идентично тултипам «Календарь»/«Скачать». Принудительно снизу. */
#pro-seats-add-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: auto !important;
    top: calc(100% + 10px) !important;
    left: 50%;
    transform: translateX(-50%) translateY(-4px) !important;
    background: var(--t-panel);
    color: var(--t-text);
    padding: 10px 20px;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 1000;
}
body.light #pro-seats-add-btn[data-tooltip]::after {
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
}
#pro-seats-add-btn[data-tooltip]:hover::after,
#pro-seats-add-btn[data-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0) !important;
}

/* «+» внутри плашки — текстовая кнопка в том же голубом стиле. */
.pro-seats-add-btn {
    position: relative;
    width: 22px;
    height: 22px;
    min-width: 22px;
    padding: 0;
    margin: 0;
    flex: 0 0 auto;
    border-radius: 4px;
    border: 1px solid rgba(var(--t-accent-rgb), 0.3);
    background: transparent;
    color: rgba(var(--t-accent-rgb), 0.85);
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pro-seats-add-btn:hover {
    border-color: rgba(var(--t-accent-rgb), 0.7);
    background: rgba(var(--t-accent-rgb), 0.12);
    color: var(--t-accent);
}
body.light .pro-seats-add-btn {
    border-color: rgba(var(--t-accent-rgb), 0.35);
    color: rgba(var(--t-accent-rgb), 0.85);
}
body.light .pro-seats-add-btn:hover {
    border-color: rgba(var(--t-accent-rgb), 0.65);
    background: rgba(var(--t-accent-rgb), 0.08);
    color: var(--t-accent);
}

/* Модалка добавления мест (PRO): базируется на .dash-sub-info-*.
   Поля/ценник/кнопка компактно уложены внутри .dash-sub-info-content. */
.pro-add-seats-current-slots {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--t-border);
    text-align: left;
    font-size: 12px;
    line-height: 1.45;
}
body.light .pro-add-seats-current-slots {
    background: rgba(0,0,0,0.02);
}
.pro-add-seats-current-slots-title {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
}
.pro-add-seats-current-slots-empty {
    color: var(--t-text-muted);
    font-style: italic;
}
.pro-add-seats-current-slots-row {
    margin: 2px 0;
}
.pro-add-seats-current-slots-row.reserved {
    color: var(--t-text-muted);
}
.pro-add-seats-current-slots-loading {
    color: var(--t-text-muted);
    font-style: italic;
}
/* Модалка продления роли. */
.role-extend-slots-list {
    margin-top: 12px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.role-extend-slot-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--t-border);
    cursor: pointer;
    font-size: 13px;
}
.role-extend-slot-row input[type=checkbox] { flex-shrink: 0; }
.role-extend-empty {
    padding: 12px;
    color: var(--t-text-muted);
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
}
.role-extend-summary {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--t-border);
    font-weight: 600;
    font-size: 13px;
    text-align: right;
}
.role-extend-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.role-extend-cancel-btn {
    padding: 8px 16px;
    border-radius: 8px;
    background: transparent;
    color: var(--t-text);
    border: 1px solid var(--t-border);
    cursor: pointer;
    font-size: 14px;
}
.role-extend-cancel-btn:hover { background: rgba(255,255,255,0.05); }

/* Стили для disabled-инпутов в модалке события (для не-редакторов).
   Отчёт и файлы отчёта остаются активными. */
.mp-locked-input,
.mp-locked-input:focus {
    opacity: 0.65;
    cursor: not-allowed;
    background: rgba(255,255,255,0.02) !important;
}
.pro-add-seats-content .pro-add-seats-counter {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--t-border);
}
body.light .pro-add-seats-content .pro-add-seats-counter {
    background: rgba(0,0,0,0.03);
}
/* В .plan-btn-counter-val/-btn зашит цвет #333 — рассчитан на цветной фон
   plan-кнопок (Std/Pro) на дашборде. В этой модалке фон тёмный, поэтому
   цифры и ± становятся неразличимыми. Перекрываем на theme-aware цвета
   только в скоупе модалки, чтобы plan-кнопки не задеть. */
.pro-add-seats-content .plan-btn-counter-val,
.pro-add-seats-content .plan-btn-counter-btn {
    color: var(--t-text);
}
.pro-add-seats-content .plan-btn-counter-btn {
    border-color: var(--t-border);
}
.pro-add-seats-content .plan-btn-counter-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.08);
    border-color: var(--t-border);
}
body.light .pro-add-seats-content .plan-btn-counter-btn:hover:not(:disabled) {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.35);
}
.pro-add-seats-price {
    margin: 14px 0 12px;
    border-top: 1px dashed rgba(0,0,0,0.25);
    padding: 12px 0 0;
    background: transparent;
    font-size: 24px;
    font-weight: 600;
    text-align: left;
    color: var(--t-text);
}
body.light .pro-add-seats-price { border-top-color: rgba(0,0,0,0.2); }
.pro-add-seats-pay {
    width: 100%;
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid rgba(var(--t-accent-rgb), 0.45);
    background: rgba(var(--t-accent-rgb), 0.1);
    color: var(--t-accent);
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.15s;
}
.pro-add-seats-pay:hover:not(:disabled) {
    background: rgba(var(--t-accent-rgb), 0.18);
    border-color: rgba(var(--t-accent-rgb), 0.7);
}
.pro-add-seats-pay:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
body.light .pro-add-seats-pay {
    border-color: rgba(var(--t-accent-rgb), 0.45);
    background: rgba(var(--t-accent-rgb), 0.08);
    color: var(--t-accent);
}
body.light .pro-add-seats-pay:hover {
    background: rgba(var(--t-accent-rgb), 0.14);
    border-color: rgba(var(--t-accent-rgb), 0.65);
}

/* ===================== Cookie consent (плашка первого посещения) ===================== */
.cookie-consent-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 20090;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--t-panel);
    border: 1px solid var(--t-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color: var(--t-text);
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    animation: cookie-consent-in 0.22s ease-out;
}
body.light .cookie-consent-banner { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); }
@keyframes cookie-consent-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cookie-consent-banner.is-hiding { opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; }
.cookie-consent-msg { flex: 1 1 auto; }
.cookie-consent-msg a { color: var(--t-accent); text-decoration: underline; }
body.light .cookie-consent-msg a { color: var(--t-accent); }
.cookie-consent-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}
.cookie-consent-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--t-border);
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
}
.cookie-consent-accept {
    background: #2ecc71;
    color: #ffffff;
    border-color: #2ecc71;
}
.cookie-consent-accept:hover { background: #27b866; border-color: #27b866; }
.cookie-consent-decline {
    background: transparent;
    color: var(--t-text);
}
.cookie-consent-decline:hover {
    border-color: rgba(var(--t-accent-rgb), 0.6);
    color: var(--t-accent);
}
body.light .cookie-consent-decline:hover {
    border-color: rgba(var(--t-accent-rgb), 0.6);
    color: var(--t-accent);
}
@media (max-width: 600px) {
    .cookie-consent-banner {
        flex-direction: column;
        align-items: stretch;
        left: 8px;
        right: 8px;
        bottom: 8px;
        padding: 12px 14px;
        gap: 10px;
    }
    .cookie-consent-actions { justify-content: flex-end; }
}

/* ===================== Платёжная модалка ===================== */
.payment-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 20080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.payment-modal-content {
    background: var(--t-panel);
    border: 1px solid var(--t-border);
    border-radius: 14px;
    padding: 26px 24px 20px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
body.light .payment-modal-content { background: #ffffff; box-shadow: 0 10px 30px rgba(0,0,0,0.18); }
.payment-spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 14px;
    border: 3px solid rgba(var(--t-accent-rgb), 0.25);
    border-top-color: var(--t-accent);
    border-radius: 50%;
    animation: payment-spin 0.9s linear infinite;
}
@keyframes payment-spin { to { transform: rotate(360deg); } }
.payment-icon {
    width: 42px;
    height: 42px;
    margin: 0 auto 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}
.payment-modal-content.is-success .payment-icon { background: #2ecc71; }
.payment-modal-content.is-failure .payment-icon { background: #e74c3c; }
.payment-msg {
    color: var(--t-text);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 14px;
}
.payment-ok {
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid var(--t-border);
    background: transparent;
    color: var(--t-text);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}
.payment-ok:hover { border-color: rgba(var(--t-accent-rgb), 0.6); color: var(--t-accent-hover); }
body.light .payment-ok:hover { border-color: rgba(var(--t-accent-rgb), 0.6); color: var(--t-accent-hover); }
.tokens-depleted-content {
    background: var(--t-panel);
    border: 1px solid var(--t-border);
    border-radius: 14px;
    padding: 22px 24px 18px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
body.light .tokens-depleted-content {
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.tokens-depleted-title {
    margin: 0 0 10px;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #e74c3c;
    font-weight: 700;
}
.tokens-depleted-msg {
    color: var(--t-text);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}
.tokens-depleted-actions {
    display: flex;
    justify-content: flex-end;
}
.tokens-depleted-ok {
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid var(--t-border);
    background: transparent;
    color: var(--t-text);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}
.tokens-depleted-ok:hover {
    border-color: rgba(var(--t-accent-rgb), 0.6);
    color: var(--t-accent);
}
body.light .tokens-depleted-ok:hover {
    border-color: rgba(var(--t-accent-rgb), 0.6);
    color: var(--t-accent);
}

/* Покупка токенов — список тарифов */
.tokens-buy-content { max-width: 440px; }
.tokens-buy-plans {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}
.tokens-buy-plan {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 20px;
    background: #b74141;
    border: 2px solid transparent;
    border-radius: 12px;
    color: #ffffff;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    transition: filter 0.15s, border-color 0.15s, transform 0.1s;
}
.tokens-buy-plan:hover { filter: brightness(1.08); }
.tokens-buy-plan:active { transform: scale(0.99); }
.tokens-buy-plan.selected {
    border-color: #ff8c00;
    filter: brightness(1.12);
    animation: soul-badge-pulse 1.8s ease-in-out infinite;
}
.tokens-buy-plan-name,
.tokens-buy-plan-price {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.4px;
}
.tokens-buy-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.tokens-buy-pay {
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #2e7d4f;
    color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: filter 0.15s, opacity 0.15s;
}
.tokens-buy-pay:hover:not(:disabled) { filter: brightness(1.1); }
.tokens-buy-pay:disabled { opacity: 0.45; cursor: not-allowed; }

/* Карточка «Баланс токенов» */
.dash-card-tokens { position: relative; }
.dash-tokens-info-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--t-border);
    background: transparent;
    color: var(--t-text-muted);
    font-size: 12px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.dash-tokens-info-btn:hover {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.6);
    background: rgba(var(--t-accent-rgb), 0.08);
}
body.light .dash-tokens-info-btn:hover {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.6);
    background: rgba(var(--t-accent-rgb), 0.06);
}

/* Модалка «О подписке» */
.dash-sub-info-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 20050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.dash-sub-info-content {
    position: relative;
    background: var(--t-panel);
    border: 1px solid var(--t-border);
    border-radius: 14px;
    padding: 22px 22px 18px;
    width: 100%;
    max-width: 560px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
.dash-sub-info-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--t-text-muted);
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}
.dash-sub-info-close:hover {
    background: var(--t-input-bg-focus);
    color: var(--t-text);
}
body.light .dash-sub-info-content {
    background: #ffffff;
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
}
.dash-sub-info-title {
    margin: 0 0 14px;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--t-text-muted);
    font-weight: 600;
}
.dash-sub-info-title.dash-sub-info-title-heading {
    font-size: 18px;
    letter-spacing: 0.3px;
    text-transform: none;
    color: var(--t-text);
    font-weight: 700;
    margin-bottom: 10px;
    padding-right: 32px;
}
.dash-sub-info-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
    color: #fff;
}
.dash-sub-info-badge.plan-inactive { background: #b74141; }
.dash-sub-info-badge.plan-standard { background: #2e7d4f; }
.dash-sub-info-badge.plan-pro { background: #7a3fc8; }
.dash-sub-info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--t-border);
    font-size: 13px;
}
.dash-sub-info-row:last-of-type { border-bottom: none; }
.dash-sub-info-key { color: var(--t-text-muted); }
.dash-sub-info-val {
    color: var(--t-text);
    font-weight: 600;
    text-align: right;
}
.dash-sub-info-message {
    margin: 4px 0 14px;
    color: var(--t-text);
    font-size: 14px;
    line-height: 1.5;
}
.dash-sub-info-hint {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(122, 63, 200, 0.12);
    color: #a975e0;
    font-size: 12px;
    text-align: center;
}
body.light .dash-sub-info-hint {
    background: rgba(122, 63, 200, 0.08);
    color: #6b2fb0;
}
/* Выбор плана подписки — «Стандарт» и «ПРО» под блоком статистики. */
.dash-sub-info-plans-title {
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--t-text-muted);
}
.dash-sub-info-plans {
    display: flex;
    gap: 8px;
}
.dash-sub-info-plan-btn {
    position: relative;
    flex: 1 1 0;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--t-border);
    overflow: hidden;
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s, box-shadow 0.15s, border-color 0.15s;
    text-align: left;
    display: flex;
    flex-direction: column;
    font-family: 'Roboto', sans-serif;
    color: inherit;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}
body.light .dash-sub-info-plan-btn { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); }
.dash-sub-info-plan-btn:hover {
    filter: brightness(1.04);
    border-color: var(--t-border-strong);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.36);
}
body.light .dash-sub-info-plan-btn:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); }
.dash-sub-info-plan-btn:active { transform: scale(0.99); }

/* Шапка карточки — цветной блок с надписью «подписка» и названием плана.
   Увеличили все размеры примерно в 1.5 раза. */
.dash-sub-info-plan-btn .plan-btn-header {
    padding: 15px 21px;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
}
.dash-sub-info-plan-btn .plan-btn-kicker {
    font-size: 21px;
    font-weight: 400;
    opacity: 0.9;
    letter-spacing: 0.3px;
}
.dash-sub-info-plan-btn .plan-btn-name {
    margin: 3px 0 0;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: 0.9px;
}

/* Информационный блок со списком фич — белый фон, приглушённый текст.
   Пункты разделены тонкими линиями, без маркеров. */
.dash-sub-info-plan-btn .plan-btn-features {
    list-style: none;
    margin: 0;
    padding: 6px 21px;
    background: #ffffff;
    color: var(--t-text-muted);
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
}
.dash-sub-info-plan-btn .plan-btn-features li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.dash-sub-info-plan-btn .plan-btn-features li:last-child { border-bottom: none; }

/* Обычный пункт фичи: текст слева, инфо-значок справа. */
.plan-btn-feature {
    display: flex !important;
    align-items: center;
    gap: 8px;
}
.plan-btn-feature-text { flex: 1 1 auto; }

/* Инфо-значок в стиле dash-tokens-info-btn из карточки «Текущий баланс». */
.plan-btn-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--t-border);
    background: transparent;
    color: var(--t-text-muted);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 12px;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
}
.plan-btn-info:hover, .plan-btn-info:focus-visible {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.6);
    background: rgba(var(--t-accent-rgb), 0.08);
    outline: none;
}
body.light .plan-btn-info:hover,
body.light .plan-btn-info:focus-visible {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.6);
    background: rgba(var(--t-accent-rgb), 0.06);
}
/* В пункте-счётчике закрепляем значок в правом верхнем углу; label
   получает симметричные отступы, чтобы оставаться по центру. */
.plan-btn-counter { position: relative; }
.plan-btn-counter > .plan-btn-info { position: absolute; top: 10px; right: 0; }
.plan-btn-counter > .plan-btn-counter-label { padding: 0 24px; }

/* Плавающий тултип — прикрепляется к body, позиционируется JS. */
.plan-btn-info-tip {
    position: fixed;
    z-index: 20100;
    max-width: 280px;
    padding: 10px 12px;
    background: #2a2a2a;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 400;
    font-style: normal;
    line-height: 1.45;
    text-align: left;
    border-radius: 6px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
}
.plan-btn-info-tip.show { opacity: 1; transform: translateY(0); }
body.light .plan-btn-info-tip { box-shadow: 0 6px 22px rgba(0, 0, 0, 0.2); }

/* Баннер «Зачтено из Стандарта» — показываем при апгрейде со Стандарта на ПРО. */
.dash-sub-info-plan-btn .plan-btn-reserve {
    padding: 8px 14px;
    background: rgba(46, 125, 79, 0.14);
    border-top: 1px solid rgba(46, 125, 79, 0.35);
    color: #2e7d4f;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    text-align: left;
}
body.light .dash-sub-info-plan-btn .plan-btn-reserve {
    background: rgba(46, 125, 79, 0.09);
    border-top-color: rgba(46, 125, 79, 0.3);
}
.dash-sub-info-plan-btn .plan-btn-reserve-warn {
    padding: 8px 14px;
    background: rgba(231, 76, 60, 0.12);
    border-top: 1px solid rgba(231, 76, 60, 0.35);
    color: #e74c3c;
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 500;
    text-align: left;
    line-height: 1.35;
}

/* Секция со стоимостью в нижней части кнопки плана. */
.dash-sub-info-plan-btn .plan-btn-price-section {
    margin-top: auto;
    border-top: 1px dashed rgba(0, 0, 0, 0.25);
    padding: 12px 21px;
    background: #ffffff;
    color: var(--t-text-muted);
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    font-weight: 600;
    text-align: left;
}

/* Пункт-счётчик (участники / месяцы) в кнопках плана. */
.plan-btn-counter {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.plan-btn-counter-label { color: var(--t-text-muted); text-align: center; }
.plan-btn-counter-ctrl {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.plan-btn-counter-btn {
    width: 33px;
    height: 33px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: transparent;
    color: #333;
    font-family: 'Roboto', sans-serif;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, border-color 0.12s, opacity 0.15s;
}
.plan-btn-counter-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.35);
}
.plan-btn-counter-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.plan-btn-counter-val {
    min-width: 27px;
    text-align: center;
    font-weight: 600;
    color: #333;
    font-size: 21px;
}

/* Цвета шапок плановых кнопок. */
.dash-sub-info-plan-btn.plan-std .plan-btn-header { background: #2e7d4f; }
.dash-sub-info-plan-btn.plan-pro .plan-btn-header { background: #7a3fc8; }

/* Жёлтый бейдж со скидкой в правом верхнем углу кнопки плана. */
.plan-btn-discount {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    padding: 3px 9px;
    border-radius: 999px;
    background: #f3b700;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1.2;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
body.light .plan-btn-discount { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); }
.plan-btn-discount.hidden { display: none; }

/* Мобильная адаптация модалки «О подписке». */
@media (max-width: 600px) {
    .dash-sub-info-modal { padding: 10px; }
    .dash-sub-info-content { padding: 18px 14px 14px; border-radius: 12px; }
    .dash-sub-info-close { top: 6px; right: 6px; }
    .dash-sub-info-plans { flex-direction: column; gap: 10px; }
    .dash-sub-info-plan-btn .plan-btn-header { padding: 12px 16px; }
    .dash-sub-info-plan-btn .plan-btn-kicker { font-size: 16px; }
    .dash-sub-info-plan-btn .plan-btn-name { font-size: 22px; }
    .dash-sub-info-plan-btn .plan-btn-features { padding: 4px 16px; font-size: 13px; }
    .dash-sub-info-plan-btn .plan-btn-features li { padding: 10px 0; }
    .dash-sub-info-plan-btn .plan-btn-price-section { padding: 10px 16px; font-size: 20px; }
    .plan-btn-counter-btn { width: 30px; height: 30px; font-size: 18px; }
    .plan-btn-counter-val { font-size: 18px; }
    .plan-btn-discount { top: 6px; right: 6px; font-size: 11px; padding: 2px 7px; }
    .plan-btn-info-tip { max-width: calc(100vw - 24px); font-size: 12px; }
}

.dash-tokens-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--t-text);
    letter-spacing: 0.5px;
}
.dash-tokens-value.is-red { color: #ff5555; }
.dash-tokens-value.is-orange { color: #f39c12; }
.dash-tokens-value.is-green { color: #2ecc71; }
.dash-tokens-sub {
    font-size: 11px;
    color: var(--t-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.dash-tokens-sub-btn { margin-top: 10px; }

/* Карточка «Быстрые действия» */
.dash-actions-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dash-action-btn {
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: transparent;
    color: rgba(var(--t-accent-rgb), 0.7);
    border: 1px solid rgba(var(--t-accent-rgb), 0.25);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.dash-action-btn:hover {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.5);
    box-shadow: 0 0 12px rgba(var(--t-accent-rgb), 0.12);
}

body.light .dash-inv-item { background: rgba(0,0,0,0.02); }
body.light .dash-unread-count { background: #d14040; }
body.light .dash-action-btn {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.45);
    background: rgba(var(--t-accent-rgb), 0.04);
}
body.light .dash-action-btn:hover {
    color: #073f61;
    border-color: rgba(var(--t-accent-rgb), 0.75);
    background: rgba(var(--t-accent-rgb), 0.08);
    box-shadow: 0 0 10px rgba(var(--t-accent-rgb), 0.15);
}

/* Карточка «Сегодня» (дата) */
.dash-card-date .dash-card-title { margin-bottom: 4px; }
.dash-date-dow {
    font-size: 13px;
    color: var(--t-text-muted);
    text-transform: capitalize;
}
.dash-date-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--t-text);
    text-transform: capitalize;
    line-height: 1.1;
}
.dash-date-year {
    font-size: 12px;
    color: var(--t-text-muted);
    opacity: 0.8;
}
.dash-date-holiday {
    margin-top: auto;
    padding-top: 6px;
    font-size: 12px;
    color: #f39c12;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Карточка «Именинники недели» */
.dash-bd-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dash-bd-item {
    display: flex;
    gap: 10px;
    align-items: center;
}
.dash-bd-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.04);
}
.dash-bd-info {
    flex: 1;
    min-width: 0;
}
.dash-bd-name {
    font-size: 13px;
    color: var(--t-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-bd-sub {
    font-size: 11px;
    color: var(--t-text-muted);
    margin-top: 2px;
}

/* Виджет «Мысль дня» */
.dash-card-quote {
    background: linear-gradient(135deg, rgba(180, 130, 255, 0.08), rgba(var(--t-accent-rgb), 0.04));
    border-color: rgba(180, 130, 255, 0.2);
}
.dash-quote-text {
    font-size: 14px;
    font-style: italic;
    color: var(--t-text);
    line-height: 1.55;
    letter-spacing: 0.3px;
}

/* Виджет «Погода» */
.dash-news-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dash-news-item {
    border-left: 2px solid rgba(var(--t-accent-rgb), 0.5);
    padding-left: 10px;
}
.dash-news-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}
.dash-news-date {
    font-size: 11px;
    color: var(--t-text-muted);
}
.dash-news-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--t-text);
    line-height: 1.3;
}
.dash-news-text {
    font-size: 12px;
    color: var(--t-text-muted);
    line-height: 1.4;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dash-news-item-clickable {
    cursor: pointer;
    border-radius: 0 6px 6px 0;
    transition: background 0.15s, border-color 0.15s;
}
.dash-news-item-clickable:hover,
.dash-news-item-clickable:focus-visible {
    background: rgba(var(--t-accent-rgb), 0.06);
    border-left-color: var(--t-accent);
    outline: none;
}
/* Модалка деталей новости */
.dash-news-modal-content { max-width: 520px; text-align: left; }
.dash-news-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--t-text);
    margin: 0 0 12px;
    line-height: 1.3;
}
.dash-news-modal-text {
    font-size: 14px;
    color: var(--t-text);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 50vh;
    overflow-y: auto;
}
.dash-news-modal-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid var(--t-border);
}
.dash-news-modal-dates {
    font-size: 11px;
    color: var(--t-text-muted);
}
.dash-news-modal-author {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--t-surface-strong);
    border-radius: 999px;
    padding: 4px 10px 4px 4px;
}
.dash-news-modal-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--t-surface);
}
.dash-news-modal-author-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--t-text);
}
.dash-news-modal-close {
    margin-top: 16px;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--t-border-strong);
    background: transparent;
    color: var(--t-text);
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}
.dash-news-modal-close:hover { background: var(--t-surface-strong); }

/* Режим хаба: основной #chat-container внутри модалки */
body.chats-hub-mode #chat-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    padding: 14px 14px 6px;
}
/* В модалке #input-area должен выглядеть идентично .group-chat-input-area —
   убираем page-уровневый градиент/z-index, чтобы совпасть визуально. */
body.chats-hub-mode #input-area {
    flex-shrink: 0;
    background: transparent;
    z-index: auto;
    position: static;
    padding: 10px 14px;
}
.group-chat-members-title {
    padding: 14px 12px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--t-text-muted);
    flex-shrink: 0;
}
.group-chat-members-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 10px;
}
/* Все плашки в списке чатов — единый стиль */
.group-chat-member-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
}
.group-chat-member-chip:hover {
    background: rgba(var(--t-accent-rgb), 0.06);
}
.group-chat-member-chip.active {
    background: rgba(var(--t-accent-rgb), 0.1);
    border-color: rgba(var(--t-accent-rgb), 0.25);
}
.group-chat-member-chip img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.group-chat-member-chip span {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Фотон — некликабельный */
.group-chat-member-chip.is-photon {
    cursor: default;
    opacity: 0.7;
}
.group-chat-member-chip.is-photon:hover {
    background: transparent;
}

/* Иконка-эмодзи для группового чата */
.gc-room-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}
/* Разделитель после плашки группы */
.gc-room-chip {
    margin-bottom: 6px;
}

/* Light theme */
body.light .group-chat-member-chip:hover {
    background: rgba(0, 100, 180, 0.06);
}
body.light .group-chat-member-chip.active {
    background: rgba(0, 100, 180, 0.1);
    border-color: rgba(0, 100, 180, 0.25);
}

/* Бэйдж непрочитанных DM у участника */
.gc-dm-badge {
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #6b7480;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    margin-left: auto;
    flex-shrink: 0;
}
.gc-group-item-badge.has-mention,
.gc-dm-badge.has-mention,
.chats-hub-dm-badge.has-mention {
    background: #ff8c00;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.6);
    animation: soul-badge-pulse 1.8s ease-in-out infinite;
}

/* Правая колонка — сообщения */
.group-chat-main {
    width: 70%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.group-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    padding: 14px 14px 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Typing-индикаторы — находятся между полем сообщений и инпутом,
   плашки выстраиваются снизу-вверх (column-reverse). */
.gc-typing-indicators {
    display: flex;
    flex-direction: column-reverse;
    gap: 4px;
    padding: 0 10px 4px;
    pointer-events: none;
    align-items: flex-start;
}
.gc-typing-indicators:empty { display: none; }
.gc-typing-plate {
    background: rgba(128, 128, 128, 0.35);
    color: var(--t-text);
    padding: 4px 12px 4px 4px;
    border-radius: 14px;
    font-size: 12px;
    font-style: italic;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
body.light .gc-typing-plate { background: rgba(0, 0, 0, 0.14); }
.gc-typing-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
}
.gc-typing-name { font-weight: 600; font-style: normal; }
.gc-typing-dots { display: inline-flex; gap: 1px; margin-left: 2px; }
.gc-typing-dots > span {
    animation: gcTypingBlink 1s infinite both;
}
.gc-typing-dots > span:nth-child(2) { animation-delay: 0.15s; }
.gc-typing-dots > span:nth-child(3) { animation-delay: 0.3s; }
@keyframes gcTypingBlink {
    0%, 100% { opacity: 0.3; }
    50%      { opacity: 1; }
}

/* Кнопка «К последнему сообщению». Появляется при прокрутке вверх.
   Sticky внутри скроллируемого контейнера сообщений — всегда у нижней
   границы поля сообщений, над полем ввода. */
.chat-scroll-down-btn {
    position: sticky;
    bottom: 10px;
    align-self: flex-end;
    margin-right: 8px;
    margin-top: auto;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--t-border);
    background: var(--t-panel);
    color: var(--t-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    z-index: 50;
}
.chat-scroll-down-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.chat-scroll-down-btn:hover {
    background: var(--t-surface-strong);
    color: var(--t-accent);
}
body.light .chat-scroll-down-btn { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14); }
body.light .chat-scroll-down-btn:hover { color: var(--t-accent-hover); }
.chat-scroll-down-btn svg { width: 18px; height: 18px; }

/* Разделитель дат — единый стиль с .msg-date-divider из чата Фотона */
.gc-date-divider {
    align-self: center;
    margin: 14px 0 6px;
    padding: 4px 14px;
    font-size: 12px;
    letter-spacing: 0.4px;
    color: var(--t-chat-foton-text, #d6d6d6);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    text-transform: lowercase;
    user-select: none;
    opacity: 0.75;
}
body.light .gc-date-divider {
    color: #4a4a4a;
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
    opacity: 0.85;
}

/* Сообщение — стиль «плашки» как у .msg из чата Фотона, но с аватаром и именем */
.gc-msg {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    align-items: flex-end;
    min-width: 0;
    max-width: 100%;
}
.gc-msg.is-mine {
    flex-direction: row-reverse;
}
.gc-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 0;
}
/* У собственных сообщений убираем аватарку и шапку (имя) */
.gc-msg.is-mine > .gc-msg-avatar,
.gc-msg.is-mine .gc-msg-header { display: none; }
.gc-msg-body {
    flex: 0 1 auto;
    max-width: 80%;
    min-width: 120px;
    position: relative;
    padding: 14px 22px 32px;
    border-radius: 15px;
    background: var(--t-chat-foton-bg);
    color: var(--t-chat-foton-text);
    letter-spacing: 0.6px;
    overflow-wrap: anywhere;
    word-break: break-word;
    animation: emerge 0.4s forwards ease-out;
}
.gc-msg.is-mine .gc-msg-body {
    background: var(--t-chat-user-bg);
    color: var(--t-chat-user-text);
}
/* Кнопка копирования в правом нижнем углу тела сообщения */
/* Кнопка копирования — идентично .msg-copy-btn */
.gc-msg-copy {
    position: absolute;
    bottom: 4px;
    left: 8px;
    width: 26px;
    height: 26px;
    padding: 4px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    font: inherit;
    color: inherit;
    line-height: 0;
    box-shadow: none;
}
.gc-msg-copy > img {
    width: 14px;
    height: 14px;
    filter: invert(1);
    opacity: 0.7;
}
.gc-msg-copy:hover {
    opacity: 0.8;
    border-color: rgba(var(--t-accent-rgb), 0.3);
}
.gc-msg-copy.copied {
    opacity: 1;
    border-color: rgba(120, 220, 160, 0.6);
    background: rgba(120, 220, 160, 0.15);
}
body.light .gc-msg-copy {
    border-color: rgba(0,0,0,0.25);
    opacity: 0.55;
}
body.light .gc-msg-copy > img {
    filter: none;
    opacity: 0.85;
}
body.light .gc-msg-copy:hover {
    opacity: 0.9;
    border-color: rgba(30, 100, 160, 0.55);
}

/* Тост уведомления об обновлении PWA — вверху по центру, в стиле приложения */
.sw-update-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 18, 24, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(var(--t-accent-rgb), 0.25);
    color: var(--t-text);
    padding: 10px 12px 10px 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 24px rgba(var(--t-accent-rgb), 0.12);
    z-index: 10050;
    animation: sw-update-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-width: calc(100vw - 24px);
    white-space: nowrap;
}
@keyframes sw-update-in {
    from { opacity: 0; transform: translate(-50%, -14px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}
.sw-update-btn {
    background: transparent;
    border: 1px solid rgba(var(--t-accent-rgb), 0.35);
    color: rgba(var(--t-accent-rgb), 0.9);
    border-radius: 999px;
    padding: 6px 16px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    transition: all 0.25s;
}
.sw-update-btn:hover {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.6);
    box-shadow: 0 0 12px rgba(var(--t-accent-rgb), 0.25);
}
.sw-update-close {
    background: none;
    border: none;
    color: var(--t-text-muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 6px;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.sw-update-close:hover { opacity: 1; color: var(--t-text); }

body.light .sw-update-toast {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 100, 180, 0.25);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15), 0 0 24px rgba(0, 100, 180, 0.08);
}
body.light .sw-update-btn {
    border-color: rgba(0, 100, 180, 0.35);
    color: rgba(0, 100, 180, 0.9);
}
body.light .sw-update-btn:hover {
    color: #0068b4;
    border-color: rgba(0, 100, 180, 0.6);
    box-shadow: 0 0 12px rgba(0, 100, 180, 0.18);
}

/* Мобильная адаптация — узкая колонка */
@media (max-width: 480px) {
    .sw-update-toast {
        font-size: 11px;
        letter-spacing: 0.6px;
        padding: 8px 10px 8px 14px;
        gap: 8px;
        top: calc(12px + env(safe-area-inset-top, 0px));
    }
    .sw-update-btn {
        padding: 5px 12px;
        font-size: 10px;
        letter-spacing: 0.8px;
    }
}
.gc-msg-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}
.gc-msg-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(var(--t-accent-rgb), 0.9);
}
.gc-msg.is-photon .gc-msg-name {
    color: rgba(180, 130, 255, 0.9);
}
.gc-msg.is-mine .gc-msg-name {
    color: rgba(120, 220, 160, 0.85);
}
/* Мета-группа (статус + время) в правом-нижнем углу пузыря. */
.gc-msg-meta {
    position: absolute;
    bottom: 6px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    letter-spacing: 0.3px;
    opacity: 0.6;
    font-style: normal;
    user-select: none;
    pointer-events: none;
    color: inherit;
}
.gc-msg-time {
    font-size: 11px;
    letter-spacing: 0.3px;
    font-style: normal;
    color: inherit;
}
.gc-msg-status {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}
.gc-msg-status svg { width: 14px; height: 10px; }
.gc-msg-status[data-status="read"] { color: var(--t-accent); }
body.light .gc-msg-status[data-status="read"] { color: var(--t-accent); }
body.light .gc-msg-meta { opacity: 0.7; }
/* TTS + Copy теперь живут слева. Если есть обе — tts справа от copy. */
.gc-msg.has-copy .gc-msg-tts { left: 40px; right: auto; }
.gc-msg-text {
    font-size: 14px;
    line-height: 1.8;
    letter-spacing: 0.6px;
    word-break: break-word;
    white-space: pre-wrap;
}
.gc-msg-text.blocked {
    color: #ff5555;
    font-style: italic;
    opacity: 0.7;
}
/* Refusal-сообщения от AI-консультанта claude: подсвечиваем чтобы юзер сразу
   понял, что запрос отклонён (а не получил полноценный ответ). */
.gc-msg-text.refusal {
    background: linear-gradient(135deg, rgba(255, 85, 85, 0.15), rgba(255, 140, 0, 0.1));
    border-left: 3px solid #ff5555;
    padding: 8px 12px 8px 36px;
    border-radius: 6px;
    position: relative;
    font-weight: 500;
    color: #ffd0d0;
}
.gc-msg-text.refusal::before {
    content: '🚨';
    position: absolute;
    left: 8px;
    top: 8px;
    font-size: 18px;
    line-height: 1;
}
.gc-msg-text.refusal[data-refusal-kind="forbidden_topic"]::before {
    content: '⛔';
}
.gc-msg-text.refusal[data-refusal-kind="tokens_depleted"]::before,
.gc-msg-text.refusal[data-refusal-kind="disabled"]::before,
.gc-msg-text.refusal[data-refusal-kind="api_error"]::before {
    content: '⚠️';
}
/* Кнопка озвучки — идентично .msg-tts-btn */
.gc-msg-tts {
    position: absolute;
    bottom: 4px;
    left: 8px;
    width: 26px;
    height: 26px;
    padding: 4px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gc-msg-tts img {
    width: 14px;
    height: 14px;
    filter: invert(1);
    opacity: 0.7;
}
.gc-msg-tts:hover {
    opacity: 0.8;
    border-color: rgba(var(--t-accent-rgb), 0.3);
}
.gc-msg-tts.playing {
    opacity: 1;
    border-color: rgba(var(--t-accent-rgb), 0.5);
    background: rgba(var(--t-accent-rgb), 0.1);
    animation: tts-pulse 1.5s infinite;
}
.gc-msg-tts.loading {
    opacity: 0.6;
    /* Гасим глобальное правило .loading (line ~290 + mobile.css ~246):
       padding 20×25, align-self: flex-start, color, font-style, pseudo-after
       с dots. Внутри .gc-msg-actions-left флекс-контейнера это смещает
       кнопку. Подавляем все эффекты явно. */
    padding: 4px;
    align-self: auto;
    color: inherit;
    font-style: normal;
    /* Кольцевой индикатор реализован через box-shadow — не влияет на layout,
       никаких pseudo-элементов и position-эквилибристики. */
    animation: gc-tts-loading-ring 1s ease-out infinite;
}
.gc-msg-tts.loading::after { content: none; }
@keyframes gc-tts-loading-ring {
    0%   { box-shadow: 0 0 0 0   rgba(var(--t-accent-rgb), 0.55); }
    100% { box-shadow: 0 0 0 6px rgba(var(--t-accent-rgb), 0);    }
}
body.light .gc-msg-tts.loading {
    animation-name: gc-tts-loading-ring-light;
}
@keyframes gc-tts-loading-ring-light {
    0%   { box-shadow: 0 0 0 0   rgba(var(--t-accent-rgb), 0.55); }
    100% { box-shadow: 0 0 0 6px rgba(var(--t-accent-rgb), 0);    }
}
body.light .gc-msg-tts {
    border-color: rgba(0,0,0,0.25);
    opacity: 0.55;
}
body.light .gc-msg-tts img {
    filter: none;
    opacity: 0.85;
}
body.light .gc-msg-tts:hover {
    opacity: 0.9;
    border-color: rgba(30, 100, 160, 0.55);
}

/* Поле ввода */
.group-chat-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--t-border);
    align-items: flex-end;
}
.group-chat-input-area textarea {
    flex: 1;
    resize: none;
    background: var(--t-input-bg);
    color: var(--t-text);
    border: 1px solid var(--t-border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    max-height: 100px;
    overflow-y: auto;
}
.group-chat-input-area textarea:focus {
    outline: none;
    border-color: rgba(var(--t-accent-rgb), 0.4);
}
#group-chat-send-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: #1f2e36;
    color: rgba(var(--t-accent-rgb), 0.8);
    border: 1px solid rgba(var(--t-accent-rgb), 0.25);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
#group-chat-send-btn:hover {
    background: #476271;
    color: var(--t-accent);
}
#group-chat-send-btn > img {
    width: 18px;
    height: 18px;
    object-fit: cover;
    opacity: 0.85;
    transition: opacity 0.2s;
}
#group-chat-send-btn:hover > img { opacity: 1; }

/* Кнопки микрофона, аттача и авто-озвучки в групповом чате */
.gc-mic-btn,
.gc-attach-btn,
.gc-tts-toggle-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: var(--t-surface);
    border: 1px solid var(--t-border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}
.gc-mic-btn > img,
.gc-attach-btn > img,
.gc-tts-toggle-btn > img {
    width: 18px;
    height: 18px;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.gc-mic-btn:hover,
.gc-attach-btn:hover,
.gc-tts-toggle-btn:hover {
    border-color: var(--t-border-strong);
}
.gc-mic-btn:hover > img,
.gc-attach-btn:hover > img,
.gc-tts-toggle-btn:hover > img {
    opacity: 1;
}
.gc-tts-toggle-btn > img {
    /* speaker.svg нарисован как currentColor (черный при рендере через <img>) —
       инвертируем, чтобы совпасть с белыми mic/attach иконками */
    filter: invert(1);
}
.gc-tts-toggle-btn.active {
    border-color: rgba(var(--t-accent-rgb), 0.5);
    background: rgba(var(--t-accent-rgb), 0.1);
    box-shadow: 0 0 12px rgba(var(--t-accent-rgb), 0.25);
}
.gc-tts-toggle-btn.active > img { opacity: 1; }
body.light .gc-tts-toggle-btn > img { filter: none; }
.gc-mic-btn.recording {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.15);
    box-shadow: 0 0 12px rgba(255, 68, 68, 0.3);
    animation: mic-pulse 1.5s infinite;
}
.gc-mic-btn.recording > img {
    opacity: 1;
}

/* Баннер «Редактирование сообщения» — над полем ввода */
.gc-editing-banner {
    order: -2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    margin-bottom: 6px;
    background: rgba(var(--t-accent-rgb), 0.1);
    border: 1px solid rgba(var(--t-accent-rgb), 0.3);
    border-radius: 8px;
    font-size: 12px;
    color: var(--t-text);
    letter-spacing: 0.3px;
}
body.light .gc-editing-banner {
    background: rgba(var(--t-accent-rgb), 0.08);
    border-color: rgba(var(--t-accent-rgb), 0.35);
}
.gc-editing-cancel {
    background: transparent;
    border: none;
    color: var(--t-text-muted);
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    border-radius: 4px;
}
.gc-editing-cancel:hover { color: var(--t-text); background: rgba(255,255,255,0.06); }
body.light .gc-editing-cancel:hover { background: rgba(0,0,0,0.05); }

/* Preview цитаты над полем ввода в групповом/личном чате */
.gc-reply-preview {
    order: -2;
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 20px 8px 10px;
    margin-bottom: 8px;
    background: rgba(var(--t-accent-rgb), 0.08);
    border-left: 3px solid var(--t-accent);
    border-radius: 6px;
    color: var(--t-text);
}
body.light .gc-reply-preview {
    background: rgba(var(--t-accent-rgb), 0.08);
    border-left-color: var(--t-accent);
}
.gc-reply-preview-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.gc-reply-preview-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--t-accent);
    letter-spacing: 0.2px;
}
body.light .gc-reply-preview-name { color: var(--t-accent); }
.gc-reply-preview-text {
    font-size: 13px;
    line-height: 1.4;
    color: var(--t-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.8em;
}
.gc-reply-preview-cancel {
    background: transparent;
    border: none;
    color: var(--t-text-muted);
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    border-radius: 4px;
}
.gc-reply-preview-cancel:hover { color: var(--t-text); background: rgba(255,255,255,0.06); }
body.light .gc-reply-preview-cancel:hover { background: rgba(0,0,0,0.05); }

/* Карточка события звонка в сообщении */
.gc-msg-call {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(var(--t-accent-rgb), 0.1);
    border: 1px solid rgba(var(--t-accent-rgb), 0.25);
    border-radius: 10px;
    color: var(--t-text);
    font-size: 13px;
    font-style: italic;
    margin: 4px 0;
}
.gc-msg-call.call-missed {
    background: rgba(245, 80, 80, 0.1);
    border-color: rgba(245, 80, 80, 0.35);
    color: #e74c3c;
}
body.light .gc-msg-call.call-missed { color: #c43333; }
.gc-msg-call-icon {
    display: inline-flex;
    line-height: 0;
    color: inherit;
}
.gc-msg-call-label { letter-spacing: 0.2px; }

/* Цитата внутри сообщения */
.gc-msg-quote {
    display: block;
    margin: 2px 0 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-left: 3px solid var(--t-accent);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.gc-msg-quote:hover { background: rgba(255, 255, 255, 0.1); }
body.light .gc-msg-quote {
    background: rgba(var(--t-accent-rgb), 0.07);
    border-left-color: var(--t-accent);
}
body.light .gc-msg-quote:hover { background: rgba(var(--t-accent-rgb), 0.12); }
.gc-msg-quote-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--t-accent);
    letter-spacing: 0.2px;
    margin-bottom: 2px;
}
body.light .gc-msg-quote-name { color: var(--t-accent); }
.gc-msg-quote-text {
    font-size: 12px;
    line-height: 1.4;
    color: var(--t-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gc-msg.gc-msg-flash .gc-msg-body {
    outline: 2px solid #ff8c00;
    outline-offset: 2px;
    transition: outline 0.3s;
}

/* Плашка «Переслано от ...» над текстом сообщения */
.gc-msg-forwarded {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 6px;
    padding: 4px 8px;
    background: rgba(var(--t-accent-rgb), 0.08);
    border-left: 2px solid rgba(var(--t-accent-rgb), 0.55);
    border-radius: 4px;
    font-size: 11px;
    color: var(--t-text-muted);
}
body.light .gc-msg-forwarded {
    background: rgba(var(--t-accent-rgb), 0.06);
    border-left-color: rgba(var(--t-accent-rgb), 0.5);
}
.gc-msg-forwarded-label {
    opacity: 0.85;
}
.gc-msg-forwarded-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.gc-msg-forwarded-name {
    font-weight: 600;
    color: var(--t-text);
}

/* Модалка «Переслать в...» */
.gc-forward-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 20070;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.gc-forward-content {
    background: var(--t-panel);
    border: 1px solid var(--t-border);
    border-radius: 14px;
    padding: 18px 18px 14px;
    width: 100%;
    max-width: 380px;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
body.light .gc-forward-content {
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.gc-forward-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.gc-forward-title {
    margin: 0;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--t-text-muted);
    font-weight: 600;
}
.gc-forward-close {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid var(--t-border);
    background: transparent;
    color: var(--t-text-muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.gc-forward-close:hover {
    color: var(--t-text);
    background: rgba(255,255,255,0.06);
}
body.light .gc-forward-close:hover { background: rgba(0,0,0,0.05); }
.gc-forward-list {
    overflow-y: auto;
    flex: 1;
}
.gc-forward-section-title {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--t-text-muted);
    padding: 10px 4px 6px;
}
.gc-forward-tile {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    color: var(--t-text);
    transition: background 0.12s;
}
.gc-forward-tile:hover {
    background: rgba(var(--t-accent-rgb), 0.1);
}
body.light .gc-forward-tile:hover {
    background: rgba(var(--t-accent-rgb), 0.07);
}
.gc-forward-tile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.gc-forward-tile-name {
    font-size: 14px;
}
.gc-forward-empty {
    padding: 24px 0;
    text-align: center;
    color: var(--t-text-muted);
    font-size: 13px;
}

/* Контекстное меню на собственных сообщениях */
.gc-msg-context-menu {
    position: fixed;
    z-index: 21000;
    min-width: 120px;
    background: var(--t-panel);
    border: 1px solid var(--t-border);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.4);
    padding: 4px;
    animation: gc-ctx-in 0.12s ease-out;
}

/* Ряд быстрых реакций над пунктами меню. */
.gc-msg-reactions-bar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--t-border);
}
.gc-msg-react-quick,
.gc-msg-react-more {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: background 0.12s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    color: var(--t-text-muted);
}
.gc-msg-react-quick:hover,
.gc-msg-react-more:hover {
    background: rgba(var(--t-accent-rgb), 0.14);
    transform: scale(1.1);
    color: var(--t-text);
}
body.light .gc-msg-react-quick:hover,
body.light .gc-msg-react-more:hover {
    background: rgba(var(--t-accent-rgb), 0.1);
}
.gc-msg-react-more { margin-left: auto; }

/* Нижний-левый блок действий: реакции + tts + copy в одном ряду. */
.gc-msg-actions-left {
    position: absolute;
    bottom: 4px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 1;
}
.gc-msg-actions-left .gc-msg-reactions {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 4px;
    margin: 0;
}
/* Pill реакции — стиль как у .gc-msg-copy (круглая обводка, полупрозрачная). */
.gc-msg-react-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: 13px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    color: var(--t-text);
    opacity: 0.75;
    transition: opacity 0.2s, background 0.12s;
    -webkit-tap-highlight-color: transparent;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
}
.gc-msg-react-pill:hover { opacity: 0.95; }
.gc-msg-react-pill.mine {
    opacity: 1;
    background: rgba(120, 220, 160, 0.12);
}
body.light .gc-msg-react-pill { opacity: 0.6; }
body.light .gc-msg-react-pill:hover { opacity: 0.9; }
body.light .gc-msg-react-pill.mine {
    opacity: 1;
    background: rgba(40, 140, 80, 0.12);
}
.gc-msg-react-emoji { font-size: 14px; line-height: 1; }
.gc-msg-react-count { font-weight: 600; }

/* Убираем абсолютное позиционирование у copy/tts — они теперь внутри
   .gc-msg-actions-left и размещаются flex'ом. */
.gc-msg-actions-left .gc-msg-copy,
.gc-msg-actions-left .gc-msg-tts {
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
}

/* Picker реакций — работает отдельно, inline-стили задают left/top.
   Переопределяем координаты, унаследованные от .emoji-picker. */
.gc-reaction-picker {
    position: fixed;
    bottom: auto;
    right: auto;
    left: 0;
    top: 0;
    z-index: 21005;
}
body.light .gc-msg-context-menu {
    box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}
@keyframes gc-ctx-in {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}
.gc-msg-context-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--t-text);
    font-size: 13px;
    cursor: pointer;
    border-radius: 5px;
}
.gc-msg-context-btn:hover {
    background: rgba(var(--t-accent-rgb), 0.12);
    color: var(--t-accent);
}
body.light .gc-msg-context-btn:hover {
    background: rgba(var(--t-accent-rgb), 0.08);
    color: var(--t-accent);
}

/* Превью файлов в групповом чате */
#gc-file-preview-bar {
    display: none;
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 0 8px 0;
    order: -1;
}
.group-chat-input-area {
    flex-wrap: wrap;
}
.gc-file-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--t-surface);
    border: 1px solid var(--t-border);
    border-radius: 16px;
    padding: 3px 8px 3px 3px;
    font-size: 11px;
    color: var(--t-text-muted);
    max-width: 180px;
}
.gc-file-chip-thumb {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    object-fit: cover;
}
.gc-file-chip-icon {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background: var(--t-surface-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    font-weight: 700;
    color: var(--t-text-muted);
}
.gc-file-chip-name {
    white-space: normal;
    word-break: break-all;
}
.gc-file-chip-remove {
    background: none;
    border: none;
    color: var(--t-text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    line-height: 1;
}
.gc-file-chip-remove:hover { color: #ff5050; }

/* Файлы в сообщениях группового/личного чата — стиль взят из .msg-attachments
   (чат Фотона): крупнее thumbnails, голубоватые ссылки. */
.gc-msg-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.gc-msg-attachments img {
    max-width: 240px;
    max-height: 180px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    transition: border-color 0.3s;
}
.gc-msg-attachments img:hover { border-color: rgba(255,255,255,0.3); }
.gc-msg-attachments a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(var(--t-accent-rgb), 0.08);
    border: 1px solid rgba(var(--t-accent-rgb), 0.2);
    border-radius: 10px;
    color: rgba(var(--t-accent-rgb), 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    margin: 4px 0;
}
.gc-msg-attachments a:hover {
    color: var(--t-accent);
    border-color: rgba(var(--t-accent-rgb), 0.5);
    box-shadow: 0 0 15px rgba(var(--t-accent-rgb), 0.15);
}
.gc-msg-attachments a::before { content: '\1F4CE '; }

body.light .gc-msg-attachments a {
    color: var(--t-accent);
    background: rgba(var(--t-accent-rgb), 0.08);
    border-color: rgba(var(--t-accent-rgb), 0.45);
}
body.light .gc-msg-attachments a:hover {
    color: #073f61;
    background: rgba(var(--t-accent-rgb), 0.14);
    border-color: rgba(var(--t-accent-rgb), 0.75);
    box-shadow: 0 0 10px rgba(var(--t-accent-rgb), 0.18);
}
body.light .gc-msg-attachments img {
    border-color: rgba(0, 0, 0, 0.12);
}
body.light .gc-msg-attachments img:hover {
    border-color: rgba(0, 0, 0, 0.3);
}

/* Light theme overrides */
body.light .company-card-chat-btn {
    color: rgba(0, 100, 180, 0.55);
}
body.light .company-card-chat-btn:hover {
    color: #0068b4;
    background: rgba(0, 100, 180, 0.08);
}
body.light .company-card-chat-badge,
body.light .gc-dm-badge {
    color: #fff !important;
}
body.light .group-chat-modal-content {
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
body.light .gc-msg-name {
    color: #0068b4;
}
body.light .gc-msg.is-photon .gc-msg-name {
    color: #7b3fba;
}
body.light .gc-msg.is-mine .gc-msg-name {
    color: #1a7f3c;
}
body.light .gc-msg-tts img {
    filter: invert(0.25);
}
body.light .gc-mic-btn > img,
body.light .gc-attach-btn > img {
    filter: invert(1);
}

/* ── Видеозвонки ──────────────────────────────────────── */
.call-overlay {
    position: fixed;
    inset: 0;
    z-index: 25000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
}
.call-overlay-content {
    text-align: center;
    color: #fff;
}
.call-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
    border: 2px solid rgba(255,255,255,0.15);
}
.call-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
}
.call-label {
    font-size: 14px;
    color: rgba(255,255,255,0.55);
    margin-bottom: 28px;
}
.call-pulse {
    animation: call-pulse 2s ease-in-out infinite;
}
@keyframes call-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.call-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}
.call-btn {
    padding: 12px 28px;
    border-radius: 30px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    transition: filter 0.2s;
}
.call-btn:hover { filter: brightness(1.2); }
.call-accept {
    background: rgba(72, 199, 120, 0.25);
    color: #7ee8a8;
    border: 1px solid rgba(72, 199, 120, 0.45);
}
.call-decline {
    background: rgba(245, 80, 80, 0.2);
    color: #ff9999;
    border: 1px solid rgba(245, 80, 80, 0.35);
}

/* Active call */
.call-active {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
}
/* Layout: stage (большое окно) слева + thumbs (колонна превью) справа.
   В полноэкранном режиме thumbs становится вертикальной колонной поверх стейджа справа. */
.call-video-wrap {
    position: relative;
    width: 70%;
    max-height: 70vh;
    height: 60vh;
    border-radius: 12px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 4px 40px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 8px;
}
.call-video-wrap.call-fs {
    width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
    flex: 1;
    padding: 0;
    gap: 0;
}
.call-stage {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 0;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    container-type: size;
}
.call-video-wrap.call-fs .call-stage { border-radius: 0; }
.call-stage-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #000;
    transition: opacity 0.3s;
}
.call-stage.cam-off .call-stage-video { opacity: 0; }
.call-stage-avatar {
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(96px, 30cqmin, 240px);
    height: clamp(96px, 30cqmin, 240px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
}
.call-stage.cam-off .call-stage-avatar { opacity: 1; }
.call-stage-name {
    position: absolute;
    left: 12px;
    bottom: 12px;
    color: #fff;
    font-size: 13px;
    background: rgba(0,0,0,0.55);
    padding: 4px 10px;
    border-radius: 12px;
    z-index: 3;
    pointer-events: none;
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.call-thumbs {
    width: 180px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
}
.call-thumbs::-webkit-scrollbar { width: 6px; }
.call-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
/* Полноэкранный режим: thumbs всплывает поверх стейджа справа, скроллится колонной шириной в один тумб. */
.call-video-wrap.call-fs .call-thumbs {
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 100%;
    padding: 10px 10px 80px 10px;
    background: linear-gradient(to left, rgba(0,0,0,0.55), rgba(0,0,0,0.15) 90%, transparent);
    z-index: 5;
    box-sizing: border-box;
}
.call-thumb {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    aspect-ratio: 16/9;
    background: #111;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s;
    container-type: size;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.call-thumb.speaking {
    border-color: #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}
.call-thumb.on-stage {
    border-color: rgba(76, 175, 80, 0.4);
}
.call-thumb-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    transition: opacity 0.3s;
}
.call-thumb-avatar {
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(40px, 45cqmin, 80px);
    height: clamp(40px, 45cqmin, 80px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.call-thumb.cam-off .call-thumb-avatar { opacity: 1; }
.call-thumb.cam-off .call-thumb-video { opacity: 0; }
.call-thumb-name {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 3px;
    color: #fff;
    font-size: 10px;
    background: rgba(0,0,0,0.5);
    padding: 1px 5px;
    border-radius: 6px;
    z-index: 3;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
.call-thumb-screen-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(33, 150, 243, 0.85);
    color: #fff;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 4px;
    z-index: 3;
    pointer-events: none;
    letter-spacing: 0.3px;
}
@media (max-width: 720px) {
    .call-video-wrap { width: 100%; height: 70vh; flex-direction: column; }
    .call-thumbs { width: 100%; height: 90px; flex-direction: row; flex-shrink: 0; }
    .call-thumb { width: 140px; height: 100%; flex-shrink: 0; aspect-ratio: auto; }
    .call-video-wrap.call-fs .call-thumbs {
        position: absolute;
        right: 0; top: 0; bottom: 0;
        width: 130px;
        height: auto;
        flex-direction: column;
    }
    .call-video-wrap.call-fs .call-thumb { width: 100%; aspect-ratio: 16/9; height: auto; }
}
.call-timer {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    background: rgba(0,0,0,0.5);
    padding: 4px 14px;
    border-radius: 16px;
    z-index: 10;
}
.call-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 18px;
    flex-shrink: 0;
}
.call-ctrl-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.call-ctrl-btn:hover { background: rgba(255,255,255,0.15); }
.call-ctrl-btn svg {
    flex-shrink: 0;
}
.call-ctrl-btn .call-icon-off { display: none; }
.call-ctrl-btn.muted .call-icon-on,
.call-ctrl-btn.cam-off .call-icon-on { display: none; }
.call-ctrl-btn.muted .call-icon-off,
.call-ctrl-btn.cam-off .call-icon-off { display: block; }
.call-ctrl-btn.muted,
.call-ctrl-btn.cam-off {
    background: rgba(245, 80, 80, 0.35);
    border-color: rgba(245, 80, 80, 0.6);
}
.call-hangup-btn {
    background: rgba(235, 50, 50, 0.5) !important;
    border-color: rgba(235, 50, 50, 0.7) !important;
}
.call-hangup-btn:hover { background: rgba(235, 50, 50, 0.7) !important; }



body.light .call-overlay { background: rgba(255,255,255,0.92); }
body.light .call-overlay-content { color: #222; }
body.light .call-name { color: #111; }
body.light .call-label { color: #888; }
body.light .call-accept { background: rgba(72,199,120,0.15); color: #2a8a52; border-color: rgba(72,199,120,0.4); }
body.light .call-decline { background: rgba(245,80,80,0.12); color: #c43333; border-color: rgba(245,80,80,0.3); }
body.light .call-ctrl-btn {
    background: rgba(0,0,0,0.7);
    border-color: rgba(0,0,0,0.3);
    color: #fff;
}
body.light .call-ctrl-btn:hover { background: rgba(0,0,0,0.85); }
.call-ctrl-btn.active {
    background: rgba(54, 214, 123, 0.25);
    border-color: rgba(54, 214, 123, 0.6);
    color: #36d67b;
    box-shadow: 0 0 0 2px rgba(54, 214, 123, 0.2);
}
body.light .call-ctrl-btn.active {
    background: rgba(30, 154, 86, 0.15);
    border-color: rgba(30, 154, 86, 0.5);
    color: #1e9a56;
}
body.light .call-ctrl-btn.muted,
body.light .call-ctrl-btn.cam-off {
    background: rgba(220, 40, 40, 0.85);
    border-color: rgba(220, 40, 40, 0.6);
}
body.light .call-ctrl-btn.muted:hover,
body.light .call-ctrl-btn.cam-off:hover {
    background: rgba(200, 30, 30, 0.95);
}

/* Расшифровка звонка */
.call-transcript-panel {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    max-width: 600px;
    max-height: 180px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 20;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.call-transcript-header {
    padding: 6px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
#call-transcript-status { color: #4caf50; }
.call-transcript-log {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    font-size: 13px;
    color: #fff;
    line-height: 1.5;
}
.call-transcript-entry {
    margin-bottom: 4px;
}
.call-transcript-entry .tr-name {
    font-weight: 600;
    color: rgba(var(--t-accent-rgb),0.9);
    margin-right: 6px;
}
.call-transcript-entry .tr-time {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    margin-right: 6px;
}
.call-ctrl-btn.transcribing {
    background: rgba(76, 175, 80, 0.35);
    border-color: rgba(76, 175, 80, 0.6);
}
body.light .call-ctrl-btn.transcribing {
    background: rgba(56, 142, 60, 0.8);
    border-color: rgba(56, 142, 60, 0.5);
}
.call-ctrl-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.call-ctrl-btn:disabled:hover {
    background: rgba(255,255,255,0.08);
}
body.light .call-transcript-panel {
    background: rgba(255,255,255,0.9);
    border-color: rgba(0,0,0,0.15);
}
body.light .call-transcript-header { color: #888; border-color: rgba(0,0,0,0.1); }
body.light .call-transcript-log { color: #222; }
body.light .call-transcript-entry .tr-name { color: #1976d2; }
body.light .call-transcript-entry .tr-time { color: #999; }

@media screen and (max-width: 768px) {
    .call-transcript-panel { width: 90%; bottom: 74px; max-height: 140px; }
}

/* Мобильная кнопка списка участников — скрыта на десктопе */
.gc-mobile-members-toggle { display: none; }

/* --- Показ/скрытие пароля (auth-форма и профиль) --- */
.password-wrap {
    position: relative;
    width: 100%;
}
.password-wrap > input {
    width: 100%;
    padding-right: 40px;
    box-sizing: border-box;
}
.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: currentColor;
    opacity: 0.55;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: opacity 0.15s, background 0.15s;
}
.password-toggle:hover { opacity: 1; background: rgba(255, 255, 255, 0.06); }
.password-toggle:focus-visible { outline: 2px solid rgba(var(--t-accent-rgb), 0.5); outline-offset: 0; }
.password-toggle .pwd-icon-eye-off { display: none; }
.password-toggle.is-visible .pwd-icon-eye { display: none; }
.password-toggle.is-visible .pwd-icon-eye-off { display: inline-block; }
body.light .password-toggle:hover { background: rgba(0, 0, 0, 0.06); }

/* ===== Групповой календарь (матрица: группа × участники × дни месяца) ===== */
.group-calendar-modal-content {
    width: 95vw;
    max-width: 95vw;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}
.group-calendar-modal-content .calendar-header {
    flex: 0 0 auto;
    padding: 12px 49px 12px 16px; /* right = 16 + (close-btn 28 + 5) — "Сегодня" не уходит под × */
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}
.group-calendar-body {
    flex: 1 1 auto;
    overflow: auto;
    position: relative;
    background: rgba(255,255,255,0.02);
    cursor: grab;
}
.group-calendar-body.gcal-dragging { cursor: grabbing; user-select: none; }
.group-calendar-body.gcal-dragging * { cursor: grabbing !important; }
.gcal-loading { opacity: 0.5; }
.gcal-empty {
    padding: 40px 20px;
    text-align: center;
    color: rgba(255,255,255,0.55);
    font-size: 14px;
}

/* Шапка дат (sticky-top) */
.gcal-header-row {
    display: grid;
    min-width: max-content; /* без этого containing-block sticky-left у gcal-corner = ширина viewport, и угол уезжает на максимальном scrollLeft */
    position: sticky;
    top: 0;
    z-index: 30;
    background: #1c1f24;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.gcal-corner {
    position: sticky;
    left: 0;
    z-index: 31;
    background: #1c1f24;
    border-right: 1px solid rgba(255,255,255,0.12);
    height: 44px;
}
.gcal-day-header {
    height: 44px;
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    line-height: 1.2;
    text-align: center;
}
.gcal-day-header.gcal-weekend { color: rgba(255,140,140,0.85); background: rgba(255,80,80,0.04); }
.gcal-day-header.gcal-today {
    background: rgba(var(--t-accent-rgb),0.18);
    color: #fff;
    font-weight: 600;
}
.gcal-day-num { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.95); }
.gcal-day-header.gcal-weekend .gcal-day-num { color: rgba(255,180,180,0.95); }
.gcal-day-header.gcal-today .gcal-day-num { color: #fff; }
.gcal-day-wd { font-size: 10px; opacity: 0.6; text-transform: lowercase; }

/* Заголовок группы — на всю ширину */
.gcal-group-row {
    display: grid;
    min-width: max-content;
    background: rgba(255,255,255,0.04);
    border-top: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.gcal-group-title {
    position: sticky;
    left: 0;
    z-index: 25;
    background: rgba(255,255,255,0.04);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,200,80,0.95);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gcal-group-title.gcal-group-owner { color: rgba(120,220,120,0.95); }

/* Свёртывание групп: строка группы — кликабельный заголовок с шевроном,
   плашка общего события рендерится прямо на этой строке. */
.gcal-group-row { cursor: pointer; }
.gcal-group-row:hover { background: rgba(255,255,255,0.07); }
body.light .gcal-group-row:hover { background: rgba(0,0,0,0.05); }
/* Название группы (sticky-left) — непрозрачный фон, чтобы плашки события,
   уезжающие под него при горизонтальном скролле, не просвечивали. */
.gcal-group-title {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #22252b;
}
.gcal-grp-chevron { flex: 0 0 auto; width: 12px; text-align: center; font-size: 10px; opacity: 0.75; }
.gcal-grp-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Строки участников */
.gcal-member-row {
    display: grid;
    grid-auto-rows: 36px;
    min-width: max-content; /* containing-block для sticky-left ячейки с именем = вся ширина ряда, иначе на крайнем правом scroll имя клампится и уезжает влево */
    border-bottom: 1px solid rgba(255,255,255,0.05);
    position: relative;
}
.gcal-member-name {
    grid-column: 1 / span 1;
    grid-row: 1;
    position: sticky;
    left: 0;
    z-index: 20;
    background: #1c1f24;
    padding: 0 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    border-right: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gcal-member-name.gcal-member-self { color: rgba(var(--t-accent-rgb),0.95); font-weight: 600; }

/* Фоновые ячейки-дни */
.gcal-day-cell {
    border-right: 1px solid rgba(255,255,255,0.05);
    background: transparent;
}
.gcal-day-cell.gcal-weekend { background: rgba(255,80,80,0.04); }
.gcal-day-cell.gcal-today { background: rgba(var(--t-accent-rgb),0.08); }

/* DnD: подсветка drop-target'а под курсором при перетаскивании плашки.
   На время drag-сессии плашки переводятся в pointer-events:none, чтобы
   dragover/drop попадали в ячейки-дни, а не в перекрывающие их tile'ы. */
.gcal-day-cell.gcal-drop-target {
    background: rgba(var(--t-accent-rgb),0.22);
    box-shadow: inset 0 0 0 2px rgba(var(--t-accent-rgb),0.6);
}
/* Тайлы во время drag не должны перехватывать события — иначе dragover
   попадает на тайл, а не на ячейку под ним. НО source-tile (.gcal-event-tile-dragging)
   исключаем — если на нём pointer-events: none, Chromium считает source
   "оторвавшимся" и прерывает drag сразу после dragstart. */
body.gcal-dnd-active .gcal-event-tile:not(.gcal-event-tile-dragging) { pointer-events: none; }
body.gcal-dnd-active .gcal-event-tile.gcal-event-tile-dragging { opacity: 0.4; }
.gcal-event-tile-draggable { cursor: grab; }
.gcal-event-tile-draggable:active { cursor: grabbing; }

/* Модалка выбора режима переноса повторяющегося события (показывается после drop). */
.gcal-cyclical-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gcal-cyclical-modal-content {
    background: #1a1f2e;
    color: rgba(255,255,255,0.95);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 20px 24px;
    max-width: 460px;
    width: calc(100% - 32px);
    box-shadow: 0 12px 48px rgba(0,0,0,0.4);
}
.gcal-cyclical-modal-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}
.gcal-cyclical-modal-text {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    margin-bottom: 16px;
    line-height: 1.45;
}
.gcal-cyclical-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.gcal-cyclical-modal-actions button {
    width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid rgba(var(--t-accent-rgb),0.4);
    background: rgba(var(--t-accent-rgb),0.12);
    color: rgba(255,255,255,0.95);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.gcal-cyclical-modal-actions button:hover {
    background: rgba(var(--t-accent-rgb),0.22);
    border-color: rgba(var(--t-accent-rgb),0.65);
}
.gcal-cyclical-modal-actions button.gcal-cyclical-modal-cancel {
    border-color: rgba(255,255,255,0.15);
    background: transparent;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}
.gcal-cyclical-modal-actions button.gcal-cyclical-modal-cancel:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.85);
}
body.light .gcal-cyclical-modal-content {
    background: #ffffff;
    color: rgba(0,0,0,0.92);
    border-color: rgba(0,0,0,0.08);
}
body.light .gcal-cyclical-modal-text { color: rgba(0,0,0,0.65); }
body.light .gcal-cyclical-modal-actions button {
    border-color: rgba(33,150,243,0.4);
    background: rgba(33,150,243,0.08);
    color: rgba(0,0,0,0.92);
}
body.light .gcal-cyclical-modal-actions button:hover {
    background: rgba(33,150,243,0.18);
}
body.light .gcal-cyclical-modal-actions button.gcal-cyclical-modal-cancel {
    color: rgba(0,0,0,0.55);
    border-color: rgba(0,0,0,0.12);
}
body.light .gcal-day-cell.gcal-drop-target {
    background: rgba(33,150,243,0.15);
    box-shadow: inset 0 0 0 2px rgba(33,150,243,0.55);
}

/* Mobile: full-screen модалка + компактная шапка. Ширины колонок сетки задаются из JS (MOBILE_DAY_COL_W / MOBILE_MEMBER_COL_W), здесь только шасси модалки и хедера. */
@media (max-width: 768px) {
    #group-calendar-modal.companies-modal {
        padding: 0; /* родитель .companies-modal имеет padding:20px — на mobile убираем чтобы content занял весь экран */
    }
    .group-calendar-modal-content {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .group-calendar-modal-content .calendar-header {
        padding: 10px 38px 10px 8px; /* right = 8 + 28 крестик + 2 зазор; на mobile экономим */
        gap: 4px;
    }
    .group-calendar-modal-content .calendar-title {
        font-size: 14px;
    }
    .group-calendar-modal-content .calendar-nav-btn,
    .group-calendar-modal-content .calendar-today-btn {
        padding: 4px 8px;
        font-size: 13px;
    }
    .gcal-corner,
    .gcal-day-header { height: 38px; }
    .gcal-member-row { grid-auto-rows: 32px; }
    .gcal-day-num { font-size: 12px; }
    .gcal-day-wd { font-size: 9px; }
    .gcal-member-name { font-size: 12px; padding: 0 8px; }
    .gcal-group-title { font-size: 11px; padding: 5px 8px; letter-spacing: 0.5px; }
    .gcal-event-tile { font-size: 10px; padding: 2px 4px; margin: 2px 1px; }
}

/* Плашки событий (поверх фоновых ячеек) */
.gcal-event-tile {
    margin: 3px 2px;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.3;
    color: rgba(255,255,255,0.95);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    z-index: 5;
    border: 1px solid transparent;
    transition: filter 0.15s, transform 0.1s;
}
.gcal-event-tile:hover { filter: brightness(1.15); transform: translateY(-1px); }
.gcal-event-tile.gcal-diff-simple {
    background: rgba(76, 175, 80, 0.45);
    border-color: rgba(76, 175, 80, 0.7);
}
.gcal-event-tile.gcal-diff-complex {
    background: rgba(33, 150, 243, 0.45);
    border-color: rgba(33, 150, 243, 0.7);
}
.gcal-event-tile.gcal-diff-rework {
    background: rgba(156, 39, 176, 0.45);
    border-color: rgba(156, 39, 176, 0.7);
}

/* Тултип — повторяет стиль calendar-tooltip */
.group-calendar-tooltip {
    position: absolute;
    z-index: 50;
    background: #23272d;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    color: rgba(255,255,255,0.92);
    font-size: 13px;
    line-height: 1.4;
}
.group-calendar-tooltip .calendar-tooltip-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    padding-right: 28px;
}
.group-calendar-tooltip .calendar-tooltip-row {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.group-calendar-tooltip .calendar-tooltip-label {
    color: rgba(255,255,255,0.55);
    font-size: 12px;
    white-space: nowrap;
}
.group-calendar-tooltip .calendar-tooltip-value {
    color: rgba(255,255,255,0.95);
    font-size: 13px;
    word-break: break-word;
    flex: 1 1 60%;
}
.group-calendar-tooltip .calendar-tooltip-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 4px;
    line-height: 0;
    border-radius: 4px;
}
.group-calendar-tooltip .calendar-tooltip-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

/* Light theme */
body.light .group-calendar-body { background: rgba(0,0,0,0.02); }
body.light .gcal-header-row { background: #f6f7f9; border-bottom-color: rgba(0,0,0,0.12); }
body.light .gcal-corner { background: #f6f7f9; border-right-color: rgba(0,0,0,0.12); }
body.light .gcal-day-header { color: rgba(0,0,0,0.7); border-right-color: rgba(0,0,0,0.08); }
body.light .gcal-day-header.gcal-weekend { color: #c63a3a; background: rgba(220,80,80,0.05); }
body.light .gcal-day-header.gcal-today { background: rgba(33,150,243,0.18); color: var(--t-accent); }
body.light .gcal-day-num { color: rgba(0,0,0,0.9); }
body.light .gcal-group-row { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08); }
body.light .gcal-group-title { background: #eef0f2; color: #b06a00; border-bottom-color: rgba(0,0,0,0.08); }
body.light .gcal-group-title.gcal-group-owner { color: #2a7a2a; }
body.light .gcal-member-row { border-bottom-color: rgba(0,0,0,0.06); }
body.light .gcal-member-name { background: #fff; color: rgba(0,0,0,0.85); border-right-color: rgba(0,0,0,0.1); }
body.light .gcal-member-name.gcal-member-self { color: var(--t-accent); }
body.light .gcal-day-cell { border-right-color: rgba(0,0,0,0.06); }
body.light .gcal-day-cell.gcal-weekend { background: rgba(220,80,80,0.04); }
body.light .gcal-day-cell.gcal-today { background: rgba(33,150,243,0.08); }
body.light .gcal-event-tile { color: rgba(0,0,0,0.9); }
body.light .gcal-event-tile.gcal-diff-simple {
    background: rgba(76, 175, 80, 0.35);
    border-color: rgba(76, 175, 80, 0.6);
}
body.light .gcal-event-tile.gcal-diff-complex {
    background: rgba(33, 150, 243, 0.35);
    border-color: rgba(33, 150, 243, 0.6);
}
body.light .gcal-event-tile.gcal-diff-rework {
    background: rgba(156, 39, 176, 0.35);
    border-color: rgba(156, 39, 176, 0.6);
}
body.light .group-calendar-tooltip {
    background: #fff;
    color: rgba(0,0,0,0.92);
    border-color: rgba(0,0,0,0.18);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
body.light .group-calendar-tooltip .calendar-tooltip-label { color: rgba(0,0,0,0.55); }
body.light .group-calendar-tooltip .calendar-tooltip-value { color: rgba(0,0,0,0.9); }
body.light .group-calendar-tooltip .calendar-tooltip-close { color: rgba(0,0,0,0.5); }
body.light .group-calendar-tooltip .calendar-tooltip-close:hover { background: rgba(0,0,0,0.06); color: #000; }

/* ===== Тренеры: мастер-кнопка + редактор настроек ===== */
#trainers-admin-btn { display: none; }
body.master #trainers-admin-btn { display: flex; }
.trainers-admin-content { max-width: 560px; max-height: 85vh; overflow-y: auto; }
.trainers-admin-list { display: flex; flex-direction: column; }
.trainer-editor { border: 1px solid var(--t-border); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.trainer-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.trainer-editor-name { font-weight: 600; color: var(--t-text); }
.trainer-active-toggle { font-size: 12px; color: var(--t-text-muted); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.trainer-editor > .events-input { margin-bottom: 8px; width: 100%; box-sizing: border-box; }
.trainer-prices { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.trainer-price-row { display: flex; gap: 6px; align-items: center; }
.trainer-price-row .events-input { margin-bottom: 0; }
.trainer-price-row input[type=number] { max-width: 90px; }
.trainer-price-del { flex: 0 0 auto; width: 30px; height: 30px; border: 1px solid var(--t-border); background: transparent; color: var(--t-text-muted); border-radius: 6px; cursor: pointer; }
.trainer-price-add { background: transparent; border: 1px dashed rgba(var(--t-accent-rgb), 0.5); color: var(--t-accent); border-radius: 6px; padding: 6px 10px; cursor: pointer; font-size: 12px; align-self: flex-start; }
.trainer-editor-save { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.trainer-editor-status { font-size: 12px; color: var(--t-text-muted); }

/* ===== Тренеры: отдельная секция под панелями + оффканвас ===== */
/* Секция тренеров — НЕ карточка дашборда, идёт под сеткой панелей, на всю
   ширину контента. Красивые карточки: фото на всю карточку, ФИО + дисциплина. */
.dash-trainers-section { max-width: 1200px; margin: 26px auto 0; }
.dash-trainers-section-title { font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--t-text-muted); margin: 0 0 14px; font-weight: 700; }
/* 4 в ряд, с уменьшением экрана — 3 → 2 → 1. */
.dash-trainers-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .dash-trainers-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .dash-trainers-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .dash-trainers-grid { grid-template-columns: 1fr; } }
.dash-trainer-photocard { position: relative; aspect-ratio: 3 / 4; width: 100%; border: none; padding: 0; border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--t-surface); box-shadow: 0 2px 10px rgba(0,0,0,0.18); transition: transform 0.18s ease, box-shadow 0.18s ease; }
.dash-trainer-photocard:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.3); }
.dash-trainer-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease; }
.dash-trainer-photocard:hover .dash-trainer-photo { transform: scale(1.04); }
.dash-trainer-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 11px; text-align: left; background: linear-gradient(to top, rgba(0,0,0,0.82) 8%, rgba(0,0,0,0.45) 45%, rgba(0,0,0,0)); }
.dash-trainer-name { font-size: 14px; font-weight: 700; line-height: 1.2; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.dash-trainer-spec { font-size: 11px; font-weight: 500; color: rgba(255,255,255,0.88); margin-top: 3px; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
/* Управление фото-карточкой (профиль тренера + мастер-редактор) */
.trainer-cardphoto { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.trainer-cardphoto-preview { width: 60px; height: 80px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: var(--t-surface); border: 1px solid var(--t-border); }
.trainer-cardphoto-controls { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.trainer-cardphoto-hint { font-size: 11px; color: var(--t-text-muted); line-height: 1.35; }
.trainer-cardphoto-btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.trainer-cardphoto-upload { font-size: 12px; color: var(--t-accent); border: 1px solid rgba(var(--t-accent-rgb), 0.4); background: rgba(var(--t-accent-rgb), 0.12); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.trainer-cardphoto-upload:hover { background: rgba(var(--t-accent-rgb), 0.2); }
.trainer-cardphoto-remove { font-size: 12px; color: var(--t-text-muted); background: transparent; border: 1px solid var(--t-border); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.trainer-cardphoto-status { font-size: 11px; color: var(--t-text-muted); min-height: 14px; }
.trainer-oc-overlay { position: fixed; inset: 0; z-index: 30000; background: rgba(0,0,0,0.45); opacity: 0; pointer-events: none; transition: opacity 0.28s ease; }
.trainer-oc-overlay.open { opacity: 1; pointer-events: auto; }
.trainer-oc-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 380px; max-width: 92vw; background: var(--t-panel); border-left: 1px solid var(--t-border); box-shadow: -8px 0 30px rgba(0,0,0,0.4); padding: 22px 20px; overflow-y: auto; transform: translateX(100%); transition: transform 0.28s ease; }
.trainer-oc-overlay.open .trainer-oc-panel { transform: translateX(0); }
.trainer-oc-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--t-text-muted); font-size: 26px; line-height: 1; cursor: pointer; }
.trainer-oc-head { display: flex; align-items: center; gap: 12px; margin: 6px 30px 14px 0; }
.trainer-oc-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--t-surface); flex: 0 0 auto; }
.trainer-oc-name { font-size: 17px; font-weight: 600; color: var(--t-text); }
.trainer-oc-spec { font-size: 12px; color: var(--t-accent); margin-top: 2px; }
.trainer-oc-desc { font-size: 13px; line-height: 1.55; color: var(--t-text); white-space: pre-wrap; margin-bottom: 16px; }
.trainer-oc-prices-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--t-text-muted); margin-bottom: 8px; }
.trainer-oc-prices { display: flex; flex-direction: column; gap: 8px; }
.trainer-oc-price-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--t-border); border-radius: 10px; }
.trainer-oc-price-title { font-size: 13px; font-weight: 500; color: var(--t-text); }
.trainer-oc-price-amount { font-size: 12px; color: var(--t-text-muted); margin-top: 2px; }
.trainer-oc-book { flex: 0 0 auto; background: rgba(var(--t-accent-rgb), 0.14); color: var(--t-accent); border: 1px solid rgba(var(--t-accent-rgb), 0.4); border-radius: 8px; padding: 8px 14px; font-size: 12px; cursor: pointer; white-space: nowrap; transition: all 0.15s; }
.trainer-oc-book:hover:not(:disabled) { background: rgba(var(--t-accent-rgb), 0.22); }
.trainer-oc-book:disabled { opacity: 0.7; cursor: default; }
.trainer-oc-book.done { background: rgba(100, 200, 120, 0.18); color: #4caf6a; border-color: rgba(100,200,120,0.4); }

/* ============================ НОВОСТИ ============================ */
:root { --news-accent: #e58a8a; --news-accent-soft: rgba(229,138,138,0.16); }

/* Пастельно-красный цвет плитки события категории «Новость» */
.events-item-header-news { background: linear-gradient(135deg, #eaa0a0, #d97a7a) !important; }
.events-item-news { box-shadow: 0 0 0 1px rgba(217,122,122,0.35); }

/* Красная (пастельная) шапка модалки при редактировании новости —
   в том же ключе, что и difficulty-шапки (полупрозрачный фон). */
.companies-modal-content.news-edit-active .companies-modal-header {
    background: rgba(229, 138, 138, 0.22);
    transition: background 0.25s;
}

/* Сноска «другие новости» в grid-карточке «Новости» */
.dash-news-more { display: block; margin-left: auto; margin-top: 8px; background: none; border: none; padding: 2px; font-size: 11px; color: var(--news-accent); cursor: pointer; text-decoration: underline; opacity: 0.85; }
.dash-news-more:hover { opacity: 1; }

/* Секция «Новости» — под секцией тренеров */
.dash-news-section { max-width: 1200px; margin: 26px auto 0; }
.dash-news-section-title { font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--news-accent); margin: 0 0 14px; font-weight: 700; }
.dash-news-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .dash-news-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .dash-news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .dash-news-grid { grid-template-columns: 1fr; } }
.dash-news-photocard { position: relative; aspect-ratio: 4 / 3; width: 100%; border: none; padding: 0; border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--t-surface); box-shadow: 0 2px 10px rgba(0,0,0,0.18); transition: transform 0.18s ease, box-shadow 0.18s ease; }
.dash-news-photocard:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.3); }
.dash-news-photocard::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--news-accent); z-index: 1; }
.dash-news-photo { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform 0.25s ease; }
.dash-news-photocard:hover .dash-news-photo { transform: scale(1.04); }
.dash-news-card-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 13px 12px; text-align: left; background: linear-gradient(to top, rgba(0,0,0,0.85) 6%, rgba(0,0,0,0.45) 48%, rgba(0,0,0,0)); }
.dash-news-card-title { font-size: 14px; font-weight: 700; line-height: 1.25; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.55); }
.dash-news-card-dates { margin-top: 4px; font-size: 11px; color: rgba(255,255,255,0.85); }

/* Оффканвас новости — наследует slide-in от .trainer-oc-* */
.news-oc-panel { padding: 0; }
.news-oc-panel .trainer-oc-close { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.6); z-index: 2; }
.news-oc-hero { width: 100%; height: 200px; background-size: cover; background-position: center; background-color: var(--t-surface); }
.news-oc-body { padding: 18px 20px 26px; }
.news-oc-title { font-size: 19px; font-weight: 700; color: var(--t-text); margin: 0 0 8px; }
.news-oc-dates { font-size: 12px; color: var(--news-accent); font-weight: 600; margin-bottom: 6px; }
.news-oc-place { font-size: 12px; color: var(--t-text-muted); margin-bottom: 10px; }
.news-oc-text { font-size: 14px; line-height: 1.6; color: var(--t-text); white-space: pre-wrap; }
.news-oc-source { margin-top: 16px; font-size: 12px; color: var(--t-text-muted); border-top: 1px solid var(--t-border); padding-top: 10px; }

/* Загрузчик картинки-оформления новости (в редакторах событий) */
.news-img-uploader { margin: 4px 0 10px; }
.news-img-preview { display: block; width: 100%; max-height: 160px; object-fit: cover; border-radius: 10px; background: var(--t-surface); border: 1px solid var(--t-border); }
.news-img-btnrow { display: flex; gap: 8px; margin-top: 8px; }
.news-img-upload-btn, .news-img-remove-btn { font-size: 12px; padding: 7px 14px; border-radius: 8px; cursor: pointer; border: 1px solid rgba(229,138,138,0.5); background: var(--news-accent-soft); color: var(--news-accent); transition: all 0.15s; }
.news-img-upload-btn:hover, .news-img-remove-btn:hover { background: rgba(229,138,138,0.28); }
.news-img-upload-btn.disabled { opacity: 0.5; cursor: not-allowed; }
.news-img-status { font-size: 11px; color: var(--t-text-muted); margin-top: 6px; min-height: 14px; }

/* ============================================================
   PWA install-баннер на дашборде. Ненавязчивая карточка сверху;
   разовое закрытие (localStorage). Видимость/клик — js.js initPwaInstall.
   Показывается только когда установка реально доступна (HTTPS + beforeinstallprompt
   на Android, либо iOS Safari). */
.install-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid rgba(var(--t-accent-rgb), 0.45);
    background: rgba(var(--t-accent-rgb), 0.08);
    border-radius: 14px;
    animation: install-banner-in 0.3s ease-out;
}
.install-banner[hidden] { display: none; }
.install-banner-icon {
    flex: 0 0 auto;
    width: 36px; height: 36px;
    border-radius: 9px;
    object-fit: cover;
}
.install-banner-text {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    line-height: 1.35;
    color: var(--t-text, #d8d8d8);
}
.install-banner-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
}
.install-banner-btn {
    padding: 8px 16px;
    border: 1px solid rgba(var(--t-accent-rgb), 0.6);
    background: rgba(var(--t-accent-rgb), 0.16);
    color: var(--t-accent);
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.15s;
}
.install-banner-btn:hover { background: rgba(var(--t-accent-rgb), 0.28); }
.install-banner-close {
    flex: 0 0 auto;
    width: 30px; height: 30px;
    border: none;
    background: transparent;
    color: var(--t-text-muted, #999);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s;
}
.install-banner-close:hover { color: #fff; background: rgba(255,255,255,0.08); }
@keyframes install-banner-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 480px) {
    .install-banner { gap: 10px; padding: 11px 12px; }
    .install-banner-text { font-size: 12px; }
    .install-banner-btn { padding: 7px 12px; font-size: 12px; }
}
