/* Растягиваем страницу на всю высоту экрана без фиксации футера */
html {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

main#main {
    flex: 1 0 auto;
}
/* =========================================
   Общая шапка, мобильное меню, футер и адаптив для /s/time/
   ========================================= */
.ms-header {
    background: linear-gradient(to right, rgb(24, 65, 0) 0%, rgb(45, 0, 0) 100%);
    border-bottom: 1px solid #6b6d19;
    width: 100%;
    position: relative;
    z-index: 60;
}

.ms-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ms-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.ms-brand-svg {
    height: 32px;
    width: auto;
    display: block;
}

.ms-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.ms-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 18px;
}

.ms-nav-list a {
    color: #ffd500;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition: color 0.2s;
}

.ms-nav-list a:hover,
.ms-nav-list a.active {
    color: #ffffff;
}

.ms-theme-btn,
.ms-menu-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 213, 0, 0.45);
    color: #ffd500;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 17px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ms-menu-btn {
    display: none;
    font-size: 20px;
}

/* Подшапка с инструментами времени */
.time-subbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6px 12px;
}

/* Компактный текстовый блок */
.ms-info-card {
    background: hsl(var(--b1) / 1);
    border: 1px solid hsl(var(--bc) / 0.12);
    border-radius: 14px;
    padding: 20px 22px;
    margin-top: 28px;
}

.ms-info-card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 10px;
}

.ms-info-card ul {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.92rem;
    opacity: 0.9;
}

/* Общий футер */
.ms-footer {
    background: linear-gradient(to right, rgb(24, 65, 0) 0%, rgb(45, 0, 0) 100%);
    border-top: 1px solid #6b6d19;
    color: #e2e8e4;
    padding: 24px 20px 18px;
    margin-top: auto;
    font-size: 14px;
}

.ms-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.ms-footer-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.ms-footer-tools a {
    color: #e2e8e4;
    text-decoration: none;
    font-size: 13px;
    opacity: 0.9;
}

.ms-footer-tools a:hover {
    color: #ffd500;
    opacity: 1;
}

.ms-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.ms-footer-bottom a {
    color: #ffd500;
    text-decoration: none;
    margin: 0 4px;
}

.ms-footer-bottom a:hover {
    color: #ffffff;
}

/* Горизонтальное мобильное меню (<= 820px) */
@media (max-width: 820px) {
    .ms-header-inner {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .ms-brand-svg {
        height: 28px;
    }

    .ms-menu-btn {
        display: inline-flex;
    }

    .ms-nav {
        display: none;
        width: 100%;
        padding: 12px 0 4px;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 10px 12px;
    }

    .ms-nav.show {
        display: flex;
    }

    .ms-nav-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .ms-nav-list a {
        display: inline-block;
        padding: 6px 10px;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.08);
        font-size: 13px;
    }

    .ms-footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* Адаптив под ТВ и 4K */
@media (min-width: 1600px) {
    .ms-header-inner,
    .ms-footer-inner,
    .time-subbar {
        max-width: 1400px;
    }
}

@media (min-width: 2400px) {
    .ms-header-inner,
    .ms-footer-inner,
    .time-subbar {
        max-width: 1800px;
    }
    .ms-nav-list a { font-size: 19px; }
    .ms-brand-svg { height: 42px; }
}