/* ===== Общие стили ===== */
* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    margin: 0;
    background: #1a1a1a;
    color: #ddd;
}
a { color: #4a90e2; }
h2 { color: #fff; }
input, select, button {
    font-family: inherit;
    font-size: 1em;
}
input[type=text], input[type=password], input[type=email], input[type=date], input[type=search], select {
    padding: 0.5em;
    border: 1px solid #555;
    border-radius: 4px;
    background: #3a3a3a;
    color: #fff;
    margin: 0.2em 0;
}
button, .btn {
    display: inline-block;
    padding: 0.5em 1em;
    background: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95em;
    text-align: center;
}
button:hover, .btn:hover { background: #357abd; }
.btn-danger { background: #ef4444; }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: #64748b; }
.btn-secondary:hover { background: #475569; }
pre {
    white-space: pre-wrap;
    background: #1e1e1e;
    padding: 1em;
    border-radius: 4px;
    border: 1px solid #333;
}
.warn { color: #f87171; font-weight: bold; }

/* ===== Главная страница (десктоп: 3 колонки) ===== */
.main-page {
    display: flex;
    min-height: 80vh;
    gap: 1.5em;
    align-items: flex-start;
    padding-top: 2em;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 1em;
    padding-right: 1em;
}
.col-login {
    flex: 0 0 20%;
    max-width: 20%;
    background: #2a2a2a;
    padding: 2em;
    border-radius: 8px;
    color: #eee;
}
.col-login h2 { color: #fff; margin-top: 0; }
.col-login input {
    width: 100%;
    padding: 0.6em;
    margin-bottom: 1em;
    background: #3a3a3a;
    border: 1px solid #555;
    color: #fff;
    border-radius: 4px;
}
.col-login button {
    width: 100%;
    padding: 0.7em;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}
.col-login button:hover { background: #357abd; }
.col-center {
    flex: 0 0 45%;
    max-width: 45%;
    text-align: center;
    padding-top: 2em;
}
.col-center .logo {
    margin-bottom: 1em;
}
.col-center .logo img {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}
.col-center .slogan {
    font-size: 1.2em;
    color: #aaa;
}
.col-ads {
    flex: 0 0 25%;
    max-width: 25%;
    display: flex;
    flex-direction: column;
    gap: 1em;
}
.ad-placeholder {
    background: #2a2a2a;
    border: 1px dashed #555;
    border-radius: 8px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.9em;
}

/* ===== Кнопки в левой колонке dashboard/profile — по центру ===== */
.main-page .col-login .btn,
.main-page .col-login button {
    text-align: center;
}

/* ===== Кнопки-ящики в dashboard ===== */
.col-center ul li .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    text-align: left;
}

/* ===== Пользовательские страницы ===== */
.container, .card {
    max-width: 900px;
    margin: 2em auto;
    padding: 1.5em;
    background: #2a2a2a;
    border-radius: 8px;
}

/* ===== Центрированное сообщение ===== */
.center-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    font-size: 1.3em;
}
.center-msg p { margin: 0.5em 0; }
.center-msg a {
    font-size: 0.85em;
    color: #4a90e2;
    text-decoration: none;
}
.center-msg a:hover { text-decoration: underline; }

/* ===== Админка ===== */
.admin-header {
    background: #111;
    color: #fff;
    padding: 1em 2em;
    display: flex;
    align-items: center;
    gap: 1.5em;
    flex-wrap: wrap;
}
.admin-header h1 { font-size: 1.2em; margin: 0; }
.admin-header a { color: #cbd5e1; text-decoration: none; margin-right: 1em; }
.admin-header a:hover { color: #fff; text-decoration: underline; }
.admin-container { max-width: 1400px; margin: 2em auto; padding: 0 1.5em; }
.card {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 1.5em;
    margin-bottom: 1.5em;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6em 0.8em; text-align: left; border-bottom: 1px solid #444; }
th { background: #333; font-weight: 600; font-size: 0.9em; text-transform: uppercase; letter-spacing: 0.03em; color: #eee; }
tr:hover td { background: #2f2f2f; }
.search-form { display: flex; gap: 0.5em; align-items: center; margin-bottom: 1em; flex-wrap: wrap; }

/* ===== Трёхколоночная страница писем (админка и ящик) ===== */
.three-col { display: flex; gap: 1.5em; align-items: flex-start; flex-wrap: wrap; max-width: 1400px; margin: 0 auto; }
.col-list { flex: 1; min-width: 220px; }
.col-text { flex: 2; min-width: 300px; }
.col-attach { flex: 1; min-width: 180px; }
.col-list, .col-text, .col-attach {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 1em;
    max-height: 80vh;
    overflow-y: auto;
}
.col-ads {
    background: transparent;
    padding: 1em;
}
.email-list { list-style: none; padding: 0; margin: 0; }
.email-list li { border-bottom: 1px solid #444; padding: 0.6em 0; }
.email-list li.active { background: #333; border-left: 3px solid #4a90e2; padding-left: 0.5em; }
.email-list a { color: #ddd; text-decoration: none; display: block; }
.email-list a:hover { color: #4a90e2; }
.email-list small { color: #999; }
pre.email-body {
    white-space: pre-wrap;
    background: #1e1e1e;
    padding: 1em;
    border-radius: 6px;
    border: 1px solid #333;
    font-size: 0.9em;
    max-height: 60vh;
    overflow-y: auto;
}
.attach-item { margin-bottom: 1em; text-align: center; }
.attach-item img, .attach-item video {
    max-width: 100%;
    max-height: 150px;
    border-radius: 5px;
    border: 1px solid #444;
}
.attach-item small { display: block; color: #999; margin-top: 0.3em; word-break: break-all; }

/* ===== Мобильная версия ===== */
.mobile-only { display: none; }

@media screen and (max-width: 900px) {
    /* Скрываем десктопные блоки, показываем мобильные */
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }

    /* Главная, dashboard, profile — три строки на всю ширину */
    .main-page {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 0.8em !important;
    }
    .main-page .col-login,
    .main-page .col-center,
    .main-page .col-ads {
        flex: 1 1 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        order: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    .main-page .col-center {
        text-align: center !important;
        padding: 1em !important;
    }
    .main-page .col-center .logo img {
        width: 100% !important;
        height: auto !important;
    }
    .main-page .col-login {
        padding: 1.5em !important;
    }
    .main-page .col-ads {
        padding: 1em !important;
    }
    .main-page .col-ads .ad-placeholder {
        height: 200px !important;
    }

    /* Страница ящика и админки — три строки на всю ширину */
    .three-col {
        flex-direction: column !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        gap: 0.8em !important;
    }
    .three-col .col-list,
    .three-col .col-text,
    .three-col .col-attach,
    .three-col .col-ads {
        flex: 1 1 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    /* Мобильная главная: порядок центр → вход → реклама */
    .mobile-only .col-center { order: 1; }
    .mobile-only .col-login { order: 2; }
    .mobile-only .col-ads { order: 3; }

    /* Отступы у мобильных блоков */
    .mobile-only > div {
        padding: 1.5em 1em !important;
        margin: 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .mobile-only .col-login form { text-align: left; }
    .mobile-only .ad-placeholder { height: 200px !important; }
}

/* Усиленное скрытие десктопной версии на мобильных */
@media screen and (max-width: 900px) {
    body .main-page.desktop-only {
        display: none !important;
    }
    body .mobile-only {
        display: block !important;
    }
}

/* ===== Юридические страницы ===== */
.legal-page { width: 100%; max-width: 1080px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.legal-paper { background: #242424; border: 1px solid #393939; border-radius: 12px; padding: 2.5rem 3rem; box-shadow: 0 14px 50px rgba(0,0,0,.14); }
.legal-header { border-bottom: 1px solid #3d3d3d; margin-bottom: 1.8rem; padding-bottom: 1.4rem; }
.legal-eyebrow { color: #94bfff; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; margin-top: 0; }
.legal-header h1 { font-size: clamp(1.65rem, 4vw, 2.35rem); color: #fff; line-height: 1.18; margin: .35rem 0 .9rem; }
.legal-updated { margin: 0; color: #aaa; font-size: .9rem; }
.legal-paper section { margin: 1.7rem 0 2.1rem; }
.legal-paper h2 { font-size: 1.18rem; line-height: 1.45; margin-bottom: .7rem; }
.legal-paper p, .legal-paper li { line-height: 1.75; color: #d1d5db; }
.legal-paper ul { padding-left: 1.4rem; }
.legal-paper li { margin: .35rem 0; }
.legal-paper strong { color: #fafafa; }
.legal-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid #454545; border-radius: 8px; }
.legal-table { min-width: 460px; }
.legal-table th { text-transform: none; letter-spacing: 0; }
.legal-table th, .legal-table td { padding: .75em 1em; }
.legal-return { margin-top: 2rem; }

/* ===== Обновлённый адаптивный подвал Fadepost ===== */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.site-footer {
    width: 100%;
    margin-top: auto;
    color: #bac5d4;
    background: linear-gradient(180deg, #171c24 0%, #10141a 100%);
    border-top: 1px solid #333e4c;
}
.site-footer-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2.75rem 1.5rem 2.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr) minmax(0, 1.1fr);
    column-gap: clamp(1.5rem, 4vw, 4.25rem);
    row-gap: 2rem;
}
.site-footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .85rem;
    min-width: 0;
}
/* Логотип занимает 15% ширины окна на компьютере. */
.site-footer-logo-link {
    display: block;
    width: 15vw;
    max-width: 100%;
    line-height: 0;
    border-radius: 8px;
    transition: opacity .2s ease, transform .2s ease;
}
.site-footer-logo-link:hover { opacity: .88; transform: translateY(-2px); }
.site-footer-logo-link:focus-visible { outline: 2px solid #84b7ff; outline-offset: 5px; }
.site-footer-logo-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
}
.site-footer-description {
    margin: .25rem 0 0;
    max-width: 26rem;
    color: #a4afbf;
    line-height: 1.65;
    font-size: .93rem;
}
.site-footer h2 {
    margin: 0 0 .35rem;
    font-size: .98rem;
    line-height: 1.4;
    font-weight: 700;
    color: #f8fafc;
}
.site-footer a {
    color: #c7dafa;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: color .15s ease;
}
.site-footer-links a {
    display: inline-block;
    padding: .1rem 0;
    font-size: .94rem;
    line-height: 1.55;
}
.site-footer a:hover, .site-footer a:focus-visible { color: #fff; text-decoration: underline; }
.site-footer a.site-footer-logo-link:hover,
.site-footer a.site-footer-logo-link:focus-visible { text-decoration: none; }
.site-footer-contacts { gap: .65rem; }
.site-footer-contact-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: .8rem 1rem;
    border: 1px solid #323c49;
    background: rgba(255,255,255,.035);
    border-radius: 10px;
}
.site-footer-contact-label {
    color: #aab7c8;
    font-size: .83rem;
    line-height: 1.4;
}
.site-footer-contact-card a {
    font-size: .96rem;
    font-weight: 600;
    line-height: 1.45;
}
.site-footer-phone {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    margin-top: .1rem;
    font-weight: 600;
}
.site-footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    border-top: 1px solid #2e3743;
    padding: 1rem 1.5rem 1.3rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    color: #8894a4;
    font-size: .8rem;
    line-height: 1.5;
}
@media (max-width: 760px) {
    .legal-page { padding: 1rem 0 2rem; }
    .legal-paper { padding: 1.35rem 1.1rem 2rem; border-radius: 0; border-left: none; border-right: none; }
    .legal-paper h2 { font-size: 1.08rem; }
    .site-footer-inner { grid-template-columns: 1fr; padding: 2.2rem 1.25rem 2rem; gap: 1.9rem; }
    .site-footer-brand { align-items: center; text-align: center; }
    /* Логотип занимает 50% ширины окна на телефоне. */
    .site-footer-logo-link { width: 50vw; }
    .site-footer-description { max-width: 25rem; }
    .site-footer-contact-card { max-width: 100%; }
    .site-footer-bottom { flex-direction: column; align-items: center; text-align: center; padding: 1rem 1.25rem 1.4rem; gap: .35rem; }
}
@media (prefers-reduced-motion: reduce) {
    .site-footer-logo-link, .site-footer a { transition: none; }
}

/* ===== Напоминание о продлении подписки ===== */
.subscription-alert { max-width: 1368px; margin: 1.25em auto 0; padding: 1.1em 1.3em; border: 1px solid #8c682a; border-radius: 8px; background: #29251b; display: flex; justify-content: space-between; align-items: center; gap: 1.2em; color: #f3e9d1; }
.subscription-alert strong { display: block; font-size: 1.08em; color: #fff; }
.subscription-alert p { margin: .4em 0 0; line-height: 1.55; }
.subscription-alert .btn { flex-shrink: 0; background: #4a90e2; }
.subscription-alert-expired { border-color: #9e4141; background: #302020; }
@media (max-width: 700px) { .subscription-alert { margin: .75em .75em 0; padding: 1em; flex-direction: column; align-items: stretch; } .subscription-alert .btn { width: 100%; } }


/* ===== Просмотр почтового ящика: собственная сетка, без переноса рекламы ===== */
/* На широком экране центральная колонка занимает около 55% рабочей ширины. */
.mailbox-view {
    display: grid;
    grid-template-columns: minmax(0, 22fr) minmax(0, 55fr) minmax(0, 23fr);
    gap: clamp(0.8rem, 1.4vw, 1.5rem);
    align-items: start;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 clamp(0.75rem, 1.5vw, 1.75rem) 2rem;
}
.mailbox-view .mailbox-sidebar {
    min-width: 0;
    width: 100%;
}
.mailbox-view .mailbox-heading {
    margin-bottom: 0.85rem;
}
.mailbox-view .mailbox-heading h2 {
    margin: 0 0 0.7rem;
    font-size: clamp(1.05rem, 1.4vw, 1.35rem);
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.mailbox-view .mailbox-heading p { margin: 0; }
.mailbox-view .mailbox-address { overflow-wrap: anywhere; }
.mailbox-view .col-list,
.mailbox-view .col-text,
.mailbox-view .col-ads {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    max-width: none;
    flex: none;
}
.mailbox-view .col-text { overflow-wrap: anywhere; }
.mailbox-view .col-text .email-body {
    max-width: 100%;
    overflow-wrap: anywhere;
}
.mailbox-view .col-ads {
    display: flex;
    flex-direction: column;
    align-self: start;
    padding: 1rem;
    gap: 1rem;
}
.mailbox-view .col-ads .ad-placeholder { width: 100%; }

/* Телефон и планшет: все блоки занимают всю доступную ширину. */
@media screen and (max-width: 900px) {
    .mailbox-view {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
        padding: 0 0 1.5rem;
        margin: 0;
        gap: 0.8rem;
    }
    .mailbox-view .mailbox-sidebar {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }
    .mailbox-view .mailbox-heading {
        padding: 0 1rem;
        margin-bottom: 0.8rem;
    }
    .mailbox-view .mailbox-heading h2 { font-size: 1.2rem; }
    .mailbox-view .col-list,
    .mailbox-view .col-text,
    .mailbox-view .col-ads {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 0;
        max-height: none;
        margin: 0;
        border-radius: 0;
    }
}

/* ===== Полноширинные страницы: главная, регистрация, dashboard, профиль =====
   На десктопе используем единую CSS Grid-сетку вместо flex-процентов,
   чтобы колонки занимали всю доступную ширину и не сдвигались из-за gap.
   Мобильные стили (<=900px) оставлены без изменений. */
@media screen and (min-width: 901px) {
    .main-page {
        display: grid;
        grid-template-columns: minmax(220px, 21fr) minmax(0, 59fr) minmax(205px, 20fr);
        column-gap: clamp(1rem, 1.6vw, 1.75rem);
        align-items: start;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 2rem clamp(1rem, 1.6vw, 2rem) 2.5rem;
    }

    .main-page > .col-login,
    .main-page > .col-center,
    .main-page > .col-ads {
        width: 100%;
        max-width: none;
        min-width: 0;
        flex: none;
    }

    .main-page > .col-ads {
        align-self: start;
    }

    .main-page .col-center ul,
    .main-page .col-center li {
        min-width: 0;
    }

    .main-page .col-center li,
    .main-page .col-center a {
        overflow-wrap: anywhere;
    }
}


/* ===== Уведомление cookie — общее для всех страниц ===== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    z-index: 10000;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(1rem, 2.5vw, 2rem);
    width: min(960px, calc(100% - 36px));
    padding: 1.25rem 1.4rem;
    color: #e6edf7;
    background: #202936;
    border: 1px solid #465469;
    border-radius: 15px;
    box-shadow: 0 14px 48px rgba(0,0,0,.55);
}
.cookie-banner-copy { min-width: 0; flex: 1; }
.cookie-banner-copy h2 {
    margin: 0 0 .45rem;
    color: #fff;
    font-size: 1.1rem;
    line-height: 1.3;
}
.cookie-banner-copy p {
    margin: 0;
    color: #c7d0df;
    font-size: .88rem;
    line-height: 1.55;
}
.cookie-banner-copy a { color: #91befa; text-underline-offset: .16em; }
.cookie-banner-actions {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: .65rem;
    flex: 0 0 185px;
}
.cookie-banner .cookie-btn {
    display: block;
    min-height: 42px;
    width: 100%;
    padding: .65rem .9rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
}
.cookie-banner .cookie-btn-primary { background: #4a90e2; color: #fff; }
.cookie-banner .cookie-btn-primary:hover { background: #3179cd; }
.cookie-banner .cookie-btn-secondary { background: #303c4d; border-color: #526075; color: #e7ecf4; }
.cookie-banner .cookie-btn-secondary:hover { background: #3b4b60; }
.cookie-banner .cookie-btn:focus-visible, .site-footer-cookies:focus-visible {
    outline: 2px solid #9fc8ff;
    outline-offset: 3px;
}
.site-footer .site-footer-cookies {
    width: auto;
    min-height: 0;
    padding: .1rem 0;
    margin: 0;
    background: none;
    border: 0;
    border-radius: 0;
    color: #c7dafa;
    text-align: left;
    font-size: .94rem;
    font-weight: 400;
    line-height: 1.55;
    text-decoration: none;
    cursor: pointer;
}
.site-footer .site-footer-cookies:hover { background: none; color: #fff; text-decoration: underline; }
@media screen and (max-width: 900px) {
    .cookie-banner {
        left: 0;
        bottom: 0;
        transform: none;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
        max-height: min(85vh, 600px);
        overflow-y: auto;
        padding: 1.1rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom));
        border-radius: 16px 16px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }
    .cookie-banner-copy h2 { font-size: 1.05rem; }
    .cookie-banner-copy p { font-size: .87rem; }
    .cookie-banner-actions { flex: none; width: 100%; gap: .55rem; }
    .cookie-banner .cookie-btn { min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
    .cookie-banner .cookie-btn { transition: none; }
}


/* ===== Редактор исходящих писем: Fadepost ===== */
.mailbox-nav { display:flex; flex-direction:column; gap:.55rem; margin:.7rem 0 1rem; }
.mailbox-nav-link { color:#d7e5fa; background:#2b3442; border:1px solid #40526a;
  border-radius:8px; padding:.72rem .85rem; font-weight:600; text-decoration:none; }
.mailbox-nav-link:hover, .mailbox-nav-link.current { background:#355577; border-color:#528ed2; color:#fff; }
.mail-compose-form { display:flex; flex-direction:column; gap:.6rem; min-width:0; }
.mail-compose-form label { color:#dfeaf6; font-weight:600; margin-top:.5rem; }
.mailbox-compose select, .mail-compose-form input[type="email"], .mail-compose-form input[type="text"], .mail-compose-form textarea {
  width:100%; min-width:0; max-width:100%; background:#171f2b; border:1px solid #495568;
  border-radius:8px; color:#f3f7fc; padding:.8rem .9rem; font:inherit; margin:0; }
.mail-compose-form textarea { min-height:230px; resize:vertical; white-space:pre-wrap; }
.mail-compose-form input:focus, .mail-compose-form textarea:focus { outline:2px solid #639bea; outline-offset:2px; }
.mail-compose-actions { display:flex; flex-wrap:wrap; align-items:center; gap:.65rem; margin-top:.7rem; }
.mail-compose-actions button { min-height:44px; }
.mail-compose-note { color:#a9b8c7; font-size:.85rem; line-height:1.55; }
.mailbox-view .col-list .email-list a { overflow-wrap:anywhere; }
@media screen and (max-width:900px) {
  .mailbox-nav { display:grid; grid-template-columns:1fr 1fr; gap:.6rem; padding:0 1rem; }
  .mailbox-nav-link { text-align:center; }
  .mail-compose-actions { flex-direction:column; align-items:stretch; }
  .mail-compose-actions button { width:100%; }
  .mailbox-compose { padding:1.2rem; }
}

.mail-compose-saved { padding:.7rem 1rem; border-left:3px solid #4a90e2; background:#27384c; border-radius:4px; }

/* ===== Папки почты, удаление, HTML-редактор ===== */
.mailbox-nav-link { display:flex; align-items:center; justify-content:center; min-height:46px; line-height:1.35; text-align:center; }
.mail-delete-form { margin:.5rem 0 1rem; }
.mail-delete-form button { max-width:100%; min-height:38px; }
.mail-delete-all { font-size:.83rem; padding:.55rem .75rem; }
.mail-editor-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:.35rem; padding:.6rem; margin-top:.3rem; border:1px solid #46546a; border-radius:9px 9px 0 0; background:#252f3f; }
.mail-editor-toolbar button, .mail-editor-toolbar select, .mail-editor-toolbar .mail-color-control { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:.36rem .58rem; border:1px solid #495a70; background:#33445a; color:#f4f8ff; border-radius:6px; font-size:.9rem; }
.mail-editor-toolbar button:hover { background:#46648d; }
.mail-editor-toolbar select { width:auto; max-width:145px; cursor:pointer; }
.mail-editor-toolbar .mail-color-control { gap:.4rem; cursor:pointer; }
.mail-editor-toolbar input[type=color] { width:35px; height:30px; border:0; background:transparent; cursor:pointer; padding:0; }
.mail-rich-editor { padding:1rem; min-height:280px; max-height:65vh; overflow:auto; overflow-wrap:anywhere; border:1px solid #53657a; border-top:0; border-radius:0 0 9px 9px; color:#f3f7fc; background:#171f2b; line-height:1.55; outline-offset:1px; }
.mail-rich-editor:focus { outline:2px solid #5899ea; }
.mail-rich-editor img, .mail-rich-preview img { max-width:100%; height:auto; }
.mail-rich-preview { padding:.85rem; background:#171f2b; border-radius:8px; border:1px solid #3d495d; overflow-wrap:anywhere; min-height:80px; line-height:1.5; }
.mail-emoji-picker { margin:.4rem 0; padding:.5rem; border:1px solid #48566a; border-radius:7px; background:#263347; }
.mail-emoji-picker[hidden] { display:none; }
.mail-emoji-picker button { background:transparent; font-size:1.2rem; border-radius:6px; padding:.35rem .5rem; }
.mail-emoji-picker button:hover { background:#3a5778; }
.mail-files { display:flex; flex-direction:column; gap:.4rem; padding:.7rem; background:#202c3d; border-radius:7px; margin:.5rem 0; }
.mail-files h4 { margin:.2rem 0; }
.mail-file-link, .mail-existing-file { display:block; overflow-wrap:anywhere; font-size:.9rem; }
.mail-existing-file { display:flex; align-items:center; gap:.4rem; }
.mail-existing-file input[type=checkbox] { width:18px; height:18px; }
.mail-compose-form input[type=file] { width:100%; border:1px dashed #52637a; border-radius:7px; padding:.7rem; background:#1c2939; color:#eee; }
@media screen and (max-width:900px) {
 .mailbox-nav-link { min-height:52px; padding:.7rem .4rem; align-items:center; justify-content:center; text-align:center; }
 .mail-editor-toolbar { gap:.3rem; }
 .mail-editor-toolbar select { max-width:calc(50% - .3rem); }
 .mail-rich-editor { min-height:240px; max-height:60vh; }
 .mail-delete-all { min-height:42px; }
}

/* ===== Спокойные текстовые ссылки для удаления писем во всех папках ===== */
/* Стилизуются только кнопки внутри форм удаления почты.
   Кнопка очистки редактора и кнопка удаления аккаунта не затрагиваются. */
.mail-delete-form .btn-danger,
.mail-delete-form .btn-danger.mail-delete-all {
    display: inline;
    width: auto;
    max-width: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #bfc5ce;
    font-size: .9rem;
    font-weight: 400;
    line-height: 1.5;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: #87919f;
    cursor: pointer;
}
.mail-delete-form .btn-danger:hover,
.mail-delete-form .btn-danger:focus-visible {
    background: transparent;
    color: #e2e8f0;
    text-decoration-color: currentColor;
}
.mail-delete-form .btn-danger:focus-visible {
    outline: 2px solid #7e9fc4;
    outline-offset: 3px;
}


/* ===== Личный кабинет: спокойные единые цвета и читаемые кнопки ===== */
.dashboard-page .dashboard-email {
    display: inline-block;
    color: #e5eef8;
    overflow-wrap: anywhere;
    font-weight: 650;
}
.dashboard-page .dashboard-actions,
.profile-page .profile-actions {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    margin-top: 1.5rem;
}
.dashboard-page .dashboard-action-form { margin: 0; }
.dashboard-page .dashboard-actions .btn,
.dashboard-page .dashboard-action-form .btn,
.profile-page .profile-actions .btn {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: .7rem .8rem;
    background: #344253;
    border: 1px solid #506076;
    border-radius: 8px;
    color: #ebf1f8;
    font-size: .93rem;
    line-height: 1.35;
    font-weight: 550;
    text-align: center;
    text-decoration: none;
    box-shadow: none;
    transition: background .15s ease, border-color .15s ease;
}
.dashboard-page .dashboard-actions .btn:hover,
.dashboard-page .dashboard-action-form .btn:hover,
.profile-page .profile-actions .btn:hover {
    background: #43556a;
    border-color: #8296ad;
    color: #fff;
}
.dashboard-page .dashboard-actions .dashboard-action-primary {
    background: #3a536d;
    border-color: #5b7695;
}
.dashboard-page .dashboard-actions .dashboard-action-danger {
    background: #303b49;
    border-color: #526071;
    color: #d7dce5;
}
.dashboard-page .dashboard-mailbox-link {
    display: inline-flex;
    gap: .4rem;
    align-items: center;
    max-width: 100%;
    min-height: 42px;
    padding: .55rem .85rem;
    border: 1px solid #506178;
    background: #344558;
    border-radius: 8px;
    color: #edf3fa;
    text-decoration: none;
    overflow-wrap: anywhere;
    line-height: 1.4;
}
.dashboard-page .dashboard-mailbox-link:hover {
    background: #466079;
    color: #fff;
}
.dashboard-page .dashboard-create-button {
    min-height: 44px;
    width: 100%;
    background: #3a536d;
    border: 1px solid #637d9c;
    border-radius: 8px;
    color: #f2f6fc;
    font-weight: 600;
}
.dashboard-page .dashboard-create-button:hover { background: #4b6784; }
.dashboard-page .dashboard-actions .btn:focus-visible,
.dashboard-page .dashboard-mailbox-link:focus-visible,
.dashboard-page .dashboard-create-button:focus-visible,
.profile-page .profile-actions .btn:focus-visible,
.profile-page .profile-save-button:focus-visible {
    outline: 2px solid #9ac4ef;
    outline-offset: 3px;
}

/* ===== Профиль: аккуратная форма и читабельные подписи ===== */
.profile-page .profile-sidebar,
.profile-page .profile-content {
    min-width: 0;
    padding: clamp(1.1rem, 2vw, 2rem);
    background: #242d38;
    border: 1px solid #3d4c5d;
    border-radius: 12px;
    color: #dce5f0;
    text-align: left;
}
.profile-page .profile-content { background: #252e39; }
.profile-page .profile-logo-link {
    display: block;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 240px;
}
.profile-page .profile-logo-link img {
    display: block;
    width: 100%;
    height: auto;
}
.profile-page .profile-kicker {
    display: block;
    margin-bottom: .45rem;
    color: #aec3dc;
    font-size: .78rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .065em;
}
.profile-page h2 { margin: 0; font-size: clamp(1.35rem, 2vw, 1.7rem); line-height: 1.3; }
.profile-page .profile-identity {
    padding: 1rem 0;
    margin-top: 1.2rem;
    border-top: 1px solid #445264;
    border-bottom: 1px solid #445264;
}
.profile-page .profile-identity span { display: block; margin-bottom: .3rem; color: #aebdcc; font-size: .85rem; }
.profile-page .profile-identity strong { display: block; font-size: .98rem; color: #e6f1fd; overflow-wrap: anywhere; }
.profile-page .profile-header { margin-bottom: 1.65rem; padding-bottom: 1.1rem; border-bottom: 1px solid #415166; }
.profile-page .profile-header p { margin: .75rem 0 0; color: #b9c7d7; line-height: 1.6; font-size: .93rem; }
.profile-page .profile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem 1.4rem; }
.profile-page .profile-field { display: flex; flex-direction: column; min-width: 0; gap: .45rem; }
.profile-page .profile-field label { color: #e5edf7; font-size: .94rem; font-weight: 600; }
.profile-page .profile-field input[type=text],
.profile-page .profile-field input[type=date] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 45px;
    border: 1px solid #52637a;
    background: #1c2530;
    color: #f0f4fa;
    border-radius: 8px;
    padding: .7rem .85rem;
    font: inherit;
    margin: 0;
}
.profile-page .profile-field input::placeholder { color: #93a4b6; }
.profile-page .profile-field input:focus-visible { outline: 2px solid #8ab3de; outline-offset: 2px; border-color: #8ab3de; }
.profile-page .profile-form-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.1rem; margin-top: 1.7rem; padding-top: 1.3rem; border-top: 1px solid #415166; }
.profile-page .profile-form-bottom p { margin: 0; font-size: .87rem; color: #aebdcc; }
.profile-page .profile-save-button {
    min-height: 45px;
    background: #3a536d;
    border: 1px solid #607d9f;
    padding: .7rem 1.3rem;
    color: #f8fafc;
    border-radius: 8px;
    font-weight: 650;
}
.profile-page .profile-save-button:hover { background: #4b6987; }
@media (max-width: 900px) {
    .profile-page .profile-sidebar,
    .profile-page .profile-content { width: 100%; max-width: 100%; border-radius: 0; border-left: none; border-right: none; }
    .profile-page .profile-fields { grid-template-columns: minmax(0, 1fr); }
    .profile-page .profile-form-bottom { align-items: stretch; flex-direction: column; }
    .profile-page .profile-save-button { width: 100%; }
}


/* ===== Публичные тарифы и продвижение подписки ===== */
.home-tariffs, .tariffs-page {
    width: 100%;
    color: #e8eef7;
}
.home-tariffs {
    padding: clamp(1.8rem, 3vw, 3rem) clamp(1rem, 2.5vw, 2.75rem) clamp(2.5rem, 4vw, 4rem);
    border-top: 1px solid #2e3847;
}
.tariffs-page { max-width: 1400px; margin: 1.8rem auto 3.5rem; padding: 0 clamp(1rem, 2vw, 2rem); }
.tariff-section-heading { max-width: 770px; margin: 0 auto 1.7rem; text-align: center; }
.tariff-section-heading h1, .tariff-section-heading h2 {
    margin: .45rem 0 .65rem; color: #f3f7fc;
    font-size: clamp(1.55rem, 2.65vw, 2.25rem); letter-spacing: -.025em;
}
.tariff-section-heading p { margin: 0; color: #afbdcf; line-height: 1.65; font-size: .96rem; }
.tariff-overline { color: #9cb9d9; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.tariff-cards {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(.8rem, 1.5vw, 1.25rem); max-width: 1350px; margin: 0 auto;
}
.tariff-card {
    display: flex; flex-direction: column; justify-content: space-between; min-width: 0;
    gap: 1.15rem; padding: clamp(1.1rem, 1.8vw, 1.55rem);
    border: 1px solid #3c4b5b; border-radius: 12px;
    background: #222c38; box-shadow: 0 4px 14px rgba(0,0,0,.10);
}
.tariff-card-selected { border-color: #88a6cb; background: #29394c; }
.tariff-card-period { color: #dbe6f5; font-weight: 650; font-size: 1rem; }
.tariff-card-price { margin: .45rem 0; color: #f7fbff; font-size: clamp(1.65rem, 2.4vw, 2.2rem); font-weight: 750; line-height: 1.2; }
.tariff-card-desc { font-size: .9rem; color: #b6c4d6; margin: 0; line-height: 1.4; }
.tariff-card form { margin: 0; }
.tariff-card-action {
    display: block; width: 100%; padding: .7rem .9rem; text-align: center;
    border: 1px solid #6c8aad; border-radius: 8px; background: #344c67;
    font: inherit; font-weight: 650; font-size: .92rem; text-decoration: none; color: #f3f8ff;
    cursor: pointer;
}
.tariff-card-action:hover { background: #456381; color: #fff; }
.tariff-card-action-disabled, .tariff-card-action-disabled:hover {
    cursor: default; border-color: #485868; background: #343f4d; color: #bec9d6;
}
.tariff-section-footnote, .tariff-terms-note { margin: 1.25rem auto 0; text-align: center; color: #b1c0d0; line-height: 1.6; }
.tariff-terms-note { max-width: 900px; }
.tariff-payment-status {
    max-width: 900px; margin: 1.45rem auto 0; padding: 1rem 1.25rem;
    border-left: 3px solid #9db5cc; border-radius: 6px; background: #293440;
    color: #dee6f0; line-height: 1.6;
}
.tariff-sidebar-card {
    width: 100%; min-width: 0; padding: 1.25rem 1.05rem;
    background: #26323e; border: 1px solid #405368; border-radius: 10px;
    color: #dae6f3;
}
.tariff-sidebar-eyebrow { color: #a5c0df; letter-spacing: .09em; font-size: .73rem; text-transform: uppercase; font-weight: 750; }
.tariff-sidebar-card h3 { font-size: 1.2rem; margin: .4rem 0 .6rem; color: #f4f7fd; }
.tariff-sidebar-card p { font-size: .87rem; color: #b9c6d5; line-height: 1.5; margin: 0 0 .9rem; }
.tariff-sidebar-list { padding: .35rem 0; margin: 0 0 .75rem; list-style: none; border-top: 1px solid #435365; }
.tariff-sidebar-list li { display: flex; justify-content: space-between; gap: .4rem; align-items: baseline; font-size: .86rem; padding: .45rem 0; border-bottom: 1px solid #435365; }
.tariff-sidebar-list strong { color: #f2f7fc; white-space: nowrap; }
.tariff-sidebar-link { display: block; text-align: center; padding: .7rem .6rem; border-radius: 7px; background: #3a5776; color: #fff; text-decoration: none; font-weight: 650; }
.tariff-sidebar-link:hover { background: #4d7091; color: #fff; }
.tariff-sidebar-card small { display: block; color: #aabbcd; margin-top: .7rem; text-align: center; line-height: 1.5; }
@media (min-width: 901px) and (max-width: 1190px) {
    .tariff-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tariff-sidebar-card { padding: .95rem .7rem; }
    .tariff-sidebar-list li { font-size: .78rem; }
}
@media (max-width: 900px) {
    .home-tariffs { padding: 1.75rem 1rem 2.75rem; }
    .tariffs-page { margin: 1.2rem auto 2.5rem; }
    .tariff-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tariff-sidebar-card { border-radius: 9px; }
}
@media (max-width: 600px) {
    .tariff-cards { grid-template-columns: minmax(0, 1fr); }
    .tariff-card { padding: 1.2rem; }
    .tariff-card-price { font-size: 1.85rem; }
    .tariff-section-heading { margin-bottom: 1.25rem; }
    .tariff-sidebar-card { padding: 1.1rem; }
}

.homepage-tariff-inline { margin: 1rem 0 .2rem; font-size: .93rem; }
.homepage-tariff-inline a { color: #b3d2f0; text-underline-offset: .2em; }
.tariff-legal-promo { max-width: 420px; margin: 0 auto 2.5rem; padding: 0 1rem; }

/* ===== Fadepost paid private chat — desktop and mobile ===== */
.chat-page { width: 100%; max-width: 100%; padding: 1.5rem clamp(12px, 2.3vw, 42px) 2rem; margin: 0 auto; }
.chat-page-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.chat-page-title h1 { font-size: clamp(1.45rem, 2vw, 2rem); margin: 0 0 5px; color: #f5f7fc; }
.chat-page-title p { margin: 0; color: #b0bbca; font-size: .92rem; }
.chat-page-title .btn { white-space: nowrap; }
.chat-columns {
    display: grid;
    grid-template-columns: minmax(225px, 22fr) minmax(0, 58fr) minmax(210px, 20fr);
    align-items: start;
    gap: clamp(12px, 1.25vw, 20px);
    width: 100%;
    min-width: 0;
}
.chat-side,.chat-main { background: #252b35; border: 1px solid #3c4756; border-radius: 12px; padding: 18px; min-width: 0; }
/* В чате активная переписка всегда занимает центральную колонку. */
.chat-columns > .chat-side { grid-column: 1; }
.chat-columns > .chat-main { grid-column: 2; width: 100%; max-width: none; min-width: 0; }
.chat-columns > .chat-promo { grid-column: 3; min-width: 0; width: 100%; align-self: start; }
.chat-columns > .chat-promo .tariff-sidebar-card { width: 100%; }
.chat-trial-note { padding: .8rem; border: 1px solid #465365; border-radius: 8px; background: #303947; line-height: 1.45; }

.chat-side h2 { margin: 0 0 12px; font-size: 1.14rem; }
.chat-room { display: block; border-radius: 8px; padding: 11px; margin: 4px 0; overflow-wrap: anywhere; color: #dce4ed; text-decoration: none; background: #313a46; }
.chat-room:hover { background: #3b4858; color: #fff; }
.chat-room.chat-current { background: #2c4263; border-left: 3px solid #76a9e8; }
.chat-side details,.chat-room-header details { background: #313944; border: 1px solid #465264; padding: 10px 12px; border-radius: 8px; margin: 12px 0; }
.chat-side summary,.chat-room-header summary { cursor: pointer; color: #dceaff; }
.chat-small-form { display: grid; gap: 9px; margin: 12px 0 0; }
.chat-small-form label { display: grid; gap: 5px; font-size: .88rem; }
.chat-small-form input { min-width: 0; width: 100%; }
.chat-small-form button { justify-self: start; }
.chat-main { display: flex; flex-direction: column; gap: 12px; }
.chat-room-header h2 { font-size: 1.2rem; margin: 0 0 6px; }
.chat-room-header p { font-size: .87rem; color: #b6c3d1; margin: 2px 0; }
.chat-message-list { min-height: 300px; height: clamp(320px, 45vh, 660px); overflow-y: auto; display: flex; flex-direction: column; gap: 13px; background: #1d242e; border-radius: 9px; border: 1px solid #394554; padding: 14px; }
.chat-message { background: #313b49; color: #e9eff7; border-radius: 12px 12px 12px 4px; padding: 12px 14px; max-width: min(85%, 780px); align-self: flex-start; overflow-wrap: anywhere; }
.chat-message.chat-own { align-self: flex-end; background: #2b4766; border-radius: 12px 12px 4px 12px; }
.chat-message-head { display: flex; align-items: baseline; gap: 15px; justify-content: space-between; font-size: .83rem; color: #aabed7; margin-bottom: 8px; }
.chat-message-head strong { color: #d7e8fb; }
.chat-message-body { font-size: .97rem; line-height: 1.55; word-break: break-word; }
.chat-message-body img { max-width: 100%; max-height: 320px; height: auto; display: block; margin-top: 7px; border-radius: 7px; }
.chat-message-body p { margin: .35em 0; }
.chat-message .chat-file { display: inline-block; margin: 8px 7px 0 0; color: #d6e8ff; text-decoration: underline; font-size: .87rem; }
.chat-message .chat-file img { display: block; max-width: 200px; max-height: 200px; }
.chat-edit-link { display: inline; border: 0; padding: 0; margin-top: 9px; color: #cad9ee; background: none; text-decoration: underline; font-size: .78rem; }
.chat-edit-link:hover { background: none; color: white; }
.chat-edited { display: block; color: #aab8c7; margin-top: 5px; }
.chat-empty,.chat-welcome { text-align: center; color: #bdc9d7; margin: auto; padding: 25px; }
.chat-compose { padding: 12px; background: #303947; border-radius: 10px; border: 1px solid #465365; }
.chat-toolbar { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-bottom: 9px; }
.chat-toolbar button,.chat-toolbar select,.chat-toolbar input[type=color] { border: 1px solid #556276; border-radius: 5px; height: 35px; padding: 4px 8px; color: #e8eff9; background: #414c5d; cursor: pointer; }
.chat-toolbar button { min-width: 32px; }
.chat-toolbar button:hover { background: #52647a; }
.chat-toolbar select { min-width: 100px; max-width: 145px; }
.chat-toolbar input[type=color] { width: 41px; padding: 3px; }
.chat-editor { min-height: 110px; max-height: 330px; overflow: auto; padding: 12px; border: 1px solid #5a6b7f; border-radius: 8px; background: #19222d; color: #f5f8fc; outline: none; line-height: 1.55; overflow-wrap: anywhere; }
.chat-editor:focus { border-color: #7db4ef; box-shadow: 0 0 0 2px #3b628a66; }
.chat-editor:empty:before { content: attr(data-placeholder); color: #98a5b5; pointer-events: none; }
.chat-editor img { max-width: 100%; max-height: 220px; border-radius: 7px; }
.chat-emoji-list { padding: 7px; margin: 8px 0; background: #252f3b; border: 1px solid #4e6073; border-radius: 7px; }
.chat-emoji-list[hidden] { display: none !important; }
.chat-emoji-list button { background: transparent; padding: 7px; border: 0; font-size: 1.3rem; }
.chat-emoji-list button:hover { background: #46576a; }
.chat-compose-bottom { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.chat-compose-bottom label { margin-right: auto; font-size: .87rem; color: #d0dbea; }
.chat-compose-bottom input[type=file] { display: block; max-width: 100%; width: 230px; font-size: .8rem; margin-top: 5px; }
.chat-note { margin: 10px 0 0; font-size: .78rem; color: #a4b4c5; }
.chat-compose-bottom button:disabled { opacity: .55; cursor: wait; }
@media (max-width: 900px) {
  .chat-page { padding: 12px 0 20px; }
  .chat-page-title { display: block; padding: 0 15px; }
  .chat-page-title .btn { display: inline-block; margin-top: 12px; }
  .chat-columns { display: flex; flex-direction: column; gap: 12px; }
  .chat-side,.chat-main { width: 100%; max-width: 100%; border-radius: 0; padding: 13px; }
  .chat-columns > .chat-promo { width: 100%; max-width: 100%; padding: 0 13px; }
  .chat-columns > .chat-promo .tariff-sidebar-card { max-width: 100%; }
  .chat-message-list { height: 340px; min-height: 300px; }
  .chat-message { max-width: 94%; }
  .chat-toolbar select { max-width: 120px; }
  .chat-compose-bottom { justify-content: stretch; }
  .chat-compose-bottom label { width: 100%; margin: 0; }
  .chat-compose-bottom input[type=file] { width: 100%; }
  .chat-compose-bottom button { flex: 1; }
}


/* Chat in the middle of a fixed three-column desktop workspace. */
@media (min-width: 901px) {
  .chat-columns { display:grid; grid-template-columns:minmax(235px,22fr) minmax(0,58fr) minmax(200px,20fr); align-items: start; }
  .chat-columns > .chat-side { grid-column:1; }
  .chat-columns > .chat-main { grid-column:2; min-width:0; }
  .chat-columns > .chat-promo { grid-column:3; }
}
.chat-mobile-entry { display:none !important; }
.chat-send-error { color:#ffb7aa; font-size:.88rem; margin-top:8px; }
.chat-send-error[hidden] { display:none; }

/* In-site chat and email notifications. Non-invasive on desktop and phone. */
.site-toast-region { position:fixed; z-index:9999; bottom:calc(18px + env(safe-area-inset-bottom,0px)); right:18px; width:min(360px,calc(100vw - 24px)); display:grid; gap:10px; pointer-events:none; }
.site-toast { pointer-events:auto; background:#263443; color:#ecf3fc; border:1px solid #5b738e; box-shadow:0 12px 36px #070e17b3; border-radius:12px; padding:12px 40px 12px 14px; position:relative; display:block; text-decoration:none; overflow-wrap:anywhere; line-height:1.45; }
.site-toast:hover { background:#30465e; color:#fff; }
.site-toast-title { display:block; font-weight:650; font-size:.9rem; }
.site-toast-description { display:block; font-size:.8rem; color:#c5d3e4; }
.site-toast-dismiss { position:absolute; right:10px; top:8px; padding:2px 7px; border:0; background:transparent; color:#e6edf5; font-size:19px; cursor:pointer; }
.site-toast-dismiss:hover { background:#425269; }

@media (max-width: 900px) {
  .chat-desktop-entry { display:none !important; }
  .chat-mobile-entry { display:inline-flex !important; }
  body.chat-screen { height:100dvh; overflow:hidden; }
  body.chat-screen > .site-footer {display:none !important;}
  body.chat-screen > .cookie-banner {display:none !important;}
  body.chat-screen .chat-page { position:fixed; inset:0; z-index:15; height:100dvh; max-height:100dvh; margin:0; padding:0; display:flex; flex-direction:column; background:#1a1a1a; overflow:hidden; }
  body.chat-screen .chat-page-title { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; margin:0; padding:10px 12px; flex:0 0 auto; border-bottom:1px solid #465366; background:#242e3b; }
  body.chat-screen .chat-page-title h1 { font-size:1.13rem; margin:0; }
  body.chat-screen .chat-page-title p {font-size:.76rem;}
  body.chat-screen .chat-page-title .btn {margin:0; padding:.55rem .75rem; font-size:.77rem; }
  body.chat-screen .chat-columns { display:flex; flex-direction:column; min-height:0; flex:1 1 auto; gap:0; overflow-y:auto; overscroll-behavior:contain; }
  body.chat-screen .chat-side {flex:none; max-height:26dvh; overflow-y:auto; padding:10px 12px; border-radius:0; border-left:0; border-right:0;}
  body.chat-screen .chat-side h2 { font-size:1rem; margin-bottom:4px; }
  body.chat-screen .chat-room {padding:7px 9px;}
  body.chat-screen .chat-side .chat-note {font-size:.72rem;}
  body.chat-screen .chat-main { flex:1 0 auto; min-height:360px; overflow:visible; padding:10px 12px; border-left:0; border-right:0; border-radius:0; }
  body.chat-screen .chat-message-list { height:clamp(220px,37dvh,450px); min-height:220px; }
  body.chat-screen .chat-promo {display:none !important;}
  .site-toast-region { width:calc(100vw - 24px); right:12px; bottom:calc(10px + env(safe-area-inset-bottom,0px)); }
  body.chat-screen .site-toast-region {bottom:auto; top:calc(70px + env(safe-area-inset-top,0px));}
}


/* Community creation: roomy, readable form in Fadepost's muted blue-grey theme. */
.chat-side .chat-community-details { position: relative; overflow: visible; }
.chat-community-details > summary { font-weight: 600; padding: 3px 0; }
.chat-side .chat-community-form {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: min(460px, calc(100vw - 44px));
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin: 0;
  padding: 22px;
  background: #293443;
  color: #eef3fa;
  border: 1px solid #51647a;
  border-radius: 12px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .35);
}
.chat-community-intro { display: flex; flex-direction: column; gap: 5px; }
.chat-community-intro strong { font-size: 1.1rem; color: #fff; }
.chat-community-intro span, .chat-community-hint { font-size: .88rem; color: #c0cfdf; line-height: 1.5; }
.chat-community-form label { font-size: .96rem; color: #e3edf8; font-weight: 600; }
.chat-side .chat-community-title {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 13px 16px;
  margin: 0;
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  border: 1px solid #647891;
  border-radius: 9px;
  color: #f6f9ff;
  background: #1b2531;
}
.chat-community-title::placeholder { color: #a9b7c8; }
.chat-community-title:focus { border-color: #92bcec; outline: 2px solid #4779a6; outline-offset: 1px; }
.chat-community-hint { margin: -3px 0 0; }
.chat-side .chat-community-submit {
  width: 100%;
  min-height: 45px;
  padding: 10px 16px;
  justify-self: stretch;
  font-weight: 600;
  background: #456e9c;
  color: #fff;
}
.chat-side .chat-community-submit:hover { background: #547fac; }
@media (max-width: 900px) {
  .chat-side .chat-community-form {
    position: static;
    width: 100%;
    max-width: 100%;
    margin-top: 12px;
    padding: 16px;
    box-shadow: none;
  }
}
@media (max-width: 900px) {
  /* When composing a community, give the enlarged form space inside chat. */
  body.chat-screen .chat-side:has(.chat-community-details[open]) {
    max-height: 62dvh;
  }
}


/* Fadepost chat: separate conversation list and window + discreet actions. */
@media (min-width: 901px) {
  .chat-columns { align-items: stretch; }
  .chat-columns > .chat-side,
  .chat-columns > .chat-main { border: 1px solid #506075; box-shadow: 0 8px 28px rgba(0,0,0,.17); }
  .chat-columns > .chat-side { background: #202a36; }
  .chat-columns > .chat-main { background: #293341; }
  .chat-room-list .chat-welcome { min-height: 360px; display:flex; flex-direction:column; justify-content:center; }
}
.chat-room-heading {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;}
.chat-room-heading h2 {min-width:0;overflow-wrap:anywhere;}
.chat-room-controls {display:flex;align-items:center;gap:16px;flex-wrap:wrap;}
.chat-delete-form {margin:0;display:inline;}
.chat-close-link,.chat-delete-link {display:inline; font:inherit;font-size:.86rem;text-decoration:underline;text-underline-offset:3px;color:#c0cddb;background:transparent;border:0;padding:3px 0;cursor:pointer;}
.chat-close-link:hover,.chat-delete-link:hover {color:#f2f7ff;background:transparent;}
.chat-delete-link {color:#c4acb4;}
@media (max-width:900px) {
  /* The list and the conversation are now separate full-screen chat views. */
  body.chat-screen .chat-page.chat-room-list .chat-main {display:none;}
  body.chat-screen .chat-page.chat-room-list .chat-side {display:block;max-height:none;flex:1 1 auto;overflow-y:auto;}
  body.chat-screen .chat-page.chat-room-open .chat-side {display:none;}
  body.chat-screen .chat-page.chat-room-open .chat-main {display:flex;flex:1 1 auto;min-height:0;overflow-y:auto;}
  body.chat-screen .chat-page.chat-room-open .chat-columns {overflow:hidden;}
  .chat-room-heading {align-items:flex-start;}
  .chat-room-controls {width:100%;justify-content:space-between;gap:8px;}
}

/* Chat 2026-11: private and community lists, and standalone mobile chat. */
.chat-window-exit { display:none; }
.chat-side > h2 { margin-bottom: 14px; }
.chat-room-section { margin: 0 0 17px; padding: 12px; border: 1px solid #47576b; background: #263342; border-radius: 11px; min-width: 0; }
.chat-room-section-group { border-color: #526076; }
.chat-room-section-title { display:flex; align-items:center; justify-content:space-between; gap: 12px; margin-bottom: 10px; }
.chat-room-section-title h3 { font-size: .96rem; margin:0; line-height:1.3; color:#e9f1fa; font-weight:650; }
.chat-room-count { min-width: 25px; padding: 3px 7px; text-align:center; border-radius: 12px; color:#d8e8fa; background:#41546d; font-size:.78rem; font-variant-numeric:tabular-nums; }
.chat-room-section-list { display:flex; flex-direction:column; gap:5px; min-width:0; }
.chat-room-section-list .chat-room { margin:0; padding:11px 10px; font-size:.9rem; overflow-wrap:anywhere; }
.chat-room-section-list .chat-room[aria-current=page] { border-left:3px solid #8fc1ff; }
.chat-room-empty { margin:0; padding:6px 2px; color:#bdc9d6; font-size:.83rem; }
/* Both actions look like subtle text links, not a primary button. */
.chat-room-controls .chat-text-action,
.chat-room-controls .chat-text-action:link,
.chat-room-controls .chat-text-action:visited { display:inline; width:auto; min-height:0; font:inherit; font-size:.87rem; line-height:1.6; font-weight:400; text-decoration:underline; text-underline-offset:3px; background:transparent; border:0; border-radius:0; box-shadow:none; padding:0; margin:0; color:#cbd6e5; cursor:pointer; }
.chat-room-controls .chat-delete-link { color:#cbb8c2; }
.chat-room-controls .chat-text-action:hover { background:transparent; color:#fff; }
@media (max-width:900px) {
  body.chat-screen .chat-desktop-return {display:none !important;}
  body.chat-screen .chat-window-nav { flex-shrink:0; }
  body.chat-screen .chat-window-exit {display:inline; text-decoration:underline; text-underline-offset:3px; color:#d1e3f8; font-size:.84rem; white-space:nowrap; padding:7px 3px; }
  body.chat-screen .chat-page-title {padding-top:calc(10px + env(safe-area-inset-top,0px));}
  body.chat-screen .chat-side .chat-room-section-title h3 {font-size:.96rem;}
  body.chat-screen .chat-side .chat-room-section { margin-bottom: 13px; }
  body.chat-screen .chat-room-list .chat-side {padding-bottom:calc(28px + env(safe-area-inset-bottom,0px));}
  body.chat-screen .chat-room-open .chat-main {padding-bottom:calc(12px + env(safe-area-inset-bottom,0px));}
}

/* Fadepost / chat invitations, privacy controls, 2026-11. */
.chat-pending { margin: 15px 0; padding: 13px 12px; border-radius: 12px; background: #263749; border: 1px solid #516b87; min-width: 0; }
.chat-pending > h3 { margin: 0 0 12px; font-size: 1.01rem; font-weight: 650; color: #f2f6ff; }
.chat-invite-card { padding: 12px 10px; border-radius: 10px; margin: 8px 0; background: #202c3a; border: 1px solid #45596c; overflow-wrap: anywhere; }
.chat-invite-card > strong, .chat-invite-card > small { display: block; }
.chat-invite-card > strong { font-size: .91rem; color: #f3f6fd; }
.chat-invite-card > small { color: #c0cedf; margin-top: 4px; font-size: .83rem; }
.chat-invite-actions { display: flex; flex-wrap: wrap; gap: 7px 10px; margin-top: 12px; }
.chat-invite-actions form { padding: 0; margin: 0; width: auto; min-width: 0; }
.chat-invite-action { width: auto; min-width: 0; padding: 7px 10px; border-radius: 7px; font-size: .83rem; line-height: 1.25; background: #374b62; color: #eef4fd; border: 1px solid #607894; cursor: pointer; }
.chat-invite-action:hover { background: #496582; }
.chat-invite-actions form:first-child .chat-invite-action { background: #476482; border-color: #708eb0; }
.chat-blocked { margin: 14px 0; padding: 11px 12px; border: 1px solid #45596c; border-radius: 10px; overflow-wrap: anywhere; }
.chat-blocked summary { cursor: pointer; }
.chat-blocked form { margin: 8px 0; padding: 8px 0; display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 9px; border-top: 1px solid #4b5c6d; }
.chat-blocked button.chat-text-action, .chat-room-header .chat-block-form .chat-text-action { width: auto; min-height: 0; padding: 0; background: none; border: 0; box-shadow: none; color: #d1dcea; text-decoration: underline; text-underline-offset: 3px; font: inherit; font-size: .86rem; cursor: pointer; }
.chat-block-form { display: inline-block; margin: 10px 0 2px; padding: 0; }
.chat-pending-compose { padding: 18px; margin: 15px 0; background: #303e4e; border: 1px solid #526477; color: #dce7f5; border-radius: 10px; }
@media (max-width: 900px) {
  body.chat-screen .chat-pending { margin: 12px 0; }
  body.chat-screen .chat-invite-actions { gap: 7px; }
  body.chat-screen .chat-invite-action { white-space: normal; text-align: center; }
  body.chat-screen .chat-blocked form { width: 100%; }
}

/* Chat moderation and per-message controls. Fadepost adaptive layout. */
.chat-moderation { margin-top: .7rem; padding: .7rem; border: 1px solid var(--border, #40505b); border-radius: 10px; }
.chat-moderation > summary { cursor:pointer; font-weight:600; }
.chat-moderation-content { padding-top: .85rem; display: flex; flex-direction: column; gap: .65rem; }
.chat-moderation-content h3 { font-size: .97rem; margin: .6rem 0 .1rem; }
.chat-group-rename input[name=title] { width:100%; max-width: 480px; min-height: 44px; }
.chat-member-row { display:flex; flex-wrap:wrap; gap: .6rem; justify-content:space-between; align-items:center; border-bottom:1px solid rgba(150,165,180,.16); padding: .6rem 0; overflow-wrap:anywhere; }
.chat-member-row > span { min-width:0; flex:1; }
.chat-member-actions { display:flex; flex-wrap:wrap; gap: .65rem; }
.chat-member-actions form, .chat-member-row form, .chat-message-action { display:inline; margin:0; }
.chat-message-action button, .chat-edit-link { background:none; border:0; padding: .2rem .4rem; cursor:pointer; color:inherit; font-size: .85rem; text-decoration:underline; text-underline-offset:2px; opacity:.8; }
.chat-message-action button:hover, .chat-edit-link:hover { opacity:1; }
.chat-deleted-globally { font-style:italic; opacity:.65; }
@media(max-width: 740px){
 .chat-moderation { margin: .65rem 0; padding:.55rem; }
 .chat-member-row { align-items:flex-start; }
 .chat-member-actions { width:100%; }
 .chat-message-action button,.chat-edit-link { min-height:34px; padding:.2rem .35rem; }
}


/* Fadepost: chat/read receipts, unread mail and new message indicators */
.dashboard-unread-badge,.chat-unread-badge {
  display:inline-flex;align-items:center;justify-content:center;min-width:21px;height:21px;
  padding:0 6px;border-radius:20px;background:#d63649;color:#fff;
  font-size:12px;font-weight:750;line-height:1;vertical-align:middle;
  box-shadow:0 0 0 2px #2a2a2a;margin-inline-start:7px;
}
.dashboard-unread-badge[hidden] {display:none !important}
.dashboard-mail-counter {font-size:.88em;color:#a9b7c4}
.dashboard-unread-label {margin-left:4px}
.chat-room {display:flex;align-items:center;justify-content:space-between;gap:8px}
.chat-unread-badge {flex:none}
.chat-receipt {display:block;text-align:right;font-size:11px;margin:7px 0 1px;font-weight:600}
.chat-receipt-pending {color:#9aa5b3}
.chat-receipt-read {color:#65b8ff}
.chat-incoming-unread .chat-message-body {border-left:3px solid #db485a;background:rgba(205,67,89,.12)}
.chat-incoming-read .chat-message-body {border-left:3px solid #4d86b6}
.email-unread a {font-weight:700}
.email-unread a::before {content:'●';color:#e04b57;padding-right:6px}
.chat-selected-files {font-size:.83rem;color:#bacbdc;margin:5px 0}
.chat-selected-files:empty {display:none}
.chat-selected-files ul {margin:6px 0;padding-left:18px;max-height:115px;overflow:auto}
.chat-selected-files li {overflow-wrap:anywhere;margin:3px 0}
@media(max-width:700px) { .chat-receipt {font-size:10px} .dashboard-unread-badge,.chat-unread-badge {min-width:20px;height:20px} }


/* Mobile chat: one conversation filling the phone's actual viewport, including keyboard resizing. */
@media (max-width:900px) {
  html:has(body.chat-screen),body.chat-screen { margin:0; width:100%; max-width:100%; overflow:hidden; }
  body.chat-screen .chat-page {
    height:var(--chat-viewport-height,100dvh);
    max-height:var(--chat-viewport-height,100dvh);
    min-height:0; width:100vw; max-width:100vw;
    overflow:hidden;
  }
  body.chat-screen .chat-page.chat-room-open .chat-columns {
    display:flex; flex:1 1 0; min-height:0; width:100%; overflow:hidden;
  }
  body.chat-screen .chat-page.chat-room-open .chat-main {
    display:flex; flex:1 1 0; min-height:0; min-width:0;
    width:100%; max-width:100%; height:100%; overflow:hidden;
    flex-direction:column; gap:8px; padding:8px 10px calc(8px + env(safe-area-inset-bottom,0px));
  }
  body.chat-screen .chat-room-header {flex:0 0 auto; max-height:27%; overflow-y:auto;}
  body.chat-screen .chat-page.chat-room-open .chat-message-list {
    flex:1 1 0; height:auto; min-height:0; max-height:none;
    overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain;
    padding:10px;
  }
  body.chat-screen .chat-page.chat-room-open .chat-compose {
    flex:0 0 auto; min-height:0; max-height:min(45%,330px);
    overflow-y:auto; padding:8px;
  }
  body.chat-screen .chat-toolbar {gap:3px; overflow-x:auto; flex-wrap:nowrap;}
  body.chat-screen .chat-toolbar button {flex:none;}
  body.chat-screen .chat-editor {min-height:50px; max-height:88px; overflow-y:auto;}
  body.chat-screen .chat-compose-bottom {gap:5px; margin-top:6px;}
  body.chat-screen .chat-note {font-size:11px; margin:4px 0 0;}
  body.chat-screen .chat-message, body.chat-screen .chat-message-body {max-width:100%; overflow-wrap:anywhere;}
}


/* 02.11.2026: real full-screen mobile conversation, independent of document height. */
@media (max-width:900px) {
  html:has(body.chat-screen), body.chat-screen {
    height:100%; min-height:0; width:100%; overflow:hidden !important; overscroll-behavior:none;
  }
  body.chat-screen .chat-page {
    position:fixed !important; inset:auto 0 auto 0 !important;
    top:var(--chat-viewport-top, 0px) !important;
    height:var(--chat-viewport-height, 100dvh) !important;
    max-height:var(--chat-viewport-height, 100dvh) !important;
    min-height:0 !important; width:100% !important;
    padding:0 !important; overflow:hidden !important;
    display:flex !important; flex-direction:column;
  }
  body.chat-screen .chat-page-title { flex-shrink:0; }
  body.chat-screen .chat-page.chat-room-open .chat-columns {
    display:flex !important; flex:1 1 0 !important; height:0 !important;
    min-height:0 !important; min-width:0; overflow:hidden !important;
  }
  body.chat-screen .chat-page.chat-room-open .chat-main {
    display:flex !important; flex-direction:column; flex:1 1 0 !important;
    height:100% !important; max-height:100% !important; min-height:0 !important;
    overflow:hidden !important; gap:6px; padding:8px 10px calc(8px + env(safe-area-inset-bottom,0px));
  }
  body.chat-screen .chat-page.chat-room-open .chat-room-header {
    flex:0 1 auto; max-height:27%; overflow-y:auto;
  }
  body.chat-screen .chat-page.chat-room-open #chat-message-list {
    flex:1 1 0 !important; min-height:0 !important; max-height:none !important;
    height:0 !important; overflow-y:auto !important; overflow-x:hidden !important;
    overscroll-behavior:contain;
  }
  body.chat-screen .chat-page.chat-room-open #chat-compose {
    flex:0 1 auto !important; min-height:0; max-height:52%; overflow-y:auto;
    overscroll-behavior:contain;
  }
  body.chat-screen .chat-page.chat-room-list .chat-columns {
    flex:1 1 0; min-height:0; height:0; overflow:hidden;
  }
  body.chat-screen .chat-page.chat-room-list .chat-side {
    flex:1 1 0; max-height:100%; overflow-y:auto;
  }
}

/* Individually removable file attachments in mail and chat editors. */
.selected-attachments-list, .chat-selected-files ul {
  list-style:none; margin:6px 0; padding:0; max-height:125px; overflow-y:auto;
}
.selected-attachment { display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:6px 12px; padding:5px 2px; border-bottom:1px solid #536071;
  color:#d7e4f1; font-size:.86rem; overflow-wrap:anywhere;
}
.selected-attachment span { flex:1 1 170px; min-width:0; }
button.attachment-remove { width:auto !important; flex:0 0 auto !important; padding:3px 6px;
  background:transparent; border:0; color:#b8cce0; text-decoration:underline;
  text-underline-offset:2px; font-size:.82rem; cursor:pointer;
}
button.attachment-remove:hover {background:transparent; color:#fff;}
#mail-new-files, .chat-compose-bottom > .chat-selected-files {
  flex:1 1 100%; min-width:0; max-width:100%; overflow-wrap:anywhere;
}

/* Fadepost: независимая буквенно-цифровая CAPTCHA регистрации */
.registration-captcha {
    margin: 14px 0 18px;
    padding: 14px;
    background: #242c36;
    border: 1px solid #48576a;
    border-radius: 10px;
    text-align: left;
    max-width: 100%;
    box-sizing: border-box;
}
.registration-captcha label {display: block; margin-bottom: 8px; color: #e7edf7; font-weight: 600;}
.registration-captcha-row {display: flex; align-items: center; justify-content: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px;}
.registration-captcha-row img {display: block; max-width: 100%; width: 230px; height: 78px; border: 1px solid #8d9db0; border-radius: 6px; background: #f1f5fb; object-fit: contain;}
.registration-captcha .captcha-refresh-link {font-size: .89rem; color: #b9d7f5; text-decoration: underline;}
.registration-captcha input[name="captcha_answer"] {width: 100%; max-width: 230px; box-sizing: border-box; text-transform: uppercase; letter-spacing: 0.16em; font-size: 1.15rem; margin: 0;}
.registration-captcha-warning {padding: 12px 16px; margin: 12px auto; max-width: 670px; border: 1px solid #9c7161; color: #ffe0d6; border-radius: 8px; background: #49352e;}
@media (max-width: 680px) {
    .registration-captcha {padding: 12px; width: 100%;}
    .registration-captcha-row {gap: 8px;}
    .registration-captcha-row img {width: min(230px, 100%);}
}

.registration-captcha-note {font-size: .78rem; line-height: 1.45; color: #b0bfcc; margin: 9px 0 0;}


/* ===== Главная: преимущества подписки без пустых рекламных мест ===== */
.ad-placeholder:empty, .col-ads:empty { display: none !important; }
@media (min-width: 901px) {
  /* Когда рекламная колонка не заполнена и убрана, центральная зона
     занимает освободившееся место и в кабинете, и при чтении писем. */
  .main-page:not(:has(> .col-ads)) {
    grid-template-columns: minmax(220px, 28fr) minmax(0, 72fr);
  }
  .mailbox-view:not(:has(> .col-ads)) {
    grid-template-columns: minmax(220px, 30fr) minmax(0, 70fr);
  }
  .main-page.home-hero {
    grid-template-columns: minmax(250px, 28fr) minmax(0, 72fr);
    min-height: 0;
    padding-bottom: clamp(1.5rem, 3vw, 3.25rem);
    align-items: center;
  }
  .home-hero > .col-center {
    justify-self: center;
    width: min(100%, 760px);
    max-width: 760px;
    padding-top: .35rem;
  }
}
.home-hero .col-center .logo,
.home-mobile .col-center .logo { max-width: 690px; margin-inline: auto; }
.home-mobile { min-height: 0; }
.home-benefits {
  width: 100%;
  padding: clamp(2rem, 4.5vw, 4.5rem) clamp(1rem, 3vw, 3rem);
  color: #e8eff8;
  background: linear-gradient(180deg, #1a1a1a 0%, #1d2630 55%, #1a1a1a 100%);
  border-top: 1px solid #303b47;
}
.home-benefits-intro { max-width: 810px; margin: 0 auto clamp(1.3rem, 3vw, 2.5rem); text-align: center; }
.home-benefits-overline { display: inline-block; font-size: .77rem; letter-spacing: .13em; text-transform: uppercase; color: #9bb9d8; font-weight: 750; }
.home-benefits-intro h2 {
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.2; letter-spacing: -.025em;
  color: #f4f8fd; margin: .6rem 0 .85rem;
}
.home-benefits-intro p { color: #b5c5d7; line-height: 1.65; margin: 0; font-size: clamp(.94rem, 1.1vw, 1.04rem); }
.home-benefits-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.8rem, 1.45vw, 1.25rem); max-width: 1380px; margin: 0 auto;
}
.home-benefit-card {
  min-width: 0; padding: clamp(1.15rem, 1.9vw, 1.7rem);
  background: #263341; border: 1px solid #405468; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  display: flex; flex-direction: column; align-items: flex-start;
}
.home-benefit-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 39px; height: 39px; margin-bottom: 1.4rem;
  border-radius: 11px; color: #bcd6ef; font-weight: 750;
  background: #354c63; border: 1px solid #4a6783;
  font-size: .83rem; letter-spacing: .015em;
}
.home-benefit-card h3 { color: #f3f7fc; font-size: clamp(1.02rem, 1.3vw, 1.2rem); line-height: 1.35; margin: 0 0 .65rem; }
.home-benefit-card p { margin: 0; color: #b8c7d9; font-size: .92rem; line-height: 1.65; }
.home-benefits-bottom {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 1rem 1.5rem; text-align: center; margin: clamp(1.5rem, 3vw, 2.25rem) auto 0;
}
.home-benefits-bottom strong { color: #e5eef9; font-weight: 650; font-size: 1.03rem; }
.home-benefits-cta {
  background: #385674; border: 1px solid #6987a6; border-radius: 8px;
  color: #f5f9ff; padding: .75rem 1.1rem; text-decoration: none;
  font-weight: 700; display: inline-flex; align-items: center; gap: .4rem;
}
.home-benefits-cta:hover { background: #496b8d; color: #fff; }
@media (max-width: 1180px) and (min-width: 701px) {
  .home-benefits-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .main-page.home-hero, .home-mobile { min-height: 0 !important; }
  .home-mobile > .col-center .logo { max-width: 540px; }
}
@media (max-width: 700px) {
  .home-benefits { padding: 2.1rem 1rem 2.5rem; }
  .home-benefits-grid { grid-template-columns: minmax(0, 1fr); }
  .home-benefit-card { padding: 1.25rem; }
  .home-benefit-number { margin-bottom: .8rem; }
  .home-benefits-bottom { flex-direction: column; }
}

/* Language selection: compact, accessible and independent of the layout. */
.site-language-switch { display:flex; align-items:center; justify-content:flex-end; gap:.55rem;
  padding: .52rem clamp(16px,3vw,42px); background:#242a36; color:#a5b2c8;
  font:600 13px/1.35 system-ui,-apple-system,Segoe UI,sans-serif; }
.site-language-switch a { color:#aebdd2; text-decoration:none; padding:.24rem .48rem;
  border:1px solid transparent; border-radius:6px; }
.site-language-switch a[aria-current="page"] { color:#f5f8ff; background:#33445f; border-color:#536b8c; }
.site-language-switch a:focus-visible { outline:2px solid #86bdf4; outline-offset:2px; }
@media(max-width:640px) { .site-language-switch {padding:.45rem 14px;} }

@media(max-width:700px){body.chat-screen .site-language-switch{display:none}}

/* Chat i18n release: per-message actions are collapsed until the message or ⋯ is activated. */
.chat-message { position:relative; overflow:visible; }
.chat-message-actions { position:relative; display:block; margin-top:3px; text-align:end; }
.chat-message-actions > summary {
  display:inline-flex; align-items:center; justify-content:center;
  list-style:none; cursor:pointer; user-select:none;
  min-height:26px; min-width:28px; padding:0 5px;
  border:1px solid transparent; border-radius:7px;
  font-size:1.25rem; line-height:1; color:#b7c6d8; background:transparent;
}
.chat-message-actions > summary::-webkit-details-marker { display:none; }
.chat-message-actions > summary:hover, .chat-message-actions > summary:focus-visible,
.chat-message-actions[open] > summary { color:#f7fbff; background:#40546b; outline-offset:2px; }
.chat-message-actions-menu {
  position:absolute; z-index:40; right:0; bottom:calc(100% + 2px);
  display:flex; flex-direction:column; align-items:stretch; gap:4px;
  width:max-content; min-width:165px; max-width:min(255px,75vw);
  padding:9px 11px; border:1px solid #61758a; border-radius:9px;
  background:#222d3a; box-shadow:0 9px 28px rgba(0,0,0,.38);
  text-align:start;
}
.chat-message-actions:not([open]) .chat-message-actions-menu {display:none;}
.chat-message-actions-menu form {display:block; margin:0;}
.chat-message-actions-menu button, .chat-message-actions-menu form button {
  display:block; width:100%; padding:8px 9px; margin:0; text-align:start;
  background:transparent; border:0; border-radius:5px; box-shadow:none;
  color:#e2eaf4; font-size:.85rem; text-decoration:none; cursor:pointer; opacity:1;
}
.chat-message-actions-menu button:hover, .chat-message-actions-menu button:focus-visible {background:#40536b;color:#fff;}
.chat-message:has(.chat-message-actions[open]) {z-index:5;}
@media (max-width:740px) {
  .chat-message-actions-menu {max-width:min(240px,78vw);}
  .chat-message-actions > summary {min-width:36px;min-height:32px;}
}

/* Localized file chooser: native browser captions can ignore HTML lang and
   still display "Обзор" on an English page. The real input remains operable. */
label.fadepost-upload-picker {
  display: inline-flex;
  position: relative;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  max-width: 100%;
  margin: 6px 0 10px;
  cursor: pointer;
  color: #cddbec;
  font-size: .9rem;
}
.fadepost-upload-description { display: block; line-height: 1.5; }
.fadepost-upload-label {
  display: inline-block;
  border: 1px solid #617e9e;
  border-radius: 7px;
  background: #253a51;
  color: #f1f6fc;
  padding: 9px 17px;
  font-size: .9rem;
  line-height: 1.3;
  font-weight: 500;
  white-space: nowrap;
}
.fadepost-upload-picker:hover .fadepost-upload-label { background: #324d6c; }
.fadepost-upload-picker:focus-within .fadepost-upload-label {
  outline: 2px solid #9bc9fc;
  outline-offset: 2px;
}
/* Stronger specificity than older mail/chat input[type=file] rules. */
.mail-compose-form label.fadepost-upload-picker input[type=file],
.chat-compose-bottom label.fadepost-upload-picker input[type=file] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  pointer-events: none;
}
@media (max-width: 900px) {
  .chat-compose-bottom label.fadepost-upload-picker { width: auto; max-width: 100%; }
}


/* ===== Fadepost 21.11.2026: central inbox and clear compose exit ===== */
.mailbox-view.mailbox-inbox-layout { max-width:none; }
.mailbox-view .mailbox-sidebar { border:1px solid #3d4c5e; border-radius:13px; background:#222d39; padding:20px; }
.mailbox-inbox-layout .mailbox-sidebar { align-self:start; }
.mailbox-inbox-layout .mail-inbox-center { padding:clamp(18px,2vw,30px); max-height:none; overflow:visible; border:1px solid #465668; border-radius:14px; background:#26313f; min-height:450px; }
.mail-kicker { color:#9cb8d8; font-size:.76rem; letter-spacing:.11em; text-transform:uppercase; font-weight:750; }
.mail-inbox-section-head { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; margin:0 0 20px; }
.mail-inbox-section-head h2 { margin:6px 0; font-size:clamp(1.5rem,2.1vw,1.85rem); }
.mail-inbox-section-head p { color:#aebfd0; margin:0; font-size:.92rem; line-height:1.5; }
.mail-inbox-count { flex:none; color:#d7e4f4; font-size:.8rem; background:#384b61; border:1px solid #526c88; padding:7px 11px; border-radius:30px; }
.mail-inbox-list { display:grid; grid-template-columns:1fr; gap:10px; }
.mail-inbox-card { display:flex; align-items:center; gap:14px; min-width:0; padding:17px 18px; background:#1f2936; border:1px solid #405268; border-radius:12px; text-decoration:none; color:#e7eef8; transition:background .17s,border-color .17s,transform .17s; }
.mail-inbox-card:hover,.mail-inbox-card:focus-visible { color:#fff; background:#304357; border-color:#7298c4; transform:translateY(-1px); }
.mail-inbox-selected { background:#30465d; border-color:#83a9d6; }
.mail-card-icon { display:flex; align-items:center; justify-content:center; flex:none; width:44px; height:44px; color:#9ebfe1; font-size:1.35rem; border-radius:12px; background:#304154; }
.mail-inbox-unread .mail-card-icon { color:#fff; background:#41658a; }
.mail-inbox-unread .mail-card-subject::before { content:""; display:inline-block; width:8px; height:8px; margin:0 8px 2px 0; border-radius:50%; background:#f0717d; }
.mail-inbox-card .mail-card-detail { display:flex; flex:1; flex-direction:column; min-width:0; gap:5px; }
.mail-card-subject { font-weight:700; color:#f3f7ff; font-size:1rem; overflow-wrap:anywhere; }
.mail-card-sender { color:#c4d5e8; font-size:.9rem; overflow-wrap:anywhere; }
.mail-card-preview { color:#94a9be; font-size:.84rem; line-height:1.45; overflow-wrap:anywhere; }
.mail-card-side { display:flex; flex:0 0 140px; flex-direction:column; align-items:flex-end; gap:12px; color:#b3c3d3; font-size:.8rem; white-space:nowrap; }
.mail-card-file-count { color:#d1e2f4; background:#35485d; padding:4px 8px; border-radius:20px; font-size:.78rem; }
.mail-inbox-toolbar { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:15px; }
.mail-back-link { color:#c0d7f3; font-size:.91rem; text-decoration:none; }
.mail-back-link:hover { color:#fff; text-decoration:underline; }
.mail-reading-card { padding:clamp(18px,2vw,28px); background:#1d2835; border:1px solid #4a5b70; border-radius:13px; margin-bottom:28px; }
.mail-reading-subject { color:#f8faff; margin:0 0 19px; font-size:clamp(1.45rem,2.2vw,2rem); line-height:1.25; overflow-wrap:anywhere; }
.mail-reading-meta { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:18px; margin-bottom:20px; padding:0 0 20px; border-bottom:1px solid #405065; }
.mail-reading-meta div { display:flex; flex-direction:column; gap:5px; min-width:0; }
.mail-reading-meta span { color:#9fb3c9; font-size:.79rem; }
.mail-reading-meta strong { color:#e3edf8; font-size:.94rem; font-weight:600; overflow-wrap:anywhere; }
.mail-reading-body { padding:clamp(16px,2vw,24px); background:#17212c; border:1px solid #3a4c60; border-radius:9px; color:#e7eef6; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.75; font-size:.98rem; min-height:100px; }
.mail-incoming-files { border:1px solid #51647a; border-radius:10px; background:#243344; margin-top:20px; padding:17px; }
.mail-incoming-files h2 { font-size:1rem; margin:0 0 12px; }
.mail-incoming-files h2 span { color:#b5c7d9; margin-left:7px; }
.mail-incoming-file-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr)); gap:10px; }
.mail-incoming-file { display:flex; flex-direction:column; gap:5px; padding:12px 14px; border:1px solid #5a738b; border-radius:8px; color:#e7f1ff; text-decoration:none; overflow-wrap:anywhere; background:#30465d; }
.mail-incoming-file:hover { color:#fff; background:#3b5875; }
.mail-incoming-file small { color:#b8cce0; font-size:.81rem; }
.mail-reading-actions { display:flex; align-items:center; gap:18px; flex-wrap:wrap; margin-top:23px; }
.mail-inbox-delete-all { margin-top:19px; display:flex; justify-content:flex-end; }
.mail-inbox-empty { text-align:center; padding:60px 20px; background:#202b37; border:1px dashed #52657a; border-radius:12px; }
.mail-inbox-empty strong { color:#f2f6fb; font-size:1.1rem; }
.mail-inbox-empty p { color:#acbdce; line-height:1.5; }
.mail-message-note { padding:18px; background:#344254; border:1px solid #697c90; color:#f0f4fa; border-radius:9px; }
.mailbox-view .col-text.mailbox-compose { max-height:none; overflow:visible; border:1px solid #46566a; border-radius:13px; background:#26313f; padding:clamp(18px,2vw,30px); }
.mail-compose-header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding-bottom:18px; border-bottom:1px solid #48586d; margin-bottom:18px; }
.mail-compose-header h3 { font-size:1.55rem; margin:5px 0 0; }
.mail-compose-close { display:inline-flex; align-items:center; justify-content:center; flex:none; width:42px; height:42px; font-size:1.8rem; line-height:1; color:#e4edf7; text-decoration:none; border:1px solid #5b6e82; background:#344556; border-radius:10px; }
.mail-compose-close:hover { background:#4b637b; color:#fff; }
.mail-compose-cancel { display:inline-flex; min-height:44px; align-items:center; padding:8px 12px; color:#dce6f3; border:1px solid #65778b; border-radius:7px; text-decoration:none; font-size:.92rem; }
.mail-compose-cancel:hover { color:#fff; background:#3a4d61; }
@media (min-width:901px) {
  .mailbox-view.mailbox-inbox-layout { grid-template-columns:minmax(205px,19fr) minmax(0,62fr) minmax(175px,19fr); }
  .mailbox-view.mailbox-inbox-layout:not(:has(> .col-ads)) { grid-template-columns:minmax(220px,23fr) minmax(0,77fr); }
}
@media(max-width:900px) {
  .mailbox-view .mailbox-sidebar,.mailbox-inbox-layout .mail-inbox-center,.mailbox-view .mailbox-compose { padding:16px; border-left:0; border-right:0; border-radius:0; }
  .mailbox-view .mailbox-sidebar { padding-bottom:10px; }
  .mail-inbox-card { padding:13px 11px; gap:10px; }
  .mail-card-icon { width:36px; height:36px; border-radius:9px; }
  .mail-card-side { flex:0 0 auto; max-width:92px; white-space:normal; text-align:right; font-size:.7rem; }
  .mail-reading-meta { grid-template-columns:1fr; gap:11px; }
  .mail-reading-card { padding:16px; }
  .mail-inbox-section-head { margin-bottom:15px; }
  .mail-card-preview { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  .mail-compose-cancel { flex:1; justify-content:center; }
}
@media(prefers-reduced-motion:reduce) { .mail-inbox-card { transition:none; } .mail-inbox-card:hover { transform:none; } }
