/* chatyuristweb/static/css/app.css */

/* ------------------- Предзагрузка темы ------------------- */

html.theme-preload *,
html.theme-preload *::before,
html.theme-preload *::after {
  transition: none !important;
}

/* ------------------- Базовые настройки ------------------- */

.ai-content {
  font-size: 15px;
  line-height: 1.7;
  color: #334155; /* slate-700 */
  word-wrap: break-word;
}

/* ------------------- Абзацы ------------------- */

.ai-content p {
  margin: 0 0 10px 0;
}

/* ------------------- Списки ------------------- */

.ai-content ul,
.ai-content ol {
  margin: 10px 0;
  padding-left: 20px;
}

.ai-content ul {
  list-style-type: disc;
}

.ai-content ol {
  list-style-type: decimal;
}

/* ------------------- Элементы списка ------------------- */

.ai-content li {
  margin: 4px 0;
}

/* ------------------- Ссылки ------------------- */

.ai-content a {
  color: #0f172a; /* slate-900 */
  text-decoration: underline;
  transition: opacity 0.2s;
}

.ai-content a:hover {
  opacity: 0.7;
}

/* ------------------- Текст ------------------- */

.ai-content b {
  font-weight: 600;
}

.ai-content i {
  font-style: italic;
}

.ai-content u {
  text-decoration: underline;
}

/* ------------------- Переносы ------------------- */

.ai-content * {
  overflow-wrap: anywhere;
}

/* ------------------- Отступы между блоками в ответах AI ------------------- */

.ai-content table,
.ai-content .ai-table-wrap,
.ai-content pre,
.ai-content blockquote {
  margin: 6px 0;
}

/* ------------------- Дополнительно ------------------- */

.ai-content h1,
.ai-content h2,
.ai-content h3 {
  margin: 16px 0 8px;
  font-weight: 600;
}

.ai-content hr {
  margin: 16px 0;
  border: none;
  border-top: 1px solid #e2e8f0;
}

/* ------------------- Таблицы в ответах AI ------------------- */

.ai-content .ai-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.ai-content table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #cbdcf5;
  border-radius: 18px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
}

.ai-content th,
.ai-content td {
  padding: 9px 11px;
  text-align: left;
  vertical-align: top;
  border-right: 1px solid #cbdcf5;
  border-bottom: 1px solid #cbdcf5;
}

.ai-content th:last-child,
.ai-content td:last-child {
  border-right: none;
}

.ai-content tr:last-child td {
  border-bottom: none;
}

.ai-content th {
  background: #f8fbff;
  color: #0f172a;
  font-weight: 600;
}

.ai-content td {
  background: #ffffff;
  color: #334155;
}

/* ------------------- Код в ответах AI ------------------- */

.ai-content code {
  border-radius: 8px;
  background: #eff6ff;
  padding: 2px 6px;
  font-size: 13px;
  color: #1e40af;
}

.ai-content pre {
  max-width: 100%;
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid #dbe7f5;
  background: #f8fbff;
  padding: 12px 14px;
}

.ai-content pre code {
  display: block;
  background: transparent;
  padding: 0;
  color: #334155;
  white-space: pre;
}

/* ------------------- Цитаты в ответах AI ------------------- */

.ai-content blockquote {
  border-left: 4px solid #2563eb;
  border-radius: 14px;
  background: #f8fbff;
  padding: 10px 14px;
  color: #334155;
}

/* ------------------- Скроллбар ------------------- */

#chat-scroll-area,
#recent-sessions-list,
#sidebar,
#message-input,
#modal-content {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

#chat-scroll-area::-webkit-scrollbar,
#recent-sessions-list::-webkit-scrollbar,
#sidebar::-webkit-scrollbar,
#message-input::-webkit-scrollbar,
#modal-content::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#chat-scroll-area::-webkit-scrollbar-track,
#recent-sessions-list::-webkit-scrollbar-track,
#sidebar::-webkit-scrollbar-track,
#message-input::-webkit-scrollbar-track,
#modal-content::-webkit-scrollbar-track {
  background: transparent;
}

#chat-scroll-area::-webkit-scrollbar-thumb,
#recent-sessions-list::-webkit-scrollbar-thumb,
#sidebar::-webkit-scrollbar-thumb,
#message-input::-webkit-scrollbar-thumb,
#modal-content::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Показываем скроллбар только во время скролла */

html.scrolling #chat-scroll-area,
html.scrolling #recent-sessions-list,
html.scrolling #sidebar,
html.scrolling #message-input,
html.scrolling #modal-content {
  scrollbar-color: rgba(148, 163, 184, 0.9) transparent;
}

html.scrolling #chat-scroll-area::-webkit-scrollbar-thumb,
html.scrolling #recent-sessions-list::-webkit-scrollbar-thumb,
html.scrolling #sidebar::-webkit-scrollbar-thumb,
html.scrolling #message-input::-webkit-scrollbar-thumb,
html.scrolling #modal-content::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.9);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

html.scrolling #chat-scroll-area::-webkit-scrollbar-thumb:hover,
html.scrolling #recent-sessions-list::-webkit-scrollbar-thumb:hover,
html.scrolling #sidebar::-webkit-scrollbar-thumb:hover,
html.scrolling #message-input::-webkit-scrollbar-thumb:hover,
html.scrolling #modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.95);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Вынос скроллбара за содержимое */

.scrollbar-outside {
  padding-right: 12px;
  margin-right: -12px;
}

/* ------------------- Крестик очистки поля поиска ------------------- */

#chat-search-input::-webkit-search-cancel-button,
#files-search-input::-webkit-search-cancel-button {
  display: none;
}

#chat-search-input::-webkit-search-decoration,
#files-search-input::-webkit-search-decoration {
  display: none;
}

#files-search-input::-ms-clear,
#files-search-input::-ms-reveal {
  display: none;
}

/* ------------------- Ночная тема ------------------- */

html.night body,
body.night {
  background-color: #1e1f23;
  color: #e5e7eb;
}

html.night button,
html.night a,
body.night button,
body.night a {
  transition:
    background-color 0.2s ease,
    background-image 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

/* ------------------- Ночная тема: текст и контент ------------------- */

html.night .ai-content,
body.night .ai-content,
html.night .text-slate-600,
body.night .text-slate-600 {
  color: #e5e7eb !important;
}

html.night .ai-content a,
body.night .ai-content a {
  color: #60a5fa;
}

html.night .ai-content hr,
body.night .ai-content hr {
  border-top: 1px solid #374151;
}

/* ------------------- Ночная тема: таблицы, код и цитаты в ответах AI ------------------- */

html.night .ai-content table,
body.night .ai-content table {
  border-color: #4b5563 !important;
}

html.night .ai-content th,
html.night .ai-content td,
body.night .ai-content th,
body.night .ai-content td {
  border-right: 1px solid #4b5563 !important;
  border-bottom: 1px solid #4b5563 !important;
}

html.night .ai-content th:last-child,
html.night .ai-content td:last-child,
body.night .ai-content th:last-child,
body.night .ai-content td:last-child {
  border-right: none !important;
}

html.night .ai-content tr:last-child td,
body.night .ai-content tr:last-child td {
  border-bottom: none !important;
}

html.night .ai-content th,
body.night .ai-content th {
  background: #2f343d !important;
  color: #f3f4f6 !important;
}

html.night .ai-content td,
body.night .ai-content td {
  background: #292d35 !important;
  color: #e5e7eb !important;
}

html.night .ai-content code,
body.night .ai-content code {
  background: #283245 !important;
  color: #93c5fd !important;
}

html.night .ai-content pre,
body.night .ai-content pre {
  border-color: #3b4350 !important;
  background: #292d35 !important;
}

html.night .ai-content pre code,
body.night .ai-content pre code {
  background: transparent !important;
  color: #e5e7eb !important;
}

html.night .ai-content blockquote,
body.night .ai-content blockquote {
  border-left-color: #2563eb !important;
  background: #292d35 !important;
  color: #e5e7eb !important;
}

html.night .text-slate-900,
body.night .text-slate-900 {
  color: #f3f4f6 !important;
}

html.night .text-slate-800,
body.night .text-slate-800 {
  color: #e5e7eb !important;
}

html.night .text-slate-700,
body.night .text-slate-700 {
  color: #d1d5db !important;
}

html.night .text-slate-500,
body.night .text-slate-500 {
  color: #9ca3af !important;
}

html.night .text-slate-400,
body.night .text-slate-400 {
  color: #94a3b8 !important;
}

html.night .text-amber-700,
body.night .text-amber-700 {
  color: #fcd34d !important;
}

html.night .text-red-600,
html.night .text-red-700,
body.night .text-red-600,
body.night .text-red-700 {
  color: #fca5a5 !important;
}

html.night .text-emerald-700,
body.night .text-emerald-700 {
  color: #6ee7b7 !important;
}

html.night .text-emerald-600,
body.night .text-emerald-600 {
  color: #6ee7b7 !important;
}

html.night .text-blue-100,
body.night .text-blue-100 {
  color: #dbeafe !important;
}

html.night .text-blue-700,
body.night .text-blue-700 {
  color: #94a3b8 !important;
}

/* ------------------- Ночная тема: layout и поверхности ------------------- */

html.night #app-shell,
html.night main,
html.night section,
html.night footer,
html.night header,
body.night #app-shell,
body.night main,
body.night section,
body.night footer,
body.night header {
  background-color: #1e1f23 !important;
}

html.night #sidebar,
body.night #sidebar {
  background: #23252b !important;
  border-color: #2e3138 !important;
  box-shadow: none !important;
}

html.night #chat-scroll-area,
body.night #chat-scroll-area {
  background: #1e1f23 !important;
}

html.night header,
body.night header {
  background: rgba(30, 31, 35, 0.92) !important;
  border-color: #2f333b !important;
}

html.night footer,
body.night footer {
  background: rgba(30, 31, 35, 0.92) !important;
  border-color: #2f333b !important;
}

/* ------------------- Ночная тема: рамки ------------------- */

html.night .border-\[\#dbeafe\],
html.night .border-\[\#dbe7f5\],
html.night .border-\[\#d8e6ff\],
html.night .border-\[\#cbdcf5\],
html.night .border-\[\#bfdbfe\],
html.night .border-\[\#93c5fd\],
html.night .border-\[\#60a5fa\],
html.night .border-\[\#e6eef8\],
html.night .border-\[\#cfe0ff\],
body.night .border-\[\#dbeafe\],
body.night .border-\[\#dbe7f5\],
body.night .border-\[\#d8e6ff\],
body.night .border-\[\#cbdcf5\],
body.night .border-\[\#bfdbfe\],
body.night .border-\[\#93c5fd\],
body.night .border-\[\#60a5fa\],
body.night .border-\[\#e6eef8\],
body.night .border-\[\#cfe0ff\] {
  border-color: #2f333b !important;
}

html.night .border-amber-200,
body.night .border-amber-200 {
  border-color: rgba(245, 158, 11, 0.34) !important;
}

html.night .border-red-200,
body.night .border-red-200 {
  border-color: rgba(248, 113, 113, 0.34) !important;
}

html.night .border-emerald-200,
body.night .border-emerald-200 {
  border-color: rgba(52, 211, 153, 0.34) !important;
}

html.night .border-blue-200,
body.night .border-blue-200 {
  border-color: rgba(96, 165, 250, 0.34) !important;
}

/* ------------------- Ночная тема: базовые фоны ------------------- */

html.night .bg-white,
html.night .bg-\[\#f8fbff\],
html.night .bg-\[\#f5f9ff\],
html.night .bg-\[\#eff6ff\],
body.night .bg-white,
body.night .bg-\[\#f8fbff\],
body.night .bg-\[\#f5f9ff\],
body.night .bg-\[\#eff6ff\] {
  background-color: #2a2d34 !important;
  background-image: none !important;
}

html.night .bg-\[\#eff6ff\],
body.night .bg-\[\#eff6ff\] {
  background-color: #283245 !important;
  background-image: none !important;
}

html.night .bg-amber-100,
body.night .bg-amber-100 {
  background-color: rgba(245, 158, 11, 0.18) !important;
}

html.night .bg-red-100,
body.night .bg-red-100 {
  background-color: rgba(248, 113, 113, 0.18) !important;
}

html.night .bg-emerald-100,
body.night .bg-emerald-100 {
  background-color: rgba(52, 211, 153, 0.18) !important;
}

html.night .bg-blue-100,
body.night .bg-blue-100 {
  background-color: rgba(96, 165, 250, 0.18) !important;
}

/* ------------------- Ночная тема: градиентные поверхности ------------------- */

html.night .bg-\[linear-gradient\(180deg\,_\#ffffff_0\%\,_\#f8fbff_100\%\)\],
html.night .bg-\[linear-gradient\(180deg\,_\#f8fbff_0\%\,_\#eff6ff_100\%\)\],
html.night .bg-\[linear-gradient\(180deg\,_\#eff6ff_0\%\,_\#e0f2fe_100\%\)\],
html.night .bg-\[linear-gradient\(180deg\,_\#eff6ff_0\%\,_\#dbeafe_100\%\)\],
body.night .bg-\[linear-gradient\(180deg\,_\#ffffff_0\%\,_\#f8fbff_100\%\)\],
body.night .bg-\[linear-gradient\(180deg\,_\#f8fbff_0\%\,_\#eff6ff_100\%\)\],
body.night .bg-\[linear-gradient\(180deg\,_\#eff6ff_0\%\,_\#e0f2fe_100\%\)\],
body.night .bg-\[linear-gradient\(180deg\,_\#eff6ff_0\%\,_\#dbeafe_100\%\)\] {
  background-color: #2a2d34 !important;
  background-image: linear-gradient(180deg, #2f343d 0%, #2a2d34 100%) !important;
}

html.night .bg-\[linear-gradient\(180deg\,_\#fffdf4_0\%\,_\#fffbeb_100\%\)\],
body.night .bg-\[linear-gradient\(180deg\,_\#fffdf4_0\%\,_\#fffbeb_100\%\)\] {
  background-color: #3a3120 !important;
  background-image: linear-gradient(180deg, #43361f 0%, #332918 100%) !important;
}

html.night .bg-\[linear-gradient\(180deg\,_\#fff5f5_0\%\,_\#fef2f2_100\%\)\],
html.night .bg-\[linear-gradient\(180deg\,_\#fff7f7_0\%\,_\#fef2f2_100\%\)\],
body.night .bg-\[linear-gradient\(180deg\,_\#fff5f5_0\%\,_\#fef2f2_100\%\)\],
body.night .bg-\[linear-gradient\(180deg\,_\#fff7f7_0\%\,_\#fef2f2_100\%\)\] {
  background-color: #3a2628 !important;
  background-image: linear-gradient(180deg, #44282b 0%, #321d20 100%) !important;
}

html.night .bg-\[linear-gradient\(180deg\,_\#f2fff8_0\%\,_\#ecfdf5_100\%\)\],
body.night .bg-\[linear-gradient\(180deg\,_\#f2fff8_0\%\,_\#ecfdf5_100\%\)\] {
  background-color: #1f342b !important;
  background-image: linear-gradient(180deg, #243e32 0%, #1a2e25 100%) !important;
}

html.night .bg-\[linear-gradient\(180deg\,_\#eff6ff_0\%\,_\#e0f2fe_100\%\)\],
body.night .bg-\[linear-gradient\(180deg\,_\#eff6ff_0\%\,_\#e0f2fe_100\%\)\] {
  background-color: #243247 !important;
  background-image: linear-gradient(180deg, #2b3a52 0%, #202d42 100%) !important;
}

html.night .bg-\[radial-gradient\(circle_at_top_right\,_rgba\(37\,99\,235\,0\.10\)\,_transparent_35\%\)\],
html.night .bg-\[radial-gradient\(circle_at_top_left\,_rgba\(37\,99\,235\,0\.10\)\,_transparent_24\%\)\,radial-gradient\(circle_at_bottom_right\,_rgba\(59\,130\,246\,0\.08\)\,_transparent_22\%\)\,linear-gradient\(180deg\,_\#f8fbff_0\%\,_\#f5f9ff_100\%\)\],
body.night .bg-\[radial-gradient\(circle_at_top_right\,_rgba\(37\,99\,235\,0\.10\)\,_transparent_35\%\)\],
body.night .bg-\[radial-gradient\(circle_at_top_left\,_rgba\(37\,99\,235\,0\.10\)\,_transparent_24\%\)\,radial-gradient\(circle_at_bottom_right\,_rgba\(59\,130\,246\,0\.08\)\,_transparent_22\%\)\,linear-gradient\(180deg\,_\#f8fbff_0\%\,_\#f5f9ff_100\%\)\] {
  background: #23252b !important;
}

/* ------------------- Ночная тема: поля ввода, textarea и загрузка файлов ------------------- */

html.night input.border-\[\#dbe7f5\].bg-white,
html.night input.bg-white.border-\[\#dbe7f5\],
html.night textarea.border-\[\#dbe7f5\].bg-white,
html.night textarea.bg-white.border-\[\#dbe7f5\],
body.night input.border-\[\#dbe7f5\].bg-white,
body.night input.bg-white.border-\[\#dbe7f5\],
body.night textarea.border-\[\#dbe7f5\].bg-white,
body.night textarea.bg-white.border-\[\#dbe7f5\] {
  border-color: #3b4350 !important;
  background-color: #232832 !important;
  background-image: linear-gradient(180deg, #2d3440 0%, #232832 100%) !important;
  color: #f3f4f6 !important;
}

html.night input.border-\[\#dbe7f5\].bg-white:focus:not([readonly]),
html.night input.bg-white.border-\[\#dbe7f5\]:focus:not([readonly]),
html.night textarea.border-\[\#dbe7f5\].bg-white:focus,
html.night textarea.bg-white.border-\[\#dbe7f5\]:focus,
body.night input.border-\[\#dbe7f5\].bg-white:focus:not([readonly]),
body.night input.bg-white.border-\[\#dbe7f5\]:focus:not([readonly]),
body.night textarea.border-\[\#dbe7f5\].bg-white:focus,
body.night textarea.bg-white.border-\[\#dbe7f5\]:focus {
  border-color: #60a5fa !important;
}

/* Контейнер поля ввода */

html.night .border-\[\#cbdcf5\].bg-\[linear-gradient\(180deg\,_\#ffffff_0\%\,_\#f8fbff_100\%\)\],
body.night .border-\[\#cbdcf5\].bg-\[linear-gradient\(180deg\,_\#ffffff_0\%\,_\#f8fbff_100\%\)\] {
  border-color: #3b4350 !important;
  background-color: #2a2f38 !important;
  background-image: linear-gradient(180deg, #313641 0%, #2a2f38 100%) !important;
}

html.night .border-\[\#cbdcf5\].bg-\[linear-gradient\(180deg\,_\#ffffff_0\%\,_\#f8fbff_100\%\)\]:focus-within,
body.night .border-\[\#cbdcf5\].bg-\[linear-gradient\(180deg\,_\#ffffff_0\%\,_\#f8fbff_100\%\)\]:focus-within {
  border-color: #60a5fa !important;
}

#create-document-attachment::file-selector-button,
#document-audit-attachment::file-selector-button {
  background-color: transparent;
  color: #64748b;
}

#create-document-attachment:hover::file-selector-button,
#document-audit-attachment:hover::file-selector-button {
  background-color: #eff6ff;
  color: #1d4ed8;
}

#create-document-attachment:disabled,
#create-document-attachment:disabled::file-selector-button,
#document-audit-attachment:disabled,
#document-audit-attachment:disabled::file-selector-button {
  cursor: not-allowed;
}

#create-document-attachment:disabled,
#document-audit-attachment:disabled {
  opacity: 0.5;
}

#create-document-attachment:disabled:hover::file-selector-button,
#document-audit-attachment:disabled:hover::file-selector-button {
  background-color: transparent;
  color: #64748b;
}

html.night #create-document-attachment::file-selector-button,
html.night #document-audit-attachment::file-selector-button,
body.night #create-document-attachment::file-selector-button,
body.night #document-audit-attachment::file-selector-button {
  background-color: transparent !important;
  color: #94a3b8 !important;
}

html.night #create-document-attachment:hover::file-selector-button,
html.night #document-audit-attachment:hover::file-selector-button,
body.night #create-document-attachment:hover::file-selector-button,
body.night #document-audit-attachment:hover::file-selector-button {
  background-color: #374151 !important;
  color: #ffffff !important;
}

html.night #create-document-attachment:disabled:hover::file-selector-button,
html.night #document-audit-attachment:disabled:hover::file-selector-button,
body.night #create-document-attachment:disabled:hover::file-selector-button,
body.night #document-audit-attachment:disabled:hover::file-selector-button {
  background-color: transparent !important;
  color: #94a3b8 !important;
}

/* ------------------- Ночная тема: модальное окно ------------------- */

html.night #modal-window,
body.night #modal-window {
  border-color: #313844 !important;
  background-color: #252932 !important;
  background-image: linear-gradient(180deg, #2d323c 0%, #252932 100%) !important;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.45) !important;
}

html.night #modal-content,
body.night #modal-content {
  scrollbar-color: transparent transparent;
}

html.night .text-\[\#1d4ed8\],
html.night .text-\[\#1e40af\],
body.night .text-\[\#1d4ed8\],
body.night .text-\[\#1e40af\] {
  color: #93c5fd !important;
}

/* ------------------- Ночная тема: вторичные кнопки ------------------- */

html.night button.border.border-\[\#cfe0ff\],
html.night a.border.border-\[\#cfe0ff\],
html.night #open-sidebar,
body.night button.border.border-\[\#cfe0ff\],
body.night a.border.border-\[\#cfe0ff\],
body.night #open-sidebar {
  border-color: #3b4350 !important;
  background-color: #2a2f38 !important;
  background-image: linear-gradient(180deg, #313641 0%, #2a2f38 100%) !important;
  color: #e2e8f0 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

html.night button.border.border-\[\#cfe0ff\]:hover,
html.night a.border.border-\[\#cfe0ff\]:hover,
html.night #open-sidebar:hover,
body.night button.border.border-\[\#cfe0ff\]:hover,
body.night a.border.border-\[\#cfe0ff\]:hover,
body.night #open-sidebar:hover {
  border-color: #55657d !important;
  background-color: #353c46 !important;
  background-image: linear-gradient(180deg, #46505d 0%, #353c46 100%) !important;
  color: #60a5fa !important;
}

/* ------------------- Ночная тема: мягкие сервисные кнопки ------------------- */

html.night button.border.border-\[\#d8e6ff\],
body.night button.border.border-\[\#d8e6ff\] {
  border-color: #3b4350 !important;
  background-color: #292d35 !important;
  background-image: linear-gradient(180deg, #2f343d 0%, #292d35 100%) !important;
  color: #e2e8f0 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025) !important;
}

html.night button.border.border-\[\#d8e6ff\]:hover,
body.night button.border.border-\[\#d8e6ff\]:hover {
  border-color: #49586f !important;
  background-color: #313741 !important;
  background-image: linear-gradient(180deg, #454d59 0%, #313741 100%) !important;
  color: #60a5fa !important;
}

/* ------------------- Ночная тема: кнопки оценки ответа ------------------- */

html.night .chat-rating-button,
html.night .create-document-rating-button,
html.night .document-audit-rating-button,
html.night .court-practice-rating-button,
body.night .chat-rating-button,
body.night .create-document-rating-button,
body.night .document-audit-rating-button,
body.night .court-practice-rating-button {
  background-color: transparent !important;
  background-image: none !important;
  color: #cbd5e1 !important;
}

html.night .chat-rating-button[data-rating-value="1"]:hover,
html.night .create-document-rating-button[data-rating-value="1"]:hover,
html.night .document-audit-rating-button[data-rating-value="1"]:hover,
html.night .court-practice-rating-button[data-rating-value="1"]:hover,
body.night .chat-rating-button[data-rating-value="1"]:hover,
body.night .create-document-rating-button[data-rating-value="1"]:hover,
body.night .document-audit-rating-button[data-rating-value="1"]:hover,
body.night .court-practice-rating-button[data-rating-value="1"]:hover {
  background-color: rgba(52, 211, 153, 0.18) !important;
  background-image: none !important;
  color: #6ee7b7 !important;
}

html.night .chat-rating-button[data-rating-value="-1"]:hover,
html.night .create-document-rating-button[data-rating-value="-1"]:hover,
html.night .document-audit-rating-button[data-rating-value="-1"]:hover,
html.night .court-practice-rating-button[data-rating-value="-1"]:hover,
body.night .chat-rating-button[data-rating-value="-1"]:hover,
body.night .create-document-rating-button[data-rating-value="-1"]:hover,
body.night .document-audit-rating-button[data-rating-value="-1"]:hover,
body.night .court-practice-rating-button[data-rating-value="-1"]:hover {
  background-color: rgba(248, 113, 113, 0.18) !important;
  background-image: none !important;
  color: #fca5a5 !important;
}

/* ------------------- Ночная тема: action-кнопки ------------------- */

html.night .bg-\[linear-gradient\(135deg\,_\#2563eb_0\%\,_\#1d4ed8_100\%\)\],
body.night .bg-\[linear-gradient\(135deg\,_\#2563eb_0\%\,_\#1d4ed8_100\%\)\] {
  background-image: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
}

html.night .hover\:bg-\[linear-gradient\(135deg\,_\#1d4ed8_0\%\,_\#1e40af_100\%\)\]:hover,
body.night .hover\:bg-\[linear-gradient\(135deg\,_\#1d4ed8_0\%\,_\#1e40af_100\%\)\]:hover {
  background-image: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
}

/* ------------------- Покупка запросов в ночной теме ------------------- */

html.night button.border.border-\[\#dbe7f5\].bg-\[linear-gradient\(180deg\,_\#ffffff_0\%\,_\#f8fbff_100\%\)\],
body.night button.border.border-\[\#dbe7f5\].bg-\[linear-gradient\(180deg\,_\#ffffff_0\%\,_\#f8fbff_100\%\)\] {
  border-color: #3b4350 !important;
  background-color: #2a2f38 !important;
  background-image: linear-gradient(180deg, #313641 0%, #2a2f38 100%) !important;
  color: #e2e8f0 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

html.night button.border.border-\[\#dbe7f5\].bg-\[linear-gradient\(180deg\,_\#ffffff_0\%\,_\#f8fbff_100\%\)\]:hover,
body.night button.border.border-\[\#dbe7f5\].bg-\[linear-gradient\(180deg\,_\#ffffff_0\%\,_\#f8fbff_100\%\)\]:hover {
  border-color: #55657d !important;
  background-color: #353c46 !important;
  background-image: linear-gradient(180deg, #46505d 0%, #353c46 100%) !important;
}

html.night button.border.border-\[\#93c5fd\].bg-\[linear-gradient\(180deg\,_\#eff6ff_0\%\,_\#dbeafe_100\%\)\],
body.night button.border.border-\[\#93c5fd\].bg-\[linear-gradient\(180deg\,_\#eff6ff_0\%\,_\#dbeafe_100\%\)\] {
  border-color: #4d617f !important;
  background-color: #2c3340 !important;
  background-image: linear-gradient(180deg, #323946 0%, #2c3340 100%) !important;
}

html.night button.border.border-\[\#93c5fd\].bg-\[linear-gradient\(180deg\,_\#eff6ff_0\%\,_\#dbeafe_100\%\)\]:hover,
body.night button.border.border-\[\#93c5fd\].bg-\[linear-gradient\(180deg\,_\#eff6ff_0\%\,_\#dbeafe_100\%\)\]:hover {
  border-color: #5c7395 !important;
  background-color: #313947 !important;
  background-image: linear-gradient(180deg, #394252 0%, #313947 100%) !important;
}

html.night button.border.border-\[\#2563eb\].bg-\[linear-gradient\(135deg\,_\#2563eb_0\%\,_\#1d4ed8_100\%\)\],
body.night button.border.border-\[\#2563eb\].bg-\[linear-gradient\(135deg\,_\#2563eb_0\%\,_\#1d4ed8_100\%\)\] {
  background-image: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
}

html.night button.border.border-\[\#2563eb\].bg-\[linear-gradient\(135deg\,_\#2563eb_0\%\,_\#1d4ed8_100\%\)\]:hover,
body.night button.border.border-\[\#2563eb\].bg-\[linear-gradient\(135deg\,_\#2563eb_0\%\,_\#1d4ed8_100\%\)\]:hover {
  background-image: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
}

/* ------------------- Инструкция в ночной теме ------------------- */

/* Основные карточки функций */

html.night #modal-content .border-\[\#e6eef8\].bg-\[\#f8fbff\],
body.night #modal-content .border-\[\#e6eef8\].bg-\[\#f8fbff\] {
  border-color: #3b4350 !important;
  background: linear-gradient(180deg, #2f343d 0%, #292d35 100%) !important;
}

/* Выделенная карточка Судебная практика */

html.night #modal-content .border-\[\#93c5fd\].bg-\[linear-gradient\(180deg\,_\#eff6ff_0\%\,_\#dbeafe_100\%\)\],
body.night #modal-content .border-\[\#93c5fd\].bg-\[linear-gradient\(180deg\,_\#eff6ff_0\%\,_\#dbeafe_100\%\)\] {
  border-color: #4d617f !important;
  background: linear-gradient(180deg, #323946 0%, #2c3340 100%) !important;
}

/* Текст внутри инструкции */

html.night #modal-content .text-slate-900,
body.night #modal-content .text-slate-900 {
  color: #f3f4f6 !important;
}

html.night #modal-content .text-slate-600,
body.night #modal-content .text-slate-600 {
  color: #cbd5e1 !important;
}

html.night #modal-content .text-slate-500,
body.night #modal-content .text-slate-500 {
  color: #94a3b8 !important;
}

html.night #modal-content b,
body.night #modal-content b {
  color: #ffffff !important;
}

/* ------------------- Результаты поиска в чатах в ночной теме ------------------- */

html.night #chat-search-status,
html.night #files-status,
body.night #chat-search-status,
body.night #files-status {
  border-color: #3b4350 !important;
  background-color: #292d35 !important;
  background-image: linear-gradient(180deg, #2f343d 0%, #292d35 100%) !important;
  color: #94a3b8 !important;
}

html.night #chat-search-status.border-red-200,
html.night #files-status.border-red-200,
body.night #chat-search-status.border-red-200,
body.night #files-status.border-red-200 {
  border-color: rgba(248, 113, 113, 0.42) !important;
  background-color: #342a2f !important;
  background-image: linear-gradient(180deg, #3b2f35 0%, #342a2f 100%) !important;
  color: #fca5a5 !important;
}

html.night #chat-search-results a.chat-search-result-link > div,
body.night #chat-search-results a.chat-search-result-link > div {
  border-color: #3b4350 !important;
  background-color: #292d35 !important;
  background-image: linear-gradient(180deg, #2f343d 0%, #292d35 100%) !important;
}

html.night #chat-search-results a.chat-search-result-link:hover > div,
body.night #chat-search-results a.chat-search-result-link:hover > div {
  border-color: #49586f !important;
  background-color: #2d333d !important;
  background-image: linear-gradient(180deg, #333943 0%, #2d333d 100%) !important;
}

html.night #chat-search-results a.chat-search-result-link:hover .text-slate-800,
body.night #chat-search-results a.chat-search-result-link:hover .text-slate-800 {
  color: #60a5fa !important;
}

html.night #chat-search-results a.chat-search-result-link .text-blue-700,
body.night #chat-search-results a.chat-search-result-link .text-blue-700 {
  color: #93c5fd !important;
}

/* ------------------- Результаты файлов в ночной теме ------------------- */

html.night #files-results a.files-result-link > div,
body.night #files-results a.files-result-link > div {
  border-color: #3b4350 !important;
  background-color: #292d35 !important;
  background-image: linear-gradient(180deg, #2f343d 0%, #292d35 100%) !important;
}

html.night #files-results a.files-result-link:hover > div,
body.night #files-results a.files-result-link:hover > div {
  border-color: #49586f !important;
  background-color: #2d333d !important;
  background-image: linear-gradient(180deg, #333943 0%, #2d333d 100%) !important;
}

html.night #files-results a.files-result-link:hover .text-slate-800,
body.night #files-results a.files-result-link:hover .text-slate-800 {
  color: #60a5fa !important;
}

html.night #files-results a.files-result-link .text-blue-700,
body.night #files-results a.files-result-link .text-blue-700 {
  color: #93c5fd !important;
}

/* ------------------- Переключатели файлов в ночной теме ------------------- */

html.night #files-type-tabs .files-type-tab[aria-pressed="false"]:hover,
body.night #files-type-tabs .files-type-tab[aria-pressed="false"]:hover {
  background: #374151 !important;
  color: #ffffff !important;
}

/* ------------------- Подсветка найденного сообщения ------------------- */

.search-target-highlight {
  border-radius: 33px;
  transition: box-shadow 0.3s ease;

  box-shadow:
    0 0 0 4px #ffffff,
    0 0 0 8px #2563eb;
}

/* ------------------- Ночная тема ------------------- */

html.night .search-target-highlight,
body.night .search-target-highlight {
  box-shadow:
    0 0 0 4px #1e1f23,
    0 0 0 8px #1d4ed8;
}

/* ------------------- Недавние диалоги в ночной теме ------------------- */

html.night .delete-session-button,
html.night #chat-search-clear,
html.night #files-search-clear,
html.night #state-duty-calculator-amount-clear,
body.night .delete-session-button,
body.night #chat-search-clear,
body.night #files-search-clear,
body.night #state-duty-calculator-amount-clear {
  color: #94a3b8 !important;
}

html.night .delete-session-button:hover,
html.night #chat-search-clear:hover,
html.night #files-search-clear:hover,
html.night #state-duty-calculator-amount-clear:hover,
body.night .delete-session-button:hover,
body.night #chat-search-clear:hover,
body.night #files-search-clear:hover,
body.night #state-duty-calculator-amount-clear:hover {
  background: transparent !important;
  color: #f87171 !important;
}

html.night #recent-sessions-list > div.border-\[\#93c5fd\],
body.night #recent-sessions-list > div.border-\[\#93c5fd\] {
  border-color: #4d617f !important;
  background-color: #2c3340 !important;
  background-image: linear-gradient(180deg, #323946 0%, #2c3340 100%) !important;
}

html.night #recent-sessions-list > div.border-\[\#93c5fd\] .recent-session-button > div:first-child,
body.night #recent-sessions-list > div.border-\[\#93c5fd\] .recent-session-button > div:first-child {
  background: #374151 !important;
  color: #93c5fd !important;
}

html.night #recent-sessions-list > div.border-\[\#93c5fd\] .recent-session-button > div:last-child > div:first-child,
body.night #recent-sessions-list > div.border-\[\#93c5fd\] .recent-session-button > div:last-child > div:first-child {
  color: #60a5fa !important;
}

html.night #recent-sessions-list > div.border-\[\#93c5fd\] .recent-session-time,
html.night #recent-sessions-list > div.border-\[\#93c5fd\] .text-slate-500,
body.night #recent-sessions-list > div.border-\[\#93c5fd\] .recent-session-time,
body.night #recent-sessions-list > div.border-\[\#93c5fd\] .text-slate-500 {
  color: #cbd5e1 !important;
}

html.night #recent-sessions-list > div.border-\[\#d8e6ff\],
body.night #recent-sessions-list > div.border-\[\#d8e6ff\] {
  border-color: #3b4350 !important;
}

html.night #recent-sessions-list > div.border-\[\#d8e6ff\]:has(.recent-session-button):hover,
body.night #recent-sessions-list > div.border-\[\#d8e6ff\]:has(.recent-session-button):hover {
  border-color: #49586f !important;
  background-color: #2d333d !important;
  background-image: linear-gradient(180deg, #333943 0%, #2d333d 100%) !important;
}

html.night #recent-sessions-list > div.border-\[\#d8e6ff\]:hover .recent-session-button > div:last-child > div:first-child,
body.night #recent-sessions-list > div.border-\[\#d8e6ff\]:hover .recent-session-button > div:last-child > div:first-child {
  color: #60a5fa !important;
}

html.night #recent-sessions-list > div.border-\[\#d8e6ff\] .recent-session-button > div:first-child,
body.night #recent-sessions-list > div.border-\[\#d8e6ff\] .recent-session-button > div:first-child {
  background: #374151 !important;
  color: #93c5fd !important;
}

/* ------------------- Служебные элементы в ночной теме ------------------- */

html.night .bg-\[\#dbe7f5\].h-px,
body.night .bg-\[\#dbe7f5\].h-px {
  background-color: rgba(71, 85, 105, 0.48) !important;
}

html.night #clear-button:hover:not(:disabled),
html.night #resend-code-button:hover:not(:disabled),
body.night #clear-button:hover:not(:disabled),
body.night #resend-code-button:hover:not(:disabled),
body.night #editing-resend-code-button:hover:not(:disabled) {
  background: #374151 !important;
  color: #ffffff !important;
}

html.night #scroll-to-bottom,
body.night #scroll-to-bottom {
  background: #2a2d34 !important;
  color: #d1d5db !important;
  border-color: #374151 !important;
}

html.night #scroll-to-bottom:hover,
body.night #scroll-to-bottom:hover {
  background: #323741 !important;
  border-color: #4b5563 !important;
  color: #ffffff !important;
}

/* ------------------- Скроллбар в ночной теме ------------------- */

html.night #chat-scroll-area,
html.night #recent-sessions-list,
html.night #sidebar,
html.night #message-input,
html.night #modal-content,
body.night #chat-scroll-area,
body.night #recent-sessions-list,
body.night #sidebar,
body.night #message-input,
body.night #modal-content {
  scrollbar-color: transparent transparent;
}

html.night #chat-scroll-area::-webkit-scrollbar-track,
html.night #recent-sessions-list::-webkit-scrollbar-track,
html.night #sidebar::-webkit-scrollbar-track,
html.night #message-input::-webkit-scrollbar-track,
html.night #modal-content::-webkit-scrollbar-track,
body.night #chat-scroll-area::-webkit-scrollbar-track,
body.night #recent-sessions-list::-webkit-scrollbar-track,
body.night #sidebar::-webkit-scrollbar-track,
body.night #message-input::-webkit-scrollbar-track,
body.night #modal-content::-webkit-scrollbar-track {
  background: transparent;
}

html.night.scrolling #chat-scroll-area,
html.night.scrolling #recent-sessions-list,
html.night.scrolling #sidebar,
html.night.scrolling #message-input,
html.night.scrolling #modal-content,
body.night.scrolling #chat-scroll-area,
body.night.scrolling #recent-sessions-list,
body.night.scrolling #sidebar,
body.night.scrolling #message-input,
body.night.scrolling #modal-content {
  scrollbar-color: rgba(75, 85, 99, 0.95) transparent;
}

html.night.scrolling #chat-scroll-area::-webkit-scrollbar-thumb,
html.night.scrolling #recent-sessions-list::-webkit-scrollbar-thumb,
html.night.scrolling #sidebar::-webkit-scrollbar-thumb,
html.night.scrolling #message-input::-webkit-scrollbar-thumb,
html.night.scrolling #modal-content::-webkit-scrollbar-thumb,
body.night.scrolling #chat-scroll-area::-webkit-scrollbar-thumb,
body.night.scrolling #recent-sessions-list::-webkit-scrollbar-thumb,
body.night.scrolling #sidebar::-webkit-scrollbar-thumb,
body.night.scrolling #message-input::-webkit-scrollbar-thumb,
body.night.scrolling #modal-content::-webkit-scrollbar-thumb {
  background: rgba(75, 85, 99, 0.95);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

html.night.scrolling #chat-scroll-area::-webkit-scrollbar-thumb:hover,
html.night.scrolling #recent-sessions-list::-webkit-scrollbar-thumb:hover,
html.night.scrolling #sidebar::-webkit-scrollbar-thumb:hover,
html.night.scrolling #message-input::-webkit-scrollbar-thumb:hover,
html.night.scrolling #modal-content::-webkit-scrollbar-thumb:hover,
body.night.scrolling #chat-scroll-area::-webkit-scrollbar-thumb:hover,
body.night.scrolling #recent-sessions-list::-webkit-scrollbar-thumb:hover,
body.night.scrolling #sidebar::-webkit-scrollbar-thumb:hover,
body.night.scrolling #message-input::-webkit-scrollbar-thumb:hover,
body.night.scrolling #modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, 0.98);
  border: 2px solid transparent;
  background-clip: padding-box;
}
