/* Правки поверх шаблона themesflat (ТЗ, этапы 3–5).
   Подключается после style.css и responsive.css. */

/* H1 вместо div/a/p: сохраняем прежний вид */
h1.page-title-heading { margin: 0; }
h1.section-heading-jost-size28 { margin: 0 0 10px; line-height: 1.3; }
h1.title-text { font-size: 30px; margin: 20px 0 10px; }
h1.reserve-name { font-size: inherit; font-weight: 700; line-height: inherit; margin: 0 0 10px; }

/* Главная: вступительный блок с названием платформы */
.platform-intro { padding: 56px 0 8px; text-align: center; }
.platform-intro-title {
    margin: 0 0 14px;
    font-family: 'Golos Text', sans-serif;
    font-size: 40px;
    line-height: 1.2;
    font-weight: 700;
    color: #18613e;
}
.platform-intro-text { max-width: 760px; margin: 0 auto; font-size: 18px; line-height: 1.6; }
@media (max-width: 767px) {
    .platform-intro { padding: 36px 0 0; }
    .platform-intro-title { font-size: 28px; }
    .platform-intro-text { font-size: 16px; }
}

/* Меню с клавиатуры: подменю открывается и при фокусе, как при наведении */
#mainnav .menu > li.focus-within > .sub-menu {
    display: block !important;
    opacity: 1;
    visibility: visible;
    left: 0;
    transform: translateY(0);
}
#mainnav .menu > li > a[role="button"] { cursor: pointer; }
:focus-visible { outline: 2px solid #18613e; outline-offset: 2px; }

/* Скорость (этап 4) */
/* width/height у картинок — только для резерва места; размеры по-прежнему задаёт CSS темы */
:where(img[width][height]) { height: auto; }
/* Прелоадер скрывал страницу до загрузки всех картинок */
.preloader { display: none !important; }
/* Появление блоков: быстро и без задержек */
.wow { animation-duration: .4s !important; animation-delay: 0s !important; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .wow { visibility: visible !important; }
}

/* Меню в одну строку на ширине от 1200px (этап 5): «Bosh sahifa» убран из меню
   (index.php), освободившееся место — на отступы между пунктами */
@media (min-width: 1200px) {
    #mainnav .menu > li > a { margin: 0 9px; }
}

/* Главная (этап 5): карточки «кому», сетки материалов и игр */
.platform-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 36px;
    text-align: left;
}
.platform-card {
    display: block;
    padding: 28px 26px;
    border-radius: 16px;
    background: #e6f4e7;
    color: inherit;
    transition: transform .2s, box-shadow .2s;
}
a.platform-card:hover, a.platform-card:focus { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(24, 97, 62, .15); color: inherit; }
.platform-card-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; margin-bottom: 14px;
    border-radius: 50%; background: #18613e; color: #fff; font-size: 22px;
}
.platform-card-title { margin: 0 0 8px; font-size: 22px; font-weight: 700; color: #18613e; }
.platform-card p { margin: 0 0 14px; line-height: 1.55; }
.platform-card-more { font-weight: 500; color: #18613e; }
.platform-card-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.platform-card-links a {
    display: inline-block; padding: 6px 14px; border-radius: 999px;
    background: #fff; color: #18613e; font-weight: 500;
}
.platform-card-links a:hover, .platform-card-links a:focus { background: #18613e; color: #fff; }

/* Цитаты одной высоты */
.flat-testimonials .owl-stage { display: flex; }
.flat-testimonials .owl-item { display: flex; }
.flat-testimonials .owl-item > .item,
.flat-testimonials .list-testimonials,
.flat-testimonials .box-item { display: flex; flex-direction: column; width: 100%; height: 100%; }
.flat-testimonials .box-item .icon-box { margin-top: auto; }

/* Красная книга на главной: 6 карточек сеткой */
.redbook-home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.redbook-home-grid .blog-item { height: 100%; margin: 0; }
.redbook-home-grid .image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.redbook-home-grid .sub-title { margin: 12px 0 0; padding-bottom: 0; }
.redbook-home-more { margin: 28px 0 60px; text-align: center; }

/* Последние материалы и игры */
.home-block { padding: 20px 0 50px; }
.home-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.home-card {
    display: flex; flex-direction: column;
    border-radius: 14px; overflow: hidden; background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .06); color: #1d3527;
    transition: transform .2s, box-shadow .2s;
}
.home-card:hover, .home-card:focus { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(24, 97, 62, .15); color: #18613e; }
.home-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.home-card-label { margin: 14px 18px 0; font-size: 13px; color: #18613e; text-transform: uppercase; letter-spacing: .04em; }
.home-card-title { margin: 6px 18px 18px; font-size: 18px; line-height: 1.35; font-weight: 500; }
.nf-btn {
    display: inline-block; padding: 12px 28px; border: 0; border-radius: 12px;
    background: #18613e; color: #fff; font-weight: 500;
}
.nf-btn:hover, .nf-btn:focus { background: #0f4a2e; color: #fff; }

@media (max-width: 991px) {
    .platform-cards, .redbook-home-grid, .home-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
    .platform-cards, .redbook-home-grid, .home-cards { grid-template-columns: 1fr; gap: 16px; }
}

/* Поиск в верхней строке с адресом, справа.
   Тема задаёт полям высоту 45px и margin-bottom 20px, иконкам в .top-header1 — тёмный цвет
   с !important и отступ, поэтому селекторы здесь конкретнее */
.top-header1 .top-bar-right,
.top-header .top-bar-right { display: flex; align-items: center; justify-content: flex-end; gap: 16px; height: 50px; padding-right: 0; }
/* правый край поиска — по правому краю белой шапки (у неё margin-right: 1%) */
.top-header1 .top-bar-right { padding-right: 1%; }
.topbar-search { display: flex; align-items: center; margin: 0; line-height: normal; }
.topbar-search input[type=search] {
    display: block; width: 220px; height: 36px; margin: 0; padding: 0 14px;
    border: 1px solid #cfe3d2; border-right: 0; border-radius: 18px 0 0 18px;
    background: #fff; color: #333; font-size: 14px; line-height: 36px;
}
.topbar-search input[type=search]:focus { border-color: #18613e; }
.topbar-search button {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 36px; margin: 0; padding: 0;
    border: 0; border-radius: 0 18px 18px 0; background: #18613e;
}
.topbar-search button:hover, .topbar-search button:focus { background: #0f4a2e; }
.top-header1 .topbar-search .fa,
.top-header .topbar-search .fa,
.topbar-search .fa { color: #fff !important; padding: 0; font-size: 15px; }
@media (max-width: 767px) {
    .top-header1 .top-bar-right, .top-header .top-bar-right { justify-content: center; height: auto; padding-right: 0; }
    .topbar-search { width: 100%; max-width: 360px; margin: 6px auto; }
    .topbar-search input[type=search] { flex: 1; width: auto; min-width: 0; }
}

/* ===== Страница новостей (/media/news): сетка карточек ===== */
.news-page { --news-green: #18613e; --news-accent: #348e38; }
.news-page .news-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 24px;
}
@media (max-width: 991px) {
    .news-page .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.news-card {
    display: flex; flex-direction: column; margin: 0;
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 60, 36, .06), 0 6px 20px rgba(16, 60, 36, .08);
    transition: transform .25s ease, box-shadow .25s ease;
}
.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 2px 4px rgba(16, 60, 36, .08), 0 14px 32px rgba(16, 60, 36, .14);
}
.news-card__media {
    position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden;
    background: #e3efe4; text-decoration: none !important;
}
.news-card__media img,
.news-card__placeholder {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    transition: transform .6s ease;
}
.news-card:hover .news-card__media img { transform: scale(1.05); }
.news-card__placeholder {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1f7a45 0%, #6cb45a 100%);
    color: rgba(255, 255, 255, .35); font-size: 96px;
}
.news-card__media::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(6,30,18,.55) 65%, rgba(6,30,18,.88) 100%);
}
.news-card__date {
    position: absolute; top: 14px; left: 14px; z-index: 2;
    padding: 5px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, .92); color: var(--news-green);
    font-size: 13px; font-weight: 600; line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.news-card__date .fa { margin-right: 4px; color: var(--news-accent); }
.news-card__title {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; margin: 0;
    padding: 0 20px 18px;
    font-family: 'Golos Text', sans-serif; font-size: 19px; font-weight: 600;
    line-height: 1.35; letter-spacing: -.2px; color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card__media:focus-visible { outline: 3px solid var(--news-accent); outline-offset: -3px; }
.news-card__body {
    display: flex; flex-direction: column; flex: 1; padding: 16px 20px 18px;
}
.news-card__text {
    margin: 0 0 12px; color: #4a5a50; font-size: 15px; line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card__more {
    margin-top: auto; align-self: flex-start;
    color: var(--news-accent) !important; font-size: 14px; font-weight: 600; line-height: 1.4;
}
.news-card__more i { margin-left: 6px; transition: transform .2s ease; }
.news-card:hover .news-card__more i { transform: translateX(4px); }

/* Пагинация */
.news-pagination {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 44px 0 10px;
}
.news-pagination a, .news-pagination span.news-pagination__page, .news-pagination span.news-pagination__arrow {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; height: 44px; padding: 0 12px; border-radius: 12px;
    background: #e8f3e9; color: var(--news-green); font-weight: 600; font-size: 15px;
    text-decoration: none !important; transition: background .2s, color .2s;
}
.news-pagination a:hover, .news-pagination a:focus-visible { background: var(--news-accent); color: #fff; }
.news-pagination .is-current { background: var(--news-green) !important; color: #fff !important; }
.news-pagination .is-disabled { opacity: .4; }

.news-page .widget.widget_lastest ul li { border-color: #e1ebe2; border-radius: 12px; transition: background .3s, border-color .3s; }
.news-page .widget.widget_lastest .thumb img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; }

@media (max-width: 767px) {
    .news-page .news-grid { grid-template-columns: 1fr; gap: 20px; }
    .news-card__title { font-size: 18px; padding: 0 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .news-card, .news-card__media img, .news-card__more i { transition: none; }
    .news-card:hover { transform: none; }
    .news-card:hover .news-card__media img { transform: none; }
}

/* ===== Шапка сайта (templates/site_header.tpl) ===== */
.site-topbar, .site-header { --hdr-green: #18613e; --hdr-dark: #0f3d27; --hdr-accent: #348e38; --hdr-soft: #eef6ef; --hdr-text: #1d3527; }

/* Верхняя строка: адрес, почта, поиск */
.site-topbar { background: var(--hdr-dark); color: rgba(255, 255, 255, .82); font-size: 13px; line-height: 1.4; }
.site-topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 42px; }
.site-topbar__contacts { display: flex; align-items: center; gap: 24px; min-width: 0; }
.site-topbar__item { display: inline-flex; align-items: center; gap: 7px; color: rgba(255, 255, 255, .82) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-topbar__item .fa { color: #8fd18a; font-size: 14px; }
a.site-topbar__item:hover { color: #fff !important; }
.site-topbar__actions { display: flex; align-items: center; gap: 14px; }
.site-topbar .topbar-search input[type=search] {
    width: 200px; height: 30px; line-height: 30px; padding: 0 12px; font-size: 13px;
    border: 1px solid rgba(255, 255, 255, .18); border-right: 0; border-radius: 15px 0 0 15px;
    background: rgba(255, 255, 255, .1); color: #fff;
}
.site-topbar .topbar-search input[type=search]::placeholder { color: rgba(255, 255, 255, .6); }
.site-topbar .topbar-search input[type=search]:focus { background: #fff; color: #222; border-color: #fff; outline: none; }
.site-topbar .topbar-search button { width: 38px; height: 30px; border-radius: 0 15px 15px 0; background: var(--hdr-accent); }
.site-topbar .topbar-search button:hover, .site-topbar .topbar-search button:focus { background: #2b7a2f; }
.site-topbar .topbar-search .fa { font-size: 13px; }
.site-topbar__social { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; line-height: 1; }
.site-topbar__social a { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff !important; }
.site-topbar__social a:hover { background: var(--hdr-accent); }
.site-topbar__social .fa { padding: 0 !important; color: inherit !important; font-size: 13px; }

/* Основная полоса: логотип + меню */
#header.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: saturate(160%) blur(8px); backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid #e3ece4;
    box-shadow: 0 4px 18px rgba(16, 60, 36, .06);
}
.site-header__inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.site-header__logo { display: flex; align-items: center; flex-shrink: 0; }
.site-header__logo img { display: block; width: auto; height: 33px; }
#header.site-header .nav-wrap { padding: 0; line-height: normal; text-align: right; flex: 1; min-width: 0; }
#header.site-header #mainnav .menu { display: flex; flex-wrap: nowrap; justify-content: flex-end; align-items: center; gap: 2px; margin: 0; padding: 0; white-space: nowrap; }
#header.site-header #mainnav .menu > li { display: block; position: relative; }
#header.site-header #mainnav .menu > li > a {
    display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 10px 11px;
    line-height: 1.3; border-radius: 10px;
    font-size: 15px; font-weight: 500; color: var(--hdr-text);
    transition: background .2s, color .2s;
}
#header.site-header #mainnav > ul > li > a::before { display: none; }
#header.site-header #mainnav > ul > li.menu-item-has-children > a::after {
    margin-left: 2px; font-size: 13px; color: currentColor; opacity: .6; transition: transform .2s;
}
#header.site-header #mainnav .menu > li:hover > a,
#header.site-header #mainnav .menu > li.focus-within > a { background: var(--hdr-soft); color: var(--hdr-green); }
#header.site-header #mainnav .menu > li:hover > a::after { transform: rotate(180deg); }
#header.site-header #mainnav .menu > li.is-active > a { color: var(--hdr-green); font-weight: 600; background: var(--hdr-soft); }

/* Выпадающее подменю */
#header.site-header #mainnav .menu > li > .sub-menu {
    top: calc(100% + 6px); left: 0; width: auto; min-width: 250px; padding: 8px;
    background: #fff; border: 1px solid #e3ece4; border-radius: 14px;
    box-shadow: 0 14px 36px rgba(16, 60, 36, .16);
    transform: translateY(8px); z-index: 1001 !important;
}
#header.site-header #mainnav .menu > li > .sub-menu::before { /* мостик, чтобы подменю не закрывалось в зазоре */
    content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px;
}
#header.site-header #mainnav .menu > li:hover > .sub-menu,
#header.site-header #mainnav .menu > li.focus-within > .sub-menu { transform: translateY(0); }
#header.site-header #mainnav .menu > li > .sub-menu > li { border: 0; }
#header.site-header #mainnav .menu > li > .sub-menu > li > a {
    display: block; padding: 9px 12px; border-radius: 8px;
    font-size: 14.5px; font-weight: 500; line-height: 1.35; color: var(--hdr-text) !important;
    background: transparent; white-space: nowrap; text-align: left;
}
#header.site-header #mainnav .menu > li > .sub-menu > li:hover > a,
#header.site-header #mainnav .menu > li > .sub-menu > li > a:focus-visible { background: var(--hdr-soft); color: var(--hdr-green) !important; }
#header.site-header #mainnav .menu > li > .sub-menu > li.is-active > a { background: var(--hdr-green); color: #fff !important; }
/* последние пункты справа — подменю выравниваем по правому краю, чтобы не вылезало за экран */
#header.site-header #mainnav .menu > li:nth-last-child(-n+2) > .sub-menu { left: auto; right: 0; }

/* Главная: шапка поверх слайдера */
.site-header-overlay { position: absolute; top: 0; left: 0; right: 0; z-index: 1000; }
/* шапка закреплена; top = высота верхней строки минус прокрутка (--hdr-top ставит fixes.js) */
.site-header-overlay #header.site-header { position: fixed; left: 0; right: 0; top: var(--hdr-top, 0px); }

/* Планшеты и телефоны: бургер, мобильное меню (main.js переносит #mainnav в #header как #mainnav-mobi) */
.site-header__inner::before, .site-header__inner::after, .site-topbar__inner::before, .site-topbar__inner::after { display: none; } /* clearfix Bootstrap ломает flex */
.site-header__logo { width: auto; margin: 0; padding: 0; line-height: 0; }
.site-header__logo img { max-width: none; width: auto !important; }
/* Шапка по ширине контента (.container): меню компактнее, чтобы было в одну строку */
@media (min-width: 992px) {
    .site-header__inner { gap: 16px; }
    #header.site-header #mainnav .menu > li > a { padding: 9px 9px; font-size: 15px; }
    #header.site-header #mainnav > ul > li.menu-item-has-children > a::after { font-size: 12px; margin-left: 0; }
    .site-header__logo img { height: 33px; }  /* SVG-логотип 6.65:1: 33px ≈ 219px ширины, меню 15px ≈ 895px */
}
@media (max-width: 1199px) and (min-width: 992px) {
    .site-header__inner { gap: 10px; }
    #header.site-header #mainnav .menu > li > a { padding: 8px 5px; font-size: 13.5px; }
    #header.site-header #mainnav > ul > li.menu-item-has-children > a::after { font-size: 11px; }
    .site-header__logo img { height: 25px; }
}
@media (max-width: 991px) {
    .site-header__inner { min-height: 64px; }
    .site-header__logo img { height: 30px; }
    #header.site-header .nav-wrap { display: none; }
    #header.site-header .btn-menu {
        position: relative; right: auto; display: block; float: none; flex-shrink: 0;
        width: 44px; height: 44px; margin: 0; border-radius: 12px; background: var(--hdr-soft);
    }
    #header.site-header .btn-menu::before, #header.site-header .btn-menu::after, #header.site-header .btn-menu span {
        left: 12px; width: 20px; background-color: var(--hdr-green);
    }
    #header.site-header #mainnav-mobi {
        top: 100%; background: #fff; border-top: 1px solid #e3ece4;
        box-shadow: 0 16px 30px rgba(16, 60, 36, .14);
        max-height: calc(100vh - 64px); overflow-y: auto;
    }
    #header.site-header #mainnav-mobi ul li { border-bottom: 1px solid #edf3ee; }
    #header.site-header #mainnav-mobi ul > li > a { display: block; padding: 0 20px; line-height: 52px; color: var(--hdr-text); font-weight: 500; }
    #header.site-header #mainnav-mobi ul.sub-menu { background: #f6faf6; }
    #header.site-header #mainnav-mobi ul.sub-menu > li > a { padding: 0 32px; line-height: 46px; font-size: 14.5px; }
    #header.site-header #mainnav-mobi li.is-active > a { color: var(--hdr-green); font-weight: 600; }
    #header.site-header #mainnav-mobi .btn-submenu { right: 0; width: 56px; height: 52px; font-size: 18px; line-height: 52px; }
}
@media (max-width: 767px) {
    .site-topbar__inner { min-height: 0; padding-top: 8px; padding-bottom: 8px; }
    .site-topbar__contacts { display: none; }
    .site-topbar__actions { width: 100%; }
    .site-topbar .topbar-search { flex: 1; max-width: none; margin: 0; }
    .site-topbar .topbar-search input[type=search] { flex: 1; width: auto; }
}

/* ===== Заголовок раздела (.page-title) — компактный, свой цвет и значок у каждого раздела =====
   Класс раздела ставит top.tpl: .page-act-{act} .page-sub-{sub} */
.boxed { --pt-accent: #348e38; --pt-bg: #dcefdd; --pt-bg2: #eef8ef; --pt-icon: "\f06c"; --pt-pattern: url("/assets/images/page-title/problems.svg"); } /* по умолчанию: лист */
/* Узор фона по разделам (assets/images/page-title/*.svg; генератор — контурные иконки 48×48 на плитке 840×170) */
.page-act-media       { --pt-pattern: url("/assets/images/page-title/media.svg"); }
.page-act-category    { --pt-pattern: url("/assets/images/page-title/category.svg"); }
.page-act-category.page-sub-problem { --pt-pattern: url("/assets/images/page-title/problems.svg"); }
.page-act-journey     { --pt-pattern: url("/assets/images/page-title/journey.svg"); }
.page-act-redbook     { --pt-pattern: url("/assets/images/page-title/redbook.svg"); }
.page-act-forteachers, .page-act-literature { --pt-pattern: url("/assets/images/page-title/forteachers.svg"); }
.page-act-theory      { --pt-pattern: url("/assets/images/page-title/theory.svg"); }
/* Подразделы — свой набор иконок, цвет остаётся цветом раздела (узор общий для баннера и полей по краям) */
.page-sub-news { --pt-pattern: url("/assets/images/page-title/news.svg"); }
.page-sub-videos { --pt-pattern: url("/assets/images/page-title/videos.svg"); }
.page-sub-photogallery { --pt-pattern: url("/assets/images/page-title/photogallery.svg"); }
.page-sub-animations { --pt-pattern: url("/assets/images/page-title/animations.svg"); }
.page-sub-steps { --pt-pattern: url("/assets/images/page-title/steps.svg"); }
.page-sub-interesting { --pt-pattern: url("/assets/images/page-title/interesting.svg"); }
.page-sub-doyouknow { --pt-pattern: url("/assets/images/page-title/doyouknow.svg"); }
.page-sub-ecohistory { --pt-pattern: url("/assets/images/page-title/ecohistory.svg"); }
.page-sub-folklor { --pt-pattern: url("/assets/images/page-title/folklor.svg"); }
.page-sub-reserves { --pt-pattern: url("/assets/images/page-title/reserves.svg"); }
.page-sub-routes { --pt-pattern: url("/assets/images/page-title/routes.svg"); }
.page-sub-camping { --pt-pattern: url("/assets/images/page-title/camping.svg"); }
.page-sub-animals { --pt-pattern: url("/assets/images/page-title/animals.svg"); }
.page-sub-plants { --pt-pattern: url("/assets/images/page-title/plants.svg"); }
.page-sub-literature { --pt-pattern: url("/assets/images/page-title/literature.svg"); }
.page-sub-scientific { --pt-pattern: url("/assets/images/page-title/scientific.svg"); }
.page-sub-lesson-developments { --pt-pattern: url("/assets/images/page-title/lesson-developments.svg"); }
.page-sub-presentations { --pt-pattern: url("/assets/images/page-title/presentations.svg"); }
.page-sub-ecothemes { --pt-pattern: url("/assets/images/page-title/ecothemes.svg"); }
.page-sub-hierarchy { --pt-pattern: url("/assets/images/page-title/hierarchy.svg"); }
.page-sub-direct-indirect { --pt-pattern: url("/assets/images/page-title/direct-indirect.svg"); }
.boxed[class*="page-sub-games"] { --pt-pattern: url("/assets/images/page-title/games.svg"); }
.page-act-category.page-sub-problem { --pt-pattern: url("/assets/images/page-title/problems.svg"); }
.page-act-media       { --pt-accent: #2f8a3a; --pt-bg: #d6eed9; --pt-bg2: #edf8ee; --pt-icon: "\f1ea"; } /* газета */
.page-sub-videos      { --pt-icon: "\f144"; }
.page-sub-photogallery{ --pt-icon: "\f030"; }
.page-sub-animations  { --pt-icon: "\f008"; }
.page-sub-games, .page-sub-games2, .page-sub-games3 { --pt-icon: "\f11b"; }
.page-sub-steps       { --pt-icon: "\f1bb"; }
.page-act-category    { --pt-accent: #b26b12; --pt-bg: #f8e3bf; --pt-bg2: #fdf3e1; --pt-icon: "\f0eb"; } /* лампочка */
.page-act-journey     { --pt-accent: #0e7c86; --pt-bg: #cdebed; --pt-bg2: #e9f6f7; --pt-icon: "\f1bb"; } /* дерево */
.page-sub-routes      { --pt-icon: "\f278"; }
.page-sub-camping     { --pt-icon: "\f0e7"; }
.page-act-redbook     { --pt-accent: #b8322a; --pt-bg: #f6d3cf; --pt-bg2: #fcecea; --pt-icon: "\f1b0"; } /* лапа */
.page-act-redbook.page-sub-plants { --pt-icon: "\f06c"; }
.page-act-forteachers, .page-act-literature
                      { --pt-accent: #2d5fa6; --pt-bg: #d4e2f5; --pt-bg2: #ecf2fb; --pt-icon: "\f19d"; } /* шапочка */
.page-act-theory      { --pt-accent: #6a4c9c; --pt-bg: #e2d8f2; --pt-bg2: #f3eefa; --pt-icon: "\f0e8"; } /* схема */

.page-title .container-fluid, .page-title .row { padding: 0; margin: 0; }
/* карточка по ширине контента (как .container), со скруглением и мягкой тенью */
.page-title .inner-title {
    position: relative; height: auto; overflow: hidden;
    width: calc(100% - 30px); max-width: 1170px; margin: 18px auto 0; border-radius: 20px;
    background:
        radial-gradient(ellipse 60% 140% at 100% 50%, color-mix(in srgb, var(--pt-accent) 14%, transparent), transparent 70%),
        linear-gradient(115deg, var(--pt-bg) 0%, var(--pt-bg2) 100%);
    border: 1px solid color-mix(in srgb, var(--pt-accent) 16%, transparent);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--pt-accent) 10%, transparent), 0 10px 30px color-mix(in srgb, var(--pt-accent) 12%, transparent);
}
@media (min-width: 768px)  { .page-title .inner-title { width: 720px; } }
@media (min-width: 992px)  { .page-title .inner-title { width: 940px; } }
@media (min-width: 1200px) { .page-title .inner-title { width: 1170px; } }
/* узор из тематических иконок раздела (--pt-pattern); под заголовком слева плавно гаснет */
.page-title .inner-title::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-color: var(--pt-accent); opacity: .22;
    -webkit-mask: var(--pt-pattern) 0 50% / auto 100% repeat-x, linear-gradient(90deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.35) 30%, #000 65%);
    -webkit-mask-composite: source-in;
            mask: var(--pt-pattern) 0 50% / auto 100% repeat-x, linear-gradient(90deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.35) 30%, #000 65%);
            mask-composite: intersect;
}
.page-title .overlay-image { display: none; }
/* значок раздела справа — поверх узора, непрозрачный, с градиентом в цвете раздела */
.page-title .inner-title::after {
    content: var(--pt-icon); font-family: 'FontAwesome';
    position: absolute; right: 48px; top: 50%; z-index: 1;
    transform: translateY(-50%);
    font-size: 80px; line-height: 1; pointer-events: none;
    background: linear-gradient(150deg, color-mix(in srgb, var(--pt-accent) 75%, #fff) 0%, var(--pt-accent) 55%, color-mix(in srgb, var(--pt-accent) 80%, #000) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 8px 16px color-mix(in srgb, var(--pt-accent) 35%, transparent));
}
.page-title .banner-title {
    position: relative; top: auto; left: auto; transform: none; z-index: 1;
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    width: auto; max-width: none; margin: 0; padding: 22px 170px 20px 32px; text-align: left;
}
.page-title .page-title-heading {
    position: relative; margin: 0; padding-left: 18px;
    font-family: 'Golos Text', sans-serif; font-size: 34px; font-weight: 700; line-height: 1.2;
    letter-spacing: -.4px; color: #14271c;
}
.page-title .page-title-heading::before {               /* цветная вертикальная полоска слева от заголовка */
    content: ""; position: absolute; left: 0; top: .15em; bottom: .15em; width: 5px; border-radius: 3px;
    background: linear-gradient(180deg, var(--pt-accent), color-mix(in srgb, var(--pt-accent) 45%, #fff));
}
/* «хлебные крошки» — в полупрозрачной белой «таблетке» */
.page-title .page-title-content {
    display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0; margin-left: 18px;
    padding: 4px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, .7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--pt-accent) 12%, transparent);
    font-size: 13.5px; font-weight: 500; line-height: 1.5; color: color-mix(in srgb, #14271c 60%, transparent);
}
.page-title .page-title-content a,
.page-title .link-style6 a { color: var(--pt-accent); }
.page-title .link-style6 a:hover { color: #14271c; text-decoration: underline; }
.page-title .page-title-content .home::before { content: "\f015"; font-family: 'FontAwesome'; margin-right: 6px; }
.page-title .page-title-content-inner::before { content: "\f105"; font-family: 'FontAwesome'; padding: 0 8px; opacity: .6; }
.page-title .page-title-content-inner > span::before { content: none; }

/* Отступ между заголовком раздела и контентом был рассчитан на высокий баннер */
.page-title ~ section > .container > .row > .col-md-12:first-child > .themesflat-spacer { height: 24px !important; }

@media (max-width: 767px) {
    .page-title .inner-title { margin-top: 14px; border-radius: 16px; }
    .page-title .banner-title { padding: 16px 84px 14px 16px; gap: 6px; }
    .page-title .page-title-heading { font-size: 24px; padding-left: 14px; }
    .page-title .page-title-heading::before { width: 4px; }
    .page-title .page-title-content { font-size: 12.5px; margin-left: 14px; padding: 3px 10px; }
    .page-title .inner-title::after { font-size: 56px; right: 18px; }
}

/* ===== Сетки медиа (видео, фотогалерея, анимации, игры): uk-grid внутри .row выходил за край контента ===== */
.uk-child-width-1-3\@m[uk-grid] {
    display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px;
    margin: 0 !important; padding: 0; list-style: none;
}
.row > .uk-child-width-1-3\@m[uk-grid] { margin: 0 15px !important; }
.uk-child-width-1-3\@m[uk-grid] > * {
    width: auto !important; max-width: none !important; float: none !important;
    margin: 0 !important; padding: 0 !important;
}
.uk-child-width-1-3\@m[uk-grid] > * > article { height: 100%; margin: 0; }
@media (max-width: 991px) {
    .uk-child-width-1-3\@m[uk-grid] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575px) {
    .uk-child-width-1-3\@m[uk-grid] { grid-template-columns: 1fr; gap: 20px; }
}

/* ===== Шапка-карточка: меню в ограниченной ширине (как баннер раздела и контент) ===== */
#header.site-header {
    padding: 10px 0 0; background: transparent; border: 0; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none;
}
#header.site-header > * { pointer-events: auto; }
.container.site-header__inner {
    width: calc(100% - 30px); max-width: 1170px; min-height: 70px; padding: 0 22px;
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: saturate(160%) blur(10px); backdrop-filter: saturate(160%) blur(10px);
    border: 1px solid #e1ebe2; border-radius: 18px;
    box-shadow: 0 1px 2px rgba(16, 60, 36, .05), 0 10px 28px rgba(16, 60, 36, .09);
}
@media (min-width: 768px)  { .container.site-header__inner { width: 720px; } }
@media (min-width: 992px)  { .container.site-header__inner { width: 940px; padding: 0 12px; } }
@media (min-width: 1200px) { .container.site-header__inner { width: 1170px; padding: 0 22px; } }
@media (min-width: 1200px) {
    .site-header__logo img { height: 31px; }
}
@media (max-width: 1199px) and (min-width: 992px) {
    #header.site-header #mainnav .menu > li > a { padding: 8px 5px; font-size: 13px; gap: 2px; }
    .site-header__logo img { height: 23px; }
}
/* баннер раздела — чуть ниже карточки меню */
.page-title .inner-title { margin-top: 14px; }
/* мобильное меню — выпадает карточкой под шапкой */
@media (max-width: 991px) {
    #header.site-header { padding-top: 8px; }
    .container.site-header__inner { min-height: 60px; padding: 0 10px 0 16px; border-radius: 16px; }
    #header.site-header #mainnav-mobi {
        top: calc(100% + 6px); left: 15px; right: 15px; width: auto;
        border: 1px solid #e1ebe2; border-radius: 16px; overflow: hidden auto;
        max-height: calc(100vh - 90px);
    }
}
@media (min-width: 768px) and (max-width: 991px) {
    #header.site-header #mainnav-mobi { left: calc(50% - 360px); right: calc(50% - 360px); }
}

/* ===== Шапка при прокрутке: плавный переход белый → зелёный =====
   fixes.js ставит --hdr-p от 0 (верх страницы) до 1 (прокручено ≥120px) и класс .is-scrolled при p > .5 */
/* --hdr-c — «зелёность» шапки: 1 = всегда зелёная (форма по-прежнему меняется от --hdr-p) */
#header.site-header { --hdr-p: 0; --hdr-c: 1; padding-top: calc(10px * (1 - var(--hdr-p))); }
#header.site-header .container.site-header__inner {
    min-height: calc(70px - 8px * var(--hdr-p));
    border-radius: calc(18px * (1 - var(--hdr-p))) calc(18px * (1 - var(--hdr-p))) 18px 18px;
    background: color-mix(in srgb, #18613e calc(var(--hdr-c) * 100%), rgba(255, 255, 255, .96));
    border-color: color-mix(in srgb, #18613e calc(var(--hdr-c) * 100%), #e1ebe2);
    box-shadow: 0 2px 4px rgba(10, 45, 28, calc(.05 + .07 * var(--hdr-p))), 0 12px 30px rgba(10, 45, 28, calc(.09 + .19 * var(--hdr-p)));
    transition: none;
}
#header.site-header #mainnav .menu > li > a { color: color-mix(in srgb, #fff calc(var(--hdr-c) * 100%), #1d3527); }
/* логотипы наложены: обычный гаснет, белый проявляется */
.site-header__logo { position: relative; }
.site-header__logo-img--green { position: absolute; left: 0; top: 50%; transform: translateY(-50%); opacity: var(--hdr-c); }
.site-header__logo-img:not(.site-header__logo-img--green) { opacity: calc(1 - var(--hdr-c)); }
/* наведение и текущий раздел — белые «таблетки», когда фон уже в основном зелёный */
#header.site-header #mainnav .menu > li:hover > a,
#header.site-header #mainnav .menu > li.focus-within > a { background: rgba(255, 255, 255, .12); color: #fff; }
#header.site-header #mainnav .menu > li.is-active > a { background: rgba(255, 255, 255, .18); color: #fff; }
#header.site-header .btn-menu { background: rgba(255, 255, 255, .14); }
#header.site-header .btn-menu::before,
#header.site-header .btn-menu::after,
#header.site-header .btn-menu span { background-color: #fff; }
@media (max-width: 991px) {
    #header.site-header { padding-top: calc(8px * (1 - var(--hdr-p))); }
    #header.site-header .container.site-header__inner {
        min-height: calc(60px - 4px * var(--hdr-p));
        border-radius: calc(16px * (1 - var(--hdr-p))) calc(16px * (1 - var(--hdr-p))) 16px 16px;
    }
}

/* При прокрутке карточка меню плавно становится шире контента на 5px с каждой стороны */
#header.site-header { --hdr-w: calc(100% - 30px); }
@media (min-width: 768px)  { #header.site-header { --hdr-w: 720px; } }
@media (min-width: 992px)  { #header.site-header { --hdr-w: 940px; } }
@media (min-width: 1200px) { #header.site-header { --hdr-w: 1170px; } }
#header.site-header .container.site-header__inner {
    width: calc(var(--hdr-w) + 10px * var(--hdr-p));
    max-width: none;
}

/* ===== Страница новости (/media/news/{id}) ===== */
.news-detail {
    margin: 0; padding: 32px 36px 30px; background: #fff; border-radius: 18px;
    box-shadow: 0 1px 2px rgba(16, 60, 36, .06), 0 8px 26px rgba(16, 60, 36, .08);
}
.news-detail__title {
    margin: 0 0 14px; font-family: 'Golos Text', sans-serif; font-size: 30px; font-weight: 700;
    line-height: 1.25; letter-spacing: -.4px; color: #14271c;
}
.news-detail__meta { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 22px; }
.news-detail__meta span {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
    background: #eef6ef; color: #18613e; font-size: 13.5px; font-weight: 500; line-height: 1.5;
}
.news-detail__meta .fa { color: #348e38; }
.news-detail__photo { margin: 0 0 26px; border-radius: 14px; overflow: hidden; background: #e3efe4; aspect-ratio: 16 / 9; }
.news-detail__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.news-detail__text { font-size: 17px; line-height: 1.75; color: #2b3a31; }
.news-detail__text * { font-size: inherit !important; font-family: inherit !important; line-height: inherit !important; white-space: normal !important; }
.news-detail__text p, .news-detail__text div { margin: 0 0 1em; }
.news-detail__text a { color: #2f8a3a; text-decoration: underline; text-underline-offset: 2px; }
.news-detail__text em { color: #6a7a70; }
.news-detail__siblings {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
    margin: 30px 0 22px; padding-top: 24px; border-top: 1px solid #e6eee7;
}
.news-detail__sibling {
    display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 12px;
    background: #f5faf5; border: 1px solid #e3ece4; text-decoration: none !important; transition: background .2s, border-color .2s;
}
.news-detail__sibling:hover { background: #eaf5ea; border-color: #bcd9bf; }
.news-detail__sibling--next { text-align: right; align-items: flex-end; }
.news-detail__sibling-label { font-size: 13px; font-weight: 600; color: #348e38; }
.news-detail__sibling-title {
    font-size: 15px; font-weight: 500; line-height: 1.4; color: #1d3527;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-detail__back {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px;
    background: #18613e; color: #fff !important; font-weight: 600; font-size: 14.5px; text-decoration: none !important;
}
.news-detail__back:hover { background: #0f4a2e; }

.news-page .widget.widget_lastest h2 { padding-top: 0; }
@media (max-width: 767px) {
    .news-detail { padding: 20px 18px; border-radius: 14px; }
    .news-detail__title { font-size: 23px; }
    .news-detail__text { font-size: 16px; }
    .news-detail__siblings { grid-template-columns: 1fr; }
    .news-detail__sibling--next { text-align: left; align-items: flex-start; }
}

/* Блок подвала (логотип + контакты) заходит вверх на контент — оставляем запас под ним */
.flat-blog-standard.news-page { padding-bottom: 80px; }
/* заголовок боковой панели — вровень с верхом карточки новости */
.news-page .side-bar .widget.widget_lastest h2 { margin-top: 0; padding: 0 0 4px 3px; line-height: 1.2; }
.news-page .side-bar .widget.widget_lastest ul li:first-child { margin-top: 12px; }
@media (max-width: 991px) {
    /* тема на планшетах/телефонах даёт секции 60px сверху — под компактным баннером это лишнее */
    .page-title ~ .flat-blog-standard { padding-top: 0; }
    .flat-blog-standard.news-page { padding-bottom: 60px; }
}
@media (max-width: 767px) {
    /* блок подвала с логотипом на телефоне не показывается — большой запас не нужен */
    .flat-blog-standard.news-page { padding-bottom: 32px; }
    /* пагинация в одну строку */
    .news-pagination { gap: 5px; margin-top: 28px; }
    .news-pagination a, .news-pagination span.news-pagination__page, .news-pagination span.news-pagination__arrow {
        min-width: 36px; height: 38px; padding: 0 8px; border-radius: 10px; font-size: 14px;
    }
}

/* ===== Боковая панель новости: «So‘nggi yangiliklar» одной карточкой ===== */
.news-page .side-bar .widget.widget_lastest {
    padding: 20px 20px 8px; background: #fff; border-radius: 18px;
    box-shadow: 0 1px 2px rgba(16, 60, 36, .06), 0 8px 26px rgba(16, 60, 36, .08);
}
.news-page .side-bar .widget.widget_lastest h2 {
    margin: 0 0 6px; padding: 0; font-size: 19px; font-weight: 700; line-height: 1.3; color: #14271c;
    display: flex; align-items: center; gap: 8px;
}
.news-page .side-bar .widget.widget_lastest h2::before { content: "\f1ea"; font-family: 'FontAwesome'; font-weight: 400; color: #348e38; font-size: 17px; }
.news-page .side-bar .widget.widget_lastest ul li,
.news-page .side-bar .widget.widget_lastest ul li:first-child {
    display: flex; gap: 12px; align-items: flex-start;
    margin: 0 -10px; padding: 12px 10px; border: 0; border-radius: 12px; background: none;
    position: relative;
}
.news-page .side-bar .widget.widget_lastest ul li + li::before {
    content: ""; position: absolute; top: 0; left: 10px; right: 10px; height: 1px; background: #edf3ee;
}
.news-page .side-bar .widget.widget_lastest ul li:hover { background: #f3f9f3; border: 0; }
.news-page .side-bar .widget.widget_lastest ul li:hover + li::before, .news-page .side-bar .widget.widget_lastest ul li:hover::before { opacity: 0; }
.news-page .side-bar .widget.widget_lastest .thumb { float: none; flex-shrink: 0; }
.news-page .side-bar .widget.widget_lastest .thumb img { display: block; width: 76px; height: 60px; object-fit: cover; border-radius: 10px; }
.news-page .side-bar .widget.widget_lastest .text { padding: 0; min-width: 0; }
.news-page .side-bar .widget.widget_lastest h3 { margin: 0 0 4px; font-size: 14.5px; line-height: 1.4; }
.news-page .side-bar .widget.widget_lastest h3 a {
    color: #1d3527 !important; font-weight: 500;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-page .side-bar .widget.widget_lastest li:hover h3 a { color: #18613e !important; }
.news-page .side-bar .widget.widget_lastest .date { font-size: 12.5px; color: #7a8c80; }

/* ===== «Qizil kitobdan» — случайный организм из Красной книги ===== */
.redbook-pick {
    display: block; margin-top: 22px; overflow: hidden; background: #fff; border-radius: 18px;
    box-shadow: 0 1px 2px rgba(120, 30, 20, .06), 0 8px 26px rgba(120, 30, 20, .10);
    text-decoration: none !important; position: relative; transition: transform .25s ease, box-shadow .25s ease;
}
.redbook-pick:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(120, 30, 20, .08), 0 14px 32px rgba(120, 30, 20, .16); }
.redbook-pick__label {
    position: absolute; top: 14px; left: 14px; z-index: 1;
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
    background: #b8322a; color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.4;
    box-shadow: 0 3px 10px rgba(184, 50, 42, .35);
}
.redbook-pick__photo { display: block; aspect-ratio: 16 / 11; background: #f6e6e4; overflow: hidden; }
.redbook-pick__photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.redbook-pick:hover .redbook-pick__photo img { transform: scale(1.05); }
.redbook-pick__body { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px 16px; border-top: 3px solid #b8322a; }
.redbook-pick__cat { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #b8322a; }
.redbook-pick__name { font-size: 17px; font-weight: 700; line-height: 1.3; color: #14271c; }
.redbook-pick__more { margin-top: 6px; font-size: 14px; font-weight: 600; color: #b8322a; }
.redbook-pick__more i { margin-left: 4px; transition: transform .2s ease; }
.redbook-pick:hover .redbook-pick__more i { transform: translateX(4px); }

/* «So‘nggi yangiliklar»: фото на всю высоту строки (без пустого места под ним), все строки одинаково выровнены */
.news-page .side-bar .widget.widget_lastest ul li:nth-child(n) {
    align-items: stretch; margin: 0 -10px; padding: 12px 10px;
}
.news-page .side-bar .widget.widget_lastest .thumb { display: flex; width: 84px; margin: 0; padding: 0; }
.news-page .side-bar .widget.widget_lastest .thumb img { width: 84px; height: 100%; min-height: 72px; }
.news-page .side-bar .widget.widget_lastest .text { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.news-page .side-bar .widget.widget_lastest h3 { margin: 0; }
.news-page .side-bar .widget.widget_lastest .date { line-height: 1.3; }
/* clearfix у <li> во flex-строке давал первой новости лишний «элемент» и сдвиг вправо */
.news-page .side-bar .widget.widget_lastest ul li:first-child::before,
.news-page .side-bar .widget.widget_lastest ul li::after { content: none; display: none; }

/* Боковая панель новости прилипает; если она выше экрана — прилипает нижним краем,
   чтобы все блоки было видно целиком (top считает fixes.js → --sb-top) */
@media (min-width: 992px) {
    .news-page .container > .row { display: flex; flex-wrap: wrap; }
    .news-page .col-md-4 > .side-bar { position: sticky; top: var(--sb-top, 96px); }
}

/* ===== Поля по краям широких экранов — узор в стиле баннера раздела (--pt-pattern, --pt-accent) =====
   Видно только по бокам от контента (контейнер 1200px); к контенту узор плавно растворяется. */
@media (min-width: 1400px) {
    .boxed::before {
        content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
        background-color: var(--pt-accent); opacity: .13;
        -webkit-mask: var(--pt-pattern) 0 0 / 630px auto repeat,
            linear-gradient(to right, #000 0, #000 calc(50% - 680px), transparent calc(50% - 590px), transparent calc(50% + 590px), #000 calc(50% + 680px), #000 100%);
        -webkit-mask-composite: source-in;
                mask: var(--pt-pattern) 0 0 / 630px auto repeat,
            linear-gradient(to right, #000 0, #000 calc(50% - 680px), transparent calc(50% - 590px), transparent calc(50% + 590px), #000 calc(50% + 680px), #000 100%);
                mask-composite: intersect;
    }
}
/* тема задаёт списку 100px снизу и минимальную высоту 1150px — на страницах новостей это лишний отступ до подвала */
.news-page .post-wrap { margin-bottom: 0; min-height: 0; }

/* ===== Подвал: адрес в одну строку (колонка по ширине содержимого, разделитель сразу после адреса) ===== */
.footer .footer-contact-info { align-items: center; }
.footer .footer-contact-info .footer-info-item,
.footer .footer-contact-info .footer-info-items { width: auto; flex: 0 1 auto; min-width: 0; }
.footer .footer-contact-info .location {
    position: relative; height: 122px; line-height: 1.4; align-items: center;
    padding: 0 32px 0 30px;
}
.footer .footer-contact-info .location::after { left: auto; right: 0; top: 50%; transform: translateY(-50%); }
.footer .icon-location::before { line-height: 1; padding: 0 12px 0 0; }
.footer .content-location { padding: 0; min-width: 0; }
.footer .content-location .heading-16px-rubik { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.footer .footer-contact-info .email { padding-left: 32px; line-height: 1.4; height: 122px; align-items: center; }
.footer .icon-email::before { line-height: 1; padding: 0 12px 0 0; margin-left: 0; }

/* ===== Подвал: меню разделов плитками (иконка в цвете раздела + название) вместо контактов ===== */
.footer .top-footer-right { flex: 1; min-width: 0; }
.footer .footer-nav {
    display: flex; align-items: stretch; height: 122px; margin-left: 10px; margin-right: -0.5%; padding: 10px 8px;
    background-color: var(--primary-color3); border-radius: 10px;
}
.footer .footer-nav__item {
    --fn-c: #348e38; --fn-i: "\f06c";
    position: relative; flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
    padding: 6px 4px; border-radius: 10px; text-align: center; text-decoration: none !important;
    transition: background .2s;
}
.footer .footer-nav__item + .footer-nav__item::before {      /* тонкий разделитель между плитками */
    content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: rgba(24, 97, 62, .14);
}
.footer .footer-nav__icon {
    display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
    background: #fff; color: var(--fn-c); box-shadow: 0 2px 8px rgba(16, 60, 36, .08);
    transition: background .2s, color .2s, transform .2s;
}
.footer .footer-nav__icon::before { content: var(--fn-i); font-family: 'FontAwesome'; font-size: 17px; line-height: 1; }
.footer .footer-nav__label { font-size: 13.5px; font-weight: 600; line-height: 1.25; color: #1d3527; }
.footer .footer-nav__item:hover, .footer .footer-nav__item:focus-visible { background: rgba(255, 255, 255, .7); }
.footer .footer-nav__item:hover .footer-nav__icon, .footer .footer-nav__item:focus-visible .footer-nav__icon { background: var(--fn-c); color: #fff; transform: translateY(-2px); }
.footer .footer-nav__item:hover .footer-nav__label { color: var(--fn-c); }
/* цвет и значок — как у баннера раздела */
.footer .footer-nav--media       { --fn-c: #2f8a3a; --fn-i: "\f1ea"; }
.footer .footer-nav--category    { --fn-c: #b26b12; --fn-i: "\f0eb"; }
.footer .footer-nav--journey     { --fn-c: #0e7c86; --fn-i: "\f1bb"; }
.footer .footer-nav--redbook     { --fn-c: #b8322a; --fn-i: "\f1b0"; }
.footer .footer-nav--forteachers { --fn-c: #2d5fa6; --fn-i: "\f19d"; }
.footer .footer-nav--testing     { --fn-c: #18613e; --fn-i: "\f046"; }
.footer .footer-nav--theory      { --fn-c: #6a4c9c; --fn-i: "\f0e8"; }

/* нижняя строка: слева копирайт, справа почта и соцсети */
.footer-bottom .footer-bottom-row {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px;
    padding-top: 26px;
}
.footer-bottom .footer-bottom-row .copyright-text { margin: 0 !important; padding: 0; text-align: left; line-height: 1.4; }
.footer-bottom .footer-contacts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: 0 !important; padding: 0; font-size: 14.5px; line-height: 1.4; }
.footer-bottom .copyright { padding-bottom: 26px; }
.footer-bottom .footer-contacts a { color: rgba(255, 255, 255, .8) !important; text-decoration: none !important; }
.footer-bottom .footer-contacts a:hover { color: #fff !important; }
.footer-bottom .footer-contacts .fa { color: #8fd18a; margin-right: 4px; }
.footer-bottom .footer-social { display: inline-flex; gap: 8px; }
.footer-bottom .footer-social a { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.footer-bottom .footer-social .fa { margin: 0; color: #fff; }
@media (max-width: 767px) {
    .footer-bottom .footer-bottom-row { flex-direction: column-reverse; justify-content: center; text-align: center; }
    .footer-bottom .footer-bottom-row .copyright-text { text-align: center; }
    .footer-bottom .footer-contacts { justify-content: center; }
}

/* ===== Видео и анимации: карточки в стиле новостей, превью 16:9 с кнопкой «▶» ===== */
:is(.page-sub-videos, .page-sub-animations) .flat-why-choose-us .flat-WCU-box {
    display: flex; flex-direction: column; height: 100%; margin: 0; overflow: hidden;
    background: #fff; border-radius: 16px;
    box-shadow: 0 1px 2px rgba(16, 60, 36, .06), 0 6px 20px rgba(16, 60, 36, .08);
    transition: transform .25s ease, box-shadow .25s ease;
}
:is(.page-sub-videos, .page-sub-animations) .flat-why-choose-us .flat-WCU-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 2px 4px rgba(16, 60, 36, .08), 0 14px 32px rgba(16, 60, 36, .14);
}
:is(.page-sub-videos, .page-sub-animations) .flat-why-choose-us .WCU-image {
    position: relative; height: auto; aspect-ratio: 16 / 9; border-radius: 0; background: #e3efe4;
}
:is(.page-sub-videos, .page-sub-animations) .WCU-image > a { position: absolute; inset: 0; display: block; }
:is(.page-sub-videos, .page-sub-animations) .WCU-image img {
    width: 100%; height: 100% !important; object-fit: cover; transition: transform .6s ease;
}
:is(.page-sub-videos, .page-sub-animations) .flat-WCU-box:hover .WCU-image img { transform: scale(1.05); }
/* затемнение и кнопка «▶» по центру */
:is(.page-sub-videos, .page-sub-animations) .WCU-image > a::before {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(6,30,18,.35) 100%);
}
:is(.page-sub-videos, .page-sub-animations) .WCU-image > a::after {
    content: "\f04b"; font-family: 'FontAwesome';
    position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%);
    display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 50%;
    padding-left: 4px; font-size: 20px; color: #18613e; background: rgba(255, 255, 255, .92);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25); transition: background .25s, color .25s, transform .25s;
}
:is(.page-sub-videos, .page-sub-animations) .flat-WCU-box:hover .WCU-image > a::after {
    background: #348e38; color: #fff; transform: translate(-50%, -50%) scale(1.08);
}
/* заголовок: компактно, без пустого места */
:is(.page-sub-videos, .page-sub-animations) .flat-why-choose-us .features-box { height: auto !important; flex: 1; margin: 0; }
:is(.page-sub-videos, .page-sub-animations) .flat-why-choose-us .content-features { padding: 14px 18px 18px !important; }
:is(.page-sub-videos, .page-sub-animations) .content-features h3 {
    margin: 0; font-size: 17px; font-weight: 600; line-height: 1.4; letter-spacing: -.1px; color: #1d3527;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
:is(.page-sub-videos, .page-sub-animations) .flat-WCU-box:hover .content-features h3 { color: #18613e; }
:is(.page-sub-videos, .page-sub-animations) .flat-why-choose-us .mg-bottom-60 { margin-bottom: 0 !important; }
/* пагинация темы на видео/анимациях без страниц (все материалы на одной странице) — только пустые стрелки */
:is(.page-sub-videos, .page-sub-animations) .flat-why-choose-us .themesflat-pagination { display: none; }

/* ===== Модальное окно с видео (fixes.js: a.js-video) ===== */
.video-modal {
    position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center;
    padding: 24px 15px; background: rgba(8, 24, 15, .82); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    animation: video-modal-in .2s ease;
}
.video-modal[hidden] { display: none; }
@keyframes video-modal-in { from { opacity: 0; } to { opacity: 1; } }
/* ширина — как у контента (.container: 1170 / 940 / 720), но не выше экрана: видео 16:9 + заголовок ≈ 110px */
.video-modal { --vm-w: 100%; }
@media (min-width: 768px)  { .video-modal { --vm-w: 720px; } }
@media (min-width: 992px)  { .video-modal { --vm-w: 940px; } }
@media (min-width: 1200px) { .video-modal { --vm-w: 1170px; } }
.video-modal__box { width: min(var(--vm-w), 100%, calc((100vh - 110px) * 16 / 9)); }
.video-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.video-modal__title { color: #fff; font-size: 17px; font-weight: 600; line-height: 1.35; }
.video-modal__close {
    flex-shrink: 0; width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
    background: rgba(255, 255, 255, .14); color: #fff; font-size: 28px; line-height: 44px; padding: 0;
}
.video-modal__close:hover, .video-modal__close:focus-visible { background: #348e38; }
.video-modal__frame { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.video-modal__frame iframe, .video-modal__frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
html.video-modal-open, html.video-modal-open body { overflow: hidden; }
.video-modal__more { display: none; }

/* Телефон — как мобильный YouTube: окно на весь экран, видео сверху во всю ширину (прилипает),
   под ним название и список «Boshqa videolar»; закрытие — стрелка вниз поверх видео */
@media (max-width: 767px) {
    .video-modal { padding: 0; align-items: stretch; background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
    /* видео, название и «Boshqa videolar» на месте; прокручивается только список */
    .video-modal__box {
        position: relative; width: 100%; height: 100%; overflow: hidden;
        display: flex; flex-direction: column; background: #fff;
    }
    .video-modal__frame { order: 1; flex-shrink: 0; border-radius: 0; box-shadow: none; }
    .video-modal__head { order: 2; flex-shrink: 0; margin: 0; padding: 12px 14px 10px; border-bottom: 1px solid #edf1ee; }
    .video-modal__title { color: #0f1f16; font-size: 17px; font-weight: 700; line-height: 1.35; }
    .video-modal__close {
        position: fixed; top: 8px; left: 8px; z-index: 3; width: 38px; height: 38px;
        background: rgba(0, 0, 0, .45); font-size: 0; line-height: 38px;
    }
    .video-modal__close::before { content: "\f107"; font-family: 'FontAwesome'; font-size: 26px; line-height: 38px; }
    .video-modal__close span { display: none; }
    .video-modal__more { order: 3; display: flex; flex-direction: column; flex: 1; min-height: 0; background: #f2f7f2; }
    .video-modal__more-title {
        flex-shrink: 0; position: relative; z-index: 1; display: flex; align-items: center; gap: 8px;
        padding: 12px 16px 10px; background: #f2f7f2; font-size: 15px; font-weight: 700; color: #0f1f16;
        box-shadow: 0 6px 8px -8px rgba(0, 0, 0, .25);
    }
    .video-modal__more-title::before { content: "\f16a"; font-family: 'FontAwesome'; font-weight: 400; font-size: 18px; color: #348e38; }
    .video-modal__count {
        margin-left: auto; min-width: 26px; padding: 2px 8px; border-radius: 999px;
        background: #dcefdd; color: #18613e; font-size: 12.5px; font-weight: 700; text-align: center;
    }
    .video-modal__list { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 12px 28px; }
    .video-modal__item {
        display: flex; gap: 12px; align-items: center; margin-top: 10px; padding: 8px; border-radius: 14px;
        background: #fff; box-shadow: 0 1px 2px rgba(16, 60, 36, .06), 0 4px 14px rgba(16, 60, 36, .07);
        text-decoration: none !important; transition: transform .15s ease, box-shadow .15s ease;
    }
    .video-modal__item:active { transform: scale(.98); box-shadow: 0 1px 2px rgba(16, 60, 36, .08); }
    .video-modal__thumb { position: relative; flex: 0 0 46%; max-width: 190px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #e3efe4; }
    .video-modal__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
    .video-modal__thumb::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,.35) 100%); }
    .video-modal__thumb::after {
        content: "\f04b"; font-family: 'FontAwesome'; position: absolute; left: 7px; bottom: 7px; z-index: 2;
        width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
        padding-left: 2px; font-size: 10px; color: #fff; background: #348e38; box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
    }
    .video-modal__item-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
    .video-modal__item-title {
        font-size: 14.5px; font-weight: 600; line-height: 1.35; color: #0f1f16;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    .video-modal__item-meta { font-size: 12.5px; font-weight: 500; color: #7a8c80; }
}
/* под сеткой видео/анимаций/фото/игр — место под блок подвала (он заходит на контент на 57px) + ~30px воздуха */
.boxed:is(.page-sub-videos, .page-sub-animations, .page-sub-photogallery, [class*="page-sub-games"]) .flat-why-choose-us { padding-bottom: 88px; }
@media (max-width: 767px) {
    .boxed:is(.page-sub-videos, .page-sub-animations, .page-sub-photogallery, [class*="page-sub-games"]) .flat-why-choose-us { padding-bottom: 32px; }
}

/* ===== Фотогалерея: альбомы ===== */
.album-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; }
.album-card {
    display: flex; flex-direction: column; overflow: hidden; background: #fff; border-radius: 16px;
    box-shadow: 0 1px 2px rgba(16, 60, 36, .06), 0 6px 20px rgba(16, 60, 36, .08);
    text-decoration: none !important; transition: transform .25s ease, box-shadow .25s ease;
}
.album-card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(16, 60, 36, .08), 0 14px 32px rgba(16, 60, 36, .14); }
.album-card__cover { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #e3efe4; }
.album-card__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.album-card:hover .album-card__cover img { transform: scale(1.05); }
.album-card__cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(6,30,18,.45) 100%); }
.album-card__count {
    position: absolute; left: 14px; bottom: 14px; z-index: 1; display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .92);
    color: #18613e; font-size: 13px; font-weight: 600; line-height: 1.4; box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.album-card__count .fa { color: #348e38; }
.album-card__title { padding: 16px 20px 18px; font-size: 17px; font-weight: 600; line-height: 1.4; color: #1d3527; }
.album-card:hover .album-card__title { color: #18613e; }

/* ===== Фотогалерея: страница альбома ===== */
.album-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 22px; }
.album-head__back {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
    background: #eef6ef; color: #18613e !important; font-size: 14px; font-weight: 600; text-decoration: none !important;
}
.album-head__back:hover { background: #dcefdd; }
.album-head__title { flex-basis: 100%; order: 2; margin: 4px 0 0; font-size: 28px; font-weight: 700; line-height: 1.25; letter-spacing: -.3px; color: #14271c; }
.album-head__count { order: 1; margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: #5f7a68; font-size: 14px; font-weight: 500; }
.album-head__count .fa { color: #348e38; }

.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.photo-grid__item {
    position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 14px; background: #e3efe4;
    box-shadow: 0 1px 2px rgba(16, 60, 36, .06), 0 6px 18px rgba(16, 60, 36, .08);
}
.photo-grid__item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.photo-grid__item:hover img { transform: scale(1.06); }
.photo-grid__caption {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: flex; flex-direction: column; gap: 3px;
    padding: 28px 14px 12px; color: #fff; font-size: 14px; font-weight: 500; line-height: 1.35;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(6,30,18,.8) 100%);
    opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease;
}
.photo-grid__caption span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.photo-grid__caption small { font-size: 12px; opacity: .85; }
.photo-grid__zoom {
    position: absolute; top: 10px; right: 10px; z-index: 1; width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .9); color: #18613e;
    opacity: 0; transform: scale(.8); transition: opacity .25s ease, transform .25s ease;
}
.photo-grid__item:hover .photo-grid__caption, .photo-grid__item:focus-visible .photo-grid__caption { opacity: 1; transform: none; }
.photo-grid__item:hover .photo-grid__zoom, .photo-grid__item:focus-visible .photo-grid__zoom { opacity: 1; transform: none; }
@media (hover: none) { .photo-grid__caption { opacity: 1; transform: none; } }   /* на телефоне подпись видна сразу */

.gallery-page { padding-bottom: 88px; }
@media (max-width: 991px) { .album-grid, .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) {
    .album-grid { grid-template-columns: 1fr; gap: 20px; }
    .photo-grid { gap: 10px; }
    .album-head__title { font-size: 22px; }
}
@media (max-width: 767px) { .gallery-page { padding-bottom: 32px; } }

/* ===== Анимации: значок типа, класс и предмет, источник (animations.tpl) ===== */
.anim-card .WCU-image .anim-badge {
    position: absolute; left: 12px; top: 12px; z-index: 3;
    padding: 4px 10px; border-radius: 999px;
    background: rgba(255, 255, 255, .92); color: #18613e;
    font-size: 12px; font-weight: 600; line-height: 1.3; pointer-events: none;
}
.anim-card--sim .WCU-image .anim-badge { background: #18613e; color: #fff; }
/* у симуляции вместо «▶» — значок «руки» (интерактив) */
.page-sub-animations .anim-card--sim .WCU-image > a::after { content: "\f25a"; padding-left: 0; }
.anim-card .anim-meta { margin: 8px 0 0; font-size: 14px; font-weight: 500; color: #348e38; }
.anim-card .anim-source { margin: 6px 0 0; font-size: 12px; line-height: 1.4; color: #7a8a80; }

/* ===== Окно просмотра: кнопки «Ulashish» (fixes.js: .video-modal__share) ===== */
.video-modal__share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.video-modal__share:empty { display: none; }
.video-modal__share-label { color: rgba(255, 255, 255, .85); font-size: 14px; font-weight: 500; margin-right: 2px; }
.video-modal__share-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%;
    color: #fff; font-size: 17px; cursor: pointer; transition: transform .15s, filter .15s;
}
.video-modal__share-btn:hover, .video-modal__share-btn:focus-visible { transform: translateY(-2px); filter: brightness(1.1); color: #fff; }
.video-modal__share-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.video-modal__share-btn.is-tg { background: #229ed9; }
.video-modal__share-btn.is-wa { background: #25d366; }
.video-modal__share-btn.is-fb { background: #1877f2; }
.video-modal__share-btn.is-copy, .video-modal__share-btn.is-native { background: rgba(255, 255, 255, .18); }
.video-modal__copied { color: #b9f6ca; font-size: 13px; font-weight: 500; }
@media (max-width: 767px) {
    /* на телефоне панель — под видео, на светлом фоне окна */
    .video-modal__share { order: 2; flex-shrink: 0; margin: 0; padding: 8px 14px 10px; border-bottom: 1px solid #edf1ee; }
    .video-modal__share-label { color: #1d3527; }
    .video-modal__share-btn.is-copy, .video-modal__share-btn.is-native { background: #e8f5e9; color: #18613e; }
    .video-modal__share-btn.is-copy:hover, .video-modal__share-btn.is-native:hover { color: #18613e; }
}

/* Лаборатории и симуляции в окне просмотра (fixes.js: .video-modal.is-lab) */
@media (max-width: 767px) {
    /* вместо полосы 16:9 — почти весь экран; название и «Ulashish» остаются видны снизу */
    /* фрейм занимает всё место, что осталось после компактной строки названия и кнопок */
    .video-modal.is-lab .video-modal__frame { aspect-ratio: auto; flex: 1 1 auto; height: auto; min-height: 0; }
    .video-modal.is-lab .video-modal__more { display: none; }
    .video-modal.is-lab .video-modal__head { padding: 7px 12px 5px; border-bottom: 0; }
    .video-modal.is-lab .video-modal__title { font-size: 15px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .video-modal.is-lab .video-modal__share { gap: 6px; padding: 0 12px 8px; border-bottom: 0; }
    .video-modal.is-lab .video-modal__share-label { display: none; }
    .video-modal.is-lab .video-modal__share-btn { width: 30px; height: 30px; font-size: 14px; }
}

/* Главная (вторая редакция): витрина лабораторий, свежие новости */
.home-block-sub { margin: -6px auto 0; max-width: 640px; text-align: center; color: #5d7266; font-size: 16px; }
.home-labs { padding-top: 36px; }  /* без своего фона — виден общий узор страницы */
.home-card--lab img { aspect-ratio: 16 / 9; }
.home-card .fa-calendar { color: #348e38; margin-right: 4px; }

/* Тема задаёт body { color: #fff } — в блоках главной текст тёмный явно */
.platform-intro, .platform-card, .home-block { color: #1d3527; }
.platform-intro-text, .platform-card p { color: #3d5246; }
a.platform-card:hover, a.platform-card:focus { color: #1d3527; }
.home-card-title { color: #1d3527; }
.home-card:hover .home-card-title, .home-card:focus .home-card-title { color: #18613e; }
.home-block-sub { color: #5d7266; }
.home-redbook { background: none; }
.home-redbook .home-card img { aspect-ratio: 4 / 3; }

/* Карточки главной: аккуратная типографика (у темы body line-height: 30px) */
.home-block .section-title-box { margin-bottom: 28px; }
.home-block .section-title { margin-bottom: 0; }
.home-block-sub { margin: 10px auto 0; line-height: 1.5; }
.home-card { line-height: 1.4; }
.home-card-title {
    margin: 8px 18px 18px; font-size: 17px; line-height: 1.35; font-weight: 600;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.home-card-label { margin: 14px 18px 0; font-size: 13px; line-height: 1.4; letter-spacing: 0; text-transform: none; color: #5d7266; }
.home-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 14px 18px 0; font-size: 13px; line-height: 1.4; }
.home-chip { flex: none; padding: 3px 10px; border-radius: 999px; background: #e8f5e9; color: #18613e; font-weight: 600; }
.home-card-subj { color: #5d7266; }

/* Главная: зазор между заголовком блока и карточками — с обеих сторон, селектор точнее темы */
section.home-block .container > .section-title-box { margin-bottom: 32px; }
section.home-block .container > .home-cards { margin-top: 0; }
section.home-block .section-title-box .section-title { margin-top: 0; }
/* Qizil kitob: рисунки на белом фоне разных пропорций — целиком, без обрезки */
.home-redbook .home-card img { object-fit: contain; background: #fff; padding: 12px; }

/* Главная: заголовки блоков в стиле сайта — слева, с зелёным акцентом, «Barchasi →» справа */
section.home-block .container > .home-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    margin-bottom: 26px; text-align: left;
}
.home-head .section-title,
.flat-testimonials .section-title-box .section-title {
    position: relative; margin: 0; padding-left: 16px;
    font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -.3px; color: #18613e;
}
.home-head .section-title::before,
.flat-testimonials .section-title-box .section-title::before {
    content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 5px; border-radius: 3px; background: #348e38;
}
.flat-testimonials .section-title-box { text-align: left; }
.home-head .home-block-sub { margin: 8px 0 0; max-width: none; text-align: left; font-size: 15px; }
.home-more { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; color: #18613e; font-weight: 600; font-size: 15px; line-height: 1.2; white-space: nowrap; }
.home-more:hover, .home-more:focus-visible { background: #e8f5e9; color: #18613e; }
@media (max-width: 767px) {
    .home-head .section-title, .flat-testimonials .section-title-box .section-title { font-size: 23px; }
    section.home-block .container > .home-head { flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
    .home-more { padding: 6px 0; }
}

/* ===== Главная: первый экран вместо слайдера (index.tpl .hero) ===== */
/* у темы .page-title-home1 { height: 975px } — под старый слайдер; высота по содержимому */
.hero.page-title-home1 { height: auto; min-height: 0; }
.hero { padding: 190px 0 70px; color: #1d3527; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; }
/* у Bootstrap .container есть ::before/::after (clearfix) — в сетке они занимали ячейки и сдвигали колонки */
.hero-inner::before, .hero-inner::after { content: none; display: none; }
.hero-eyebrow {
    display: inline-block; margin-bottom: 14px; padding: 6px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, .8); color: #18613e; font-size: 14px; font-weight: 600; line-height: 1.3;
}
.hero-title { margin: 0 0 16px; font-size: 48px; line-height: 1.12; font-weight: 800; letter-spacing: -.8px; color: #0f4a2e; }
.hero-sub { margin: 0 0 28px; max-width: 560px; font-size: 18px; line-height: 1.6; color: #3d5246; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px; border-radius: 12px;
    background: #fff; color: #18613e; font-weight: 600; font-size: 16px; line-height: 1.2;
    box-shadow: 0 4px 14px rgba(16, 60, 36, .1); transition: transform .2s, box-shadow .2s, background .2s;
}
.hero-btn.is-main { background: #18613e; color: #fff; }
.hero-btn:hover, .hero-btn:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16, 60, 36, .18); color: #18613e; }
.hero-btn.is-main:hover, .hero-btn.is-main:focus-visible { background: #0f4a2e; color: #fff; }
.hero-reco { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 26px; font-size: 14px; line-height: 1.4; color: #5d7266; }
.hero-reco a { color: #18613e; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(24, 97, 62, .35); }
.hero-reco a:hover { text-decoration-color: #18613e; }

/* коллаж 2×2 из превью лабораторий */
.hero-collage { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hero-tile {
    position: relative; display: block; overflow: hidden; border-radius: 16px; background: #fff;
    box-shadow: 0 10px 30px rgba(16, 60, 36, .18); transition: transform .3s, box-shadow .3s;
}
.hero-tile img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.hero-tile span {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px;
    background: linear-gradient(180deg, rgba(10, 40, 24, 0) 0%, rgba(10, 40, 24, .75) 100%);
    color: #fff; font-size: 13px; font-weight: 600; line-height: 1.3;
}
.hero-tile-1 { transform: rotate(-2deg); }
.hero-tile-2 { transform: rotate(1.5deg) translateY(18px); }
.hero-tile-3 { transform: rotate(1deg) translateY(-6px); }
.hero-tile-4 { transform: rotate(-1.5deg) translateY(12px); }
.hero-tile:hover, .hero-tile:focus-visible { transform: rotate(0) translateY(-4px) scale(1.02); box-shadow: 0 16px 40px rgba(16, 60, 36, .25); z-index: 1; }

/* блок «kimga» идёт сразу под первым экраном */
.platform-intro { padding-top: 40px; }
.platform-intro .platform-cards { margin-top: 0; }

@media (max-width: 991px) {
    .hero { padding: 170px 0 50px; }
    .hero-inner { grid-template-columns: 1fr; gap: 36px; }
    .hero-title { font-size: 38px; }
}
@media (max-width: 575px) {
    .hero { padding: 150px 0 36px; }
    .hero-title { font-size: 30px; }
    .hero-sub { font-size: 16px; }
    .hero-btn { flex: 1 1 100%; justify-content: center; }
    .hero-collage { gap: 10px; }
    .hero-tile span { font-size: 12px; padding: 18px 8px 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-tile, .hero-btn { transition: none; }
}

/* Цитаты: карусель обрезает всё за своим краем — рамка крайней карточки иногда пропадала (округление пикселей).
   Небольшой внутренний отступ держит рамку внутри видимой области. */
.flat-testimonials .owl-item > .item { padding: 0 3px; box-sizing: border-box; }

/* Первый экран: три блока в одной ячейке сетки — высота по самому высокому, без скачков */
.hero-slides { display: grid; }
.hero-slides::before, .hero-slides::after, .hero-nav::before, .hero-nav::after { content: none; display: none; }
.hero-slide { grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateX(24px); transition: opacity .6s ease, transform .6s ease, visibility 0s linear .6s; }
.hero-slide.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity .6s ease, transform .6s ease, visibility 0s; }
.hero { padding-bottom: 36px; }
.hero-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 34px; }
.hero-dots { display: flex; gap: 8px; }
.hero-dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 999px; background: rgba(24, 97, 62, .25); cursor: pointer; transition: width .3s, background .3s; }
.hero-dot.is-active { width: 28px; background: #18613e; }
.hero-arrow {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0;
    border: 0; border-radius: 50%; background: rgba(255, 255, 255, .85); color: #18613e; font-size: 20px; cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 60, 36, .12);
}
.hero-arrow:hover, .hero-arrow:focus-visible, .hero-dot:focus-visible { background: #18613e; color: #fff; }
.hero-dot:focus-visible, .hero-arrow:focus-visible { outline: 2px solid #18613e; outline-offset: 3px; }

/* цифры видов в слайде «Qizil kitob» */
.hero-stats { display: flex; gap: 12px; margin: -8px 0 26px; }
.hero-stats a { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 12px; background: rgba(255, 255, 255, .8); color: #1d3527; font-weight: 500; }
.hero-stats b { font-size: 24px; font-weight: 800; color: #c0392b; }
/* рисунки Красной книги — целиком на белом, название снизу */
.hero-collage--rb .hero-tile img { object-fit: contain; background: #fff; padding: 10px; }
.hero-collage--rb .hero-tile span {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px;
    background: rgba(255, 255, 255, .92); color: #1d3527; font-size: 13px; font-weight: 600; line-height: 1.3;
}
/* плитки-разделы в слайде «для учителей» */
.hero-icon-tile { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 10px; aspect-ratio: 16 / 10; padding: 18px; color: #fff; }
.hero-icon-tile .fa { font-size: 34px; opacity: .95; }
.hero-icon-tile span { font-size: 17px; font-weight: 700; line-height: 1.25; }
.hero-icon-tile.is-green { background: linear-gradient(135deg, #2e8b57, #18613e); }
.hero-icon-tile.is-orange { background: linear-gradient(135deg, #f39c12, #d35400); }
.hero-icon-tile.is-blue { background: linear-gradient(135deg, #3b8fd9, #1f5f8b); }
.hero-icon-tile.is-purple { background: linear-gradient(135deg, #9b59b6, #6c3483); }
.hero-icon-tile:hover, .hero-icon-tile:focus-visible { color: #fff; }
@media (max-width: 575px) {
    .hero-stats b { font-size: 20px; }
    .hero-icon-tile { padding: 12px; }
    .hero-icon-tile .fa { font-size: 26px; }
    .hero-icon-tile span { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .hero-slide { transition: none; transform: none; } }

/* Цитаты: у темы margin 99px сверху и 120px снизу — фото выступает над карточкой всего на ~41px */
.flat-testimonials .list-testimonials { margin: 52px 0 72px; }

/* Маршруты (/journey/routes/…): текст буклета, раньше залитый картинками, — обычной вёрсткой */
.route { color: #2c3e33; font-size: 17px; line-height: 1.7; }
.route h2 { margin: 36px 0 14px; font-size: 22px; line-height: 1.3; font-weight: 700; color: #18613e; }
.route h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; color: #1d3527; }
.route p { margin: 0 0 1em; }
.route-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 24px; padding: 0; list-style: none; }
.route-facts li { display: flex; flex-direction: column; padding: 10px 16px; border-radius: 12px; background: #e8f5e9; line-height: 1.3; }
.route-facts span { color: #5b7263; font-size: 13px; }
.route-facts b { color: #18613e; font-size: 16px; }
.route-fig { margin: 0 0 20px; }
.route-fig img { width: 100%; max-height: 420px; object-fit: cover; border-radius: 14px; }
.route-day { margin: 0 0 16px; padding: 18px 20px; border: 1px solid #e1eee4; border-radius: 16px; background: #f7fbf8; }
.route h2[id] { scroll-margin-top: 120px; }
.route-day-label { display: inline-block; margin-bottom: 8px; padding: 2px 12px; border-radius: 999px; background: #18613e; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.route-day h3 + p { color: #5b7263; font-size: 15px; }
.route-day > :last-child { margin-bottom: 0; }
.route-steps { margin: 12px 0 0; padding: 0; list-style: none; }
.route-steps li { position: relative; display: grid; grid-template-columns: 112px 1fr; gap: 14px; padding: 8px 0 8px 18px; border-left: 2px solid #cfe6d3; }
.route-steps li::before { content: ""; position: absolute; left: -6px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: #348e38; }
.route-steps time { color: #18613e; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.route-list { margin: 0; padding-left: 0; list-style: none; }
/* пункты плана со ссылкой на описание места ниже — видно, что по ним можно перейти */
.route-list a { display: inline-flex; align-items: baseline; gap: 6px; color: #18613e; text-decoration: none; border-bottom: 1px dashed rgba(24, 97, 62, .45); }
.route-list a::after { content: "↓"; font-size: .85em; color: #348e38; transition: transform .2s; }
.route-list a:hover, .route-list a:focus-visible { color: #348e38; border-bottom-style: solid; }
.route-list a:hover::after { transform: translateY(2px); }
.route-list li { position: relative; padding: 4px 0 4px 26px; }
.route-list li::before { content: ""; position: absolute; left: 4px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: #348e38; }
.route-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 0 0 1em; }
.route-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; }
.route-note { padding: 14px 18px; border-left: 4px solid #348e38; border-radius: 0 12px 12px 0; background: #f3faf4; }
@media (max-width: 575px) {
    .route { font-size: 16px; }
    .route h2 { font-size: 20px; margin-top: 28px; }
    .route-day { padding: 14px; }
    .route-steps li { grid-template-columns: 1fr; gap: 0; }
}

/* Единая тонкая рамка карточек (как в «Qizil kitob»): чуть темнее фона, при наведении — зеленее */
.news-card, .album-card,
:is(.page-sub-videos, .page-sub-animations) .flat-why-choose-us .flat-WCU-box,
.cat-card, .cat-article, .cat-box, .home-card, .platform-card { border: 1px solid #d3e2d8; }
.news-card:hover, .album-card:hover, .cat-card:hover, .cat-card:focus-visible, .home-card:hover,
:is(.page-sub-videos, .page-sub-animations) .flat-why-choose-us .flat-WCU-box:hover { border-color: #a9cbb3; }

/* ===== Главная v2 (откат: git checkout before-home-v2 -- site/assets/stylesheet/fixes.css или удалить этот блок) ===== */
/* 1. Первый экран растворяется в фоне страницы — без резкой нижней кромки и обрезанных дуги/листа */
.hero.page-title-home1 {
    padding-bottom: 130px;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 110px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 110px), transparent);
}
/* 2. Стрелки и точки слайдера — под текстом, по левому краю (на телефоне — по центру) */
.hero-nav { justify-content: flex-start; margin-top: 28px; }
@media (max-width: 767px) { .hero-nav { justify-content: center; } }
/* 3. Карточки «O‘quvchilarga / O‘qituvchilarga / Tashxis testi» — белые, зелёным только значок и кнопки */
.platform-card { background: #fff; box-shadow: 0 1px 2px rgba(16, 60, 36, .06), 0 6px 20px rgba(16, 60, 36, .08); }
a.platform-card:hover, a.platform-card:focus { border-color: #a9cbb3; }
.platform-card-links a { background: #e8f5e9; }
.platform-intro { margin-top: -40px; position: relative; }

/* Пометки «Tekshirilmagan» (материалы Claude без проверки) скрыты; показ — Alt+Shift+U или ?tekshiruv=1 (fixes.js) */
html:not(.show-unverified) .unverified,
html:not(.show-unverified) .unverified-note { display: none !important; }

/* Цитаты на главной: вместо садовой картинки темы (перчатки, лейка — Mask-testimonial-box.png)
   еле заметный узор раздела «Ekologik ta’limotlar tarixi», гаснет к верху карточки */
.flat-testimonials .box-item { background-image: none; background-color: #f3faf4; }
.flat-testimonials .box-item-overlay {
    position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
    background: url("/assets/images/page-title/ecohistory.svg") center bottom 8px / 560px auto no-repeat;
    opacity: .08;
    -webkit-mask-image: linear-gradient(to top, #000 20%, transparent 75%);
    mask-image: linear-gradient(to top, #000 20%, transparent 75%);
}

/* Главная: опрос BBB (KWL) — вопрос о сайте и три карточки с буквой «B»: Bilaman / Bilishni xohlayman / Bilib oldim
   (templates/kwl.tpl, kwl.js). После нажатия на карточках — процент, количество ответов и полоса. */
.home-kwl { color: #1d3527; }
.kwl {
    position: relative; padding: 40px 34px 34px; overflow: hidden; text-align: center;
    border: 1px solid #d3e2d8; border-radius: 24px;
    background: radial-gradient(circle at 12% 0%, rgba(52, 142, 56, .10), transparent 42%), radial-gradient(circle at 90% 100%, rgba(31, 95, 139, .08), transparent 40%), #fff;
    box-shadow: 0 6px 24px rgba(16, 60, 36, .08);
}
.kwl-eyebrow { display: inline-flex; align-items: center; gap: 4px; padding: 5px 14px 5px 6px; border-radius: 999px; background: #f0f6f1; color: #4a5e52; font-size: 14px; font-weight: 600; }
.kwl-eyebrow b { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 800; }
.kwl-eyebrow b:nth-child(1) { background: #18613e; } .kwl-eyebrow b:nth-child(2) { background: #1f5f8b; } .kwl-eyebrow b:nth-child(3) { background: #e0a030; margin-right: 6px; }
.kwl-q { max-width: 760px; margin: 16px auto 8px; font-size: 32px; line-height: 1.2; font-weight: 800; letter-spacing: -.4px; color: #0f4a2e; }
.kwl-hint { margin: 0 0 26px; color: #5b7263; font-size: 16px; }
.kwl-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.kwl-card {
    --c: #18613e; --c2: #2e8b57; --bg: #e3f3e5;
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0; padding: 28px 20px 24px;
    border: 1px solid #d3e2d8; border-radius: 20px; background: #fff; color: #1d3527; font: inherit; line-height: 1.4; text-align: center; cursor: pointer;
    -webkit-appearance: none; appearance: none;   /* тема задаёт кнопкам системный вид и зелёный фон */
    box-shadow: 0 1px 2px rgba(16, 60, 36, .06), 0 8px 22px rgba(16, 60, 36, .08);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.kwl-card.is-w { --c: #b06a00; --c2: #e8a93a; --bg: #fff0d2; }
.kwl-card.is-l { --c: #1f5f8b; --c2: #3b8fd9; --bg: #e1edf9; }
.kwl-card:hover, .kwl-card:focus-visible { transform: translateY(-6px); border-color: var(--c); background: #fff; box-shadow: 0 16px 34px rgba(16, 60, 36, .16); outline: none; }
.kwl-card:focus-visible { box-shadow: 0 0 0 3px var(--bg), 0 16px 34px rgba(16, 60, 36, .16); }
.kwl-letter {
    display: flex; align-items: center; justify-content: center; width: 96px; height: 96px; margin-bottom: 10px; border-radius: 50%;
    background: linear-gradient(135deg, var(--c2), var(--c)); color: #fff; font-size: 54px; font-weight: 800; line-height: 1;
    box-shadow: 0 0 0 10px var(--bg), 0 10px 22px rgba(0, 0, 0, .12);
    transition: transform .35s ease;
}
.kwl-card:hover .kwl-letter { transform: scale(1.06) rotate(-6deg); }
.kwl-name { margin-top: 8px; font-size: 21px; font-weight: 800; color: var(--c); }
.kwl-desc { color: #4a5e52; font-size: 15px; }
/* выбранная карточка: цветная рамка и галочка */
.kwl-card[aria-pressed="true"] { border-color: var(--c); box-shadow: 0 0 0 3px var(--bg), 0 12px 28px rgba(16, 60, 36, .14); }
.kwl-card[aria-pressed="true"]::after {
    content: "✓"; position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%;
    background: var(--c); color: #fff; font-size: 17px; font-weight: 800; line-height: 30px; text-align: center;
}
/* итоги на карточке */
.kwl-res { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; margin-top: 14px; padding-top: 14px; border-top: 1px dashed #d3e2d8; }
.kwl-res[hidden] { display: none; }
.kwl-pct { font-size: 40px; font-weight: 800; line-height: 1; color: var(--c); font-variant-numeric: tabular-nums; }
.kwl-cnt { color: #5b7263; font-size: 14px; font-weight: 600; }
.kwl-meter { display: block; width: 100%; height: 10px; margin-top: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.kwl-meter i { display: block; width: var(--fill, 0%); height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--c2), var(--c)); transition: width .8s ease; }
.kwl-card:disabled { cursor: progress; opacity: .85; }
.kwl-msg { max-width: 760px; margin: 22px auto 0; font-size: 16px; font-weight: 600; line-height: 1.55; } .kwl-msg:empty { display: none; }
.kwl-msg.is-error { color: #a02a17; }
.kwl-msg a { color: #18613e; text-decoration: underline; text-underline-offset: 3px; }
.kwl-total { margin: 8px 0 0; color: #7a8a80; font-size: 13.5px; } .kwl-total:empty { display: none; }
@media (max-width: 991px) {
    .kwl-q { font-size: 26px; }
    .kwl-letter { width: 78px; height: 78px; font-size: 44px; box-shadow: 0 0 0 8px var(--bg), 0 8px 18px rgba(0, 0, 0, .12); }
    .kwl-name { font-size: 18px; }
}
@media (max-width: 767px) {
    .kwl { padding: 26px 16px 22px; border-radius: 18px; }
    .kwl-q { font-size: 22px; }
    .kwl-hint { margin-bottom: 18px; font-size: 15px; }
    .kwl-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    /* на телефоне карточка горизонтальная: буква слева, текст справа, итоги — во всю ширину снизу */
    .kwl-card { display: grid; grid-template-columns: 60px minmax(0, 1fr); column-gap: 14px; row-gap: 0; align-items: center; padding: 14px 16px; text-align: left; border-radius: 16px; }
    .kwl-card:hover { transform: none; }
    .kwl-letter { grid-row: 1 / span 2; width: 60px; height: 60px; margin: 0; font-size: 34px; box-shadow: 0 0 0 5px var(--bg); }
    .kwl-name { margin: 0; font-size: 17px; }
    .kwl-desc { font-size: 14px; }
    .kwl-res { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 12px; padding-top: 10px; }
    .kwl-pct { font-size: 28px; }
    .kwl-meter { margin-top: 4px; height: 8px; }
    .kwl-card[aria-pressed="true"]::after { top: 10px; right: 10px; width: 24px; height: 24px; font-size: 14px; line-height: 24px; }
}
@media (prefers-reduced-motion: reduce) { .kwl-card, .kwl-letter, .kwl-meter i { transition: none; } }
