/* Поддержка: кнопка, панель переписки и страница /support.
   Отдельный файл намеренно: public-white.css правится вручную, и новый
   блок там каждый раз терялся при перезаливке. */

.support-fab {
    position: fixed;
    right: 20px;
    bottom: calc(20px + var(--support-bottom-offset, 0px));
    z-index: 2147483000;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 54px;
    padding: 0 18px;
    border: 0;
    border-radius: 27px;
    background: #0179cd;
    color: #fff;
    font: 600 15px/1 "Roboto Flex", Roboto, system-ui, sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(1, 121, 205, 0.35);
    transition: background-color .15s ease, transform .15s ease;
}

.support-fab:hover {
    background: #0167b1;
}

.support-fab:focus-visible {
    outline: 3px solid rgba(1, 121, 205, .45);
    outline-offset: 2px;
}

.support-fab--hidden {
    display: none;
}

.support-fab__badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #e6462d;
    color: #fff;
    font: 700 12px/20px "Roboto Flex", Roboto, system-ui, sans-serif;
    text-align: center;
}

.support-fab__badge[hidden] {
    display: none;
}

.support-panel {
    position: fixed;
    right: 20px;
    bottom: calc(86px + var(--support-bottom-offset, 0px));
    z-index: 2147483000;
    display: flex;
    flex-direction: column;
    width: min(420px, calc(100vw - 32px));
    height: min(600px, calc(100vh - 140px - var(--support-bottom-offset, 0px)));
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 48px rgba(10, 16, 28, .28);
    overflow: hidden;
}

.support-panel[hidden] {
    display: none;
}

/* --- Шапка --- */

.support-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #0b1522;
    color: #fff;
}

.support-head__title {
    margin: 0;
    font: 600 15px/1.3 "Roboto Flex", Roboto, system-ui, sans-serif;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-head__sub {
    margin: 2px 0 0;
    font: 400 12px/1.3 "Roboto Flex", Roboto, system-ui, sans-serif;
    color: #9db0c9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-head__close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

/* Заголовок в шапке: текст должен переноситься, кнопка — нет. */
.support-head__text {
    flex: 1 1 auto;
    min-width: 0;
}

/* Метка у гостя — короткая, чтобы кнопка не занимала угол. */
.support-fab__label {
    font: inherit;
}

.support-fab--guest {
    text-decoration: none;
}

/* Ссылка из панели на полную страницу: нужна на узких экранах, где
   панель занимает весь экран и закрыть её нечем. */
.support-panel__link {
    flex: 0 0 auto;
    padding: 9px 12px;
    border-top: 1px solid #e7ecf3;
    background: #f6f8fb;
    color: #0179cd;
    font: 400 13px/1.3 "Roboto Flex", Roboto, system-ui, sans-serif;
    text-align: center;
    text-decoration: none;
}

.support-panel__link:hover {
    background: #eef4fa;
}

/* Подпись поля ввода — только для скринридеров. */
.support-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.support-head__close:hover {
    background: rgba(255, 255, 255, .22);
}

/* --- Список диалогов (оператор) --- */

.support-dialogs {
    flex: 0 0 auto;
    max-height: 40%;
    overflow-y: auto;
    border-bottom: 1px solid #e7ecf3;
}

.support-dialogs[hidden] {
    display: none;
}

.support-dialogs__item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    border-left: 3px solid transparent;
    background: none;
    text-align: left;
    cursor: pointer;
}

.support-dialogs__item:hover {
    background: #f4f8fc;
}

.support-dialogs__item--active {
    border-left-color: #0179cd;
    background: #eaf4fd;
}

.support-dialogs__row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.support-dialogs__name {
    flex: 1 1 auto;
    min-width: 0;
    font: 600 13px/1.3 "Roboto Flex", Roboto, system-ui, sans-serif;
    color: #12151c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-dialogs__preview {
    margin: 2px 0 0;
    font: 400 12px/1.35 "Roboto Flex", Roboto, system-ui, sans-serif;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-dialogs__badge {
    flex: 0 0 auto;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #e6462d;
    color: #fff;
    font: 700 11px/18px "Roboto Flex", Roboto, system-ui, sans-serif;
    text-align: center;
}

/* --- Переписка --- */

.support-thread {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f6f8fb;
}

.support-msg {
    max-width: 84%;
    padding: 9px 12px;
    border-radius: 12px;
    font: 400 14px/1.45 "Roboto Flex", Roboto, system-ui, sans-serif;
    color: #12151c;
    background: #fff;
    border: 1px solid #e3e8ef;
    align-self: flex-start;
    word-break: break-word;
}

.support-msg--mine {
    align-self: flex-end;
    background: #0179cd;
    color: #fff;
    border-color: #0179cd;
}

.support-msg__author {
    display: block;
    margin-bottom: 3px;
    font: 600 12px/1.3 "Roboto Flex", Roboto, system-ui, sans-serif;
    color: #6b7280;
}

.support-msg--mine .support-msg__author {
    color: rgba(255, 255, 255, .8);
}

.support-msg__time {
    display: block;
    margin-top: 4px;
    font: 400 11px/1.3 "Roboto Flex", Roboto, system-ui, sans-serif;
    color: #9aa3af;
}

.support-msg--mine .support-msg__time {
    color: rgba(255, 255, 255, .75);
}

.support-msg__attach {
    display: block;
    margin-top: 8px;
    max-width: 100%;
    border-radius: 8px;
}

/* --- Поле ввода --- */

.support-composer {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e7ecf3;
    background: #fff;
}

.support-composer__input {
    flex: 1 1 auto;
    min-height: 42px;
    max-height: 120px;
    padding: 11px 12px;
    border: 1px solid #d5dce5;
    border-radius: 10px;
    font: 400 14px/1.4 "Roboto Flex", Roboto, system-ui, sans-serif;
    color: #12151c;
    resize: vertical;
}

.support-composer__input:focus {
    outline: none;
    border-color: #0179cd;
}

.support-composer__btn {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: #0179cd;
    color: #fff;
    font: 600 14px/1 "Roboto Flex", Roboto, system-ui, sans-serif;
    cursor: pointer;
}

.support-composer__btn:disabled {
    background: #b6c3d1;
    cursor: default;
}

/* --- Вложение картинки --- */

.support-composer__row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.support-attach {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid #d5dce5;
    border-radius: 10px;
    background: #fff;
    color: #55607a;
    cursor: pointer;
}

.support-attach:hover {
    border-color: #0179cd;
    color: #0179cd;
}

.support-attach__name {
    flex: 0 0 auto;
    margin: 0;
    font: 400 12px/1.3 "Roboto Flex", Roboto, system-ui, sans-serif;
    color: #55607a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-attach__name[hidden] {
    display: none;
}

/* --- Почта для гостя --- */

.support-contact {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: #f6f8fb;
    border-top: 1px solid #e7ecf3;
}

.support-contact[hidden] {
    display: none;
}

.support-contact__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.support-contact__label {
    font: 600 12px/1.3 "Roboto Flex", Roboto, system-ui, sans-serif;
    color: #12151c;
}

.support-contact__optional {
    font-weight: 400;
    color: #9aa3af;
}

.support-contact__input {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #d5dce5;
    border-radius: 10px;
    font: 400 14px/1.4 "Roboto Flex", Roboto, system-ui, sans-serif;
    color: #12151c;
    background: #fff;
}

.support-contact__input:focus {
    outline: none;
    border-color: #0179cd;
}

.support-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font: 400 12px/1.45 "Roboto Flex", Roboto, system-ui, sans-serif;
    color: #55607a;
    cursor: pointer;
}

.support-consent input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
}

.support-consent a {
    color: #0179cd;
}

/* --- Состояния --- */

.support-note {
    margin: auto;
    padding: 18px 14px;
    text-align: center;
    font: 400 14px/1.5 "Roboto Flex", Roboto, system-ui, sans-serif;
    color: #6b7280;
}

.support-note a {
    color: #0179cd;
}

.support-status {
    flex: 0 0 auto;
    padding: 8px 12px;
    text-align: center;
    font: 400 13px/1.4 "Roboto Flex", Roboto, system-ui, sans-serif;
    color: #6b7280;
    background: #fff;
    border-top: 1px solid #e7ecf3;
}

.support-status:empty {
    display: none;
}

.support-status--error {
    color: #b3261e;
    background: #fdf1f0;
}

