/* Copyright (c) 2026 Oleksii Mykhalevych */

/* Script popups: the picker, the parameters popup and the results popup that ScriptRunnerService opens with
   BsModalService. ngx-bootstrap puts the configured `class` on the .modal-dialog: every script dialog carries
   scripts-dialog plus scripts-picker-dialog, scripts-parameters-dialog or scripts-results-dialog. The content renders
   at <body> level, out of reach of component styles, hence this global stylesheet (as css/audit/projectAudit.css is for
   the Project Audit modal). */

/* ---- Dialog ---- */

.modal-dialog.scripts-picker-dialog {
    width: 520px;
}

/* The results and the run history are wide: What changed's rows keep to one line, and a run's state shares its line
   with why it failed, Open and Cancel at the row's right. */
.modal-dialog.scripts-results-dialog,
.modal-dialog.scripts-runs-dialog {
    width: 960px;
}

/* A window narrower than the dialog: it keeps 10px from each edge. */
.modal-dialog.scripts-dialog {
    max-width: calc(100vw - 20px);
}

/* The run form is 720px wide, and grows with what it holds, a wide table of records or a control's own minimum, up to
   80% of the window; only a table wider than that scrolls sideways. A long title, message, description, helper text or
   output never widens it: they keep no width of their own (width: 0) and wrap or cut at the dialog's. It grows in
   height too, up to 90% of the window (.scripts-form), so it sits in the window's middle (top: 0, which outweighs the
   bottom: 5% that lifts the app's dialogs, css/shared/services/modalTemplate.css): lifted, a form that tall would touch
   the window's top. */
.modal-dialog.scripts-dialog.scripts-parameters-dialog {
    top: 0;
    width: fit-content;
    min-width: min(720px, calc(100vw - 20px));
    max-width: min(80vw, calc(100vw - 20px));
}

/* Bootstrap's `.modal.in .modal-dialog { transform: translate(0, 0) }` makes the dialog the containing block of its
   position:fixed descendants, which shifts the list of custom-dropdown (placed in viewport coordinates). Without the
   transform it opens right under its input, as in the Project Audit modal. */
.modal-dialog.scripts-dialog,
.modal.in .modal-dialog.scripts-dialog {
    transform: none !important;
}

.scripts-dialog > .modal-content {
    border: none;
    border-radius: 4px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px 0 rgba(0, 41, 199, 0.2);
}

.scripts-popup {
    font-family: GlowRegular;
    font-size: 14px;
    color: #4a4a4a;
}

.scripts-header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 10px 20px;
    border-bottom: 1px solid #ecedf2;
}

/* A title wraps, at a word or inside a long one, onto two lines at most: never cut on one line, an ellipsis only at the
   end of the second. Its hover hint holds it whole. */
.scripts-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-width: 100%;
    overflow: hidden;
    font-family: GlowBold;
    font-size: 18px;
    line-height: 24px;
    color: #222222;
    text-overflow: ellipsis;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* The other popups' title, beside the close button: a title of one line is in the middle of the header's 56px (10px
   padding, then 6px above its 24px line and 5px below it), and a second line grows the header downwards. */
.scripts-header > .scripts-title {
    align-self: flex-start;
    margin: 6px 0 5px;
}

/* The run form's header: the scripts icon on a light tile, the title with a step's name under it, and the close
   button. The other popups' headers are the title and the close button, at the header's right. */
.scripts-header-icon {
    display: flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    height: 40px;
    border-radius: 8px;
    background-color: #eef1fe;
}

.scripts-heading {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 0;
    min-width: 0;
}

.scripts-step-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 2px 10px;
    border-radius: 12px;
    background-color: #eef1fe;
    font-family: GlowSemibold;
    font-size: 12px;
    line-height: 18px;
    color: #5774e7;
}

.scripts-step-name img {
    flex: 0 0 auto;
}

.scripts-step-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scripts-close {
    display: flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    height: 32px;
    margin-left: auto;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: none;
    cursor: pointer;
}

/* Beside a title, the close button is centred on its first line. */
.scripts-title + .scripts-close {
    align-self: flex-start;
    margin-top: 2px;
}

/* close_16.svg is drawn light (#b6b6b6): the × is darkened to about the muted text's colour (#808080), and to about the
   text's (#4a4a4a) on hover. */
.scripts-close img {
    filter: brightness(0.7);
}

.scripts-close:hover {
    background-color: #f4f5fc;
}

.scripts-close:not(:disabled):hover img {
    filter: brightness(0.4);
}

/* While an Apply runs, the results' close button waits, as Close does. */
.scripts-close:disabled {
    cursor: default;
    opacity: 0.4;
}

.scripts-close:disabled:hover {
    background: none;
}

.scripts-close:focus-visible {
    outline: 2px solid #5774e7;
    outline-offset: 1px;
}

/* The body scrolls between the fixed header and footer, also in a low window. */
.scripts-body {
    max-height: min(470px, calc(100vh - 220px));
    overflow-y: auto;
    padding: 16px 20px;
}

/* A run on many projects: the results use the window's height. */
.scripts-results-dialog .scripts-body {
    max-height: calc(100vh - 220px);
}

/* The run form is at most 90% of the window high. Its title and its buttons keep their height; the body between them
   (the descriptions, a step's problems and the outputs of the step before, then the parameters' rows) grows with what
   it holds, and only past that height does it scroll: the form's one scroll area. */
.scripts-form {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.scripts-form > .scripts-header,
.scripts-form > .scripts-footer {
    flex: 0 0 auto;
}

.scripts-form .scripts-body {
    flex: 0 1 auto;
    min-height: 0;
    max-height: none;
    padding-top: 6px;
    padding-bottom: 10px;
}

.scripts-form .scripts-body > .scripts-message {
    margin-top: 10px;
    margin-bottom: 6px;
}

.scripts-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid #ecedf2;
}

/* The picker's footer says what it loads, or why the pick failed, in the room left of the button. */
.scripts-footer-message {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-right: 4px;
}

.scripts-footer-message .ui-loader-dark {
    flex: 0 0 20px;
    margin-top: 0;
}

.scripts-footer-text {
    overflow: hidden;
    color: #808080;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Secondary (ui-btn-grey, ui-btn-light) and primary (ui-btn-dark) buttons of one size. */
.scripts-footer .ui-btn-grey,
.scripts-footer .ui-btn-light,
.scripts-footer .ui-btn-dark {
    min-width: 104px;
    height: 38px;
    padding: 0 20px;
}

.scripts-footer button:focus-visible {
    outline: 2px solid #5774e7;
    outline-offset: 2px;
}

/* ---- States and texts ---- */

.scripts-state {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: #808080;
}

.scripts-state .ui-loader-dark {
    flex: 0 0 20px;
    margin-top: 0;
}

.scripts-error {
    color: #ec4a43;
    overflow-wrap: anywhere;
}

.scripts-message {
    margin-bottom: 12px;
}

.scripts-muted {
    color: #808080;
}

/* ---- Picker ---- */

.scripts-section-title {
    margin: 4px 0 6px;
    font-family: GlowSemibold;
    font-size: 12px;
    color: #808080;
}

.scripts-show-all + .scripts-section-title {
    margin-top: 16px;
}

.scripts-picker-list {
    margin: 0 -10px;
}

/* While the runner fetches the picked script, the lists wait dimmed and take no click. */
.scripts-picker--busy .scripts-picker-list {
    opacity: 0.6;
    pointer-events: none;
}

/* A row takes no click itself: its name picks the script and its star toggles the favorite. */
.scripts-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 36px;
    padding: 0 10px 0 0;
}

/* The focusable part of a row, which picks the script: its name and tag, from the row's left edge. The star beside it
   is a button of its own. Only this part reacts to the pointer, as only a click on it picks. */
.scripts-picker-pick {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    height: 100%;
    padding-left: 10px;
    border-radius: 4px;
    cursor: pointer;
}

.scripts-picker-pick:hover {
    background-color: #fafafa;
}

.scripts-picker-pick:hover .scripts-picker-name {
    color: #5774e7;
}

.scripts-picker-pick:focus-visible,
.scripts-star:focus-visible,
.scripts-show-all:focus-visible {
    outline: 2px solid #5774e7;
    outline-offset: 1px;
}

.scripts-picker-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scripts-tag {
    flex: 0 0 auto;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 16px;
}

.scripts-tag--public {
    background-color: #eef1fe;
    color: #5774e7;
}

.scripts-tag--private {
    background-color: #f1f1f1;
    color: #808080;
}

/* The star: a 32px target around its 16px image. The negative margins keep the row's layout as for the image alone,
   and the focus ring stays around the image. */
.scripts-star {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0 -8px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.scripts-star:focus-visible {
    outline-offset: -7px;
}

.scripts-star:disabled {
    cursor: default;
}

.scripts-star--saving {
    opacity: 0.4;
}

.scripts-show-all {
    display: inline-block;
    margin-top: 8px;
    padding: 0;
    border: none;
    background: none;
    line-height: 20px;
}

.scripts-search {
    width: 100%;
    margin-bottom: 8px;
    padding: 0 10px;
}

/* ---- Parameters ---- */

/* The problems of a step's last Next and the outputs of the step before wrap at the dialog's width (see the dialog). */
.scripts-step-problem,
.scripts-step-outputs {
    width: 0;
    min-width: 100%;
}

.scripts-step-outputs {
    padding: 6px 12px;
    border: 1px solid #ecedf2;
    border-radius: 4px;
}

.scripts-parameter {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 10px 0;
    border-bottom: 1px solid #ecedf2;
}

.scripts-parameter:last-child {
    border-bottom: none;
}

/* A list's label stays beside its first element as the rows grow. */
.scripts-parameter-list {
    align-items: flex-start;
}

/* An input with helper text: its name lines up with its control's text, however many lines the help takes (centred on
   the control and its help together, the name sank by half of every line of help past the first). A field, a
   dropdown, a picker, a checkbox and a date picker alike: the name's baseline is the control's. An input without help
   keeps its name centred on its control; a list's and a record's rows keep their own alignment, and a narrow window its
   name above the editor (below). */
@media not all and (max-width: 600px) {
    .scripts-parameter:not(.scripts-parameter-list):not(.scripts-parameter-record):has(> .scripts-described) {
        align-items: baseline;
    }
}

.scripts-parameter-label {
    flex: 0 0 180px;
    min-width: 0;
    padding-right: 16px;
}

/* A parameter's or a record field's name alone: its type is its hover hint, and a screen reader's. */
.scripts-parameter-name {
    overflow: hidden;
    font-family: GlowSemibold;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scripts-parameter-editor {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.scripts-number,
.scripts-text,
.scripts-time {
    padding: 0 10px;
}

.scripts-number {
    width: 140px;
}

/* A number and its unit ("hours", "days") on one line; in a table's cell the number alone. */
.scripts-number-field {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.scripts-text {
    width: 100%;
}

.scripts-time {
    width: 124px;
}

/* The date field's text is its line's baseline, as a field's is (custom-datepicker sets vertical-align: top), so that a
   row with helper text lines its name up with it (see the parameters above); the field stays 32px high (below). */
.scripts-date .customDatepicker__container .datepicker {
    width: 130px;
    margin-left: 0;
    vertical-align: baseline;
}

/* Every single-line control of the run form is 32px high, in a row and in a table's cell, its text in the middle: the
   number, text and time fields and the date field, as the dropdowns, the pickers, Add, Choose file…, Set and None are
   (Remove is 32px square). */
.scripts-form .scripts-number,
.scripts-form .scripts-text,
.scripts-form .scripts-time,
.scripts-form .scripts-date .customDatepicker__container .datepicker {
    height: 32px;
}

/* A user, a group or a team, an element, a phase or an assignment of the project, or a list of them; and the
   dropdowns of an attribute picker. A parameter's or a record field's takes the rest of its line. */
.scripts-entity {
    width: 260px;
    max-width: 100%;
}

.scripts-parameter-editor > .scripts-entity,
.scripts-record-editor > .scripts-entity {
    flex: 1 1 auto;
    min-width: 0;
}

/* Why a row or a record's field has no editor wraps at the dialog's width (see the dialog). */
.scripts-parameter-editor > .scripts-unsupported,
.scripts-record-editor > .scripts-unsupported {
    flex: 1 1 0;
    width: 0;
}

/* A list or a collection of a scalar: one row per element with its Remove, and Add below them. */
.scripts-list {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
}

.scripts-list-item {
    display: flex;
    align-self: stretch;
    align-items: center;
    gap: 8px;
}

.scripts-list-item .scripts-text {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

/* A file of a File input: its name, cut to fit, then its size and Remove. */
.scripts-file-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Why a file was refused, or must be chosen again, wraps at the dialog's width (see the dialog). */
.scripts-list > .scripts-error {
    width: 0;
    min-width: 100%;
}

/* The browser's own file input stays out of sight behind Choose file…: Bootstrap's input[type=file] rule
   (display: block) outweighs its hidden attribute. */
.scripts-form input[type='file'] {
    display: none;
}

/* Add: the app's light button with its blue plus. */
.scripts-list-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 14px;
}

/* Remove: an icon button with the app's trash, bordered and as high as the fields beside it. */
.scripts-list-remove {
    display: inline-flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    background-color: #ffffff;
    cursor: pointer;
}

.scripts-list-remove:hover {
    border-color: #5774e7;
    background-color: #f4f5fc;
}

.scripts-list-add:focus-visible,
.scripts-list-remove:focus-visible {
    outline: 2px solid #5774e7;
    outline-offset: 2px;
}

/* An attribute picker: the scope switch, then the attribute and its value. */
.scripts-attribute {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* The pickers of a list of attributes: a light line between one picker and the next. */
.scripts-attribute-item + .scripts-attribute-item {
    padding-top: 8px;
    border-top: 1px solid #ecedf2;
}

.scripts-attribute-scopes {
    display: flex;
    gap: 4px;
}

.scripts-attribute-scope {
    height: 24px;
    padding: 0 10px;
    border: 1px solid #d6d9e5;
    border-radius: 12px;
    background-color: #ffffff;
    font-size: 12px;
    color: #4a4a4a;
    cursor: pointer;
}

.scripts-attribute-scope--active {
    border-color: #5774e7;
    background-color: #eef1fd;
    color: #5774e7;
}

.scripts-attribute-scope:focus-visible {
    outline: 2px solid #5774e7;
    outline-offset: 2px;
}

.scripts-unit {
    color: #808080;
}

.scripts-unsupported {
    font-size: 13px;
    color: #808080;
}

/* A record parameter: its name above it, then the group of its fields or the table of its records. */
.scripts-parameter-record {
    flex-direction: column;
    align-items: stretch;
}

.scripts-parameter-record > .scripts-parameter-label {
    flex: 0 0 auto;
    padding: 0 0 8px;
}

.scripts-parameter-record > .scripts-parameter-editor {
    display: block;
}

/* A record's group: one line per field, its name before its editor, in a light frame. */
.scripts-record {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid #ecedf2;
    border-radius: 4px;
}

.scripts-record-none {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scripts-record-field {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.scripts-record-label {
    flex: 0 0 120px;
    min-width: 0;
}

.scripts-record-editor {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* Set, and None for a nested record or a record's date. */
.scripts-record-switch {
    height: 32px;
    padding: 0 12px;
}

.scripts-record-switch:focus-visible {
    outline: 2px solid #5774e7;
    outline-offset: 2px;
}

/* A list of records: the table, as wide as the dialog, which grows to fit it; only a table wider than 80% of the window
   scrolls sideways. Add below it. */
.scripts-records {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.scripts-record-table {
    align-self: stretch;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid #ecedf2;
    border-radius: 4px;
}

.scripts-record-table table {
    width: 100%;
    border-collapse: collapse;
}

/* A little room in each cell, around its editor and its Remove. css/resourceManagement/usersInGroups.css, which every
   page loads, sets `th, td { padding: 0 5px !important }` and `th > div` the same: these rules have to outweigh it. */
.scripts-record-table th,
.scripts-record-table td {
    padding: 4px 6px !important;
    border-bottom: 1px solid #ecedf2;
    text-align: left;
    vertical-align: middle;
}

.scripts-record-table th + th,
.scripts-record-table td + td {
    border-left: 1px solid #ecedf2;
}

.scripts-record-table tbody tr:last-child td {
    border-bottom: none;
}

/* The header row: each column's icon (by its field's type, when it has one) and its name; its type is on hover. The
   header and every other row are tinted as the other script tables are (.scripts-node-grid). */
.scripts-record-table th {
    font-family: GlowSemibold;
    font-weight: normal;
    white-space: nowrap;
    background-color: #eef1fe;
}

.scripts-record-table tbody tr:nth-child(even) td {
    background-color: #f7f7f9;
}

.scripts-record-table th > .scripts-column {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 !important;
}

.scripts-column-icon {
    flex: 0 0 16px;
}

/* Remove's column: as narrow as its button. */
.scripts-record-table .scripts-record-actions {
    width: 1%;
    text-align: center;
}

/* The editors of a table's cell are narrower than a parameter's: a dropdown or a text takes 150px of the table's width,
   and fills its cell when the table is wider. A number has no unit beside it there: 96px hold 1024.75 by the spinner.
   Three columns (two dropdowns and a number) and Remove's take about 480px: they fit the form's 520px. */
.scripts-record-table .scripts-entity,
.scripts-record-table .scripts-text {
    width: 150px;
    min-width: 100%;
}

.scripts-record-table .scripts-number {
    width: 96px;
}

/* ---- A field whose choices come from its declaration (ef-script-choice-picker) ---- */

/* The picker, then the note of a check that removed values, or why they could not be checked. */
.scripts-choice-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.scripts-choice {
    position: relative;
    width: 100%;
}

/* The box: as high as the app's inputs, the chips of a list wrapping inside it, the search box taking the rest. */
.scripts-choice-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 2px 4px 2px 8px;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    background-color: #ffffff;
    cursor: text;
}

.scripts-choice--open .scripts-choice-box,
.scripts-choice-box:focus-within {
    border-color: #5774e7;
}

.scripts-choice--disabled .scripts-choice-box {
    background-color: #f7f7f9;
    cursor: default;
}

.scripts-choice-search {
    flex: 1 1 80px;
    min-width: 60px;
    height: 26px;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
}

.scripts-choice-search::placeholder {
    color: #808080;
}

.scripts-choice--disabled .scripts-choice-search {
    cursor: default;
}

/* A value chosen of a list: the app's light blue tag, its remove button after its name. */
.scripts-choice-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    height: 22px;
    padding: 0 4px 0 8px;
    border-radius: 11px;
    background-color: #eef1fd;
    color: #5774e7;
    font-size: 12px;
}

.scripts-choice-chip-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scripts-choice-chip-remove,
.scripts-choice-clear,
.scripts-choice-arrow {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.scripts-choice-chip-remove {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.scripts-choice-chip-remove:hover {
    background-color: #d9dffa;
}

.scripts-choice-clear,
.scripts-choice-arrow {
    width: 22px;
    height: 26px;
}

.scripts-choice-arrow:disabled {
    cursor: default;
    opacity: 0.5;
}

.scripts-choice-chip-remove:focus-visible,
.scripts-choice-clear:focus-visible {
    outline: 2px solid #5774e7;
    outline-offset: 1px;
}

/* The list: under the box (above it near the window's bottom), as wide as it. It is placed in the window's coordinates,
   as custom-dropdown's is (the dialog has no transform, see above), so that neither the form's scrolling body nor a
   table of records, which scrolls sideways, cuts it off. */
.scripts-choice-list {
    position: fixed;
    z-index: 20;
    padding: 4px 0;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.scripts-choice-count,
.scripts-choice-state {
    padding: 4px 10px;
    font-size: 12px;
    color: #808080;
    overflow-wrap: anywhere;
}

/* The list never scrolls sideways: CDK's wrapper of the rows is placed absolutely and grows as wide as its widest row,
   so a long name made the list scroll sideways, and the scroll bar took a row's room. The wrapper is as wide as the list
   instead; a long name ends in an ellipsis on its one line (.scripts-choice-name), and its row's hover hint holds it
   whole. */
.scripts-choice-list .scripts-choice-viewport {
    width: 100%;
    overflow-x: hidden;
}

.scripts-choice-viewport .cdk-virtual-scroll-content-wrapper {
    width: 100%;
}

/* A choice: 32px high, which the virtual scroll counts on; its checkbox for a list. */
.scripts-choice-option {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 10px;
    cursor: pointer;
}

.scripts-choice-option:hover {
    background-color: #f4f5fc;
}

.scripts-choice-option--selected {
    color: #5774e7;
}

.scripts-choice-option .ui-checkbox {
    flex: 0 0 auto;
    margin: 0;
}

.scripts-choice-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* They wrap at the field's width, which they never widen (see the dialog). */
.scripts-choice-note {
    width: 0;
    min-width: 100%;
    font-size: 12px;
    color: #808080;
}

.scripts-choice-problem {
    width: 0;
    min-width: 100%;
    font-size: 12px;
}

/* Descriptions (choices-from design, section 12.3): plain text with its line breaks, wrapping at the dialog's width, and
   whole: no block of its own scrolls, a long one scrolls with the body. At the top of the body, the script's on the run's
   first form, then the step's (Main's) on a light tile. The script's keeps no width of its own (width: 0), so a long
   line never widens the dialog, and fills its line (min-width). */
.scripts-description {
    font-size: 13px;
    line-height: 18px;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.scripts-script-description {
    width: 0;
    min-width: 100%;
    margin: 10px 0 6px;
    color: #808080;
}

.scripts-step-description {
    margin: 10px 0 6px;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: #f4f5fc;
    color: #4a4a4a;
}

/* An input's or a record field's description: subtle helper text on its own line under its editor. It keeps no width of
   its own (width: 0, and no percentage for its basis), so a long line never widens the dialog, and fills its line
   (min-width). */
.scripts-described {
    flex-wrap: wrap;
    row-gap: 4px;
}

.scripts-help {
    flex: 0 0 auto;
    width: 0;
    min-width: 100%;
    font-size: 12px;
    line-height: 16px;
    color: #808080;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.scripts-parameter-record > .scripts-parameter-editor > .scripts-help {
    margin-top: 6px;
}

/* A record's own description (section 13.4): once above the table of its records, or first in a record's group, as
   subtle text like an input's helper text. It keeps no width of its own (width: 0), so a long line never widens the
   dialog, and fills the line it is on (min-width). */
.scripts-record-description {
    width: 0;
    min-width: 100%;
    font-size: 12px;
    line-height: 16px;
    color: #808080;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* A narrow window: a parameter's name above its editor. */
@media (max-width: 600px) {
    .scripts-parameter {
        flex-direction: column;
        align-items: stretch;
    }

    .scripts-parameter-label {
        flex: 0 0 auto;
        padding: 0 0 6px;
    }
}

/* ---- Results ---- */

/* A section's card: the project's (or "Pipeline") name in bold and its status pill on a light header, then its outputs
   and why it stopped. What it changed follows the card, under a heading of its own. */
.scripts-result {
    margin-bottom: 12px;
    border: 1px solid #ecedf2;
    border-radius: 6px;
}

.scripts-result:last-child {
    margin-bottom: 0;
}

.scripts-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #ecedf2;
    border-radius: 5px 5px 0 0;
    background-color: #eef1fe;
}

.scripts-result-project {
    min-width: 0;
    overflow: hidden;
    font-family: GlowBold;
    font-size: 15px;
    line-height: 22px;
    color: #222222;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* What changed (or what a Test would change), and the changes to apply, under their section's card: a heading as large
   as the card's title, then the table. */
.scripts-body > .scripts-changes,
.scripts-body > ef-script-held-changes {
    display: block;
    margin: 20px 0 12px;
}

.scripts-body > .scripts-changes:last-child,
.scripts-body > ef-script-held-changes:last-child {
    margin-bottom: 0;
}

.scripts-changes > .scripts-section-title,
.scripts-held > .scripts-section-title {
    margin: 0 0 8px;
    font-family: GlowBold;
    font-size: 16px;
    line-height: 22px;
    color: #222222;
}

.scripts-changes > .scripts-muted {
    margin-bottom: 8px;
}

.scripts-changes .scripts-node-grid > table {
    width: 100%;
}

.scripts-status {
    flex: 0 0 auto;
    padding: 2px 12px;
    border-radius: 12px;
    font-family: GlowSemibold;
    font-size: 12px;
    line-height: 16px;
}

/* The colours of the Project Audit change badges (css/audit/projectAudit.css): Done as "added", Not run as
   "modified", Failed as "removed". A cancelled background run's Cancelled is coloured as Not run, as in the run
   history. */
.scripts-status--done {
    background-color: #e6f5ec;
    color: #1f7a52;
}

.scripts-status--not-run,
.scripts-status--cancelled {
    background-color: #eaf1fc;
    color: #2461c4;
}

.scripts-status--failed {
    background-color: #fdecea;
    color: #c0392b;
}

.scripts-result-body {
    padding: 8px 16px;
}

.scripts-result-body > * + * {
    margin-top: 6px;
}

/* An output's row: its name at the left in grey, its value at the right, a thin line between rows, as much room above
   the line as below it. A value too long for the name's line goes under it (see the values below). */
.scripts-output {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f2f5;
}

.scripts-output:first-child {
    padding-top: 0;
}

.scripts-output:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.scripts-output + .scripts-output {
    margin-top: 0;
}

.scripts-output-name {
    flex: 0 0 35%;
    min-width: 0;
    overflow: hidden;
    color: #808080;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scripts-output-value {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

/* A value of one line (an entity's text, a value tree's compact line, or None) sits at the row's right while it fits
   beside the name: as wide as its text, pushed right. One too long for that goes to its own line under the name, as
   wide as the row, and reads from the left, its own line breaks kept. The value tree's own alignment by type (a style
   on its node) gives way here. An object's arrow stays just left of its text and still expands it; its parts then read
   from the left, under the line. */
.scripts-output > span.scripts-output-value,
.scripts-output > ef-script-value-node.scripts-output-value {
    flex: 0 1 auto;
    margin-left: auto;
    text-align: left;
}

.scripts-output > ef-script-value-node.scripts-output-value > .scripts-node {
    text-align: left !important;
}

.scripts-output
    > ef-script-value-node.scripts-output-value
    > .scripts-node
    > .scripts-node-toggle
    > .scripts-node-label {
    flex: 0 1 auto;
}

.scripts-output > ef-script-value-node.scripts-output-value > .scripts-node > .scripts-node-children {
    text-align: left;
}

/* A list of records without a row: None, muted, in a value's place. */
.scripts-output-none {
    color: #808080;
}

/* A table output's caption: how many rows it has, "27 rows", in a value's place; its record's name is its hover hint. A
   single record has none. */
.scripts-record-output-label {
    color: #808080;
}

/* A record output (its fields) or a list of records (a table) takes two lines: its name, and a table's caption at the
   right, then 8px below, from the row's left edge and up to its full width, its fields or its table (at the table's
   own width; What changed's stays the full width), the pager under it. */
.scripts-output--block {
    row-gap: 8px;
}

.scripts-output--block > .scripts-output-name {
    flex: 1 1 0;
}

.scripts-output--block > .scripts-record-output-label {
    flex: 0 0 auto;
}

.scripts-output--block > .scripts-output-value {
    flex: 0 0 100%;
}

/* ---- Results: the value tree (ef-script-value-node) ----
   A node is its compact line; once expanded, its parts follow below, one level, indented under the arrow. An output
   that does not expand is its text alone, aligned as before. The parts of a level line up: a part that does not
   expand keeps the arrow's room. Labels, notes and messages are muted; long texts wrap. */

ef-script-value-node {
    display: block;
    min-width: 0;
}

.scripts-node-line {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

/* The toggle: the whole line of a node that expands (a div with the button role). */
.scripts-node-toggle {
    text-align: left;
    cursor: pointer;
}

.scripts-node-toggle:focus {
    outline: none;
}

.scripts-node-toggle:focus-visible {
    outline: 1px solid #5774e7;
    outline-offset: 1px;
}

.scripts-node-toggle:hover .expandCollapseArrowComponent path {
    fill: #5774e7;
}

/* The arrow and the room it keeps: as high as one line of text, so it stays beside the first line of a long one. The
   arrow is decoration: a click on it goes to the toggle, never to the arrow's own toggling. */
.scripts-node-arrow,
.scripts-node-spacer {
    flex: 0 0 12px;
    height: 20px;
}

.scripts-node-arrow {
    pointer-events: none;
}

.scripts-node-arrow expandCollapse-arrow,
.scripts-node-arrow .expandCollapseArrowComponent {
    display: flex;
    height: 100%;
}

.scripts-node-label {
    flex: 1 1 auto;
    min-width: 0;
}

.scripts-node-name {
    margin-right: 4px;
    color: #808080;
}

.scripts-node-note {
    margin-left: 6px;
    color: #808080;
}

.scripts-node-meta {
    color: #808080;
}

/* A muted fixed text in a part's line: the message of a field that could not be read, or "(default)" for a weekday
   that the calendar does not set. */
.scripts-node-label .scripts-node-meta {
    font-style: italic;
}

/* A List of plain elements, inline: ["a", "b", "c", …+5 more]. A line breaks between its elements and between words,
   never inside a word or a number, as a table's cells do (outside a table, as any value, only a word longer than the
   line itself); "…+5 more]" keeps to one line. "+5 more" and "show less" are buttons that read as links. */
.scripts-node-list-end {
    white-space: nowrap;
}

.scripts-node-more {
    padding: 0;
    border: none;
    background: none;
    color: #5774e7;
    font: inherit;
    cursor: pointer;
}

.scripts-node-more:hover {
    text-decoration: underline;
}

.scripts-node-more:focus {
    outline: none;
}

.scripts-node-more:focus-visible {
    outline: 1px solid #5774e7;
    outline-offset: 1px;
}

.scripts-node-children {
    margin-left: 5px;
    padding-left: 11px;
    border-left: 1px solid #ecedf2;
}

.scripts-node-grid {
    max-width: 100%;
    margin: 2px 0 4px;
    overflow-x: auto;
}

/* Every script table of values (What changed, the run history, Apply's report, a record output's or an expanded value's
   table): a thin frame with rounded corners, the header row on a light blue-grey, every other row lightly tinted, the
   same room in each cell; long texts wrap between words, never inside a word or a number, as an output's value outside
   a table may (overflow-wrap: anywhere): a table wider than its box scrolls sideways (.scripts-node-grid).
   css/resourceManagement/usersInGroups.css, which every page loads, sets the padding of `td` and of `th > div` with
   !important: these paddings have to outweigh it. The child combinators keep a table's rules off the tables in its
   cells, which have their own. */
.scripts-node-grid > table {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #ecedf2;
    border-radius: 6px;
    font-size: 13px;
    overflow-wrap: normal;
    word-break: normal;
}

.scripts-node-grid > table > * > tr > th,
.scripts-node-grid > table > * > tr > td {
    padding: 6px 10px !important;
    border-bottom: 1px solid #ecedf2;
    vertical-align: top;
}

.scripts-node-grid > table > * > tr > th + th,
.scripts-node-grid > table > * > tr > td + td {
    border-left: 1px solid #ecedf2;
}

.scripts-node-grid > table > tbody > tr:last-child > td {
    border-bottom: none;
}

.scripts-node-grid > table > tbody > tr:nth-child(even) > td {
    background-color: #f7f7f9;
}

.scripts-node-grid > table > thead > tr > th {
    font-family: GlowSemibold;
    font-weight: normal;
    text-align: left;
    white-space: nowrap;
    background-color: #eef1fe;
}

.scripts-node-grid > table > thead > tr > th > div {
    padding: 0 !important;
}

/* The corner cells round with the frame. */
.scripts-node-grid > table > thead > tr > th:first-child {
    border-top-left-radius: 5px;
}

.scripts-node-grid > table > thead > tr > th:last-child {
    border-top-right-radius: 5px;
}

.scripts-node-grid > table > tbody > tr:last-child > td:first-child {
    border-bottom-left-radius: 5px;
}

.scripts-node-grid > table > tbody > tr:last-child > td:last-child {
    border-bottom-right-radius: 5px;
}

/* One alignment per column of a record output's or an expanded value's table (scripts-cell--left, scripts-cell--right),
   by its field's declared type: a number or a date at the right, anything else at the left; its header, every cell and
   an empty cell's dash alike. The value tree's own alignment by type (a style on its node) gives way. A number's or a
   date's column never wraps. Its header is the field's name alone, on one line; its type is the hover hint. */
.scripts-node-grid > table > * > tr > .scripts-cell--left,
.scripts-node-grid > table > * > tr > .scripts-cell--left > ef-script-value-node > .scripts-node {
    text-align: left !important;
}

.scripts-node-grid > table > * > tr > .scripts-cell--right,
.scripts-node-grid > table > * > tr > .scripts-cell--right > ef-script-value-node > .scripts-node {
    text-align: right !important;
}

.scripts-node-grid > table > * > tr > .scripts-cell--right {
    white-space: nowrap;
}

/* ---- Results: the pager (ef-script-pager) ----
   Under a long table or list, which shows a page at a time: back, the page's number in a small field, how many pages,
   forward, then which rows show, small and grey as the value tree's notes; a table's CSV and Excel links at the right. */
ef-script-pager {
    display: block;
    min-width: 0;
}

.scripts-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 22px;
    color: #808080;
    text-align: left;
    white-space: nowrap;
}

.scripts-pager-step {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid #ecedf2;
    border-radius: 4px;
    background-color: #ffffff;
    color: #4a4a4a;
    font-size: 14px;
    line-height: 18px;
}

.scripts-pager-step:hover:not([disabled]) {
    border-color: #5774e7;
    color: #5774e7;
}

.scripts-pager-step[disabled] {
    opacity: 0.4;
    cursor: default;
}

.scripts-pager-page input {
    width: 64px;
    height: 22px;
    margin: 0 4px;
    padding: 0 4px;
    border: 1px solid #ecedf2;
    border-radius: 4px;
    color: #222222;
    font-size: 12px;
    text-align: right;
}

.scripts-pager-rows {
    margin-left: 6px;
}

.scripts-pager-downloads {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.scripts-pager-downloads .ui-btn-link {
    padding: 0;
    border: none;
    background: none;
    font-size: 12px;
    line-height: 22px;
}

.scripts-pager-downloads .ui-btn-link:focus-visible,
.scripts-pager-step:focus-visible {
    outline: 2px solid #5774e7;
    outline-offset: 1px;
}

.scripts-diagnostics {
    margin: 0;
    padding: 0;
    list-style: none;
}

.scripts-diagnostic {
    display: flex;
    gap: 12px;
    padding: 2px 0;
}

.scripts-diagnostic-position {
    flex: 0 0 auto;
    font-family: Consolas, 'Courier New', monospace;
    color: #808080;
}

.scripts-diagnostic-message {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* A warning, which never stops a script from running, says so before its message, beside its first line. */
.scripts-diagnostic-severity {
    flex: 0 0 auto;
    align-self: flex-start;
    padding: 0 6px;
    border-radius: 8px;
    background-color: #fff6d6;
    font-size: 12px;
    color: #8a6100;
}

.scripts-problems {
    margin: 0;
    padding-left: 18px;
}

.scripts-problems li {
    padding: 2px 0;
}

/* ---- Results: held changes (ef-script-held-changes) ----
   A pipeline or group script on live data holds its changes: a box per project (and one for availability), its tick,
   its title that expands to the rows, and after Apply its status badge and what Apply did, then Apply or Continue. */

.scripts-held-notes {
    margin: 0 0 8px;
    padding-left: 18px;
    color: #808080;
}

.scripts-held-group {
    margin-bottom: 6px;
    padding: 4px 8px;
    border: 1px solid #ecedf2;
    border-radius: 4px;
}

.scripts-held-group > * + * {
    margin-top: 4px;
}

.scripts-held-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scripts-held-toggle {
    display: flex;
    flex: 1 1 auto;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    cursor: pointer;
}

.scripts-held-toggle:focus {
    outline: none;
}

.scripts-held-toggle:focus-visible {
    outline: 1px solid #5774e7;
    outline-offset: 1px;
}

.scripts-held-toggle:hover .expandCollapseArrowComponent path {
    fill: #5774e7;
}

.scripts-held-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-family: GlowSemibold;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A refusal's badge carries its reason, which may be long. */
.scripts-held-header .scripts-status {
    flex: 0 1 auto;
    overflow-wrap: anywhere;
}

.scripts-held-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}

.scripts-held-choices label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

.scripts-held-choices input {
    margin: 0;
}

.scripts-held-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.scripts-held-actions .ui-btn-light {
    width: 131px;
}

/* ---- Background runs ---- */

/* The run form's Run in the background, left of its buttons. */
.scripts-footer .scripts-background {
    white-space: nowrap;
}

/* A background run's progress panel in the results: its text, a bar, the product step and the time, then its sync
   values. */
.scripts-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scripts-progress-text {
    overflow-wrap: anywhere;
}

.scripts-progress-bar {
    position: relative;
    height: 6px;
    overflow: hidden;
    border-radius: 3px;
    background-color: #ecedf2;
}

.scripts-progress-fill {
    height: 100%;
    border-radius: 3px;
    background-color: #5774e7;
    transition: width 0.3s ease;
}

/* No percent: the whole bar, pale. */
.scripts-progress-bar--indeterminate .scripts-progress-fill {
    opacity: 0.35;
}

.scripts-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #808080;
    font-size: 12px;
}

.scripts-progress-time {
    margin-left: auto;
    white-space: nowrap;
}

/* The run history: one row per run, as wide as the dialog. A run's state is a pill, with how far it is or why it failed
   after it in grey; Open and Cancel are links at the row's right. */
.scripts-runs-table {
    width: 100%;
}

.scripts-runs-table td {
    vertical-align: top;
}

.scripts-runs-state > .scripts-muted {
    display: inline;
    margin-left: 8px;
    overflow-wrap: anywhere;
}

.scripts-runs-script {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scripts-runs-started,
.scripts-runs-by {
    white-space: nowrap;
}

.scripts-runs-actions {
    text-align: right;
    white-space: nowrap;
}

/* The app's link button (ui-btn-link), underlined, on the line of the row's text. */
.scripts-runs-actions .scripts-runs-link {
    padding: 0;
    border: none;
    background: none;
    line-height: 20px;
    text-decoration: underline;
}

.scripts-runs-actions .scripts-runs-link + .scripts-runs-link {
    margin-left: 12px;
}

.scripts-runs-actions .scripts-runs-link:focus-visible {
    outline: 2px solid #5774e7;
    outline-offset: 1px;
}

/* The sidebar entry next to the bell: the whole tile clicks. */
ef-script-runs-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* The bell's hover tile (navigationShell.css, the link's ::before) lies over the icon: clicks go through it. */
.scriptRunsButton > a::before {
    pointer-events: none;
}

/* ---- Settings > Scripts: the Schedules and Settings tabs ---- */

/* A tab's page: a title and its New button, a note, then the table or the form, in the organizer's text. */
.scripts-schedules,
.scripts-settings {
    padding: 16px 20px 24px;
    font-family: GlowRegular, sans-serif;
    font-size: 13px;
    line-height: 18px;
    color: #4a4a4a;
}

.scripts-schedules-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.scripts-schedules-title {
    font-family: GlowBold, sans-serif;
    font-size: 16px;
    line-height: 22px;
    color: #222222;
}

.scripts-schedules-note {
    margin: 0 0 12px;
    color: #808080;
}

.scripts-schedules-table {
    width: 100%;
}

.scripts-schedules-table td {
    vertical-align: top;
}

/* The form of a schedule or of the settings: one labelled row per field, the label in a column of its own. */
.scripts-schedule-form,
.scripts-settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 720px;
}

.scripts-schedule-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    margin: 0;
    font-weight: normal;
}

.scripts-schedule-label {
    flex: 0 0 180px;
    color: #808080;
}

.scripts-schedule-row input[type='text'],
.scripts-schedule-row input[type='number'],
.scripts-schedule-row input[type='time'],
.scripts-schedule-row select {
    min-width: 180px;
    height: 28px;
    padding: 2px 8px;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    background: #ffffff;
    color: #4a4a4a;
}

.scripts-schedule-row input[type='text'] {
    flex: 1 1 260px;
}

.scripts-schedule-choices {
    display: flex;
    flex: 1 1 300px;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 16px;
}

.scripts-schedule-choices--column {
    flex-direction: column;
    gap: 6px;
}

.scripts-schedule-choices label {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    margin: 0;
    font-weight: normal;
}

.scripts-schedule-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}