/* Constructor of the rules (#list/rules/rule/add), in the manner of the mail filters: "Если ..." / "Выполнить действие" / "Название" */
.rule-builder { margin: 6px 0 14px; max-width: 760px; }
.rb-section { margin-bottom: 16px; }
.rb-title { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.rb-hint { font-weight: 400; font-size: 12px; color: #888; }
.rb-logic { margin-bottom: 8px; }
.rb-logic select, .rb-row select { padding: 3px 6px; border: 1px solid #c9ced4; border-radius: 4px; font-size: 13px; background: #fff; }
.rb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 4px 0; }
.rb-row input[type=text] { flex: 1 1 220px; min-width: 120px; padding: 3px 6px; border: 1px solid #c9ced4; border-radius: 4px; font-size: 13px; }
.rb-row input.rb-narrow, .rb-ctl input.rb-narrow { flex: 0 1 150px; min-width: 100px; }
.rb-del { color: #999; text-decoration: none; font-size: 20px; line-height: 1; padding: 0 6px; }
.rb-del:hover { color: #d00; }
.rb-add { display: inline-block; margin-top: 4px; font-size: 13px; text-decoration: none; border-bottom: 1px dashed; }
.rb-act { margin: 5px 0; }
.rb-act > label { font-size: 13px; cursor: pointer; }
.rb-act input[type=checkbox] { margin-right: 6px; }
.rb-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0 0 22px; }
.rb-ctl input[type=text] { flex: 1 1 260px; padding: 3px 6px; border: 1px solid #c9ced4; border-radius: 4px; font-size: 13px; }
.rb-ctl textarea { flex: 1 1 100%; padding: 4px 6px; border: 1px solid #c9ced4; border-radius: 4px; font-size: 13px; resize: vertical; }
.rb-ctl input:disabled, .rb-ctl textarea:disabled { background: #f3f4f6; color: #aaa; }
.rb-sub { font-size: 12px; color: #555; white-space: nowrap; }
.rb-namebox .rb-name { width: 100%; padding: 4px 8px; border: 1px solid #c9ced4; border-radius: 4px; font-size: 13px; }
.rb-cancel { display: inline-block; margin: 8px 14px 0 0; font-size: 13px; }
.rb-section hr { margin: 10px 0; border: 0; border-top: 1px solid #e4e7eb; }
/* a wrong field of the constructor */
.rb-invalid { border-color: #d33 !important; background: #fff4f4 !important; box-shadow: 0 0 0 1px rgba(211,51,51,.25); }
.rb-bad > .rb-title { color: #c22; }
.rb-error { margin: 6px 0 0; font-size: 12px; padding: 6px 10px; }
.rb-act.rb-invalid { border-radius: 4px; padding: 2px 6px; }
/* the view of a rule: nothing can be changed until "Изменить" */
.rb-readonly .rb-add, .rb-readonly .rb-del { display: none; }
.rb-readonly .rb-row select, .rb-readonly .rb-logic select { background: transparent; border-color: transparent; -webkit-appearance: none; -moz-appearance: none; appearance: none; color: #222; opacity: 1; }
.rb-readonly .rb-row input[type=text], .rb-readonly .rb-name { background: transparent; border-color: transparent; }
.rb-extra .rb-act { margin: 5px 0; }
.rb-enabled { margin-top: 8px; }
/* the view of a rule: the conditions and the actions in force, as a plain list */
.rb-summary { margin-bottom: 8px; }
.rb-sum-block { margin-bottom: 12px; }
.rb-sum-block ul { margin: 0; padding-left: 20px; }
.rb-sum-block li { font-size: 14px; line-height: 1.6; }
.rb-sum-block li.rb-empty { color: #999; list-style: none; margin-left: -20px; }
.rb-sum-notes { font-size: 13px; color: #666; padding-top: 4px; border-top: 1px solid #e4e7eb; }
/* the view of a rule works without any script: the sentences are made by the server, the constructor is shown by "Изменить" */
.rule-builder[data-mode="view"] .rb-section { display: none; }
.rule-builder[data-mode="view"].rb-editing .rb-section { display: block; }
.rule-builder[data-mode="view"].rb-editing .rb-summary { display: none; }
/* adding a condition / an action in the view of a rule */
.rb-sum-add { display: inline-block; margin-top: 4px; font-size: 13px; text-decoration: none; border-bottom: 1px dashed; }
.rb-sum-form { margin: 8px 0 4px; padding: 8px 10px; border: 1px solid #d7dbe0; border-radius: 6px; background: #fafbfc; }
.rb-sum-form .rb-act-params { margin-left: 8px; }
.rb-sum-form .rb-act-params input[type=text] { width: 260px; padding: 3px 6px; border: 1px solid #c9ced4; border-radius: 4px; font-size: 13px; }
.rb-sum-form .rb-act-params input.rb-narrow { width: 140px; }
.rb-sum-form .rb-act-params textarea { width: 100%; margin-top: 6px; padding: 4px 6px; border: 1px solid #c9ced4; border-radius: 4px; }
.rb-sum-btns { margin-top: 8px; }
.rb-sum-btns button { padding: 3px 12px; font-size: 13px; }
.rb-sum-btns .rb-sum-cancel { margin-left: 10px; font-size: 13px; }
.rb-sum-err { margin-top: 6px; color: #c22; font-size: 12px; }
.rb-sum-form .rb-row { padding: 0; }
.rb-sum-form select { padding: 3px 6px; border: 1px solid #c9ced4; border-radius: 4px; font-size: 13px; background: #fff; }
/* "+" at the right of the header of a block of the view: the list of what can be added */
.rb-sum-block { position: relative; }
.rb-sum-block .rb-title { display: flex; justify-content: space-between; align-items: center; }
.rb-plus { width: 26px; height: 26px; line-height: 22px; padding: 0; font-size: 20px; border: 1px solid #c9ced4; border-radius: 50%; background: #fff; color: #2457c5; cursor: pointer; }
.rb-plus:hover { background: #eef3ff; border-color: #2457c5; }
.rb-sum-block .rb-menu { position: absolute; right: 0; top: 30px; z-index: 30; min-width: 260px; background: #fff; border: 1px solid #c9ced4; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.15); padding: 4px 0; }
.rb-sum-block .rb-menu a { display: block; padding: 5px 14px; font-size: 13px; color: #222; text-decoration: none; }
.rb-sum-block .rb-menu a:hover { background: #eef3ff; }
.rb-sum-block .rb-menu .rb-empty { display: block; padding: 6px 14px; font-size: 12px; color: #888; }
/* the "+ Добавить" select at the right of the header of a block of the view */
.rb-pick { padding: 2px 8px; font-size: 13px; font-weight: 400; color: #2457c5; border: 1px solid #c9ced4; border-radius: 14px; background: #fff; cursor: pointer; max-width: 190px; }
.rb-pick:hover { background: #eef3ff; border-color: #2457c5; }
.rb-fatal { margin: 0 0 8px; padding: 6px 10px; border: 1px solid #d33; border-radius: 4px; background: #fff4f4; color: #b00; font-size: 12px; }
.rb-ver { margin-top: 10px; font-size: 10px; color: #aaa; text-align: right; }
/* "+ Добавить дополнительный критерий" under the sentences of the view */
.rb-addbtn { display: inline-block; margin: 6px 0 2px; padding: 4px 12px; font-size: 13px; color: #2457c5; background: #fff; border: 1px solid #2457c5; border-radius: 4px; cursor: pointer; }
.rb-addbtn:hover { background: #eef3ff; }
/* "+" without a text, at the right end of the last line of the conditions / of the actions */
.rb-listrow { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.rb-listrow ul { flex: 1 1 auto; margin: 0; }
.rb-addbtn { flex: 0 0 auto; width: 26px; height: 26px; line-height: 22px; margin: 0; padding: 0; font-size: 20px; text-align: center; border-radius: 50%; }
/* the menu of the "+" opens under the last line, at the right */
.rb-listrow { position: relative; }
.rb-listrow .rb-menu { position: absolute; right: 0; top: 100%; margin-top: 4px; z-index: 30; min-width: 260px; background: #fff; border: 1px solid #c9ced4; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.15); padding: 4px 0; }
.rb-listrow .rb-menu a { display: block; padding: 5px 14px; font-size: 13px; color: #222; text-decoration: none; }
.rb-listrow .rb-menu a:hover { background: #eef3ff; }
.rb-listrow .rb-menu .rb-empty { display: block; padding: 6px 14px; font-size: 12px; color: #888; }
