/** Settings polish: single preferences navigation and native settings forms. */
.cm-settings-intro, .cm-settings-welcome { display: none; }
/* Shared settings navigation: identical icon/text axes, no hidden entries. */
@media screen and (min-width: 769px) {
  html:not(.iframe):not(.dark-mode) body.task-settings #settings-menu > li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px !important;
    min-height: 36px;
    line-height: 22px !important;
    box-sizing: border-box;
  }
  html:not(.iframe):not(.dark-mode) body.task-settings #settings-menu > li:is(.preferences,.folders,.identities,.responses) > a::before {
    content: "" !important;
    float: none !important;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0 !important;
    background: currentColor;
    mask: var(--cm-settings-icon) center / 18px 18px no-repeat;
  }
  body.task-settings #settings-menu #settingstabpreferences { --cm-settings-icon: url('../assets/icons/ui/lucide/regular/sliders-horizontal.svg'); }
  body.task-settings #settings-menu #settingstabfolders { --cm-settings-icon: url('../assets/icons/ui/lucide/regular/folder.svg'); }
  body.task-settings #settings-menu #settingstabidentities { --cm-settings-icon: url('../assets/icons/ui/lucide/regular/contact-round.svg'); }
  body.task-settings #settings-menu #settingstabresponses { --cm-settings-icon: url('../assets/icons/ui/lucide/regular/message-square.svg'); }
  body.cm-settings-preferences #settings-menu #settingstabpreferences > a::before { display: none !important; }
  body.cm-settings-preferences #sections-table td.section { display: flex; align-items: center; gap: 10px; }
  body.cm-settings-preferences #sections-table td.section::before { float: none; flex: 0 0 18px; margin: 0 !important; }
  html:not(.iframe):not(.dark-mode) body.task-settings :is(#identities-table,#responses-table) tr > td {
    height: 40px; padding: 10px 14px; border: 0; font-size: 13px;
  }
  html:not(.iframe):not(.dark-mode) body.task-settings :is(#identities-table,#responses-table) tr.selected > td {
    background: #eef4fb !important; color: #245994 !important;
  }
  html:not(.iframe):not(.dark-mode) body.task-settings :is(#identities-table,#responses-table) td::before {
    content: "" !important; width: 18px; height: 18px; background: currentColor;
    display: inline-block !important; float: none !important; vertical-align: -4px; margin: 0 10px 0 0;
    mask: var(--cm-settings-record-icon) center / 18px 18px no-repeat;
  }
  #identities-table { --cm-settings-record-icon: url('../assets/icons/ui/lucide/regular/contact-round.svg'); }
  #responses-table { --cm-settings-record-icon: url('../assets/icons/ui/lucide/regular/message-square.svg'); }
  html:not(.iframe):not(.dark-mode) body.task-settings #layout-content #toolbar-menu > li > a {
    display: inline-flex; align-items: center; gap: 7px; min-height: 36px;
    padding: 8px 12px; border-radius: 9px; color: #555; font-size: 13px;
    width: auto !important; max-width: none !important; height: 36px !important; line-height: 20px;
  }
  html:not(.iframe):not(.dark-mode) body.task-settings:is(.action-identities,.action-responses,.action-folders) #layout-content > .header { justify-content: flex-start; padding-inline: 24px; }
  html:not(.iframe):not(.dark-mode) body.task-settings #layout-content #toolbar-menu { display: flex; align-items: center; gap: 8px; margin: 0; }
  html:not(.iframe):not(.dark-mode) body.task-settings #layout-content #toolbar-menu > li { height: auto; border: 0 !important; }
  html:not(.iframe):not(.dark-mode) body.task-settings #layout-content #toolbar-menu > li > a .inner { display: inline; }
  html:not(.iframe):not(.dark-mode) body.task-settings #layout-content #toolbar-menu > li > a.create {
    color: #245994; background: #eef4fb;
  }
  html:not(.iframe):not(.dark-mode) body.task-settings #layout-content #toolbar-menu > li > a:is(.create,.delete,.purge)::before {
    content: "" !important; display: inline-block; float: none; margin: 0;
    width: 16px !important; height: 16px !important; flex: 0 0 16px; background: currentColor;
    mask: var(--cm-settings-command-icon) center / 16px 16px no-repeat;
  }
  body.task-settings #toolbar-menu a.create { --cm-settings-command-icon: url('../assets/icons/ui/lucide/regular/plus.svg'); }
  body.task-settings #toolbar-menu a.delete { --cm-settings-command-icon: url('../assets/icons/ui/lucide/regular/trash-2.svg'); }
  body.task-settings #toolbar-menu a.purge { --cm-settings-command-icon: url('../assets/icons/ui/lucide/regular/ban.svg'); }
  html:not(.iframe):not(.dark-mode) body.task-settings #layout-content #toolbar-menu a:not(.disabled):hover { background: #f0f0f0; }
  html:not(.iframe):not(.dark-mode) body.task-settings #layout-content #toolbar-menu a.disabled { opacity: .45; }
  html:not(.iframe):not(.dark-mode) body.task-settings #subscription-table li.mailbox > a::before {
    content: "" !important; display: inline-block; width: 18px; height: 18px;
    background: currentColor; mask: var(--cm-settings-folder-icon, url('../assets/icons/ui/lucide/regular/folder.svg')) center / contain no-repeat;
  }
  #subscription-table li.inbox { --cm-settings-folder-icon: url('../assets/icons/ui/lucide/regular/inbox.svg'); }
  #subscription-table li.drafts { --cm-settings-folder-icon: url('../assets/icons/ui/lucide/regular/file-pen-line.svg'); }
  #subscription-table li.sent { --cm-settings-folder-icon: url('../assets/icons/ui/lucide/regular/send.svg'); }
  #subscription-table li.junk { --cm-settings-folder-icon: url('../assets/icons/ui/lucide/regular/ban.svg'); }
  #subscription-table li.trash { --cm-settings-folder-icon: url('../assets/icons/ui/lucide/regular/trash-2.svg'); }
  #subscription-table li.archive { --cm-settings-folder-icon: url('../assets/icons/ui/lucide/regular/archive.svg'); }
}

html.iframe:is(.layout-large,.layout-normal):not(.dark-mode) body.task-settings .html-editor a.mce-i-html::before {
  content: "" !important; display: inline-block; width: 16px; height: 16px;
  background: currentColor; mask: url('../assets/icons/ui/lucide/regular/code-xml.svg') center / contain no-repeat;
}

html.iframe:is(.layout-large,.layout-normal):not(.dark-mode) body.action-edit-prefs fieldset.advanced > legend {
  padding: 10px 12px; border: 1px solid #e8e8e8; border-radius: 9px;
  background: #fafafa; cursor: pointer; font-size: 13px;
}
html.iframe:is(.layout-large,.layout-normal):not(.dark-mode) body.action-edit-prefs fieldset.advanced > legend::after {
  content: ""; display: inline-block; width: 16px; height: 16px; margin-left: 8px;
  vertical-align: -3px; background: currentColor;
  mask: url('../assets/icons/ui/lucide/regular/chevron-down.svg') center / contain no-repeat;
}
html.iframe:is(.layout-large,.layout-normal):not(.dark-mode) body.action-edit-prefs fieldset.advanced > legend.closed::after { transform: rotate(-90deg); }
html.iframe:is(.layout-large,.layout-normal):not(.dark-mode) body.action-edit-prefs fieldset.advanced > legend:focus-visible { outline: 2px solid #2864ac; outline-offset: 2px; }
html.iframe:is(.layout-large,.layout-normal):not(.dark-mode) body.action-edit-prefs .skinselection {
  display: flex; align-items: center; gap: 14px; padding: 12px;
  border: 1px solid #e5e5e5; border-radius: 10px; width: 100%; margin: 0;
}
html.iframe:is(.layout-large,.layout-normal):not(.dark-mode) body.action-edit-prefs .skinselection:has(input:checked) { border-color: #a9c3e2; background: #f6f9fd; }
html.iframe:is(.layout-large,.layout-normal):not(.dark-mode) body.action-edit-prefs .skinselection .skinitem { padding: 0; }
html.iframe:is(.layout-large,.layout-normal):not(.dark-mode) body.action-edit-prefs .skinselection input[type="radio"] { accent-color: #2864ac; }
html.iframe:is(.layout-large,.layout-normal):not(.dark-mode) body.task-settings .formcontent a:not(.mce-i-html):not(.button) { color: #2864ac !important; }
html.iframe:is(.layout-large,.layout-normal):not(.dark-mode) body.action-edit-prefs .skinthumbnail[alt="cloudmail"] {
  content: url('../assets/icons/brand/cloudmail-mark.svg');
  object-fit: contain; width: 48px; height: 48px; padding: 6px;
  border: 0; background: transparent;
}
html.iframe:is(.layout-large,.layout-normal):not(.dark-mode) body.task-settings .formcontent textarea.form-control { min-height: 160px; resize: vertical; }
html.iframe:is(.layout-large,.layout-normal):not(.dark-mode) body.task-settings .formcontent .mce-tinymce { border-radius: 9px; overflow: hidden; border-color: #dedede; }
@media screen and (min-width: 769px) {
  html:not(.iframe):not(.dark-mode) body.cm-settings-preferences #layout-sidebar {
    display: flex !important;
    flex: 0 0 248px !important;
    width: 248px !important;
    min-width: 248px !important;
    max-width: 248px !important;
    box-shadow: inset -1px 0 #eaeaea;
  }
  body.cm-settings-preferences #layout-sidebar > .header {
    justify-content: flex-start;
    padding-inline: 24px !important;
  }
  body.cm-settings-preferences #layout-sidebar .header-title { margin: 0 !important; text-align: left !important; }
  body.cm-settings-preferences #layout-sidebar .task-menu-button,
  body.cm-settings-preferences #layout-sidebar > .column-resizer,
  body.cm-settings-preferences #layout-list,
  body.cm-settings-preferences #layout-content > :is(.header, .footer) { display: none !important; }
  html:not(.iframe) body.cm-settings-preferences #layout-content {
    display: flex !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
  }
  body.cm-settings-preferences #layout-sidebar > .scroller { overflow: auto; }
  body.cm-settings-preferences #settings-menu #settingstabpreferences > a {
    color: #717171 !important;
    background: transparent !important;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    margin-top: 8px !important;
  }
  body.cm-settings-preferences #settingstabpreferences > a::before { display: none; }
  body.cm-settings-preferences #settings-menu > li:not(:first-child) > a {
    font-size: 13px;
    line-height: 36px;
    height: 36px;
  }
  body.cm-settings-preferences #settingstabfolders { margin-top: 16px; }
  body.cm-settings-preferences #sections-table {
    width: calc(100% - 16px);
    margin: 0 8px;
    border-collapse: separate;
    border-spacing: 0 2px;
  }
  body.cm-settings-preferences #sections-table td.section {
    box-sizing: border-box;
    height: 36px;
    padding: 7px 10px !important;
    line-height: 22px;
    font-size: 13px;
    white-space: normal;
    border: 0 !important;
    border-radius: 9px;
    background: transparent;
  }
  body.cm-settings-preferences #sections-table tr:hover > td { background: #f0f0f0 !important; }
  body.cm-settings-preferences #sections-table tr.selected > td {
    background: #eef4fb !important;
    color: #245994 !important;
    font-weight: 600;
  }
  body.cm-settings-preferences #sections-table:focus-visible tr.focused > td,
  body.cm-settings-preferences #sections-table td:focus-visible {
    outline: 2px solid #2864ac;
    outline-offset: -2px;
  }
  body.cm-settings-preferences #sections-table td::before { font-size: 16px; width: 18px; margin-right: 10px; }
  body.cm-settings-preferences #sections-table tr:is(.general, .mailbox, .mailview, .compose, .addressbook, .folders, .server, .encryption) td::before,
  body.cm-settings-preferences #settings-menu > li:is(.folders, .identities, .responses) > a::before {
    content: "" !important;
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: -4px;
    background: currentColor;
    mask: var(--cm-settings-icon) center / 18px 18px no-repeat;
  }
  body.cm-settings-preferences #rcmrowgeneral { --cm-settings-icon: url('../assets/icons/ui/lucide/regular/monitor.svg'); }
  body.cm-settings-preferences #rcmrowmailbox { --cm-settings-icon: url('../assets/icons/ui/lucide/regular/list.svg'); }
  body.cm-settings-preferences #rcmrowmailview { --cm-settings-icon: url('../assets/icons/ui/lucide/regular/mail-open.svg'); }
  body.cm-settings-preferences #rcmrowcompose { --cm-settings-icon: url('../assets/icons/ui/lucide/regular/file-pen-line.svg'); }
  body.cm-settings-preferences #rcmrowaddressbook { --cm-settings-icon: url('../assets/icons/ui/lucide/regular/users-round.svg'); }
  body.cm-settings-preferences #rcmrowfolders { --cm-settings-icon: url('../assets/icons/ui/lucide/regular/folder-input.svg'); }
  body.cm-settings-preferences #settingstabfolders { --cm-settings-icon: url('../assets/icons/ui/lucide/regular/folder.svg'); }
  body.cm-settings-preferences #rcmrowserver { --cm-settings-icon: url('../assets/icons/ui/lucide/regular/server.svg'); }
  body.cm-settings-preferences #rcmrowencryption { --cm-settings-icon: url('../assets/icons/ui/lucide/regular/lock-keyhole.svg'); }
  body.cm-settings-preferences #settingstabidentities { --cm-settings-icon: url('../assets/icons/ui/lucide/regular/contact-round.svg'); }
  body.cm-settings-preferences #settingstabresponses { --cm-settings-icon: url('../assets/icons/ui/lucide/regular/message-square.svg'); }
  body.cm-settings-preferences .cm-settings-intro {
    display: block;
    flex: 0 0 auto;
    padding: 30px 32px 22px;
    border-bottom: 1px solid #f0f0f0;
  }
  .cm-settings-intro h2 { font-size: 22px; font-weight: 650; line-height: 1.3; margin: 0 0 8px; }
  .cm-settings-intro p { color: #737373; font-size: 13px; line-height: 1.5; margin: 0; }
  body.cm-settings-preferences .iframe-wrapper { position: relative; flex: 1 1 auto; min-height: 0; }
  body.cm-settings-preferences .cm-settings-welcome:not([hidden]) {
    display: grid;
    place-content: center;
    position: absolute;
    inset: 0;
    padding: 32px;
    background: #fff;
    color: #737373;
    font-size: 14px;
    text-align: center;
  }
}

/* Embedded preference documents have their own viewport: use Elastic's inherited layout class. */
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) {
  --cm-color-focus: #2864ac;
  color: #262626;
  background: #fff;
}
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .formcontent {
  padding: 26px 32px !important;
}
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) form.propform {
  max-width: 840px;
  margin: 0;
}
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) fieldset {
  margin: 0 0 30px !important;
  padding: 0;
}
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) legend {
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 16px;
  color: #333;
}
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .form-group.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 1fr);
  align-items: center;
  gap: 16px;
  margin: 0 0 14px;
}
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .form-group.row > td {
  width: auto;
  max-width: none;
  padding: 0;
  min-width: 0;
}
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .form-group.row > td[colspan="2"] { grid-column: 1 / -1; }
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .form-group.row > td:is(:only-child,.col-sm-12) { grid-column: 1 / -1; }
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .col-form-label {
  font-size: 13px;
  line-height: 1.5;
  hyphens: none;
  color: #555;
}
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .form-control {
  border: 1px solid #dedede;
  border-radius: 9px;
  box-shadow: none;
  min-height: 38px;
  font-size: 13px;
  color: #333;
  background-color: #fff;
}
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .form-control:focus {
  border-color: #2864ac !important;
  box-shadow: inset 0 0 0 1px #2864ac !important;
  outline: none;
}
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .custom-control-input:checked ~ .custom-control-label::before {
  background-color: #2864ac;
  border-color: #2864ac;
}
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .custom-control-input:focus ~ .custom-control-label::before {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2864ac;
}
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .custom-control-input:disabled ~ .custom-control-label { opacity: .6; }
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .formbuttons {
  padding: 14px 32px !important;
  border-top: 1px solid #eee;
  background: #fff;
}
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .formbuttons .btn-primary {
  background: #2864ac !important;
  border-color: #2864ac !important;
  border-radius: 9px;
  min-height: 38px;
  padding: 8px 18px;
  font-size: 13px;
  color: #fff !important;
}
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .formbuttons .btn-primary:not(:disabled):hover { background: #21558f !important; }
html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .formbuttons .btn-primary::before { display: none !important; }
@media (max-width: 600px) {
  html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .form-group.row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  html.iframe:is(.layout-large, .layout-normal):not(.dark-mode) body.task-settings:is(.action-edit-prefs, .action-edit-identity, .action-edit-response, .action-add-response, .action-edit-folder) .formcontent { padding: 20px !important; }
}
