/* ==========================================================================
   chess-burgundy / DLE system layer
   Файл: /templates/chess-burgundy/css/dle.css v.2
   Назначение: стили для системного HTML DLE, BBCode, editor output и widgets
   ========================================================================== */
/* --- Section name -------------------------------------------------------
   Responsibility:
   Owns:
   Do not:
   Related:
------------------------------------------------------------------------- */
/* --- 1) Базовый слой для контента DLE ----------------------------------- */

.full-text,
.short-text,
.text,
.textwrap,
.editorcomm,
.comment-text,
#dle-content,
.userinfo,
.static-page,
.pm,
.pmlist,
#searchsuggestions {
  color: var(--text);
  font-family: var(--font-body);
}

.full-text,
.short-text,
.text,
.comment-text,
.static-page {
  font-size: var(--fs-base);
  line-height: 1.8;
}

.full-text > * + *,
.short-text > * + *,
.text > * + *,
.comment-text > * + *,
.static-page > * + * {
  margin-top: 1em;
}

.full-text > :where(p, ul, ol, blockquote, pre, table, figure, .quote, .text_spoiler, .mce-toc),
.short-text > :where(p, ul, ol, blockquote, pre, table, figure, .quote, .text_spoiler, .mce-toc),
.text > :where(p, ul, ol, blockquote, pre, table, figure, .quote, .text_spoiler, .mce-toc),
.comment-text > :where(p, ul, ol, blockquote, pre, table, figure, .quote, .text_spoiler),
.static-page > :where(p, ul, ol, blockquote, pre, table, figure, .quote, .text_spoiler, .mce-toc) {
  max-width: 72ch;
}

.full-text > :where(h2, h3, h4, h5, h6),
.short-text > :where(h2, h3, h4, h5, h6),
.text > :where(h2, h3, h4, h5, h6),
.comment-text > :where(h2, h3, h4, h5, h6),
.static-page > :where(h2, h3, h4, h5, h6) {
  max-width: 24ch;
}

.full-text a,
.short-text a,
.text a,
.comment-text a,
.static-page a {
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.full-text strong,
.short-text strong,
.text strong,
.comment-text strong,
.static-page strong {
  font-weight: 700;
}

.full-text em,
.short-text em,
.text em,
.comment-text em,
.static-page em {
  font-style: italic;
}

.full-text ul,
.full-text ol,
.short-text ul,
.short-text ol,
.text ul,
.text ol,
.comment-text ul,
.comment-text ol,
.static-page ul,
.static-page ol {
  padding-left: 1.35rem;
}

.full-text li + li,
.short-text li + li,
.text li + li,
.comment-text li + li,
.static-page li + li {
  margin-top: 0.45rem;
}

.full-text hr,
.short-text hr,
.text hr,
.comment-text hr,
.static-page hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

/* --- 2) Заголовки внутри редакторского контента ------------------------- */

.full-text h2,
.short-text h2,
.text h2,
.static-page h2 {
  font-family: var(--font-heading);
  font-size: var(--fs-h2);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.full-text h3,
.short-text h3,
.text h3,
.comment-text h3,
.static-page h3 {
  font-size: var(--fs-h3);
  line-height: 1.22;
  font-weight: 700;
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 0.85rem;
}

.full-text h4,
.short-text h4,
.text h4,
.comment-text h4,
.static-page h4,
.full-text h5,
.short-text h5,
.text h5,
.comment-text h5,
.static-page h5,
.full-text h6,
.short-text h6,
.text h6,
.comment-text h6,
.static-page h6 {
  font-size: var(--fs-lead);
  line-height: 1.35;
  font-weight: 700;
  color: var(--text);
  margin-top: 1.6rem;
  margin-bottom: 0.75rem;
}

/* --- 3) Цитаты / quote --------------------------------------------------- */

.title_quote {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--accent);
  font-size: var(--fs-meta);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.title_quote::before {
  content: "";
  width: 1.25rem;
  height: 1px;
  background: currentColor;
}

.quote,
blockquote {
  position: relative;
  margin: 0;
  padding: 1.25rem 1.25rem 1.25rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  color: var(--text);
}

.quote::before,
blockquote::before {
  content: "“";
  position: absolute;
  top: 0.5rem;
  left: 0.9rem;
  font-family: var(--font-heading);
  font-size: 2.4rem;
  line-height: 1;
  color: color-mix(in srgb, var(--accent) 30%, transparent);
  pointer-events: none;
}

.quote > :first-child,
blockquote > :first-child {
  margin-top: 0;
}

.quote > :last-child,
blockquote > :last-child {
  margin-bottom: 0;
}

/* --- 4) Спойлеры --------------------------------------------------------- */

.title_spoiler {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 1.25rem 0 0;
  padding: 0.95rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}

.title_spoiler svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  color: var(--accent);
}

.text_spoiler {
  margin-top: 0.5rem;
  padding: 1rem 1rem 1.05rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.text_spoiler > :first-child {
  margin-top: 0;
}

.text_spoiler > :last-child {
  margin-bottom: 0;
}

/* --- 5) Код / pre / hljs ------------------------------------------------- */

pre,
.codebox,
.bb-editor textarea,
.wseditor textarea {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

pre,
.codebox {
  max-width: 100%;
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  background: #211d1a;
  border: 1px solid #3a312c;
  border-radius: 14px;
  color: #f4eee7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

pre code,
.codebox code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: inherit;
  background: transparent;
  padding: 0;
}

code,
.tt {
  display: inline;
  padding: 0.15em 0.4em;
  background: var(--accent-soft);
  border-radius: 0.4rem;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.hljs {
  display: block;
  overflow-x: auto;
  background: transparent;
  color: #f4eee7;
}

.hljs-comment,
.hljs-quote {
  color: #b4a79b;
  font-style: italic;
}

.hljs-keyword,
.hljs-doctag,
.hljs-formula {
  color: #f0b3c0;
}

.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.hljs-meta-string {
  color: #d8c48d;
}

.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-type {
  color: #c8d8c8;
}

.hljs-title,
.hljs-section,
.hljs-selector-tag,
.hljs-name {
  color: #f2ddd0;
}

.hljs-link {
  color: #f2ddd0;
  text-decoration: underline;
}

/* --- 6) Таблицы ---------------------------------------------------------- */

.full-text table,
.short-text table,
.text table,
.static-page table,
.comment-text table {
  width: 100%;
  max-width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: block;
  overflow-x: auto;
}

.full-text table thead,
.short-text table thead,
.text table thead,
.static-page table thead,
.comment-text table thead {
  background: var(--surface);
}

.full-text th,
.full-text td,
.short-text th,
.short-text td,
.text th,
.text td,
.static-page th,
.static-page td,
.comment-text th,
.comment-text td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.full-text th,
.short-text th,
.text th,
.static-page th,
.comment-text th {
  font-weight: 700;
  color: var(--text);
}

.full-text tr:last-child td,
.short-text tr:last-child td,
.text tr:last-child td,
.static-page tr:last-child td,
.comment-text tr:last-child td {
  border-bottom: 0;
}

/* --- 7) TOC из редактора ------------------------------------------------- */

.mce-toc {
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.mce-toc h2,
.mce-toc h3,
.mce-toc h4 {
  margin: 0 0 0.75rem;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.4;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mce-toc ul,
.mce-toc ol {
  margin: 0;
  padding-left: 1.1rem;
}

.mce-toc li + li {
  margin-top: 0.35rem;
}

.mce-accordion summary {
  cursor: pointer;
}

/* --- 8) Изображения и figure -------------------------------------------- */

.full-text img,
.short-text img,
.text img,
.comment-text img,
.static-page img {
  border-radius: 12px;
}

figure {
  margin: 1.5rem 0;
}

figure.align-left {
  float: left;
  margin: 0.4rem 1.25rem 1rem 0;
}

figure.align-right {
  float: right;
  margin: 0.4rem 0 1rem 1.25rem;
}

figure.image.align-center {
  display: table;
  margin-left: auto;
  margin-right: auto;
}

figure.image figcaption {
  padding: 0.8rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  color: var(--muted);
  font-size: var(--fs-meta);
  line-height: 1.55;
  text-align: center;
  word-break: break-word;
}

figure.image.align-center figcaption {
  display: table-caption;
  caption-side: bottom;
}

figure.image > img,
figure.image > a > img,

.full-text img,
.short-text img,
.text img,
.static-page img {
  background: var(--surface);
  border: 1px solid var(--line);
}

/* Full Article media is a reading-flow block, not legacy floated decoration.
   Keep small source images at natural size; larger images shrink responsively to the article measure. */
.story-page__lead img,
.story-page__body img {
  display: block;
  float: none;
  clear: both;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
}

.story-page__lead a.highslide,
.story-page__body a.highslide,
.story-page__lead a[data-highslide],
.story-page__body a[data-highslide] {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 1.5rem auto;
}

.story-page__lead a.highslide img,
.story-page__body a.highslide img,
.story-page__lead a[data-highslide] img,
.story-page__body a[data-highslide] img {
  margin: 0;
}

.story-page__lead figure.align-left,
.story-page__lead figure.align-right,
.story-page__body figure.align-left,
.story-page__body figure.align-right {
  float: none;
  max-width: 100%;
  margin: 1.5rem auto;
}

.image-bordered {
  border: 1px solid var(--line) !important;
}

.image-shadows {
  box-shadow: 0 8px 24px rgba(31, 26, 23, 0.08);
}

.image-padded {
  padding: 0.5rem;
  background: var(--surface-2);
}

/* --- 9) Видео / embeds --------------------------------------------------- */

iframe,
video {
  max-width: 100%;
  border: 0;
  border-radius: 12px;
}

.full-text iframe,
.short-text iframe,
.text iframe,
.static-page iframe {
  width: 100%;
  min-height: 360px;
  background: #000;
}

/* --- 10) Формы DLE ------------------------------------------------------- */

.ui-form,
.form_wrap,
.addform,
.page_form__inner,
.form_box {
  display: grid;
  gap: 1rem;
}

.ui-form {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ui-form > li {
  margin: 0;
  padding: 0;
}

.ui-form label,
.form-group label,
.page_form__form label,
.form-sep label {
  display: inline-block;
  margin-bottom: 0.45rem;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.45;
}

.wide,
.f_input,
.xfields input,
.xfields textarea,
.xfields select,
.ui-form input[type="text"],
.ui-form input[type="password"],
.ui-form input[type="email"],
.ui-form input[type="search"],
.ui-form input[type="url"],
.ui-form input[type="tel"],
.ui-form input[type="number"],
.ui-form textarea,
.ui-form select,
.page_form__form input[type="text"],
.page_form__form input[type="password"],
.page_form__form input[type="email"],
.page_form__form textarea,
.page_form__form select,
.comments_author_field {
  width: 100%;
  min-height: 3rem;
  padding: 0.8rem 0.95rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.5;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.ui-form textarea,
.page_form__form textarea,
.xfields textarea,
.bb-editor textarea,
.wseditor textarea {
  min-height: 11rem;
  resize: vertical;
}

.wide::placeholder,
.f_input::placeholder,
.ui-form input::placeholder,
.ui-form textarea::placeholder,
.page_form__form input::placeholder,
.page_form__form textarea::placeholder,
.comments_author_field::placeholder {
  color: var(--muted-2);
}

.wide:focus,
.f_input:focus,
.ui-form input:focus,
.ui-form textarea:focus,
.ui-form select:focus,
.page_form__form input:focus,
.page_form__form textarea:focus,
.page_form__form select:focus,
.comments_author_field:focus,
.bb-editor textarea:focus,
.wseditor textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(110, 33, 50, 0.12);
}

.form-group.combo,
.combo {
  display: grid;
  gap: 1rem;
}

.combo_field {
  min-width: 0;
}

.form_submit,
.page_form__actions,
.addform__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.form_note,
.form-text,
.form_desc,
.xfieldsnote {
  color: var(--muted);
  font-size: var(--fs-meta);
  line-height: 1.6;
}

/* --- 11) Чекбоксы / radio ------------------------------------------------ */

.form-check-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.7rem;
  cursor: pointer;
}

.form-check-input {
  color: var(--accent);
  flex-shrink: 0;
  width: 1.12rem;
  height: 1.12rem;
  margin: 0.15rem 0 0;
  appearance: none;
  background-color: var(--surface-2);
  background-image: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border: 1px solid var(--accent);
  vertical-align: middle;
}

.form-check-input[type="checkbox"] {
  border-radius: 0.25rem;
}

.form-check-input[type="radio"] {
  border-radius: 50%;
}

.form-check-input:checked[type="checkbox"] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%236e2132' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m4.5 10 3.2 3.2 7.5-7.5'/%3e%3c/svg%3e");
}

.form-check-input:checked[type="radio"] {
  background-image: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%236e2132'/%3e%3c/svg%3e\");
}

.form-check-input:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(110, 33, 50, 0.12);
}

/* DLE simple-search emits #searchinput without a theme form class.
   Own its border here so mobile rendering cannot fall back to an incomplete UA style. */
.search-page__table #searchinput {
  border: 1px solid var(--line);
}

.search-page__table #searchinput:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(110, 33, 50, 0.12);
}

/* --- 12) Кнопки от движка ------------------------------------------------ */

.ui-button,
.bbcodes,
button[type="submit"],
button[type="button"]:not(.nav-toggle),
input[type="submit"],
input[type="button"],
.self_delete_link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0.75rem 1rem;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  cursor: pointer;
}

.ui-button:hover,
.bbcodes:hover,
button[type="submit"]:hover,
button[type="button"]:not(.nav-toggle):hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.self_delete_link:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.ui-button:active,
.bbcodes:active,
button[type="submit"]:active,
button[type="button"]:not(.nav-toggle):active,
input[type="submit"]:active,
input[type="button"]:active,
.self_delete_link:active {
  transform: translateY(1px);
}

.ui-dialog-buttonset button.ui-button-delete,
.self_delete_link {
  background: #8b2d2d;
  border-color: #8b2d2d;
}

.ui-dialog-buttonset button.ui-button-delete:hover,
.self_delete_link:hover {
  background: #742323;
  border-color: #742323;
}

/* --- 13) Редактор / BBcodes --------------------------------------------- */

#comment-editor,
.editor-panel,
.bb-editor,
.wseditor {
  width: 100%;
}

.bb-editor,
.wseditor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.bb-editor textarea,
.wseditor textarea {
  display: block;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-2);
}

.bb-pane,
.editor-toolbar,
.wseditor .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem;
  background: var(--surface);
}

.bb-btn,
.editor-btn,
.bb-editor .btn,
.wseditor .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  min-height: 2.35rem;
  padding: 0.4rem 0.6rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
}

.bb-btn:hover,
.editor-btn:hover,
.bb-editor .btn:hover,
.wseditor .btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- 14) captcha / secondary blocks ------------------------------------- */

.c-captcha,
.sec_code,
.page_form__captcha,
.form-captcha {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.c-captcha img,
.sec_code img {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}

/* --- 15) DLE dialog / popup --------------------------------------------- */

.ui-widget-overlay {
  background: rgba(31, 26, 23, 0.45);
}

.ui-front {
  z-index: 1000;
}

.ui-dialog {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(31, 26, 23, 0.16);
  color: var(--text);
  overflow: hidden;
}

.ui-dialog-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.ui-dialog-title {
  font-size: var(--fs-lead);
  font-weight: 700;
}

.ui-dialog-content {
  padding: 1rem 1.1rem;
}

.ui-dialog-buttonpane {
  padding: 0 1.1rem 1rem;
}

.ui-dialog-buttonset {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ui-button-icon-only {
  overflow: hidden;
  text-indent: -9999px;
}

/* --- 15.1 Fancybox popup bridge -----------------------------------------
Responsibility: canonical visual layer for image popup / lightbox.
Owns: Fancybox backdrop, toolbar, caption, nav buttons, popup content skin.
Do not: keep or add second popup skin, style popup in style.css, preserve legacy Highslide path.
Canonical viewer path: Fancybox only.
JS owner: app.js only.
Migration rule: remove Highslide selectors after template + JS migration is complete.
------------------------------------------------------------------------- */
.fancybox__container {
  --fancybox-bg: rgba(31, 26, 23, 0.82);
  --fancybox-color: var(--inverse);
  --f-button-width: 40px;
  --f-button-height: 40px;
  --f-button-svg-width: 18px;
  --f-button-svg-height: 18px;
  z-index: 2100;
}

.fancybox__backdrop {
  background: rgba(31, 26, 23, 0.82);
}

.fancybox__toolbar,
.fancybox__footer {
  text-shadow: none;
}

.fancybox__toolbar {
  padding: 0.75rem;
}

.fancybox__counter {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(251, 248, 242, 0.08);
  color: #fff;
  font-size: var(--fs-meta);
  line-height: 1;
}

.fancybox__button,
.fancybox__nav .f-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(251, 248, 242, 0.1);
  color: #fff;
  box-shadow: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.fancybox__button:hover,
.fancybox__nav .f-button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.fancybox__button:active,
.fancybox__nav .f-button:active {
  transform: translateY(1px);
}

.fancybox__content {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(31, 26, 23, 0.22);
}

.fancybox__caption {
  width: min(100% - 2rem, 46rem);
  margin: 0 auto 1rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(221, 211, 196, 0.2);
  border-radius: 12px;
  background: rgba(31, 26, 23, 0.72);
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

@media (max-width: 767.98px) {
  .fancybox__toolbar {
    padding: 0.5rem;
  }

  .fancybox__caption {
    width: calc(100% - 1rem);
    margin-bottom: 0.5rem;
    padding: 0.7rem 0.8rem;
    font-size: var(--fs-meta);
  }

  .fancybox__button,
  .fancybox__nav .f-button {
    min-width: 2.25rem;
    min-height: 2.25rem;
  }
}

/* --- 16) push notifications --------------------------------------------- */

.DLEPush {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2001;
  width: min(100% - 2rem, 24rem);
}

@keyframes DLEPush-show {
  from {
    transform: translateY(1rem);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.DLEPush-notification.wrapper {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  margin-bottom: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: 0 14px 40px rgba(31, 26, 23, 0.12);
  color: var(--text);
  animation: DLEPush-show 220ms ease;
}

.DLEPush-notification .DLEPush-icon {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  min-height: 100%;
  color: #fff;
  background: var(--accent);
}

.DLEPush-notification .DLEPush-icon svg {
  width: 1rem;
  height: 1rem;
}

.DLEPush-notification .DLEPush-header {
  grid-column: 2;
  grid-row: 1;
  margin: 0.8rem 2.5rem 0 1rem;
  font-size: var(--fs-sm);
  font-weight: 700;
}

.DLEPush-notification .DLEPush-header:empty {
  margin-top: 0;
}

.DLEPush-notification .DLEPush-message {
  grid-column: 2;
  grid-row: 2;
  margin: 0.35rem 2.5rem 0.9rem 1rem;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.DLEPush-notification .DLEPush-message ul,
.DLEPush-notification .DLEPush-message li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.DLEPush-notification .DLEPush-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  min-height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.DLEPush-notification .DLEPush-close:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.DLEPush-notification.wrapper.push-success .DLEPush-icon {
  background: #567a42;
}

.DLEPush-notification.wrapper.push-warning .DLEPush-icon {
  background: #a06a1f;
}

.DLEPush-notification.wrapper.push-error .DLEPush-icon {
  background: #8b2d2d;
}

/* --- 17) PM / таблицы личных сообщений ---------------------------------- */

.pm {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.pm th,
.pm td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.pm th {
  background: var(--surface);
  font-weight: 700;
  white-space: nowrap;
}

.pm th.pm_checkbox {
  text-align: center;
}

.pm tbody > tr:hover {
  background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface-2));
}

.pm td.pm_list.pm_icon,
.userstop td,
th.pm_head.pm_icon {
  border-bottom: none;
}

.pm_list.pm_subj,
.pm_list.pm_icon,
.pm_list.pm_last_user {
  cursor: pointer;
}

.pm_list.pm_icon svg {
  width: 1.2rem;
  height: 1.2rem;
  vertical-align: middle;
}

.pm_list.pm_icon.pm-unread-image {
  color: var(--accent);
}

.pm_list.pm_icon.pm-reply-image {
  color: #567a42;
}

.pm_list.pm_icon.pm-read-image {
  color: var(--muted-2);
}

.pm_list .pm_last_message,
.pm_list .pm_last_date,
.pm_list .pm_with_user {
  color: var(--muted);
  font-size: var(--fs-meta);
}

.pm_navigation {
  margin-top: 1rem;
}

.pm_navigation .navigation {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.pm_navigation .navigation a,
.pm_navigation .navigation span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: var(--fs-sm);
}

.pm_navigation .navigation span {
  background: var(--accent);
  color: #fff;
}

.pm_navigation .navigation a {
  color: var(--text);
}

.pm_navigation .navigation a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* --- 18) Быстрый поиск --------------------------------------------------- */

#searchsuggestions {
  overflow: hidden;
  margin-top: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(31, 26, 23, 0.08);
}

#searchsuggestions a {
  display: block;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

#searchsuggestions a:last-child {
  border-bottom: 0;
}

#searchsuggestions a:hover {
  background: var(--surface);
}

.searchheading {
  display: block;
  margin-bottom: 0.25rem;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
}

#searchsuggestions a span:last-child {
  display: block;
  color: var(--muted);
  font-size: var(--fs-meta);
  line-height: 1.55;
}

/* --- 19) Служебные классы ------------------------------------------------ */

.signature {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-meta);
  line-height: 1.6;
}

.comments-user-profile {
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
}

.attachment,
.attach {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.attachment a,
.attach a {
  font-weight: 600;
}

.hidden,
[hidden] {
  display: none !important;
}

/* --- 20) Адаптив --------------------------------------------------------- */

@media (min-width: 768px) {
  .form-group.combo,
  .combo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  figure.align-left,
  figure.align-right {
    float: none;
    margin: 1.25rem 0;
  }

  .full-text iframe,
  .short-text iframe,
  .text iframe,
  .static-page iframe {
    min-height: 220px;
  }

  .pm,
  .full-text table,
  .short-text table,
  .text table,
  .static-page table,
  .comment-text table {
    font-size: 0.9375rem;
  }

  .ui-dialog {
    width: calc(100vw - 1rem) !important;
    max-width: none !important;
    left: 0.5rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .DLEPush-notification.wrapper,
  .ui-button,
  .bbcodes,
  button,
  input[type="submit"],
  input[type="button"] {
    animation: none !important;
    transition: none !important;
  }
}