/**
 * Modern Larry — a professional refresh of the Larry skin.
 * Based on Larry by FLINT / Büro für Gestaltung and the Roundcube Dev Team.
 * Licensed under CC BY-SA 3.0. See README.md for attribution and maintenance.
 * Keep Larry's positioning and splitters; theme only the application chrome.
 */

:root {
  color-scheme: light;
  --ml-bg: #f2f5f8;
  --ml-surface: #fff;
  --ml-subtle: #f8fafc;
  --ml-border: #dce4ec;
  --ml-text: #243447;
  --ml-muted: #607086;
  --ml-accent: #087f8c;
  --ml-accent-hover: #066874;
  --ml-selection: #e3f3f4;
  --ml-nav: #172b3a;
  --ml-radius: 10px;
  --ml-shadow: 0 2px 8px rgb(23 43 58 / 4%);
}

body {
  margin: 0;
  color: var(--ml-text);
  background: var(--ml-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a, a:visited { color: var(--ml-accent); }
a:hover { color: var(--ml-accent-hover); }
::selection { color: #123a40; background: #cbeaec; }

/* Account bar and primary navigation */
#topline,
.minimal #topline,
.minimal #topline:hover,
.extwin #topline {
  position: relative;
  top: 0;
  box-sizing: border-box;
  width: auto;
  height: 30px;
  padding: 4px 20px;
  border: 0;
  background: #10222f;
  color: #c3d0dc;
  font-size: 11px;
  line-height: 22px;
  opacity: 1;
}
#topline a,
#topline .topleft a,
#topline a.button-logout { color: #c3d0dc; }
#topline a:hover { color: #fff; }
#topline .topleft a { padding-top: 0; }
#topline span.username,
.minimal #topline span.username { padding-top: 0; }
#topline a.button-logout,
.minimal #topline a.button-logout { display: inline-block; padding: 0 0 0 12px; background: none; }

#topnav,
.minimal #topnav {
  top: 0;
  height: 64px;
  margin: 0;
  padding: 0 20px;
  background: var(--ml-nav);
  box-shadow: 0 2px 6px rgb(16 34 47 / 10%);
}
#toplogo { width: auto; max-width: 200px; max-height: 40px; padding-top: 12px; }
#taskbar { display: flex; align-items: center; gap: 6px; height: 100%; padding-right: 26px; }
#taskbar a,
.minimal #taskbar a {
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 7px;
  color: #d2dee8;
  transition: background-color .15s, color .15s;
}
#taskbar a:hover { color: #fff; background: #243d4f; }
#taskbar a.button-selected { color: #fff; background: #2a4859; box-shadow: inset 0 -2px #54c2cb; }
#taskbar a span.button-inner,
.minimal #taskbar a span.button-inner {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  top: auto;
  width: auto;
  height: auto !important;
  padding: 0;
  background: none;
  text-indent: 0;
  font-size: 13px;
  font-weight: 500;
}
#taskbar a span.button-inner::before {
  content: "";
  width: 19px;
  height: 19px;
  background: currentColor;
  -webkit-mask: var(--ml-icon, url(images/modern/folder.svg)) center / contain no-repeat;
  mask: var(--ml-icon, url(images/modern/folder.svg)) center / contain no-repeat;
}
#taskbar .button-mail { --ml-icon: url(images/modern/mail.svg); }
#taskbar .button-addressbook { --ml-icon: url(images/modern/contacts.svg); }
#taskbar .button-settings { --ml-icon: url(images/modern/settings.svg); }
#taskbar .button-calendar { --ml-icon: url(images/modern/calendar.svg); }
#taskbar .button-logout { --ml-icon: url(images/modern/logout.svg); }
#taskbar .button-logout,
.minimal #taskbar .button-logout { display: none; }
#taskbar .tooltip,
.minimal #taskbar .tooltip { display: none !important; }
#taskbar .minmodetoggle,
.minimal #taskbar .minmodetoggle {
  top: 23px;
  right: 0;
  width: 20px;
  height: 20px;
  background: #a7becd;
  -webkit-mask: url(images/modern/chevron.svg) center / 18px no-repeat;
  mask: url(images/modern/chevron.svg) center / 18px no-repeat;
}
.minimal #topnav { height: 48px; }
.minimal #toplogo { max-height: 32px; padding-top: 8px; }
.minimal #taskbar a { height: 34px; }
.minimal #taskbar .minmodetoggle { top: 14px; transform: rotate(180deg); }

/* Preserve the dimensions expected by Larry's draggable layout. */
#mainscreen { top: 110px; left: 20px; right: 20px; bottom: 20px; }
#mainscreencontent { top: 64px; }
#mainscreen.offset { top: 174px; }
.minimal #mainscreen { top: 94px; }
.minimal #mainscreen.offset { top: 158px; }
.extwin #mainscreen { top: 46px; }
.extwin #mainscreen.offset { top: 110px; }
.uibox { border: 1px solid var(--ml-border); border-radius: var(--ml-radius); background: var(--ml-surface); box-shadow: var(--ml-shadow); }
.listbox, ul.listing li { background-color: var(--ml-surface); }
.watermark { background: #fff url(images/modern-watermark.svg) center / 112px no-repeat; }
.scroller, .boxlistcontent { scrollbar-width: thin; scrollbar-color: #c2ced8 transparent; }

/* Action buttons: local SVGs remain crisp at every display scale. */
#messagetoolbar,
#addressbooktoolbar { top: 0; height: 50px; }
.toolbar .spacer { width: 12px; height: 48px; vertical-align: top; }
/* Split-button wrappers must share the ordinary buttons' top alignment. */
.toolbar .dropbutton { height: 48px; vertical-align: top; }
.toolbar a.button {
  position: relative;
  box-sizing: border-box;
  min-width: 56px;
  max-width: 86px;
  height: 48px;
  margin: 0 2px;
  padding: 28px 7px 3px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #40536a;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  vertical-align: top;
}
.toolbar a.button::before {
  content: "";
  position: absolute;
  top: 5px;
  left: calc(50% - 10px);
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--ml-icon, url(images/modern/more.svg)) center / contain no-repeat;
  mask: var(--ml-icon, url(images/modern/more.svg)) center / contain no-repeat;
}
.toolbar a.button:hover,
.toolbar a.button.pressed,
.toolbar a.button.selected { color: var(--ml-accent); background: #e7eef3; }
.toolbar a.button.compose,
.toolbar a.button.send { min-width: 84px; color: #fff; background: var(--ml-accent); box-shadow: 0 2px 4px rgb(8 127 140 / 15%); }
.toolbar a.button.compose:hover,
.toolbar a.button.send:hover { color: #fff; background: var(--ml-accent-hover); }
.toolbar a.button.disabled { opacity: .45; cursor: default; }
.toolbar a.button.disabled:hover { color: #40536a; background: transparent; }
.toolbar a.button.delete:not(.disabled):hover { color: #bb3449; background: #fcecf0; }
.toolbar a.button.hidden { display: none; }
.toolbar .checkmail { --ml-icon: url(images/modern/refresh.svg); }
.toolbar .compose { --ml-icon: url(images/modern/compose.svg); }
.toolbar .reply { --ml-icon: url(images/modern/reply.svg); }
.toolbar .reply-all { --ml-icon: url(images/modern/reply-all.svg); }
.toolbar .forward { --ml-icon: url(images/modern/forward.svg); }
.toolbar .delete { --ml-icon: url(images/modern/trash.svg); }
.toolbar .archive { --ml-icon: url(images/modern/archive.svg); }
.toolbar .junk { --ml-icon: url(images/modern/junk.svg); }
.toolbar .print { --ml-icon: url(images/modern/print.svg); }
.toolbar .markmessage { --ml-icon: url(images/modern/flag.svg); }
.toolbar .move { --ml-icon: url(images/modern/folder.svg); }
.toolbar .more { --ml-icon: url(images/modern/more.svg); }
.toolbar .attach { --ml-icon: url(images/modern/attach.svg); }
.toolbar .send { --ml-icon: url(images/modern/send.svg); }
.toolbar .savedraft { --ml-icon: url(images/modern/save.svg); }
.toolbar .close { --ml-icon: url(images/modern/close.svg); }
.toolbar .back { --ml-icon: url(images/modern/back.svg); }
.toolbar .download, .toolbar .export { --ml-icon: url(images/modern/download.svg); }
.toolbar .import { --ml-icon: url(images/modern/upload.svg); }
.toolbar .search { --ml-icon: url(images/modern/search.svg); }
.toolbar .insertsig { --ml-icon: url(images/modern/signature.svg); }
.toolbar .spellcheck { --ml-icon: url(images/modern/spell.svg); }
.toolbar .responses { --ml-icon: url(images/modern/chat.svg); }
.toolbar .encrypt { --ml-icon: url(images/modern/lock.svg); }
.dropbutton .dropbuttontip {
  top: 4px;
  right: 0;
  width: 16px;
  height: 24px;
  background: #536a80;
  -webkit-mask: url(images/modern/chevron.svg) center / 16px no-repeat;
  mask: url(images/modern/chevron.svg) center / 16px no-repeat;
}

/* Search and form controls */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], input[type="search"], textarea, select {
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid #c5d1dc;
  border-radius: 6px;
  background-color: #fff;
  color: var(--ml-text);
  font: inherit;
  box-shadow: none;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--ml-accent); }
input:disabled, select:disabled, textarea:disabled { background-color: #f0f3f6; color: var(--ml-muted); }
input[type="text"]:required, input[type="email"]:required, input[type="password"]:required { border-color: #9fb8c5; }
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus,
input[type="search"]:focus, input[type="number"]:focus, textarea:focus, select:focus {
  border-color: var(--ml-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgb(8 127 140 / 14%);
}
a:focus-visible, button:focus-visible, input.button:focus-visible,
#taskbar a:focus-visible, .toolbar a.button:focus-visible,
.dropbutton .dropbuttontip:focus-visible {
  outline: 2px solid #168b9a;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgb(8 127 140 / 12%);
}
#messagesearchtools { top: 7px; }
#quicksearchbar { width: 240px; }
.searchbox input, #quicksearchbar input {
  width: 100%;
  height: 36px;
  padding: 7px 30px 7px 34px;
  border-color: #cdd9e3;
  background: #fff;
  font-size: 13px;
  font-weight: 400;
}
.searchbox .searchicon, .searchbox #searchmenulink,
#quicksearchbar #searchmenulink { top: 9px; }
.searchbox #searchreset, .searchbox .iconbutton.reset,
#quicksearchbar #searchreset { top: 8px; }
#searchfilter select { height: 36px; }
/* Use the actual select, including its keyboard and native option behavior. */
select:not([multiple]):not([size]), select[size="1"] {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 32px;
  background-image: url(images/modern/chevron.svg);
  background-position: right 8px center;
  background-size: 16px;
  background-repeat: no-repeat;
  cursor: pointer;
}
select option, select optgroup { color: var(--ml-text); background: #fff; }
/* Keep selects visible before UI initialization and in plugin content. */
select.decorated {
  opacity: 1;
  height: auto;
  min-height: 34px;
  border: 1px solid #c5d1dc;
  background-color: #fff;
}
select.decorated option { color: var(--ml-text); background: #fff; }
a.menuselector, a.menuselector:active {
  border: 1px solid #c5d1dc;
  border-radius: 6px;
  background: #fff;
  color: var(--ml-text);
}
a.menuselector .handle {
  height: 24px;
  padding: 0 30px 0 9px;
  line-height: 24px;
  background: url(images/modern/chevron.svg) right 7px center / 16px no-repeat;
}
a.menuselector:hover { border-color: #8eb9c1; background-color: #eff6f7; }
.listsearchbox { background: var(--ml-subtle); border-bottom: 1px solid var(--ml-border); }

button, input.button, a.button {
  padding: 7px 14px;
  border: 1px solid #c5d1dc;
  border-radius: 6px;
  background: #fff;
  color: #344b60;
  box-shadow: none;
  font-weight: 500;
  text-shadow: none;
}
button:not(:disabled):hover, input.button:not(:disabled):hover,
a.button:hover { color: var(--ml-accent-hover); background: #eff6f7; border-color: #8eb9c1; }
.formbuttons button, .formbuttons input.button,
button.mainaction, input.button.mainaction {
  padding: 8px 18px;
  border-color: var(--ml-accent);
  border-radius: 6px;
  background: var(--ml-accent);
  color: #fff;
  font-size: 13px;
  box-shadow: none;
  text-shadow: none;
}
.formbuttons button:hover, .formbuttons input.button:hover,
.formbuttons button:focus, .formbuttons input.button:focus,
button.mainaction:hover, input.button.mainaction:hover,
button.mainaction:active, input.button.mainaction:active {
  border-color: var(--ml-accent-hover);
  background: var(--ml-accent-hover);
  color: #fff;
  box-shadow: none;
}

/* Folder, contact, and preference navigation */
.boxtitle, .uibox .boxtitle,
.uibox .listing thead th, .uibox .listing thead td,
.contentbox .boxtitle, body.iframe .boxtitle {
  border-color: var(--ml-border);
  background: var(--ml-subtle);
  color: #42566d;
  font-size: 12px;
  font-weight: 600;
  text-shadow: none;
}
.listbox .boxtitle { padding-left: 14px; }
.listbox .listitem, .listbox .tablink, .listing tbody td, .listing li,
ul.listing li ul { border-color: #edf1f5; }
.listbox .listitem a, .listbox .listitem span, .listbox .tablink a,
.listing tbody td, .listing li a { color: #455a70; }
.listbox .listitem a, .listbox .tablink a, .listing li > a { padding-top: 9px; padding-bottom: 9px; }
.listing tbody td { padding-top: 9px; padding-bottom: 9px; }
.listing tbody td a { color: inherit; }
.listing li > a:hover,
.listbox .listitem a:hover,
.listing tbody tr:not(.selected):hover td { background-color: #f0f5f8; }
.listbox .listitem.selected, .listbox .tablink.selected,
.listbox .listitem.selected > a, .listbox .tablink.selected > a,
.listing tbody tr.selected td, .listing li.selected,
.listing li.selected > a { color: #075d67; background-color: var(--ml-selection); font-weight: 600; }
.listing li.selected > a { box-shadow: inset 3px 0 var(--ml-accent); }
.folderlist li.mailbox .unreadcount {
  top: 8px;
  right: 9px;
  min-width: 16px;
  padding: 1px 6px;
  background: #e9eef4;
  color: #455a70;
  font-size: 11px;
  line-height: 18px;
  font-weight: 600;
}
.folderlist li.mailbox.selected > a .unreadcount,
.folderlist li.mailbox.recent > a .unreadcount { background: var(--ml-accent); color: #fff; }
.folderlist li.recent > a { color: var(--ml-accent); }
#mailboxlist li.mailbox > a,
#subscription-table li.mailbox > a,
#directorylist li > a,
#settings-sections .listitem > a,
#settings-sections .tablink > a { background-image: none; }
#mailboxlist li.mailbox > a::before,
#subscription-table li.mailbox > a::before,
#directorylist li > a::before,
#settings-sections .listitem > a::before,
#settings-sections .tablink > a::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0 10px 0 -26px;
  vertical-align: -3px;
  background: currentColor;
  -webkit-mask: var(--ml-icon, url(images/modern/folder.svg)) center / contain no-repeat;
  mask: var(--ml-icon, url(images/modern/folder.svg)) center / contain no-repeat;
}
#mailboxlist .inbox, #subscription-table .inbox { --ml-icon: url(images/modern/inbox.svg); }
#mailboxlist .sent, #subscription-table .sent { --ml-icon: url(images/modern/send.svg); }
#mailboxlist .drafts, #subscription-table .drafts { --ml-icon: url(images/modern/compose.svg); }
#mailboxlist .trash, #subscription-table .trash { --ml-icon: url(images/modern/trash.svg); }
#mailboxlist .junk, #subscription-table .junk { --ml-icon: url(images/modern/junk.svg); }
#mailboxlist .archive, #subscription-table .archive { --ml-icon: url(images/modern/archive.svg); }
/* Align subscription controls with the refreshed folder rows. */
#subscription-table li input { top: 11px; }
#directorylist .addressbook, #directorylist .contactgroup { --ml-icon: url(images/modern/contacts.svg); }
#settings-sections .preferences, #settings-sections .listitem { --ml-icon: url(images/modern/settings.svg); }
#settings-sections .folders { --ml-icon: url(images/modern/folder.svg); }
#settings-sections .identities { --ml-icon: url(images/modern/contacts.svg); }
#settings-sections .password { --ml-icon: url(images/modern/lock.svg); }
#settings-sections .responses { --ml-icon: url(images/modern/chat.svg); }
#settings-sections .filter { --ml-icon: url(images/modern/flag.svg); }
.treelist li div.collapsed, .treelist li div.expanded { top: 9px; }
#directorylist li.addressbook div.collapsed, #directorylist li.addressbook div.expanded { top: 19px; }

/* Contact rows also exceed the old sprite spacing. Render one icon per
   name cell, including selected contacts and contact groups. */
#contacts-table tbody .contact td.name,
#contacts-table tbody .group td.name {
  background-image: none;
}
#contacts-table tbody td.name {
  padding-left: 12px;
}
#contacts-table td.name::before {
  content: "";
  display: inline-block;
  width: 17px;
  height: 17px;
  margin-right: 10px;
  vertical-align: -3px;
  background: currentColor;
  -webkit-mask: url(images/modern/person.svg) center / contain no-repeat;
  mask: url(images/modern/person.svg) center / contain no-repeat;
}
#contacts-table .group td.name::before {
  -webkit-mask-image: url(images/modern/contacts.svg);
  mask-image: url(images/modern/contacts.svg);
}

/* Preference rows are taller than Larry's sprite spacing. Draw one SVG
   per cell instead of exposing adjacent icons in the old sprite sheet. */
.listbox table.listing { background: var(--ml-surface); }
#sections-table tbody td, #sections-table .listitem span {
  background-image: none;
}
#sections-table tbody td.section {
  padding-left: 12px;
  padding-right: 12px;
  height: auto;
}
#sections-table td.section::before {
  content: "";
  display: inline-block;
  width: 17px;
  height: 17px;
  margin-right: 10px;
  vertical-align: -3px;
  background: currentColor;
  -webkit-mask: var(--ml-icon, url(images/modern/settings.svg)) center / contain no-repeat;
  mask: var(--ml-icon, url(images/modern/settings.svg)) center / contain no-repeat;
}
#sections-table .listitem span.section { padding-left: 12px; }
#sections-table #rcmrowgeneral { --ml-icon: url(images/modern/settings.svg); }
#sections-table #rcmrowmailbox { --ml-icon: url(images/modern/inbox.svg); }
#sections-table #rcmrowmailview { --ml-icon: url(images/modern/mail.svg); }
#sections-table #rcmrowcompose { --ml-icon: url(images/modern/compose.svg); }
#sections-table #rcmrowaddressbook { --ml-icon: url(images/modern/contacts.svg); }
#sections-table #rcmrowfolders { --ml-icon: url(images/modern/folder.svg); }
#sections-table #rcmrowserver { --ml-icon: url(images/modern/archive.svg); }
#sections-table #rcmrowcalendar { --ml-icon: url(images/modern/calendar.svg); }
#sections-table #rcmrowencryption { --ml-icon: url(images/modern/lock.svg); }

/* Lists and reading panes */
.records-table thead th, .records-table thead td {
  border-color: var(--ml-border);
  background: var(--ml-subtle);
  color: var(--ml-muted);
  font-size: 11px;
  font-weight: 600;
}
.records-table thead th a, .records-table thead td a,
.records-table thead th span, .records-table thead td span { color: var(--ml-muted); padding-top: 9px; padding-bottom: 9px; }
.records-table tbody td { height: 22px; padding-top: 7px; padding-bottom: 7px; border-bottom-color: #edf1f5; border-left-color: transparent; }
.records-table tbody tr:not(.selected):hover td { background-color: #f5f9fb; }
.records-table tr.selected td,
.records-table.focus tr.selected td { color: #164d58 !important; background-color: var(--ml-selection) !important; }
.records-table tr.selected td a,
.records-table tr.selected td span { color: #164d58 !important; }
.records-table.focus tbody tr.focused > td:first-child { border-left-color: var(--ml-accent); }
.messagelist tr.unread { color: #172b3a; font-weight: 600; }
.messagelist tr.unread td.subject a { color: #172b3a; }
.messagelist tr.flagged td, .messagelist tr.flagged td a { color: #a54922; }
.messagelist tr.thread.expanded:not(.selected) td { background-color: #f0f5f8; }
.messagelist thead tr th.sortedASC a,
.messagelist thead tr th.sortedDESC a { color: var(--ml-accent); }
#messagelistfooter,
.listbox .boxfooter,
.uibox .boxfooter,
#message.statusbar { border-top-color: var(--ml-border); background: var(--ml-subtle); color: var(--ml-muted); }
.boxfooter .countdisplay, .countdisplay { color: var(--ml-muted); font-size: 11px; }
#messagelistfooter {
  box-sizing: border-box;
  height: 44px;
  padding: 7px 8px;
  border-radius: 0 0 var(--ml-radius) var(--ml-radius);
}
/* Reserve the whole footer height so rows never sit beneath its controls. */
#messagelistcontainer { bottom: 44px; }
#messagelistfooter #countcontrols { display: inline-flex; align-items: center; vertical-align: middle; }
#messagelistfooter .pagenavbuttons { top: 0; }
#messagelistfooter .pagenav .pagejumper { height: 26px; }
#messagelistfooter .pagenav a.button { height: 20px; padding: 3px 4px; margin-bottom: 0; }
.listbox .boxfooter { height: 48px; }
.listbox .scroller.withfooter { bottom: 49px; }
.boxfooter .listbutton { background: var(--ml-subtle); border-right-color: var(--ml-border); }
.boxfooter .listbutton:hover { background: var(--ml-selection); }
#mailview-bottom { border-radius: var(--ml-radius); }
#messageheader, #composeheaders { border-color: var(--ml-border); background: var(--ml-subtle); }
#messageheader h2.subject, #messageheader h3.subject { color: #172b3a; font-size: 18px; line-height: 1.4; font-weight: 600; }
#messageheader .headers-table { color: #455a70; font-size: 12px; }
#messageheader .header-title { color: var(--ml-muted); }

/* A readable segmented format switch in both the reader and preview pane. */
#messageheader .format-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--ml-border);
  border-radius: 7px;
  background: #edf2f6;
  vertical-align: middle;
}
#messageheader .format-toggle a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 46px;
  height: 24px;
  margin: 0;
  padding: 3px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #455a70;
  box-shadow: none;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-decoration: none;
  text-shadow: none;
}
#messageheader .format-toggle a.button:hover {
  color: var(--ml-accent-hover);
  background: #fff;
}
#messageheader .format-toggle a.button.selected,
#messageheader .format-toggle a.button.pressed {
  background: var(--ml-accent);
  color: #fff;
}
#messageheader .format-toggle a.button:focus-visible {
  outline: 2px solid var(--ml-accent);
  outline-offset: 1px;
}
#messageheader .format-toggle .format-label {
  display: inline;
  width: auto;
  height: auto;
  background: none;
  text-indent: 0;
}

#composeheaders input { font-size: 13px; }
/* Recipient inputs must retain a full text line after padding and borders. */
#composeheaders .compose-headers textarea {
  box-sizing: border-box;
  min-height: 36px;
  padding: 7px 10px;
  line-height: 20px;
  font-size: 13px;
  vertical-align: top;
}
#composeheaders .compose-headers input[type="text"],
#composeheaders .compose-headers input[type="email"] { min-height: 36px; }
#composeheaders .compose-headers td.top { padding-top: 10px; }
/* Single SVGs prevent adjacent sprite icons appearing behind taller links. */
#composeheaders .compose-headers a.iconlink {
  position: relative;
  padding: 4px 8px 4px 24px;
  background-image: none;
  color: var(--ml-accent);
  line-height: 20px;
}
#composeheaders .compose-headers a.iconlink::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--ml-icon, url(images/modern/plus.svg)) center / contain no-repeat;
  mask: var(--ml-icon, url(images/modern/plus.svg)) center / contain no-repeat;
}
#composeheaders .compose-headers a.iconlink.edit { --ml-icon: url(images/modern/compose.svg); }
#composeheaders .compose-headers a.iconbutton.cancel {
  background: var(--ml-muted);
  -webkit-mask: url(images/modern/close.svg) center / 14px no-repeat;
  mask: url(images/modern/close.svg) center / 14px no-repeat;
}
/* Compose's address list uses contact/contactgroup cells instead of name
   cells, and its directory rules previously restored the original sprite. */
#compose-contacts #directorylist li > a { background-image: none; }
#compose-contacts #contacts-table tbody td.contact,
#compose-contacts #contacts-table tbody td.contactgroup {
  position: relative;
  padding-left: 38px;
  background-image: none;
}
#compose-contacts #contacts-table td.contact::before,
#compose-contacts #contacts-table td.contactgroup::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 10px;
  width: 17px;
  height: 17px;
  margin: 0;
  background: currentColor;
  -webkit-mask: url(images/modern/person.svg) center / contain no-repeat;
  mask: url(images/modern/person.svg) center / contain no-repeat;
}
#compose-contacts #contacts-table td.contactgroup::before {
  -webkit-mask-image: url(images/modern/contacts.svg);
  mask-image: url(images/modern/contacts.svg);
}
#compose-contacts .boxfooter .listbutton .inner {
  background-image: none;
  text-indent: 0;
  line-height: 35px;
  color: var(--ml-accent);
  font-weight: 600;
  text-align: center;
}
#composebody { font-family: inherit; font-size: 14px; }
body.iframe { background: #fff; }
body.iframe.error { background: var(--ml-subtle); }
.propform fieldset { border-color: var(--ml-border); border-radius: 8px; }
.propform fieldset legend { color: #3e5369; font-weight: 600; }
#preferences-details .identity-encryption-block { background: var(--ml-subtle); border-radius: 6px; }
.skinselection { padding: 12px; border-radius: 8px; }
.skinselection:hover { background: var(--ml-subtle); }
.skinname { color: var(--ml-text); font-weight: 600; }

/* Menus, tabs, dialogs, and notifications */
.popupmenu, #rcmKSearchpane {
  padding: 5px;
  border: 1px solid var(--ml-border);
  border-radius: 9px;
  background: #fff;
  color: var(--ml-text);
  box-shadow: 0 10px 32px rgb(23 43 58 / 16%);
  text-shadow: none;
}
ul.toolbarmenu li { color: var(--ml-text); border-top-color: #edf1f5; }
ul.toolbarmenu li a, ul.toolbarmenu li label, ul.toolbarmenu li span {
  color: #43576b;
  font-size: 12px;
  text-shadow: none;
}
/* Larry's active and icon links have more specific white-text rules. */
ul.toolbarmenu li a.active, ul.toolbarmenu li a.icon { color: #344b60; }
ul.toolbarmenu li a { border-radius: 5px; }
ul.toolbarmenu li a:not(.active), ul.toolbarmenu li a[aria-disabled="true"] {
  color: #64748b;
  cursor: default;
}
ul.toolbarmenu li a span.icon,
ul.toolbarmenu li a.active span.icon {
  position: relative;
  background-image: none;
  color: inherit;
  opacity: 1;
}
ul.toolbarmenu li span.icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 5px;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--ml-icon, url(images/modern/more.svg)) center / contain no-repeat;
  mask: var(--ml-icon, url(images/modern/more.svg)) center / contain no-repeat;
}
ul.toolbarmenu .icon.print { --ml-icon: url(images/modern/print.svg); }
ul.toolbarmenu .icon.download { --ml-icon: url(images/modern/download.svg); }
ul.toolbarmenu .icon.edit { --ml-icon: url(images/modern/compose.svg); }
ul.toolbarmenu .icon.viewsource { --ml-icon: url(images/modern/mail.svg); }
ul.toolbarmenu .icon.move, ul.toolbarmenu .icon.copy { --ml-icon: url(images/modern/folder.svg); }
ul.toolbarmenu .icon.extwin { --ml-icon: url(images/modern/forward.svg); }
ul.toolbarmenu .icon.read, ul.toolbarmenu .icon.unread { --ml-icon: url(images/modern/mail.svg); }
ul.toolbarmenu .icon.flagged, ul.toolbarmenu .icon.unflagged { --ml-icon: url(images/modern/flag.svg); }
ul.toolbarmenu .icon.cross { --ml-icon: url(images/modern/close.svg); }
ul.toolbarmenu .icon.mail { --ml-icon: url(images/modern/mail.svg); }
ul.toolbarmenu li a.active:hover, ul.toolbarmenu li a.active:focus,
ul.toolbarmenu li.selected a, #rcmKSearchpane li.selected { color: #075d67; background-color: var(--ml-selection); }
ul.toolbarmenu li.separator { border-color: var(--ml-border); }
ul.toolbarmenu li.separator label { color: var(--ml-muted); }
.popupmenu > .buttons { border-color: var(--ml-border); background: var(--ml-subtle); }
.ui-dialog.ui-widget-content { border: 1px solid var(--ml-border); border-radius: 12px; background: #fff; box-shadow: 0 20px 70px rgb(16 34 47 / 24%); }
.ui-dialog .ui-dialog-titlebar { padding: 12px 16px; border: 0; border-bottom: 1px solid var(--ml-border); border-radius: 11px 11px 0 0; background: var(--ml-subtle); color: var(--ml-text); text-shadow: none; font-size: 14px; }
.ui-dialog .ui-dialog-buttonpane { border-color: var(--ml-border); background: var(--ml-subtle); }
.ui-widget { font-family: inherit; font-size: 13px; }
.ui-widget-overlay { background: #10222f; opacity: .35; }
.tabsbar { border-color: var(--ml-border); background: var(--ml-subtle); }
.tabsbar .tablink a { background: var(--ml-subtle); color: #53677d; border-color: var(--ml-border); text-shadow: none; }
.tabsbar .tablink.selected a { background: #fff; color: var(--ml-accent); }
#messagestack div { border: 1px solid #2b4357; border-radius: 8px; padding-top: 10px; padding-bottom: 10px; background: #172b3a; color: #eef5fa; box-shadow: 0 5px 20px rgb(16 34 47 / 15%); font-weight: 500; }
#messagestack div.confirmation { color: #9fe6c5; }
#messagestack div.error { color: #ffb2bc; }
#messagestack div.warning { color: #ffe099; }

/* Login uses the same palette and keeps all Roundcube form hooks. */
body.modern-login { background: radial-gradient(ellipse at 20% 15%, #e1eff1 0, transparent 55%), var(--ml-bg); }
#login-form { box-sizing: border-box; width: 440px; max-width: calc(100% - 32px); margin: clamp(32px, 14vh, 160px) auto 32px; }
#login-form .box-inner { box-sizing: border-box; width: 100%; margin: 0; padding: 34px 36px; border: 1px solid var(--ml-border); border-radius: 14px; background: #fff; box-shadow: 0 12px 40px rgb(23 43 58 / 8%); }
#login-form #logo { display: block; width: auto; max-width: 100%; max-height: 56px; margin: 0 auto 30px; }
#login-form form table, #login-form form tbody, #login-form form tr,
#login-form td.title, #login-form td.input { display: block; box-sizing: border-box; width: 100%; }
#login-form form table { border-spacing: 0; }
#login-form td.title { padding: 0 0 6px; color: #455a70; text-align: start; font-size: 12px; font-weight: 600; white-space: normal; }
#login-form td.input { padding: 0 0 18px; }
#login-form input[type="text"], #login-form input[type="email"],
#login-form input[type="password"], #login-form select { width: 100%; min-height: 44px; border-color: #c5d1dc; background: #fff; }
#login-form input:focus { border-color: var(--ml-accent); }
#login-form p.formbuttons { margin: 10px 0 0; }
#login-form .button { box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px 16px; border-color: var(--ml-accent); background: var(--ml-accent); color: #fff; font-size: 14px; font-weight: 600; }
#login-form .button:hover, #login-form .button:active { background: var(--ml-accent-hover); border-color: var(--ml-accent-hover); color: #fff; }
#login-form p.formbuttons + p.oauthlogin { border-color: var(--ml-border); }
#login-form .box-bottom { margin-top: 10px; }
#login-form #message { min-height: 0; padding: 0; }
#login-form #message div { box-sizing: border-box; max-width: 100%; white-space: normal; }
#login-form .noscriptwarning { width: auto; }
#bottomline { color: var(--ml-muted); font-size: 11px; text-shadow: none; }
#bottomline a { color: var(--ml-accent); }

/* Larry remains a desktop layout, with a usable scaled workspace on tablets. */
@media screen and (max-width: 1100px) {
  #mainscreen { left: 12px; right: 12px; bottom: 12px; }
  #topnav, .minimal #topnav { padding-left: 12px; padding-right: 12px; }
  #taskbar a, .minimal #taskbar a { padding-left: 10px; padding-right: 10px; }
  .toolbar a.button { min-width: 48px; padding-left: 4px; padding-right: 4px; }
  .toolbar a.button.compose, .toolbar a.button.send { min-width: 70px; }
  .toolbar .spacer { width: 4px; }
}
@media screen and (max-width: 540px) {
  body.modern-login { min-width: 0; }
  #login-form .box-inner { padding: 28px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  #taskbar a, #topline { transition: none; }
}
@media (forced-colors: active) {
  #taskbar a span.button-inner::before, .toolbar a.button::before,
  #mailboxlist li.mailbox > a::before, #directorylist li > a::before,
  #settings-sections .listitem > a::before { background: CanvasText; }
  #taskbar a.button-selected, .listing li.selected > a { outline: 2px solid Highlight; }
}
