/* Maxlevel Mail: a light, familiar mail layout over Roundcube Elastic. */
:root {
  --ml-canvas: #f6f8fc;
  --ml-white: #ffffff;
  --ml-text: #202124;
  --ml-muted: #5f6368;
  --ml-line: #e0e3e7;
  --ml-blue: #0b57d0;
  --ml-blue-soft: #d3e3fd;
  --ml-compose: #c2e7ff;
}

html, body { background: var(--ml-canvas); color: var(--ml-text); font-family: Arial, Roboto, sans-serif; }
body.task-login { background: var(--ml-canvas); }
body.task-login #layout-content { background: var(--ml-canvas); }
body.task-login .maxlevel-login-brand { display: inline-flex; align-items: center; gap: 10px; position: relative; top: 17vh; }
body.task-login #login-form { max-width: 360px; top: 21vh; padding: 28px 26px 20px; border-radius: 20px; background: var(--ml-white); box-shadow: 0 10px 35px #20212414; }
body.task-login #login-form input.form-control { border-radius: 8px; min-height: 42px; }
body.task-login #rcmloginsubmit { width: 100%; border-radius: 20px; min-height: 40px; background: #0b57d0; border-color: #0b57d0; font-weight: 600; }

.maxlevel-brand { display: inline-flex; align-items: center; gap: 10px; color: #3c4043; text-decoration: none !important; white-space: nowrap; }
.maxlevel-mark { display: inline-grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; background: #1a73e8; color: white; font-size: 21px; font-weight: 800; letter-spacing: -3px; padding-right: 3px; }
.maxlevel-wordmark { font-size: 21px; font-weight: 400; letter-spacing: -0.7px; }
.maxlevel-wordmark strong { font-weight: 600; }

@media screen and (min-width: 901px) {
  body:not(.task-login) #layout { box-sizing: border-box; height: 100vh; padding-top: 64px; background: var(--ml-canvas); }
  body:not(.task-login) #layout-menu {
    position: fixed; z-index: 1000; top: 0; left: 0; right: 0;
    width: 100%; height: 64px; display: flex; align-items: center;
    background: var(--ml-canvas); border: 0;
  }
  body:not(.task-login) #layout-menu .popover-header {
    display: flex; flex: 0 0 230px; box-sizing: border-box; align-items: center;
    justify-content: flex-start; width: 230px; height: 64px; padding: 0 16px !important;
    background: transparent !important; text-align: left;
  }
  body:not(.task-login) #layout-menu .popover-header .maxlevel-brand { display: inline-flex !important; }
  body:not(.task-login) #taskmenu {
    display: flex; flex: 1; align-items: center; justify-content: flex-end;
    position: relative; height: 64px; padding: 0 18px; gap: 2px; background: transparent;
  }
  body:not(.task-login) #taskmenu > a,
  body:not(.task-login) #taskmenu .special-buttons a {
    width: 40px; height: 40px; min-width: 40px; padding: 0 !important;
    margin: 0 3px; border-radius: 50%; color: var(--ml-muted) !important;
    background: transparent !important; line-height: 40px; text-align: center;
  }
  body:not(.task-login) #taskmenu > a:hover,
  body:not(.task-login) #taskmenu .special-buttons a:hover { background: #e8eaed !important; color: var(--ml-text) !important; }
  body:not(.task-login) #taskmenu > a .inner,
  body:not(.task-login) #taskmenu .special-buttons a .inner { display: none; }
  body:not(.task-login) #taskmenu > a:before,
  body:not(.task-login) #taskmenu .special-buttons a:before { float: none; display: inline-block; line-height: 40px; font-size: 19px; }
  body:not(.task-login) #taskmenu > a.mail { display: none; }
  body:not(.task-login) #taskmenu .special-buttons { display: flex; position: static; width: auto; background: transparent; }
  body:not(.task-login) #taskmenu .special-buttons a.about { display: none; }
  body:not(.task-login) #taskmenu .special-buttons a.logout { color: var(--ml-muted) !important; }
  body:not(.task-login) #taskmenu .action-buttons { position: fixed; z-index: 1050; left: 8px; top: 75px; }
  body:not(.task-login) #taskmenu .action-buttons a.compose {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    width: 136px; max-width: none; height: 55px; padding: 0 16px !important; border-radius: 16px;
    background: var(--ml-compose) !important; color: #001d35 !important;
    box-shadow: none; font-size: 14px; font-weight: 600;
  }
  body:not(.task-login) #taskmenu .action-buttons a.compose:hover { background: #b2d8f4 !important; }
  body:not(.task-login) #taskmenu .action-buttons a.compose:before { color: #001d35; font-size: 20px; line-height: 1; }
  body:not(.task-login) #taskmenu .action-buttons a.compose .inner { display: inline; font-size: 14px; padding: 0; }
  body:not(.task-mail) #taskmenu .action-buttons,
  body.task-mail:not(.action-none) #taskmenu .action-buttons { display: none; }
  body.task-mail.action-compose #layout-content { background: var(--ml-white); }
  body.task-mail.action-compose #layout-content .btn-primary { background: #0b57d0; border-color: #0b57d0; border-radius: 18px; }

  body.task-mail #layout-sidebar {
    flex: 0 0 230px !important; width: 230px !important; min-width: 230px; max-width: 230px;
    box-sizing: border-box; padding: 75px 0 10px; border: 0; background: var(--ml-canvas);
  }
  body.task-mail #layout-sidebar > .header { display: none; }
  body.task-mail #layout-sidebar > .footer { background: transparent; border: 0; color: var(--ml-muted); }
  body.task-mail #folderlist-content { background: transparent; }
  body.task-mail .folderlist li.mailbox.root { display: none !important; }
  body.task-mail .folderlist li > a {
    display: block; box-sizing: border-box; height: 34px; line-height: 34px;
    margin: 1px 10px 1px 0; padding: 0 18px 0 24px !important;
    border-radius: 0 18px 18px 0; color: #444746;
    font-size: 14px; font-weight: 500; text-decoration: none;
  }
  body.task-mail .folderlist li > a:hover { background: #e7ebf2; }
  body.task-mail .folderlist li.selected > a,
  body.task-mail .folderlist li.focused > a { background: var(--ml-blue-soft); color: #001d35; font-weight: 700; }
  body.task-mail .folderlist li > a:before { color: #444746; margin-right: 16px; font-size: 16px; }
  body.task-mail .folderlist li.selected > a:before { color: #001d35; }
  body.task-mail .folderlist li.mailbox .unreadcount { margin: 6px 0; border-radius: 10px; background: transparent; color: #001d35; font-size: 12px; }

  body.task-mail #layout-list {
    flex: 0 1 48% !important; width: 48% !important; max-width: none; min-width: 370px;
    box-sizing: border-box; border: 0; border-right: 1px solid var(--ml-line);
    border-radius: 16px 0 0 0; background: var(--ml-white);
  }
  body.task-mail #layout-content { flex: 1 1 0; min-width: 0; width: auto; border-radius: 0 16px 0 0; background: var(--ml-white); }
  body.task-mail #layout-list > .header,
  body.task-mail #layout-content > .header {
    justify-content: flex-start; height: 50px; min-height: 50px; line-height: 50px;
    padding: 0 14px; border-bottom: 1px solid var(--ml-line);
    background: var(--ml-white); color: var(--ml-muted);
  }
  body.task-mail #layout-list > .header a.button,
  body.task-mail #layout-content > .header a.button { color: var(--ml-muted); }
  body.task-mail #layout-list > .header .toolbar { margin-left: 0; }
  body.task-mail #layout-list > .header .header-title { display: none; }
  body.task-mail #layout-list > .header a.button:hover,
  body.task-mail #layout-content > .header a.button:hover { color: var(--ml-blue); }
  body.task-mail #layout-list > .searchbar {
    position: fixed; z-index: 1040; top: 8px; left: 230px;
    width: min(650px, calc(100vw - 620px)); height: 48px; min-height: 48px;
    line-height: 48px; border: 0; border-radius: 25px;
    background: #e9eef6; color: var(--ml-text); overflow: visible;
  }
  body.task-mail #layout-list > .searchbar form:before { height: 48px; line-height: 48px; margin-left: 18px; color: #444746; }
  body.task-mail #layout-list > .searchbar input { font-size: 16px; color: var(--ml-text); }
  body.task-mail #layout-list > .searchbar a:before { height: 48px; line-height: 48px; }
  body.task-mail #layout-list > .searchbar a.options { padding-right: 10px; }
  body.task-mail #searchmenu { position: fixed; z-index: 1200; top: 58px; left: 230px; width: min(650px, calc(100vw - 620px)); max-height: calc(100vh - 80px); box-shadow: 0 8px 22px #20212433; background: white; }
  body.task-mail #messagelist-content { background: var(--ml-white); }
  body.task-mail #messagelist { width: 100%; border-collapse: collapse; }
  body.task-mail #messagelist tbody tr.message { display: flex; align-items: center; min-width: 0; height: 43px; border-bottom: 1px solid #eef0f3; background: #fff; color: var(--ml-text); }
  body.task-mail #messagelist tbody tr.message:hover { background: #f2f6fc; box-shadow: inset 0 -1px 0 #e7eaf0; }
  body.task-mail #messagelist tbody tr.message.selected,
  body.task-mail #messagelist tbody tr.message.focused { background: #e8f0fe; }
  body.task-mail #messagelist tbody tr.message.unread { background: #fff; font-weight: 700; }
  body.task-mail #messagelist tbody tr.message td { box-sizing: border-box; border: 0; height: 43px; padding-top: 0; padding-bottom: 0; vertical-align: middle; font-size: 13px !important; }
  body.task-mail #messagelist tbody tr.message td.selection { order: 0; display: flex; flex: 0 0 29px; align-items: center; justify-content: center; padding: 0 0 0 5px; }
  body.task-mail #messagelist tbody tr.message td.flags { order: 1; display: flex; flex: 0 0 25px; align-items: center; padding: 0; }
  body.task-mail #messagelist tbody tr.message td.flags .attachment { display: none; }
  body.task-mail #messagelist tbody tr.message td.flags .flag { height: auto; line-height: 1; }
  body.task-mail #messagelist tbody tr.message td.flags span.unflagged:before,
  body.task-mail #messagelist tbody tr.message td.flags span.flagged:before { content: "\f005"; font-family: Icons; font-weight: 400; color: #9aa0a6; font-size: 15px; }
  body.task-mail #messagelist tbody tr.message td.flags span.flagged:before { font-weight: 900; color: #f4b400; }
  body.task-mail #messagelist tbody tr.message td.subject { order: 2; display: flex; flex: 1 1 auto; align-items: center; flex-wrap: nowrap; min-width: 0; width: auto; padding: 0 12px 0 4px; }
  body.task-mail #messagelist tbody tr.message td.subject span.fromto { order: 0; flex: 0 0 32%; min-width: 0; padding: 0 12px 0 0; color: var(--ml-text); font-size: 13px; white-space: nowrap; }
  body.task-mail #messagelist tbody tr.message td.subject span.subject { order: 1; flex: 1 1 auto; min-width: 0; width: auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 43px; }
  body.task-mail #messagelist tbody tr.message td.subject span.subject a { color: var(--ml-text); cursor: pointer; }
  body.task-mail #messagelist tbody tr.message td.subject span.date { order: 2; flex: 0 0 73px; padding-left: 8px; color: var(--ml-muted); font-size: 11px; text-align: right; white-space: nowrap; }
  body.task-mail #messagelist tbody tr.message td.subject span.size { display: none; }
  body.task-mail #messagelist tbody tr.message td.subject span.msgicon.status { display: none; }
  body.task-mail #layout-list > .footer { height: 34px; min-height: 34px; line-height: 34px; border-top: 1px solid var(--ml-line); background: var(--ml-white); color: var(--ml-muted); font-size: 12px; }
  body.task-mail #layout-content:has(#messagecontframe[src*="watermark.html"]) > .header { visibility: hidden; }
  body.task-mail #layout-list:has(#messagelist tr.message.selected) + #layout-content > .header { visibility: visible; }
  body.task-mail.action-none #layout-list:not(:has(#messagelist tr.message.selected)) + #layout-content .iframe-wrapper { position: relative; }
  body.task-mail.action-none #layout-list:not(:has(#messagelist tr.message.selected)) + #layout-content .iframe-wrapper::before {
    content: "✉"; position: absolute; z-index: 2; top: calc(50% - 38px); left: 50%;
    transform: translate(-50%, -50%); width: 68px; height: 68px; border-radius: 50%;
    background: #e8f0fe; color: #0b57d0; font-size: 32px; line-height: 68px; text-align: center;
  }
  body.task-mail.action-none #layout-list:not(:has(#messagelist tr.message.selected)) + #layout-content .iframe-wrapper::after {
    content: "No conversations selected"; position: absolute; z-index: 2; top: calc(50% + 30px); left: 50%;
    transform: translateX(-50%); color: var(--ml-muted); font-size: 14px; white-space: nowrap;
  }
  body.task-mail #layout-content .iframe-wrapper { background: var(--ml-white); }
}

@media screen and (max-width: 900px) {
  body:not(.task-login) #layout-menu { background: var(--ml-canvas); }
  body:not(.task-login) #layout-menu .popover-header { background: var(--ml-canvas) !important; }
  body:not(.task-login) #layout-menu .maxlevel-wordmark { display: none; }
  body:not(.task-login) #layout-sidebar,
  body:not(.task-login) #layout-list,
  body:not(.task-login) #layout-content { background: var(--ml-white); }
}

/* Desktop compose window. The mail list and folder sidebar remain visible. */
.ml-compose-panel {
  position: fixed; z-index: 2000; right: 32px; bottom: 0;
  display: flex; flex-direction: column; width: min(650px, calc(100vw - 280px));
  height: min(670px, calc(100vh - 90px)); overflow: hidden;
  background: #fff; border-radius: 10px 10px 0 0;
  box-shadow: 0 4px 22px #20212455;
}
.ml-compose-panel[hidden] { display: none; }
.ml-compose-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  flex: 0 0 42px; padding: 0 10px 0 16px;
  background: #f2f6fc; color: #202124; font-size: 14px; font-weight: 600;
}
.ml-compose-window-actions { display: flex; align-items: center; gap: 2px; }
.ml-compose-window-actions button {
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 4px;
  background: transparent; color: #444746; font: 20px/30px Arial, sans-serif; cursor: pointer;
}
.ml-compose-window-actions button:hover { background: #dce3ed; }
.ml-compose-frame { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: #fff; }
.ml-compose-panel.ml-compose-minimized { height: 42px; }
.ml-compose-panel.ml-compose-minimized .ml-compose-frame { display: none; }
.ml-compose-panel.ml-compose-expanded { width: min(900px, calc(100vw - 260px)); height: calc(100vh - 75px); }

/* The framed page keeps Roundcube's own form, editor, draft and upload logic. */
html.ml-embedded-compose, html.ml-embedded-compose body { width: 100%; height: 100%; overflow: hidden; background: #fff; }
html.ml-embedded-compose body #layout { display: flex; width: 100%; height: 100%; padding: 0; background: #fff; }
html.ml-embedded-compose body #layout-menu,
html.ml-embedded-compose body #layout-sidebar { display: none !important; }
html.ml-embedded-compose body #layout-content {
  display: flex !important; flex: 1 1 auto !important; width: 100% !important;
  min-width: 0; height: 100%; border: 0; border-radius: 0; background: #fff;
}
html.ml-embedded-compose body #layout-content > .header { display: none !important; }
html.ml-embedded-compose body #layout-content > .footer { display: none !important; }
html.ml-embedded-compose body #layout-content > .header .task-menu-button,
html.ml-embedded-compose body #layout-content > .header .header-title { display: none !important; }
html.ml-embedded-compose body #compose-content { display: flex !important; flex: 1 1 auto; min-height: 0; overflow: hidden; }
html.ml-embedded-compose body #compose-content form.formcontent.scroller {
  display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0;
  padding: 0 12px; overflow: auto;
}
html.ml-embedded-compose body #compose-headers .form-group { margin-bottom: 0; }
html.ml-embedded-compose body #composebodycontainer { flex: 1 1 auto; min-height: 120px; }
html.ml-embedded-compose body #composebodycontainer textarea { height: 100% !important; min-height: 120px; }
html.ml-embedded-compose body #compose-content .formbuttons {
  display: flex !important; align-items: center; justify-content: flex-start;
  gap: 10px; flex: 0 0 54px; padding: 8px 12px;
}
html.ml-embedded-compose body #compose-content .formbuttons .send {
  order: -2; flex: 0 0 auto; width: auto; min-width: 82px; height: 36px;
  padding: 0 17px; border-radius: 18px; background: #0b57d0; color: #fff;
  font-size: 14px; font-weight: 600; line-height: 36px;
}
html.ml-embedded-compose body #compose-content .formbuttons .save { order: 2; margin-left: auto; }
html.ml-embedded-compose body #compose-content .formbuttons .ml-compose-attach {
  order: -1; height: 34px; padding: 0 12px; border: 0; border-radius: 17px;
  background: transparent; color: #444746; cursor: pointer;
}
html.ml-embedded-compose body #compose-content .formbuttons .ml-compose-attach:hover { background: #e8eaed; }
html.ml-embedded-compose body #compose-content .formbuttons .extwin { display: none !important; }

@media screen and (max-width: 900px) {
  .ml-compose-panel { display: none !important; }
}
