/* ============================================================
   WOAH FINAL — single consolidated stylesheet, no duplicate
   or conflicting rules. Replaces all prior experimental passes.
   ============================================================ */

/* ---------- LOGIN SCREEN (task-login) ---------- */
body.task-login {
    background: linear-gradient(135deg, rgba(10,40,80,0.55), rgba(29,155,240,0.35)), url('images/richcmx-bg.jpg') center/cover no-repeat fixed !important;
}
body.task-login #layout {
    position: relative;
}
body.task-login #layout::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(56,189,248,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56,189,248,0.05) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}
body.task-login #layout-content {
    position: relative;
    z-index: 1;
    max-width: 420px;
    margin: 12px auto;
    padding: 8px;
    box-sizing: border-box;
}
body.task-login #logo {
    max-height: 130px;
    max-width: 90%;
    height: auto;
    display: block;
    margin: 0 auto 6px auto;
}
body.task-login #login-form {
    background: rgba(40,10,5,0.72);
    border: 1px solid rgba(56,189,248,0.45);
    border-radius: 3px;
    padding: 14px 16px;
    font-family: 'JetBrains Mono', monospace;
}
body.task-login #login-form table,
body.task-login #login-form tbody,
body.task-login #login-form tr,
body.task-login #login-form td {
    display: block;
    width: 100%;
    box-sizing: border-box;
}
body.task-login #login-form td.title[style*="display: none"] {
    display: none !important;
}
body.task-login #login-form td.title label {
    font-size: 10px;
    letter-spacing: 2px;
    color: #68B5FF;
    text-transform: uppercase;
}
body.task-login #login-form input.form-control {
    width: 100%;
    box-sizing: border-box;
    background: rgba(4,10,22,0.85);
    border: 1px solid rgba(90,170,255,0.4);
    color: #D7ECFF;
    border-radius: 1px;
    letter-spacing: 1px;
    padding: 10px 12px;
    font-size: 14px;
}
body.task-login .button.mainaction.submit {
    width: 100%;
    background: linear-gradient(90deg, #0A82D9, #238CF5);
    border: 1px solid #0A82D9;
    color: #EAF5FF;
    letter-spacing: 3px;
    text-transform: uppercase;
    border-radius: 1px;
    font-family: 'JetBrains Mono', monospace;
}
body.task-login #login-footer {
    color: #0F72C2;
    font-size: 10px;
    letter-spacing: 1px;
    margin-top: 16px;
    text-align: center;
}
body.task-login #login-footer a {
    color: #66B7FF;
}
body.task-login .ifpl-hint {
    background: rgba(8,18,36,0.9);
    color: #8FD7FF;
    border: 1px solid rgba(56,189,248,0.4);
    padding: 8px;
    font-size: 11px;
}
tr#ifpl-hint.richcmx-hint-hidden {
    display: none !important;
}

/* toggle switch */
body.task-login div.custom-control.custom-switch {
    position: relative;
    padding-left: 50px;
    min-height: 26px;
    display: flex;
    align-items: center;
    margin: 16px 0;
}
body.task-login div.custom-control.custom-switch input.custom-control-input {
    position: absolute;
    left: 0;
    width: 40px;
    height: 22px;
    opacity: 0;
    margin: 0;
    cursor: pointer;
    z-index: 5;
}
body.task-login div.custom-control.custom-switch label.custom-control-label {
    position: relative;
    color: #D9EEFF;
    font-size: 12px;
    letter-spacing: 1px;
    padding-left: 8px;
    cursor: pointer;
}
body.task-login div.custom-control.custom-switch label.custom-control-label::before {
    content: '';
    position: absolute;
    left: -50px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 22px;
    background: rgba(20,40,70,0.9);
    border: 1px solid #238CF5;
    border-radius: 11px;
}
body.task-login div.custom-control.custom-switch label.custom-control-label::after {
    content: '';
    position: absolute;
    left: -46px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: #238CF5;
    border-radius: 50%;
}
body.task-login div.custom-control.custom-switch input.custom-control-input:checked ~ label.custom-control-label::after {
    left: -26px;
    background: #ffffff;
    box-shadow: 0 0 8px #238CF5;
}
body.task-login div.custom-control.custom-switch input.custom-control-input:checked ~ label.custom-control-label::before {
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(56,189,248,0.8);
}

/* install button */
#richcmx-install-inline {
    background: transparent;
    border: none;
    border-top: 1px solid #0A82D9;
    border-bottom: 1px solid #0A82D9;
    border-radius: 0;
    color: #0A82D9;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 5px;
    text-shadow: 0 0 8px rgba(29,161,242,0.6);
    padding: 12px;
    width: 100%;
    margin-bottom: 12px;
}
#richcmx-install-inline:hover {
    background: rgba(29,161,242,0.1);
    box-shadow: 0 0 20px rgba(29,161,242,0.5);
}

@media (max-width: 480px) {
    body.task-login #logo { max-height: 90px; }
    body.task-login #login-form { padding: 12px; }
}

/* ---------- INBOX (task-mail) — one clean light theme, bright blue accent ---------- */
body.task-mail {
    background: #F7FAFC;
}
body.task-mail .header,
body.task-mail #messagelist-header,
body.task-mail .toolbar,
body.task-mail #layout-sidebar,
body.task-mail #taskmenu {
    background: #EEF5FC;
    border-color: rgba(0,0,0,0.08);
}
body.task-mail .header {
    min-height: 64px;
    padding-top: 6px;
    padding-bottom: 6px;
}
body.task-mail #layout,
body.task-mail #layout-list,
body.task-mail #layout-content,
body.task-mail #messagelist-content {
    background: #ffffff;
}
body.task-mail #logo {
    max-height: 56px;
    margin: 10px auto;
    display: block;
}

/* toolbar + taskmenu icon rail */
body.task-mail .toolbar a.button,
body.task-mail .toolbar a.button .inner,
body.task-mail #taskmenu a {
    color: #0A6FB8;
    font-family: 'JetBrains Mono', monospace;
}
body.task-mail .toolbar a.button:not(.disabled):hover,
body.task-mail #taskmenu a:hover {
    color: #0d4d82;
    background: rgba(26,111,181,0.08);
}
body.task-mail .toolbar a.button.disabled {
    color: rgba(26,111,181,0.3);
}
body.task-mail #taskmenu a.logout {
    color: #2B87C0;
}
body.task-mail #taskmenu a.logout:hover {
    color: #216792;
    background: rgba(30,90,150,0.08);
}
body.task-mail .header-title {
    color: #1c2b36;
}

/* folder list — Inbox, Drafts, Sent, Junk, Trash, Archive all identical treatment */
body.task-mail .folderlist {
    background: #EEF5FC;
}
body.task-mail .folderlist li a {
    color: #1c2b36;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}
body.task-mail .folderlist li a:before {
    color: #0A6FB8;
}
body.task-mail .folderlist li.mailbox.recent > a,
body.task-mail .folderlist li.mailbox.unread > a {
    color: #0d1f2b;
    font-weight: 700;
}
body.task-mail .folderlist li a:hover {
    color: #0d4d82;
    background: rgba(26,111,181,0.06);
}
body.task-mail .folderlist li.selected > a,
body.task-mail .folderlist li.mailbox.selected > a {
    color: #0d4d82;
    background: rgba(26,111,181,0.14);
    border-left: 2px solid #0A6FB8;
    font-weight: 700;
}
body.task-mail .folderlist li.mailbox .unreadcount {
    background: #0A6FB8;
    color: #ffffff;
}

/* message list */
body.task-mail #messagelist tbody tr,
body.task-mail #messagelist > li {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
body.task-mail #messagelist tbody tr:hover,
body.task-mail #messagelist > li:hover {
    background: rgba(26,111,181,0.05);
}
body.task-mail #messagelist tbody tr.unread,
body.task-mail #messagelist > li.unread {
    background: rgba(26,111,181,0.06);
    border-left: 3px solid #0A6FB8;
}
body.task-mail #messagelist tbody tr.selected,
body.task-mail #messagelist > li.selected {
    background: rgba(26,111,181,0.14);
    border-left: 3px solid #0A6FB8;
}
body.task-mail .subject {
    color: #1c2b36;
}
body.task-mail #messagelist tbody tr.unread .subject,
body.task-mail #messagelist > li.unread .subject {
    color: #0d1f2b;
    font-weight: 700;
}
body.task-mail .fromto {
    color: #5F778A;
}
body.task-mail .unreadcount {
    background: #0A6FB8;
    color: #ffffff;
}

/* reading pane — always readable regardless of theme */
body.task-mail .message-partheaders {
    background-color: #f8f9fa;
    border-top: 1px solid rgba(0,0,0,0.08);
}
body.task-mail .message-partheaders table.headers-table,
body.task-mail .message-partheaders table.headers-table .header-title,
body.task-mail .message-partheaders table.headers-table .subject {
    color: #2c363a;
}
body.task-mail .message-partheaders table.headers-table a {
    color: #0A6FB8;
}
body.task-mail #messagecontframe,
body.task-mail .message-body,
body.task-mail .message-part,
body.task-mail blockquote,
body.task-mail pre {
    background-color: #ffffff;
    color: #2c363a;
    border-color: rgba(0,0,0,0.1);
}

/* RICHCMX-MOBILE-SCROLL-FIX */
@media (max-width: 767px) {
    body.task-mail #layout-sidebar,
    body.task-mail #layout-sidebar .scroller,
    body.task-mail .folderlist {
        max-height: none !important;
        height: auto !important;
        overflow-y: auto !important;
    }
    body.task-mail #layout-sidebar {
        max-height: 70vh !important;
    }
}

/* RICHCMX-ABOUT-STYLE */
.richcmx-about {
    padding: 24px;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.6;
}
.richcmx-about h2.sysname {
    font-size: 20px;
    margin-bottom: 16px;
}
.richcmx-about h3 {
    margin-top: 20px;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #5F778A;
}
.richcmx-about a {
    color: #0A6FB8;
}
.richcmx-about .copyright {
    margin-top: 24px;
    font-size: 11px;
    color: #8599AA;
}

/* RICHCMX-MODERN-TOUCHES — message list presence: avatar circles, spacing, rounded surfaces */
body.task-mail #messagelist tbody tr,
body.task-mail #messagelist > li {
    padding: 12px 16px !important;
}
body.task-mail #messagelist tbody tr td.subject,
body.task-mail #messagelist > li .subject {
    position: relative;
    padding-left: 40px !important;
}
body.task-mail #messagelist tbody tr td.subject::before,
body.task-mail #messagelist > li .subject::before {
    content: attr(data-initial);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #0A6FB8;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}
body.task-mail .folderlist li a {
    padding: 8px 10px !important;
    border-radius: 4px !important;
    margin: 2px 6px !important;
}
body.task-mail .folderlist li a:before {
    font-size: 1.1em !important;
}
body.task-mail #messagelist-content,
body.task-mail .folderlist {
    padding-top: 6px !important;
}

/* RICHCMX-FIX-WHITEBOX — restore transparency lost in consolidation rewrite */
body.task-login #layout-content,
body.task-login .selected,
body.task-login #layout,
body.task-login .header {
    background: transparent !important;
}

/* mobile Junk fix, take 2 — remove height cap entirely, force real scroll */
@media (max-width: 767px) {
    body.task-mail #layout-sidebar {
        max-height: none !important;
        height: auto !important;
    }
    body.task-mail #layout-sidebar,
    body.task-mail #layout-sidebar .scroller,
    body.task-mail .folderlist,
    body.task-mail .folderlist ul {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* RICHCMX-MOBILE-DRAWER-FIX — the logo header bar in the mobile task-menu popover */
#taskmenu .header,
#layout-menu .header,
.popover #taskmenu .header,
#taskmenu.popover .header,
.menu.toolbar .header {
    background: #ffffff !important;
    border-bottom: 1px solid rgba(0,0,0,0.08) !important;
}
#taskmenu .header #logo,
#layout-menu .header #logo {
    max-height: 40px !important;
}

/* RICHCMX-NO-OVERLAP-STACK — force logo and install button into a clean vertical stack */
body.task-login #logo {
    position: static !important;
    display: block !important;
    float: none !important;
    margin: 0 auto 12px auto !important;
}
body.task-login #richcmx-install-inline {
    position: static !important;
    display: block !important;
    float: none !important;
    clear: both !important;
    margin: 0 0 16px 0 !important;
}

/* RICHCMX-DRAWER-FOLDERS — style the folder shortcuts added to the task menu drawer */
.richcmx-folder-shortcuts {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    border-top: 1px solid rgba(0,0,0,0.08);
}
.richcmx-folder-shortcuts li a {
    display: block;
    padding: 12px 20px;
    color: #0A6FB8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    text-decoration: none;
}
.richcmx-folder-shortcuts li a:hover,
.richcmx-folder-shortcuts li a:active {
    background: rgba(26,111,181,0.08);
}

/* RICHCMX-COMPOSE-FIX — compose form always white/readable, no exceptions */
body.task-mail.action-compose input.form-control,
body.task-mail.action-compose textarea.form-control,
body.task-mail.action-compose .recipient-input,
body.task-mail.action-compose #compose-subject,
body.task-mail.action-compose ul.recipient-input {
    background-color: #ffffff !important;
    color: #1c2b36 !important;
    border: 1px solid rgba(0,0,0,0.15) !important;
}
body.task-mail.action-compose .recipient-input li.recipient {
    background-color: #EEF5FC !important;
    color: #0A6FB8 !important;
}

/* RICHCMX-NO-DOT — remove redundant unread status dot, keep only bold text + left accent border */
body.task-mail #messagelist span.msgicon.status,
body.task-mail #messagelist span.msgicon.status:before,
body.task-mail #messagelist td.subject span.msgicon:before {
    display: none !important;
}

/* RICHCMX-NO-DOT-V2 — mirrors exact core selector chain, forced */
.messagelist td.subject span.msgicon.status:before,
.messagelist td.subject span.msgicon.status.unread:before,
.messagelist td.subject span.msgicon.status.unreadchildren:before {
    display: none !important;
    content: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
}

/* RICHCMX-ABOUT-COSMIC — same visual identity as login screen, self-contained */
.richcmx-about {
    background: #030712 url('images/richcmx-bg.jpg') center/cover no-repeat fixed;
    padding: 40px 24px;
    text-align: center;
    color: #D9EEFF;
    font-family: 'JetBrains Mono', monospace;
    min-height: 100%;
    box-sizing: border-box;
}
.richcmx-about-logo {
    max-height: 70px;
    margin: 0 auto 20px auto;
    display: block;
}
.richcmx-about h2.sysname {
    color: #ffffff;
    font-size: 18px;
    margin-bottom: 16px;
}
.richcmx-about p {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}
.richcmx-about h3 {
    margin-top: 24px;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #68B5FF;
}
.richcmx-about a {
    color: #66B7FF;
}
.richcmx-about .copyright {
    margin-top: 28px;
    font-size: 11px;
    color: #6F879A;
}

/* RICHCMX-NO-DOT-FINAL — catch-all removal regardless of exact class combo */
body.task-mail .messagelist span.msgicon,
body.task-mail .messagelist span.msgicon:before,
body.task-mail .messagelist span.msgicon:after,
body.task-mail .messagelist td.subject span.msgicon.status,
body.task-mail .messagelist td.subject span.msgicon.status:before,
body.task-mail .messagelist td.subject span.msgicon.status:after {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    content: none !important;
    visibility: hidden !important;
}

/* clear, single unread/read distinction: bold white text + blue left border only */
body.task-mail .messagelist tr.unread td.subject,
body.task-mail .messagelist tr.unread .subject a {
    font-weight: 700 !important;
    color: #0d1f2b !important;
}
body.task-mail .messagelist tr:not(.unread) td.subject,
body.task-mail .messagelist tr:not(.unread) .subject a {
    font-weight: 400 !important;
    color: #4a5c68 !important;
}

/* RICHCMX-SCAN-RESTORE — bring back the moving light sweep on the install button */
#richcmx-install-inline {
    position: relative !important;
    overflow: hidden !important;
}
#richcmx-install-inline::after {
    content: '' !important;
    position: absolute !important;
    top: 0;
    left: -60%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(29,161,242,0.25), transparent) !important;
    animation: richcmx-scan 3s ease-in-out infinite !important;
    pointer-events: none;
}
@keyframes richcmx-scan {
    0% { left: -60%; }
    100% { left: 120%; }
}

/* RICHCMX-ROW-DELETE */
.richcmx-row-delete {
    display: none;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #2B87C0;
    font-size: 16px;
    padding: 4px;
    z-index: 5;
}
body.task-mail .messagelist tr:hover .richcmx-row-delete,
body.task-mail .messagelist > li:hover .richcmx-row-delete {
    display: inline-block;
}
body.task-mail .messagelist td.subject {
    position: relative;
}

/* RICHCMX-READ-UNREAD-CONTRAST — background difference, not just font-weight */
body.task-mail .messagelist tr.unread,
body.task-mail .messagelist > li.unread {
    background: #EAF3FC !important;
    border-left: 3px solid #0A6FB8 !important;
}
body.task-mail .messagelist tr.unread td.subject,
body.task-mail .messagelist tr.unread .subject a {
    font-weight: 700 !important;
    color: #0d1f2b !important;
}
body.task-mail .messagelist tr:not(.unread) {
    background: #ffffff !important;
    border-left: 3px solid transparent !important;
}
body.task-mail .messagelist tr:not(.unread) td.subject,
body.task-mail .messagelist tr:not(.unread) .subject a {
    font-weight: 400 !important;
    color: #5a6b76 !important;
}

/* RICHCMX-DELETE-ICON-ROLLBACK — JS removed due to breaking message open; hiding leftover CSS-created elements */
.richcmx-row-delete {
    display: none !important;
}

/* RICHCMX-DELETE-V3 — always visible, touch-friendly, no hover dependency */
body.task-mail .messagelist td.subject {
    position: relative;
    padding-right: 32px !important;
}
.richcmx-row-delete {
    display: inline-block !important;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #2B87C0;
    font-size: 15px;
    opacity: 0.55;
    padding: 6px;
    z-index: 5;
}
.richcmx-row-delete:hover,
.richcmx-row-delete:active {
    opacity: 1;
}

/* RICHCMX-BIG-GMAIL-FINAL */
body.task-mail .messagelist span.msgicon.status { display: none !important; }
body.task-mail { background: #ffffff !important; }
body.task-mail .header, body.task-mail #messagelist-header, body.task-mail .toolbar,
body.task-mail #layout-sidebar, body.task-mail #taskmenu {
    background: #ffffff !important; border-color: #e8eaed !important;
}
body.task-mail #logo { max-height: 48px !important; margin: 14px auto !important; }
body.task-mail .toolbar a.button, body.task-mail #taskmenu a { color: #5f6368 !important; font-size: 16px !important; }
body.task-mail .toolbar a.button:hover, body.task-mail #taskmenu a:hover { background: #f1f3f4 !important; color: #202124 !important; }
body.task-mail #taskmenu a.logout { color: #2596D9 !important; }
body.task-mail .header-title { color: #202124 !important; font-size: 18px !important; }
body.task-mail .folderlist li a { color: #202124 !important; font-size: 16px !important; padding: 14px 18px !important; border-radius: 0 22px 22px 0 !important; }
body.task-mail .folderlist li a:hover { background: #f1f3f4 !important; }
body.task-mail .folderlist li.selected > a, body.task-mail .folderlist li.mailbox.selected > a {
    background: #D3EAFD !important; color: #041e49 !important; font-weight: 700 !important;
}
body.task-mail .folderlist li.mailbox.unread > a { color: #202124 !important; font-weight: 700 !important; }
body.task-mail .messagelist tr, body.task-mail .messagelist > li {
    height: 64px !important; background: #F2F8FC !important; border-bottom: 1px solid #e8eaed !important;
}
body.task-mail .messagelist tr.unread, body.task-mail .messagelist > li.unread { background: #ffffff !important; }
body.task-mail .messagelist tr:hover, body.task-mail .messagelist > li:hover {
    background: #f5f5f5 !important; box-shadow: 0 1px 3px rgba(60,64,67,0.2) !important;
}
body.task-mail .messagelist tr.selected, body.task-mail .messagelist > li.selected { background: #D3EAFD !important; }
body.task-mail .messagelist td.subject { display: flex !important; align-items: center !important; gap: 18px !important; padding: 0 22px !important; }
body.task-mail .fromto { width: 220px !important; flex-shrink: 0 !important; font-size: 16px !important; color: #202124 !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
body.task-mail .subject { font-size: 16px !important; color: #5f6368 !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; flex: 1 !important; }
body.task-mail .messagelist tr.unread .fromto, body.task-mail .messagelist tr.unread .subject { color: #202124 !important; font-weight: 700 !important; }
body.task-mail .messagelist .date { font-size: 14px !important; color: #5f6368 !important; flex-shrink: 0 !important; margin-left: auto !important; }
.richcmx-avatar {
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    width: 42px !important; height: 42px !important; border-radius: 50% !important;
    color: #ffffff !important; font-size: 16px !important; font-weight: 700 !important; flex-shrink: 0 !important;
}
body.task-mail .message-partheaders, body.task-mail #messagecontframe, body.task-mail .message-body {
    background-color: #ffffff !important; color: #202124 !important; font-size: 16px !important;
}

/* RICHCMX-FINAL-CLEANUP */
.richcmx-row-delete { display: none !important; }
body.task-mail .messagelist tr[id^="rcmrow"] span:not(.richcmx-avatar),
body.task-mail .messagelist li[id^="rcmrow"] span:not(.richcmx-avatar) {
    background: transparent !important;
    width: auto !important;
    height: auto !important;
}
body.task-mail .messagelist span.msgicon,
body.task-mail .messagelist span.msgicon.status,
body.task-mail .messagelist .flagged,
body.task-mail .messagelist .unflagged,
body.task-mail .messagelist .selection,
body.task-mail .messagelist td.selection,
body.task-mail .messagelist input[type="checkbox"] {
    display: none !important;
}

/* RICHCMX-GMAIL-INBOX */
body.task-mail .messagelist tr[id^="rcmrow"],
body.task-mail .messagelist li[id^="rcmrow"] {
    display: flex !important;
    align-items: center !important;
    padding: 8px 12px !important;
    border-bottom: 1px solid #eee !important;
}

/* Remove Roundcube's native status/flag dots — avatar replaces them */
body.task-mail .messagelist span.msgicon,
body.task-mail .messagelist span.msgicon.status,
body.task-mail .messagelist .flagged,
body.task-mail .messagelist .unflagged {
    display: none !important;
}

/* Gmail-style circular avatar with initial */
.richcmx-avatar {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50% !important;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    margin-right: 14px;
    font-family: 'Google Sans', Roboto, Arial, sans-serif;
    user-select: none;
}

/* Unread rows: bold subject/sender, Gmail-style */
body.task-mail .messagelist tr.unread .subject,
body.task-mail .messagelist tr.unread .fromto,
body.task-mail .messagelist li.unread .subject,
body.task-mail .messagelist li.unread .fromto {
    font-weight: 700 !important;
    color: #202124 !important;
}
body.task-mail .messagelist tr:not(.unread) .subject,
body.task-mail .messagelist tr:not(.unread) .fromto,
body.task-mail .messagelist li:not(.unread) .subject,
body.task-mail .messagelist li:not(.unread) .fromto {
    font-weight: 400 !important;
    color: #5f6368 !important;
}

/* RICHCMX-REMOVE-BLUE-DOTS */
body.task-mail .messagelist tr.unread::before,
body.task-mail .messagelist tr.unread::after,
body.task-mail .messagelist li.unread::before,
body.task-mail .messagelist li.unread::after,
body.task-mail .messagelist .unreadchildren,
body.task-mail .messagelist .status.unread,
body.task-mail .messagelist td.status,
body.task-mail .messagelist span.status,
body.task-mail .messagelist span.dot,
body.task-mail .messagelist span.unread-dot {
    display: none !important;
    content: none !important;
    background: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* RICHCMX-KILL-UNREAD-DOT-V2 */
body.task-mail .messagelist td.subject:before,
body.task-mail .messagelist td.subject:after,
body.task-mail .messagelist .subject:before,
body.task-mail .messagelist .subject:after,
body.task-mail .messagelist tr.unread td.subject:before,
body.task-mail .messagelist tr.unread td.subject:after,
body.task-mail .messagelist tr.unread .subject:before,
body.task-mail .messagelist tr.unread .subject:after {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
}

/* RICHCMX-AVATAR-POSITION-AND-SPACING */
body.task-mail .messagelist .richcmx-avatar {
    margin-left: 2px !important;
    margin-right: 16px !important;
}
body.task-mail .messagelist td.subject,
body.task-mail .messagelist .subject {
    padding-left: 4px !important;
}
/* extra breathing room in reply/compose pane so avatar row doesn't crowd text */
body.task-mail #layout-content .composeview,
body.task-mail #layout-content iframe {
    padding-top: 6px !important;
}

/* RICHCMX-AVATAR-LEFT-V2 */
body.task-mail .messagelist td.subject,
body.task-mail .messagelist .subject {
    display: flex !important;
    align-items: center !important;
    padding-left: 0 !important;
}
body.task-mail .messagelist .richcmx-avatar {
    margin-left: 0 !important;
    margin-right: 18px !important;
    order: -1;
}
/* extra clear space above reply/compose text area */
body.task-mail #layout-content .composeview textarea,
body.task-mail #layout-content .composeview .mce-content-body,
body.task-mail #layout-content iframe[name="messagecontframe"] {
    padding-top: 24px !important;
}

/* RICHCMX-AVATAR-SHIFT-LEFT — REMOVED, was fighting against V2 fix */

/* RICHCMX-SKYNET-LIGHT — Apple-clean structure, X-blue accent, technical touches. White/black foundation untouched. */
:root { --rcx-blue: #0A82D9; --rcx-blue-dark: #0765A8; }

/* Primary buttons + active states — the one accent color everywhere */
body.task-mail .btn-primary, body.task-mail button.btn-primary,
body.task-mail .floating-action-buttons a.button {
    background: var(--rcx-blue) !important; border-color: var(--rcx-blue) !important;
}
body.task-mail .btn-primary:hover, body.task-mail .floating-action-buttons a.button:hover {
    background: var(--rcx-blue-dark) !important; border-color: var(--rcx-blue-dark) !important;
}
body.task-mail a { color: var(--rcx-blue) !important; }
body.task-mail .messagelist tr.selected, body.task-mail .messagelist > li.selected,
body.task-mail .listing li.selected, body.task-mail .listing tr.selected td {
    background: #EAF5FF !important; border-left: 3px solid var(--rcx-blue) !important;
}
body.task-mail #taskmenu a.selected, body.task-mail #taskmenu a.selected:hover {
    background: var(--rcx-blue) !important; color: #fff !important;
}
body.task-mail .tab-btn.active, body.task-mail .folderlist li.mailbox.unread > a {
    color: var(--rcx-blue) !important;
}
body.task-mail .folderlist li.mailbox .unreadcount {
    background: var(--rcx-blue) !important;
}

/* Apple-level typography: system font stack, tighter tracking on headers */
body.task-mail, body.task-mail input, body.task-mail button, body.task-mail select {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, sans-serif !important;
}
body.task-mail h1, body.task-mail h2, body.task-mail h3, body.task-mail .header-title {
    letter-spacing: -0.01em !important; font-weight: 600 !important;
}

/* Technical/console touch: monospace metadata (timestamps, sizes) — subtle, not overdone */
body.task-mail .messagelist .date, body.task-mail .messagelist td.subject span.date {
    font-family: "SF Mono", ui-monospace, Menlo, monospace !important; font-size: 12px !important; letter-spacing: -0.02em !important;
}

/* Crisp Apple-style borders + slightly more generous radius on cards/panels */
body.task-mail .ui-widget, body.task-mail .popover, body.task-mail .ui-dialog {
    border-radius: 12px !important; border-color: #e5e5e5 !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08) !important;
}
body.task-mail input.form-control, body.task-mail textarea.form-control {
    border-radius: 8px !important; border-color: #dcdcdc !important;
}
body.task-mail input.form-control:focus, body.task-mail textarea.form-control:focus {
    border-color: var(--rcx-blue) !important; box-shadow: 0 0 0 3px rgba(29,155,240,0.15) !important;
}

/* Sidebar — clean, crisp, minimal, Apple Mail-esque */
body.task-mail #layout-menu, body.task-mail #taskmenu {
    background: #fafafa !important; border-right: 1px solid #ececec !important;
}

/* RICHCMX-AVATAR-LEFT-V3 — the real remaining space is the ROW's own left padding, not the subject cell */
body.task-mail .messagelist tr[id^="rcmrow"], body.task-mail .messagelist li[id^="rcmrow"] {
    padding-left: 0 !important;
}
body.task-mail .messagelist .richcmx-avatar {
    margin-left: 0 !important; margin-right: 10px !important;
}
body.task-mail .messagelist td.subject { gap: 8px !important; }

/* RICHCMX-FAB-ICON-FIX — restore visible white pencil icon on the new blue compose button */
body.task-mail .floating-action-buttons a.button:before {
    color: #ffffff !important;
    position: relative !important;
    z-index: 2 !important;
    font-size: 1.5rem !important;
}
body.task-mail .floating-action-buttons a.button {
    position: relative !important;
    z-index: 1 !important;
}

/* ══════════════════════════════════════════════════════════════
   RICHCMX-INTEL-DIVISION — DARPA/intelligence-console styling.
   White background + black text preserved throughout, per spec.
   X-blue (#0A82D9) remains the single accent color.
   ══════════════════════════════════════════════════════════════ */

/* Briefing-document typography: uppercase, letter-spaced labels everywhere */
body.task-mail .folderlist li a, body.task-mail #taskmenu a span.inner,
body.task-mail .tab-btn, body.task-mail .header-title {
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    font-size: 0.82em !important;
    font-weight: 600 !important;
}

/* Classification-stamp style unread badges */
body.task-mail .folderlist li.mailbox .unreadcount {
    border-radius: 3px !important;
    font-family: "SF Mono", ui-monospace, Menlo, monospace !important;
    font-size: 11px !important;
    letter-spacing: 0.03em !important;
    padding: 1px 6px !important;
}

/* Tactical corner-bracket accent on focus/selected — reticle motif */
body.task-mail .messagelist tr.selected, body.task-mail .messagelist > li.selected {
    position: relative !important;
}
body.task-mail .messagelist tr.selected::before, body.task-mail .messagelist > li.selected::before {
    content: '' !important; position: absolute !important; left: 0; top: 0; bottom: 0;
    width: 3px !important; background: var(--rcx-blue) !important;
}

/* Subtle tactical grid texture in the header bar only — restrained, not overdone */
body.task-mail #layout > div > .header {
    background-image: linear-gradient(rgba(29,155,240,0.03) 1px, transparent 1px),
                       linear-gradient(90deg, rgba(29,155,240,0.03) 1px, transparent 1px) !important;
    background-size: 24px 24px !important;
    border-bottom: 1px solid #e5e5e5 !important;
}

/* Console-style search bar: monospace, subtle bracket accents */
body.task-mail .searchbar input {
    font-family: "SF Mono", ui-monospace, Menlo, monospace !important;
    font-size: 13px !important;
}
body.task-mail .searchbar input::placeholder {
    content: '// SEARCH_ARCHIVE' !important;
    letter-spacing: 0.02em !important;
}

/* Sender initials avatar: sharper, more technical — square-ish rounded rather than full circle */
body.task-mail .richcmx-avatar {
    border-radius: 6px !important;
    font-family: "SF Mono", ui-monospace, Menlo, monospace !important;
    letter-spacing: 0 !important;
}

/* Toolbar icons: crisp, minimal hover state in accent blue */
body.task-mail .header a.button.icon:hover, body.task-mail .header a.button.icon:focus {
    background: rgba(29,155,240,0.1) !important;
    border-radius: 6px !important;
}

/* ── Mobile responsive tuning ── */
@media screen and (max-width: 768px) {
    body.task-mail .folderlist li a, body.task-mail .tab-btn {
        letter-spacing: 0.03em !important;
        font-size: 0.9em !important;
    }
    body.task-mail #layout > div > .header {
        background-size: 16px 16px !important;
    }
    /* Ensure tap targets stay comfortably touchable per Apple HIG minimum */
    body.task-mail .messagelist tr[id^="rcmrow"], body.task-mail .messagelist li[id^="rcmrow"] {
        min-height: 44px !important;
    }
    body.task-mail .floating-action-buttons a.button {
        width: 3.5rem !important; height: 3.5rem !important;
    }
}

/* RICHCMX-FAB-CENTER-V2 — real flexbox centering, not line-height guessing */
body.task-mail .floating-action-buttons a.button {
    display: flex !important; align-items: center !important; justify-content: center !important;
}
body.task-mail .floating-action-buttons a.button:before {
    width: auto !important; height: auto !important; line-height: 1 !important; margin: 0 !important;
}

/* RICHCMX-ICON-RECOLOR — save + send icons in accent blue */
body.task-mail a.button.icon.save:before, body.task-mail button.btn.save:before,
body.task-mail a.button.icon.submit:before, body.task-mail button.btn.submit:before,
body.task-mail a.button.icon.send:before, body.task-mail button.btn.send:before {
    color: var(--rcx-blue) !important;
}

/* RICHCMX-2026-SEARCHBAR — modern pill-shaped search, controlled 16px icon inset */
body.task-mail .searchbar {
    background: transparent !important; border-bottom: none !important;
    padding: 10px 12px !important;
}
body.task-mail .searchbar form {
    background: #f1f3f4 !important; border-radius: 20px !important;
    padding: 0 !important; height: 40px !important;
    transition: background 0.15s !important;
}
body.task-mail .searchbar form:hover, body.task-mail .searchbar form:focus-within {
    background: #e8eaed !important;
}
body.task-mail .searchbar form:before {
    margin-left: 16px !important; color: #5f6368 !important; font-size: 1rem !important;
}
body.task-mail .searchbar input {
    padding-left: 12px !important; background: transparent !important;
}

/* RICHCMX-AVATAR-ALIGN-FINAL — same 16px inset as the search icon above, guaranteed match */
body.task-mail .messagelist tr[id^="rcmrow"], body.task-mail .messagelist li[id^="rcmrow"] {
    padding-left: 16px !important;
}
body.task-mail .messagelist .richcmx-avatar {
    margin-left: 0 !important;
}

/* RICHCMX-2026-TOOLBAR — softer, modern toolbar button hover/press states */
body.task-mail .header a.button.icon {
    border-radius: 10px !important; transition: background 0.12s !important;
}
body.task-mail .header a.button.icon:hover {
    background: rgba(29,155,240,0.08) !important;
}
body.task-mail .header a.button.icon:active {
    background: rgba(29,155,240,0.16) !important;
}

/* RICHCMX-2026-FOLDERLIST — soft rounded active state instead of flat highlight */
body.task-mail .folderlist li a {
    border-radius: 0 20px 20px 0 !important; margin-right: 12px !important;
    transition: background 0.12s !important;
}
body.task-mail .folderlist li.mailbox.selected > a,
body.task-mail .folderlist li.mailbox.active > a {
    background: rgba(29,155,240,0.1) !important; color: var(--rcx-blue-dark) !important;
}

/* RICHCMX-AVATAR-FINAL-REAL-FIX — targets the actual TD cell, not the TR (which never worked, tr padding is ignored by browsers in table layout) */
body.task-mail .messagelist td.subject {
    padding-left: 4px !important;
}
body.task-mail .messagelist td.selection {
    width: 32px !important; padding: 0 !important;
}

/* RICHCMX-SEND-ARROW-FINAL — targets the actual :before pseudo-element (JS cannot reach this) */
body.task-mail .btn.send:before, body.task-mail .btn-primary.send:before,
body.task-mail button.send:before {
    color: #ffffff !important;
    font-size: 1.1rem !important;
}
body.task-mail .btn.send, body.task-mail .btn-primary.send {
    background: #0A82D9 !important; border-color: #0A82D9 !important;
    border-radius: 8px !important;
}

/* RICHCMX-RECIPIENT-BLACK-FINAL — broad universal selector, CSS !important always beats non-important JS-set inline styles, wins any re-render race */
body.task-mail #compose-container *,
body.task-mail .recipient-input *,
body.task-mail [data-recipient-input] *,
body.task-mail .recipient-input,
body.task-mail [data-recipient-input] {
    color: #0d1a2b !important;
}

/* RICHCMX-OPTIONS-PANEL-BLUE — toggles, attach button, and helper text all in accent blue */
body.task-mail input[type="checkbox"]:not(.custom-control-input), body.task-mail input[type="radio"]:not(.custom-control-input) {
    accent-color: #0A82D9 !important;
}
body.task-mail .toggle, body.task-mail .switch,
body.task-mail .custom-control-input:checked ~ .custom-control-label:before {
    background-color: #0A82D9 !important; border-color: #0A82D9 !important;
}
body.task-mail #compose-attachments {
    color: #0A82D9 !important;
}
body.task-mail #compose-attachments .file-upload,
body.task-mail #compose-attachments button,
body.task-mail #compose-attachments .filedrop {
    background: rgba(29,155,240,0.08) !important;
    border: 1.5px dashed #0A82D9 !important;
    color: #0765A8 !important;
}
body.task-mail #compose-attachments a.button {
    background: #0A82D9 !important; color: #ffffff !important; border-color: #0A82D9 !important;
}

/* RICHCMX-RECIPIENT-BLUE-FINAL — blue instead of black, as requested */
body.task-mail #compose-container *,
body.task-mail .recipient-input *,
body.task-mail [data-recipient-input] *,
body.task-mail .recipient-input,
body.task-mail [data-recipient-input] {
    color: #0765A8 !important;
}

/* RICHCMX-AUTOCOMPLETE-FIX — jQuery UI contact suggestion dropdown, currently white-on-white */
body.task-mail .ui-autocomplete, body.task-mail ul.ui-autocomplete {
    background: #ffffff !important; border: 1px solid #0A82D9 !important;
}
body.task-mail .ui-autocomplete .ui-menu-item,
body.task-mail .ui-autocomplete li,
body.task-mail .ui-widget-content {
    color: #0d1a2b !important; background: #ffffff !important;
}
body.task-mail .ui-autocomplete .ui-menu-item:hover,
body.task-mail .ui-autocomplete li:hover,
body.task-mail .ui-state-active, body.task-mail .ui-state-hover {
    background: #EAF5FF !important; color: #0d1a2b !important;
}

/* RICHCMX-CARET-ARROWS — every dropdown/chevron arrow in accent blue */
body.task-mail .dropdown-toggle:after, body.task-mail .caret,
body.task-mail [class*="arrow"]:not(.rcx-custom-arrow),
body.task-mail .icon.dropdown:before {
    color: #0A82D9 !important; border-top-color: #0A82D9 !important;
}

/* RICHCMX-TOGGLE-FINAL — force the actual pseudo-element pill/knob, not just accent-color */
body.task-mail input[type="checkbox"]:checked:before,
body.task-mail input[type="checkbox"]:checked:after,
body.task-mail label.toggle:before, body.task-mail label.toggle:after {
    background-color: #0A82D9 !important; border-color: #0A82D9 !important;
}

/* RICHCMX-NUCLEAR-BLUE — broad final sweep: kill every white dropdown/popup, force blue everywhere in compose */
body.task-mail ul, body.task-mail li,
body.task-mail .ui-menu, body.task-mail .ui-menu-item, body.task-mail .ui-widget,
body.task-mail .popup, body.task-mail .popover, body.task-mail .dropdown-menu,
body.task-mail [class*="autocomplete"], body.task-mail [class*="suggest"] {
    background-color: #ffffff !important;
    color: #0765A8 !important;
}
body.task-mail ul *, body.task-mail li *,
body.task-mail .ui-menu *, body.task-mail .popup *, body.task-mail .popover * {
    color: #0765A8 !important;
}
body.task-mail *[style*="color: white"], body.task-mail *[style*="color:#fff"],
body.task-mail *[style*="color: #fff"], body.task-mail *[style*="color:white"] {
    color: #0765A8 !important;
}

/* RICHCMX-RIGHTPANEL-MODERN — full modern repaint of Options & Attachments panel */
body.task-mail #layout-sidebar, body.task-mail .options-panel, body.task-mail .compose-options {
    background: linear-gradient(180deg, #F7FBFF 0%, #ffffff 100%) !important;
    border-left: 1px solid #D7ECFF !important;
}
body.task-mail .options-panel .header-title, body.task-mail .header-title {
    color: #0765A8 !important; letter-spacing: 0.08em !important;
}
body.task-mail #compose-attachments {
    background: #F7FBFF !important; border: 2px dashed #0A82D9 !important;
    border-radius: 16px !important; padding: 24px !important;
}
body.task-mail #compose-attachments a.button {
    background: linear-gradient(135deg, #0A82D9, #0765A8) !important;
    color: #fff !important; border-radius: 10px !important;
    box-shadow: 0 4px 14px rgba(29,155,240,0.35) !important;
}

/* RICHCMX-SEND-HUGE-FUTURISTIC — dramatic, glowing, unmissable */
body.task-mail .btn.send, body.task-mail .btn-primary.send {
    background: linear-gradient(135deg, #0A82D9 0%, #0765A8 100%) !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 18px 48px !important;
    font-size: 1.3rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
    box-shadow: 0 8px 30px rgba(29,155,240,0.5), 0 0 0 1px rgba(255,255,255,0.1) inset !important;
    transition: transform 0.15s, box-shadow 0.15s !important;
}
body.task-mail .btn.send:hover, body.task-mail .btn-primary.send:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 12px 40px rgba(29,155,240,0.65) !important;
}

/* RICHCMX-SEND-SCIFI-V2 — breathing glow, pill shape, satisfying press */
@keyframes rcxSendBreathe {
    0%, 100% { box-shadow: 0 8px 30px rgba(29,155,240,0.5), 0 0 0 1px rgba(255,255,255,0.15) inset, 0 0 20px rgba(29,155,240,0.3); }
    50% { box-shadow: 0 8px 40px rgba(29,155,240,0.75), 0 0 0 1px rgba(255,255,255,0.25) inset, 0 0 35px rgba(29,155,240,0.5); }
}
body.task-mail .btn.send, body.task-mail .btn-primary.send {
    border-radius: 50px !important;
    animation: rcxSendBreathe 2.6s ease-in-out infinite !important;
    position: relative !important;
    overflow: hidden !important;
}
body.task-mail .btn.send:before, body.task-mail .btn-primary.send:before {
    content: '' !important;
    position: absolute !important; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent) !important;
    animation: rcxSendShimmer 3s ease-in-out infinite !important;
}
@keyframes rcxSendShimmer {
    0% { left: -100%; }
    50%, 100% { left: 150%; }
}
body.task-mail .btn.send:active, body.task-mail .btn-primary.send:active {
    transform: scale(0.96) !important;
    animation: none !important;
    box-shadow: 0 4px 16px rgba(29,155,240,0.8), 0 0 0 1px rgba(255,255,255,0.3) inset !important;
}

/* RICHCMX-MOBILE-NATIVE-FEEL — sticky compose toolbar (fixes the scroll-to-find-send bug) + modern pagination */
@media screen and (max-width: 768px) {
    body.task-mail #layout-content .composeview .boxfooter,
    body.task-mail .composeview .formbuttons,
    body.task-mail #compose-buttons {
        position: fixed !important;
        bottom: 0 !important; left: 0 !important; right: 0 !important;
        background: #ffffff !important;
        border-top: 1px solid #e5e5e5 !important;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.06) !important;
        z-index: 999 !important;
        padding: 12px 16px !important;
    }
    body.task-mail .composeview textarea,
    body.task-mail .composeview .mce-content-body {
        padding-bottom: 80px !important;
    }

    /* Modernize the pagination bar — small floating pill instead of a heavy 1995 bar */
    body.task-mail .listing-footer, body.task-mail .pagenav {
        background: transparent !important;
        border: none !important;
        display: flex !important;
        justify-content: center !important;
        padding: 8px 0 !important;
    }
    body.task-mail .listing-footer .pagenav-text,
    body.task-mail .pagenav .pagenav-text {
        background: #f1f3f4 !important;
        border-radius: 20px !important;
        padding: 6px 16px !important;
        font-size: 12px !important;
        color: #5f6368 !important;
        border: none !important;
    }
    body.task-mail .listing-footer a.button, body.task-mail .pagenav a.button {
        background: transparent !important;
        border: none !important;
        color: #0A82D9 !important;
    }
}

/* RICHCMX-SEARCH-ICON-HIDE-OLD — the JS couldn't touch this pseudo-element, CSS can */
body.task-mail .searchbar form:before {
    display: none !important; content: none !important;
}

/* ══════════════════════════════════════════════════════════════
   RICHCMX-TOTAL-REDESIGN — every remaining default element,
   broad universal selectors on purpose (precision has repeatedly
   missed real elements tonight; breadth has consistently worked).
   ══════════════════════════════════════════════════════════════ */

/* Every form control, everywhere, modernized */
body.task-mail input, body.task-mail select, body.task-mail textarea,
body.task-mail button, body.task-mail .form-control {
    border-radius: 10px !important;
    border-color: #dcdcdc !important;
    font-family: -apple-system, BlinkMacSystemFont, Roboto, sans-serif !important;
    transition: all 0.15s !important;
}
body.task-mail input:focus, body.task-mail select:focus, body.task-mail textarea:focus {
    border-color: #0A82D9 !important;
    box-shadow: 0 0 0 3px rgba(29,155,240,0.15) !important;
    outline: none !important;
}

/* Every icon, avatar-placeholder, and generic UI glyph — recolor toward accent blue */
body.task-mail svg, body.task-mail svg path, body.task-mail svg circle {
    color: #0A82D9 !important;
}
body.task-mail .contactpic, body.task-mail .contact-photo,
body.task-mail img[src*="photo"], body.task-mail .avatar,
body.task-mail .icon.contact, body.task-mail .icon.person {
    background: linear-gradient(135deg, #0A82D9, #0765A8) !important;
    border-radius: 8px !important;
    filter: none !important;
}

/* Every list item, table row, panel — soft modern surfaces, no more flat 90s borders */
body.task-mail table, body.task-mail .listing, body.task-mail .propform {
    border: none !important;
}
body.task-mail table td, body.task-mail table th {
    border-color: #f0f0f0 !important;
}
body.task-mail .box, body.task-mail .propform fieldset,
body.task-mail .uibox, body.task-mail .panel {
    border-radius: 14px !important;
    border-color: #ececec !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04) !important;
}

/* Every button — pill-shaped, modern weight */
body.task-mail button.btn, body.task-mail a.button {
    border-radius: 10px !important;
    font-weight: 600 !important;
}

/* Scrollbar — thin, modern, blue-tinted (webkit browsers) */
body.task-mail ::-webkit-scrollbar { width: 8px !important; height: 8px !important; }
body.task-mail ::-webkit-scrollbar-thumb { background: #C8E1F5 !important; border-radius: 10px !important; }
body.task-mail ::-webkit-scrollbar-track { background: transparent !important; }

/* ── Full mobile responsive pass ── */
@media screen and (max-width: 768px) {
    body.task-mail input, body.task-mail select, body.task-mail textarea, body.task-mail button {
        font-size: 16px !important; /* prevents iOS auto-zoom on focus */
        min-height: 44px !important;
    }
    body.task-mail .box, body.task-mail .panel {
        border-radius: 10px !important;
        margin: 8px !important;
    }
    body.task-mail table td, body.task-mail table th {
        padding: 10px 8px !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   RICHCMX-GLASSMORPH-SKYNET — full frosted-glass sci-fi surface pass
   ══════════════════════════════════════════════════════════════ */

/* Fix search icon overlap definitively — guaranteed clearance, broadened to every search variant */
body.task-mail .searchbar form:before, body.task-mail .search-form:before,
body.task-mail input.search:not(.rcx-fixed):before {
    display: none !important; content: none !important;
}
body.task-mail .searchbar input, body.task-mail input.search {
    padding-left: 44px !important;
}
body.task-mail .rcx-search-icon {
    left: 16px !important; z-index: 10 !important;
}

/* Sidebar — real frosted glass */
body.task-mail #layout-menu, body.task-mail #taskmenu, body.task-mail .folderlist {
    background: rgba(250, 250, 252, 0.75) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-right: 1px solid rgba(29,155,240,0.15) !important;
}

/* Header bar — frosted, floating feel */
body.task-mail #layout > div > .header, body.task-mail .header {
    background: rgba(255,255,255,0.7) !important;
    backdrop-filter: blur(16px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(160%) !important;
    border-bottom: 1px solid rgba(29,155,240,0.12) !important;
}

/* Search bar — glass pill with glow */
body.task-mail .searchbar form {
    background: rgba(255,255,255,0.6) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(29,155,240,0.25) !important;
    box-shadow: 0 4px 20px rgba(29,155,240,0.1) !important;
}
body.task-mail .searchbar form:focus-within {
    border-color: #0A82D9 !important;
    box-shadow: 0 4px 24px rgba(29,155,240,0.25) !important;
}

/* Every panel/box/dialog — glass cards */
body.task-mail .box, body.task-mail .panel, body.task-mail .uibox,
body.task-mail .popover, body.task-mail .ui-dialog {
    background: rgba(255,255,255,0.7) !important;
    backdrop-filter: blur(18px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(180%) !important;
    border: 1px solid rgba(29,155,240,0.15) !important;
}

/* Options/attachment panel — glass with glow */
body.task-mail #layout-sidebar, body.task-mail .options-panel {
    background: rgba(247,251,255,0.7) !important;
    backdrop-filter: blur(18px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(180%) !important;
}

/* Message list rows — subtle glass on hover/select for depth */
body.task-mail .messagelist tr:hover, body.task-mail .messagelist > li:hover {
    background: rgba(29,155,240,0.05) !important;
    backdrop-filter: blur(4px) !important;
}

body.task-mail body, body.task-mail #layout {
    background: linear-gradient(135deg, #EEF7FF 0%, #F7FBFF 50%, #EEF7FF 100%) !important;
}



/* RICHCMX-REMOVE-DARKMODE-FINAL — confirmed real class from template source, guaranteed hide */
body.task-mail a.theme.dark, body.task-mail a.button.theme,
body.task-mail [class*="theme dark"], body.task-mail li:has(a.theme.dark) {
    display: none !important;
}

/* RICHCMX-LOGIN-NUCLEAR-CLEAN — hide ANY remaining default icon on login, broad and decisive */
body.task-login svg:not(.rcx-badge svg), body.task-login .iconuser, body.task-login .icon-user,
body.task-login [class*="user-icon"], body.task-login .fa-user, body.task-login .fa-lock,
body.task-login i[class*="icon"], body.task-login .input-group-text {
    display: none !important;
}
body.task-login input {
    padding-left: 16px !important;
}
.rcx-badge { text-align: center; margin-bottom: 20px; }
.rcx-badge svg { display: inline-block !important; filter: drop-shadow(0 0 12px rgba(79,178,255,0.6)); }

/* RICHCMX-INSTALL-BUTTON-MATCH — same width/style as the login form, unified futuristic interface */
#richcmx-install-inline {
    width: 100% !important;
    max-width: 420px !important;
    margin: 0 auto 20px !important;
    box-sizing: border-box !important;
}
body.task-login #login-form, body.task-login .propform {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* RICHCMX-INSTALL-NARROW — auto-width, not full form width */
#richcmx-install-inline {
    width: auto !important;
    max-width: none !important;
    padding: 10px 28px !important;
    margin: 0 auto 20px !important;
    display: inline-flex !important;
}
body.task-login #login-form { display: block !important; }

/* RICHCMX-FOOTER-STYLE + HUD TOUCHES — terminator/skynet feel */
body.task-login .rcx-footer-extra {
    margin-top: 16px !important; font-size: 10.5px !important;
    color: rgba(234,246,255,0.5) !important; text-align: center !important;
    line-height: 1.6 !important; letter-spacing: 0.02em !important;
}
body.task-login #login-footer {
    color: rgba(234,246,255,0.7) !important; text-align: center !important;
    font-family: "SF Mono", ui-monospace, Menlo, monospace !important;
    font-size: 11px !important; letter-spacing: 0.05em !important; text-transform: uppercase !important;
}
body.task-login #login-footer a.support-link { color: #238CF5 !important; }
body.task-login #login-form::before, body.task-login #login-form::after {
    content: '' !important; position: absolute !important; width: 24px !important; height: 24px !important;
    border-color: #238CF5 !important; opacity: 0.6 !important;
}
body.task-login #login-form::before {
    top: -1px !important; left: -1px !important; border-top: 2px solid !important; border-left: 2px solid !important;
}
body.task-login #login-form::after {
    bottom: -1px !important; right: -1px !important; border-bottom: 2px solid !important; border-right: 2px solid !important;
}

/* RICHCMX-HUD-CORNERS-FIX — anchor the corner brackets properly, fix stray white box */
body.task-login #login-form {
    position: relative !important;
}
body.task-login #login-form::before, body.task-login #login-form::after {
    background: transparent !important;
    border-style: solid !important;
}

/* RICHCMX-HUD-CORNERS-REMOVED — caused a stray white box, removing entirely */
body.task-login #login-form::before, body.task-login #login-form::after {
    display: none !important;
    content: none !important;
}

/* RICHCMX-INSTALL-BUTTON-FUTURISTIC — centered, glowing, modern */
#richcmx-install-inline {
    display: flex !important;
    margin: 0 auto 20px auto !important;
    background: linear-gradient(135deg, rgba(79,178,255,0.15), rgba(29,155,240,0.1)) !important;
    border: 1px solid #238CF5 !important;
    border-radius: 50px !important;
    box-shadow: 0 0 20px rgba(79,178,255,0.3) !important;
    color: #EAF5FF !important;
    transition: all 0.2s !important;
}
#richcmx-install-inline:hover {
    box-shadow: 0 0 30px rgba(79,178,255,0.5) !important;
    transform: translateY(-1px) !important;
}
body.task-login #login-form {
    display: flex !important; flex-direction: column !important; align-items: center !important;
}

/* RICHCMX-FOOTER-EXTRA-TRANSPARENT-FIX — the real cause of the white box, never set explicitly before */
body.task-login .rcx-footer-extra {
    background: transparent !important;
    color: rgba(234,246,255,0.55) !important;
}

/* RICHCMX-LOGIN-MOBILE-SCROLL-FIX — real bug: content taller than screen was getting clipped, not scrollable */
body.task-login, body.task-login #layout-content {
    min-height: 100vh !important;
    height: auto !important;
    overflow-y: auto !important;
    padding: 20px 0 !important;
}
#richcmx-install-inline {
    order: -1 !important;
    margin-top: 8px !important;
}

@media screen and (max-width: 600px) {
    body.task-login, body.task-login #layout-content {
        display: block !important;
        padding: 16px !important;
    }
    body.task-login #login-form, body.task-login .propform {
        max-width: 100% !important;
        margin: 0 auto !important;
    }
    #richcmx-install-inline {
        margin: 0 auto 16px auto !important;
        font-size: 11px !important;
        padding: 8px 20px !important;
    }
}

/* RICHCMX-INSTALL-CENTER-ONLY — simple horizontal centering, nothing else */
#richcmx-install-inline {
    margin-left: auto !important;
    margin-right: auto !important;
    display: flex !important;
}

/* RICHCMX-INSTALL-CENTER-FINAL — the real, reliable method: block + fit-content + margin auto */
#richcmx-install-inline {
    display: block !important;
    width: fit-content !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* RICHCMX-INSTALL-CENTER-BULLETPROOF — position+transform method, immune to any parent layout quirks */
body.task-login #login-form {
    position: relative !important;
}
#richcmx-install-inline {
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    float: none !important;
    display: block !important;
    width: fit-content !important;
    margin: 0 0 20px 0 !important;
}

/* RICHCMX-FIX-SEND-BUTTON-TEXT */
body.task-mail #compose-buttons button,
body.task-mail #compose-buttons .btn,
body.task-mail .composeview button.mainaction,
body.task-mail button.send,
body.task-mail a.send {
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-indent: 0 !important;
    overflow: visible !important;
    white-space: nowrap !important;
    padding: 0 24px !important;
}
body.task-mail #compose-buttons button .inner,
body.task-mail button.send .inner {
    color: #ffffff !important;
    opacity: 1 !important;
    display: inline !important;
}

/* RICHCMX-RESTORE-SETTINGS-NAV */
body #taskmenu a.settings {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* RICHCMX-FIX-SEND-BUTTON-TEXT */
body.task-mail #compose-buttons button,
body.task-mail #compose-buttons .btn,
body.task-mail .composeview button.mainaction,
body.task-mail button.send,
body.task-mail a.send {
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-indent: 0 !important;
    overflow: visible !important;
    white-space: nowrap !important;
    padding: 0 24px !important;
}
body.task-mail #compose-buttons button .inner,
body.task-mail button.send .inner {
    color: #ffffff !important;
    opacity: 1 !important;
    display: inline !important;
}

/* RICHCMX-RESTORE-SETTINGS-NAV */
body #taskmenu a.settings {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* RICHCMX-REMOVE-LOGIN-SCROLLBAR */
body.task-login,
body.task-login html {
    overflow: hidden !important;
    height: 100% !important;
}
body.task-login {
    overflow-y: hidden !important;
}

/* RICHCMX-SEND-BUTTON-TEXT-FORCE-FINAL */
body.task-mail .composeview .footer button.mainaction,
body.task-mail .footer button.mainaction,
body.task-mail button.mainaction {
    font-size: 14px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-indent: 0 !important;
    white-space: nowrap !important;
    width: auto !important;
    min-width: 90px !important;
    padding: 0 20px !important;
}
body.task-mail .composeview .footer button.mainaction .inner,
body.task-mail button.mainaction .inner {
    font-size: 14px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
    display: inline !important;
    position: static !important;
    visibility: visible !important;
}

/* RICHCMX-SETTINGS-DESKTOP-FORCE-FINAL */
body #taskmenu .menu.toolbar a.settings,
body #taskmenu a.settings,
body.task-mail #taskmenu a.settings {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
    position: static !important;
}



/* RICHCMX-TERMINAL-INSTALL */
#richcmx-terminal-install-wrap {
    width: 100%;
    display: none;
    justify-content: center;
    margin: 18px 0 22px 0;
}
#richcmx-terminal-install-wrap.richcmx-visible {
    display: flex;
}

.richcmx-terminal-btn {
    position: relative;
    background: linear-gradient(180deg, rgba(15,0,0,0.95) 0%, rgba(30,4,4,0.98) 100%);
    border: 1px solid rgba(12,122,191,0.55);
    border-radius: 2px;
    padding: 14px 34px;
    cursor: pointer;
    overflow: hidden;
    box-shadow:
        0 0 8px rgba(12,122,191,0.35),
        0 0 24px rgba(12,122,191,0.15),
        inset 0 0 18px rgba(29,155,240,0.08);
    animation: richcmx-term-pulse 2.4s ease-in-out infinite;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.richcmx-terminal-btn:hover {
    transform: scale(1.02);
    box-shadow:
        0 0 14px rgba(0,255,120,0.55),
        0 0 40px rgba(0,255,120,0.25),
        inset 0 0 22px rgba(0,255,120,0.12);
    border-color: rgba(80,255,150,0.85);
}
.richcmx-terminal-btn:active {
    transform: scale(0.98);
}

/* scanline sweep overlay */
.richcmx-terminal-btn::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(80,255,150,0.9), transparent);
    animation: richcmx-scanline 2.6s linear infinite;
    z-index: 3;
}
/* static grain / noise texture */
.richcmx-terminal-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(255,255,255,0.025) 0px,
        rgba(255,255,255,0.025) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 2;
}

.richcmx-btn-text {
    position: relative;
    z-index: 4;
    display: block;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #baffcf;
    text-shadow:
        0 0 4px rgba(80,255,150,0.9),
        0 0 12px rgba(80,255,150,0.5);
    animation: richcmx-flicker 4s linear infinite;
}
.richcmx-btn-sub {
    position: relative;
    z-index: 4;
    display: block;
    margin-top: 4px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 9px;
    letter-spacing: 2px;
    color: rgba(56,189,248,0.75);
    text-transform: uppercase;
}

/* targeting-bracket corners */
.richcmx-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: rgba(26,111,181,0.85);
    z-index: 5;
}
.richcmx-corner.tl { top: 3px; left: 3px; border-top: 2px solid; border-left: 2px solid; }
.richcmx-corner.tr { top: 3px; right: 3px; border-top: 2px solid; border-right: 2px solid; }
.richcmx-corner.bl { bottom: 3px; left: 3px; border-bottom: 2px solid; border-left: 2px solid; }
.richcmx-corner.br { bottom: 3px; right: 3px; border-bottom: 2px solid; border-right: 2px solid; }

@keyframes richcmx-term-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(12,122,191,0.35), 0 0 24px rgba(12,122,191,0.15), inset 0 0 18px rgba(29,155,240,0.08); }
    50% { box-shadow: 0 0 14px rgba(12,122,191,0.55), 0 0 36px rgba(12,122,191,0.25), inset 0 0 24px rgba(29,155,240,0.14); }
}
@keyframes richcmx-scanline {
    0% { transform: translateY(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(48px); opacity: 0; }
}
@keyframes richcmx-flicker {
    0%, 92%, 100% { opacity: 1; }
    93% { opacity: 0.4; }
    94% { opacity: 1; }
    96% { opacity: 0.6; }
    97% { opacity: 1; }
}

/* RICHCMX-PW-EYE-AND-FOOTER */
.richcmx-pw-wrap {
    position: relative;
    display: block;
}
.richcmx-pw-wrap input[type="password"],
.richcmx-pw-wrap input[type="text"] {
    padding-right: 38px !important;
}
.richcmx-pw-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(56,189,248,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: color 0.15s ease;
}
.richcmx-pw-eye:hover {
    color: rgba(80,255,150,0.9);
}
.richcmx-pw-eye.richcmx-pw-visible {
    color: rgba(80,255,150,0.9);
}

#richcmx-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    text-align: center;
    padding: 10px 16px;
    background: rgba(10,2,2,0.85);
    border-top: 1px solid rgba(12,122,191,0.25);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 10px;
    letter-spacing: 0.5px;
    color: rgba(200,200,210,0.55);
}
.richcmx-footer-sep {
    margin: 0 8px;
    color: rgba(26,111,181,0.5);
}

/* RICHCMX-FIX-SEND-BTN-TEXT */
.btn.btn-primary.send,
button.btn.btn-primary.send,
a.btn.btn-primary.send,
#compose-toolbar .btn.btn-primary.send,
.formbuttons .btn.btn-primary.send {
    color: #ffffff !important;
    background: #0A82D9 !important;
    border-color: #0A82D9 !important;
    font-weight: 600 !important;
    text-shadow: none !important;
}
.btn.btn-primary.send:hover,
button.btn.btn-primary.send:hover {
    color: #ffffff !important;
    background: #0765A8 !important;
    border-color: #0765A8 !important;
}

/* RICHCMX-TYPING-SOUND-TOGGLE */
#richcmx-sound-toggle {
    position: fixed;
    bottom: 14px;
    right: 14px;
    z-index: 60;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10,2,2,0.85);
    border: 1px solid rgba(12,122,191,0.35);
    border-radius: 4px;
    color: rgba(200,200,210,0.7);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}
#richcmx-sound-toggle:hover {
    color: rgba(80,255,150,0.9);
    border-color: rgba(80,255,150,0.6);
}

/* RICHCMX-SETTINGS-VISIBLE-CONFIRMED-REAL */
#taskmenu a#rcmbtn108.settings {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    color: inherit !important;
}
#taskmenu a#rcmbtn108.settings .inner {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* RICHCMX-TASKMENU-OVERFLOW-FIX */
#taskmenu {
    overflow: visible !important;
    flex-wrap: nowrap !important;
    width: auto !important;
    min-width: max-content !important;
}
#taskmenu .special-buttons {
    overflow: visible !important;
    flex-shrink: 0 !important;
}
#layout-menu {
    overflow: visible !important;
    width: auto !important;
    min-width: max-content !important;
}

/* RICHCMX-SETTINGS-RESTORE-VERTICAL */
#taskmenu a#rcmbtn108.settings {
    display: block !important;
    width: 100% !important;
}
#taskmenu {
    flex-wrap: wrap !important;
    flex-direction: column !important;
}

/* RICHCMX-UNDO-TASKMENU-COLUMN-OVERRIDE */
#taskmenu {
    flex-direction: unset !important;
}

/* RICHCMX-NAV-FINAL-FIX */
/* Remove risky flex-wrap override from earlier attempts */
#taskmenu {
    flex-wrap: nowrap !important;
}

/* Hide duplicate folder shortcuts on desktop — folders already shown in sidebar */
@media (min-width: 769px) {
    #taskmenu .richcmx-folder-shortcuts {
        display: none !important;
    }
}

/* Settings — normal vertical icon, matches Compose/Mail/Contacts styling */
#taskmenu a#rcmbtn108.settings {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    padding: 10px 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* RICHCMX-HIDE-INSTALL-BUTTON-TEXT-ONLY */
#richcmx-install-btn {
    display: none !important;
}
body.task-login, body.task-login html { overflow-y: auto !important; -ms-overflow-style: none; scrollbar-width: none; }
body.task-login::-webkit-scrollbar, body.task-login html::-webkit-scrollbar { width: 0px; background: transparent; }

/* RICHCMX-MATRIX-RAIN */
#richcmx-rain{
    position:fixed;
    inset:0;
    z-index:0;
    opacity:.22;
    mix-blend-mode:screen;
    pointer-events:none;
}
body.task-login #layout{ position:relative; z-index:1; }


/* RICHCMX-LOGIN-BUTTON-GUARANTEED — covers every likely login submit selector */
body.task-login button.button.mainaction,
body.task-login button[type="submit"],
body.task-login #login-form button,
body.task-login input[type="submit"] {
    background: #0A82D9 !important;
    border-color: #0A82D9 !important;
    color: #ffffff !important;
}
body.task-login button.button.mainaction:hover,
body.task-login button[type="submit"]:hover,
body.task-login #login-form button:hover,
body.task-login input[type="submit"]:hover {
    background: #0765A8 !important;
    border-color: #0765A8 !important;
}


/* RICHCMX-BOOTSTRAP-ROOT-OVERRIDE — catches every default Bootstrap-blue
   element app-wide (toolbar icons, attach dropzone, toggles, links,
   focus rings) in one place, since Elastic is built on Bootstrap 5 */
:root {
    --bs-primary: #0A82D9 !important;
    --bs-primary-rgb: 217,63,10 !important;
    --bs-link-color: #0A82D9 !important;
    --bs-link-color-rgb: 217,63,10 !important;
    --bs-link-hover-color: #0765A8 !important;
    --bs-focus-ring-color: rgba(29,155,240,.25) !important;
    --bs-border-color-translucent: rgba(29,155,240,.3) !important;
}
.btn-primary, .btn-outline-primary:hover,
.text-primary, .border-primary, .bg-primary,
a, a:hover,
.dropzone, #compose-attachments .dropzone,
.custom-control-input:checked ~ .custom-control-label::before,
.form-check-input:checked {
    color: #0A82D9 !important;
    border-color: #0A82D9 !important;
}
.btn-primary, .bg-primary,
.custom-control-input:checked ~ .custom-control-label::before,
.form-check-input:checked {
    background-color: #0A82D9 !important;
}
.btn-primary:hover { background-color: #0765A8 !important; border-color: #0765A8 !important; }

/* RICHCMX-ABOUT-MODAL-FORCE — broad safety net covering every way the
   in-app About popup could be scoped, since it renders differently
   from the standalone about.html page */
.ui-dialog img, .popup img, .modal img, [class*="about"] img,
.ui-dialog-content img, dialog img, iframe.about-frame,
.about-content img, #about-dialog img {
    max-height: 60px !important;
    width: auto !important;
    display: block !important;
    margin: 0 auto 16px auto !important;
}
.ui-dialog, .ui-dialog-content, .modal-content, [class*="about"],
.ui-dialog-buttonpane {
    background: #05111A !important;
}
.ui-dialog h1, .ui-dialog h2, .ui-dialog h3,
.modal-content h1, .modal-content h2, .modal-content h3 {
    color: #ffffff !important;
}
/* catch any remaining blue SVG decoration (fill/stroke, not background) */
svg circle, svg path, svg line,
[class*="about"] svg * {
    fill: #0A82D9 !important;
    stroke: #0A82D9 !important;
}

/* RICHCMX-REMOVE-ABOUT-LINK — the framed About dialog has an unresolvable
   CSS-scoping bug (separate minimal wrapper template with no stylesheet
   link); removing the trigger rather than chase it further */
a.about, .about { display: none !important; }

/* ============================================================
   RICHCMX-MODERN-POLISH — pushing existing components toward the
   glassmorphism / gradient / rounded-pill direction as far as
   CSS on the current markup allows, without new HTML/JS
   ============================================================ */

/* warm ivory/blush atmosphere instead of stark white */
body.task-mail {
    background: linear-gradient(160deg, #F6FBFF 0%, #F0FAFF 50%, #E3F6FF 100%) !important;
}

/* glass panels — toolbar, sidebar, message list */
body.task-mail #layout-sidebar,
body.task-mail .header,
body.task-mail #messagelist-header,
body.task-mail #messagetoolbar {
    background: rgba(245,251,255,0.75) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-radius: 18px !important;
    border: 1px solid rgba(29,155,240,0.12) !important;
    box-shadow: 0 4px 24px rgba(29,155,240,0.06) !important;
}

/* rounder, softer everything */
.btn, .form-control, input, textarea, select,
.listing, .message-list li, .boxfooter,
#compose-attachments .dropzone {
    border-radius: 14px !important;
}

/* primary actions get the signature gradient */
.btn-primary, button[type="submit"], .btn.send, .btn-primary.send {
    background: linear-gradient(135deg, #FF3FA4 0%, #30BBFF 45%, #1896FF 100%) !important;
    border: none !important;
    box-shadow: 0 6px 20px rgba(29,155,240,0.35) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}
.btn-primary:hover, button[type="submit"]:hover, .btn.send:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 28px rgba(29,155,240,0.5) !important;
}

/* message list rows — soft glass cards instead of flat lines */
body.task-mail .messagelist tr,
body.task-mail .messagelist > li {
    background: rgba(255,255,255,0.6) !important;
    border-radius: 12px !important;
    margin-bottom: 4px !important;
    transition: box-shadow 0.15s ease, transform 0.15s ease !important;
}
body.task-mail .messagelist tr:hover,
body.task-mail .messagelist > li:hover {
    box-shadow: 0 4px 16px rgba(29,155,240,0.15) !important;
    transform: translateY(-1px) !important;
}
body.task-mail .messagelist tr.unread,
body.task-mail .messagelist > li.unread {
    background: rgba(224,240,255,0.6) !important;
    box-shadow: 0 0 0 1px rgba(29,155,240,0.15) inset !important;
}

/* recipient chips + toggles already orange — give them the gradient too */
.recipient-input li.recipient {
    background: linear-gradient(135deg, #E3F6FF, #B5DEFF) !important;
    border-radius: 20px !important;
}

/* subtle glow orbs behind the layout, atmospheric not distracting */
body.task-mail #layout::before {
    content: '';
    position: fixed;
    top: -10%; right: -5%;
    width: 40vw; height: 40vw;
    background: radial-gradient(circle, rgba(56,189,248,0.10), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================================
   RICHCMX-ICON-TOGGLE-MODERNIZE — toggles, plus/add buttons,
   avatars, checkboxes, generic icon buttons
   ============================================================ */

/* toggle switches — bigger, smoother, gradient when on */
.custom-switch .custom-control-label::before,
input[type="checkbox"].toggle,
.pretty-toggle {
    border-radius: 20px !important;
    transition: background 0.2s ease !important;
}
.custom-control-input:checked ~ .custom-control-label::before {
    background: linear-gradient(135deg, #FF3FA4, #1896FF) !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(29,155,240,0.4) !important;
}
.custom-control-label::after {
    box-shadow: 0 1px 4px rgba(0,0,0,0.15) !important;
}

/* plus / add buttons — circular gradient */
button[title*="Add" i], a[title*="Add" i],
.btn-icon, .toolbar a.add, #contact-add,
button.add, a.add, .compose-attach-btn {
    border-radius: 50% !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}
button[title*="Add" i]:hover, a[title*="Add" i]:hover {
    background: linear-gradient(135deg, #FF3FA4, #1896FF) !important;
    color: #fff !important;
    transform: scale(1.08) !important;
    box-shadow: 0 4px 14px rgba(29,155,240,0.4) !important;
}

/* generic toolbar icon buttons — soft rounded hover state */
.toolbar a, .toolbar button,
#toolbar-menu a, .listing-actions a {
    border-radius: 10px !important;
    transition: background 0.15s ease, transform 0.1s ease !important;
}
.toolbar a:hover, .toolbar button:hover {
    background: rgba(29,155,240,0.08) !important;
    transform: translateY(-1px) !important;
}

/* avatars / sender identity circles — gradient ring */
.contact-photo, .avatar, img.photo,
[class*="avatar"], [class*="contact-photo"] {
    border-radius: 50% !important;
    box-shadow: 0 0 0 2px rgba(56,189,248,0.25) !important;
}
.richcmx-avatar {
    border-radius: 50% !important;
    background: linear-gradient(135deg, #FF3FA4, #30BBFF, #1896FF) !important;
    box-shadow: 0 2px 8px rgba(29,155,240,0.3) !important;
}

/* checkboxes */
input[type="checkbox"] {
    accent-color: #30BBFF !important;
}

/* select dropdowns — rounder, softer border */
select.form-control, .custom-select {
    border-radius: 12px !important;
    border-color: rgba(29,155,240,0.2) !important;
}

/* RICHCMX-RECIPIENT-FLOW-FORCE */
body.task-mail.action-compose .recipient-input,
body.task-mail.action-compose ul.recipient-input,
body.task-mail [data-recipient-input] {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 4px !important;
}
body.task-mail.action-compose .recipient-input li,
body.task-mail.action-compose .recipient-input li.recipient {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    margin: 2px !important;
}

/* RICHCMX-MODAL-MODERNIZE — the plain "Are you sure..." style confirm
   dialogs were never touched by any previous pass; bring them in line */
.ui-dialog, .jquery-modal, .popup-dialog,
div[role="dialog"], .prompt-dialog {
    border-radius: 18px !important;
    border: none !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2) !important;
    overflow: hidden !important;
}
.ui-dialog-titlebar, .prompt-dialog .header,
div[role="dialog"] .header {
    background: linear-gradient(135deg, #0C7ABF, #1D9BF0) !important;
    color: #fff !important;
    border: none !important;
    padding: 16px 20px !important;
}
.ui-dialog .button, .prompt-dialog button, div[role="dialog"] button,
.ui-dialog-buttonpane button {
    border-radius: 12px !important;
    padding: 8px 20px !important;
    border: none !important;
    font-weight: 600 !important;
}
.ui-dialog .button.mainaction, .prompt-dialog button.mainaction,
div[role="dialog"] button.mainaction,
button[class*="discard"], button[class*="delete"] {
    background: linear-gradient(135deg, #1D9BF0, #38BDF8) !important;
    color: #fff !important;
}
.ui-dialog .button:not(.mainaction), .prompt-dialog button:not(.mainaction),
div[role="dialog"] button:not(.mainaction) {
    background: #EAF7FF !important;
    color: #0C7ABF !important;
}

/* RICHCMX-COOKIE-NOTICE */
#richcmx-cookie-notice {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 480px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(255,255,255,0.92) !important;
    backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(29,155,240,0.2) !important;
    border-radius: 16px !important;
    padding: 14px 18px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15) !important;
    font-size: 13px !important;
    color: #102A56 !important;
    z-index: 9999;
}
#richcmx-cookie-accept {
    background: linear-gradient(135deg, #0C7ABF, #38BDF8) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 8px 18px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}

/* RICHCMX-TOOLBAR-MODERNIZE — real selectors confirmed from mail-menu.html */
#mailtoolbar {
    background: rgba(255,255,255,0.7) !important;
    backdrop-filter: blur(12px) !important;
    border-radius: 16px !important;
    padding: 8px !important;
    gap: 4px !important;
    box-shadow: 0 4px 20px rgba(29,155,240,0.08) !important;
}
#mailtoolbar a, #mailtoolbar .reply, #mailtoolbar .reply-all,
#mailtoolbar .forward, #mailtoolbar .delete, #mailtoolbar .print,
#mailtoolbar .markmessage, #mailtoolbar .more,
#mailtoolbar .prev, #mailtoolbar .next {
    border-radius: 12px !important;
    transition: background 0.15s ease, transform 0.1s ease !important;
}
#mailtoolbar a:hover {
    background: rgba(29,155,240,0.1) !important;
    transform: translateY(-1px) !important;
}
#mailtoolbar .delete:hover {
    background: rgba(255,60,60,0.1) !important;
}

/* RICHCMX-POPUP-CLOSE-FIX — Roundcube core injects a mobile close
   button into popupmenus at runtime; force visible contrast
   regardless of where exactly it comes from */
.popupmenu .close, .popupmenu button.close,
.popupmenu [class*="close"], div[role="dialog"] .close {
    background: #ffffff !important;
    color: #0C7ABF !important;
    border: 1px solid rgba(29,155,240,0.3) !important;
    border-radius: 10px !important;
}

/* ============================================================
   RICHCMX-MOBILE-ACTION-SHEET — the touch/mobile popup menu
   (Reply/Forward/Delete/etc slide-up sheet) is core Roundcube
   JS-generated markup, not present in any static template file.
   Using broad structural targeting since exact class names can't
   be confirmed from a phone without dev tools.
   ============================================================ */
@media (max-width: 768px) {
  /* the header/close bar — every plausible structural pattern at once */
  .popupmenu > .header,
  .popupmenu > *:first-child,
  div[role="dialog"] > .header,
  div[role="dialog"] > *:first-child,
  .uidialog > .header,
  .ui-dialog > .header {
    background: linear-gradient(135deg, #0C7ABF, #1D9BF0) !important;
    color: #ffffff !important;
  }
  .popupmenu > .header *, .popupmenu > *:first-child *,
  div[role="dialog"] > .header *, div[role="dialog"] > *:first-child *,
  .uidialog > .header *, .ui-dialog > .header * {
    color: #ffffff !important;
    fill: #ffffff !important;
    opacity: 1 !important;
  }

  /* modernize the sheet itself — rounded top, softer surface */
  .popupmenu, div[role="dialog"], .uidialog {
    border-radius: 20px 20px 0 0 !important;
    overflow: hidden !important;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.15) !important;
  }
  .popupmenu ul.menu, .popupmenu ul.listing {
    background: #ffffff !important;
  }
  .popupmenu ul.menu li, .popupmenu ul.listing li,
  .popupmenu ul.menu a, .popupmenu ul.listing a {
    padding: 14px 20px !important;
    border-bottom: 1px solid rgba(29,155,240,0.08) !important;
    transition: background 0.15s ease !important;
  }
  .popupmenu ul.menu a:active, .popupmenu ul.listing a:active {
    background: rgba(29,155,240,0.08) !important;
  }
  .popupmenu ul.menu a.disabled, .popupmenu ul.listing a.disabled {
    opacity: 0.4 !important;
  }
}

/* RICHCMX-QUICK-DELETE — small trash icon on each message row */
.messagelist tr, .messagelist > li { position: relative !important; }
.richcmx-quick-delete {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: rgba(255,60,60,0.08) !important;
    color: #C0392B !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    opacity: 0 !important;
    transition: opacity 0.15s ease, background 0.15s ease !important;
    z-index: 5 !important;
}
.messagelist tr:hover .richcmx-quick-delete,
.messagelist > li:hover .richcmx-quick-delete,
.richcmx-quick-delete { opacity: 0.7 !important; }
.richcmx-quick-delete:hover { background: rgba(255,60,60,0.2) !important; opacity: 1 !important; }
@media (max-width: 768px) {
  .richcmx-quick-delete { opacity: 0.6 !important; }
}

/* ============================================================
   RICH CMX BETA — LOGIN REDESIGN
   Blue glass intelligence-facility aesthetic. Isolated to
   richcmx-beta skin only, safe for real users.
   ============================================================ */

body.task-login {
    background:
        radial-gradient(circle at 20% 20%, rgba(0,191,255,0.12), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(20,107,255,0.15), transparent 50%),
        linear-gradient(160deg, #061B3A 0%, #08254D 50%, #0B3063 100%) !important;
    position: relative !important;
    overflow: hidden !important;
}

#richcmx-matrix-canvas {
    position: fixed !important;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0 !important;
    opacity: 0.35 !important;
    pointer-events: none !important;
}

body.task-login #layout-content {
    position: relative !important;
    z-index: 2 !important;
}

body.task-login #logo {
    filter: drop-shadow(0 0 24px rgba(0,191,255,0.5)) !important;
}

body.task-login #login-form {
    background: rgba(15,35,70,0.55) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(0,191,255,0.3) !important;
    border-radius: 24px !important;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.05) inset,
        0 20px 60px rgba(0,0,0,0.4),
        0 0 40px rgba(0,191,255,0.1) !important;
    padding: 28px !important;
}

body.task-login #login-form input {
    background: rgba(255,255,255,0.06) !important;
    border: 1px solid rgba(0,191,255,0.25) !important;
    border-radius: 14px !important;
    color: #F5FBFF !important;
    padding: 14px 18px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}
body.task-login #login-form input:focus {
    border-color: rgba(0,191,255,0.7) !important;
    box-shadow: 0 0 0 3px rgba(0,191,255,0.15) !important;
    outline: none !important;
}
body.task-login #login-form input::placeholder {
    color: rgba(245,251,255,0.4) !important;
}

body.task-login button[type="submit"],
body.task-login .richcmx-terminal-btn {
    background: linear-gradient(135deg, #146BFF, #00BFFF) !important;
    border: none !important;
    border-radius: 14px !important;
    color: #fff !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    box-shadow: 0 8px 24px rgba(0,191,255,0.35) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}
body.task-login button[type="submit"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 32px rgba(0,191,255,0.5) !important;
}

/* HUD status strip — SYSTEM READY / SECURE SESSION style, honest labels only */
#richcmx-hud-strip {
    position: fixed !important;
    bottom: 16px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    gap: 24px !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 11px !important;
    letter-spacing: 0.08em !important;
    color: rgba(0,191,255,0.6) !important;
    z-index: 3 !important;
}
#richcmx-hud-strip span::before {
    content: '● ';
    color: #00E5FF;
}

/* ============================================================
   RICH CMX BETA — INBOX REDESIGN
   Floating glass email cards, blue glow atmosphere.
   Isolated to richcmx-beta skin only.
   ============================================================ */

body.task-mail {
    background:
        radial-gradient(circle at 10% 10%, rgba(0,191,255,0.06), transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(20,107,255,0.08), transparent 40%),
        #F5FBFF !important;
}

body.task-mail #layout-sidebar,
body.task-mail .header,
body.task-mail #messagelist-header,
#mailtoolbar {
    background: rgba(255,255,255,0.7) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(0,191,255,0.15) !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 32px rgba(20,107,255,0.08) !important;
}

/* floating email cards instead of flat rows */
body.task-mail .messagelist tr,
body.task-mail .messagelist > li {
    background: rgba(255,255,255,0.85) !important;
    border: 1px solid rgba(0,191,255,0.1) !important;
    border-radius: 16px !important;
    margin: 6px 8px !important;
    box-shadow: 0 2px 12px rgba(20,107,255,0.05) !important;
    transition: all 0.2s ease !important;
}
body.task-mail .messagelist tr:hover,
body.task-mail .messagelist > li:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(0,191,255,0.15) !important;
    border-color: rgba(0,191,255,0.3) !important;
}

/* unread — cyan edge glow, not giant effects */
body.task-mail .messagelist tr.unread,
body.task-mail .messagelist > li.unread {
    background: rgba(230,248,255,0.9) !important;
    border-left: 3px solid #00BFFF !important;
    box-shadow: 0 0 0 1px rgba(0,191,255,0.15), 0 2px 12px rgba(0,191,255,0.1) !important;
}
body.task-mail .messagelist tr.unread .subject,
body.task-mail .messagelist > li.unread .subject {
    font-weight: 700 !important;
    color: #08254D !important;
}

/* sender avatars — soft ring */
body.task-mail .messagelist .contact-photo,
body.task-mail [class*="avatar"] {
    border-radius: 50% !important;
    box-shadow: 0 0 0 2px rgba(0,191,255,0.25) !important;
}

/* toolbar buttons */
#mailtoolbar a {
    border-radius: 12px !important;
    transition: background 0.15s ease, transform 0.1s ease !important;
}
#mailtoolbar a:hover {
    background: rgba(0,191,255,0.1) !important;
    transform: translateY(-1px) !important;
}

/* primary action buttons — electric blue to cyan */
body.task-mail .btn-primary, body.task-mail button[type="submit"] {
    background: linear-gradient(135deg, #146BFF, #00BFFF) !important;
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 6px 20px rgba(0,191,255,0.3) !important;
}

/* ============================================================
   RICH CMX BETA — COMPOSE REDESIGN
   Floating glass communication panel.
   ============================================================ */

body.task-mail.action-compose #layout-content {
    background: transparent !important;
}

body.task-mail.action-compose #composeview,
body.task-mail.action-compose .compose-container {
    background: rgba(255,255,255,0.85) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(0,191,255,0.15) !important;
    border-radius: 24px !important;
    box-shadow: 0 20px 60px rgba(20,107,255,0.1) !important;
    margin: 12px !important;
}

body.task-mail.action-compose input.form-control,
body.task-mail.action-compose textarea.form-control,
body.task-mail.action-compose #compose-subject,
body.task-mail.action-compose .recipient-input {
    background: rgba(245,251,255,0.8) !important;
    border: 1px solid rgba(0,191,255,0.15) !important;
    border-radius: 14px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}
body.task-mail.action-compose input.form-control:focus,
body.task-mail.action-compose textarea.form-control:focus,
body.task-mail.action-compose #compose-subject:focus {
    border-color: rgba(0,191,255,0.5) !important;
    box-shadow: 0 0 0 3px rgba(0,191,255,0.1) !important;
    outline: none !important;
}

/* recipient chips — blue glass pills */
body.task-mail.action-compose .recipient-input li.recipient {
    background: linear-gradient(135deg, rgba(0,191,255,0.15), rgba(20,107,255,0.15)) !important;
    border: 1px solid rgba(0,191,255,0.3) !important;
    color: #08254D !important;
    border-radius: 20px !important;
    padding: 4px 12px !important;
}

/* attachment dropzone — glass, glowing on hover */
#compose-attachments .dropzone {
    background: rgba(245,251,255,0.6) !important;
    border: 2px dashed rgba(0,191,255,0.3) !important;
    border-radius: 18px !important;
    transition: border-color 0.2s ease, background 0.2s ease !important;
}
#compose-attachments .dropzone:hover {
    border-color: rgba(0,191,255,0.6) !important;
    background: rgba(0,191,255,0.05) !important;
}

/* send button — the signature gradient, satisfying press */
body.task-mail.action-compose .btn.send,
body.task-mail.action-compose .btn-primary.send {
    background: linear-gradient(135deg, #146BFF, #00BFFF) !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 14px 36px !important;
    font-weight: 700 !important;
    letter-spacing: 0.03em !important;
    box-shadow: 0 8px 24px rgba(0,191,255,0.35) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}
body.task-mail.action-compose .btn.send:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 12px 32px rgba(0,191,255,0.5) !important;
}
body.task-mail.action-compose .btn.send:active {
    transform: scale(0.97) !important;
}

/* options panel — matching glass treatment */
#composeview .compose-options,
.formcontent {
    background: rgba(245,251,255,0.6) !important;
    border-radius: 18px !important;
}

/* toggles */
.custom-control-input:checked ~ .custom-control-label::before {
    background: linear-gradient(135deg, #146BFF, #00BFFF) !important;
    border-color: transparent !important;
}

/* RICH CMX BETA — keep-logged-in label needs white text on the dark login bg */
body.task-login .custom-control-label,
body.task-login label {
    color: #F5FBFF !important;
}

/* RICH CMX BETA — keep-logged-in label needs white text on the dark login bg */
body.task-login .custom-control-label,
body.task-login label {
    color: #F5FBFF !important;
}

/* ============================================================
   RICH CMX BETA — MESSAGE READING VIEW
   Calm glass reading environment, contextual actions.
   ============================================================ */

body.task-mail.action-show #messagecontent,
body.task-mail #message-objects {
    background: rgba(255,255,255,0.9) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(0,191,255,0.12) !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 32px rgba(20,107,255,0.06) !important;
    padding: 24px !important;
    max-width: 760px !important;
    margin: 16px auto !important;
}

/* sender identity card at top of the message */
.message-partheaders, #messageheader {
    border-bottom: 1px solid rgba(0,191,255,0.1) !important;
    padding-bottom: 16px !important;
    margin-bottom: 16px !important;
}
.message-partheaders .contact-photo,
#messageheader .contact-photo {
    border-radius: 50% !important;
    box-shadow: 0 0 0 2px rgba(0,191,255,0.25) !important;
}

/* comfortable reading typography */
.message-part, .message-htmlpart {
    font-size: 15px !important;
    line-height: 1.65 !important;
    color: #08254D !important;
}

/* attachment cards instead of plain filename links */
#attachment-list li, .attachmentslist li {
    background: rgba(245,251,255,0.7) !important;
    border: 1px solid rgba(0,191,255,0.15) !important;
    border-radius: 14px !important;
    padding: 10px 14px !important;
    margin: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: box-shadow 0.15s ease, transform 0.15s ease !important;
}
#attachment-list li:hover, .attachmentslist li:hover {
    box-shadow: 0 4px 14px rgba(0,191,255,0.15) !important;
    transform: translateY(-1px) !important;
}

/* contextual toolbar, not a giant traditional one */
body.task-mail.action-show #mailtoolbar,
body.task-mail.action-show .toolbar {
    background: rgba(255,255,255,0.6) !important;
    backdrop-filter: blur(16px) !important;
    border-radius: 16px !important;
    padding: 6px !important;
    max-width: 760px !important;
    margin: 0 auto 8px auto !important;
    box-shadow: 0 4px 16px rgba(20,107,255,0.06) !important;
}

/* ============================================================
   RICH CMX BETA — MESSAGE-LIST HEADER TOOLBAR
   Select / Threads / Options / Refresh / Search / pagination —
   a genuinely separate toolbar from the reply/forward one, never
   styled until now.
   ============================================================ */
#messagelist-header, .listing-toolbar, .pagenav {
    background: rgba(255,255,255,0.7) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-radius: 16px !important;
    padding: 6px 10px !important;
    box-shadow: 0 4px 16px rgba(20,107,255,0.06) !important;
    border: 1px solid rgba(0,191,255,0.1) !important;
}
#messagelist-header a, #messagelist-header button,
.listing-toolbar a, .pagenav a {
    border-radius: 10px !important;
    transition: background 0.15s ease !important;
}
#messagelist-header a:hover, .listing-toolbar a:hover, .pagenav a:hover {
    background: rgba(0,191,255,0.1) !important;
}
#quicksearchbox, input[type="search"] {
    background: rgba(245,251,255,0.8) !important;
    border: 1px solid rgba(0,191,255,0.2) !important;
    border-radius: 20px !important;
}

/* RICH CMX BETA — restore-from-trash quick action */
.richcmx-restore {
    position: absolute !important;
    right: 48px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: rgba(0,191,255,0.1) !important;
    color: #146BFF !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    opacity: 0.7 !important;
    transition: opacity 0.15s ease, background 0.15s ease !important;
    z-index: 5 !important;
}
.richcmx-restore:hover { background: rgba(0,191,255,0.25) !important; opacity: 1 !important; }

/* RICH CMX BETA — any notice/warning banner (draft, remote-content, etc) */
.notice, .boxwarning, .messagelist-notice, [class*="notice"] {
    color: #08254D !important;
    background: rgba(230,248,255,0.9) !important;
}
.notice a, .boxwarning a, [class*="notice"] a {
    color: #146BFF !important;
    font-weight: 600 !important;
}

/* RICH CMX BETA — stronger, clearly visible glass on the real header */
#messagelist-header.header {
    background: linear-gradient(135deg, rgba(20,107,255,0.08), rgba(0,191,255,0.05)) !important;
    border: 1px solid rgba(0,191,255,0.25) !important;
    border-radius: 16px !important;
    margin: 8px !important;
    box-shadow: 0 4px 20px rgba(20,107,255,0.12) !important;
}
#messagelist-header .toolbar.menu a {
    border-radius: 10px !important;
    padding: 6px 12px !important;
}
#messagelist-header .toolbar.menu a:hover {
    background: rgba(0,191,255,0.15) !important;
}
#messagelist-header .toolbar-button.refresh {
    color: #146BFF !important;
}

/* RICH CMX BETA — restore icon must be visually distinct from delete (was both blue) */
.richcmx-restore {
    background: rgba(16,185,129,0.12) !important;
    color: #10B981 !important;
}
.richcmx-restore:hover {
    background: rgba(16,185,129,0.25) !important;
}

/* RICH CMX BETA — force-hide the native checkbox inside any custom-switch,
   fixing the doubled toggle appearance in compose options */
body.task-mail .custom-switch input.custom-control-input {
    opacity: 0 !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
}
body.task-mail .custom-switch .custom-control-label::before,
body.task-mail .custom-switch .custom-control-label::after {
    display: block !important;
}

/* also modernize the whole options/attachments panel while we're here */
#composeview .compose-options .row {
    padding: 8px 4px !important;
    border-bottom: 1px solid rgba(0,191,255,0.06) !important;
}
#composeview .compose-options label {
    font-size: 14px !important;
    color: #08254D !important;
}

/* ============================================================
   RICH CMX BETA — SETTINGS + CONTACTS REDESIGN
   Category cards, glass panels, consistent with the rest.
   ============================================================ */

body.task-settings, body.task-addressbook {
    background:
        radial-gradient(circle at 10% 10%, rgba(0,191,255,0.05), transparent 40%),
        #F5FBFF !important;
}

body.task-settings #layout-sidebar,
body.task-addressbook #layout-sidebar,
body.task-settings .header,
body.task-addressbook .header {
    background: linear-gradient(135deg, rgba(20,107,255,0.08), rgba(0,191,255,0.05)) !important;
    border: 1px solid rgba(0,191,255,0.15) !important;
    border-radius: 16px !important;
    margin: 8px !important;
    box-shadow: 0 4px 16px rgba(20,107,255,0.08) !important;
}

/* settings menu items — as category cards */
body.task-settings #settings-menu li,
body.task-settings .listing li {
    border-radius: 12px !important;
    margin: 3px 6px !important;
    transition: background 0.15s ease !important;
}
body.task-settings #settings-menu li a,
body.task-settings .listing li a {
    padding: 12px 14px !important;
    border-radius: 12px !important;
}
body.task-settings #settings-menu li.selected a,
body.task-settings .listing li.selected a {
    background: linear-gradient(135deg, rgba(20,107,255,0.15), rgba(0,191,255,0.1)) !important;
    color: #08254D !important;
    font-weight: 600 !important;
    box-shadow: inset 0 0 0 1px rgba(0,191,255,0.25) !important;
}
body.task-settings #settings-menu li a:hover,
body.task-settings .listing li a:hover {
    background: rgba(0,191,255,0.08) !important;
}

/* main content panel — floating glass card */
body.task-settings #preferences-details,
body.task-settings .propform,
body.task-addressbook #contact-details,
body.task-addressbook .contactfieldgroup {
    background: rgba(255,255,255,0.85) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(0,191,255,0.12) !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 32px rgba(20,107,255,0.06) !important;
    padding: 20px !important;
    margin: 12px !important;
}

/* section titles */
body.task-settings h1, body.task-settings h2,
body.task-addressbook h1, body.task-addressbook h2 {
    color: #08254D !important;
    font-weight: 700 !important;
}

/* contact list — avatar cards */
body.task-addressbook .listing li {
    border-radius: 14px !important;
    margin: 4px 6px !important;
    transition: box-shadow 0.15s ease, transform 0.15s ease !important;
}
body.task-addressbook .listing li:hover {
    box-shadow: 0 4px 16px rgba(0,191,255,0.12) !important;
    transform: translateY(-1px) !important;
}
body.task-addressbook .contact-photo,
body.task-addressbook [class*="avatar"] {
    border-radius: 50% !important;
    box-shadow: 0 0 0 2px rgba(0,191,255,0.25) !important;
}

/* form fields consistent with compose/login */
body.task-settings input.form-control,
body.task-settings select.form-control,
body.task-addressbook input.form-control {
    background: rgba(245,251,255,0.8) !important;
    border: 1px solid rgba(0,191,255,0.15) !important;
    border-radius: 12px !important;
}
body.task-settings input.form-control:focus,
body.task-addressbook input.form-control:focus {
    border-color: rgba(0,191,255,0.5) !important;
    box-shadow: 0 0 0 3px rgba(0,191,255,0.1) !important;
    outline: none !important;
}

/* save/primary buttons consistent with the rest */
body.task-settings .btn-primary, body.task-settings button[type="submit"],
body.task-addressbook .btn-primary, body.task-addressbook button[type="submit"] {
    background: linear-gradient(135deg, #146BFF, #00BFFF) !important;
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 6px 20px rgba(0,191,255,0.3) !important;
}

/* RICH CMX BETA — FINAL settings-icon fix, class-only (not the
   fragile auto-generated #rcmbtn108 ID, which may not match this
   context at all) — appended last so it wins the cascade */
#taskmenu {
    flex-wrap: nowrap !important;
    flex-direction: row !important;
}
#taskmenu a.settings {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    padding: 10px 8px !important;
}

/* RICH CMX BETA — Settings gets its own guaranteed-visible icon,
   independent of whatever base icon-font may be missing this glyph */
#taskmenu a.settings::before {
    content: '' !important;
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23146BFF' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E") !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    margin-bottom: 2px !important;
}

/* RICH CMX BETA — simple guaranteed-visible settings link, sidestepping
   the icon-rail mystery entirely */
.richcmx-settings-link {
    color: #146BFF !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    padding: 6px 12px !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
}
.richcmx-settings-link:hover {
    background: rgba(0,191,255,0.1) !important;
}

/* RICH CMX BETA — move the sound-toggle speaker off the pencil/edit icon */
#richcmx-sound-toggle {
    right: 20px !important;
    bottom: 70px !important;
}
