/* ==============================================================================================
   10_029 (Paket E): Stil des Berechnungs-Editors (js/bi/crf/calc-editor.js).

   Alles unter `.cse-modal` (der Dialog am body), `.cse-field` (Reiter „Berechnung“ der Feld-Maske)
   und `.cse-list` (Reiter „Berechnungen“/„Funktionen“ der Workflow-Maske) -- die Traegerseiten
   stylen nackte Elemente (css/bi/field.css), eine Regel ohne Praefix waere ein Eingriff.
   Tokens, Kopf, Fuss, Knoepfe (`.dlg-btn`), Schalter (`.dlg-seg`), Streifen (`.dlg-warn`) kommen
   aus css/bi/dlg/dlg.css (`.dlg-scope` an der Box). z-index: Fenster 9000, Listeneditor 10001,
   Listenfenster „Vorlagen verwalten“ 10001 (`.cse-modal--manage`), dieser Dialog 10002, Hilfe-Fenster 10003
   (eigene Huelle `.cse-modal--help`, auch ohne Editor),
   Rueckfragen (dlgBlock) 11000, Ziehhilfe 12000.
   ============================================================================================== */

.cse-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    pointer-events: none;
    font-size: 12px;
    line-height: 1.45;
    color: #2C3A47;
    text-align: left;
}

.cse-modal * {
    box-sizing: border-box;
}

.cse-modal .cse-box {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 96vw;
    max-width: 1680px;
    height: 92vh;
    overflow: hidden;
    border: 1px solid #D6DEE5;
    border-radius: 10px;
    background: #FFFFFF;
    box-shadow: 0 22px 54px rgba(23, 43, 63, .30);
    pointer-events: auto;
}

.cse-modal input[type="text"],
.cse-modal select,
.cse-modal textarea {
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 3px 6px;
    border: 1px solid #B9C4CE;
    border-radius: 4px;
    background: #FFFFFF;
    font: inherit;
    color: inherit;
}

.cse-modal textarea {
    width: 100%;
    resize: vertical;
}

.cse-modal .cse-input--short {
    width: 56px;
}

.cse-modal .cse-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid #E3E8ED;
}

.cse-modal .cse-top__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cse-modal .cse-top__item--wide {
    flex: 1 1 260px;
}

.cse-modal .cse-top__item--wide input {
    width: 100%;
}

.cse-modal .cse-top__tools {
    flex-direction: row;
    gap: 6px;
}

.cse-modal .cse-lbl {
    font-size: 11px;
    font-weight: 600;
    color: #5B6B79;
}

/* 10_029 (Abnahme 12): drei Reiter statt vier Spalten -- 1: ① (1/3) + ② (2/3), 2: ③ + ④, 3: Hilfe.
   Kopf, lesbare Fassung und Fuss bleiben immer sichtbar; jeder Bereich rollt fuer sich. */
.cse-modal .cse-tabs {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-end;
    gap: 2px;
    padding: 8px 18px 0;
    border-bottom: 1px solid #CBD5DE;
    background: #F7F9FB;
}

.cse-modal .cse-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    margin: 0 0 -1px;
    padding: 8px 18px 9px;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
    background: transparent;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: #4A5966;
    cursor: pointer;
}

.cse-modal .cse-tab:hover {
    background: #EEF3F7;
    color: #1B4676;
}

.cse-modal .cse-tab.is-on {
    border-color: #CBD5DE;
    background: #FFFFFF;
    color: #1B4676;
    box-shadow: inset 0 3px 0 #1B4676;
}

.cse-modal .cse-tab__dot {
    display: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #B42318;
}

.cse-modal .cse-tab.has-error .cse-tab__dot {
    display: inline-block;
}

.cse-modal .cse-body {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.cse-modal .cse-pane {
    flex: 1 1 auto;
    min-height: 0;
}

.cse-modal .cse-pane--algo {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(460px, 2fr);
    grid-template-rows: minmax(0, 1fr);
}

.cse-modal .cse-pane--result {
    display: grid;
    /* 10_029 (Abnahme 15): ③ schmal (~1/3), ④ Test breit (~2/3) */
    grid-template-columns: minmax(300px, 1fr) minmax(420px, 2fr);
    grid-template-rows: minmax(0, 1fr);
}

.cse-modal .cse-pane--help {
    overflow: auto;
}

@media (max-width: 1100px) {
    .cse-modal .cse-pane--algo,
    .cse-modal .cse-pane--result {
        display: block;
        overflow: auto;
    }
}

.cse-modal .cse-col {
    min-width: 0;
    min-height: 0;
    padding: 14px 18px;
    border-right: 1px solid #E3E8ED;
    overflow: auto;
}

.cse-modal .cse-col:last-child {
    border-right: 0;
}

.cse-modal .cse-h {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: #1B4676;
}

.cse-modal .cse-chip {
    display: inline-block;
    padding: 0 6px;
    border-radius: 10px;
    background: #EEF2F6;
    font-size: 10px;
    line-height: 16px;
    color: #4A5966;
    white-space: nowrap;
    vertical-align: middle;
}

.cse-modal .cse-chip--type {
    background: #E4EEF9;
    color: #1B4676;
}

.cse-modal .cse-unit {
    font-size: 10px;
    color: #6D7B88;
}

.cse-modal .cse-unit--warn {
    color: #A35B00;
}

.cse-modal .cse-ib {
    width: auto;
    height: auto;
    min-width: 20px;
    margin: 0;
    padding: 0 4px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    font: inherit;
    line-height: 18px;
    color: #5B6B79;
    cursor: pointer;
}

.cse-modal .cse-ib:hover {
    border-color: #B9C4CE;
    background: #F2F5F8;
}

.cse-modal .cse-hint,
.cse-modal .cse-empty {
    color: #6D7B88;
    font-size: 11px;
}

.cse-modal .cse-warn {
    margin: 4px 0;
    font-size: 11px;
}

.cse-modal .cse-ok {
    color: #1E7B34;
}

.cse-modal .cse-bad {
    color: #B42318;
}

/* ① Eingaenge ---------------------------------------------------------------------------------- */

.cse-modal .cse-input {
    margin: 0 0 10px;
    padding: 6px;
    border: 1px solid #DCE3E9;
    border-radius: 6px;
    background: #FAFBFC;
}

.cse-modal .cse-input--unbound {
    border-color: #E0A100;
    background: #FFF8E6;
}

.cse-modal .cse-input__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.cse-modal .cse-input__row + .cse-input__row {
    margin-top: 8px;
}

.cse-modal .cse-input__row input[type="text"] {
    flex: 1 1 80px;
    min-width: 0;
}

.cse-modal .cse-input__src,
.cse-modal .cse-input__mode {
    margin-top: 6px;
    font-size: 11px;
    color: #4A5966;
    word-break: break-word;
}

.cse-modal .cse-input__mode,
.cse-modal .cse-input__moderow {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cse-modal .cse-input__moderow {
    margin-top: 8px;
}

.cse-modal .cse-input__moderow .cse-mode {
    flex: 1 1 auto;
    min-width: 0;
}

.cse-modal .cse-bind {
    margin-top: 8px;
}

.cse-modal .cse-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.cse-modal .cse-set {
    margin-top: 10px;
    padding-top: 6px;
    border-top: 1px dashed #CBD5DE;
}

.cse-modal .cse-set__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 0 0 8px;
}

.cse-modal .cse-set__lbl {
    display: inline-flex;
    flex: 0 0 120px;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: #5B6B79;
}

/* 10_029 (Abnahme 11): ⓘ an ① Eingaenge (Karte, Bezugsart, Zeilen von „Werte aus …“, Reiter der Auswahl) */
.cse-modal .cse-info {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: #7C8894;
    cursor: pointer;
}

.cse-modal .cse-info:hover,
.cse-modal .cse-info:focus {
    border-color: #B9C4CE;
    background: #E6EEF6;
    color: #1B4676;
    outline: 0;
}

.cse-modal .cse-info svg {
    width: 16px;
    height: 16px;
}

.cse-modal .cse-set__row select,
.cse-modal .cse-set__row input[type="text"] {
    flex: 1 1 100px;
    min-width: 0;
}

.cse-modal .cse-set__element {
    font-size: 11px;
}

.cse-modal .cse-checkline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-right: 10px;
    font-size: 11px;
}

.cse-modal .cse-pick {
    margin-top: 12px;
    padding: 6px;
    border: 1px solid #B9C4CE;
    border-radius: 6px;
    background: #FFFFFF;
}

.cse-modal .cse-pick__head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.cse-modal .cse-pick__spacer {
    flex: 1 1 auto;
}

.cse-modal .cse-pick__body {
    max-height: 340px;
    overflow: auto;
}

.cse-modal .cse-pick__item,
.cse-modal .cse-tree__field,
.cse-modal .cse-tree__toggle {
    display: block;
    width: 100%;
    margin: 0;
    padding: 2px 4px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.cse-modal .cse-pick__item:hover,
.cse-modal .cse-tree__field:hover,
.cse-modal .cse-tree__toggle:hover {
    background: #EEF4FB;
}

.cse-modal .cse-pick__item[disabled],
.cse-modal .cse-tree__field[disabled] {
    color: #9AA6B1;
    cursor: not-allowed;
    background: transparent;
}

.cse-modal .cse-tree__toggle {
    font-weight: 600;
}

.cse-modal .cse-tree__node--l2 {
    padding-left: 16px;
}

.cse-modal .cse-tree__node--l3 {
    padding-left: 16px;
}

.cse-modal .cse-tree__toggle.cse-tree__block {
    font-size: 11px;
    color: #5B6B79;
}

/* 10_029 (Abnahme 1): the fields of a block sit one level below the block, with a guide line */
.cse-modal .cse-tree__fields {
    margin-left: 7px;
    padding-left: 10px;
    border-left: 1px solid #DDE3E9;
}

.cse-modal .cse-tree__label {
    color: #6D7B88;
}

.cse-modal .cse-tree__why {
    display: block;
    font-size: 10px;
    color: #9A6B00;
}

/* ② Algorithmus -------------------------------------------------------------------------------- */

.cse-modal .cse-algo-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 12px; /* 10_029 („klebt“): Abstand zwischen Titel/Umschalter und Suchfeld bzw. Formelfeld */
}

.cse-modal .cse-algo-head .cse-h {
    margin: 0;
}

/* Palette (Abnahme 3): Suchfeld, Reiter, ruhiges Raster gleich breiter Kacheln -------------------
   Kachel = Symbolspalte fester Breite (Operatoren fluchten) + Beschriftung (Ellipsis, voller Name im
   title) + ⓘ-Knopf rechts. Gleiche Hoehe, eckig-ruhig wie die uebrigen Felder (4 px), kein Pillen-Look. */

.cse-modal .cse-pal-searchrow {
    position: relative;
    margin-bottom: 10px;
}

.cse-modal input[type="text"].cse-pal-search {
    display: block;
    width: 100%;
    height: 28px;
    padding: 4px 28px 4px 26px;
    border-color: #CBD5DE;
    background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='14' height='14' fill='none' stroke='%237C8894' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='4.6'/%3E%3Cpath d='M10.4 10.4L14 14'/%3E%3C/svg%3E") no-repeat 10px 50%;
}

.cse-modal input[type="text"].cse-pal-search:focus {
    border-color: #1B4676;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(27, 70, 118, .15);
}

.cse-modal .cse-pal-clear {
    position: absolute;
    top: 5px;
    right: 5px;
}

.cse-modal .cse-pal-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0;
    min-height: 25px;
    margin-bottom: 0;
    border-bottom: 1px solid #CBD5DE;
}

.cse-modal .cse-pal-tab {
    width: auto;
    margin: 0 0 -1px;
    padding: 4px 9px 5px;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    font: inherit;
    font-size: 11px;
    color: #4A5966;
    cursor: pointer;
}

.cse-modal .cse-pal-tab:hover {
    color: #1B4676;
    background: #F2F6FA;
}

.cse-modal .cse-pal-tab.is-on {
    border-bottom-color: #1B4676;
    background: transparent;
    font-weight: 700;
    color: #1B4676;
}

.cse-modal .cse-pal-count {
    padding: 4px 2px 5px;
    font-size: 11px;
    color: #5B6B79;
}

.cse-modal .cse-pal-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    grid-auto-rows: 28px;
    gap: 4px;
    align-content: start;
    max-height: 104px; /* 10_029 (Abnahme 8): hoechstens 3 Reihen (3 x 28 + 2 x 4 + 2 x 6), darunter rollt die Flaeche */
    padding: 6px;
    overflow-y: auto;
    border: 1px solid #E3E8ED;
    border-top: 0;
    border-radius: 0 0 6px 6px;
    background: #F7F9FB;
}

.cse-modal .cse-pal-none {
    grid-column: 1 / -1;
    align-self: center;
    padding: 4px 2px;
}

.cse-modal .cse-pal-item {
    display: flex;
    align-items: stretch;
    min-width: 0;
    height: 28px;
    border: 1px solid #D3DCE4;
    border-left: 3px solid #9FB3C8;
    border-radius: 4px;
    background: #FFFFFF;
    color: #1F3550;
    cursor: grab;
}

.cse-modal .cse-pal-item:hover {
    border-color: #9FB3C8;
    background: #F4F8FC;
}

.cse-modal .cse-pal-item--op {
    border-left-color: #1B4676;
}

.cse-modal .cse-pal-item--lit {
    border-left-color: #C9B27C;
}

.cse-modal .cse-pal-item--var {
    border-left-color: #7FA77F;
    color: #2F5E2F;
}

.cse-modal .cse-pal-item--lib {
    border-left-color: #0E5F6B;
}

.cse-modal .cse-pal-item__main {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 6px;
    min-width: 0;
    width: auto;
    height: 100%;
    margin: 0;
    padding: 0 4px 0 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 11.5px;
    text-align: left;
    color: inherit;
    cursor: inherit;
}

.cse-modal .cse-pal-item__main:focus,
.cse-modal .cse-pal-info:focus {
    outline: 2px solid rgba(27, 70, 118, .45);
    outline-offset: -2px;
}

.cse-modal .cse-pal-item__sym {
    flex: 0 0 28px;
    width: 24px;
    font-family: Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    color: #1B4676;
}

.cse-modal .cse-pal-item:not(.cse-pal-item--op) .cse-pal-item__sym {
    font-weight: 400;
    color: #8A98A6;
}

.cse-modal .cse-pal-item--var .cse-pal-item__label {
    font-family: Menlo, Consolas, "Liberation Mono", monospace;
}

.cse-modal .cse-pal-item__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cse-modal .cse-pal-item__grp {
    flex: 0 1 auto;
    max-width: 45%;
    overflow: hidden;
    padding: 0 4px;
    border-radius: 3px;
    background: #EEF2F6;
    font-size: 9.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #5B6B79;
}

.cse-modal .cse-pal-info {
    display: inline-flex;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-left: 1px solid #E3E8ED;
    border-radius: 0 3px 3px 0;
    background: transparent;
    color: #7C8894;
    cursor: pointer;
}

.cse-modal .cse-pal-info:hover {
    background: #E6EEF6;
    color: #1B4676;
}

.cse-modal .cse-pal-hint {
    margin: 6px 0 12px;
    font-size: 10px;
    color: #6D7B88;
}

/* Hilfe-Fenster je Baustein (Abnahme 3): ueber dem Editor, innerhalb von .cse-modal --------------- */

.cse-modal .cse-help {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(23, 43, 63, .28);
    pointer-events: auto;
}

.cse-modal .cse-help__box {
    display: flex;
    flex-direction: column;
    width: 640px;
    max-width: 92vw;
    max-height: 82vh;
    overflow: hidden;
    border: 1px solid #D6DEE5;
    border-radius: 10px;
    background: #FFFFFF;
    box-shadow: 0 22px 54px rgba(23, 43, 63, .32);
}

.cse-modal .cse-help__hd {
    cursor: default;
}

.cse-modal .cse-help__title {
    padding-right: 36px;
    font-size: 17px;
    word-break: break-word;
}

.cse-modal .cse-help__body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 18px 14px;
    overflow-y: auto;
    font-size: 12.5px;
    line-height: 1.5;
}

.cse-modal .cse-help__body p {
    margin: 0;
}

.cse-modal .cse-help__summary {
    margin: 0 0 10px;
    font-size: 13px;
    color: #2C3A47;
}

.cse-modal .cse-help__sec {
    margin: 0 0 10px;
}

.cse-modal .cse-help__h {
    margin: 0 0 3px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: #5B6B79;
}

.cse-modal .cse-help__body code,
.cse-modal .cse-help__code {
    font-family: Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 11.5px;
}

.cse-modal .cse-help__body code {
    padding: 0 3px;
    border-radius: 3px;
    background: #F1F4F7;
}

.cse-modal .cse-help__code {
    display: block;
    margin: 0;
    padding: 3px 5px;
    border: 1px solid #E3E8ED;
    border-radius: 4px;
    background: #F7F9FB;
    white-space: pre-wrap;
    word-break: break-word;
    color: #1F3550;
}

.cse-modal .cse-help__example {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.cse-modal .cse-help__example .cse-help__code {
    flex: 1 1 200px;
}

.cse-modal .cse-help__code--result {
    flex: 0 1 auto;
    border-color: #BFD8C4;
    background: #F2F8F3;
}

.cse-modal .cse-help__gives {
    font-size: 11px;
    color: #6D7B88;
}

.cse-modal .cse-help__params {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.cse-modal .cse-help__params th,
.cse-modal .cse-help__params td {
    padding: 3px 6px;
    border-bottom: 1px solid #E3E8ED;
    text-align: left;
    vertical-align: top;
}

.cse-modal .cse-help__params th {
    font-size: 10.5px;
    font-weight: 700;
    color: #5B6B79;
    background: #F7F9FB;
}

.cse-modal .cse-help__params td:first-child {
    white-space: nowrap;
}

.cse-modal .cse-help__sec--notes {
    padding: 6px 8px;
    border-left: 3px solid #C9B27C;
    background: #FFFBF0;
}

/* Abnahme 3c: eigene Huelle des Hilfe-Fensters (ueber dem Editor bzw. der Workflow-Maske) */
.cse-modal.cse-modal--help {
    z-index: 10003;
}

.cse-modal .cse-help__none {
    margin: 0 0 10px;
    padding: 6px 8px;
    border-radius: 4px;
    background: #F1F4F7;
    font-size: 12px;
    color: #5B6B79;
}

.cse-modal .cse-help__aside {
    margin: 12px 0 0;
    padding-top: 8px;
    border-top: 1px solid #E3E8ED;
    font-size: 11px;
    color: #6D7B88;
}

/* Abnahme 3c: Hilfe der Funktion im Funktions-Editor (aufklappbar unter ③) ----------------------- */

.cse-modal .cse-fh {
    margin: 0;
    border: 1px solid #DCE3E9;
    border-radius: 6px;
    background: #FBFCFD;
}

.cse-modal .cse-fh.cse-lit--bad {
    border-color: #B42318;
}

.cse-modal .cse-fh__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    padding: 6px 8px;
}

.cse-modal .cse-fh__title {
    margin: 0;
}

.cse-modal .cse-fh-toggle {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #1B4676;
    cursor: pointer;
}

.cse-modal .cse-fh__caret {
    display: inline-block;
    width: 14px;
    color: #5B6B79;
}

.cse-modal .cse-fh__state {
    flex: 1 1 auto;
    font-size: 11px;
    color: #6D7B88;
}

.cse-modal .cse-fh__body {
    padding: 2px 8px 8px;
    border-top: 1px solid #E3E8ED;
}

.cse-modal .cse-fh__intro {
    margin: 6px 0 8px;
}

.cse-modal .cse-fh__row,
.cse-modal .cse-fh__group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 0 14px;
}

.cse-modal .cse-fh__lbl {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #5B6B79;
}

.cse-modal .cse-fh__count {
    font-weight: 400;
    font-size: 10px;
    color: #8A97A3;
    white-space: nowrap;
}

.cse-modal .cse-fh__count.is-over {
    color: #B42318;
}

.cse-modal .cse-fh__input {
    width: 100%;
}

.cse-modal textarea.cse-fh__input {
    min-height: 38px;
}

.cse-modal .cse-fh__input--mono {
    font-family: Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 11.5px;
}

.cse-modal .cse-fh__param {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
}

.cse-modal .cse-fh__param code {
    flex: 0 0 auto;
    max-width: 40%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 11px;
}

.cse-modal .cse-fh__param input {
    flex: 1 1 auto;
    min-width: 0;
}

.cse-modal .cse-blocks {
    padding: 2px;
}

.cse-modal .cse-stmt {
    margin: 0 0 12px;
    padding: 6px;
    border: 1px solid #DCE3E9;
    border-radius: 6px;
}

.cse-modal .cse-stmt--result {
    border-color: #1B4676;
}

.cse-modal .cse-stmt__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.cse-modal .cse-step-name {
    width: 140px;
    font-family: monospace;
}

.cse-modal .cse-stmt__body {
    overflow-x: auto;
    padding: 2px 0 4px;
}

.cse-modal .cse-card {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 3px;
    padding: 3px 4px;
    border: 1px solid #9FB3C8;
    border-radius: 6px;
    background: #F4F8FC;
    vertical-align: middle;
    cursor: grab;
}

.cse-modal .cse-card--infix,
.cse-modal .cse-card--num,
.cse-modal .cse-card--text,
.cse-modal .cse-card--date,
.cse-modal .cse-card--bool,
.cse-modal .cse-card--empty,
.cse-modal .cse-card--var,
.cse-modal .cse-card--col {
    flex-direction: row;
    align-items: center;
}

.cse-modal .cse-card--var {
    border-color: #7FA77F;
    background: #F2F8F2;
    font-family: monospace;
}

.cse-modal .cse-card--num,
.cse-modal .cse-card--text,
.cse-modal .cse-card--date,
.cse-modal .cse-card--bool,
.cse-modal .cse-card--empty {
    border-color: #C9B27C;
    background: #FFFBF0;
}

.cse-modal .cse-card--error {
    border-color: #B42318;
    background: #FFF1F0;
}

.cse-modal .cse-card.is-active,
.cse-modal .cse-slot.is-active {
    outline: 2px solid #2F80ED;
    outline-offset: 1px;
}

.cse-modal .cse-card.is-drop,
.cse-modal .cse-slot.is-drop {
    background: #DCEBFF;
}

.cse-modal .cse-card__head {
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 600;
    font-size: 11px;
    color: #1B4676;
}

.cse-modal .cse-card__head code {
    font-weight: 400;
    color: #6D7B88;
}

.cse-modal .cse-card__args {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}

.cse-modal .cse-card__args--named {
    flex-direction: column;
    align-items: flex-start;
}

.cse-modal .cse-arg {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.cse-modal .cse-arg__label {
    min-width: 54px;
    font-size: 10px;
    color: #6D7B88;
}

.cse-modal .cse-card__op {
    padding: 0 4px;
    font-weight: 700;
    color: #1B4676;
}

.cse-modal .cse-card__error {
    display: block;
    max-width: 340px;
    font-size: 10px;
    color: #B42318;
}

.cse-modal .cse-card__tools {
    margin-left: 2px;
}

.cse-modal .cse-lit {
    width: 80px;
    padding: 1px 4px;
    font-family: monospace;
}

.cse-modal .cse-lit-bool {
    width: auto;
}

.cse-modal .cse-lit--bad {
    border-color: #B42318 !important;
    background: #FFF1F0 !important;
}

.cse-modal .cse-slot {
    display: inline-block;
    min-width: 54px;
    margin: 3px;
    padding: 2px 8px;
    border: 1px dashed #8BA1B5;
    border-radius: 6px;
    background: #FFFFFF;
    font-size: 10px;
    color: #6D7B88;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
}

.cse-modal .cse-algo-status {
    min-height: 16px;
    margin-top: 6px;
    font-size: 11px;
    color: #4A5966;
}

.cse-modal .cse-algo-status--error {
    color: #B42318;
}

.cse-modal .cse-formula .CodeMirror {
    height: 320px;
    min-height: 220px;
    border: 1px solid #B9C4CE;
    border-radius: 4px;
    font-size: 12px;
}

.cse-modal .cse-formula-text {
    min-height: 280px;
    font-family: monospace;
}

.cse-modal .cse-formula-hint {
    margin-top: 8px;
    font-size: 11px;
    color: #6D7B88;
}

.cse-cm-error {
    background: #FFD3CF;
    border-bottom: 2px solid #B42318;
}

/* ③ Ergebnis ----------------------------------------------------------------------------------- */

.cse-modal .cse-res__row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin: 0 0 14px;
}

.cse-modal .cse-res__row .cse-target-pick {
    margin-top: 6px;
}

.cse-modal .cse-res__row > span:first-child {
    font-size: 11px;
    font-weight: 600;
    color: #5B6B79;
}

.cse-modal .cse-res__row--bad {
    outline: 1px solid #B42318;
}

.cse-modal .cse-res__target {
    font-family: monospace;
    font-size: 11px;
    word-break: break-word;
}

.cse-modal .cse-res__sub {
    font-size: 10px;
    color: #6D7B88;
}

.cse-modal .cse-check-mark--ok {
    color: #1E7B34;
}

.cse-modal .cse-check-mark--bad {
    color: #B42318;
}

/* ④ Testen ------------------------------------------------------------------------------------- */

.cse-modal .cse-test__row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 10px;
}

.cse-modal .cse-test-run {
    margin-top: 4px;
}

.cse-modal .cse-test__row input[type="text"],
.cse-modal .cse-test__row select {
    width: 100%;
}

.cse-modal .cse-test__participant {
    margin-top: 18px;
    padding-top: 8px;
    border-top: 1px solid #E3E8ED;
}

.cse-modal .cse-test__participant h5 {
    margin: 0 0 10px;
    font-size: 12px;
}

.cse-modal .cse-test__participant select,
.cse-modal .cse-test__participant > input[type="text"] {
    display: block;
    width: 100%;
    margin: 0 0 8px;
}

.cse-modal .cse-test__participant .cse-test__row {
    flex-direction: row;
    gap: 8px;
}

.cse-modal .cse-test__participant .cse-test__row input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
}

.cse-modal .cse-cmp {
    width: 100%;
    margin-top: 12px;
    border-collapse: collapse;
    font-size: 11px;
}

.cse-modal .cse-cmp th,
.cse-modal .cse-cmp td {
    padding: 5px 8px;
    border: 1px solid #E3E8ED;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
}

.cse-modal .cse-cmp-verdict {
    margin-top: 4px;
    font-weight: 600;
}

/* Lesbare Fassung und Fuss --------------------------------------------------------------------- */

.cse-modal .cse-narration {
    flex: 0 0 auto;
    max-height: 96px;
    padding: 8px 18px;
    overflow: auto;
    border-top: 1px solid #E3E8ED;
    background: #F7F9FB;
    font-size: 11px;
}

.cse-modal .cse-narration--stale {
    opacity: .6;
}

.cse-modal .cse-narration__label {
    font-weight: 700;
    color: #1B4676;
}

.cse-modal .cse-status--error {
    color: #B42318;
}

.cse-modal .cse-status--ok {
    color: #1E7B34;
}

/* Menues (Vorlagen, Baustein, Zeile) ------------------------------------------------------------ */

.cse-menu {
    position: absolute;
    z-index: 30;
    display: none;
    min-width: 200px;
    max-width: 420px;
    padding: 4px;
    border: 1px solid #B9C4CE;
    border-radius: 6px;
    background: #FFFFFF;
    box-shadow: 0 8px 24px rgba(23, 43, 63, .22);
    text-align: left;
}

.cse-menu.is-open {
    display: block;
}

/* 10_029 (Abnahme 6): the height is set by openMenu() to the space inside the dialog */
.cse-menu--tall {
    overflow: auto;
}

.cse-menu .cse-menu__title {
    padding: 2px 6px 4px;
    font-size: 11px;
    font-weight: 700;
    color: #5B6B79;
}

.cse-menu .cse-menu__item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 4px 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    font: inherit;
    font-size: 12px;
    text-align: left;
    color: #2C3A47;
    cursor: pointer;
}

.cse-menu .cse-menu__item:hover {
    background: #EEF4FB;
}

.cse-menu .cse-menu__item[disabled] {
    color: #9AA6B1;
    cursor: not-allowed;
}

.cse-menu .cse-menu__item--danger {
    color: #B42318;
}

.cse-menu .cse-menu__tpl {
    display: flex;
    align-items: flex-start;
}

.cse-menu .cse-menu__item--side {
    flex: 0 0 auto;
    width: auto;
    font-size: 11px;
    color: #1B4676;
}

.cse-menu .cse-menu__sub {
    display: block;
    font-family: monospace;
    font-size: 10px;
    color: #6D7B88;
}

.cse-drag-helper {
    padding: 2px 8px;
    border: 1px solid #1B4676;
    border-radius: 10px;
    background: #FFFFFF;
    font: 11px monospace;
    color: #1B4676;
    box-shadow: 0 4px 12px rgba(23, 43, 63, .25);
}

/* Listen der Workflow-Maske --------------------------------------------------------------------- */

.qv-mask .cse-list {
    position: relative;
}

.qv-mask .cse-list .cse-list__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 8px;
}

.qv-mask .cse-list .cse-list__bar .cse-list-search {
    flex: 1 1 auto;
    max-width: 420px;
}

.qv-mask .cse-list th[data-sort] {
    cursor: pointer;
}

.qv-mask .cse-list .cse-list__formula {
    max-width: 420px;
    font-size: 11px;
    color: #4A5966;
}

.cse-status-chip {
    display: inline-block;
    padding: 0 6px;
    border-radius: 9px;
    background: #EEF2F6;
    font-size: 10px;
    line-height: 16px;
}

.cse-status-chip--ok {
    background: #E3F4E7;
    color: #1E7B34;
}

.cse-status-chip--invalid {
    background: #FDECEA;
    color: #B42318;
}

.qv-mask .cse-list .cse-bad,
.cse-field .cse-bad {
    color: #B42318;
}

/* Reiter „Berechnung“ der Feld-Maske ------------------------------------------------------------- */

.cse-field {
    position: relative;
    padding: 8px 4px;
    font-size: 12px;
}

.cse-field .cse-field__row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
}

.cse-field .cse-field__row--formula {
    align-items: flex-start;
}

.cse-field .cse-field__label {
    flex: 0 0 140px;
    font-weight: 600;
    color: #5B6B79;
}

.cse-field .cse-field__formula {
    font-family: monospace;
    white-space: pre-wrap;
}

.cse-field .cse-field__empty,
.cse-field .cse-hint {
    margin: 0 0 8px;
    color: #6D7B88;
}

/* 10_029 (Abnahme 9): Vorlagen ----------------------------------------------------------------- */

/* Kopf des Editors im Modus `template`: Bezeichnung neben dem (technischen) Namen */
.cse-modal .cse-label-wrap input {
    width: 220px;
}

/* Menue „Vorlagen“: nicht lauffaehige Vorlage, Eintrag „Vorlagen verwalten …“ */
.cse-menu .cse-menu__item--invalid {
    color: #B42318;
}

.cse-menu .cse-menu__item--manage {
    margin-top: 4px;
    border-top: 1px solid #E3E8ED;
    border-radius: 0 0 4px 4px;
    color: #1B4676;
    font-weight: 600;
}

.cse-menu .cse-empty {
    padding: 4px 8px;
    color: #6D7B88;
}

.qv-mask .cse-list .cse-list__hint {
    flex: 1 1 auto;
}

.qv-mask .cse-list .cse-list__name,
.cse-list--manage .cse-list__name {
    font-family: Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 11px;
    color: #5B6B79;
}

/* Listenfenster „Vorlagen verwalten …“ (ohne Workflow-Maske): unter dem Editor (10002) */
.cse-modal.cse-modal--manage {
    z-index: 10001;
}

.cse-modal .cse-manage__box {
    width: 1080px;
    pointer-events: auto;
}

.cse-list--manage {
    position: relative;
}

.cse-list--manage .cse-list__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
}

.cse-list--manage .cse-list__hint {
    flex: 1 1 auto;
    font-size: 11px;
    color: #6D7B88;
}

.cse-list--manage .cse-list-search {
    width: 260px;
}

.cse-list--manage .qv-btn {
    padding: 4px 12px;
    border: 1px solid #1B4676;
    border-radius: 4px;
    background: #1B4676;
    font: inherit;
    color: #FFFFFF;
    cursor: pointer;
}

.cse-list--manage .qv-icon-btn {
    padding: 0 8px;
    border: 1px solid #C9D2DA;
    border-radius: 4px;
    background: #FFFFFF;
    font: inherit;
    cursor: pointer;
}

.cse-list--manage table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.cse-list--manage th {
    padding: 4px 6px;
    border-bottom: 1px solid #7C8894;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
    color: #5F6A76;
}

.cse-list--manage td {
    vertical-align: top;
    padding: 5px 6px;
    border-bottom: 1px solid #E8EBEE;
}

.cse-list--manage td.qv-all-actions {
    white-space: nowrap;
    text-align: right;
}

.cse-list--manage .qv-all-text {
    margin-top: 2px;
    font-size: 11.5px;
    color: #5B6773;
}

.cse-list--manage .cse-list__formula {
    max-width: 380px;
    font-size: 11px;
    color: #4A5966;
}

.cse-list--manage .cse-bad {
    color: #B42318;
}

.cse-list--manage .cse-chip {
    display: inline-block;
    padding: 0 6px;
    border-radius: 9px;
    background: #EEF2F6;
    font-size: 10px;
}

/* 10_029 (Abnahme 12): Reiter „3 · Hilfe“ -- Felder links, Vorschau rechts ------------------------ */

.cse-modal .cse-hp {
    display: grid;
    grid-template-columns: minmax(360px, 1.1fr) minmax(320px, 1fr);
    gap: 22px;
    min-height: 100%;
    padding: 16px 20px;
}

@media (max-width: 1100px) {
    .cse-modal .cse-hp {
        display: block;
    }

    .cse-modal .cse-hp__preview {
        margin-top: 18px;
    }
}

.cse-modal .cse-hp__preview .cse-hint {
    margin: -6px 0 10px;
}

.cse-modal .cse-hp__card {
    border: 1px solid #D6DEE5;
    border-radius: 10px;
    background: #FFFFFF;
    box-shadow: 0 6px 18px rgba(23, 43, 63, .10);
    overflow: hidden;
}

.cse-modal .cse-hp__title {
    padding: 12px 22px;
    border-bottom: 1px solid #E3E8ED;
    background: #F7F9FB;
    font-size: 15px;
    font-weight: 700;
    color: #1F2933;
    word-break: break-word;
}

/* Menues im Editor (Vorlagen, Baustein, Steckplatz): proportional zur Grundschrift */
.cse-modal .cse-menu {
    min-width: 240px;
    max-width: 480px;
    padding: 6px;
}

.cse-modal .cse-menu .cse-menu__item {
    padding: 6px 10px;
    font-size: 12px;
}

.cse-modal .cse-menu .cse-menu__title {
    padding: 4px 10px 6px;
    font-size: 11px;
}

.cse-modal .cse-menu .cse-menu__sub {
    font-size: 10px;
}

.cse-modal .cse-menu .cse-menu__item--side {
    font-size: 11px;
}

.cse-drag-helper {
    font-size: 11px;
}

/* 10_029 (Abnahme 11): Fenster verschiebbar (Kopf) und minimierbar (Leiste unten, Vorbild qv-window/.wchip) */
.cse-modal .cse-head {
    cursor: move;
}

.cse-modal .cse-head .cse-title {
    padding-right: 84px; /* Platz fuer Minimieren + Schliessen */
}

.cse-minbar {
    position: fixed;
    right: 20px;
    bottom: 14px;
    z-index: 10002;
    font-size: 12px;
    line-height: 1.4;
}

.cse-minbar .cse-minchip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    height: 40px;
    padding: 0 6px 0 0;
    border: 1px solid #D6DEE5;
    border-radius: 6px;
    background: #FFFFFF;
    box-shadow: 0 8px 24px rgba(23, 43, 63, .22);
    overflow: hidden;
}

.cse-minbar .cse-minchip:hover {
    border-color: #B9C4CE;
    background: #EEF3F7;
}

.cse-minbar .cse-minchip__bar {
    align-self: stretch;
    flex-shrink: 0;
    width: 4px;
    background: #0E5F6B;
}

.cse-minbar .cse-minchip__open {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    margin: 0;
    padding: 0 6px 0 8px;
    border: 0;
    background: transparent;
    font: inherit;
    color: #2C3A47;
    cursor: pointer;
}

.cse-minbar .cse-minchip__kick {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: #5F6A76;
}

.cse-minbar .cse-minchip__t {
    max-width: 360px;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cse-minbar .cse-minchip__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #A96400;
}

.cse-minbar .cse-minchip__x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #5F6A76;
    cursor: pointer;
}

.cse-minbar .cse-minchip__x:hover {
    background: #E3E8ED;
    color: #1F2933;
}

.cse-minbar button:focus-visible {
    outline: 2px solid #14707F;
    outline-offset: 1px;
}

.cse-modal .dlg-scope .dlg__ft {
    gap: 10px;
}

/* 10_029 (Abnahme 15): Zwischenschritte in der Vergleichstabelle des Tests */
.cse-modal .cse-cmp .cse-cmp-step th {
    padding-left: 14px;
    font-weight: 400;
    color: #5B6B79;
}

.cse-modal .cse-cmp .cse-cmp-step td {
    color: #3A4A59;
}

.cse-modal .cse-cmp .cse-cmp-step--diff td {
    background: #FDECEC;
}

/* 10_029 (Abnahme 16): die Bindung eines Feld-Eingangs als eigene Zeile */
.cse-modal .cse-input__bind {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin-top: 4px;
    font-size: 11px;
    color: #3A4A59;
}

.cse-modal .cse-input__bindlbl {
    font-weight: 600;
}

.cse-modal .cse-input__bind--none .cse-input__bindval {
    color: #B42318;
    font-weight: 600;
}

.cse-modal .cse-fqn {
    padding: 0 4px;
    border: 1px solid #D3DCE4;
    border-radius: 3px;
    background: #F4F7FA;
    font-size: 10.5px;
    color: #44566A;
}

.cse-modal .cse-input__bind .cse-bind {
    margin-left: auto;
}
