/* Общая оболочка Telegid: стили не переопределяют контент страниц. */
:root {
    --tg-bg: #fff;
    --tg-surface: #f4f6f6;
    --tg-ink: #171c20;
    --tg-text: #353d42;
    --tg-muted: #636d75;
    --tg-line: #e1e5e7;
    --tg-accent: #17617b;
    --tg-accent-hover: #104a61;
    --tg-accent-soft: #eaf3f6;
    --tg-font: 'Golos Text', Arial, sans-serif;
    --tg-layout-gutter: 24px;
}

.tg_layout_container {
    width: min(1280px, calc(100% - 2 * var(--tg-layout-gutter)));
    margin-inline: auto;
}
.tg_masthead, .tg_footer, .tg_top_notice, #cookie_note {
    font: 400 15px/1.5 var(--tg-font);
    color: var(--tg-text);
}
.tg_masthead a, .tg_footer a {
    text-decoration: none;
}
.tg_masthead :focus-visible, .tg_footer :focus-visible,
.tg_top_notice :focus-visible, #cookie_note :focus-visible {
    outline: 2px solid var(--tg-accent);
    outline-offset: 3px;
}
.tg_masthead {
    background: var(--tg-bg);
    border-bottom: 1px solid var(--tg-line);
}
.tg_masthead_top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    min-height: 108px;
    position: relative;
}
.tg_masthead_note {
    color: var(--tg-muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    text-transform: uppercase;
    letter-spacing: .075em;
}
.tg_masthead_note span {
    display: block;
    color: var(--tg-ink);
    font-size: 12px;
    letter-spacing: .02em;
}
.tg_wordmark {
    display: block;
    color: var(--tg-ink);
    text-align: center;
    line-height: 1;
}
.tg_wordmark:hover {
    color: var(--tg-ink);
}
.tg_wordmark b {
    display: block;
    font-size: 49px;
    font-weight: 700;
    letter-spacing: -.075em;
}
.tg_wordmark b span {
    color: var(--tg-accent);
}
.tg_wordmark small {
    display: block;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .1em;
    margin-top: 9px;
    color: var(--tg-muted);
}
.tg_masthead_actions {
    display: flex;
    justify-content: end;
    align-items: center;
    gap: 8px;
}
.tg_button, #cookie_note .cookie_accept {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 15px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--tg-accent);
    color: white;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
}
.tg_button:hover, #cookie_note .cookie_accept:hover {
    background: var(--tg-accent-hover);
    color: white;
}
.tg_add_link {
    white-space: nowrap;
    min-height: 34px;
    font-size: 13px;
}
.tg_icon_button {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 6px;
    color: var(--tg-ink);
    background: transparent;
    cursor: pointer;
}
.tg_icon_button:hover, .tg_search[open] > summary {
    background: var(--tg-accent-soft);
    color: var(--tg-accent);
}
.tg_icon_button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.tg_mobile_menu {
    display: none;
}
.tg_nav_wrap {
    border-top: 1px solid var(--tg-line);
}
.tg_navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    min-height: 46px;
}
.tg_navigation a {
    display: flex;
    align-items: center;
    position: relative;
    min-height: 46px;
    color: var(--tg-text);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}
.tg_navigation a:hover {
    color: var(--tg-accent);
}
.tg_navigation a[aria-current] {
    color: var(--tg-ink);
    font-weight: 650;
}
.tg_navigation a[aria-current]::after {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: var(--tg-ink);
}

/* Поиск — небольшая панель рядом с кнопкой, без перезагрузки при открытии. */
.tg_search {
    position: relative;
}
.tg_search summary {
    list-style: none;
}
.tg_search summary::-webkit-details-marker {
    display: none;
}
.tg_search_panel {
    position: absolute;
    inset: calc(100% + 8px) 0 auto auto;
    z-index: 1030;
    width: min(360px, calc(100vw - 32px));
    padding: 16px;
    background: var(--tg-bg);
    border: 1px solid var(--tg-line);
    border-radius: 8px;
    box-shadow: 0 8px 28px #171c201a;
}
.tg_search_panel label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-ink);
}
.tg_search_fields {
    display: flex;
    gap: 8px;
}
.tg_search_fields input {
    flex: 1;
    min-width: 0;
    width: 100%;
    min-height: 44px;
    border: 1px solid #cdd3d6;
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--tg-ink);
    background: var(--tg-bg);
    font: inherit;
}
.tg_search_panel small {
    display: block;
    margin-top: 8px;
    color: var(--tg-muted);
    font-size: 12px;
}

/* Информационная полоска и компактный футер. */
.tg_top_notice {
    background: var(--tg-surface);
    border-bottom: 1px solid var(--tg-line);
    font-size: 12px;
}
.tg_notice_inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.tg_notice_inner p {
    margin: 8px 0;
}
.tg_notice_inner .tg_icon_button {
    width: 36px;
    height: 36px;
    color: var(--tg-muted);
}
.tg_notice_inner .tg_icon_button svg {
    width: 18px;
    height: 18px;
}
.tg_footer {
    background: var(--tg-surface);
    border-top: 1px solid var(--tg-line);
    margin-top: 40px;
    padding: 28px 0 16px;
}
.tg_footer_grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.tg_footer .tg_wordmark {
    display: inline-block;
    text-align: left;
}
.tg_footer .tg_wordmark b {
    font-size: 35px;
}
.tg_footer_intro p {
    font-size: 13px;
    margin: 12px 0 0;
    max-width: 38ch;
    color: var(--tg-muted);
}
.tg_footer_intro strong {
    color: var(--tg-ink);
}
.tg_footer nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.tg_footer_heading {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 3px;
    color: var(--tg-ink);
}
.tg_footer nav a {
    font-size: 13px;
    color: var(--tg-text);
    overflow-wrap: anywhere;
}
.tg_footer nav a:hover, .tg_footer_bottom a:hover {
    color: var(--tg-accent);
    text-decoration: underline;
}
.tg_footer_bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid var(--tg-line);
    color: var(--tg-muted);
    font-size: 12px;
}
.tg_footer_bottom a {
    color: var(--tg-muted);
}

/* Сохраняем существующий cookie_note и его JS-контракт. */
#cookie_note {
    width: min(760px, calc(100% - 32px));
    bottom: 16px;
    z-index: 1035;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--tg-bg);
    border: 1px solid var(--tg-line);
    border-radius: 8px;
    box-shadow: 0 8px 28px #171c2020;
    font-size: 13px;
}
#cookie_note p {
    margin: 0;
}
#cookie_note a {
    color: var(--tg-accent);
    text-decoration: underline;
}
#cookie_note .cookie_accept {
    flex-shrink: 0;
}

@media (max-width: 1050px) {
    .tg_navigation {
        gap: 22px;
    }
}
@media (max-width: 720px) {
    :root {
        --tg-layout-gutter: 16px;
    }
    .tg_masthead_top {
        min-height: 78px;
        gap: 8px;
    }
    .tg_masthead_note, .tg_add_link {
        display: none;
    }
    .tg_wordmark {
        grid-column: 2;
        grid-row: 1;
    }
    .tg_wordmark b {
        font-size: 39px;
    }
    .tg_wordmark small {
        font-size: 9px;
        letter-spacing: .06em;
        margin-top: 6px;
    }
    .tg_masthead_actions {
        grid-column: 3;
        grid-row: 1;
    }
    .tg_search {
        position: static;
    }
    .tg_search_panel {
        inset: calc(100% - 4px) 0 auto auto;
    }
    .tg_navigation {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0 22px;
        padding-block: 4px;
    }
    .tg_masthead.tg_menu_ready .tg_mobile_menu {
        display: inline-grid;
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
    }
    .tg_masthead.tg_menu_ready:not(.tg_menu_open) .tg_nav_wrap {
        display: none;
    }
    .tg_navigation a {
        min-height: 44px;
    }
    .tg_notice_inner .tg_icon_button {
        width: 44px;
        height: 44px;
    }
    .tg_footer {
        margin-top: 32px;
        padding-top: 24px;
    }
    .tg_footer_grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 16px;
    }
    .tg_footer_intro {
        grid-column: 1 / -1;
    }
    .tg_footer_intro p {
        max-width: none;
    }
    .tg_footer nav a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    .tg_footer nav {
        gap: 0;
    }
    .tg_footer nav:last-child {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 16px;
    }
    .tg_footer nav:last-child .tg_footer_heading {
        grid-column: 1 / -1;
    }
    #cookie_note {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .tg_search_fields button, #cookie_note .cookie_accept {
        min-height: 44px;
    }
}
@media (max-width: 360px) {
    .tg_masthead_top .tg_wordmark b {
        font-size: 34px;
    }
}
