html.theme-dark-pending body.page-site,
html.theme-dark-pending body.page-site.theme-dark {
    --tm-bg: #0f1218;
    --tm-surface: #1a1f29;
    --tm-ink: #f3f4f6;
    --tm-ink-soft: #c5cad3;
    --tm-muted: #9aa3b2;
    --tm-line: #2a3140;
    background-color: #0f1218;
    color: #f3f4f6;
}

html.theme-dark-pending body.page-site .headerbar,
html.theme-dark-pending body.page-site .headerbar--home {
    background: rgba(18, 22, 30, 0.94);
    border-bottom-color: rgba(42, 49, 64, 0.95);
}

html.theme-dark-pending body.page-site .menuburger,
html.theme-dark-pending body.page-site .menulang,
html.theme-dark-pending body.page-site.theme-dark .menuburger,
html.theme-dark-pending body.page-site.theme-dark .menulang {
    filter: invert(1) brightness(0.96);
    opacity: 0.92;
}
.page-site .headerbar--home {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px 28px;
    padding: 14px clamp(20px, 5vw, 64px) 14px clamp(36px, 7vw, 96px);
}

.page-site .headerbar__brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    margin-left: clamp(8px, 2vw, 28px);
    min-width: 0;
}

.page-site .headerbar__mark {
    width: 84px;
    height: 84px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
    border-radius: 14px;
    background: transparent;
}

.page-site .headerbar__navbar {
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
}

.page-site .headerbar__lang {
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
}

.page-site .menuburger,
.page-site .menulang {
    object-fit: contain;
    opacity: 0.9;
}

.page-site .menuburger {
    width: 20px !important;
    height: 14px !important;
}

.page-site .menulang {
    width: 22px !important;
    height: 22px !important;
}

.page-site .headerbar__wordmark {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.page-site .headerbar__name {
    font-size: clamp(1.5rem, 2.4vw, 2.05rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1;
    color: var(--tm-ink);
    white-space: nowrap;
}

.page-site .headerbar__name b {
    font-weight: 700;
}

.page-site .headerbar__tag {
    font-size: clamp(0.72rem, 1.1vw, 0.875rem);
    font-weight: 500;
    line-height: 1.25;
    color: var(--tm-muted);
    white-space: nowrap;
}

.page-site .headerbar__tag em {
    font-style: normal;
    color: var(--tm-accent);
    font-weight: 600;
}

.page-site .headerbar__navulcontainer {
    justify-content: center;
    max-width: none;
    gap: 0;
    margin: 0 auto;
}

.page-site .headerbar__tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-right: clamp(4px, 1.5vw, 20px);
    margin-left: 8px;
}

.page-site .headerbar__lang {
    position: relative;
}

.page-site .headerbar__flags {
    gap: 6px;
}

.page-site .lang-link {
    padding: 7px 12px;
}

.page-site .lang-link img,
.page-site .headerbar__flags img {
    width: 30px;
    height: 30px;
}

.page-site .theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--tm-line);
    border-radius: 10px;
    background: var(--tm-surface);
    color: var(--tm-ink-soft);
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.page-site .theme-toggle:hover {
    border-color: rgba(224, 138, 18, 0.45);
    color: var(--tm-accent);
}

.page-site .theme-toggle svg {
    width: 22px;
    height: 22px;
    display: block;
}

.page-site .theme-toggle .icon-sun {
    display: none;
}

.page-site .theme-toggle .icon-moon {
    display: block;
}

.page-site.theme-dark .theme-toggle .icon-sun {
    display: block;
}

.page-site.theme-dark .theme-toggle .icon-moon {
    display: none;
}

/* Night theme (home only) */
.page-site.theme-dark {
    --tm-bg: #0f1218;
    --tm-surface: #1a1f29;
    --tm-ink: #f3f4f6;
    --tm-ink-soft: #c5cad3;
    --tm-muted: #9aa3b2;
    --tm-line: #2a3140;
    --tm-accent: #f0a12a;
    --tm-accent-hover: #ffb84a;
    background-color: var(--tm-bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(240, 161, 42, 0.08), transparent 55%),
        linear-gradient(180deg, #12161e 0%, var(--tm-bg) 30%, #0c0e13 100%);
    color: var(--tm-ink);
}

.page-site.theme-dark .headerbar,
.page-site.theme-dark .headerbar--home {
    background: rgba(18, 22, 30, 0.94);
    border-bottom-color: rgba(42, 49, 64, 0.95);
}

.page-site.theme-dark .headerbar__mark {
    border-radius: 14px;
    background: transparent;
    filter: saturate(0.9) contrast(0.98) brightness(0.98);
}

.page-site.theme-dark .headerbar__navbar,
.page-site.theme-dark .headerbar__lang,
.page-site.theme-dark .lang-link.is-active,
.page-site.theme-dark .theme-toggle {
    background: #222836;
    border-color: var(--tm-line);
    color: var(--tm-ink-soft);
}

.page-site.theme-dark .menuburger,
.page-site.theme-dark .menulang {
    filter: invert(1) brightness(0.96);
    opacity: 0.92;
}

.page-site.theme-dark .headerbar__name,
.page-site.theme-dark .headerbar__navbarul li a {
    color: var(--tm-ink);
}

.page-site.theme-dark .headerbar__navbarul li a:hover {
    color: var(--tm-accent);
    background: rgba(240, 161, 42, 0.12);
}

.page-site.theme-dark .headerbar__navbarul,
.page-site.theme-dark .headerbar__flags {
    background: #1a1f29;
    border-color: var(--tm-line);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.page-site.theme-dark .form,
.page-site.theme-dark .mixsteps li,
.page-site.theme-dark .pgpkey code,
.page-site.theme-dark .table,
.page-site.theme-dark .table-ar {
    background: var(--tm-surface);
    border-color: var(--tm-line);
}

.page-site.theme-dark .form input[type="text"],
.page-site.theme-dark .form input[type="number"],
.page-site.theme-dark #btcinput {
    background: #12161e;
    color: var(--tm-ink);
    border-color: var(--tm-line);
}

.page-site.theme-dark .optioncursor,
.page-site.theme-dark .H1,
.page-site.theme-dark .H2,
.page-site.theme-dark .H2FAQ,
.page-site.theme-dark .faqs,
.page-site.theme-dark .privacy-banner__title {
    color: var(--tm-ink);
}

@media (max-width: 1000px) {
    .page-site .headerbar__navbar,
    .page-site .headerbar__lang {
        border-color: var(--tm-line);
        background: var(--tm-surface);
    }

    .page-site.theme-dark .headerbar__navbar,
    .page-site.theme-dark .headerbar__lang {
        background: #222836;
        border-color: var(--tm-line);
    }
}

@media (max-width: 1100px) {
    .page-site .headerbar__tag {
        display: none;
    }

    .page-site .headerbar__mark {
        width: 64px;
        height: 64px;
    }
}

@media (max-width: 1000px) {
    .page-site .headerbar--home {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        position: relative;
        padding: 10px 12px;
        grid-template-columns: none;
        grid-template-areas: none;
    }

    .page-site .headerbar__brand {
        margin-left: 0;
        margin-right: auto;
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        z-index: 2;
    }

    .page-site .headerbar__navulcontainer {
        order: 2;
        justify-content: flex-end;
        margin: 0;
        flex: 0 0 auto;
        z-index: 2;
    }

    .page-site .headerbar__tools {
        order: 3;
        margin: 0;
        gap: 6px;
        flex: 0 0 auto;
        z-index: 2;
        display: flex;
        align-items: center;
    }

    /* Язык справа в ряду кнопок; иконка по центру кнопки */
    .page-site .headerbar__lang {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 4;
    }

    .page-site .headerbar__lang .selectorlang {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        opacity: 0;
        cursor: pointer;
        z-index: 3;
        transform: none !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
    }

    .page-site .headerbar__lang .menulang {
        position: static !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        transform: none !important;
        margin: 0 !important;
        width: 22px !important;
        height: 22px !important;
        display: block;
        pointer-events: none;
    }

    .page-site .headerbar__flags {
        top: calc(100% + 10px) !important;
        right: 0 !important;
        left: auto !important;
        transform: none !important;
    }

    .page-site .headerbar__name {
        font-size: 1.15rem;
    }

    .page-site .headerbar__mark {
        width: 52px;
        height: 52px;
    }

    .page-site .theme-toggle {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 560px) {
    .page-site .headerbar--home {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        padding: 10px 12px;
        grid-template-columns: none;
        grid-template-areas: none;
        row-gap: 0;
    }

    .page-site .headerbar__brand {
        gap: 8px;
        min-width: 0;
        margin-left: 0;
        margin-right: auto;
        max-width: none;
        grid-area: unset;
    }

    .page-site .headerbar__navulcontainer {
        order: 2;
        justify-content: flex-end;
        margin: 0;
        grid-area: unset;
    }

    .page-site .headerbar__tools {
        order: 3;
        gap: 6px;
        margin: 0;
        align-self: center;
        grid-area: unset;
    }

    .page-site .headerbar__lang {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: 42px;
        height: 42px;
    }

    .page-site .headerbar__name {
        font-size: 1rem;
    }

    .page-site .headerbar__mark {
        width: 44px;
        height: 44px;
    }

    .page-site .theme-toggle {
        width: 42px;
        height: 42px;
    }
}

/* SEO inner pages */
.page-site .seo-main {
    max-width: 42rem;
    margin: 1.5rem auto 4rem;
    padding: 0 20px 3rem;
    text-align: left;
    color: var(--tm-ink-soft);
}
.page-site .seo-main .breadcrumbs {
    font-size: 0.9rem;
    margin: 0 0 1rem;
    opacity: 0.85;
}
.page-site .seo-main > .H2:first-of-type,
.page-site .seo-main > h1.H2 {
    text-align: center;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--tm-ink);
}
.page-site .seo-main h2.H2 {
    text-align: left;
    font-size: clamp(1.2rem, 1.8vw, 1.45rem);
    margin-top: 2rem;
    margin-bottom: 0.85rem;
    color: var(--tm-ink);
}
.page-site .seo-main p {
    max-width: none;
    margin: 0 0 1rem;
    text-align: left;
    font-size: 1.0625rem;
    line-height: 1.72;
}
.page-site .seo-main ul {
    margin: 0 0 1.25rem;
    padding-left: 1.25rem;
    line-height: 1.7;
}
.page-site .seo-main li {
    margin-bottom: 0.45rem;
}
.page-site .seo-main a {
    color: var(--tm-accent);
    text-decoration: none;
}
.page-site .seo-main a:hover {
    color: var(--tm-accent-hover);
}
.page-site.theme-dark .seo-main,
.page-site.theme-dark .seo-main p,
.page-site.theme-dark .seo-main li {
    color: var(--tm-ink-soft);
}
