/* Drafts Mail. Derived from Elastic by the Roundcube Dev Team. CC BY-SA 3.0. */
:root {
  --dm-blue: #0f6cbd;
  --dm-blue-dark: #0b579a;
  --dm-blue-soft: #e8f2fc;
  --dm-text: #242424;
  --dm-muted: #616161;
  --dm-border: #e0e0e0;
  --dm-surface: #f5f5f5;
  --dm-font: "Segoe UI", "Segoe UI Variable", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}
html, body, button, input, select, textarea, .popover, .ui-widget {
  font-family: var(--dm-font);
}
body { color: var(--dm-text); background: var(--dm-surface); }
a { color: var(--dm-blue); }
.btn-primary { background: var(--dm-blue); border-color: var(--dm-blue); }
.btn-primary:hover { background: var(--dm-blue-dark); border-color: var(--dm-blue-dark); }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--dm-blue); outline-offset: 2px; }
#drafts-header, #drafts-ribbon { display: none; }
.listing tr.selected td, .listing li.selected > a { background: var(--dm-blue-soft); color: var(--dm-text); }
.folderlist li.selected > a { background: #dceafa; color: #0c3b5e; box-shadow: inset 3px 0 var(--dm-blue); font-weight: 600; }
.listing li > a:hover, .listing tr:not(.selected):hover td { background-color: #f0f0f0; }
.listing td { border-color: #ededed; }
.folderlist li a { border-radius: 4px; margin: 2px 8px; }
.folderlist li a:before { color: #616161; }
.folderlist li.selected a:before { color: var(--dm-blue); }
.folderlist .unreadcount { background: transparent; color: var(--dm-muted); font-weight: 600; }
.folderlist li.selected .unreadcount { color: #0c3b5e; }
#messagelist tr.unread td.subject a { color: var(--dm-blue-dark); }
#messagelist tr.selected td { border-top-color: #cfe4f9; border-bottom-color: #cfe4f9; }
#messagelist tr.selected { box-shadow: inset 3px 0 var(--dm-blue); }
#messagelist td.subject { padding-top: 12px; padding-bottom: 12px; }
#messagelist td.subject .fromto { font-size: 14px; font-weight: 600; color: var(--dm-text); }
#messagelist td.subject .date { font-size: 11px; color: var(--dm-muted); }
#messagelist td.subject .subject { font-size: 13px; line-height: 1.6; }
#messagelist td.subject .msgicon { margin-right: 6px; }
#layout > div > .header, #layout > div > .footer { background: white; color: var(--dm-text); border-color: var(--dm-border); }
.task-mail #layout-sidebar { background: var(--dm-surface); }
#layout-sidebar > .header { background: transparent; }
#layout-sidebar > .footer { background: transparent; border: 0; }
#layout-list { border-color: var(--dm-border); }
.popover, .popupmenu { border-radius: 6px; box-shadow: 0 4px 16px #0002; }
.toolbar a.button, .header a.button { color: var(--dm-muted); }
.toolbar a:not(.disabled):hover { color: var(--dm-blue); background: #ebf3fc; }
/* Message HTML stays in Roundcube's sanitized content frame. */
html.iframe body.task-mail { background: white; }
html.iframe #message-header { padding: 24px 30px 12px; border-bottom: 1px solid #eeeeee; }
html.iframe #message-header .subject { font-size: 22px; font-weight: 600; color: var(--dm-text); margin-bottom: 22px; line-height: 1.4; }
html.iframe #messagebody { padding: 24px 30px; font-size: 14px; line-height: 1.7; }
html.iframe #message-header .headers { font-size: 13px; }
.task-login #layout { background: radial-gradient(ellipse at 15% 20%, #d9e9f9 0, transparent 52%), linear-gradient(125deg, #f3f7fa, #e8eef5); align-items: center; justify-content: center; }
.task-login #layout-content { width: 420px; max-width: calc(100vw - 32px); flex: initial; padding: 36px 38px 30px; height: auto; min-height: 380px; margin: 0; border: 1px solid #e4e7ec; border-radius: 8px; box-shadow: 0 12px 48px #193b6115; }
.drafts-login-mark { color: var(--dm-blue); margin-bottom: 20px; }
.task-login h1 { font-size: 26px; font-weight: 600; margin: 0 0 8px; text-align: left; }
.drafts-login-description { color: var(--dm-muted); margin-bottom: 26px; font-size: 14px; }
.task-login #login-form { position: static; top: auto; left: auto; width: 100%; max-width: none; margin: 0; }
.task-login #layout-content .drafts-login-description { text-align: left; }
.task-login .form-control { height: 42px; border-radius: 4px; }
.task-login #login-form .button { border-radius: 4px; min-height: 40px; }
.task-login #login-footer { margin-top: 16px; font-size: 12px; color: var(--dm-muted); }
/* Desktop proportions follow the supplied Outlook reference: 44px title bar,
   36px tabs, 42px command bar, 42px app rail and 214px folders. */
#drafts-list-columns, .drafts-list-filters, #drafts-reader-back, .drafts-sender-avatar { display: none; }
.drafts-view-choice { display: block; width: 100%; padding: 9px 18px; border: 0; background: white; text-align: left; color: var(--dm-text); }
.drafts-view-choice:hover { background: #f0f0f0; }
.drafts-view-choice[aria-pressed="true"] { color: var(--dm-blue); font-weight: 600; }
@media (min-width: 1201px) {
  html.drafts-mail:not(.iframe) body:not(.task-login) #layout { padding-top: 44px; }
  html.drafts-mail:not(.iframe) body.drafts-inbox #layout { padding-top: 129px; }
  #drafts-header { display: flex; align-items: center; position: fixed; inset: 0 0 auto; height: 44px; background: var(--dm-blue); color: white; z-index: 102; gap: 0; padding: 0 12px 0 0; }
  .drafts-launcher { display: grid; place-items: center; width: 42px; height: 44px; flex: none; color: white; }
  .drafts-launcher:hover { color: white; background: #ffffff1a; }
  .drafts-brand { width: 214px; flex: none; display: flex; align-items: center; font-size: 15px; font-weight: 600; white-space: nowrap; }
  .drafts-brand svg { display: none; }
  #drafts-search-slot { width: 356px; max-width: 38vw; }
  #drafts-search-slot .searchbar { display: flex; position: static; height: 32px; margin: 0; padding: 0; border: 1px solid #b6cee4; border-radius: 4px; background: #fff; color: #242424; }
  #drafts-search-slot .searchbar input { background: transparent; color: #242424; border: 0; height: 30px; font-size: 13px; }
  #drafts-search-slot .searchbar input::placeholder { color: #424242; }
  #drafts-search-slot .searchbar a { height: 30px; line-height: 30px; color: #53616b; }
  .drafts-account { margin-left: auto; display: flex; align-items: center; gap: 12px; }
  .drafts-account-name { font-size: 12px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
  .drafts-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #ededed; color: #616161; font-weight: 400; }
  #drafts-ribbon { display: block; position: fixed; top: 44px; left: 42px; right: 0; height: 78px; background: var(--dm-surface); z-index: 101; padding: 0 18px 0 6px; }
  .drafts-tabs { height: 36px; display: flex; align-items: center; gap: 22px; padding: 0 14px; font-size: 14px; }
  .drafts-tabs > a { color: #424242; text-decoration: none; }
  .drafts-tabs > a:hover { color: var(--dm-blue); }
  .drafts-tab { align-self: stretch; display: flex; align-items: center; border-bottom: 2px solid var(--dm-blue); font-weight: 600; }
  .drafts-folders-toggle { border: 0; background: transparent; color: #424242; font-size: 18px; padding: 0; margin-right: 2px; }
  .drafts-ribbon-actions { display: flex; align-items: center; height: 42px; padding: 3px; gap: 0; background: white; border: 1px solid #dedede; border-radius: 7px; box-shadow: 0 2px 3px #00000012; overflow-x: auto; scrollbar-width: thin; }
  .drafts-ribbon-actions > a, .drafts-options-slot > a { display: inline-flex; gap: 7px; align-items: center; flex: none; padding: 6px 9px; border-radius: 4px; font-size: 13px; line-height: 20px; color: #424242; text-decoration: none; white-space: nowrap; }
  .drafts-ribbon-actions a:before { font-family: Icons; font-weight: 900; font-size: 14px; width: 16px; text-align: center; }
  .drafts-ribbon-actions a:hover { background: #f0f0f0; }
  .drafts-ribbon-actions a.disabled { opacity: .38; pointer-events: none; }
  .drafts-ribbon-actions a.drafts-new { background: var(--dm-blue); color: white; padding: 6px 14px; margin-right: 5px; }
  .drafts-ribbon-actions a.drafts-new:hover { background: var(--dm-blue-dark); }
  .drafts-options-slot > a.dropdown { padding: 6px 3px; margin-left: -5px; }
  .drafts-options-slot > a.dropdown:before { content: "\f107"; width: 10px; font-size: 11px; }
  .drafts-options-slot a.dropdown .inner { display: none; }
  .drafts-new:before { content: "\f044"; }
  .drafts-delete:before { content: "\f2ed"; color: #909090; }
  .drafts-archive:before { content: "\f187"; color: #6b9c3c; }
  .drafts-reply:before { content: "\f3e5"; color: #aa65bd; }
  .drafts-reply-all:before { content: "\f122"; color: #aa65bd; }
  .drafts-forward:before { content: "\f064"; color: #68a7d3; }
  .drafts-read-all:before { content: "\f2b6"; }
  .drafts-refresh:before { content: "\f2f1"; }
  .drafts-separator { display: block; flex: none; height: 23px; width: 1px; margin: 0 7px; background: #e5e5e5; }
  #drafts-more-slot { display: flex; margin-left: auto; flex: none; }
  #drafts-more-slot #toolbar-menu { height: 32px; min-height: 32px; align-items: center; display: flex; position: static; background: none; border: 0; margin: 0; padding: 0; width: auto; }
  body.drafts-inbox #toolbar-menu > li:has(> .reply, > .dropbutton, > .delete, > .archive, > .compose, > .hidden-big),
  body.drafts-inbox #toolbar-menu > li.spacer { display: none; }
  #drafts-more-slot #toolbar-menu > li { flex: none; width: auto; height: 32px; line-height: 32px; }
  #drafts-more-slot #toolbar-menu a { display: inline-flex; align-items: center; gap: 6px; width: auto; height: 32px; min-width: 0; max-width: none; padding: 0 9px; font-size: 13px; line-height: 32px; white-space: nowrap; color: #424242; border: 0; }
  #drafts-more-slot #toolbar-menu a:before { height: auto; line-height: 32px; font-size: 14px; }
  #drafts-more-slot #toolbar-menu a .inner { display: inline; }
  #layout-menu { background: #f0f0f0; width: 42px; min-width: 42px; position: relative; border: 0; }
  body.drafts-inbox #layout-menu { margin-top: -85px; }
  #layout-menu .popover-header, #taskmenu .action-buttons { display: none; }
  #taskmenu { padding-top: 0; }
  #taskmenu .special-buttons { background: #f0f0f0; }
  #taskmenu a { background: transparent; color: #616161; height: 48px; width: 42px; border-left: 2px solid transparent; }
  #taskmenu a:before { font-size: 18px; height: 48px; line-height: 48px; }
  #taskmenu a.mail { color: #0078d4; }
  #taskmenu a.contacts { color: #009bd9; }
  #taskmenu a.selected { background: #e4eaf0; border-left-color: var(--dm-blue); }
  #taskmenu a:hover { background: #e5e5e5; }
  #taskmenu a .inner { display: none; }
  body.drafts-inbox #layout-sidebar { flex: 0 0 214px; min-width: 214px; max-width: 214px; border: 0; padding: 0 8px; }
  body.drafts-folders-collapsed #layout-sidebar { display: none !important; }
  body.drafts-inbox #layout-sidebar > .header { border: 0; justify-content: flex-start; height: 42px; min-height: 42px; padding: 0 10px; }
  body.drafts-inbox #layout-sidebar .header-title { text-align: left; margin: 0 !important; min-width: 0; font-size: 14px; font-weight: 600; }
  body.drafts-inbox #layout-sidebar .sidebar-menu { display: none; }
  body.drafts-inbox .folderlist li a { display: flex; align-items: center; height: 36px; line-height: 36px; padding: 0 8px 0 26px; margin: 0; border-radius: 4px; font-size: 14px; font-weight: 400; }
  body.drafts-inbox .folderlist li a:before { content: ""; background: url(../images/folder.svg) center / contain no-repeat; margin: 0 10px 0 0; width: 17px; height: 17px; line-height: 17px; float: none; flex: none; }
  body.drafts-inbox .folderlist li.unread > a { padding-right: 8px; }
  body.drafts-inbox .folderlist li.inbox > a:before { background-image: url(../images/inbox.svg); }
  body.drafts-inbox .folderlist li.drafts > a:before { background-image: url(../images/drafts.svg); }
  body.drafts-inbox .folderlist li.sent > a:before { background-image: url(../images/sent.svg); }
  body.drafts-inbox .folderlist li.junk > a:before { background-image: url(../images/junk.svg); }
  body.drafts-inbox .folderlist li.trash > a:before { background-image: url(../images/trash.svg); }
  body.drafts-inbox .folderlist li.archive > a:before { background-image: url(../images/archive.svg); }
  body.drafts-inbox .folderlist li.selected > a { background: #e5e5e5; color: #242424; box-shadow: none; font-weight: 600; }
  body.drafts-inbox .folderlist .unreadcount { position: static; margin-left: auto; padding: 0 0 0 6px; line-height: 36px; height: 36px; background: transparent; color: #005a9e; font-size: 13px; font-weight: 400; }
  body.drafts-inbox #layout-list { display: flex !important; flex: 1 1 0; max-width: none; min-width: 0; margin: 0 12px 8px 0; border: 1px solid var(--dm-border); border-radius: 4px; }
  body.drafts-inbox #messagelist-header { height: 45px; min-height: 45px; padding: 0 36px; justify-content: flex-start; gap: 20px; }
  body.drafts-inbox #layout-list #messagelist-header .header-title { display: none; }
  .drafts-list-filters { display: flex; align-items: center; align-self: stretch; gap: 20px; }
  .drafts-list-filters input { width: 15px; height: 15px; accent-color: var(--dm-blue); }
  .drafts-list-filters button { position: relative; height: 100%; border: 0; padding: 0 2px; background: none; color: #616161; font-size: 14px; }
  .drafts-list-filters button.active { color: #242424; font-weight: 600; }
  .drafts-list-filters button.active:after { content: ""; position: absolute; height: 3px; left: 2px; right: 2px; bottom: 5px; border-radius: 3px; background: #0078d4; }
  body.drafts-inbox #messagelist-header > .refresh { display: none; }
  body.drafts-inbox #messagelist-header .toolbar { order: 1; flex: none; margin-left: auto; }
  body.drafts-inbox #messagelist-header .toolbar a { min-width: 32px; width: 32px; padding: 0; }
  body.drafts-inbox #messagelist-header .toolbar a .inner { display: none; }
  #drafts-list-columns { display: grid; grid-template-columns: 190px minmax(0, 1fr) 102px; height: 36px; min-height: 36px; padding: 0 54px 0 68px; align-items: center; border-bottom: 1px solid var(--dm-border); color: #424242; font-size: 13px; background: white; gap: 8px; }
  body.drafts-inbox:not(.drafts-pane-right) #messagelist td.subject { display: grid; grid-template-columns: 28px 190px minmax(0, 1fr) 102px; gap: 8px; align-items: center; padding: 4px 8px 4px 28px; box-sizing: border-box; height: 38px; line-height: 28px; position: relative; }
  body.drafts-inbox:not(.drafts-pane-right) #messagelist td.subject > span { line-height: 28px; min-width: 0; }
  body.drafts-inbox:not(.drafts-pane-right) #messagelist td.subject > .fromto { grid-column: 2; grid-row: 1; padding: 0; font-size: 14px; font-weight: 400; color: #242424; }
  body.drafts-inbox:not(.drafts-pane-right) #messagelist td.subject > .subject { grid-column: 3; grid-row: 1; width: auto; font-size: 14px; font-weight: 400; }
  body.drafts-inbox:not(.drafts-pane-right) #messagelist td.subject > .subject a { display: block; overflow: hidden; text-overflow: ellipsis; color: #242424; }
  body.drafts-inbox:not(.drafts-pane-right) #messagelist td.subject > .date { grid-column: 4; grid-row: 1; font-size: 12px; color: #424242; text-align: right; }
  body.drafts-inbox:not(.drafts-pane-right) #messagelist td.subject > .size { display: none; }
  body.drafts-inbox:not(.drafts-pane-right) #messagelist td.subject .msgicon { display: none; }
  body.drafts-inbox:not(.drafts-pane-right) #messagelist .drafts-sender-avatar { display: block; grid-column: 1; grid-row: 1; width: 28px; height: 28px; border-radius: 50%; text-align: center; color: #424242; font-size: 12px; font-weight: 400; }
  .drafts-color-0 { background: #efb9bc; } .drafts-color-1 { background: #9ee5ec; } .drafts-color-2 { background: #e7baf0; }
  .drafts-color-3 { background: #ddc2b0; } .drafts-color-4 { background: #d7d7d7; } .drafts-color-5 { background: #f2c6b2; }
  body.drafts-inbox:not(.drafts-pane-right) #messagelist tr.unread td.subject:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #0f6cbd; }
  body.drafts-inbox:not(.drafts-pane-right) #messagelist tr.unread td.subject > .fromto,
  body.drafts-inbox:not(.drafts-pane-right) #messagelist tr.unread td.subject > .subject a { color: #006bc4; font-weight: 600; }
  body.drafts-inbox:not(.drafts-pane-right) #messagelist tr.unread td.subject > .date { color: #006bc4; }
  body.drafts-inbox:not(.drafts-pane-right) #messagelist td.flags { width: 42px; padding: 4px 5px; line-height: 0; vertical-align: middle; white-space: nowrap; }
  body.drafts-inbox:not(.drafts-pane-right) #messagelist td.flags > span { display: inline-block; height: 24px; line-height: 24px; }
  /* Elastic resizes panes with inline display values; explicit desktop state wins. */
  body.drafts-inbox #layout-content { display: none !important; min-width: 0; margin: 0 12px 8px 0; border: 1px solid var(--dm-border); border-radius: 4px; overflow: hidden; }
  body.drafts-inbox.drafts-reading:not(.drafts-pane-right) #layout-list { display: none !important; }
  body.drafts-inbox.drafts-reading #layout-content, body.drafts-inbox.drafts-pane-right #layout-content { display: flex !important; flex: 1 1 0; }
  body.drafts-inbox #layout-content > .header { height: 44px; min-height: 44px; justify-content: flex-start; padding: 0 14px; }
  body.drafts-inbox #layout-content > .header .header-title { display: none; }
  #drafts-reader-back { display: inline-flex; border: 0; border-radius: 4px; color: #424242; background: none; font-size: 14px; padding: 6px 8px; }
  #drafts-reader-back:hover { background: #f0f0f0; }
  body.drafts-inbox.drafts-pane-right #layout-list { flex: 0 0 360px; margin-right: 0; border-radius: 4px 0 0 4px; }
  body.drafts-inbox.drafts-pane-right #layout-content { border-left: 0; border-radius: 0 4px 4px 0; }
  body.drafts-pane-right #layout-content > .header { display: none; }
  body.drafts-pane-right #messagelist-header { padding: 0 14px; gap: 8px; }
  body.drafts-pane-right #drafts-list-columns, body.drafts-pane-right #messagelist-header .header-title { display: none !important; }
  body.drafts-pane-right #messagelist td.subject { padding: 8px 0; }
  body.drafts-inbox #layout-list > .pagenav { justify-content: flex-end; gap: 8px; background: white; font-weight: 400; height: 32px; min-height: 32px; padding: 0 12px; }
  body.drafts-inbox #layout-list > .pagenav > a { flex: none; width: 26px; line-height: 32px; height: 32px; }
  body.drafts-inbox #layout-list > .pagenav .pagenav-text { margin-right: auto; font-weight: 400; }
}
@media (max-width: 1200px) {
  #layout-menu, #taskmenu { background: #f0f0f0; }
  #taskmenu a { color: #616161; }
  #taskmenu a.selected { background: #dceafa; color: var(--dm-blue); }
  #taskmenu .action-buttons a { background: var(--dm-blue); color: white; }
  html.iframe #message-header { padding: 16px; }
  html.iframe #messagebody { padding: 16px; }
}
