/* LegalMail v73 — modern Yandex-inspired mail workspace.
 * Loaded after legalmail.css.  Native Roundcube commands and plugin containers
 * are preserved; this layer changes only spacing, surfaces and action docks. */

:root {
    --lm71-bg-a: #eef2f6;
    --lm71-bg-b: #f7f2ed;
    --lm71-panel: #ffffff;
    --lm71-panel-soft: #f6f7f9;
    --lm71-text: #202124;
    --lm71-muted: #6f7680;
    --lm71-line: rgba(32, 36, 40, .09);
    --lm71-hover: #f1f3f5;
    --lm71-selected: #e9edf2;
    --lm71-accent: #ffcc00;
    --lm71-accent-hover: #f5c400;
    --lm71-radius: 18px;
    --lm71-shadow: 0 8px 28px rgba(30, 35, 45, .08);
}

/* --------------------------------------------------------------------------
 * Desktop shell: separated rounded work areas like a modern web mail client.
 * ----------------------------------------------------------------------- */
@media screen and (min-width: 1201px) {
    body.task-mail {
        background:
            radial-gradient(circle at 14% 10%, rgba(196, 210, 225, .60), transparent 34%),
            radial-gradient(circle at 88% 90%, rgba(232, 216, 202, .55), transparent 38%),
            linear-gradient(135deg, var(--lm71-bg-a), var(--lm71-bg-b)) !important;
    }

    body.task-mail #layout {
        box-sizing: border-box !important;
        gap: 10px !important;
        padding: 10px !important;
        background: transparent !important;
    }

    body.task-mail #layout-menu {
        width: 58px !important;
        min-width: 58px !important;
        max-width: 58px !important;
        flex-basis: 58px !important;
        overflow: hidden !important;
        border: 0 !important;
        border-radius: 18px !important;
        background: linear-gradient(180deg, #292b31, #1f2025) !important;
        box-shadow: var(--lm71-shadow) !important;
    }

    body.task-mail #layout-menu .popover-header,
    body.task-mail #taskmenu .special-buttons {
        width: 58px !important;
        background: transparent !important;
        border: 0 !important;
    }

    body.task-mail #layout-menu .popover-header {
        height: 56px !important;
        line-height: 56px !important;
    }

    body.task-mail #layout-menu .popover-header img {
        width: 34px !important;
        height: 34px !important;
        max-width: 34px !important;
        max-height: 34px !important;
        filter: drop-shadow(0 2px 5px rgba(0,0,0,.18));
    }

    body.task-mail #taskmenu a {
        width: 42px !important;
        height: 42px !important;
        margin: 3px 8px !important;
        border-radius: 13px !important;
        color: #c8cbd1 !important;
        background: transparent !important;
    }

    body.task-mail #taskmenu a::before {
        width: 42px !important;
        height: 42px !important;
        line-height: 42px !important;
    }

    body.task-mail #taskmenu a:hover,
    body.task-mail #taskmenu a.selected {
        color: #fff !important;
        background: rgba(255,255,255,.12) !important;
    }

    body.task-mail #taskmenu a.mail.selected,
    body.task-mail #taskmenu a.compose.selected {
        color: #1f2024 !important;
        background: #fff !important;
    }

    body.task-mail #layout-sidebar:not(.sidebar-right),
    body.task-mail #legalmail-folder-sidebar,
    body.task-mail #layout-list,
    body.task-mail #layout-content:not(.legalmail-native-preview) {
        border: 1px solid rgba(255,255,255,.80) !important;
        border-radius: var(--lm71-radius) !important;
        box-shadow: var(--lm71-shadow) !important;
        overflow: hidden !important;
        background: var(--lm71-panel) !important;
    }

    body.task-mail #layout-sidebar:not(.sidebar-right),
    body.task-mail #legalmail-folder-sidebar {
        flex-basis: 238px !important;
        width: 238px !important;
        min-width: 238px !important;
        max-width: 238px !important;
        border-right: 1px solid rgba(255,255,255,.80) !important;
    }

    body.task-mail.action-none #layout-list {
        min-width: 560px !important;
    }

    body.task-mail.action-none #layout-content.legalmail-native-preview {
        display: none !important;
    }
}

/* --------------------------------------------------------------------------
 * Sidebar and compose shortcut.
 * ----------------------------------------------------------------------- */
body.task-mail #layout-sidebar > .header.yandex-sidebar-header,
body.task-mail #legalmail-folder-sidebar > .header.yandex-sidebar-header {
    height: 58px !important;
    min-height: 58px !important;
    padding: 0 12px !important;
    background: var(--lm71-panel) !important;
    border-bottom: 0 !important;
}

body.task-mail #layout-sidebar > .header.yandex-sidebar-header .yandex-account-title,
body.task-mail #legalmail-folder-sidebar > .header.yandex-sidebar-header .yandex-account-title {
    color: var(--lm71-text) !important;
    font-size: 13px !important;
    font-weight: 650 !important;
}

body.task-mail .yandex-compose-wrap {
    padding: 4px 10px 10px !important;
}

body.task-mail .yandex-compose-button {
    height: 42px !important;
    border: 1px solid #e5e7ea !important;
    border-radius: 13px !important;
    background: #f5f6f8 !important;
    color: #25272b !important;
    font-weight: 650 !important;
    box-shadow: none !important;
}

body.task-mail .yandex-compose-button:hover,
body.task-mail .yandex-compose-button:focus {
    border-color: #d9dde2 !important;
    background: #eceff2 !important;
    color: #111317 !important;
}

body.task-mail .yandex-refresh-button,
body.task-mail a.yandex-refresh-button.button.icon,
body.task-mail a.yandex-refresh-button.toolbar-button {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    border: 1px solid #e5e7ea !important;
    border-radius: 13px !important;
    background: #fff !important;
    color: #636a73 !important;
}

body.task-mail .yandex-refresh-button:hover,
body.task-mail .yandex-refresh-button:focus {
    background: #f5f6f8 !important;
    color: #202124 !important;
}

body.task-mail .folderlist li > a,
body.task-mail .folderlist li > div > a {
    border-radius: 11px !important;
}

body.task-mail .folderlist li.selected > a,
body.task-mail .folderlist li.selected > div > a {
    background: #eef0f3 !important;
    color: #17191d !important;
}

/* --------------------------------------------------------------------------
 * Inbox/list: airy search, compact action strip and quiet rows.
 * ----------------------------------------------------------------------- */
body.task-mail.action-none #layout-list > .legalmail-search-row {
    min-height: 66px !important;
    height: 66px !important;
    flex-basis: 66px !important;
    padding: 11px 12px !important;
    gap: 9px !important;
    background: var(--lm71-panel) !important;
}

body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form {
    height: 44px !important;
    border: 1px solid transparent !important;
    border-radius: 14px !important;
    background: #f2f3f5 !important;
}

body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form:focus-within {
    border-color: #d7dbe0 !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(45, 55, 70, .05) !important;
}

body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot {
    border-color: #e4e7ea !important;
    background: #fff !important;
}

body.task-mail.action-none #messagelist-header.yandex-list-toolbar {
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 10px !important;
    border-top: 1px solid var(--lm71-line) !important;
    border-bottom: 1px solid var(--lm71-line) !important;
    background: rgba(255,255,255,.96) !important;
}

body.task-mail.action-none #messagelist-content {
    background: #fff !important;
}

body.task-mail.action-none .messagelist tbody tr {
    height: 48px !important;
}

body.task-mail.action-none .messagelist tbody td {
    height: 48px !important;
    min-height: 48px !important;
    line-height: 48px !important;
    border-bottom-color: #f0f1f3 !important;
}

body.task-mail.action-none .messagelist tbody tr:hover td {
    background: #f7f8fa !important;
}

body.task-mail.action-none .messagelist tbody tr.selected td {
    background: #e9edf2 !important;
}

body.task-mail.action-none .messagelist td.subject > span,
body.task-mail.action-none .messagelist td.flags > span,
body.task-mail.action-none .messagelist td.subject span.msgicon.status::before,
body.task-mail.action-none .messagelist td.subject span.attachment {
    height: 48px !important;
    line-height: 48px !important;
}

body.task-mail.action-none .messagelist td.subject span.fromto {
    font-size: 13.5px !important;
    font-weight: 550 !important;
}

body.task-mail.action-none .messagelist td.subject span.subject a {
    color: #30343a !important;
}

body.task-mail.action-none .messagelist td.subject span.date {
    color: #8a9098 !important;
}

/* --------------------------------------------------------------------------
 * Message reader: card-like reading surface + bottom action dock.
 * ----------------------------------------------------------------------- */
body.task-mail.action-show #layout-content.yandex-message-view {
    background: transparent !important;
}

body.task-mail.action-show #layout-content.yandex-message-view > .header {
    flex: 0 0 52px !important;
    height: 52px !important;
    min-height: 52px !important;
    padding: 0 10px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--lm71-line) !important;
    background: rgba(255,255,255,.96) !important;
}

body.task-mail.action-show #layout-content.yandex-message-view > .content.frame-content {
    padding: 18px 18px 28px !important;
    background: #f5f6f8 !important;
    scroll-padding-bottom: 88px;
}

body.task-mail.action-show #message-header,
body.task-mail.action-show #message-content {
    max-width: 1060px !important;
    box-sizing: border-box !important;
    margin-left: auto !important;
    margin-right: auto !important;
    background: #fff !important;
}

body.task-mail.action-show #message-header {
    margin-bottom: 0 !important;
    padding: 22px 24px 12px !important;
    border: 1px solid #e7e9ec !important;
    border-bottom: 0 !important;
    border-radius: 18px 18px 0 0 !important;
}

body.task-mail.action-show #message-content {
    min-height: 280px !important;
    padding: 0 24px 30px !important;
    border: 1px solid #e7e9ec !important;
    border-top: 0 !important;
    border-radius: 0 0 18px 18px !important;
    box-shadow: 0 6px 24px rgba(30,35,45,.05) !important;
}

body.task-mail.action-show #message-header > .subject {
    margin-bottom: 14px !important;
    font-size: 22px !important;
    line-height: 1.35 !important;
    font-weight: 650 !important;
    letter-spacing: -.01em !important;
}

body.task-mail.action-show #message-header > .header img.contactphoto {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
}

body.task-mail.action-show .yandex-reply-footer {
    position: sticky !important;
    z-index: 80 !important;
    bottom: 12px !important;
    max-width: 760px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 18px auto 0 !important;
    padding: 9px !important;
    border: 1px solid rgba(32,36,40,.10) !important;
    border-radius: 16px !important;
    background: rgba(255,255,255,.94) !important;
    box-shadow: 0 12px 34px rgba(30,35,45,.15) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

body.task-mail.action-show .yandex-reply-footer > a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 0 14px !important;
    border: 0 !important;
    border-radius: 11px !important;
    background: #f1f3f5 !important;
    color: #30343a !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

body.task-mail.action-show .yandex-reply-footer > a:first-child {
    flex: 1 1 auto !important;
    justify-content: flex-start !important;
    padding-left: 18px !important;
}

body.task-mail.action-show .yandex-reply-footer > a:hover,
body.task-mail.action-show .yandex-reply-footer > a:focus {
    background: #e8ebef !important;
    color: #17191d !important;
}

body.task-mail.action-show .yandex-reply-footer > a.disabled {
    opacity: .45 !important;
}

/* --------------------------------------------------------------------------
 * Compose/reply: clean editor card and a viewport-fixed bottom toolbar.
 * ----------------------------------------------------------------------- */
body.task-mail.action-compose #layout-content.legalmail-compose-view {
    position: relative !important;
    min-width: 0 !important;
    background: #f5f6f8 !important;
}

body.task-mail.action-compose #layout-content.legalmail-compose-view > .header {
    height: 54px !important;
    min-height: 54px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--lm71-line) !important;
    background: rgba(255,255,255,.97) !important;
}

body.task-mail.action-compose #layout-content.legalmail-compose-view > .header .header-title {
    font-size: 15px !important;
    font-weight: 650 !important;
}

body.task-mail.action-compose #messagetoolbar {
    gap: 3px !important;
}

body.task-mail.action-compose #messagetoolbar > a,
body.task-mail.action-compose #messagetoolbar > .dropbutton {
    border-radius: 10px !important;
}

/* Attach is deliberately promoted to the bottom dock; keep a single primary
 * attachment affordance instead of showing the same action twice. */
@media screen and (min-width: 769px) {
    body.task-mail.action-compose #messagetoolbar > a.attach {
        display: none !important;
    }
}

body.task-mail.action-compose #compose-content {
    width: calc(100% - 38px) !important;
    max-width: 1000px !important;
    margin: 18px auto 28px !important;
    padding: 0 0 calc(var(--legalmail-compose-dock-height, 66px) + 24px) !important;
    border: 1px solid #e5e7ea !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: 0 7px 26px rgba(30,35,45,.07) !important;
    overflow: auto !important;
    scroll-padding-bottom: calc(var(--legalmail-compose-dock-height, 66px) + 30px);
}

body.task-mail.action-compose #compose-headers {
    padding: 13px 16px 6px !important;
    border-bottom: 1px solid #f0f1f3 !important;
}

body.task-mail.action-compose .compose-headers .form-group {
    min-height: 42px !important;
    margin-bottom: 4px !important;
    align-items: center !important;
}

body.task-mail.action-compose .compose-headers .col-form-label {
    color: #777e87 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

body.task-mail.action-compose .compose-headers .form-control,
body.task-mail.action-compose .compose-headers .recipient-input,
body.task-mail.action-compose .compose-headers .input-group-text {
    min-height: 38px !important;
    border-color: transparent !important;
    border-radius: 10px !important;
    background: #f5f6f8 !important;
    box-shadow: none !important;
}

body.task-mail.action-compose .compose-headers .form-control:focus,
body.task-mail.action-compose .compose-headers .recipient-input:focus {
    border-color: #d6dae0 !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(45,55,70,.05) !important;
}

body.task-mail.action-compose #composebodycontainer {
    padding: 10px 18px 8px !important;
}

body.task-mail.action-compose #composebodycontainer textarea#composebody {
    min-height: 320px !important;
    height: clamp(320px, 50vh, 640px) !important;
    padding: 12px 2px 24px !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    resize: vertical !important;
}

body.task-mail.action-compose.legalmail-reply-compose #composebodycontainer textarea#composebody {
    min-height: 220px !important;
    height: clamp(220px, 36vh, 440px) !important;
}

body.task-mail.action-compose #composebodycontainer .tox-tinymce {
    border: 1px solid #eceef1 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

body.task-mail.action-compose #composebodycontainer .tox .tox-editor-header,
body.task-mail.action-compose #composebodycontainer .tox .tox-toolbar-overlord,
body.task-mail.action-compose #composebodycontainer .tox .tox-toolbar__primary {
    background: #fafbfc !important;
}

body.task-mail.action-compose #composebodycontainer .tox .tox-toolbar__primary {
    border-bottom: 1px solid #eceef1 !important;
}

body.task-mail.action-compose .legalmail-compose-actions {
    box-sizing: border-box !important;
    min-height: 62px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 9px 10px !important;
    border: 1px solid rgba(32,36,40,.10) !important;
    border-radius: 16px !important;
    background: rgba(255,255,255,.95) !important;
    box-shadow: 0 14px 38px rgba(30,35,45,.18) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

body.task-mail.action-compose .legalmail-compose-actions.legalmail-compose-actions-fixed {
    position: fixed !important;
    z-index: 1250 !important;
    left: var(--legalmail-compose-dock-left, 16px) !important;
    right: var(--legalmail-compose-dock-right, 16px) !important;
    bottom: 14px !important;
    width: auto !important;
}

body.task-mail.action-compose .legalmail-compose-actions .btn.send {
    min-width: 126px !important;
    height: 44px !important;
    padding: 0 22px !important;
    border: 1px solid #e4b900 !important;
    border-radius: 11px !important;
    background: var(--lm71-accent) !important;
    color: #1c1d20 !important;
    font-weight: 750 !important;
    box-shadow: none !important;
}

body.task-mail.action-compose .legalmail-compose-actions .btn.send:hover,
body.task-mail.action-compose .legalmail-compose-actions .btn.send:focus {
    border-color: #d9af00 !important;
    background: var(--lm71-accent-hover) !important;
    color: #111215 !important;
}

body.task-mail.action-compose .legalmail-inline-attach {
    width: auto !important;
    min-width: 42px !important;
    height: 42px !important;
    padding: 0 13px !important;
    gap: 5px !important;
    border-radius: 11px !important;
    background: #f2f3f5 !important;
    color: #3f454d !important;
}

body.task-mail.action-compose .legalmail-inline-attach::before {
    width: 20px !important;
    height: 42px !important;
    line-height: 42px !important;
    margin: 0 4px 0 0 !important;
}

body.task-mail.action-compose .legalmail-inline-attach .inner {
    display: inline !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

body.task-mail.action-compose .legalmail-inline-attach:hover,
body.task-mail.action-compose .legalmail-inline-attach:focus {
    background: #e9ebee !important;
    color: #202124 !important;
}

body.task-mail.action-compose .legalmail-compose-actions .float-right {
    margin-left: auto !important;
}

body.task-mail.action-compose .legalmail-compose-actions .extwin {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 42px !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border-radius: 11px !important;
    color: #616871 !important;
    background: transparent !important;
}

body.task-mail.action-compose .legalmail-compose-actions .extwin:hover,
body.task-mail.action-compose .legalmail-compose-actions .extwin:focus {
    background: #f2f3f5 !important;
    color: #202124 !important;
}

body.task-mail.action-compose #legalmail-compose-settings {
    border: 1px solid #e3e6e9 !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: 0 12px 34px rgba(30,35,45,.14) !important;
}

/* External compose/reply window: the editor fills the window while the action
 * dock remains pinned to the viewport, independent of the message scrollbar. */
body.task-mail.action-compose.legalmail-external-compose #layout {
    padding: 10px !important;
    background: linear-gradient(135deg, #eef2f6, #f7f4f1) !important;
}

body.task-mail.action-compose.legalmail-external-compose #layout-content.legalmail-compose-view {
    border-radius: 18px !important;
    overflow: hidden !important;
    box-shadow: var(--lm71-shadow) !important;
}

body.task-mail.action-compose.legalmail-external-compose #compose-content {
    max-width: 1120px !important;
}

/* --------------------------------------------------------------------------
 * Responsive fallback: on phones use sticky rather than fixed so the virtual
 * keyboard and Roundcube's phone layout remain in control.
 * ----------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
    body.task-mail.action-compose #compose-content {
        width: 100% !important;
        margin: 0 !important;
        padding-bottom: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    body.task-mail.action-compose .legalmail-compose-actions,
    body.task-mail.action-compose .legalmail-compose-actions.legalmail-compose-actions-fixed {
        position: sticky !important;
        z-index: 120 !important;
        left: auto !important;
        right: auto !important;
        bottom: 0 !important;
        width: 100% !important;
        border-width: 1px 0 0 !important;
        border-radius: 0 !important;
        box-shadow: 0 -8px 24px rgba(30,35,45,.10) !important;
    }

    body.task-mail.action-show #layout-content.yandex-message-view > .content.frame-content {
        padding: 10px 8px 16px !important;
    }

    body.task-mail.action-show #message-header {
        padding: 16px 14px 10px !important;
        border-radius: 14px 14px 0 0 !important;
    }

    body.task-mail.action-show #message-content {
        padding: 0 14px 18px !important;
        border-radius: 0 0 14px 14px !important;
    }

    body.task-mail.action-show .yandex-reply-footer {
        bottom: 6px !important;
        max-width: none !important;
        border-radius: 14px !important;
    }
}

/* --------------------------------------------------------------------------
 * Dark mode: retain the modern geometry with dark native-looking surfaces.
 * ----------------------------------------------------------------------- */
html.dark-mode {
    --lm71-panel: #202226;
    --lm71-panel-soft: #282b30;
    --lm71-text: #f2f3f5;
    --lm71-muted: #a4aab2;
    --lm71-line: rgba(255,255,255,.09);
    --lm71-hover: #2c2f34;
    --lm71-selected: #34383e;
    --lm71-shadow: 0 10px 34px rgba(0,0,0,.26);
}

html.dark-mode body.task-mail {
    background: linear-gradient(135deg, #15171a, #1d1c20) !important;
}

html.dark-mode body.task-mail #layout-sidebar:not(.sidebar-right),
html.dark-mode body.task-mail #legalmail-folder-sidebar,
html.dark-mode body.task-mail #layout-list,
html.dark-mode body.task-mail #layout-content:not(.legalmail-native-preview),
html.dark-mode body.task-mail #layout-sidebar > .header.yandex-sidebar-header,
html.dark-mode body.task-mail #legalmail-folder-sidebar > .header.yandex-sidebar-header,
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row,
html.dark-mode body.task-mail.action-none #messagelist-header.yandex-list-toolbar,
html.dark-mode body.task-mail.action-show #layout-content.yandex-message-view > .header,
html.dark-mode body.task-mail.action-compose #layout-content.legalmail-compose-view > .header {
    background: #202226 !important;
    border-color: #30343a !important;
}

html.dark-mode body.task-mail .yandex-compose-button,
html.dark-mode body.task-mail .yandex-refresh-button,
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form,
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot {
    border-color: #353940 !important;
    background: #292c31 !important;
    color: #e7e9ec !important;
}

html.dark-mode body.task-mail.action-none #messagelist-content,
html.dark-mode body.task-mail.action-none .messagelist tbody td {
    background: #202226 !important;
    border-bottom-color: #2e3238 !important;
}

html.dark-mode body.task-mail.action-none .messagelist tbody tr:hover td {
    background: #292c31 !important;
}

html.dark-mode body.task-mail.action-none .messagelist tbody tr.selected td {
    background: #34383e !important;
}

html.dark-mode body.task-mail.action-show #layout-content.yandex-message-view > .content.frame-content,
html.dark-mode body.task-mail.action-compose #layout-content.legalmail-compose-view {
    background: #181a1e !important;
}

/* Email HTML itself stays light to preserve sender formatting and readability. */
html.dark-mode body.task-mail.action-show #message-header,
html.dark-mode body.task-mail.action-show #message-content {
    background: #fff !important;
    border-color: #3a3d42 !important;
    color: #202124 !important;
}

html.dark-mode body.task-mail.action-show .yandex-reply-footer,
html.dark-mode body.task-mail.action-compose .legalmail-compose-actions {
    border-color: #3a3e44 !important;
    background: rgba(35,38,43,.95) !important;
}

html.dark-mode body.task-mail.action-show .yandex-reply-footer > a,
html.dark-mode body.task-mail.action-compose .legalmail-inline-attach {
    background: #30343a !important;
    color: #e2e5e8 !important;
}

html.dark-mode body.task-mail.action-compose #compose-content {
    border-color: #34383e !important;
    background: #202226 !important;
}

html.dark-mode body.task-mail.action-compose #compose-headers {
    border-bottom-color: #30343a !important;
}

html.dark-mode body.task-mail.action-compose .compose-headers .form-control,
html.dark-mode body.task-mail.action-compose .compose-headers .recipient-input,
html.dark-mode body.task-mail.action-compose .compose-headers .input-group-text {
    background: #292c31 !important;
    color: #edf0f2 !important;
}

html.dark-mode body.task-mail.action-compose #composebodycontainer textarea#composebody {
    background: #202226 !important;
    color: #edf0f2 !important;
}

html.dark-mode body.task-mail.action-compose.legalmail-external-compose #layout {
    background: linear-gradient(135deg, #15171a, #1d1c20) !important;
}

/* ========================================================================== 
 * LegalMail v72 — unified application shell + Yandex-like aligned mail rows
 * ========================================================================== */

/* One desktop rail and one panel language across Mail, Contacts and Settings. */
@media screen and (min-width: 1201px) {
    body.task-mail,
    body.task-addressbook,
    body.task-settings {
        background:
            radial-gradient(circle at 14% 10%, rgba(196, 210, 225, .60), transparent 34%),
            radial-gradient(circle at 88% 90%, rgba(232, 216, 202, .55), transparent 38%),
            linear-gradient(135deg, var(--lm71-bg-a, #eef2f6), var(--lm71-bg-b, #f7f2ed)) !important;
    }

    body.task-mail #layout,
    body.task-addressbook #layout,
    body.task-settings #layout {
        position: relative !important;
        width: 100% !important;
        height: 100vh !important;
        min-height: 0 !important;
        padding: 10px !important;
        padding-left: 10px !important;
        gap: 10px !important;
        overflow: hidden !important;
        background: transparent !important;
    }

    body.task-mail #layout-menu,
    body.task-addressbook #layout-menu,
    body.task-settings #layout-menu {
        position: relative !important;
        inset: auto !important;
        z-index: 90 !important;
        flex: 0 0 58px !important;
        width: 58px !important;
        min-width: 58px !important;
        max-width: 58px !important;
        height: 100% !important;
        margin: 0 !important;
        overflow: hidden !important;
        border: 0 !important;
        border-radius: 18px !important;
        background: linear-gradient(180deg, #292b31, #1f2025) !important;
        box-shadow: var(--lm71-shadow, 0 8px 28px rgba(30,35,45,.08)) !important;
        display: flex !important;
        flex-direction: column !important;
    }

    body.task-mail #layout-menu .popover-header,
    body.task-addressbook #layout-menu .popover-header,
    body.task-settings #layout-menu .popover-header {
        flex: 0 0 56px !important;
        width: 58px !important;
        height: 56px !important;
        min-height: 56px !important;
        padding: 0 !important;
        margin: 0 !important;
        line-height: 56px !important;
        border: 0 !important;
        background: transparent !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    body.task-mail #layout-menu .popover-header img,
    body.task-addressbook #layout-menu .popover-header img,
    body.task-settings #layout-menu .popover-header img,
    body.task-mail #layout-menu #logo,
    body.task-addressbook #layout-menu #logo,
    body.task-settings #layout-menu #logo {
        width: 34px !important;
        height: 34px !important;
        max-width: 34px !important;
        max-height: 34px !important;
        padding: 0 !important;
        object-fit: contain !important;
        filter: drop-shadow(0 2px 5px rgba(0,0,0,.18));
    }

    body.task-mail #taskmenu,
    body.task-addressbook #taskmenu,
    body.task-settings #taskmenu {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        width: 58px !important;
        padding: 2px 0 6px !important;
        overflow: hidden !important;
        background: transparent !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    body.task-mail #taskmenu > span.action-buttons,
    body.task-addressbook #taskmenu > span.action-buttons,
    body.task-settings #taskmenu > span.action-buttons {
        flex: 0 0 auto !important;
        width: 58px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    body.task-mail #taskmenu > a,
    body.task-mail #taskmenu > span > a,
    body.task-addressbook #taskmenu > a,
    body.task-addressbook #taskmenu > span > a,
    body.task-settings #taskmenu > a,
    body.task-settings #taskmenu > span > a {
        position: relative !important;
        flex: 0 0 42px !important;
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        margin: 3px 8px !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 13px !important;
        color: #c8cbd1 !important;
        background: transparent !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
    }

    /* Elastic's icon pseudo element has a left float/margin by default. Reset it
       so top and bottom rail icons share the exact same horizontal center. */
    body.task-mail #taskmenu a::before,
    body.task-addressbook #taskmenu a::before,
    body.task-settings #taskmenu a::before {
        float: none !important;
        display: block !important;
        flex: 0 0 42px !important;
        width: 42px !important;
        height: 42px !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 42px !important;
        text-align: center !important;
    }

    body.task-mail #taskmenu a .inner,
    body.task-addressbook #taskmenu a .inner,
    body.task-settings #taskmenu a .inner {
        display: none !important;
    }

    body.task-mail #taskmenu a:hover,
    body.task-mail #taskmenu a.selected,
    body.task-addressbook #taskmenu a:hover,
    body.task-addressbook #taskmenu a.selected,
    body.task-settings #taskmenu a:hover,
    body.task-settings #taskmenu a.selected {
        color: #fff !important;
        background: rgba(255,255,255,.12) !important;
    }

    body.task-mail #taskmenu a.mail.selected,
    body.task-mail #taskmenu a.compose.selected,
    body.task-addressbook #taskmenu a.contacts.selected,
    body.task-settings #taskmenu a.settings.selected {
        color: #1f2024 !important;
        background: #fff !important;
    }

    body.task-mail #taskmenu .special-buttons,
    body.task-addressbook #taskmenu .special-buttons,
    body.task-settings #taskmenu .special-buttons {
        flex: 0 0 auto !important;
        width: 58px !important;
        margin: auto 0 0 !important;
        padding: 0 0 2px !important;
        background: transparent !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-end !important;
    }

    body.task-mail #layout-sidebar:not(.sidebar-right),
    body.task-mail #legalmail-folder-sidebar,
    body.task-mail #layout-list,
    body.task-mail #layout-content:not(.legalmail-native-preview),
    body.task-addressbook #layout-sidebar,
    body.task-addressbook #layout-list,
    body.task-addressbook #layout-content,
    body.task-settings #layout-sidebar,
    body.task-settings #layout-list,
    body.task-settings #layout-content {
        height: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        border: 1px solid rgba(255,255,255,.80) !important;
        border-radius: 18px !important;
        box-shadow: var(--lm71-shadow, 0 8px 28px rgba(30,35,45,.08)) !important;
        overflow: hidden !important;
        background: #fff !important;
    }

    body.task-addressbook #layout-sidebar,
    body.task-settings #layout-sidebar {
        flex: 0 0 238px !important;
        width: 238px !important;
        min-width: 238px !important;
        max-width: 238px !important;
    }

    body.task-addressbook #layout-list {
        flex: 0 0 350px !important;
        width: 350px !important;
        min-width: 350px !important;
        max-width: 350px !important;
    }

    body.task-settings #layout-list {
        flex: 0 0 300px !important;
        width: 300px !important;
        min-width: 300px !important;
        max-width: 300px !important;
    }

    body.task-addressbook #layout-content,
    body.task-settings #layout-content {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
    }

    body.task-addressbook #layout > div > .header,
    body.task-settings #layout > div > .header {
        background: #fff !important;
        border-bottom: 1px solid rgba(32,36,40,.09) !important;
    }
}

/* Yandex-like desktop message rows: sender, subject and date stay on one shared
   baseline with stable columns instead of wrapping into a two-line Elastic row. */
@media screen and (min-width: 769px) {
    body.task-mail.action-none #layout-list {
        max-width: none !important;
        flex: 1 1 auto !important;
    }

    body.task-mail.action-none .messagelist tbody tr,
    body.task-mail.action-none .messagelist tbody td {
        height: 44px !important;
        min-height: 44px !important;
    }

    body.task-mail.action-none .messagelist tbody td {
        line-height: 44px !important;
        vertical-align: middle !important;
    }

    body.task-mail.action-none .messagelist td.subject {
        box-sizing: border-box !important;
        display: grid !important;
        grid-template-columns: 22px minmax(150px, 28%) minmax(0, 1fr) max-content !important;
        grid-template-rows: 44px !important;
        align-items: center !important;
        column-gap: 12px !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 0 16px 0 4px !important;
        line-height: normal !important;
        white-space: nowrap !important;
    }

    body.task-mail.action-none .messagelist td.subject > span {
        box-sizing: border-box !important;
        min-width: 0 !important;
        width: auto !important;
        height: auto !important;
        max-height: 44px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        line-height: 44px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    body.task-mail.action-none .messagelist td.subject > span.msgicon.status {
        grid-column: 1 !important;
        grid-row: 1 !important;
        width: 22px !important;
        min-width: 22px !important;
        padding: 0 !important;
        justify-self: center !important;
        overflow: visible !important;
        text-align: center !important;
    }

    body.task-mail.action-none .messagelist td.subject > span.msgicon.status::before {
        float: none !important;
        display: inline-block !important;
        width: 22px !important;
        height: 44px !important;
        margin: 0 !important;
        line-height: 44px !important;
        vertical-align: top !important;
        text-align: center !important;
    }

    body.task-mail.action-none .messagelist td.subject > span.fromto {
        grid-column: 2 !important;
        grid-row: 1 !important;
        padding: 0 !important;
        color: #555b63 !important;
        font-size: 13.5px !important;
        font-weight: 500 !important;
    }

    body.task-mail.action-none .messagelist tr.unread td.subject > span.fromto,
    body.task-mail.action-none .messagelist tr.unread td.subject > span.subject a {
        color: #202328 !important;
        font-weight: 700 !important;
    }

    body.task-mail.action-none .messagelist td.subject > span.subject {
        grid-column: 3 !important;
        grid-row: 1 !important;
        padding: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    body.task-mail.action-none .messagelist td.subject > span.subject a {
        display: block !important;
        width: 100% !important;
        overflow: hidden !important;
        color: #30343a !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        cursor: pointer !important;
    }

    body.task-mail.action-none .messagelist td.subject > span.date,
    body.task-mail.action-none .messagelist td.subject > span.size {
        grid-column: 4 !important;
        grid-row: 1 !important;
        min-width: 62px !important;
        padding: 0 !important;
        color: #8a9098 !important;
        font-size: 12.5px !important;
        text-align: right !important;
        justify-self: end !important;
    }

    /* Keep optional attachment/status extras from forcing a second line. */
    body.task-mail.action-none .messagelist td.subject > span.attachment {
        position: absolute !important;
        right: 86px !important;
        width: 20px !important;
        height: 44px !important;
        line-height: 44px !important;
        overflow: hidden !important;
    }

    body.task-mail.action-none .messagelist td.flags,
    body.task-mail.action-none .messagelist td.flags > span,
    body.task-mail.action-none .messagelist td.threads,
    body.task-mail.action-none .messagelist td.selection {
        height: 44px !important;
        line-height: 44px !important;
        vertical-align: middle !important;
    }
}

/* At narrower tablet widths keep the one-line row but shrink the sender column. */
@media screen and (min-width: 769px) and (max-width: 1100px) {
    body.task-mail.action-none .messagelist td.subject {
        grid-template-columns: 20px minmax(120px, 32%) minmax(0, 1fr) max-content !important;
        column-gap: 9px !important;
        padding-right: 10px !important;
    }
}

/* Dark mode counterparts for the unified shell and aligned list. */
@media screen and (min-width: 1201px) {
    html.dark-mode body.task-mail,
    html.dark-mode body.task-addressbook,
    html.dark-mode body.task-settings {
        background: #111318 !important;
    }

    html.dark-mode body.task-mail #layout-menu,
    html.dark-mode body.task-addressbook #layout-menu,
    html.dark-mode body.task-settings #layout-menu {
        background: linear-gradient(180deg, #24262b, #191b1f) !important;
    }

    html.dark-mode body.task-addressbook #layout-sidebar,
    html.dark-mode body.task-addressbook #layout-list,
    html.dark-mode body.task-addressbook #layout-content,
    html.dark-mode body.task-settings #layout-sidebar,
    html.dark-mode body.task-settings #layout-list,
    html.dark-mode body.task-settings #layout-content {
        border-color: #2f3339 !important;
        background: #202328 !important;
    }

    html.dark-mode body.task-addressbook #layout > div > .header,
    html.dark-mode body.task-settings #layout > div > .header {
        border-bottom-color: #34383e !important;
        background: #202328 !important;
    }
}

@media screen and (min-width: 769px) {
    html.dark-mode body.task-mail.action-none .messagelist td.subject > span.fromto,
    html.dark-mode body.task-mail.action-none .messagelist td.subject > span.subject a {
        color: #d1d5da !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist tr.unread td.subject > span.fromto,
    html.dark-mode body.task-mail.action-none .messagelist tr.unread td.subject > span.subject a {
        color: #fff !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist td.subject > span.date,
    html.dark-mode body.task-mail.action-none .messagelist td.subject > span.size {
        color: #8f969f !important;
    }
}


/* v72.1 row collision guard: leave room for the native hover flag column. */
@media screen and (min-width: 769px) {
    body.task-mail.action-none .messagelist tbody tr {
        position: relative !important;
    }

    body.task-mail.action-none .messagelist td.subject {
        position: relative !important;
        padding-right: 44px !important;
    }

    body.task-mail.action-none .messagelist td.flags {
        top: 0 !important;
        right: 5px !important;
        bottom: auto !important;
        width: 30px !important;
        min-width: 30px !important;
        padding: 0 !important;
        background: transparent !important;
    }

    body.task-mail.action-none .messagelist td.flags > span {
        width: 30px !important;
        height: 44px !important;
        line-height: 44px !important;
        text-align: center !important;
    }

    body.task-mail.action-none .messagelist td.subject > span.attachment {
        right: 104px !important;
    }
}


/* ========================================================================== 
 * LegalMail v74.2 — requested inbox polish
 * 1) no square hover tiles in the inbox action/search controls;
 * 2) Yandex-like subject + muted message preview on one line;
 * 3) logout glyph uses a soft red accent.
 * ========================================================================== */

/* Inbox toolbar: keep icons visually flat on mouse hover instead of drawing
   a rectangular/square tile around the glyph. Keyboard focus remains visible. */
body.task-mail.action-none #messagelist-header #mailtoolbar.toolbar.menu a:not(.disabled):hover,
body.task-mail.action-none #messagelist-header #mailtoolbar.toolbar.menu .dropbutton:hover,
body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls a:not(.disabled):hover,
body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls a.active:hover {
    background: transparent !important;
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* The unread-only control before search is now an icon, not a separate square
   card. Selected state is communicated by the icon color. */
body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot {
    flex: 0 0 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}
body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot > a.button.unread {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 44px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot > a.button.unread::before {
    width: 36px !important;
}
body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot > a.button.unread:hover,
body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot > a.button.unread:focus:not(:focus-visible) {
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #202428 !important;
    outline: 0 !important;
}
body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot > a.button.unread.selected {
    border-color: transparent !important;
    background: transparent !important;
    color: #2e7fae !important;
}
body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot > a.button.unread:focus-visible {
    outline: 2px solid rgba(32, 36, 40, .25) !important;
    outline-offset: 1px !important;
}

/* Yandex-like content cell: subject stays primary, body snippet is muted and
   uses the remaining horizontal space. */
@media screen and (min-width: 769px) {
    body.task-mail.action-none .messagelist tr.legalmail-row-normalized .legalmail-yandex-content {
        display: flex !important;
        align-items: center !important;
        min-width: 0 !important;
        width: 100% !important;
        height: 44px !important;
        overflow: hidden !important;
        line-height: 44px !important;
        white-space: nowrap !important;
        visibility: visible !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-row-normalized .legalmail-yandex-content .legalmail-yandex-subject {
        flex: 0 1 auto !important;
        min-width: 26px !important;
        max-width: 64% !important;
        height: 44px !important;
        overflow: hidden !important;
        color: #30343a !important;
        font-size: 13.5px !important;
        font-weight: 500 !important;
        line-height: 44px !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-row-normalized .legalmail-yandex-content:not(.has-preview) .legalmail-yandex-subject {
        flex: 1 1 auto !important;
        max-width: none !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-row-normalized .legalmail-yandex-preview {
        display: block !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        height: 44px !important;
        margin-left: 10px !important;
        overflow: hidden !important;
        color: #8a9098 !important;
        font-size: 13px !important;
        font-weight: 400 !important;
        line-height: 44px !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        visibility: visible !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-row-normalized .legalmail-yandex-preview:empty {
        display: none !important;
        margin-left: 0 !important;
    }

    body.task-mail.action-none .messagelist tr.unread .legalmail-yandex-content .legalmail-yandex-subject {
        color: #202328 !important;
        font-weight: 700 !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-row-normalized .legalmail-yandex-content .legalmail-yandex-subject {
        color: #e8eaed !important;
    }
    html.dark-mode body.task-mail.action-none .messagelist tr.unread .legalmail-yandex-content .legalmail-yandex-subject {
        color: #fff !important;
    }
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-row-normalized .legalmail-yandex-preview {
        color: #8f969f !important;
    }
}

/* Logout: replace the white power glyph with a gentle red accent. */
@media screen and (min-width: 1201px) {
    body.task-mail #taskmenu a.logout,
    body.task-mail #taskmenu a.logout .inner,
    body.task-mail #taskmenu a.logout::before,
    body.task-mail #taskmenu a.logout .inner::before,
    body.task-addressbook #taskmenu a.logout,
    body.task-addressbook #taskmenu a.logout .inner,
    body.task-addressbook #taskmenu a.logout::before,
    body.task-addressbook #taskmenu a.logout .inner::before,
    body.task-settings #taskmenu a.logout,
    body.task-settings #taskmenu a.logout .inner,
    body.task-settings #taskmenu a.logout::before,
    body.task-settings #taskmenu a.logout .inner::before {
        color: #ef8f8f !important;
        -webkit-text-fill-color: #ef8f8f !important;
        fill: #ef8f8f !important;
    }

    body.task-mail #taskmenu a.logout:hover,
    body.task-addressbook #taskmenu a.logout:hover,
    body.task-settings #taskmenu a.logout:hover {
        color: #f5a0a0 !important;
        -webkit-text-fill-color: #f5a0a0 !important;
        background: rgba(239, 111, 111, .10) !important;
    }
}

html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot,
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot > a.button.unread,
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot > a.button.unread:hover,
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot > a.button.unread:focus:not(:focus-visible) {
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot > a.button.unread:hover {
    color: #f1f1f3 !important;
}
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot > a.button.unread.selected {
    background: transparent !important;
    color: #f0c95b !important;
}


/* ========================================================================== 
 * LegalMail v79 — lightweight inbox + unified search
 * ========================================================================== */

/* Search is one rounded control. Hover/focus never turns the surface white and
   inner Roundcube buttons do not create square segments or separator strokes. */
body.task-mail.action-none #layout-list > .legalmail-search-row {
    align-items: center !important;
}
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar:hover,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar:focus-within {
    flex: 1 1 auto !important;
    height: 44px !important;
    min-height: 44px !important;
    border: 1px solid #e1e4e8 !important;
    border-radius: 14px !important;
    outline: 0 !important;
    background: #f2f3f5 !important;
    box-shadow: none !important;
    overflow: hidden !important;
}
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form:hover,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form:focus,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form:focus-within,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form:active {
    height: 42px !important;
    min-height: 42px !important;
    border: 0 !important;
    border-radius: 13px !important;
    outline: 0 !important;
    background: #f2f3f5 !important;
    box-shadow: none !important;
    overflow: hidden !important;
}
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form::before {
    height: 42px !important;
    line-height: 42px !important;
    margin-left: 12px !important;
    border: 0 !important;
    color: #718092 !important;
    background: transparent !important;
    box-shadow: none !important;
}
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar input#mailsearchform,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar input#mailsearchform:hover,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar input#mailsearchform:focus,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar input#mailsearchform:active {
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 9px !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #252a31 !important;
    caret-color: #252a31 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar a,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar a:hover,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar a:focus,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar a:active,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar button,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar button:hover,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar button:focus,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar button:active {
    height: 42px !important;
    min-height: 42px !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar a::before,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar a::after,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar button::before,
body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar button::after {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

@media screen and (min-width: 769px) {
    /* Reserve the final height immediately, so the native list never appears
       compressed while the lightweight renderer is attaching its overlay. */
    body.task-mail.action-none .messagelist tbody tr,
    body.task-mail.action-none .messagelist tbody td,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 > td {
        height: 40px !important;
        min-height: 40px !important;
        line-height: 40px !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject {
        position: relative !important;
        overflow: visible !important;
    }

    /* Keep Roundcube's native nodes in the DOM for commands/plugins, but paint
       only the v79 row. Attachments stay native and clickable on the right. */
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > span.fromto,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > span.subject:not(.legalmail-yandex-subject),
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > span.date:not(.legalmail-yandex-date),
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > span.status:not(.legalmail-yandex-status) {
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row {
        position: absolute !important;
        z-index: 2 !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        display: grid !important;
        grid-template-columns: 30px clamp(156px, 16vw, 220px) 16px minmax(0, 1fr) minmax(58px, max-content) !important;
        grid-template-areas: "avatar sender status content date" !important;
        column-gap: 8px !important;
        align-items: center !important;
        height: 40px !important;
        min-height: 40px !important;
        padding-right: 10px !important;
        box-sizing: border-box !important;
        line-height: 40px !important;
        overflow: hidden !important;
        background: transparent !important;
    }
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.legalmail-has-attachment .legalmail-yandex-row {
        padding-right: 42px !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar {
        grid-area: avatar !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #e7eaee !important;
        color: #5b626b !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        line-height: 30px !important;
        letter-spacing: -0.25px !important;
        text-transform: uppercase !important;
        overflow: hidden !important;
        pointer-events: none !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-sender {
        grid-area: sender !important;
        min-width: 0 !important;
        height: 40px !important;
        line-height: 40px !important;
        color: #30343a !important;
        font-size: 13.5px !important;
        font-weight: 500 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status {
        grid-area: status !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 16px !important;
        min-width: 16px !important;
        height: 40px !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 40px !important;
        overflow: visible !important;
        pointer-events: auto !important;
    }
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:not(.unread) .legalmail-yandex-status::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-read::before {
        content: "" !important;
        display: block !important;
        width: 0 !important;
        min-width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: transparent !important;
        box-shadow: none !important;
        font-size: 0 !important;
    }
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.unread .legalmail-yandex-status::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-unread::before {
        content: "" !important;
        display: block !important;
        width: 9px !important;
        min-width: 9px !important;
        height: 9px !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #f4c000 !important;
        box-shadow: none !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content {
        grid-area: content !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 40px !important;
        line-height: 40px !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }
    /* First text = the real message Subject header. It may shrink, but never
       consumes the whole row: the body preview always keeps visible space. */
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-subject {
        display: block !important;
        flex: 0 1 auto !important;
        min-width: 24px !important;
        max-width: 48% !important;
        height: 40px !important;
        line-height: 40px !important;
        color: #24282e !important;
        font-size: 13.5px !important;
        font-weight: 500 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    /* Second text = first meaningful text from the message body. It owns all
       remaining horizontal space and ends with a native ellipsis at the edge. */
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-preview {
        display: block !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 40px !important;
        margin-left: 0 !important;
        line-height: 40px !important;
        color: #8a9098 !important;
        font-size: 13px !important;
        font-weight: 400 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    /* Reserve exactly the same second-text lane while its body is being fetched,
       so the subject/date never jump or resize after AJAX/search results arrive. */
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-preview:empty {
        display: block !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        margin-left: 0 !important;
    }
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-date {
        grid-area: date !important;
        width: auto !important;
        min-width: 58px !important;
        max-width: 84px !important;
        height: 40px !important;
        padding-left: 4px !important;
        line-height: 40px !important;
        color: #858c95 !important;
        font-size: 12.5px !important;
        font-weight: 400 !important;
        text-align: right !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.unread .legalmail-yandex-sender,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.unread .legalmail-yandex-subject {
        color: #202328 !important;
        font-weight: 700 !important;
    }

    /* The old native status/priority cell must not draw a second unread marker. */
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.status,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.priority,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.status *,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.priority * {
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        border: 0 !important;
        overflow: hidden !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.flags,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.flags > span,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.threads,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.selection {
        height: 40px !important;
        min-height: 40px !important;
        line-height: 40px !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > span.attachment,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > a.attachment {
        position: absolute !important;
        z-index: 4 !important;
        right: 4px !important;
        width: 26px !important;
        height: 40px !important;
        line-height: 40px !important;
    }
}

@media screen and (min-width: 769px) and (max-width: 1050px) {
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row {
        grid-template-columns: 30px clamp(132px, 17vw, 168px) 16px minmax(0, 1fr) 62px !important;
        column-gap: 7px !important;
    }
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-subject {
        max-width: 44% !important;
    }
}

html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar,
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar:hover,
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar:focus-within,
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form,
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form:hover,
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form:focus-within {
    border-color: #3a3d43 !important;
    background: #2a2c31 !important;
}
@media screen and (min-width: 769px) {
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-sender,
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-subject {
        color: #f1f1f3 !important;
    }
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-preview,
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-date {
        color: #969ca5 !important;
    }
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar {
        background: #353941 !important;
        color: #d7dbe1 !important;
    }
}


/* ========================================================================== 
 * LegalMail v80 — neutral black mail/reply toolbars (light mode)
 * ========================================================================== */
/*
 * Keep every active mail action in the same neutral palette. This applies to
 * the main message-list toolbar, the reader toolbar and the compose/reply
 * toolbar.  Roundcube/Elastic and plugins often colour icons on nested spans
 * or ::before pseudo-elements, therefore every rendered layer is overridden.
 */
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:not(.disabled),
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:not(.disabled) > .inner,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:not(.disabled) > span,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:not(.disabled) *,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:not(.disabled)::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:not(.disabled)::after,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:not(.disabled) > .inner::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:not(.disabled) > .inner::after,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar .dropbutton > a:not(.disabled),
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar .dropbutton > a:not(.disabled) *,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar .dropbutton > a:not(.disabled)::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar .dropbutton > a:not(.disabled)::after,
html:not(.dark-mode) body.task-mail #messagetoolbar a:not(.disabled),
html:not(.dark-mode) body.task-mail #messagetoolbar a:not(.disabled) > .inner,
html:not(.dark-mode) body.task-mail #messagetoolbar a:not(.disabled) > span,
html:not(.dark-mode) body.task-mail #messagetoolbar a:not(.disabled) *,
html:not(.dark-mode) body.task-mail #messagetoolbar a:not(.disabled)::before,
html:not(.dark-mode) body.task-mail #messagetoolbar a:not(.disabled)::after,
html:not(.dark-mode) body.task-mail #messagetoolbar a:not(.disabled) > .inner::before,
html:not(.dark-mode) body.task-mail #messagetoolbar a:not(.disabled) > .inner::after,
html:not(.dark-mode) body.task-mail #messagetoolbar .dropbutton > a:not(.disabled),
html:not(.dark-mode) body.task-mail #messagetoolbar .dropbutton > a:not(.disabled) *,
html:not(.dark-mode) body.task-mail #messagetoolbar .dropbutton > a:not(.disabled)::before,
html:not(.dark-mode) body.task-mail #messagetoolbar .dropbutton > a:not(.disabled)::after {
    color: #202124 !important;
    -webkit-text-fill-color: #202124 !important;
    fill: #202124 !important;
    text-decoration-color: #202124 !important;
    text-shadow: none !important;
    filter: none !important;
}

/* Keep dropdown chevrons neutral too. */
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.dropdown:not(.disabled),
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.dropdown:not(.disabled)::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.dropdown:not(.disabled) .inner,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.dropdown:not(.disabled) .inner::before,
html:not(.dark-mode) body.task-mail #messagetoolbar a.dropdown:not(.disabled),
html:not(.dark-mode) body.task-mail #messagetoolbar a.dropdown:not(.disabled)::before,
html:not(.dark-mode) body.task-mail #messagetoolbar a.dropdown:not(.disabled) .inner,
html:not(.dark-mode) body.task-mail #messagetoolbar a.dropdown:not(.disabled) .inner::before {
    color: #202124 !important;
    -webkit-text-fill-color: #202124 !important;
    fill: #202124 !important;
}

/* Hover/focus stays black; only the quiet background changes. */
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:not(.disabled):hover,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:not(.disabled):focus,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar .dropbutton:hover > a:not(.disabled),
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.selected:not(.disabled),
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a[aria-expanded="true"]:not(.disabled),
html:not(.dark-mode) body.task-mail #messagetoolbar a:not(.disabled):hover,
html:not(.dark-mode) body.task-mail #messagetoolbar a:not(.disabled):focus,
html:not(.dark-mode) body.task-mail #messagetoolbar .dropbutton:hover > a:not(.disabled),
html:not(.dark-mode) body.task-mail #messagetoolbar a.selected:not(.disabled),
html:not(.dark-mode) body.task-mail #messagetoolbar a[aria-expanded="true"]:not(.disabled) {
    color: #111315 !important;
    -webkit-text-fill-color: #111315 !important;
    background-color: #f1f2f4 !important;
    border-color: transparent !important;
}

/* Disabled commands remain visibly disabled instead of becoming black. */
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.disabled,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.disabled *,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.disabled::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.disabled::after,
html:not(.dark-mode) body.task-mail #messagetoolbar a.disabled,
html:not(.dark-mode) body.task-mail #messagetoolbar a.disabled *,
html:not(.dark-mode) body.task-mail #messagetoolbar a.disabled::before,
html:not(.dark-mode) body.task-mail #messagetoolbar a.disabled::after {
    color: #b7bcc1 !important;
    -webkit-text-fill-color: #b7bcc1 !important;
    fill: #b7bcc1 !important;
}


/* ==========================================================================
 * LegalMail v81 — Yandex-like read/unread marker
 * ========================================================================== */
@media screen and (min-width: 769px) {
    /* Read mail: no marker at rest, only a quiet hollow ring while hovering
       the whole row. The 16px hit area always remains clickable. */
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status {
        cursor: pointer !important;
    }
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:not(.unread):hover .legalmail-yandex-status::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-read:hover::before {
        content: "" !important;
        display: block !important;
        box-sizing: border-box !important;
        width: 10px !important;
        min-width: 10px !important;
        height: 10px !important;
        margin: 0 !important;
        border: 2px solid #8f969d !important;
        border-radius: 50% !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    /* Unread mail: solid Yandex-yellow dot at rest and on hover. */
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.unread .legalmail-yandex-status::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.unread:hover .legalmail-yandex-status::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-unread::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-unread:hover::before {
        width: 9px !important;
        min-width: 9px !important;
        height: 9px !important;
        border: 0 !important;
        background: #f4c000 !important;
    }
}

/* ========================================================================== 
 * LegalMail v86 — status-dot isolation, bright checkbox, hard neutral toolbar
 * ========================================================================== */
@media screen and (min-width: 769px) {
    /* The read-status hit target is independent from the selection column. */
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status {
        position: relative !important;
        z-index: 8 !important;
        user-select: none !important;
        -webkit-user-select: none !important;
    }

    /* Read mail: invisible at rest, hollow ring only while the row/status is hovered. */
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79[data-legalmail-read-state="read"] .legalmail-yandex-status::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:not(.unread):not([data-legalmail-read-state="unread"]) .legalmail-yandex-status::before {
        width: 0 !important;
        min-width: 0 !important;
        height: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79[data-legalmail-read-state="read"]:hover .legalmail-yandex-status::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:not(.unread):not([data-legalmail-read-state="unread"]):hover .legalmail-yandex-status::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-read:hover::before {
        width: 10px !important;
        min-width: 10px !important;
        height: 10px !important;
        box-sizing: border-box !important;
        border: 2px solid #8f969d !important;
        border-radius: 50% !important;
        background: transparent !important;
    }

    /* Unread stays a solid yellow dot after the mouse leaves. */
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79[data-legalmail-read-state="unread"] .legalmail-yandex-status::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.unread .legalmail-yandex-status::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-unread::before {
        content: "" !important;
        display: block !important;
        width: 9px !important;
        min-width: 9px !important;
        height: 9px !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #f4c000 !important;
        box-shadow: none !important;
    }

    /* Hide every stock Elastic read-status glyph, including variants that are
       not direct children of span.status. These are what could look like a
       short yellow stripe after a status toggle. */
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject [id^="statusicn"],
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject [id^="msgicn"],
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject .msgicon.status:not(.legalmail-yandex-status),
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > span.status:not(.legalmail-yandex-status),
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.status .msgicon,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.status [id^="statusicn"],
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.status [id^="msgicn"] {
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        color: transparent !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    /* The checkbox is the ONLY bulk-selection control. Make the checked state
       obvious and Yandex-like without changing its native keyboard behavior. */
    body.task-mail.action-none .messagelist td.selection input[type="checkbox"] {
        accent-color: #f4c000 !important;
        cursor: pointer !important;
    }
}

/* Last-resort reader/reply toolbar palette. The icon itself receives a
   grayscale/brightness filter so even plugin CSS that hard-codes a blue
   pseudo-icon cannot leak through. */
html:not(.dark-mode) body.task-mail div#layout div#layout-content > div.header div#mailtoolbar.toolbar.menu a:not(.disabled),
html:not(.dark-mode) body.task-mail div#layout div#layout-content > div.header div#mailtoolbar.toolbar.menu a:not(.disabled) *,
html:not(.dark-mode) body.task-mail div#layout div#layout-content > div.header div#mailtoolbar.toolbar.menu a:not(.disabled) > .inner,
html:not(.dark-mode) body.task-mail div#layout div#layout-content > div.header div#mailtoolbar.toolbar.menu a:not(.disabled) > span,
html:not(.dark-mode) body.task-mail div#layout div#layout-content > div.header div#mailtoolbar.toolbar.menu .dropbutton > a:not(.disabled) {
    color: #202124 !important;
    -webkit-text-fill-color: #202124 !important;
    fill: #202124 !important;
    stroke: #202124 !important;
    text-decoration-color: #202124 !important;
}
html:not(.dark-mode) body.task-mail div#layout div#layout-content > div.header div#mailtoolbar.toolbar.menu a:not(.disabled)::before,
html:not(.dark-mode) body.task-mail div#layout div#layout-content > div.header div#mailtoolbar.toolbar.menu a:not(.disabled)::after,
html:not(.dark-mode) body.task-mail div#layout div#layout-content > div.header div#mailtoolbar.toolbar.menu a:not(.disabled) > .inner::before,
html:not(.dark-mode) body.task-mail div#layout div#layout-content > div.header div#mailtoolbar.toolbar.menu a:not(.disabled) > .inner::after,
html:not(.dark-mode) body.task-mail div#layout div#layout-content > div.header div#mailtoolbar.toolbar.menu a:not(.disabled) > span::before,
html:not(.dark-mode) body.task-mail div#layout div#layout-content > div.header div#mailtoolbar.toolbar.menu a:not(.disabled) > span::after {
    color: #202124 !important;
    -webkit-text-fill-color: #202124 !important;
    fill: #202124 !important;
    stroke: #202124 !important;
    filter: grayscale(1) saturate(0) brightness(.24) contrast(2) !important;
}


/* ==========================================================================
 * LegalMail v86 — isolated Yandex read dot + absolute reader-toolbar palette
 * ========================================================================== */
@media screen and (min-width: 769px) {
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 16px !important;
        min-width: 16px !important;
        height: 40px !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        line-height: 1 !important;
        font: inherit !important;
        color: transparent !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        cursor: pointer !important;
    }
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status::before {
        content: "" !important;
        display: block !important;
        float: none !important;
        flex: 0 0 auto !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        border-radius: 999px !important;
        transform: none !important;
        font-size: 0 !important;
        font-family: inherit !important;
        line-height: 0 !important;
        box-shadow: none !important;
    }
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.unread .legalmail-yandex-status::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79[data-legalmail-read-state="unread"] .legalmail-yandex-status::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-unread::before {
        width: 9px !important;
        min-width: 9px !important;
        max-width: 9px !important;
        height: 9px !important;
        min-height: 9px !important;
        max-height: 9px !important;
        border: 0 !important;
        border-radius: 999px !important;
        background: #f4c000 !important;
    }
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:not(.unread):not([data-legalmail-read-state="unread"]) .legalmail-yandex-status.is-read::before {
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:not(.unread):not([data-legalmail-read-state="unread"]):hover .legalmail-yandex-status.is-read::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-read:hover::before {
        width: 10px !important;
        min-width: 10px !important;
        max-width: 10px !important;
        height: 10px !important;
        min-height: 10px !important;
        max-height: 10px !important;
        border: 2px solid #8f969d !important;
        border-radius: 999px !important;
        background: transparent !important;
    }
}

/* Route _task=mail&_action=show: deliberately broad header scope. This catches
   stock actions and plugin-injected buttons even if their generated markup does
   not retain one of the skin helper classes. */
html:not(.dark-mode) body.task-mail.action-show #layout-content > .header #mailtoolbar,
html:not(.dark-mode) body.task-mail.action-show #layout-content > .header #mailtoolbar a,
html:not(.dark-mode) body.task-mail.action-show #layout-content > .header #mailtoolbar a:link,
html:not(.dark-mode) body.task-mail.action-show #layout-content > .header #mailtoolbar a:visited,
html:not(.dark-mode) body.task-mail.action-show #layout-content > .header #mailtoolbar a *,
html:not(.dark-mode) body.task-mail.action-show #layout-content > .header #mailtoolbar .dropbutton,
html:not(.dark-mode) body.task-mail.action-show #layout-content > .header #mailtoolbar .dropbutton * {
    color: #202124 !important;
    -webkit-text-fill-color: #202124 !important;
    fill: #202124 !important;
    stroke: #202124 !important;
    text-decoration-color: #202124 !important;
}
html:not(.dark-mode) body.task-mail.action-show #layout-content > .header #mailtoolbar a::before,
html:not(.dark-mode) body.task-mail.action-show #layout-content > .header #mailtoolbar a::after,
html:not(.dark-mode) body.task-mail.action-show #layout-content > .header #mailtoolbar a *::before,
html:not(.dark-mode) body.task-mail.action-show #layout-content > .header #mailtoolbar a *::after,
html:not(.dark-mode) body.task-mail.action-show #layout-content > .header #mailtoolbar .dropbutton::before,
html:not(.dark-mode) body.task-mail.action-show #layout-content > .header #mailtoolbar .dropbutton::after {
    color: #202124 !important;
    -webkit-text-fill-color: #202124 !important;
    fill: #202124 !important;
    stroke: #202124 !important;
    filter: grayscale(1) saturate(0) brightness(.22) contrast(2) !important;
}


/* ========================================================================== 
 * LegalMail v86 — Yandex-style two-letter sender monograms
 * ========================================================================== */
body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar[data-avatar-tone="lime"]   { background:#8fce00 !important; color:#fff !important; }
body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar[data-avatar-tone="blue"]   { background:#3f8cff !important; color:#fff !important; }
body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar[data-avatar-tone="orange"] { background:#ff9500 !important; color:#fff !important; }
body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar[data-avatar-tone="teal"]   { background:#2bb5a7 !important; color:#fff !important; }
body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar[data-avatar-tone="violet"] { background:#8a63d2 !important; color:#fff !important; }
body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar[data-avatar-tone="pink"]   { background:#e45f91 !important; color:#fff !important; }
body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar[data-avatar-tone="coral"]  { background:#ef6b55 !important; color:#fff !important; }
body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar[data-avatar-tone="cyan"]   { background:#2fa8cf !important; color:#fff !important; }
body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar[data-avatar-tone="indigo"] { background:#5d73d9 !important; color:#fff !important; }
body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar[data-avatar-tone="mint"]   { background:#65b88a !important; color:#fff !important; }
body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar[data-avatar-tone="amber"]  { background:#e6a400 !important; color:#fff !important; }
body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar[data-avatar-tone="rose"]   { background:#d76574 !important; color:#fff !important; }

/* Center the pencil glyph in the compact left compose task button. Elastic's
   generic icon rule floats ::before; positioning it explicitly avoids the
   top/right drift visible on the compose shortcut. */
body.task-mail #taskmenu a.compose {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    text-align: center !important;
}
body.task-mail #taskmenu a.compose::before {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    float: none !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    line-height: 1 !important;
    transform: translate(-50%, -50%) !important;
    text-align: center !important;
}
body.task-mail #taskmenu a.compose > .inner { display:none !important; }

/* Reader toolbar: final cache-busted neutral palette. This intentionally does
   not depend on action-show because Roundcube can render the message template
   framed, in an external window, or through plugin-modified action classes. */
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:link,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:visited,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:not(.disabled),
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:not(.disabled) *,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar .dropbutton,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar .dropbutton * {
    color:#202124 !important;
    -webkit-text-fill-color:#202124 !important;
    fill:#202124 !important;
    stroke:#202124 !important;
    text-decoration-color:#202124 !important;
    --bs-link-color:#202124 !important;
    --bs-link-hover-color:#202124 !important;
}
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:not(.disabled)::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:not(.disabled)::after,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:not(.disabled) *::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a:not(.disabled) *::after,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar .dropbutton::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar .dropbutton::after {
    color:#202124 !important;
    -webkit-text-fill-color:#202124 !important;
    fill:#202124 !important;
    stroke:#202124 !important;
    filter:grayscale(1) saturate(0) brightness(.22) contrast(2) !important;
}
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.reply,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.forward,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.delete,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.junk,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.spam,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.unread,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.move,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.markmessage,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.more,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.reply::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.forward::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.delete::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.junk::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.spam::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.unread::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.move::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.markmessage::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.more::before {
    color:#202124 !important;
    -webkit-text-fill-color:#202124 !important;
    fill:#202124 !important;
    stroke:#202124 !important;
}
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.disabled,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.disabled *,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.disabled::before,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.disabled::after {
    color:#a7adb3 !important;
    -webkit-text-fill-color:#a7adb3 !important;
    fill:#a7adb3 !important;
    stroke:#a7adb3 !important;
}


/* ==========================================================================
 * LegalMail v86 — final colorful avatars + reader toolbar pixel guard
 * ========================================================================== */
/* v85's neutral avatar rule had one extra class in its selector, therefore its
   gray !important background won the cascade. These selectors add the row
   class (and the JS also writes the same color inline) so monograms are colored
   immediately and stay stable through search/AJAX refreshes. */
body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar {
    color:#fff !important;
}

/* Exact controls observed on Roundcube's _action=show page. Color is forced
   normally, while filter is the final rendered-pixel fallback for Firefox: it
   neutralizes Elastic/plugin blue even if a late rule recolors the glyph. */
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar > a:not(.disabled),
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar > .dropbutton > a:not(.disabled),
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar #rcmbtn114:not(.disabled),
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar #rcmbtn115:not(.disabled),
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar #rcmbtn116:not(.disabled),
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar #rcmbtn100:not(.disabled),
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar #rcmbtn117:not(.disabled),
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar #rcmbtn118:not(.disabled),
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar #markmessagemenulink,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar #messagemenulink,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar #replyallmenulink,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar #forwardmenulink {
    color:#202124 !important;
    -webkit-text-fill-color:#202124 !important;
    background:transparent !important;
    border-color:transparent !important;
    box-shadow:none !important;
    filter:grayscale(1) saturate(0) brightness(.20) !important;
}
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar > a:not(.disabled) *,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar > .dropbutton > a:not(.disabled) *,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar > a:not(.disabled)::before,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar > a:not(.disabled)::after,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar > .dropbutton > a:not(.disabled)::before,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar > .dropbutton > a:not(.disabled)::after {
    color:#202124 !important;
    -webkit-text-fill-color:#202124 !important;
    fill:#202124 !important;
    stroke:#202124 !important;
}


/* ========================================================================== 
 * LegalMail v89 — reader toolbar structural color fix + blue unread filter
 * + visible soft-blue refresh hover.
 * ========================================================================== */

/* Reader toolbar actions are controls, not ordinary blue hyperlinks.  The
 * template now gives these anchors .button as well, but this selector also
 * covers stale/cached markup before JS normalizes the classes. */
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar a,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar a:link,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar a:visited,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar a > .inner,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar a > span {
    color: #202124 !important;
    -webkit-text-fill-color: #202124 !important;
    text-decoration-color: #202124 !important;
    filter: none !important;
}
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar a::before,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar a::after,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar a > .inner::before,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar a > .inner::after,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar a > span::before,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar a > span::after {
    color: #202124 !important;
    -webkit-text-fill-color: #202124 !important;
    fill: #202124 !important;
    stroke: #202124 !important;
    filter: none !important;
}
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar a.disabled,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar a.disabled *,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar a.disabled::before,
html:not(.dark-mode) body.task-mail.action-show #mailtoolbar a.disabled::after {
    color: #a7adb3 !important;
    -webkit-text-fill-color: #a7adb3 !important;
    fill: #a7adb3 !important;
    stroke: #a7adb3 !important;
}

/* Unread-only filter: selected state uses the same calm blue family as the
 * rest of LegalMail instead of the old yellow envelope. */
body.task-mail.action-none #layout-list > .legalmail-search-row >
.yandex-selection-toolbar.legalmail-unread-slot > a.button.unread {
    color: #66727d !important;
}
body.task-mail.action-none #layout-list > .legalmail-search-row >
.yandex-selection-toolbar.legalmail-unread-slot > a.button.unread:hover,
body.task-mail.action-none #layout-list > .legalmail-search-row >
.yandex-selection-toolbar.legalmail-unread-slot > a.button.unread:focus:not(:focus-visible) {
    color: #2e7fae !important;
    background: #eef7fd !important;
    border-radius: 10px !important;
}
body.task-mail.action-none #layout-list > .legalmail-search-row >
.yandex-selection-toolbar.legalmail-unread-slot > a.button.unread.selected {
    color: #2e7fae !important;
    background: #e7f3fb !important;
    border-radius: 10px !important;
}

/* Refresh stays quiet at rest but has an obvious blue-tinted hover/focus. */
body.task-mail .yandex-refresh-button,
body.task-mail a.yandex-refresh-button.button.icon,
body.task-mail a.yandex-refresh-button.toolbar-button {
    transition: background-color .14s ease, border-color .14s ease,
                color .14s ease, box-shadow .14s ease !important;
}
body.task-mail .yandex-refresh-button:hover,
body.task-mail .yandex-refresh-button:focus-visible,
body.task-mail a.yandex-refresh-button.button.icon:hover,
body.task-mail a.yandex-refresh-button.button.icon:focus-visible,
body.task-mail a.yandex-refresh-button.toolbar-button:hover,
body.task-mail a.yandex-refresh-button.toolbar-button:focus-visible {
    background: #eaf5fc !important;
    border-color: #c4deef !important;
    color: #2e7fae !important;
    box-shadow: 0 0 0 3px rgba(46, 127, 174, .10) !important;
    outline: 0 !important;
}
body.task-mail .yandex-refresh-button:active,
body.task-mail a.yandex-refresh-button.button.icon:active,
body.task-mail a.yandex-refresh-button.toolbar-button:active {
    background: #deeffa !important;
    border-color: #afd2e7 !important;
    box-shadow: none !important;
}

/* ========================================================================== 
 * LegalMail v89 — unified message reply action bar
 * Visual language matches the compact compose/send bar: one white rounded
 * surface, a warm primary action and quiet secondary actions.
 * ======================================================================= */
body.task-mail.action-show .yandex-reply-footer {
    position: sticky !important;
    z-index: 80 !important;
    bottom: 12px !important;
    width: calc(100% - 36px) !important;
    max-width: 860px !important;
    min-height: 64px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin: 22px auto 4px !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    border: 1px solid #e4e7eb !important;
    border-radius: 18px !important;
    background: rgba(255,255,255,.97) !important;
    box-shadow: 0 10px 32px rgba(24,31,42,.12) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
}

body.task-mail.action-show .yandex-reply-footer > a {
    position: relative !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
    background: #f1f3f5 !important;
    color: #343a40 !important;
    -webkit-text-fill-color: #343a40 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    line-height: 1 !important;
    font-weight: 650 !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    transition: background-color .15s ease, border-color .15s ease,
                box-shadow .15s ease, transform .08s ease !important;
}

body.task-mail.action-show .yandex-reply-footer > a .inner {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
    font: inherit !important;
    line-height: 1 !important;
}

/* Primary action: same visual weight as the yellow Send button. */
body.task-mail.action-show .yandex-reply-footer > a.yandex-reply-button.reply {
    flex: 0 0 auto !important;
    min-width: 132px !important;
    justify-content: center !important;
    padding: 0 18px !important;
    background: #ffcc00 !important;
    border-color: #efbd00 !important;
    color: #17191c !important;
    -webkit-text-fill-color: #17191c !important;
    box-shadow: 0 1px 1px rgba(0,0,0,.05) !important;
}

/* Compact icons use the already bundled Elastic FontAwesome font. */
body.task-mail.action-show .yandex-reply-footer > a::before {
    display: inline-block !important;
    flex: 0 0 auto !important;
    width: 18px !important;
    margin: 0 !important;
    color: currentColor !important;
    -webkit-text-fill-color: currentColor !important;
    font-family: Icons !important;
    font-style: normal !important;
    font-weight: 900 !important;
    font-size: 16px !important;
    line-height: 1 !important;
    text-align: center !important;
    speak: none !important;
    -webkit-font-smoothing: antialiased !important;
}
body.task-mail.action-show .yandex-reply-footer > a.yandex-reply-button.reply::before { content: "\f3e5" !important; }
body.task-mail.action-show .yandex-reply-footer > a.yandex-reply-secondary.reply.all::before { content: "\f122" !important; }
body.task-mail.action-show .yandex-reply-footer > a.yandex-reply-secondary.forward::before { content: "\f064" !important; }

body.task-mail.action-show .yandex-reply-footer > a.yandex-reply-button.reply:not(.disabled):hover,
body.task-mail.action-show .yandex-reply-footer > a.yandex-reply-button.reply:not(.disabled):focus-visible {
    background: #ffd633 !important;
    border-color: #efbd00 !important;
    color: #111315 !important;
    -webkit-text-fill-color: #111315 !important;
    box-shadow: 0 5px 14px rgba(226,173,0,.20) !important;
}

body.task-mail.action-show .yandex-reply-footer > a.yandex-reply-secondary:not(.disabled):hover,
body.task-mail.action-show .yandex-reply-footer > a.yandex-reply-secondary:not(.disabled):focus-visible {
    background: #e9f2fb !important;
    border-color: #d5e6f6 !important;
    color: #202a33 !important;
    -webkit-text-fill-color: #202a33 !important;
    box-shadow: 0 3px 10px rgba(65,116,164,.08) !important;
}

body.task-mail.action-show .yandex-reply-footer > a:not(.disabled):active {
    transform: translateY(1px) !important;
    box-shadow: none !important;
}

/* Keep disabled buttons visually intentional instead of looking like inputs. */
body.task-mail.action-show .yandex-reply-footer > a.disabled,
body.task-mail.action-show .yandex-reply-footer > a[aria-disabled="true"] {
    opacity: 1 !important;
    cursor: default !important;
    pointer-events: none !important;
    background: #f4f5f6 !important;
    border-color: transparent !important;
    color: #a0a6ad !important;
    -webkit-text-fill-color: #a0a6ad !important;
    box-shadow: none !important;
}
body.task-mail.action-show .yandex-reply-footer > a.yandex-reply-button.reply.disabled,
body.task-mail.action-show .yandex-reply-footer > a.yandex-reply-button.reply[aria-disabled="true"] {
    background: #f2f3f4 !important;
    color: #9aa0a6 !important;
    -webkit-text-fill-color: #9aa0a6 !important;
}

@media screen and (max-width: 620px) {
    body.task-mail.action-show .yandex-reply-footer {
        width: calc(100% - 20px) !important;
        gap: 6px !important;
        padding: 8px !important;
        border-radius: 16px !important;
    }
    body.task-mail.action-show .yandex-reply-footer > a {
        height: 42px !important;
        min-height: 42px !important;
        padding: 0 12px !important;
        font-size: 13px !important;
    }
    body.task-mail.action-show .yandex-reply-footer > a.yandex-reply-button.reply {
        min-width: 112px !important;
        padding: 0 14px !important;
    }
}

html.dark-mode body.task-mail.action-show .yandex-reply-footer {
    border-color: #394248 !important;
    background: rgba(28,33,37,.96) !important;
    box-shadow: 0 12px 34px rgba(0,0,0,.30) !important;
}
html.dark-mode body.task-mail.action-show .yandex-reply-footer > a.yandex-reply-secondary {
    background: #343c42 !important;
    color: #e2e6e9 !important;
    -webkit-text-fill-color: #e2e6e9 !important;
}
html.dark-mode body.task-mail.action-show .yandex-reply-footer > a.yandex-reply-secondary:not(.disabled):hover,
html.dark-mode body.task-mail.action-show .yandex-reply-footer > a.yandex-reply-secondary:not(.disabled):focus-visible {
    background: #3d4b57 !important;
    border-color: #496071 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* ========================================================================== 
 * LegalMail v89 — adaptive reader + composer action surfaces
 * Reader bar intentionally mirrors the compact compose dock: the primary
 * Reply control stays button-sized at every breakpoint and never stretches
 * across the message width.
 * ======================================================================= */
html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) {
    position: sticky !important;
    z-index: 90 !important;
    bottom: 12px !important;
    width: min(calc(100% - 40px), 980px) !important;
    max-width: 980px !important;
    min-width: 0 !important;
    min-height: 64px !important;
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin: 20px auto 8px !important;
    padding: 9px 10px !important;
    box-sizing: border-box !important;
    border: 1px solid #e1e5e9 !important;
    border-radius: 17px !important;
    background: rgba(255,255,255,.97) !important;
    box-shadow: 0 12px 32px rgba(30,38,48,.13) !important;
    overflow: visible !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
}

html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a,
html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a:first-child,
html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a.yandex-reply-button,
html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a.yandex-reply-secondary {
    flex: 0 0 auto !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    flex-basis: auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 15px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    box-sizing: border-box !important;
    border: 1px solid transparent !important;
    border-radius: 11px !important;
    background: #f1f3f5 !important;
    color: #343a40 !important;
    -webkit-text-fill-color: #343a40 !important;
    text-align: center !important;
    text-decoration: none !important;
    font-size: 14px !important;
    line-height: 1 !important;
    font-weight: 650 !important;
    white-space: nowrap !important;
    box-shadow: none !important;
}

html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a.yandex-reply-button.reply {
    width: auto !important;
    min-width: 126px !important;
    max-width: 180px !important;
    padding-inline: 18px !important;
    background: #ffcc00 !important;
    border-color: #e9bb00 !important;
    color: #15171a !important;
    -webkit-text-fill-color: #15171a !important;
}

html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a.yandex-reply-button.reply:not(.disabled):hover,
html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a.yandex-reply-button.reply:not(.disabled):focus-visible {
    background: #ffd633 !important;
    border-color: #dfb200 !important;
    box-shadow: 0 4px 14px rgba(214,165,0,.18) !important;
}

html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a.yandex-reply-secondary:not(.disabled):hover,
html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a.yandex-reply-secondary:not(.disabled):focus-visible {
    background: #eaf3fb !important;
    border-color: #d6e7f5 !important;
    color: #26333d !important;
    -webkit-text-fill-color: #26333d !important;
}

/* Medium reader widths: preserve one compact row while reducing chrome. */
@media screen and (max-width: 820px) {
    html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) {
        width: calc(100% - 20px) !important;
        min-height: 60px !important;
        gap: 6px !important;
        padding: 8px !important;
        border-radius: 15px !important;
    }
    html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a,
    html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a:first-child {
        height: 42px !important;
        min-height: 42px !important;
        padding-inline: 12px !important;
        font-size: 13px !important;
    }
    html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a.yandex-reply-button.reply {
        min-width: 112px !important;
        max-width: 150px !important;
    }
}

/* Narrow phones: buttons wrap as compact controls; none becomes 100% wide. */
@media screen and (max-width: 520px) {
    html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) {
        bottom: 6px !important;
        width: calc(100% - 12px) !important;
        min-height: 0 !important;
        flex-flow: row wrap !important;
        align-content: center !important;
        row-gap: 6px !important;
        column-gap: 6px !important;
        margin-top: 14px !important;
        padding: 7px !important;
        border-radius: 14px !important;
    }
    html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a,
    html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a:first-child,
    html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a.yandex-reply-secondary {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: calc(100% - 14px) !important;
        height: 40px !important;
        min-height: 40px !important;
        padding-inline: 10px !important;
        font-size: 12.5px !important;
    }
    html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a.yandex-reply-button.reply {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 104px !important;
        max-width: 140px !important;
        padding-inline: 12px !important;
    }
}

/* Composer card and dock adapt without making Send/Attach oversized. */
html body.task-mail.action-compose #compose-content {
    width: min(calc(100% - 32px), 1000px) !important;
    max-width: 1000px !important;
    min-width: 0 !important;
}

html body.task-mail.action-compose .legalmail-compose-actions,
html body.task-mail.action-compose .legalmail-compose-actions.legalmail-compose-actions-fixed {
    max-width: 1000px !important;
    box-sizing: border-box !important;
}

html body.task-mail.action-compose .legalmail-compose-actions .btn.send,
html body.task-mail.action-compose .legalmail-compose-actions .legalmail-inline-attach,
html body.task-mail.action-compose .legalmail-compose-actions .extwin {
    flex: 0 0 auto !important;
    width: auto !important;
}

@media screen and (max-width: 1040px) and (min-width: 769px) {
    html body.task-mail.action-compose #compose-content {
        width: calc(100% - 20px) !important;
        margin-top: 10px !important;
        margin-bottom: 18px !important;
    }
    html body.task-mail.action-compose #compose-headers {
        padding-inline: 12px !important;
    }
    html body.task-mail.action-compose #composebodycontainer {
        padding-inline: 12px !important;
    }
}

@media screen and (max-width: 768px) {
    html body.task-mail.action-compose #compose-content {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding-bottom: 76px !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    html body.task-mail.action-compose .legalmail-compose-actions,
    html body.task-mail.action-compose .legalmail-compose-actions.legalmail-compose-actions-fixed {
        position: sticky !important;
        z-index: 250 !important;
        left: auto !important;
        right: auto !important;
        bottom: 6px !important;
        width: calc(100% - 16px) !important;
        max-width: none !important;
        min-height: 58px !important;
        margin: 0 8px 8px !important;
        padding: 7px 8px !important;
        gap: 6px !important;
        border: 1px solid #e0e4e8 !important;
        border-radius: 14px !important;
        background: rgba(255,255,255,.97) !important;
        box-shadow: 0 10px 26px rgba(30,38,48,.14) !important;
    }
    html body.task-mail.action-compose .legalmail-compose-actions .btn.send {
        min-width: 112px !important;
        height: 42px !important;
        padding-inline: 16px !important;
        border-radius: 10px !important;
    }
    html body.task-mail.action-compose .legalmail-inline-attach,
    html body.task-mail.action-compose .legalmail-compose-actions .extwin {
        height: 42px !important;
        min-height: 42px !important;
        border-radius: 10px !important;
    }
    html body.task-mail.action-compose #composebodycontainer textarea#composebody {
        min-height: 260px !important;
        height: clamp(260px, 45vh, 520px) !important;
    }
}

@media screen and (max-width: 560px) {
    html body.task-mail.action-compose #compose-headers {
        padding: 9px 8px 5px !important;
    }
    html body.task-mail.action-compose .compose-headers .form-group {
        margin-bottom: 3px !important;
    }
    html body.task-mail.action-compose .compose-headers .col-form-label {
        flex: 0 0 58px !important;
        max-width: 58px !important;
        padding-left: 4px !important;
        padding-right: 6px !important;
    }
    html body.task-mail.action-compose .compose-headers .col-10 {
        flex: 1 1 0 !important;
        max-width: none !important;
        min-width: 0 !important;
    }
    html body.task-mail.action-compose #composebodycontainer {
        padding: 8px !important;
    }
    html body.task-mail.action-compose #composebodycontainer .tox-tinymce {
        border-radius: 10px !important;
    }
    html body.task-mail.action-compose .legalmail-compose-actions .btn.send {
        min-width: 104px !important;
        padding-inline: 13px !important;
        font-size: 13px !important;
    }
    html body.task-mail.action-compose .legalmail-inline-attach {
        padding-inline: 10px !important;
        font-size: 12.5px !important;
    }
    html body.task-mail.action-compose .legalmail-compose-actions .extwin {
        min-width: 40px !important;
        padding-inline: 10px !important;
    }
}

html.dark-mode body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89),
html.dark-mode body.task-mail.action-compose .legalmail-compose-actions {
    border-color: #394248 !important;
    background: rgba(28,33,37,.96) !important;
}


/* ========================================================================== 
 * LegalMail v92 — responsive message reader + zero-navigation read dot
 * ========================================================================== */

/* Status dot is a real isolated hit target. Prevent text selection / drag and
   keep it above the transparent row overlay so pointer hit-testing is stable. */
body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status {
    position: relative !important;
    z-index: 40 !important;
    isolation: isolate !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* Reader frame scales continuously instead of jumping between a wide desktop
   card and a cramped mobile surface. */
html body.task-mail.action-show #layout-content.yandex-message-view > .content.frame-content {
    padding: clamp(8px, 1.7vw, 22px) clamp(8px, 2.1vw, 28px) clamp(18px, 3vw, 34px) !important;
    scroll-padding-bottom: 92px !important;
}
html body.task-mail.action-show #message-header,
html body.task-mail.action-show #message-content {
    width: min(100%, 1120px) !important;
    max-width: 1120px !important;
    min-width: 0 !important;
}
html body.task-mail.action-show #message-header {
    padding: clamp(15px, 2vw, 24px) clamp(14px, 2.3vw, 28px) 12px !important;
}
html body.task-mail.action-show #message-content {
    padding: 0 clamp(14px, 2.3vw, 28px) clamp(20px, 3vw, 34px) !important;
}
html body.task-mail.action-show #message-header > .subject {
    max-width: 100% !important;
    padding-right: clamp(0px, 14vw, 170px) !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    font-size: clamp(18px, 1.65vw, 23px) !important;
    line-height: 1.32 !important;
}
html body.task-mail.action-show #message-header > .header {
    min-width: 0 !important;
}
html body.task-mail.action-show #message-header .header-content {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
}
html body.task-mail.action-show #message-header .header-summary,
html body.task-mail.action-show #message-header .header-headers,
html body.task-mail.action-show #message-header .header-headers tbody {
    width: 100% !important;
    max-width: 100% !important;
}
html body.task-mail.action-show #message-header .header-headers td.header:not(.header-title) {
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}
html body.task-mail.action-show #message-header .header-headers td.header a,
html body.task-mail.action-show #message-header .header-summary a {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
}

/* Embedded HTML mail may contain a hard min-width (420/600px). Keep any such
   overflow inside the message itself rather than forcing the whole UI wider. */
html body.task-mail.action-show #message-content,
html body.task-mail.action-show #message-content .rightcol,
html body.task-mail.action-show #messagebody,
html body.task-mail.action-show #messagebody .message-htmlpart,
html body.task-mail.action-show #messagebody .message-htmlpart > .rcmBody {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
html body.task-mail.action-show #messagebody .message-htmlpart > .rcmBody,
html body.task-mail.action-show #messagebody .message-htmlpart .rcmBody {
    overflow-x: auto !important;
    overscroll-behavior-inline: contain !important;
    -webkit-overflow-scrolling: touch !important;
}
html body.task-mail.action-show #messagebody img:not([width="1"]):not([height="1"]) {
    max-width: 100% !important;
    height: auto;
}

/* The reply dock follows the reader width, but its controls remain compact. */
html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) {
    width: min(calc(100% - 12px), 760px) !important;
    max-width: 760px !important;
    box-sizing: border-box !important;
}
html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
}

/* Tablet: navigation joins normal flow, header fields stay readable, and the
   top toolbar can scroll horizontally instead of squeezing or wrapping. */
@media screen and (max-width: 900px) {
    html body.task-mail.action-show #layout-content.yandex-message-view > .header {
        min-width: 0 !important;
        overflow: hidden !important;
    }
    html body.task-mail.action-show #layout-content.yandex-message-view > .header #mailtoolbar {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
    }
    html body.task-mail.action-show #layout-content.yandex-message-view > .header #mailtoolbar::-webkit-scrollbar {
        display: none !important;
    }
    html body.task-mail.action-show #message-header > .subject {
        padding-right: 0 !important;
        margin-bottom: 10px !important;
    }
    html body.task-mail.action-show .yandex-message-nav {
        position: static !important;
        width: 100% !important;
        justify-content: flex-end !important;
        margin: -3px 0 7px !important;
    }
    html body.task-mail.action-show #message-header > .header img.contactphoto {
        width: 38px !important;
        height: 38px !important;
        flex: 0 0 38px !important;
    }
}

/* Phone/small tablet: turn the metadata table into stacked label/value rows.
   This prevents long addresses from making the card wider than the viewport. */
@media screen and (max-width: 640px) {
    html body.task-mail.action-show #layout-content.yandex-message-view > .content.frame-content {
        padding: 6px 5px 16px !important;
    }
    html body.task-mail.action-show #message-header,
    html body.task-mail.action-show #message-content {
        width: 100% !important;
        max-width: none !important;
    }
    html body.task-mail.action-show #message-header {
        padding: 14px 12px 9px !important;
        border-radius: 13px 13px 0 0 !important;
    }
    html body.task-mail.action-show #message-content {
        padding: 0 12px 18px !important;
        border-radius: 0 0 13px 13px !important;
    }
    html body.task-mail.action-show #message-header > .subject {
        font-size: 18px !important;
        line-height: 1.3 !important;
    }
    html body.task-mail.action-show #message-header > .header {
        display: grid !important;
        grid-template-columns: 34px minmax(0, 1fr) !important;
        column-gap: 9px !important;
        align-items: start !important;
    }
    html body.task-mail.action-show #message-header > .header img.contactphoto {
        width: 34px !important;
        height: 34px !important;
        margin: 1px 0 0 !important;
    }
    html body.task-mail.action-show #message-header .header-content {
        width: 100% !important;
        min-width: 0 !important;
    }
    html body.task-mail.action-show #message-header .header-summary {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }
    html body.task-mail.action-show #message-header .header-headers,
    html body.task-mail.action-show #message-header .header-headers tbody,
    html body.task-mail.action-show #message-header .header-headers tr,
    html body.task-mail.action-show #message-header .header-headers td {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    html body.task-mail.action-show #message-header .header-headers tr {
        margin: 0 0 6px !important;
    }
    html body.task-mail.action-show #message-header .header-headers td.header-title {
        min-width: 0 !important;
        padding: 0 0 2px !important;
        color: #87909a !important;
        font-size: 11px !important;
        line-height: 1.2 !important;
    }
    html body.task-mail.action-show #message-header .header-headers td.header:not(.header-title) {
        padding: 7px 9px !important;
        border-radius: 9px !important;
        background: #f4f6f8 !important;
        font-size: 12.5px !important;
        line-height: 1.3 !important;
    }
    html body.task-mail.action-show #message-header .header-links {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
        margin-top: 5px !important;
    }
    html body.task-mail.action-show #message-header .header-links a {
        margin: 0 !important;
    }
    html body.task-mail.action-show .yandex-message-nav > a {
        padding-inline: 6px !important;
        font-size: 12px !important;
    }
    html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) {
        width: calc(100% - 8px) !important;
        max-width: none !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        flex-wrap: nowrap !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
    }
    html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89)::-webkit-scrollbar {
        display: none !important;
    }
    html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a,
    html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a:first-child,
    html body.task-mail.action-show .yandex-reply-footer:is(.legalmail-replybar-v92,.legalmail-replybar-v89) > a.yandex-reply-button.reply {
        width: auto !important;
        min-width: max-content !important;
        max-width: none !important;
        flex: 0 0 auto !important;
    }
}

@media screen and (max-width: 420px) {
    html body.task-mail.action-show #message-header > .header {
        grid-template-columns: 1fr !important;
    }
    html body.task-mail.action-show #message-header > .header img.contactphoto {
        display: none !important;
    }
    html body.task-mail.action-show .yandex-message-nav {
        justify-content: flex-start !important;
        overflow-x: auto !important;
    }
}

html.dark-mode body.task-mail.action-show #message-header .header-headers td.header:not(.header-title) {
    background: #252a2f !important;
}

/* ========================================================================== 
 * LegalMail v92 — instant read-dot cursor + Yandex-like adaptive composer
 * ========================================================================== */

/* The blue spinning mouse cursor was caused by v90's explicit `cursor: wait`
   while the IMAP mark request was locked. The state still paints immediately,
   but the pointer remains a normal control cursor while the server catches up. */
html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status,
html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status[data-legalmail-toggle-lock="1"],
html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status::before {
    cursor: pointer !important;
}

/* Compose/reply stays centered in the REAL content column.  The side gutters
   grow with the viewport until the editor reaches a comfortable desktop width,
   like Yandex Mail: small screens use the available width, wide monitors gain
   increasingly generous whitespace instead of an over-stretched editor. */
html body.task-mail.action-compose #layout-content.legalmail-compose-view {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

html body.task-mail.action-compose #compose-content {
    --lm92-compose-gutter: clamp(16px, 4vw, 88px);
    box-sizing: border-box !important;
    flex: 0 1 auto !important;
    align-self: center !important;
    width: min(1120px, calc(100% - var(--lm92-compose-gutter) - var(--lm92-compose-gutter))) !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: clamp(14px, 1.8vw, 24px) auto 28px !important;
}

/* Reply and new-message windows use the same geometry so switching between
   compose modes does not make the editor jump sideways. */
html body.task-mail.action-compose.legalmail-reply-compose #compose-content,
html body.task-mail.action-compose.legalmail-external-compose #compose-content,
html body.task-mail.action-compose.legalmail-external-compose.legalmail-reply-compose #compose-content {
    width: min(1120px, calc(100% - var(--lm92-compose-gutter) - var(--lm92-compose-gutter))) !important;
    max-width: none !important;
}

/* Keep every inner editor layer shrinkable. Long addresses, TinyMCE and the
   formatting toolbar must scroll inside the card instead of widening the page. */
html body.task-mail.action-compose #compose-content > form,
html body.task-mail.action-compose #compose-headers,
html body.task-mail.action-compose .compose-headers,
html body.task-mail.action-compose .compose-headers .form-group,
html body.task-mail.action-compose .compose-headers .input-group,
html body.task-mail.action-compose .compose-headers .form-control,
html body.task-mail.action-compose .compose-headers .recipient-input,
html body.task-mail.action-compose #composebodycontainer,
html body.task-mail.action-compose #composebodycontainer .tox-tinymce,
html body.task-mail.action-compose #composebodycontainer .tox-editor-container,
html body.task-mail.action-compose #composebodycontainer .tox-edit-area {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

html body.task-mail.action-compose #composebodycontainer .tox-toolbar-overlord,
html body.task-mail.action-compose #composebodycontainer .tox-toolbar__primary {
    min-width: 0 !important;
    max-width: 100% !important;
}

/* Medium desktop/tablet: preserve visible side air without sacrificing editor
   space. The top compose toolbar scrolls horizontally when it cannot fit. */
@media screen and (max-width: 1100px) and (min-width: 769px) {
    html body.task-mail.action-compose #compose-content {
        --lm92-compose-gutter: clamp(14px, 2.4vw, 28px);
        width: calc(100% - var(--lm92-compose-gutter) - var(--lm92-compose-gutter)) !important;
    }
    html body.task-mail.action-compose #layout-content.legalmail-compose-view > .header {
        min-width: 0 !important;
        overflow: hidden !important;
    }
    html body.task-mail.action-compose #messagetoolbar {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        flex-wrap: nowrap !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
    }
    html body.task-mail.action-compose #messagetoolbar::-webkit-scrollbar {
        display: none !important;
    }
}

/* Mobile keeps the native full-width Roundcube flow. */
@media screen and (max-width: 768px) {
    html body.task-mail.action-compose #compose-content,
    html body.task-mail.action-compose.legalmail-reply-compose #compose-content,
    html body.task-mail.action-compose.legalmail-external-compose #compose-content,
    html body.task-mail.action-compose.legalmail-external-compose.legalmail-reply-compose #compose-content {
        --lm92-compose-gutter: 0px;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }
}

/* ========================================================================== 
 * LegalMail v93 — truly fluid compose/reply card
 * The previous v92 rule stopped growing at 1120px, so on wide displays the
 * form looked fixed. v93 derives its width from the actual content column.
 * Side gutters grow with the window, while the card itself also keeps growing
 * until an ultra-wide comfort ceiling is reached.
 * ========================================================================== */
html body.task-mail.action-compose #layout-content.legalmail-compose-view {
    --lm93-compose-total-gutter: clamp(32px, 20%, 880px);
}

html body.task-mail.action-compose #compose-content,
html body.task-mail.action-compose.legalmail-reply-compose #compose-content,
html body.task-mail.action-compose.legalmail-external-compose #compose-content,
html body.task-mail.action-compose.legalmail-external-compose.legalmail-reply-compose #compose-content {
    width: min(1680px, calc(100% - var(--lm93-compose-total-gutter))) !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* A 1120–1600px desktop should use noticeably more of the available column,
   instead of already behaving like an ultra-wide monitor. */
@media screen and (min-width: 769px) and (max-width: 1599px) {
    html body.task-mail.action-compose #layout-content.legalmail-compose-view {
        --lm93-compose-total-gutter: clamp(28px, 14%, 220px);
    }
}

/* From 1600px upward the gutters become progressively larger, Yandex-style. */
@media screen and (min-width: 1600px) and (max-width: 2199px) {
    html body.task-mail.action-compose #layout-content.legalmail-compose-view {
        --lm93-compose-total-gutter: clamp(220px, 20%, 440px);
    }
}

@media screen and (min-width: 2200px) {
    html body.task-mail.action-compose #layout-content.legalmail-compose-view {
        --lm93-compose-total-gutter: clamp(440px, 28%, 880px);
    }
}

/* Keep the editor card and fixed Send dock on the same live geometry. */
html body.task-mail.action-compose #compose-content,
html body.task-mail.action-compose #compose-content > form,
html body.task-mail.action-compose #compose-headers,
html body.task-mail.action-compose #composebodycontainer,
html body.task-mail.action-compose #composebodycontainer .tox-tinymce {
    box-sizing: border-box !important;
}

/* Mobile remains edge-to-edge; the desktop gutter formula must not leak in. */
@media screen and (max-width: 768px) {
    html body.task-mail.action-compose #layout-content.legalmail-compose-view {
        --lm93-compose-total-gutter: 0px;
    }
    html body.task-mail.action-compose #compose-content,
    html body.task-mail.action-compose.legalmail-reply-compose #compose-content,
    html body.task-mail.action-compose.legalmail-external-compose #compose-content,
    html body.task-mail.action-compose.legalmail-external-compose.legalmail-reply-compose #compose-content {
        width: 100% !important;
        max-width: none !important;
    }
}

/* v93 final fluid geometry: one continuous desktop formula, no breakpoint jump. */
html body.task-mail.action-compose #layout-content.legalmail-compose-view {
    --lm93-compose-total-gutter: clamp(40px, 12vw, 560px) !important;
}
html body.task-mail.action-compose #compose-content,
html body.task-mail.action-compose.legalmail-reply-compose #compose-content,
html body.task-mail.action-compose.legalmail-external-compose #compose-content,
html body.task-mail.action-compose.legalmail-external-compose.legalmail-reply-compose #compose-content {
    width: min(1440px, calc(100% - var(--lm93-compose-total-gutter))) !important;
    max-width: none !important;
}
@media screen and (max-width: 768px) {
    html body.task-mail.action-compose #layout-content.legalmail-compose-view {
        --lm93-compose-total-gutter: 0px !important;
    }
    html body.task-mail.action-compose #compose-content,
    html body.task-mail.action-compose.legalmail-reply-compose #compose-content,
    html body.task-mail.action-compose.legalmail-external-compose #compose-content,
    html body.task-mail.action-compose.legalmail-external-compose.legalmail-reply-compose #compose-content {
        width: 100% !important;
    }
}

/* ========================================================================== 
 * LegalMail v94 — fluid incoming-message reader
 * Match the v93 compose/reply geometry: the reader card grows with the actual
 * viewport instead of stopping at 1120px. Wide displays keep proportional
 * side air, while normal desktops use substantially more of the screen.
 * ========================================================================== */
html body.task-mail.action-show #layout-content.yandex-message-view {
    --lm94-reader-total-gutter: clamp(40px, 12vw, 560px) !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

html body.task-mail.action-show #layout-content.yandex-message-view > .content.frame-content {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

html body.task-mail.action-show #message-header,
html body.task-mail.action-show #message-content {
    width: min(1440px, calc(100% - var(--lm94-reader-total-gutter))) !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

/* Keep all reader internals shrinkable so a long address, attachment name or
   HTML newsletter cannot force the card back to a fixed/wider layout. */
html body.task-mail.action-show #message-header > .header,
html body.task-mail.action-show #message-header .header-content,
html body.task-mail.action-show #message-header .header-headers,
html body.task-mail.action-show #message-content .leftcol,
html body.task-mail.action-show #message-content .rightcol,
html body.task-mail.action-show #messagebody,
html body.task-mail.action-show #messagebody .message-htmlpart {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* On a normal desktop use the available column generously. */
@media screen and (min-width: 769px) and (max-width: 1599px) {
    html body.task-mail.action-show #layout-content.yandex-message-view {
        --lm94-reader-total-gutter: clamp(28px, 10vw, 180px) !important;
    }
}

/* Wide monitors get progressively larger margins, matching compose v93. */
@media screen and (min-width: 1600px) and (max-width: 2199px) {
    html body.task-mail.action-show #layout-content.yandex-message-view {
        --lm94-reader-total-gutter: clamp(180px, 12vw, 320px) !important;
    }
}

@media screen and (min-width: 2200px) {
    html body.task-mail.action-show #layout-content.yandex-message-view {
        --lm94-reader-total-gutter: clamp(320px, 18vw, 560px) !important;
    }
}

/* Mobile stays edge-to-edge. */
@media screen and (max-width: 768px) {
    html body.task-mail.action-show #layout-content.yandex-message-view {
        --lm94-reader-total-gutter: 0px !important;
    }
    html body.task-mail.action-show #message-header,
    html body.task-mail.action-show #message-content {
        width: 100% !important;
        max-width: none !important;
    }
}

/* ========================================================================== 
 * LegalMail v95 — small UI polish requested after v94
 * 1) exact centering for the compact Compose glyph in the dark app rail;
 * 2) prominent yellow sidebar Compose button matching the Reply primary action;
 * 3) Logout keeps only the power glyph red; hover uses the same neutral rail
 *    surface as the other app buttons.
 * ========================================================================== */

/* Compact rail Compose: Elastic's generic icon rules use float/line-height and
   can leave the pencil a few pixels off-center. Make the pseudo-icon occupy the
   entire 42x42 hit area and center the glyph geometrically. */
body.task-mail #taskmenu > span.action-buttons > a.compose {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    text-align: center !important;
}
body.task-mail #taskmenu > span.action-buttons > a.compose::before {
    position: absolute !important;
    inset: 0 !important;
    float: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    text-align: center !important;
    transform: none !important;
}
body.task-mail #taskmenu > span.action-buttons > a.compose > .inner {
    display: none !important;
}

/* Sidebar “Написать”: use the same primary yellow language as Reply/Send. */
body.task-mail .yandex-compose-button,
html.dark-mode body.task-mail .yandex-compose-button {
    border: 1px solid #efbd00 !important;
    background: #ffcc00 !important;
    color: #17191c !important;
    -webkit-text-fill-color: #17191c !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 1px rgba(0,0,0,.05) !important;
}
body.task-mail .yandex-compose-button:hover,
body.task-mail .yandex-compose-button:focus-visible,
html.dark-mode body.task-mail .yandex-compose-button:hover,
html.dark-mode body.task-mail .yandex-compose-button:focus-visible {
    border-color: #efbd00 !important;
    background: #ffd633 !important;
    color: #111315 !important;
    -webkit-text-fill-color: #111315 !important;
    box-shadow: 0 5px 14px rgba(226,173,0,.18) !important;
    outline: 0 !important;
}
body.task-mail .yandex-compose-button:active,
html.dark-mode body.task-mail .yandex-compose-button:active {
    background: #f5c400 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.08) !important;
    transform: translateY(1px) !important;
}

/* Logout: neutral hover surface like Mail/Contacts/Settings. Only the power
   glyph remains red; do not paint the whole button red/pink on hover. */
body.task-mail #taskmenu a.logout,
body.task-addressbook #taskmenu a.logout,
body.task-settings #taskmenu a.logout {
    color: #c8cbd1 !important;
    -webkit-text-fill-color: #c8cbd1 !important;
    background: transparent !important;
}
body.task-mail #taskmenu a.logout::before,
body.task-addressbook #taskmenu a.logout::before,
body.task-settings #taskmenu a.logout::before,
body.task-mail #taskmenu a.logout .inner::before,
body.task-addressbook #taskmenu a.logout .inner::before,
body.task-settings #taskmenu a.logout .inner::before {
    color: #ef8f8f !important;
    -webkit-text-fill-color: #ef8f8f !important;
    fill: #ef8f8f !important;
}
body.task-mail #taskmenu a.logout:hover,
body.task-mail #taskmenu a.logout:focus-visible,
body.task-addressbook #taskmenu a.logout:hover,
body.task-addressbook #taskmenu a.logout:focus-visible,
body.task-settings #taskmenu a.logout:hover,
body.task-settings #taskmenu a.logout:focus-visible {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: rgba(255,255,255,.12) !important;
    outline: 0 !important;
}
body.task-mail #taskmenu a.logout:hover::before,
body.task-mail #taskmenu a.logout:focus-visible::before,
body.task-addressbook #taskmenu a.logout:hover::before,
body.task-addressbook #taskmenu a.logout:focus-visible::before,
body.task-settings #taskmenu a.logout:hover::before,
body.task-settings #taskmenu a.logout:focus-visible::before {
    color: #ef8f8f !important;
    -webkit-text-fill-color: #ef8f8f !important;
    fill: #ef8f8f !important;
}

/* ========================================================================== 
 * LegalMail v96 — unified blue toast accent
 * All Roundcube push/status toasts use the LegalMail blue accent on the left.
 * Semantic icon colors remain intact; only the vertical accent is unified.
 * ========================================================================== */
#messagestack > div:not(.voice)::after,
#messagestack .alert-success::after,
#messagestack .alert-info::after,
#messagestack .alert-info.information::after,
#messagestack .alert-warning::after,
#messagestack .alert-danger::after,
#messagestack .loading::after,
#messagestack .uploading::after {
    width: 5px !important;
    background: #3b8fc5 !important;
    box-shadow: 2px 0 8px rgba(59,143,197,.16) !important;
}
html.dark-mode #messagestack > div:not(.voice)::after,
html.dark-mode #messagestack .alert-success::after,
html.dark-mode #messagestack .alert-info::after,
html.dark-mode #messagestack .alert-warning::after,
html.dark-mode #messagestack .alert-danger::after,
html.dark-mode #messagestack .loading::after,
html.dark-mode #messagestack .uploading::after {
    background: #59aee0 !important;
    box-shadow: 2px 0 9px rgba(89,174,224,.22) !important;
}


/* ========================================================================== 
 * LegalMail v97 — browser-width subject/snippet flow + answered-state icon
 * Subject keeps its natural width. The body snippet receives only the space
 * that is actually left; when the subject itself fills the row, the snippet
 * collapses to zero instead of forcing the subject into an artificial 48/64%
 * column. Answered/forwarded state is painted in the existing 16px status lane.
 * ========================================================================== */
@media screen and (min-width: 769px) {
    body.task-mail.action-none .messagelist tr.legalmail-row-normalized.legalmail-yandex-v79 .legalmail-yandex-content .legalmail-yandex-subject {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-row-normalized.legalmail-yandex-v79 .legalmail-yandex-content .legalmail-yandex-preview,
    body.task-mail.action-none .messagelist tr.legalmail-row-normalized.legalmail-yandex-v79 .legalmail-yandex-content .legalmail-yandex-preview:empty {
        display: block !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        max-width: none !important;
        margin-left: 0 !important;
    }

    /* A replied/forwarded marker occupies the same compact lane as Yandex's
       read-state/action indicator, so it does not steal width from the subject. */
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-read.has-message-action::before {
        display: block !important;
        width: 16px !important;
        min-width: 16px !important;
        height: 40px !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        color: #8f969d !important;
        font-family: Icons !important;
        font-size: 14px !important;
        font-style: normal !important;
        font-weight: 900 !important;
        line-height: 40px !important;
        text-align: center !important;
        -webkit-font-smoothing: antialiased !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-read.has-replied::before {
        content: "\f3e5" !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-read.has-forwarded:not(.has-replied)::before {
        content: "\f064" !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:hover .legalmail-yandex-status.is-read.has-message-action::before {
        color: #737b84 !important;
        border: 0 !important;
        background: transparent !important;
    }

    /* Unread remains visually stronger than the history marker: the yellow
       unread dot wins until the message becomes read, then the reply icon shows. */
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-unread.has-message-action::before {
        content: "" !important;
        width: 9px !important;
        min-width: 9px !important;
        height: 9px !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #f4c000 !important;
        color: transparent !important;
        font-size: 0 !important;
        line-height: 9px !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-read.has-message-action::before {
        color: #9aa1aa !important;
    }
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:hover .legalmail-yandex-status.is-read.has-message-action::before {
        color: #c1c6cc !important;
    }
}


/* ==========================================================================
 * LegalMail v98 — fixed reply lane + eager/steady row preview geometry
 * The history arrow owns its own 16px lane immediately BEFORE the read-state
 * circle. The lane is reserved on every row, so subjects never shift between
 * replied and ordinary messages. Body-preview loading is handled in JS.
 * ========================================================================== */
@media screen and (min-width: 769px) {
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row {
        grid-template-columns: 30px clamp(156px, 16vw, 220px) 16px 16px minmax(0, 1fr) minmax(58px, max-content) !important;
        grid-template-areas: "avatar sender action status content date" !important;
        column-gap: 8px !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-action {
        grid-area: action !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 16px !important;
        min-width: 16px !important;
        max-width: 16px !important;
        height: 40px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
        pointer-events: none !important;
        color: #8f969d !important;
        font-family: Icons !important;
        font-style: normal !important;
        font-weight: 900 !important;
        font-size: 14px !important;
        line-height: 40px !important;
        text-align: center !important;
        -webkit-font-smoothing: antialiased !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-action::before {
        content: "" !important;
        display: block !important;
        width: 16px !important;
        min-width: 16px !important;
        height: 40px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        color: inherit !important;
        font: inherit !important;
        line-height: 40px !important;
        text-align: center !important;
        transform: none !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-action.has-replied::before {
        content: "\f3e5" !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-action.has-forwarded:not(.has-replied)::before {
        content: "\f064" !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:hover .legalmail-yandex-action.has-message-action {
        color: #737b84 !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.has-message-action::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.has-replied::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.has-forwarded::before {
        content: "" !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-action {
        color: #9aa1aa !important;
    }
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:hover .legalmail-yandex-action.has-message-action {
        color: #c1c6cc !important;
    }
}


/* ==========================================================================
 * LegalMail v99 — answered arrow BEFORE read circle, answered-only
 * Force the indicator order with explicit grid columns (not named-area auto
 * placement), reserve the arrow lane on every row for perfect alignment, and
 * suppress Roundcube's native reply/forward glyph so it cannot appear after
 * the read-state circle.
 * ========================================================================== */
@media screen and (min-width: 769px) {
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row {
        grid-template-columns: 30px clamp(156px, 16vw, 220px) 16px 16px minmax(0, 1fr) minmax(58px, max-content) !important;
        grid-template-areas: none !important;
        column-gap: 8px !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar {
        grid-area: auto !important;
        grid-column: 1 !important;
        grid-row: 1 !important;
    }
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-sender {
        grid-area: auto !important;
        grid-column: 2 !important;
        grid-row: 1 !important;
    }
    /* Arrow lane: always reserved, but the glyph exists ONLY for answered mail. */
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-action {
        grid-area: auto !important;
        grid-column: 3 !important;
        grid-row: 1 !important;
    }
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status {
        grid-area: auto !important;
        grid-column: 4 !important;
        grid-row: 1 !important;
    }
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content {
        grid-area: auto !important;
        grid-column: 5 !important;
        grid-row: 1 !important;
    }
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-date {
        grid-area: auto !important;
        grid-column: 6 !important;
        grid-row: 1 !important;
    }

    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-action::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-action.has-forwarded::before,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-action.has-forwarded:not(.has-replied)::before {
        content: "" !important;
    }
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-action.has-replied::before {
        content: "\f3e5" !important;
    }

    /* Native Roundcube history glyphs stay in DOM for state detection, but are
       never painted. This prevents a second arrow from appearing after the dot. */
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject span.msgicon.replied,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject span.msgicon.answered,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject span.msgicon.forwarded,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject span.replied:not(.legalmail-yandex-action),
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject span.answered:not(.legalmail-yandex-action),
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject span.forwarded:not(.legalmail-yandex-action),
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.status span.replied,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.status span.answered,
    body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.status span.forwarded {
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* ========================================================================== 
 * LegalMail v100 — answered arrow visibly BEFORE the read/unread circle
 *
 * v99 already reserved two independent 16px lanes, but a read message hides
 * its circle at rest.  That made an answered row LOOK as if the arrow occupied
 * the circle slot.  Keep the same geometry and force a quiet hollow read ring
 * to remain visible on answered rows: [arrow] [circle] [subject].
 * Ordinary read rows keep the existing Yandex-like behavior; unread rows keep
 * the yellow dot.  The arrow still appears only for the real Answered flag.
 * ========================================================================== */
@media screen and (min-width: 769px) {
    /* Lock the visual order even against older cached/nested grid-area rules. */
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-action {
        grid-area: auto !important;
        grid-column: 3 !important;
        grid-row: 1 !important;
        order: 0 !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status {
        grid-area: auto !important;
        grid-column: 4 !important;
        grid-row: 1 !important;
        order: 0 !important;
    }

    /* Answered + READ: always show the hollow circle AFTER the reply arrow. */
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79
        .legalmail-yandex-action.has-replied + .legalmail-yandex-status.is-read::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:not(.unread):not([data-legalmail-read-state="unread"])
        .legalmail-yandex-action.has-replied + .legalmail-yandex-status::before {
        content: "" !important;
        display: block !important;
        box-sizing: border-box !important;
        width: 10px !important;
        min-width: 10px !important;
        height: 10px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 2px solid #8f969d !important;
        border-radius: 50% !important;
        background: transparent !important;
        box-shadow: none !important;
        color: transparent !important;
        font-size: 0 !important;
        line-height: 0 !important;
    }

    /* Answered + UNREAD: the same status lane remains the normal yellow dot. */
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79
        .legalmail-yandex-action.has-replied + .legalmail-yandex-status.is-unread::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.unread
        .legalmail-yandex-action.has-replied + .legalmail-yandex-status::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79[data-legalmail-read-state="unread"]
        .legalmail-yandex-action.has-replied + .legalmail-yandex-status::before {
        content: "" !important;
        display: block !important;
        width: 9px !important;
        min-width: 9px !important;
        height: 9px !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #f4c000 !important;
        box-shadow: none !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:not(.unread)
        .legalmail-yandex-action.has-replied + .legalmail-yandex-status::before {
        border-color: #9aa1aa !important;
    }
}


/* ========================================================================== 
 * LegalMail v101 — Yandex-exact status / replied / subject flow
 *
 * Visual states copied from the supplied Yandex examples:
 *   read, idle       : [blank status] [reply if Answered] Subject
 *   read, hover      : [hollow ring]  [reply if Answered] Subject
 *   unread           : [yellow dot]   [reply if Answered] Subject
 *
 * Crucially, the reply icon is NOT a permanently reserved grid column. It is
 * an inline flex item inside the content line. When absent, Subject begins at
 * the normal content edge; when present, the icon + 8px gap pushes Subject to
 * the right exactly like Yandex. The status marker always remains before it.
 * ========================================================================== */
@media screen and (min-width: 769px) {
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row {
        grid-template-columns: 30px clamp(156px, 16vw, 220px) 16px minmax(0, 1fr) minmax(58px, max-content) !important;
        grid-template-areas: "avatar sender status content date" !important;
        column-gap: 8px !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar {
        grid-area: avatar !important;
        grid-column: 1 !important;
        grid-row: 1 !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-sender {
        grid-area: sender !important;
        grid-column: 2 !important;
        grid-row: 1 !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status {
        grid-area: status !important;
        grid-column: 3 !important;
        grid-row: 1 !important;
        order: 0 !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content {
        grid-area: content !important;
        grid-column: 4 !important;
        grid-row: 1 !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-date {
        grid-area: date !important;
        grid-column: 5 !important;
        grid-row: 1 !important;
    }

    /* No Answered flag = no element width and no flex gap. This is what makes
       the reply glyph itself move `Re:` instead of all rows having a fake lane. */
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content > .legalmail-yandex-action {
        grid-area: auto !important;
        grid-column: auto !important;
        grid-row: auto !important;
        display: none !important;
        flex: 0 0 16px !important;
        width: 16px !important;
        min-width: 16px !important;
        max-width: 16px !important;
        height: 40px !important;
        margin: 0 !important;
        padding: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        color: #969ba1 !important;
        font-family: Icons !important;
        font-style: normal !important;
        font-weight: 900 !important;
        font-size: 14px !important;
        line-height: 40px !important;
        text-align: center !important;
        pointer-events: none !important;
        overflow: visible !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content > .legalmail-yandex-action::before {
        content: "" !important;
        display: block !important;
        width: 16px !important;
        height: 40px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        color: inherit !important;
        font: inherit !important;
        line-height: 40px !important;
        text-align: center !important;
        transform: none !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content > .legalmail-yandex-action.has-replied {
        display: flex !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content > .legalmail-yandex-action.has-replied::before {
        content: "\f3e5" !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:hover .legalmail-yandex-content > .legalmail-yandex-action.has-replied {
        color: #8d9298 !important;
    }

    /* Yandex read marker states. A replied READ row does NOT force a circle at
       rest; the hollow circle appears only on hover. */
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:not(.unread):not([data-legalmail-read-state="unread"]) .legalmail-yandex-status::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-read::before {
        content: "" !important;
        display: block !important;
        box-sizing: border-box !important;
        width: 0 !important;
        min-width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:not(.unread):not([data-legalmail-read-state="unread"]):hover .legalmail-yandex-status::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:hover .legalmail-yandex-status.is-read::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-read:hover::before {
        content: "" !important;
        display: block !important;
        box-sizing: border-box !important;
        width: 10px !important;
        min-width: 10px !important;
        height: 10px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 2px solid #8f969d !important;
        border-radius: 50% !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.unread .legalmail-yandex-status::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.unread:hover .legalmail-yandex-status::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79[data-legalmail-read-state="unread"] .legalmail-yandex-status::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79[data-legalmail-read-state="unread"]:hover .legalmail-yandex-status::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-unread::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-unread:hover::before {
        content: "" !important;
        display: block !important;
        box-sizing: border-box !important;
        width: 9px !important;
        min-width: 9px !important;
        height: 9px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #f4c000 !important;
        box-shadow: none !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content > .legalmail-yandex-action.has-replied {
        color: #9aa1aa !important;
    }
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:not(.unread):hover .legalmail-yandex-status::before,
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-read:hover::before {
        border-color: #9aa1aa !important;
    }
}


/* ========================================================================== 
 * LegalMail v106 — faster preview prefetch + Yandex-style "Отвечено" hint
 * The replied glyph remains an inline item before Subject. Only genuinely
 * Answered rows receive pointer events / tooltip behavior.
 * ========================================================================== */
@media screen and (min-width: 769px) {
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79
        .legalmail-yandex-content > .legalmail-yandex-action.has-replied {
        pointer-events: auto !important;
        cursor: default !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79
        .legalmail-yandex-content > .legalmail-yandex-action:not(.has-replied) {
        pointer-events: none !important;
    }
}

#legalmail-reply-tooltip-v106 {
    position: fixed !important;
    z-index: 2147483000 !important;
    left: 0;
    top: 0;
    display: block;
    box-sizing: border-box;
    max-width: 180px;
    padding: 6px 9px;
    border: 0;
    border-radius: 5px;
    background: rgba(45, 48, 52, 0.96);
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 2px));
    transition: opacity 80ms linear, visibility 80ms linear;
}
#legalmail-reply-tooltip-v106.is-visible {
    opacity: 1;
    visibility: visible;
}
#legalmail-reply-tooltip-v106::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 8px;
    height: 8px;
    background: inherit;
    transform: translateX(-50%) rotate(45deg);
}

/* ========================================================================== 
 * LegalMail v106 — table-cell geometry + reliable replied tooltip
 * Keep the native message table a real table.  Elastic makes td.subject flex;
 * with the absolute LegalMail row this causes the 1px row divider to land on a
 * different raster line at cell boundaries.  Revert Subject to table-cell and
 * draw one identical bottom divider on every cell.
 * ========================================================================== */
@media screen and (min-width: 769px) {
    html body.task-mail.action-none table.messagelist {
        border-collapse: collapse !important;
        border-spacing: 0 !important;
    }

    html body.task-mail.action-none .messagelist tbody tr,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 {
        height: 40px !important;
        min-height: 40px !important;
    }

    html body.task-mail.action-none .messagelist tbody tr > td,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td {
        box-sizing: border-box !important;
        height: 40px !important;
        min-height: 40px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        vertical-align: middle !important;
        border-top: 0 !important;
        border-left: 0 !important;
        border-right: 0 !important;
        border-bottom: 1px solid #eef0f2 !important;
        background-clip: padding-box !important;
    }

    /* Critical fix: do not let Elastic's display:flex on TD split the row
       baseline/divider.  The LegalMail overlay itself remains grid/flex. */
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td.subject {
        display: table-cell !important;
        position: relative !important;
        width: 100% !important;
        height: 40px !important;
        min-height: 40px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        vertical-align: middle !important;
        line-height: normal !important;
        overflow: visible !important;
    }

    /* Checkbox and the first painted message content share one exact 40px
       center line, so the left edge no longer looks a pixel lower/higher. */
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td.selection {
        height: 40px !important;
        min-height: 40px !important;
        line-height: 40px !important;
        vertical-align: middle !important;
    }
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td.selection > input[type="checkbox"] {
        display: inline-block !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        vertical-align: middle !important;
    }

    /* Old status/priority cells are zero-width but must still participate in
       the same bottom divider; otherwise a tiny notch appears in the line. */
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td.status,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td.priority {
        border-bottom: 1px solid #eef0f2 !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist tbody tr > td,
    html.dark-mode body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td,
    html.dark-mode body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td.status,
    html.dark-mode body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td.priority {
        border-bottom-color: #35393f !important;
    }

    /* Give the replied glyph a real hit box above the row content. */
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79
        .legalmail-yandex-content > .legalmail-yandex-action.has-replied {
        position: relative !important;
        z-index: 7 !important;
        pointer-events: auto !important;
        cursor: default !important;
    }
}

#legalmail-reply-tooltip-v106 {
    transform: translate(-50%, calc(-100% - 2px)) !important;
}
#legalmail-reply-tooltip-v106.is-below {
    transform: translate(-50%, 0) !important;
}
#legalmail-reply-tooltip-v106.is-below::after {
    top: -4px !important;
    bottom: auto !important;
}

/* ========================================================================== 
 * LegalMail v106 — restore compact 40px rows without reintroducing divider skew
 *
 * v103 forced td.subject back to display:table-cell. That made the native
 * (hidden but still layout-participating) Roundcube subject/from/date spans
 * stack/wrap and could inflate a message row far beyond 40px.  The LegalMail
 * renderer was designed around the Elastic/grid subject cell, so restore that
 * geometry and paint the separator with an inset shadow on each 40px cell.
 * This keeps the checkbox divider aligned while every message stays compact.
 * ========================================================================== */
@media screen and (min-width: 769px) {
    html body.task-mail.action-none table.messagelist {
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    html body.task-mail.action-none .messagelist tbody tr,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 {
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
    }

    html body.task-mail.action-none .messagelist tbody tr > td,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td {
        box-sizing: border-box !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        vertical-align: middle !important;
        border-top: 0 !important;
        border-bottom: 0 !important;
        box-shadow: inset 0 -1px 0 #eef0f2 !important;
    }

    /* Critical v106 correction: keep Subject on the compact grid layout.
       Do NOT use table-cell here: invisible native spans still consume layout
       and can make the table algorithm expand the entire row. */
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td.subject {
        display: grid !important;
        grid-template-columns: 22px minmax(150px, 28%) minmax(0, 1fr) max-content !important;
        grid-template-rows: 40px !important;
        align-items: center !important;
        position: relative !important;
        width: 100% !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        vertical-align: middle !important;
        line-height: 40px !important;
        white-space: nowrap !important;
        overflow: visible !important;
    }

    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td.subject > span:not(.legalmail-yandex-row):not(.attachment),
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td.subject > a:not(.attachment) {
        max-height: 40px !important;
    }

    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td.selection,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td.flags,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td.threads {
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        line-height: 40px !important;
        vertical-align: middle !important;
    }

    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td.selection > input[type="checkbox"] {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        vertical-align: middle !important;
    }

    /* Keep the 40px overlay as the only visible row surface. */
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-sender,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-date,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content > .legalmail-yandex-action {
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        line-height: 40px !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist tbody tr > td,
    html.dark-mode body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td {
        box-shadow: inset 0 -1px 0 #35393f !important;
    }
}

/* ========================================================================== 
 * LegalMail v106 — Yandex-like tablet / narrow-browser split layout
 *
 * Elastic switches the whole application to its one-panel "small" mode at
 * <=768px and also applies `html.touch .messagelist tr { display:flex }` all
 * the way up to 1024px.  On a ~700px desktop browser that combination hides
 * the folders pane and collapses native message cells into the garbled line
 * shown in the report.  v106 keeps a real two-pane mail workspace from 600px
 * through 768px: app rail + folders + a shrinkable message list.  Phones keep
 * Elastic's original one-panel behavior.
 * ========================================================================== */
@media screen and (min-width: 600px) and (max-width: 768px) {
    html body.task-mail.action-none #layout {
        display: flex !important;
        flex-flow: row nowrap !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    html body.task-mail.action-none #layout-menu {
        display: block !important;
        flex: 0 0 42px !important;
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
    }

    /* The folders column follows Yandex's tablet proportions.  It narrows a
       little near 600px but never disappears just because the browser is under
       Elastic's old 768px breakpoint. */
    html body.task-mail.action-none #layout-sidebar,
    html body.task-mail.action-none #layout-sidebar.hidden {
        display: flex !important;
        flex: 0 0 clamp(218px, 34vw, 245px) !important;
        width: clamp(218px, 34vw, 245px) !important;
        min-width: 218px !important;
        max-width: 245px !important;
        border-right: 1px solid #e2e5e8 !important;
        overflow: hidden !important;
    }

    html body.task-mail.action-none #layout-list,
    html body.task-mail.action-none #layout-list.hidden {
        display: flex !important;
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        border-right: 0 !important;
        overflow: hidden !important;
    }

    /* The list screen has no live reading pane in LegalMail, so never let the
       hidden native content frame consume narrow-browser width. */
    html body.task-mail.action-none #layout-content,
    html body.task-mail.action-none #layout-content.legalmail-native-preview {
        display: none !important;
        flex: 0 0 0 !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
    }

    /* Folders are already visible in split mode, therefore mobile back/menu
       buttons are redundant and only steal space from the list toolbar. */
    html body.task-mail.action-none #messagelist-header .task-menu-button,
    html body.task-mail.action-none #messagelist-header .back-sidebar-button {
        display: none !important;
    }

    html body.task-mail.action-none #layout-sidebar > .header.yandex-sidebar-header {
        height: 56px !important;
        min-height: 56px !important;
        line-height: 56px !important;
        padding-inline: 10px !important;
    }

    html body.task-mail.action-none .yandex-compose-wrap {
        padding: 4px 8px 9px !important;
    }

    html body.task-mail.action-none .yandex-compose-button {
        min-width: 0 !important;
    }

    html body.task-mail.action-none #layout-list > .legalmail-search-row {
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
        gap: 7px !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 58px !important;
        min-height: 58px !important;
        flex-basis: 58px !important;
        padding: 7px 8px !important;
    }

    html body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    html body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form {
        width: 100% !important;
        min-width: 0 !important;
        height: 42px !important;
    }

    html body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot {
        flex: 0 0 36px !important;
        width: 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
    }

    html body.task-mail.action-none #messagelist-header.yandex-list-toolbar {
        box-sizing: border-box !important;
        height: 44px !important;
        min-height: 44px !important;
        line-height: 44px !important;
        padding-inline: 7px !important;
        overflow: hidden !important;
    }

    html body.task-mail.action-none #messagelist-content {
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    /* Undo Elastic's `html.touch tr { display:flex }`.  That rule is the main
       reason narrow desktop rows turn into a sequence of unrelated cells. */
    html.touch body.task-mail.action-none table.messagelist,
    html body.task-mail.action-none table.messagelist {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    html.touch body.task-mail.action-none .messagelist tbody tr,
    html body.task-mail.action-none .messagelist tbody tr,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 {
        position: relative !important;
        display: table-row !important;
        box-sizing: border-box !important;
        width: 100% !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
    }

    html body.task-mail.action-none .messagelist tbody tr > td {
        box-sizing: border-box !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        vertical-align: middle !important;
        border: 0 !important;
        box-shadow: inset 0 -1px 0 #eef0f2 !important;
    }

    html body.task-mail.action-none .messagelist tbody tr > td.selection {
        display: table-cell !important;
        width: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;
        padding: 0 5px !important;
        line-height: 48px !important;
        text-align: center !important;
        overflow: hidden !important;
    }

    html body.task-mail.action-none .messagelist tbody tr > td.selection input[type="checkbox"] {
        margin: 0 !important;
        vertical-align: middle !important;
    }

    /* Native touch-only columns are deliberately removed.  Their information
       is already represented by the LegalMail overlay and leaving them visible
       is what produced the `F | • P...` fragments in the broken screenshot. */
    html body.task-mail.action-none .messagelist tbody tr > td.threads,
    html body.task-mail.action-none .messagelist tbody tr > td.flags,
    html body.task-mail.action-none .messagelist tbody tr > td.status,
    html body.task-mail.action-none .messagelist tbody tr > td.priority {
        display: none !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    html.touch body.task-mail.action-none .messagelist tbody tr > td.subject,
    html body.task-mail.action-none .messagelist tbody tr > td.subject {
        position: relative !important;
        display: table-cell !important;
        width: auto !important;
        min-width: 0 !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        padding: 0 !important;
        line-height: normal !important;
        vertical-align: middle !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }

    /* Native Subject/Sender/Date/status nodes stay in the DOM for Roundcube
       commands, but unlike v103 they are `display:none`, so table-cell geometry
       cannot make a row grow vertically. */
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > span.fromto,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > span.subject:not(.legalmail-yandex-subject),
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > span.date:not(.legalmail-yandex-date),
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > span.status:not(.legalmail-yandex-status),
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > span.msgicon:not(.attachment),
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > span.size {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* A single coherent row, scaled for the 310–480px list column that remains
       next to the folders pane. */
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row {
        position: absolute !important;
        z-index: 2 !important;
        inset: 0 !important;
        display: grid !important;
        grid-template-columns: 28px minmax(88px, 30%) 12px minmax(0, 1fr) 48px !important;
        grid-template-areas: "avatar sender status content date" !important;
        align-items: center !important;
        column-gap: 6px !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        padding: 0 7px 0 2px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        background: transparent !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.legalmail-has-attachment .legalmail-yandex-row {
        padding-right: 25px !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar {
        grid-area: avatar !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 28px !important;
        min-width: 28px !important;
        max-width: 28px !important;
        height: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        color: #fff !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        line-height: 28px !important;
        text-align: center !important;
        overflow: hidden !important;
        pointer-events: none !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-sender {
        grid-area: sender !important;
        min-width: 0 !important;
        height: 48px !important;
        line-height: 48px !important;
        color: #30343a !important;
        font-size: 12.5px !important;
        font-weight: 500 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status {
        grid-area: status !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 12px !important;
        min-width: 12px !important;
        max-width: 12px !important;
        height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        cursor: pointer !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:not(.unread):not([data-legalmail-read-state="unread"]) .legalmail-yandex-status::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-read::before {
        content: "" !important;
        display: block !important;
        box-sizing: border-box !important;
        width: 0 !important;
        min-width: 0 !important;
        height: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: transparent !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:not(.unread):not([data-legalmail-read-state="unread"]):hover .legalmail-yandex-status::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:hover .legalmail-yandex-status.is-read::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-read:hover::before {
        content: "" !important;
        display: block !important;
        box-sizing: border-box !important;
        width: 9px !important;
        min-width: 9px !important;
        height: 9px !important;
        border: 2px solid #8f969d !important;
        border-radius: 50% !important;
        background: transparent !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.unread .legalmail-yandex-status::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79[data-legalmail-read-state="unread"] .legalmail-yandex-status::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-unread::before {
        content: "" !important;
        display: block !important;
        width: 8px !important;
        min-width: 8px !important;
        height: 8px !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #f4c000 !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content {
        grid-area: content !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 48px !important;
        line-height: 48px !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    /* Answered is still sourced only from the real Roundcube/IMAP Answered
       state in JS.  The icon is inline, so it pushes `Re:` to the right just
       like Yandex instead of reserving a blank arrow column on every row. */
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content > .legalmail-yandex-action {
        display: none !important;
        flex: 0 0 14px !important;
        width: 14px !important;
        min-width: 14px !important;
        max-width: 14px !important;
        height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        color: #969ba1 !important;
        font-family: Icons !important;
        font-size: 13px !important;
        font-style: normal !important;
        font-weight: 900 !important;
        line-height: 48px !important;
        text-align: center !important;
        overflow: visible !important;
        pointer-events: none !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content > .legalmail-yandex-action::before {
        content: "" !important;
        display: block !important;
        width: 14px !important;
        height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        color: inherit !important;
        font: inherit !important;
        line-height: 48px !important;
        text-align: center !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content > .legalmail-yandex-action.has-replied {
        display: flex !important;
        pointer-events: auto !important;
        cursor: default !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content > .legalmail-yandex-action.has-replied::before {
        content: "\f3e5" !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-subject {
        display: block !important;
        flex: 0 1 auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 48px !important;
        line-height: 48px !important;
        color: #24282e !important;
        font-size: 12.5px !important;
        font-weight: 500 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-preview,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-preview:empty {
        display: block !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 48px !important;
        margin-left: 0 !important;
        line-height: 48px !important;
        color: #8a9098 !important;
        font-size: 12px !important;
        font-weight: 400 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-date {
        grid-area: date !important;
        min-width: 0 !important;
        width: 48px !important;
        max-width: 48px !important;
        height: 48px !important;
        padding: 0 !important;
        line-height: 48px !important;
        color: #858c95 !important;
        font-size: 11.5px !important;
        font-weight: 400 !important;
        text-align: right !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.unread .legalmail-yandex-sender,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.unread .legalmail-yandex-subject {
        color: #202328 !important;
        font-weight: 700 !important;
    }

    /* Keep a small paperclip hit area without giving the old flags cell back
       its own column. */
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > span.attachment,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > a.attachment {
        position: absolute !important;
        z-index: 5 !important;
        display: block !important;
        right: 49px !important;
        top: 0 !important;
        width: 20px !important;
        height: 48px !important;
        line-height: 48px !important;
        overflow: hidden !important;
    }

    html.dark-mode body.task-mail.action-none #layout-sidebar {
        border-right-color: #34383e !important;
    }
    html.dark-mode body.task-mail.action-none .messagelist tbody tr > td {
        box-shadow: inset 0 -1px 0 #35393f !important;
    }
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-sender,
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-subject {
        color: #f1f1f3 !important;
    }
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-preview,
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-date {
        color: #969ca5 !important;
    }
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:not(.unread):hover .legalmail-yandex-status::before,
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-read:hover::before {
        border-color: #9aa1aa !important;
    }
}

/* At the very bottom of the split range preserve useful subject space by
   letting the sender tighten before anything else disappears. */
@media screen and (min-width: 600px) and (max-width: 660px) {
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row {
        grid-template-columns: 26px minmax(76px, 27%) 11px minmax(0, 1fr) 42px !important;
        column-gap: 5px !important;
        padding-inline: 2px 5px !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar {
        width: 26px !important;
        min-width: 26px !important;
        max-width: 26px !important;
        height: 26px !important;
        min-height: 26px !important;
        max-height: 26px !important;
        line-height: 26px !important;
        font-size: 9px !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-date {
        width: 42px !important;
        max-width: 42px !important;
        font-size: 11px !important;
    }
}

/* ========================================================================== 
 * LegalMail v107 — persistent Yandex-style mail columns
 *
 * The left app rail and folder pane are structural columns, not responsive
 * decorations.  From 600px upward they keep their normal desktop widths and
 * never collapse/disappear.  Only the message list receives the remaining
 * viewport width and its text truncates naturally, matching Yandex Mail's
 * narrow-browser behavior.
 * ========================================================================== */
@media screen and (min-width: 600px) and (max-width: 1200px) {
    html body.task-mail.action-none {
        background:
            radial-gradient(circle at 14% 10%, rgba(196, 210, 225, .60), transparent 34%),
            radial-gradient(circle at 88% 90%, rgba(232, 216, 202, .55), transparent 38%),
            linear-gradient(135deg, var(--lm71-bg-a), var(--lm71-bg-b)) !important;
    }

    html body.task-mail.action-none #layout {
        box-sizing: border-box !important;
        display: flex !important;
        flex-flow: row nowrap !important;
        gap: 10px !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 10px !important;
        overflow: hidden !important;
        background: transparent !important;
    }

    /* Keep the application rail exactly desktop-sized. */
    html body.task-mail.action-none #layout-menu {
        display: flex !important;
        flex: 0 0 58px !important;
        width: 58px !important;
        min-width: 58px !important;
        max-width: 58px !important;
        overflow: hidden !important;
        border: 0 !important;
        border-radius: 18px !important;
        background: linear-gradient(180deg, #292b31, #1f2025) !important;
        box-shadow: var(--lm71-shadow) !important;
    }

    html body.task-mail.action-none #layout-menu .popover-header,
    html body.task-mail.action-none #taskmenu .special-buttons {
        width: 58px !important;
        min-width: 58px !important;
        max-width: 58px !important;
        background: transparent !important;
        border: 0 !important;
    }

    html body.task-mail.action-none #layout-menu .popover-header {
        height: 56px !important;
        min-height: 56px !important;
        line-height: 56px !important;
    }

    html body.task-mail.action-none #layout-menu .popover-header img {
        width: 34px !important;
        height: 34px !important;
        max-width: 34px !important;
        max-height: 34px !important;
    }

    html body.task-mail.action-none #taskmenu > a,
    html body.task-mail.action-none #taskmenu > span > a {
        box-sizing: border-box !important;
        flex: 0 0 42px !important;
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        margin: 3px 8px !important;
        padding: 0 !important;
        border-radius: 13px !important;
    }

    html body.task-mail.action-none #taskmenu a::before {
        float: none !important;
        display: block !important;
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 42px !important;
        text-align: center !important;
    }

    /* Folder pane never turns into a hidden/mobile panel in this range. */
    html body.task-mail.action-none #layout-sidebar,
    html body.task-mail.action-none #layout-sidebar.hidden {
        position: relative !important;
        display: flex !important;
        flex: 0 0 238px !important;
        flex-direction: column !important;
        width: 238px !important;
        min-width: 238px !important;
        max-width: 238px !important;
        height: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        border: 1px solid rgba(255,255,255,.80) !important;
        border-radius: var(--lm71-radius) !important;
        box-shadow: var(--lm71-shadow) !important;
        overflow: hidden !important;
        background: var(--lm71-panel) !important;
    }

    html body.task-mail.action-none #layout-sidebar > .header.yandex-sidebar-header {
        box-sizing: border-box !important;
        flex: 0 0 58px !important;
        height: 58px !important;
        min-height: 58px !important;
        line-height: 58px !important;
        padding: 0 12px !important;
    }

    /* legalmail.css used to hide Compose below 1200px. Yandex keeps it. */
    html body.task-mail.action-none .yandex-compose-wrap {
        display: block !important;
        flex: 0 0 auto !important;
        padding: 4px 10px 10px !important;
    }

    html body.task-mail.action-none .yandex-compose-row {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
    }

    html body.task-mail.action-none .yandex-compose-button {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        height: 42px !important;
    }

    html body.task-mail.action-none .yandex-refresh-button {
        flex: 0 0 42px !important;
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        height: 42px !important;
    }

    /* The inbox is the only flexible column. It is allowed to become narrow,
       while its internal text ellipsizes instead of collapsing other blocks. */
    html body.task-mail.action-none #layout-list,
    html body.task-mail.action-none #layout-list.hidden {
        display: flex !important;
        flex: 1 1 0 !important;
        flex-direction: column !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        border: 1px solid rgba(255,255,255,.80) !important;
        border-radius: var(--lm71-radius) !important;
        box-shadow: var(--lm71-shadow) !important;
        overflow: hidden !important;
        background: var(--lm71-panel) !important;
    }

    html body.task-mail.action-none #layout-content,
    html body.task-mail.action-none #layout-content.legalmail-native-preview {
        display: none !important;
        flex: 0 0 0 !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
    }

    /* Folders are already visible, so mobile pane-navigation controls must not
       consume any of the message-list toolbar. */
    html body.task-mail.action-none #messagelist-header .task-menu-button,
    html body.task-mail.action-none #messagelist-header .back-sidebar-button {
        display: none !important;
    }

    html body.task-mail.action-none #messagelist-content {
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    html body.task-mail.action-none table.messagelist {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed !important;
    }

    html.dark-mode body.task-mail.action-none #layout-sidebar,
    html.dark-mode body.task-mail.action-none #layout-list {
        border-color: #34383e !important;
        background: #1b1b1f !important;
    }
}

/* 600–768px used to shrink the rail, folder pane, avatars and row height.
   Keep the same desktop row geometry instead; only text is truncated. */
@media screen and (min-width: 600px) and (max-width: 768px) {
    html body.task-mail.action-none .messagelist tbody tr,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 {
        display: table-row !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
    }

    html body.task-mail.action-none .messagelist tbody tr > td,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td {
        box-sizing: border-box !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        vertical-align: middle !important;
        border: 0 !important;
        box-shadow: inset 0 -1px 0 #eef0f2 !important;
    }

    html body.task-mail.action-none .messagelist tbody tr > td.selection {
        display: table-cell !important;
        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
        padding: 0 5px 0 10px !important;
        line-height: 40px !important;
        text-align: center !important;
        overflow: hidden !important;
    }

    html body.task-mail.action-none .messagelist tbody tr > td.threads,
    html body.task-mail.action-none .messagelist tbody tr > td.flags,
    html body.task-mail.action-none .messagelist tbody tr > td.status,
    html body.task-mail.action-none .messagelist tbody tr > td.priority {
        display: none !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    html.touch body.task-mail.action-none .messagelist tbody tr > td.subject,
    html body.task-mail.action-none .messagelist tbody tr > td.subject {
        position: relative !important;
        display: grid !important;
        grid-template-columns: 22px minmax(0, 1fr) !important;
        grid-template-rows: 40px !important;
        align-items: center !important;
        width: auto !important;
        min-width: 0 !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        padding: 0 !important;
        line-height: 40px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row {
        position: absolute !important;
        z-index: 2 !important;
        inset: 0 !important;
        display: grid !important;
        grid-template-columns: 30px minmax(118px, 34%) 16px minmax(0, 1fr) minmax(46px, max-content) !important;
        grid-template-areas: "avatar sender status content date" !important;
        grid-template-rows: 40px !important;
        align-items: center !important;
        column-gap: 8px !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        padding: 0 8px 0 2px !important;
        overflow: hidden !important;
        pointer-events: none !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar {
        grid-area: avatar !important;
        width: 30px !important;
        min-width: 30px !important;
        max-width: 30px !important;
        height: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;
        line-height: 30px !important;
        font-size: 10px !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-sender,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-date,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content > .legalmail-yandex-action,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content > .legalmail-yandex-action::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-subject,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-preview {
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        line-height: 40px !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-sender {
        grid-area: sender !important;
        min-width: 0 !important;
        font-size: 12.5px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status {
        grid-area: status !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 16px !important;
        min-width: 16px !important;
        max-width: 16px !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content {
        grid-area: content !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        pointer-events: auto !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content > .legalmail-yandex-action {
        display: none !important;
        flex: 0 0 16px !important;
        width: 16px !important;
        min-width: 16px !important;
        max-width: 16px !important;
        align-items: center !important;
        justify-content: center !important;
        color: #969ba1 !important;
        font-family: Icons !important;
        font-size: 14px !important;
        font-style: normal !important;
        font-weight: 900 !important;
        text-align: center !important;
        overflow: visible !important;
        pointer-events: none !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content > .legalmail-yandex-action.has-replied {
        display: flex !important;
        pointer-events: auto !important;
        cursor: default !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-content > .legalmail-yandex-action.has-replied::before {
        content: "\f3e5" !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-subject {
        display: block !important;
        flex: 0 1 auto !important;
        min-width: 0 !important;
        max-width: none !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-preview,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-preview:empty {
        display: block !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        max-width: none !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-date {
        grid-area: date !important;
        min-width: 0 !important;
        width: auto !important;
        max-width: none !important;
        padding: 0 !important;
        font-size: 11.5px !important;
        text-align: right !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    /* Read/unread marker remains identical to desktop/Yandex behavior. */
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:not(.unread):not([data-legalmail-read-state="unread"]) .legalmail-yandex-status::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-read::before {
        content: "" !important;
        display: block !important;
        box-sizing: border-box !important;
        width: 0 !important;
        min-width: 0 !important;
        height: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: transparent !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:not(.unread):not([data-legalmail-read-state="unread"]):hover .legalmail-yandex-status::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79:hover .legalmail-yandex-status.is-read::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-read:hover::before {
        width: 10px !important;
        min-width: 10px !important;
        height: 10px !important;
        border: 2px solid #8f969d !important;
        background: transparent !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.unread .legalmail-yandex-status::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79[data-legalmail-read-state="unread"] .legalmail-yandex-status::before,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-status.is-unread::before {
        content: "" !important;
        display: block !important;
        width: 9px !important;
        min-width: 9px !important;
        height: 9px !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #f4c000 !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > span.attachment,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > a.attachment {
        position: absolute !important;
        z-index: 5 !important;
        right: 48px !important;
        top: 0 !important;
        width: 20px !important;
        height: 40px !important;
        line-height: 40px !important;
        overflow: hidden !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist tbody tr > td,
    html.dark-mode body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td {
        box-shadow: inset 0 -1px 0 #35393f !important;
    }
}

/* ========================================================================== 
 * LegalMail v108 — fixed desktop canvas + browser horizontal scrollbar
 *
 * Yandex-style narrow desktop behavior: do not squeeze the desktop UI when the
 * browser becomes narrower.  Keep the normal rail, folder pane and inbox at a
 * stable desktop canvas width, and let the browser expose the overflow with its
 * horizontal scrollbar at the bottom.  Phones below 600px retain Elastic's
 * native mobile mode.
 * ========================================================================== */
@media screen and (min-width: 600px) and (max-width: 1200px) {
    /* Elastic normally clips the page horizontally. The scrollbar must belong
       to the browser/document, not to a squeezed message-list pane. */
    html {
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }

    html body.task-mail.action-none {
        box-sizing: border-box !important;
        width: 1200px !important;
        min-width: 1200px !important;
        max-width: none !important;
        overflow-x: visible !important;
    }

    html body.task-mail.action-none #layout {
        box-sizing: border-box !important;
        display: flex !important;
        flex-flow: row nowrap !important;
        width: 1200px !important;
        min-width: 1200px !important;
        max-width: none !important;
        height: 100vh !important;
        min-height: 0 !important;
        padding: 10px !important;
        gap: 10px !important;
        overflow: hidden !important;
    }

    /* Never shrink the structural columns. */
    html body.task-mail.action-none #layout-menu {
        flex: 0 0 58px !important;
        width: 58px !important;
        min-width: 58px !important;
        max-width: 58px !important;
    }

    html body.task-mail.action-none #layout-sidebar,
    html body.task-mail.action-none #layout-sidebar.hidden {
        flex: 0 0 238px !important;
        width: 238px !important;
        min-width: 238px !important;
        max-width: 238px !important;
    }

    /* 1200 - 20px outer padding - 20px gaps - 58px rail - 238px folders =
       864px for the inbox. Keep that desktop-like width even in a 700px window;
       the rest is reached with the browser scrollbar. */
    html body.task-mail.action-none #layout-list,
    html body.task-mail.action-none #layout-list.hidden {
        flex: 1 0 864px !important;
        width: 864px !important;
        min-width: 864px !important;
        max-width: none !important;
    }

    html body.task-mail.action-none #messagelist-content {
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    html body.task-mail.action-none table.messagelist {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed !important;
    }
}

/* At 600–768px the viewport is technically "small", but the v108 canvas is
   still desktop-sized. Restore the same row proportions instead of the compact
   narrow-column proportions from v107. */
@media screen and (min-width: 600px) and (max-width: 768px) {
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row {
        grid-template-columns: 30px 190px 16px minmax(0, 1fr) minmax(58px, max-content) !important;
        grid-template-areas: "avatar sender status content date" !important;
        grid-template-rows: 40px !important;
        column-gap: 8px !important;
        padding: 0 8px 0 2px !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar {
        width: 30px !important;
        min-width: 30px !important;
        max-width: 30px !important;
        height: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;
        line-height: 30px !important;
        font-size: 10px !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-sender {
        font-size: 13px !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-date {
        width: auto !important;
        min-width: 58px !important;
        max-width: none !important;
        font-size: 12px !important;
    }
}

/* ========================================================================== 
 * LegalMail v109 — compact desktop geometry on narrow browser windows
 *
 * v108 kept a 1200px desktop canvas but Elastic still applied its <=768px
 * touch/small visual rules inside that canvas.  That made the folder pane look
 * like a phone menu (large 48px rows/icons/back arrow) and collapsed the mail
 * action toolbar to the mobile three-dot button.  v109 keeps the horizontal
 * browser scrollbar, but forces the SAME compact desktop proportions as the
 * supplied wide-screen reference from 600px upward.
 * ========================================================================== */
@media screen and (min-width: 600px) and (max-width: 1200px) {
    /* Match the wide-screen reference proportions instead of the oversized
       tablet/mobile columns: ~54px rail + ~218px folders + desktop inbox. */
    html body.task-mail.action-none {
        width: 1200px !important;
        min-width: 1200px !important;
    }

    html body.task-mail.action-none #layout {
        width: 1200px !important;
        min-width: 1200px !important;
        padding: 4px !important;
        gap: 8px !important;
        overflow: hidden !important;
    }

    html body.task-mail.action-none #layout-menu {
        flex: 0 0 54px !important;
        width: 54px !important;
        min-width: 54px !important;
        max-width: 54px !important;
        border-radius: 16px !important;
    }

    html body.task-mail.action-none #layout-menu .popover-header,
    html body.task-mail.action-none #taskmenu .special-buttons {
        width: 54px !important;
        min-width: 54px !important;
        max-width: 54px !important;
    }

    html body.task-mail.action-none #layout-menu .popover-header {
        height: 52px !important;
        min-height: 52px !important;
        line-height: 52px !important;
    }

    html body.task-mail.action-none #layout-menu .popover-header img {
        width: 32px !important;
        height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
    }

    html body.task-mail.action-none #taskmenu a,
    html body.task-mail.action-none #taskmenu > span.action-buttons > a.compose {
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        margin: 2px 7px !important;
        border-radius: 12px !important;
    }

    html body.task-mail.action-none #taskmenu a::before,
    html body.task-mail.action-none #taskmenu > span.action-buttons > a.compose::before {
        width: 40px !important;
        height: 40px !important;
        line-height: 40px !important;
        font-size: 18px !important;
    }

    html body.task-mail.action-none #layout-sidebar,
    html body.task-mail.action-none #layout-sidebar.hidden {
        display: flex !important;
        flex: 0 0 218px !important;
        width: 218px !important;
        min-width: 218px !important;
        max-width: 218px !important;
        border-radius: 16px !important;
        overflow: hidden !important;
    }

    html body.task-mail.action-none #layout-list,
    html body.task-mail.action-none #layout-list.hidden {
        display: flex !important;
        flex: 1 0 904px !important;
        width: 904px !important;
        min-width: 904px !important;
        max-width: none !important;
        border-radius: 16px !important;
        overflow: hidden !important;
    }

    /* ---------------- Folder pane: desktop, not phone ---------------- */
    html body.task-mail.action-none #layout-sidebar > .header.yandex-sidebar-header {
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;
        line-height: 52px !important;
        padding: 0 10px !important;
        gap: 6px !important;
        overflow: hidden !important;
    }

    /* Elastic exposes this only in its phone/small layout.  Folders are already
       on screen, so the back arrow must not consume desktop header space. */
    html body.task-mail.action-none #layout-sidebar > .header.yandex-sidebar-header .back-list-button,
    html body.task-mail.action-none #layout-sidebar > .header.yandex-sidebar-header a.back-list-button {
        display: none !important;
    }

    html body.task-mail.action-none #layout-sidebar > .header.yandex-sidebar-header .header-title.yandex-account-title {
        display: block !important;
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 52px !important;
        line-height: 52px !important;
        margin: 0 !important;
        padding: 0 2px !important;
        text-align: center !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    html body.task-mail.action-none #layout-sidebar > .header.yandex-sidebar-header .sidebar-menu {
        display: inline-flex !important;
        flex: 0 0 30px !important;
        align-items: center !important;
        justify-content: center !important;
        width: 30px !important;
        min-width: 30px !important;
        max-width: 30px !important;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        line-height: 34px !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 9px !important;
    }

    html body.task-mail.action-none #layout-sidebar > .header.yandex-sidebar-header .sidebar-menu::before {
        width: 30px !important;
        height: 34px !important;
        line-height: 34px !important;
        margin: 0 !important;
        font-size: 17px !important;
        text-align: center !important;
    }

    /* legalmail.css hides Compose at <=1200; restore the desktop compose row. */
    html body.task-mail.action-none .yandex-compose-wrap {
        display: block !important;
        flex: 0 0 auto !important;
        padding: 3px 9px 7px !important;
    }

    html body.task-mail.action-none .yandex-compose-row {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        gap: 6px !important;
    }

    html body.task-mail.action-none .yandex-compose-button {
        display: flex !important;
        flex: 1 1 auto !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 0 !important;
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
        border-radius: 11px !important;
        font-size: 13px !important;
        line-height: 38px !important;
    }

    html body.task-mail.action-none a.yandex-refresh-button,
    html body.task-mail.action-none a.yandex-refresh-button.button.icon,
    html body.task-mail.action-none a.yandex-refresh-button.toolbar-button {
        display: inline-flex !important;
        flex: 0 0 36px !important;
        width: 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
        border-radius: 10px !important;
    }

    html body.task-mail.action-none #folderlist-content {
        padding: 0 7px 8px !important;
    }

    /* Beat Elastic's html.touch / layout-small list sizing. */
    html.touch body.task-mail.action-none #layout-sidebar .folderlist li,
    html body.task-mail.action-none #layout-sidebar .folderlist li {
        box-sizing: border-box !important;
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        line-height: 36px !important;
        margin: 1px 0 !important;
        border-bottom: 0 !important;
    }

    html.touch body.task-mail.action-none #layout-sidebar .folderlist li > a,
    html.touch body.task-mail.action-none #layout-sidebar .folderlist li > div > a,
    html body.task-mail.action-none #layout-sidebar .folderlist li > a,
    html body.task-mail.action-none #layout-sidebar .folderlist li > div > a {
        box-sizing: border-box !important;
        display: block !important;
        width: 100% !important;
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        line-height: 36px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        padding-right: 9px !important;
        border-radius: 9px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    html body.task-mail.action-none #layout-sidebar .folderlist li > a::before,
    html body.task-mail.action-none #layout-sidebar .folderlist li > div > a::before {
        float: left !important;
        width: 18px !important;
        height: 36px !important;
        line-height: 36px !important;
        margin: 0 7px 0 0 !important;
        font-size: 15px !important;
        text-align: center !important;
    }

    html.touch body.task-mail.action-none #layout-sidebar .folderlist li.mailbox .unreadcount,
    html body.task-mail.action-none #layout-sidebar .folderlist li.mailbox .unreadcount {
        top: 7px !important;
        right: 7px !important;
        min-width: 22px !important;
        width: auto !important;
        height: 22px !important;
        line-height: 22px !important;
        margin: 0 !important;
        padding: 0 6px !important;
        border-radius: 11px !important;
        font-size: 11px !important;
    }

    /* ---------------- Inbox header: restore the desktop tool strip -------- */
    html body.task-mail.action-none #layout-list > .legalmail-search-row {
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 56px !important;
        min-height: 56px !important;
        max-height: 56px !important;
        flex: 0 0 56px !important;
        gap: 7px !important;
        padding: 7px 10px !important;
    }

    html body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form {
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        border-radius: 12px !important;
    }

    html body.task-mail.action-none #layout-list > .legalmail-search-row > .yandex-selection-toolbar.legalmail-unread-slot {
        flex: 0 0 36px !important;
        width: 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
    }

    html body.task-mail.action-none #messagelist-header.yandex-list-toolbar {
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        flex: 0 0 48px !important;
        line-height: 1 !important;
        padding: 0 8px !important;
        gap: 2px !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    /* Mobile-only menu/folder buttons are exactly what produced the lone
       centered three-dot row in the supplied screenshot. */
    html body.task-mail.action-none #messagelist-header .task-menu-button,
    html body.task-mail.action-none #messagelist-header .back-sidebar-button,
    html body.task-mail.action-none #messagelist-header .toolbar-menu-button {
        display: none !important;
    }

    html body.task-mail.action-none #messagelist-header .toolbar.menu.legalmail-v63-native-list-controls,
    html body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar {
        display: flex !important;
        flex: 0 0 auto !important;
        align-items: stretch !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        gap: 1px !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* Restore actions hidden by the legacy <=1200 compact rule. */
    html body.task-mail.action-none #mailtoolbar.yandex-mailtoolbar > a:not(.compose),
    html body.task-mail.action-none #mailtoolbar.yandex-mailtoolbar > .dropbutton,
    html body.task-mail.action-none #mailtoolbar.yandex-mailtoolbar .move,
    html body.task-mail.action-none #mailtoolbar.yandex-mailtoolbar .unread,
    html body.task-mail.action-none #mailtoolbar.yandex-mailtoolbar .markmessage,
    html body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls > a,
    html body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls > .dropbutton {
        display: inline-flex !important;
    }

    html body.task-mail.action-none #mailtoolbar.yandex-mailtoolbar > a:not(.dropdown):not(.compose),
    html body.task-mail.action-none #mailtoolbar.yandex-mailtoolbar > .dropbutton > a:not(.dropdown),
    html body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls > a {
        box-sizing: border-box !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        min-width: 44px !important;
        max-width: 64px !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        margin: 0 !important;
        padding: 3px 5px 2px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        line-height: 1 !important;
        text-align: center !important;
        overflow: hidden !important;
    }

    /* Generic Elastic <=768px hides .inner and enlarges :before to 1.75rem.
       Undo that only inside this list toolbar. */
    html body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls a > .inner,
    html body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar a > .inner {
        display: block !important;
        width: auto !important;
        height: 14px !important;
        min-height: 14px !important;
        max-width: 58px !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        color: inherit !important;
        font-size: 10px !important;
        font-weight: 400 !important;
        line-height: 14px !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls a::before,
    html body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar a:not(.dropdown)::before {
        display: block !important;
        float: none !important;
        width: 20px !important;
        height: 22px !important;
        min-height: 22px !important;
        line-height: 22px !important;
        margin: 0 auto !important;
        padding: 0 !important;
        font-size: 15px !important;
        text-align: center !important;
    }

    html body.task-mail.action-none #mailtoolbar.yandex-mailtoolbar > .dropbutton {
        align-items: stretch !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    html body.task-mail.action-none #mailtoolbar.yandex-mailtoolbar > .dropbutton > a.dropdown {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 12px !important;
        min-width: 12px !important;
        max-width: 12px !important;
        height: 48px !important;
        margin: 0 1px 0 -5px !important;
        padding: 0 !important;
    }

    html body.task-mail.action-none #mailtoolbar.yandex-mailtoolbar > .dropbutton > a.dropdown .inner {
        display: none !important;
    }

    /* Preserve the v104/v108 40px message rows — no touch enlargement. */
    html.touch body.task-mail.action-none .messagelist tbody tr,
    html body.task-mail.action-none .messagelist tbody tr,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79,
    html body.task-mail.action-none .messagelist tbody tr > td {
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
    }
}

/* ========================================================================== 
 * LegalMail v110 — narrow viewport must remain visually identical to desktop
 *
 * The real viewport width can still trigger Elastic's phone/touch rules even
 * though v108/v109 render a fixed 1200px mail canvas.  This final guard applies
 * the desktop folder palette and desktop action toolbar at EVERY viewport up to
 * 1200px.  Nothing is squeezed: the document keeps its horizontal scrollbar.
 * ========================================================================== */
@media screen and (max-width: 1200px) {
    /* Keep the full desktop canvas even when Elastic reports layout-phone or
       layout-small.  The browser/document owns horizontal scrolling. */
    html,
    html.layout-phone,
    html.layout-small,
    html.touch {
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }

    html body.task-mail.action-none {
        box-sizing: border-box !important;
        width: 1200px !important;
        min-width: 1200px !important;
        max-width: none !important;
        overflow-x: visible !important;
        overflow-y: hidden !important;
    }

    html body.task-mail.action-none #layout {
        box-sizing: border-box !important;
        display: flex !important;
        flex-flow: row nowrap !important;
        width: 1200px !important;
        min-width: 1200px !important;
        max-width: none !important;
        height: 100vh !important;
        min-height: 0 !important;
        padding: 4px !important;
        gap: 8px !important;
        overflow: hidden !important;
    }

    /* Always render the left app rail as a desktop column, never as a phone
       popover. */
    html body.task-mail.action-none #layout-menu,
    html.layout-phone body.task-mail.action-none #layout-menu,
    html.layout-small body.task-mail.action-none #layout-menu {
        position: relative !important;
        inset: auto !important;
        display: flex !important;
        flex: 0 0 54px !important;
        flex-direction: column !important;
        width: 54px !important;
        min-width: 54px !important;
        max-width: 54px !important;
        height: auto !important;
        margin: 0 !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        border-radius: 16px !important;
        overflow: hidden !important;
    }

    html body.task-mail.action-none #layout-sidebar,
    html body.task-mail.action-none #layout-sidebar.hidden,
    html.layout-phone body.task-mail.action-none #layout-sidebar,
    html.layout-small body.task-mail.action-none #layout-sidebar {
        position: relative !important;
        inset: auto !important;
        display: flex !important;
        flex: 0 0 218px !important;
        flex-direction: column !important;
        width: 218px !important;
        min-width: 218px !important;
        max-width: 218px !important;
        height: auto !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        border-radius: 16px !important;
        overflow: hidden !important;
    }

    html body.task-mail.action-none #layout-list,
    html body.task-mail.action-none #layout-list.hidden,
    html.layout-phone body.task-mail.action-none #layout-list,
    html.layout-small body.task-mail.action-none #layout-list {
        position: relative !important;
        inset: auto !important;
        display: flex !important;
        flex: 1 0 904px !important;
        flex-direction: column !important;
        width: 904px !important;
        min-width: 904px !important;
        max-width: none !important;
        height: auto !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        border-radius: 16px !important;
        overflow: hidden !important;
    }

    /* ---------- Folder pane: same neutral colors as the large version. ---- */
    html:not(.dark-mode) body.task-mail.action-none #layout-sidebar .folderlist li > a,
    html:not(.dark-mode) body.task-mail.action-none #layout-sidebar .folderlist li > div > a,
    html:not(.dark-mode) body.task-mail.action-none #layout-sidebar .folderlist li > a:link,
    html:not(.dark-mode) body.task-mail.action-none #layout-sidebar .folderlist li > div > a:link,
    html:not(.dark-mode) body.task-mail.action-none #layout-sidebar .folderlist li > a:visited,
    html:not(.dark-mode) body.task-mail.action-none #layout-sidebar .folderlist li > div > a:visited {
        color: #202124 !important;
        -webkit-text-fill-color: #202124 !important;
        text-decoration-color: #202124 !important;
    }

    html:not(.dark-mode) body.task-mail.action-none #layout-sidebar .folderlist li > a::before,
    html:not(.dark-mode) body.task-mail.action-none #layout-sidebar .folderlist li > div > a::before,
    html:not(.dark-mode) body.task-mail.action-none #layout-sidebar .folderlist li > a::after,
    html:not(.dark-mode) body.task-mail.action-none #layout-sidebar .folderlist li > div > a::after {
        color: #202124 !important;
        -webkit-text-fill-color: #202124 !important;
        fill: #202124 !important;
        stroke: #202124 !important;
        filter: none !important;
    }

    html:not(.dark-mode) body.task-mail.action-none #layout-sidebar .folderlist li > a:hover,
    html:not(.dark-mode) body.task-mail.action-none #layout-sidebar .folderlist li > div > a:hover {
        color: #202124 !important;
        -webkit-text-fill-color: #202124 !important;
        background: #f1f2f4 !important;
    }

    html:not(.dark-mode) body.task-mail.action-none #layout-sidebar .folderlist li.selected > a,
    html:not(.dark-mode) body.task-mail.action-none #layout-sidebar .folderlist li.selected > div > a {
        color: #17191d !important;
        -webkit-text-fill-color: #17191d !important;
        background: #e8eaed !important;
        font-weight: 700 !important;
    }

    html:not(.dark-mode) body.task-mail.action-none #layout-sidebar .folderlist li.mailbox .unreadcount,
    html:not(.dark-mode) body.task-mail.action-none #layout-sidebar .folderlist li .unreadcount {
        border: 0 !important;
        background: #e1e2e6 !important;
        color: #282a2e !important;
        -webkit-text-fill-color: #282a2e !important;
        box-shadow: none !important;
        font-weight: 600 !important;
    }

    /* Do not let touch/mobile CSS enlarge or recolor the folder rows. */
    html.touch body.task-mail.action-none #layout-sidebar .folderlist li,
    html.layout-phone body.task-mail.action-none #layout-sidebar .folderlist li,
    html.layout-small body.task-mail.action-none #layout-sidebar .folderlist li,
    html body.task-mail.action-none #layout-sidebar .folderlist li {
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        line-height: 36px !important;
        margin: 1px 0 !important;
    }

    html.touch body.task-mail.action-none #layout-sidebar .folderlist li > a,
    html.touch body.task-mail.action-none #layout-sidebar .folderlist li > div > a,
    html.layout-phone body.task-mail.action-none #layout-sidebar .folderlist li > a,
    html.layout-phone body.task-mail.action-none #layout-sidebar .folderlist li > div > a,
    html.layout-small body.task-mail.action-none #layout-sidebar .folderlist li > a,
    html.layout-small body.task-mail.action-none #layout-sidebar .folderlist li > div > a {
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        line-height: 36px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        font-size: 13px !important;
    }

    /* ---------- Inbox toolbar: force the complete desktop action strip. --- */
    html body.task-mail.action-none #messagelist-header.yandex-list-toolbar,
    html.layout-phone body.task-mail.action-none #messagelist-header.yandex-list-toolbar,
    html.layout-small body.task-mail.action-none #messagelist-header.yandex-list-toolbar {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        flex: 0 0 48px !important;
        padding: 0 8px !important;
        gap: 2px !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Phone-only navigation/menu buttons must never replace the desktop bar. */
    html body.task-mail.action-none #messagelist-header > .task-menu-button,
    html body.task-mail.action-none #messagelist-header > .back-sidebar-button,
    html body.task-mail.action-none #messagelist-header > .toolbar-menu-button {
        display: none !important;
    }

    html body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls,
    html body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar,
    html.layout-phone body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls,
    html.layout-phone body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar,
    html.layout-small body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls,
    html.layout-small body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar {
        position: relative !important;
        inset: auto !important;
        display: flex !important;
        flex: 0 0 auto !important;
        align-items: stretch !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 1px !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow: visible !important;
    }

    /* Restore every real list action, including plugin buttons carrying
       responsive helper classes. Compose remains the intentional hidden
       fallback; Discussions keeps its own runtime visibility logic. */
    html body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar > a:not(.compose),
    html body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar > .dropbutton,
    html body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar > .hidden-small:not(.compose),
    html body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar > .hidden-lbs:not(.compose),
    html body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls > a:not([hidden]),
    html body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls > .dropbutton {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    html body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar > a.compose {
        display: none !important;
    }

    /* Undo Elastic <=768px: labels stay visible and icons keep desktop size. */
    html body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls a > .inner,
    html body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar a > .inner,
    html.layout-phone body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls a > .inner,
    html.layout-phone body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar a > .inner,
    html.layout-small body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls a > .inner,
    html.layout-small body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar a > .inner {
        display: block !important;
        width: auto !important;
        height: 14px !important;
        min-height: 14px !important;
        max-width: 62px !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        font-size: 10px !important;
        font-weight: 400 !important;
        line-height: 14px !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls > a,
    html body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar > a:not(.dropdown):not(.compose),
    html body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar > .dropbutton > a:not(.dropdown) {
        box-sizing: border-box !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        min-width: 44px !important;
        max-width: 68px !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        margin: 0 !important;
        padding: 3px 5px 2px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        line-height: 1 !important;
        text-align: center !important;
        overflow: hidden !important;
    }

    html body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls a::before,
    html body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar a:not(.dropdown)::before {
        display: block !important;
        float: none !important;
        width: 20px !important;
        height: 22px !important;
        min-height: 22px !important;
        line-height: 22px !important;
        margin: 0 auto !important;
        padding: 0 !important;
        font-size: 15px !important;
        text-align: center !important;
    }

    /* Same neutral desktop palette for toolbar labels/icons. */
    html:not(.dark-mode) body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls a:not(.disabled),
    html:not(.dark-mode) body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls a:not(.disabled) > .inner,
    html:not(.dark-mode) body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar a:not(.disabled),
    html:not(.dark-mode) body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar a:not(.disabled) * {
        color: #202124 !important;
        -webkit-text-fill-color: #202124 !important;
        fill: #202124 !important;
        stroke: #202124 !important;
    }

    html:not(.dark-mode) body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls a.disabled,
    html:not(.dark-mode) body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls a.disabled > .inner,
    html:not(.dark-mode) body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar a.disabled,
    html:not(.dark-mode) body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar a.disabled * {
        color: #b7bcc1 !important;
        -webkit-text-fill-color: #b7bcc1 !important;
        fill: #b7bcc1 !important;
        stroke: #b7bcc1 !important;
    }

    /* Preserve compact 40px message rows in touch/layout-phone mode. */
    html.touch body.task-mail.action-none .messagelist tbody tr,
    html.layout-phone body.task-mail.action-none .messagelist tbody tr,
    html.layout-small body.task-mail.action-none .messagelist tbody tr,
    html body.task-mail.action-none .messagelist tbody tr,
    html body.task-mail.action-none .messagelist tbody tr > td {
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
    }
}

/* ========================================================================== 
 * LegalMail v111 — restore Elastic's REAL list toolbar after responsive init
 *
 * Elastic's toolbar_init() physically removes every `.header > .menu` toolbar
 * and moves the original buttons into `#toolbar-list-menu`.  v110 attempted to
 * re-show #mailtoolbar, but on small layouts that node no longer exists.  v111
 * styles the actual post-init `#toolbar-list-menu` back into the same inline
 * desktop action strip.  No cloned/dead controls are used, so all Roundcube
 * commands and plugin actions keep their original handlers/state.
 * ========================================================================== */
@media screen and (max-width: 1200px) {
    html body.task-mail.action-none #messagelist-header.yandex-list-toolbar {
        display: flex !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        flex: 0 0 48px !important;
        padding: 0 8px !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    /* Elastic creates this UL during UI init and moves the original list
       controls into it.  Render that UL inline instead of as a popup. */
    html body.task-mail.action-none #messagelist-header > #toolbar-list-menu.legalmail-v111-inline-toolbar,
    html.layout-phone body.task-mail.action-none #messagelist-header > #toolbar-list-menu.legalmail-v111-inline-toolbar,
    html.layout-small body.task-mail.action-none #messagelist-header > #toolbar-list-menu.legalmail-v111-inline-toolbar,
    html.touch body.task-mail.action-none #messagelist-header > #toolbar-list-menu.legalmail-v111-inline-toolbar {
        position: static !important;
        inset: auto !important;
        z-index: auto !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex: 0 0 auto !important;
        flex-direction: row !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 1px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow: visible !important;
        list-style: none !important;
        pointer-events: auto !important;
    }

    html body.task-mail.action-none #messagelist-header > #toolbar-list-menu.legalmail-v111-inline-toolbar > li {
        position: relative !important;
        inset: auto !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex: 0 0 auto !important;
        align-items: stretch !important;
        justify-content: center !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow: visible !important;
    }

    /* Keep items that Elastic labels responsive-only available in our fixed
       desktop canvas. Compose is still intentionally hidden. */
    html body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar > li.hidden-small,
    html body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar > li.hidden-lbs,
    html body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar > li.hidden-big,
    html body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar > li.hidden-large {
        display: flex !important;
    }

    html body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar a.compose {
        display: none !important;
    }

    html body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar > li > a:not(.dropdown):not(.compose),
    html body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar > li > .dropbutton > a:not(.dropdown),
    html body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar > li > span.dropbutton > a:not(.dropdown) {
        position: relative !important;
        box-sizing: border-box !important;
        display: inline-flex !important;
        flex: 0 0 auto !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        min-width: 44px !important;
        max-width: 68px !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        margin: 0 !important;
        padding: 3px 5px 2px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        line-height: 1 !important;
        text-align: center !important;
        text-decoration: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow: hidden !important;
    }

    html body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar > li > .dropbutton,
    html body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar > li > span.dropbutton {
        box-sizing: border-box !important;
        display: inline-flex !important;
        flex: 0 0 auto !important;
        align-items: stretch !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    html body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar a.dropdown {
        box-sizing: border-box !important;
        display: inline-flex !important;
        flex: 0 0 12px !important;
        align-items: center !important;
        justify-content: center !important;
        width: 12px !important;
        min-width: 12px !important;
        max-width: 12px !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        overflow: visible !important;
    }

    html body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar a > .inner {
        display: block !important;
        width: auto !important;
        height: 14px !important;
        min-height: 14px !important;
        max-width: 62px !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        font-size: 10px !important;
        font-weight: 400 !important;
        line-height: 14px !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar a:not(.dropdown)::before {
        display: block !important;
        float: none !important;
        width: 20px !important;
        height: 22px !important;
        min-height: 22px !important;
        margin: 0 auto !important;
        padding: 0 !important;
        font-size: 15px !important;
        line-height: 22px !important;
        text-align: center !important;
    }

    /* Match the large desktop toolbar palette. */
    html:not(.dark-mode) body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar a:not(.disabled),
    html:not(.dark-mode) body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar a:not(.disabled) *,
    html:not(.dark-mode) body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar a:not(.disabled)::before,
    html:not(.dark-mode) body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar a:not(.disabled)::after {
        color: #202124 !important;
        -webkit-text-fill-color: #202124 !important;
        fill: #202124 !important;
        stroke: #202124 !important;
    }

    html:not(.dark-mode) body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar a.disabled,
    html:not(.dark-mode) body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar a.disabled *,
    html:not(.dark-mode) body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar a.disabled::before,
    html:not(.dark-mode) body.task-mail.action-none #toolbar-list-menu.legalmail-v111-inline-toolbar a.disabled::after {
        color: #b7bcc1 !important;
        -webkit-text-fill-color: #b7bcc1 !important;
        fill: #b7bcc1 !important;
        stroke: #b7bcc1 !important;
    }

    /* Hide the popup launcher: its menu is now the visible desktop strip. */
    html body.task-mail.action-none #messagelist-header > a.toolbar-list-button,
    html body.task-mail.action-none #messagelist-header > a.toolbar-menu-button,
    html body.task-mail.action-none #messagelist-header > a.task-menu-button,
    html body.task-mail.action-none #messagelist-header > a.back-sidebar-button {
        display: none !important;
    }
}

/* ========================================================================== 
 * LegalMail v112 — exact desktop toolbar on the fixed narrow canvas
 * ========================================================================== */
@media screen and (max-width: 1200px) {
    /* Once JS has put the original controls back into their desktop wrappers,
       never allow the v111 popup-UL presentation to compete with them. */
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header > #toolbar-list-menu,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header > a.toolbar-list-button,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header > a.toolbar-menu-button,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header > a.task-menu-button,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header > a.back-sidebar-button {
        display: none !important;
    }

    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header .legalmail-v112-restored-controls,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar {
        position: relative !important;
        inset: auto !important;
        display: flex !important;
        flex: 0 0 auto !important;
        flex-direction: row !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        width: auto !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 1px !important;
        border: 0 !important;
        background: transparent !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow: visible !important;
    }

    /* Only the same direct controls as the normal desktop strip. */
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header .legalmail-v112-restored-controls > a.select,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header .legalmail-v112-restored-controls > a.options,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header .legalmail-v112-restored-controls > a.threads,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > .dropbutton,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a.delete,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a.junk,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a.spam,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a.unread,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a.move,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a.markmessage,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a.more {
        visibility: visible !important;
        opacity: 1 !important;
    }

    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header [data-legalmail-v112-extra="1"],
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a.compose {
        display: none !important;
    }

    /* Re-apply the desktop button geometry after Elastic's phone rules. */
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header .legalmail-v112-restored-controls > a,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a:not(.dropdown):not(.compose),
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > .dropbutton > a:not(.dropdown) {
        box-sizing: border-box !important;
        display: inline-flex !important;
        flex: 0 0 auto !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        min-width: 44px !important;
        max-width: 68px !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        margin: 0 !important;
        padding: 3px 5px 2px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        line-height: 1 !important;
        text-align: center !important;
        overflow: hidden !important;
    }

    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header .legalmail-v112-restored-controls a > .inner,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar a > .inner {
        display: block !important;
        width: auto !important;
        height: 14px !important;
        min-height: 14px !important;
        max-width: 62px !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        font-size: 10px !important;
        font-weight: 400 !important;
        line-height: 14px !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header .legalmail-v112-restored-controls a::before,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar a:not(.dropdown)::before {
        display: block !important;
        float: none !important;
        width: 20px !important;
        height: 22px !important;
        min-height: 22px !important;
        margin: 0 auto !important;
        padding: 0 !important;
        font-size: 15px !important;
        line-height: 22px !important;
        text-align: center !important;
    }

    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > .dropbutton {
        box-sizing: border-box !important;
        display: inline-flex !important;
        flex: 0 0 auto !important;
        align-items: stretch !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        overflow: visible !important;
    }

    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > .dropbutton > a.dropdown {
        display: inline-flex !important;
        flex: 0 0 12px !important;
        align-items: center !important;
        justify-content: center !important;
        width: 12px !important;
        min-width: 12px !important;
        max-width: 12px !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        margin: 0 1px 0 -5px !important;
        padding: 0 !important;
    }

    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > .dropbutton > a.dropdown .inner {
        display: none !important;
    }
}

/* ========================================================================== 
 * LegalMail v114 — exactly one dynamic Read / Unread toolbar action
 * ========================================================================== */
/* The native READ command is retained only as a hidden command delegate. */
body.task-mail.action-none #mailtoolbar.yandex-mailtoolbar > a.legalmail-quick-read,
html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a.legalmail-quick-read,
body.task-mail.action-none #mailtoolbar.yandex-mailtoolbar > a.legalmail-quick-command-delegate {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Before JS reads the selected message status, show only the one normal quick
   button.  There is never a second visible read-state action. */
body.task-mail.action-none #mailtoolbar.yandex-mailtoolbar > a.legalmail-quick-unread,
html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a.legalmail-quick-unread {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Neutral desktop palette for both states of that SAME visible element. */
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.legalmail-quick-state,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.legalmail-quick-state::before {
    color: #202124 !important;
    -webkit-text-fill-color: #202124 !important;
    fill: #202124 !important;
    stroke: #202124 !important;
}
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.legalmail-quick-state.disabled,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar a.legalmail-quick-state.disabled::before {
    color: #a7adb3 !important;
    -webkit-text-fill-color: #a7adb3 !important;
    fill: #a7adb3 !important;
    stroke: #a7adb3 !important;
}

@media screen and (max-width: 1200px) {
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a.legalmail-quick-state {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a.legalmail-quick-read {
        display: none !important;
        visibility: hidden !important;
    }
}


/* ========================================================================== 
 * LegalMail v115 — one physical read-state action in every toolbar layout
 * ========================================================================== */
/* Old cached/responsive copies from v113/v114 must never become a second button. */
body.task-mail.action-none #mailtoolbar a.legalmail-quick-read,
body.task-mail.action-none #messagelist-header a.legalmail-quick-read {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.task-mail.action-none #mailtoolbar a.legalmail-quick-toggle,
html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar a.legalmail-quick-toggle {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Let the same element inherit the proper Elastic icon from its current mode. */
body.task-mail.action-none #mailtoolbar a.legalmail-quick-toggle.read::before {
    /* .read's native icon rule remains authoritative; this selector only wins
       over stale .unread layout rules if both existed during a repaint. */
    visibility: visible !important;
}
body.task-mail.action-none #mailtoolbar a.legalmail-quick-toggle.unread::before {
    visibility: visible !important;
}

/* ========================================================================== 
 * LegalMail v117 — exact ONE read-state action, corrected state detection
 * ========================================================================== */
body.task-mail.action-none #mailtoolbar a.legalmail-v116-duplicate-read-state,
html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar a.legalmail-v116-duplicate-read-state {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

body.task-mail.action-none #mailtoolbar a.legalmail-quick-toggle.legalmail-v116-quick-toggle,
html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar a.legalmail-quick-toggle.legalmail-v116-quick-toggle {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* The JS writes exactly “Прочитано” / “Не прочитано” into .inner. Keep it
   visible as the toolbar caption and prevent old responsive label substitutes. */
body.task-mail.action-none #mailtoolbar a.legalmail-quick-toggle.legalmail-v116-quick-toggle > .inner {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Hard guard: the inbox action strip must contain only the dynamic quick
   read-state action. Popup-menu read/unread commands are intentionally left
   untouched because they live outside #mailtoolbar. */
body.task-mail.action-none #mailtoolbar > a.read:not(.legalmail-quick-toggle),
body.task-mail.action-none #mailtoolbar > a.unread:not(.legalmail-quick-toggle),
html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar > a.read:not(.legalmail-quick-toggle),
html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar > a.unread:not(.legalmail-quick-toggle) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ========================================================================== 
 * LegalMail v119 — Yandex date rail + clean attachment indicator
 *
 * - recent mail: `13:46`, then `Пн 13:46` for the previous six days;
 * - older mail in the current year: `11 авг`;
 * - previous years: `30.12.25`;
 * - exact received date/time is shown by the custom hover tooltip;
 * - the native attachment/count/download stack is visually suppressed and a
 *   single Yandex-like paperclip is rendered in its own aligned rail.
 * ========================================================================== */
@media screen and (min-width: 600px) {
    /* The old Elastic attachment DOM remains available to Roundcube, but it is
       no longer allowed to paint count/download tiles over the date column. */
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > span.attachment,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.subject > a.attachment,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 td.flags .attachment,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 > td.attachment,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 > td.attachment * {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
    }

    /* One stable right rail: date first, paperclip second. Reserving the
       paperclip lane on every row keeps every date on exactly the same axis. */
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.legalmail-has-attachment .legalmail-yandex-row {
        grid-template-columns: 30px clamp(156px, 16vw, 220px) 16px minmax(0, 1fr) 72px 22px !important;
        grid-template-areas: "avatar sender status content date attachment" !important;
        column-gap: 8px !important;
        padding-right: 8px !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-date {
        grid-area: date !important;
        box-sizing: border-box !important;
        display: block !important;
        width: 72px !important;
        min-width: 72px !important;
        max-width: 72px !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        margin: 0 !important;
        padding: 0 2px 0 0 !important;
        color: #858c95 !important;
        font-size: 12.5px !important;
        font-weight: 400 !important;
        line-height: 40px !important;
        text-align: right !important;
        text-overflow: clip !important;
        white-space: nowrap !important;
        overflow: visible !important;
        cursor: default !important;
        pointer-events: auto !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment {
        grid-area: attachment !important;
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 22px !important;
        min-width: 22px !important;
        max-width: 22px !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        margin: 0 !important;
        padding: 0 !important;
        color: transparent !important;
        font-size: 0 !important;
        line-height: 40px !important;
        opacity: 0 !important;
        overflow: visible !important;
        pointer-events: none !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment.is-visible,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.legalmail-has-attachment .legalmail-yandex-attachment {
        opacity: 1 !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment::before {
        content: "\f0c6" !important;
        display: block !important;
        width: 18px !important;
        height: 40px !important;
        margin: 0 !important;
        padding: 0 !important;
        color: #9ba1a7 !important;
        font-family: Icons !important;
        font-size: 17px !important;
        font-style: normal !important;
        font-weight: 900 !important;
        line-height: 40px !important;
        text-align: center !important;
        -webkit-font-smoothing: antialiased !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-date {
        color: #969ca5 !important;
    }
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment::before {
        color: #969ca5 !important;
    }
}

/* Date hover follows the same compact dark hint style as the Answered hint,
   but it can grow to fit a full `18 августа 2026, 13:46` timestamp. */
#legalmail-date-tooltip-v119 {
    position: fixed !important;
    z-index: 2147483600 !important;
    display: block !important;
    max-width: min(320px, calc(100vw - 20px)) !important;
    margin: 0 !important;
    padding: 6px 9px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: #2f3033 !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .22) !important;
    font-family: Roboto, Arial, sans-serif !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 16px !important;
    text-align: center !important;
    white-space: nowrap !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translate(-50%, calc(-100% - 2px)) !important;
    transition: opacity .08s linear !important;
}
#legalmail-date-tooltip-v119::after {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    bottom: -4px !important;
    width: 8px !important;
    height: 8px !important;
    margin-left: -4px !important;
    background: #2f3033 !important;
    transform: rotate(45deg) !important;
}
#legalmail-date-tooltip-v119.is-visible {
    opacity: 1 !important;
    visibility: visible !important;
}
#legalmail-date-tooltip-v119.is-below {
    transform: translate(-50%, 0) !important;
}
#legalmail-date-tooltip-v119.is-below::after {
    top: -4px !important;
    bottom: auto !important;
}

/* v119.1 — compact Yandex-like attachment count/download stack. */
@media screen and (min-width: 600px) {
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.legalmail-has-attachment .legalmail-yandex-row {
        grid-template-columns: 30px clamp(156px, 16vw, 220px) 16px minmax(0, 1fr) 72px 30px !important;
        grid-template-areas: "avatar sender status content date attachment" !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment {
        width: 30px !important;
        min-width: 30px !important;
        max-width: 30px !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment::before {
        content: none !important;
        display: none !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment-count,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment-download {
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 28px !important;
        min-width: 28px !important;
        max-width: 28px !important;
        height: 18px !important;
        min-height: 18px !important;
        max-height: 18px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 6px !important;
        background: #f0f1f2 !important;
        color: #202124 !important;
        font-family: Roboto, Arial, sans-serif !important;
        font-size: 11px !important;
        font-style: normal !important;
        font-weight: 500 !important;
        line-height: 18px !important;
        text-align: center !important;
        box-shadow: none !important;
        overflow: hidden !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment-download {
        color: transparent !important;
        font-size: 0 !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment-download::before {
        content: "\f019" !important;
        display: block !important;
        width: 28px !important;
        height: 18px !important;
        margin: 0 !important;
        color: #202124 !important;
        font-family: Icons !important;
        font-size: 12px !important;
        font-style: normal !important;
        font-weight: 900 !important;
        line-height: 18px !important;
        text-align: center !important;
        -webkit-font-smoothing: antialiased !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment-count,
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment-download {
        background: #3b4147 !important;
        color: #f0f2f4 !important;
    }
    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment-download::before {
        color: #f0f2f4 !important;
    }
}
@media screen and (min-width: 600px) {
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment.is-visible,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.legalmail-has-attachment .legalmail-yandex-attachment {
        pointer-events: auto !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment-count {
        pointer-events: none !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment-download {
        pointer-events: auto !important;
        cursor: pointer !important;
    }
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment-download:hover {
        background: #e5e7e9 !important;
    }
}

/* ========================================================================== 
 * LegalMail v119 — paperclip-only attachments + simpler date rail
 * ========================================================================== */

/* v119 global cache-repair: v118 may have already inserted these controls before
   the new stylesheet/JS finishes loading. Never paint them at any viewport. */
html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment-count,
html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment-download {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
@media screen and (min-width: 600px) {
    /* Keep one reserved paperclip lane so dates stay perfectly aligned, but do
       not manufacture count/download tiles.  The paperclip becomes visible only
       when JS has found real attachment evidence in the native Roundcube row. */
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.legalmail-has-attachment .legalmail-yandex-row {
        grid-template-columns: 30px clamp(156px, 16vw, 220px) 16px minmax(0, 1fr) 72px 22px !important;
        grid-template-areas: "avatar sender status content date attachment" !important;
        column-gap: 8px !important;
        padding-right: 8px !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment {
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        width: 22px !important;
        min-width: 22px !important;
        max-width: 22px !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        gap: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        opacity: 0 !important;
        pointer-events: none !important;
        overflow: hidden !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment.is-visible,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.legalmail-has-attachment .legalmail-yandex-attachment {
        opacity: 1 !important;
        pointer-events: none !important;
    }

    /* v118 created these two controls. They may still exist in cached DOM, but
       v119 deliberately restores the single Yandex-like paperclip indicator. */
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment-count,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment-download {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment::before {
        content: "\f0c6" !important;
        display: block !important;
        width: 20px !important;
        min-width: 20px !important;
        max-width: 20px !important;
        height: 40px !important;
        margin: 0 !important;
        padding: 0 !important;
        color: #9ba1a7 !important;
        font-family: Icons !important;
        font-size: 17px !important;
        font-style: normal !important;
        font-weight: 900 !important;
        line-height: 40px !important;
        text-align: center !important;
        -webkit-font-smoothing: antialiased !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment::before {
        color: #969ca5 !important;
    }
}

/* ========================================================================== 
 * LegalMail v120 — attachment truth fix + tighter paperclip rail
 * ========================================================================== */
@media screen and (min-width: 600px) {
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row,
    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79.legalmail-has-attachment .legalmail-yandex-row {
        grid-template-columns: 30px clamp(156px, 16vw, 220px) 16px minmax(0, 1fr) 72px 18px !important;
        grid-template-areas: "avatar sender status content date attachment" !important;
        column-gap: 6px !important;
        padding-right: 2px !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment {
        width: 18px !important;
        min-width: 18px !important;
        max-width: 18px !important;
        justify-content: flex-end !important;
        overflow: visible !important;
    }

    html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-attachment::before {
        width: 18px !important;
        min-width: 18px !important;
        max-width: 18px !important;
        font-size: 16px !important;
        text-align: right !important;
    }
}

/* ========================================================================== 
 * LegalMail v120 — Yandex-like attachment cards in the message reader
 * ========================================================================== */
html body.task-mail.action-show .legalmail-attachment-summary,
html body.task-mail.action-preview .legalmail-attachment-summary {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 7px !important;
    margin: 0 0 8px !important;
    min-height: 24px !important;
    color: #61666c !important;
    font-family: Roboto, Arial, sans-serif !important;
    font-size: 12px !important;
    line-height: 20px !important;
}

html body.task-mail.action-show .legalmail-attachment-summary-count,
html body.task-mail.action-preview .legalmail-attachment-summary-count {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
}

html body.task-mail.action-show .legalmail-attachment-summary-count::before,
html body.task-mail.action-preview .legalmail-attachment-summary-count::before {
    content: "\f0c6" !important;
    font-family: Icons !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    color: #8f969d !important;
    -webkit-font-smoothing: antialiased !important;
}

html body.task-mail.action-show .legalmail-attachment-summary-types,
html body.task-mail.action-preview .legalmail-attachment-summary-types {
    display: inline-flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
}

html body.task-mail.action-show .legalmail-attachment-type-chip,
html body.task-mail.action-preview .legalmail-attachment-type-chip,
html body.task-mail.action-show .legalmail-attachment-type-more,
html body.task-mail.action-preview .legalmail-attachment-type-more {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 28px !important;
    height: 18px !important;
    padding: 0 5px !important;
    border-radius: 5px !important;
    background: #eef0f2 !important;
    color: #656b72 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 18px !important;
    letter-spacing: .02em !important;
}

html body.task-mail.action-show #attachment-list.attachmentslist,
html body.task-mail.action-preview #attachment-list.attachmentslist {
    display: flex !important;
    align-items: stretch !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    overflow: visible !important;
}

html body.task-mail.action-show #attachment-list.attachmentslist > li.legalmail-yandex-attachment-card,
html body.task-mail.action-preview #attachment-list.attachmentslist > li.legalmail-yandex-attachment-card {
    box-sizing: border-box !important;
    position: relative !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 24px !important;
    grid-template-rows: auto 18px !important;
    grid-template-areas: "filename menu" "type menu" !important;
    align-items: center !important;
    column-gap: 6px !important;
    row-gap: 5px !important;
    width: auto !important;
    min-width: 116px !important;
    max-width: 190px !important;
    min-height: 60px !important;
    margin: 0 !important;
    padding: 7px 7px 7px 9px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: #f0f1f2 !important;
    box-shadow: none !important;
    white-space: normal !important;
    line-height: normal !important;
    overflow: hidden !important;
}

html body.task-mail.action-show #attachment-list.attachmentslist > li.legalmail-yandex-attachment-card::before,
html body.task-mail.action-preview #attachment-list.attachmentslist > li.legalmail-yandex-attachment-card::before {
    display: none !important;
    content: none !important;
}

html body.task-mail.action-show #attachment-list > li.legalmail-yandex-attachment-card > a.filename,
html body.task-mail.action-preview #attachment-list > li.legalmail-yandex-attachment-card > a.filename {
    grid-area: filename !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    line-height: 16px !important;
    text-decoration: none !important;
}

html body.task-mail.action-show #attachment-list > li.legalmail-yandex-attachment-card .attachment-name,
html body.task-mail.action-preview #attachment-list > li.legalmail-yandex-attachment-card .attachment-name {
    display: -webkit-box !important;
    overflow: hidden !important;
    color: #202124 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 16px !important;
    white-space: normal !important;
    text-overflow: ellipsis !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
}

html body.task-mail.action-show #attachment-list > li.legalmail-yandex-attachment-card .attachment-size,
html body.task-mail.action-preview #attachment-list > li.legalmail-yandex-attachment-card .attachment-size {
    display: none !important;
}

html body.task-mail.action-show #attachment-list > li.legalmail-yandex-attachment-card .legalmail-filetype-badge,
html body.task-mail.action-preview #attachment-list > li.legalmail-yandex-attachment-card .legalmail-filetype-badge {
    grid-area: type !important;
    justify-self: start !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 27px !important;
    height: 17px !important;
    padding: 0 4px !important;
    border-radius: 4px !important;
    background: #7b8188 !important;
    color: #fff !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    line-height: 17px !important;
    letter-spacing: .02em !important;
    white-space: nowrap !important;
}

html body.task-mail.action-show #attachment-list .legalmail-filetype-badge[data-type="PDF"],
html body.task-mail.action-preview #attachment-list .legalmail-filetype-badge[data-type="PDF"] { background: #e32636 !important; }
html body.task-mail.action-show #attachment-list .legalmail-filetype-badge[data-type="DOC"],
html body.task-mail.action-show #attachment-list .legalmail-filetype-badge[data-type="DOCX"],
html body.task-mail.action-preview #attachment-list .legalmail-filetype-badge[data-type="DOC"],
html body.task-mail.action-preview #attachment-list .legalmail-filetype-badge[data-type="DOCX"] { background: #2457d6 !important; }
html body.task-mail.action-show #attachment-list .legalmail-filetype-badge[data-type="XLS"],
html body.task-mail.action-show #attachment-list .legalmail-filetype-badge[data-type="XLSX"],
html body.task-mail.action-preview #attachment-list .legalmail-filetype-badge[data-type="XLS"],
html body.task-mail.action-preview #attachment-list .legalmail-filetype-badge[data-type="XLSX"] { background: #1f8b4c !important; }
html body.task-mail.action-show #attachment-list .legalmail-filetype-badge[data-type="ZIP"],
html body.task-mail.action-show #attachment-list .legalmail-filetype-badge[data-type="RAR"],
html body.task-mail.action-preview #attachment-list .legalmail-filetype-badge[data-type="ZIP"],
html body.task-mail.action-preview #attachment-list .legalmail-filetype-badge[data-type="RAR"] { background: #b87516 !important; }

html body.task-mail.action-show #attachment-list > li.legalmail-yandex-attachment-card > a.dropdown,
html body.task-mail.action-preview #attachment-list > li.legalmail-yandex-attachment-card > a.dropdown,
html body.task-mail.action-show #attachment-list > li.legalmail-yandex-attachment-card > a.delete,
html body.task-mail.action-preview #attachment-list > li.legalmail-yandex-attachment-card > a.delete {
    grid-area: menu !important;
    align-self: center !important;
    justify-self: center !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 24px !important;
}

html.dark-mode body.task-mail.action-show .legalmail-attachment-summary,
html.dark-mode body.task-mail.action-preview .legalmail-attachment-summary {
    color: #aeb4bb !important;
}
html.dark-mode body.task-mail.action-show .legalmail-attachment-summary-count::before,
html.dark-mode body.task-mail.action-preview .legalmail-attachment-summary-count::before {
    color: #9ca3aa !important;
}
html.dark-mode body.task-mail.action-show #attachment-list.attachmentslist > li.legalmail-yandex-attachment-card,
html.dark-mode body.task-mail.action-preview #attachment-list.attachmentslist > li.legalmail-yandex-attachment-card {
    background: #343a40 !important;
}
html.dark-mode body.task-mail.action-show #attachment-list > li.legalmail-yandex-attachment-card .attachment-name,
html.dark-mode body.task-mail.action-preview #attachment-list > li.legalmail-yandex-attachment-card .attachment-name {
    color: #f1f3f4 !important;
}
html.dark-mode body.task-mail.action-show .legalmail-attachment-type-chip,
html.dark-mode body.task-mail.action-preview .legalmail-attachment-type-chip,
html.dark-mode body.task-mail.action-show .legalmail-attachment-type-more,
html.dark-mode body.task-mail.action-preview .legalmail-attachment-type-more {
    background: #3d444b !important;
    color: #d8dde2 !important;
}

/* ========================================================================== 
 * LegalMail v120 — full-page Roundcube error state
 * ========================================================================== */

/* Error pages are rendered by templates/error.html for different tasks
 * (including CSRF/session errors whose URL can still say _task=login).  The
 * explicit body marker keeps styling independent of env:error_task details. */
body.legalmail-error-screen {
    background:
        radial-gradient(circle at 14% 10%, rgba(196, 210, 225, .60), transparent 34%),
        radial-gradient(circle at 88% 90%, rgba(232, 216, 202, .55), transparent 38%),
        linear-gradient(135deg, var(--lm71-bg-a, #eef2f6), var(--lm71-bg-b, #f7f2ed)) !important;
}

body.legalmail-error-screen #layout-content.legalmail-error-page {
    min-width: 0 !important;
    background: #fff !important;
}

body.legalmail-error-screen #layout-content.legalmail-error-page > .legalmail-error-header {
    border-bottom: 1px solid rgba(32, 36, 40, .07) !important;
    background: #fff !important;
}

body.legalmail-error-screen .legalmail-error-content {
    background: #f7f8fa !important;
}

body.legalmail-error-screen .legalmail-error-shell {
    box-sizing: border-box;
    width: 100%;
    min-height: 100%;
    padding: clamp(28px, 5vw, 72px) clamp(18px, 4vw, 56px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

body.legalmail-error-screen .legalmail-error-card {
    box-sizing: border-box;
    width: min(760px, 100%);
    padding: 0;
    overflow: hidden;
    border: 1px solid #e4e7eb;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(30, 35, 45, .08), 0 2px 8px rgba(30, 35, 45, .04);
}

/* Roundcube converts boxerror/boxwarning/... into Bootstrap .ui.alert during
 * startup.  Keep both forms covered so the page looks correct before and after
 * that conversion and also if JavaScript fails to initialise. */
body.legalmail-error-screen .legalmail-error-card > .ui.alert,
body.legalmail-error-screen .legalmail-error-card > .boxerror,
body.legalmail-error-screen .legalmail-error-card > .boxwarning,
body.legalmail-error-screen .legalmail-error-card > .boxinformation,
body.legalmail-error-screen .legalmail-error-card > .boxconfirmation {
    position: relative !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 26px 28px 26px 82px !important;
    border: 0 !important;
    border-radius: 18px !important;
    background: #fff !important;
    color: #2b3035 !important;
    box-shadow: none !important;
    opacity: 1 !important;
    line-height: 1.55 !important;
    display: block !important;
}

body.legalmail-error-screen .legalmail-error-card > .ui.alert::after,
body.legalmail-error-screen .legalmail-error-card > .boxerror::after,
body.legalmail-error-screen .legalmail-error-card > .boxwarning::after,
body.legalmail-error-screen .legalmail-error-card > .boxinformation::after,
body.legalmail-error-screen .legalmail-error-card > .boxconfirmation::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 18px 0 0 18px;
    background: #78838d;
}

body.legalmail-error-screen .legalmail-error-card > .boxerror::after,
body.legalmail-error-screen .legalmail-error-card > .ui.alert.alert-danger::after {
    background: #cf6565;
}

body.legalmail-error-screen .legalmail-error-card > .boxwarning::after,
body.legalmail-error-screen .legalmail-error-card > .ui.alert.alert-warning::after {
    background: #d8a64f;
}

body.legalmail-error-screen .legalmail-error-card > .boxinformation::after,
body.legalmail-error-screen .legalmail-error-card > .ui.alert.alert-info::after {
    background: #78a9cc;
}

body.legalmail-error-screen .legalmail-error-card > .boxconfirmation::after,
body.legalmail-error-screen .legalmail-error-card > .ui.alert.alert-success::after {
    background: #64a873;
}

/* Native Elastic error icon becomes a quiet circular status badge. */
body.legalmail-error-screen .legalmail-error-card > .ui.alert > i.icon {
    position: absolute !important;
    left: 28px !important;
    top: 27px !important;
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background: #faeaea !important;
    color: #ad4b4b !important;
    font-size: 16px !important;
    line-height: 36px !important;
    text-align: center !important;
}

body.legalmail-error-screen .legalmail-error-card > .ui.alert > i.icon::before {
    float: none !important;
    display: block !important;
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    line-height: 36px !important;
    color: inherit !important;
}

body.legalmail-error-screen .legalmail-error-card > .ui.alert.alert-warning > i.icon {
    background: #faf1df !important;
    color: #9b742f !important;
}
body.legalmail-error-screen .legalmail-error-card > .ui.alert.alert-info > i.icon {
    background: #eaf3f9 !important;
    color: #537f9f !important;
}
body.legalmail-error-screen .legalmail-error-card > .ui.alert.alert-success > i.icon {
    background: #e8f4eb !important;
    color: #4c8f5b !important;
}

body.legalmail-error-screen .legalmail-error-card h2,
body.legalmail-error-screen .legalmail-error-card h3 {
    margin: 0 0 6px !important;
    color: #252a2f !important;
    font-size: 18px !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
}

body.legalmail-error-screen .legalmail-error-card p {
    margin: 0 0 10px !important;
    color: #555e67 !important;
    font-size: 14px !important;
    line-height: 1.55 !important;
}
body.legalmail-error-screen .legalmail-error-card p:last-child {
    margin-bottom: 0 !important;
}
body.legalmail-error-screen .legalmail-error-card a:not(.btn) {
    color: #3d6685 !important;
    text-decoration: none !important;
}
body.legalmail-error-screen .legalmail-error-card a:not(.btn):hover {
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
}

/* Desktop: use the same compact application rail and rounded work surface as
 * Mail/Contacts/Settings, even when the underlying error task is "login". */
@media screen and (min-width: 1201px) {
    body.legalmail-error-screen #layout {
        position: relative !important;
        width: 100% !important;
        height: 100vh !important;
        min-height: 0 !important;
        padding: 10px !important;
        gap: 10px !important;
        overflow: hidden !important;
        background: transparent !important;
    }

    body.legalmail-error-screen #layout-menu {
        position: relative !important;
        inset: auto !important;
        z-index: 90 !important;
        flex: 0 0 58px !important;
        width: 58px !important;
        min-width: 58px !important;
        max-width: 58px !important;
        height: 100% !important;
        margin: 0 !important;
        overflow: hidden !important;
        border: 0 !important;
        border-radius: 18px !important;
        background: linear-gradient(180deg, #292b31, #1f2025) !important;
        box-shadow: var(--lm71-shadow, 0 8px 28px rgba(30,35,45,.08)) !important;
        display: flex !important;
        flex-direction: column !important;
    }

    body.legalmail-error-screen #layout-menu .popover-header {
        flex: 0 0 56px !important;
        width: 58px !important;
        height: 56px !important;
        min-height: 56px !important;
        padding: 0 !important;
        margin: 0 !important;
        line-height: 56px !important;
        border: 0 !important;
        background: transparent !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    body.legalmail-error-screen #layout-menu .popover-header img,
    body.legalmail-error-screen #layout-menu #logo {
        width: 34px !important;
        height: 34px !important;
        max-width: 34px !important;
        max-height: 34px !important;
        padding: 0 !important;
        object-fit: contain !important;
        filter: drop-shadow(0 2px 5px rgba(0,0,0,.18));
    }

    body.legalmail-error-screen #taskmenu {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        width: 58px !important;
        padding: 2px 0 6px !important;
        overflow: hidden !important;
        background: transparent !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    body.legalmail-error-screen #taskmenu > span.action-buttons {
        flex: 0 0 auto !important;
        width: 58px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    body.legalmail-error-screen #taskmenu > a,
    body.legalmail-error-screen #taskmenu > span > a {
        position: relative !important;
        flex: 0 0 42px !important;
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        margin: 3px 8px !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 13px !important;
        color: #c8cbd1 !important;
        background: transparent !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
    }

    body.legalmail-error-screen #taskmenu a::before {
        float: none !important;
        display: block !important;
        flex: 0 0 42px !important;
        width: 42px !important;
        height: 42px !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 42px !important;
        text-align: center !important;
    }

    body.legalmail-error-screen #taskmenu a .inner {
        display: none !important;
    }

    body.legalmail-error-screen #taskmenu a:hover,
    body.legalmail-error-screen #taskmenu a.selected {
        color: #fff !important;
        background: rgba(255,255,255,.12) !important;
    }

    body.legalmail-error-screen #taskmenu .special-buttons {
        flex: 0 0 auto !important;
        width: 58px !important;
        margin: auto 0 0 !important;
        padding: 0 0 2px !important;
        background: transparent !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-end !important;
    }

    body.legalmail-error-screen #layout-content.legalmail-error-page {
        flex: 1 1 auto !important;
        width: auto !important;
        height: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        border: 1px solid rgba(255,255,255,.80) !important;
        border-radius: 18px !important;
        box-shadow: var(--lm71-shadow, 0 8px 28px rgba(30,35,45,.08)) !important;
        overflow: hidden !important;
        background: #fff !important;
    }

    body.legalmail-error-screen #layout-content.legalmail-error-page > .legalmail-error-header {
        display: none !important;
    }

    body.legalmail-error-screen #layout-content.legalmail-error-page > .legalmail-error-content {
        height: 100% !important;
        max-height: 100% !important;
    }
}

/* Framed/plugin errors don't get the full application rail, only the clean
 * neutral card so dialogs/iframes remain compact. */
body.legalmail-error-screen #layout-content.legalmail-error-page-framed {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

html.dark-mode body.legalmail-error-screen {
    background: #171a1d !important;
}
html.dark-mode body.legalmail-error-screen #layout-content.legalmail-error-page,
html.dark-mode body.legalmail-error-screen #layout-content.legalmail-error-page > .legalmail-error-header {
    border-color: #343a40 !important;
    background: #22262a !important;
}
html.dark-mode body.legalmail-error-screen .legalmail-error-content {
    background: #1b1f22 !important;
}
html.dark-mode body.legalmail-error-screen .legalmail-error-card {
    border-color: #373d43 !important;
    background: #262a2e !important;
    box-shadow: 0 14px 36px rgba(0,0,0,.24) !important;
}
html.dark-mode body.legalmail-error-screen .legalmail-error-card > .ui.alert,
html.dark-mode body.legalmail-error-screen .legalmail-error-card > .boxerror,
html.dark-mode body.legalmail-error-screen .legalmail-error-card > .boxwarning,
html.dark-mode body.legalmail-error-screen .legalmail-error-card > .boxinformation,
html.dark-mode body.legalmail-error-screen .legalmail-error-card > .boxconfirmation {
    background: #262a2e !important;
    color: #e8ebed !important;
}
html.dark-mode body.legalmail-error-screen .legalmail-error-card h2,
html.dark-mode body.legalmail-error-screen .legalmail-error-card h3 {
    color: #f1f3f4 !important;
}
html.dark-mode body.legalmail-error-screen .legalmail-error-card p {
    color: #b7bec4 !important;
}
html.dark-mode body.legalmail-error-screen .legalmail-error-card a:not(.btn) {
    color: #8db7d4 !important;
}

@media screen and (max-width: 1200px) {
    body.legalmail-error-screen .legalmail-error-shell {
        padding: 24px 18px;
    }
}

@media screen and (max-width: 520px) {
    body.legalmail-error-screen .legalmail-error-shell {
        padding: 14px 10px;
    }
    body.legalmail-error-screen .legalmail-error-card {
        border-radius: 14px;
    }
    body.legalmail-error-screen .legalmail-error-card > .ui.alert,
    body.legalmail-error-screen .legalmail-error-card > .boxerror,
    body.legalmail-error-screen .legalmail-error-card > .boxwarning,
    body.legalmail-error-screen .legalmail-error-card > .boxinformation,
    body.legalmail-error-screen .legalmail-error-card > .boxconfirmation {
        padding: 20px 18px 20px 66px !important;
        border-radius: 14px !important;
    }
    body.legalmail-error-screen .legalmail-error-card > .ui.alert > i.icon {
        left: 18px !important;
        top: 20px !important;
        width: 32px !important;
        height: 32px !important;
        line-height: 32px !important;
    }
    body.legalmail-error-screen .legalmail-error-card > .ui.alert > i.icon::before {
        width: 32px !important;
        height: 32px !important;
        line-height: 32px !important;
    }
    body.legalmail-error-screen .legalmail-error-card h2,
    body.legalmail-error-screen .legalmail-error-card h3 {
        font-size: 16px !important;
    }
}

/* ========================================================================== 
 * LegalMail v120 — dark-mode opened-message metadata = compose header style
 * Scope intentionally limited to the metadata block inside an opened message.
 * No template/JS/light-theme changes.
 * ========================================================================== */
html.dark-mode body.task-mail.action-show #message-header > .header {
    padding: 14px 16px 12px !important;
    border: 1px solid #34383e !important;
    border-radius: 16px !important;
    background: #202226 !important;
    color: #edf0f2 !important;
    box-shadow: none !important;
}

html.dark-mode body.task-mail.action-show #message-header > .header img.contactphoto {
    background: #292c31 !important;
    border: 1px solid #34383e !important;
}

html.dark-mode body.task-mail.action-show #message-header .header-summary,
html.dark-mode body.task-mail.action-show #message-header .header-headers td:not(.header-title),
html.dark-mode body.task-mail.action-show #message-header .header-headers th:not(.header-title),
html.dark-mode body.task-mail.action-show #message-header .header-headers td.header:not(.header-title) {
    min-height: 38px !important;
    padding: 8px 12px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: #292c31 !important;
    color: #edf0f2 !important;
    -webkit-text-fill-color: #edf0f2 !important;
    box-shadow: none !important;
}

html.dark-mode body.task-mail.action-show #message-header .header-headers .header-title {
    background: transparent !important;
    color: #7f8b99 !important;
    -webkit-text-fill-color: #7f8b99 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

html.dark-mode body.task-mail.action-show #message-header .header-summary a,
html.dark-mode body.task-mail.action-show #message-header .header-headers tr:first-child td:not(.header-title) a,
html.dark-mode body.task-mail.action-show #message-header .header-headers tr:first-child th:not(.header-title) a {
    color: #29a3e6 !important;
    -webkit-text-fill-color: #29a3e6 !important;
}

html.dark-mode body.task-mail.action-show #message-header .header-headers tr:not(:first-child) td:not(.header-title) a,
html.dark-mode body.task-mail.action-show #message-header .header-headers tr:not(:first-child) th:not(.header-title) a,
html.dark-mode body.task-mail.action-show #message-header .header-headers tr:not(:first-child) td:not(.header-title) a:hover,
html.dark-mode body.task-mail.action-show #message-header .header-headers tr:not(:first-child) th:not(.header-title) a:hover {
    color: #edf0f2 !important;
    -webkit-text-fill-color: #edf0f2 !important;
}

html.dark-mode body.task-mail.action-show #message-header .header-links {
    margin-top: 8px !important;
}

html.dark-mode body.task-mail.action-show #message-header .header-links a {
    border-color: #3a3f46 !important;
    background: #292c31 !important;
    color: #cbd2d9 !important;
    -webkit-text-fill-color: #cbd2d9 !important;
    box-shadow: none !important;
}

html.dark-mode body.task-mail.action-show #message-header .header-links a:hover,
html.dark-mode body.task-mail.action-show #message-header .header-links a:focus {
    border-color: #454b53 !important;
    background: #34383e !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

@media screen and (max-width: 640px) {
    html.dark-mode body.task-mail.action-show #message-header > .header {
        padding: 12px !important;
        border-radius: 13px !important;
    }

    html.dark-mode body.task-mail.action-show #message-header .header-headers td.header:not(.header-title) {
        padding: 8px 10px !important;
        border-radius: 9px !important;
        background: #292c31 !important;
        color: #edf0f2 !important;
        -webkit-text-fill-color: #edf0f2 !important;
    }
}


/* ========================================================================== 
 * LegalMail v120 final — reader navigation + dark reader toolbar polish
 * Scope: opened-message controls only. No layout/template structure changes.
 * ========================================================================== */

/* Previous / Next: keep both controls fully inside the message card. */
html body.task-mail.action-show .yandex-message-nav {
    top: 12px !important;
    right: 16px !important;
    z-index: 5 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

html body.task-mail.action-show .yandex-message-nav > a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 12px !important;
    border: 1px solid #dfe4e8 !important;
    border-radius: 10px !important;
    background: #f5f7f9 !important;
    color: #4e5964 !important;
    -webkit-text-fill-color: #4e5964 !important;
    text-decoration: none !important;
    font-size: 13px !important;
    line-height: 34px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

html body.task-mail.action-show .yandex-message-nav > a::before {
    height: 34px !important;
    line-height: 34px !important;
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
}

html body.task-mail.action-show .yandex-message-nav > a:not(.disabled):hover,
html body.task-mail.action-show .yandex-message-nav > a:not(.disabled):focus-visible {
    border-color: #cfd7de !important;
    background: #eaf0f5 !important;
    color: #20262c !important;
    -webkit-text-fill-color: #20262c !important;
    outline: none !important;
}

html body.task-mail.action-show .yandex-message-nav > a.disabled {
    border-color: #e7eaed !important;
    background: #f7f8f9 !important;
    color: #a1a8af !important;
    -webkit-text-fill-color: #a1a8af !important;
    opacity: 1 !important;
    cursor: default !important;
}

/* Reserve enough room for two real buttons on desktop. */
html body.task-mail.action-show #message-header > .subject {
    padding-right: 220px !important;
}

/* Same controls in dark mode. */
html.dark-mode body.task-mail.action-show .yandex-message-nav > a {
    border-color: #3a3f46 !important;
    background: #292c31 !important;
    color: #dbe0e5 !important;
    -webkit-text-fill-color: #dbe0e5 !important;
}

html.dark-mode body.task-mail.action-show .yandex-message-nav > a:not(.disabled):hover,
html.dark-mode body.task-mail.action-show .yandex-message-nav > a:not(.disabled):focus-visible {
    border-color: #4b525a !important;
    background: #34383e !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html.dark-mode body.task-mail.action-show .yandex-message-nav > a.disabled {
    border-color: #30343a !important;
    background: #24272b !important;
    color: #737b84 !important;
    -webkit-text-fill-color: #737b84 !important;
}

/* Reader action toolbar in dark mode: visible, button-like controls instead of
   low-contrast glyphs on the dark header. */
html.dark-mode body.task-mail.action-show #layout-content.yandex-message-view > .header {
    border-bottom-color: #34383e !important;
    background: #202226 !important;
}

html.dark-mode body.task-mail.action-show #layout-content.yandex-message-view > .header #mailtoolbar.yandex-mailtoolbar {
    gap: 5px !important;
}

html.dark-mode body.task-mail.action-show #mailtoolbar.yandex-mailtoolbar > a:not(.compose),
html.dark-mode body.task-mail.action-show #mailtoolbar.yandex-mailtoolbar > .dropbutton > a {
    min-height: 36px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    border: 1px solid #343940 !important;
    border-radius: 9px !important;
    background: #292c31 !important;
    color: #e8ebed !important;
    -webkit-text-fill-color: #e8ebed !important;
    fill: #e8ebed !important;
    stroke: #e8ebed !important;
    box-shadow: none !important;
    filter: none !important;
}

html.dark-mode body.task-mail.action-show #mailtoolbar.yandex-mailtoolbar > a:not(.compose) *,
html.dark-mode body.task-mail.action-show #mailtoolbar.yandex-mailtoolbar > .dropbutton > a *,
html.dark-mode body.task-mail.action-show #mailtoolbar.yandex-mailtoolbar > a:not(.compose)::before,
html.dark-mode body.task-mail.action-show #mailtoolbar.yandex-mailtoolbar > a:not(.compose)::after,
html.dark-mode body.task-mail.action-show #mailtoolbar.yandex-mailtoolbar > .dropbutton > a::before,
html.dark-mode body.task-mail.action-show #mailtoolbar.yandex-mailtoolbar > .dropbutton > a::after {
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
    fill: currentColor !important;
    stroke: currentColor !important;
    filter: none !important;
}

html.dark-mode body.task-mail.action-show #mailtoolbar.yandex-mailtoolbar > a:not(.compose):not(.disabled):hover,
html.dark-mode body.task-mail.action-show #mailtoolbar.yandex-mailtoolbar > a:not(.compose):not(.disabled):focus-visible,
html.dark-mode body.task-mail.action-show #mailtoolbar.yandex-mailtoolbar > a:not(.compose)[aria-expanded="true"],
html.dark-mode body.task-mail.action-show #mailtoolbar.yandex-mailtoolbar > .dropbutton > a:not(.disabled):hover,
html.dark-mode body.task-mail.action-show #mailtoolbar.yandex-mailtoolbar > .dropbutton > a:not(.disabled):focus-visible,
html.dark-mode body.task-mail.action-show #mailtoolbar.yandex-mailtoolbar > .dropbutton > a[aria-expanded="true"] {
    border-color: #4b525a !important;
    background: #34383e !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    fill: #ffffff !important;
    stroke: #ffffff !important;
    outline: none !important;
}

html.dark-mode body.task-mail.action-show #mailtoolbar.yandex-mailtoolbar > a.disabled,
html.dark-mode body.task-mail.action-show #mailtoolbar.yandex-mailtoolbar > .dropbutton > a.disabled {
    border-color: #30343a !important;
    background: #24272b !important;
    color: #747c85 !important;
    -webkit-text-fill-color: #747c85 !important;
    fill: #747c85 !important;
    stroke: #747c85 !important;
    opacity: 1 !important;
}

/* On compact widths navigation already enters normal flow; keep the new button
   treatment but remove the old negative margin that pushed it into the edge. */
@media screen and (max-width: 900px) {
    html body.task-mail.action-show #message-header > .subject {
        padding-right: 0 !important;
    }
    html body.task-mail.action-show .yandex-message-nav {
        position: static !important;
        width: 100% !important;
        justify-content: flex-end !important;
        margin: 0 0 10px !important;
    }
}

@media screen and (max-width: 420px) {
    html body.task-mail.action-show .yandex-message-nav {
        justify-content: flex-start !important;
        gap: 5px !important;
        overflow-x: auto !important;
    }
    html body.task-mail.action-show .yandex-message-nav > a {
        flex: 0 0 auto !important;
    }
}

/* LegalMail v120 — dark popup menu contrast/final polish.
   Keep Roundcube menu behaviour intact; only normalize visual states. */
html.dark-mode body.task-mail .popupmenu {
    background: #181b1f !important;
    border: 1px solid #3b424a !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .38) !important;
    color: #f2f5f7 !important;
    overflow: hidden;
}

html.dark-mode body.task-mail .popupmenu > .menu.listing,
html.dark-mode body.task-mail .popupmenu .menu.listing {
    background: transparent !important;
    color: #f2f5f7 !important;
}

html.dark-mode body.task-mail .popupmenu .menu.listing > li {
    background: transparent !important;
    border-color: #30363d !important;
}

html.dark-mode body.task-mail .popupmenu .menu.listing > li > a,
html.dark-mode body.task-mail .popupmenu .menu.listing > li > a.active {
    min-height: 35px;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    color: #f2f5f7 !important;
    -webkit-text-fill-color: #f2f5f7 !important;
    background: transparent !important;
    opacity: 1 !important;
}

html.dark-mode body.task-mail .popupmenu .menu.listing > li > a::before,
html.dark-mode body.task-mail .popupmenu .menu.listing > li > a.active::before,
html.dark-mode body.task-mail .popupmenu .menu.listing > li > a[aria-haspopup]::after,
html.dark-mode body.task-mail .popupmenu .menu.listing > li > a .inner::before,
html.dark-mode body.task-mail .popupmenu .menu.listing > li > a .folder-selector-link::after {
    color: #dfe7ec !important;
    -webkit-text-fill-color: #dfe7ec !important;
    opacity: 1 !important;
    filter: none !important;
}

html.dark-mode body.task-mail .popupmenu .menu.listing > li > a:not(.disabled):hover,
html.dark-mode body.task-mail .popupmenu .menu.listing > li > a:not(.disabled):focus,
html.dark-mode body.task-mail .popupmenu .menu.listing > li > a:not(.disabled):focus-visible {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: #2a3036 !important;
    outline: none !important;
}

html.dark-mode body.task-mail .popupmenu .menu.listing > li > a:not(.disabled):hover::before,
html.dark-mode body.task-mail .popupmenu .menu.listing > li > a:not(.disabled):focus::before,
html.dark-mode body.task-mail .popupmenu .menu.listing > li > a:not(.disabled):hover[aria-haspopup]::after,
html.dark-mode body.task-mail .popupmenu .menu.listing > li > a:not(.disabled):focus[aria-haspopup]::after {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

/* Disabled commands must still be readable as labels, but clearly inactive. */
html.dark-mode body.task-mail .popupmenu .menu.listing > li > a.disabled,
html.dark-mode body.task-mail .popupmenu .menu.listing > li > a[aria-disabled="true"] {
    color: #69737d !important;
    -webkit-text-fill-color: #69737d !important;
    background: transparent !important;
    opacity: 1 !important;
    cursor: default !important;
}

html.dark-mode body.task-mail .popupmenu .menu.listing > li > a.disabled::before,
html.dark-mode body.task-mail .popupmenu .menu.listing > li > a.disabled::after,
html.dark-mode body.task-mail .popupmenu .menu.listing > li > a.disabled .inner::before,
html.dark-mode body.task-mail .popupmenu .menu.listing > li > a[aria-disabled="true"]::before,
html.dark-mode body.task-mail .popupmenu .menu.listing > li > a[aria-disabled="true"]::after {
    color: #56606a !important;
    -webkit-text-fill-color: #56606a !important;
    opacity: 1 !important;
    filter: none !important;
}

html.dark-mode body.task-mail .popupmenu .menu.listing > li.separator {
    border-color: #30363d !important;
    color: #8e99a4 !important;
}


/* LegalMail v120 — compose toolbar dark-mode contrast fix.
   The compose template historically carried a hard-coded dark foreground.
   Keep the light theme unchanged and give the compose toolbar its own dark
   palette, including active/hover/disabled states. */
html.dark-mode body.task-mail.action-compose {
    --lm-compose-toolbar-fg: #e8ebed;
}

html.dark-mode body.task-mail.action-compose #layout-content.legalmail-compose-view > .header {
    background: #202226 !important;
    border-bottom-color: #34383e !important;
}

html.dark-mode body.task-mail.action-compose #messagetoolbar {
    gap: 5px !important;
    color: #e8ebed !important;
}

html.dark-mode body.task-mail.action-compose #messagetoolbar > a,
html.dark-mode body.task-mail.action-compose #messagetoolbar > .dropbutton,
html.dark-mode body.task-mail.action-compose #messagetoolbar > .dropbutton > a,
html.dark-mode body.task-mail.action-compose #messagetoolbar #compose-toolbar > a,
html.dark-mode body.task-mail.action-compose #messagetoolbar #compose-toolbar > .dropbutton,
html.dark-mode body.task-mail.action-compose #messagetoolbar #compose-toolbar > .dropbutton > a {
    border-color: #343940 !important;
    background: #292c31 !important;
    color: #e8ebed !important;
    -webkit-text-fill-color: #e8ebed !important;
    fill: #e8ebed !important;
    stroke: #e8ebed !important;
    box-shadow: none !important;
    filter: none !important;
}

html.dark-mode body.task-mail.action-compose #messagetoolbar > a,
html.dark-mode body.task-mail.action-compose #messagetoolbar > .dropbutton > a,
html.dark-mode body.task-mail.action-compose #messagetoolbar #compose-toolbar > a,
html.dark-mode body.task-mail.action-compose #messagetoolbar #compose-toolbar > .dropbutton > a {
    min-height: 48px !important;
    padding: 5px 10px !important;
    border: 1px solid #343940 !important;
    border-radius: 9px !important;
    box-sizing: border-box !important;
}

html.dark-mode body.task-mail.action-compose #messagetoolbar a:not(.disabled) *,
html.dark-mode body.task-mail.action-compose #messagetoolbar a:not(.disabled)::before,
html.dark-mode body.task-mail.action-compose #messagetoolbar a:not(.disabled)::after,
html.dark-mode body.task-mail.action-compose #messagetoolbar a:not(.disabled) .inner::before,
html.dark-mode body.task-mail.action-compose #messagetoolbar a:not(.disabled) .inner::after {
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
    fill: currentColor !important;
    stroke: currentColor !important;
    filter: none !important;
}

html.dark-mode body.task-mail.action-compose #messagetoolbar > a:not(.disabled):hover,
html.dark-mode body.task-mail.action-compose #messagetoolbar > a:not(.disabled):focus-visible,
html.dark-mode body.task-mail.action-compose #messagetoolbar > a:not(.disabled)[aria-expanded="true"],
html.dark-mode body.task-mail.action-compose #messagetoolbar > a.selected:not(.disabled),
html.dark-mode body.task-mail.action-compose #messagetoolbar > .dropbutton:focus-within,
html.dark-mode body.task-mail.action-compose #messagetoolbar > .dropbutton:hover,
html.dark-mode body.task-mail.action-compose #messagetoolbar #compose-toolbar > a:not(.disabled):hover,
html.dark-mode body.task-mail.action-compose #messagetoolbar #compose-toolbar > a:not(.disabled):focus-visible,
html.dark-mode body.task-mail.action-compose #messagetoolbar #compose-toolbar > a.selected:not(.disabled) {
    border-color: #4b525a !important;
    background: #34383e !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    fill: #ffffff !important;
    stroke: #ffffff !important;
    outline: none !important;
}

/* Roundcube can leave the signature/options action in a selected/pressed
   state.  Do not let Elastic's light selected background leak into dark mode. */
html.dark-mode body.task-mail.action-compose #messagetoolbar > a.signature:not(.disabled),
html.dark-mode body.task-mail.action-compose #messagetoolbar > a.options[aria-expanded="true"],
html.dark-mode body.task-mail.action-compose #messagetoolbar > a.responses[aria-expanded="true"],
html.dark-mode body.task-mail.action-compose #messagetoolbar a.pressed:not(.disabled) {
    border-color: #4b525a !important;
    background: #34383e !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html.dark-mode body.task-mail.action-compose #messagetoolbar a.disabled,
html.dark-mode body.task-mail.action-compose #messagetoolbar a.disabled *,
html.dark-mode body.task-mail.action-compose #messagetoolbar a.disabled::before,
html.dark-mode body.task-mail.action-compose #messagetoolbar a.disabled::after {
    border-color: #30343a !important;
    background: #24272b !important;
    color: #747c85 !important;
    -webkit-text-fill-color: #747c85 !important;
    fill: #747c85 !important;
    stroke: #747c85 !important;
    opacity: 1 !important;
    filter: none !important;
}

html.dark-mode body.task-mail.action-compose #messagetoolbar .spacer {
    border-color: #34383e !important;
}

/* ========================================================================== 
 * LegalMail v120 — session/request recovery action
 * ========================================================================== */
body.legalmail-error-screen .legalmail-error-card .legalmail-session-action {
    margin: 18px 0 20px !important;
}

body.legalmail-error-screen .legalmail-error-card .legalmail-session-refresh {
    min-height: 40px !important;
    padding: 9px 18px !important;
    border: 1px solid #315f80 !important;
    border-radius: 10px !important;
    background: #315f80 !important;
    color: #fff !important;
    font-size: 14px !important;
    line-height: 20px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(49, 95, 128, .18) !important;
}

body.legalmail-error-screen .legalmail-error-card .legalmail-session-refresh:hover,
body.legalmail-error-screen .legalmail-error-card .legalmail-session-refresh:focus {
    border-color: #294f6b !important;
    background: #294f6b !important;
    color: #fff !important;
    text-decoration: none !important;
}

body.legalmail-error-screen .legalmail-error-card .legalmail-session-help {
    margin-top: 4px !important;
    padding-top: 16px !important;
    border-top: 1px solid #eceff2 !important;
    color: #737b83 !important;
    font-size: 13px !important;
}

html.dark-mode body.legalmail-error-screen .legalmail-error-card .legalmail-session-refresh {
    border-color: #5e8aa8 !important;
    background: #5e8aa8 !important;
    color: #fff !important;
}

html.dark-mode body.legalmail-error-screen .legalmail-error-card .legalmail-session-refresh:hover,
html.dark-mode body.legalmail-error-screen .legalmail-error-card .legalmail-session-refresh:focus {
    border-color: #6d99b7 !important;
    background: #6d99b7 !important;
}

html.dark-mode body.legalmail-error-screen .legalmail-error-card .legalmail-session-help {
    border-top-color: #3a4046 !important;
    color: #949da5 !important;
}

/* ========================================================================== *
 * LegalMail v120.7 — total Drafts counter
 * ========================================================================== */
body.task-mail #layout-sidebar .folderlist li.mailbox > a,
body.task-mail #layout-sidebar .folderlist li.mailbox > div > a {
    position: relative;
}

body.task-mail #layout-sidebar .folderlist li.mailbox .legalmail-draft-total-count {
    box-sizing: border-box !important;
    position: absolute !important;
    top: 7px !important;
    right: 8px !important;
    min-width: 24px !important;
    width: auto !important;
    height: 24px !important;
    line-height: 24px !important;
    margin: 0 !important;
    padding: 0 6px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: #e1e2e6 !important;
    color: #282a2e !important;
    -webkit-text-fill-color: #282a2e !important;
    box-shadow: none !important;
    text-align: center !important;
    font-size: inherit !important;
    font-weight: 700 !important;
    z-index: 2 !important;
}

/* Drafts uses total messages, not the native unread value. */
body.task-mail #layout-sidebar .folderlist li.mailbox.legalmail-draft-total-active .unreadcount {
    display: none !important;
}

html.dark-mode body.task-mail #layout-sidebar .folderlist li.mailbox .legalmail-draft-total-count {
    background: #4a474f !important;
    color: #f4f4f5 !important;
    -webkit-text-fill-color: #f4f4f5 !important;
}

@media screen and (max-width: 1200px) {
    body.task-mail.action-none #layout-sidebar .folderlist li.mailbox .legalmail-draft-total-count {
        top: 7px !important;
        right: 7px !important;
        min-width: 22px !important;
        height: 22px !important;
        line-height: 22px !important;
        padding: 0 6px !important;
        border-radius: 11px !important;
        font-size: 11px !important;
    }
}


/* ========================================================================== *
 * LegalMail v120.8 — green Save button in unsaved-compose confirmation
 * ========================================================================== */
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-save-draft-exit,
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-save-draft-exit.btn {
    background: #28a745 !important;
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-save-draft-exit:hover,
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-save-draft-exit:focus {
    background: #218838 !important;
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-save-draft-exit:focus {
    box-shadow: 0 0 0 .2rem rgba(40, 167, 69, .28) !important;
}

.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-save-draft-exit:disabled,
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-save-draft-exit.disabled {
    opacity: .65;
    cursor: wait;
}


/* ========================================================================== *
 * LegalMail v120.9 — keep Drafts total badge identical inside draft/message view
 * ========================================================================== */
/* In compose/show/preview Elastic applies different sidebar counter rules.
 * Keep our total Drafts counter visually identical to the compact mailbox view. */
body.task-mail.action-compose #layout-sidebar .folderlist li.mailbox .legalmail-draft-total-count,
body.task-mail.action-show #layout-sidebar .folderlist li.mailbox .legalmail-draft-total-count,
body.task-mail.action-preview #layout-sidebar .folderlist li.mailbox .legalmail-draft-total-count {
    box-sizing: border-box !important;
    position: absolute !important;
    top: 7px !important;
    right: 8px !important;
    min-width: 24px !important;
    width: auto !important;
    height: 24px !important;
    line-height: 24px !important;
    margin: 0 !important;
    padding: 0 6px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: #e1e2e6 !important;
    color: #282a2e !important;
    -webkit-text-fill-color: #282a2e !important;
    box-shadow: none !important;
    text-align: center !important;
    font-size: inherit !important;
    font-weight: 700 !important;
    z-index: 2 !important;
}

html.dark-mode body.task-mail.action-compose #layout-sidebar .folderlist li.mailbox .legalmail-draft-total-count,
html.dark-mode body.task-mail.action-show #layout-sidebar .folderlist li.mailbox .legalmail-draft-total-count,
html.dark-mode body.task-mail.action-preview #layout-sidebar .folderlist li.mailbox .legalmail-draft-total-count {
    background: #4a474f !important;
    color: #f4f4f5 !important;
    -webkit-text-fill-color: #f4f4f5 !important;
}


/* ========================================================================== *
 * LegalMail v120.10 — Drafts badge in the compose/draft sidebar
 * ========================================================================== */
/*
 * compose.html uses #legalmail-folder-sidebar + #compose-mailboxlist instead
 * of #layout-sidebar + #mailboxlist.  v120.9 only targeted #layout-sidebar,
 * so the counter span was present but rendered inline (e.g. "Черновики1").
 * Target both sidebar variants directly and do not depend on the action class.
 */
body.task-mail #legalmail-folder-sidebar .folderlist li.mailbox > a,
body.task-mail #legalmail-folder-sidebar .folderlist li.mailbox > div > a,
body.task-mail #compose-mailboxlist li.mailbox > a,
body.task-mail #compose-mailboxlist li.mailbox > div > a {
    position: relative !important;
}

body.task-mail #legalmail-folder-sidebar .folderlist li.mailbox .legalmail-draft-total-count,
body.task-mail #compose-mailboxlist li.mailbox .legalmail-draft-total-count {
    box-sizing: border-box !important;
    display: block !important;
    position: absolute !important;
    top: 7px !important;
    right: 8px !important;
    min-width: 24px !important;
    width: auto !important;
    height: 24px !important;
    line-height: 24px !important;
    margin: 0 !important;
    padding: 0 6px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: #e1e2e6 !important;
    color: #282a2e !important;
    -webkit-text-fill-color: #282a2e !important;
    box-shadow: none !important;
    text-align: center !important;
    font-size: inherit !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    z-index: 3 !important;
}

/* Never show Roundcube's unread counter next to our total Drafts counter. */
body.task-mail #legalmail-folder-sidebar .folderlist li.mailbox.legalmail-draft-total-active .unreadcount,
body.task-mail #compose-mailboxlist li.mailbox.legalmail-draft-total-active .unreadcount {
    display: none !important;
}

html.dark-mode body.task-mail #legalmail-folder-sidebar .folderlist li.mailbox .legalmail-draft-total-count,
html.dark-mode body.task-mail #compose-mailboxlist li.mailbox .legalmail-draft-total-count {
    background: #4a474f !important;
    color: #f4f4f5 !important;
    -webkit-text-fill-color: #f4f4f5 !important;
}

@media screen and (max-width: 1200px) {
    body.task-mail #legalmail-folder-sidebar .folderlist li.mailbox .legalmail-draft-total-count,
    body.task-mail #compose-mailboxlist li.mailbox .legalmail-draft-total-count {
        top: 7px !important;
        right: 7px !important;
        min-width: 22px !important;
        height: 22px !important;
        line-height: 22px !important;
        padding: 0 6px !important;
        border-radius: 11px !important;
        font-size: 11px !important;
    }
}

/* ========================================================================== *
 * LegalMail v120.15 — suppress routine loading banners
 * ========================================================================== *
 * Generic Roundcube loading/uploading notices are intentionally invisible on
 * Mail pages. Real warnings, errors, confirmations and ordinary informational
 * notices remain native. A manual Refresh mail click uses a normal Roundcube
 * `notice`, so no dedicated timer/progress styling is needed here.
 */
html body.task-mail #messagestack > .loading,
html body.task-mail #messagestack > .uploading {
    display: none !important;
}


/* ========================================================================== *
 * LegalMail v120.16 — clearer inline Search action
 * ========================================================================== */
html body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form .legalmail-search-submit[hidden] {
    display: none !important;
}
html body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form .legalmail-search-submit {
    width: auto !important;
    min-width: 72px !important;
    height: 34px !important;
    min-height: 34px !important;
    margin: 4px 4px 4px 2px !important;
    padding: 0 14px !important;
    border: 1px solid #c7dfef !important;
    border-radius: 10px !important;
    background: #eaf5fc !important;
    color: #236f9c !important;
    -webkit-text-fill-color: #236f9c !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 32px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: background-color .14s ease, border-color .14s ease,
                color .14s ease, box-shadow .14s ease, transform .08s ease !important;
}
html body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form .legalmail-search-submit:hover,
html body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form .legalmail-search-submit:focus-visible {
    border-color: #9fcbe6 !important;
    background: #dceffa !important;
    color: #175f8a !important;
    -webkit-text-fill-color: #175f8a !important;
    box-shadow: 0 0 0 3px rgba(46, 127, 174, .12) !important;
    outline: 0 !important;
}
html body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form .legalmail-search-submit:active {
    background: #cfe8f7 !important;
    border-color: #8fbfdb !important;
    box-shadow: none !important;
    transform: scale(.98) !important;
}
html body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form .legalmail-search-submit.legalmail-searching {
    cursor: progress !important;
    opacity: .78 !important;
}

html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form .legalmail-search-submit {
    border-color: #3f6075 !important;
    background: #263f50 !important;
    color: #c7e8fb !important;
    -webkit-text-fill-color: #c7e8fb !important;
}
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form .legalmail-search-submit:hover,
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-search-row > .searchbar form .legalmail-search-submit:focus-visible {
    border-color: #56819d !important;
    background: #31546a !important;
    color: #e2f4ff !important;
    -webkit-text-fill-color: #e2f4ff !important;
}

/* ========================================================================== 
 * LegalMail v120.20.2 — "Открыть шаблон" button, isolated from row renderer
 * ========================================================================== */
html body.task-mail.action-none .messagelist tr.legalmail-template-open-row .legalmail-yandex-sender {
    visibility: hidden !important;
}

html body.task-mail.action-none .messagelist tr.legalmail-template-open-row > td.subject > .legalmail-open-template-button {
    position: absolute !important;
    z-index: 6 !important;
    left: 38px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: clamp(124px, 15vw, 190px) !important;
    max-width: calc(30% - 4px) !important;
    height: 28px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    border: 1px solid #d7dce2 !important;
    border-radius: 8px !important;
    background: #f3f5f7 !important;
    color: #202124 !important;
    -webkit-text-fill-color: #202124 !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    line-height: 26px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-shadow: none !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

html body.task-mail.action-none .messagelist tr.legalmail-template-open-row > td.subject > .legalmail-open-template-button:hover,
html body.task-mail.action-none .messagelist tr.legalmail-template-open-row > td.subject > .legalmail-open-template-button:focus-visible {
    background: #e8edf2 !important;
    border-color: #c3cbd4 !important;
    outline: none !important;
}

html body.task-mail.action-none .messagelist tr.legalmail-template-open-row > td.subject > .legalmail-open-template-button.is-opening,
html body.task-mail.action-none .messagelist tr.legalmail-template-open-row > td.subject > .legalmail-open-template-button:disabled {
    opacity: .68 !important;
    cursor: wait !important;
}

@media screen and (max-width: 760px) {
    html body.task-mail.action-none .messagelist tr.legalmail-template-open-row > td.subject > .legalmail-open-template-button {
        left: 36px !important;
        width: min(122px, 29%) !important;
        max-width: 29% !important;
        padding: 0 7px !important;
        font-size: 11.5px !important;
    }
}

html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-template-open-row > td.subject > .legalmail-open-template-button {
    border-color: #56646b !important;
    background: #303b40 !important;
    color: #e2e8e9 !important;
    -webkit-text-fill-color: #e2e8e9 !important;
}

/* LegalMail build marker: v120.20.3 checkbox-only selection */


/* ========================================================================== *
 * LegalMail v120.20.4 — centered modern unsaved-compose actions
 * ========================================================================== */
/* Only the "message not sent/saved" confirmation gets this treatment. */
.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane {
    padding: 12px 16px 16px !important;
}

.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
    float: none !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    margin: 0 !important;
}

.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button {
    min-width: 112px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 8px 16px !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 20px !important;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .08s ease !important;
}

.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:active:not(:disabled) {
    transform: translateY(1px) !important;
}

/* Save — first, green. */
.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-save-draft-exit,
.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-save-draft-exit.btn {
    order: 1 !important;
    background: #23a455 !important;
    background-color: #23a455 !important;
    border-color: #23a455 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-save-draft-exit:hover,
.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-save-draft-exit:focus {
    background: #1d9149 !important;
    background-color: #1d9149 !important;
    border-color: #1d9149 !important;
    box-shadow: 0 0 0 3px rgba(35, 164, 85, .16) !important;
}

/* Delete — second, red. */
.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-unsaved-delete {
    order: 2 !important;
    background: #e55353 !important;
    background-color: #e55353 !important;
    border-color: #e55353 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-unsaved-delete:hover,
.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-unsaved-delete:focus {
    background: #d84444 !important;
    background-color: #d84444 !important;
    border-color: #d84444 !important;
    box-shadow: 0 0 0 3px rgba(229, 83, 83, .15) !important;
}

/* Cancel — third, neutral and visually close to the light LegalMail buttons. */
.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-unsaved-cancel {
    order: 3 !important;
    background: #f3f6f8 !important;
    background-color: #f3f6f8 !important;
    border-color: #d4dde3 !important;
    color: #41515c !important;
    -webkit-text-fill-color: #41515c !important;
}

.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-unsaved-cancel:hover,
.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-unsaved-cancel:focus {
    background: #e8eef2 !important;
    background-color: #e8eef2 !important;
    border-color: #c5d0d8 !important;
    box-shadow: 0 0 0 3px rgba(95, 122, 138, .10) !important;
}

html.dark-mode .ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-unsaved-cancel {
    background: #3f4b50 !important;
    background-color: #3f4b50 !important;
    border-color: #5f7077 !important;
    color: #f1f5f6 !important;
    -webkit-text-fill-color: #f1f5f6 !important;
}

html.dark-mode .ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-unsaved-cancel:hover,
html.dark-mode .ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.legalmail-unsaved-cancel:focus {
    background: #4b5a60 !important;
    background-color: #4b5a60 !important;
    border-color: #71858d !important;
}

@media screen and (max-width: 480px) {
    .ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
        flex-wrap: wrap !important;
    }

    .ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button {
        min-width: 96px !important;
        flex: 1 1 96px !important;
    }
}

/* ========================================================================== *
 * LegalMail v120.20.5 — rounded fixed-size unsaved-compose dialog
 * ========================================================================== */
.ui-dialog.legalmail-unsaved-compose-dialog {
    border: 1px solid #d8e0e5 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    resize: none !important;
    box-shadow: 0 14px 38px rgba(25, 43, 54, .18) !important;
}

.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-titlebar {
    border-radius: 15px 15px 0 0 !important;
}

.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-content,
.ui-dialog.legalmail-unsaved-compose-dialog .ui-dialog-buttonpane {
    resize: none !important;
}

/* This confirmation has a fixed layout; the bottom-right resize grip is not useful. */
.ui-dialog.legalmail-unsaved-compose-dialog .ui-resizable-handle,
.ui-dialog.legalmail-unsaved-compose-dialog .ui-resizable-se,
.ui-dialog.legalmail-unsaved-compose-dialog .ui-icon-gripsmall-diagonal-se {
    display: none !important;
}

html.dark-mode .ui-dialog.legalmail-unsaved-compose-dialog {
    border-color: #536168 !important;
    box-shadow: 0 14px 38px rgba(0, 0, 0, .34) !important;
}

/* ========================================================================== 
 * LegalMail v120.20.7 — high-contrast TinyMCE surfaces in dark mode
 * Based strictly on the supplied v120.20.5 build.
 * ========================================================================== */
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox.tox-tinymce {
    border-color: #434a54 !important;
    background: #252a30 !important;
}

html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-editor-header,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-toolbar-overlord,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-toolbar__primary,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-toolbar,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-toolbar-overlord > div {
    background: #22272d !important;
    background-color: #22272d !important;
    border-color: #414852 !important;
    box-shadow: none !important;
}

html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-toolbar__primary {
    border-bottom: 1px solid #414852 !important;
}

html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-toolbar__group {
    border-color: #414852 !important;
}

html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-split-button,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-split-button__chevron,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-swatches__picker-btn {
    color: #e5e9ee !important;
    background: transparent !important;
    border-color: transparent !important;
}

html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn svg,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-split-button svg,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-split-button__chevron svg,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-swatches__picker-btn svg {
    fill: #e5e9ee !important;
}

html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn__select-label,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn__select-chevron,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn__select-chevron svg {
    color: #e5e9ee !important;
    fill: #e5e9ee !important;
    opacity: 1 !important;
}

html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn:hover,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn:focus,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-split-button:hover,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-split-button:focus-within,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-swatches__picker-btn:hover,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-swatches__picker-btn:focus {
    color: #ffffff !important;
    background: #353c45 !important;
}

html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn:hover svg,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn:focus svg,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-split-button:hover svg,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-split-button:focus-within svg {
    fill: #ffffff !important;
}

html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn--enabled,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn--enabled:hover,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn--enabled:focus {
    color: #ffffff !important;
    background: #3b434d !important;
}

html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn:disabled,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn.tox-tbtn--disabled {
    color: #7f8994 !important;
    background: transparent !important;
    opacity: .72 !important;
}

html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn:disabled svg,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn.tox-tbtn--disabled svg {
    fill: #7f8994 !important;
}

/* The iframe itself is also darkened immediately, before its inner document
 * receives the runtime body style from legalmail-v120.js. */
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-edit-area,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-edit-area__iframe,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox .tox-edit-area iframe {
    background: #292e35 !important;
    background-color: #292e35 !important;
}

/* ========================================================================== 
 * LegalMail v120.20.8 — dark message viewer surfaces
 * Keeps sender colors where they are meaningful, but removes the bright white
 * reader card and normalizes white/black HTML-mail surfaces in dark mode.
 * ========================================================================== */
html.dark-mode body.task-mail.action-show #layout-content.yandex-message-view > .content.frame-content {
    background: #181a1e !important;
    color: #e7ebef !important;
}

html.dark-mode body.task-mail.action-show #message-header,
html.dark-mode body.task-mail.action-show #message-content {
    background: #23272d !important;
    background-color: #23272d !important;
    border-color: #3d444d !important;
    color: #e7ebef !important;
}

html.dark-mode body.task-mail.action-show #message-header > .subject,
html.dark-mode body.task-mail.action-show #message-header .subject,
html.dark-mode body.task-mail.action-show #message-header .header-summary,
html.dark-mode body.task-mail.action-show #message-header .header-headers {
    color: #f0f3f6 !important;
}

html.dark-mode body.task-mail.action-show #message-header .header-headers .header-title,
html.dark-mode body.task-mail.action-show #message-header .header-links a,
html.dark-mode body.task-mail.action-show #message-header .header-title {
    color: #aab3bd !important;
}

html.dark-mode body.task-mail.action-show #message-header .header-headers td.header:not(.header-title),
html.dark-mode body.task-mail.action-show #message-header .header-summary td,
html.dark-mode body.task-mail.action-show #message-header .header-content {
    color: #e7ebef !important;
}

html.dark-mode body.task-mail.action-show #message-header .header-headers a,
html.dark-mode body.task-mail.action-show #message-header .header-summary a {
    color: #67b4ff !important;
}

html.dark-mode body.task-mail.action-show #message-content .rightcol,
html.dark-mode body.task-mail.action-show #messagebody,
html.dark-mode body.task-mail.action-show #messagebody .message-part,
html.dark-mode body.task-mail.action-show #messagebody .message-htmlpart,
html.dark-mode body.task-mail.action-show #messagebody .message-htmlpart > .rcmBody,
html.dark-mode body.task-mail.action-show #messagebody .message-htmlpart .rcmBody {
    background: #292e35 !important;
    background-color: #292e35 !important;
    color: #e7ebef !important;
}

html.dark-mode body.task-mail.action-show #messagebody .message-part {
    border-color: #434b55 !important;
}

/* Runtime classes are added only when the original computed mail color is
 * near-white/near-black. Branded colored blocks and colored text are left as-is. */
html.dark-mode body.task-mail.action-show #messagebody .lm-dark-mail-surface {
    background-color: #292e35 !important;
}

html.dark-mode body.task-mail.action-show #messagebody .lm-dark-mail-text {
    color: #e7ebef !important;
}

html.dark-mode body.task-mail.action-show #messagebody .lm-dark-mail-muted {
    color: #aeb7c1 !important;
}

html.dark-mode body.task-mail.action-show #messagebody a:not(.lm-dark-mail-keep-color) {
    text-decoration-color: currentColor;
}


/* ==========================================================================
 * LegalMail v120.20.9 — strict checkbox hit area
 * Only the square itself is a bulk-selection target.
 * ========================================================================== */
body.task-mail.action-none #messagelist td.selection {
    cursor: default !important;
}
body.task-mail.action-none #messagelist td.selection input[type="checkbox"] {
    cursor: pointer !important;
}

/* ========================================================================== 
 * LegalMail v120.20.11 — modern rounded mail menus and list-options controls
 * Brings popup cards, toolbar hit areas and the message-list options dialog
 * into the same soft-radius visual language as LegalMail toasts/cards.
 * ========================================================================== */
body.task-mail {
    --lm-menu-radius: 14px;
    --lm-menu-item-radius: 9px;
    --lm-control-radius: 10px;
    --lm-menu-border: #dbe2e7;
    --lm-menu-surface: #ffffff;
    --lm-menu-hover: #f1f4f6;
    --lm-menu-active: #e9f3fa;
    --lm-menu-text: #273139;
    --lm-menu-muted: #9ba5ad;
    --lm-menu-focus: rgba(73, 145, 194, .18);
}

/* Bootstrap is the visible shell around Roundcube's .popupmenu. */
html:not(.dark-mode) body.task-mail .popover {
    border: 1px solid var(--lm-menu-border) !important;
    border-radius: var(--lm-menu-radius) !important;
    background: var(--lm-menu-surface) !important;
    box-shadow: 0 14px 36px rgba(28, 43, 53, .16), 0 3px 10px rgba(28, 43, 53, .08) !important;
    overflow: visible !important;
}

body.task-mail .popover .popover-body {
    padding: 6px !important;
}

body.task-mail .popover .popupmenu,
body.task-mail .popover .popupmenu > .menu.listing,
body.task-mail .popover .popupmenu .menu.listing {
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    border: 0 !important;
    border-radius: calc(var(--lm-menu-radius) - 3px) !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

body.task-mail .popover .popupmenu .menu.listing > li {
    margin: 2px 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

body.task-mail .popover .popupmenu .menu.listing > li > a,
body.task-mail .popover .popupmenu .menu.listing > li > .dropbutton > a {
    box-sizing: border-box !important;
    min-height: 38px !important;
    padding: 8px 10px !important;
    border: 1px solid transparent !important;
    border-radius: var(--lm-menu-item-radius) !important;
    color: var(--lm-menu-text) !important;
    -webkit-text-fill-color: var(--lm-menu-text) !important;
    background: transparent !important;
    line-height: 20px !important;
    transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease, color .14s ease !important;
}

body.task-mail .popover .popupmenu .menu.listing > li > a::before,
body.task-mail .popover .popupmenu .menu.listing > li > a::after,
body.task-mail .popover .popupmenu .menu.listing > li > a .inner::before,
body.task-mail .popover .popupmenu .menu.listing > li > a .folder-selector-link::after {
    color: currentColor !important;
    -webkit-text-fill-color: currentColor !important;
    opacity: .86 !important;
}

html:not(.dark-mode) body.task-mail .popover .popupmenu .menu.listing > li > a:not(.disabled):hover,
html:not(.dark-mode) body.task-mail .popover .popupmenu .menu.listing > li > a:not(.disabled):focus,
html:not(.dark-mode) body.task-mail .popover .popupmenu .menu.listing > li > a:not(.disabled):focus-visible {
    border-color: #e4e9ed !important;
    background: var(--lm-menu-hover) !important;
    color: #172027 !important;
    -webkit-text-fill-color: #172027 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

html:not(.dark-mode) body.task-mail .popover .popupmenu .menu.listing > li > a.selected,
html:not(.dark-mode) body.task-mail .popover .popupmenu .menu.listing > li > a[aria-selected="true"] {
    border-color: #d7e8f4 !important;
    background: var(--lm-menu-active) !important;
}

body.task-mail .popover .popupmenu .menu.listing > li > a.disabled,
body.task-mail .popover .popupmenu .menu.listing > li > a[aria-disabled="true"] {
    color: var(--lm-menu-muted) !important;
    -webkit-text-fill-color: var(--lm-menu-muted) !important;
    opacity: .72 !important;
    background: transparent !important;
}

/* Keyboard focus stays visible without the old square outline. */
body.task-mail .popover .popupmenu .menu.listing > li > a:not(.disabled):focus-visible {
    box-shadow: 0 0 0 3px var(--lm-menu-focus) !important;
}

/* Some plugin menus use textual separators. Keep them soft and inset. */
body.task-mail .popover .popupmenu .menu.listing > li.separator {
    margin: 6px 4px !important;
    padding: 5px 8px !important;
    border-top: 1px solid #e8ecef !important;
    border-bottom: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}

/* Rounded hit areas for list and reader toolbar buttons. */
body.task-mail #messagelist-header .legalmail-v112-restored-controls > a,
body.task-mail #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a:not(.compose),
body.task-mail #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > .dropbutton > a,
body.task-mail #mailtoolbar.yandex-mailtoolbar > a:not(.compose),
body.task-mail #mailtoolbar.yandex-mailtoolbar > .dropbutton > a,
body.task-mail.action-compose #messagetoolbar > a,
body.task-mail.action-compose #messagetoolbar > .dropbutton > a {
    border-radius: var(--lm-control-radius) !important;
    transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease, transform .08s ease !important;
}

body.task-mail #messagelist-header .legalmail-v112-restored-controls,
body.task-mail #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar,
body.task-mail #mailtoolbar.yandex-mailtoolbar,
body.task-mail.action-compose #messagetoolbar {
    gap: 4px !important;
}

/* Split actions (Reply + caret, etc.) read as one rounded control. */
body.task-mail #mailtoolbar.yandex-mailtoolbar > .dropbutton,
body.task-mail #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > .dropbutton,
body.task-mail.action-compose #messagetoolbar > .dropbutton {
    border-radius: var(--lm-control-radius) !important;
    background: transparent !important;
    overflow: hidden !important;
}

body.task-mail #mailtoolbar.yandex-mailtoolbar > .dropbutton > a:first-child,
body.task-mail #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > .dropbutton > a:first-child,
body.task-mail.action-compose #messagetoolbar > .dropbutton > a:first-child {
    border-radius: var(--lm-control-radius) 0 0 var(--lm-control-radius) !important;
}

body.task-mail #mailtoolbar.yandex-mailtoolbar > .dropbutton > a.dropdown,
body.task-mail #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > .dropbutton > a.dropdown,
body.task-mail.action-compose #messagetoolbar > .dropbutton > a.dropdown {
    border-radius: 0 var(--lm-control-radius) var(--lm-control-radius) 0 !important;
}

html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar > a:not(.disabled):hover,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar > a:not(.disabled):focus-visible,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar > a[aria-expanded="true"]:not(.disabled),
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar > .dropbutton > a:not(.disabled):hover,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar > .dropbutton > a:not(.disabled):focus-visible,
html:not(.dark-mode) body.task-mail #messagelist-header .legalmail-v112-restored-controls > a:not(.disabled):hover,
html:not(.dark-mode) body.task-mail #messagelist-header .legalmail-v112-restored-controls > a:not(.disabled):focus-visible,
html:not(.dark-mode) body.task-mail #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a:not(.disabled):hover,
html:not(.dark-mode) body.task-mail #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > .dropbutton > a:not(.disabled):hover {
    border-color: #dfe5e9 !important;
    background: #eef2f4 !important;
    box-shadow: 0 1px 2px rgba(28, 43, 53, .04) !important;
    outline: 0 !important;
}

html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar > a:not(.disabled):active,
html:not(.dark-mode) body.task-mail #mailtoolbar.yandex-mailtoolbar > .dropbutton > a:not(.disabled):active,
html:not(.dark-mode) body.task-mail #messagelist-header .legalmail-v112-restored-controls > a:not(.disabled):active,
html:not(.dark-mode) body.task-mail #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar a:not(.disabled):active {
    background: #e5eaed !important;
    transform: translateY(1px) !important;
}

/* Message-list options dialog shown in the first reference screenshot. */
body.task-mail .ui-dialog[aria-describedby="listoptions-menu"],
body.task-mail .ui-dialog:has(> #listoptions-menu.ui-dialog-content) {
    border: 1px solid #d9e1e6 !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: 0 18px 46px rgba(25, 42, 53, .20), 0 4px 12px rgba(25, 42, 53, .08) !important;
    overflow: hidden !important;
}

body.task-mail .ui-dialog[aria-describedby="listoptions-menu"] .ui-dialog-titlebar,
body.task-mail .ui-dialog:has(> #listoptions-menu.ui-dialog-content) .ui-dialog-titlebar {
    min-height: 54px !important;
    padding: 14px 50px 12px 16px !important;
    border: 0 !important;
    border-bottom: 1px solid #e7ecef !important;
    border-radius: 15px 15px 0 0 !important;
    background: #fff !important;
}

body.task-mail .ui-dialog[aria-describedby="listoptions-menu"] .ui-dialog-title,
body.task-mail .ui-dialog:has(> #listoptions-menu.ui-dialog-content) .ui-dialog-title {
    color: #1f2a31 !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 26px !important;
}

body.task-mail .ui-dialog[aria-describedby="listoptions-menu"] .ui-dialog-titlebar-close,
body.task-mail .ui-dialog:has(> #listoptions-menu.ui-dialog-content) .ui-dialog-titlebar-close {
    top: 10px !important;
    right: 10px !important;
    width: 34px !important;
    height: 34px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: #3f4b53 !important;
}

body.task-mail .ui-dialog[aria-describedby="listoptions-menu"] .ui-dialog-titlebar-close:hover,
body.task-mail .ui-dialog[aria-describedby="listoptions-menu"] .ui-dialog-titlebar-close:focus-visible,
body.task-mail .ui-dialog:has(> #listoptions-menu.ui-dialog-content) .ui-dialog-titlebar-close:hover,
body.task-mail .ui-dialog:has(> #listoptions-menu.ui-dialog-content) .ui-dialog-titlebar-close:focus-visible {
    background: #eef2f4 !important;
    outline: 0 !important;
}

body.task-mail #listoptions-menu.ui-dialog-content {
    height: auto !important;
    padding: 18px 18px 10px !important;
    background: #fff !important;
}

body.task-mail #listoptions-menu.ui-dialog-content .form-group {
    align-items: center !important;
    margin-bottom: 10px !important;
}

body.task-mail #listoptions-menu.ui-dialog-content .col-form-label {
    color: #273139 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

body.task-mail #listoptions-menu.ui-dialog-content select {
    width: 100% !important;
    min-height: 38px !important;
    padding: 7px 34px 7px 11px !important;
    border: 1px solid #d6dfe5 !important;
    border-radius: 9px !important;
    background-color: #fff !important;
    color: #243039 !important;
    box-shadow: 0 1px 2px rgba(28, 43, 53, .03) !important;
    outline: 0 !important;
    transition: border-color .14s ease, box-shadow .14s ease, background-color .14s ease !important;
}

body.task-mail #listoptions-menu.ui-dialog-content select:hover {
    border-color: #c8d4dc !important;
}

body.task-mail #listoptions-menu.ui-dialog-content select:focus,
body.task-mail #listoptions-menu.ui-dialog-content select:focus-visible {
    border-color: #84b9dc !important;
    box-shadow: 0 0 0 3px rgba(84, 161, 211, .16) !important;
}

body.task-mail #listoptions-menu.ui-dialog-content ~ .ui-dialog-buttonpane {
    padding: 10px 14px 14px !important;
    border-top: 1px solid #e8edef !important;
    background: #fff !important;
}

body.task-mail #listoptions-menu.ui-dialog-content ~ .ui-dialog-buttonpane .ui-dialog-buttonset {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 8px !important;
}

body.task-mail #listoptions-menu.ui-dialog-content ~ .ui-dialog-buttonpane button {
    min-height: 38px !important;
    margin: 0 !important;
    padding: 7px 14px !important;
    border-radius: 9px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease, transform .08s ease !important;
}

body.task-mail #listoptions-menu.ui-dialog-content ~ .ui-dialog-buttonpane button:not(.btn-primary) {
    border-color: #d2dbe1 !important;
    background: #f2f5f7 !important;
    color: #3d4a53 !important;
}

body.task-mail #listoptions-menu.ui-dialog-content ~ .ui-dialog-buttonpane button.btn-primary {
    border-color: #7cb5db !important;
    background: #eaf5fc !important;
    color: #15628f !important;
}

body.task-mail #listoptions-menu.ui-dialog-content ~ .ui-dialog-buttonpane button:not(:disabled):hover,
body.task-mail #listoptions-menu.ui-dialog-content ~ .ui-dialog-buttonpane button:not(:disabled):focus-visible {
    box-shadow: 0 0 0 3px rgba(72, 143, 190, .12) !important;
    outline: 0 !important;
}

body.task-mail #listoptions-menu.ui-dialog-content ~ .ui-dialog-buttonpane button:not(:disabled):active {
    transform: translateY(1px) !important;
}

/* Dark mode uses the same geometry, with LegalMail's reader palette. */
html.dark-mode body.task-mail {
    --lm-menu-border: #3c464e;
    --lm-menu-surface: #20252a;
    --lm-menu-hover: #2d343a;
    --lm-menu-active: #283b47;
    --lm-menu-text: #edf1f3;
    --lm-menu-muted: #717d86;
    --lm-menu-focus: rgba(93, 164, 210, .20);
}

html.dark-mode body.task-mail .popover {
    border-color: var(--lm-menu-border) !important;
    border-radius: var(--lm-menu-radius) !important;
    background: var(--lm-menu-surface) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .38), 0 3px 10px rgba(0, 0, 0, .22) !important;
    overflow: visible !important;
}

html.dark-mode body.task-mail .popover .popupmenu {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

html.dark-mode body.task-mail .popover .popupmenu .menu.listing > li > a,
html.dark-mode body.task-mail .popover .popupmenu .menu.listing > li > a.active {
    color: var(--lm-menu-text) !important;
    -webkit-text-fill-color: var(--lm-menu-text) !important;
    background: transparent !important;
}

html.dark-mode body.task-mail .popover .popupmenu .menu.listing > li > a:not(.disabled):hover,
html.dark-mode body.task-mail .popover .popupmenu .menu.listing > li > a:not(.disabled):focus,
html.dark-mode body.task-mail .popover .popupmenu .menu.listing > li > a:not(.disabled):focus-visible {
    border-color: #3b464f !important;
    background: var(--lm-menu-hover) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

html.dark-mode body.task-mail .popover .popupmenu .menu.listing > li.separator {
    border-top-color: #343d44 !important;
}

html.dark-mode body.task-mail #mailtoolbar.yandex-mailtoolbar > a:not(.disabled):hover,
html.dark-mode body.task-mail #mailtoolbar.yandex-mailtoolbar > a:not(.disabled):focus-visible,
html.dark-mode body.task-mail #mailtoolbar.yandex-mailtoolbar > a[aria-expanded="true"]:not(.disabled),
html.dark-mode body.task-mail #mailtoolbar.yandex-mailtoolbar > .dropbutton > a:not(.disabled):hover,
html.dark-mode body.task-mail #messagelist-header .legalmail-v112-restored-controls > a:not(.disabled):hover,
html.dark-mode body.task-mail #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a:not(.disabled):hover {
    border-color: #48525a !important;
    background: #333a40 !important;
    box-shadow: none !important;
}

html.dark-mode body.task-mail .ui-dialog[aria-describedby="listoptions-menu"],
html.dark-mode body.task-mail .ui-dialog:has(> #listoptions-menu.ui-dialog-content) {
    border-color: #46515a !important;
    background: #23282d !important;
    box-shadow: 0 18px 46px rgba(0, 0, 0, .40) !important;
}

html.dark-mode body.task-mail .ui-dialog[aria-describedby="listoptions-menu"] .ui-dialog-titlebar,
html.dark-mode body.task-mail .ui-dialog:has(> #listoptions-menu.ui-dialog-content) .ui-dialog-titlebar,
html.dark-mode body.task-mail #listoptions-menu.ui-dialog-content,
html.dark-mode body.task-mail #listoptions-menu.ui-dialog-content ~ .ui-dialog-buttonpane {
    border-color: #3e474f !important;
    background: #23282d !important;
}

html.dark-mode body.task-mail .ui-dialog[aria-describedby="listoptions-menu"] .ui-dialog-title,
html.dark-mode body.task-mail .ui-dialog:has(> #listoptions-menu.ui-dialog-content) .ui-dialog-title,
html.dark-mode body.task-mail #listoptions-menu.ui-dialog-content .col-form-label {
    color: #edf1f3 !important;
}

html.dark-mode body.task-mail .ui-dialog[aria-describedby="listoptions-menu"] .ui-dialog-titlebar-close,
html.dark-mode body.task-mail .ui-dialog:has(> #listoptions-menu.ui-dialog-content) .ui-dialog-titlebar-close {
    color: #dce3e7 !important;
}

html.dark-mode body.task-mail .ui-dialog[aria-describedby="listoptions-menu"] .ui-dialog-titlebar-close:hover,
html.dark-mode body.task-mail .ui-dialog:has(> #listoptions-menu.ui-dialog-content) .ui-dialog-titlebar-close:hover {
    background: #31383e !important;
}

html.dark-mode body.task-mail #listoptions-menu.ui-dialog-content select {
    border-color: #48545d !important;
    background-color: #2d343a !important;
    color: #eef2f4 !important;
    box-shadow: none !important;
}

html.dark-mode body.task-mail #listoptions-menu.ui-dialog-content select:hover {
    border-color: #5a6872 !important;
}

html.dark-mode body.task-mail #listoptions-menu.ui-dialog-content select:focus,
html.dark-mode body.task-mail #listoptions-menu.ui-dialog-content select:focus-visible {
    border-color: #5f9fc8 !important;
    box-shadow: 0 0 0 3px rgba(79, 154, 202, .18) !important;
}

html.dark-mode body.task-mail #listoptions-menu.ui-dialog-content ~ .ui-dialog-buttonpane button:not(.btn-primary) {
    border-color: #4c5861 !important;
    background: #30383e !important;
    color: #e4e9ec !important;
}

html.dark-mode body.task-mail #listoptions-menu.ui-dialog-content ~ .ui-dialog-buttonpane button.btn-primary {
    border-color: #497f9f !important;
    background: #294657 !important;
    color: #edf7fc !important;
}

@media (prefers-reduced-motion: reduce) {
    body.task-mail .popover .popupmenu .menu.listing > li > a,
    body.task-mail #mailtoolbar.yandex-mailtoolbar > a,
    body.task-mail #mailtoolbar.yandex-mailtoolbar > .dropbutton > a,
    body.task-mail #listoptions-menu.ui-dialog-content select,
    body.task-mail #listoptions-menu.ui-dialog-content ~ .ui-dialog-buttonpane button {
        transition: none !important;
    }
}

/* Preserve Elastic's mobile side-sheet behavior; the rounded card treatment is desktop/tablet. */
html.layout-small body.task-mail .popover:not(.select-menu),
html.layout-phone body.task-mail .popover:not(.select-menu) {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}
html.layout-small body.task-mail .popover:not(.select-menu) .popover-body,
html.layout-phone body.task-mail .popover:not(.select-menu) .popover-body {
    padding: 0 !important;
}

/* v112's narrow desktop toolbar was tuned to fit a fixed canvas; keep its spacing. */
@media screen and (max-width: 1200px) {
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header .legalmail-v112-restored-controls,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar {
        gap: 1px !important;
    }
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > .dropbutton {
        overflow: visible !important;
    }
}

/* Exact v112 selectors: override its intentional square-button reset without changing geometry. */
@media screen and (max-width: 1200px) {
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header .legalmail-v112-restored-controls > a,
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > a:not(.dropdown):not(.compose),
    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > .dropbutton > a:not(.dropdown) {
        border-radius: var(--lm-control-radius) !important;
    }

    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > .dropbutton > a:first-child {
        border-radius: var(--lm-control-radius) 0 0 var(--lm-control-radius) !important;
    }

    html.legalmail-v112-toolbar-ready body.task-mail.action-none #messagelist-header #mailtoolbar.legalmail-v112-restored-mailtoolbar > .dropbutton > a.dropdown {
        border-radius: 0 var(--lm-control-radius) var(--lm-control-radius) 0 !important;
    }
}

/* ========================================================================== *
 * LegalMail v120.20.12 — unified modern compose dialogs and soft recipient hints
 * ========================================================================== */
/*
 * Keep all small compose confirmations in the same visual language as the
 * unsaved-message dialog: rounded card, subtle border/shadow, calm controls,
 * and no legacy jQuery-UI resize grip.
 */
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) {
    border: 1px solid #d8e2e8 !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    overflow: hidden !important;
    resize: none !important;
    box-shadow: 0 16px 42px rgba(29, 45, 55, .20) !important;
}

body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-titlebar {
    min-height: 58px !important;
    padding: 0 14px 0 16px !important;
    border: 0 !important;
    border-bottom: 1px solid #e7edf1 !important;
    border-radius: 15px 15px 0 0 !important;
    background: #ffffff !important;
    color: #18242b !important;
    display: flex !important;
    align-items: center !important;
}

body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-title {
    margin: 0 !important;
    padding: 0 !important;
    color: #18242b !important;
    -webkit-text-fill-color: #18242b !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 22px !important;
}

body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-titlebar-close {
    position: absolute !important;
    top: 11px !important;
    right: 11px !important;
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: #40515c !important;
    -webkit-text-fill-color: #40515c !important;
    box-shadow: none !important;
    opacity: 1 !important;
    transition: background-color .14s ease, color .14s ease !important;
}

body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-titlebar-close:hover,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-titlebar-close:focus-visible {
    background: #f0f4f6 !important;
    color: #202e36 !important;
    -webkit-text-fill-color: #202e36 !important;
    outline: none !important;
}

body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content {
    padding: 18px 16px 16px !important;
    border: 0 !important;
    background: #ffffff !important;
    color: #27363f !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    resize: none !important;
}

/* Text fields used by e.g. the "No subject" and recipient-edit dialogs. */
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content input[type="text"],
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content input[type="email"],
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content textarea,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content select {
    box-sizing: border-box !important;
    min-height: 38px !important;
    border: 1px solid #cfdce4 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #22323b !important;
    box-shadow: inset 0 1px 2px rgba(31, 48, 58, .04) !important;
    outline: 0 !important;
    transition: border-color .14s ease, box-shadow .14s ease, background-color .14s ease !important;
}

body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content input[type="text"]:hover,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content input[type="email"]:hover,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content textarea:hover,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content select:hover {
    border-color: #b8ccd8 !important;
}

body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content input[type="text"]:focus,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content input[type="email"]:focus,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content textarea:focus,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content select:focus {
    border-color: #8fbdd7 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(88, 154, 191, .12) !important;
}

body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-buttonpane {
    margin: 0 !important;
    padding: 12px 16px 16px !important;
    border: 0 !important;
    background: #ffffff !important;
    resize: none !important;
}

body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-buttonpane .ui-dialog-buttonset {
    float: none !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 9px !important;
    margin: 0 !important;
}

body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-buttonpane .ui-dialog-buttonset button {
    min-width: 104px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 8px 15px !important;
    border: 1px solid #d2dde4 !important;
    border-radius: 10px !important;
    background: #f3f6f8 !important;
    color: #41515c !important;
    -webkit-text-fill-color: #41515c !important;
    box-shadow: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 20px !important;
    transition: background-color .14s ease, border-color .14s ease,
                box-shadow .14s ease, transform .08s ease !important;
}

body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-buttonpane .ui-dialog-buttonset button:not(:disabled):hover,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-buttonpane .ui-dialog-buttonset button:not(:disabled):focus-visible {
    border-color: #c3d0d8 !important;
    background: #e9eff3 !important;
    color: #344650 !important;
    -webkit-text-fill-color: #344650 !important;
    box-shadow: 0 0 0 3px rgba(83, 117, 136, .09) !important;
    outline: 0 !important;
}

body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-buttonpane .ui-dialog-buttonset button:not(:disabled):active {
    transform: translateY(1px) !important;
}

/* Primary confirmation/send/OK actions use a quiet blue rather than the old
 * saturated cyan. The custom Save/Delete/Cancel dialog keeps its own colors. */
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button.btn-primary,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button.mainaction,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button.send,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button.ok {
    border-color: #a9cde2 !important;
    background: #e7f2f9 !important;
    color: #246887 !important;
    -webkit-text-fill-color: #246887 !important;
}

body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button.btn-primary:not(:disabled):hover,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button.btn-primary:not(:disabled):focus-visible,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button.mainaction:not(:disabled):hover,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button.mainaction:not(:disabled):focus-visible,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button.send:not(:disabled):hover,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button.send:not(:disabled):focus-visible,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button.ok:not(:disabled):hover,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button.ok:not(:disabled):focus-visible {
    border-color: #91bdd6 !important;
    background: #dcecf6 !important;
    color: #1e5c79 !important;
    -webkit-text-fill-color: #1e5c79 !important;
    box-shadow: 0 0 0 3px rgba(63, 133, 171, .11) !important;
}

/* jQuery UI may add resizable handles to simple_dialog(). They make the small
 * confirmation cards look dated and are not useful here. */
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-resizable-handle,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-resizable-se,
body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-icon-gripsmall-diagonal-se {
    display: none !important;
}

/* A slightly softer overlay makes the dialog feel integrated instead of harsh. */
body.task-mail.action-compose .ui-widget-overlay {
    background: rgba(25, 36, 43, .42) !important;
    opacity: 1 !important;
}

/* Recipient autocomplete / address-book hints.
 * Support both older <a> and newer .ui-menu-item-wrapper markup. */
body.task-mail.action-compose .ui-autocomplete,
body.task-mail.action-compose ul.ui-autocomplete.ui-menu {
    box-sizing: border-box !important;
    margin-top: 5px !important;
    padding: 5px !important;
    border: 1px solid #d8e5ec !important;
    border-radius: 12px !important;
    background: #fbfdfe !important;
    color: #2c414e !important;
    box-shadow: 0 10px 26px rgba(35, 55, 67, .13) !important;
    overflow: hidden !important;
}

body.task-mail.action-compose .ui-autocomplete .ui-menu-item {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: #2c414e !important;
}

body.task-mail.action-compose .ui-autocomplete .ui-menu-item > a,
body.task-mail.action-compose .ui-autocomplete .ui-menu-item > div,
body.task-mail.action-compose .ui-autocomplete .ui-menu-item-wrapper {
    box-sizing: border-box !important;
    min-height: 34px !important;
    margin: 0 !important;
    padding: 7px 10px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: #2d4654 !important;
    -webkit-text-fill-color: #2d4654 !important;
    font-weight: 500 !important;
    line-height: 20px !important;
    box-shadow: none !important;
    transition: background-color .12s ease, color .12s ease !important;
}

body.task-mail.action-compose .ui-autocomplete .ui-menu-item > a::before,
body.task-mail.action-compose .ui-autocomplete .ui-menu-item > div::before,
body.task-mail.action-compose .ui-autocomplete .ui-menu-item-wrapper::before {
    color: #79a9c2 !important;
    fill: #79a9c2 !important;
}

body.task-mail.action-compose .ui-autocomplete .ui-menu-item > a.ui-state-active,
body.task-mail.action-compose .ui-autocomplete .ui-menu-item > div.ui-state-active,
body.task-mail.action-compose .ui-autocomplete .ui-menu-item-wrapper.ui-state-active,
body.task-mail.action-compose .ui-autocomplete .ui-state-active {
    margin: 0 !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: #eaf3f8 !important;
    color: #244b61 !important;
    -webkit-text-fill-color: #244b61 !important;
    box-shadow: none !important;
}

body.task-mail.action-compose .ui-autocomplete .ui-menu-item > a.ui-state-active::before,
body.task-mail.action-compose .ui-autocomplete .ui-menu-item > div.ui-state-active::before,
body.task-mail.action-compose .ui-autocomplete .ui-menu-item-wrapper.ui-state-active::before,
body.task-mail.action-compose .ui-autocomplete .ui-state-active::before {
    color: #5d91ad !important;
    fill: #5d91ad !important;
}

/* Dark mode equivalents keep the same low-contrast, rounded treatment. */
html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) {
    border-color: #4a5961 !important;
    background: #252c30 !important;
    box-shadow: 0 16px 42px rgba(0, 0, 0, .38) !important;
}

html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-titlebar,
html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content,
html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-buttonpane {
    background: #252c30 !important;
}

html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-titlebar {
    border-bottom-color: #3d484e !important;
}

html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-title,
html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content {
    color: #edf2f4 !important;
    -webkit-text-fill-color: #edf2f4 !important;
}

html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-titlebar-close {
    color: #d8e0e3 !important;
    -webkit-text-fill-color: #d8e0e3 !important;
}

html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-titlebar-close:hover,
html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-titlebar-close:focus-visible {
    background: #343e43 !important;
}

html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content input[type="text"],
html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content input[type="email"],
html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content textarea,
html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content select {
    border-color: #50616a !important;
    background: #20262a !important;
    color: #edf2f4 !important;
    -webkit-text-fill-color: #edf2f4 !important;
}

html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content input[type="text"]:focus,
html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content input[type="email"]:focus,
html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content textarea:focus,
html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content select:focus {
    border-color: #719db4 !important;
    box-shadow: 0 0 0 3px rgba(94, 150, 181, .14) !important;
}

html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button {
    border-color: #53636b !important;
    background: #354047 !important;
    color: #e9eff2 !important;
    -webkit-text-fill-color: #e9eff2 !important;
}

html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button.btn-primary,
html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button.mainaction,
html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button.send,
html.dark-mode body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog)
    .ui-dialog-buttonpane .ui-dialog-buttonset button.ok {
    border-color: #537f96 !important;
    background: #294554 !important;
    color: #e8f5fb !important;
    -webkit-text-fill-color: #e8f5fb !important;
}

html.dark-mode body.task-mail.action-compose .ui-autocomplete,
html.dark-mode body.task-mail.action-compose ul.ui-autocomplete.ui-menu {
    border-color: #485a63 !important;
    background: #252d31 !important;
    color: #e3ecef !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .32) !important;
}

html.dark-mode body.task-mail.action-compose .ui-autocomplete .ui-menu-item > a,
html.dark-mode body.task-mail.action-compose .ui-autocomplete .ui-menu-item > div,
html.dark-mode body.task-mail.action-compose .ui-autocomplete .ui-menu-item-wrapper {
    color: #e1eaee !important;
    -webkit-text-fill-color: #e1eaee !important;
}

html.dark-mode body.task-mail.action-compose .ui-autocomplete .ui-menu-item > a.ui-state-active,
html.dark-mode body.task-mail.action-compose .ui-autocomplete .ui-menu-item > div.ui-state-active,
html.dark-mode body.task-mail.action-compose .ui-autocomplete .ui-menu-item-wrapper.ui-state-active,
html.dark-mode body.task-mail.action-compose .ui-autocomplete .ui-state-active {
    background: #33434b !important;
    color: #f0f7fa !important;
    -webkit-text-fill-color: #f0f7fa !important;
}

@media screen and (max-width: 480px) {
    body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-titlebar {
        min-height: 54px !important;
        padding-left: 14px !important;
    }

    body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-content {
        padding: 16px 14px 14px !important;
    }

    body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-buttonpane {
        padding: 10px 14px 14px !important;
    }

    body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-buttonpane .ui-dialog-buttonset button {
        min-width: 96px !important;
        flex: 1 1 96px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-titlebar-close,
    body.task-mail.action-compose .ui-dialog:not(.legalmail-unsaved-compose-dialog) .ui-dialog-buttonpane .ui-dialog-buttonset button,
    body.task-mail.action-compose .ui-autocomplete .ui-menu-item > a,
    body.task-mail.action-compose .ui-autocomplete .ui-menu-item > div,
    body.task-mail.action-compose .ui-autocomplete .ui-menu-item-wrapper {
        transition: none !important;
    }
}

/* ========================================================================== *
 * LegalMail v120.20.15 — hide routine page-loading status in all main tasks
 * ========================================================================== *
 * Navigation between Mail, Contacts and Settings must stay visually quiet.
 * Roundcube's transient .loading message is an internal page/request status,
 * not a user notification. Keep warnings/errors/success/info messages intact.
 */
html body.task-mail #messagestack > .loading,
html body.task-addressbook #messagestack > .loading,
html body.task-settings #messagestack > .loading,
html body.task-mail #messagestack .loading,
html body.task-addressbook #messagestack .loading,
html body.task-settings #messagestack .loading {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    animation: none !important;
}

/* ========================================================================== *
 * LegalMail v120.20.18 — list options dialog matches modern confirmations
 * The class is applied by JS using stable form controls, not only the cloned
 * #listoptions-menu id (which is not preserved by every Roundcube build).
 * ========================================================================== */
html body .ui-dialog.legalmail-listoptions-dialog {
    box-sizing: border-box !important;
    width: min(520px, calc(100vw - 28px)) !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100vh - 28px) !important;
    border: 1px solid #d8e0e5 !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: 0 14px 38px rgba(25, 43, 54, .18) !important;
    overflow: hidden !important;
    resize: none !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-titlebar {
    box-sizing: border-box !important;
    min-height: 58px !important;
    padding: 16px 54px 14px 18px !important;
    border: 0 !important;
    border-bottom: 1px solid #e4eaee !important;
    border-radius: 15px 15px 0 0 !important;
    background: #fff !important;
    color: #202a31 !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-title {
    float: none !important;
    display: block !important;
    width: auto !important;
    margin: 0 !important;
    color: #202a31 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 27px !important;
    white-space: normal !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-titlebar-close {
    position: absolute !important;
    top: 11px !important;
    right: 11px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: #26353d !important;
    opacity: 1 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-titlebar-close:hover,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-titlebar-close:focus-visible {
    background: #eef2f4 !important;
    box-shadow: none !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-titlebar-close .ui-icon {
    margin: 0 !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content,
html body .ui-dialog.legalmail-listoptions-dialog .legalmail-listoptions-content {
    box-sizing: border-box !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 18px 18px 14px !important;
    border: 0 !important;
    background: #fff !important;
    color: #202a31 !important;
    overflow: visible !important;
    resize: none !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content .form-group {
    display: grid !important;
    grid-template-columns: minmax(135px, 165px) minmax(0, 1fr) !important;
    align-items: center !important;
    column-gap: 14px !important;
    row-gap: 6px !important;
    margin: 0 0 10px !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content .form-group:last-child {
    margin-bottom: 0 !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content .col-form-label,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content label {
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #273139 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 20px !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content .col-sm-8,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content .col-md-8,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content [class*="col-"] {
    width: auto !important;
    max-width: none !important;
    flex: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content select,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content .form-control {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 7px 36px 7px 11px !important;
    border: 1px solid #cfd9df !important;
    border-radius: 9px !important;
    background-color: #fff !important;
    color: #243039 !important;
    font-size: 14px !important;
    line-height: 24px !important;
    box-shadow: 0 1px 2px rgba(28, 43, 53, .04) !important;
    outline: 0 !important;
    transition: border-color .14s ease, box-shadow .14s ease, background-color .14s ease !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content select:hover,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content .form-control:hover {
    border-color: #bfcdd6 !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content select:focus,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content select:focus-visible,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content .form-control:focus,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content .form-control:focus-visible {
    border-color: #74afd2 !important;
    box-shadow: 0 0 0 3px rgba(71, 151, 200, .16) !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane {
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 12px 16px 16px !important;
    border: 0 !important;
    border-top: 1px solid #e4eaee !important;
    background: #fff !important;
    resize: none !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
    float: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button {
    box-sizing: border-box !important;
    min-width: 112px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 8px 16px !important;
    border: 1px solid #d4dde3 !important;
    border-radius: 10px !important;
    background: #f3f6f8 !important;
    color: #41515c !important;
    -webkit-text-fill-color: #41515c !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 20px !important;
    box-shadow: none !important;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .08s ease !important;
}

/* Save uses the same green primary action as the modern "Внимание" dialog. */
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.btn-primary,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.save,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:first-child:not(.btn-secondary) {
    border-color: #23a455 !important;
    background: #23a455 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.btn-primary:hover,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.btn-primary:focus-visible,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.save:hover,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.save:focus-visible,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:first-child:not(.btn-secondary):hover,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:first-child:not(.btn-secondary):focus-visible {
    border-color: #1d9149 !important;
    background: #1d9149 !important;
    box-shadow: 0 0 0 3px rgba(35, 164, 85, .16) !important;
    outline: 0 !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:not(.btn-primary):not(.save):hover,
html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:not(.btn-primary):not(.save):focus-visible {
    border-color: #c5d0d8 !important;
    background: #e8eef2 !important;
    box-shadow: 0 0 0 3px rgba(95, 122, 138, .10) !important;
    outline: 0 !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:active:not(:disabled) {
    transform: translateY(1px) !important;
}

html body .ui-dialog.legalmail-listoptions-dialog .ui-resizable-handle,
html body .ui-dialog.legalmail-listoptions-dialog .ui-resizable-se,
html body .ui-dialog.legalmail-listoptions-dialog .ui-icon-gripsmall-diagonal-se {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

/* Keep the "Вид" trigger itself visually aligned with the rest of LegalMail. */
html body.task-mail #listmenulink {
    border-radius: 10px !important;
    transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease !important;
}

html:not(.dark-mode) body.task-mail #listmenulink:not(.disabled):hover,
html:not(.dark-mode) body.task-mail #listmenulink:not(.disabled):focus-visible,
html:not(.dark-mode) body.task-mail #listmenulink[aria-expanded="true"] {
    background: #eef2f4 !important;
    outline: 0 !important;
}

html.dark-mode body .ui-dialog.legalmail-listoptions-dialog {
    border-color: #536168 !important;
    background: #23282d !important;
    box-shadow: 0 14px 38px rgba(0, 0, 0, .34) !important;
}

html.dark-mode body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-titlebar,
html.dark-mode body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content,
html.dark-mode body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane {
    border-color: #414c54 !important;
    background: #23282d !important;
    color: #edf1f3 !important;
}

html.dark-mode body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-title,
html.dark-mode body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-titlebar-close,
html.dark-mode body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content label,
html.dark-mode body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content .col-form-label {
    color: #edf1f3 !important;
    -webkit-text-fill-color: #edf1f3 !important;
}

html.dark-mode body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-titlebar-close:hover,
html.dark-mode body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-titlebar-close:focus-visible {
    background: #31383e !important;
}

html.dark-mode body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content select,
html.dark-mode body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content .form-control {
    border-color: #53616a !important;
    background-color: #2d343a !important;
    color: #eef2f4 !important;
    -webkit-text-fill-color: #eef2f4 !important;
    box-shadow: none !important;
}

html.dark-mode body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content select:focus,
html.dark-mode body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content .form-control:focus {
    border-color: #5f9fc8 !important;
    box-shadow: 0 0 0 3px rgba(79, 154, 202, .18) !important;
}

html.dark-mode body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:not(.btn-primary):not(.save) {
    border-color: #5f7077 !important;
    background: #3f4b50 !important;
    color: #f1f5f6 !important;
    -webkit-text-fill-color: #f1f5f6 !important;
}

html.dark-mode body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:not(.btn-primary):not(.save):hover,
html.dark-mode body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:not(.btn-primary):not(.save):focus-visible {
    border-color: #71858d !important;
    background: #4b5a60 !important;
}

@media screen and (max-width: 560px) {
    html body .ui-dialog.legalmail-listoptions-dialog {
        width: calc(100vw - 16px) !important;
    }

    html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-content .form-group {
        grid-template-columns: 1fr !important;
        row-gap: 5px !important;
    }

    html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
        flex-wrap: wrap !important;
    }

    html body .ui-dialog.legalmail-listoptions-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button {
        flex: 1 1 110px !important;
        min-width: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html body .ui-dialog.legalmail-listoptions-dialog *,
    html body.task-mail #listmenulink {
        transition: none !important;
    }
}

/* ========================================================================== *
 * LegalMail v120.20.19 — Templates guide + unified dialogs/list controls
 * ========================================================================== */

/* Only the selected “Шаблоны” mailbox enables this strip (JS toggles hidden).
 * It sits exactly between the message action toolbar and the message rows. */
body.task-mail.action-none #layout-list > .legalmail-template-guide {
    order: 3 !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 8px 12px 9px !important;
    padding: 10px 13px !important;
    border: 1px solid #d9e5ec !important;
    border-radius: 12px !important;
    background: #f5f9fc !important;
    color: #34434d !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    box-shadow: 0 1px 2px rgba(28, 43, 53, .03) !important;
}

body.task-mail.action-none #layout-list > .legalmail-template-guide[hidden] {
    display: none !important;
}

body.task-mail.action-none #layout-list > .legalmail-template-guide::before {
    content: "\f05a" !important;
    flex: 0 0 18px !important;
    width: 18px !important;
    margin-top: 1px !important;
    color: #50758b !important;
    font-family: Icons !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 18px !important;
    text-align: center !important;
}

body.task-mail.action-none #layout-list > .legalmail-template-guide .legalmail-template-guide-title {
    flex: 0 0 auto !important;
    color: #253740 !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

body.task-mail.action-none #layout-list > .legalmail-template-guide .legalmail-template-guide-text {
    min-width: 0 !important;
    color: #53636d !important;
    font-weight: 400 !important;
}

/* Shift the list/footer one slot down so the guide remains between toolbar and
 * rows without absolute positioning or overlap. */
body.task-mail.action-none #messagelist-content {
    order: 4 !important;
}
body.task-mail.action-none #layout-list > .footer {
    order: 5 !important;
}

/* “Выбрать”, “Вид” and the other list-toolbar actions share one hit-area,
 * radius and hover language. Commands and popup ownership remain native. */
body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls > a,
body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar > a,
body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar > .dropbutton {
    min-height: 36px !important;
    border-radius: 10px !important;
    transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease, color .14s ease !important;
}

body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls > a:not(.disabled):hover,
body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls > a:not(.disabled):focus-visible,
body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls > a[aria-expanded="true"],
body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar > a:not(.disabled):hover,
body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar > a:not(.disabled):focus-visible,
body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar > a[aria-expanded="true"],
body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar > .dropbutton:has(> a:not(.disabled):hover) {
    background: #eef2f4 !important;
    outline: 0 !important;
}

body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls > a:not(.disabled):focus-visible,
body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar > a:not(.disabled):focus-visible {
    box-shadow: 0 0 0 3px rgba(78, 105, 122, .10) !important;
}

/* --------------------------------------------------------------------------
 * “О программе” — same rounded dialog language as the modern confirmations.
 * The about iframe is a stable marker created by Elastic's UI.about_dialog().
 * ----------------------------------------------------------------------- */
html body .ui-dialog:has(iframe#aboutframe) {
    box-sizing: border-box !important;
    width: min(660px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100vh - 24px) !important;
    padding: 0 !important;
    border: 1px solid #d8e0e5 !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: 0 16px 44px rgba(25, 38, 48, .20) !important;
    overflow: hidden !important;
}

html body .ui-dialog:has(iframe#aboutframe) .ui-dialog-titlebar {
    box-sizing: border-box !important;
    min-height: 58px !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 14px 54px 14px 18px !important;
    border: 0 !important;
    border-bottom: 1px solid #e4eaee !important;
    border-radius: 0 !important;
    background: #fff !important;
}

html body .ui-dialog:has(iframe#aboutframe) .ui-dialog-title {
    margin: 0 !important;
    color: #202a31 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 28px !important;
}

html body .ui-dialog:has(iframe#aboutframe) .ui-dialog-titlebar-close {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    width: 38px !important;
    height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: #3c4a53 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

html body .ui-dialog:has(iframe#aboutframe) .ui-dialog-titlebar-close:hover,
html body .ui-dialog:has(iframe#aboutframe) .ui-dialog-titlebar-close:focus-visible {
    background: #eef2f4 !important;
    box-shadow: 0 0 0 3px rgba(78, 105, 122, .08) !important;
}

html body .ui-dialog:has(iframe#aboutframe) .ui-dialog-content {
    box-sizing: border-box !important;
    min-height: 320px !important;
    max-height: calc(100vh - 150px) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: #fff !important;
    overflow: hidden !important;
}

html body .ui-dialog:has(iframe#aboutframe) iframe#aboutframe {
    display: block !important;
    width: 100% !important;
    min-height: 320px !important;
    height: 100% !important;
    border: 0 !important;
    background: #fff !important;
}

html body .ui-dialog:has(iframe#aboutframe) .ui-dialog-buttonpane {
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 12px 16px 16px !important;
    border: 0 !important;
    border-top: 1px solid #e4eaee !important;
    background: #fff !important;
}

html body .ui-dialog:has(iframe#aboutframe) .ui-dialog-buttonpane .ui-dialog-buttonset {
    float: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 !important;
}

html body .ui-dialog:has(iframe#aboutframe) .ui-dialog-buttonpane button {
    min-width: 112px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 8px 16px !important;
    border: 1px solid #d4dde3 !important;
    border-radius: 10px !important;
    background: #f3f6f8 !important;
    color: #41515c !important;
    -webkit-text-fill-color: #41515c !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 20px !important;
    box-shadow: none !important;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .08s ease !important;
}

html body .ui-dialog:has(iframe#aboutframe) .ui-dialog-buttonpane button:not(:disabled):hover,
html body .ui-dialog:has(iframe#aboutframe) .ui-dialog-buttonpane button:not(:disabled):focus-visible {
    border-color: #c5d0d8 !important;
    background: #e8eef2 !important;
    box-shadow: 0 0 0 3px rgba(95, 122, 138, .10) !important;
    outline: 0 !important;
}

html body .ui-dialog:has(iframe#aboutframe) .ui-dialog-buttonpane button.help {
    border-color: #79acd0 !important;
    background: #eaf4fb !important;
    color: #255b7b !important;
    -webkit-text-fill-color: #255b7b !important;
}

html body .ui-dialog:has(iframe#aboutframe) .ui-dialog-buttonpane button.help:not(:disabled):hover,
html body .ui-dialog:has(iframe#aboutframe) .ui-dialog-buttonpane button.help:not(:disabled):focus-visible {
    border-color: #65a0c8 !important;
    background: #dceefa !important;
}

html body .ui-dialog:has(iframe#aboutframe) .ui-resizable-handle,
html body .ui-dialog:has(iframe#aboutframe) .ui-resizable-se,
html body .ui-dialog:has(iframe#aboutframe) .ui-icon-gripsmall-diagonal-se {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

/* Inner framed “О программе” page: remove the old flat/table look. */
body.task-settings.action-about .frame-content {
    box-sizing: border-box !important;
    max-width: none !important;
    min-height: 100% !important;
    margin: 0 !important;
    padding: 20px 22px 24px !important;
    background: #fff !important;
    color: #28343b !important;
}

body.task-settings.action-about .frame-content > .sysname {
    margin: 0 0 7px !important;
    color: #1f2a31 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 28px !important;
}

body.task-settings.action-about .frame-content > .copyright,
body.task-settings.action-about .frame-content > .license,
body.task-settings.action-about .frame-content > p {
    margin: 4px 0 !important;
    color: #6a7881 !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
}

body.task-settings.action-about .frame-content .readtext {
    margin-top: 18px !important;
    padding: 16px !important;
    border: 1px solid #e1e7eb !important;
    border-radius: 12px !important;
    background: #f8fafb !important;
    box-shadow: 0 1px 2px rgba(28, 43, 53, .03) !important;
}

body.task-settings.action-about .frame-content .readtext > h3 {
    margin: 0 0 10px !important;
    color: #2b3941 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 20px !important;
}

body.task-settings.action-about #pluginlist.records-table {
    width: 100% !important;
    margin: 0 !important;
    border: 1px solid #e2e8ec !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: 10px !important;
    background: #fff !important;
    overflow: hidden !important;
}

body.task-settings.action-about #pluginlist.records-table th,
body.task-settings.action-about #pluginlist.records-table td {
    padding: 8px 10px !important;
    border: 0 !important;
    border-bottom: 1px solid #edf1f3 !important;
    background: #fff !important;
    color: #46555e !important;
    font-size: 12.5px !important;
    line-height: 18px !important;
}

body.task-settings.action-about #pluginlist.records-table tr:last-child th,
body.task-settings.action-about #pluginlist.records-table tr:last-child td {
    border-bottom: 0 !important;
}

html.dark-mode body.task-mail.action-none #layout-list > .legalmail-template-guide {
    border-color: #3e4d56 !important;
    background: #252d32 !important;
    color: #dbe4e8 !important;
    box-shadow: none !important;
}
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-template-guide::before {
    color: #8cb7d0 !important;
}
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-template-guide .legalmail-template-guide-title {
    color: #edf3f5 !important;
}
html.dark-mode body.task-mail.action-none #layout-list > .legalmail-template-guide .legalmail-template-guide-text {
    color: #bdc9cf !important;
}

html.dark-mode body .ui-dialog:has(iframe#aboutframe) {
    border-color: #536168 !important;
    background: #23282d !important;
    box-shadow: 0 16px 44px rgba(0, 0, 0, .34) !important;
}
html.dark-mode body .ui-dialog:has(iframe#aboutframe) .ui-dialog-titlebar,
html.dark-mode body .ui-dialog:has(iframe#aboutframe) .ui-dialog-content,
html.dark-mode body .ui-dialog:has(iframe#aboutframe) .ui-dialog-buttonpane {
    border-color: #414c54 !important;
    background: #23282d !important;
    color: #edf1f3 !important;
}
html.dark-mode body .ui-dialog:has(iframe#aboutframe) .ui-dialog-title,
html.dark-mode body .ui-dialog:has(iframe#aboutframe) .ui-dialog-titlebar-close {
    color: #edf1f3 !important;
    -webkit-text-fill-color: #edf1f3 !important;
}
html.dark-mode body .ui-dialog:has(iframe#aboutframe) .ui-dialog-titlebar-close:hover,
html.dark-mode body .ui-dialog:has(iframe#aboutframe) .ui-dialog-titlebar-close:focus-visible {
    background: #31383e !important;
}
html.dark-mode body .ui-dialog:has(iframe#aboutframe) iframe#aboutframe,
html.dark-mode body.task-settings.action-about .frame-content {
    background: #23282d !important;
}
html.dark-mode body.task-settings.action-about .frame-content > .sysname,
html.dark-mode body.task-settings.action-about .frame-content .readtext > h3 {
    color: #edf2f4 !important;
}
html.dark-mode body.task-settings.action-about .frame-content > .copyright,
html.dark-mode body.task-settings.action-about .frame-content > .license,
html.dark-mode body.task-settings.action-about .frame-content > p {
    color: #aebbc1 !important;
}
html.dark-mode body.task-settings.action-about .frame-content .readtext {
    border-color: #414d55 !important;
    background: #293137 !important;
    box-shadow: none !important;
}
html.dark-mode body.task-settings.action-about #pluginlist.records-table,
html.dark-mode body.task-settings.action-about #pluginlist.records-table th,
html.dark-mode body.task-settings.action-about #pluginlist.records-table td {
    border-color: #414d55 !important;
    background: #242b30 !important;
    color: #d8e0e4 !important;
}
html.dark-mode body .ui-dialog:has(iframe#aboutframe) .ui-dialog-buttonpane button:not(.help) {
    border-color: #5f7077 !important;
    background: #3f4b50 !important;
    color: #f1f5f6 !important;
    -webkit-text-fill-color: #f1f5f6 !important;
}

@media screen and (max-width: 760px) {
    body.task-mail.action-none #layout-list > .legalmail-template-guide {
        flex-wrap: wrap !important;
        gap: 4px 8px !important;
        margin: 7px 8px 8px !important;
        padding: 9px 11px !important;
    }
    body.task-mail.action-none #layout-list > .legalmail-template-guide .legalmail-template-guide-title {
        white-space: normal !important;
    }
}

@media screen and (max-width: 560px) {
    html body .ui-dialog:has(iframe#aboutframe) {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
    }
    html body .ui-dialog:has(iframe#aboutframe) .ui-dialog-buttonpane .ui-dialog-buttonset {
        flex-wrap: wrap !important;
    }
    html body .ui-dialog:has(iframe#aboutframe) .ui-dialog-buttonpane button {
        flex: 1 1 110px !important;
        min-width: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.task-mail.action-none #messagelist-header .legalmail-v63-native-list-controls > a,
    body.task-mail.action-none #messagelist-header #mailtoolbar.yandex-mailtoolbar > a,
    html body .ui-dialog:has(iframe#aboutframe) * {
        transition: none !important;
    }
}

/* ========================================================================== *
 * LegalMail v120.20.20 — full message separators + LB avatar in Templates
 * ========================================================================== */
/*
 * The visible LegalMail row is an absolutely-positioned overlay inside the
 * native Subject cell.  A separator painted only on the native table cells can
 * therefore disappear under most of the visible row and remain noticeable only
 * in the narrow trailing cell.  Paint the divider on the overlay itself, while
 * keeping the checkbox-cell divider, so every message has one continuous line.
 */
html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row::after {
    content: "" !important;
    position: absolute !important;
    z-index: 20 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: #eef0f2 !important;
    box-shadow: none !important;
    pointer-events: none !important;
}

html body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td.selection {
    box-shadow: inset 0 -1px 0 #eef0f2 !important;
}

html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row::after {
    background: #35393f !important;
}

html.dark-mode body.task-mail.action-none .messagelist tbody tr.legalmail-yandex-v79 > td.selection {
    box-shadow: inset 0 -1px 0 #35393f !important;
}

/*
 * Only the selected “Шаблоны” mailbox receives body.legalmail-templates-mailbox
 * (see legalmail-v120.js).  Keep all other folders on their normal sender
 * monograms, but cover the monogram in Templates with the existing blue LB
 * logo.  A pseudo-element is intentional here: avatar colors are written inline
 * with !important by the row renderer, and this guarantees the logo stays on
 * top without changing avatar behavior anywhere else.
 */
html body.task-mail.action-none.legalmail-templates-mailbox
    .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar {
    position: relative !important;
    font-size: 0 !important;
    line-height: 0 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

html body.task-mail.action-none.legalmail-templates-mailbox
    .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar::before {
    content: "" !important;
    position: absolute !important;
    z-index: 2 !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #174770 var(--legalmail-lb-logo-image, url("../images/logo.svg")) center / cover no-repeat !important;
    box-shadow: none !important;
    pointer-events: none !important;
}

/* ========================================================================== *
 * LegalMail v120.20.21 — clipped separators + soft Templates branding
 * ========================================================================== */
/*
 * Keep the divider paint inside the visible mail row.  v120.20.20 used an
 * absolutely-positioned ::after line; on some responsive/zoom combinations the
 * browser could composite that 1px layer outside the list card and it became
 * visible over the folders pane.  An inset shadow is clipped to the row box and
 * cannot leak into the sidebar.
 */
html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row::after {
    content: none !important;
    display: none !important;
}

html body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row {
    box-shadow: inset 0 -1px 0 #eef0f2 !important;
}

html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-row {
    box-shadow: inset 0 -1px 0 #35393f !important;
}

/* The folders card is its own opaque clipping layer.  Also remove Elastic's
 * generic .listing li bottom borders from the mailbox tree: those lines are
 * useful in settings lists, but look like mail separators running through the
 * left menu when a nested folder such as “Шаблоны” is shown. */
html body.task-mail.action-none #layout-sidebar {
    z-index: 3 !important;
    isolation: isolate !important;
    overflow: hidden !important;
}

html body.task-mail.action-none #layout-list {
    z-index: 1 !important;
    isolation: isolate !important;
    overflow: hidden !important;
}

html body.task-mail.action-none #layout-sidebar #mailboxlist.folderlist li,
html body.task-mail.action-none #layout-sidebar #mailboxlist.folderlist li.mailbox,
html body.task-mail.action-none #layout-sidebar #mailboxlist.folderlist li > a,
html body.task-mail.action-none #layout-sidebar #mailboxlist.folderlist li > div > a {
    border-top: 0 !important;
    border-bottom: 0 !important;
}

/* In Templates the LB mark is intentionally quieter than a normal sender
 * monogram: a small 24px logo sits on a pale 30px circular chip. */
html body.task-mail.action-none.legalmail-templates-mailbox
    .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar::before {
    box-sizing: border-box !important;
    background-color: #f3f6f8 !important;
    background-image: var(--legalmail-lb-logo-image, url("../images/logo.svg")) !important;
    background-position: center !important;
    background-size: 24px 24px !important;
    background-repeat: no-repeat !important;
    border: 1px solid #e1e8ed !important;
    border-radius: 50% !important;
    box-shadow: 0 1px 3px rgba(23, 71, 112, .10), inset 0 0 0 1px rgba(255,255,255,.55) !important;
}

html.dark-mode body.task-mail.action-none.legalmail-templates-mailbox
    .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar::before {
    background-color: #2d343a !important;
    border-color: #46515a !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.22), inset 0 0 0 1px rgba(255,255,255,.035) !important;
}


/* ========================================================================== *
 * LegalMail v120.20.22 — exact mailbox icon + clean folder tree + full dividers
 * ========================================================================== */
/* Elastic draws a border on nested UL elements in treelists.  That is the
 * stubborn horizontal line seen directly under “Черновики”; removing borders
 * from LI/A alone cannot affect it.  Kill the nested-list separator itself. */
html body.task-mail #mailboxlist.folderlist ul,
html body.task-mail #mailboxlist.folderlist li > ul,
html body.task-mail #mailboxlist.folderlist ul.folderlist,
html body.task-mail #mailboxlist.folderlist ul.treelist {
    border-top: 0 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
    background-image: none !important;
}

/* Keep mailbox rows themselves line-free as well, including responsive/moved
 * copies of the same #mailboxlist used in compose/reader layouts. */
html body.task-mail #mailboxlist.folderlist li,
html body.task-mail #mailboxlist.folderlist li.mailbox,
html body.task-mail #mailboxlist.folderlist li > a,
html body.task-mail #mailboxlist.folderlist li > div > a {
    border-top: 0 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
}

/* Use one identical Templates glyph everywhere the mailbox tree is rendered.
 * No separate icon chip: selected and unselected rows now show the same clean
 * overlapping-sheets mark, with only the row itself providing selection bg. */
html body.task-mail #mailboxlist.folderlist
    li.legalmail-templates-folder > a::before,
html body.task-mail #mailboxlist.folderlist
    li.legalmail-templates-folder > div > a::before {
    content: "\f24d" !important; /* Font Awesome clone */
    box-sizing: border-box !important;
    display: block !important;
    float: left !important;
    width: 22px !important;
    min-width: 22px !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 6px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #252a2f !important;
    -webkit-text-fill-color: #252a2f !important;
    font-family: Icons !important;
    font-size: 14px !important;
    font-style: normal !important;
    font-weight: 900 !important;
    line-height: 38px !important;
    text-align: center !important;
    box-shadow: none !important;
}

html.dark-mode body.task-mail #mailboxlist.folderlist
    li.legalmail-templates-folder > a::before,
html.dark-mode body.task-mail #mailboxlist.folderlist
    li.legalmail-templates-folder > div > a::before {
    background: transparent !important;
    color: #e1e7ea !important;
    -webkit-text-fill-color: #e1e7ea !important;
}

/* Yandex-like row separator: paint the same 1px inset line on EVERY real TD.
 * This explicitly includes td.selection, so the line begins at the list's left
 * edge and runs underneath the checkbox without a blank notch.  The visible
 * subject overlay must not paint a second partial line on top of it. */
html body.task-mail.action-none #messagelist.messagelist {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

html body.task-mail.action-none #messagelist.messagelist tbody tr > td,
html body.task-mail.action-none #messagelist.messagelist tbody tr.legalmail-yandex-v79 > td,
html body.task-mail.action-none #messagelist.messagelist tbody tr.legalmail-yandex-v79 > td.selection {
    border-bottom: 0 !important;
    box-shadow: inset 0 -1px 0 #e8ecef !important;
    background-clip: padding-box !important;
}

html body.task-mail.action-none #messagelist.messagelist
    tr.legalmail-yandex-v79 .legalmail-yandex-row {
    box-shadow: none !important;
}

html.dark-mode body.task-mail.action-none #messagelist.messagelist tbody tr > td,
html.dark-mode body.task-mail.action-none #messagelist.messagelist tbody tr.legalmail-yandex-v79 > td,
html.dark-mode body.task-mail.action-none #messagelist.messagelist tbody tr.legalmail-yandex-v79 > td.selection {
    box-shadow: inset 0 -1px 0 #35393f !important;
}

/* ========================================================================== *
 * LegalMail v120.20.23 — Templates icon parity in message-list view
 * ========================================================================== */
/* action-none has additional sidebar icon rules in Elastic/LegalMail.  Pin the
 * Templates glyph to the exact same clean, transparent appearance used while
 * reading a message.  In particular, never draw a small rounded chip behind
 * the overlapping-sheets icon. */
html body.task-mail.action-none #layout-sidebar #mailboxlist.folderlist
    li.legalmail-templates-folder > a::before,
html body.task-mail.action-none #layout-sidebar #mailboxlist.folderlist
    li.legalmail-templates-folder > div > a::before {
    content: "\f24d" !important;
    box-sizing: border-box !important;
    display: block !important;
    float: left !important;
    width: 22px !important;
    min-width: 22px !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 6px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: #252a2f !important;
    -webkit-text-fill-color: #252a2f !important;
    font-family: Icons !important;
    font-size: 14px !important;
    font-style: normal !important;
    font-weight: 900 !important;
    line-height: 38px !important;
    text-align: center !important;
    box-shadow: none !important;
    filter: none !important;
}

html.dark-mode body.task-mail.action-none #layout-sidebar #mailboxlist.folderlist
    li.legalmail-templates-folder > a::before,
html.dark-mode body.task-mail.action-none #layout-sidebar #mailboxlist.folderlist
    li.legalmail-templates-folder > div > a::before {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: #e1e7ea !important;
    -webkit-text-fill-color: #e1e7ea !important;
    box-shadow: none !important;
}



/* ========================================================================== *
 * LegalMail v120.20.24 — dark folder cleanup + Templates icon in compose
 * ========================================================================== */
/*
 * Elastic paints the selected LI itself in dark mode.  For a parent mailbox
 * (for example “Входящие” with a nested “ВАЖНО”) that background can remain as
 * a 1px strip under the child list.  Keep LI/UL transparent and paint selection
 * only on the clickable row.  This also removes the pale selection “flash” that
 * v120's generic light-theme rule could leave on dark mailboxes/Templates.
 */
html body.task-mail .folderlist li.selected,
html body.task-mail .folderlist li.selected > ul,
html body.task-mail .folderlist li.selected ul {
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

html.dark-mode body.task-mail .folderlist li > a:hover,
html.dark-mode body.task-mail .folderlist li > div > a:hover {
    background: #292c31 !important;
    color: #eef1f3 !important;
    -webkit-text-fill-color: #eef1f3 !important;
}

html.dark-mode body.task-mail .folderlist li.selected > a,
html.dark-mode body.task-mail .folderlist li.selected > div > a,
html.dark-mode body.task-mail .folderlist li > a.selected,
html.dark-mode body.task-mail .folderlist li > div > a.selected,
html.dark-mode body.task-mail .folderlist li[aria-selected="true"] > a,
html.dark-mode body.task-mail .folderlist li[aria-selected="true"] > div > a {
    background: #34383e !important;
    background-color: #34383e !important;
    background-image: none !important;
    color: #f2f4f5 !important;
    -webkit-text-fill-color: #f2f4f5 !important;
    box-shadow: none !important;
}

/* Remove every tree separator in both normal mail and compose sidebars.  The
 * compose view uses #compose-mailboxlist, not #mailboxlist. */
html body.task-mail #mailboxlist.folderlist ul,
html body.task-mail #compose-mailboxlist.folderlist ul,
html body.task-mail #legalmail-folder-sidebar .folderlist ul,
html body.task-mail #layout-sidebar .folderlist ul,
html body.task-mail #mailboxlist.folderlist li,
html body.task-mail #compose-mailboxlist.folderlist li,
html body.task-mail #legalmail-folder-sidebar .folderlist li,
html body.task-mail #layout-sidebar .folderlist li {
    border-top: 0 !important;
    border-bottom: 0 !important;
    border-color: transparent !important;
    box-shadow: none !important;
    background-image: none !important;
}

/* One Templates glyph everywhere, including an opened template in the compose
 * screen (#compose-mailboxlist).  No icon chip/glow in either theme. */
html body.task-mail .folderlist li.legalmail-templates-folder > a::before,
html body.task-mail .folderlist li.legalmail-templates-folder > div > a::before,
html body.task-mail #compose-mailboxlist.folderlist li.legalmail-templates-folder > a::before,
html body.task-mail #compose-mailboxlist.folderlist li.legalmail-templates-folder > div > a::before {
    content: "\f24d" !important;
    box-sizing: border-box !important;
    display: block !important;
    float: left !important;
    width: 22px !important;
    min-width: 22px !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 6px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: #252a2f !important;
    -webkit-text-fill-color: #252a2f !important;
    font-family: Icons !important;
    font-size: 14px !important;
    font-style: normal !important;
    font-weight: 900 !important;
    line-height: 38px !important;
    text-align: center !important;
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
}

html.dark-mode body.task-mail .folderlist li.legalmail-templates-folder > a::before,
html.dark-mode body.task-mail .folderlist li.legalmail-templates-folder > div > a::before,
html.dark-mode body.task-mail #compose-mailboxlist.folderlist li.legalmail-templates-folder > a::before,
html.dark-mode body.task-mail #compose-mailboxlist.folderlist li.legalmail-templates-folder > div > a::before {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: #e1e7ea !important;
    -webkit-text-fill-color: #e1e7ea !important;
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
}


/* ========================================================================== *
 * LegalMail v120.20.25 — first-paint Templates glyph + dark compose body
 * ========================================================================== */
/*
 * The stock Elastic rule was `.folderlist li.drafts a:before`, so every nested
 * mailbox under Drafts inherited the pencil until JavaScript marked Templates.
 * v120.20.25 also fixes that rule in styles.css/lists.less.  These direct link
 * selectors are a no-JS first-paint fallback, so “Шаблоны” never flashes the
 * old pencil while the folder tree is being parsed.
 */
html body.task-mail .folderlist a[title="Шаблоны"]::before,
html body.task-mail .folderlist a[href*="Шаблоны"]::before,
html body.task-mail .folderlist a[href*="%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%D1%8B"]::before,
html body.task-mail #compose-mailboxlist a[title="Шаблоны"]::before,
html body.task-mail #compose-mailboxlist a[href*="Шаблоны"]::before,
html body.task-mail #compose-mailboxlist a[href*="%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%D1%8B"]::before {
    content: "\f24d" !important;
    box-sizing: border-box !important;
    display: block !important;
    float: left !important;
    width: 22px !important;
    min-width: 22px !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 6px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: #252a2f !important;
    -webkit-text-fill-color: #252a2f !important;
    font-family: Icons !important;
    font-size: 14px !important;
    font-style: normal !important;
    font-weight: 900 !important;
    line-height: 38px !important;
    text-align: center !important;
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
}

html.dark-mode body.task-mail .folderlist a[title="Шаблоны"]::before,
html.dark-mode body.task-mail .folderlist a[href*="Шаблоны"]::before,
html.dark-mode body.task-mail .folderlist a[href*="%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%D1%8B"]::before,
html.dark-mode body.task-mail #compose-mailboxlist a[title="Шаблоны"]::before,
html.dark-mode body.task-mail #compose-mailboxlist a[href*="Шаблоны"]::before,
html.dark-mode body.task-mail #compose-mailboxlist a[href*="%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%D1%8B"]::before {
    color: #e1e7ea !important;
    -webkit-text-fill-color: #e1e7ea !important;
}

/* The visible TinyMCE chrome already followed the dark theme, but the editor
 * document itself lives in an iframe and could remain white.  Keep both the
 * plain-text fallback and every common TinyMCE iframe/edit-area surface dark;
 * legalmail-v120-early.js applies the matching colors inside the iframe too. */
html.dark-mode body.task-mail.action-compose #composebodycontainer,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox-editor-container,
html.dark-mode body.task-mail.action-compose #composebodycontainer .tox-edit-area,
html.dark-mode body.task-mail.action-compose #composebodycontainer .mce-edit-area,
html.dark-mode body.task-mail.action-compose #composebodycontainer iframe,
html.dark-mode body.task-mail.action-compose iframe#composebody_ifr,
html.dark-mode body.task-mail.action-compose iframe[id^="composebody_"][id$="_ifr"] {
    background: #292e35 !important;
    background-color: #292e35 !important;
    color-scheme: dark !important;
}

html.dark-mode body.task-mail.action-compose #composebodycontainer textarea#composebody {
    background: #292e35 !important;
    background-color: #292e35 !important;
    color: #e7ebef !important;
    -webkit-text-fill-color: #e7ebef !important;
    caret-color: #ffffff !important;
    border-color: #434a54 !important;
}

/* ========================================================================== *
 * LegalMail v120.20.26 — keep the first/focused row divider after reload
 * ========================================================================== */
/*
 * Roundcube puts keyboard focus on the first message after a mailbox reload.
 * An older LegalMail "no focus stripe" rule used `box-shadow:none` on the
 * focused row's leading cells.  v106+ uses that same box-shadow to paint the
 * 1px Yandex-style row separator, so only the focused first row lost the line
 * under the checkbox/avatar area.  Keep the blue focus stripe disabled via
 * border-left, but always repaint the divider on every focused cell.
 */
@media screen and (min-width: 769px) {
    html:not(.touch) body.task-mail.action-none
        #messagelist.listing.focus tbody tr.focused > td,
    html:not(.touch) body.task-mail.action-none
        #messagelist.listing.focus:not(.withselection) tbody tr.focused > td.selection + td {
        border-left-color: transparent !important;
        box-shadow: inset 0 -1px 0 #e8ecef !important;
    }

    html.dark-mode:not(.touch) body.task-mail.action-none
        #messagelist.listing.focus tbody tr.focused > td,
    html.dark-mode:not(.touch) body.task-mail.action-none
        #messagelist.listing.focus:not(.withselection) tbody tr.focused > td.selection + td {
        border-left-color: transparent !important;
        box-shadow: inset 0 -1px 0 #35393f !important;
    }
}


/* ========================================================================== *
 * LegalMail v120.20.28 — Yandex-like left flag lane + selection-menu repair
 * ========================================================================== */
/*
 * Roundcube keeps its native flag state in the hidden flags column.  The
 * LegalMail list now mirrors that state in a dedicated lane immediately to the
 * LEFT of the persistent checkbox.  The lane is clickable without opening the
 * message; marking through Roundcube's menu is mirrored by the same row tint.
 */
@media screen and (min-width: 769px) {
    html body.task-mail.action-none .messagelist tbody tr > td.selection {
        position: relative !important;
        width: 48px !important;
        min-width: 48px !important;
        max-width: 48px !important;
        padding: 0 !important;
        line-height: 48px !important;
        text-align: left !important;
        overflow: visible !important;
    }

    html body.task-mail.action-none .messagelist tbody tr > td.selection input[type="checkbox"] {
        position: absolute !important;
        left: 27px !important;
        top: 50% !important;
        z-index: 2 !important;
        margin: 0 !important;
        transform: translateY(-50%) !important;
        vertical-align: middle !important;
    }

    html body.task-mail.action-none .messagelist .legalmail-yandex-flag-toggle {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        z-index: 3 !important;
        display: block !important;
        width: 20px !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        outline: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        cursor: pointer !important;
        user-select: none !important;
        -webkit-user-select: none !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    /* A compact pennant with the inward notch used by Yandex-like lists. */
    html body.task-mail.action-none .messagelist .legalmail-yandex-flag-toggle::before {
        content: "" !important;
        position: absolute !important;
        left: 0 !important;
        top: 50% !important;
        display: block !important;
        width: 12px !important;
        height: 14px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 1px 1px 0 !important;
        background: #aeb5bd !important;
        clip-path: polygon(0 0, 100% 0, 62% 50%, 100% 100%, 0 100%) !important;
        opacity: 0 !important;
        transform: translateY(-50%) !important;
        transition: opacity .08s linear, background-color .08s linear !important;
        box-shadow: none !important;
    }

    /* Unmarked messages expose a quiet affordance only on hover/focus. */
    html body.task-mail.action-none .messagelist tbody tr:hover .legalmail-yandex-flag-toggle::before,
    html body.task-mail.action-none .messagelist .legalmail-yandex-flag-toggle:focus-visible::before {
        opacity: .42 !important;
    }

    html body.task-mail.action-none .messagelist .legalmail-yandex-flag-toggle:hover::before,
    html body.task-mail.action-none .messagelist .legalmail-yandex-flag-toggle:focus-visible::before {
        background: #e32636 !important;
        opacity: 1 !important;
    }

    /* Native menu marking and direct flag clicks converge on this same visual. */
    html body.task-mail.action-none .messagelist tbody tr.flagged .legalmail-yandex-flag-toggle::before,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-flagged-visual .legalmail-yandex-flag-toggle::before {
        background: #ff1f32 !important;
        opacity: 1 !important;
    }

    html body.task-mail.action-none .messagelist tbody tr.flagged > td,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-flagged-visual > td {
        background: #fff0f3 !important;
    }

    html body.task-mail.action-none .messagelist tbody tr.flagged:hover > td,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-flagged-visual:hover > td {
        background: #ffe8ed !important;
    }

    html body.task-mail.action-none .messagelist tbody tr.flagged.selected > td,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-flagged-visual.selected > td {
        background: #f9dfe5 !important;
    }

    /* Keep the existing one-pixel row divider intact on the tinted row. */
    html body.task-mail.action-none .messagelist tbody tr.flagged > td,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-flagged-visual > td,
    html body.task-mail.action-none .messagelist tbody tr.flagged.focused > td,
    html body.task-mail.action-none .messagelist tbody tr.legalmail-flagged-visual.focused > td {
        box-shadow: inset 0 -1px 0 #e8ecef !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist tbody tr.flagged > td,
    html.dark-mode body.task-mail.action-none .messagelist tbody tr.legalmail-flagged-visual > td {
        background: #38262c !important;
        box-shadow: inset 0 -1px 0 #4b333a !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist tbody tr.flagged:hover > td,
    html.dark-mode body.task-mail.action-none .messagelist tbody tr.legalmail-flagged-visual:hover > td {
        background: #442c33 !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist tbody tr.flagged.selected > td,
    html.dark-mode body.task-mail.action-none .messagelist tbody tr.legalmail-flagged-visual.selected > td {
        background: #503039 !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist .legalmail-yandex-flag-toggle::before {
        background: #7e8791 !important;
    }

    html.dark-mode body.task-mail.action-none .messagelist tbody tr.flagged .legalmail-yandex-flag-toggle::before,
    html.dark-mode body.task-mail.action-none .messagelist tbody tr.legalmail-flagged-visual .legalmail-yandex-flag-toggle::before,
    html.dark-mode body.task-mail.action-none .messagelist .legalmail-yandex-flag-toggle:hover::before,
    html.dark-mode body.task-mail.action-none .messagelist .legalmail-yandex-flag-toggle:focus-visible::before {
        background: #ff4354 !important;
    }
}


/* ========================================================================== *
 * LegalMail v120.20.28 — flag/checkbox optical alignment + native Select menu
 * ========================================================================== */
@media screen and (min-width: 769px) {
    /* Use the row's real center instead of a hard-coded pixel top. This keeps
       the pennant exactly opposite the checkbox in 40px and 48px list rows. */
    html body.task-mail.action-none #messagelist.messagelist
        .legalmail-yandex-flag-toggle {
        top: 0 !important;
        bottom: 0 !important;
        height: auto !important;
    }

    html body.task-mail.action-none #messagelist.messagelist
        .legalmail-yandex-flag-toggle::before {
        top: 50% !important;
        transform: translateY(-50%) !important;
    }

    html body.task-mail.action-none #messagelist.messagelist tbody tr > td.selection
        input[type="checkbox"] {
        top: 50% !important;
        transform: translateY(-50%) !important;
    }
}


/* ==========================================================================
 * LegalMail v120.20.30 — clearer native Select menu labels
 * ========================================================================== */
body.task-mail #listselect-menu {
    min-width: 218px !important;
}

body.task-mail #listselect-menu .menu.listing > li > a {
    white-space: nowrap !important;
}

/* ========================================================================== 
 * LegalMail v120.20.33 — compose/templates: one outer page scrollbar
 * --------------------------------------------------------------------------
 * The compose card used to inherit overflow:auto from an older v120 layer.
 * Long templates therefore scrolled inside the white card while the surrounding
 * mail pane stayed still.  Reading a message already uses one outer scroller;
 * compose now follows the same interaction model.
 * ========================================================================== */
html body.task-mail.action-compose #layout-content.legalmail-compose-view {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
}

/* Keep the compose toolbar available while the whole editor card moves below
 * it. The scrollbar belongs to the content pane, not to #compose-content. */
html body.task-mail.action-compose #layout-content.legalmail-compose-view > .header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1300 !important;
}

html body.task-mail.action-compose #compose-content,
html body.task-mail.action-compose.legalmail-reply-compose #compose-content,
html body.task-mail.action-compose.legalmail-external-compose #compose-content,
html body.task-mail.action-compose.legalmail-external-compose.legalmail-reply-compose #compose-content {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
}

/* TinyMCE/plain-text bodies are auto-grown by legalmail-v120.js. These guards
 * make sure no CSS ceiling recreates a second vertical scrollbar. */
html body.task-mail.action-compose #composebodycontainer,
html body.task-mail.action-compose #composebodycontainer .tox-tinymce,
html body.task-mail.action-compose #composebodycontainer .tox-editor-container,
html body.task-mail.action-compose #composebodycontainer .tox-edit-area {
    max-height: none !important;
}

html body.task-mail.action-compose #composebodycontainer textarea#composebody {
    overflow-y: hidden !important;
    max-height: none !important;
}


/* ========================================================================== 
 * LegalMail v120.20.34 — readable TinyMCE font selector
 * ========================================================================== */
html body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn--select.legalmail-font-family-select {
    width: 142px !important;
    min-width: 142px !important;
    max-width: 142px !important;
    flex: 0 0 142px !important;
    justify-content: space-between !important;
}

html body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn--select.legalmail-font-family-select .tox-tbtn__select-label {
    display: block !important;
    min-width: 0 !important;
    max-width: 104px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    text-align: left !important;
}

@media screen and (max-width: 768px) {
    html body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn--select.legalmail-font-family-select {
        width: 124px !important;
        min-width: 124px !important;
        max-width: 124px !important;
        flex-basis: 124px !important;
    }

    html body.task-mail.action-compose #composebodycontainer .tox .tox-tbtn--select.legalmail-font-family-select .tox-tbtn__select-label {
        max-width: 86px !important;
    }
}


/* ==========================================================================
 * LegalMail v120.20.36 — compact editor content inset
 * --------------------------------------------------------------------------
 * TinyMCE content uses styles/embed.css inside its iframe. Keep the plain-text
 * compose body visually consistent: less empty space above the first line and
 * a small breathing room on the left/right edges.
 * ========================================================================== */
html body.task-mail.action-compose #composebodycontainer textarea#composebody {
    box-sizing: border-box !important;
    padding: 8px 14px 14px !important;
}


/* v120.20.37: compose editor content inset is injected into the TinyMCE iframe
 * by legalmail-v120.js as well, so cached embed.css cannot preserve old spacing. */
html body.task-mail.action-compose #composebodycontainer .tox-edit-area__iframe,
html body.task-mail.action-compose #composebodycontainer .tox-edit-area iframe {
    margin: 0 !important;
}


/* ========================================================================== 
 * LegalMail v120.20.37 — roomier editor inset + clean compose transition
 * --------------------------------------------------------------------------
 * Keep a comfortable writing inset in both HTML and plain-text compose modes.
 * The thin separator below Subject duplicated the TinyMCE card edge, so remove
 * it for normal compose, replies and messages opened from Templates in both
 * light and dark themes.
 * ========================================================================== */
html body.task-mail.action-compose #composebodycontainer textarea#composebody {
    box-sizing: border-box !important;
    padding: 8px 14px 14px !important;
}

html body.task-mail.action-compose #compose-headers,
html.dark-mode body.task-mail.action-compose #compose-headers {
    border-bottom: 0 !important;
    border-bottom-color: transparent !important;
}


/* ========================================================================== *
 * LegalMail v120.20.38 — Templates icon in “Переместить в…” folder selector
 * ========================================================================== */
/* The move/copy selector is generated dynamically and its LI elements do not
 * always carry the normal `mailbox` class.  JS marks the Templates LI with the
 * same legalmail-templates-folder class used by the permanent mailbox tree;
 * pin the same overlapping-sheets glyph here so the popup can never fall back
 * to Elastic's generic folder icon. */
html body.task-mail #folder-selector.folderlist li.legalmail-templates-folder > a::before,
html body.task-mail #folder-selector li.legalmail-templates-folder > a::before,
html body.task-mail .popover #folder-selector li.legalmail-templates-folder > a::before,
html body.task-mail .popover ul.folderlist li.legalmail-templates-folder > a::before {
    content: "\f24d" !important;
    box-sizing: border-box !important;
    display: block !important;
    float: left !important;
    width: 22px !important;
    min-width: 22px !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 6px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    color: #252a2f !important;
    -webkit-text-fill-color: #252a2f !important;
    font-family: Icons !important;
    font-size: 14px !important;
    font-style: normal !important;
    font-weight: 900 !important;
    line-height: 38px !important;
    text-align: center !important;
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
}

html.dark-mode body.task-mail #folder-selector li.legalmail-templates-folder > a::before,
html.dark-mode body.task-mail .popover #folder-selector li.legalmail-templates-folder > a::before,
html.dark-mode body.task-mail .popover ul.folderlist li.legalmail-templates-folder > a::before {
    color: #e1e7ea !important;
    -webkit-text-fill-color: #e1e7ea !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* ========================================================================== *
 * LegalMail v120.20.39 — align Templates glyph in Move/Copy menu
 * ========================================================================== */
/* v120.20.38 reused the 38px sidebar icon box inside the compact folder popup.
 * That made only the Templates row taller and shifted its text/icon left.
 * Restore Elastic's native popup icon geometry and keep only our glyph. */
html body.task-mail #folder-selector.folderlist.menu li.legalmail-templates-folder > a::before,
html body.task-mail .popover #folder-selector.folderlist.menu li.legalmail-templates-folder > a::before,
html body.task-mail .popover ul.folderlist.menu li.legalmail-templates-folder > a::before {
    content: "\f24d" !important;
    display: block !important;
    float: left !important;
    box-sizing: content-box !important;
    width: 1.18em !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 1em !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 .5rem 0 .5em !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    font-family: Icons !important;
    font-size: 1.25em !important;
    font-style: normal !important;
    font-weight: 900 !important;
    line-height: inherit !important;
    text-align: center !important;
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
}

html.dark-mode body.task-mail #folder-selector.folderlist.menu li.legalmail-templates-folder > a::before,
html.dark-mode body.task-mail .popover #folder-selector.folderlist.menu li.legalmail-templates-folder > a::before,
html.dark-mode body.task-mail .popover ul.folderlist.menu li.legalmail-templates-folder > a::before {
    color: #e1e7ea !important;
    -webkit-text-fill-color: #e1e7ea !important;
}

/* ========================================================================== *
 * LegalMail v120.20.40 — final Move/Copy Templates row parity
 * ========================================================================== */
/* The live Roundcube folder selector is not guaranteed to carry `.menu`.
 * Therefore v120.20.39 could miss the real popup and the older 38px icon box
 * from v120.20.38 stayed active.  Override the Templates item in EVERY
 * folder-selector shape with Elastic's native compact icon geometry. */
html body.task-mail #folder-selector li.legalmail-templates-folder > a::before,
html body.task-mail #folder-selector.folderlist li.legalmail-templates-folder > a::before,
html body.task-mail .popover #folder-selector li.legalmail-templates-folder > a::before,
html body.task-mail .popover ul.folderlist li.legalmail-templates-folder > a::before,
html body.task-mail .popupmenu #folder-selector li.legalmail-templates-folder > a::before {
    content: "\f24d" !important;
    display: block !important;
    float: left !important;
    box-sizing: content-box !important;
    width: 1.18em !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 1em !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 .5rem 0 .5em !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    color: #465057 !important;
    -webkit-text-fill-color: #465057 !important;
    font-family: Icons !important;
    font-size: 1.25em !important;
    font-style: normal !important;
    font-weight: 900 !important;
    line-height: inherit !important;
    text-align: center !important;
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
}

/* Keep the row itself on exactly the same rhythm as neighboring folders. */
html body.task-mail #folder-selector li.legalmail-templates-folder,
html body.task-mail .popover #folder-selector li.legalmail-templates-folder,
html body.task-mail .popover ul.folderlist li.legalmail-templates-folder {
    min-height: 0 !important;
    height: auto !important;
}

html body.task-mail #folder-selector li.legalmail-templates-folder > a,
html body.task-mail .popover #folder-selector li.legalmail-templates-folder > a,
html body.task-mail .popover ul.folderlist li.legalmail-templates-folder > a {
    min-height: 0 !important;
    height: auto !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: inherit !important;
}

html.dark-mode body.task-mail #folder-selector li.legalmail-templates-folder > a::before,
html.dark-mode body.task-mail .popover #folder-selector li.legalmail-templates-folder > a::before,
html.dark-mode body.task-mail .popover ul.folderlist li.legalmail-templates-folder > a::before {
    color: #c5d1d3 !important;
    -webkit-text-fill-color: #c5d1d3 !important;
}

/* ========================================================================== *
 * LegalMail v120.20.41 — stronger dark-theme folder counters
 * ========================================================================== */
html.dark-mode body.task-mail #layout-sidebar .folderlist li.mailbox .unreadcount,
html.dark-mode body.task-mail #layout-sidebar .folderlist li.mailbox .legalmail-draft-total-count,
html.dark-mode body.task-mail #legalmail-folder-sidebar .folderlist li.mailbox .unreadcount,
html.dark-mode body.task-mail #legalmail-folder-sidebar .folderlist li.mailbox .legalmail-draft-total-count {
    font-weight: 800 !important;
}

/* ========================================================================== *
 * LegalMail v120.20.43 — dark compose card parity with light theme
 * --------------------------------------------------------------------------
 * Keep the same visual hierarchy as the light composer: one rounded compose
 * card on a darker page.  In dark mode an older rule painted the whole
 * #composebodycontainer #292e35, producing a conspicuous square behind the
 * rounded TinyMCE editor.  The wrapper is now transparent; only the actual
 * editor remains a distinct surface and is clipped to its rounded corners.
 * ========================================================================== */
html.dark-mode body.task-mail.action-compose #layout-content.legalmail-compose-view {
    background: #181a1e !important;
}

html.dark-mode body.task-mail.action-compose #compose-content > form,
html.dark-mode body.task-mail.action-compose #compose-headers,
html.dark-mode body.task-mail.action-compose #composebodycontainer {
    background: transparent !important;
    background-color: transparent !important;
}

html.dark-mode body.task-mail.action-compose #composebodycontainer {
    border: 0 !important;
    box-shadow: none !important;
}

html.dark-mode body.task-mail.action-compose #composebodycontainer .tox.tox-tinymce {
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #252a30 !important;
    background-color: #252a30 !important;
}

@media screen and (min-width: 769px) {
    html.dark-mode body.task-mail.action-compose #compose-content,
    html.dark-mode body.task-mail.action-compose.legalmail-reply-compose #compose-content,
    html.dark-mode body.task-mail.action-compose.legalmail-external-compose #compose-content,
    html.dark-mode body.task-mail.action-compose.legalmail-external-compose.legalmail-reply-compose #compose-content {
        border: 1px solid #34383e !important;
        border-radius: 18px !important;
        background: #202226 !important;
        background-color: #202226 !important;
        box-shadow: 0 7px 26px rgba(0, 0, 0, .20) !important;
    }
}

/* ========================================================================== *
 * LegalMail v120.20.44 — seamless dark incoming-message card
 * --------------------------------------------------------------------------
 * In dark mode the opened-message header and body are two adjacent halves of
 * one reader card.  Elastic/legacy message spacing can expose a thin strip of
 * the page background between them.  Pin both halves together visually and
 * remove the first HTML-part top gap, while leaving the light theme untouched.
 * ========================================================================== */
html.dark-mode body.task-mail.action-show #message-header {
    margin-bottom: 0 !important;
}

html.dark-mode body.task-mail.action-show #message-content {
    position: relative !important;
    margin-top: 0 !important;
    border-top: 0 !important;
}

/* Bridge the legacy ~.5rem seam without moving the message contents.  The
 * header/content halves already use the same reader-card surface, so this is
 * visually equivalent to the continuous light-theme card. */
html.dark-mode body.task-mail.action-show #message-header + #message-content::before {
    content: "" !important;
    position: absolute !important;
    z-index: 0 !important;
    left: -1px !important;
    right: -1px !important;
    top: -8px !important;
    height: 8px !important;
    box-sizing: border-box !important;
    border-left: 1px solid #3d444d !important;
    border-right: 1px solid #3d444d !important;
    background: #23272d !important;
    pointer-events: none !important;
}

html.dark-mode body.task-mail.action-show #message-content > .leftcol,
html.dark-mode body.task-mail.action-show #message-content > .rightcol {
    position: relative !important;
    z-index: 1 !important;
}

/* Roundcube gives HTML message parts margin-top:.5rem in dark mode.  On the
 * first rendered part this creates a second visible band before the email.
 * Keep separators only between genuine subsequent MIME parts. */
html.dark-mode body.task-mail.action-show #messagebody > .message-htmlpart:first-child,
html.dark-mode body.task-mail.action-show #messagebody > .message-part:first-child {
    margin-top: 0 !important;
    border-top: 0 !important;
}

/* ========================================================================== *
 * LegalMail v120.20.45 — no horizontal mail scrollbar + subtle body outline
 * --------------------------------------------------------------------------
 * Some incoming HTML mail contains fixed-width tables/containers.  Older
 * LegalMail rules intentionally put overflow-x:auto on .rcmBody, which makes a
 * visible horizontal scrollbar at the bottom of such messages.  The reader
 * should behave like a normal mail client instead: constrain wide content to
 * the card, wrap long text/URLs and clip only the impossible remainder.
 * The actual message body also gets one quiet rounded outline so the readable
 * area is clear in both themes without introducing another heavy card.
 * ========================================================================== */
html body.task-mail.action-show #messagebody {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    overflow: clip !important;
    border: 1px solid #e1e6eb !important;
    border-radius: 14px !important;
    background: #fff !important;
    background-color: #fff !important;
}

/* The HTML part itself must never become a horizontal scroll container. */
html body.task-mail.action-show #messagebody .message-htmlpart,
html body.task-mail.action-show #messagebody .message-part,
html body.task-mail.action-show #messagebody .message-htmlpart > .rcmBody,
html body.task-mail.action-show #messagebody .message-htmlpart .rcmBody,
html body.task-mail.action-show #messagebody .message-part > .rcmBody,
html body.task-mail.action-show #messagebody .message-part .rcmBody {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    overflow: clip !important;
    scrollbar-width: none !important;
}

html body.task-mail.action-show #messagebody .message-htmlpart::-webkit-scrollbar,
html body.task-mail.action-show #messagebody .message-part::-webkit-scrollbar,
html body.task-mail.action-show #messagebody .rcmBody::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Respect the sender's layout, but never let a fixed pixel width exceed the
 * reader card.  max-width overrides fixed inline widths without flattening all
 * normal table widths to 100%. */
html body.task-mail.action-show #messagebody .rcmBody *,
html body.task-mail.action-show #messagebody .message-part * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

html body.task-mail.action-show #messagebody .rcmBody table,
html body.task-mail.action-show #messagebody .message-part table {
    max-width: 100% !important;
}

html body.task-mail.action-show #messagebody .rcmBody img:not([width="1"]):not([height="1"]),
html body.task-mail.action-show #messagebody .message-part img:not([width="1"]):not([height="1"]),
html body.task-mail.action-show #messagebody .rcmBody video,
html body.task-mail.action-show #messagebody .rcmBody canvas,
html body.task-mail.action-show #messagebody .rcmBody svg,
html body.task-mail.action-show #messagebody .rcmBody iframe,
html body.task-mail.action-show #messagebody .rcmBody object,
html body.task-mail.action-show #messagebody .rcmBody embed {
    max-width: 100% !important;
}

/* Long URLs, signatures and preformatted text must wrap instead of expanding
 * the mail to the right. */
html body.task-mail.action-show #messagebody .rcmBody,
html body.task-mail.action-show #messagebody .rcmBody p,
html body.task-mail.action-show #messagebody .rcmBody div,
html body.task-mail.action-show #messagebody .rcmBody td,
html body.task-mail.action-show #messagebody .rcmBody th,
html body.task-mail.action-show #messagebody .rcmBody a,
html body.task-mail.action-show #messagebody .message-part,
html body.task-mail.action-show #messagebody .message-part p,
html body.task-mail.action-show #messagebody .message-part div,
html body.task-mail.action-show #messagebody .message-part td,
html body.task-mail.action-show #messagebody .message-part th,
html body.task-mail.action-show #messagebody .message-part a {
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

html body.task-mail.action-show #messagebody .rcmBody pre,
html body.task-mail.action-show #messagebody .rcmBody code,
html body.task-mail.action-show #messagebody .message-part pre,
html body.task-mail.action-show #messagebody .message-part code {
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
}

/* Keep the first/last part visually inside the one rounded mail outline. */
html body.task-mail.action-show #messagebody > :first-child {
    border-top-left-radius: 13px !important;
    border-top-right-radius: 13px !important;
}
html body.task-mail.action-show #messagebody > :last-child {
    border-bottom-left-radius: 13px !important;
    border-bottom-right-radius: 13px !important;
}

html.dark-mode body.task-mail.action-show #messagebody {
    border-color: #3b424b !important;
    background: #292e35 !important;
    background-color: #292e35 !important;
}

/* On small screens keep the outline, but soften the radius to preserve room. */
@media screen and (max-width: 768px) {
    html body.task-mail.action-show #messagebody {
        border-radius: 10px !important;
    }
}

/* ========================================================================== *
 * LegalMail v120.20.46 — reader inner padding
 * --------------------------------------------------------------------------
 * Give the opened-message body the same quiet inner breathing room as the
 * composer editor.  The padding belongs to the outer reader outline, so both
 * HTML and plain-text mail stay away from the rounded border without adding a
 * nested scroll container or changing the sender's own paragraph spacing.
 * ========================================================================== */
html body.task-mail.action-show #messagebody {
    padding: 8px 14px 12px !important;
}

html.dark-mode body.task-mail.action-show #messagebody {
    padding: 8px 14px 12px !important;
}

@media screen and (max-width: 768px) {
    html body.task-mail.action-show #messagebody {
        padding: 7px 10px 10px !important;
    }
}

/* ========================================================================== *
 * LegalMail v120.20.47 — dark reader: one rounded body, no square halo
 * --------------------------------------------------------------------------
 * v120.20.45 introduced a rounded #messagebody outline. In dark mode the
 * older #message-content/.rightcol surfaces remained visible behind it as a
 * rectangular #23272d/#292e35 layer, so the rounded body looked as if it sat
 * inside a square. Keep the surrounding reader area transparent and let the
 * rounded #messagebody be the only visible body card. Also remove rounding
 * from nested MIME/HTML surfaces: only the outer mail frame owns the corners.
 * ========================================================================== */
html.dark-mode body.task-mail.action-show #message-content {
    background: transparent !important;
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

html.dark-mode body.task-mail.action-show #message-header + #message-content::before {
    display: none !important;
    content: none !important;
}

html.dark-mode body.task-mail.action-show #message-content > .leftcol,
html.dark-mode body.task-mail.action-show #message-content > .rightcol,
html.dark-mode body.task-mail.action-show #message-content .rightcol {
    background: transparent !important;
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

html.dark-mode body.task-mail.action-show #messagebody {
    position: relative !important;
    isolation: isolate !important;
    border-radius: 16px !important;
    background: #292e35 !important;
    background-color: #292e35 !important;
    background-clip: padding-box !important;
    overflow: hidden !important;
    overflow: clip !important;
}

/* Nested mail surfaces stay square inside the padded outer frame. This avoids
 * the visibly "cut" second set of rounded corners shown by HTML mail. */
html.dark-mode body.task-mail.action-show #messagebody > :first-child,
html.dark-mode body.task-mail.action-show #messagebody > :last-child,
html.dark-mode body.task-mail.action-show #messagebody .message-htmlpart,
html.dark-mode body.task-mail.action-show #messagebody .message-part,
html.dark-mode body.task-mail.action-show #messagebody .message-htmlpart > .rcmBody,
html.dark-mode body.task-mail.action-show #messagebody .message-htmlpart .rcmBody,
html.dark-mode body.task-mail.action-show #messagebody .message-part > .rcmBody,
html.dark-mode body.task-mail.action-show #messagebody .message-part .rcmBody {
    border-radius: 0 !important;
}

@media screen and (max-width: 768px) {
    html.dark-mode body.task-mail.action-show #messagebody {
        border-radius: 12px !important;
    }
}

/* ========================================================================== *
 * LegalMail v120.20.48 — dark reader continuous outer card
 * --------------------------------------------------------------------------
 * Restore the reader's dark outer card all the way below the message header,
 * but keep the join between header and body completely seamless.  The header
 * owns only the top corners, #message-content owns only the bottom corners,
 * and both halves share one surface/border.  The rounded #messagebody remains
 * the quiet inner mail frame introduced in v120.20.45–47.
 * ========================================================================== */
html.dark-mode body.task-mail.action-show #message-header {
    margin-bottom: 0 !important;
    background: #23272d !important;
    background-color: #23272d !important;
    border: 1px solid #3d444d !important;
    border-bottom: 0 !important;
    border-radius: 18px 18px 0 0 !important;
    box-shadow: none !important;
}

html.dark-mode body.task-mail.action-show #message-content {
    margin-top: 0 !important;
    background: #23272d !important;
    background-color: #23272d !important;
    border: 1px solid #3d444d !important;
    border-top: 0 !important;
    border-radius: 0 0 18px 18px !important;
    box-shadow: 0 7px 26px rgba(0, 0, 0, .16) !important;
}

/* No bridge strip or pseudo-element at the join: the two halves already touch
 * and use the exact same surface. */
html.dark-mode body.task-mail.action-show #message-header + #message-content::before {
    display: none !important;
    content: none !important;
}

/* Keep legacy columns invisible so they cannot draw a second rectangle inside
 * the continuous outer card. */
html.dark-mode body.task-mail.action-show #message-content > .leftcol,
html.dark-mode body.task-mail.action-show #message-content > .rightcol,
html.dark-mode body.task-mail.action-show #message-content .rightcol {
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* The inner email frame remains rounded, but sits on the continuous outer
 * surface with no extra top band or transition. */
html.dark-mode body.task-mail.action-show #messagebody {
    margin-top: 0 !important;
}

@media screen and (max-width: 768px) {
    html.dark-mode body.task-mail.action-show #message-header {
        border-radius: 14px 14px 0 0 !important;
    }
    html.dark-mode body.task-mail.action-show #message-content {
        border-radius: 0 0 14px 14px !important;
    }
}

/* ========================================================================== *
 * LegalMail v120.20.49 — light reader: clean bottom rounded corners
 * --------------------------------------------------------------------------
 * Some HTML messages paint their last inner part over the antialiased bottom
 * edge of #messagebody, which makes the light-theme lower corners look cut or
 * almost square. Keep the existing box geometry, let the outer reader body own
 * the rounding, and draw one final 1px outline above message content so the
 * lower arcs stay continuous and visible.
 * ========================================================================== */
html:not(.dark-mode) body.task-mail.action-show #messagebody {
    position: relative !important;
    border-color: transparent !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    background-clip: padding-box !important;
}

html:not(.dark-mode) body.task-mail.action-show #messagebody::after {
    content: "" !important;
    position: absolute !important;
    z-index: 20 !important;
    inset: 0 !important;
    box-sizing: border-box !important;
    border: 1px solid #d9dfe5 !important;
    border-radius: 14px !important;
    pointer-events: none !important;
}

/* Avoid a second set of inner radii fighting the outer frame. */
html:not(.dark-mode) body.task-mail.action-show #messagebody > :first-child,
html:not(.dark-mode) body.task-mail.action-show #messagebody > :last-child {
    border-radius: 0 !important;
}

@media screen and (max-width: 768px) {
    html:not(.dark-mode) body.task-mail.action-show #messagebody,
    html:not(.dark-mode) body.task-mail.action-show #messagebody::after {
        border-radius: 10px !important;
    }
}

/* ========================================================================== *
 * LegalMail v120.20.50 — verified @legalbook.ru sender logo
 * --------------------------------------------------------------------------
 * JS adds .legalmail-trusted-domain-row only after the raw Received chain has
 * passed the local ESMTPSA + LMTP verification.  Match the softened LB avatar
 * used in Templates, but do not affect unverified same-domain-looking mail.
 * ========================================================================== */
html body.task-mail.action-none .messagelist tr.legalmail-trusted-domain-row .legalmail-yandex-avatar {
    position: relative !important;
    font-size: 0 !important;
    line-height: 0 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

html body.task-mail.action-none .messagelist tr.legalmail-trusted-domain-row .legalmail-yandex-avatar::before {
    content: "" !important;
    position: absolute !important;
    z-index: 4 !important;
    inset: 0 !important;
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #e1e8ed !important;
    border-radius: 50% !important;
    background-color: #f3f6f8 !important;
    background-image: var(--legalmail-lb-logo-image, url("../images/logo.svg")) !important;
    background-position: center !important;
    background-size: 24px 24px !important;
    background-repeat: no-repeat !important;
    box-shadow: 0 1px 3px rgba(23, 71, 112, .10), inset 0 0 0 1px rgba(255,255,255,.55) !important;
    pointer-events: none !important;
}

html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-trusted-domain-row .legalmail-yandex-avatar::before {
    background-color: #2d343a !important;
    border-color: #46515a !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.22), inset 0 0 0 1px rgba(255,255,255,.035) !important;
}

/* Opened incoming message: use the same verified LB identity in the sender
 * photo slot.  The source image is replaced only after verification succeeds. */
html body.task-mail.action-show.legalmail-trusted-domain-message #message-header .contactphoto {
    box-sizing: border-box !important;
    border: 1px solid #e1e8ed !important;
    border-radius: 50% !important;
    background: #f3f6f8 !important;
    padding: 3px !important;
    box-shadow: 0 1px 3px rgba(23, 71, 112, .10), inset 0 0 0 1px rgba(255,255,255,.55) !important;
    object-fit: contain !important;
}

html.dark-mode body.task-mail.action-show.legalmail-trusted-domain-message #message-header .contactphoto {
    background: #2d343a !important;
    border-color: #46515a !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.22), inset 0 0 0 1px rgba(255,255,255,.035) !important;
}

/* ========================================================================== *
 * LB mail avatars — full-size mark + soft theme-aware shadow only
 * ========================================================================== */
html body.task-mail.action-none.legalmail-templates-mailbox
    .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar::before,
html body.task-mail.action-none .messagelist tr.legalmail-trusted-domain-row
    .legalmail-yandex-avatar::before {
    border: 0 !important;
    background-color: transparent !important;
    background-size: 30px 30px !important;
    box-shadow: 0 1px 4px rgba(23, 71, 112, .18), 0 0 0 1px rgba(23, 71, 112, .06) !important;
}

html.dark-mode body.task-mail.action-none.legalmail-templates-mailbox
    .messagelist tr.legalmail-yandex-v79 .legalmail-yandex-avatar::before,
html.dark-mode body.task-mail.action-none .messagelist tr.legalmail-trusted-domain-row
    .legalmail-yandex-avatar::before {
    background-color: transparent !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .32), 0 0 0 1px rgba(255, 255, 255, .10) !important;
}

html body.task-mail.action-show.legalmail-trusted-domain-message #message-header .contactphoto {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: 0 1px 4px rgba(23, 71, 112, .18), 0 0 0 1px rgba(23, 71, 112, .06) !important;
    object-fit: cover !important;
}

html.dark-mode body.task-mail.action-show.legalmail-trusted-domain-message #message-header .contactphoto {
    background: transparent !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .32), 0 0 0 1px rgba(255, 255, 255, .10) !important;
}


/* ========================================================================== *
 * Opened messages — sender monogram identical to the main message list
 * ========================================================================== */
html body.task-mail.action-show #message-header > .header .legalmail-reader-avatar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    flex: 0 0 42px !important;
    margin: 0 12px 0 0 !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 50% !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 42px !important;
    letter-spacing: -0.25px !important;
    text-transform: uppercase !important;
    overflow: hidden !important;
    user-select: none !important;
    pointer-events: none !important;
}

html body.task-mail.action-show #message-header > .header img.contactphoto.legalmail-reader-contact-hidden {
    display: none !important;
}

/* The verified-domain check owns the LB avatar. Once it succeeds, reveal the
   original photo slot (whose src is replaced with logo.svg) and hide initials. */
html body.task-mail.action-show.legalmail-trusted-domain-message #message-header > .header .legalmail-reader-avatar {
    display: none !important;
}
html body.task-mail.action-show.legalmail-trusted-domain-message #message-header > .header img.contactphoto.legalmail-reader-contact-hidden {
    display: block !important;
}

@media screen and (max-width: 820px) {
    html body.task-mail.action-show #message-header > .header .legalmail-reader-avatar {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        flex-basis: 38px !important;
        font-size: 12px !important;
        line-height: 38px !important;
    }
}

@media screen and (max-width: 640px) {
    html body.task-mail.action-show #message-header > .header .legalmail-reader-avatar {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        flex-basis: 34px !important;
        margin: 1px 0 0 !important;
        font-size: 11px !important;
        line-height: 34px !important;
    }
}

@media screen and (max-width: 420px) {
    html body.task-mail.action-show #message-header > .header .legalmail-reader-avatar,
    html body.task-mail.action-show.legalmail-trusted-domain-message #message-header > .header img.contactphoto.legalmail-reader-contact-hidden {
        display: none !important;
    }
}

/* LegalMail v120.20.86 attachment strip hover fix — keep the compose dock
   compact: one highlighted attachment beside “Attach”, a count only when there
   are 2+ files, and a hover/focus popover with the complete removable list. */
html body.task-mail.action-compose .legalmail-inline-attachment-strip[hidden] {
    display: none !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-strip {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: min(430px, 48vw) !important;
    height: 42px !important;
    gap: 6px !important;
    overflow: visible !important;
    outline: none !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-files {
    display: flex !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 320px !important;
    height: 100% !important;
    overflow: hidden !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-file {
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 300px !important;
    height: 34px !important;
    padding: 0 11px !important;
    box-sizing: border-box !important;
    border: 1px solid #b8d8ee !important;
    border-radius: 10px !important;
    background: #eef7fd !important;
    color: #245d82 !important;
    box-shadow: 0 1px 0 rgba(38,113,167,.06) !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    line-height: 32px !important;
    white-space: nowrap !important;
    transition: background .12s ease, border-color .12s ease, box-shadow .12s ease !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-strip:hover .legalmail-inline-attachment-file,
html body.task-mail.action-compose .legalmail-inline-attachment-strip:focus-within .legalmail-inline-attachment-file,
html body.task-mail.action-compose .legalmail-inline-attachment-strip:focus .legalmail-inline-attachment-file {
    border-color: #7db9df !important;
    background: #e4f2fb !important;
    box-shadow: 0 0 0 2px rgba(38,113,167,.08) !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-name {
    display: block !important;
    min-width: 0 !important;
    max-width: 278px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-count[hidden] {
    display: none !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-count {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    min-width: 26px !important;
    height: 26px !important;
    padding: 0 7px !important;
    box-sizing: border-box !important;
    border: 1px solid #b8d8ee !important;
    border-radius: 999px !important;
    background: #e8f4fc !important;
    color: #1f6f9f !important;
    box-shadow: 0 1px 0 rgba(38,113,167,.06) !important;
    font-size: 12px !important;
    font-weight: 750 !important;
    line-height: 24px !important;
    cursor: default !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-strip:hover .legalmail-inline-attachment-count,
html body.task-mail.action-compose .legalmail-inline-attachment-strip:focus-within .legalmail-inline-attachment-count,
html body.task-mail.action-compose .legalmail-inline-attachment-strip:focus .legalmail-inline-attachment-count {
    border-color: #7db9df !important;
    background: #dff0fb !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover {
    position: absolute !important;
    left: 0 !important;
    bottom: calc(100% - 1px) !important;
    z-index: 40 !important;
    width: min(380px, calc(100vw - 32px)) !important;
    max-height: 250px !important;
    padding: 8px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    border: 1px solid #dfe5ea !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #252a30 !important;
    box-shadow: 0 14px 38px rgba(23,33,43,.18), 0 2px 8px rgba(23,33,43,.08) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(5px) scale(.985) !important;
    transform-origin: left bottom !important;
    transition: opacity .12s ease, transform .12s ease, visibility 0s linear .12s !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-strip:hover .legalmail-inline-attachment-popover,
html body.task-mail.action-compose .legalmail-inline-attachment-strip:focus-within .legalmail-inline-attachment-popover,
html body.task-mail.action-compose .legalmail-inline-attachment-strip:focus .legalmail-inline-attachment-popover {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(-4px) scale(1) !important;
    transition-delay: 0s !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-title {
    height: 27px !important;
    padding: 0 5px 5px !important;
    box-sizing: border-box !important;
    color: #69727b !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    line-height: 22px !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-files {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    max-height: 205px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-file {
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
    min-height: 36px !important;
    padding: 4px 5px 4px 7px !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
    background: transparent !important;
    transition: background .1s ease !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-file:hover,
html body.task-mail.action-compose .legalmail-inline-attachment-popover-file:focus-within {
    background: #f3f7fa !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker {
    position: relative !important;
    flex: 0 0 20px !important;
    width: 20px !important;
    height: 20px !important;
    margin-right: 7px !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker::before {
    content: "" !important;
    position: absolute !important;
    left: 5px !important;
    top: 3px !important;
    width: 9px !important;
    height: 13px !important;
    box-sizing: border-box !important;
    border: 1.5px solid #6b8799 !important;
    border-radius: 2px !important;
    background: #fff !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker::after {
    content: "" !important;
    position: absolute !important;
    left: 10px !important;
    top: 3px !important;
    width: 4px !important;
    height: 4px !important;
    border-top: 1.5px solid #6b8799 !important;
    border-right: 1.5px solid #6b8799 !important;
    background: #eef5f9 !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-name {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: #30363c !important;
    font-size: 12.5px !important;
    line-height: 28px !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-remove {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 26px !important;
    width: 26px !important;
    height: 26px !important;
    margin: 0 0 0 7px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: #879098 !important;
    font-family: Arial, sans-serif !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    line-height: 26px !important;
    opacity: .65 !important;
    cursor: pointer !important;
    transition: opacity .1s ease, background .1s ease, color .1s ease !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-file:hover .legalmail-inline-attachment-remove,
html body.task-mail.action-compose .legalmail-inline-attachment-remove:focus {
    opacity: 1 !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-remove:hover,
html body.task-mail.action-compose .legalmail-inline-attachment-remove:focus {
    background: #e8edf1 !important;
    color: #202428 !important;
    outline: none !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-file {
    border-color: #446a83 !important;
    background: #223a4a !important;
    color: #b9ddf3 !important;
}
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-count {
    border-color: #446a83 !important;
    background: #263f50 !important;
    color: #a8d6f3 !important;
}
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-popover {
    border-color: #3b444b !important;
    background: #22282d !important;
    color: #e6e9eb !important;
    box-shadow: 0 14px 38px rgba(0,0,0,.42) !important;
}
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-popover-title {
    color: #aab2b8 !important;
}
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-popover-file:hover,
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-popover-file:focus-within {
    background: #2e363c !important;
}
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-popover-name {
    color: #edf0f2 !important;
}
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-popover-marker::before {
    border-color: #8ba8ba !important;
    background: #22282d !important;
}
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-popover-marker::after {
    border-color: #8ba8ba !important;
    background: #30404a !important;
}
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-remove {
    color: #aeb5bb !important;
}
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-remove:hover,
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-remove:focus {
    background: #394248 !important;
    color: #fff !important;
}

@media screen and (max-width: 560px) {
    html body.task-mail.action-compose .legalmail-inline-attachment-strip {
        max-width: calc(100vw - 190px) !important;
        gap: 4px !important;
    }
    html body.task-mail.action-compose .legalmail-inline-attachment-files {
        max-width: calc(100vw - 225px) !important;
    }
    html body.task-mail.action-compose .legalmail-inline-attachment-file {
        max-width: calc(100vw - 225px) !important;
        padding-inline: 9px !important;
    }
    html body.task-mail.action-compose .legalmail-inline-attachment-name {
        max-width: calc(100vw - 245px) !important;
    }
    html body.task-mail.action-compose .legalmail-inline-attachment-popover {
        width: min(340px, calc(100vw - 20px)) !important;
    }
}

/* LegalMail v120.20.86 attachment badge-on-button fix.
   Keep the Attach action visually unchanged, pin a bright count bubble to its
   corner, and reveal the removable attachment list from that bubble only. */
html body.task-mail.action-compose .legalmail-inline-attach-wrap {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    overflow: visible !important;
}

html body.task-mail.action-compose .legalmail-inline-attach-wrap > .legalmail-inline-attach {
    margin: 0 !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-strip[hidden] {
    display: none !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-strip {
    position: absolute !important;
    z-index: 45 !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    overflow: visible !important;
    pointer-events: none !important;
    outline: none !important;
}

/* The former inline filename strip is intentionally suppressed: the bubble is
   now the single compact indicator beside/on the Attach button. */
html body.task-mail.action-compose .legalmail-inline-attachment-files,
html body.task-mail.action-compose .legalmail-inline-attachment-file,
html body.task-mail.action-compose .legalmail-inline-attachment-name {
    display: none !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-count[hidden] {
    display: none !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-count {
    position: absolute !important;
    z-index: 3 !important;
    top: -7px !important;
    right: -8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 24px !important;
    width: auto !important;
    height: 24px !important;
    padding: 0 6px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border: 2px solid #fff !important;
    border-radius: 999px !important;
    background: #2f8fca !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    box-shadow: 0 2px 7px rgba(22, 88, 130, .28) !important;
    font-family: Arial, sans-serif !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    line-height: 20px !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    transition: background .12s ease, box-shadow .12s ease, transform .12s ease !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-count:hover,
html body.task-mail.action-compose .legalmail-inline-attachment-count:focus,
html body.task-mail.action-compose .legalmail-inline-attachment-count:focus-visible,
html body.task-mail.action-compose .legalmail-inline-attachment-strip.is-open .legalmail-inline-attachment-count {
    border-color: #fff !important;
    background: #217fb8 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(47,143,202,.14), 0 3px 9px rgba(22,88,130,.28) !important;
    transform: translateY(-1px) !important;
    outline: none !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover {
    position: absolute !important;
    z-index: 2 !important;
    left: 0 !important;
    right: auto !important;
    bottom: calc(100% + 7px) !important;
    width: min(390px, calc(100vw - 28px)) !important;
    max-height: 260px !important;
    padding: 9px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    border: 1px solid #dfe5ea !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #252a30 !important;
    box-shadow: 0 14px 38px rgba(23,33,43,.18), 0 2px 8px rgba(23,33,43,.08) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(4px) !important;
    transform-origin: left bottom !important;
    transition: opacity .12s ease, transform .12s ease, visibility 0s linear .12s !important;
}

/* Invisible hover bridge between the count bubble and the popover. */
html body.task-mail.action-compose .legalmail-inline-attachment-popover::after {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: -10px !important;
    height: 12px !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-count:hover ~ .legalmail-inline-attachment-popover,
html body.task-mail.action-compose .legalmail-inline-attachment-count:focus ~ .legalmail-inline-attachment-popover,
html body.task-mail.action-compose .legalmail-inline-attachment-count:focus-visible ~ .legalmail-inline-attachment-popover,
html body.task-mail.action-compose .legalmail-inline-attachment-popover:hover,
html body.task-mail.action-compose .legalmail-inline-attachment-popover:focus-within,
html body.task-mail.action-compose .legalmail-inline-attachment-strip.is-open .legalmail-inline-attachment-popover {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
    transition-delay: 0s !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-title {
    height: auto !important;
    min-height: 26px !important;
    padding: 0 6px 5px !important;
    color: #69727b !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    line-height: 21px !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-files {
    max-height: 208px !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-file {
    min-height: 38px !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-remove {
    opacity: .78 !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-file:hover .legalmail-inline-attachment-remove,
html body.task-mail.action-compose .legalmail-inline-attachment-popover-file:focus-within .legalmail-inline-attachment-remove,
html body.task-mail.action-compose .legalmail-inline-attachment-remove:hover,
html body.task-mail.action-compose .legalmail-inline-attachment-remove:focus {
    opacity: 1 !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-count,
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-count:hover,
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-count:focus,
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-strip.is-open .legalmail-inline-attachment-count {
    border-color: #1c2125 !important;
    background: #3c9bd4 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

@media screen and (max-width: 560px) {
    html body.task-mail.action-compose .legalmail-inline-attachment-strip {
        max-width: none !important;
    }
    html body.task-mail.action-compose .legalmail-inline-attachment-popover {
        left: -72px !important;
        width: min(320px, calc(100vw - 20px)) !important;
    }
}


/* LegalMail v120.20.86 attachment badge hover-menu refinement.
   Keep the popup compact, keep it open while moving from the count bubble into
   the menu, and show a readable file-format badge at the left of every row. */
html body.task-mail.action-compose .legalmail-inline-attachment-popover {
    left: auto !important;
    right: -8px !important;
    bottom: calc(100% + 3px) !important;
    width: min(310px, calc(100vw - 24px)) !important;
    min-width: 250px !important;
    max-width: 310px !important;
    max-height: 228px !important;
    padding: 7px !important;
    border-radius: 10px !important;
    transform-origin: right bottom !important;
}

/* The hover-safe zone bridges the tiny visual gap between badge and popup. */
html body.task-mail.action-compose .legalmail-inline-attachment-popover::after {
    left: auto !important;
    right: 0 !important;
    bottom: -9px !important;
    width: 76px !important;
    height: 11px !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-title {
    min-height: 22px !important;
    height: 22px !important;
    padding: 0 5px 3px !important;
    font-size: 11px !important;
    line-height: 19px !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-files {
    gap: 2px !important;
    max-height: 190px !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-file {
    min-height: 34px !important;
    padding: 3px 4px !important;
    border-radius: 7px !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 36px !important;
    width: 36px !important;
    height: 22px !important;
    margin: 0 8px 0 0 !important;
    padding: 0 3px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    border: 1px solid #d6e0e6 !important;
    border-radius: 5px !important;
    background: #eef3f6 !important;
    color: #52616d !important;
    font-family: Arial, sans-serif !important;
    font-size: 9.5px !important;
    font-weight: 700 !important;
    line-height: 20px !important;
    letter-spacing: .1px !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
}
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker::before,
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker::after {
    content: none !important;
    display: none !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker[data-type="PDF"] {
    border-color: #efc7ca !important;
    background: #fff0f1 !important;
    color: #b62d38 !important;
}
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker[data-type="DOC"],
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker[data-type="DOCX"],
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker[data-type="RTF"] {
    border-color: #c8d9ef !important;
    background: #eef5ff !important;
    color: #315f9f !important;
}
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker[data-type="XLS"],
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker[data-type="XLSX"],
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker[data-type="CSV"] {
    border-color: #c9e3d2 !important;
    background: #eef9f1 !important;
    color: #34734b !important;
}
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker[data-type="ZIP"],
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker[data-type="RAR"],
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker[data-type="7Z"] {
    border-color: #ead8b7 !important;
    background: #fff7e9 !important;
    color: #94651b !important;
}
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker[data-type="JPG"],
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker[data-type="JPEG"],
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker[data-type="PNG"],
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker[data-type="GIF"],
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker[data-type="WEBP"] {
    border-color: #d9cdea !important;
    background: #f6f0fd !important;
    color: #72529b !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-name {
    font-size: 12px !important;
    line-height: 26px !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-remove {
    flex-basis: 24px !important;
    width: 24px !important;
    height: 24px !important;
    margin-left: 5px !important;
    line-height: 24px !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-popover-marker {
    border-color: #49565f !important;
    background: #303a41 !important;
    color: #d8e0e5 !important;
}

@media screen and (max-width: 560px) {
    html body.task-mail.action-compose .legalmail-inline-attachment-popover {
        left: auto !important;
        right: -8px !important;
        width: min(296px, calc(100vw - 16px)) !important;
        min-width: 230px !important;
        max-width: 296px !important;
    }
}

/* LegalMail v120.20.86 compact attachment actions fix.
   Keep delete fully active and expose Roundcube's native attachment options
   menu (Open / Download / Rename) beside every file in the badge popover. */
html body.task-mail.action-compose .legalmail-inline-attachment-actions {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex: 0 0 auto !important;
    gap: 2px !important;
    margin-left: 5px !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-options,
html body.task-mail.action-compose .legalmail-inline-attachment-remove {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 25px !important;
    width: 25px !important;
    height: 25px !important;
    min-width: 25px !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: transparent !important;
    color: #7d8891 !important;
    opacity: 1 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    pointer-events: auto !important;
    transition: background .1s ease, color .1s ease, box-shadow .1s ease !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-options::before {
    display: block !important;
    float: none !important;
    width: 25px !important;
    height: 25px !important;
    margin: 0 !important;
    color: currentColor !important;
    font-size: 13px !important;
    line-height: 25px !important;
    text-align: center !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-options > .inner {
    display: none !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-remove {
    color: #858f97 !important;
    font-family: Arial, sans-serif !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    line-height: 25px !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-options:hover,
html body.task-mail.action-compose .legalmail-inline-attachment-options:focus,
html body.task-mail.action-compose .legalmail-inline-attachment-remove:hover,
html body.task-mail.action-compose .legalmail-inline-attachment-remove:focus {
    background: #e8eef2 !important;
    color: #26323a !important;
    box-shadow: none !important;
    outline: none !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-options:focus-visible,
html body.task-mail.action-compose .legalmail-inline-attachment-remove:focus-visible {
    box-shadow: 0 0 0 2px rgba(47,143,202,.22) !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-options,
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-remove {
    color: #aeb7bd !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-options:hover,
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-options:focus,
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-remove:hover,
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-remove:focus {
    background: #394248 !important;
    color: #fff !important;
}


/* LegalMail v120.20.86 attachment action hit-area fix.
   The badge shell normally ignores pointer events so the Attach button below
   stays usable.  While the attachment popup is open, explicitly restore hit
   testing for the shell and its controls.  This fixes visible-but-unclickable
   action icons in browsers that don't retarget descendants of a pointer-events
   none overlay consistently. */
html body.task-mail.action-compose .legalmail-inline-attachment-strip.is-open {
    pointer-events: auto !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover,
html body.task-mail.action-compose .legalmail-inline-attachment-popover-files,
html body.task-mail.action-compose .legalmail-inline-attachment-popover-file,
html body.task-mail.action-compose .legalmail-inline-attachment-actions,
html body.task-mail.action-compose .legalmail-inline-attachment-options,
html body.task-mail.action-compose .legalmail-inline-attachment-remove {
    pointer-events: auto !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-file {
    position: relative !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-actions {
    position: relative !important;
    z-index: 8 !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-options,
html body.task-mail.action-compose .legalmail-inline-attachment-remove {
    z-index: 9 !important;
    touch-action: manipulation !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}


/* LegalMail v120.20.86 attachment action click-through fix.
   Keep the compact action rail above row/popup hit layers and prevent any
   decorative pseudo-elements from intercepting pointer input. */
html body.task-mail.action-compose .legalmail-inline-attachment-popover::after,
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker::before,
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker::after {
    pointer-events: none !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-file {
    isolation: isolate !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-popover-name,
html body.task-mail.action-compose .legalmail-inline-attachment-popover-marker {
    position: relative !important;
    z-index: 1 !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-actions {
    position: relative !important;
    z-index: 20 !important;
    pointer-events: auto !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-options,
html body.task-mail.action-compose .legalmail-inline-attachment-remove {
    position: relative !important;
    z-index: 21 !important;
    pointer-events: auto !important;
}

/* v120.20.86 — attachment rename: basename editable, extension locked.
   The editor and the locked suffix are one joined control so the borders,
   height and baseline always stay perfectly aligned. */
html body.task-mail.action-compose .legalmail-attachment-rename-row {
    display: flex !important;
    align-items: center !important;
    gap: .65rem !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: .15rem 0 !important;
    white-space: nowrap !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-caption {
    display: block !important;
    flex: 0 0 auto !important;
    float: none !important;
    width: auto !important;
    min-width: 2.2rem !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 2.5rem !important;
    vertical-align: middle !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-canonical {
    display: none !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-field {
    display: inline-flex !important;
    flex: 1 1 22rem !important;
    align-items: stretch !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 32rem !important;
    height: 2.5rem !important;
    min-height: 2.5rem !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    position: relative !important;
    overflow: hidden !important;
    vertical-align: middle !important;
    border: 1px solid #ced4da !important;
    border-radius: .45rem !important;
    background: #fff !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    border-color: #80bdff !important;
    box-shadow: 0 0 0 .12rem rgba(0,123,255,.14) !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-basename {
    order: 1 !important;
    flex: 1 1 auto !important;
    display: block !important;
    float: none !important;
    position: static !important;
    width: 1px !important;
    min-width: 8rem !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: .45rem .7rem !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #2c363a !important;
    font: inherit !important;
    line-height: 1.35rem !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-basename:focus {
    outline: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
}

html body.task-mail.action-compose .legalmail-attachment-locked-extension {
    order: 2 !important;
    flex: 0 0 auto !important;
    align-self: stretch !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    float: none !important;
    position: static !important;
    min-width: 3.15rem !important;
    height: auto !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: .45rem .72rem !important;
    border: 0 !important;
    border-left: 1px solid #ced4da !important;
    border-radius: 0 !important;
    background: #eef1f3 !important;
    color: #66737d !important;
    font: inherit !important;
    font-weight: 600 !important;
    line-height: 1.35rem !important;
    white-space: nowrap !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    pointer-events: none !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field {
    border-color: #4d6066 !important;
    background: #21292c !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    border-color: #6ba9d6 !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-basename {
    background: transparent !important;
    color: #d4ddde !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-locked-extension {
    border-left-color: #4d6066 !important;
    background: #374549 !important;
    color: #c5d1d3 !important;
}

@media (max-width: 520px) {
    html body.task-mail.action-compose .legalmail-attachment-rename-row {
        gap: .45rem !important;
    }

    html body.task-mail.action-compose .legalmail-attachment-rename-field {
        flex-basis: 14rem !important;
    }

    html body.task-mail.action-compose .legalmail-attachment-rename-caption {
        min-width: 1.9rem !important;
    }
}

/* LegalMail v120.20.86 light fix: make the per-file delete X clearly destructive. */
html body.task-mail.action-compose .legalmail-inline-attachment-remove {
    color: #d43f3a !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-remove:hover,
html body.task-mail.action-compose .legalmail-inline-attachment-remove:focus {
    background: #fff0ef !important;
    color: #b92f2b !important;
}

html body.task-mail.action-compose .legalmail-inline-attachment-remove:focus-visible {
    box-shadow: 0 0 0 2px rgba(212,63,58,.22) !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-remove {
    color: #ff7770 !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-remove:hover,
html.dark-mode body.task-mail.action-compose .legalmail-inline-attachment-remove:focus {
    background: rgba(212,63,58,.18) !important;
    color: #ff9a95 !important;
}

/* LegalMail v120.20.86 light fix: rename control uses one clean outline only. */
html body.task-mail.action-compose .legalmail-attachment-rename-field,
html body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    box-shadow: none !important;
    outline: 0 !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-basename,
html body.task-mail.action-compose .legalmail-attachment-rename-basename:hover,
html body.task-mail.action-compose .legalmail-attachment-rename-basename:focus,
html body.task-mail.action-compose .legalmail-attachment-rename-basename:active {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background-image: none !important;
}

html body.task-mail.action-compose .legalmail-attachment-locked-extension {
    border-top: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

/* LegalMail v120.20.86 — rename field alignment hotfix.
   Keep basename + locked extension as one exact-height control on one row. */
html body.task-mail.action-compose .legalmail-attachment-rename-row {
    display: grid !important;
    grid-template-columns: 2.35rem minmax(0, 1fr) !important;
    align-items: center !important;
    column-gap: .55rem !important;
    width: 100% !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-caption {
    align-self: center !important;
    min-width: 0 !important;
    line-height: 1 !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-field {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) max-content !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: none !important;
    height: 2.35rem !important;
    min-height: 2.35rem !important;
    overflow: hidden !important;
    border: 1px solid #ced4da !important;
    border-radius: .42rem !important;
    background: #fff !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-basename {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 .7rem !important;
    border: 0 !important;
    border-radius: 0 !important;
    line-height: normal !important;
    box-sizing: border-box !important;
    align-self: stretch !important;
}

html body.task-mail.action-compose .legalmail-attachment-locked-extension {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: stretch !important;
    height: 100% !important;
    min-height: 0 !important;
    min-width: 2.9rem !important;
    margin: 0 !important;
    padding: 0 .7rem !important;
    border: 0 !important;
    border-left: 1px solid #ced4da !important;
    border-radius: 0 !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    background: #eef1f3 !important;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-locked-extension {
    border-left-color: #4d6066 !important;
}

@media (max-width: 520px) {
    html body.task-mail.action-compose .legalmail-attachment-rename-row {
        grid-template-columns: 2rem minmax(0, 1fr) !important;
        column-gap: .4rem !important;
    }
}

/* LegalMail v120.20.86 — rename joined-control final seam fix.
   Draw the frame on the two visible pieces instead of the wrapper. This removes
   the doubled left outline and keeps the basename/extension junction perfectly
   square while preserving rounded outer corners only. */
html body.task-mail.action-compose .legalmail-attachment-rename-field,
html body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: 0 !important;
    overflow: visible !important;
    column-gap: 0 !important;
    gap: 0 !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-basename,
html body.task-mail.action-compose .legalmail-attachment-rename-basename:hover,
html body.task-mail.action-compose .legalmail-attachment-rename-basename:focus,
html body.task-mail.action-compose .legalmail-attachment-rename-basename:active {
    width: auto !important;
    min-width: 0 !important;
    height: 2.35rem !important;
    min-height: 2.35rem !important;
    margin: 0 !important;
    padding: 0 .7rem !important;
    box-sizing: border-box !important;
    border: 1px solid #ced4da !important;
    border-right: 1px solid #ced4da !important;
    border-radius: .42rem 0 0 .42rem !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    background-image: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

html body.task-mail.action-compose .legalmail-attachment-locked-extension {
    height: 2.35rem !important;
    min-height: 2.35rem !important;
    margin: 0 !important;
    padding: 0 .7rem !important;
    box-sizing: border-box !important;
    border: 1px solid #ced4da !important;
    border-left: 0 !important;
    border-radius: 0 .42rem .42rem 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: #eef1f3 !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within .legalmail-attachment-rename-basename {
    border-color: #80bdff !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within .legalmail-attachment-locked-extension {
    border-color: #80bdff !important;
    border-left: 0 !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-basename,
html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-basename:hover,
html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-basename:focus,
html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-basename:active {
    border-color: #4d6066 !important;
    background: #21292c !important;
    color: #d4ddde !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-locked-extension {
    border-color: #4d6066 !important;
    border-left: 0 !important;
    background: #374549 !important;
    color: #c5d1d3 !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within .legalmail-attachment-rename-basename,
html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within .legalmail-attachment-locked-extension {
    border-color: #6ba9d6 !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within .legalmail-attachment-locked-extension {
    border-left: 0 !important;
}

/* LegalMail v120.20.86 — rename suffix visually inside the input.
   One outer frame only: the editable basename and locked extension share the
   same field surface, with no inner border, button background or seam. */
html body.task-mail.action-compose .legalmail-attachment-rename-field,
html body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) max-content !important;
    align-items: stretch !important;
    width: 100% !important;
    height: 2.35rem !important;
    min-height: 2.35rem !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    border: 1px solid #ced4da !important;
    border-radius: .42rem !important;
    background: #fff !important;
    box-shadow: none !important;
    outline: 0 !important;
    gap: 0 !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    border-color: #80bdff !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-basename,
html body.task-mail.action-compose .legalmail-attachment-rename-basename:hover,
html body.task-mail.action-compose .legalmail-attachment-rename-basename:focus,
html body.task-mail.action-compose .legalmail-attachment-rename-basename:active {
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 .2rem 0 .7rem !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    background-image: none !important;
    color: #2c363a !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

html body.task-mail.action-compose .legalmail-attachment-locked-extension {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    align-self: stretch !important;
    height: 100% !important;
    min-height: 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 .75rem 0 .1rem !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #7a8790 !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within .legalmail-attachment-rename-basename,
html body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within .legalmail-attachment-locked-extension {
    border: 0 !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field,
html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    border-color: #4d6066 !important;
    background: #21292c !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    border-color: #6ba9d6 !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-basename,
html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-basename:hover,
html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-basename:focus,
html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-basename:active {
    background: transparent !important;
    color: #d4ddde !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-locked-extension {
    border: 0 !important;
    background: transparent !important;
    color: #91a1a6 !important;
}

/* LegalMail v120.20.86 — final rename field polish.
   Keep the locked extension visually inside the same input surface without
   creating a second flex/grid cell.  The suffix floats inside the field and
   the editable basename simply reserves room for it. */
html body.task-mail.action-compose .legalmail-attachment-rename-field,
html body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 2.35rem !important;
    min-height: 2.35rem !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border: 1px solid #ced4da !important;
    border-radius: .42rem !important;
    background: #fff !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-basename,
html body.task-mail.action-compose .legalmail-attachment-rename-basename:hover,
html body.task-mail.action-compose .legalmail-attachment-rename-basename:focus,
html body.task-mail.action-compose .legalmail-attachment-rename-basename:active {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 4.6rem 0 .7rem !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    line-height: normal !important;
}

html body.task-mail.action-compose .legalmail-attachment-locked-extension {
    position: absolute !important;
    top: 50% !important;
    right: .7rem !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #6f7d86 !important;
    font: inherit !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    border-color: #80bdff !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field,
html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    background: #21292c !important;
    border-color: #4d6066 !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    border-color: #6ba9d6 !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-locked-extension {
    color: #91a1a6 !important;
}

/* LegalMail v120.20.86 — calm rounded rectangle for attachment rename.
   One quiet outer input frame; the locked extension stays visually inside it. */
html body.task-mail.action-compose .legalmail-attachment-rename-field,
html body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: 2.5rem !important;
    min-height: 2.5rem !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border: 1px solid #cbd5dc !important;
    border-radius: .5rem !important;
    background: #fff !important;
    box-shadow: none !important;
    outline: 0 !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-basename,
html body.task-mail.action-compose .legalmail-attachment-rename-basename:hover,
html body.task-mail.action-compose .legalmail-attachment-rename-basename:focus,
html body.task-mail.action-compose .legalmail-attachment-rename-basename:active {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 4.25rem 0 .75rem !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    background-image: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

html body.task-mail.action-compose .legalmail-attachment-locked-extension {
    position: absolute !important;
    top: 50% !important;
    right: .75rem !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #6f7d86 !important;
    font: inherit !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    border-color: #9eb6c6 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field,
html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    background: #21292c !important;
    border-color: #4d6066 !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    border-color: #6f8e9d !important;
    box-shadow: none !important;
    outline: 0 !important;
}


/* LegalMail v120.20.86 — attachment rename single-border guard.
   The field itself owns the only visible frame; neither focus nor the nested
   editor may paint a second ring. */
html body.task-mail.action-compose .legalmail-attachment-rename-field,
html body.task-mail.action-compose .legalmail-attachment-rename-field:focus,
html body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    box-shadow: none !important;
    outline: none !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:hover,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:focus,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:focus-visible,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:active {
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* LegalMail v120.20.86 — TRUE single-frame rename field.
   IMPORTANT: the wrapper is only a positioning box. The editable input itself
   owns the ONLY visible border. This prevents a second outline from appearing
   along the left/right sides in Roundcube/Bootstrap focus states. */
html body.task-mail.action-compose .legalmail-attachment-rename-field,
html body.task-mail.action-compose .legalmail-attachment-rename-field:hover,
html body.task-mail.action-compose .legalmail-attachment-rename-field:focus,
html body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 2.5rem !important;
    min-height: 2.5rem !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    background: transparent !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-field::before,
html body.task-mail.action-compose .legalmail-attachment-rename-field::after {
    content: none !important;
    display: none !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:hover,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:focus,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:focus-visible,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:active {
    display: block !important;
    width: 100% !important;
    height: 2.5rem !important;
    min-height: 2.5rem !important;
    margin: 0 !important;
    padding: 0 4.25rem 0 .75rem !important;
    box-sizing: border-box !important;
    border: 1px solid #cbd5dc !important;
    border-radius: .5rem !important;
    outline: 0 !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    background: #fff !important;
    background-image: none !important;
    color: #2c363a !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:focus,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:focus-visible {
    border-color: #9eb6c6 !important;
    outline: 0 !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-locked-extension {
    position: absolute !important;
    top: 0 !important;
    right: .75rem !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: 2.5rem !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    background: transparent !important;
    color: #6f7d86 !important;
    font: inherit !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field,
html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field:focus-within {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename,
html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:hover,
html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:active {
    border-color: #4d6066 !important;
    background: #21292c !important;
    color: #d4ddde !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:focus,
html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:focus-visible {
    border-color: #6f8e9d !important;
    box-shadow: none !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-locked-extension {
    color: #91a1a6 !important;
}

/* LegalMail v120.20.86 — compact locked-extension spacing.
   Keep the basename inset modest; JS reserves only the real extension width. */
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:hover,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:focus,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:focus-visible,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:active {
    padding-left: 10px !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-locked-extension {
    right: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* LegalMail v120.20.86 — final locked-extension right-edge protection.
   The suffix stays at the end of the ONE input; JS reserves its exact width,
   and this opaque inset prevents any horizontally-scrolled text showing under it. */
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-locked-extension {
    right: 10px !important;
    left: auto !important;
    z-index: 2 !important;
    padding: 0 0 0 4px !important;
    background: #fff !important;
    pointer-events: none !important;
}

html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:hover,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:focus,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:focus-visible,
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-rename-basename:active {
    padding-left: 10px !important;
}

html.dark-mode body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-locked-extension {
    background: #21292c !important;
}

/* LegalMail v120.20.86 — attachment rename suffix vertical alignment.
   Keep the locked extension centered inside the input without its opaque
   background covering the input's top/bottom border. */
html body.task-mail.action-compose .legalmail-attachment-rename-field > .legalmail-attachment-locked-extension {
    top: 50% !important;
    bottom: auto !important;
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.25rem !important;
    transform: translateY(-50%) !important;
    padding: 0 0 0 4px !important;
}
