@import url('https://fonts.googleapis.com/css2?family=Inter:wght@800&display=swap');

:root {
    --bg-main: #0f172a;
    --bg-alt: #F0EDE0;
    --text-main: #e5e7eb;
    --accent: #7C3A17;
    --danger: #991b1b;
    /* Единая тёплая палитра сайта */
    --site-cream: #FFF9ED;
    --site-cream-muted: #F0EDE0;
    --site-surface: #FAFAFA;
    --site-brown: #5C4033;
    --site-brown-deep: #7C3A17;
    --site-brown-rgb: 92, 64, 51;
    --site-brown-deep-rgb: 124, 58, 23;
    /* Совместимость со старыми токенами (--site-blue*): теперь оттенки коричневой палитры */
    --site-blue: #5C4033;
    --site-blue-rgb: 92, 64, 51;
    --site-blue-soft-bg: #F0EDE0;
    --site-blue-soft-border: #e0d8c8;
    --site-blue-gradient-light: #a67c5d;
    --site-blue-gradient-mid: #7C3A17;
    --site-blue-on-dark: #d4b8a0;
    --site-blue-heading-on-dark: #e8d5c4;
    --bs-blue: #5C4033;
    --bs-primary: #5C4033;
    --bs-primary-rgb: 92, 64, 51;
    /* Primary-кнопки: оттенки #5C4033 */
    --politruk-btn-primary: #5C4033;
    --politruk-btn-primary-hover: #7C3A17;
    --politruk-btn-primary-active-bg: #4a3329;
    --politruk-btn-primary-active-border: #3f2c23;
    --politruk-btn-primary-rgb: 92, 64, 51;
}

/* Primary-кнопки Bootstrap (в сборке зашиты #0d6efd — смягчаем) */
.btn-primary {
    color: #fff;
    background-color: var(--politruk-btn-primary);
    border-color: var(--politruk-btn-primary);
}

.btn-primary:hover {
    color: #fff;
    background-color: var(--politruk-btn-primary-hover);
    border-color: var(--politruk-btn-primary-hover);
}

.btn-check:focus + .btn-primary,
.btn-primary:focus {
    color: #fff;
    background-color: var(--politruk-btn-primary-hover);
    border-color: var(--politruk-btn-primary-hover);
    box-shadow: 0 0 0 0.25rem rgba(var(--politruk-btn-primary-rgb), 0.4);
}

.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary,
.btn-primary:active,
.btn-primary.active,
.show > .btn-primary.dropdown-toggle {
    color: #fff;
    background-color: var(--politruk-btn-primary-active-bg);
    border-color: var(--politruk-btn-primary-active-border);
}

.btn-check:checked + .btn-primary:focus,
.btn-check:active + .btn-primary:focus,
.btn-primary:active:focus,
.btn-primary.active:focus,
.show > .btn-primary.dropdown-toggle:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--politruk-btn-primary-rgb), 0.4);
}

.btn-primary:disabled,
.btn-primary.disabled {
    color: #fff;
    background-color: var(--politruk-btn-primary);
    border-color: var(--politruk-btn-primary);
}

.btn-outline-primary {
    color: var(--politruk-btn-primary);
    border-color: var(--politruk-btn-primary);
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: var(--politruk-btn-primary);
    border-color: var(--politruk-btn-primary);
}

.btn-check:focus + .btn-outline-primary,
.btn-outline-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--politruk-btn-primary-rgb), 0.4);
}

.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary,
.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-outline-primary.dropdown-toggle.show {
    color: #fff;
    background-color: var(--politruk-btn-primary);
    border-color: var(--politruk-btn-primary);
}

.btn-check:checked + .btn-outline-primary:focus,
.btn-check:active + .btn-outline-primary:focus,
.btn-outline-primary:active:focus,
.btn-outline-primary.active:focus,
.btn-outline-primary.dropdown-toggle.show:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--politruk-btn-primary-rgb), 0.4);
}

.btn-outline-primary:disabled,
.btn-outline-primary.disabled {
    color: var(--politruk-btn-primary);
    background-color: transparent;
}

.text-primary {
    color: var(--politruk-btn-primary) !important;
}

.link-primary {
    color: var(--politruk-btn-primary) !important;
}

.link-primary:hover,
.link-primary:focus {
    color: var(--politruk-btn-primary-hover) !important;
}

.bg-primary {
    background-color: var(--politruk-btn-primary) !important;
}

.border-primary {
    border-color: var(--politruk-btn-primary) !important;
}

/* Единый стиль подсказок/инструкций по сайту */
.alert-info {
    color: #1e5631;
    background-color: #e8f8e8;
    border-color: #b9e3b9;
}

.alert-info a {
    color: #1a4f2b;
}

.form-text {
    color: #2f6d3c;
}

/* Пагинация — стиль сайта */
.pagination {
    gap: 0.35rem;
}

.pagination .page-item {
    margin: 0;
}

.pagination .page-link {
    border-radius: 9px !important;
    border: 1px solid #d7cfc8;
    color: var(--politruk-btn-primary);
    background: #fff;
    font-weight: 600;
    min-width: 2.15rem;
    text-align: center;
    box-shadow: 0 1px 2px rgba(92, 64, 51, 0.06);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.pagination .page-link:hover {
    background: #f6f1ed;
    border-color: #b9a89a;
    color: var(--politruk-btn-primary-active-bg);
    z-index: 2;
}

.pagination .page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--politruk-btn-primary-rgb), 0.28);
    z-index: 3;
}

.page-item.active .page-link {
    background-color: var(--politruk-btn-primary);
    border-color: var(--politruk-btn-primary);
    color: #fff;
    box-shadow: 0 3px 10px rgba(var(--politruk-btn-primary-rgb), 0.28);
}

.page-item.disabled .page-link {
    color: #a8988c;
    background: #f8f6f4;
    border-color: #e5ddd6;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: var(--site-surface);
    color: #111827;
}

.site-header,
.site-footer {
    background: linear-gradient(120deg, #111827, #1f2937);
    color: var(--text-main);
}

.header-topbar {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 0.45rem 0.6rem;
}

.header-search-form {
    min-width: 240px;
    position: relative;
}

.header-user-chip {
    min-width: 180px;
    max-width: 280px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.25rem 0.55rem 0.25rem 0.3rem;
}

.header-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: var(--site-blue);
    color: #fff;
    flex-shrink: 0;
}

.header-user-meta {
    line-height: 1.1;
}

.header-user-name {
    font-size: 0.85rem;
    color: #f9fafb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-user-role {
    font-size: 0.72rem;
    color: rgba(229, 231, 235, 0.82);
}

.header-search-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.3rem);
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.24);
    z-index: 40;
    overflow: hidden;
}

.header-search-item {
    width: 100%;
    border: 0;
    background: #fff;
    text-align: left;
    display: block;
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid #eef2f7;
}

.header-search-item:last-child {
    border-bottom: 0;
}

.header-search-item:hover,
.header-search-item.active {
    background: #eef2ff;
}

.header-search-item-title {
    display: block;
    font-size: 0.86rem;
    color: #0f172a;
}

.header-search-item-meta {
    display: block;
    font-size: 0.74rem;
    color: #64748b;
}

.header-search-mark {
    background: #fde68a;
    color: #111827;
    padding: 0 1px;
    border-radius: 3px;
}

.text-light-50 {
    color: rgba(229, 231, 235, 0.78);
}

.main-nav .nav-link {
    color: #d1d5db;
}

.main-nav .nav-link > i {
    font-size: 1.05rem;
    margin-right: 0.65rem;
    vertical-align: -0.1em;
}

.main-nav .nav-link.active,
.main-nav .nav-link:hover {
    background: rgba(245, 158, 11, 0.2);
    color: #fff;
}

.main-nav .dropdown-menu.main-nav-schools-dropdown {
    max-height: min(70vh, 28rem);
    overflow-y: auto;
}

.main-nav .dropdown-menu.main-nav-schools-dropdown .dropdown-item {
    white-space: normal;
}

.main-nav .dropdown-menu .dropdown-item.active,
.main-nav .dropdown-menu .dropdown-item:active {
    background-color: rgba(var(--site-blue-rgb), 0.12);
    color: var(--site-brown);
}

.main-nav .dropdown-toggle::after {
    vertical-align: 0.15em;
}

.logo-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #b91c1c;
    color: #fff;
    font-weight: 700;
}

.site-header-brand {
    min-width: 0;
}

.site-logo-circle {
    width: clamp(4.25rem, 12vw, 7rem);
    height: clamp(4.25rem, 12vw, 7rem);
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.07);
    border: 2px solid rgba(255, 255, 255, 0.32);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.site-logo-circle:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 3px;
}

.site-logo-circle-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.site-logo-circle-placeholder {
    width: 62%;
    height: 62%;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.28);
    box-sizing: border-box;
}

.site-brand.var1 {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-width: min(100%, 44rem);
}

.site-brand-name {
    margin: 0;
    padding: 0;
    font-size: unset;
    font-weight: unset;
    line-height: 1.15;
}

.site-brand-home-link {
    display: inline-block;
}

.site-brand.var1 .logo-text {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: clamp(2.35rem, 5.5vw, 3.85rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
    line-height: 1.05;
    /* Контраст к тёмному хедеру: светлый градиент по буквам */
    background: linear-gradient(165deg, #ffffff 0%, #e8eef5 45%, #cbd5e1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.site-brand.var1 .logo-text::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: clamp(52px, 18vw, 72px);
    height: 4px;
    background: #e63946;
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.site-brand-tagline {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 1.056rem;
    font-weight: 400;
    color: rgba(229, 231, 235, 0.85);
    line-height: 1.45;
    letter-spacing: 0.01em;
}

@media (min-width: 992px) {
    .site-brand-tagline {
        font-size: 1.138rem;
    }
}

.hero-section {
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.58), rgba(15, 23, 42, 0.52)),
        url('../img/fon/lenta4.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
}

.panel {
    border-radius: 14px;
    padding: 1rem;
    background: rgba(22, 31, 49, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(2px);
    /* Явный светлый текст: иначе наследуется цвет body (#111827) и теряется на тёмном фоне */
    color: rgba(255, 255, 255, 0.94);
}

.panel-light {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #111827;
}

.partner-logo-frame {
    width: 84px;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: var(--site-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.partner-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 6px;
}

.partner-logo-placeholder {
    color: #64748b;
}

.partner-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    text-align: center;
    width: 95px;
    height: 95px;
    min-height: 95px;
    padding: 0.35rem !important;
    gap: 0.2rem;
    margin-left: auto;
    margin-right: auto;
}

.partner-card-media {
    flex-shrink: 0;
}

.partner-card-name {
    font-weight: 600;
    line-height: 1.25;
    color: #111827;
}

.countdown {
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    display: inline-block;
}

.countdown #countdown-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.section-title h2 {
    margin-bottom: 0.25rem;
    color: var(--site-blue);
    font-weight: 700;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.section-title h2 .bi {
    color: var(--site-blue);
}

.section-title p {
    color: #6b7280;
}

/* Кнопки в блоке «Партнёры» на главной */
.home-partners-actions .home-partners-action-btn {
    box-shadow: 0 4px 14px rgba(var(--site-blue-rgb), 0.18);
    border-radius: 10px;
}

.home-partners-actions .home-partners-action-btn:hover {
    box-shadow: 0 6px 18px rgba(var(--site-blue-rgb), 0.26);
}

body.theme-dark .home-partners-actions .home-partners-action-btn {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.55);
}

body.theme-dark .home-partners-actions .home-partners-action-btn:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    color: #fff;
    border-color: rgba(226, 232, 240, 0.65);
}

/* Заголовки страниц и подразделов (не страницы училищ — там .school-section-title) */
.site-page-heading {
    color: var(--site-blue);
    font-weight: 700;
}

.site-page-heading .bi {
    color: var(--site-blue);
}

.site-subsection-heading {
    color: var(--site-blue);
    font-weight: 600;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.site-subsection-heading .bi {
    color: var(--site-blue);
}

.alt-bg {
    background: var(--bg-alt);
}

.ussr-map {
    position: relative;
    height: 430px;
    border-radius: 16px;
    background:
        radial-gradient(circle at 30% 35%, rgba(245, 158, 11, 0.18), transparent 20%),
        radial-gradient(circle at 60% 45%, rgba(239, 68, 68, 0.18), transparent 24%),
        linear-gradient(160deg, #1f2937, #374151);
    overflow: hidden;
}

.map-caption {
    position: absolute;
    left: 12px;
    top: 12px;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: #f9fafb;
    font-size: 0.85rem;
}

.school-star {
    position: absolute;
    color: #facc15;
    transform: translate(-50%, -50%);
    font-size: 1.25rem;
    text-decoration: none;
    transition: transform 0.15s ease, color 0.15s ease;
}

.school-star:hover {
    color: #fde047;
    transform: translate(-50%, -50%) scale(1.15);
}

.map-tooltip {
    position: absolute;
    min-width: 260px;
    max-width: 300px;
    background: rgba(17, 24, 39, 0.95);
    color: #f9fafb;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.65rem;
    display: none;
    pointer-events: none;
    z-index: 5;
    font-size: 0.9rem;
}

.yandex-map-embed {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #d1d5db;
    background: #fff;
}

.fact-tile {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    height: 100%;
}

.fact-tile span {
    display: block;
    font-weight: 700;
    font-size: 1.4rem;
}

.media-card,
.profile-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    height: 100%;
}

/* Текстура фона: переменные задаёт #schools-list (includes/school_list_card_design.php) */
.school-list-card {
    display: flex;
    flex-direction: column;
    background-color: var(--school-lc-fill, rgba(240, 240, 242, 0.38));
    background-image: linear-gradient(var(--school-lc-veil, rgba(255, 255, 255, 0.1)), var(--school-lc-veil, rgba(255, 255, 255, 0.1))), var(--school-lc-bg, url('../img/fon/fon33.jpg'));
    background-size: auto, cover;
    background-position: center, center;
    background-repeat: no-repeat;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    height: 100%;
    box-shadow:
        0 4px 14px rgba(15, 23, 42, 0.08),
        0 2px 6px rgba(15, 23, 42, 0.05);
    transition: box-shadow 0.2s ease;
}

.school-list-card:hover {
    box-shadow:
        0 10px 28px rgba(15, 23, 42, 0.12),
        0 4px 10px rgba(15, 23, 42, 0.06);
}

.school-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 0.7rem;
}

.school-list-card .school-card-title-block {
    flex: 1;
    min-width: 0;
    align-self: stretch;
    background: rgba(255, 255, 255, 0.78);
    border-radius: 10px;
    padding: 0.5rem 0.65rem;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.65),
        0 1px 4px rgba(15, 23, 42, 0.06);
}

body.theme-dark .school-list-card .school-card-title-block {
    background: rgba(30, 38, 52, 0.55);
    box-shadow:
        inset 0 0 0 1px rgba(237, 233, 219, 0.14),
        0 1px 6px rgba(0, 0, 0, 0.25);
}

.school-list-card .school-card-title-block h3 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0;
}

/* Ровно 4 строки под название: короткое — «пустые» строки, длинное — обрезка с многоточием */
.school-list-card .school-card-title-block h3 a {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
    min-height: calc(1.3em * 4);
    line-height: 1.3;
    text-align: justify;
    text-align-last: left;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    color: #111827;
}

.school-list-card .school-card-title-block h3 a:hover {
    color: #b91c1c;
}

.school-list-card .school-card-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.school-logo-circle {
    width: calc(62px * 1.2);
    height: calc(62px * 1.2);
    flex: 0 0 calc(62px * 1.2);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--site-blue-gradient-light), var(--site-blue));
    border: 2px solid var(--site-blue-soft-border);
    display: grid;
    place-items: center;
    font-size: 0.66rem;
    font-weight: 700;
    color: #eff6ff;
    overflow: hidden;
}

.school-logo-circle--with-img {
    background: #FCFAF5;
    border-color: #cbd5e1;
}

.school-card-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 6px;
    box-sizing: border-box;
}

.school-awards-strip {
    min-height: 52px;
    border-radius: 10px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    padding: 0.35rem 0;
    margin-bottom: 0.75rem;
}

/* Пустая полоса: тот же вертикальный «шаг», что и при наличии наград, без видимой заливки */
.school-awards-strip--empty {
    pointer-events: none;
}

.school-award-slot {
    width: 44px;
    height: 44px;
    aspect-ratio: 1;
    flex-shrink: 0;
    border-radius: 6px;
    border: 1px solid #94a3b8;
    background: linear-gradient(180deg, var(--site-blue-soft-bg) 0%, var(--site-blue-soft-border) 45%, var(--site-blue-gradient-mid) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.school-award-slot.has-image {
    background: #fff;
    border-color: #64748b;
}

.school-award-slot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 4px;
    box-sizing: border-box;
    display: block;
}

.school-card-content p {
    line-height: 1.25;
}

/* Кнопки «Сайт и социальные сети» на карточке списка — в палитре карточки (состаренное золото/сепия) */
.school-card-social-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.school-card-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #5c4033;
    border: 2px solid #6b4423;
    background-color: rgba(255, 255, 255, 0.55);
    font-size: 0.95rem;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(92, 64, 51, 0.16);
    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.school-card-social-btn:hover,
.school-card-social-btn:focus-visible {
    color: #2a1c14;
    border-color: #a67c52;
    background-color: #cc9966;
    box-shadow: 0 5px 12px rgba(139, 90, 43, 0.32);
    transform: translateY(-2px) scale(1.06);
}

.school-card-social-btn-text {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.01em;
}

body.theme-dark .school-card-social-btn {
    color: #d2a679;
    border-color: #b8956a;
    background-color: rgba(30, 38, 52, 0.5);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

body.theme-dark .school-card-social-btn:hover,
body.theme-dark .school-card-social-btn:focus-visible {
    color: #2a1c14;
    border-color: #a67c52;
    background-color: #cc9966;
    box-shadow: 0 5px 14px rgba(204, 153, 102, 0.3);
}

/* «Текущее состояние» на карточке списка: ровно 4 строки текста, короткое — пустое место, длинное — многоточие */
.school-list-card .school-card-status-heading {
    display: block;
    margin-bottom: 0.2rem;
}

.school-list-card .school-card-status-value {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
    line-height: 1.25;
    min-height: calc(1.25em * 4);
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 1rem;
    text-align: justify;
    text-align-last: left;
}

.school-list-card .school-card-footer {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.35rem;
}

.school-list-card .school-card-footer-stats {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.school-list-card .school-card-footer-stats .school-card-stat-line {
    color: #6b4423;
    line-height: 1.25;
}

.school-list-card .school-card-footer-stats .school-card-stat-line strong {
    color: inherit;
    font-weight: 600;
}

body.theme-dark .school-list-card .school-card-footer-stats .school-card-stat-line {
    color: #ede9db !important;
}

body.theme-dark .school-list-card .school-card-footer-stats .school-card-stat-line strong {
    color: inherit;
}

.school-list-card .school-card-more-btn {
    flex-shrink: 0;
    color: #5c4033;
    border-color: #6b4423;
    border-width: 2px;
    font-weight: 600;
    background-color: transparent;
    box-shadow: 0 3px 10px rgba(92, 64, 51, 0.18);
    border-radius: 8px;
    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        font-weight 0.12s ease;
}

.school-list-card .school-card-more-btn:hover,
.school-list-card .school-card-more-btn:focus-visible {
    color: #2a1c14;
    border-color: #a67c52;
    border-width: 2px;
    background-color: #cc9966;
    font-weight: 700;
    box-shadow: 0 5px 14px rgba(139, 90, 43, 0.35);
}

body.theme-dark .school-list-card .school-card-more-btn {
    color: #d2a679;
    border-color: #b8956a;
    border-width: 2px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}

body.theme-dark .school-list-card .school-card-more-btn:hover,
body.theme-dark .school-list-card .school-card-more-btn:focus-visible {
    color: #2a1c14;
    border-color: #a67c52;
    border-width: 2px;
    background-color: #cc9966;
    font-weight: 700;
    box-shadow: 0 5px 16px rgba(204, 153, 102, 0.32);
}

/* Поверх общих .btn-outline-primary — фокус/нажатие без синей заливки */
.school-list-card .btn.btn-outline-primary.school-card-more-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(107, 68, 35, 0.28);
}

.school-list-card .btn.btn-outline-primary.school-card-more-btn:active,
.school-list-card .btn.btn-outline-primary.school-card-more-btn.active,
.school-list-card .btn.btn-outline-primary.school-card-more-btn.dropdown-toggle.show {
    color: #2a1c14;
    border-color: #956842;
    border-width: 2px;
    background-color: #b88355;
    font-weight: 700;
}

body.theme-dark .school-list-card .btn.btn-outline-primary.school-card-more-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(204, 153, 102, 0.32);
}

body.theme-dark .school-list-card .btn.btn-outline-primary.school-card-more-btn:active,
body.theme-dark .school-list-card .btn.btn-outline-primary.school-card-more-btn.active,
body.theme-dark .school-list-card .btn.btn-outline-primary.school-card-more-btn.dropdown-toggle.show {
    color: #2a1c14;
    border-color: #956842;
    border-width: 2px;
    background-color: #b88355;
    font-weight: 700;
}

/* Общий фон блоков фильтров (списки, новости, воспоминания и т.п.) */
.site-filters-block,
.school-filters {
    background-color: var(--site-cream-muted);
}

.card.site-filters-block {
    --bs-card-bg: var(--site-cream-muted);
}

.school-filters {
    border-radius: 12px;
    border: 1px solid var(--site-blue-soft-border);
    padding: 1rem;
}

.news-portal-filters.card {
    background-color: var(--site-cream-muted);
    --bs-card-bg: var(--site-cream-muted);
}

.news-portal-filters .card-body {
    background-color: transparent;
}

/* Лента новостей: фильтры в одну линию (с переносом), кнопки отдельным рядом */
.news-portal-filter-form .news-portal-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.news-portal-filter-form .news-portal-filter-field {
    flex: 0 0 auto;
    min-width: 0;
}

.news-portal-filter-form .news-portal-filter-field--grow {
    flex: 1 1 14rem;
    min-width: 11rem;
}

.news-portal-filter-form .news-portal-filter-field--date {
    flex: 0 1 10.5rem;
    min-width: 9.5rem;
}

.news-portal-filter-form .news-portal-filter-field--select {
    flex: 0 1 11rem;
    min-width: 9rem;
}

.news-portal-filter-form .news-portal-filter-field .form-label {
    white-space: nowrap;
}

.news-portal-filter-form .news-portal-filter-actions {
    margin-top: 0.25rem;
}

.news-portal-live-count .news-portal-live-count-hint {
    font-size: 0.8em;
}

/* Кнопки в блоках фильтров — заметная тень на светлом фоне панели */
.school-filters .btn,
#school-empty-state .btn,
.news-portal-filters.card .btn,
.site-filters-block.card .btn {
    box-shadow:
        0 6px 18px rgba(15, 23, 42, 0.16),
        0 3px 8px rgba(15, 23, 42, 0.1),
        0 1px 2px rgba(15, 23, 42, 0.06);
    border-radius: 9px;
}

.school-filters .btn:hover,
#school-empty-state .btn:hover,
.news-portal-filters.card .btn:hover,
.site-filters-block.card .btn:hover {
    box-shadow:
        0 9px 26px rgba(15, 23, 42, 0.2),
        0 4px 12px rgba(15, 23, 42, 0.12),
        0 2px 4px rgba(15, 23, 42, 0.08);
}

.school-filters .btn:active,
#school-empty-state .btn:active,
.news-portal-filters.card .btn:active,
.site-filters-block.card .btn:active {
    box-shadow:
        0 3px 10px rgba(15, 23, 42, 0.14),
        0 1px 4px rgba(15, 23, 42, 0.08);
}

.school-active-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.85rem;
    color: #312e81;
}

.chip-icon {
    font-size: 0.9rem;
    line-height: 1;
}

.filter-chip button {
    border: 0;
    background: transparent;
    color: #4c1d95;
    line-height: 1;
    padding: 0;
    font-size: 1rem;
    cursor: pointer;
}

.copy-link-success {
    color: #065f46;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #1f2937;
    color: #fff;
    margin-bottom: 0.75rem;
}

.slider-placeholder {
    border-radius: 10px;
    height: 140px;
    background: repeating-linear-gradient(
        45deg,
        #e5e7eb,
        #e5e7eb 10px,
        #f3f4f6 10px,
        #f3f4f6 20px
    );
    display: grid;
    place-items: center;
    color: #4b5563;
}

.qr-box {
    width: 52px;
    height: 52px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    display: grid;
    place-items: center;
}

.footer-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    align-items: flex-start;
}

.footer-grid > section {
    flex: 1 1 220px;
    min-width: 220px;
}

.site-footer .site-footer-col-title {
    font-weight: 700;
    color: var(--site-blue-on-dark);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.site-footer .site-footer-col-title .bi {
    color: var(--site-blue-on-dark);
}

.footer-social-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(229, 231, 235, 0.65);
    color: #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    text-decoration: none;
}

.footer-social-btn:hover {
    color: #fff;
    border-color: #fff;
}

.footer-contact-form {
    display: grid;
    gap: 0.35rem;
    max-width: 240px;
    width: 100%;
}

.footer-contact-form .form-control {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(255, 255, 255, 0.35);
    font-size: 0.78rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    padding-top: 0.65rem;
}

@media (max-width: 991.98px) {
    .footer-grid > section {
        flex-basis: calc(50% - 0.75rem);
        min-width: 260px;
    }
}

@media (max-width: 575.98px) {
    .footer-grid > section {
        flex-basis: 100%;
        min-width: 0;
    }
}

body.study-mode .site-header,
body.study-mode .site-footer,
body.study-mode .hero-section {
    background: linear-gradient(120deg, #180909, #3f0000);
}

body.study-mode .btn-warning {
    background: #b91c1c;
    border-color: #b91c1c;
}

body.theme-dark {
    background: #0b1220;
    color: #dbe3ee;
}

/* Коричневые акценты светлой темы → читаемые кремовые на тёмном фоне */
body.theme-dark .form-label,
body.theme-dark .memories-add-panel .memories-add-form .form-label,
body.theme-dark .gallery-add-form .form-label,
body.theme-dark .together-search-form .form-label {
    color: var(--site-blue-heading-on-dark) !important;
}

body.theme-dark .school-section-title {
    color: var(--site-blue-heading-on-dark);
}

body.theme-dark .gallery-archive-tabs {
    border-bottom-color: rgba(232, 213, 196, 0.28);
}

body.theme-dark .gallery-archive-tabs .nav-link {
    color: var(--site-blue-on-dark);
}

body.theme-dark .gallery-archive-tabs .nav-link:hover {
    color: var(--site-blue-heading-on-dark);
    background: rgba(232, 213, 196, 0.1);
    border-color: rgba(232, 213, 196, 0.2);
}

body.theme-dark .gallery-archive-tabs .nav-link.active {
    color: var(--site-brown);
    background: linear-gradient(180deg, #f7f1ec 0%, #fff9ed 100%);
    border-color: rgba(232, 213, 196, 0.4) rgba(232, 213, 196, 0.4) #0b1220;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.25);
}

body.theme-dark .gallery-add-panel__title,
body.theme-dark .gallery-add-panel__title .bi,
body.theme-dark .news-portal-title,
body.theme-dark .event-card-title,
body.theme-dark .cabinet-link,
body.theme-dark .holiday-banner__title,
body.theme-dark .holiday-banner__title-text {
    color: var(--site-blue-heading-on-dark);
}

body.theme-dark .gallery-page .nav-tabs .nav-link {
    color: var(--site-blue-on-dark);
}

body.theme-dark .gallery-page .nav-tabs .nav-link:hover,
body.theme-dark .gallery-page .nav-tabs .nav-link:focus {
    color: var(--site-blue-heading-on-dark);
    border-color: rgba(232, 213, 196, 0.35) rgba(232, 213, 196, 0.35) transparent;
}

body.theme-dark .gallery-page .nav-tabs .nav-link.active {
    color: var(--site-brown);
    background-color: var(--site-cream);
    border-color: rgba(232, 213, 196, 0.45) rgba(232, 213, 196, 0.45) #0b1220;
}

body.theme-dark .alt-bg {
    background: #111a2b;
}

body.theme-dark .panel-light,
body.theme-dark .school-filters,
body.theme-dark .site-filters-block,
body.theme-dark .news-portal-filters.card,
body.theme-dark .media-card,
body.theme-dark .profile-card,
body.theme-dark .fact-tile {
    background: #172235;
    border-color: #273449;
    color: #e5e7eb;
}

body.theme-dark .school-list-card {
    background-color: var(--school-lc-fill, rgba(23, 34, 53, 0.38));
    background-image: linear-gradient(var(--school-lc-veil, rgba(23, 34, 53, 0.46)), var(--school-lc-veil, rgba(23, 34, 53, 0.46))), var(--school-lc-bg, url('../img/fon/fon33.jpg'));
    background-size: auto, cover;
    background-position: center, center;
    background-repeat: no-repeat;
    border-color: #273449;
    color: #e5e7eb;
    box-shadow:
        0 6px 22px rgba(0, 0, 0, 0.45),
        0 2px 8px rgba(0, 0, 0, 0.35);
}

body.theme-dark .school-list-card:hover {
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.55),
        0 4px 12px rgba(0, 0, 0, 0.4);
}

body.theme-dark .school-list-card .school-card-title-block h3 a {
    color: #e5e7eb;
}

body.theme-dark .school-list-card .school-card-title-block h3 a:hover {
    color: var(--site-blue-on-dark);
}

body.theme-dark .school-filters .btn,
body.theme-dark #school-empty-state .btn,
body.theme-dark .news-portal-filters.card .btn,
body.theme-dark .site-filters-block.card .btn {
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.38),
        0 3px 10px rgba(0, 0, 0, 0.26),
        0 1px 3px rgba(0, 0, 0, 0.2);
}

body.theme-dark .school-filters .btn:hover,
body.theme-dark #school-empty-state .btn:hover,
body.theme-dark .news-portal-filters.card .btn:hover,
body.theme-dark .site-filters-block.card .btn:hover {
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.45),
        0 4px 14px rgba(0, 0, 0, 0.3),
        0 2px 5px rgba(0, 0, 0, 0.22);
}

body.theme-dark .school-filters .btn:active,
body.theme-dark #school-empty-state .btn:active,
body.theme-dark .news-portal-filters.card .btn:active,
body.theme-dark .site-filters-block.card .btn:active {
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.32),
        0 2px 6px rgba(0, 0, 0, 0.22);
}

body.theme-dark .school-awards-strip {
    background: transparent;
    border: none;
}

body.theme-dark .school-award-slot {
    border-color: #6b5a4e;
    background: linear-gradient(180deg, #4a372c 0%, #5C4033 50%, #3d2a22 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

body.theme-dark .school-award-slot.has-image {
    background: #0f172a;
    border-color: #64748b;
}

body.theme-dark .section-title h2,
body.theme-dark .section-title h2 .bi {
    color: var(--site-blue-heading-on-dark);
}

body.theme-dark .site-page-heading,
body.theme-dark .site-page-heading .bi,
body.theme-dark .site-subsection-heading,
body.theme-dark .site-subsection-heading .bi {
    color: var(--site-blue-heading-on-dark);
}

body.theme-dark .section-title p,
body.theme-dark .text-muted {
    color: #9fb0c7 !important;
}

body.theme-dark .form-control,
body.theme-dark .form-select {
    background: #0f1a2b;
    border-color: #304056;
    color: #e5e7eb;
}

body.theme-dark .form-control::placeholder {
    color: #8ea0bb;
}

body.theme-dark .header-topbar {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.35);
}

body.theme-dark .header-search-suggest {
    background: #0f1a2b;
    border-color: #304056;
}

body.theme-dark .header-search-item {
    background: #0f1a2b;
    border-bottom-color: #213248;
}

body.theme-dark .header-search-item:hover,
body.theme-dark .header-search-item.active {
    background: #1e2b40;
}

body.theme-dark .header-search-item-title {
    color: #e5e7eb;
}

body.theme-dark .header-search-item-meta {
    color: #9fb0c7;
}

body.theme-dark .header-search-mark {
    background: #f59e0b;
    color: #111827;
}

/* Главная: новости в тёмной теме */
body.theme-dark .home-news-section {
    background: #0f1a2b !important;
    border-color: #273449 !important;
}

body.theme-dark .home-news-section .section-title h2,
body.theme-dark .home-news-section .section-title h2 .bi {
    color: var(--site-blue-heading-on-dark);
}

body.theme-dark .home-news-section .section-title p,
body.theme-dark .home-news-section .text-muted {
    color: #9fb0c7 !important;
}

body.theme-dark .home-news-section .btn-outline-primary {
    color: var(--site-blue-on-dark);
    border-color: var(--site-blue);
}

body.theme-dark .home-news-section .btn-outline-primary:hover {
    background: var(--site-blue);
    border-color: var(--site-blue);
    color: #eff6ff;
}

body.theme-dark .home-news-card {
    background: #172235;
    border-color: #304056;
    color: #dbe3ee;
}

body.theme-dark .home-news-card .news-card-title {
    color: var(--site-blue-heading-on-dark);
}

body.theme-dark .home-news-card .news-card-excerpt {
    color: #cbd5e1;
}

body.theme-dark .home-news-card .news-card-category-name {
    color: var(--site-blue-heading-on-dark);
    font-weight: 700;
}

/* Карточки ленты и страницы материала (news.php / news_view.php): как на главной */
body.theme-dark .news-portal-body .news-portal-card.card {
    background: #172235;
    border-color: #304056;
    color: #dbe3ee;
}

body.theme-dark .news-portal-body .news-portal-card .news-card-title {
    color: var(--site-blue-heading-on-dark);
}

body.theme-dark .news-portal-body .news-portal-card .news-card-excerpt {
    color: #cbd5e1;
}

body.theme-dark .news-portal-body .news-portal-card .news-card-category-name {
    color: var(--site-blue-heading-on-dark);
    font-weight: 700;
}

body.theme-dark .news-portal-body .news-portal-card .border-top {
    border-color: #304056 !important;
}

body.theme-dark .news-portal-body .news-article-full.card {
    background: #172235;
    border-color: #304056 !important;
    color: #dbe3ee;
}

body.theme-dark .news-portal-body .news-article-full .news-article-full-title,
body.theme-dark .news-portal-body .news-article-full .news-article-full-title .bi {
    color: var(--site-blue-heading-on-dark);
}

body.theme-dark .news-portal-body .news-article-full .news-card-category-name {
    color: var(--site-blue-heading-on-dark);
    font-weight: 700;
}

body.theme-dark .news-portal-body .news-portal-card .text-muted,
body.theme-dark .news-portal-body .news-article-full .text-muted {
    color: #9fb0c7 !important;
}

body.theme-dark .home-news-card .badge.bg-light {
    background: #22324a !important;
    color: #dbe3ee !important;
    border-color: #3a4c67 !important;
}

body.theme-dark .home-news-card .border-top {
    border-color: #304056 !important;
}

body.theme-dark .partner-logo-frame {
    background: #22324a;
    border-color: #3a4c67;
}

body.theme-dark .partner-logo-placeholder {
    color: #9fb0c7;
}

body.theme-dark .partner-card-name {
    color: #e5e7eb !important;
}

/* Заголовки страниц "Новости" и "Воспоминания" в dark mode */
body.theme-dark .news-portal-title,
body.theme-dark .news-portal-title .bi {
    color: var(--site-blue-heading-on-dark);
}

body.theme-dark .news-article-full-title,
body.theme-dark .news-article-full-title .bi {
    color: var(--site-blue-heading-on-dark);
}

/* Точечный аудит контраста: админка, фильтры, таблицы, сервисные элементы */
body.theme-dark .admin-console-body,
body.theme-dark .cabinet-body,
body.theme-dark .news-portal-body,
body.theme-dark .school-page-body {
    background: #0b1220;
    color: #dbe3ee;
}

body.theme-dark .admin-content,
body.theme-dark .cabinet-content {
    color: #dbe3ee;
}

body.theme-dark .admin-kpi-card,
body.theme-dark .admin-block,
body.theme-dark .cabinet-card,
body.theme-dark .school-grad-card,
body.theme-dark .gallery-folder-card,
body.theme-dark .gallery-photo-card {
    background: #172235;
    border-color: #304056;
    color: #dbe3ee;
}

body.theme-dark .school-grad-card--compact .school-grad-k {
    color: #94a3b8;
}

body.theme-dark .school-grad-card--compact .school-grad-v {
    color: #e2e8f0;
}

body.theme-dark .admin-chart-card {
    background: #172235;
    border-color: #304056;
}

body.theme-dark .admin-chart-title {
    color: var(--site-blue-heading-on-dark);
}

body.theme-dark .admin-chart-canvas-wrap {
    background: #111c2e;
    border-color: #304056;
}

body.theme-dark .admin-kpi-val,
body.theme-dark .cabinet-title,
body.theme-dark .cabinet-title .bi {
    color: var(--site-blue-heading-on-dark);
}

body.theme-dark .table {
    color: #dbe3ee;
}

body.theme-dark .table > :not(caption) > * > * {
    background-color: #172235;
    border-bottom-color: #304056;
    color: #dbe3ee;
}

body.theme-dark .table thead th {
    background: #1b2a40;
    color: var(--site-blue-heading-on-dark);
    border-bottom-color: #3b4f6b;
}

body.theme-dark .table-hover > tbody > tr:hover > * {
    background-color: #1f2f46;
    color: #eff6ff;
}

body.theme-dark .alert-light {
    background: #172235;
    border-color: #304056;
    color: #dbe3ee;
}

body.theme-dark .alert-secondary {
    background: #1d2c43;
    border-color: #3a4c67;
    color: #dbe3ee;
}

body.theme-dark .pagination .page-link {
    background: #172235;
    border-color: #304056;
    color: #e7d5c8;
    box-shadow: none;
}

body.theme-dark .pagination .page-item.active .page-link {
    background: var(--politruk-btn-primary);
    border-color: var(--politruk-btn-primary);
    color: #fff;
}

body.theme-dark .pagination .page-link:hover {
    background: #22324a;
    border-color: #3a4c67;
    color: #f3e8df;
}

body.theme-dark .breadcrumb-item a {
    color: var(--site-blue-on-dark);
}

body.theme-dark .breadcrumb-item.active {
    color: #9fb0c7;
}

body.theme-dark .input-group-text {
    background: #1b2a40;
    border-color: #304056;
    color: #9fb0c7;
}

body.theme-dark .btn-outline-secondary {
    color: #cbd5e1;
    border-color: #4b5f7d;
}

body.theme-dark .btn-outline-secondary:hover {
    background: #2b3b54;
    border-color: #5f7696;
    color: #eff6ff;
}

body.theme-dark .btn-outline-dark {
    color: #cbd5e1;
    border-color: #4b5f7d;
}

body.theme-dark .btn-outline-dark:hover {
    background: #2b3b54;
    border-color: #5f7696;
    color: #eff6ff;
}

body.theme-dark .form-text {
    color: #9bc6a6;
}

body.theme-dark .alert-info {
    color: #d7f0de;
    background-color: rgba(61, 122, 74, 0.26);
    border-color: rgba(146, 214, 162, 0.5);
}

body.theme-dark .alert-info a {
    color: #e2f7e7;
}

body.theme-dark .yandex-map-embed {
    border-color: #304056;
    background: #172235;
}

/* Галерея: корректный dark mode для карточек фотоархива */
body.theme-dark.gallery-page-body {
    background: #0b1220;
    color: #dbe3ee;
}

body.theme-dark .gallery-folder-card,
body.theme-dark .gallery-photo-card {
    background: #172235;
    border-color: #304056;
    color: #dbe3ee;
}

body.theme-dark .gallery-folder-cover {
    background: #22324a;
    color: var(--site-blue-on-dark);
}

body.theme-dark .gallery-folder-city-icon {
    background: #22324a;
    border-color: #3a4c67;
    color: var(--site-blue-on-dark);
}

body.theme-dark .gallery-folder-link {
    color: inherit;
}

body.theme-dark .gallery-folder-body .text-dark {
    color: #e5e7eb !important;
}

body.theme-dark .gallery-folder-body .text-muted,
body.theme-dark .gallery-photo-body .text-muted,
body.theme-dark .gallery-photo-caption {
    color: #9fb0c7 !important;
}

body.theme-dark .gallery-photo-wrap {
    background: #22324a;
}

/* Ищем вместе: форма поиска */
.find-together-body .together-search-panel {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--site-blue-soft-border);
    background:
        linear-gradient(180deg, var(--site-cream-muted) 0%, var(--site-cream) 42%, #ffffff 100%);
    box-shadow:
        0 10px 28px rgba(var(--site-blue-rgb), 0.08),
        0 2px 8px rgba(15, 23, 42, 0.04);
}

.find-together-body .together-search-panel > .card-body {
    background: transparent;
}

.find-together-body .together-panel-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(var(--site-blue-rgb), 0.12);
    background:
        linear-gradient(110deg, rgba(var(--site-blue-rgb), 0.12) 0%, rgba(var(--site-brown-deep-rgb), 0.1) 48%, rgba(255, 249, 237, 0.85) 100%);
}

.find-together-body .together-panel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 11px;
    flex-shrink: 0;
    color: #fff;
    background: linear-gradient(145deg, var(--site-blue-gradient-mid), var(--site-blue));
    box-shadow: 0 4px 12px rgba(var(--site-blue-rgb), 0.28);
    font-size: 1.15rem;
}

.find-together-body .together-panel-title {
    font-weight: 700;
    color: var(--site-blue);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.find-together-body .together-search-form .form-label {
    color: var(--site-brown);
    margin-bottom: 0.4rem;
    font-size: 0.92rem;
}

.find-together-body .together-label-hint {
    font-weight: 400;
    color: #64748b;
    font-size: 0.85em;
}

.find-together-body .together-form-block {
    padding: 1.05rem 1.2rem;
    border-radius: 14px;
    border: 1px solid var(--site-blue-soft-border);
    background: linear-gradient(165deg, #ffffff 0%, var(--site-blue-soft-bg) 140%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.find-together-body .together-form-block--names {
    background: #ffffff;
    border-color: var(--site-blue-soft-border);
}

.find-together-body .together-form-block--extra {
    background: linear-gradient(165deg, #ffffff 0%, var(--site-cream) 130%);
}

.find-together-body .together-field {
    border-color: var(--site-blue-soft-border);
    border-radius: 10px;
    background-color: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.find-together-body .together-field:hover {
    border-color: var(--site-blue-gradient-mid);
}

.find-together-body .together-field:focus {
    border-color: var(--site-blue);
    background-color: #fff;
    box-shadow: 0 0 0 0.22rem rgba(var(--site-blue-rgb), 0.2);
}

.find-together-body .together-form-block--extra .together-other-textarea {
    min-height: 7.5rem;
    resize: vertical;
}

.find-together-body .together-photo-input {
    padding: 0.45rem 0.65rem;
    background:
        linear-gradient(180deg, var(--site-cream) 0%, var(--site-cream-muted) 100%);
}

.find-together-body .together-photo-input::file-selector-button {
    margin-right: 0.85rem;
    padding: 0.35rem 0.85rem;
    border: 0;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    background: linear-gradient(145deg, var(--site-blue-gradient-mid), var(--site-blue));
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.find-together-body .together-photo-input:hover::file-selector-button {
    background: linear-gradient(145deg, var(--politruk-btn-primary), var(--site-blue));
    box-shadow: 0 2px 8px rgba(var(--site-blue-rgb), 0.25);
}

.find-together-body .together-form-subtitle {
    font-size: 1rem;
    font-weight: 700;
    color: var(--site-blue);
    margin-bottom: 0.75rem;
    padding-bottom: 0.55rem;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--site-blue) 0%, var(--site-blue-gradient-light) 55%, transparent 100%) 1;
    letter-spacing: -0.01em;
}

.find-together-body .together-photo-filename {
    min-height: 1.25rem;
    color: var(--site-brown);
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.find-together-body .together-photo-filename.is-visible {
    opacity: 1;
}

.find-together-body .together-photo-hint {
    color: #5b7391;
}

.find-together-body .together-form-actions {
    padding-top: 1rem;
    border-top: 1px solid rgba(var(--site-blue-rgb), 0.14);
}

.find-together-body .together-search-submit {
    border-radius: 11px;
    min-width: 9.5rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow:
        0 6px 18px rgba(var(--site-blue-rgb), 0.28),
        0 2px 6px rgba(15, 23, 42, 0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.find-together-body .together-search-submit:hover {
    transform: translateY(-1px);
    box-shadow:
        0 10px 24px rgba(var(--site-blue-rgb), 0.34),
        0 3px 8px rgba(15, 23, 42, 0.12);
}

.find-together-body .together-search-submit:active {
    transform: translateY(0);
}

.find-together-body .together-form-footnote {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(var(--site-blue-rgb), 0.14);
    background: rgba(var(--site-blue-rgb), 0.05);
    color: #4b607a;
    line-height: 1.5;
}

.find-together-body .together-form-footnote strong {
    color: var(--site-blue);
    font-weight: 700;
}

@media (max-width: 991.98px) {
    .find-together-body .together-field-year {
        max-width: 12rem;
    }

    .find-together-body .together-panel-head {
        padding: 0.9rem 1rem;
    }
}

/* Ищем вместе: тёмная форма + светлые поля ввода */
body.theme-dark.find-together-body .card {
    background: #172235;
    border-color: #304056 !important;
    color: #dbe3ee;
}

body.theme-dark.find-together-body .form-label,
body.theme-dark.find-together-body .small,
body.theme-dark.find-together-body .text-muted {
    color: #c7d2e5 !important;
}

body.theme-dark.find-together-body .form-control,
body.theme-dark.find-together-body .form-select {
    background: var(--site-surface);
    border-color: #cbd5e1;
    color: #0f172a;
}

body.theme-dark.find-together-body .form-control::placeholder {
    color: #64748b;
}

body.theme-dark.find-together-body .form-control:focus,
body.theme-dark.find-together-body .form-select:focus {
    background: #ffffff;
    color: #0f172a;
    border-color: var(--site-blue);
    box-shadow: 0 0 0 0.2rem rgba(var(--site-blue-rgb), 0.25);
}

body.theme-dark.find-together-body .btn-outline-dark {
    color: #cbd5e1;
    border-color: #5f7696;
}

body.theme-dark.find-together-body .btn-outline-dark:hover {
    background: #2b3b54;
    border-color: #6b84a8;
    color: #eff6ff;
}

body.theme-dark.find-together-body .together-search-panel {
    background: linear-gradient(180deg, #1a2740 0%, #172235 55%, #151f33 100%);
    border-color: #304056;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

body.theme-dark.find-together-body .together-panel-head {
    background: linear-gradient(110deg, rgba(90, 142, 190, 0.22) 0%, rgba(23, 34, 53, 0.9) 100%);
    border-bottom-color: #304056;
}

body.theme-dark.find-together-body .together-panel-title {
    color: var(--site-blue-heading-on-dark);
}

body.theme-dark.find-together-body .together-search-form .form-label {
    color: #d5e2f3 !important;
}

body.theme-dark.find-together-body .together-label-hint {
    color: #94a3b8 !important;
}

body.theme-dark.find-together-body .together-form-block {
    background: linear-gradient(165deg, #1b2a42 0%, #172235 55%);
    border-color: #304056;
    box-shadow: none;
}

body.theme-dark.find-together-body .together-form-block--names,
body.theme-dark.find-together-body .together-form-block--extra {
    background: #151f33;
}

body.theme-dark.find-together-body .together-field {
    background-color: var(--site-surface);
    border-color: #cbd5e1;
}

body.theme-dark.find-together-body .together-field:hover {
    border-color: var(--site-blue-gradient-light);
}

body.theme-dark.find-together-body .together-photo-input {
    background: var(--site-surface);
}

body.theme-dark.find-together-body .together-form-subtitle {
    color: var(--site-blue-heading-on-dark);
    border-image: linear-gradient(90deg, var(--site-blue-on-dark) 0%, transparent 100%) 1;
}

body.theme-dark.find-together-body .together-photo-filename {
    color: #cbd5e1;
}

body.theme-dark.find-together-body .together-photo-hint {
    color: #9fb0c7 !important;
}

body.theme-dark.find-together-body .together-form-actions {
    border-top-color: #304056;
}

body.theme-dark.find-together-body .together-form-footnote {
    background: rgba(142, 197, 235, 0.08);
    border-color: #304056;
    color: #9fb0c7 !important;
}

body.theme-dark.find-together-body .together-form-footnote strong {
    color: var(--site-blue-heading-on-dark);
}

/* Единый паттерн: тёмные формы + светлые поля ввода */
body.theme-dark .admin-block,
body.theme-dark .admin-kpi-card,
body.theme-dark .cabinet-card,
body.theme-dark .profile-card,
body.theme-dark .media-card,
body.theme-dark .news-portal-filters.card,
body.theme-dark .school-filters,
body.theme-dark .site-filters-block,
body.theme-dark .panel-light,
body.theme-dark.find-together-body .card {
    color: #dbe3ee;
}

body.theme-dark .admin-block .form-control,
body.theme-dark .admin-block .form-select,
body.theme-dark .admin-kpi-card .form-control,
body.theme-dark .admin-kpi-card .form-select,
body.theme-dark .cabinet-card .form-control,
body.theme-dark .cabinet-card .form-select,
body.theme-dark .profile-card .form-control,
body.theme-dark .profile-card .form-select,
body.theme-dark .media-card .form-control,
body.theme-dark .media-card .form-select,
body.theme-dark .news-portal-filters.card .form-control,
body.theme-dark .news-portal-filters.card .form-select,
body.theme-dark .school-filters .form-control,
body.theme-dark .school-filters .form-select,
body.theme-dark .site-filters-block .form-control,
body.theme-dark .site-filters-block .form-select,
body.theme-dark .panel-light .form-control,
body.theme-dark .panel-light .form-select,
body.theme-dark.find-together-body .card .form-control,
body.theme-dark.find-together-body .card .form-select {
    background: var(--site-surface);
    border-color: #cbd5e1;
    color: #0f172a;
}

body.theme-dark .admin-block .form-control::placeholder,
body.theme-dark .admin-kpi-card .form-control::placeholder,
body.theme-dark .cabinet-card .form-control::placeholder,
body.theme-dark .profile-card .form-control::placeholder,
body.theme-dark .media-card .form-control::placeholder,
body.theme-dark .news-portal-filters.card .form-control::placeholder,
body.theme-dark .school-filters .form-control::placeholder,
body.theme-dark .site-filters-block .form-control::placeholder,
body.theme-dark .panel-light .form-control::placeholder,
body.theme-dark.find-together-body .card .form-control::placeholder {
    color: #64748b;
}

body.theme-dark .admin-block .form-control:focus,
body.theme-dark .admin-block .form-select:focus,
body.theme-dark .admin-kpi-card .form-control:focus,
body.theme-dark .admin-kpi-card .form-select:focus,
body.theme-dark .cabinet-card .form-control:focus,
body.theme-dark .cabinet-card .form-select:focus,
body.theme-dark .profile-card .form-control:focus,
body.theme-dark .profile-card .form-select:focus,
body.theme-dark .media-card .form-control:focus,
body.theme-dark .media-card .form-select:focus,
body.theme-dark .news-portal-filters.card .form-control:focus,
body.theme-dark .news-portal-filters.card .form-select:focus,
body.theme-dark .school-filters .form-control:focus,
body.theme-dark .school-filters .form-select:focus,
body.theme-dark .site-filters-block .form-control:focus,
body.theme-dark .site-filters-block .form-select:focus,
body.theme-dark .panel-light .form-control:focus,
body.theme-dark .panel-light .form-select:focus,
body.theme-dark.find-together-body .card .form-control:focus,
body.theme-dark.find-together-body .card .form-select:focus {
    background: #ffffff;
    color: #0f172a;
    border-color: var(--site-blue);
    box-shadow: 0 0 0 0.2rem rgba(var(--site-blue-rgb), 0.25);
}

/* Страница училища */
.school-page-body {
    background: #fafafa;
}

.school-section {
    scroll-margin-top: 88px;
}

/* Шапка блока «Идентификация»: знак слева, текст справа */
.school-ident-hero {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.school-ident-badge-wrap {
    flex-shrink: 0;
}

.school-ident-badge-wrap .school-ident-badge-circle {
    width: 132px;
    height: 132px;
    flex: 0 0 132px;
    max-width: min(132px, 28vw);
    max-height: min(132px, 28vw);
}

.school-ident-badge-wrap .school-ident-badge-img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
}

.school-ident-text {
    flex: 1 1 240px;
    min-width: 0;
}

.school-ident-title {
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    font-weight: 700;
    color: #0f172a;
    line-height: 1.28;
    margin: 0 0 0.35rem;
}

.school-ident-abbr {
    margin: 0 0 0.65rem;
    font-size: 1rem;
    color: #9ca3af;
    line-height: 1.35;
}

.school-ident-years {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.45;
}

.school-ident-years-label {
    font-weight: 600;
}

.school-ident-years-range {
    font-weight: 600;
}

.school-ident-years-hint {
    color: #9ca3af;
    font-size: 0.88rem;
    font-weight: 400;
}

.school-ident-status {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    line-height: 1.45;
}

.school-ident-status-label {
    color: #9ca3af;
}

.school-ident-status-value {
    color: #1f2937;
    font-weight: 700;
}

.school-ident-status-value--muted {
    font-weight: 400;
    color: #6b7280;
}

.school-ident-stats {
    margin: 0;
    font-size: 0.8125rem;
    color: #9ca3af;
    line-height: 1.45;
}

.school-ident-stats + .school-ident-stats {
    margin-top: 0.2rem;
}

/* Блок «Сайт и социальные сети» на карточке училища */
.school-social-title {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.school-social-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.school-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.school-social-btn:hover,
.school-social-btn:focus-visible {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.28);
    filter: brightness(1.08);
    color: #fff;
}

.school-social-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.school-social-btn-text {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.school-social-btn--site {
    background: var(--site-blue, #5C4033);
}

.school-social-btn--vk {
    background: #0077ff;
}

.school-social-btn--ok {
    background: #ee8208;
}

body.theme-dark .school-social-title {
    color: #94a3b8;
}

body.theme-dark .school-ident-title {
    color: #f1f5f9;
}

body.theme-dark .school-ident-years {
    color: #cbd5e1;
}

body.theme-dark .school-ident-status-value {
    color: #e5e7eb;
}

body.theme-dark .school-ident-status-value--muted {
    color: #94a3b8;
}

body.theme-dark .school-ident-years-hint,
body.theme-dark .school-ident-abbr,
body.theme-dark .school-ident-status-label,
body.theme-dark .school-ident-stats {
    color: #94a3b8;
}

.school-page-toc {
    top: 1rem;
}

.school-section-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: var(--site-cream-muted);
    border: 1px solid var(--site-blue-soft-border);
    border-radius: 10px;
    padding: 0.55rem 0.8rem;
    color: var(--site-brown);
}

.school-section-title-icon {
    color: var(--site-blue);
}

.school-page-toc .school-toc-link {
    font-weight: 500;
}

.school-page-toc .school-toc-icon {
    width: 1.35rem;
    flex-shrink: 0;
    text-align: center;
    color: var(--site-blue);
}

body.theme-dark .school-section-title-icon {
    color: var(--site-blue-on-dark);
}

body.theme-dark .school-section-title {
    background: rgba(var(--site-brown-deep-rgb), 0.22);
    border-color: rgba(212, 184, 160, 0.35);
}

body.theme-dark .school-page-toc .school-toc-icon {
    color: var(--site-blue-on-dark);
}

body.theme-dark .school-page-toc .list-group-item {
    background: #172235;
    border-color: #304056;
    color: #e5e7eb;
}

body.theme-dark .school-page-toc .list-group-item-action:hover,
body.theme-dark .school-page-toc .list-group-item-action:focus {
    background: #1e2f4a;
    color: #f8fafc;
}

.school-chat-section .school-chat-log {
    max-height: 280px;
    overflow-y: auto;
}

.school-chat-section .school-chat-message:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.school-hero-thumb {
    width: 96px;
    height: 96px;
    object-fit: cover;
    flex-shrink: 0;
}

.school-prose {
    line-height: 1.55;
}

/* Историческая справка: по ширине + красная строка у абзацев */
.school-historical-reference-prose {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
    hyphenate-limit-chars: 6 3 3;
    line-height: 1.65;
}

.school-historical-reference-prose p {
    text-indent: 1.5em;
    margin-top: 0;
    margin-bottom: 0.65em;
}

.school-historical-reference-prose p:last-child {
    margin-bottom: 0;
}

.school-historical-reference-prose--plain {
    text-indent: 1.5em;
}

.school-historical-reference-prose h2,
.school-historical-reference-prose h3,
.school-historical-reference-prose h4,
.school-historical-reference-prose h5 {
    text-align: start;
    text-indent: 0;
    hyphens: manual;
    -webkit-hyphens: manual;
}

.school-historical-reference-prose ul,
.school-historical-reference-prose ol {
    text-align: start;
    hyphens: manual;
    -webkit-hyphens: manual;
}

.school-grad-card {
    border: 1px solid #dbe1ea;
    border-radius: 10px;
    background: #fff;
    padding: 0.5rem 0.6rem;
    position: relative;
    overflow: hidden;
}

.school-grad-card--compact {
    padding: 0.6rem 0.45rem;
    min-height: 9rem;
}

.school-grad-card__below {
    position: relative;
    z-index: 1;
    transition: opacity 0.18s ease;
}

.school-grad-card.is-grad-card-photo-expanded .school-grad-card__below {
    opacity: 0;
    pointer-events: none;
}

.school-grad-card.is-grad-card-photo-expanded .school-grad-avatar-wrap {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100% !important;
    height: 100%;
    margin: 0 !important;
    max-width: none;
    z-index: 2;
}

.school-grad-card.is-grad-card-photo-expanded .school-grad-avatar {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    transform: none;
}

.school-grad-card.is-grad-card-photo-expanded .school-grad-avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    font-size: 2.5rem;
}

.school-grad-card--compact .school-grad-k {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-bottom: 0.15rem;
    line-height: 1.2;
}

.school-grad-card--compact .school-grad-v {
    display: block;
    font-size: 0.78rem;
    color: #374151;
    line-height: 1.25;
    word-break: break-word;
}

.school-grad-card--compact .school-grad-fio {
    font-size: 0.85rem;
}

.school-grad-avatar-wrap {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    position: relative;
}

.school-grad-avatar-wrap.school-grad-avatar-wrap--zoomable {
    cursor: zoom-in;
}

.school-grad-card.is-grad-card-photo-expanded .school-grad-avatar-wrap.school-grad-avatar-wrap--zoomable {
    cursor: zoom-out;
}

.school-grad-avatar-wrap.school-grad-avatar-wrap--zoomable:focus-visible {
    outline: 2px solid var(--site-blue, #5C4033);
    outline-offset: 3px;
    border-radius: 10px;
}

.school-grad-avatar {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #d1d5db;
    transition: transform 0.22s ease;
    transform-origin: center center;
}

.school-grad-avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.school-grad-fio {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
}

.school-grad-meta {
    font-size: 0.78rem;
    color: #4b5563;
    line-height: 1.25;
}

.school-grad-about {
    font-size: 0.8rem;
    color: #1f2937;
    line-height: 1.25;
}

.timeline-list {
    max-width: 640px;
}

.school-timeline-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.school-timeline-card {
    background: var(--site-surface);
    border: 1px solid #dbe1ea;
    border-left: 4px solid #64748b;
    border-radius: 14px;
    padding: 0.9rem 1rem 0.95rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.school-timeline-card--tone-1 { border-left-color: #8b5cf6; }
.school-timeline-card--tone-2 { border-left-color: #ef4444; }
.school-timeline-card--tone-3 { border-left-color: #f59e0b; }
.school-timeline-card--tone-4 { border-left-color: #0ea5e9; }
.school-timeline-card--tone-5 { border-left-color: #22c55e; }
.school-timeline-card--tone-6 { border-left-color: var(--site-blue); }

.school-timeline-topline {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.55rem;
}

.school-timeline-step {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #eef2f7;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.school-timeline-year {
    font-size: 1.7rem;
    line-height: 1;
    font-weight: 800;
    color: #1f2937;
}

.school-timeline-title {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    color: #1f2937;
}

.school-timeline-body {
    color: #475569;
    line-height: 1.45;
}

@media (max-width: 991.98px) {
    .school-timeline-grid {
        grid-template-columns: 1fr;
    }
}

body.theme-dark .school-timeline-card {
    background: #172235;
    border-color: #304056;
    color: #dbe3ee;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}

body.theme-dark .school-timeline-step {
    background: #22324a;
    color: #9fb0c7;
}

body.theme-dark .school-timeline-year,
body.theme-dark .school-timeline-title {
    color: #e5e7eb;
}

body.theme-dark .school-timeline-body {
    color: #c7d2e5;
}


@media (max-width: 575.98px) {
    .school-awards-strip {
        justify-content: flex-start;
    }
}

/* Админ-панель и личный кабинет */
.admin-console-body {
    background: var(--site-cream-muted);
}

.admin-console-wrap {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #3d2a22, #5C4033);
    color: #e8d5c4;
    padding: 1rem 0.8rem;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.admin-brand {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    margin-bottom: 0.8rem;
    color: #d4b8a0;
}

.admin-brand-section {
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-nav-link {
    display: block;
    color: #f0e8dc;
    text-decoration: none;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    font-size: 0.93rem;
}

.admin-nav-link-sub {
    padding-left: 1.35rem;
    font-size: 0.88rem;
    opacity: 0.95;
}

.admin-nav-link:hover,
.admin-nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.admin-content {
    flex: 1;
    padding: 1rem;
}

.admin-content-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

/* Предпросмотр фона карточек училищ (админка → Дизайн) */
.school-list-card-bg-preview {
    max-width: 360px;
    min-height: 120px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    position: relative;
    overflow: hidden;
    background-color: rgba(240, 240, 242, 0.35);
}

body.theme-dark .school-list-card-bg-preview {
    border-color: #475569;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.school-list-card-bg-preview__hint {
    position: absolute;
    right: 0.55rem;
    bottom: 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #334155;
    text-shadow: 0 0 4px #fff, 0 0 10px rgba(255, 255, 255, 0.85);
    pointer-events: none;
}

body.theme-dark .school-list-card-bg-preview__hint {
    color: #e2e8f0;
    text-shadow: 0 0 6px #0f172a, 0 0 12px rgba(15, 23, 42, 0.9);
}

.events-calendar-create-toggle {
    cursor: pointer;
    user-select: none;
}

.events-calendar-create-toggle .bi-chevron-down {
    transition: transform 0.2s ease;
}

.events-calendar-create-toggle[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.events-calendar-create-optional-heading {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-kpi-card,
.admin-block {
    background: #fff;
    border: 1px solid #d7e0ed;
    border-radius: 12px;
    padding: 0.9rem;
}

.admin-memories-feed-table .admin-memories-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--bs-border-color, #dee2e6);
    vertical-align: middle;
    display: inline-block;
}

.admin-kpi-val {
    font-size: 2rem;
    font-weight: 700;
    color: #1676d2;
}

.admin-chart-card {
    background: #fff;
    border: 1px solid #d7e0ed;
    border-radius: 12px;
    padding: 0.75rem;
}

.admin-chart-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #0f3f7a;
    line-height: 1.2;
}

.admin-chart-type {
    max-width: 120px;
}

.admin-chart-canvas-wrap {
    position: relative;
    height: 240px;
    border: 1px solid #e4ebf5;
    border-radius: 10px;
    background: #f9fbff;
    padding: 0.4rem;
}

.cabinet-body {
    background: #dfeaf4;
}

.cabinet-shell {
    display: flex;
    gap: 1rem;
}

.cabinet-sidebar {
    width: 220px;
    background: #11335d;
    border-radius: 10px;
    padding: 0.75rem;
}

.cabinet-logo {
    background: #e7eef8;
    color: #0f2949;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    padding: 0.45rem;
    margin-bottom: 0.8rem;
}

.cabinet-link {
    display: block;
    text-decoration: none;
    color: #e6f0fb;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    margin-bottom: 0.2rem;
}

.cabinet-link.active,
.cabinet-link:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.cabinet-content {
    flex: 1;
}

.cabinet-card {
    background: #fff;
    border: 1px solid var(--site-blue-soft-border);
    border-radius: 14px;
    padding: 1rem;
}

.cabinet-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--site-blue);
    margin-bottom: 0.8rem;
}

.cabinet-title .bi {
    color: var(--site-blue);
}

.cabinet-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e6eef8;
}

.cabinet-avatar.placeholder {
    background: linear-gradient(135deg, #c8d9ed, #9eb7d5);
}

.cabinet-avatar-upload-preview {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #e8f0fa;
    border: 2px solid #d0dde9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cabinet-avatar-upload-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cabinet-avatar-upload-ph {
    font-size: 2.35rem;
    color: #9eb7d5;
    line-height: 1;
}

/* CMS-рендер новостей с изображениями */
.news-cms-body {
    line-height: 1.5;
}

.news-media-block {
    margin: 0.5rem 0 0.75rem;
}

.news-media-left {
    float: left;
    margin-right: 0.75rem;
}

.news-media-right {
    float: right;
    margin-left: 0.75rem;
}

.news-media-center {
    margin-left: auto;
    margin-right: auto;
}

.news-media-ratio {
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #e5e7eb;
}

.news-media-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-media-block--zoomable {
    cursor: zoom-in;
    transition: width 0.25s ease;
}

.news-media-block--zoomable.is-expanded {
    cursor: zoom-out;
    float: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.news-media-block--zoomable .news-media-ratio {
    transition: box-shadow 0.2s ease;
}

.news-media-block--zoomable.is-expanded .news-media-ratio {
    box-shadow: 0 8px 24px rgba(92, 64, 51, 0.18);
}

.news-media-caption {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.3rem;
}

.news-text-block {
    margin-bottom: 0.4rem;
}

.news-text-block.text-justify,
.news-cms-body .text-justify {
    text-align: justify;
    text-align-last: left;
}

.news-clear {
    clear: both;
}

.memories-feed-card-cover {
    background: #e5e7eb;
    overflow: hidden;
}

.memories-feed-card-cover .news-media-block {
    margin-top: 0;
    margin-bottom: 0;
}

.memories-feed-card-cover .news-clear {
    display: none;
}

.memory-expand-card {
    border: 1px solid #e5ddd6;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.memory-expand-card__cover {
    min-height: 100%;
    height: 100%;
    background: linear-gradient(165deg, var(--site-cream), var(--site-cream-muted));
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.memory-expand-card__cover img {
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
    display: block;
}

.memory-expand-card__placeholder {
    width: 100%;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--site-blue);
    font-size: 2.75rem;
    opacity: 0.55;
}

.memory-expand-card__full {
    background: #fbfaf8;
}

.memory-expand-card__body {
    font-size: 0.95rem;
    line-height: 1.55;
    color: #1f2937;
}

.memory-expand-card__gallery-item {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5ddd6;
    aspect-ratio: 1 / 1;
    background: #eef2f7;
}

.memory-expand-card__gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.memories-add-panel .memories-add-form .form-label {
    font-weight: 600;
    color: var(--site-brown);
}

@media (max-width: 575.98px) {
    .memory-expand-card__cover img,
    .memory-expand-card__placeholder {
        min-height: 140px;
    }
}

/* Портал новостей */
.news-portal-body {
    background: var(--site-surface);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.news-portal-body > .site-header {
    flex-shrink: 0;
}

.news-portal-body > main.news-portal-page {
    flex: 1 0 auto;
}

.news-portal-body > .site-footer {
    flex-shrink: 0;
    margin-top: auto;
}

.news-portal-page {
    --news-portal-blue: var(--site-blue);
    color: #111827;
}

.news-portal-title {
    color: var(--site-blue);
    font-weight: 700;
}

.news-portal-title .bi {
    color: var(--site-blue);
}

.news-article-full-title {
    color: var(--site-blue);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.news-article-full-title .bi {
    color: var(--site-blue);
}

.news-portal-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    text-align: center;
}

.news-portal-stat-val {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--news-portal-blue);
    line-height: 1.2;
}

.news-portal-stat-label {
    font-size: 0.82rem;
    color: #6b7280;
}

.news-portal-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.news-card-cover-wrap {
    aspect-ratio: 16 / 10;
    background: #e5e7eb;
    overflow: hidden;
}

.news-card-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-card-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 2rem;
}

/* Категория на карточках новостей: после заголовка, слева, полужирным */
.news-card-category-row {
    letter-spacing: 0.01em;
    text-align: left;
}

.news-card-category-prefix {
    display: none;
}

.news-card-category-name {
    color: var(--site-brown);
    font-weight: 700;
}

.news-article-category-line {
    letter-spacing: 0.01em;
}

.news-article-category-line .news-card-category-name {
    color: var(--site-brown);
    font-weight: 700;
}

/* Совместимость: старый класс без префикса */
.news-card-category {
    letter-spacing: 0.02em;
}

.news-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--news-portal-blue);
    text-align: center;
    line-height: 1.35;
    min-height: calc(1.35em * 3);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.news-card-title-link {
    color: inherit;
    text-decoration: none;
}

.news-card-title-link:hover,
.news-card-title-link:focus {
    color: var(--site-brown-deep);
    text-decoration: none;
}

.news-card-excerpt {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.45;
    text-align: justify;
    text-justify: inter-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
}

/* Автор в карточке — одна строка с многоточием; дата — следующей строкой, прижата вправо */
.news-portal-card .news-card-author {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
}

.news-portal-card .news-card-author-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.news-portal-card .news-card-meta--author-date .news-card-date-row {
    margin-top: 0.2rem;
}

/* Карточки новостей на странице училища: 3 в ряд, компактный вид */
.school-news-grid .school-news-card .news-card-cover-wrap {
    aspect-ratio: 4 / 3;
}

.school-news-grid .school-news-card .card-body {
    padding: 0.65rem 0.75rem 0.75rem;
}

.school-news-grid .school-news-card .news-card-category-row {
    font-size: 0.72rem;
    margin-bottom: 0.35rem !important;
}

.school-news-grid .school-news-card .news-card-meta {
    font-size: 0.68rem;
    margin-bottom: 0.35rem !important;
}

.school-news-grid .school-news-card .news-card-meta.mb-3 {
    margin-bottom: 0.5rem !important;
}

.school-news-grid .school-news-card .news-card-title {
    min-height: 0;
    font-size: 0.88rem;
    -webkit-line-clamp: 2;
    line-height: 1.3;
    margin-bottom: 0.35rem !important;
}

.school-news-grid .school-news-card .news-card-excerpt {
    font-size: 0.75rem;
    line-height: 1.35;
    -webkit-line-clamp: 4;
    margin-bottom: 0.5rem !important;
}

.school-news-grid .school-news-card .btn {
    font-size: 0.78rem;
    padding: 0.2rem 0.85rem;
}

@media (max-width: 575.98px) {
    .school-news-grid > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Объявления под новостями на странице училища */
.school-announcement-card {
    border-radius: 8px;
    border-color: #e5e7eb !important;
}

.school-announcement-card__meta {
    line-height: 1.3;
}

.school-announcement-card__text {
    color: #374151;
    line-height: 1.4;
    text-align: justify;
    text-justify: inter-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
}

body.theme-dark .school-announcement-card {
    background: #1e293b;
    border-color: #334155 !important;
}

body.theme-dark .school-announcement-card__text {
    color: #cbd5e1;
}

.news-card-stars .news-star-on {
    color: #fbbf24;
    font-size: 0.95rem;
}

.news-card-stars .news-star-off {
    color: #d1d5db;
    font-size: 0.95rem;
}

.news-card-meta .news-card-meta-row {
    width: 100%;
}

.news-rate-star-btn {
    border: none;
    background: none;
    padding: 0 0.06rem;
    line-height: 1;
    color: #cbd5e1;
}

.news-rate-star-btn:focus-visible {
    outline: 2px solid var(--bs-primary, #5C4033);
    outline-offset: 2px;
}

.news-rate-star-btn:hover .bi-star {
    color: #fbbf24;
}

.news-rate-star-btn.is-user-choice,
.news-rate-star-btn.is-user-choice .bi-star-fill {
    color: #fbbf24;
}

.news-reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid #d1d5db;
    background: var(--site-surface);
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    line-height: 1.4;
    font-size: 0.85rem;
    color: #475569;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.news-reaction-btn:hover:not(:disabled) {
    background: #eef2f7;
    border-color: #94a3b8;
}

.news-reaction-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.news-reaction-btn.is-active {
    background: var(--site-cream);
    border-color: var(--site-blue);
    color: var(--site-blue);
    font-weight: 600;
}

.news-reaction-emoji {
    font-size: 1rem;
    line-height: 1;
}

body.theme-dark .news-reaction-btn {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

body.theme-dark .news-reaction-btn.is-active {
    background: rgba(var(--site-brown-deep-rgb), 0.45);
    border-color: var(--site-blue-gradient-light);
    color: var(--site-blue-heading-on-dark);
}

.news-share-icon {
    min-width: 2.25rem;
}

.news-share-vk {
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

.news-article-full .news-cms-body {
    font-size: 1.175rem;
    line-height: 1.48;
}

.news-article-full .news-cms-body .news-text-block {
    margin-bottom: 0.15rem;
}

.news-article-full .news-cms-body .news-text-block p {
    margin-top: 0;
    margin-bottom: 0.12em;
}

.news-article-full .news-cms-body .news-text-block p:last-child {
    margin-bottom: 0;
}

/* Выравнивание задаётся в админке (по умолчанию — по ширине) и действует на весь текст статьи */
.news-article-full .news-cms-body .news-text-block.text-justify,
.news-article-full .news-cms-body .news-text-block.text-justify p,
.news-article-full .news-cms-body .news-text-block.text-justify li,
.news-article-full .news-cms-body .news-text-block.text-justify h1,
.news-article-full .news-cms-body .news-text-block.text-justify h2,
.news-article-full .news-cms-body .news-text-block.text-justify h3,
.news-article-full .news-cms-body .news-text-block.text-justify h4,
.news-article-full .news-cms-body .news-text-block.text-justify blockquote,
.news-article-full .news-cms-body .news-text-block.text-justify [class*="ql-align"],
.news-article-full .news-cms-body .news-text-block.text-justify [style*="text-align"] {
    text-align: justify !important;
    text-align-last: left !important;
}

/* Абзацный отступ при выравнивании по ширине */
.news-article-full .news-cms-body .news-text-block.text-justify p {
    text-indent: 1.5em;
}

.news-article-full .news-cms-body .news-text-block.text-justify li,
.news-article-full .news-cms-body .news-text-block.text-justify blockquote,
.news-article-full .news-cms-body .news-text-block.text-justify h1,
.news-article-full .news-cms-body .news-text-block.text-justify h2,
.news-article-full .news-cms-body .news-text-block.text-justify h3,
.news-article-full .news-cms-body .news-text-block.text-justify h4 {
    text-indent: 0;
}

.news-article-full .news-cms-body .news-text-block.text-center,
.news-article-full .news-cms-body .news-text-block.text-center p,
.news-article-full .news-cms-body .news-text-block.text-center li,
.news-article-full .news-cms-body .news-text-block.text-center [class*="ql-align"],
.news-article-full .news-cms-body .news-text-block.text-center [style*="text-align"] {
    text-align: center !important;
    text-align-last: center !important;
}

.news-article-full .news-cms-body .news-text-block.text-start,
.news-article-full .news-cms-body .news-text-block.text-start p,
.news-article-full .news-cms-body .news-text-block.text-start li,
.news-article-full .news-cms-body .news-text-block.text-start [class*="ql-align"],
.news-article-full .news-cms-body .news-text-block.text-start [style*="text-align"] {
    text-align: left !important;
    text-align-last: left !important;
}

.news-article-full .news-cms-body .news-text-block.text-end,
.news-article-full .news-cms-body .news-text-block.text-end p,
.news-article-full .news-cms-body .news-text-block.text-end li,
.news-article-full .news-cms-body .news-text-block.text-end [class*="ql-align"],
.news-article-full .news-cms-body .news-text-block.text-end [style*="text-align"] {
    text-align: right !important;
    text-align-last: right !important;
}

.news-article-full .news-rating-footer .news-rating-row {
    width: 100%;
    justify-content: center;
}

/* Галерея */
.gallery-page-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--site-surface);
}

.gallery-page-body > .site-header {
    flex-shrink: 0;
}

.gallery-page-body > .gallery-page {
    flex: 1 0 auto;
}

.gallery-page-body > .site-footer {
    margin-top: auto;
    flex-shrink: 0;
}

.find-together-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.find-together-body > .site-header {
    flex-shrink: 0;
}

.find-together-body > main {
    flex: 1 0 auto;
}

.find-together-body > .site-footer {
    margin-top: auto;
    flex-shrink: 0;
}

.gallery-folder-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.gallery-folder-cover {
    position: relative;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2f7;
    color: var(--site-blue);
    font-size: 5rem;
    padding: 1rem;
}

.gallery-folder-cover--video {
    background: linear-gradient(165deg, var(--site-cream-muted) 0%, #e6dfd2 100%);
}

.gallery-folder-video-icon {
    font-size: 4.25rem;
    color: var(--site-blue);
    opacity: 0.85;
}

.gallery-archive-tabs {
    border-bottom: 2px solid rgba(var(--politruk-btn-primary-rgb), 0.18);
    gap: 0.35rem;
}

.gallery-archive-tabs .nav-item {
    margin-bottom: -2px;
}

.gallery-archive-tabs .nav-link {
    color: #5a463a;
    font-weight: 650;
    border: 1px solid transparent;
    border-radius: 12px 12px 0 0;
    padding: 0.65rem 1.05rem;
    background: transparent;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.gallery-archive-tabs .nav-link .bi {
    color: inherit;
}

.gallery-archive-tabs .nav-link:hover {
    color: var(--politruk-btn-primary);
    background: rgba(var(--politruk-btn-primary-rgb), 0.08);
    border-color: rgba(var(--politruk-btn-primary-rgb), 0.12);
}

.gallery-archive-tabs .nav-link.active {
    color: var(--politruk-btn-primary);
    background: linear-gradient(180deg, #f7f1ec 0%, #ffffff 100%);
    border-color: rgba(var(--politruk-btn-primary-rgb), 0.28) rgba(var(--politruk-btn-primary-rgb), 0.28) #fff;
    box-shadow: 0 -2px 10px rgba(var(--politruk-btn-primary-rgb), 0.08);
}

.gallery-add-school-note {
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    border: 1px solid rgba(var(--site-blue-rgb), 0.16);
    background: linear-gradient(110deg, rgba(var(--site-blue-rgb), 0.08), rgba(255, 249, 237, 0.95));
    color: var(--site-brown);
    font-size: 0.92rem;
    line-height: 1.45;
}

.gallery-add-school-note strong {
    color: var(--site-blue);
}

.gallery-add-panel {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--site-blue-soft-border);
    background: #fff;
    box-shadow:
        0 10px 28px rgba(var(--site-blue-rgb), 0.08),
        0 2px 8px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
}

.gallery-add-panel__head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(var(--site-blue-rgb), 0.12);
    background: linear-gradient(110deg, rgba(var(--site-blue-rgb), 0.12) 0%, rgba(var(--site-brown-deep-rgb), 0.1) 55%, var(--site-cream) 100%);
}

.gallery-add-panel--video .gallery-add-panel__head {
    background: linear-gradient(110deg, rgba(var(--site-brown-deep-rgb), 0.14) 0%, rgba(var(--site-blue-rgb), 0.1) 55%, var(--site-cream) 100%);
}

.gallery-add-panel__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 11px;
    flex-shrink: 0;
    color: #fff;
    background: linear-gradient(145deg, var(--site-blue-gradient-mid), var(--site-blue));
    box-shadow: 0 4px 12px rgba(var(--site-blue-rgb), 0.28);
    font-size: 1.15rem;
}

.gallery-add-panel--video .gallery-add-panel__icon {
    background: linear-gradient(145deg, var(--politruk-btn-primary), var(--site-blue));
}

.gallery-add-panel__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--site-blue);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.gallery-add-panel__body {
    padding: 1.15rem 1.25rem 1.35rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.gallery-add-form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gallery-add-form .form-label {
    color: var(--site-brown);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.gallery-add-form .form-control {
    border-color: var(--site-blue-soft-border);
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gallery-add-form .form-control:hover {
    border-color: var(--site-blue-gradient-mid);
}

.gallery-add-form .form-control:focus {
    border-color: var(--site-blue);
    box-shadow: 0 0 0 0.2rem rgba(var(--site-blue-rgb), 0.18);
}

.gallery-add-form__author {
    background: #f1f5f9;
    color: #475569;
}

.gallery-add-form__submit {
    margin-top: auto;
    border-radius: 11px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(var(--site-blue-rgb), 0.22);
}

.gallery-add-form__submit:hover {
    box-shadow: 0 6px 18px rgba(var(--site-blue-rgb), 0.3);
}

@media (max-width: 991.98px) {
    .gallery-add-grid--two > [class*="col-"] + [class*="col-"] {
        margin-top: 0;
    }
}

body.theme-dark .gallery-add-school-note {
    background: rgba(142, 197, 235, 0.08);
    border-color: #304056;
    color: #9fb0c7;
}

body.theme-dark .gallery-add-school-note strong {
    color: var(--site-blue-heading-on-dark);
}

body.theme-dark .gallery-add-panel {
    background: #172235;
    border-color: #304056;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

body.theme-dark .gallery-add-panel__head {
    background: linear-gradient(110deg, rgba(90, 142, 190, 0.22) 0%, rgba(23, 34, 53, 0.9) 100%);
    border-bottom-color: #304056;
}

body.theme-dark .gallery-add-panel__title {
    color: var(--site-blue-heading-on-dark);
}

body.theme-dark .gallery-add-form .form-label {
    color: var(--site-blue-heading-on-dark);
}

body.theme-dark .gallery-add-form .form-control {
    background: var(--site-surface);
    border-color: #cbd5e1;
    color: #0f172a;
}

body.theme-dark .gallery-add-form__author {
    background: #e8eef5;
}

.gallery-folder-cover-img {
    display: block;
    width: auto;
    max-width: min(72%, 200px);
    max-height: 140px;
    height: auto;
    object-fit: contain;
}

.gallery-folder-count {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: var(--site-blue);
    color: #fff;
    border-radius: 999px;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0 0.45rem;
}

.gallery-folder-body {
    padding: 0.75rem 0.9rem;
}

.gallery-folder-title {
    line-height: 1.25;
    height: calc(1.25em * 4);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

.gallery-folder-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-folder-city-icon {
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: var(--site-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--site-blue);
    font-size: 1.5rem;
}

.gallery-folder-city-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 4px;
}

.gallery-folder-stats {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: auto;
    text-align: right;
}

.gallery-folder-link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gallery-folder-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.gallery-folder-meta .small {
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-photo-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.gallery-photo-card:has(.js-zoomable-photo.is-zoomed) {
    overflow: visible;
    position: relative;
    z-index: 10;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.gallery-photo-wrap {
    overflow: auto;
    background: #e5e7eb;
}

.gallery-photo-wrap:has(.js-zoomable-photo.is-zoomed) {
    overflow: visible;
}

.gallery-photo-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

/* Щелчок / двойной щелчок: scale(2.2) — см. initGalleryPhotoZoom в app.js */
.gallery-album-photo-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 991.98px) {
    .gallery-album-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.js-zoomable-photo {
    cursor: zoom-in;
    transform-origin: center center;
    transition: transform 0.2s ease;
}

.js-zoomable-photo.is-zoomed {
    transform: scale(2.2);
    cursor: zoom-out;
}

/* Вкладки альбомов в фотоархиве (Bootstrap .nav-link зашит синим) */
.gallery-page .nav-tabs-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.gallery-page .nav-tabs .nav-link {
    color: var(--site-brown);
    white-space: nowrap;
    border-color: transparent;
}

.gallery-page .nav-tabs .nav-link:hover,
.gallery-page .nav-tabs .nav-link:focus {
    color: var(--site-brown-deep);
    border-color: var(--site-blue-soft-border) var(--site-blue-soft-border) transparent;
    isolation: isolate;
}

.gallery-page .nav-tabs .nav-link.active {
    color: var(--site-brown);
    background-color: var(--site-cream);
    border-color: var(--site-blue-soft-border) var(--site-blue-soft-border) #fff;
    font-weight: 600;
}

.gallery-page .nav-tabs .nav-link .badge {
    background-color: var(--site-brown) !important;
    color: #fff;
}

.gallery-photo-reactions-block {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--site-blue-soft-border);
}

.gallery-photo-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
    min-height: 1.4rem;
}

.gallery-photo-reactions .video-reaction-chip,
.gallery-photo-reactions .gallery-photo-reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: var(--site-cream-muted);
    border: 1px solid var(--site-blue-soft-border);
    font-size: 0.85rem;
}

.gallery-photo-reaction-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.gallery-photo-reaction-picker .react-btn {
    border: 1px solid var(--site-blue-soft-border);
    background: #fff;
    border-radius: 999px;
    padding: 0.15rem 0.45rem;
    cursor: pointer;
    line-height: 1;
    font-size: 1rem;
    transition: background 0.15s, border-color 0.15s;
}

.gallery-photo-reaction-picker .react-btn:hover {
    border-color: var(--site-blue);
    background: var(--site-cream);
}

.school-photo-albums-accordion .accordion-item {
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.school-photo-albums-accordion .school-photo-album-accordion-btn {
    font-size: 1rem;
    font-weight: 600;
    color: var(--site-brown);
}

.school-photo-albums-accordion .school-photo-album-accordion-btn:not(.collapsed) {
    color: var(--site-brown);
    background-color: var(--site-cream-muted);
    box-shadow: inset 0 -1px 0 var(--site-blue-soft-border);
}

.school-photo-albums-accordion .school-photo-album-accordion-btn:focus {
    border-color: var(--site-blue-soft-border);
    box-shadow: 0 0 0 0.2rem rgba(var(--site-blue-rgb), 0.2);
}

.school-photo-albums-accordion .school-photo-album-accordion-btn > .text-truncate {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.school-photo-albums-accordion .accordion-header.d-flex {
    gap: 0;
}

.school-photo-albums-accordion .accordion-header.d-flex > .accordion-button {
    flex: 1 1 auto;
    min-width: 0;
}

.school-photo-album-to-gallery {
    flex: 0 0 auto;
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    padding: 0 0.65rem;
    font-size: 0.8125rem;
    white-space: nowrap;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-left: 0;
    background: var(--bs-accordion-btn-bg, #fff);
    color: var(--site-brown);
    text-decoration: none;
}

.school-photo-album-to-gallery:hover {
    text-decoration: underline;
    color: var(--site-brown-deep);
}

.school-photo-albums-accordion .accordion-item:first-of-type .school-photo-album-to-gallery {
    border-top-right-radius: var(--bs-accordion-border-radius, 0.375rem);
}

.school-photo-albums-accordion .accordion-item:last-of-type .accordion-button.collapsed ~ .school-photo-album-to-gallery,
.school-photo-albums-accordion .accordion-item:last-of-type .accordion-button:not(.collapsed) ~ .school-photo-album-to-gallery {
    border-bottom-right-radius: var(--bs-accordion-border-radius, 0.375rem);
}

/* Лайтбокс фотоальбома на странице училища (поверх сайта, scale 2.2) */
.school-photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    box-sizing: border-box;
}

.school-photo-lightbox[hidden] {
    display: none !important;
}

.school-photo-lightbox__backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.88);
    cursor: zoom-out;
}

.school-photo-lightbox__dialog {
    position: relative;
    z-index: 1;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.school-photo-lightbox__close {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.school-photo-lightbox__close:hover {
    background: #fff;
}

.school-photo-lightbox__imgwrap {
    --school-album-lb-scale: 2.2;
    transform: scale(var(--school-album-lb-scale));
    transform-origin: center center;
}

.school-photo-lightbox__img {
    display: block;
    max-width: min(90vw, calc(100vw / var(--school-album-lb-scale)));
    max-height: min(90vh, calc(100vh / var(--school-album-lb-scale)));
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.gallery-photo-placeholder {
    width: 100%;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #9ca3af;
}

.gallery-photo-body {
    padding: 0.75rem;
}

.gallery-photo-caption {
    font-size: 0.9rem;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-sort-handle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #6c757d;
    cursor: grab;
    font-size: 0.78rem;
    font-weight: 600;
    user-select: none;
}

.js-sortable-item {
    transition: box-shadow 0.18s ease, background-color 0.18s ease;
}

.js-sortable-item .admin-sort-handle:active,
.js-sortable-item.opacity-50 .admin-sort-handle {
    cursor: grabbing;
}

.js-sortable-item.admin-drop-target {
    background: rgba(var(--site-blue-rgb), 0.08);
    box-shadow: inset 0 0 0 2px rgba(var(--site-blue-rgb), 0.25);
}

.scroll-to-top-btn {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1055;
    border: 0;
    border-radius: 999px;
    background: #ffffff;
    color: #0d4d8b;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    padding: 0.55rem 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.scroll-to-top-btn i {
    font-size: 1rem;
    line-height: 1;
}

.scroll-to-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-to-top-btn:hover {
    background: #f2f6fb;
}

@media (max-width: 575.98px) {
    .scroll-to-top-btn {
        right: 0.75rem;
        bottom: 0.75rem;
        padding: 0.55rem;
    }

    .scroll-to-top-btn span {
        display: none;
    }
}

.registration-page-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.registration-page-body > main {
    flex: 1 0 auto;
}

.registration-card {
    max-width: 760px;
    border-radius: 20px;
    border: 1px solid rgba(110, 177, 242, 0.45);
    background: linear-gradient(180deg, #5b6677 0%, #49627f 100%);
    color: #eaf3ff;
    padding: 1.1rem 1.1rem 1.5rem;
    box-shadow: 0 14px 38px rgba(4, 25, 52, 0.35);
}

.registration-logo-wrap {
    margin-top: 0.1rem;
    margin-bottom: 0.55rem;
    display: flex;
    justify-content: center;
}

.registration-logo {
    width: 112px;
    height: 112px;
    object-fit: cover;
    border-radius: 999px;
    border: 2px solid #65c0ff;
    background: rgba(255, 255, 255, 0.12);
}

.registration-logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.registration-title {
    color: var(--site-blue);
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.registration-title .bi {
    color: var(--site-blue);
}

body.theme-dark .registration-title,
body.theme-dark .registration-title .bi {
    color: var(--site-blue-on-dark);
}

.registration-subtitle {
    color: #d2e9ff;
}

.registration-card .form-label {
    color: #f0f7ff;
    margin-bottom: 0.35rem;
}

.registration-input {
    background: #f2f6fb;
    border: 1px solid #89a2bf;
    color: #17324f;
}

.registration-input:focus {
    background: #ffffff;
    border-color: #a9c2de;
    box-shadow: 0 0 0 0.2rem rgba(169, 194, 222, 0.25);
    color: #17324f;
}

.registration-input::placeholder {
    color: #607a99;
}

.registration-card select.registration-input option {
    color: #0c2742;
    background: #ffffff;
}

.registration-avatar-row {
    margin-top: 0.15rem;
}

.registration-avatar-preview {
    width: 112px;
    height: 112px;
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(110, 177, 242, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
}

.registration-avatar-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.registration-avatar-preview-ph {
    font-size: 3.25rem;
    color: rgba(240, 247, 255, 0.42);
    line-height: 1;
}

.registration-submit {
    background: linear-gradient(180deg, var(--site-brown-deep) 0%, var(--site-blue) 100%);
    border: 0;
}

.registration-submit:hover {
    filter: brightness(1.05);
}

.registration-login-btn {
    min-width: 90px;
}

.auth-panel {
    background: linear-gradient(180deg, #4e596a 0%, #3f4a5c 100%);
    border-color: rgba(164, 177, 196, 0.45);
}

.hero-main-panel,
.hero-auth-panel {
    display: flex;
    flex-direction: column;
}

.hero-main-panel .hero-primary-actions,
.hero-auth-panel .auth-login-actions {
    margin-top: auto;
}

.hero-auth-panel .auth-login-actions {
    transform: translateY(3px);
}

.hero-primary-actions .btn,
.auth-login-actions .btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.role-rights-divider {
    width: 50%;
    margin: 0.75rem auto 0.8rem;
    border: 0;
    border-top: 1px solid rgba(229, 231, 235, 0.45);
}

.role-rights-text {
    font-size: 1rem;
    line-height: 1.5;
}

/* Праздничный баннер (главная, между картой и списком училищ) */
.holiday-banner-section {
    background: transparent;
}

.holiday-banner {
    display: flex;
    align-items: stretch;
    height: 130px;
    max-width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--site-blue-soft-border);
    box-shadow: 0 8px 24px rgba(var(--site-blue-rgb), 0.08);
    background: #fff;
}

.holiday-banner__aside {
    position: relative;
    flex: 0 0 118px;
    width: 118px;
    min-height: 130px;
    background: linear-gradient(160deg, #7C3A17 0%, var(--site-blue) 55%, #3d2a22 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.holiday-banner__img {
    display: block;
    width: 100%;
    height: 130px;
    object-fit: cover;
    object-position: center;
}

/* Щелчок/двойной щелчок по изображению праздника увеличивает его поверх баннера (.js-zoomable-photo, см. initGalleryPhotoZoom в app.js) */
.holiday-banner:has(.js-zoomable-photo.is-zoomed) {
    overflow: visible;
    position: relative;
    z-index: 20;
}

.holiday-banner__aside:has(.js-zoomable-photo.is-zoomed) {
    overflow: visible;
    position: relative;
    z-index: 21;
}

.holiday-banner__aside--gallery {
    position: relative;
}

.holiday-banner__gallery-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.3rem;
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    z-index: 2;
}

.holiday-banner__gallery-dot {
    width: 6px;
    height: 6px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.holiday-banner__gallery-dot.is-active {
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.holiday-banner__img--site-logo {
    object-fit: contain;
    padding: 0.65rem 0.5rem;
    box-sizing: border-box;
    background: linear-gradient(160deg, #7C3A17 0%, var(--site-blue) 55%, #3d2a22 100%);
}

.holiday-banner__aside-pattern {
    height: 100%;
    min-height: 130px;
    background:
        radial-gradient(circle at 50% 36%, rgba(245, 158, 11, 0.35) 0%, transparent 42%),
        linear-gradient(160deg, #7C3A17 0%, var(--site-blue) 100%);
}

.holiday-banner__date-chip {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    padding: 0.2rem 0.25rem;
    text-align: center;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.15;
    color: #fff;
    background: rgba(17, 24, 39, 0.78);
    border-bottom: 1px solid rgba(245, 158, 11, 0.45);
}

.holiday-banner__main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.4rem 0.65rem 0.45rem 0.75rem;
    background: linear-gradient(180deg, #fdfbf7 0%, #f7f4ee 100%);
    border-left: 4px solid #7c2d12;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
}

.holiday-banner__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--site-blue);
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
}

.holiday-banner__title .bi {
    color: var(--site-blue);
    flex-shrink: 0;
    margin-top: 0.12rem;
}

.holiday-banner__title-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-width: 0;
}

.holiday-banner__desc {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.28;
    color: #374151;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.holiday-banner__greet {
    flex: 0 0 clamp(200px, 26vw, 272px);
    width: clamp(200px, 26vw, 272px);
    padding: 0.45rem 0.55rem;
    background: linear-gradient(180deg, #fff9ed 0%, #fff4e0 100%);
    border-left: 1px dashed rgba(var(--site-blue-rgb), 0.22);
    display: flex;
    align-items: center;
}

.holiday-banner__greet-text {
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.8;
    text-align: start;
    color: #9b1f35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
}

.holiday-banner__greet-text strong {
    font-weight: 700;
    color: inherit;
}

@media (max-width: 991.98px) {
    .holiday-banner {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .holiday-banner__greet {
        flex: 0 0 220px;
        width: 220px;
    }
}

.holiday-admin-thumb-img,
.holiday-admin-thumb-placeholder {
    width: 52px;
    height: 52px;
    object-fit: cover;
    vertical-align: middle;
}

.holiday-admin-thumb-placeholder {
    background: var(--site-blue-soft-bg, #F0EDE0);
    border-color: var(--site-blue-soft-border, #e0d8c8) !important;
    font-size: 1.25rem;
}

.holiday-admin-thumb-img--site-logo {
    object-fit: contain;
    padding: 4px;
    box-sizing: border-box;
    background: var(--site-blue-soft-bg, #F0EDE0);
}

a.holiday-admin-th-sort {
    border-bottom: 1px dashed rgba(var(--site-blue-rgb), 0.35);
}

a.holiday-admin-th-sort:hover {
    border-bottom-color: var(--site-blue, #5C4033);
    color: var(--site-blue, #5C4033) !important;
}

/* Страница училища: карточки воспоминаний (3 в ряд, 6 на страницу) */
.school-memories-mini-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 576px) {
    .school-memories-mini-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .school-memories-mini-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.school-memory-mini-meta {
    font-size: 0.72rem;
    line-height: 1.3;
    margin-top: 0.15rem;
}

.school-memory-mini-card {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(var(--site-blue-rgb), 0.14);
    background: #fff;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    color: inherit;
    min-width: 0;
}

.school-memory-mini-card:hover {
    box-shadow: 0 6px 16px rgba(var(--site-blue-rgb), 0.12);
    transform: translateY(-2px);
    color: inherit;
}

.school-memory-mini-cover {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(160deg, #eef3fa 0%, #e4eaf4 100%);
    overflow: hidden;
}

.school-memory-mini-comment-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    min-width: 1.35rem;
    padding: 0.12rem 0.38rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.15;
    color: #fff;
    background: rgba(var(--site-blue-rgb), 0.88);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    pointer-events: none;
}

.school-memory-mini-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.school-memory-mini-placeholder {
    width: 100%;
    height: 100%;
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: rgba(var(--site-blue-rgb), 0.35);
}

.school-memory-mini-body {
    padding: 0.35rem 0.45rem 0.45rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-height: 0;
}

.school-memory-mini-title {
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.school-memory-mini-author {
    font-size: 0.62rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.memory-story-page-media .news-media-block {
    max-width: 100%;
}

.memory-story-comment-body {
    word-break: break-word;
}

/* Начальники училищ: единый шаблон списка (годы ― звание Фамилия, Имя Отчество) */
.school-commanders-block .school-commanders-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.school-commanders-block .school-commanders-list li {
    position: relative;
    padding-left: 0.15rem;
    margin-bottom: 0.35rem;
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
}

.school-commanders-block .school-commanders-list li:last-child {
    margin-bottom: 0;
}

/* Чат выпускников */
.graduate-chat-dialog-row {
    color: inherit;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.graduate-chat-dialog-row:hover {
    border-color: var(--site-blue-soft-border, #e0d8c8) !important;
    box-shadow: 0 0.25rem 0.75rem rgba(var(--site-blue-rgb), 0.12) !important;
}

.graduate-chat-bubble {
    border-radius: 0.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(var(--site-blue-rgb), 0.12);
    background: #fff;
}

.graduate-chat-bubble--mine {
    margin-left: 2rem;
    background: var(--site-blue-soft-bg, #F0EDE0);
    border-color: var(--site-blue-soft-border, #e0d8c8);
}

.graduate-chat-bubble--peer {
    margin-right: 2rem;
}

.graduate-chat-bubble--unread {
    border-color: rgba(var(--site-blue-rgb), 0.45);
    box-shadow: 0 0 0 1px rgba(var(--site-blue-rgb), 0.15);
}

.graduate-chat-bubble--hidden-mod {
    background: #e8f7e8;
    border-color: #b6dfb8;
}

.graduate-chat-body-text {
    white-space: pre-wrap;
    word-break: break-word;
}

body.news-portal-body.graduate-chat-body .graduate-chat-bubble {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-main, #e5e7eb);
}

body.news-portal-body.graduate-chat-body .graduate-chat-bubble--mine {
    background: rgba(var(--site-blue-rgb), 0.35);
    border-color: rgba(142, 197, 235, 0.35);
}

body.news-portal-body.graduate-chat-body .graduate-chat-bubble--hidden-mod {
    background: rgba(120, 180, 120, 0.22);
    border-color: rgba(120, 200, 120, 0.45);
}

/* ——— Календарь мероприятий ——— */
.events-calendar-table {
    width: 100%;
    overflow: hidden;
}

.events-calendar-table .row {
    margin-left: 0;
    margin-right: 0;
    flex-wrap: nowrap;
}

.events-calendar-table .row > .col {
    flex: 0 0 14.285714%;
    max-width: 14.285714%;
    min-width: 0;
}

.events-calendar-head-cell {
    padding: 0.5rem 0.25rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    background: rgba(var(--site-blue-rgb), 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.events-calendar-week + .events-calendar-week .events-calendar-day {
    border-top: none;
}

.events-calendar-day {
    min-height: 6.5rem;
    padding: 0.35rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-right: none;
    vertical-align: top;
}

.events-calendar-week .events-calendar-day:last-child {
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.events-calendar-day--empty {
    background: rgba(0, 0, 0, 0.02);
}

.events-calendar-day--no-events {
    cursor: pointer;
}

.events-calendar-day--no-events:hover {
    background: rgba(var(--site-blue-rgb), 0.04);
}

.events-calendar-day--today {
    background: rgba(var(--site-blue-rgb), 0.06);
    box-shadow: inset 0 0 0 2px rgba(var(--site-blue-rgb), 0.35);
}

.events-calendar-day-num {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.25rem;
}

.events-calendar-day-event {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    border-radius: 4px;
    background: var(--site-blue);
    color: #fff;
    font-size: 0.72rem;
    line-height: 1.25;
    padding: 0.2rem 0.35rem;
    margin-bottom: 0.2rem;
    cursor: pointer;
}

.events-calendar-day-event:hover {
    background: var(--site-brown-deep);
}

.events-calendar-day-event--holiday {
    background: linear-gradient(135deg, #fff8e1 0%, #ffe082 100%);
    color: #7b4f00;
    border: 1px solid #ffc107;
    font-weight: 600;
}

.events-calendar-day-event--holiday:hover {
    background: linear-gradient(135deg, #ffe082 0%, #ffd54f 100%);
    color: #5d4037;
}

.events-calendar-day-event-icon {
    margin-right: 0.2rem;
    font-size: 0.85em;
    vertical-align: -0.05em;
}

.events-calendar-day-event-time {
    opacity: 0.85;
    margin-right: 0.2rem;
}

.event-detail-modal-content {
    border-radius: 12px;
}

.event-card-title {
    color: var(--site-blue);
    font-weight: 700;
}

.event-card-body--holiday .event-card-holiday-greeting,
.event-card-holiday-greeting {
    font-size: 1.08rem;
    line-height: 1.55;
    color: var(--site-blue, #5C4033);
    text-align: start;
}

.event-card-body--holiday .event-card-holiday-greeting strong,
.event-card-holiday-greeting strong {
    font-weight: 700;
    color: inherit;
}

.event-card-meta-item {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.event-card-meta-item i {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.event-card-image {
    object-fit: cover;
    max-height: 320px;
}

.event-registration-box--closed {
    background: #f8f9fa;
    color: #6c757d;
}

.event-external-link-desc {
    line-height: 1.45;
}

.event-messages-log {
    max-height: 280px;
    overflow-y: auto;
}

body.theme-dark .events-calendar-day-event {
    background: #2a6cb8;
}

body.theme-dark .events-calendar-day-event--holiday {
    background: linear-gradient(135deg, #5d4037 0%, #8d6e63 100%);
    color: #fff8e1;
    border-color: #ffb74d;
}

body.theme-dark .events-calendar-day-event--holiday:hover {
    background: linear-gradient(135deg, #6d4c41 0%, #a1887f 100%);
}

body.theme-dark .events-calendar-head-cell {
    background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 767.98px) {
    .events-calendar-day {
        min-height: 4.5rem;
        padding: 0.2rem;
    }

    .events-calendar-day-num {
        font-size: 0.7rem;
    }

    .events-calendar-day-event {
        font-size: 0.62rem;
        padding: 0.15rem 0.2rem;
    }

    .events-calendar-head-cell {
        font-size: 0.7rem;
        padding: 0.35rem 0.1rem;
    }
}

body.theme-dark .event-card-title {
    color: #8ec5eb;
}

body.theme-dark .event-card-body--holiday .event-card-holiday-greeting,
body.theme-dark .event-card-holiday-greeting {
    color: #8ec5eb;
}
