/*
 * Form footer vs Messenger button.
 * .chat-fab stays where it is (56px, default right: 20px) and covers the
 * bottom-right of .btn-bottom-toolbar. Extra right padding is static so
 * Save and Cancel stay clickable without following open/close or drag.
 * 110px clears the button, its offset, and a small gap (~29mm).
 */
html:not([dir="rtl"]) .btn-bottom-toolbar {
  padding-right: 110px;
}

/* Open message panel covers the right side. Center the footer actions
   in the space beside it. Minimized panel keeps the right-side layout. */
body:has(.main-chat-panel:not(.minimized)) .btn-bottom-toolbar {
  padding-right: 340px;
  text-align: center !important;
  justify-content: center !important;
}

body:has(.main-chat-panel:not(.minimized)) .btn-bottom-toolbar .pull-right,
body:has(.main-chat-panel:not(.minimized)) .btn-bottom-toolbar .pull-left {
  float: none !important;
}

body:has(.main-chat-panel:not(.minimized)) .btn-bottom-toolbar .btn-toolbar-notice {
  position: absolute;
  left: 20px;
  float: none !important;
  max-width: 34%;
}

/* Save / submit */
html body .btn-bottom-toolbar .btn-primary:not(.dropdown-toggle),
html body .btn-bottom-toolbar .btn-info:not(.dropdown-toggle),
html body .btn-bottom-toolbar .btn-success:not(.dropdown-toggle),
html body .btn-bottom-toolbar button.transaction-submit,
html body .btn-bottom-toolbar button.save-as-draft,
html body .btn-bottom-toolbar button.save-and-send,
html body .btn-bottom-toolbar .btn-primary:hover:not(.dropdown-toggle),
html body .btn-bottom-toolbar .btn-info:hover:not(.dropdown-toggle),
html body .btn-bottom-toolbar .btn-success:hover:not(.dropdown-toggle),
html body .btn-bottom-toolbar button.transaction-submit:hover,
html body .btn-bottom-toolbar button.save-as-draft:hover,
html body .btn-bottom-toolbar button.save-and-send:hover,
html body .btn-bottom-toolbar .btn-primary:focus:not(.dropdown-toggle),
html body .btn-bottom-toolbar .btn-info:focus:not(.dropdown-toggle),
html body .btn-bottom-toolbar .btn-success:focus:not(.dropdown-toggle),
html body .btn-bottom-toolbar button.transaction-submit:focus,
html body .btn-bottom-toolbar button.save-as-draft:focus,
html body .btn-bottom-toolbar button.save-and-send:focus,
html body .btn-bottom-toolbar .btn-primary:active:not(.dropdown-toggle),
html body .btn-bottom-toolbar .btn-info:active:not(.dropdown-toggle),
html body .btn-bottom-toolbar .btn-success:active:not(.dropdown-toggle),
html body .btn-bottom-toolbar button.transaction-submit:active,
html body .btn-bottom-toolbar button.save-as-draft:active,
html body .btn-bottom-toolbar button.save-and-send:active,
html body .btn-bottom-toolbar .btn-primary.active:not(.dropdown-toggle),
html body .btn-bottom-toolbar .btn-info.active:not(.dropdown-toggle),
html body .btn-bottom-toolbar .btn-success.active:not(.dropdown-toggle) {
  background-color: #86efac;
  background-image: none;
  border-color: #4ade80;
  color: #14532d;
}

html body .btn-bottom-toolbar .btn-primary:hover:not(.dropdown-toggle),
html body .btn-bottom-toolbar .btn-info:hover:not(.dropdown-toggle),
html body .btn-bottom-toolbar .btn-success:hover:not(.dropdown-toggle),
html body .btn-bottom-toolbar button.transaction-submit:hover,
html body .btn-bottom-toolbar button.save-as-draft:hover,
html body .btn-bottom-toolbar button.save-and-send:hover,
html body .btn-bottom-toolbar .btn-primary:focus:not(.dropdown-toggle),
html body .btn-bottom-toolbar .btn-info:focus:not(.dropdown-toggle),
html body .btn-bottom-toolbar .btn-success:focus:not(.dropdown-toggle),
html body .btn-bottom-toolbar button.transaction-submit:focus,
html body .btn-bottom-toolbar button.save-as-draft:focus,
html body .btn-bottom-toolbar button.save-and-send:focus,
html body .btn-bottom-toolbar .btn-primary:active:not(.dropdown-toggle),
html body .btn-bottom-toolbar .btn-info:active:not(.dropdown-toggle),
html body .btn-bottom-toolbar .btn-success:active:not(.dropdown-toggle) {
  background-color: #4ade80;
  border-color: #22c55e;
  color: #14532d;
}

/* Cancel / close / back. Save actions above keep the green fill. */
html body .btn-bottom-toolbar a.btn-default,
html body .btn-bottom-toolbar button.btn-default:not(.transaction-submit):not(.save-as-draft):not(.save-and-send),
html body .btn-bottom-toolbar a.btn-default:hover,
html body .btn-bottom-toolbar button.btn-default:not(.transaction-submit):not(.save-as-draft):not(.save-and-send):hover,
html body .btn-bottom-toolbar a.btn-default:focus,
html body .btn-bottom-toolbar button.btn-default:not(.transaction-submit):not(.save-as-draft):not(.save-and-send):focus,
html body .btn-bottom-toolbar a.btn-default:active,
html body .btn-bottom-toolbar button.btn-default:not(.transaction-submit):not(.save-as-draft):not(.save-and-send):active {
  background-color: #fecaca;
  background-image: none;
  border-color: #fca5a5;
  color: #7f1d1d;
}

html body .btn-bottom-toolbar a.btn-default:hover,
html body .btn-bottom-toolbar button.btn-default:not(.transaction-submit):not(.save-as-draft):not(.save-and-send):hover,
html body .btn-bottom-toolbar a.btn-default:focus,
html body .btn-bottom-toolbar button.btn-default:not(.transaction-submit):not(.save-as-draft):not(.save-and-send):focus,
html body .btn-bottom-toolbar a.btn-default:active,
html body .btn-bottom-toolbar button.btn-default:not(.transaction-submit):not(.save-as-draft):not(.save-and-send):active {
  background-color: #fca5a5;
  border-color: #f87171;
  color: #7f1d1d;
}
