/* Доп. стили страницы чата (из chats.php) */
.chatTextName { max-width: 90%; }
.hidescroller { scrollbar-width: none; overflow: auto; max-height: 285px; }
.hidescroller::-webkit-scrollbar { display: none; }
.approack { display: flex; align-items: flex-start; justify-content: flex-start; margin-bottom: 5px; position: relative; }
.showSubs { display: inline-block; width: 32px; cursor: pointer; padding-top: 4px; }
.showSubs img { display: block; }
.subberClick {
    position: absolute;
    right: 0;
    top: -16px;
    z-index: 10;
    background: #fff;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid #b1b7bc;
    list-style: none;
    padding: 0;
    display: flex;
    display: none;
}
.subberClick.showed { display: flex; }
.subberClick li { margin: 0; padding: 0; }
.subberClick li form { margin: 0; padding: 0; display: block; }
.subberClick .sublink {
    display: block;
    background: #fafafa;
    text-decoration: none;
    color: #000;
    padding: 3px 10px;
    text-align: center;
}
.subberClick .sublink:hover { opacity: 0.6; }
.subberClick .sublink img { display: block; vertical-align: middle; }
.subberClick button.sublink {
    cursor: pointer;
    font-size: inherit;
    border: none;
    background: #fafafa;
    padding: 3px 10px;
    width: 100%;
    box-sizing: border-box;
}
.selectChatsLInk:hover { opacity: 0.7; }
.selectChatsLInk {
    display: block; font-size: 14px; font-weight: 600; color: #181818; line-height: 1.4;
    text-decoration: none; padding: 5px 10px; border: 1px solid white; border-radius: 10px;
    max-width: 90%; flex-grow: 1; text-align: left;
}
.grow__title { font-size: 20px; }

/* Таблицы из Markdown в сообщениях консультанта — аккуратное оформление */
.chat__bubble .chat__md-table {
    width: 100%;
    max-width: 100%;
    margin: 0.75rem 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    border: 1px solid rgba(102, 136, 187, 0.2);
}
.chat__bubble .chat__md-table th,
.chat__bubble .chat__md-table td {
    padding: 0.65rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e8ecf0;
    border-right: 1px solid #e8ecf0;
}
.chat__bubble .chat__md-table th:last-child,
.chat__bubble .chat__md-table td:last-child {
    border-right: none;
}
.chat__bubble .chat__md-table thead th {
    background: linear-gradient(180deg, #6b8fc9 0%, #5a7ab5 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.85em;
    letter-spacing: 0.02em;
    text-transform: none;
    padding: 0.75rem 1rem;
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,0.2);
}
.chat__bubble .chat__md-table thead th:last-child {
    border-right: none;
}
.chat__bubble .chat__md-table tbody tr {
    transition: background-color 0.15s ease;
}
.chat__bubble .chat__md-table tbody tr:nth-child(even) {
    background: #f7f9fc;
}
.chat__bubble .chat__md-table tbody tr:hover {
    background: #eef2f8;
}
.chat__bubble .chat__md-table tbody tr:last-child td {
    border-bottom: none;
}
.chat__bubble .chat__md-table td {
    color: #333;
}
.chat__bubble .chat__md-table tbody tr td:first-child {
    font-weight: 500;
    color: #2c3e50;
}

/* Блок «Создать беседу»: заголовок и closeBar в одной строке */
.leftSideBlock { margin-bottom: 30px; }
.openBar { display: none; width: 32px; margin-left: 13px; cursor: pointer; }
.openBar img { width: 100%; height: auto; display: block; }
.closeBar { position: absolute; right: 15px; top: 25px; width: 32px; cursor: pointer; }
.closeBar img { width: 100%; height: auto; display: block; }

/* Свёрнутая левая панель (closeBar): узкая полоса, показываем openBar, скрываем closeBar */
.bubka.banished { width: 72px; position: fixed; left: 3px; z-index: 10; }
.bubka.banished .grow__content--open { padding: 10px 0; display: flex; flex-direction: column; align-items: center; }
.bubka.banished .openBar { display: block; margin-left: 0; }
.bubka.banished .closeBar { display: none; }
.bubka.banished .leftSideBlock { margin-bottom: 0; width: 100%; }
.bubka.banished .leftSideBlock .grow__main { display: flex; flex-direction: column; align-items: center; }
.bubka.banished .formedHidden { display: none; }
.bubka.banished .grow__title { display: none; }
.bubka.banished .listchats { display: flex; flex-direction: column; align-items: center; width: 100%; }
.bubka.banished .hidescroller small { display: none; }
.bubka.banished .showSubs { display: none; }
.bubka.banished .approack { margin-bottom: 8px; display: flex; justify-content: center; }
.bubka.banished .selectChatsLInk {
    font-size: 0;
    padding: 0;
    width: 37px;
    min-height: 37px;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.bubka.banished .selectChatsLInk::before {
    content: attr(data-letter);
    font-size: 16px;
    font-weight: 600;
    color: #181818;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 37px;
    height: 37px;
    background: #e8ecef;
    border-radius: 10px;
    border: 1px solid #e2e2e2;
}
.bubka.banished .selectChatsLInk:hover { opacity: 0.7; }
.bubka.banished .selectChatsLInk:hover::before { border-color: #8BB7A2; background: #f0f5f3; }
.bubka.banished .fastChat { font-size: 0; padding: 0; width: 40px; height: 40px; margin-left: 0; background: url("../img/fastChat.png") center/contain no-repeat !important; }
.bubka.banished .appeal__btn-list { display: none; }
.bubka.banished .site-form__label { display: none; }
/* Стилизация селекта «Роль модели» под старый сайт */
.site-form__label--select { display: block; margin-bottom: 16px; }
/* .site-form__text для селекта: позиционируется как лейбл над селектом */
.site-form__label--select .site-form__text {
    font-size: 12px;
    top: 10px;
    z-index: 1;
}
.appeal__cell--grow { flex-grow: 1; width: 50%; box-sizing: border-box; padding: 0; }
.appeal__row { gap: 30px; }
/* Кнопка «Быстрый чат» по центру блока */
.leftSideBlock:last-child .grow__main { text-align: center; }
.leftSideBlock:last-child .grow__main .fastChat { display: inline-flex; }
.appeal__btn-item { padding: 0 !important; }
.appeal__btn-list { gap: 30px; }
.site-wrapper { max-width: 1800px; }
.newRowLeft .appeal__btn-item { flex-basis: 100%; }
.newRowLeft { display: flex; flex-wrap: wrap; }
.chat__body { padding-bottom: 10px; }
.bubka { width: 23%; }
.site-wrapper { width: calc(100vw - 120px); }
.blobls { display: flex; align-items: center; gap: 15px; }
/* Футер чата: кнопка «Выбрать запрос» слева от загрузки файлов, в одну строку */
.chat__footer-item--row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin: 0;
    padding-left: 8px;
}
.chat__footer-item--row .chat__file-names {
    font-size: 12px;
    font-weight: 600;
    color: #636C78;
    max-width: 180px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat__bubble table:not(.chat__md-table) td { border: 1px solid #ccc; }
.chat__bubble table:not(.chat__md-table) { width: 100%; border-collapse: collapse; }
@media (max-width: 992px) {
    .appeal__cell--grow { width: 100%; }
    .bubka { width: 100%; }
    .site-wrapper { width: 100%; }
}
@media screen and (max-width: 1535px) {
    .subberClick {
        flex-direction: column;
    }
}
@media (max-width: 1175px) {
    .chat__footer { display: flex; justify-content: center; align-items: center; padding: 0 16px; flex-direction: column; }
    .blobls { width: 100%; }
}
@media (max-width: 600px) {
    .blobls { flex-direction: column-reverse; padding-bottom: 0; }
}

/* Название роли над заголовком беседы — бейдж «таблетка» */
.chat__role-name {
    display: inline-block;
    margin: 0 0 0.35rem 0;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #6688bb 0%, #5577aa 100%);
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(102, 136, 187, 0.35);
    letter-spacing: 0.02em;
}

/* Шапка чата: кнопки справа — все в одну линию, top: 15px как в chat.css */
.chat-header-actions { position: relative; }
.chat-header-actions .copydialod,
.chat-header-actions .savedialod,
.chat-header-actions .openChats,
.chat-header-actions .miniChats {
    position: absolute;
    top: 15px;
    right: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.chat-header-actions #chat-save-icon-wrap {
    position: absolute;
    top: 15px;
    right: 95px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.chat-header-actions #chat-save-icon-wrap .copydialod,
.chat-header-actions #chat-save-icon-wrap .savedialod {
    position: static;
}
.chat-header-actions #chat-clear-icon-wrap {
    position: absolute;
    top: 15px;
    right: 55px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.chat-header-actions #chat-clear-icon-wrap form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}
.chat-header-actions #chat-clear-icon-wrap .clearDisalog {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.chat-header-actions .copydialod.fastIcon,
.chat-header-actions .savedialod.fastIcon { right: 95px; }
.chat-header-actions .openChats { right: 15px; }
.chat-header-actions .miniChats { right: 15px; }
.chat-header-actions .savedialod { font-size: 14px; text-decoration: none; color: #181818; }

/* Режим «на весь экран» */
.bigChat .footer-support__footer.site-footer { display: none; }

/* Футер: слева — логотип и навигация, справа — юридические документы и копирайт */
.site-footer__nav-list .site-footer__nav-link {
    white-space: nowrap;
}
.site-footer__nav-list {
    flex-wrap: nowrap;
    gap: 16px;
}
.site-footer__legal-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}
.site-footer__legal-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    justify-content: flex-end;
}
.site-footer__legal-list .site-footer__nav-link {
    font-size: 14px;
    font-weight: 600;
}
.site-footer__legal-col .site-footer__copyright {
    margin: 0;
    font-size: 13px;
    color: #636C78;
}
.bigChat .chat__wysiwyg textarea { height: 153px !important; }
.bigChat .flawor { padding-bottom: 0; }
.bigChat .bubka { display: none; }
.bigChat .site-wrapper.site-wrapper--big { display: none; }
.bigChat .chat__bubble { max-width: 95%; }

/* Стили для markdown в сообщениях */
.chat__bubble h1, .chat__bubble h2, .chat__bubble h3, .chat__bubble h4 {
    margin: 10px 0 8px 0;
    font-weight: 600;
    line-height: 1.3;
}
.chat__bubble h1 { font-size: 1.5em; }
.chat__bubble h2 { font-size: 1.3em; }
.chat__bubble h3 { font-size: 1.1em; }
.chat__bubble h4 { font-size: 1.05em; }
.chat__bubble ul, .chat__bubble ol {
    margin: 8px 0;
    padding-left: 25px;
}
.chat__bubble li {
    margin: 4px 0;
    line-height: 1.4;
}
.chat__bubble pre {
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 8px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}
.chat__bubble code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}
.chat__bubble b { font-weight: 700; }
.chat__bubble i { font-style: italic; }
.chat__bubble s { text-decoration: line-through; }

/* Окно «Добавить роль» / «Редактировать роль» — как форма авторизации, по центру */
.about--role-form {
    padding: 20px 0 40px;
}
.about--role-form .auth-form {
    max-width: 400px;
    margin: 0 auto;
}
.about--role-form .auth-form__body {
    padding: 20px;
    border-radius: 16px;
    background-color: #ffffff;
    box-shadow: 0 5px 10px 0 rgba(0, 0, 0, 0.1);
}
.about--role-form .auth-form__title {
    margin: 0 0 20px;
    font-size: 24px;
    font-weight: 700;
    color: #181818;
}
.about--role-form .auth-form__label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #181818;
}
.about--role-form .auth-form__input {
    display: block;
    width: 100%;
    margin-bottom: 16px;
    padding: 12px 16px;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}
.about--role-form .auth-form__input:focus {
    outline: none;
    border-color: #636C78;
}
.about--role-form .auth-form__textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}
.about--role-form .auth-form__btn {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background-color: #8BB7A2;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    text-align: center;
}
.about--role-form .auth-form__btn:hover {
    opacity: 0.9;
}
.about--role-form .auth-form__btn--secondary {
    margin-top: 12px;
    background-color: #636C78;
}
.about--role-form .auth-form__actions {
    margin-top: 16px;
}
.about--role-form .auth-form__errors {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 8px;
    background-color: #ffebee;
    font-size: 14px;
    color: #c62828;
}
.about--role-form .auth-form__errors ul {
    margin: 0;
    padding-left: 20px;
}

/* Кнопка «Выбрать запрос» в футере чата — в стиле сайта, без иконки */
.btn--chat-prompt {
    width: auto;
    min-width: auto;
    height: 48px;
    padding: 0 20px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    background-color: #6688bb;
    color: #fff;
}
.btn--chat-prompt:hover {
    opacity: 0.9;
}
.btn--chat-prompt::before {
    display: none;
}

/* Блок «Создать запрос» на странице «Мои запросы» — те же стили, что у «Добавить роль» */
.prompt-create-form.about--role-form {
    padding: 0 0 20px;
}

/* ---------- Библиотека: аккордеон категорий и сетка карточек ---------- */
.library-intro {
    margin-bottom: 24px;
    color: #636C78;
}
.library-empty {
    color: #636C78;
}

.library-accordion {
    margin-bottom: 12px;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.library-accordion[open] .library-accordion__summary::after {
    transform: rotate(220deg);
}
.library-accordion__summary {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 700;
    color: #181818;
    cursor: pointer;
    list-style: none;
    user-select: none;
    background: #fafafa;
    border-bottom: 1px solid transparent;
    transition: background 0.2s;
}
.library-accordion__summary::-webkit-details-marker {
    display: none;
}
.library-accordion__summary::after {
    content: "";
    margin-left: auto;
    width: 12px;
    height: 12px;
    border-right: 2px solid #636C78;
    border-bottom: 2px solid #636C78;
    transform: rotate(45deg);
    transition: transform 0.2s;
}
.library-accordion__summary:hover {
    background: #f0f0f0;
}

.library-prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 20px;
}

.library-card {
    padding: 16px;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}
.library-card__title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: #181818;
}
.library-card__text {
    margin: 0 0 12px;
    font-size: 14px;
    color: #636C78;
    line-height: 1.4;
    flex-grow: 1;
}
.library-card__form {
    margin: 0;
    min-width: 0;
}
.library-card__btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.library-card__added {
    margin: 0;
    font-size: 14px;
    color: #8BB7A2;
    font-weight: 600;
}
.library-card__added a {
    color: #8BB7A2;
    text-decoration: underline;
}
.library-card__added a:hover {
    opacity: 0.9;
}

/* «Мои запросы»: карточки с кнопками Изменить и Удалить */
.library-card__actions {
    margin-top: auto;
    padding-top: 12px;
}
.library-card__actions--row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.library-card__form-inline {
    display: inline;
    margin: 0;
}
.library-card__link {
    font-size: 14px;
    font-weight: 600;
    color: #6688bb;
    text-decoration: none;
}
.library-card__link:hover {
    opacity: 0.8;
}
.library-card__link--danger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #EE5643;
    text-decoration: none;
}
.library-card__link--danger:hover {
    opacity: 0.8;
}

/* Страницы юридических документов (контент из админки) */
.legal-document-body { color: #181818; }
.legal-document__title { margin: 0 0 16px; font-size: 20px; }
.legal-document__content { line-height: 1.6; }
.legal-document__content p { margin: 0 0 12px; }
.legal-document__content ul, .legal-document__content ol { margin: 0 0 12px; padding-left: 24px; }
.legal-document__empty { color: #636C78; }
.legal-document__empty a { color: #6688bb; }
