.s-formula-option {
  display: grid;
  grid-template-columns: 1fr 30px;
  grid-template-rows: 1fr 20px;
  row-gap: 4px;
}

form.aui .s-formula-display {
  position: relative;
}

.s-formula-var-name,
.s-formula-vars-list,
form.aui .s-formula-display .s-mono-edit,
#st-edit-column form.aui .s-formula-display .s-mono-edit {
  font-family: "Lucida Sans Typewriter", "Consolas", "Lucida Console", "Courier New", monospace;
  font-size: 12px;
}

/*
Formula is also used in Settings->Structure and in Effector settings popup
where there is no #structure context
*/
form.aui .s-formula-display .s-mono-edit,
/*
Jira has this complex context for :focus
 */
body:not(.aui-legacy-focus) form.aui:not(.aui-legacy-forms) .s-formula-display .s-mono-edit:focus,
/*
Without #st-edit-column context textarea style is overridden by '#st-edit-column textarea'
*/
#st-edit-column form.aui .s-formula-display .s-mono-edit {
  line-height: 15px;
  white-space: pre;
  word-wrap: normal;
  box-sizing: border-box;
  height: 110px;
  min-height: 110px;
  width: 100%;
  max-width: none;
  padding: 5px;
  overflow: auto;
  resize: none;
  border: 1px solid #cccccc;
  /* this comes from the AUI */
  border-radius: 3.01px;
  box-shadow: none;
}

form.aui .s-formula-display textarea.s-mono-edit.s-formula-edit-off,
form.aui .s-formula-display textarea.s-mono-edit.s-formula-edit-off:focus {
  /* making it invisible in view mode - disable for debug */
  color: #fff;
  opacity: 0;
}

form.aui .s-formula-display .s-mono-edit.s-formula-view {
  position: absolute;
  top: 0;
  left: 0;
}

.s-formula-edit-off.s-when-formula-edit-on,
.s-formula-edit-on.s-when-formula-edit-off,
.s-formula-var-edit-off.s-when-formula-var-edit-on,
.s-formula-var-edit-on.s-when-formula-var-edit-off {
  display: none;
}

.s-formula-var-edit-off.s-when-formula-var-edit-on.s-formula-var-ae {
  /* override inline style from AttributeEditor */
  display: none !important;
}

.s-formula-controls {
  display: flex;
  align-items: center;
  column-gap: 12px;
  font-size: 12px;
}

.s-formula-controls .s-right-controls {
  margin-left: auto;
}

.s-formula-controls .s-controls-block {
  display: flex;
}

.s-formula-controls .s-controls-block > * + * {
  margin-left: 12px;
}

.s-formula-controls .s-controls-link {
  display: flex;
  align-items: center;
  column-gap: 2px;
}

.s-formula-controls,
.s-formula-controls > div,
.s-formula-controls .s-controls-link {
  /* required for truncating text inside flex items */
  min-width: 0;
}

.s-formula-controls .s-controls-link > i {
  font-size: 14px;
  color: #344563;
  flex-shrink: 0;
}

.s-formula-controls .s-controls-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.s-formula-controls .s-formula-saved-column-icon {
  width: 16px;
  height: 16px;
  background: url("/s/-2rizk2/940000/z9u883/8.2.0/_/download/resources/com.almworks.jira.structure:widget-css/img/formula_preset.svg");
}

.s-formula-sidebar {
  display: flex;
  flex-direction: column;
  margin-left: 8px;
}

.s-formula-sidebar .s-validation-status {
  margin-top: auto;
}

.s-formula-saved-columns {
  height: 0;
}

.s-formula-saved-column {
  visibility: hidden;
  height: 0 !important;
}

form.aui .s-formula-vars-section > .field-group > label {
  padding-top: 4px;
}

#s-automation-edit .s-formula-vars-section {
  margin-left: -145px;
}

#s-automation-edit > div > form.aui .s-formula-vars-section > .field-group {
  padding: 0 10px 0 145px;
}

#st-edit-column .s-formula-vars-section {
  margin-left: -100px;
}

#s-automation-edit .s-formula-vars-section,
#st-edit-column .s-formula-vars-section {
  margin-right: -10px;
  clear: both;
}

.s-formula-vars-comment {
  color: #6b778c;
  font-size: 12px;
  line-height: 14px;
  display: inline-block;
}

.s-formula-vars-back {
  margin: 7px 0;
}

.s-formula-vars-list {
  position: relative;
  margin-top: 4px;
  max-width: 310px;
  overflow: hidden;
}

.s-var-entry {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.s-formula-var-name,
.s-formula-vars-list {
  line-height: 19px;
}

.s-formula-var-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.s-formula-vars-list i.s-defined {
  font-size: 14px;
  width: 14px;
  color: #36B37E;
}

.s-formula-vars-list i.s-undefined {
  font-size: 14px;
  width: 14px;
  color: #FF5630;
}

.s-formula-vars-list-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.s-formula-vars-list-unmodifiable {
  opacity: 0.5;
}

.s-formula-vars-list > div > div:last-child {
  margin-bottom: 5px;
}

.s-formula-vars-list > div > div > i {
  margin-right: 10px;
}

.s-formula-display .s-formula-view a.s-formula-var.s-formula-var-undefined {
  color: #e83250;
}

.s-formula-display .s-formula-view span.s-formula-aggr.s-formula-unresolved,
.s-formula-display .s-formula-view span.s-formula-fun.s-formula-unresolved {
  color: #e83250;
}

.s-formula-display .s-formula-view span.s-formula-comment {
  color: #a0a0a0;
}

.s-formula-display .s-formula-view:hover .s-formula-var.s-formula-var-defined,
.s-formula-display .s-formula-var.s-formula-var-defined.s-var-edited {
  background-color: #cbf1ba;
  color: #333333;
}

.s-formula-display .s-formula-view:hover .s-formula-var.s-formula-local-var-usage,
.s-formula-display .s-formula-var.s-formula-local-var-usage.s-var-edited,
.s-formula-display .s-formula-view:hover .s-formula-var.s-formula-local-var-definition,
.s-formula-display .s-formula-var.s-formula-local-var-definition.s-var-edited {
  background-color: #bae1f2;
  color: #333333;
}

.s-formula-display .s-formula-view:hover .s-formula-var.s-formula-var-undefined,
.s-formula-display .s-formula-var.s-formula-var-undefined.s-var-edited,
.s-formula-display .s-formula-view:hover .s-formula-var.s-formula-failed-validation,
.s-formula-display .s-formula-var.s-var-edited.s-formula-failed-validation {
  background-color: #f3bbc4;
  color: #333333;
}

.s-var-find-declaration {
  -webkit-animation: find-declaration 0.5s;
  -moz-animation: find-declaration 0.5s;
  -ms-animation: find-declaration 0.5s;
  -o-animation: find-declaration 0.5s;
  animation: find-declaration 0.5s;
}

@-webkit-keyframes find-declaration {
  50% {
    background-color: #ffffff;
  }
}

@-moz-keyframes find-declaration {
  50% {
    background-color: #ffffff;
  }
}

@-ms-keyframes find-declaration {
  50% {
    background-color: #ffffff;
  }
}

@-o-keyframes find-declaration {
  50% {
    background-color: #ffffff;
  }
}

@keyframes find-declaration {
  50% {
    background-color: #ffffff;
  }
}

.s-formula-var:hover, .s-formula-var:active, .s-formula-var.s-var-edited, .s-formula-var.s-var-selected {
  font-weight: bold;
}

.s-formula-display a.s-formula-var, .s-formula-display a.s-formula-var:visited,
.s-formula-display a.s-formula-var:active, .s-formula-display a.s-formula-var:hover {
  color: #333333;
}

.s-formula-error {
  background-color: #f3bbc4;
}

.s-additional-options {
  margin-left: calc(-1 * var(--s-edit-column-label-outer-width));
}

.s-additional-options .description {
  max-width: 320px;
}

.s-text-beside-input {
  line-height: 26px;
  display: inline-block;
}

.s-formula-cell-error {
  font-size: 11px;
  line-height: 18px;
}

.st-col-edit .st-col-scroll > div > form.aui .s-formula-vars-section > .field-group {
  padding: 0 10px 0 100px;
}

#st-edit-column .ui-resizable-sw,
#st-edit-column .ui-icon-gripsmall-diagonal-se {
  background-image: url(/s/-2rizk2/940000/z9u883/8.2.0/_/download/resources/com.almworks.jira.structure:widget-css/img/ui-icons_222222_256x240.png);
  background-position: -80px -224px;
  width: 16px;
  height: 16px;
}

#st-edit-column .ui-resizable-sw {
  transform: scaleX(-1);
  left: 1px;
  bottom: 1px;
}

#st-edit-column.s-wide .s-formula-display {
  min-width: 310px;
}

#st-edit-column form.aui.s-col-opts-form .s-formula-display.ui-resizable {
  min-height: 110px;
  height: 110px;
}

#st-edit-column form.aui.s-col-opts-form .ui-resizable .s-formula-view {
  height: 100%;
}

#st-edit-column form.aui.s-col-opts-form .s-formula-display.ui-resizable textarea {
  height: 100%;
}

#st-edit-column.st-col-resizable .s-formula-view::-webkit-scrollbar,
#st-edit-column.st-col-resizable .s-formula-display textarea::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

#st-edit-column.st-col-resizable .s-formula-view::-webkit-scrollbar-track,
#st-edit-column.st-col-resizable .s-formula-display textarea::-webkit-scrollbar-track
{
  background-color: #fafafa;
}

#st-edit-column.st-col-resizable .st-pos-left .s-formula-view::-webkit-scrollbar-track,
#st-edit-column.st-col-resizable .st-pos-left.s-formula-display textarea::-webkit-scrollbar-track {
  margin: 1px 1px 1px 16px;
}

#st-edit-column.st-col-resizable .st-pos-right .s-formula-view::-webkit-scrollbar-track,
#st-edit-column.st-col-resizable .st-pos-right.s-formula-display textarea::-webkit-scrollbar-track {
  margin: 1px 18px 18px 1px;
}

#st-edit-column.st-col-resizable .st-pos-left .s-formula-view::-webkit-scrollbar-corner,
#st-edit-column.st-col-resizable .st-pos-left.s-formula-display textarea::-webkit-scrollbar-corner {
  background-color: #fafafa;
}

#st-edit-column.st-col-resizable .st-pos-right .s-formula-view::-webkit-scrollbar-corner,
#st-edit-column.st-col-resizable .st-pos-right.s-formula-display textarea::-webkit-scrollbar-corner {
  background-color: #fff;
}

#st-edit-column.st-col-resizable .st-pos-right .s-formula-view::-webkit-scrollbar-track:corner-present,
#st-edit-column.st-col-resizable .st-pos-right.s-formula-display textarea::-webkit-scrollbar-track:corner-present {
  margin-bottom: 5px;
  margin-right: 5px;
}

#st-edit-column.st-col-resizable .s-formula-view::-webkit-scrollbar-thumb,
#st-edit-column.st-col-resizable .s-formula-display textarea::-webkit-scrollbar-thumb
{
  border-radius: 5px;
  background-color: #c1c1c1;
}

#st-edit-column.st-col-resizable .s-formula-view::-webkit-scrollbar-thumb:hover,
#st-edit-column.st-col-resizable .s-formula-display textarea::-webkit-scrollbar-thumb:hover {
  background-color: #7d7d7d;
}

#st-edit-column.st-col-resizable .s-formula-view::-webkit-scrollbar-thumb:window-inactive,
#st-edit-column.st-col-resizable .s-formula-display textarea::-webkit-scrollbar-thumb:window-inactive {
  background-color: #c1c1c1;
}
