/**
 * templStandart — CMS overlay (after layout.css + theme.css)
 * Joomla-specific bridges only; design tokens & components live in theme.css.
 */

:root {
  --tempcolor-dark: color-mix(in srgb, var(--tempcolor, #3d4f8f) 72%, #000);
  --tempcolor-soft: color-mix(in srgb, var(--tempcolor, #3d4f8f) 12%, #fff);
  --tempcolor-mid: color-mix(in srgb, var(--tempcolor, #3d4f8f) 22%, #fff);
  --tempaccent-soft: color-mix(in srgb, var(--tempaccentcolor, #c26d2d) 12%, #fff);
  --ts-text: #1a2a33;
  --ts-muted: #5a6b75;
  --ts-surface: #ffffff;
  --ts-surface-alt: #f4f7f9;
  --ts-border: #d8e2e8;
  --ts-radius: 6px;
  --ts-radius-sm: 4px;
  --ts-control-min-h: 2.35rem;
  --ts-control-pad-y: 0.28rem;
  --ts-control-pad-x: 0.65rem;
  --ts-control-font: 0.78rem;
  --ts-control-border: color-mix(in srgb, var(--tempcolor, #3d4f8f) 22%, #d8e2e8);
  --ts-shadow: 0 1px 2px rgba(10, 42, 58, 0.06), 0 4px 14px rgba(10, 42, 58, 0.05);
  --ts-font-ui: "Manrope", "Segoe UI", sans-serif;
  --ts-font-display: "Source Serif 4", "Times New Roman", serif;
}

body.ts-body {
  font-family: var(--ts-font-ui);
  color: var(--ts-text);
  background-color: var(--ts-surface-alt);
  -webkit-font-smoothing: antialiased;
}

a:hover {
  color: var(--tempaccentcolor, #c26d2d);
}

.error-404__btn,
.error-404__btn:hover {
  color: #fff !important;
  text-decoration: none !important;
}

/* Footer links stay light; top-bar buttons keep their own hover */
#footer a:hover {
  color: #fff !important;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--tempaccentcolor, #c26d2d);
  outline-offset: 2px;
}

/* —— Icon size caps (FA / images in template chrome only) —— */
.site-header .fa,
.site-header .fas,
.site-header .far,
.site-header .fab,
.site-header .fal,
.site-header .fad,
.site-header .fa-solid,
.site-header .fa-regular,
.site-header .fa-brands,
.site-header .fa-light,
.site-header .icon,
.site-header [class^="icon-"],
.site-header [class*=" icon-"],
.site-header svg.svg-inline--fa,
.site-footer .fa,
.site-footer .fas,
.site-footer .far,
.site-footer .fab,
.site-footer .fal,
.site-footer .fad,
.site-footer .fa-solid,
.site-footer .fa-regular,
.site-footer .fa-brands,
.site-footer .fa-light,
.site-footer .icon,
.site-footer [class^="icon-"],
.site-footer [class*=" icon-"],
.site-footer svg.svg-inline--fa,
#footer .fa,
#footer .fas,
#footer .far,
#footer .fab,
#footer .fal,
#footer .fad,
#footer .fa-solid,
#footer .fa-regular,
#footer .fa-brands,
#footer .fa-light,
#footer .icon,
#footer [class^="icon-"],
#footer [class*=" icon-"],
#footer svg.svg-inline--fa,
.imeny-section .fa,
.imeny-section .fas,
.imeny-section .far,
.imeny-section .fab,
.imeny-section .fal,
.imeny-section .fad,
.imeny-section .fa-solid,
.imeny-section .fa-regular,
.imeny-section .fa-brands,
.imeny-section .fa-light,
.imeny-section .icon,
.imeny-section [class^="icon-"],
.imeny-section [class*=" icon-"],
.imeny-section svg.svg-inline--fa,
#imeny .fa,
#imeny .fas,
#imeny .far,
#imeny .fab,
#imeny .fal,
#imeny .fad,
#imeny .fa-solid,
#imeny .fa-regular,
#imeny .fa-brands,
#imeny .fa-light,
#imeny .icon,
#imeny [class^="icon-"],
#imeny [class*=" icon-"],
#imeny svg.svg-inline--fa,
.breadcrumb-bar .fa,
.breadcrumb-bar .fas,
.breadcrumb-bar .far,
.breadcrumb-bar .fab,
.breadcrumb-bar .fal,
.breadcrumb-bar .fad,
.breadcrumb-bar .fa-solid,
.breadcrumb-bar .fa-regular,
.breadcrumb-bar .fa-brands,
.breadcrumb-bar .fa-light,
.breadcrumb-bar .icon,
.breadcrumb-bar [class^="icon-"],
.breadcrumb-bar [class*=" icon-"],
.breadcrumb-bar svg.svg-inline--fa,
.sidenav .fa,
.sidenav .fas,
.sidenav .far,
.sidenav .fab,
.sidenav .fal,
.sidenav .fad,
.sidenav .fa-solid,
.sidenav .fa-regular,
.sidenav .fa-brands,
.sidenav .fa-light,
.sidenav .icon,
.sidenav [class^="icon-"],
.sidenav [class*=" icon-"],
.sidenav svg.svg-inline--fa,
.sidebar-nav .fa,
.sidebar-nav .fas,
.sidebar-nav .far,
.sidebar-nav .fab,
.sidebar-nav .fal,
.sidebar-nav .fad,
.sidebar-nav .fa-solid,
.sidebar-nav .fa-regular,
.sidebar-nav .fa-brands,
.sidebar-nav .fa-light,
.sidebar-nav .icon,
.sidebar-nav [class^="icon-"],
.sidebar-nav [class*=" icon-"],
.sidebar-nav svg.svg-inline--fa {
  width: 1em !important;
  height: 1em !important;
  max-width: 1.35rem !important;
  max-height: 1.35rem !important;
  font-size: 1em !important;
  line-height: 1 !important;
  vertical-align: -0.125em;
}

/* Third-party editors: do not inherit template icon caps */
.nfc-editor-toolbar .fa,
.nfc-editor-toolbar .fas,
.nfc-editor-toolbar .far,
.nfc-editor-toolbar .fab,
.nfc-editor-toolbar .fal,
.nfc-editor-toolbar .fad,
.nfc-editor-toolbar .fa-solid,
.nfc-editor-toolbar .fa-regular,
.nfc-editor-toolbar .fa-brands,
.nfc-editor-toolbar .fa-light,
.nfc-editor-toolbar .icon,
.nfc-editor-toolbar [class^="icon-"],
.nfc-editor-toolbar [class*=" icon-"],
.nfc-editor-toolbar svg.svg-inline--fa,
.nfc-editor-toolbar svg:not(.svg-inline--fa),
[class*="nfc-editor"] .icon,
[class*="nfc-editor"] [class^="icon-"],
[class*="nfc-editor"] [class*=" icon-"],
[class*="nfc-editor"] svg.svg-inline--fa,
[class*="nfc-editor"] svg:not(.svg-inline--fa) {
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  font-size: inherit !important;
  line-height: inherit !important;
  vertical-align: baseline;
}

/* FA в .top-btn: размер как в прототипе (1.35rem), без фиксированной height */
.top-btn > i,
.top-btn > .fa,
.top-btn > .fa-solid,
.top-btn > .fa-regular,
.top-header-left a.top-btn > i,
.top-header-left a.top-btn > .fa-solid {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: stretch !important;
  width: 1.35rem !important;
  height: auto !important;
  max-width: 1.35rem !important;
  max-height: none !important;
  font-size: 1.35rem !important;
  line-height: 1 !important;
  vertical-align: middle;
}

.top-btn-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: stretch !important;
  flex: 0 0 1.55rem !important;
  width: 1.55rem !important;
  min-height: 100%;
}

.top-btn-text {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-self: center !important;
  line-height: 1.15 !important;
  max-width: 7.5rem;
  white-space: normal !important;
}

.top-btn img,
.top-btn-icon img,
.top-header-left a img,
.top-bar-menu img {
  width: 1.35rem !important;
  height: 1.35rem !important;
  max-width: 1.35rem !important;
  max-height: 1.35rem !important;
  object-fit: contain;
}

.layout-contacts i,
.layout-contacts .fa-solid {
  width: 1rem !important;
  height: 1rem !important;
  max-width: 1rem !important;
  max-height: 1rem !important;
  font-size: 1rem !important;
  margin-right: 0.4rem;
}

.imeny-item .imeny-icon img,
.imeny-item .imeny-icon i,
.imeny-item .imeny-icon .fa-solid {
  width: 1.75rem !important;
  height: 1.75rem !important;
  max-width: 1.75rem !important;
  max-height: 1.75rem !important;
  font-size: 1.75rem !important;
}

.site-footer i,
.site-footer .fa-solid,
.site-footer .fa-regular {
  width: 1em !important;
  height: 1em !important;
  max-width: 1.1rem !important;
  max-height: 1.1rem !important;
  font-size: 1em !important;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="date"],
select,
textarea,
.form-control,
.inputbox {
  box-sizing: border-box;
  min-height: var(--control-min-h, 2.35rem);
  padding: var(--control-pad-y, 0.28rem) var(--control-pad-x, 0.65rem);
  border: 1px solid var(--control-border, var(--ts-control-border));
  border-radius: var(--radius-sm, 4px);
  background: #fff;
  color: var(--tempcolor, #3d4f8f);
  font-family: var(--font-ui, var(--ts-font-ui));
  font-size: var(--control-font, 0.78rem);
  font-weight: 700;
  line-height: 1.15;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--tempcolor, #3d4f8f) 45%, #fff);
  font-weight: 600;
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.inputbox:focus {
  outline: none;
  border-color: var(--tempaccentcolor, #c26d2d);
  box-shadow: 0 0 0 2px var(--tempaccent-soft);
}

textarea {
  min-height: 6rem;
  font-weight: 600;
  line-height: 1.4;
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto !important;
  min-height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Поля форм — не слипаются */
.control-group,
.form-group,
.field-calendar,
.ts-login__field,
.ts-login__remember,
.com-contact .control-group,
.com-users .control-group,
.mod-login .mod-login__username,
.mod-login .mod-login__password,
.mod-login .mod-login__remember,
.mod-login .form-group,
#footer form > div,
#footer .moduletable form > p,
[data-position^="footer"] form .control-group {
  margin-bottom: 0.85rem;
}

.control-group .control-label,
.control-group > label,
.form-group > label,
.ts-login__field label,
.mod-login label:not(:has(input[type="checkbox"])),
.com-contact label:not(:has(input[type="checkbox"])) {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.3;
}

/* Checkbox + text in one row (Remember me, etc.) */
.ts-login__remember label,
.mod-login__remember label,
.mod-login label:has(input[type="checkbox"]),
.com-users label:has(input[type="checkbox"]),
#footer label:has(input[type="checkbox"]),
label:has(> input[type="checkbox"]) {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.45rem;
  margin-bottom: 0 !important;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
}

.ts-login__remember input[type="checkbox"],
.mod-login__remember input[type="checkbox"],
label:has(> input[type="checkbox"]) > input[type="checkbox"] {
  flex: 0 0 auto !important;
  width: 1.05rem !important;
  height: 1.05rem !important;
  max-width: 1.05rem !important;
  margin: 0 !important;
  accent-color: var(--tempcolor, #3d4f8f);
}

.control-group .controls,
.form-group .controls {
  margin-top: 0;
}

.ts-login__form,
.com-contact form,
.com-users form,
.mod-login form,
#footer form {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ts-login__form input[type="text"],
.ts-login__form input[type="password"],
.ts-login__form input[type="email"],
.com-contact form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.com-contact form select,
.com-contact form textarea,
.com-users form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.com-users form select,
.com-users form textarea,
.mod-login input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
#footer form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
#footer form select,
#footer form textarea,
.module-box input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.module-box select,
.module-box textarea {
  width: 100%;
  max-width: 100%;
}

/* Кнопки как в прототипе — только статьи / основной компонент (.ts-main), не блоки модулей.
 * Исключения: вкладки joomla-tab, тулбары редакторов (JCE/TinyMCE), виджеты полей —
 * иначе display:inline-flex перебивает display:none у аккордеон-кнопок вкладок. */
.ts-main
  :is(
    button:not(.btn-search):not(.news-slider__btn):not(.news-slider__dot),
    .btn:not(.btn-search),
input[type="submit"],
input[type="button"],
    input[type="reset"],
    .button
  ):not(
    joomla-tab button,
    joomla-tab-element button,
    [role="tablist"] button,
    .tox button,
    .tox-tbtn,
    .mce-container button,
    .mce-container .btn,
    .mce-toolbar button,
    .mce-btn-group button,
    .mce-btn button,
    .mce-listbox button,
    .mce-splitbtn button,
    .mce-menubar button,
    .mce-floatpanel button,
    .mce-window button,
    .mce-btn,
    .wf-editor button,
    .wf-editor .btn,
    .wf-editor-container button,
    .wf-editor-header button,
    .wf-editor-toolbar button,
    .wf-editor-tabs button,
    .js-editor-jce button,
    .js-editor-tinymce button,
    .editor-xtd-buttons button,
    .editor-xtd-buttons .btn,
    .editor-xtd-buttons a.btn,
    #editor-xtd-buttons button,
    #editor-xtd-buttons .btn,
    #editor-xtd-buttons a.btn,
    button[data-joomla-dialog],
    .btn[data-joomla-dialog],
    joomla-dialog button,
    joomla-dialog .btn,
    .joomla-dialog-container button,
    .joomla-dialog-container .btn,
    .modal button,
    .modal .btn,
    joomla-field-media button,
    joomla-field-user button,
    .field-calendar button,
    .choices button,
    .btn-group.radio button,
    .btn-group.radio .btn,
    .js-calendar button,
    .js-calendar .btn
  ) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: var(--control-min-h, 2.35rem);
  padding: var(--control-pad-y, 0.28rem) 0.85rem;
  border: 1.5px solid var(--tempcolor, #3d4f8f);
  border-radius: var(--radius-sm, 4px);
  background: var(--tempcolor-soft);
  color: var(--tempcolor, #3d4f8f);
  font-family: var(--font-ui, var(--ts-font-ui));
  font-size: var(--control-font, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ts-main
  :is(
    .btn:not(.btn-search),
    input[type="submit"],
    input[type="button"],
    input[type="reset"],
    .button,
    button:not(.btn-search):not(.news-slider__btn):not(.news-slider__dot)
  ):not(
    joomla-tab button,
    joomla-tab-element button,
    [role="tablist"] button,
    .tox button,
    .tox-tbtn,
    .mce-container button,
    .mce-container .btn,
    .mce-toolbar button,
    .mce-btn-group button,
    .mce-btn button,
    .mce-listbox button,
    .mce-splitbtn button,
    .mce-menubar button,
    .mce-floatpanel button,
    .mce-window button,
    .wf-editor button,
    .wf-editor .btn,
    .wf-editor-container button,
    .wf-editor-header button,
    .wf-editor-toolbar button,
    .wf-editor-tabs button,
    .js-editor-jce button,
    .js-editor-tinymce button,
    .editor-xtd-buttons button,
    .editor-xtd-buttons .btn,
    .editor-xtd-buttons a.btn,
    #editor-xtd-buttons button,
    #editor-xtd-buttons .btn,
    #editor-xtd-buttons a.btn,
    button[data-joomla-dialog],
    .btn[data-joomla-dialog],
    joomla-dialog button,
    joomla-dialog .btn,
    .joomla-dialog-container button,
    .modal button,
    .modal .btn,
    joomla-field-media button,
    .field-calendar button,
    .btn-group.radio button,
    .btn-group.radio .btn,
    .js-calendar button,
    .js-calendar .btn
  ):hover {
  background: var(--tempaccent-soft);
  color: var(--tempaccentcolor, #c26d2d);
  border-color: var(--tempaccentcolor, #c26d2d);
}

/*
 * Тулбар JCE / TinyMCE: не перебивать стили плагина (как в админке).
 * Любой padding/height/display на button внутри .mce-* ломает ряд кнопок.
 * Chrome шаблона уже исключён через :not(...) выше.
 */
.ts-main :is(.mce-container, .wf-editor, .wf-editor-container, .tox, .js-editor-jce, .js-editor-tinymce) img {
  display: inline-block;
  max-width: none;
  width: auto;
  height: auto;
  vertical-align: middle;
  border-radius: 0;
}

/* XTD-кнопки под редактором — ровный flex-ряд, без chrome шаблона */
.ts-main .editor-xtd-buttons,
.ts-main #editor-xtd-buttons,
.ts-main .toggle-editor,
.com-content-form .editor-xtd-buttons,
.edit.item-page .editor-xtd-buttons,
form[name="adminForm"] .editor-xtd-buttons {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0.4rem !important;
  margin: 0.65rem 0 1rem !important;
  padding: 0 !important;
}

.ts-main .editor-xtd-buttons :is(button, .btn, a.btn),
.ts-main #editor-xtd-buttons :is(button, .btn, a.btn),
.com-content-form .editor-xtd-buttons :is(button, .btn, a.btn),
.edit.item-page .editor-xtd-buttons :is(button, .btn, a.btn),
form[name="adminForm"] .editor-xtd-buttons :is(button, .btn, a.btn) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 2rem !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0.3rem 0.65rem !important;
  gap: 0.3rem !important;
  border: 1px solid #ced4da !important;
  border-radius: 3px !important;
  background: #fff !important;
  color: #212529 !important;
  font-family: inherit !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  white-space: nowrap;
}

.ts-main .editor-xtd-buttons :is(button, .btn, a.btn):hover,
.ts-main #editor-xtd-buttons :is(button, .btn, a.btn):hover,
.com-content-form .editor-xtd-buttons :is(button, .btn, a.btn):hover,
.edit.item-page .editor-xtd-buttons :is(button, .btn, a.btn):hover {
  background: #e9ecef !important;
  color: #212529 !important;
  border-color: #adb5bd !important;
}

.ts-main .field-calendar button:hover,
.ts-main joomla-field-media button:hover {
  background: #e9ecef !important;
  color: #212529 !important;
  border-color: #ced4da !important;
}

/*
 * Поле даты (Joomla calendar): input + кнопка в одну строку, нормальная высота.
 * Паттерн Bootstrap input-group: input flex:1 + width:1%, кнопка фиксированная.
 */
.ts-main .field-calendar,
.ts-main joomla-field-calendar,
.com-finder .field-calendar,
.com-finder joomla-field-calendar,
.com-content-form .field-calendar,
.com-content-form joomla-field-calendar,
.edit.item-page .field-calendar,
.edit.item-page joomla-field-calendar,
form[name="adminForm"] .field-calendar,
form[name="adminForm"] joomla-field-calendar {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ts-main .field-calendar .input-group,
.ts-main .field-calendar .input-append,
.ts-main joomla-field-calendar .input-group,
.ts-main joomla-field-calendar .input-append,
.com-finder .field-calendar .input-group,
.com-finder .field-calendar .input-append,
.com-finder joomla-field-calendar .input-group,
.com-content-form .field-calendar .input-group,
.com-content-form .field-calendar .input-append,
.com-content-form joomla-field-calendar .input-group,
.edit.item-page .field-calendar .input-group,
.edit.item-page .field-calendar .input-append,
form[name="adminForm"] .field-calendar .input-group,
form[name="adminForm"] .field-calendar .input-append {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.ts-main .field-calendar .input-group .form-control,
.ts-main .field-calendar .input-group input:not([type="hidden"]),
.ts-main .field-calendar .input-append input:not([type="hidden"]),
.ts-main .field-calendar > input:not([type="hidden"]),
.ts-main joomla-field-calendar .input-group .form-control,
.ts-main joomla-field-calendar .input-group input:not([type="hidden"]),
.ts-main joomla-field-calendar > input:not([type="hidden"]),
.com-finder .field-calendar .input-group .form-control,
.com-finder .field-calendar .input-group input:not([type="hidden"]),
.com-finder .field-calendar input:not([type="hidden"]),
.com-finder joomla-field-calendar input:not([type="hidden"]),
.com-content-form .control-group .field-calendar input:not([type="hidden"]),
.com-content-form .control-group .field-calendar .form-control,
.com-content-form .control-group joomla-field-calendar input:not([type="hidden"]),
.edit.item-page .control-group .field-calendar input:not([type="hidden"]),
.edit.item-page .control-group .field-calendar .form-control,
form[name="adminForm"] .control-group .field-calendar input:not([type="hidden"]),
form[name="adminForm"] .control-group .field-calendar .form-control,
form[name="adminForm"] .control-group joomla-field-calendar input:not([type="hidden"]) {
  flex: 1 1 auto !important;
  width: 1% !important;
  min-width: 8rem !important;
  max-width: none !important;
  min-height: var(--control-min-h, 2.35rem) !important;
  height: var(--control-min-h, 2.35rem) !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.ts-main .field-calendar .input-group > button,
.ts-main .field-calendar .input-group > .btn,
.ts-main .field-calendar .input-append > button,
.ts-main .field-calendar .input-append > .btn,
.ts-main .field-calendar > button,
.ts-main joomla-field-calendar .input-group > button,
.ts-main joomla-field-calendar .input-group > .btn,
.ts-main joomla-field-calendar > button,
.com-finder .field-calendar .input-group > button,
.com-finder .field-calendar .input-group > .btn,
.com-finder .field-calendar > button,
.com-finder .input-append > .btn,
.com-content-form .field-calendar button,
.com-content-form .field-calendar .btn,
.com-content-form joomla-field-calendar button,
.edit.item-page .field-calendar button,
.edit.item-page .field-calendar .btn,
form[name="adminForm"] .field-calendar button,
form[name="adminForm"] .field-calendar .btn {
  flex: 0 0 2.6rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 2.6rem !important;
  min-width: 2.6rem !important;
  max-width: 2.6rem !important;
  min-height: var(--control-min-h, 2.35rem) !important;
  height: var(--control-min-h, 2.35rem) !important;
  margin: 0 0 0 -1px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-top-right-radius: var(--radius-sm, 4px) !important;
  border-bottom-right-radius: var(--radius-sm, 4px) !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  font-weight: 500 !important;
  line-height: 1 !important;
}

/* —— Frontend article edit (com_content form) —— */
.com-content-form,
form.com-content-form,
.edit.item-page form,
form[name="adminForm"].form-validate {
  display: block;
  width: 100%;
  max-width: 100%;
}

.com-content-form .control-group,
.edit.item-page .control-group,
form[name="adminForm"] .control-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  margin: 0 0 1rem;
  width: 100%;
}

.com-content-form .control-group .control-label,
.com-content-form .control-group > label,
.edit.item-page .control-group .control-label,
form[name="adminForm"] .control-group .control-label {
  display: block;
  float: none;
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 0;
  text-align: left;
}

.com-content-form .control-group .controls,
.edit.item-page .control-group .controls,
form[name="adminForm"] .control-group .controls {
  display: block;
  float: none;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.com-content-form .control-group .form-control,
.com-content-form .control-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.com-content-form .control-group select,
.com-content-form .control-group textarea,
.edit.item-page .control-group .form-control,
form[name="adminForm"] .control-group .form-control,
form[name="adminForm"] .control-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
form[name="adminForm"] .control-group select,
form[name="adminForm"] .control-group textarea {
  width: 100%;
  max-width: 100%;
  font-weight: 600;
}

/* Поле даты в редакторе: input растёт, кнопка справа — не width:100% на весь control-group */
.com-content-form .control-group .field-calendar .form-control,
.com-content-form .control-group .field-calendar input:not([type="hidden"]),
.com-content-form .control-group joomla-field-calendar input:not([type="hidden"]),
.edit.item-page .control-group .field-calendar .form-control,
.edit.item-page .control-group .field-calendar input:not([type="hidden"]),
form[name="adminForm"] .control-group .field-calendar .form-control,
form[name="adminForm"] .control-group .field-calendar input:not([type="hidden"]),
form[name="adminForm"] .control-group joomla-field-calendar input:not([type="hidden"]) {
  flex: 1 1 auto;
  width: 1%;
  min-width: 8rem;
  max-width: none;
  min-height: var(--control-min-h, 2.35rem);
  height: var(--control-min-h, 2.35rem);
}

.com-content-form .btn-toolbar,
.edit.item-page .btn-toolbar,
form[name="adminForm"] > .btn-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.15rem;
  padding: 0;
}

/* Одна панель действий: убрать визуальный «второй» тулбар без кнопок Save */
.com-content-form .btn-toolbar.pull-left,
.edit.item-page .btn-toolbar.pull-left,
form[name="adminForm"] .btn-toolbar.pull-left {
  margin-bottom: 0.75rem;
}

.com-content-form .btn-toolbar .btn .icon-ok,
.com-content-form .btn-toolbar .btn .icon-check,
.com-content-form .btn-toolbar .btn .icon-cancel,
.com-content-form .btn-toolbar .btn .icon-times,
form[name="adminForm"] .btn-toolbar .btn [class^="icon-"] {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-style: normal;
  speak: never;
  margin-right: 0.35rem;
}

.com-content-form .btn-toolbar .btn .icon-ok::before,
.com-content-form .btn-toolbar .btn .icon-check::before {
  content: "\f00c" !important;
}

.com-content-form .btn-toolbar .btn .icon-cancel::before,
.com-content-form .btn-toolbar .btn .icon-times::before {
  content: "\f00d" !important;
}

/* joomla-tab: восстановить flex + order:-1 (наш display:block ломал вкладки → дубли кнопок) */
.com-content-form joomla-tab,
.com-content-form .joomla-tabs,
.edit.item-page joomla-tab,
form[name="adminForm"] joomla-tab {
  display: flex !important;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  margin-bottom: 1rem;
}

.com-content-form joomla-tab > button[role="tab"],
.edit.item-page joomla-tab > button[role="tab"],
form[name="adminForm"] joomla-tab > button[role="tab"],
.ts-main joomla-tab > button[role="tab"] {
  order: -1;
  flex: 0 1 auto;
  min-height: 2.25rem;
  margin: 0;
  border-radius: var(--radius-sm, 4px) var(--radius-sm, 4px) 0 0;
  text-transform: uppercase;
}

/* Панель вкладки — на всю ширину под рядом кнопок */
.com-content-form joomla-tab > joomla-tab-element,
.edit.item-page joomla-tab > joomla-tab-element,
form[name="adminForm"] joomla-tab > joomla-tab-element,
.ts-main joomla-tab > joomla-tab-element {
  flex: 1 0 100%;
  max-width: 100%;
  width: 100%;
}

/* В режиме tabs скрыть «аккордеонные» кнопки внутри панелей (дубли под рядом вкладок) */
.ts-main joomla-tab[view="tabs"] joomla-tab-element > button[role="tab"],
.ts-main joomla-tab[view="tabs"] > joomla-tab-element > button,
.edit.item-page joomla-tab[view="tabs"] joomla-tab-element > button[role="tab"],
form[name="adminForm"] joomla-tab[view="tabs"] joomla-tab-element > button[role="tab"] {
  display: none !important;
}

.com-content-form .tab-content,
.edit.item-page .tab-content {
  padding-top: 0.75rem;
}

/*
 * Нижняя часть формы: диалоги версий не должны «вылезать» в поток,
 * поле «Версии» — одна кнопка, XTD уже выше.
 */
.ts-main joomla-dialog:not([open]),
.edit.item-page joomla-dialog:not([open]),
form[name="adminForm"] joomla-dialog:not([open]),
.com-content-form joomla-dialog:not([open]) {
  display: none !important;
}

.ts-main .modal:not(.show),
.edit.item-page .modal:not(.show),
form[name="adminForm"] .modal:not(.show),
.com-content-form .modal:not(.show) {
  display: none !important;
}

/* Поле Versions / contenthistory — одна кнопка, не на всю ширину */
.com-content-form button[data-joomla-dialog],
.edit.item-page button[data-joomla-dialog],
form[name="adminForm"] button[data-joomla-dialog],
.com-content-form .control-group button[data-joomla-dialog],
.edit.item-page .control-group button[data-joomla-dialog] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: flex-start !important;
  width: auto !important;
  max-width: 100%;
  min-height: 2.35rem !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0.4rem 0.9rem !important;
  gap: 0.4rem !important;
  white-space: nowrap;
}

/* Иконка ветки версий (icomoon → FA, если icomoon не подключён на фронте) */
.com-content-form .icon-code-branch,
.edit.item-page .icon-code-branch,
form[name="adminForm"] .icon-code-branch,
.ts-main .icon-code-branch {
  display: inline-block !important;
  width: 1em !important;
  height: 1em !important;
  font-style: normal;
  line-height: 1 !important;
  speak: never;
}

.com-content-form .icon-code-branch::before,
.edit.item-page .icon-code-branch::before,
form[name="adminForm"] .icon-code-branch::before,
.ts-main .icon-code-branch::before {
  content: "\f126" !important;
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
}

/* Кнопки внутри control-group (не Save-тулбар) — не растягивать на 100% колонкой */
.com-content-form .control-group .controls:has(> button),
.com-content-form .control-group .controls:has(> .btn),
.edit.item-page .control-group .controls:has(> button),
form[name="adminForm"] .control-group .controls:has(> button) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.com-content-form .control-group .controls > button,
.com-content-form .control-group .controls > .btn,
.edit.item-page .control-group .controls > button,
.edit.item-page .control-group .controls > .btn,
form[name="adminForm"] .control-group .controls > button,
form[name="adminForm"] .control-group .controls > .btn {
  width: auto !important;
  max-width: 100%;
  flex: 0 0 auto;
}

/* —— NextFlexContact: do not inherit template form/button chrome —— */
.nfc-form-wrap input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.nfc-form-wrap select,
.nfc-form-wrap textarea,
.nfc-form-wrap .nfc-editor {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  box-shadow: none;
}

.nfc-form-wrap input::placeholder,
.nfc-form-wrap textarea::placeholder {
  color: inherit;
  opacity: 0.55;
  font-weight: inherit;
}

.nfc-form-wrap input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
.nfc-form-wrap select:focus,
.nfc-form-wrap textarea:focus,
.nfc-form-wrap .nfc-editor:focus-within {
  outline: 0;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.nfc-form-wrap .nfc-editor-toolbar button,
.nfc-form-wrap .nfc-editor .nfc-editor-toolbar button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: none !important;
  padding: 0 !important;
  gap: 0 !important;
  border: 1px solid currentColor !important;
  border-radius: 4px !important;
  background: transparent !important;
  color: inherit !important;
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  line-height: normal !important;
  cursor: pointer;
  box-shadow: none !important;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nfc-form-wrap .nfc-editor-toolbar button:hover,
.nfc-form-wrap .nfc-editor-toolbar button:focus {
  background: rgba(127, 127, 127, 0.15) !important;
  color: inherit !important;
  border-color: currentColor !important;
}

.nfc-form-wrap .nfc-editor-toolbar button.is-active {
  background: #0d6efd !important;
  border-color: #0d6efd !important;
  color: #fff !important;
}

.nfc-form-wrap .nfc-editor-toolbar svg,
.nfc-form-wrap .nfc-editor .nfc-editor-toolbar svg {
  width: 18px !important;
  height: 18px !important;
  max-width: none !important;
  max-height: none !important;
  fill: currentColor;
  pointer-events: none;
}

.nfc-form-wrap .nfc-captcha-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-height: auto !important;
  max-width: 100% !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: inherit !important;
  font: inherit !important;
  font-weight: inherit !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  box-shadow: none !important;
}

/* Smart Search (com_finder) — input-group layout + advanced panel */
.com-finder.finder {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  overflow: visible;
}

.com-finder.finder > h1:first-child {
  margin: 0 0 1.15rem !important;
  border-radius: var(--radius-sm, 4px) var(--radius-sm, 4px) 0 0 !important;
}

.com-finder fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
  min-width: 0;
  background: transparent;
  box-shadow: none;
}

.com-finder .form-inline {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}

.com-finder .form-inline > label {
  display: block;
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
}

.com-finder .input-group {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
  max-width: 42rem;
  gap: 0;
  position: relative;
}

.com-finder .input-group > .form-control {
  flex: 1 1 12rem;
  width: auto !important;
  min-width: 0;
  margin: 0 !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  position: relative;
  z-index: 1;
}

.com-finder .input-group > .btn {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.4rem;
  margin: 0 0 0 -1px !important;
  border-radius: 0 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  white-space: nowrap;
  position: relative;
  z-index: 2;
}

.com-finder .input-group > .btn:last-child {
  border-top-right-radius: var(--radius-sm, 4px) !important;
  border-bottom-right-radius: var(--radius-sm, 4px) !important;
}

/* Одна иконка: FA <i> ИЛИ icomoon, не оба */
.com-finder .input-group > .btn > .fa-solid,
.com-finder .input-group > .btn > .fa-regular {
  display: inline-block !important;
  width: 1em !important;
  height: 1em !important;
  margin: 0;
  font-size: 1em !important;
  line-height: 1 !important;
  flex-shrink: 0;
}

.com-finder .input-group > .btn:has(> .fa-solid) > [class^="icon-"],
.com-finder .input-group > .btn:has(> .fa-solid) > [class*=" icon-"],
.com-finder .input-group > .btn:has(> .fa-regular) > [class^="icon-"],
.com-finder .input-group > .btn:has(> .fa-regular) > [class*=" icon-"] {
  display: none !important;
}

.com-finder .input-group > .btn .icon-search,
.com-finder .input-group > .btn .icon-search-plus {
  display: inline-block !important;
  width: 1em !important;
  height: 1em !important;
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-style: normal;
  speak: never;
  line-height: 1 !important;
}

.com-finder .input-group > .btn .icon-search::before,
.com-finder .input-group > .btn .icon-search:before {
  content: "\f002" !important;
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
}

.com-finder .input-group > .btn .icon-search-plus::before,
.com-finder .input-group > .btn .icon-search-plus:before {
  content: "\f00e" !important;
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
}

.com-finder .input-group > .btn .icon-white {
  color: inherit !important;
}

@media (max-width: 560px) {
  .com-finder .input-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .com-finder .input-group > .form-control,
  .com-finder .input-group > .btn,
  .com-finder .input-group > .btn:last-child {
    width: 100% !important;
    margin-left: 0 !important;
    border-radius: var(--radius-sm, 4px) !important;
  }
}

.com-finder #advancedSearch.collapse:not(.show) {
  display: none !important;
}

.com-finder #advancedSearch.collapse.show {
  display: block !important;
}

.com-finder__advanced {
  margin-top: 0.35rem;
  padding: 1rem 1.1rem 1.15rem;
  border: 1px solid color-mix(in srgb, var(--tempcolor, #3d4f8f) 16%, #fff);
  border-radius: var(--radius-sm, 4px);
  background: color-mix(in srgb, var(--tempcolor, #3d4f8f) 4%, #fff);
}

.com-finder__filter-heading {
  margin: 0 0 0.95rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tempcolor-dark, #2a3558);
}

.com-finder__filter-empty {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--tempaccentcolor, #c26d2d);
  background: var(--tempcolor-soft, #eef1f8);
  color: var(--text-muted, #4a5568);
}

/* Даты: две колонки; внутри каждой — подпись, затем «До» + поле в одну строку */
.com-finder__filter ul.filter-date-list,
.com-finder__filter .filter-date-list,
.com-finder__filter ul:has(> .filter-date) {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: grid;
  gap: 0.85rem 1.15rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .com-finder__filter ul.filter-date-list,
  .com-finder__filter .filter-date-list,
  .com-finder__filter ul:has(> .filter-date) {
    grid-template-columns: 1fr 1fr;
  }
}

.com-finder__filter .filter-date {
  display: grid !important;
  grid-template-columns: 5.5rem minmax(11rem, 1fr);
  grid-template-rows: auto auto;
  align-items: stretch;
  column-gap: 0.5rem;
  row-gap: 0.4rem;
  margin: 0;
  min-width: 0;
}

.com-finder__filter .filter-date > label[for^="filter_date"],
.com-finder__filter .filter-date > label.hasTooltip {
  grid-column: 1 / -1;
  display: block;
  margin: 0;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--tempcolor, #3d4f8f);
}

/* Скрыть служебную подпись оператора — смысл уже в select */
.com-finder__filter .filter-date label[for^="finder-filter-w"],
.com-finder__filter .filter-date label.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Убрать <br> между оператором и календарём, если Joomla их вставляет */
.com-finder__filter .filter-date > br {
  display: none !important;
}

.com-finder__filter .filter-date .filter-date-operator,
.com-finder__filter .filter-date select.filter-date-operator,
.com-finder__filter .filter-date .form-select.filter-date-operator {
  grid-column: 1;
  grid-row: 2;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: var(--control-min-h, 2.35rem) !important;
  height: var(--control-min-h, 2.35rem) !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.com-finder__filter .filter-date .field-calendar,
.com-finder__filter .filter-date .input-append,
.com-finder__filter .filter-date joomla-field-calendar {
  grid-column: 2;
  grid-row: 2;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  box-sizing: border-box;
}

.com-finder__filter .filter-date .field-calendar .input-group,
.com-finder__filter .filter-date .field-calendar .input-append,
.com-finder__filter .filter-date joomla-field-calendar .input-group {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: var(--control-min-h, 2.35rem) !important;
}

.com-finder__filter .filter-date .field-calendar .form-control,
.com-finder__filter .filter-date .field-calendar input:not([type="hidden"]),
.com-finder__filter .filter-date input.form-control,
.com-finder__filter .filter-date input[type="text"],
.com-finder__filter .filter-date input[type="date"] {
  flex: 1 1 auto !important;
  width: 1% !important;
  min-width: 9.5rem !important;
  max-width: none !important;
  min-height: var(--control-min-h, 2.35rem) !important;
  height: var(--control-min-h, 2.35rem) !important;
  margin: 0 !important;
  padding-inline: 0.65rem !important;
  box-sizing: border-box !important;
}

.com-finder__filter .filter-date .field-calendar button,
.com-finder__filter .filter-date .field-calendar .btn,
.com-finder__filter .filter-date .input-append .btn,
.com-finder__filter .filter-date joomla-field-calendar button {
  flex: 0 0 2.6rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 2.6rem !important;
  min-width: 2.6rem !important;
  max-width: 2.6rem !important;
  min-height: var(--control-min-h, 2.35rem) !important;
  height: var(--control-min-h, 2.35rem) !important;
  margin: 0 0 0 -1px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  color: #fff !important;
}

/* Иконка календаря на кнопке (icomoon → FA) */
.ts-main .field-calendar .icon-calendar,
.com-finder .field-calendar .icon-calendar,
.com-content-form .field-calendar .icon-calendar,
.edit.item-page .field-calendar .icon-calendar,
form[name="adminForm"] .field-calendar .icon-calendar {
  display: inline-block !important;
  width: 1em !important;
  height: 1em !important;
  font-style: normal !important;
  line-height: 1 !important;
  speak: never;
  color: inherit !important;
}

.ts-main .field-calendar .icon-calendar::before,
.com-finder .field-calendar .icon-calendar::before,
.com-content-form .field-calendar .icon-calendar::before,
.edit.item-page .field-calendar .icon-calendar::before,
form[name="adminForm"] .field-calendar .icon-calendar::before {
  content: "\f073" !important;
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
}

@media (max-width: 420px) {
  .com-finder__filter .filter-date {
    grid-template-columns: 1fr;
  }

  .com-finder__filter .filter-date .filter-date-operator,
  .com-finder__filter .filter-date select.filter-date-operator,
  .com-finder__filter .filter-date .field-calendar,
  .com-finder__filter .filter-date joomla-field-calendar {
    grid-column: 1;
    grid-row: auto;
  }
}

/*
 * Попап календаря Joomla (.js-calendar):
 * не обрезать низ (Очистить / Закрыть), не навязывать chrome шаблона.
 */
.com-finder__advanced,
.com-finder__filter,
.com-finder__filter .filter-date,
.com-finder__filter .field-calendar,
.com-finder .field-calendar,
.ts-main .field-calendar {
  overflow: visible !important;
}

.ts-main .js-calendar,
body > .js-calendar,
.com-finder .js-calendar,
.field-calendar .js-calendar {
  /* display не трогаем — Joomla сама скрывает/показывает попап */
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
  z-index: 1200 !important;
}

.ts-main .js-calendar .calendar-container,
body > .js-calendar .calendar-container,
.com-finder .js-calendar .calendar-container {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
  padding-bottom: 0.35rem;
}

.ts-main .js-calendar table,
body > .js-calendar table {
  width: auto;
  max-width: 100%;
  border-collapse: separate;
  margin: 0 auto;
}

.ts-main .js-calendar td,
.ts-main .js-calendar th,
body > .js-calendar td,
body > .js-calendar th {
  text-align: center;
  vertical-align: middle;
}

/* Футер: Сегодня / Очистить / Закрыть — все видны в один ряд */
.ts-main .js-calendar .buttons-wrapper,
body > .js-calendar .buttons-wrapper,
.com-finder .js-calendar .buttons-wrapper {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.35rem !important;
  width: 100% !important;
  min-height: 2.5rem !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0.4rem 0.35rem 0.55rem !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

.ts-main .js-calendar .buttons-wrapper :is(button, .btn),
body > .js-calendar .buttons-wrapper :is(button, .btn),
.com-finder .js-calendar .buttons-wrapper :is(button, .btn) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 4.5rem !important;
  max-width: none !important;
  min-height: 2.1rem !important;
  height: 2.1rem !important;
  margin: 0 !important;
  padding: 0 0.55rem !important;
  border: 1px solid var(--tempcolor, #3d4f8f) !important;
  border-radius: 3px !important;
  background: var(--tempcolor, #3d4f8f) !important;
  color: #fff !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

.ts-main .js-calendar .buttons-wrapper :is(button, .btn):hover,
body > .js-calendar .buttons-wrapper :is(button, .btn):hover {
  background: var(--tempaccentcolor, #c26d2d) !important;
  border-color: var(--tempaccentcolor, #c26d2d) !important;
  color: #fff !important;
}

/* Навигация / дни внутри календаря — без «кнопочного» chrome шаблона */
.ts-main .js-calendar .calendar-head-row button,
.ts-main .js-calendar .calendar-head-row .btn,
body > .js-calendar .calendar-head-row button,
body > .js-calendar .calendar-head-row .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 1.75rem !important;
  min-height: 1.75rem !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0.15rem 0.35rem !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  box-shadow: none !important;
}

/* Таксономия: ровная сетка карточек-полей */
.com-finder__filter .filter-branch,
.com-finder__filter ul.filter-branch {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .com-finder__filter .filter-branch,
  .com-finder__filter ul.filter-branch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .com-finder__filter .filter-branch,
  .com-finder__filter ul.filter-branch {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.com-finder__filter .filter-branch > li {
  margin: 0;
  min-width: 0;
}

.com-finder__filter .filter-branch label {
  display: block;
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--tempcolor, #3d4f8f);
}

.com-finder__filter .filter-branch select,
.com-finder__filter .filter-branch .form-select,
.com-finder__filter .filter-branch .form-control {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.com-finder__filter select:not(.filter-date-operator),
.com-finder__filter input[type="date"],
.com-finder__filter .form-control:not(.filter-date-operator) {
  max-width: 100%;
}

.com-finder__syntax-tips {
  margin-top: 1rem;
  border: 1px solid color-mix(in srgb, var(--tempcolor, #3d4f8f) 18%, #fff);
  border-radius: var(--radius-sm, 4px);
  background: #fff;
}

.com-finder__syntax-tips > summary {
  cursor: pointer;
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  color: var(--tempcolor, #3d4f8f);
  list-style: none;
}

.com-finder__syntax-tips > summary::-webkit-details-marker {
  display: none;
}

.com-finder__syntax-tips[open] > summary {
  border-bottom: 1px solid color-mix(in srgb, var(--tempcolor, #3d4f8f) 12%, #fff);
}

.com-finder__syntax-tips .com-finder__tips {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.com-finder__syntax-tips .card-body {
  padding: 0.85rem 1rem 1rem;
  font-size: 0.95rem;
  line-height: 1.55;
}

.com-finder__syntax-tips .term {
  font-weight: 600;
  color: var(--tempcolor-dark, #2a3558);
}

/* Submit — template button chrome (.ts-main only) */

.ts-main .btn-primary,
.ts-main .btn-success,
.ts-main button.btn-primary,
.ts-main input.btn-primary {
  background: var(--tempcolor, #3d4f8f) !important;
  color: #fff !important;
  border-color: var(--tempcolor, #3d4f8f) !important;
}

.ts-main .btn-primary:hover,
.ts-main .btn-success:hover,
.ts-main button.btn-primary:hover,
.ts-main input.btn-primary:hover {
  background: var(--tempaccent-soft) !important;
  color: var(--tempaccentcolor, #c26d2d) !important;
  border-color: var(--tempaccentcolor, #c26d2d) !important;
}

.ts-main .btn-light {
  background: #fff !important;
  color: var(--tempcolor, #3d4f8f) !important;
  border-color: var(--tempcolor, #3d4f8f) !important;
}

.ts-main .btn-light:hover {
  background: var(--tempaccent-soft) !important;
  color: var(--tempaccentcolor, #c26d2d) !important;
  border-color: var(--tempaccentcolor, #c26d2d) !important;
}

.ts-main .btn-ghost,
.ts-main .btn-secondary {
  background: transparent !important;
  color: var(--tempcolor, #3d4f8f) !important;
  border-color: color-mix(in srgb, var(--tempcolor, #3d4f8f) 45%, #fff) !important;
}

.ts-main .btn-ghost:hover,
.ts-main .btn-secondary:hover {
  background: var(--tempaccent-soft) !important;
  color: var(--tempaccentcolor, #c26d2d) !important;
  border-color: var(--tempaccentcolor, #c26d2d) !important;
}

/* Password show/hide — Joomla field (Icomoon → FA eye) */
.password-group,
.ts-login__field .password-group,
.control-group .password-group,
.input-group:has(.input-password-toggle) {
  display: flex !important;
  align-items: stretch;
  width: 100%;
  gap: 0;
}

.password-group > input,
.password-group > .form-control,
.ts-login__field .password-group > input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.password-group .btn.input-password-toggle,
.password-group button.input-password-toggle,
.password-group .btn-secondary.input-password-toggle,
.input-group:has(.input-password-toggle) .btn.input-password-toggle,
.input-group:has(.input-password-toggle) button.input-password-toggle,
.input-group:has(.input-password-toggle) .btn-secondary.input-password-toggle {
  flex: 0 0 2.6rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 2.6rem !important;
  min-width: 2.6rem !important;
  max-width: 2.6rem !important;
  min-height: var(--control-min-h, 2.35rem) !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff !important;
  color: var(--tempcolor, #3d4f8f) !important;
  border: 1px solid var(--control-border, var(--ts-control-border)) !important;
  border-left: 0 !important;
  border-radius: 0 var(--radius-sm, 4px) var(--radius-sm, 4px) 0 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  font-size: 1rem !important;
  line-height: 1 !important;
  box-shadow: none !important;
}

.password-group .btn.input-password-toggle:hover,
.password-group button.input-password-toggle:hover,
.input-group:has(.input-password-toggle) .btn.input-password-toggle:hover,
.input-group:has(.input-password-toggle) button.input-password-toggle:hover {
  background: var(--tempaccent-soft) !important;
  color: var(--tempaccentcolor, #c26d2d) !important;
  border-color: var(--tempaccentcolor, #c26d2d) !important;
}

.password-group .input-password-toggle .icon-eye,
.password-group .input-password-toggle .icon-eye-slash,
.password-group .input-password-toggle [class^="icon-"],
.password-group .input-password-toggle [class*=" icon-"],
.input-group:has(.input-password-toggle) .input-password-toggle .icon-eye,
.input-group:has(.input-password-toggle) .input-password-toggle .icon-eye-slash,
.input-group:has(.input-password-toggle) .input-password-toggle [class^="icon-"],
.input-group:has(.input-password-toggle) .input-password-toggle [class*=" icon-"] {
  display: inline-block !important;
  width: 1.1rem !important;
  height: 1.1rem !important;
  max-width: 1.1rem !important;
  max-height: 1.1rem !important;
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-size: 1rem !important;
  line-height: 1.1rem !important;
  speak: never;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
}

.password-group .input-password-toggle .icon-eye::before,
.password-group .input-password-toggle .icon-eye:before,
.input-group:has(.input-password-toggle) .input-password-toggle .icon-eye::before,
.input-group:has(.input-password-toggle) .input-password-toggle .icon-eye:before {
  content: "\f06e" !important;
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
}

.password-group .input-password-toggle .icon-eye-slash::before,
.password-group .input-password-toggle .icon-eye-slash:before,
.input-group:has(.input-password-toggle) .input-password-toggle .icon-eye-slash::before,
.input-group:has(.input-password-toggle) .input-password-toggle .icon-eye-slash:before {
  content: "\f070" !important;
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
}

.btn-row,
.ts-login__actions,
.com-contact .controls,
.mod-login__submit,
.mod-login .mod-login__submit,
form .btn-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

/* Sidebar / custom modules: опрос, формы — одна кнопка до 240px, несколько в строку */
.module-box .mod-body form,
.mod-custom form,
.module-box .mod-body .btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
}

.module-box .mod-body form button:only-of-type,
.module-box .mod-body form input[type="submit"]:only-of-type,
.module-box .mod-body form input[type="button"]:only-of-type,
.module-box .mod-body form .btn:only-of-type,
.mod-custom form button:only-of-type,
.mod-custom form input[type="submit"]:only-of-type,
.mod-custom form input[type="button"]:only-of-type,
.module-box .mod-body .btn-row > *:only-child {
  width: 100%;
  max-width: 240px;
}

.module-box .mod-body form button:not(:only-of-type),
.module-box .mod-body form input[type="submit"]:not(:only-of-type),
.module-box .mod-body form input[type="button"]:not(:only-of-type),
.mod-custom form button:not(:only-of-type),
.mod-custom form input[type="submit"]:not(:only-of-type),
.mod-custom form input[type="button"]:not(:only-of-type) {
  width: auto;
  max-width: none;
  flex: 0 1 auto;
}

/* Footer login: обе кнопки на всю ширину, не сжимать из-за правила выше */
#footer .mod-login .mod-login__actions button,
#footer .mod-login .mod-login__actions .btn {
  width: 100% !important;
  max-width: none !important;
  flex: 1 1 auto;
}

/* —— Top utility bar: Joomla menus → .top-btn look —— */
#top-header {
  background-color: var(--tempcolor-dark);
}

.top-header-left ul,
.top-bar-menu {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.top-header-left > ul > li,
.top-bar-menu > li {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.top-header-left > a:not(.top-btn),
.top-header-left > ul > li > a:not(.top-btn),
.top-header-left > ul > li > .menu-item__hit:not(.top-btn),
.top-bar-menu > li > a:not(.top-btn),
.top-bar-menu > li > .menu-item__hit:not(.top-btn) {
  display: inline-flex;
  align-items: stretch;
  gap: 0.5rem;
  min-height: var(--control-min-h, 2.35rem);
  padding: 0.2rem var(--control-pad-x, 0.65rem) 0.2rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-sm, 4px);
  background: #fff;
  color: var(--tempcolor, #3d4f8f) !important;
  font-weight: 700;
  font-size: var(--control-font, 0.78rem);
  line-height: 1.15;
  text-decoration: none !important;
  text-transform: none;
  letter-spacing: normal;
}

.top-header-left a.top-btn,
.top-header-left .menu-item__hit.top-btn,
.top-bar-menu a.top-btn,
.top-bar-menu .menu-item__hit.top-btn {
  color: var(--tempcolor, #3d4f8f) !important;
}

.top-header-left a:hover,
.top-header-left a.top-btn:hover,
.top-header-left .menu-item__hit:hover,
.top-header-left .menu-item__hit.top-btn:hover,
.top-bar-menu a:hover,
.top-bar-menu .menu-item__hit:hover {
  background: var(--tempaccent-soft) !important;
  color: var(--tempaccentcolor, #c26d2d) !important;
  border-color: #fff !important;
}

.top-header-left a:hover i,
.top-bar-menu a:hover i {
  color: var(--tempaccentcolor, #c26d2d) !important;
}

.top-header-right .btn-search,
.top-header-right .site-search--header .btn-search {
  color: var(--tempcolor, #3d4f8f);
  height: 100% !important;
  min-height: 0 !important;
  padding-block: 0 !important;
  line-height: 1 !important;
}

.top-header-right .site-search--header .btn-search > i,
.top-header-right .site-search--header .btn-search > .fa-solid,
.site-search-toggle > i,
.site-search-toggle > .fa-solid,
.site-search-close > i,
.site-search-close > .fa-solid {
  width: 1.35rem !important;
  height: 1.35rem !important;
  max-width: 1.35rem !important;
  max-height: 1.35rem !important;
  font-size: 1.35rem !important;
  vertical-align: middle !important;
  margin: 0 !important;
}

.mid-header,
#midle-header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--mid-header-bg, #f5f7fa);
}

.mid-header-grid {
  padding-block: 0.65rem 0.75rem !important;
  min-height: 0 !important;
  gap: 0.85rem 1.5rem !important;
}

.mid-header-grid.mid-header-grid--no-logo {
  min-height: 160px !important;
  align-items: center;
  align-content: center;
}

.mid-header::before,
#midle-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.mid-header:not(.mid-header--has-image)::before,
#midle-header:not(.mid-header--has-image)::before {
  content: none;
}

.mid-header--has-image::before,
#midle-header.mid-header--has-image::before {
  background: linear-gradient(
    105deg,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(255, 255, 255, 0.45) 42%,
    rgba(255, 255, 255, 0.08) 72%,
    transparent 100%
  );
}

.mid-header::after,
#midle-header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.mid-header:not(.mid-header--has-image)::after,
#midle-header:not(.mid-header--has-image)::after {
  background: linear-gradient(
    180deg,
    transparent 75%,
    color-mix(in srgb, var(--tempcolor) 4%, #ffffff) 100%
  );
}

@media (max-width: 640px) {
  .mid-header:not(.mid-header--has-image),
  #midle-header:not(.mid-header--has-image) {
    background-size: 280px auto, 280px auto, 48% 100%, auto !important;
    background-position: -32px 100%, calc(100% + 20px) 100%, 100% 0, center !important;
  }
}

.mid-header--has-image::after,
#midle-header.mid-header--has-image::after {
  background: linear-gradient(
    180deg,
    transparent 60%,
    rgba(255, 255, 255, 0.25) 100%
  );
}

.mid-header--has-image .site-slogan,
.mid-header--has-image .site-title,
.mid-header--has-image .site-title a,
.mid-header--has-image .layout-contacts .contact-link,
.mid-header--has-image .layout-contacts .contact-link span {
  text-shadow:
    0 1px 3px rgba(255, 255, 255, 0.75),
    0 0 10px rgba(255, 255, 255, 0.55);
}

.mid-header > *,
#midle-header > * {
  position: relative;
  z-index: 1;
}

.site-logo {
  display: block;
  width: 160px !important;
  height: 160px !important;
  max-width: 160px !important;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(5, 60, 85, 0.15));
}

.site-slogan {
  color: var(--slogan-color, var(--tempaccentcolor, #c26d2d));
}

.site-title,
.site-title a {
  color: var(--title-color, inherit);
}

.site-title a:hover {
  color: var(--tempaccentcolor, #c26d2d) !important;
}

.layout-contacts .contact-link:hover,
.layout-contacts .contact-link:hover span {
  color: var(--tempaccentcolor, #c26d2d) !important;
}

.layout-contacts .fa-solid,
.layout-contacts i {
  color: var(--tempcolor, #3d4f8f);
}

/* Content shell */
.wrap-content {
  width: 100%;
  max-width: var(--sheet-max, 1340px);
  margin-inline: auto;
  padding-inline: var(--sheet-pad, 1rem);
  padding-bottom: 1.25rem;
}

.ts-top-row,
.ts-bottom-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-block: 1rem;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width, 300px);
  grid-template-areas: "content sidebar";
  gap: 1.25rem;
  align-items: start;
  margin-block: 1rem;
}

.content-layout > .u-content {
  grid-area: content;
}

.content-layout > .sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-self: start;
}

.content-layout.sidebar-left {
  grid-template-columns: var(--sidebar-width, 300px) minmax(0, 1fr);
  grid-template-areas: "sidebar content";
}

.content-layout.no-sidebar {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "content";
}

.content-layout .sidebar,
.content-layout .u-content,
.content-layout .ts-main {
  min-width: 0;
}

.ts-main-pos {
  margin-top: 0.75rem;
}

/* —— Headings / module titles (Joomla markup variants) —— */
.module-box:not(.module-box--footer) .mod-title,
.module:not(.module-box) > h3,
.module:not(.module-box) > h2,
.moduletable > h3,
.moduletable > h2,
aside.sidebar .page-header h3,
.ts-main .page-header > h1,
.ts-main .page-header > h2,
.blog .page-header h1,
.blog .page-header h2,
.page-header > h1,
.page-header > h2,
.page-heading,
.article > h1,
.article .page-heading,
.category-blog__head h1,
.category-blog__head h2,
.category-list__head h1,
.category-list__head h2,
.ts-login__head h1,
.com-users h1,
.com-users .page-header h1 {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.95rem !important;
  background: var(--tempcolor, #3d4f8f) !important;
  color: #fff !important;
  font-family: var(--font-display, var(--ts-font-display)) !important;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem) !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  border: 0 !important;
  border-radius: var(--ts-radius-sm, 4px) var(--ts-radius-sm, 4px) 0 0;
  text-transform: none !important;
  letter-spacing: normal !important;
}

.module-box:not(.module-box--footer) .mod-title {
  margin: 0 !important;
  border-radius: 0 !important;
}

.article > h1,
.article .page-heading,
.ts-component--ext > .page-heading,
.ts-login > .ts-login__head .page-heading,
.com-finder.finder > h1:first-child,
.contact > h1:first-child {
  margin: 0 -1.75rem 1.15rem !important;
  border-radius: var(--ts-radius-sm, 4px) var(--ts-radius-sm, 4px) 0 0 !important;
}

/* Menu-driven components (OSMap sitemap, etc.) */
.ts-component-body > *:first-child,
.ts-ext-body > *:first-child {
  margin-top: 0;
}

.ts-component-body ul {
  margin: 0 0 0.75rem 1.15rem;
  padding: 0;
  list-style: disc;
}

.ts-component-body li {
  margin: 0.2rem 0;
}

/* —— Article / editor content typography (Joomla body) —— */
.article-body,
.item-page .article-body,
.fr-view,
.blog-card__intro {
  color: var(--text, #1a2a33);
  font-family: var(--font-ui, var(--ts-font-ui));
  font-size: 1rem;
  line-height: 1.6;
}

.article-body > *:first-child,
.fr-view > *:first-child {
  margin-top: 0;
}

.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6,
.item-page .article-body h2,
.item-page .article-body h3,
.item-page .article-body h4,
.fr-view h2,
.fr-view h3,
.fr-view h4 {
  display: block !important;
  margin: 1.25rem 0 0.55rem !important;
  padding: 0 !important;
  background: transparent !important;
  color: var(--text, #1a2a33) !important;
  border: 0 !important;
  border-radius: 0 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  font-family: var(--font-display, var(--ts-font-display)) !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}

.article-body h2,
.fr-view h2 {
  font-size: clamp(1.2rem, 1.8vw, 1.4rem) !important;
}

.article-body h3,
.fr-view h3 {
  font-size: 1.12rem !important;
}

.article-body h4,
.article-body h5,
.article-body h6,
.fr-view h4 {
  font-family: var(--font-ui, var(--ts-font-ui)) !important;
  font-size: 1rem !important;
}

.article-body p,
.fr-view p {
  margin: 0 0 1rem;
  color: inherit;
}

.article-body ul,
.article-body ol,
.fr-view ul,
.fr-view ol {
  margin: 0 0 1rem 1.25rem !important;
  padding: 0 !important;
  color: inherit;
}

.article-body ul,
.fr-view ul {
  list-style: disc !important;
}

.article-body ol,
.fr-view ol {
  list-style: decimal !important;
}

.article-body li,
.fr-view li {
  margin-bottom: 0.35rem;
  line-height: 1.55;
}

.article-body a,
.fr-view a {
  color: var(--tempaccentcolor, #c26d2d);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body blockquote,
.fr-view blockquote {
  margin: 1.15rem 0;
  padding: 0.85rem 1rem 0.85rem 1.15rem;
  border-left: 4px solid var(--tempaccentcolor, #c26d2d);
  background: color-mix(in srgb, var(--tempaccent-soft, #f7ebe3) 55%, #fff);
  border-radius: 0 4px 4px 0;
}

.article-body hr,
.fr-view hr {
  margin: 1.35rem 0;
  border: 0;
  border-top: 1px solid var(--border, #d8e2e8);
}

.article-body table,
.item-page table,
.fr-view table,
.mod-body table,
.module-box .mod-body table {
  width: 100% !important;
  max-width: 100%;
  margin: 0 0 1rem !important;
  border-collapse: collapse !important;
  empty-cells: show;
  font-size: 0.9rem;
  background: #fff;
}

.article-body table th,
.article-body table td,
.item-page table th,
.item-page table td,
.fr-view table th,
.fr-view table td,
.mod-body table th,
.mod-body table td {
  padding: 0.55rem 0.75rem !important;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--border, #d8e2e8) !important;
  color: var(--text, #1a2a33) !important;
  background: transparent;
}

.article-body table th,
.item-page table th,
.fr-view table th,
.mod-body table th {
  background: var(--tempcolor-soft) !important;
  color: var(--tempcolor, #3d4f8f) !important;
  font-weight: 700 !important;
}

.article-body table tr:nth-child(even) td,
.item-page table tr:nth-child(even) td,
.fr-view table tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-alt, #f4f7f9) 70%, #fff);
}

.category-blog__head,
.category-list__head {
  margin: 0 0 0.85rem;
}

.category-blog__head h1,
.category-blog__head h2,
.category-list__head h1,
.category-list__head h2 {
  margin: 0 !important;
}

.module-box {
  background: #fff;
  border: 1px solid var(--ts-border, #d8e2e8);
  border-radius: var(--ts-radius, 6px);
  overflow: hidden;
  box-shadow: var(--ts-shadow);
}

.module-box--footer,
#footer .module-box,
.site-footer .module-box {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  margin: 0 0 1rem;
}

#footer .footer-heading,
#footer .mod-title,
#footer h3.mod-title,
#footer h3.footer-heading,
#footer .module-box .mod-title,
#footer .module-box--footer > h3,
.site-footer .footer-heading,
.site-footer .mod-title,
.site-footer .module-box .mod-title,
.site-footer .module-box--footer > h3,
.site-footer h3.mod-title,
.site-footer h3.footer-heading {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 0 0 0.85rem !important;
  padding: 0 0 0.5rem !important;
  background: transparent !important;
  color: #fff !important;
  font-family: var(--font-ui, var(--ts-font-ui)) !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.02em !important;
  text-transform: uppercase !important;
  border: 0 !important;
  border-bottom: 2px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 0 !important;
  text-shadow: none !important;
}

#footer .mod-body,
.site-footer .module-box .mod-body {
  padding: 0 !important;
  color: #fff;
}

#footer .footer-links,
#footer ul.menu,
#footer .mod-menu,
#footer .nav.menu,
#footer .nav {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

#footer .footer-links li,
#footer ul.menu li,
#footer .nav li {
  margin: 0;
  padding: 0;
  list-style: none;
}

#footer .footer-links a,
#footer .footer-links .menu-item__hit,
#footer ul.menu a,
#footer ul.menu .menu-item__hit,
#footer .mod-menu a,
#footer .mod-menu .menu-item__hit,
#footer .nav a,
#footer .nav .menu-item__hit {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  background: transparent !important;
  border: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

#footer .footer-links a:hover,
#footer .footer-links .menu-item__hit:hover,
#footer ul.menu a:hover,
#footer ul.menu .menu-item__hit:hover,
#footer .nav a:hover,
#footer .nav .menu-item__hit:hover {
  color: #fff !important;
  opacity: 0.85;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

#footer .mod-menu a:hover,
#footer .mod-menu .menu-item__hit:hover {
  color: #fff !important;
  opacity: 0.85;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

/* Generic Joomla menu module (fallback layout) */
.nav.menu .menu-item__hit,
.nav.menu a.menu-item__hit {
  display: block;
  padding: 0.45rem 0.65rem;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.35;
}

.nav.menu li.is-separator > .menu-item__hit:not(.menu-item__hit--empty),
.nav.menu li.is-heading > .menu-item__hit:not(.menu-item__hit--empty),
.nav.menu li.divider > .menu-item__hit:not(.menu-item__hit--empty) {
  cursor: pointer;
}

#footer .footer-links i,
#footer .footer-links .fa-solid,
#footer .footer-links .fa-regular,
#footer .footer-links .fa,
#footer ul.menu i,
#footer ul.menu .fa-solid,
#footer .nav i {
  width: 1.1rem !important;
  height: 1.1rem !important;
  max-width: 1.1rem !important;
  max-height: 1.1rem !important;
  font-size: 1rem !important;
  line-height: 1 !important;
  flex-shrink: 0;
  opacity: 0.95;
}

#footer .footer-links img,
#footer ul.menu img,
#footer .nav img {
  width: 1.1rem !important;
  height: 1.1rem !important;
  max-width: 1.1rem !important;
  max-height: 1.1rem !important;
  object-fit: contain;
  flex-shrink: 0;
}

#footer .footer-brand__logo img.site-logo {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 200px !important;
  object-fit: contain;
  background: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: none !important;
}

#footer .footer-brand__logo svg.site-logo {
  display: block !important;
  width: auto !important;
  height: 200px !important;
  max-width: 100% !important;
  max-height: 200px !important;
  background: none !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

#footer .footer-brand__logo svg.site-logo--default {
  filter: brightness(0) invert(1) !important;
}

/* Card grids: one frame level (.blog-card only), no outer panel */
.module-box--articles,
.module-box:has(.category-blog--module),
.category-blog.category-blog--page,
.category-blog.category-blog--featured,
.category-blog.category-blog--module {
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
  padding: 0;
}

.module-box--articles .mod-title,
.module-box:has(.category-blog--module) .mod-title {
  margin: 0 0 0.85rem !important;
  border-radius: var(--radius-sm, 4px) var(--radius-sm, 4px) 0 0 !important;
}

.module-box--articles .mod-body,
.module-box:has(.category-blog--module) .mod-body {
  padding: 0 !important;
}

.module-box .category-blog--module,
.category-blog--module {
  margin: 0;
}

.module-box .category-blog--module .category-blog__grid,
.category-blog--module .category-blog__grid {
  display: grid;
  grid-template-columns: repeat(var(--blog-cols, 2), minmax(0, 1fr));
  gap: 0.85rem;
}

.module-box .category-blog--module.category-blog--layout-vert .category-blog__grid,
.category-blog--module.category-blog--layout-vert .category-blog__grid,
.module-box .category-blog--module.category-blog--cols-1 .category-blog__grid,
.category-blog--module.category-blog--cols-1 .category-blog__grid {
  grid-template-columns: 1fr;
}

.module-box .category-blog--module.category-blog--layout-hor.category-blog--cols-2 .category-blog__grid,
.category-blog--module.category-blog--layout-hor.category-blog--cols-2 .category-blog__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.module-box .category-blog--module.category-blog--layout-hor.category-blog--cols-3 .category-blog__grid,
.category-blog--module.category-blog--layout-hor.category-blog--cols-3 .category-blog__grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-box .category-blog--module.category-blog--layout-hor.category-blog--cols-4 .category-blog__grid,
.category-blog--module.category-blog--layout-hor.category-blog--cols-4 .category-blog__grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.module-box .category-blog--module .blog-card,
.category-blog--module .blog-card {
  height: 100%;
}

.category-blog--module .category-blog__all {
  margin: 0.9rem 0 0;
  text-align: right;
}

.category-blog--page .category-blog__grid,
.category-blog--featured .category-blog__grid {
  display: grid;
  grid-template-columns: repeat(var(--blog-cols, 1), minmax(0, 1fr));
  gap: 0.85rem;
}

.category-blog--page .category-blog__grid--down,
.category-blog--featured .category-blog__grid--down {
  display: block;
  column-count: var(--blog-cols, 1);
  column-gap: 0.85rem;
}

/* Планшет: на 1 колонку меньше, чем в настройках Joomla (адаптив только в шаблоне) */
@media (min-width: 641px) and (max-width: 991px) {
  .module-box .category-blog--module.category-blog--layout-hor.category-blog--cols-4 .category-blog__grid,
  .category-blog--module.category-blog--layout-hor.category-blog--cols-4 .category-blog__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .module-box .category-blog--module.category-blog--layout-hor.category-blog--cols-3 .category-blog__grid,
  .category-blog--module.category-blog--layout-hor.category-blog--cols-3 .category-blog__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-box .category-blog--module.category-blog--layout-hor.category-blog--cols-2 .category-blog__grid,
  .category-blog--module.category-blog--layout-hor.category-blog--cols-2 .category-blog__grid {
    grid-template-columns: 1fr;
  }

  .category-blog--cols-4 .category-blog__grid,
  .category-blog--page.category-blog--cols-4 .category-blog__grid,
  .category-blog--featured.category-blog--cols-4 .category-blog__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .category-blog--cols-3 .category-blog__grid,
  .category-blog--page.category-blog--cols-3 .category-blog__grid,
  .category-blog--featured.category-blog--cols-3 .category-blog__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-blog--cols-2 .category-blog__grid,
  .category-blog--page.category-blog--cols-2 .category-blog__grid,
  .category-blog--featured.category-blog--cols-2 .category-blog__grid {
    grid-template-columns: 1fr;
  }

  .category-blog--cols-4 .category-blog__grid--down,
  .category-blog--page.category-blog--cols-4 .category-blog__grid--down,
  .category-blog--featured.category-blog--cols-4 .category-blog__grid--down {
    column-count: 3;
  }

  .category-blog--cols-3 .category-blog__grid--down,
  .category-blog--page.category-blog--cols-3 .category-blog__grid--down,
  .category-blog--featured.category-blog--cols-3 .category-blog__grid--down {
    column-count: 2;
  }

  .category-blog--cols-2 .category-blog__grid--down,
  .category-blog--page.category-blog--cols-2 .category-blog__grid--down,
  .category-blog--featured.category-blog--cols-2 .category-blog__grid--down {
    column-count: 1;
  }
}

@media (max-width: 640px) {
  .module-box .category-blog--module:not(.has-news-slider) .category-blog__grid,
  .category-blog--module:not(.has-news-slider) .category-blog__grid,
  .category-blog--page .category-blog__grid,
  .category-blog--featured .category-blog__grid {
    grid-template-columns: 1fr;
  }

  .category-blog--page .category-blog__grid--down,
  .category-blog--featured .category-blog__grid--down {
    column-count: 1;
  }
}

/* Legacy chrome without .module-box */
.moduletable,
.module:not(.module-box) {
  background: #fff;
  border: 1px solid var(--ts-border, #d8e2e8);
  border-radius: var(--ts-radius, 6px);
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: var(--ts-shadow);
}

.moduletable > h3 + *,
.module > h3 + * {
  padding: 1rem;
}

/* Pagination */
.ts-pagination {
  margin: 1.5rem 0 0;
}

.ts-pagination__list,
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ts-pagination__list a,
.ts-pagination__list span,
.pagination .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--ts-border);
  border-radius: var(--ts-radius-sm);
  color: var(--tempcolor, #3d4f8f);
  text-decoration: none;
  background: #fff;
}

.ts-pagination__list li.active span,
.ts-pagination__list li.active a,
.pagination li.active .page-link {
  background: var(--tempcolor, #3d4f8f);
  border-color: var(--tempcolor, #3d4f8f);
  color: #fff;
}

.ts-pagination__list a:hover,
.pagination .page-link:hover {
  border-color: var(--tempaccentcolor, #c26d2d);
  color: var(--tempaccentcolor, #c26d2d);
}

/* Login */
.ts-login,
.ts-logout {
  max-width: none;
  margin: 0;
}

.ts-login__form,
.ts-logout form {
  max-width: 28rem;
}

.ts-login__field,
.ts-login__remember {
  margin-bottom: 0.85rem;
}

.ts-login__field label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.ts-login__remember label {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.45rem;
  margin: 0 !important;
  white-space: nowrap;
  cursor: pointer;
}

.ts-login__remember input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.05rem !important;
  height: 1.05rem !important;
  margin: 0 !important;
}

.ts-login__field input[type="text"],
.ts-login__field input[type="password"],
.ts-login__field input[type="email"] {
  width: 100%;
}

.ts-login__links {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

/* Footer */
#footer {
  background: var(--tempcolor, #3d4f8f);
  color: #fff;
}

#footer a {
  color: #fff;
}

#footer .btn-ghost,
#footer .btn-secondary,
#footer button.btn-ghost {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.65) !important;
}

#footer .btn-ghost:hover,
#footer .btn-secondary:hover {
  background: var(--tempaccent-soft) !important;
  color: var(--tempaccentcolor, #c26d2d) !important;
  border-color: var(--tempaccentcolor, #c26d2d) !important;
}

#footer .btn:not(.btn-ghost):not(.btn-secondary),
#footer .btn-light,
#footer .btn-primary,
#footer input[type="submit"],
#footer button[type="submit"],
#footer .button {
  background: #fff !important;
  color: var(--tempcolor, #3d4f8f) !important;
  border: 1.5px solid #fff !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

#footer .btn:not(.btn-ghost):not(.btn-secondary):hover,
#footer .btn-light:hover,
#footer .btn-primary:hover,
#footer input[type="submit"]:hover,
#footer button[type="submit"]:hover,
#footer .button:hover {
  background: var(--tempaccent-soft) !important;
  color: var(--tempaccentcolor, #c26d2d) !important;
  border-color: var(--tempaccentcolor, #c26d2d) !important;
}

#footer form,
#footer .mod-login,
[data-position^="footer"] form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

/* Footer login — компактный WebAuthn + крупная «Войти» */
#footer .mod-login.footer-auth .mod-login__actions,
#footer .footer-auth .mod-login__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.25rem;
}

#footer .mod-login .mod-login__submit,
#footer .mod-login .mod-login__submit--extra,
#footer .mod-login .mod-login__submit--primary {
  margin-bottom: 0 !important;
  width: 100%;
}

#footer .mod-login .mod-login__submit button,
#footer .mod-login .mod-login__actions .btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100% !important;
  max-width: none !important;
  min-height: var(--control-min-h, 2.35rem);
  padding: 0.5rem 0.85rem;
  font-family: var(--font-ui, var(--ts-font-ui));
  font-size: var(--control-font, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-transform: uppercase;
  box-sizing: border-box;
}

#footer .mod-login .mod-login__webauthn,
#footer .mod-login .plg_system_webauthn_login_button {
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: normal;
}

#footer .mod-login .mod-login__webauthn-icon,
.mod-login .mod-login__webauthn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
}

#footer .mod-login .mod-login__webauthn-icon img,
.mod-login .mod-login__webauthn-icon img,
.mod-login .plg_system_webauthn_login_button img {
  width: 1.15rem !important;
  height: 1.15rem !important;
  max-width: 1.15rem !important;
  max-height: 1.15rem !important;
  margin: 0 !important;
  display: block !important;
  object-fit: contain;
}

#footer .mod-login .mod-login__webauthn-icon img,
#footer .mod-login .plg_system_webauthn_login_button img {
  filter: brightness(0) invert(1);
}

#footer .mod-login .mod-login__webauthn-label {
  text-align: left;
  line-height: 1.2;
}

#footer .mod-login button[type="submit"],
#footer .mod-login .mod-login__submit--primary .btn-light {
  min-height: 2.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}

#footer .mod-login__options,
#footer .mod-login .auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
}

#footer .mod-login__options a,
#footer .mod-login .auth-links a {
  color: #fff !important;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  text-transform: none;
  font-weight: 500;
}

#footer form label,
[data-position^="footer"] form label {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Cookie */
.cookie-banner,
#cookie-banner {
  font-family: var(--ts-font-ui);
}

.cookie-banner__logo {
  display: block;
  width: 5.75rem;
  height: 5.75rem;
  color: var(--tempcolor, #3d4f8f);
  fill: currentColor;
  flex-shrink: 0;
  object-fit: contain;
}

button.cookie-banner-button,
.cookie-banner-button {
  background: var(--tempcolor-soft);
  color: var(--tempcolor, #3d4f8f);
  border: 1.5px solid color-mix(in srgb, var(--tempcolor, #3d4f8f) 45%, var(--border, #d8e2e8));
  box-shadow: none;
}

button.cookie-banner-button:hover,
.cookie-banner-button:hover {
  background: var(--tempaccent-soft);
  color: var(--tempaccentcolor, #c26d2d);
  border-color: var(--tempaccentcolor, #c26d2d);
}

@media (max-width: 991px) {
  .cookie-banner,
  #cookie-banner,
  .cookie-banner-top,
  .cookie-banner-bottom,
  .cookie-banner-bottom-left,
  .cookie-banner-bottom-right {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    margin: 0 !important;
    border-radius: 0;
    padding: 0.55rem 0.7rem 0.65rem !important;
  }

  .cookie-banner-bottom-left,
  .cookie-banner-bottom-right {
    bottom: 0 !important;
  }

  .cookie-banner__logo {
    width: 3.25rem !important;
    height: 3.25rem !important;
  }
}

@media (max-width: 359px) {
  .cookie-banner,
  #cookie-banner,
  .cookie-banner-top,
  .cookie-banner-bottom,
  .cookie-banner-bottom-left,
  .cookie-banner-bottom-right {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    margin: 0 !important;
    border-radius: 0;
    padding: 0.55rem 0.7rem 0.65rem !important;
  }

  .cookie-banner-bottom-left,
  .cookie-banner-bottom-right {
    bottom: 0 !important;
  }

  .cookie-banner__logo {
    width: 2.15rem !important;
    height: 2.15rem !important;
  }
}

.error-page-details {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 1rem 2.5rem;
  text-align: center;
  box-sizing: border-box;
}

.error-page-details__code {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ts-muted);
}

.error-page-details__debug {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: #8a9aa3;
  word-break: break-all;
}

/* Motion */
@keyframes ts-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.imeny-item {
  animation: ts-fade-up 0.4s ease both;
}

.imeny-item:nth-child(2) { animation-delay: 0.04s; }
.imeny-item:nth-child(3) { animation-delay: 0.08s; }
.imeny-item:nth-child(4) { animation-delay: 0.12s; }
.imeny-item:nth-child(5) { animation-delay: 0.16s; }
.imeny-item:nth-child(6) { animation-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Mobile layout + burger hmenu */
@media (max-width: 860px) {
  .top-header .sheet-inner {
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
  }

  .top-header-left,
  .top-header-right,
  .top-header-left ul,
  .top-header-left > ul,
  .top-header-left > div,
  .top-bar-menu,
  .top-header-left > ul > li,
  .top-bar-menu > li {
    display: contents;
    flex: 0 0 auto;
    margin: 0;
    justify-content: center;
  }

  .top-header .site-search--header,
  html.ts-js .top-header .site-search--collapsible {
    margin-left: 0;
    margin-right: 0;
  }

  .content-layout,
  .content-layout.sidebar-left {
    grid-template-columns: 1fr;
    grid-template-areas:
      "sidenav"
      "content"
      "sideextra";
  }

  .content-layout > .sidebar {
    display: contents;
  }

  .content-layout .sidebar-nav {
    grid-area: sidenav;
  }

  .content-layout .sidebar-extra {
    grid-area: sideextra;
  }

  .ts-top-row,
  .ts-bottom-row {
    grid-template-columns: 1fr;
  }

  body.nav-open {
    overflow: hidden;
  }

  html.ts-js .site-search--collapsible .site-search-toggle,
  html.ts-js .site-search--collapsible.is-open .site-search-close {
    background: #fff;
    color: var(--tempcolor, #3d4f8f);
    border: 1px solid rgba(255, 255, 255, 0.65);
  }

  html.ts-js .bottom-header .sheet {
    padding-inline: 0;
  }

  html.ts-js .nav-toggle {
    display: flex !important;
    flex: 1 1 auto;
    width: 100%;
    min-height: 2.85rem;
    border: 0;
    border-radius: 0;
  }
}

@media (min-width: 861px) {
  .nav-toggle,
  .nav-close,
  .nav-backdrop,
  .hmenu-drawer-head {
    display: none !important;
  }

  .site-search-toggle,
  .site-search-close {
    display: none !important;
  }
}
