/* SparkMail: Gmail-style look for Elastic */
:root {
    --sm-bg: #F6F8FC;
    --sm-card: #FFFFFF;
    --sm-text: #1F1F1F;
    --sm-text-2: #444746;
    --sm-text-3: #5E5E5E;
    --sm-line: #ECEFF3;
    --sm-search: #E9EEF6;
    --sm-nav-sel: #D3E3FD;
    --sm-nav-sel-text: #001D35;
    --sm-compose: #C2E7FF;
    --sm-compose-text: #001D35;
    --sm-row-read: #F2F6FC;
    --sm-row-hover-shadow: inset 1px 0 0 #DADCE0, inset -1px 0 0 #DADCE0, 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
    --sm-row-sel: #C2DBFF;
    --sm-chip-border: #C4C7C5;
    --sm-primary: #0B57D0;
    --sm-font: Roboto, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
html.dark-mode {
    --sm-bg: #111316;
    --sm-card: #1B1D21;
    --sm-text: #E3E3E3;
    --sm-text-2: #C4C7C5;
    --sm-text-3: #A8ABAF;
    --sm-line: #2C2F33;
    --sm-search: #282A2E;
    --sm-nav-sel: #004A77;
    --sm-nav-sel-text: #C2E7FF;
    --sm-compose: #004A77;
    --sm-compose-text: #C2E7FF;
    --sm-row-read: #16181B;
    --sm-row-hover-shadow: 0 1px 3px rgba(0,0,0,.6);
    --sm-row-sel: #1F3A5F;
    --sm-chip-border: #44474A;
    --sm-primary: #A8C7FA;
}

/* ---------- loading screen ---------- */
#sm-splash {
    position: fixed; inset: 0; z-index: 100000; display: none;
    background: var(--sm-card); color: var(--sm-text); font-family: var(--sm-font);
    align-items: center; justify-content: center; flex-direction: column;
    transition: opacity .3s ease;
}
#sm-splash.sm-show { display: flex; }
#sm-splash.sm-hide { opacity: 0; }
#sm-splash .sm-splash-inner { display: flex; flex-direction: column; align-items: center; gap: 28px; }
#sm-splash .sm-bar { width: 220px; height: 4px; border-radius: 2px; background: var(--sm-line); overflow: hidden; }
#sm-splash .sm-bar span { display: block; width: 40%; height: 4px; border-radius: 2px; animation: sm-slide 1.4s ease-in-out infinite; }
#sm-splash .sm-splash-text { font-size: 16px; margin-bottom: -22px; }
#sm-splash .sm-splash-domain { font-size: 13px; color: var(--sm-text-3); }
#sm-splash .sm-splash-foot { position: absolute; left: 0; right: 0; bottom: 32px; display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 12px; color: var(--sm-text-3); }
@keyframes sm-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { #sm-splash .sm-bar span { animation: none; transform: translateX(60%); } }

/* brand mark: logo or letter tile */
.sm-logo { display: inline-flex; align-items: center; }
.sm-logo img { display: block; width: auto; object-fit: contain; }
.sm-logo-lg img { height: 120px; max-width: 360px; }
.sm-logo-sm img { height: 36px; max-width: 150px; }
.sm-logo-dark { background: #0B1120; border-radius: 10px; padding: 6px 10px; }
html.dark-mode .sm-logo:not(.sm-logo-dark) { background: #FFFFFF; border-radius: 10px; padding: 4px 8px; }
.sm-mono { display: inline-flex; align-items: center; gap: 12px; }
.sm-mono-tile { display: inline-flex; align-items: center; justify-content: center; color: #FFFFFF; font-weight: 700; }
.sm-mono-lg .sm-mono-tile { width: 88px; height: 88px; border-radius: 22px; font-size: 44px; }
.sm-mono-lg .sm-mono-name { font-size: 34px; font-weight: 500; letter-spacing: -.5px; }
.sm-mono-sm .sm-mono-tile { width: 32px; height: 32px; border-radius: 8px; font-size: 17px; }
.sm-mono-sm .sm-mono-name { font-size: 18px; font-weight: 500; color: var(--sm-text); white-space: nowrap; }

/* ---------- login page ---------- */
body.task-login { background: var(--sm-bg) !important; font-family: var(--sm-font); }
body.task-login #layout-content { background: transparent !important; }
body.task-login #logo { display: none !important; }
body.task-login #login-form {
    background: var(--sm-card); border-radius: 28px; padding: 40px 40px 28px;
    box-shadow: 0 1px 2px rgba(60,64,67,.12), 0 2px 6px rgba(60,64,67,.08);
    width: 100%; max-width: 420px; box-sizing: border-box;
}
body.task-login .sm-login-brand { display: flex; justify-content: center; margin: 0 0 24px; }
body.task-login .sm-login-brand .sm-logo img { height: 72px; max-width: 260px; }
body.task-login .sm-login-title { text-align: center; font-size: 24px; font-weight: 400; margin: 0 0 6px; color: var(--sm-text); }
body.task-login .sm-login-sub { text-align: center; font-size: 14px; color: var(--sm-text-2); margin: 0 0 24px; }
body.task-login #login-form button.mainaction,
body.task-login #login-form .btn-primary {
    background: var(--sm-primary) !important; border-color: var(--sm-primary) !important; color: #FFFFFF !important;
    border-radius: 20px !important; height: 44px; font-weight: 500;
}
html.dark-mode body.task-login #login-form .btn-primary { color: #062E6F !important; }
body.task-login #login-form table { width: 100%; border-collapse: collapse; margin: 0; }
body.task-login #login-form table td { display: block; width: 100%; padding: 0; border: 0; }
body.task-login #login-form td.title { display: none !important; }
body.task-login #login-form td.input { padding: 0 0 16px !important; }
body.task-login #login-form .input-group { display: block; position: relative; width: 100%; }
body.task-login #login-form .input-group-prepend,
body.task-login #login-form .input-group-append { display: none !important; }
body.task-login #login-form .form-control,
body.task-login #login-form .input-group > .form-control {
    display: block; width: 100% !important; height: 56px; box-sizing: border-box;
    padding: 0 16px; margin: 0;
    font: 400 16px/1.5 var(--sm-font); color: var(--sm-text);
    background: var(--sm-card) !important;
    border: 1px solid #747775 !important; border-radius: 8px !important;
    box-shadow: none !important; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
body.task-login #login-form .form-control::placeholder { color: var(--sm-text-3); opacity: 1; }
body.task-login #login-form .form-control:hover { border-color: var(--sm-text) !important; }
body.task-login #login-form .form-control:focus {
    border-color: var(--sm-primary) !important;
    box-shadow: inset 0 0 0 1px var(--sm-primary) !important;
}
html.dark-mode body.task-login #login-form .form-control { border-color: #8E918F !important; }
body.task-login #login-form .formbuttons { margin: 8px 0 0; padding: 0; text-align: center; }
body.task-login #login-form button.mainaction { width: 100%; height: 48px; margin: 0; font-size: 15px; letter-spacing: .2px; text-transform: none; }
body.task-login #login-footer { display: none; }

/* ---------- top bar (desktop) ---------- */
#sm-topbar { display: none; }
body.sm-has-topbar.sm-desktop {
    display: flex; flex-direction: column; height: 100%; background: var(--sm-bg); font-family: var(--sm-font);
}
body.sm-has-topbar.sm-desktop #sm-topbar {
    height: 64px; flex: 0 0 64px; display: flex; align-items: center; gap: 8px;
    padding: 8px 16px 8px 20px; box-sizing: border-box; background: var(--sm-bg); color: var(--sm-text-2);
}
body.sm-has-topbar.sm-desktop #layout { flex: 1 1 auto; min-height: 0; height: auto; background: var(--sm-bg); }
#sm-topbar .sm-brand { display: flex; align-items: center; gap: 8px; width: 228px; flex-shrink: 0; text-decoration: none !important; color: var(--sm-text-2); }
#sm-topbar .sm-brand-mail { font-size: 22px; color: var(--sm-text-2); }
#sm-topbar .sm-mono-sm .sm-mono-name { display: none; }
#sm-search-slot { flex: 1 1 auto; max-width: 720px; min-width: 0; }
#sm-topbar .sm-spacer { flex: 1; }
#sm-topbar .sm-apps { display: flex; gap: 4px; }
#sm-topbar .sm-app {
    width: 44px; height: 44px; border-radius: 22px; display: flex; align-items: center; justify-content: center;
    color: var(--sm-text-2) !important; text-decoration: none !important;
}
#sm-topbar .sm-app:hover, #sm-topbar .sm-app:focus-visible { background: rgba(68,71,70,.1); }
#sm-topbar .sm-app.sm-active { background: var(--sm-nav-sel); color: var(--sm-nav-sel-text) !important; }
#sm-topbar .sm-account { position: relative; margin-left: 8px; }
.sm-avatar {
    width: 34px; height: 34px; border-radius: 17px; border: 0; color: #FFFFFF; font-size: 15px; font-weight: 500;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.sm-avatar:focus-visible { outline: 3px solid var(--sm-primary); outline-offset: 2px; }
.sm-avatar-lg { width: 64px; height: 64px; border-radius: 32px; font-size: 28px; cursor: default; }
#sm-topbar .sm-account-menu {
    position: absolute; right: 0; top: 46px; z-index: 1000; width: 300px; background: var(--sm-card);
    border-radius: 24px; box-shadow: 0 4px 8px 3px rgba(60,64,67,.15), 0 1px 3px rgba(60,64,67,.3); padding: 20px 0 12px;
}
#sm-topbar .sm-account-menu[hidden] { display: none; }
.sm-account-head { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 16px 16px; border-bottom: 1px solid var(--sm-line); }
.sm-account-mail { font-size: 14px; color: var(--sm-text); word-break: break-all; text-align: center; }
.sm-menu-item { display: block; padding: 12px 24px; font-size: 14px; color: var(--sm-text) !important; text-decoration: none !important; }
.sm-menu-item:hover, .sm-menu-item:focus-visible { background: rgba(68,71,70,.08); }

/* search pill */
#sm-search-slot .searchbar {
    height: 48px; border-radius: 24px !important; background: var(--sm-search) !important; border: 0 !important;
    display: flex; align-items: center; padding: 0 6px; margin: 0 !important; position: relative; box-shadow: none !important;
}
#sm-search-slot .searchbar:focus-within { background: var(--sm-card) !important; box-shadow: 0 1px 1px rgba(0,0,0,.1), 0 1px 3px 1px rgba(60,64,67,.15) !important; }
#sm-search-slot .searchbar input { background: transparent !important; border: 0 !important; font-size: 16px !important; color: var(--sm-text) !important; height: 48px; box-shadow: none !important; }
#sm-search-slot .searchbar a.button, #sm-search-slot .searchbar .button { color: var(--sm-text-2) !important; }

/* ---------- desktop shell: hide Elastic's left icon bar ---------- */
body.sm-desktop.sm-has-topbar #layout-menu { display: none !important; }
body.sm-desktop.sm-has-topbar #layout-sidebar {
    background: var(--sm-bg) !important; border: 0 !important; width: 256px; flex: 0 0 256px; max-width: 256px; padding-right: 16px; box-sizing: border-box;
}
body.sm-desktop.sm-has-topbar #layout-sidebar > .header { display: none; }
body.sm-desktop.sm-has-topbar #layout-sidebar .footer { background: transparent; border: 0; color: var(--sm-text-2); }

.sm-compose {
    display: inline-flex; align-items: center; gap: 14px; align-self: flex-start; flex-shrink: 0;
    margin: 8px 0 16px 8px; height: 56px; padding: 0 26px 0 18px; border-radius: 16px;
    background: var(--sm-compose); color: var(--sm-compose-text) !important; font-size: 14px; font-weight: 500; text-decoration: none !important;
    transition: box-shadow .15s;
}
.sm-compose:hover, .sm-compose:focus-visible { box-shadow: 0 1px 3px 1px rgba(60,64,67,.15), 0 1px 2px rgba(60,64,67,.3); }
body:not(.sm-desktop) .sm-compose { display: none; }

/* folder list */
body.sm-desktop.sm-has-topbar #folderlist-content { background: transparent; }
body.sm-desktop.sm-has-topbar #mailboxlist li { border: 0 !important; }
body.sm-desktop.sm-has-topbar #mailboxlist li > a {
    height: 32px; line-height: 32px; padding-top: 0 !important; padding-bottom: 0 !important;
    border-radius: 0 16px 16px 0; color: var(--sm-text) !important; font-size: 14px;
}
body.sm-desktop.sm-has-topbar #mailboxlist li > a:hover { background: rgba(68,71,70,.08); }
body.sm-desktop.sm-has-topbar #mailboxlist li.selected > a {
    background: var(--sm-nav-sel) !important; color: var(--sm-nav-sel-text) !important; font-weight: 700;
}
body.sm-desktop.sm-has-topbar #mailboxlist li.selected { background: transparent !important; }
body.sm-desktop.sm-has-topbar #mailboxlist li .unreadcount { background: transparent !important; color: inherit !important; font-weight: 700; font-size: 12px; }
body.sm-desktop.sm-has-topbar #mailboxlist li.unread > a { font-weight: 700; }

/* list and content as white cards */
body.sm-desktop.sm-has-topbar #layout-list,
body.sm-desktop.sm-has-topbar #layout-content {
    background: var(--sm-card) !important; border-radius: 16px; margin: 0 16px 16px 0; overflow: hidden;
    border: 0 !important; box-shadow: none !important;
}
body.sm-desktop.sm-has-topbar.task-mail.action-none #layout-list { flex: 1 1 auto; max-width: none; width: auto; }
body.sm-desktop.sm-has-topbar.task-mail.action-none #layout-content { display: none !important; }
body.sm-desktop.sm-has-topbar.task-mail.action-none.sm-reading #layout-list { display: none !important; }
body.sm-desktop.sm-has-topbar.task-mail.action-none.sm-reading #layout-content { display: flex !important; flex: 1 1 auto; }
body.sm-desktop.sm-has-topbar #layout-list > .header,
body.sm-desktop.sm-has-topbar #layout-content > .header { background: var(--sm-card) !important; border-bottom: 1px solid var(--sm-line) !important; }
.sm-back { display: none !important; }
body.sm-desktop.sm-reading .sm-back {
    display: inline-flex !important; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 20px;
    color: var(--sm-text-2) !important; margin-right: 8px; flex-shrink: 0;
}
body.sm-desktop.sm-reading .sm-back:hover { background: rgba(68,71,70,.1); }

/* ---------- message rows, one line like Gmail ---------- */
body.sm-desktop.task-mail #messagelist { font-family: var(--sm-font); }
body.sm-desktop.task-mail #messagelist thead { display: none; }
body.sm-desktop.task-mail #messagelist tbody tr { display: flex; align-items: flex-start; border-bottom: 1px solid var(--sm-line); background: var(--sm-row-read); cursor: pointer; }
body.sm-desktop.task-mail #messagelist tbody tr.unread { background: var(--sm-card); }
body.sm-desktop.task-mail #messagelist tbody tr:hover { box-shadow: var(--sm-row-hover-shadow); position: relative; z-index: 1; }
body.sm-desktop.task-mail #messagelist tbody tr.selected,
body.sm-desktop.task-mail #messagelist tbody tr.focused.selected { background: var(--sm-row-sel) !important; }
body.sm-desktop.task-mail #messagelist tbody tr td { border: 0 !important; display: block; }
body.sm-desktop.task-mail #messagelist tbody tr td.selection { order: 0; flex: 0 0 auto; }
body.sm-desktop.task-mail #messagelist tbody tr td.flags {
    order: 1; flex: 0 0 auto; width: auto !important; display: flex; align-items: center; height: 40px; padding: 0 0 0 12px !important;
}
body.sm-desktop.task-mail #messagelist tbody tr td.subject {
    order: 2; flex: 1 1 auto; min-width: 0; display: flex !important; flex-wrap: wrap; align-items: center;
    padding: 0 16px 0 8px !important; line-height: 40px; min-height: 40px;
}
body.sm-desktop.task-mail #messagelist td.subject span.fromto {
    order: 1; flex: 0 0 200px; width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 14px; color: var(--sm-text); padding-right: 16px; box-sizing: border-box;
}
body.sm-desktop.task-mail #messagelist td.subject span.subject {
    order: 2; flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--sm-text);
}
body.sm-desktop.task-mail #messagelist td.subject span.subject a { color: inherit !important; }
body.sm-desktop.task-mail #messagelist td.subject span.date {
    order: 3; flex: 0 0 auto; margin-left: 16px; font-size: 12px; color: var(--sm-text-3); float: none !important; position: static !important;
}
body.sm-desktop.task-mail #messagelist td.subject span.size,
body.sm-desktop.task-mail #messagelist td.subject span.msgicon.status { display: none; }
body.sm-desktop.task-mail #messagelist tr.unread td.subject span.fromto,
body.sm-desktop.task-mail #messagelist tr.unread td.subject span.subject,
body.sm-desktop.task-mail #messagelist tr.unread td.subject span.date { font-weight: 700; color: var(--sm-text); }
body.sm-desktop.task-mail #messagelist tr.sm-has-chips td.flags span.attachment { display: none; }

/* attachment chips */
.sm-chips { order: 4; flex: 0 0 100%; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 10px 200px; line-height: normal; box-sizing: border-box; }
.sm-chip {
    height: 30px; max-width: 220px; box-sizing: border-box; border: 1px solid var(--sm-chip-border); border-radius: 15px;
    padding: 0 12px 0 8px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sm-text); background: var(--sm-card);
}
.sm-chip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-chip-more { padding: 0 12px; color: var(--sm-text-2); }
body:not(.sm-desktop) .sm-chips { display: none; }

/* ---------- open message (inside the content frame) ---------- */
html.sm-message body { font-family: var(--sm-font); }
html.sm-message #message-header h2.subject { font-size: 22px; font-weight: 400; color: var(--sm-text); }
html.sm-message .sm-att-head { font-size: 14px; font-weight: 500; color: var(--sm-text); margin: 8px 0 12px; padding-top: 16px; border-top: 1px solid var(--sm-line); }
#attachment-list.sm-cards { display: flex !important; flex-wrap: wrap; gap: 12px; padding: 0 !important; margin: 0 0 16px !important; list-style: none; border: 0 !important; background: transparent !important; }
#attachment-list.sm-cards > li {
    width: 196px; height: 146px; display: flex !important; flex-direction: column; border: 1px solid #DADCE0 !important; border-radius: 8px;
    overflow: hidden; background: var(--sm-card) !important; position: relative; margin: 0 !important; padding: 0 !important; float: none !important;
}
#attachment-list.sm-cards > li:hover { box-shadow: 0 1px 3px 1px rgba(60,64,67,.15); }
#attachment-list.sm-cards .sm-thumb { flex: 1 1 auto; min-height: 0; background: #F1F3F4; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
html.dark-mode #attachment-list.sm-cards .sm-thumb { background: #26292D; }
#attachment-list.sm-cards .sm-thumb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
#attachment-list.sm-cards .sm-page { width: 74px; height: 88px; background: #FFFFFF; box-shadow: 0 1px 2px rgba(0,0,0,.2); display: flex; align-items: center; justify-content: center; margin-top: 14px; }
#attachment-list.sm-cards > li > a.filename {
    flex: 0 0 40px; height: 40px; display: flex !important; align-items: center; gap: 6px; padding: 0 10px !important;
    border-top: 1px solid var(--sm-line); font-size: 13px; color: var(--sm-text) !important; white-space: nowrap; overflow: hidden;
}
#attachment-list.sm-cards > li > a.filename::before { display: none !important; }
#attachment-list.sm-cards > li .attachment-name { overflow: hidden; text-overflow: ellipsis; }
#attachment-list.sm-cards > li .attachment-size { color: var(--sm-text-3); font-size: 12px; flex-shrink: 0; }
#attachment-list.sm-cards > li a.drop {
    position: absolute !important; top: 8px; right: 8px; width: 32px !important; height: 32px; border-radius: 16px;
    background: rgba(32,33,36,.72) !important; color: #FFFFFF !important; opacity: 0; transition: opacity .15s; display: flex !important; align-items: center; justify-content: center;
}
#attachment-list.sm-cards > li:hover a.drop, #attachment-list.sm-cards > li a.drop:focus-visible { opacity: 1; }

/* ---------- compose pop-up ---------- */
.sm-compose-win {
    position: fixed; right: 24px; bottom: 0; z-index: 9000; width: 560px; height: min(680px, calc(100vh - 80px));
    background: var(--sm-card); border-radius: 12px 12px 0 0; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 8px 28px rgba(0,0,0,.22), 0 2px 6px rgba(0,0,0,.12); font-family: var(--sm-font);
}
.sm-compose-win.sm-max { right: 50%; bottom: 50%; transform: translate(50%, 50%); width: min(1100px, calc(100vw - 80px)); height: calc(100vh - 80px); border-radius: 12px; }
.sm-compose-win.sm-min { height: 40px; width: 300px; }
.sm-compose-win.sm-closing { opacity: .6; pointer-events: none; }
.sm-compose-head { height: 40px; flex: 0 0 40px; background: #F2F6FC; display: flex; align-items: center; padding: 0 6px 0 16px; gap: 2px; cursor: default; }
html.dark-mode .sm-compose-head { background: #26292D; }
.sm-compose-title { flex: 1; font-size: 14px; font-weight: 500; color: var(--sm-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-compose-btn { width: 32px; height: 32px; border: 0; border-radius: 16px; background: transparent; color: var(--sm-text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.sm-compose-btn:hover, .sm-compose-btn:focus-visible { background: rgba(68,71,70,.12); }
.sm-compose-frame { flex: 1 1 auto; width: 100%; border: 0; background: var(--sm-card); }
.sm-compose-win.sm-min .sm-compose-frame { display: none; }

/* compose page inside the pop-up */
html.sm-in-popup body { background: var(--sm-card) !important; font-family: var(--sm-font); }
html.sm-in-popup #layout-sidebar,
html.sm-in-popup #layout-content > .header > .header-title,
html.sm-in-popup #layout-content > .header a.back-list-button { display: none !important; }
html.sm-in-popup #layout-content { border: 0 !important; }
html.sm-in-popup .formbuttons button.send,
html.sm-in-popup button.btn.send,
html.sm-in-popup .btn-primary.send {
    background: var(--sm-primary) !important; border-color: var(--sm-primary) !important; border-radius: 20px !important; padding: 0 24px !important; height: 40px;
}

/* ---------- round 2 fixes ---------- */
/* stars instead of red flags, fixed column so senders line up */
body.sm-desktop.task-mail #messagelist tbody tr td.flags {
    position: static !important; width: 40px !important; flex: 0 0 40px; padding: 0 !important; justify-content: center;
}
body.sm-desktop.task-mail #messagelist td.flags span.attachment { display: none; }
body.sm-desktop.task-mail #messagelist td.flags .flag { visibility: visible !important; height: 40px; line-height: 40px; display: flex; align-items: center; }
body.sm-desktop.task-mail #messagelist td.flags span.flagged:before,
body.sm-desktop.task-mail #messagelist td.flags span.unflagged:before {
    content: "\f005" !important; font-family: Icons; font-size: 1.05em; float: none; margin: 0; display: block;
}
body.sm-desktop.task-mail #messagelist td.flags span.unflagged:before { font-weight: 400 !important; color: #747775 !important; }
body.sm-desktop.task-mail #messagelist td.flags span.flagged:before { font-weight: 900 !important; color: #F4B400 !important; }
body.sm-desktop.task-mail #messagelist tr.flagged td,
body.sm-desktop.task-mail #messagelist tr.flagged td.subject span.fromto,
body.sm-desktop.task-mail #messagelist tr.flagged td.subject span.subject a,
body.sm-desktop.task-mail #messagelist tr.flagged td.subject span.date { color: var(--sm-text) !important; }
body.sm-desktop.task-mail #messagelist tr:not(.unread).flagged td.subject span.date { color: var(--sm-text-3) !important; }
body.sm-desktop.task-mail #messagelist tbody tr td.subject { padding-left: 4px !important; }
.sm-chips { padding-left: 200px; }

/* toolbars: icons only, left aligned, like Gmail */
body.sm-desktop.sm-has-topbar #layout-list > .header,
body.sm-desktop.sm-has-topbar #layout-content > .header { justify-content: flex-start !important; padding: 0 8px 0 12px; height: 52px; min-height: 52px; }
body.sm-desktop.sm-has-topbar #layout-list > .header .header-title,
body.sm-desktop.sm-has-topbar #layout-content > .header .header-title { display: none; }
body.sm-desktop.sm-has-topbar #layout-list > .header .toolbar,
body.sm-desktop.sm-has-topbar #layout-content > .header .toolbar { justify-content: flex-start !important; margin: 0 !important; flex: 0 0 auto; width: auto !important; }
body.sm-desktop.sm-has-topbar #layout-list > .header .toolbar { order: 1; }
body.sm-desktop.sm-has-topbar #layout-list > .header > a.refresh { order: 2; }
body.sm-desktop.sm-has-topbar .header .toolbar a .inner,
body.sm-desktop.sm-has-topbar .header > a.refresh .inner {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
body.sm-desktop.sm-has-topbar .header .toolbar a:not(.dropdown),
body.sm-desktop.sm-has-topbar .header > a.refresh {
    min-width: 40px !important; width: 40px; height: 40px; padding: 0 !important; border-radius: 20px; display: inline-flex !important;
    align-items: center; justify-content: center; color: var(--sm-text-2) !important; margin: 0 2px !important; font-size: 0 !important;
}
body.sm-desktop.sm-has-topbar .header .toolbar a:not(.dropdown):before,
body.sm-desktop.sm-has-topbar .header > a.refresh:before { margin: 0 !important; float: none !important; font-size: 17px !important; width: auto !important; height: auto !important; line-height: 1 !important; }
body.sm-desktop.sm-has-topbar .header .toolbar a:hover,
body.sm-desktop.sm-has-topbar .header > a.refresh:hover { background: rgba(68,71,70,.1) !important; }
body.sm-desktop.sm-has-topbar .header .toolbar a.disabled { opacity: .38; }
body.sm-desktop.sm-has-topbar .header .toolbar li { margin: 0 !important; }
body.sm-desktop.sm-has-topbar .header .toolbar .dropbutton { display: inline-flex !important; align-items: center; }
body.sm-desktop.sm-has-topbar .header .toolbar .dropbutton a.dropdown { width: 14px !important; min-width: 14px !important; margin-left: -8px !important; padding: 0 !important; }
body.sm-desktop.sm-has-topbar .header .toolbar .spacer { display: none; }

/* attachment cards: drop Elastic's icon, options button top-right */
#attachment-list.sm-cards > li:before { display: none !important; }
#attachment-list.sm-cards > li > a.dropdown {
    position: absolute !important; top: 6px; right: 6px; width: 30px !important; height: 30px !important; border-radius: 15px;
    background: rgba(32,33,36,.72) !important; color: #FFFFFF !important; opacity: 0; transition: opacity .15s;
    display: flex !important; align-items: center; justify-content: center; margin: 0 !important; padding: 0 !important;
}
#attachment-list.sm-cards > li > a.dropdown:before { margin: 0 !important; float: none !important; color: #FFFFFF !important; }
#attachment-list.sm-cards > li:hover > a.dropdown,
#attachment-list.sm-cards > li > a.dropdown:focus-visible { opacity: 1; }

/* plain-text emails in a readable font, like Gmail */
html.sm-message #messagebody div.pre { font-family: var(--sm-font) !important; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
html.sm-message #messagebody { font-family: var(--sm-font); }
html.sm-message #messagebody div.pre { white-space: normal !important; }
body.sm-desktop.task-mail #messagelist td.flags .flag > span { display: block !important; margin: 0 !important; height: auto !important; line-height: 1 !important; position: static !important; }

/* ---------- attachment viewer ---------- */
.sm-viewer { position: fixed; inset: 0; z-index: 10000; background: rgba(24,25,27,.93); color: #FFFFFF; display: flex; flex-direction: column; font-family: var(--sm-font); }
.sm-v-head { height: 64px; flex: 0 0 64px; display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.sm-v-name { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-v-size { font-size: 13px; color: #C4C7C5; white-space: nowrap; }
.sm-v-spacer { flex: 1; }
.sm-v-icon { display: inline-flex; background: #FFFFFF; border-radius: 4px; padding: 2px; }
.sm-v-btn { width: 44px; height: 44px; border: 0; border-radius: 22px; background: transparent; color: #FFFFFF !important; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; text-decoration: none !important; }
.sm-v-btn:hover, .sm-v-btn:focus-visible { background: rgba(255,255,255,.14); outline: none; }
.sm-v-stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px 88px 64px; }
.sm-v-img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 4px 16px rgba(0,0,0,.4); background: #FFFFFF; }
.sm-v-frame { width: min(900px, 100%); height: 100%; border: 0; background: #FFFFFF; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.sm-v-none { display: flex; flex-direction: column; align-items: center; gap: 12px; background: #2D2E30; border-radius: 12px; padding: 40px 56px; text-align: center; }
.sm-v-none-icon { background: #FFFFFF; border-radius: 8px; padding: 12px; display: inline-flex; }
.sm-v-none p { margin: 0; font-size: 15px; }
.sm-v-none-dl { display: inline-flex; align-items: center; height: 40px; padding: 0 24px; border-radius: 20px; background: #A8C7FA; color: #062E6F !important; font-weight: 500; text-decoration: none !important; }
.sm-viewer .sm-v-prev, .sm-viewer .sm-v-next { position: absolute; top: 50%; margin-top: -24px; width: 48px; height: 48px; border-radius: 24px; background: rgba(255,255,255,.12); }
.sm-viewer .sm-v-prev { left: 24px; }
.sm-viewer .sm-v-next { right: 24px; }
.sm-v-foot { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); background: #2D2E30; border-radius: 18px; padding: 8px 16px; font-size: 13px; color: #E3E3E3; }

/* ---------- compose page inside the pop-up (Elastic small mode) ---------- */
html.sm-in-popup #layout-menu,
html.sm-in-popup #sm-topbar,
html.sm-in-popup #layout-content > .header .task-menu-button,
html.sm-in-popup #layout-content > .header .header-title,
html.sm-in-popup #layout-content > .footer,
html.sm-in-popup #compose-content > .formbuttons { display: none !important; }
html.sm-in-popup body { display: block !important; }
html.sm-in-popup #layout { height: 100%; }
html.sm-in-popup #layout-content { width: 100% !important; display: flex; flex-direction: column; }
html.sm-in-popup #layout-content > .header { height: 36px; min-height: 36px; background: var(--sm-card) !important; border: 0 !important; justify-content: flex-end; }
html.sm-in-popup #compose-content { flex: 1 1 auto; min-height: 0; }
html.sm-in-popup #compose-content .formcontent { padding: 0 16px 8px !important; }
html.sm-in-popup .sm-pop-attachments { display: block !important; padding: 8px 0 0; border: 0 !important; }
html.sm-in-popup .sm-pop-attachments .upload-form { display: none !important; }
html.sm-in-popup .sm-pop-attachments #attachment-list li { background: #F2F6FC; border-radius: 8px; margin: 0 0 6px; }
html.sm-in-popup.dark-mode .sm-pop-attachments #attachment-list li { background: #26292D; }
.sm-pop-bar { flex: 0 0 64px; height: 64px; display: flex; align-items: center; gap: 4px; padding: 0 12px 0 16px; background: var(--sm-card); border-top: 1px solid var(--sm-line); }
.sm-pop-send {
    height: 40px; padding: 0 26px; border: 0; border-radius: 20px; background: var(--sm-primary); color: #FFFFFF; font: 500 14px var(--sm-font);
    cursor: pointer; margin-right: 8px;
}
html.dark-mode .sm-pop-send { color: #062E6F; }
.sm-pop-send:hover { box-shadow: 0 1px 3px 1px rgba(60,64,67,.15), 0 1px 2px rgba(60,64,67,.3); }
.sm-pop-tool { width: 40px; height: 40px; border: 0; border-radius: 20px; background: transparent; color: var(--sm-text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.sm-pop-tool:hover, .sm-pop-tool:focus-visible { background: rgba(68,71,70,.1); }
.sm-pop-spacer { flex: 1; }
html.sm-in-popup .sm-pop-attachments { flex: 0 0 auto; max-height: 140px; overflow: auto; padding: 4px 16px 0 !important; background: var(--sm-card); }
html.sm-in-popup .sm-pop-attachments #attachment-list:empty { display: none; }
html.sm-in-popup .sm-pop-attachments #attachment-list { margin: 0 !important; }
body.status-flagged #message-header > .subject:before { content: "\f005" !important; color: #F4B400 !important; }
html.sm-in-popup .sm-pop-attachments:not(:has(#attachment-list > li)) { display: none !important; }
html.sm-in-popup .sm-pop-attachments:before, html.sm-in-popup .sm-pop-attachments .hint { display: none !important; }

/* all sizes: stars instead of red flags */
.messagelist tr.flagged td, .messagelist tr.flagged td.subject span.fromto, .messagelist tr.flagged td.subject span.subject a,
.messagelist tr.flagged td.subject span.date, .messagelist tr.flagged span.size { color: inherit !important; }
.messagelist span.flagged:before { content: "\f005" !important; color: #F4B400 !important; }
#sm-topbar .sm-mono-sm .sm-mono-name { display: inline; max-width: 120px; overflow: hidden; text-overflow: ellipsis; color: var(--sm-text-2); font-weight: 400; font-size: 20px; }
#sm-topbar .sm-brand { min-width: 0; }

/* ---------- round 3: closer to Gmail ---------- */
/* folder list: thin grey outline icons */
body.sm-desktop.sm-has-topbar #mailboxlist li.mailbox > a { display: flex !important; align-items: center; padding-left: 26px !important; }
body.sm-desktop.sm-has-topbar #mailboxlist li.mailbox > a:before {
    content: "" !important; font-family: inherit !important; width: 20px; height: 20px; flex: 0 0 20px; margin: 0 18px 0 0 !important;
    background-color: #444746; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.63 5.84C17.27 5.33 16.67 5 16 5L5 5.01C3.9 5.01 3 5.9 3 7v10c0 1.1.9 1.99 2 1.99L16 19c.67 0 1.27-.33 1.63-.84L22 12l-4.37-6.16zM16 17H5V7h11l3.55 5L16 17z'/%3E%3C/svg%3E") center / 20px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.63 5.84C17.27 5.33 16.67 5 16 5L5 5.01C3.9 5.01 3 5.9 3 7v10c0 1.1.9 1.99 2 1.99L16 19c.67 0 1.27-.33 1.63-.84L22 12l-4.37-6.16zM16 17H5V7h11l3.55 5L16 17z'/%3E%3C/svg%3E") center / 20px no-repeat;
}
html.dark-mode body.sm-desktop.sm-has-topbar #mailboxlist li.mailbox > a:before { background-color: #C4C7C5; }
body.sm-desktop.sm-has-topbar #mailboxlist li.mailbox.selected > a:before { background-color: var(--sm-nav-sel-text); }
body.sm-desktop.sm-has-topbar #mailboxlist li.mailbox.inbox > a:before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5v-3h3.56c.69 1.19 1.97 2 3.45 2s2.75-.81 3.45-2H19v3zm0-5h-4.99c0 1.1-.9 2-2 2s-2-.9-2-2H5V5h14v9z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5v-3h3.56c.69 1.19 1.97 2 3.45 2s2.75-.81 3.45-2H19v3zm0-5h-4.99c0 1.1-.9 2-2 2s-2-.9-2-2H5V5h14v9z'/%3E%3C/svg%3E"); }
body.sm-desktop.sm-has-topbar #mailboxlist li.mailbox.drafts > a:before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z'/%3E%3C/svg%3E"); }
body.sm-desktop.sm-has-topbar #mailboxlist li.mailbox.sent > a:before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4.01 6.03l7.51 3.22-7.52-1 .01-2.22m7.5 8.72L4 17.97v-2.22l7.51-1M2.01 3L2 10l15 2-15 2 .01 7L23 12 2.01 3z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4.01 6.03l7.51 3.22-7.52-1 .01-2.22m7.5 8.72L4 17.97v-2.22l7.51-1M2.01 3L2 10l15 2-15 2 .01 7L23 12 2.01 3z'/%3E%3C/svg%3E"); }
body.sm-desktop.sm-has-topbar #mailboxlist li.mailbox.junk > a:before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27L15.73 3zM19 14.9L14.9 19H9.1L5 14.9V9.1L9.1 5h5.8L19 9.1v5.8zM11 7h2v6h-2zm0 8h2v2h-2z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27L15.73 3zM19 14.9L14.9 19H9.1L5 14.9V9.1L9.1 5h5.8L19 9.1v5.8zM11 7h2v6h-2zm0 8h2v2h-2z'/%3E%3C/svg%3E"); }
body.sm-desktop.sm-has-topbar #mailboxlist li.mailbox.trash > a:before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z'/%3E%3C/svg%3E"); }
body.sm-desktop.sm-has-topbar #mailboxlist li.mailbox.archive > a:before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM6.24 5h11.52l.81.97H5.44l.8-.97zM5 19V8h14v11H5zm8.45-9h-2.9v3H8l4 4 4-4h-2.55z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM6.24 5h11.52l.81.97H5.44l.8-.97zM5 19V8h14v11H5zm8.45-9h-2.9v3H8l4 4 4-4h-2.55z'/%3E%3C/svg%3E"); }
body.sm-desktop.sm-has-topbar #mailboxlist li.mailbox .unreadcount { position: static !important; margin: 0 0 0 auto !important; padding: 0 0 0 8px !important; min-width: 0 !important; }
body.sm-desktop.sm-has-topbar #mailboxlist li.mailbox ul li.mailbox > a { padding-left: 42px !important; }

/* list toolbar: checkbox, refresh, more ... and 1-50 of N on the right */
body.sm-desktop.sm-has-topbar #messagelist-header { height: 48px; min-height: 48px; padding: 0 12px 0 8px; border-bottom: 0 !important; display: flex; align-items: center; }
body.sm-desktop.sm-has-topbar #messagelist-header .sm-hide-desktop { display: none !important; }
body.sm-desktop.sm-has-topbar #messagelist-header a.select:before { content: "\f0c8" !important; font-weight: 400 !important; font-size: 18px !important; }
body.sm-desktop.sm-has-topbar #messagelist-header a.select { width: 52px !important; border-radius: 4px !important; }
body.sm-desktop.sm-has-topbar #messagelist-header a.select:after { content: "\f0d7"; font-family: Icons; font-weight: 900; font-size: 11px; margin-left: 6px; color: var(--sm-text-2); }
body.sm-desktop.sm-has-topbar #messagelist-header a.options:before { content: "\f142" !important; font-weight: 900 !important; }
body.sm-desktop.sm-has-topbar #messagelist-header a.refresh:before { content: "\f01e" !important; }
body.sm-desktop.sm-has-topbar #messagelist-header .sm-refresh-li a.refresh { position: static; }
.sm-pager { display: none; }
body.sm-desktop.sm-has-topbar .sm-pager { display: flex; align-items: center; gap: 4px; margin-left: auto; order: 9; font-size: 12px; color: var(--sm-text-2); }
.sm-pager-text { margin-right: 8px; white-space: nowrap; }
.sm-pager-btn { width: 36px; height: 36px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; color: var(--sm-text-2) !important; text-decoration: none !important; }
.sm-pager-btn:hover { background: rgba(68,71,70,.1); }
.sm-pager-btn.disabled { opacity: .38; pointer-events: none; }
body.sm-desktop.sm-has-topbar #layout-list > .footer.pagenav { display: none !important; }

/* search pill: magnifier left, filter icon right */
#sm-search-slot .searchbar a.button.unread { display: none !important; }
#sm-search-slot .searchbar form { flex: 1 1 auto; order: 1; }
#sm-search-slot .searchbar a.button.search { order: 0; position: static !important; width: 44px; height: 44px; border-radius: 22px; display: inline-flex; align-items: center; justify-content: center; }
#sm-search-slot .searchbar a.button.reset { order: 2; }
#sm-search-slot .searchbar a.button.options { order: 3; width: 44px; height: 44px; border-radius: 22px; display: inline-flex; align-items: center; justify-content: center; position: static !important; }
#sm-search-slot .searchbar a.button.options:before { content: "\f1de" !important; font-weight: 900 !important; font-size: 18px; }
#sm-search-slot .searchbar a.button:hover { background: rgba(68,71,70,.1); }
#sm-search-slot .searchbar input { padding-left: 4px !important; }

/* rows: subject - grey preview, Gmail dates, actions on hover */
.sm-snippet { color: var(--sm-text-3); font-weight: 400 !important; }
body.sm-desktop.task-mail #messagelist tr.unread .sm-snippet { font-weight: 400; color: var(--sm-text-3); }
body.sm-desktop.task-mail #messagelist td.subject span.date { min-width: 64px; text-align: right; }
.sm-row-actions { display: none; }
body.sm-desktop.task-mail #messagelist tbody tr:hover .sm-row-actions { display: inline-flex; order: 3; margin-left: 8px; gap: 2px; align-items: center; height: 40px; }
body.sm-desktop.task-mail #messagelist tbody tr:hover td.subject span.date { display: none; }
.sm-row-btn { width: 36px; height: 36px; border: 0; border-radius: 18px; background: transparent; color: var(--sm-text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.sm-row-btn:hover { background: rgba(68,71,70,.12); color: var(--sm-text); }
body.sm-desktop.task-mail #messagelist tbody tr td.selection { display: flex !important; align-items: center; height: 40px; padding: 0 0 0 12px !important; }
#sm-topbar .sm-app.sm-active { background: transparent; color: var(--sm-text-2) !important; }
body.sm-desktop.sm-has-topbar #toolbar-list-menu { display: flex !important; flex-wrap: nowrap; align-items: center; height: 48px; margin: 0 !important; padding: 0 !important; position: static !important; }
body.sm-desktop.sm-has-topbar #toolbar-list-menu > li { display: flex; align-items: center; height: 48px; }
body.sm-desktop.sm-has-topbar #messagelist-header { height: 48px !important; min-height: 48px !important; }
#sm-search-slot .searchbar a.button.search,
#sm-search-slot .searchbar a.button.options,
#sm-search-slot .searchbar a.button.reset { margin: 0 !important; top: auto !important; align-self: center; line-height: 1 !important; padding: 0 !important; }
#sm-search-slot .searchbar a.button.search:before,
#sm-search-slot .searchbar a.button.options:before { margin: 0 !important; line-height: 1 !important; font-size: 18px !important; }
#sm-search-slot .searchbar form:before { display: none !important; }

/* ---------- account switcher (avatar menu) ---------- */
.sm-accounts { border-bottom: 1px solid var(--sm-line); padding: 6px 0; }
.sm-accounts[hidden] { display: none; }
.sm-acct { display: flex; align-items: center; gap: 12px; padding: 8px 24px; color: var(--sm-text) !important; text-decoration: none !important; }
.sm-acct:hover, .sm-acct:focus-visible { background: rgba(68,71,70,.08); }
.sm-avatar-sm { width: 32px; height: 32px; border-radius: 16px; font-size: 14px; cursor: pointer; flex-shrink: 0; }
.sm-acct-text { display: flex; flex-direction: column; min-width: 0; }
.sm-acct-mail { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-acct-state { font-size: 12px; color: var(--sm-text-3); }
.sm-add-account { display: flex !important; align-items: center; gap: 12px; border-bottom: 1px solid var(--sm-line); }
.sm-add-account:before {
    content: "+"; width: 32px; height: 32px; border-radius: 16px; border: 1px solid var(--sm-chip-border);
    display: inline-flex; align-items: center; justify-content: center; font-size: 20px; color: var(--sm-text-2); box-sizing: border-box;
}

/* ---------- SparkWorld ad card ---------- */
.sm-ad {
    position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 16px;
    margin: 12px 16px 4px; padding: 16px 60px 22px 20px; border: 1px solid #DADCE0; border-radius: 16px;
    background: var(--sm-card); cursor: pointer; font-family: var(--sm-font); overflow: hidden;
    transition: box-shadow .2s, opacity .25s, transform .25s;
    animation: sm-ad-in .45s ease-out;
}
.sm-ad:hover { box-shadow: 0 1px 3px 1px rgba(60,64,67,.15), 0 1px 2px rgba(60,64,67,.3); }
.sm-ad.sm-ad-gone { opacity: 0; transform: translateY(-8px); }
html.dark-mode .sm-ad { border-color: #3C4043; }
@keyframes sm-ad-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.sm-ad-logo {
    position: relative; width: 52px; height: 52px; flex: 0 0 52px; border-radius: 50%; background: #FFFFFF;
    border: 1px solid #DADCE0; display: flex; align-items: center; justify-content: center; overflow: visible;
    font-size: 22px; font-weight: 700; color: #0E78A8;
}
.sm-ad-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; transform: scale(1.25); }
.sm-ad-logo:after {
    content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #29ABE2; opacity: 0;
    animation: sm-ad-ring 3.5s ease-out infinite;
}
@keyframes sm-ad-ring { 0% { opacity: .7; transform: scale(.9); } 70%, 100% { opacity: 0; transform: scale(1.25); } }

.sm-ad-body { flex: 1 1 auto; min-width: 0; }
.sm-ad-brand { font-size: 12px; color: var(--sm-text-3); margin-bottom: 2px; }
.sm-ad-slides { position: relative; height: 46px; overflow: hidden; }
.sm-ad-slide {
    position: absolute; inset: 0; opacity: 0; transform: translateY(100%);
    transition: transform .55s cubic-bezier(.2,.7,.2,1), opacity .45s;
}
.sm-ad-slide.sm-on { opacity: 1; transform: none; }
.sm-ad-title { font-size: 17px; line-height: 24px; color: var(--sm-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-ad-text { font-size: 14px; line-height: 20px; color: var(--sm-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sm-ad-side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.sm-ad-price {
    display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 16px;
    background: #FFF1D6; color: #7A4B00; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.sm-ad-price.sm-ad-ask { background: #E8F0FE; color: #0B57D0; font-weight: 500; }
html.dark-mode .sm-ad-price { background: #4A3600; color: #FFDDA0; }
html.dark-mode .sm-ad-price.sm-ad-ask { background: #0B3B7A; color: #C2E7FF; }
.sm-ad-price.sm-pop { animation: sm-ad-pop .5s ease-out; }
@keyframes sm-ad-pop { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }

.sm-ad-cta {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 20px; border-radius: 20px;
    background: #1E8E3E; color: #FFFFFF !important; font-size: 14px; font-weight: 500; text-decoration: none !important; white-space: nowrap;
}
.sm-ad-cta:hover { background: #188038; box-shadow: 0 1px 3px rgba(0,0,0,.25); }

.sm-ad-close {
    position: absolute; top: 50%; right: 12px; margin-top: -18px; width: 36px; height: 36px; border: 0; border-radius: 18px;
    background: transparent; color: var(--sm-text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.sm-ad-close:hover { background: rgba(68,71,70,.1); }

.sm-ad-dots { position: absolute; left: 88px; bottom: 8px; display: flex; gap: 4px; }
.sm-ad-dots span { width: 5px; height: 5px; border-radius: 3px; background: #C4C7C5; transition: width .3s, background .3s; }
.sm-ad-dots span.sm-on { width: 16px; background: #29ABE2; }

@media (max-width: 1100px) {
    .sm-ad-text { display: none; }
    .sm-ad-slides { height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
    .sm-ad, .sm-ad-slide, .sm-ad-price.sm-pop, .sm-ad-logo:after { animation: none !important; transition: none !important; }
}
.sm-ad-logo { overflow: hidden; animation: sm-ad-glow 3.5s ease-out infinite; }
.sm-ad-logo:after { display: none; }
.sm-ad-logo img { transform: scale(1.3); }
@keyframes sm-ad-glow { 0% { box-shadow: 0 0 0 0 rgba(41,171,226,.55); } 70%, 100% { box-shadow: 0 0 0 10px rgba(41,171,226,0); } }
@media (prefers-reduced-motion: reduce) { .sm-ad-logo { animation: none; } }
.sm-ad-logo img { transform: scale(1.12); }

/* ---------- page-change loader: logo in the middle with a spinning ring ---------- */
#sm-navload {
    position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center;
    background: var(--sm-bg); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s ease, visibility 0s linear .25s;
}
#sm-navload .sm-navload-inner { display: flex; flex-direction: column; align-items: center; gap: 28px; }
#sm-navload .sm-logo-lg img { height: 96px; max-width: 300px; }
#sm-navload .sm-spin {
    width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--sm-line); border-top-color: var(--sm-primary);
    animation: sm-spin .8s linear infinite;
}
html.sm-navshow #sm-navload, html.sm-navin #sm-navload { opacity: 1; visibility: visible; transition: opacity .2s ease; }
html.sm-navin.sm-navout #sm-navload { opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s; }
@keyframes sm-spin { to { transform: rotate(360deg); } }

/* ---------- in-page loads: thin bar in the brand colour (replaces the grey "Loading..." box) ---------- */
#sm-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100001; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .3s; }
#sm-progress span { display: block; height: 100%; width: 0; }
#sm-progress.sm-run { opacity: 1; }
#sm-progress.sm-run span { animation: sm-progress 8s cubic-bezier(.1,.7,.3,1) forwards; }
#sm-progress.sm-run.sm-done span { animation: none; width: 100%; transition: width .2s; }
#sm-progress.sm-done { opacity: 0; transition: opacity .3s .15s; }
@keyframes sm-progress { 0% { width: 0; } 20% { width: 45%; } 100% { width: 92%; } }
#messagestack div.loading { display: none !important; }
@media (prefers-reduced-motion: reduce) {
    #sm-navload .sm-spin { animation-duration: 2.4s; }
    #sm-progress.sm-run span { animation: none; width: 60%; }
}

/* ---------- Primary / Promotions & subscriptions tabs ---------- */
.sm-tabs { display: flex; background: var(--sm-card); border-bottom: 1px solid var(--sm-line); flex-shrink: 0; }
.sm-tabs[hidden] { display: none; }
.sm-tab {
    display: flex; align-items: center; gap: 14px; width: 250px; max-width: 50%; height: 56px; padding: 0 16px;
    border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--sm-text-3);
    font: 500 14px var(--sm-font); cursor: pointer; text-align: left; position: relative;
}
.sm-tab:hover { background: rgba(68,71,70,.06); }
.sm-tab.sm-active { color: var(--sm-primary); border-bottom-color: var(--sm-primary); }
.sm-tab .sm-tab-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-tab-count { flex-shrink: 0; margin-left: auto; color: var(--sm-text); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sm-tab.sm-active .sm-tab-count { color: var(--sm-primary); }
.sm-tab-count[hidden] { display: none; }

/* ---------- menu items for install / notifications ---------- */
#sm-topbar .sm-menu-item[hidden] { display: none; }
#sm-topbar .sm-notify.sm-on { color: var(--sm-primary); }

/* ---------- phone and small tablet ---------- */
.sm-avatar-row, .sm-hamburger, #sm-bottomnav, .sm-fab { display: none; }

body.sm-has-topbar:not(.sm-desktop) {
    display: flex !important; flex-direction: column; height: 100%; background: var(--sm-bg);
}
body.sm-has-topbar:not(.sm-desktop) #sm-topbar {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0; height: 64px; padding: 8px 8px 8px 8px; background: var(--sm-bg);
}
body.sm-has-topbar:not(.sm-desktop) #layout { flex: 1 1 auto; min-height: 0; height: auto; }
body.sm-has-topbar:not(.sm-desktop) #sm-topbar .sm-brand,
body.sm-has-topbar:not(.sm-desktop) #sm-topbar .sm-apps,
body.sm-has-topbar:not(.sm-desktop) #sm-topbar .sm-spacer { display: none; }
body.sm-has-topbar:not(.sm-desktop) #sm-topbar .sm-hamburger {
    display: flex; align-items: center; justify-content: center; position: absolute; left: 14px; z-index: 2;
    width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--sm-text-2);
}
body.sm-has-topbar:not(.sm-desktop) #sm-topbar #sm-search-slot { flex: 1; min-width: 0; }
body.sm-has-topbar:not(.sm-desktop) #sm-topbar .sm-moved-search {
    display: flex !important; position: static !important; width: 100% !important; height: 48px; margin: 0 !important;
    border-radius: 24px !important; background: var(--sm-search) !important; padding-left: 52px !important; padding-right: 52px !important;
}
body.sm-has-topbar:not(.sm-desktop) #sm-topbar .sm-moved-search input { background: transparent !important; font-size: 16px; }
body.sm-has-topbar:not(.sm-desktop) #sm-topbar .sm-moved-search .button.search,
body.sm-has-topbar:not(.sm-desktop) #sm-topbar .sm-moved-search .button.reset:not(:hover) { display: none !important; }
body.sm-has-topbar:not(.sm-desktop) #sm-topbar .sm-account { position: absolute; right: 16px; margin: 0; z-index: 2; }
body.sm-has-topbar:not(.sm-desktop) #sm-topbar .sm-account > .sm-avatar { width: 32px; height: 32px; font-size: 15px; }
body.sm-has-topbar:not(.sm-desktop) #sm-topbar .sm-account-menu { right: -8px; max-width: calc(100vw - 16px); }
body.sm-has-topbar:not(.sm-desktop):has(#layout-content:not(.hidden)):has(#layout-list.hidden) #sm-topbar,
body.sm-has-topbar:not(.sm-desktop).action-show #sm-topbar,
body.sm-has-topbar:not(.sm-desktop).action-compose #sm-topbar { display: none; }

/* list: our top bar replaces Elastic's list header */
body.sm-has-topbar:not(.sm-desktop).task-mail #layout-list > .header { display: none !important; }
body.sm-has-topbar:not(.sm-desktop) #layout-list,
body.sm-has-topbar:not(.sm-desktop) #messagelist-content { background: var(--sm-bg) !important; border: 0 !important; }
body.sm-has-topbar:not(.sm-desktop) #messagelist-header { display: none !important; }
body.sm-has-topbar:not(.sm-desktop) .sm-ad { margin: 4px 8px 8px; }
body.sm-has-topbar:not(.sm-desktop) .sm-tab { height: 44px; gap: 8px; font-size: 13px; padding: 0 12px; width: auto; max-width: none; flex: 1; }
body.sm-has-topbar:not(.sm-desktop) .sm-tabs { background: var(--sm-bg); }
body.sm-has-topbar:not(.sm-desktop) .sm-tab svg { display: none; }

/* email cards */
body.sm-has-topbar:not(.sm-desktop) #messagelist tr { background: var(--sm-bg) !important; border: 0 !important; }
body.sm-has-topbar:not(.sm-desktop) #messagelist tr.selected { background: var(--sm-row-sel) !important; }
body.sm-has-topbar:not(.sm-desktop) #messagelist td { border: 0 !important; }
body.sm-has-topbar:not(.sm-desktop) #messagelist td.selection,
body.sm-has-topbar:not(.sm-desktop) #messagelist td.threads { display: none !important; }
body.sm-has-topbar:not(.sm-desktop) #messagelist td.subject { position: relative; padding: 12px 52px 12px 72px !important; }
body.sm-has-topbar:not(.sm-desktop) .sm-avatar-row {
    display: flex; align-items: center; justify-content: center; position: absolute; left: 16px; top: 14px;
    width: 40px; height: 40px; border-radius: 50%; color: #fff; font: 500 18px var(--sm-font);
}
body.sm-has-topbar:not(.sm-desktop) #messagelist td.subject span.fromto { font-size: 16px; color: var(--sm-text); padding-left: 0 !important; }
body.sm-has-topbar:not(.sm-desktop) #messagelist td.subject span.date { position: absolute; right: 16px; top: 13px; font-size: 12px; color: var(--sm-text-3); }
body.sm-has-topbar:not(.sm-desktop) #messagelist tr.unread td.subject span.date { color: var(--sm-text); font-weight: 700; }
body.sm-has-topbar:not(.sm-desktop) #messagelist td.subject span.subject { display: block; font-size: 14px; color: var(--sm-text); margin-top: 2px; }
body.sm-has-topbar:not(.sm-desktop) #messagelist td.subject span.subject a { display: block; white-space: normal; overflow: hidden; }
body.sm-has-topbar:not(.sm-desktop) #messagelist td.subject .sm-snippet {
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
    font-size: 14px; color: var(--sm-text-3); font-weight: 400 !important; margin-top: 1px;
}
body.sm-has-topbar:not(.sm-desktop) #messagelist td.subject .sm-snippet:before { content: none; }
body.sm-has-topbar:not(.sm-desktop) #layout-menu,
body.sm-has-topbar:not(.sm-desktop) .floating-action-buttons,
body.sm-has-topbar:not(.sm-desktop) #messagelist td.subject span.msgicon,
body.sm-has-topbar:not(.sm-desktop) #messagelist td.subject span.status { display: none !important; }
body.sm-has-topbar:not(.sm-desktop) #messagelist tr.unread td.subject span.fromto,
body.sm-has-topbar:not(.sm-desktop) #messagelist tr.unread td.subject span.subject a > span:not(.sm-snippet) { font-weight: 700; }
body.sm-has-topbar:not(.sm-desktop) #messagelist tr:not(.unread) td.subject span.fromto,
body.sm-has-topbar:not(.sm-desktop) #messagelist tr:not(.unread) td.subject span.subject { color: var(--sm-text-2); font-weight: 400; }
body.sm-has-topbar:not(.sm-desktop) #messagelist td.flags { position: absolute; right: 8px; bottom: 6px; width: auto !important; padding: 0 !important; }
body.sm-has-topbar:not(.sm-desktop) #messagelist tr { position: relative; }
body.sm-has-topbar:not(.sm-desktop) #messagelist .sm-row-actions,
body.sm-has-topbar:not(.sm-desktop) #messagelist .sm-chips { display: none !important; }
body.sm-has-topbar:not(.sm-desktop) #messagelist tr.unread td.subject:before {
    content: ""; position: absolute; left: 4px; top: 32px; width: 6px; height: 6px; border-radius: 50%; background: var(--sm-primary);
}

/* Compose button and bottom bar */
body.sm-has-topbar:not(.sm-desktop) .sm-fab {
    display: flex; align-items: center; gap: 12px; position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 50;
    height: 56px; padding: 0 20px 0 16px; border-radius: 16px; background: var(--sm-compose); color: var(--sm-compose-text) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.3), 0 4px 8px 3px rgba(0,0,0,.15); font: 500 14px var(--sm-font); text-decoration: none !important;
    transition: padding .2s, gap .2s;
}
body.sm-has-topbar:not(.sm-desktop) .sm-fab.sm-fab-small { padding: 0 16px; gap: 0; }
body.sm-has-topbar:not(.sm-desktop) .sm-fab.sm-fab-small .sm-fab-label { display: none; }
body.sm-has-topbar:not(.sm-desktop) #sm-bottomnav {
    display: flex; flex-shrink: 0; height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--sm-card); border-top: 1px solid var(--sm-line); order: 99;
}
body.sm-has-topbar:not(.sm-desktop).action-compose #sm-bottomnav,
body.sm-has-topbar:not(.sm-desktop):has(#layout-content:not(.hidden)):has(#layout-list.hidden) #sm-bottomnav,
body.sm-has-topbar:not(.sm-desktop):has(#layout-list.hidden) .sm-fab { display: none; }
#sm-bottomnav .sm-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    color: var(--sm-text-2) !important; text-decoration: none !important; font: 500 12px var(--sm-font);
}
#sm-bottomnav .sm-nav-icon { position: relative; display: flex; align-items: center; justify-content: center; width: 64px; height: 32px; border-radius: 16px; }
#sm-bottomnav .sm-nav-item.sm-active .sm-nav-icon { background: var(--sm-nav-sel); color: var(--sm-nav-sel-text); }
#sm-bottomnav .sm-nav-badge {
    position: absolute; top: 0; left: 36px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
    background: #B3261E; color: #fff; font-size: 11px; line-height: 16px; text-align: center;
}
#sm-bottomnav .sm-nav-badge[hidden] { display: none; }

#messagelist .sm-snippet:before { content: " - "; }

/* ---------- bulk actions ---------- */
.sm-bulk[hidden], .sm-bulk-btn[hidden] { display: none !important; }
.sm-checkall-li { display: flex; align-items: center; }
.sm-checkall {
    position: relative; width: 40px; height: 40px; margin-right: -10px; border: 0; border-radius: 50%; background: transparent; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.sm-checkall:hover { background: rgba(68,71,70,.08); }
.sm-checkall:before {
    content: ""; width: 14px; height: 14px; border: 2px solid var(--sm-text-2); border-radius: 2px; box-sizing: content-box;
}
.sm-checkall.sm-on:before, .sm-checkall.sm-some:before { background: var(--sm-text-2); }
.sm-checkall.sm-on:after, .sm-checkall.sm-some:after { content: ""; position: absolute; }
.sm-checkall.sm-on:after { width: 5px; height: 10px; border: solid var(--sm-card); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.sm-checkall.sm-some:after { width: 10px; height: 2px; background: var(--sm-card); }
body.sm-desktop.sm-has-topbar #messagelist-header .sm-select-li a.select { width: 22px !important; min-width: 22px !important; padding: 0 !important; }
body.sm-desktop.sm-has-topbar #messagelist-header .sm-select-li a.select:before { content: none !important; }
body.sm-desktop.sm-has-topbar #messagelist-header .sm-select-li a.select:after { margin-left: 0; }
body.sm-desktop #messagelist-header .sm-checkall-li { display: flex !important; }
body:not(.sm-desktop) .sm-checkall-li { display: none !important; }

.sm-bulk { display: flex; align-items: center; gap: 2px; order: 3; flex: 1 1 auto; min-width: 0; margin-left: 8px; }
.sm-bulk-actions { display: flex; align-items: center; gap: 2px; }
.sm-bulk-btn, .sm-bulk-close {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
    border: 0; border-radius: 50%; background: transparent; color: var(--sm-text-2); cursor: pointer;
}
.sm-bulk-btn:hover, .sm-bulk-close:hover { background: rgba(68,71,70,.08); color: var(--sm-text); }
.sm-bulk-btn[data-bulk="delete"]:hover { color: #B3261E; }
.sm-bulk-count { font: 500 14px var(--sm-font); color: var(--sm-text-2); white-space: nowrap; }
.sm-bulk-all { font: 14px var(--sm-font); color: var(--sm-text-2); white-space: nowrap; margin-left: 12px; }
.sm-bulk-all a { color: var(--sm-primary) !important; font-weight: 500; }
body.sm-desktop .sm-bulk-close { display: none; }
body.sm-desktop .sm-bulk-count { order: 2; margin-left: 12px; }
body.sm-desktop .sm-bulk-all { order: 3; }
body.sm-desktop.sm-selecting #messagelist-header .sm-refresh-li,
body.sm-desktop.sm-selecting #messagelist-header #listmenulink { display: none !important; }

/* phone: a selection bar over the top bar, ticked avatars */
body:not(.sm-desktop) .sm-bulk {
    position: fixed; top: 0; left: 0; right: 0; z-index: 70; height: 64px; margin: 0; padding: 0 4px 0 8px; gap: 0;
    background: var(--sm-card); box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
body:not(.sm-desktop) .sm-bulk-count { flex: 1; margin-left: 8px; font-size: 18px; color: var(--sm-text); }
body:not(.sm-desktop) .sm-bulk-all {
    position: absolute; top: 64px; left: 0; right: 0; margin: 0; padding: 10px 16px; background: var(--sm-nav-sel);
    color: var(--sm-nav-sel-text); font-size: 13px; text-align: center;
}
body:not(.sm-desktop) .sm-bulk-all:empty { display: none; }
body:not(.sm-desktop) .sm-bulk-btn[data-bulk="move"] { display: none; }
body.sm-has-topbar:not(.sm-desktop).sm-selecting #messagelist tr.selected { background: var(--sm-row-sel) !important; }
body.sm-has-topbar:not(.sm-desktop).sm-selecting #messagelist tr.selected .sm-avatar-row { background: var(--sm-primary) !important; color: transparent; }
body.sm-has-topbar:not(.sm-desktop).sm-selecting #messagelist tr.selected .sm-avatar-row:after {
    content: ""; position: absolute; width: 8px; height: 16px; border: solid #fff; border-width: 0 3px 3px 0; transform: translateY(-2px) rotate(45deg);
}
html.dark-mode body.sm-has-topbar:not(.sm-desktop).sm-selecting #messagelist tr.selected .sm-avatar-row:after { border-color: #062E6F; }
body.sm-has-topbar:not(.sm-desktop).sm-selecting .sm-fab { display: none; }
body.sm-has-topbar:not(.sm-desktop) #messagelist .sm-avatar-row { cursor: pointer; }

/* ---------- sign-in: show/hide password ---------- */
.sm-eye-wrap { position: relative; }
#rcmloginpwd.sm-has-eye { padding-right: 52px !important; }
.sm-eye {
    position: absolute !important; right: 8px; top: 0; bottom: 0; margin: auto 0 !important; transform: none !important; width: 40px; height: 40px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%;
    background: transparent !important; color: var(--sm-text-3) !important; cursor: pointer; z-index: 5 !important;
}
.sm-eye svg { display: block; }
.sm-eye:hover, .sm-eye:focus-visible { background: rgba(68,71,70,.08); color: var(--sm-text); }

/* ---------- schedule send ---------- */
.sm-send-split { position: relative; display: inline-flex; align-items: stretch; margin-right: 8px; }
.sm-send-split .sm-pop-send { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; margin-right: 0; padding: 0 18px 0 24px; }
.sm-pop-send-more {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; padding: 0; margin-left: 1px;
    border: 0; border-left: 1px solid rgba(255,255,255,.35); border-radius: 0 20px 20px 0; background: var(--sm-primary); color: #fff; cursor: pointer;
}
html.dark-mode .sm-pop-send-more { color: #062E6F; border-left-color: rgba(6,46,111,.35); }
.sm-pop-send-more:hover { box-shadow: 0 1px 3px 1px rgba(60,64,67,.15), 0 1px 2px rgba(60,64,67,.3); }
.sm-send-menu {
    position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 30; min-width: 200px; padding: 6px 0;
    background: var(--sm-card); border-radius: 8px; box-shadow: 0 2px 6px 2px rgba(60,64,67,.15), 0 1px 2px rgba(60,64,67,.3);
}
.sm-send-menu button {
    display: flex; align-items: center; gap: 12px; width: 100%; height: 40px; padding: 0 16px; border: 0;
    background: transparent; color: var(--sm-text); font: 14px var(--sm-font); text-align: left; cursor: pointer;
}
.sm-send-menu button:hover { background: rgba(68,71,70,.08); }

.sm-sched-overlay {
    position: fixed; inset: 0; z-index: 100002; display: flex; align-items: center; justify-content: center;
    background: rgba(32,33,36,.45); padding: 16px;
}
.sm-sched {
    width: 100%; max-width: 380px; padding: 20px 0 12px; border-radius: 16px; background: var(--sm-card); color: var(--sm-text);
    box-shadow: 0 4px 8px 3px rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.3); font-family: var(--sm-font);
}
.sm-sched-title { padding: 0 24px 12px; font-size: 22px; font-weight: 400; }
.sm-sched-list { display: flex; flex-direction: column; }
.sm-sched-item {
    display: flex; align-items: center; gap: 16px; min-height: 48px; padding: 0 24px; border: 0; background: transparent;
    color: var(--sm-text); font: 14px var(--sm-font); text-align: left; cursor: pointer;
}
.sm-sched-item:hover, .sm-sched-item:focus-visible { background: rgba(68,71,70,.08); outline: none; }
.sm-sched-item .sm-sched-name { flex: 1; }
.sm-sched-item .sm-sched-when { color: var(--sm-text-3); white-space: nowrap; }
.sm-sched-pick { border-top: 1px solid var(--sm-line); margin-top: 4px; }
.sm-sched-fields { display: flex; gap: 12px; padding: 4px 24px 8px; }
.sm-sched-fields label { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--sm-text-3); }
.sm-sched-input {
    height: 44px; padding: 0 12px; border: 1px solid #747775; border-radius: 8px; background: var(--sm-card);
    color: var(--sm-text); font: 15px var(--sm-font); color-scheme: light dark;
}
.sm-sched-input:focus { outline: none; border: 2px solid var(--sm-primary); padding: 0 11px; }
.sm-sched-preview { padding: 4px 24px; font-size: 14px; color: var(--sm-text-2); min-height: 20px; }
.sm-sched-error { padding: 0 24px; font-size: 13px; color: #B3261E; min-height: 18px; }
.sm-sched-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px 4px; }
.sm-sched-actions button {
    height: 40px; padding: 0 20px; border-radius: 20px; font: 500 14px var(--sm-font); cursor: pointer;
}
.sm-sched-cancel { border: 0; background: transparent; color: var(--sm-primary); }
.sm-sched-cancel:hover { background: rgba(11,87,208,.08); }
.sm-sched-go { border: 0; background: #0B57D0; color: #fff; }
.sm-sched-go:hover { background: #0842A0; }

.sm-sched-btn { display: inline-flex !important; align-items: center; gap: 8px; margin-left: 8px; }

.sm-sched-banner {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 16px; padding: 10px 16px; border-radius: 12px;
    background: var(--sm-nav-sel); color: var(--sm-nav-sel-text); font: 14px var(--sm-font);
}
.sm-sched-banner-icon { display: inline-flex; }
.sm-sched-banner-text { flex: 1; min-width: 160px; }
.sm-sched-cancel-send {
    height: 36px; padding: 0 16px; border: 1px solid currentColor; border-radius: 18px; background: transparent;
    color: inherit; font: 500 14px var(--sm-font); cursor: pointer;
}
.sm-sched-cancel-send:hover { background: rgba(0,0,0,.06); }
#messagelist span.date.sm-sched-date { color: #B06000 !important; }

/* Scheduled folder: clock icon */
body.sm-desktop.sm-has-topbar #mailboxlist li#rcmliU2NoZWR1bGVk > a:before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}

/* phone compose footer: Schedule button between Save and Send */
.footer .buttons .sm-sched-foot { display: block; text-align: center; color: inherit; text-decoration: none; }
.footer .buttons .sm-sched-foot svg { display: block; flex: none; width: 20px !important; height: 20px !important; margin: 2px auto 3px; }
.footer .buttons .sm-sched-foot::before { display: none !important; }

/* undo send: Gmail-style dark bar at the bottom left */
.sm-compose-win.sm-held { display: none !important; }
.sm-undo-toast {
    position: fixed; left: 24px; bottom: 24px; z-index: 10050; display: flex; align-items: center; gap: 8px;
    min-width: 288px; max-width: calc(100vw - 32px); padding: 6px 8px 6px 20px; border-radius: 8px; overflow: hidden;
    background: #303030; color: #f2f2f2; font: 400 14px var(--sm-font, Roboto, Arial, sans-serif);
    box-shadow: 0 4px 12px rgba(0,0,0,.3); animation: sm-undo-in .18s ease-out;
}
.sm-undo-text { flex: 1; padding: 8px 0; }
.sm-undo-btn {
    border: 0; background: transparent; color: #A8C7FA; font-family: inherit; font-size: 14px; font-weight: 500;
    padding: 8px 12px; border-radius: 4px; cursor: pointer;
}
.sm-undo-btn:hover, .sm-undo-btn:focus-visible { background: rgba(168,199,250,.12); outline: none; }
.sm-undo-now {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
    border: 0; border-radius: 50%; background: transparent; color: #c4c7c5; cursor: pointer;
}
.sm-undo-now:hover { background: rgba(255,255,255,.1); }
.sm-undo-bar {
    position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #A8C7FA;
    transition-property: width; transition-timing-function: linear;
}
.sm-undo-bar.sm-undo-go { width: 0; }
@keyframes sm-undo-in { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
/* phones: full width, above the bottom bar */
@media (max-width: 767px) {
    .sm-undo-toast { left: 8px; right: 8px; bottom: 72px; min-width: 0; }
}

/* signatures: settings list + editor, compose menu, small dialog */
.sm-sigs { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; padding: 8px 0; font-family: var(--sm-font); }
.sm-sig-side { flex: 0 0 240px; max-width: 100%; }
.sm-sig-main { flex: 1 1 360px; min-width: 0; }
.sm-sig-list { list-style: none; margin: 0 0 8px; padding: 0; }
.sm-sig-item { display: flex; align-items: center; border-radius: 8px; }
.sm-sig-item.sm-active { background: #D3E3FD; }
.sm-sig-item:not(.sm-active):hover { background: rgba(68,71,70,.08); }
.sm-sig-name {
    flex: 1; min-width: 0; padding: 10px 12px; border: 0; background: transparent; color: var(--sm-text, #1f1f1f);
    text-align: left; font: 14px var(--sm-font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.sm-sig-item.sm-active .sm-sig-name { font-weight: 500; color: #041E49; }
.sm-sig-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-right: 2px;
    border: 0; border-radius: 50%; background: transparent; color: #444746; cursor: pointer; opacity: 0;
}
.sm-sig-item:hover .sm-sig-icon, .sm-sig-item.sm-active .sm-sig-icon, .sm-sig-icon:focus-visible { opacity: 1; }
.sm-sig-icon:hover { background: rgba(68,71,70,.12); }
.sm-sig-add {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid #747775; border-radius: 20px;
    background: transparent; color: #0B57D0; font: 500 14px var(--sm-font); cursor: pointer;
}
.sm-sig-add:hover { background: rgba(11,87,208,.08); }
.sm-sig-empty { margin: 10px 0; color: #444746; }
.sm-sig-editor-wrap .tox-tinymce { border-radius: 8px; }
.sm-sig-editor-wrap textarea { width: 100%; min-height: 180px; }

.sm-sig-menu { position: fixed; bottom: auto; z-index: 100003; max-height: 60vh; overflow-y: auto; min-width: 220px; }
.sm-sig-menu hr { margin: 6px 0; border: 0; border-top: 1px solid rgba(0,0,0,.12); }
.sm-sig-menu .sm-sig-check { display: inline-flex; width: 18px; color: #0B57D0; }
.sm-sig-menu .sm-sig-manage { padding-left: 46px; }

.sm-dialog-text { margin: 0; padding: 0 24px 8px; color: #444746; font-size: 14px; }
.sm-dialog-input {
    display: block; width: calc(100% - 48px); margin: 4px 24px 4px; height: 44px; padding: 0 12px; box-sizing: border-box;
    border: 1px solid #747775; border-radius: 8px; font: 15px var(--sm-font); background: transparent; color: inherit;
}
.sm-dialog-input:focus { outline: 2px solid #0B57D0; outline-offset: -1px; border-color: transparent; }

/* snooze: Snoozed folder icon, toolbar button */
body.sm-desktop.sm-has-topbar #mailboxlist li#rcmliU25vb3plZA > a:before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}
#toolbar-menu a.sm-snooze-tb::before { display: none !important; }
#toolbar-menu a.sm-snooze-tb svg { display: block; margin: 0 auto 2px; }
#toolbar-menu a.sm-snooze-tb.disabled { opacity: .45; pointer-events: none; }
