/* BEGIN Diskant login layout refinement */
body.task-login { margin: 0; background: #f5f6f8; }
body.task-login #layout-content { margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important; }
body.task-login .wb-login.wb-login-minimal { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 100vh; min-height: 100dvh; padding: 24px; box-sizing: border-box; }
body.task-login .wb-login-minimal .wb-login-card { display: block; width: 100%; max-width: 400px; min-height: 0; margin: 0; padding: 36px 32px 32px; border: 1px solid #e5e8ed; border-radius: 18px; background: #fff; box-shadow: 0 10px 40px rgba(24, 32, 48, .055); box-sizing: border-box; }
body.task-login #wb-login-logo { display: block; width: 172px; height: auto; margin: 0 auto 30px; }
body.task-login #login-form { margin: 0; width: 100%; }
body.task-login #login-form table, body.task-login #login-form tbody { display: block; width: 100%; margin: 0; padding: 0; }
body.task-login #login-form tr.form-group { display: block; width: 100%; margin: 0 0 16px !important; padding: 0; }
body.task-login #login-form td.input { position: relative; display: flex; align-items: center; width: 100%; height: 52px; margin: 0; padding: 0; border: 1px solid #d9dee6; border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; box-sizing: border-box; }
body.task-login #login-form td.input:focus-within { border-color: #bb262b; box-shadow: 0 0 0 3px rgba(187,38,43,.09); }
body.task-login #login-form .input-group-prepend { position: absolute; z-index: 3; left: 16px; top: 0; display: flex; align-items: center; justify-content: center; width: 20px; height: 100%; margin: 0; pointer-events: none; }
body.task-login #login-form .input-group-text { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: #8892a1; font-size: 16px; }
body.task-login #login-form td.input input.form-control { display: block; flex: 1 1 auto; width: 100%; min-width: 0; height: 50px; margin: 0 !important; padding: 12px 14px 12px 46px !important; border: 0 !important; border-radius: 10px !important; outline: none !important; box-shadow: none !important; background: transparent !important; color: #202a38; font-size: 16px; font-weight: 400; line-height: 24px; box-sizing: border-box; }
body.task-login #login-form input::placeholder { color: #87909e; opacity: 1; }
body.task-login #login-form .formbuttons { display: block; margin: 22px 0 0 !important; padding: 0; }
body.task-login #rcmloginsubmit { display: block; width: 100%; height: 50px; margin: 0; padding: 12px 20px; border: 1px solid #b6262b; border-radius: 10px; background: #b6262b; color: #fff; box-shadow: none; font-size: 16px; font-weight: 600; line-height: 24px; letter-spacing: 0; text-transform: none !important; transition: background .15s; }
body.task-login #rcmloginsubmit:hover { background: #9f2025; border-color: #9f2025; }
body.task-login #rcmloginsubmit:focus-visible { outline: 3px solid rgba(182,38,43,.25); outline-offset: 3px; }
body.task-login #login-footer:empty { display: none; }
body.task-login #login-footer { margin: 0; padding: 0; }
html.dark-mode body.task-login { background: #151922; }
html.dark-mode body.task-login .wb-login-minimal .wb-login-card { background: #202632; border-color: #343d4c; box-shadow: 0 10px 40px rgba(0,0,0,.15); }
html.dark-mode body.task-login #login-form td.input { background: #191f29; border-color: #455063; }
html.dark-mode body.task-login #login-form td.input input.form-control { color: #edf0f5; }
html.dark-mode body.task-login #wb-login-logo { content: url("../images/logo-dark.svg"); }
@media (max-width: 480px) { body.task-login .wb-login.wb-login-minimal { padding: 20px; } body.task-login .wb-login-minimal .wb-login-card { padding: 32px 24px 28px; } }
/* END Diskant login layout refinement */


/* Component compatibility fixes for Roundcube 1.7 + Workbench. */
/* The compound field owns its focus ring; its embedded input must not draw another. */
input.form-control:focus-visible, select.form-control:focus-visible,
textarea.form-control:focus-visible, select.custom-select:focus-visible,
.searchbar input:focus-visible { outline: none; outline-offset: 0; }
ul.recipient-input input, ul.recipient-input input:focus,
ul.recipient-input input:focus-visible { border: 0 !important; border-radius: 0 !important; outline: none !important; box-shadow: none !important; background: transparent !important; }
ul.recipient-input li.input { margin: 0; padding: 0; }
ul.recipient-input li.input input { margin: 0 !important; padding: 0 2px !important; height: 28px; line-height: 28px; }
#compose-headers ul.recipient-input { min-height: 40px; padding: 4px 10px; border-radius: 10px 0 0 10px !important; }
#compose-headers .input-group > .input-group-append:last-child > .input-group-text { border-radius: 0 10px 10px 0; }
#compose-headers .input-group-append .input-group-text { min-height: 40px; align-items: center; justify-content: center; }
/* A focused message already has Roundcube's selected-row background. */
.listing td:focus-visible, .listing tr:focus-visible { outline: none; }
.messagelist .wb-row-actions { display: none !important; }
/* Give search its own inset and reserve a stable slot for each action. */
.task-mail #layout-list > .searchbar { position: relative; display: flex; align-items: center; flex: 0 0 auto; width: calc(100% - 24px); height: 40px; min-height: 40px; margin: 10px 12px; padding: 0; border: 1px solid var(--wb-border); border-radius: 10px; box-sizing: border-box; }
.task-mail #layout-list > .searchbar:focus-within { border-color: var(--wb-accent); box-shadow: 0 0 0 2px rgba(204,21,28,.12); }
.task-mail #layout-list > .searchbar form:before { position: absolute; float: none; left: 12px; top: 0; width: 16px; height: 38px; margin: 0; font-size: 16px; line-height: 38px; }
.task-mail #layout-list > .searchbar form { position: relative; display: block; flex: 1 1 0; min-width: 0; width: auto; height: 38px; margin: 0; padding: 0; }
.task-mail #mailsearchform { width: 100%; min-width: 0; height: 38px; margin: 0; padding: 0 10px 0 36px; border: 0 !important; border-radius: 10px; outline: none !important; box-shadow: none !important; background: transparent; font-size: 14px; box-sizing: border-box; }
.task-mail #layout-list > .searchbar .button { position: static; flex: 0 0 32px; width: 32px; height: 32px; margin: 0; padding: 0; line-height: 32px; }
.task-mail #layout-list > .searchbar .button:before { width: 32px; height: 32px; margin: 0; font-size: 16px; line-height: 32px; }
.task-mail #layout-list > .searchbar .button.options { right: 5px; }
.task-mail #layout-list > .searchbar .button.unread { right: 37px; }
.task-mail #layout-list > .searchbar .button.reset { right: 69px; }
/* The avatar is a flex item, not a replacement with the image's old margins. */
#message-header > .header { display: flex; align-items: flex-start; gap: 14px; }
#message-header .wb-avatar-lg, #message-header img.contactphoto { flex: 0 0 46px; width: 46px; height: 46px; margin: 0 !important; }
#message-header .header-content { flex: 1 1 auto; min-width: 0; margin: 0 !important; padding: 0; }
#message-header .header-summary { margin-top: 0; line-height: 1.6; overflow-wrap: anywhere; }
#message-header .header-links { display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px; row-gap: 4px; margin-top: 5px; }
#message-header .header-links a { margin: 0; line-height: 24px; }
/* Long Russian labels should share a row with a compact switch, not a 50% column. */
#compose-options > .form-group.form-check { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 12px; padding: 0; margin: 0 0 14px; }
#compose-options > .form-group.form-check > label { flex: 1 1 auto; max-width: none; width: auto; padding: 0; line-height: 1.5; overflow-wrap: normal; word-break: normal; }
#compose-options > .form-group.form-check > .form-check { flex: 0 0 38px; max-width: 38px; width: 38px; margin: 0; padding: 0; }
/* Login is one card on a background, without another full-screen card. */
body.task-login #layout { background: #f5f6f8; }
body.task-login .wb-login.wb-login-minimal { border: 0; border-radius: 0; background: transparent !important; box-shadow: none; }
html.dark-mode body.task-login #layout { background: #151922; }
@media (max-width: 480px) {
 #message-header { padding: 14px; }
 #message-header > .header { gap: 12px; }
 #message-header .wb-avatar-lg, #message-header img.contactphoto { flex-basis: 38px; width: 38px; height: 38px; font-size: 14px; }
 .task-mail #layout-list > .searchbar { margin: 10px 12px; }
}

/* Search form must not add a second left inset around its input. */
.task-mail #layout-list > .searchbar form { padding: 0; }
.searchbar:focus-within { border-color: var(--wb-accent); box-shadow: 0 0 0 2px rgba(204,21,28,.12); }
a:focus-visible, button:focus-visible, [role="button"]:focus-visible { outline-width: 2px; outline-offset: 2px; }

/* Search icons share one 20px box, centered in the same 38px content row. */
.task-mail #layout-list > .searchbar form:before { top: 50%; width: 20px !important; height: 20px !important; margin: 0 !important; padding: 0 !important; line-height: 20px; transform: translateY(-50%); }
.task-mail #layout-list > .searchbar .button.unread,
.task-mail #layout-list > .searchbar .button.options { display: flex; align-items: center; justify-content: center; }
.task-mail #layout-list > .searchbar .button.unread:before,
.task-mail #layout-list > .searchbar .button.options:before { flex: 0 0 20px; width: 20px !important; height: 20px !important; margin: 0 !important; padding: 0 !important; line-height: 20px; font-size: 18px; transform: none; }
