/* Содержимое использует ширину холста одинаково в редакторе и на опубликованной странице. */
.public-news-article, .article-document, .widget-rich-text { overflow-wrap: anywhere; }
.article-prose img, .widget-rich-text img { max-width: 100%; height: auto; }
.article-prose pre, .widget-rich-text pre { max-width: 100%; overflow-x: auto; white-space: pre; overflow-wrap: normal; }
.article-prose table, .widget-rich-text table { display: block; max-width: 100%; overflow-x: auto; }
.article-prose blockquote, .widget-rich-text blockquote { margin-inline: clamp(12px, 3cqw, 32px); }
.article-editor__sidebar .editor-properties { width: 100%; height: auto; }
.stream-widget--wide-player { container-type: inline-size; }
.stream-widget__external { display: none; }
@container (max-width: 399px) {
    .stream-widget--wide-player > iframe { display: none; }
    .stream-widget__external { display: grid; place-items: center; min-height: 300px; padding: 20px; text-align: center; }
}

@container site-canvas (max-width: 1100px) {
    html, body, .site-header__nav, .public-home *, .public-news-article * { scrollbar-width: none; }
    html::-webkit-scrollbar,
    body::-webkit-scrollbar,
    .site-header__nav::-webkit-scrollbar,
    .public-home *::-webkit-scrollbar,
    .public-news-article *::-webkit-scrollbar { display: none; }
}

@media (max-width: 1499px) {
    body > .site-header .site-header__desktop-account-actions { display: none; }
    body > .site-header .site-header__account-menu { display: block; }
}

@media (min-width: 701px) and (max-width: 1050px) {
    body > .site-header {
        height: 78px !important;
        min-height: 78px !important;
        grid-template-columns: max-content minmax(0, 1fr) max-content;
        grid-template-rows: 1fr;
        column-gap: clamp(12px, 2vw, 24px) !important;
        padding: 0 22px !important;
    }
    body > .site-header .site-header__brand { grid-column: 1; grid-row: 1; font-size: clamp(20px, 2.2vw, 28px); }
    body > .site-header .site-header__nav {
        position: static !important;
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        height: 100%;
        padding: 0;
        justify-content: center;
        gap: clamp(12px, 2vw, 22px);
        overflow: hidden;
        transform: none !important;
        background: none;
    }
    body > .site-header .site-header__nav a { font-size: 13px; }
    body > .site-header .site-header__account { grid-column: 3; grid-row: 1; flex-wrap: nowrap; }
    body > .site-header .site-header__desktop-account-actions { display: none; }
    body > .site-header .site-header__account-menu { display: block; }
}

@container site-canvas (min-width: 701px) and (max-width: 1050px) {
    .site-header {
        height: 78px !important;
        min-height: 78px !important;
        grid-template-columns: max-content minmax(0, 1fr) max-content;
        grid-template-rows: 1fr;
        column-gap: clamp(12px, 2cqw, 24px) !important;
        padding: 0 22px !important;
    }
    .site-header .site-header__brand { grid-column: 1; grid-row: 1; font-size: clamp(20px, 2.2cqw, 28px); }
    .site-header .site-header__nav {
        position: static !important;
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        height: 100%;
        justify-content: center;
        gap: clamp(12px, 2cqw, 22px);
        overflow: hidden;
        transform: none !important;
        background: none;
    }
    .site-header .site-header__nav a { font-size: 13px; }
    .site-header .site-header__account { grid-column: 3; grid-row: 1; flex-wrap: nowrap; }
}

@media (max-width: 700px) {
    body > .site-header {
        height: auto !important;
        min-height: 96px !important;
        grid-template-columns: minmax(0, 1fr) max-content;
        grid-template-rows: 52px 44px;
        column-gap: 8px !important;
        row-gap: 0 !important;
        padding: 0 16px !important;
    }
    body > .site-header .site-header__brand {
        grid-column: 1;
        grid-row: 1;
        font-size: clamp(16px, 4.2vw, 20px);
        letter-spacing: .05em;
    }
    body > .site-header .site-header__account {
        grid-column: 2;
        grid-row: 1;
        flex-wrap: nowrap;
        gap: 6px;
    }
    body > .site-header .site-header__desktop-account-actions { display: none; }
    body > .site-header .site-header__account-menu { display: block; }
    body > .site-header .site-header__account .angular-button {
        min-width: 0;
        min-height: 40px;
        padding: 8px 10px;
        font-size: 13px;
        white-space: nowrap;
    }
    body > .site-header .site-header__nav {
        position: static !important;
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        height: 44px;
        min-width: 0;
        justify-content: space-between;
        gap: 0;
        padding: 0;
        overflow-x: auto;
        overflow-y: hidden;
        border-top: 1px solid var(--line-bright);
        background: none;
        transform: none !important;
    }
    body > .site-header .site-header__nav a {
        flex: 1 0 auto;
        min-width: 0;
        min-height: 44px;
        padding: 0 8px;
        font-size: clamp(12px, 3vw, 14px);
    }
    body > .site-header .site-header__nav a.is-active::after { bottom: 0; }
    body > .site-header .site-language-menu { margin-left: 0; }
    body > .site-header .site-language-menu summary { min-width: 56px; min-height: 40px; }
}

@container site-canvas (max-width: 1100px) {
    .widget-tree .role-hero-copy h1 { font-size: clamp(26px, 7cqw, 58px) !important; letter-spacing: .01em; }
    .widget-tree .role-hero-copy h2 { font-size: clamp(20px, 5cqw, 32px) !important; letter-spacing: .08em; }
    .widget-tree .role-hero-copy p { font-size: 16px !important; }
    .widget-tree .content-button { max-width: 100%; white-space: normal; min-height: 44px; padding: 12px; }
    .widget-tree .content-menu ul { display: flex; flex-wrap: wrap; gap: 8px 16px; }
    .widget-tree .content-menu a { display: inline-block; min-height: 44px; padding-block: 10px; }
    .video-widget:not(.stream-widget) { height: auto; min-height: 0; aspect-ratio: 16 / 9; }
    .video-widget:not(.stream-widget) iframe { display: block; min-height: 0; height: 100%; }
    .public-news-article { max-width: calc(100% - 24px); padding-bottom: 32px; }
    .public-news-article > header h1 { font-size: clamp(28px, 7cqw, 48px); line-height: 1.15; }
    .public-news-article__meta { flex-wrap: wrap; }
    .article-prose, .widget-rich-text { font-size: 16px; line-height: 1.65; }
    .article-document h1 { font-size: 1.85em; }
    .article-document h2 { font-size: 1.5em; }
    .article-document h3 { font-size: 1.25em; }
    .article-task-list li { align-items: flex-start; overflow-wrap: anywhere; }
    .image-carousel__dots button { min-width: 36px; min-height: 36px; }
    .article-engagement__reactions button { min-height: 44px; }
    .server-selection--scene,
    .server-universe-scene[data-card-side="left"] .server-selection--scene {
        left: 12px;
        right: 12px;
        width: auto;
        max-height: calc(100% - 24px);
        padding: 54px 18px 18px;
        clip-path: none;
        overflow-wrap: anywhere;
        touch-action: pan-y;
    }
    .server-selection__close { min-height: 44px; min-width: 44px; top: 4px; right: 8px; }
    .server-selection .angular-button { min-width: 0; width: 100%; padding-inline: 12px; white-space: normal; }
    .server-universe-scene, .server-universe-scene canvas { touch-action: pan-y pinch-zoom; }
}

@container site-canvas (max-width: 700px) {
    .site-header {
        height: auto !important;
        min-height: 96px !important;
        grid-template-columns: minmax(0, 1fr) max-content;
        grid-template-rows: 52px 44px;
        column-gap: 8px !important;
        row-gap: 0 !important;
        padding: 0 16px !important;
    }
    .site-header .site-header__brand {
        grid-column: 1;
        grid-row: 1;
        font-size: clamp(16px, 4.2cqw, 20px);
        letter-spacing: .05em;
    }
    .site-header .site-header__account { grid-column: 2; grid-row: 1; flex-wrap: nowrap; gap: 6px; }
    .site-header .site-header__nav {
        position: static !important;
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        height: 44px;
        min-width: 0;
        justify-content: space-between;
        gap: 0;
        padding: 0;
        overflow-x: auto;
        overflow-y: hidden;
        border-top: 1px solid var(--line-bright);
        background: none;
        transform: none !important;
    }
    .site-header .site-header__nav a {
        flex: 1 0 auto;
        min-width: 0;
        min-height: 44px;
        padding: 0 8px;
        font-size: clamp(12px, 3cqw, 14px);
    }
    .site-header .site-header__nav a.is-active::after { bottom: 0; }
    .site-header .site-header__account .angular-button { min-width: 0; min-height: 40px; padding: 8px 10px; font-size: 13px; }
}


@container site-canvas (max-width: 1100px) {
    .widget-tree:not(.account-page-tree) .site-widget.widget-planethero {
        padding: 0 !important;
        height: calc(100svh - var(--planet-header-height, 78px)) !important;
        min-height: calc(100svh - var(--planet-header-height, 78px)) !important;
    }
}
