/**
 * mailbox.solar — Elastic fixes for Firefox 66 / Ubuntu 14.04 LTS (retail PCs).
 *
 * 1) Login: ui.js adds .input-group on td.input — never force display:block on that cell.
 * 2) Mail: #layout-content { width:100% } breaks flex columns in old Firefox.
 * 3) Resizer: show handle at <=1024px; JS patch sets width with !important (utexco_ui_fix.js).
 */

/* --- Login: icon bar full width above input (stacked, FF66-safe) --- */
#login-form table,
#login-form tbody,
#login-form tr {
  display: block;
  width: 100%;
}

#login-form td.title {
  display: none !important;
}

#login-form td.input.input-group {
  display: block !important;
  width: 100%;
  padding: 0;
  margin-bottom: 0.75rem;
  box-sizing: border-box;
}

#login-form td.input.input-group > .input-group-prepend {
  display: block !important;
  width: 100%;
}

#login-form td.input.input-group > .input-group-prepend .input-group-text {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  height: 2.5rem;
  line-height: 2.5rem;
  border: 1px solid #ced4da;
  border-bottom: 0;
  border-radius: 0.25rem 0.25rem 0 0;
  background-color: #e9ecef;
}

#login-form td.input.input-group > .form-control {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box;
  border-radius: 0 0 0.25rem 0.25rem;
}

#login-form .formbuttons {
  text-align: center;
  margin-top: 1rem;
}

.task-login #layout-content {
  text-align: center;
}

.task-login #login-form {
  margin-left: auto;
  margin-right: auto;
}

/* --- Mail layout: flex columns (FF66 + width:100% on flex child) ---
 * Только для широких экранов (retail-кассы, десктоп) — на мобильных
 * (<=1024px) не мешаем штатной адаптивной раскладке Elastic
 * (иначе три колонки насильно сжимаются в ширину телефона и обрезаются). */
@media screen and (min-width: 1025px) {
#layout {
  display: -webkit-box !important;
  display: -ms-flexbox !important;
  display: flex !important;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
  -ms-flex-direction: row;
  flex-direction: row;
  -webkit-box-align: stretch;
  -ms-flex-align: stretch;
  align-items: stretch;
  width: 100% !important;
  height: 100% !important;
}

#layout-menu {
  -webkit-box-flex: 0;
  -ms-flex: 0 0 auto;
  flex: 0 0 auto;
}

#layout-sidebar,
#layout-list {
  position: relative;
  -webkit-box-flex: 3;
  -ms-flex: 3 1 300px;
  flex: 3 1 300px;
  min-width: 260px;
  max-width: 30%;
}

#layout-sidebar {
  display: -webkit-box !important;
  display: -ms-flexbox !important;
  display: flex !important;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
}

#layout-sidebar > .scroller,
#layout-sidebar > #folderlist-content {
  -webkit-box-flex: 1;
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

#layout-sidebar > .footer {
  -webkit-box-flex: 0;
  -ms-flex: 0 0 auto;
  flex: 0 0 auto;
}

#layout-sidebar.sidebar-right {
  max-width: 45%;
}

#quotadisplay.quota-widget {
  display: -webkit-box !important;
  display: -ms-flexbox !important;
  display: flex !important;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

#layout-content {
  -webkit-box-flex: 6;
  -ms-flex: 6 1 0%;
  flex: 6 1 0%;
  width: auto !important;
  min-width: 0;
  max-width: none;
}
} /* end @media min-width: 1025px */

.column-resizer {
  z-index: 30 !important;
  pointer-events: auto !important;
  width: 10px !important;
  right: -5px !important;
}

.column-resizer.inverted {
  left: -5px !important;
  right: auto !important;
}

#layout-list.utexco-resized,
#layout-sidebar.utexco-resized {
  flex: none !important;
  max-width: none !important;
}

/* Fallback popup menus (three dots etc.) */
.popupmenu.utexco-menu-open {
  z-index: 15000 !important;
  display: block !important;
  background: #fff !important;
  border: 1px solid #d4dbde !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
  padding: 0.25rem 0 !important;
}

.popupmenu.utexco-menu-open .menu.listing {
  list-style: none;
  margin: 0;
  padding: 0;
}

.popupmenu.utexco-menu-open .menu.listing a {
  display: block;
  padding: 0.5rem 1rem;
  color: #2c363a;
  text-decoration: none;
}

.popupmenu.utexco-menu-open .menu.listing a:hover {
  background: #f1f3f4;
}

.ui-dialog.utexco-about-dialog,
.utexco-about-wrap + .ui-dialog {
  z-index: 25001 !important;
}

.ui-widget-overlay {
  z-index: 25000 !important;
}

#layout-sidebar > .header,
#layout-list > .header,
#layout > div > .header {
  overflow: visible !important;
}

/* Elastic hides resizer at <=1024px */
@media screen and (max-width: 1024px) {
  .column-resizer {
    display: block !important;
  }
}

/* --- Compose: От / Кому / Копия / Скрытая / Ответить / Тема — одна длина (FF66) --- */
#compose-headers .form-group.row {
  display: -webkit-box !important;
  display: -ms-flexbox !important;
  display: flex !important;
  -ms-flex-wrap: nowrap;
  flex-wrap: nowrap;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  margin-bottom: 0.5rem;
  margin-left: 0;
  margin-right: 0;
}

#compose-headers .form-group.row > label.col-form-label,
#compose-headers .form-group.row > label.col-2 {
  -webkit-box-flex: 0 !important;
  -ms-flex: 0 0 16.666666% !important;
  flex: 0 0 16.666666% !important;
  width: 16.666666% !important;
  max-width: 16.666666% !important;
  vertical-align: top;
  padding-top: 0.5rem;
  white-space: nowrap;
  box-sizing: border-box;
}

/* Явная ширина col-10: на FF66 flex:1 1 0% сжимал строки Кому/Копия до содержимого */
#compose-headers .form-group.row > .col-10 {
  -webkit-box-flex: 0 !important;
  -ms-flex: 0 0 83.333333% !important;
  flex: 0 0 83.333333% !important;
  width: 83.333333% !important;
  max-width: 83.333333% !important;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
}

/*
 * FF66: виджет ul.recipient-input часто не поднимается → остаются сырые
 * textarea#_to/#_cc/#_bcc и input#_replyto БЕЗ .form-control.
 * Кнопки absolute справа; поле width:100% до края «От»/«Тема».
 */
#compose-headers .input-group {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

#compose-headers .input-group > textarea,
#compose-headers .input-group > input[type="text"],
#compose-headers .input-group > input:not([type]),
#compose-headers .input-group > select.form-control,
#compose-headers .input-group > .form-control,
#compose-headers .input-group > ul.recipient-input,
#compose-headers #_to,
#compose-headers #_cc,
#compose-headers #_bcc,
#compose-headers #_replyto {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  margin-bottom: 0 !important;
}

/* Скрытый оригинал после recipient_input() — не растягивать */
#compose-headers .input-group > textarea[style*="absolute"],
#compose-headers .input-group > input[style*="absolute"] {
  width: 10px !important;
  max-width: 10px !important;
}

#compose-headers .input-group > ul.recipient-input {
  display: -webkit-box !important;
  display: -ms-flexbox !important;
  display: flex !important;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  position: relative !important;
  overflow: visible !important;
  height: auto !important;
  padding: 0 0.75rem 4px 0.75rem;
  padding-right: 4.75rem !important;
}

#compose-headers .input-group > textarea,
#compose-headers .input-group > input[type="text"],
#compose-headers .input-group > input:not([type]),
#compose-headers #_to,
#compose-headers #_cc,
#compose-headers #_bcc,
#compose-headers #_replyto {
  display: block !important;
  padding-right: 4.75rem !important;
}

#compose-headers #compose_from .input-group > .form-control,
#compose-headers #compose_from .input-group > select.form-control {
  display: block !important;
  padding-right: 2.5rem !important;
}

#compose-headers .input-group > .input-group-append {
  position: absolute !important;
  top: 0;
  bottom: 0;
  z-index: 3;
  display: -webkit-box !important;
  display: -ms-flexbox !important;
  display: flex !important;
  margin: 0 !important;
}

#compose-headers .input-group > .input-group-append:last-child {
  right: 0;
}

#compose-headers .input-group > .input-group-append:nth-last-child(2) {
  right: 2.25rem;
}

#compose-headers .recipient-input li.input {
  -webkit-box-flex: 1 !important;
  -ms-flex: 1 1 100px !important;
  flex: 1 1 100px !important;
  min-width: 100px !important;
  max-width: 100% !important;
}

#compose-headers .recipient-input li.input input {
  width: 100% !important;
  box-sizing: border-box;
  padding-right: 0 !important;
}

#compose-headers #compose-subject,
#compose-headers .form-group.row > .col-10 > .form-control {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Followup-To — не используется в retail (специфичность выше .form-group.row flex) */
#compose-headers #compose_followupto.form-group.row {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
}

#headers-menu li:has(> a[data-target="followupto"]),
#headers-menu a[data-target="followupto"] {
  display: none !important;
}

/* --- Compose address autocomplete (#rcmKSearchpane) — FF66 like Chromium --- */
#rcmKSearchpane,
#rcmKSearchpane.select-menu,
#rcmKSearchpane.popover,
div#rcmKSearchpane.popupmenu {
  position: absolute !important;
  z-index: 100000 !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  border: 1px solid #ced4da !important;
  border-radius: 0.25rem !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
  padding: 0 !important;
  margin: 0 !important;
  height: auto !important;
  max-height: 280px !important;
  min-width: 260px !important;
  max-width: 480px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  opacity: 1 !important;
  -webkit-box-sizing: border-box !important;
  box-sizing: border-box !important;
}

#rcmKSearchpane > ul,
#rcmKSearchpane ul.listing,
#rcmKSearchpane ul.menu {
  display: block !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
}

#rcmKSearchpane > ul > li,
#rcmKSearchpane ul.listing > li {
  display: block !important;
  width: 100% !important;
  -webkit-box-sizing: border-box !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0.45rem 0.75rem !important;
  list-style: none !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #2c363a !important;
  border: 0 !important;
  border-bottom: 1px solid #f1f3f4 !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  white-space: normal !important;
  line-height: 1.35 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  /* override Elastic flex that breaks on FF66 */
  -webkit-box-orient: unset !important;
  -webkit-flex-flow: unset !important;
  flex-flow: unset !important;
  align-items: unset !important;
}

#rcmKSearchpane > ul > li:last-child,
#rcmKSearchpane ul.listing > li:last-child {
  border-bottom: 0 !important;
}

#rcmKSearchpane > ul > li:hover,
#rcmKSearchpane > ul > li.selected,
#rcmKSearchpane ul.listing > li:hover,
#rcmKSearchpane ul.listing > li.selected {
  background: #37beff !important;
  background-color: #37beff !important;
  color: #ffffff !important;
}

#rcmKSearchpane > ul > li:hover *,
#rcmKSearchpane > ul > li.selected *,
#rcmKSearchpane ul.listing > li:hover *,
#rcmKSearchpane ul.listing > li.selected * {
  color: #ffffff !important;
}

#rcmKSearchpane > ul > li > i.icon,
#rcmKSearchpane ul.listing > li > i.icon {
  display: inline-block !important;
  width: 1.2em !important;
  margin-right: 0.35rem !important;
  vertical-align: middle !important;
  float: none !important;
}

#rcmKSearchpane > ul > li > span.fields {
  display: inline !important;
  width: auto !important;
  overflow: visible !important;
  margin: 0 !important;
}

#rcmKSearchpane > ul > li > span.fields > span.field {
  display: inline !important;
  -webkit-box-flex: unset !important;
  flex: unset !important;
}

/* legacy jQuery UI autocomplete (if used elsewhere) */
.ui-autocomplete.ui-menu {
  z-index: 100000 !important;
  background: #ffffff !important;
  border: 1px solid #ced4da !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
  max-height: 240px;
  overflow-y: auto;
}

.ui-autocomplete .ui-menu-item-wrapper {
  display: block !important;
  white-space: normal !important;
}

.ui-autocomplete .ui-menu-item-wrapper.ui-state-active,
.ui-autocomplete .ui-menu-item-wrapper.ui-state-focus,
.ui-autocomplete .ui-menu-item-wrapper:hover {
  background: #37beff !important;
  color: #ffffff !important;
  border: 0 !important;
  margin: 0 !important;
}

/*
 * Message view: always show To/Cc (Elastic hides them behind the envelope toggle).
 * Compact From-only summary is hidden; envelope button is unused.
 */
#message-header .header-content .header-summary {
  display: none !important;
}
#message-header .header-content .header-headers {
  display: initial !important;
}
#message-header .header-links a.headers-summary,
#message-header .header-links a.headers-details {
  display: none !important;
}
