h1.color {
    font-weight: bold;
    text-align: center;
    color: #673ab7;
}

.btn-primary {
    background: linear-gradient(0deg, #9170c8 0%, #673ab7 100%)!important;
}

.text-bg-light {
    background: linear-gradient(0deg, #9cc440 0%, #d9f380 100%);
}

.justified-text {
    text-align: justify;
}

/* Общие стили для имитации страницы А4 - остаются без изменений */
.tl-a4-page {
    width: 210mm;
    height: 297mm;
    background-color: white;
    border: 1px solid #dee2e6;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20mm;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    color: #343a40;
    position: relative;
    margin: 0 auto;
    margin-bottom: 3rem !important;
}

/* --- СТИЛИ ДЛЯ ГЛАВНОЙ СТРАНИЦЫ (ЗАГЛАВНОЙ) --- */
.tl-a4-page-main {
    /* justify-content: space-between; Убираем, так как gap будет управлять отступами */
    text-align: center;
    gap: 30mm; /* Добавляем универсальный отступ между секциями главной страницы */
}

/* Секция шапки главной страницы */
.tl-header-section {
    /* margin-bottom: 50mm; Убираем, отступ управляется через gap родителя */
}

/* Секция заголовка проекта главной страницы */
.tl-title-section {
    /* flex-grow: 1; УДАЛЯЕМ ЭТО СВОЙСТВО, чтобы заголовок не отталкивал детали вниз */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* margin-bottom: 50mm; Убираем, отступ управляется через gap родителя */
}

/* Заголовки главной страницы - БЕЗ ИЗМЕНЕНИЙ */
.tl-heading-h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.2;
}

.tl-heading-h2 {
    font-size: 1.8rem;
    font-weight: normal;
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.tl-heading-h3 {
    font-size: 1.5rem;
    font-weight: normal;
    margin-top: 0;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.tl-heading-h4 {
    font-size: 1.2rem;
    font-weight: normal;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.2;
}

/* Секция с деталями (выполнил, руководитель) на главной странице - БЕЗ ИЗМЕНЕНИЙ */
.tl-details-section {
    text-align: right;
    align-self: flex-end;
    margin-left: auto;
    margin-right: 20%;
}

.tl-details-row {
    margin-bottom: 1rem;
}

.tl-details-label {
    display: inline-block;
    width: 120px;
    font-weight: bold;
    text-align: left;
}

/* Секция футера (года) на главной странице */
.tl-footer-section {
    text-align: center;
    margin-top: auto; /* Остается, чтобы футер прилипал к низу, если есть свободное место */
    font-size: 1rem;
    color: #6c757d;
}

/* --- СТИЛИ ДЛЯ СТРАНИЦЫ СОДЕРЖАНИЯ - БЕЗ ИЗМЕНЕНИЙ --- */
.tl-a4-page-contents {
    justify-content: flex-start;
    gap: 0;
}

.tl-a4-page-contents h2 {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 25mm;
    color: #212529;
}

.tl-contents-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tl-contents-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0.3rem;
    font-size: 1.1rem;
    line-height: 1.4;
    overflow: hidden;
}

.tl-contents-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    padding-right: 0.5rem;
    font-weight: normal;
    color: #343a40;
    margin: 0;
}

.tl-contents-dots {
    flex-grow: 1;
    border-bottom: 1px dotted #6c757d;
    margin: 0 0.5rem;
    height: 0.8em;
}

.tl-contents-page-number {
    flex-shrink: 0;
    font-weight: bold;
    color: #495057;
    min-width: 25px;
    text-align: right;
}

.tl-no-sections-message {
    text-align: center;
    font-style: italic;
    color: #6c757d;
    margin-top: 20mm;
}

/* --- СТИЛИ ДЛЯ СТРАНИЦЫ С ЗАБЛОКИРОВАННЫМ КОНТЕНТОМ --- */
.tl-a4-page-locked {
    position: relative; /* Для позиционирования оверлея */
    overflow: hidden; /* Скрывает контент за пределами страницы */
}

.tl-blurred-content {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
    color: transparent;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    line-height: 1.6;
    height: calc(100% - 70px);
    margin-top: 70px;
}

.tl-blurred-content:after {
    content: "<p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p> <p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p> <p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p>";
}

/* --- ОБНОВЛЕННЫЙ ВАРИАНТ СТИЛЕЙ ДЛЯ ЗАБЛОКИРОВАННОГО КОНТЕНТА --- */
.tl-overlay-locked-content-v2 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border: 1px solid #cce5ff;
    border-radius: 20px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35),
    0 0 0 8px rgba(0, 123, 255, 0.05);
    padding: 5mm;
    text-align: center;
    max-width: 90%;
    z-index: 10;
    backdrop-filter: blur(10px);

    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Анимация появления снизу */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 0%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Анимация пульсации границы */
@keyframes pulseBorder {
    0% { box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35), 0 0 0 8px rgba(0, 123, 255, 0.05); }
    50% { box-shadow: 0 15px 45px rgba(0, 0, 0, 0.45), 0 0 0 12px rgba(0, 123, 255, 0.1); }
    100% { box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35), 0 0 0 8px rgba(0, 123, 255, 0.05); }
}

/* Новый контейнер для иконки замка */
.tl-lock-centered-icon-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 12;
}

/* Стили для самого замка */
.tl-lock-centered-icon-container .lock-icon {
    font-size: 5rem;
    color: #673ab7;
    filter: drop-shadow(0 0 10px rgba(103, 58, 183, 0.7)) drop-shadow(0 0 20px rgba(103, 58, 183, 0.3));

    opacity: 0.6; /* Делаем полупрозрачным */
    animation: lockShake 0.5s infinite alternate ease-in-out; /* Анимация тряски */
    transition: all 0.3s ease-in-out; /* Плавный переход для hover-эффектов */
    /* Важно: transform здесь НЕ должен быть установлен по умолчанию,
       так как он будет конфликтовать с трансформацией анимации.
       Анимация lockShake сама управляет transform. */
}

/* Эффекты при наведении на замок */
.tl-lock-centered-icon-container .lock-icon:hover {
    opacity: 1; /* Становится полностью непрозрачным */
    transform: scale(1.2); /* Увеличивается */
    animation: none; /* Останавливает тряску */
}

@keyframes lockShake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(2deg); }
    75% { transform: rotate(-2deg); }
    100% { transform: rotate(0deg); }
}

/* Корректируем стили для h3 и p, чтобы они не перекрывали замок */
.tl-overlay-locked-content-v2 h3 {
    font-size: 0.8rem;
    color: #1a202c;
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1.1;
    text-transform: uppercase;
    position: relative;
    z-index: 11;
}

.tl-overlay-locked-content-v2 h3::before,
.tl-overlay-locked-content-v2 h3::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 2px;
    background: #673ab7;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 1px;
}

.tl-overlay-locked-content-v2 h3::before {
    left: -80px;
}

.tl-overlay-locked-content-v2 h3::after {
    right: -80px;
}

.tl-overlay-locked-content-v2 p {
    font-size: 0.8rem;
    color: #343a40;
    line-height: 1.8;
    margin-top: 0.2rem;
    margin-bottom: 0;
    font-weight: 400;
    max-width: 85%;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    z-index: 11;
}

.tl-locked-page-main-heading {
    position: absolute;
    top: 20mm;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11;
    font-size: 2.2rem;
    font-weight: bold;
    color: #212529;
    text-align: center;
    width: 80%;
    line-height: 1.3;
    text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.8), -1px -1px 3px rgba(255, 255, 255, 0.8);
}

/* Стили для маленьких экранов (смартфоны, планшеты в портретной ориентации) */
@media (max-width: 768px) {
    .tl-a4-page {
        width: 100%;
        /* Удаляем min-height: 100vh; чтобы избежать проблем с высотой на мобильных */
        height: auto; /* Высота подстраивается под контент */
        margin: 0;
        border: none;
        box-shadow: none;
        padding: 15px; /* Уменьшаем внутренние отступы */
        justify-content: flex-start;
        gap: 20px;
        /* Добавляем box-sizing для единообразия, если вдруг был переопределен */
        box-sizing: border-box;
    }

    /* --- СТИЛИ ДЛЯ ГЛАВНОЙ СТРАНИЦЫ (ЗАГЛАВНОЙ) --- */
    .tl-a4-page-main {
        gap: 40px;
        padding: 20px 15px;
        /* Убедимся, что flex-grow не тянет страницу */
        flex-grow: 0;
    }

    .tl-header-section {
        margin-bottom: 0;
    }

    .tl-title-section {
        padding: 0 10px;
        /* Убедимся, что flex-grow не тянет секцию */
        flex-grow: 0;
    }

    .tl-heading-h1 {
        font-size: 1.8rem;
        line-height: 1.1;
    }

    .tl-heading-h2 {
        font-size: 1.4rem;
        margin-bottom: 0.8rem;
    }

    .tl-heading-h3 {
        font-size: 1.2rem;
        margin-bottom: 0.3rem;
    }

    .tl-heading-h4 {
        font-size: 1rem;
    }

    .tl-details-section {
        text-align: center;
        align-self: center;
        margin-right: auto;
        margin-left: auto;
        width: 100%;
    }

    .tl-details-row {
        display: flex;
        flex-direction: column;
        margin-bottom: 0.5rem;
    }

    .tl-details-label {
        width: auto;
        text-align: center;
        margin-bottom: 0.2rem;
    }

    .tl-footer-section {
        font-size: 0.9rem;
        margin-top: 30px;
        /* Остается auto, чтобы прилипать к низу, если контента мало */
        margin-top: auto;
    }

    /* --- СТИЛИ ДЛЯ СТРАНИЦЫ СОДЕРЖАНИЯ --- */
    .tl-a4-page-contents {
        padding: 15px;
        /* Убедимся, что flex-grow не тянет страницу */
        flex-grow: 0;
    }

    .tl-a4-page-contents h2 {
        font-size: 1.8rem;
        margin-bottom: 20mm;
    }

    .tl-contents-item {
        font-size: 1rem;
        margin-bottom: 0.2rem;
    }

    .tl-contents-dots {
        margin: 0 0.3rem;
    }

    .tl-contents-page-number {
        min-width: 20px;
    }

    /* --- СТИЛИ ДЛЯ СТРАНИЦЫ С ЗАБЛОКИРОВАННЫМ КОНТЕНТОМ --- */
    .tl-a4-page-locked {
        /* Высота будет определяться контентом, а не фиксироваться */
        height: auto;
    }

    .tl-blurred-content {
        filter: blur(3px);
        /* Высота теперь относительно родителя .tl-a4-page-locked */
        height: 100%;
        margin-top: 0; /* Убираем жесткий margin-top, так как padding страницы управляет отступом */
        padding-top: 50px; /* Добавляем padding-top, чтобы заголовок не наезжал */
        padding-bottom: 20px; /* Добавим padding-bottom для отступа снизу */
        box-sizing: border-box; /* Важно для padding */
    }

    .tl-blurred-content:after {
        /* Если заглушка генерируется через :after, убедитесь, что она не добавляет лишней высоты */
        content: ""; /* Оставляем пустым, так как контент размывается */
        height: 0; /* Убираем высоту, если она была задана через content */
        display: none; /* Скрываем, если не нужен контент для размытия */
    }


    .tl-overlay-locked-content-v2 {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        max-width: 100%;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .tl-lock-centered-icon-container .lock-icon {
        font-size: 3rem;
        filter: drop-shadow(0 0 5px rgba(103, 58, 183, 0.7)) drop-shadow(0 0 10px rgba(103, 58, 183, 0.3));
    }

    .tl-overlay-locked-content-v2 h3 {
        font-size: 0.7rem;
        margin-top: 15px;
        margin-bottom: 15px;
        gap: 15px;
    }

    .tl-overlay-locked-content-v2 h3::before,
    .tl-overlay-locked-content-v2 h3::after {
        width: 40px;
        height: 1px;
    }

    .tl-overlay-locked-content-v2 h3::before {
        left: -55px;
    }

    .tl-overlay-locked-content-v2 h3::after {
        right: -55px;
    }

    .tl-overlay-locked-content-v2 p {
        font-size: 0.75rem;
        max-width: 90%;
    }

    .tl-locked-page-main-heading {
        font-size: 1.6rem;
        top: 15mm;
        width: 90%;
    }
}

/* Дополнительные стили для очень маленьких экранов (смартфоны в портретной ориентации) */
@media (max-width: 480px) {
    .tl-a4-page {
        padding: 10px;
        gap: 15px;
    }

    .tl-a4-page-main {
        gap: 30px;
        padding: 15px 10px;
    }

    .tl-heading-h1 {
        font-size: 1.5rem;
    }

    .tl-heading-h2 {
        font-size: 1.2rem;
    }

    .tl-heading-h3 {
        font-size: 1rem;
    }

    .tl-heading-h4 {
        font-size: 0.9rem;
    }

    .tl-details-label {
        font-size: 0.9rem;
    }

    .tl-a4-page-contents h2 {
        font-size: 1.5rem;
        margin-bottom: 15mm;
    }

    .tl-contents-item {
        font-size: 0.9rem;
    }

    .tl-overlay-locked-content-v2 {
        padding: 5mm;
    }

    .tl-lock-centered-icon-container .lock-icon {
        font-size: 2.5rem;
    }

    .tl-overlay-locked-content-v2 h3 {
        font-size: 0.6rem;
        gap: 10px;
    }

    .tl-overlay-locked-content-v2 h3::before,
    .tl-overlay-locked-content-v2 h3::after {
        width: 30px;
    }

    .tl-overlay-locked-content-v2 h3::before {
        left: -45px;
    }

    .tl-overlay-locked-content-v2 h3::after {
        right: -45px;
    }

    .tl-overlay-locked-content-v2 p {
        font-size: 0.7rem;
    }

    .tl-locked-page-main-heading {
        font-size: 1.3rem;
        top: 10mm;
    }
}
