/* NextFound Mail — layout layer
   Sits on top of styles.min.css (Roundcube Elastic recompiled with NextFound tokens).
   Desktop layout (>= 1024px) is fully custom; tablets and phones keep the adaptive
   panel behaviour underneath, in NextFound colours. */

:root {
  --nf-ink: #0F1A2B;
  --nf-ink-2: #1B2A40;
  --nf-ink-3: #24364F;
  --nf-red: #E23B2E;
  --nf-red-press: #C42F23;
  --nf-paper: #EEF1F5;
  --nf-paper-2: #F6F8FA;
  --nf-slate: #5C6878;
  --nf-mute: #8C96A4;
  --nf-line: #E1E5EB;
  --nf-line-2: #CDD4DD;
  --nf-white: #FFFFFF;
  --nf-surface: #FFFFFF;
  --nf-text: #0F1A2B;
  --nf-text-2: #3A4556;
  --nf-top: 48px;
  --nf-nav: 216px;
  --nf-list: clamp(320px, 30vw, 440px);
  --nf-row: 36px;
  --nf-tab: 58px;
  --nf-cut: 8px;
  --nf-font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html.dark-mode {
  --nf-paper: #0B1422;
  --nf-paper-2: #17263B;
  --nf-surface: #111D2E;
  --nf-line: #22324A;
  --nf-line-2: #33465F;
  --nf-text: #E3E8EF;
  --nf-text-2: #B7C1CE;
  --nf-slate: #93A0B2;
  --nf-mute: #6F7D90;
}

body, button, input, select, textarea, .popover {
  font-family: var(--nf-font);
}

kbd.nf-kbd {
  display: inline-block;
  padding: 1px 5px;
  font: 500 11px/16px var(--nf-font);
  color: inherit;
  opacity: .7;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 0;
  box-shadow: none;
  white-space: nowrap;
}

/* ================================================================
   Desktop shell
   ================================================================ */

@media screen and (min-width: 1024px) {

  /* grid: top bar across, navigation column, work area */
  #layout {
    display: grid !important;
    grid-template-columns: var(--nf-nav) minmax(0, 1fr);
    grid-template-rows: var(--nf-top) minmax(0, 1fr);
    height: 100%;
  }

  #layout > #layout-sidebar.hidden,
  #layout > #layout-list.hidden,
  #layout > #layout-content.hidden {
    display: flex !important;
  }

  /* ---------- top bar ---------- */

  #layout-menu.nf-topbar {
    grid-column: 1 / -1;
    grid-row: 1;
    position: relative;
    z-index: 20;
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    width: auto !important;
    height: var(--nf-top);
    padding: 0 12px 0 16px;
    background: var(--nf-ink) !important;
    border: 0 !important;
    overflow: visible;
  }

  #layout-menu .popover-header {
    display: none !important;
  }

  .nf-brand {
    flex: 0 0 auto;
    width: calc(var(--nf-nav) - 32px);
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff !important;
    text-decoration: none !important;
  }

  .nf-brand-mark {
    width: 22px;
    height: 20px;
  }

  .nf-brand-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -.01em;
  }

  .nf-cmd-trigger {
    flex: 0 1 560px;
    min-width: 200px;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 0 10px;
    color: rgba(255, 255, 255, .62);
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    font-size: 12.5px;
    text-align: left;
    cursor: text;
  }

  .nf-cmd-trigger:hover,
  .nf-cmd-trigger:focus-visible {
    background: rgba(255, 255, 255, .11);
    color: rgba(255, 255, 255, .8);
    outline: none;
  }

  .nf-cmd-trigger:focus-visible {
    box-shadow: 0 0 0 2px var(--nf-red);
  }

  .nf-cmd-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nf-cmd-icon,
  .nf-cmd-icon::before {
    width: 14px;
    height: 14px;
  }

  .nf-cmd-icon {
    position: relative;
    flex: 0 0 14px;
  }

  .nf-cmd-icon::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 10px;
    height: 10px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
  }

  .nf-cmd-icon::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 9px;
    width: 5px;
    height: 1.5px;
    background: currentColor;
    transform: rotate(45deg);
    transform-origin: left center;
  }

  /* task links and the new-message button */
  #layout-menu #taskmenu {
    position: static;
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    height: 100%;
    margin-left: auto;
    width: auto !important;
    background: transparent;
    overflow: visible;
  }

  #layout-menu #taskmenu .nf-tasks {
    order: 1;
    display: flex;
    height: 100%;
  }

  #layout-menu #taskmenu .action-buttons {
    order: 2;
    display: flex;
    align-items: center;
    margin-left: 12px;
  }

  #layout-menu #taskmenu a {
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    float: none;
    padding: 0 12px !important;
    margin: 0;
    height: 100%;
    display: flex !important;
    align-items: center;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    color: rgba(255, 255, 255, .66) !important;
    background: transparent !important;
    position: relative;
    text-decoration: none;
  }

  #layout-menu #taskmenu a::before {
    display: none !important;
  }

  #layout-menu #taskmenu a .inner {
    display: inline !important;
    font-size: 12.5px;
    max-width: none !important;
    overflow: visible !important;
    white-space: nowrap;
  }

  #layout-menu #taskmenu .nf-tasks a:hover {
    color: #fff !important;
  }

  #layout-menu #taskmenu .nf-tasks a.selected {
    color: #fff !important;
  }

  #layout-menu #taskmenu .nf-tasks a.selected::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 2px;
    background: var(--nf-red);
  }

  #layout-menu #taskmenu .action-buttons a.compose {
    height: 32px;
    padding: 0 16px 0 14px !important;
    color: #fff !important;
    background: var(--nf-red) !important;
    font-weight: 600;
    clip-path: polygon(0 0, calc(100% - var(--nf-cut)) 0, 100% var(--nf-cut), 100% 100%, 0 100%);
  }

  #layout-menu #taskmenu .action-buttons a.compose:hover {
    background: var(--nf-red-press) !important;
  }

  #layout-menu #taskmenu .action-buttons a.compose.selected {
    opacity: .55;
    pointer-events: none;
  }

  /* account button + menu */
  .nf-account {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    margin-left: 6px;
    padding: 0;
    border: 0;
    background: var(--nf-ink-3);
    color: #fff;
    font: 600 12px/32px var(--nf-font);
    letter-spacing: .02em;
    cursor: pointer;
    clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%);
  }

  .nf-account:hover,
  .nf-account[aria-expanded="true"] {
    background: #33496A;
  }

  .nf-account:focus-visible {
    outline: 2px solid var(--nf-red);
    outline-offset: 2px;
  }

  #layout-menu #taskmenu .special-buttons {
    position: absolute !important;
    top: calc(var(--nf-top) - 2px);
    right: 12px;
    left: auto !important;
    bottom: auto !important;
    z-index: 50;
    display: none !important;
    flex-direction: column;
    width: 264px;
    padding: 6px 0;
    background: var(--nf-surface) !important;
    border: 1px solid var(--nf-line);
    box-shadow: 0 12px 32px -12px rgba(15, 26, 43, .35);
  }

  #layout-menu.nf-account-open #taskmenu .special-buttons {
    display: flex !important;
  }

  #layout-menu #taskmenu .special-buttons a {
    height: 36px;
    padding: 0 16px !important;
    color: var(--nf-text) !important;
    font-size: 12.5px;
  }

  #layout-menu #taskmenu .special-buttons a:hover,
  #layout-menu #taskmenu .special-buttons a:focus {
    background: var(--nf-paper-2) !important;
    outline: none;
  }

  #layout-menu #taskmenu .special-buttons a.logout {
    margin-top: 6px;
    border-top: 1px solid var(--nf-line);
    height: 42px;
  }

  .nf-account-head {
    display: block;
    padding: 10px 16px 12px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--nf-line);
  }

  .nf-account-label {
    display: block;
    font-size: 12px;
    color: var(--nf-slate);
  }

  .nf-account-user {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 600;
    color: var(--nf-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* ---------- navigation column (folders, settings sections, address books) ---------- */

  #layout > #layout-sidebar {
    grid-column: 1;
    grid-row: 2;
    width: auto !important;
    min-width: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    background: var(--nf-paper) !important;
    border-right: 1px solid var(--nf-line) !important;
    border-left: 0;
  }

  #layout-sidebar > .header {
    height: 44px;
    min-height: 44px;
    padding: 0 8px 0 16px;
    display: flex;
    align-items: center;
    background: transparent !important;
    border: 0 !important;
  }

  #layout-sidebar > .header .header-title {
    margin: 0 !important;
    padding: 0 !important;
    flex: 1;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--nf-slate);
    letter-spacing: 0;
  }

  #layout-sidebar > .header a.button.icon {
    width: 28px;
    height: 28px;
    min-width: 0;
    padding: 0;
    color: var(--nf-slate);
  }

  #layout-sidebar > .header a.button.icon .inner {
    display: none;
  }

  #layout-sidebar .scroller {
    padding: 0 8px;
  }

  #layout-sidebar .listing li,
  #layout-sidebar .listing li a {
    border: 0 !important;
  }

  #layout-sidebar .listing li a,
  #layout-sidebar .listing li > div > a {
    height: 32px;
    line-height: 32px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 13px;
    color: var(--nf-text-2);
    background: transparent;
  }

  #layout-sidebar .listing li a:before {
    font-size: 12.5px;
    color: var(--nf-mute);
    width: 1.6em !important;
  }

  #layout-sidebar .listing li a:hover {
    background: rgba(15, 26, 43, .045) !important;
    color: var(--nf-text);
  }

  #layout-sidebar ul.treelist li.selected > a,
  #layout-sidebar .listing.iconized li.selected,
  #layout-sidebar .listing li.selected > a {
    background: var(--nf-surface) !important;
    color: var(--nf-text) !important;
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--nf-red);
  }

  #layout-sidebar ul.treelist li.selected > a:before,
  #layout-sidebar .listing li.selected a:before {
    color: var(--nf-text);
  }

  #layout-sidebar .listing li .unreadcount {
    position: absolute;
    right: 8px;
    top: 0;
    padding: 0;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 32px;
    font-variant-numeric: tabular-nums;
    color: var(--nf-text) !important;
    background: transparent !important;
  }

  #layout-sidebar ul.treelist li div.treetoggle {
    height: 32px;
    line-height: 32px;
    color: var(--nf-mute);
  }

  #layout-sidebar > .footer {
    background: transparent !important;
    border: 0;
    padding: 10px 16px 14px;
  }

  #layout-sidebar .quota-widget {
    font-size: 12px;
    color: var(--nf-slate);
  }

  #layout-sidebar .quota-widget .bar {
    height: 3px;
    background: var(--nf-line-2);
  }

  #layout-sidebar .quota-widget .value {
    background: var(--nf-ink) !important;
  }

  /* column header in the navigation column */
  #layout > #layout-sidebar > .header {
    flex-wrap: nowrap;
  }

  #layout > #layout-sidebar > .header > .header-title {
    flex: 1 1 auto;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--nf-slate);
  }

  #layout > #layout-sidebar > .header {
    height: 52px !important;
    min-height: 52px !important;
    padding: 0 6px 0 18px !important;
  }

  #layout > #layout-sidebar > .header > a.button.icon.sidebar-menu:before {
    margin: 0 !important;
    line-height: 1 !important;
    font-size: 12.5px;
    color: var(--nf-mute);
  }

  #layout > #layout-sidebar > .header > a.button.icon.sidebar-menu {
    position: static !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0;
  }

  #layout-sidebar .listing li > a:before {
    position: static !important;
    float: none !important;
    flex: 0 0 auto;
    margin: 0 10px 0 0 !important;
    line-height: 1 !important;
    top: auto !important;
  }

  /* folder rows: label and count on one line */
  #layout-sidebar .listing li > a {
    display: flex !important;
    align-items: center;
    padding-right: 10px;
  }

  #layout-sidebar .listing li > a .unreadcount {
    position: static !important;
    margin-left: auto;
    line-height: 1 !important;
    top: auto;
    right: auto;
  }

  /* settings and contacts lists: quieter icons */
  #layout > #layout-list .listing.iconized li a:before,
  #layout > #layout-list .listing.iconized td.section:before,
  #layout > #layout-list .listing.iconized td:before {
    color: var(--nf-mute) !important;
    font-size: 12.5px !important;
  }

  #layout > #layout-list .listing li a,
  #layout > #layout-list .listing td {
    font-size: 13px;
  }

  #layout > #layout-list .listing li.selected,
  #layout > #layout-list .listing tr.selected td {
    background: var(--nf-paper) !important;
  }

  /* dropdown carets in toolbars */
  #layout > div > .header > ul.menu.toolbar > li > .dropbutton > a.dropdown:before {
    position: static !important;
    margin: 0 !important;
    font-size: 9px !important;
    line-height: 1 !important;
    color: var(--nf-mute);
  }

  /* pagination: compact, right side */
  #layout-list > .footer.pagenav {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    padding: 0 12px;
  }

  #layout-list > .footer.pagenav .pagenav-text {
    order: -1;
    margin-right: auto;
    font-weight: 400;
    font-size: 12px;
  }

  #layout-list > .footer.pagenav a.button {
    width: 28px;
    min-width: 0;
    height: 28px;
    padding: 0;
    color: var(--nf-slate);
  }

  #layout-list > .footer.pagenav .pagenav-page input {
    width: 44px;
    height: 26px;
    font-size: 12px;
  }

  /* Settings > Security spans the work area */
  body.task-settings.action-plugin-nf-security #layout > #layout-content {
    grid-column: 2 / -1;
  }

  body.task-settings.action-plugin-nf-security #layout-content > .header {
    display: none !important;
  }

  /* ---------- work area: lists and content share column 2 ---------- */

  #layout > #layout-list,
  #layout > #layout-content {
    grid-row: 2;
    grid-column: 2;
    width: auto !important;
    min-width: 0;
    max-width: none !important;
    border: 0 !important;
    background: var(--nf-surface) !important;
  }

  /* mail: list on the left, reading pane on the right */
  body.task-mail.action-none #layout {
    grid-template-columns: var(--nf-nav) var(--nf-list) minmax(0, 1fr);
  }

  body.task-mail.action-none #layout > #layout-list {
    grid-column: 2;
    border-right: 1px solid var(--nf-line) !important;
  }

  body.task-mail.action-none #layout > #layout-content {
    grid-column: 3;
  }

  /* settings and contacts: list beside content */
  body.task-settings #layout,
  body.task-addressbook #layout {
    grid-template-columns: var(--nf-nav) 340px minmax(0, 1fr);
  }

  body.task-settings #layout > #layout-list,
  body.task-addressbook #layout > #layout-list {
    grid-column: 2;
    border-right: 1px solid var(--nf-line) !important;
  }

  body.task-settings #layout > #layout-content,
  body.task-addressbook #layout > #layout-content {
    grid-column: 3;
  }

  body.task-settings #layout > #layout-content:only-of-type,
  body.task-settings.action-folders #layout > #layout-content,
  body.task-settings.action-identities #layout > #layout-content,
  body.task-settings.action-responses #layout > #layout-content,
  body.task-settings.action-preferences #layout > #layout-content {
    grid-column: 3;
  }

  /* compose and full message view: the work area spans the whole width */
  body.task-mail.action-compose #layout,
  body.task-mail.action-show #layout,
  body.task-mail.action-preview #layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  body.task-mail.action-show #layout,
  body.task-mail.action-preview #layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body.task-mail.action-compose #layout > #layout-content,
  body.task-mail.action-show #layout > #layout-content {
    grid-column: 1;
  }

  body.task-mail.action-compose #layout > #layout-sidebar {
    grid-column: 2;
    border-right: 0 !important;
    border-left: 1px solid var(--nf-line) !important;
    background: var(--nf-paper-2) !important;
  }

  /* headers inside the work area */
  #layout > #layout-list > .header,
  #layout > #layout-content > .header {
    height: 52px;
    min-height: 52px;
    padding: 0 12px 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--nf-surface) !important;
    border-bottom: 1px solid var(--nf-line) !important;
  }

  #layout > div > .header > .header-title {
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 1 auto;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--nf-text);
  }

  /* phone/tablet-only header controls */
  #layout > div > .header > a.button.icon.back-list-button,
  #layout > div > .header > a.button.icon.back-sidebar-button,
  #layout > div > .header > a.button.icon.task-menu-button,
  #layout > div > .header > a.button.icon.toolbar-menu-button,
  #layout > div > .header > a.button.icon.toolbar-list-button,
  #layout > div > .header > a.button.icon.back-content-button {
    display: none !important;
  }

  #layout > #layout-list > .header > .header-title {
    display: block !important;
  }

  /* toolbars: icon and label on one line, compact */
  #layout > div > .header > ul.menu.toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    margin: 0 0 0 auto;
    padding: 0;
    height: 100%;
    position: static;
    background: transparent;
    box-shadow: none;
    border: 0;
    list-style: none;
  }

  #layout > div > .header > ul.menu.toolbar > li {
    display: flex;
    align-items: center;
    border: 0;
  }

  #layout > div > .header > ul.menu.toolbar > li.spacer {
    width: 1px;
    height: 18px;
    margin: 0 8px;
    background: var(--nf-line-2);
  }

  #layout > div > .header > ul.menu.toolbar > li > a,
  #layout > div > .header > ul.menu.toolbar > li > .dropbutton > a:not(.dropdown) {
    max-width: none !important;
    flex-direction: row;
    align-items: center;
    gap: 7px;
    height: 32px;
    min-width: 0;
    width: auto;
    padding: 0 10px;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    color: var(--nf-text-2);
    border-radius: 0;
    background: transparent;
  }

  #layout > div > .header > ul.menu.toolbar > li > a:not(.hidden):not(.hidden-large):not(.hidden-big),
  #layout > div > .header > ul.menu.toolbar > li > .dropbutton > a:not(.dropdown) {
    display: inline-flex;
  }

  #layout > div > .header > ul.menu.toolbar > li > a:before,
  #layout > div > .header > ul.menu.toolbar > li > .dropbutton > a:not(.dropdown):before {
    display: inline-block;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    font-size: 12.5px !important;
    line-height: 1 !important;
    color: var(--nf-slate);
  }

  #layout > div > .header > ul.menu.toolbar > li > a .inner,
  #layout > div > .header > ul.menu.toolbar > li > .dropbutton > a:not(.dropdown) .inner {
    display: inline !important;
    font-size: 12.5px;
    line-height: 1;
    max-width: none !important;
    overflow: visible !important;
    white-space: nowrap;
  }

  #layout > div > .header > ul.menu.toolbar > li > a:hover:not(.disabled),
  #layout > div > .header > ul.menu.toolbar > li > .dropbutton > a:hover:not(.disabled) {
    background: var(--nf-paper-2);
    color: var(--nf-text);
  }

  #layout > div > .header > ul.menu.toolbar > li > a.disabled,
  #layout > div > .header > ul.menu.toolbar > li > .dropbutton > a.disabled {
    opacity: .38;
  }

  #layout > div > .header > ul.menu.toolbar > li > .dropbutton {
    display: inline-flex;
    align-items: center;
  }

  #layout > div > .header > ul.menu.toolbar > li > .dropbutton > a.dropdown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 32px;
    min-width: 0;
    padding: 0;
    margin-left: -6px;
  }

  #layout > div > .header > ul.menu.toolbar > li > .dropbutton > a.dropdown .inner {
    display: none;
  }

  /* message list header: icon-only list tools */
  #messagelist-header > ul.menu.toolbar > li > a .inner,
  #messagelist-header > a.button.icon .inner {
    display: none !important;
  }

  #messagelist-header > ul.menu.toolbar > li > a,
  #messagelist-header > a.button.icon.refresh {
    width: 32px;
    justify-content: center;
    padding: 0;
  }

  #messagelist-header > a.button.icon.refresh {
    display: inline-flex !important;
    align-items: center;
    height: 32px;
    color: var(--nf-slate);
  }

  #messagelist-header > a.button.icon.refresh:hover {
    background: var(--nf-paper-2);
    color: var(--nf-text);
  }

  #messagelist-header > a.button.icon.refresh:before {
    margin: 0;
    font-size: 12.5px;
  }

  .nf-count {
    font-size: 12px;
    color: var(--nf-slate);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  /* the quick search box lives in the command bar on desktop */
  body.task-mail #layout-list > .searchbar {
    display: none !important;
  }

  /* ---------- lanes ---------- */

  .nf-lanes {
    display: flex;
    align-items: stretch;
    gap: 22px;
    height: 40px;
    padding: 0 20px;
    border-bottom: 1px solid var(--nf-line);
    background: var(--nf-surface);
    flex: 0 0 auto;
  }

  .nf-lanes:empty {
    display: none;
  }

  /* list footer: pagination */
  #layout-list > .footer.pagenav {
    height: 40px;
    min-height: 40px;
    border-top: 1px solid var(--nf-line) !important;
    background: var(--nf-surface) !important;
    font-size: 12px;
    color: var(--nf-slate);
  }

  /* ---------- focus view: the reader replaces the list ---------- */

  body.task-mail.action-none .nf-back {
    display: none !important;
  }

  .nf-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 12px 0 10px;
    margin-right: 6px;
    border: 1px solid var(--nf-line-2);
    background: transparent;
    color: var(--nf-text);
    font: 500 12.5px var(--nf-font);
    cursor: pointer;
  }

  .nf-back svg {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
  }

  .nf-back:hover,
  .nf-back:focus-visible {
    background: var(--nf-paper-2);
    color: var(--nf-text);
    text-decoration: none;
    outline: none;
  }

  .nf-back:focus-visible {
    box-shadow: 0 0 0 2px var(--nf-red);
  }

  .nf-back .nf-kbd {
    opacity: .55;
  }

  body.task-mail.action-none #layout-content > .header .header-title {
    display: none;
  }

  #layout-content > .header .nf-pos {
    margin-left: 8px;
    font-size: 12px;
    color: var(--nf-slate);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  #mailtoolbar a .nf-key {
    margin-left: 2px;
    font-size: 11px;
    color: var(--nf-mute);
  }

  /* ---------- composer ---------- */

  body.task-mail.action-compose #layout > #layout-content > .header > .header-title {
    display: block !important;
    font-size: 16px;
  }

  body.task-mail.action-compose #layout-content > .header ul.menu.toolbar > li > a.save,
  body.task-mail.action-compose #layout-content > .header ul.menu.toolbar > li > a.attach,
  body.task-mail.action-compose #layout-content > .header ul.menu.toolbar > li > a.options {
    display: none !important;
  }

  body.task-mail.action-compose #compose-content {
    padding: 0;
    background: var(--nf-surface);
  }

  body.task-mail.action-compose #compose-content > form,
  body.task-mail.action-compose #compose-content > .formcontent {
    max-width: none;
  }

  body.task-mail.action-compose .compose-headers .form-group.row {
    display: flex;
    align-items: center;
    margin: 0;
    min-height: 44px;
    padding: 0 20px;
    border-bottom: 1px solid var(--nf-line);
  }

  body.task-mail.action-compose .compose-headers .form-group.row > label {
    flex: 0 0 76px;
    max-width: 76px;
    padding: 0;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--nf-slate);
  }

  body.task-mail.action-compose .compose-headers .form-group.row > div {
    flex: 1;
    max-width: none;
    padding: 0;
  }

  body.task-mail.action-compose .compose-headers .form-control,
  body.task-mail.action-compose .compose-headers .custom-select,
  body.task-mail.action-compose .compose-headers .recipient-input,
  body.task-mail.action-compose .compose-headers .input-group-text {
    border: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    font-size: 13px;
    padding-left: 0;
  }

  body.task-mail.action-compose #compose-subject {
    font-size: 14px;
    font-weight: 600;
  }

  body.task-mail.action-compose .compose-headers .input-group-append .input-group-text {
    color: var(--nf-mute);
  }

  body.task-mail.action-compose #composebodycontainer {
    padding: 0;
    border-bottom: 1px solid var(--nf-line);
  }

  body.task-mail.action-compose #composebody {
    font-family: var(--nf-font) !important;
    min-height: 340px;
    padding: 18px 20px;
    border: 0 !important;
    box-shadow: none !important;
    font-size: 14px;
    line-height: 1.6;
    background: transparent;
  }

  body.task-mail.action-compose .editor-toolbar,
  body.task-mail.action-compose .tox-editor-header {
    border-bottom: 1px solid var(--nf-line) !important;
  }

  .nf-templates {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--nf-line);
    background: var(--nf-paper-2);
  }

  .nf-templates[hidden] {
    display: none;
  }

  .nf-templates-label {
    margin-right: 6px;
    font-size: 12px;
    color: var(--nf-slate);
  }

  .nf-chip {
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--nf-line-2);
    background: var(--nf-surface);
    color: var(--nf-text);
    font: 500 12px var(--nf-font);
    cursor: pointer;
  }

  .nf-chip:hover {
    border-color: var(--nf-ink);
  }

  .nf-chip:focus-visible {
    outline: 2px solid var(--nf-red);
    outline-offset: 1px;
  }

  .nf-sendbar {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 14px 20px !important;
    margin: 0 !important;
    background: var(--nf-surface);
  }

  .nf-sendbar .btn.send {
    height: 38px;
    padding: 0 22px 0 18px;
    font-size: 13px;
  }

  .nf-sendbar .btn.send:before {
    display: none;
  }

  .nf-send-hint {
    color: var(--nf-slate);
  }

  .nf-ghost {
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--nf-line-2);
    background: transparent;
    color: var(--nf-text);
    font: 500 12.5px var(--nf-font);
    cursor: pointer;
  }

  .nf-ghost:hover {
    background: var(--nf-paper-2);
  }

  .nf-sendbar .float-right {
    margin-left: auto;
  }

  .nf-autosave {
    font-size: 12px;
    color: var(--nf-slate);
  }

  body.task-mail.action-compose #layout-sidebar > .header .header-title {
    font-size: 12px;
  }

  body.task-mail.action-compose #compose-attachments .upload-form button.attach {
    display: none;
  }

  body.task-mail.action-compose #layout-sidebar .formcontent {
    padding: 0 16px;
  }

  body.task-mail.action-compose #layout-sidebar .form-group.row {
    font-size: 12.5px;
  }
}

/* ================================================================
   Message rows (all sizes): sender and date, then subject
   ================================================================ */

#messagelist-content {
  background: var(--nf-surface);
}

#messagelist,
#messagelist tbody {
  display: block;
  width: 100%;
}

#messagelist thead {
  display: none;
}

#messagelist tbody tr {
  --nf-sel: 0px;
  --nf-row: 20px;
  display: grid;
  grid-template-columns: var(--nf-sel) 22px minmax(0, 1fr) auto;
  grid-template-rows: 20px 19px;
  align-items: center;
  height: auto;
  padding: 9px 14px 9px 0;
  border-bottom: 1px solid var(--nf-line);
  background: var(--nf-surface);
  cursor: pointer;
}

#messagelist.withselection tbody tr {
  --nf-sel: 34px;
}

#messagelist tbody tr td {
  display: block;
  height: auto;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  line-height: var(--nf-row);
  white-space: nowrap;
  overflow: hidden;
}

#messagelist tbody tr td.selection {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: auto;
  padding: 0 0 0 14px;
}

#messagelist:not(.withselection) tbody tr td.selection {
  display: none;
}

#messagelist tbody tr td.subject,
#messagelist tbody tr td.subject > span.subject {
  display: contents;
}

#messagelist tbody tr td.subject span.msgicon.status {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  width: 12px;
  height: var(--nf-row);
  display: block;
  position: static;
  margin: 0;
}

#messagelist tbody tr td.subject span.msgicon.status:before {
  content: "" !important;
  display: block;
  width: 12px !important;
  height: var(--nf-row) !important;
  margin: 0 !important;
  background: transparent;
}

#messagelist tbody tr td.subject span.msgicon.status.unread:before {
  background: linear-gradient(var(--nf-red), var(--nf-red)) no-repeat 50% 50% / 7px 7px;
}

#messagelist tbody tr td.subject span.msgicon.status.replied:before,
#messagelist tbody tr td.subject span.msgicon.status.forwarded:before {
  background: linear-gradient(var(--nf-mute), var(--nf-mute)) no-repeat 50% 50% / 8px 1.5px;
}

#messagelist tbody tr td.subject span.fromto {
  grid-column: 3;
  grid-row: 1;
  display: block;
  float: none;
  width: auto;
  padding: 0 12px 0 0 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: var(--nf-row);
  font-size: 13px;
  font-weight: 500;
  color: var(--nf-text) !important;
}

#messagelist tbody tr td.subject span.fromto * {
  font-size: inherit;
  color: inherit !important;
}

#messagelist tbody tr td.subject > span.subject > a {
  grid-column: 3;
  grid-row: 2;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 19px;
  padding-right: 12px !important;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--nf-text-2) !important;
  text-decoration: none;
  padding: 0;
}

#messagelist tbody tr td.subject span.date {
  grid-column: 4;
  grid-row: 1;
  display: block;
  float: none;
  width: auto;
  text-align: right;
  line-height: var(--nf-row);
  font-size: 11.5px;
  color: var(--nf-slate) !important;
  font-variant-numeric: tabular-nums;
}

#messagelist tbody tr td.subject span.size {
  display: none !important;
}

#messagelist tbody tr.unread td.subject span.fromto,
#messagelist tbody tr.unread td.subject > span.subject > a,
#messagelist tbody tr.unread td.subject span.date {
  font-weight: 600;
  color: var(--nf-text) !important;
}

#messagelist tbody tr td.flags {
  grid-column: 4;
  grid-row: 2;
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  gap: 2px;
  width: auto;
  padding: 0;
}

#messagelist tbody tr td.flags > span {
  display: block;
  width: 16px;
  height: 19px;
  line-height: 19px;
  font-size: 11px;
  text-align: center;
  color: var(--nf-mute);
}

#messagelist tbody tr td.flags span.flagged:before {
  color: var(--nf-red) !important;
}

@media (hover: hover) {
  #messagelist tbody tr:hover {
    background: var(--nf-paper-2);
  }
}

#messagelist tbody tr.selected,
#messagelist tbody tr.selected:hover {
  background: var(--nf-paper);
  box-shadow: inset 2px 0 0 var(--nf-red);
}

#messagelist tbody tr.focused:not(.selected) {
  box-shadow: inset 2px 0 0 var(--nf-line-2);
}

#messagelist tbody tr.flagged td,
#messagelist tbody tr.flagged td.subject span.date {
  color: inherit;
}

#messagelist tbody tr.deleted td.subject > span.subject > a {
  text-decoration: line-through;
  color: var(--nf-mute) !important;
}

/* ================================================================
   Desktop: reading pane sizing
   ================================================================ */

@media screen and (min-width: 1024px) {
  html {
    font-size: 13px;
  }

  /* message toolbar above a narrow reading pane: icons only */
  body.task-mail.action-none #layout-content > .header {
    padding-left: 14px;
  }
  /* list header beside the reading pane: folder name first, tools as icons */
  body.task-mail.action-none #layout > #layout-list > .header > ul.menu.toolbar > li > a .inner {
    display: none !important;
  }

  body.task-mail.action-none #layout > #layout-list > .header > ul.menu.toolbar > li > a {
    padding: 0 8px;
  }

  body.task-mail.action-none #layout > #layout-list > .header > .header-title {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.task-mail.action-none #layout > #layout-list > .header {
    padding-left: 16px;
  }
}

@media screen and (min-width: 1024px) and (max-width: 1439px) {
  body.task-mail.action-none #layout > #layout-content > .header > ul.menu.toolbar > li > a .inner,
  body.task-mail.action-none #layout > #layout-content > .header > ul.menu.toolbar > li > .dropbutton > a:not(.dropdown) .inner {
    display: none !important;
  }

  body.task-mail.action-none #layout > #layout-content > .header > ul.menu.toolbar > li > a,
  body.task-mail.action-none #layout > #layout-content > .header > ul.menu.toolbar > li > .dropbutton > a:not(.dropdown) {
    padding: 0 9px;
  }
}

/* ================================================================
   Command palette and shortcuts sheet (all sizes)
   ================================================================ */

.nf-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: rgba(10, 18, 31, .45);
}

.nf-overlay[hidden] {
  display: none;
}

.nf-palette,
.nf-sheet {
  width: 100%;
  max-width: 600px;
  background: var(--nf-surface);
  color: var(--nf-text);
  border: 1px solid var(--nf-line);
  box-shadow: 0 24px 64px -16px rgba(10, 18, 31, .5);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}

.nf-palette-input {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 18px;
  border: 0;
  border-bottom: 1px solid var(--nf-line);
  background: transparent;
  color: var(--nf-text);
  font: 400 16px var(--nf-font);
  outline: none;
}

.nf-palette-input::placeholder {
  color: var(--nf-mute);
}

.nf-palette-list {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  margin: 0;
  padding: 6px 0;
  list-style: none;
}

.nf-palette-group {
  padding: 10px 18px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--nf-slate);
}

.nf-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  padding: 0 18px;
  font-size: 13px;
  cursor: pointer;
}

.nf-palette-item[aria-selected="true"] {
  background: var(--nf-paper);
  box-shadow: inset 2px 0 0 var(--nf-red);
}

.nf-palette-item .nf-pi-label {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nf-palette-item .nf-pi-hint {
  font-size: 12px;
  color: var(--nf-mute);
}

.nf-palette-item mark {
  padding: 0;
  background: transparent;
  color: var(--nf-text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--nf-red);
  text-underline-offset: 3px;
}

.nf-palette-foot {
  display: flex;
  gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid var(--nf-line);
  font-size: 12px;
  color: var(--nf-slate);
}

.nf-sheet {
  max-width: 680px;
  padding: 22px 26px 18px;
}

.nf-sheet h2 {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 600;
}

.nf-sheet-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 36px;
}

.nf-sheet dl {
  margin: 0;
}

.nf-sheet h3 {
  margin: 10px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--nf-slate);
}

.nf-sheet .nf-sc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 30px;
  border-bottom: 1px solid var(--nf-line);
  font-size: 13px;
}

.nf-sheet .nf-sc kbd {
  margin-left: 4px;
}

.nf-sheet-close {
  margin-top: 16px;
  font-size: 12px;
  color: var(--nf-slate);
}

@media (max-width: 640px) {
  .nf-sheet-cols {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   Lanes (all sizes)
   ================================================================ */

.nf-lane {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--nf-slate);
  font: 500 12.5px var(--nf-font);
  cursor: pointer;
  white-space: nowrap;
}

.nf-lane:hover {
  color: var(--nf-text);
}

.nf-lane[aria-selected="true"] {
  color: var(--nf-text);
  font-weight: 600;
}

.nf-lane[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--nf-red);
}

.nf-lane:focus-visible {
  outline: 2px solid var(--nf-red);
  outline-offset: 2px;
}

.nf-lane-count {
  min-width: 18px;
  padding: 0 5px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--nf-white);
  background: var(--nf-ink);
}

html.dark-mode .nf-lane-count {
  background: var(--nf-ink-3);
}

.nf-lane-count:empty {
  display: none;
}

.nf-lane-key {
  font-size: 11px;
  color: var(--nf-mute);
}

.nf-search-chip {
  margin-left: auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 4px 0 10px;
  font-size: 12px;
  color: var(--nf-text);
  background: var(--nf-paper);
}

.nf-search-chip button {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: var(--nf-slate);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

/* ================================================================
   Reader (inside the preview frame and the full message page)
   ================================================================ */

body.task-mail.action-preview,
body.task-mail.action-show {
  background: var(--nf-surface);
}

.nf-reader {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: 0;
  padding: 0 !important;
  min-height: 100%;
}

.nf-reader-main {
  min-width: 0;
  padding: 28px 40px 48px;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.nf-rail {
  border-left: 1px solid var(--nf-line);
  background: var(--nf-paper-2);
  padding: 22px 18px;
}

@media (max-width: 1100px) {
  .nf-reader {
    grid-template-columns: minmax(0, 1fr);
  }

  .nf-rail {
    border-left: 0;
    border-top: 1px solid var(--nf-line);
  }
}

.nf-rail-block + .nf-rail-block {
  margin-top: 26px;
}

.nf-rail h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--nf-slate);
}

.nf-template-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nf-template-list li + li {
  margin-top: 6px;
}

.nf-template-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--nf-line-2);
  background: var(--nf-surface);
  color: var(--nf-text);
  font: 500 12.5px var(--nf-font);
  text-align: left;
  cursor: pointer;
}

.nf-template-list button:hover {
  border-color: var(--nf-ink);
}

.nf-template-list button::after {
  content: "Reply";
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--nf-slate);
}

.nf-template-list button:focus-visible {
  outline: 2px solid var(--nf-red);
  outline-offset: 1px;
}

.nf-rail-empty {
  margin: 0;
  font-size: 12px;
  color: var(--nf-slate);
}

.nf-sender-facts {
  margin: 0;
  font-size: 12.5px;
}

.nf-sender-facts dt {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--nf-slate);
}

.nf-sender-facts dt:first-child {
  margin-top: 0;
}

.nf-sender-facts dd {
  margin: 2px 0 0;
  color: var(--nf-text);
  word-break: break-word;
}

.nf-sender-facts .nf-tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 12px;
  font-weight: 600;
  background: var(--nf-paper);
}

.nf-sender-facts .nf-tag.is-team {
  color: #fff;
  background: var(--nf-ink);
}

.nf-sender-facts .nf-tag.is-warn {
  color: #fff;
  background: var(--nf-red);
}

/* security notices above the message */
.nf-alerts:empty {
  display: none;
}

.nf-alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 18px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--nf-text);
  background: var(--nf-paper);
  border-left: 3px solid var(--nf-slate);
}

.nf-alert strong {
  display: block;
  font-weight: 600;
}

.nf-alert.is-danger {
  background: #FDECEA;
  border-left-color: var(--nf-red);
}

html.dark-mode .nf-alert.is-danger {
  background: #3A1A1A;
}

/* message header block */
#message-header {
  padding: 0 !important;
  margin: 0 0 22px;
  border: 0 !important;
  background: transparent !important;
}

#message-header h2.subject {
  margin: 0 0 18px;
  padding: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.012em;
  color: var(--nf-text);
}

#message-header > .header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--nf-line);
}

#message-header .contactphoto {
  width: 40px !important;
  height: 40px !important;
  border-radius: 0 !important;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  background: var(--nf-paper);
}

#message-header .header-summary {
  font-size: 13px;
  color: var(--nf-text-2);
}

#message-header .header-summary a,
#message-header .header-summary .rcmContactAddress {
  font-weight: 600;
  color: var(--nf-text);
}

#message-header .header-links {
  margin-top: 4px;
  font-size: 12px;
}

#message-header .header-links a {
  color: var(--nf-slate) !important;
  margin-right: 12px;
}

#message-header .header-links a:before {
  display: none;
}

#messagebody {
  font-size: 14px;
  line-height: 1.6;
  color: var(--nf-text);
}

#messagebody div.pre {
  font-family: var(--nf-font) !important;
  font-size: 14px;
}

#messagebody a {
  color: var(--nf-text);
  text-decoration: underline;
  text-decoration-color: var(--nf-red);
  text-underline-offset: 3px;
}

#message-content .attachmentslist li {
  border: 1px solid var(--nf-line-2) !important;
  border-radius: 0 !important;
  background: var(--nf-surface) !important;
}

/* ================================================================
   Login (carries over the approved sign-in design)
   ================================================================ */

body.task-login,
/* ================================================================
   Login (carries over the approved sign-in design)
   ================================================================ */

body.action-plugin-nf-verify {
  min-height: 100vh;
  background: #E9EDF2 !important;
  color: var(--nf-ink);
}html.dark-mode body.task-login,
html.dark-mode body.action-plugin-nf-verify {
  background: #E9EDF2 !important;
}body.task-login .nf-trace,
body.action-plugin-nf-verify .nf-trace {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}body.task-login .nf-trace polygon,
body.action-plugin-nf-verify .nf-trace polygon {
  fill: none;
  stroke: var(--nf-ink);
  stroke-opacity: .22;
  stroke-width: .14;
  stroke-linejoin: miter;
  stroke-dasharray: 1.01 1.01;
  stroke-dashoffset: 0;
}

@media (prefers-reduced-motion: no-preference) {body.task-login .nf-trace polygon,
body.action-plugin-nf-verify .nf-trace polygon {
    animation: nf-trace 1.8s cubic-bezier(.65, 0, .25, 1) .15s both;
  }
}

@keyframes nf-trace {
  from { stroke-dashoffset: 1.01; }
  to { stroke-dashoffset: 0; }
}body.task-login #layout,
body.action-plugin-nf-verify #layout {
  position: relative;
  z-index: 1;
  display: block !important;
  height: auto;
  min-height: 100vh;
  background: transparent !important;
}body.task-login #layout-content,
body.action-plugin-nf-verify #layout-content {
  position: relative;
  z-index: 1;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 24px 16px;
  box-sizing: border-box;
  text-align: left !important;
  background: transparent !important;
}body.task-login #logo,
body.action-plugin-nf-verify #logo {
  display: none !important;
}body.task-login #login-form,
body.action-plugin-nf-verify #login-form {
  position: static !important;
  top: auto !important;
  width: 100%;
  max-width: 372px;
  margin: 0;
  padding: 32px 32px 26px;
  box-sizing: border-box;
  background: #fff;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}body.task-login .nf-logo,
body.action-plugin-nf-verify .nf-logo {
  display: block;
  height: 24px;
  width: auto;
  margin: 0 0 30px;
}body.task-login .nf-head h2,
body.action-plugin-nf-verify .nf-head h2 {
  margin: 0 0 18px;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--nf-ink);
}body.task-login #login-form table,
body.task-login #login-form tbody,
body.action-plugin-nf-verify #login-form table,
body.action-plugin-nf-verify #login-form tbody {
  display: block;
  width: 100%;
  margin: 0;
}body.task-login #login-form tr.form-group,
body.action-plugin-nf-verify #login-form tr.form-group {
  display: block;
  margin: 0;
}body.task-login #login-form tr.form-group + tr.form-group,
body.action-plugin-nf-verify #login-form tr.form-group + tr.form-group {
  margin-top: -1px;
}body.task-login #login-form td.input,
body.action-plugin-nf-verify #login-form td.input {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  width: 100%;
  padding: 0;
  border: 1px solid #C8CFD9;
  background: #fff;
}body.task-login #login-form td.input:focus-within,
body.action-plugin-nf-verify #login-form td.input:focus-within {
  z-index: 1;
  border-color: var(--nf-ink);
  box-shadow: inset 3px 0 0 var(--nf-red);
}body.task-login #login-form .input-group-prepend,
body.action-plugin-nf-verify #login-form .input-group-prepend {
  display: none !important;
}body.task-login #login-form .form-control,
body.action-plugin-nf-verify #login-form .form-control {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0 14px 0 16px;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--nf-ink) !important;
  font-size: 16px;
  font-weight: 500;
}body.task-login #login-form .form-control::placeholder,
body.action-plugin-nf-verify #login-form .form-control::placeholder {
  color: #8C96A4;
  font-weight: 400;
  opacity: 1;
}body.task-login #login-form .form-control:-webkit-autofill,
body.action-plugin-nf-verify #login-form .form-control:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px #fff inset !important;
  -webkit-text-fill-color: var(--nf-ink);
}body.task-login .nf-domain,
body.action-plugin-nf-verify .nf-domain {
  flex: 0 0 auto;
  padding-right: 14px;
  font-size: 15px;
  color: #5C6878;
  white-space: nowrap;
  user-select: none;
}body.task-login #login-form td.input.nf-full .nf-domain,
body.action-plugin-nf-verify #login-form td.input.nf-full .nf-domain {
  display: none;
}body.task-login #login-form .formbuttons,
body.action-plugin-nf-verify #login-form .formbuttons {
  margin: 14px 0 0;
}body.task-login #rcmloginsubmit,
body.action-plugin-nf-verify #rcmloginsubmit {
  display: block;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: var(--nf-red) !important;
  color: #fff !important;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  text-transform: none !important;
  box-shadow: none !important;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}body.task-login #rcmloginsubmit:hover,
body.action-plugin-nf-verify #rcmloginsubmit:hover {
  background: var(--nf-red-press) !important;
}body.task-login #rcmloginsubmit:focus,
body.action-plugin-nf-verify #rcmloginsubmit:focus {
  outline: none;
}body.task-login #login-form .formbuttons:has(#rcmloginsubmit:focus-visible),
body.action-plugin-nf-verify #login-form .formbuttons:has(#rcmloginsubmit:focus-visible) {
  outline: 2px solid var(--nf-ink);
  outline-offset: 3px;
}body.task-login .nf-help,
body.action-plugin-nf-verify .nf-help {
  margin: 18px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #5C6878;
}body.task-login #login-footer,
body.action-plugin-nf-verify #login-footer {
  display: none;
}

@media (max-width: 700px) {body.task-login .nf-trace polygon,
body.action-plugin-nf-verify .nf-trace polygon {
    stroke-width: .3;
  }
}

@media (max-width: 480px) {body.task-login .nf-trace,
body.action-plugin-nf-verify .nf-trace {
    top: auto;
    bottom: 0;
    height: 40vh;
  }body.task-login #layout-content,
body.action-plugin-nf-verify #layout-content {
    justify-content: flex-start;
    padding-top: 8vh;
  }body.task-login #login-form,
body.action-plugin-nf-verify #login-form {
    padding: 28px 22px 22px;
  }
}

/* ================================================================
   Phones and tablets (under 1024px): app-style bottom bar, sheets
   ================================================================ */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.nf-tabbar {
  display: none;
}

@media screen and (max-width: 1023px) {
  /* computer-only chrome */
  .nf-brand,
  .nf-cmd-trigger,
  .nf-account,
  .nf-account-head,
  .nf-back,
  .nf-count,
  .nf-lane-key,
  #layout-menu,
  .floating-action-buttons,
  #layout > div > .header > a.button.icon.task-menu-button,
  body.task-mail #layout-list > .header > a.button.icon.back-sidebar-button {
    display: none !important;
  }

  html.nf-has-tabbar:not(.nf-tabbar-off) #layout {
    padding-bottom: calc(var(--nf-tab) + env(safe-area-inset-bottom));
  }

  /* ---------- bottom bar ---------- */
  html.nf-has-tabbar .nf-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: calc(var(--nf-tab) + env(safe-area-inset-bottom));
    padding: 0 max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left));
    background: var(--nf-ink);
    border-top: 1px solid #1F2E44;
  }

  html.nf-tabbar-off .nf-tabbar {
    display: none !important;
  }

  .nf-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #93A0B2;
    font: 500 10.5px/1 var(--nf-font);
    letter-spacing: .01em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .nf-tab .nf-i {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: square;
    stroke-linejoin: miter;
  }

  .nf-tab[aria-current="page"] {
    color: #FFFFFF;
  }

  .nf-tab[aria-current="page"]::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 50%;
    width: 22px;
    height: 2px;
    margin-left: -11px;
    background: var(--nf-red);
  }

  .nf-tab:active {
    color: #FFFFFF;
  }

  .nf-tab:focus-visible {
    outline: 2px solid var(--nf-red);
    outline-offset: -4px;
  }

  .nf-tab-primary span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .nf-tab-primary .nf-i {
    box-sizing: content-box;
    width: 20px;
    height: 20px;
    padding: 10px 12px;
    color: #FFFFFF;
    background: var(--nf-red);
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  }

  .nf-tab-primary:active .nf-i {
    background: var(--nf-red-press);
  }

  /* ---------- panel headers ---------- */
  #layout > div > .header {
    min-height: 52px;
    background: var(--nf-surface) !important;
    border-bottom: 1px solid var(--nf-line) !important;
  }

  #layout > div > .header > .header-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--nf-text);
  }

  body.task-mail #layout-list > .header > .header-title {
    text-align: left;
    padding-left: 16px;
    font-size: 19px;
  }

  #layout > div > .header a.button.icon:before {
    font-size: 17px;
  }

  /* ---------- lanes ---------- */
  .nf-lanes {
    display: flex;
    gap: 18px;
    height: 42px;
    padding: 0 16px;
    overflow-x: auto;
    border-bottom: 1px solid var(--nf-line);
    background: var(--nf-surface);
    flex: 0 0 auto;
    scrollbar-width: none;
  }

  .nf-lanes::-webkit-scrollbar {
    display: none;
  }

  .nf-lanes:empty {
    display: none;
  }

  /* the Search tab replaces the search row */
  body.task-mail #layout-list > .header > .searchbar,
  body.task-mail #layout-list .searchbar.menu {
    display: none !important;
  }

  /* ---------- rows: bigger targets, same structure ---------- */
  #messagelist tbody tr {
    grid-template-rows: 21px 20px;
    padding: 11px 16px 11px 0;
  }

  #messagelist tbody tr td.subject span.fromto {
    font-size: 14.5px;
    line-height: 21px;
  }

  #messagelist tbody tr td.subject > span.subject > a {
    font-size: 13.5px;
    line-height: 20px;
  }

  #messagelist tbody tr td.subject span.date {
    font-size: 12px;
    line-height: 21px;
  }

  #messagelist tbody tr td.subject span.msgicon.status,
  #messagelist tbody tr td.subject span.msgicon.status:before {
    height: 21px !important;
  }

  #messagelist tbody tr td.flags > span {
    height: 20px;
    line-height: 20px;
  }

  #messagelist tbody tr.selected,
  #messagelist tbody tr.selected:hover {
    background: var(--nf-paper);
    box-shadow: inset 2px 0 0 var(--nf-red);
  }

  #messagelist tbody tr:active {
    background: var(--nf-paper-2);
  }

  #layout-list > .footer.pagenav {
    min-height: 40px;
    font-size: 12px;
    color: var(--nf-slate);
    border-top: 1px solid var(--nf-line);
    background: var(--nf-surface);
  }

  /* lists in settings and contacts */
  html.touch .listing tbody td,
  html.touch .listing:not(.toolbar) li {
    font-size: 15px;
    line-height: 44px;
  }

  /* typing never zooms the page on iPhone */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  input:not([type]),
  textarea,
  select.form-control,
  select.custom-select {
    font-size: 16px !important;
  }

  /* reader */
  .nf-reader-main {
    padding: 18px 16px 32px;
  }
}

/* tablets: list and reading pane side by side, bar stays */
@media screen and (min-width: 769px) and (max-width: 1023px) {
  .nf-bsheet {
    max-width: 520px;
  }
}

/* installed app on iPhone: keep clear of the status bar */
@media screen and (display-mode: standalone) and (max-width: 1023px) {
  html,
  body {
    background: var(--nf-ink);
  }

  #layout {
    padding-top: env(safe-area-inset-top);
  }
}

/* ---------- bottom sheets (folders, account) ---------- */
.nf-bsheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(10, 18, 31, 0);
  transition: background .18s ease;
}

.nf-bsheet-overlay.nf-open {
  background: rgba(10, 18, 31, .45);
}

.nf-bsheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  max-height: 82dvh;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--nf-surface);
  color: var(--nf-text);
  outline: none;
  transform: translateY(100%);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
}

.nf-open .nf-bsheet {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .nf-bsheet,
  .nf-bsheet-overlay {
    transition: none;
  }
}

.nf-bsheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 8px 8px 18px;
  border-bottom: 1px solid var(--nf-line);
}

.nf-bsheet-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--nf-text);
}

.nf-bsheet-close {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--nf-slate);
  cursor: pointer;
}

.nf-bsheet .nf-i {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.nf-bsheet-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 6px 0 10px;
}

.nf-bsheet-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  background: transparent;
  color: var(--nf-text) !important;
  font: 400 15px var(--nf-font);
  text-align: left;
  text-decoration: none !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nf-bsheet-row .nf-i {
  color: var(--nf-slate);
}

.nf-bsheet-row:active,
.nf-bsheet-row:hover {
  background: var(--nf-paper-2);
}

.nf-bsheet-row[aria-current="true"] {
  background: var(--nf-paper);
  box-shadow: inset 2px 0 0 var(--nf-red);
  font-weight: 600;
}

.nf-bsheet-row[aria-current="true"] .nf-i {
  color: var(--nf-text);
}

.nf-bsheet-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nf-bsheet-meta {
  flex: 0 0 auto;
  min-width: 20px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: #FFFFFF;
  background: var(--nf-ink);
}

html.dark-mode .nf-bsheet-meta {
  background: var(--nf-red);
}

.nf-bsheet-div {
  height: 1px;
  margin: 6px 18px;
  background: var(--nf-line);
}

.nf-bsheet-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nf-bsheet-user .nf-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  font: 600 13px var(--nf-font);
  color: #FFFFFF;
  background: var(--nf-ink);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}

html.dark-mode .nf-bsheet-user .nf-avatar {
  background: #2B3F5C;
}

.nf-bsheet-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nf-bsheet-whol {
  font-size: 11.5px;
  color: var(--nf-slate);
}

.nf-bsheet-whou {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 600;
}

/* ================================================================
   Two-step check page extras
   ================================================================ */

body.action-plugin-nf-verify .nf-sub {
  margin: -8px 0 18px;
  font-size: 13px;
  line-height: 1.45;
  color: #5C6878;
}

body.action-plugin-nf-verify .nf-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: #8A1C14;
  background: #FDECEA;
  border-left: 3px solid var(--nf-red);
}

body.action-plugin-nf-verify #nf-code {
  letter-spacing: .3em;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

body.action-plugin-nf-verify .nf-help a {
  color: var(--nf-ink);
}

/* ================================================================
   Settings > Security
   ================================================================ */

.nf-sec {
  max-width: 720px;
  padding: 28px 32px 48px;
  color: var(--nf-text);
}

.nf-sec-title {
  margin: 0 0 22px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.nf-sec-block {
  padding: 22px 0;
  border-top: 1px solid var(--nf-line);
}

.nf-sec-block h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.nf-sec-lead,
.nf-sec-meta {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--nf-slate);
  max-width: 60ch;
}

.nf-sec-status {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--nf-paper);
}

.nf-sec-status.is-on {
  color: #fff;
  background: var(--nf-ink);
}

.nf-sec-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin: 14px 0 0;
}

.nf-sec-label {
  flex: 0 0 100%;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--nf-slate);
}

.nf-sec-code {
  width: 160px !important;
  height: 38px;
  letter-spacing: .2em;
  font-variant-numeric: tabular-nums;
}

.nf-sec-steps {
  margin: 0 0 6px;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.6;
}

.nf-sec-steps li + li {
  margin-top: 10px;
}

.nf-qr {
  width: 176px;
  height: 176px;
  margin: 12px 0 8px;
  background: #fff;
  border: 1px solid var(--nf-line);
}

.nf-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.nf-secret {
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--nf-text);
  background: var(--nf-paper);
  padding: 2px 6px;
}

.nf-sec-codes {
  margin: 0 0 20px;
  padding: 16px 18px;
  background: var(--nf-paper-2);
  border-left: 3px solid var(--nf-red);
}

.nf-codes {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 6px 36px;
  margin: 0 0 14px;
  padding-left: 22px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.nf-sec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.nf-sec-table th {
  padding: 8px 10px 8px 0;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--nf-slate);
  border-bottom: 1px solid var(--nf-line);
}

.nf-sec-table td {
  padding: 9px 10px 9px 0;
  border-bottom: 1px solid var(--nf-line);
  font-variant-numeric: tabular-nums;
}

.nf-sec .nf-tag {
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: var(--nf-ink);
}

.nf-sec-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--nf-text-2);
}

.nf-sec-list li + li {
  margin-top: 8px;
}

.nf-sec .nf-ghost {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--nf-line-2);
  background: transparent;
  color: var(--nf-text);
  font: 500 12.5px var(--nf-font);
  cursor: pointer;
}

/* settings list entry icon */
#settings-menu li.nf-security a:before,
#settings-menu a.nf-security:before {
  content: "\f3ed";
}

/* frames never show the app chrome */
html.iframe #layout-menu {
  display: none !important;
}

/* sender initials in place of the generic photo */
.nf-initials {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 13px var(--nf-font);
  letter-spacing: .02em;
  color: #fff;
  background: var(--nf-ink);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}

.nf-initials.is-team {
  background: var(--nf-red);
}

.nf-initials.is-risk {
  background: #8A1C14;
}

/* ================================================================
   Conversation view
   ================================================================ */

.nf-thread-count {
  margin: -8px 0 14px;
  font-size: 12px;
  color: var(--nf-slate);
}

.nf-thread-before,
.nf-thread-after {
  border-top: 1px solid var(--nf-line);
}

.nf-thread-after {
  margin-top: 28px;
}

.nf-msg {
  border-bottom: 1px solid var(--nf-line);
}

.nf-msg-head {
  display: grid;
  grid-template-columns: 32px minmax(90px, max-content) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--nf-text);
  font: 400 13px var(--nf-font);
  text-align: left;
  cursor: pointer;
}

.nf-msg-head:hover {
  background: var(--nf-paper-2);
}

.nf-msg-head:focus-visible {
  outline: 2px solid var(--nf-red);
  outline-offset: -2px;
}

.nf-initials.is-sm {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  font-size: 12px;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
}

.nf-msg-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nf-msg-name {
  font-weight: 600;
  white-space: nowrap;
}

.nf-msg-addr {
  display: none;
  font-size: 12px;
  color: var(--nf-slate);
}

.nf-msg-snip {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--nf-slate);
}

.nf-msg-date {
  font-size: 12px;
  color: var(--nf-slate);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.nf-msg.is-unread .nf-msg-name,
.nf-msg.is-unread .nf-msg-snip {
  color: var(--nf-text);
  font-weight: 600;
}

.nf-msg.is-open .nf-msg-snip {
  visibility: hidden;
}

.nf-msg.is-open .nf-msg-addr {
  display: block;
}

.nf-msg-body {
  padding: 4px 4px 22px 48px;
  font-size: 14px;
  line-height: 1.6;
}

.nf-msg-body .nf-msg-content div.pre {
  font-family: var(--nf-font) !important;
  font-size: 14px;
}

.nf-msg-body blockquote,
#messagebody blockquote {
  margin: 8px 0;
  padding: 0 0 0 12px;
  border-left: 2px solid var(--nf-line-2);
  color: var(--nf-slate);
}

.nf-msg-loading {
  margin: 8px 0;
  font-size: 12.5px;
  color: var(--nf-slate);
}

.nf-thread-fold {
  display: block;
  width: 100%;
  height: 34px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--nf-line);
  background: var(--nf-paper-2);
  font: 600 12px var(--nf-font);
  color: var(--nf-text);
  cursor: pointer;
}

.nf-thread-fold:hover {
  color: var(--nf-red);
}

/* the message being read inside a conversation */
.nf-has-thread #message-header > .header.nf-msg-current {
  padding-top: 16px;
}

/* reply bar under the conversation (Gmail-style) */
.nf-thread-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 8px;
}

.nf-respond {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px 0 14px;
  border: 1px solid var(--nf-line-2);
  background: var(--nf-surface);
  color: var(--nf-text);
  font: 500 13px var(--nf-font);
  cursor: pointer;
}

.nf-respond svg {
  width: 15px;
  height: 15px;
}

.nf-respond:hover {
  border-color: var(--nf-ink);
}

.nf-respond:focus-visible {
  outline: 2px solid var(--nf-red);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .nf-msg-head {
    grid-template-columns: 32px minmax(0, 1fr) auto;
  }

  .nf-msg-snip {
    grid-column: 2 / -1;
    grid-row: 2;
  }

  .nf-msg-body {
    padding-left: 4px;
  }
}

.nf-msg-head:focus {
  outline: none;
  box-shadow: none;
}

.nf-msg-head:focus-visible {
  outline: 2px solid var(--nf-red);
  outline-offset: -2px;
}

/* current message header, same form as the cards */
#message-header > .header.nf-has-cur .header-summary {
  display: none;
}

.nf-cur {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.nf-cur-who {
  min-width: 0;
}

.nf-cur-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}

.nf-cur-addr {
  font-size: 12px;
  color: var(--nf-slate);
}

.nf-cur-to {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  color: var(--nf-slate);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 52ch;
}

#message-header > .header.nf-has-cur .header-content {
  flex: 1;
  min-width: 0;
}

#message-header > .header.nf-has-cur .header-links {
  margin-top: 6px;
}

.nf-quote-toggle {
  display: inline-block;
  margin: 6px 0;
  padding: 0 8px;
  height: 18px;
  border: 1px solid var(--nf-line-2);
  background: var(--nf-paper-2);
  color: var(--nf-slate);
  font: 600 11px/16px var(--nf-font);
  letter-spacing: .08em;
  cursor: pointer;
}

.nf-quote-toggle:hover {
  border-color: var(--nf-ink);
  color: var(--nf-text);
}

/* ================================================================
   Rich-text composer (TinyMCE)
   ================================================================ */

body.task-mail.action-compose .tox.tox-tinymce {
  border: 0 !important;
  border-radius: 0 !important;
}

body.task-mail.action-compose .tox .tox-editor-header {
  border-top: 1px solid var(--nf-line) !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  background: var(--nf-paper-2) !important;
}

body.task-mail.action-compose .tox .tox-toolbar,
body.task-mail.action-compose .tox .tox-toolbar__primary,
body.task-mail.action-compose .tox .tox-toolbar__overflow {
  background: var(--nf-paper-2) !important;
  border: 0 !important;
}

body.task-mail.action-compose .tox .tox-toolbar__group {
  padding: 0 4px !important;
  border-right: 1px solid var(--nf-line) !important;
}

body.task-mail.action-compose .tox .tox-toolbar__group:last-child {
  border-right: 0 !important;
}

body.task-mail.action-compose .tox .tox-tbtn {
  height: 30px !important;
  margin: 3px 1px !important;
  border-radius: 0 !important;
  color: var(--nf-text-2) !important;
}

body.task-mail.action-compose .tox .tox-tbtn svg {
  fill: var(--nf-text-2) !important;
}

body.task-mail.action-compose .tox .tox-tbtn:hover,
body.task-mail.action-compose .tox .tox-tbtn--enabled,
body.task-mail.action-compose .tox .tox-tbtn--enabled:hover {
  background: var(--nf-line) !important;
  color: var(--nf-text) !important;
}

body.task-mail.action-compose .tox .tox-tbtn__select-label {
  font-family: var(--nf-font) !important;
  font-size: 12px !important;
}

body.task-mail.action-compose .tox .tox-tbtn--select {
  min-width: 0;
}

body.task-mail.action-compose .tox .tox-edit-area {
  border: 0 !important;
}

body.task-mail.action-compose .tox .tox-edit-area::before {
  display: none !important;
}

.tox .tox-menu,
.tox .tox-collection--list,
.tox .tox-dialog,
.tox .tox-dialog__header,
.tox .tox-dialog__footer {
  border-radius: 0 !important;
}

.tox .tox-collection__item-label {
  font-family: inherit;
}

.tox .tox-dialog__title,
.tox .tox-dialog__body,
.tox .tox-button {
  font-family: var(--nf-font) !important;
}

.tox .tox-button:not(.tox-button--secondary):not(.tox-button--naked) {
  background: var(--nf-red) !important;
  border-color: var(--nf-red) !important;
  border-radius: 0 !important;
}

.tox .tox-button--secondary {
  border-radius: 0 !important;
}

/* plain-text / HTML switch row: keep it out of the way */
body.task-mail.action-compose #composebodycontainer .editor-toolbar {
  background: var(--nf-paper-2);
  border: 0 !important;
  border-top: 1px solid var(--nf-line) !important;
}

body.task-mail.action-compose #composebodycontainer > .tox-tinymce,
body.task-mail.action-compose #composebodycontainer .mce-tinymce {
  border: 0 !important;
}

body.task-mail.action-compose #composebodycontainer {
  border-top: 0 !important;
}

.nf-thread-before > .nf-thread-count {
  margin: 10px 0 8px;
}

html.dark-mode .nf-initials:not(.is-team):not(.is-risk) {
  background: #2B3F5C;
}


/* notifications panel */
.nf-sheet.nf-notify {
  max-width: 520px;
}

.nf-notify-body .nf-sec-lead,
.nf-notify-body .nf-sec-meta {
  max-width: none;
}

.nf-notify-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 18px;
}

.nf-notify-actions .btn {
  height: 38px;
  padding: 0 18px 0 16px;
}

.nf-notify-sound {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--nf-line);
  font-size: 13px;
  cursor: pointer;
}

.nf-notify-sound input {
  width: 16px;
  height: 16px;
  accent-color: var(--nf-red);
}

.nf-notify .nf-alert {
  display: block;
}

/* ================================================================
   Settings > Password
   ================================================================ */

@media screen and (min-width: 1024px) {
  body.task-settings.action-plugin-password #layout > #layout-content {
    grid-column: 2 / -1;
  }

  body.action-plugin-password #layout > #layout-content > .header > .header-title {
    display: block !important;
  }
}

body.action-plugin-password .formcontent {
  max-width: 500px;
  padding: 26px 28px 6px !important;
}

body.action-plugin-password table.propform,
body.action-plugin-password table.propform tbody {
  display: block;
  width: 100%;
}

body.action-plugin-password table.propform tr {
  display: flex;
  flex-direction: column;
  margin: 0 0 16px;
}

body.action-plugin-password table.propform td {
  display: block;
  width: 100%;
  max-width: none;
  flex: none;
  padding: 0 !important;
  border: 0;
}

body.action-plugin-password table.propform label {
  padding: 0 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--nf-text);
}

body.action-plugin-password table.propform input.form-control {
  height: 40px;
}

body.action-plugin-password #ruleslist {
  margin: 4px 0 0;
  padding: 12px 14px;
  list-style: none;
  background: var(--nf-paper-2);
  border-left: 2px solid var(--nf-line-2);
  color: var(--nf-slate);
}

body.action-plugin-password #ruleslist li {
  padding: 2px 0;
  font-size: 12.5px;
  font-style: normal;
  line-height: 1.45;
}

body.action-plugin-password .formbuttons {
  padding: 10px 28px 28px;
}

@media screen and (max-width: 1023px) {
  .nf-palette-foot,
  .nf-palette-item .nf-pi-hint {
    display: none;
  }

  .nf-overlay {
    padding-top: max(16px, env(safe-area-inset-top));
  }
}

/* ================================================================
   Unread first: list split into unread and read
   ================================================================ */

.nf-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  height: 24px;
  margin: 0 0 0 10px;
  padding: 0 9px;
  border: 1px solid var(--nf-line-2);
  background: transparent;
  color: var(--nf-slate);
  font: 500 11.5px/1 var(--nf-font);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nf-group-toggle::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
  opacity: .6;
}

.nf-group-toggle:hover {
  border-color: var(--nf-text);
  color: var(--nf-text);
}

.nf-group-toggle[aria-pressed="true"] {
  border-color: var(--nf-ink);
  background: var(--nf-ink);
  color: #FFFFFF;
}

.nf-group-toggle[aria-pressed="true"]::before {
  background: var(--nf-red);
  opacity: 1;
}

html.dark-mode .nf-group-toggle[aria-pressed="true"] {
  border-color: #2B3F5C;
  background: #2B3F5C;
}

.nf-group-toggle:focus-visible {
  outline: 2px solid var(--nf-red);
  outline-offset: 1px;
}

html.nf-grouped #messagelist tbody tr[data-nf-group] {
  position: relative;
  margin-top: 30px;
}

html.nf-grouped #messagelist tbody tr[data-nf-group]::before {
  content: attr(data-nf-label);
  position: absolute;
  left: 0;
  right: 0;
  top: -30px;
  height: 30px;
  padding: 0 16px;
  line-height: 30px;
  font: 600 11.5px/30px var(--nf-font);
  letter-spacing: .01em;
  color: var(--nf-text);
  background: var(--nf-paper-2);
  border-bottom: 1px solid var(--nf-line);
  pointer-events: none;
}

html.nf-grouped #messagelist tbody tr[data-nf-group="read"]::before {
  color: var(--nf-slate);
  border-top: 1px solid var(--nf-line);
}

/* ================================================================
   Sign-in: show / hide password
   ================================================================ */

.nf-reveal {
  flex: 0 0 auto;
  align-self: stretch;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: #5C6878;
  font: 600 13px var(--nf-font);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nf-reveal:hover {
  color: var(--nf-ink);
}

.nf-reveal:focus-visible {
  outline: 2px solid var(--nf-red);
  outline-offset: -6px;
}

body.task-login #rcmloginpwd::-ms-reveal {
  display: none;
}

/* ================================================================
   Phones: close buttons, dialogs, compact menus
   ================================================================ */

.nf-exit {
  display: none;
}

@media screen and (max-width: 1023px) {
  .nf-exit {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    align-self: center;
    width: 44px;
    height: 44px;
    margin-left: 4px;
    color: var(--nf-text) !important;
    z-index: 2;
  }

  .nf-exit svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
  }

  /* pop-up pages (list options, search options, dialogs) cover the bottom bar */
  body:has(> .ui-dialog:not([style*="display: none"])) .nf-tabbar,
  body:has(> .ui-widget-overlay) .nf-tabbar {
    display: none !important;
  }

  .ui-dialog .ui-dialog-titlebar-close {
    display: block !important;
    color: var(--nf-text);
  }

  /* menus from the top-right button, and their submenus */
  html.touch .popover .listing li a,
  html.touch .popover ul.menu li a,
  .popover .listing li a,
  .popover ul.menu li a {
    line-height: 40px !important;
    font-size: 14px !important;
    padding: 0 14px !important;
  }

  html.touch .popover .listing li a:before,
  html.touch .popover ul.menu li a:before,
  .popover .listing li a:before,
  .popover ul.menu li a:before {
    font-size: 14px !important;
    width: 18px !important;
    margin-right: 10px !important;
  }

  .popover .popover-header {
    min-height: 44px;
    font-size: 14px;
  }

  .popover .popover-header a.button,
  .popover .popover-header a.button .inner {
    font-size: 14px !important;
  }

  .popover .listing li,
  .popover ul.menu li {
    min-height: 0;
  }
}

@media screen and (max-width: 1023px) {
  body.task-mail #layout-list > .header > .header-title {
    flex: 0 1 auto;
    margin: 0 !important;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #layout-list > .header > .nf-group-toggle {
    align-self: center;
    margin: 0 12px 0 auto;
  }
}

/* list header: the folder name never truncates; the count gives way first */
@media screen and (min-width: 1024px) {
  body.task-mail.action-none #layout > #layout-list > .header > .header-title {
    flex: 0 0 auto;
    overflow: visible;
  }

  body.task-mail.action-none #layout-list > .header > .nf-count {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

@media screen and (min-width: 1024px) and (max-width: 1365px) {
  body.task-mail.action-none #layout-list > .header > .nf-count {
    display: none;
  }
}

/* ================================================================
   Touch: selection bar and swipe actions
   ================================================================ */

#layout-list > .header {
  position: relative;
}

#messagelist tbody tr,
#messagelist tbody tr a {
  -webkit-touch-callout: none;
}

@media (pointer: coarse) {
  #messagelist tbody tr {
    -webkit-user-select: none;
    user-select: none;
  }
}

.nf-selbar {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px 0 4px;
  background: var(--nf-ink);
  color: #FFFFFF;
}

.nf-selbar-count {
  flex: 1;
  min-width: 0;
  padding-left: 6px;
  font: 600 15px var(--nf-font);
  white-space: nowrap;
}

.nf-selbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #FFFFFF;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nf-selbar-btn:active {
  background: rgba(255, 255, 255, .12);
}

.nf-selbar-btn .nf-i {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: square;
}

.nf-selbar-btn[aria-label="More actions"] .nf-i {
  stroke-width: 3;
  stroke-linecap: round;
}

html.nf-selecting #messagelist tbody tr.selected {
  background: var(--nf-paper);
}

#messagelist-content {
  position: relative;
}

.nf-swipe-bg {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: var(--nf-paper);
  color: var(--nf-slate);
  font: 600 13px var(--nf-font);
  pointer-events: none;
  transition: background .12s ease, color .12s ease;
}

.nf-swipe-bg > span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nf-swipe-bg .nf-i {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: square;
}

.nf-swipe-bg.nf-left .nf-swipe-mark,
.nf-swipe-bg.nf-right .nf-swipe-del {
  visibility: hidden;
}

.nf-swipe-bg.nf-left.nf-armed {
  background: var(--nf-red);
  color: #FFFFFF;
}

.nf-swipe-bg.nf-right.nf-armed {
  background: var(--nf-ink);
  color: #FFFFFF;
}

html.dark-mode .nf-swipe-bg.nf-right.nf-armed {
  background: #2B3F5C;
}
