/* APEX Business – formatierter Text: Anzeige (.apex-rt) und Editor (.apex-editor) · ab 0.40.0 (aus APEX v2026.10.28.01) */

/* ── Anzeige ── */
.apex-rt { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.apex-rt-text { white-space: pre-wrap; }
.apex-rt > :first-child { margin-top: 0; }
.apex-rt > :last-child { margin-bottom: 0; }
.apex-rt p, .apex-rt div { margin: 0 0 .35em; }
.apex-rt h1 { font-size: 1.45em; font-weight: 700; margin: .5em 0 .3em; line-height: 1.25; }
.apex-rt h2 { font-size: 1.25em; font-weight: 700; margin: .5em 0 .3em; line-height: 1.25; }
.apex-rt h3 { font-size: 1.1em; font-weight: 700; margin: .45em 0 .25em; }
.apex-rt ul, .apex-rt ol { margin: 0 0 .4em; padding-left: 1.6em; }
.apex-rt ul { list-style: disc; }
.apex-rt ol { list-style: decimal; }
.apex-rt li { margin: 0 0 .1em; }
.apex-rt blockquote { margin: 0 0 .4em; padding: .1em 0 .1em .8em; border-left: 3px solid #cbd5e1; color: #475569; }
.apex-rt pre { margin: 0 0 .4em; padding: .45em .6em; background: #f1f5f9; border-radius: 4px; font-family: Consolas, 'Courier New', monospace; font-size: .92em; white-space: pre-wrap; }
.apex-rt code { font-family: Consolas, 'Courier New', monospace; background: #f1f5f9; padding: 0 .2em; border-radius: 3px; }
.apex-rt a { color: var(--primaer, #0369a1); text-decoration: underline; }
.apex-rt hr { border: none; border-top: 1px solid #cbd5e1; margin: .5em 0; }

/* ── Editor ── */
.apex-editor { border: 1px solid var(--rahmen, #e2e8f0); border-radius: var(--radius-m, 8px); background: #fff; width: 100%; box-sizing: border-box; }
.apex-editor:focus-within { border-color: var(--primaer, #0369a1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primaer, #0369a1) 15%, transparent); }
.apex-editor.apex-editor-fehlt { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
.apex-editor-leiste { display: flex; flex-wrap: wrap; gap: 2px 6px; padding: 4px 6px; border-bottom: 1px solid var(--rahmen, #e2e8f0); background: var(--hintergrund-seite, #f8fafc);
                      border-radius: var(--radius-m, 8px) var(--radius-m, 8px) 0 0; }
.apex-ed-gruppe { display: inline-flex; align-items: center; gap: 1px; }
.apex-ed-gruppe + .apex-ed-gruppe { padding-left: 6px; border-left: 1px solid var(--rahmen, #e2e8f0); }
.apex-ed-knopf { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 4px; border: 1px solid transparent;
                 border-radius: 4px; background: transparent; color: #334155; cursor: pointer; font-size: 15px; position: relative; }
.apex-ed-knopf:hover { background: #e2e8f0; }
.apex-ed-knopf.apex-ed-an { background: var(--primaer-hell, #e0f2fe); border-color: var(--primaer-rand, #93c5fd); color: var(--primaer-dunkel, #075985); }
.apex-ed-svg { display: inline-flex; line-height: 0; }
.apex-ed-auswahl { height: 26px; font-size: 12px; padding: 0 4px; border: 1px solid var(--rahmen, #e2e8f0); border-radius: 4px; background: #fff; max-width: 130px; width: auto !important; margin: 0 !important; }
.apex-ed-farbe { flex-direction: column; gap: 0; line-height: 1; }
.apex-ed-farbstrich { display: block; width: 14px; height: 3px; border-radius: 1px; background: #e03e2d; margin-top: 1px; }
.apex-ed-farbe[title^='Hintergrund'] .apex-ed-farbstrich { background: #fef9c3; outline: 1px solid #e2e8f0; }
.apex-ed-pop { position: relative; display: inline-flex; }
.apex-ed-palette { position: absolute; z-index: 1000; top: 30px; left: 0; display: grid; grid-template-columns: repeat(6, 20px); gap: 4px; padding: 7px;
                   background: #fff; border: 1px solid var(--rahmen, #e2e8f0); border-radius: 6px; box-shadow: 0 8px 24px rgba(15, 23, 42, .18); }
.apex-ed-palette[hidden] { display: none; }
.apex-ed-farbfeld { width: 20px; height: 20px; border: 1px solid rgba(15, 23, 42, .18); border-radius: 3px; cursor: pointer; padding: 0; }
.apex-ed-farbfeld:hover { transform: scale(1.15); }
.apex-ed-farbe-weg { grid-column: 1 / -1; margin-top: 2px; font-size: 11.5px; border: 1px solid var(--rahmen, #e2e8f0); background: #fff; border-radius: 4px; padding: 2px 4px; cursor: pointer; }
.apex-editor-flaeche { position: relative; padding: .5rem .7rem; outline: none; font-size: 13px; overflow-y: auto; max-height: 60vh; cursor: text; }
.apex-editor-leer .apex-editor-flaeche::before { content: attr(data-platzhalter); color: #94a3b8; position: absolute; pointer-events: none; }
.apex-editor-gesperrt .apex-editor-leiste { display: none; }
.apex-editor-gesperrt .apex-editor-flaeche { background: var(--hintergrund-seite, #f8fafc); cursor: default; }
@media print { .apex-editor-leiste { display: none; } }

/* APEX Business: Editor in Formularen (.formularfeld) */
.formularfeld .apex-editor { margin-top: 2px; }
.apex-editor-flaeche { font-size: 14px; line-height: 1.45; color: var(--text, #0f172a); }
.apex-editor-kompakt:not(:focus-within) .apex-editor-leiste { display: none; }   /* Leiste nur beim Bearbeiten (z. B. in Tabellen) */
.apex-editor-kompakt .apex-editor-flaeche { padding: .3rem .5rem; font-size: 13px; }
.apex-ed-gruppe { flex-wrap: wrap; max-width: 100%; }
.apex-ed-auswahl { min-width: 0; }
/* Auswahllisten der Leiste gegen Formular-Stile der Module absichern */
.apex-editor select.apex-ed-auswahl { height: 26px !important; min-height: 0 !important; padding: 0 18px 0 6px !important; font-size: 12px !important; line-height: 24px !important; width: auto !important; }
