:root {
  --ntype-green: #03c75a;
  --ntype-green-dark: #00a94f;
  --ntype-green-soft: #e9f9f0;
  --ntype-blue-soft: #eaf3ff;
  --ntype-ink: #17201b;
  --ntype-muted: #6d7771;
  --ntype-border: #e4e9e6;
  --ntype-canvas: #f6f8f7;
  --ntype-sidebar: #f7f9fa;
}

body,
button,
input,
select,
textarea,
.popover {
  color: var(--ntype-ink);
  font-family: Pretendard, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ntype-green-dark); }

.btn-primary,
button.mainaction,
input.button.mainaction,
#rcmloginsubmit {
  border-color: var(--ntype-green) !important;
  color: #fff !important;
  background: var(--ntype-green) !important;
}

.btn-primary:hover,
button.mainaction:hover,
input.button.mainaction:hover,
#rcmloginsubmit:hover {
  border-color: var(--ntype-green-dark) !important;
  background: var(--ntype-green-dark) !important;
}

/* Login */
.task-login #layout-content {
  border-top: 5px solid #263749;
  background:
    radial-gradient(circle at 13% 9%, rgba(3, 199, 90, .1), transparent 34%),
    radial-gradient(circle at 88% 90%, rgba(3, 199, 90, .065), transparent 30%),
    var(--ntype-canvas);
}

.task-login #logo {
  top: 5vh;
  width: 138px;
  max-height: 120px;
  object-fit: contain;
}

.task-login #login-form {
  top: 8vh;
  max-width: 410px;
  padding: 2.15rem;
  border: 1px solid var(--ntype-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(20, 52, 34, .1);
}

.task-login #login-form .form-control {
  min-height: 50px;
  border-color: #dfe5e1;
  border-radius: 9px;
  background: #fbfcfb;
}

.task-login #login-form .form-control:focus {
  border-color: var(--ntype-green);
  background: #fff;
  box-shadow: 0 0 0 .2rem rgba(3, 199, 90, .1);
}

.task-login #rcmloginsubmit {
  min-height: 50px;
  border-radius: 9px;
  font-weight: 750;
}

.task-login #login-footer > div {
  color: var(--ntype-muted);
  background: transparent;
}

/* Shared application surfaces */
#layout-menu {
  border-color: var(--ntype-border);
  background: #fff;
  box-shadow: 1px 0 0 rgba(18, 43, 29, .035);
}

#layout-menu .popover-header {
  background: #fff !important;
}

#layout-menu a,
#layout-menu .button,
#layout-menu a.logout {
  color: #66716b !important;
}

#layout-menu a.selected,
#layout-menu .button.selected,
#layout-menu a:hover,
#layout-menu .button:hover {
  color: var(--ntype-green-dark) !important;
  background-color: var(--ntype-green-soft) !important;
}

#layout-sidebar,
#layout-list,
#layout-content {
  border-color: var(--ntype-border);
}

#layout-sidebar > .header,
#layout-list > .header,
#layout-content > .header {
  border-color: var(--ntype-border);
  color: var(--ntype-ink);
  background: #fff;
}

#layout-sidebar { background: var(--ntype-sidebar); }
#layout-list,
#layout-content { background: #fff; }

.listing li,
.listing tbody td { border-color: #edf0ee; }

.listing li.selected,
.listing li.selected > a,
.listing li.selected > div > a,
.listing tbody tr.selected td {
  color: var(--ntype-ink) !important;
  background-color: var(--ntype-blue-soft) !important;
}

.listing tbody tr:hover td { background-color: #f8faf9; }

.folderlist li.mailbox .unreadcount {
  border-radius: 10px;
  color: #fff;
  background: var(--ntype-green);
}

.searchbar input:focus,
.form-control:focus {
  border-color: var(--ntype-green);
  box-shadow: 0 0 0 .15rem rgba(3, 199, 90, .1);
}

.quota-widget .value { background: var(--ntype-green); }

/* Desktop mail layout: light top bar, compact folder rail, spacious message list */
@media screen and (min-width: 769px) {
  .task-mail #layout {
    position: relative;
    height: 100%;
    padding-top: 62px;
    background: #fff;
  }

  body.task-mail.action-none #layout,
  body.task-mail.action-show #layout {
    left: 0 !important;
    width: 100vw;
    margin-left: 0 !important;
    padding-left: 0 !important;
    transform: none !important;
  }

  .task-mail #layout-menu {
    position: fixed !important;
    z-index: 1000;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    width: 100vw !important;
    max-width: none !important;
    height: 62px;
    flex: 0 0 auto !important;
    margin: 0 !important;
    transform: none !important;
    border-top: 4px solid #263749;
    border-right: 0;
    border-bottom: 1px solid var(--ntype-border);
    background: rgba(255, 255, 255, .98);
  }

  .task-mail #layout-menu .popover-header {
    display: flex !important;
    width: 200px;
    height: 57px;
    flex: 0 0 200px;
    align-items: center;
    justify-content: flex-start;
    padding: 7px 15px !important;
  }

  .task-mail #layout-menu .popover-header img {
    width: 62px;
    height: 51px;
    max-width: 62px;
    max-height: 51px;
    padding: 0;
    object-fit: contain;
  }

  .task-mail #taskmenu {
    position: static;
    display: flex;
    height: 57px;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    padding: 0 10px;
    background: transparent;
  }

  .task-mail #taskmenu > a,
  .task-mail #taskmenu > .special-buttons > a {
    width: 43px;
    height: 43px;
    padding: 0;
    border-radius: 10px;
    line-height: 43px;
  }

  .task-mail #taskmenu > a::before,
  .task-mail #taskmenu > .special-buttons > a::before {
    height: 43px !important;
    margin: 0 !important;
    line-height: 43px;
  }

  .task-mail #taskmenu > a .inner,
  .task-mail #taskmenu > .special-buttons > a .inner {
    display: none;
  }

  .task-mail #taskmenu .special-buttons {
    position: static;
    display: flex;
    background: transparent;
  }

  .task-mail #taskmenu .action-buttons {
    position: static;
  }

  .task-mail #taskmenu .action-buttons .compose {
    position: fixed;
    z-index: 1001;
    top: 75px;
    left: 13px;
    display: flex;
    width: 176px !important;
    min-width: 176px !important;
    max-width: 176px !important;
    height: 43px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0 18px !important;
    border-radius: 9px;
    color: #fff !important;
    background: var(--ntype-green) !important;
    box-shadow: 0 5px 15px rgba(3, 199, 90, .17);
  }

  .task-mail #taskmenu .action-buttons .compose:hover {
    background: var(--ntype-green-dark) !important;
  }

  .task-mail #taskmenu .action-buttons .compose::before {
    width: auto !important;
    height: auto !important;
    margin-right: 7px !important;
    line-height: 1;
  }

  .task-mail #taskmenu .action-buttons .compose .inner {
    display: inline !important;
    overflow: visible;
    font-size: 13px;
    font-weight: 750;
  }

  /* Elastic may clone the compose action into a floating container. Keep the
     cloned control identical to the desktop sidebar action. */
  html:not(.iframe) body.task-mail:not(.action-compose) .floating-action-buttons > a.compose {
    position: fixed !important;
    z-index: 1001;
    top: 75px !important;
    right: auto !important;
    bottom: auto !important;
    left: 13px !important;
    display: flex !important;
    width: 176px !important;
    min-width: 176px !important;
    max-width: 176px !important;
    height: 43px !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0 18px !important;
    border-radius: 9px !important;
    color: #fff !important;
    background: var(--ntype-green) !important;
    box-shadow: 0 5px 15px rgba(3, 199, 90, .17) !important;
  }

  html:not(.iframe) body.task-mail:not(.action-compose) .floating-action-buttons > a.compose::before {
    width: auto !important;
    height: auto !important;
    margin-right: 7px !important;
    line-height: 1 !important;
  }

  html:not(.iframe) body.task-mail:not(.action-compose) .floating-action-buttons > a.compose .inner {
    display: inline !important;
    overflow: visible;
    font-size: 13px;
    font-weight: 750;
  }

  .task-mail .ntype-mail-searchbar {
    position: fixed;
    z-index: 1002;
    top: 12px;
    left: 218px;
    width: min(410px, calc(100vw - 570px));
    height: 36px;
    min-height: 36px;
    border: 0;
    border-radius: 18px;
    background: #f3f6f8;
    box-shadow: none;
  }

  .task-mail .ntype-mail-searchbar form,
  .task-mail .ntype-mail-searchbar input {
    height: 36px;
  }

  .task-mail .ntype-mail-searchbar form {
    min-width: 0;
    align-items: center;
  }

  .task-mail .ntype-mail-searchbar form::before {
    height: 36px;
    margin-left: 14px;
    color: #66716b;
    line-height: 36px;
  }

  .task-mail #mailsearchform {
    position: static;
    width: 100%;
    min-width: 0;
    height: 36px;
    border: 0;
    color: var(--ntype-ink);
    background: transparent;
  }

  .task-mail #mailsearchform:focus { box-shadow: none; }

  .task-mail #layout-sidebar {
    left: 0 !important;
    width: 200px !important;
    min-width: 200px;
    max-width: 200px;
    flex: 0 0 200px;
    margin-left: 0 !important;
    transform: none !important;
    border-right: 1px solid var(--ntype-border);
    background: var(--ntype-sidebar);
  }

  /* The Elastic layout keeps a narrow task-menu flex track in front of the
     mailbox sidebar. Pin the sidebar and main pane to explicit coordinates so
     that track cannot leave a visible gutter. */
  html:not(.iframe) body.task-mail.action-none #layout-sidebar,
  html:not(.iframe) body.task-mail.action-show #layout-sidebar {
    position: fixed !important;
    z-index: 20;
    top: 62px;
    bottom: 0;
    left: 0 !important;
    width: 200px !important;
    height: auto;
    margin: 0 !important;
  }

  html:not(.iframe) body.task-mail.action-none #layout-list,
  html:not(.iframe) body.task-mail.action-show #layout-content {
    width: calc(100vw - 200px) !important;
    max-width: none;
    flex: 0 0 calc(100vw - 200px) !important;
    margin-left: 200px !important;
  }

  .task-mail #layout-sidebar > .header {
    height: 66px;
    min-height: 66px;
    border-bottom: 0;
    background: var(--ntype-sidebar);
  }

  .task-mail #layout-sidebar > .header .header-title,
  .task-mail #layout-sidebar > .header .sidebar-menu {
    visibility: hidden;
  }

  .task-mail #folderlist-content { padding: 0 8px 10px; }

  .task-mail .folderlist li {
    margin: 2px 0;
    border: 0;
    border-radius: 7px;
  }

  .task-mail .folderlist li > a {
    min-height: 37px;
    padding: 0 11px;
    border-radius: 7px;
    color: #4c5751;
    font-size: 13px;
    line-height: 37px;
  }

  .task-mail .folderlist li > a::before { color: #7b867f; }

  .task-mail .folderlist li.selected > a,
  .task-mail .folderlist li > a:hover {
    color: #1767c8 !important;
    background: var(--ntype-blue-soft) !important;
  }

  .task-mail #layout-list {
    min-width: 0;
    max-width: none;
    flex: 1;
    border-right: 1px solid var(--ntype-border);
  }

  html:not(.iframe) body.task-mail.action-none #layout-content {
    display: none;
  }

  .task-mail #layout-list > .header,
  .task-mail #layout-content > .header {
    height: 52px;
    min-height: 52px;
    line-height: 52px;
    background: #fff;
  }

  .task-mail #layout-list > .header {
    justify-content: flex-start;
    gap: 5px;
    padding: 0 10px;
  }

  html:not(.iframe) body.task-mail.action-none #mailtoolbar.ntype-list-mailtoolbar {
    display: flex;
    height: 40px;
    align-items: center;
    gap: 4px;
    margin: 0 0 0 5px;
  }

  html:not(.iframe) body.task-mail.action-none #mailtoolbar.ntype-list-mailtoolbar > a,
  html:not(.iframe) body.task-mail.action-none #mailtoolbar.ntype-list-mailtoolbar > .dropbutton > a {
    display: inline-flex;
    width: auto;
    min-width: 34px;
    height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    border: 1px solid var(--ntype-border);
    border-radius: 7px;
    color: #53605a;
    background: #fff;
    font-size: 12px;
    line-height: 34px;
  }

  html:not(.iframe) body.task-mail.action-none #mailtoolbar.ntype-list-mailtoolbar > a:hover,
  html:not(.iframe) body.task-mail.action-none #mailtoolbar.ntype-list-mailtoolbar > .dropbutton > a:hover {
    color: var(--ntype-green-dark);
    background: var(--ntype-green-soft);
  }

  html:not(.iframe) body.task-mail.action-none #mailtoolbar.ntype-list-mailtoolbar a::before {
    height: 34px !important;
    margin-right: 5px !important;
    line-height: 34px !important;
  }

  html:not(.iframe) body.task-mail.action-none #mailtoolbar.ntype-list-mailtoolbar a .inner {
    display: inline !important;
    overflow: visible;
  }

  html:not(.iframe) body.task-mail.action-none #mailtoolbar.ntype-list-mailtoolbar .disabled {
    opacity: .38;
  }

  .task-mail #layout-list > .header > .ntype-hidden-trigger {
    display: none !important;
  }

  .task-mail .ntype-actionbar {
    display: flex !important;
    height: 51px;
    align-items: center;
    gap: 3px;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #fff;
  }

  .task-mail .ntype-actionbar > li {
    display: block;
    height: 36px;
  }

  .task-mail .ntype-actionbar > li.spacer {
    width: 1px;
    height: 20px;
    margin: 0 4px;
    background: var(--ntype-border);
  }

  .task-mail .ntype-actionbar a {
    display: flex;
    min-width: 36px;
    max-width: none;
    height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid #edf0ee !important;
    border-radius: 7px;
    color: #59645e;
    background: #fff;
    font-size: 12px;
    line-height: 34px;
  }

  .task-mail .ntype-actionbar a::before {
    height: 34px !important;
    margin-right: 5px !important;
    line-height: 34px;
  }

  .task-mail .ntype-actionbar a .inner {
    display: inline !important;
    font-size: 12px;
  }

  .task-mail .ntype-actionbar a:hover {
    color: var(--ntype-green-dark);
    background: var(--ntype-green-soft);
  }

  .task-mail #layout-list > .header > .refresh {
    margin-left: auto;
  }

  .task-mail #messagelist-content { background: #fff; }

  .task-mail #messagelist { table-layout: fixed; }

  /* NTYPE/Naver-style desktop message row: checkbox, star, thread,
     envelope, attachment, sender, subject and date. */
  .task-mail #messagelist.ntype-arranged-list tbody tr {
    display: flex;
    width: 100%;
    min-width: 0;
  }

  .task-mail #messagelist.ntype-arranged-list td.selection {
    display: flex;
    width: 36px;
    min-width: 36px;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    order: 1;
    padding: 0;
  }

  .task-mail #messagelist.ntype-arranged-list td.selection .custom-switch,
  .task-mail #messagelist.ntype-arranged-list td.selection .custom-control-label {
    position: relative;
    width: 36px;
    height: 43px;
    min-height: 43px;
    padding: 0;
  }

  .task-mail #messagelist.ntype-arranged-list td.selection .custom-control-label::before,
  .task-mail #messagelist.ntype-arranged-list td.selection .custom-control-label::after {
    top: 14px;
    left: 10px;
    width: 15px;
    height: 15px;
    margin: 0;
    border-radius: 3px;
    transform: none;
  }

  .task-mail #messagelist.ntype-arranged-list td.selection .custom-control-label::after {
    content: "\f00c";
    color: #fff;
    background: none;
    font-family: Icons;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    line-height: 15px;
    opacity: 0;
    text-align: center;
  }

  .task-mail #messagelist.ntype-arranged-list td.selection .custom-control-input:checked ~ .custom-control-label::after {
    opacity: 1;
    transform: none;
  }

  .task-mail #messagelist.ntype-arranged-list td.flags {
    display: flex;
    width: 34px;
    min-width: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    order: 2;
    padding: 0;
  }

  .task-mail #messagelist.ntype-arranged-list td.flags > span {
    display: inline-flex;
    width: 30px;
    height: 43px;
    align-items: center;
    justify-content: center;
    line-height: 43px;
  }

  .task-mail #messagelist.ntype-arranged-list td.flags span.unflagged::before,
  .task-mail #messagelist.ntype-arranged-list td.flags span.flagged::before {
    width: 18px;
    margin: 0;
    content: "\f005";
    color: #98a29d;
    font-family: Icons;
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    text-align: center;
  }

  .task-mail #messagelist.ntype-arranged-list td.flags span.flagged::before {
    color: #ffc107;
    font-weight: 900;
  }

  .task-mail #messagelist.ntype-arranged-list td.threads {
    display: flex;
    width: 24px;
    min-width: 24px;
    flex: 0 0 24px;
    align-items: center;
    justify-content: center;
    order: 3;
    padding: 0;
  }

  .task-mail .messagelist td {
    height: 43px;
    padding-top: .35rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid #edf0ee;
    vertical-align: middle;
  }

  .task-mail .messagelist tbody tr,
  .task-mail .messagelist td.subject {
    cursor: pointer;
  }

  .task-mail .messagelist td.subject {
    display: grid;
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    grid-template-columns: 22px 20px minmax(120px, 20%) minmax(0, 1fr) 92px;
    grid-template-rows: 32px;
    align-items: center;
    order: 4;
    column-gap: 10px;
    padding-right: 14px;
  }

  .task-mail .messagelist td.subject span {
    min-width: 0;
    line-height: 32px;
  }

  .task-mail .messagelist td.subject span.msgicon.status {
    grid-column: 1;
    grid-row: 1;
  }

  .task-mail .messagelist td.subject span.msgicon.status:not(.replied):not(.forwarded)::before {
    width: 18px;
    height: 32px;
    margin: 0;
    content: "\f0e0";
    color: #99a39e;
    font-size: 15px;
    font-weight: 400;
    line-height: 32px;
  }

  .task-mail .messagelist td.subject span.msgicon.status.unread:not(.replied):not(.forwarded)::before {
    color: #6f9ee8;
    font-weight: 900;
  }

  .task-mail .messagelist td.subject > span.attachment {
    display: flex;
    min-width: 20px;
    height: 32px;
    grid-column: 2;
    grid-row: 1;
    align-items: center;
    justify-content: center;
    color: #98a29d;
    line-height: 32px;
  }

  .task-mail .messagelist td.subject > span.attachment > span::before {
    margin: 0;
    font-size: 14px;
  }

  .task-mail .messagelist td.subject span.fromto {
    grid-column: 3;
    grid-row: 1;
    width: auto;
    padding: 0;
    color: #53605a;
    font-size: 12px;
  }

  .task-mail .messagelist td.subject span.subject {
    grid-column: 4;
    grid-row: 1;
    width: auto;
    overflow: hidden;
  }

  .task-mail .messagelist td.subject span.subject a {
    display: block;
    overflow: hidden;
    color: #253029;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .task-mail .messagelist td.subject span.date {
    grid-column: 5;
    grid-row: 1;
    color: #7b857f;
    text-align: right;
    white-space: nowrap;
  }

  .task-mail .messagelist td.subject span.size { display: none; }

  .task-mail .messagelist tr.unread td.subject span.subject a,
  .task-mail .messagelist tr.unread td.subject span.fromto {
    color: #17201b;
    font-weight: 750;
  }

  .task-mail #layout-content { min-width: 360px; }

  /* Message detail: dense, full-width Naver-style reading surface. */
  html:not(.iframe) body.task-mail.action-show #layout-content {
    min-width: 0;
    flex: 1;
    background: #fff;
  }

  html:not(.iframe) body.task-mail.action-show #layout-content > .header {
    display: flex;
    height: 54px;
    min-height: 54px;
    align-items: center;
    justify-content: flex-start !important;
    padding: 0 18px;
    border-bottom: 1px solid var(--ntype-border);
    line-height: normal;
  }

  html:not(.iframe) body.task-mail.action-show #layout-content > .header > .ntype-list-button {
    display: inline-flex !important;
    width: auto;
    height: 36px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    order: 20;
    margin: 0 0 0 6px;
    padding: 0 12px;
    border: 1px solid var(--ntype-border);
    border-radius: 7px;
    color: #52605a;
    background: #fff;
    font-size: 12px;
    font-weight: 650;
  }

  html:not(.iframe) body.task-mail.action-show #layout-content > .header > .ntype-list-button::before {
    display: none;
  }

  html:not(.iframe) body.task-mail.action-show #layout-content > .header > .ntype-list-button .inner {
    display: inline !important;
  }

  html:not(.iframe) body.task-mail.action-show #layout-content > .header > .header-title {
    display: none;
  }

  html:not(.iframe) body.task-mail.action-show #mailtoolbar {
    display: flex !important;
    width: 100%;
    min-width: 0;
    height: 40px;
    flex: 1 1 0 !important;
    align-items: center;
    justify-content: flex-start !important;
    gap: 4px;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    text-align: left;
    scrollbar-width: none;
  }

  html:not(.iframe) body.task-mail.action-show #mailtoolbar::-webkit-scrollbar {
    display: none;
  }

  html:not(.iframe) body.task-mail.action-show #mailtoolbar > .prev {
    margin-left: auto !important;
  }

  html:not(.iframe) body.task-mail.action-show #mailtoolbar > a,
  html:not(.iframe) body.task-mail.action-show #mailtoolbar > .dropbutton > a {
    display: inline-flex !important;
    float: none !important;
    width: auto !important;
    min-width: 34px !important;
    max-width: none !important;
    height: 34px !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0 10px !important;
    border: 1px solid #dfe5e2 !important;
    border-radius: 6px;
    color: #53605a;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 32px !important;
    text-align: center;
  }

  html:not(.iframe) body.task-mail.action-show #mailtoolbar > .dropbutton {
    display: inline-flex;
    height: 34px;
    flex: 0 0 auto;
    align-items: center;
    overflow: hidden;
    border: 1px solid #dfe5e2;
    border-radius: 6px;
    background: #fff;
  }

  html:not(.iframe) body.task-mail.action-show #mailtoolbar > .dropbutton > a {
    height: 32px !important;
    border: 0 !important;
    border-radius: 0;
  }

  html:not(.iframe) body.task-mail.action-show #mailtoolbar > .dropbutton > a:first-child {
    padding-right: 5px !important;
  }

  html:not(.iframe) body.task-mail.action-show #mailtoolbar > .dropbutton > a.dropdown {
    width: 22px !important;
    min-width: 22px !important;
    padding: 0 !important;
    border-left: 1px solid #edf0ee !important;
  }

  html:not(.iframe) body.task-mail.action-show #mailtoolbar > a:hover,
  html:not(.iframe) body.task-mail.action-show #mailtoolbar > .dropbutton > a:hover {
    border-color: #dfe5e2 !important;
    color: var(--ntype-green-dark);
    background: var(--ntype-green-soft) !important;
  }

  html:not(.iframe) body.task-mail.action-show #mailtoolbar a::before {
    display: inline-block !important;
    float: none !important;
    width: auto !important;
    height: auto !important;
    margin: 0 6px 0 0 !important;
    font-size: 13px;
    line-height: 1 !important;
  }

  html:not(.iframe) body.task-mail.action-show #mailtoolbar a.dropdown::before {
    margin: 0 !important;
  }

  html:not(.iframe) body.task-mail.action-show #mailtoolbar a .inner {
    display: inline !important;
    overflow: visible;
  }

  html:not(.iframe) body.task-mail.action-show #mailtoolbar > .spacer {
    width: 1px;
    height: 20px;
    flex: 0 0 1px;
    margin: 0 4px;
    background: #e5eae7;
  }

  html:not(.iframe) body.task-mail.action-show #layout-content > .frame-content {
    padding: 0 0 56px;
    background: #fff;
  }

  html:not(.iframe) body.task-mail.action-show #message-header,
  html:not(.iframe) body.task-mail.action-show #message-content {
    width: 100%;
    max-width: none;
    margin: 0;
    border: 0;
    background: #fff;
    box-shadow: none;
  }

  html:not(.iframe) body.task-mail.action-show #message-header {
    padding: 17px 20px 15px;
    border-bottom: 1px solid #edf0ee;
    border-radius: 0;
  }

  html:not(.iframe) body.task-mail.action-show #message-header .subject {
    margin: 0 0 12px;
    color: #15201a;
    font-size: 17px;
    font-weight: 750;
    line-height: 1.45;
    letter-spacing: -.015em;
  }

  html:not(.iframe) body.task-mail.action-show #message-header > .header {
    display: flex;
    align-items: flex-start;
    padding: 0;
    border: 0;
    background: transparent;
  }

  html:not(.iframe) body.task-mail.action-show #message-header .contactphoto {
    display: none;
  }

  html:not(.iframe) body.task-mail.action-show #message-header .header-content {
    min-width: 0;
    flex: 1;
  }

  html:not(.iframe) body.task-mail.action-show #message-header .header-summary,
  html:not(.iframe) body.task-mail.action-show #message-header .header-headers {
    color: #46534c;
    font-size: 12px;
    line-height: 1.75;
  }

  html:not(.iframe) body.task-mail.action-show #message-header .header-summary > span {
    margin-right: 10px;
  }

  html:not(.iframe) body.task-mail.action-show #message-header .header-summary a,
  html:not(.iframe) body.task-mail.action-show #message-header .header-headers a {
    color: #23734a;
    font-weight: 650;
  }

  html:not(.iframe) body.task-mail.action-show #message-header .header-links {
    margin-top: 2px;
    font-size: 11px;
  }

  html:not(.iframe) body.task-mail.action-show #message-content {
    display: block;
    min-height: calc(100vh - 245px);
    padding: 24px 20px 80px;
    border-radius: 0;
  }

  html:not(.iframe) body.task-mail.action-show #message-content > .leftcol:empty,
  html:not(.iframe) body.task-mail.action-show #attachment-list:empty {
    display: none;
  }

  html:not(.iframe) body.task-mail.action-show #message-content > .leftcol.ntype-no-attachments {
    display: none !important;
  }

  html:not(.iframe) body.task-mail.action-show #message-content > .leftcol {
    width: 100%;
    margin: 0 0 16px;
  }

  html:not(.iframe) body.task-mail.action-show #message-content > .rightcol {
    width: 100%;
    min-width: 0;
    flex: 1;
  }

  html:not(.iframe) body.task-mail.action-show #messagebody,
  html:not(.iframe) body.task-mail.action-show .message-part,
  html:not(.iframe) body.task-mail.action-show .message-htmlpart,
  html:not(.iframe) body.task-mail.action-show .message-part div.rcmBody,
  html:not(.iframe) body.task-mail.action-show .message-htmlpart div.rcmBody {
    width: 100%;
    max-width: none;
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  html:not(.iframe) body.task-mail.action-show #remote-objects-message {
    margin: 0 0 18px !important;
    padding: 11px 14px;
    border: 1px solid #f0dfa6;
    border-radius: 7px;
    background: #fff8df;
  }

  html:not(.iframe) body.task-mail.action-show #messagebody,
  html:not(.iframe) body.task-mail.action-show .message-part {
    color: #26312b;
    font-size: 13px;
    line-height: 1.85;
  }

  html:not(.iframe) body.task-mail.action-show #messagebody pre {
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: pre-wrap;
    word-break: break-word;
  }

  html:not(.iframe) body.task-mail.action-show .attachmentslist {
    overflow: hidden;
    border: 1px solid var(--ntype-border);
    border-radius: 7px;
    background: #fbfcfb;
  }

  .task-mail .pagenav {
    border-color: var(--ntype-border);
    background: #fff;
  }
}

@media screen and (min-width: 769px) and (max-width: 1080px) {
  .task-mail #layout-menu .popover-header {
    width: 188px;
    flex-basis: 188px;
  }

  .task-mail #layout-menu .popover-header img { width: 58px; height: 48px; }
  .task-mail #layout-sidebar { width: 188px !important; min-width: 188px; max-width: 188px; flex-basis: 188px; }
  html:not(.iframe) body.task-mail.action-none #layout-sidebar,
  html:not(.iframe) body.task-mail.action-show #layout-sidebar { width: 188px !important; }
  html:not(.iframe) body.task-mail.action-none #layout-list,
  html:not(.iframe) body.task-mail.action-show #layout-content {
    width: calc(100vw - 188px) !important;
    flex-basis: calc(100vw - 188px) !important;
    margin-left: 188px !important;
  }
  .task-mail #taskmenu .action-buttons .compose { left: 11px; width: 166px; }
  .task-mail .ntype-mail-searchbar { left: 202px; width: 300px; }

  .task-mail .messagelist td.subject {
    grid-template-columns: 20px 18px minmax(110px, 24%) minmax(0, 1fr) 78px;
    column-gap: 8px;
  }
}

/* Compose, contacts and settings use the same NTYPE workspace language. */
@media screen and (min-width: 769px) {
  body.task-mail.action-compose #layout {
    padding-left: 200px;
  }

  body.task-mail.action-compose #layout::before {
    position: fixed;
    z-index: 0;
    top: 62px;
    bottom: 0;
    left: 0;
    width: 200px;
    border-right: 1px solid var(--ntype-border);
    background: var(--ntype-sidebar);
    content: "";
  }

  body.task-mail.action-compose #layout-content {
    min-width: 520px;
    border-right: 1px solid var(--ntype-border);
    background: #fff;
  }

  body.task-mail.action-compose #layout-content > .header {
    height: 54px;
    min-height: 54px;
    justify-content: flex-start;
    padding: 0 20px;
    line-height: normal;
  }

  body.task-mail.action-compose #layout-sidebar.sidebar-right {
    width: 300px !important;
    min-width: 300px;
    max-width: 300px;
    flex: 0 0 300px;
    border-right: 0;
    border-left: 1px solid var(--ntype-border);
    background: #f8faf9;
  }

  body.task-mail.action-compose #layout-sidebar.sidebar-right > .header {
    height: 54px;
    min-height: 54px;
    padding: 0 18px;
    border-bottom: 1px solid var(--ntype-border);
    background: #fff;
  }

  body.task-mail.action-compose #layout-sidebar.sidebar-right > .header .header-title {
    visibility: visible;
    color: #26322b;
    font-size: 13px;
    text-align: left;
  }

  body.task-mail.action-compose #messagetoolbar {
    display: flex;
    height: 40px;
    align-items: center;
    gap: 4px;
    margin: 0;
  }

  body.task-mail.action-compose #messagetoolbar a {
    display: inline-flex;
    width: auto;
    min-width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid var(--ntype-border);
    border-radius: 7px;
    color: #53605a;
    background: #fff;
    font-size: 12px;
    line-height: 34px;
  }

  body.task-mail.action-compose #messagetoolbar a::before {
    height: 34px !important;
    margin-right: 5px !important;
    line-height: 34px !important;
  }

  body.task-mail.action-compose #messagetoolbar a .inner {
    display: inline !important;
    overflow: visible;
  }

  body.task-mail.action-compose #messagetoolbar a:hover {
    color: var(--ntype-green-dark);
    background: var(--ntype-green-soft);
  }

  body.task-mail.action-compose #compose-content {
    padding: 0;
    background: #fff;
  }

  body.task-mail.action-compose #compose-content > .formcontent {
    padding: 20px 28px 88px;
  }

  body.task-mail.action-compose #compose-headers {
    max-width: 1180px;
    margin: 0 auto;
    padding-bottom: 14px;
    border-bottom: 1px solid #edf0ee;
  }

  body.task-mail.action-compose .compose-headers .form-group {
    align-items: center;
    margin-bottom: 9px;
  }

  body.task-mail.action-compose .compose-headers .col-form-label {
    max-width: 82px;
    flex: 0 0 82px;
    color: #53605a;
    font-size: 12px;
    font-weight: 700;
  }

  body.task-mail.action-compose .compose-headers .col-10 {
    max-width: calc(100% - 82px);
    flex: 0 0 calc(100% - 82px);
  }

  body.task-mail.action-compose .compose-headers .form-control,
  body.task-mail.action-compose .compose-headers .recipient-input {
    min-height: 40px;
    border-color: #dde4e0;
    border-radius: 7px;
    background: #fff;
  }

  body.task-mail.action-compose #composebodycontainer {
    max-width: 1180px;
    min-height: 420px;
    margin: 16px auto 0;
  }

  body.task-mail.action-compose #composebody {
    min-height: 420px;
    padding: 18px;
    border-color: #dde4e0;
    border-radius: 8px;
    color: #26312b;
    font-size: 14px;
    line-height: 1.75;
  }

  body.task-mail.action-compose #compose-content .formbuttons {
    position: sticky;
    z-index: 5;
    bottom: 0;
    margin: 0;
    padding: 12px 28px;
    border-top: 1px solid var(--ntype-border);
    background: rgba(255, 255, 255, .97);
  }

  body.task-mail.action-compose #compose-content .formbuttons .send {
    min-width: 104px;
    height: 42px;
    border-radius: 8px;
    font-weight: 750;
  }

  body.task-mail.action-compose #compose-attachments,
  body.task-mail.action-compose #compose-options {
    padding: 18px;
  }

  body.task-mail.action-compose #compose-attachments {
    border-bottom: 1px solid var(--ntype-border);
  }

  body.task-mail.action-compose #compose-attachments .btn.attach {
    width: 100%;
    min-height: 39px;
    border-color: #dce4df;
    border-radius: 7px;
    color: #445149;
    background: #fff;
  }

  .task-addressbook #layout,
  .task-settings #layout {
    height: 100%;
    padding-top: 62px;
    background: #fff;
  }

  .task-addressbook #layout-menu,
  .task-settings #layout-menu {
    position: fixed;
    z-index: 1000;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    width: auto;
    height: 62px;
    border-top: 4px solid #263749;
    border-right: 0;
    border-bottom: 1px solid var(--ntype-border);
    background: rgba(255, 255, 255, .98);
  }

  .task-addressbook #layout-menu .popover-header,
  .task-settings #layout-menu .popover-header {
    display: flex !important;
    width: 200px;
    height: 57px;
    flex: 0 0 200px;
    align-items: center;
    justify-content: flex-start;
    padding: 7px 15px !important;
    background: #fff !important;
  }

  .task-addressbook #layout-menu .popover-header img,
  .task-settings #layout-menu .popover-header img {
    width: 62px;
    height: 51px;
    max-width: 62px;
    max-height: 51px;
    object-fit: contain;
  }

  .task-addressbook #taskmenu,
  .task-settings #taskmenu {
    position: static;
    display: flex;
    height: 57px;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    padding: 0 10px;
    background: transparent;
  }

  .task-addressbook #taskmenu > a,
  .task-addressbook #taskmenu > .special-buttons > a,
  .task-settings #taskmenu > a,
  .task-settings #taskmenu > .special-buttons > a {
    width: 43px;
    height: 43px;
    padding: 0;
    border-radius: 10px;
    line-height: 43px;
  }

  .task-addressbook #taskmenu > a .inner,
  .task-addressbook #taskmenu > .special-buttons > a .inner,
  .task-settings #taskmenu > a .inner,
  .task-settings #taskmenu > .special-buttons > a .inner {
    display: none;
  }

  .task-addressbook #taskmenu .special-buttons,
  .task-settings #taskmenu .special-buttons {
    position: static;
    display: flex;
    background: transparent;
  }

  .task-addressbook #layout-sidebar,
  .task-settings #layout-sidebar {
    width: 220px !important;
    min-width: 220px;
    max-width: 220px;
    flex: 0 0 220px;
    border-right: 1px solid var(--ntype-border);
    background: var(--ntype-sidebar);
  }

  .task-addressbook #layout-list,
  .task-settings #layout-list {
    width: 310px !important;
    min-width: 310px;
    max-width: 310px;
    flex: 0 0 310px;
    border-right: 1px solid var(--ntype-border);
    background: #fff;
  }

  .task-addressbook #layout-content,
  .task-settings #layout-content {
    min-width: 0;
    flex: 1;
    background: #fff;
  }

  .task-addressbook #layout-sidebar > .header,
  .task-addressbook #layout-list > .header,
  .task-addressbook #layout-content > .header,
  .task-settings #layout-sidebar > .header,
  .task-settings #layout-list > .header,
  .task-settings #layout-content > .header {
    height: 54px;
    min-height: 54px;
    border-color: var(--ntype-border);
    background: #fff;
    line-height: 54px;
  }

  .task-addressbook .listing li,
  .task-settings .listing li {
    min-height: 40px;
    border-color: #edf0ee;
  }

  .task-addressbook .listing li > a,
  .task-settings .listing li > a {
    color: #4c5751;
    font-size: 13px;
  }

  .task-addressbook .listing li.selected > a,
  .task-settings .listing li.selected > a {
    color: #1767c8 !important;
    background: var(--ntype-blue-soft) !important;
  }

  .task-addressbook #addressbooktoolbar,
  .task-settings #folderstoolbar,
  .task-settings #identitiestoolbar,
  .task-settings #responsestoolbar {
    display: flex;
    height: 40px;
    align-items: center;
    gap: 4px;
  }

  .task-addressbook #addressbooktoolbar a,
  .task-settings #folderstoolbar a,
  .task-settings #identitiestoolbar a,
  .task-settings #responsestoolbar a {
    display: inline-flex;
    width: auto;
    min-width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid var(--ntype-border);
    border-radius: 7px;
    color: #53605a;
    background: #fff;
    font-size: 12px;
  }

  .task-addressbook #addressbooktoolbar a .inner,
  .task-settings #folderstoolbar a .inner,
  .task-settings #identitiestoolbar a .inner,
  .task-settings #responsestoolbar a .inner {
    display: inline !important;
  }
}

html.iframe body.task-settings .formcontent,
html.iframe body.task-addressbook .formcontent {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 28px;
}

html.iframe body.task-settings .formbuttons,
html.iframe body.task-addressbook .formbuttons {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 16px 28px 28px;
}

html.iframe body.task-settings .propform .form-control,
html.iframe body.task-settings .propform .custom-select,
html.iframe body.task-addressbook .form-control,
html.iframe body.task-addressbook .custom-select {
  min-height: 40px;
  border-color: #dde4e0;
  border-radius: 7px;
}

@media screen and (max-width: 768px) {
  #layout-menu { background: #fff; }

  #layout-menu .popover-header {
    border-top: 4px solid #263749;
    border-bottom: 1px solid var(--ntype-border);
  }

  #layout-menu .popover-header img {
    width: 64px;
    height: 52px;
    max-width: 64px;
    object-fit: contain;
  }

  #taskmenu a { color: #46514b !important; }

  #taskmenu .action-buttons a {
    color: #fff !important;
    background: var(--ntype-green) !important;
  }

  #layout > div > .header { background: #fff; }

  body.task-mail.action-none #messagelist-header {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  body.task-mail.action-none #messagelist-header::-webkit-scrollbar {
    display: none;
  }

  body.task-mail.action-none #mailtoolbar.ntype-list-mailtoolbar {
    display: flex;
    height: 48px;
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
  }

  body.task-mail.action-none #mailtoolbar.ntype-list-mailtoolbar > a,
  body.task-mail.action-none #mailtoolbar.ntype-list-mailtoolbar > .dropbutton > a {
    display: inline-flex;
    width: 42px;
    min-width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    color: #53605a;
  }

  body.task-mail.action-none #mailtoolbar.ntype-list-mailtoolbar a::before {
    height: 42px !important;
    margin: 0 !important;
    line-height: 42px !important;
  }

  body.task-mail.action-none #mailtoolbar.ntype-list-mailtoolbar a .inner,
  body.task-mail.action-none #mailtoolbar.ntype-list-mailtoolbar .spacer {
    display: none !important;
  }

  body.task-mail.action-compose #compose-content > .formcontent {
    padding: 12px 12px 76px;
  }

  body.task-mail.action-compose .compose-headers .form-group {
    margin-bottom: 8px;
  }

  body.task-mail.action-compose #composebodycontainer,
  body.task-mail.action-compose #composebody {
    min-height: 50vh;
  }

  body.task-mail.action-compose #compose-content .formbuttons {
    position: sticky;
    z-index: 5;
    bottom: 0;
    margin: 0;
    padding: 10px 12px;
    border-top: 1px solid var(--ntype-border);
    background: rgba(255, 255, 255, .97);
  }

  body.task-mail.action-show #layout-content > .frame-content {
    padding: 12px;
    background: var(--ntype-canvas);
  }

  body.task-mail.action-show #message-header {
    padding: 18px 16px 16px;
    border: 1px solid var(--ntype-border);
    border-radius: 11px 11px 0 0;
    background: #fff;
  }

  body.task-mail.action-show #message-header .subject {
    margin-bottom: 15px;
    font-size: 20px;
    line-height: 1.4;
  }

  body.task-mail.action-show #message-content {
    min-height: calc(100vh - 270px);
    margin-top: -1px;
    padding: 22px 16px 50px;
    border: 1px solid var(--ntype-border);
    border-radius: 0 0 11px 11px;
    background: #fff;
  }

  .task-login #login-form {
    top: 7vh;
    width: calc(100% - 2rem);
    padding: 1.5rem;
  }

  .task-login #logo {
    top: 4vh;
    width: 120px;
  }
}
