input, select, button {
    width: clamp(200px, 95%, 300px);
    padding: 10px;
    margin-top: 5px;
}

button {
    background-color: #0056b3;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

button:hover {
    background-color: #004494;
}

.edit_mode {
    display: grid;
    align-items: center;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
    border-bottom: 1px solid #000000;
    margin: 2px 0px;
    padding: 1px 0px
}

.edit_mode div:last-child {
    width: clamp(100px, 90%, 95%);
    text-align: right;
    /* padding-right: 5px; */
    justify-self: center;
}

.edit_mode div:first-child {
    min-width: 52px;
    padding: 2px 5px;
    justify-self: center;
    text-align: center;
    border-radius: 5px;
    border: 1px solid #000000;
    cursor: pointer;
}

.suggestion_div {
    display: none;
    align-items: center;
    grid-template-columns: 1fr 2fr;
    position: absolute;
    width: clamp(100px, 250px, 250px);
    height: clamp(50px, 200px, 200px);
    overflow-y: auto;
    background-color: #ffffff;
    border-radius: 5px;
    border: 1px solid #000000;
    z-index: 7;
}

#search_institution {
    display: none;
}

#share_button {
    display: none;
    font-weight: bold;
    border-radius: 5px;
    padding: 5px;
}

.end_share_chain_dialog {
    display: none;
    color: red;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    bottom: 33px !important;
    right: -8px !important;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 14px;
    color: red;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
}

#process-chain-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#process-chain {
    width: 100%;
    min-height: 120px;
    border: 2px dashed #000;
    padding: 10px;
    display: flex;
    flex-direction: column; /* 🔁 das ist der Trick */
    gap: 10px;
}

.draggable {
    padding: 10px 15px;
    background-color: #ccc;
    border-radius: 5px;
    cursor: grab;
    white-space: nowrap;
    position: relative;
    margin: 1.5px;
}

/* Mehr Abstand rechts zwischen Custom-Prozessen in der Palette */
#custom-processes .draggable {
    margin-right: 12px;
}

/* Insert-Button oben links auf Palette-Elementen (Click-to-Insert)
   Gestylt analog zum Löschbutton, aber links positioniert */
.insert-palette-button {
    position: absolute;
    top: -10px !important;
    left: -2px !important;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 14px;
    color: #333333; /* neutral by default; accent on active */
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 0px 0px rgba(0,0,0,0.12);
    z-index: 1002;
    display: block !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: box-shadow 180ms ease, transform 120ms ease, color 120ms ease;
}

.insert-palette-button-material {
    position: absolute;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 14px;
    color: #333333;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    z-index: 1002;
    display: block !important;
}

.insert-palette-button-product {
    position: absolute;
    top: -10px !important;
    left: -15px !important;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 14px;
    color: #333333;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 1002;
    display: block !important;
}

.insert-palette-button:hover {
    background: #f8f8f8;
}

/* Visuelles Feedback für Click-to-Insert: Akzentfarbe #fe9d0b */
.insert-palette-button.active-insert-palette,
.insert-palette-button.active-insert-palette:focus {
    color: #fe9d0b;
    background: #ffffff;
    box-shadow: 0 0 7px 10px rgba(254,157,11,0.22), 0 0 0 2px rgba(254,157,11,0.08);
    z-index: 1200 !important;
}


.flow-step {
    background-color: #ADD8E6;
    padding: 10px 15px;
    border-radius: 5px;
    position: relative;
}

/* Einheitlicher Lösch-Button für ALLE abgelegten Grid-Elemente */
.flow-step .remove-button {
    position: absolute;
    top: -10px !important;
    right: -2px !important;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 14px;
    color: red;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 10;
}

.flow-step-material .remove-button{
    position: absolute;
    top: -10px !important;
    left: 35px !important;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 14px;
    color: red;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 10;
}

.flow-step-product .remove-button{
    position: absolute;
    top: -10px !important;
    left: 15px !important;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 14px;
    color: red;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 10;
}

/* Optional: Hover-Effekt einheitlich */
.flow-step .remove-button:hover,
.flow-step-material .remove-button:hover,
.flow-step-product .remove-button:hover {
    background: #f8f8f8;
    color: darkred;
}

.custom-item {
    position: relative;           /* wichtig für absolute Position des × */
    padding: 8px 24px 8px 8px;   /* Platz rechts für das Kreuz schaffen */
    border-radius: 4px;
    background: #f8faf8;          /* optional */
    margin: 4px;
    display: inline-block;
}

.remove-palette-material {
    position: absolute;
    top: -10px !important;     /* exakt wie im Grid */
    left: 35px !important; 
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 14px;
    color: red;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);   /* optional: sieht noch besser aus */
    z-index: 5;
    display: block !important;
}

.remove-palette-material:hover {
    background: #f8f8f8;
    color: darkred;
}

/* Material-spezifische Feinjustierung:
   - Insert-Button wie beim Produkt positionieren
   - Löschbutton weiter nach rechts schieben, damit beide Buttons
     spiegelbildlich an der Mittelachse des Elements stehen */
.material-item .insert-palette-button {
    top: -10px !important;
    left: -0px !important;
    z-index: 6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.material-item .remove-palette-material {
    top: -10px !important;
    right: -10px !important; /* gleiche Ausrichtung wie bei Produkten */
    z-index: 6;
}

/* Produkt-spezifisch: kleiner adjustments, falls nötig */
.product-item .remove-palette-material {
    top: -10px !important;
    left: 15px !important;
    z-index: 6;
}

/* Custom processes palette: Entfernen-Button oben rechts positionieren (wie im Grid) */
#custom-processes .remove-palette-material {
    top: -10px !important;
    right: -2px !important;
    left: auto !important;
    z-index: 6;
}

.product-item {
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 35px solid gold;
    margin: 10px;
    position: relative;
    cursor: grab;
}

.product-item span {
    position: absolute;
    top: 38px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}

.flow-step-product {
    position: relative;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 35px solid gold;
    margin: 10px;
}

.flow-step-product span {
    position: absolute;
    top: 38px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}

.flow-step-product .remove-button {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 14px;
    color: red;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
}


#process-placeholder {
    width: 100%;
    text-align: center;
    color: #888;
    font-style: italic;
}

.material-item {
    width: 35px;
    height: 35px;
    background-color: gold;
    border-radius: 50%;
    margin: 10px;
    position: relative;
    cursor: grab;
}

.material-item span {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
}

.flow-step-material {
    width: 35px;
    height: 35px;
    background-color: gold;
    border-radius: 50%;
    position: relative;
    margin: 10px;
}

.flow-step-material span {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
}

.flow-step-material .remove-button {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 14px;
    color: red;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
}

.drop-grid {
    display: flex;
    gap: 10px;
    justify-content: center;
    min-height: 80px;
    margin-bottom: 10px;
    position: relative;
    flex-wrap: nowrap;
    overflow-x: auto;
}

[data-theme="light"] .drop-grid .cell {
    border: 2px dashed #000000;
    background-color: #ffffff;
}

.drop-grid .cell {
    width: 100px;        /* vorher 80px */
    height: 120px;       /* vorher 100% – wird zu flach */
    min-height: 120px;
    border: 2px dashed #aaaaaa;
    background-color: #1c1c1c;
    border-radius: 8px;
    margin: 0px;
    margin-right: -5px;
    margin-left: -5px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease;
}

.drop-grid .cell:hover {
    background-color: #333;
    border-color: #888;
    cursor: pointer;
}

#material-row {
    margin-bottom: 20px;
}


.dropdown_content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    /* padding-inline: 10px; */
    max-height: 210px;
    overflow-y: auto;
    z-index: 100;
}

.hidden_dropdown {
    display: inline-block;
}

div.div_list {
    padding: 2px;
}

div.div_list:hover {
    color: var(--light-link-hover-color);
}

.insert-zone {
    width: 30px;                
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.insert-zone .insert-line {
    width: 2px;
    height: 80%;                
    background: transparent;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.insert-zone:hover .insert-line,
.active-insert .insert-line {
    background: #fe9d0b;        
    width: 4px;
    box-shadow: 0 0 8px rgba(254, 157, 11, 0.6);
}

.grid-row {
    display: flex;
    align-items: flex-start;
    gap: 0; /* kein Gap zwischen Zellen und Insert-Zonen */
}

/* Die Delete-Row muss exakt die gleiche Flex-Logik haben wie material-row / process-row */
.delete-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex;
    align-items: stretch;          /* ← wichtig */
    min-height: 40px;
    margin-top: -10px;
    margin-left: 5px;              /* gleicher negativer Start wie bei .cell */
    margin-right: 5px;
}

.column-delete {
    width: 104px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fe9d0b;
    font-size: 24px;
    font-weight: bold;
    background: rgba(254, 157, 11, 0.12);
    border-radius: 0 0 8px 8px;
    transition: all 0.2s ease;             
    border: 1px solid rgba(254, 157, 11, 0.3);
    box-sizing: border-box;
}

.column-delete:hover {
    background: rgba(254, 157, 11, 0.35);
    color: white;
    box-shadow: 0 2px 8px rgba(254, 157, 11, 0.4);
}

.column-delete:active {
    transform: scale(0.94);
}

/* Insert-Zonen in delete-row: gleiche Breite wie oben (30–40px) */
.delete-row .insert-zone {
    width: 20px;                    /* exakt wie oben */
    pointer-events: none;
}

/* Verstecke versehentlich mitgeklonte Palette-Remove-Buttons im Grid */
.drop-grid .cell .remove-palette-material,
.material-cell .remove-palette-material,
.process-cell .remove-palette-material {
    display: none !important;
}

/* ------------------------------------------------------------------
   Einheitliche Tabellen-Stile für die Ausgabe nach Generierung
   (z. B. Inhalte, die in `renderProcessDetails` als Tabellen erzeugt werden)
   - Rahmenfarbe: schwarz
   - Tabellen innerhalb von `#process-details` werden hier zentral gesteuert
   - Breiten / individuelle Zellgrößen sollten weiterhin von `build.js`
     per Inline-Style o.ä. gesetzt werden.
   ------------------------------------------------------------------ */
#process-details table {
    border-collapse: collapse;
    width: 1000px;
    margin-top: 10px;
}

#process-details table,
#process-details table th,
#process-details table td {
    border: 1px solid #000; /* schwarzer Rahmen wie gewünscht */
}

#process-details table th,
#process-details table td {
    padding: 8px 10px;
    vertical-align: top;
    text-align: left;
    background: transparent; /* JS kann bei Bedarf eigene Hintergründe setzen */
}

#process-details table th {
    font-weight: 600;
}

/* Optional: eine generische Klasse für andere generierte Tabellen */
.builder-generated-table {
    border-collapse: separate !important;
    border-spacing: 0;
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 2px solid !important;
}

.builder-generated-table th,
.builder-generated-table td {
    border: 1px solid;
}