/**
 * Briefeditor (Wahl-Modul Stufe 3, W3-38). Alles hängt an .as-le. Farben aus den Theme-Variablen (hell und dunkel),
 * Zustände nie nur durch Farbe: gedrückte Knöpfe sind umgekehrt und unterstrichen, Grenzüberschreitung steht als Text da.
 */
.as-le { display: flex; flex-direction: column; gap: 12px; min-width: 0; max-width: 100%; color: var(--ink, #1a1d23); }
.as-le * { box-sizing: border-box; }
.as-le [hidden] { display: none; }
.as-le__bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--line, #6b7280); border-radius: 12px; background: var(--bg-elev, #fff); position: sticky; top: 0; z-index: 2; }
.as-le__btn { min-height: 44px; min-width: 44px; padding: 0 12px; font: inherit; font-size: 0.9375rem; line-height: 1.2; color: var(--ink, #1a1d23); background: var(--bg-elev, #fff); border: 1px solid var(--line, #6b7280); border-radius: 10px; cursor: pointer; }
.as-le__btn:hover { background: var(--bg-soft, rgba(128, 128, 128, 0.16)); }
.as-le__btn[aria-pressed="true"] { background: var(--ink, #1a1d23); color: var(--bg-elev, #fff); border-color: var(--ink, #1a1d23); text-decoration: underline; text-underline-offset: 3px; }
.as-le__btn[data-as-le-cmd="bold"] { font-weight: 700; }
.as-le__btn[data-as-le-cmd="italic"] { font-style: italic; }
.as-le__btn[data-as-le-cmd="underline"] { text-decoration: underline; }
.as-le__btn[data-as-le-cmd="underline"][aria-pressed="true"] { text-decoration: underline double; }
.as-le__btn:focus-visible, .as-le__ed:focus-visible, .as-le__link input:focus-visible { outline: 3px solid var(--focus, #0052cc); outline-offset: 2px; }
.as-le__menu { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--line, #6b7280); border-radius: 12px; background: var(--bg-elev, #fff); }
.as-le__menu .as-le__btn { text-align: left; }
.as-le__link { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line, #6b7280); border-radius: 12px; background: var(--bg-elev, #fff); }
.as-le__link input { width: 100%; min-height: 44px; padding: 0 10px; font: inherit; font-size: 1rem; color: var(--ink, #1a1d23); background: var(--bg, #fff); border: 1px solid var(--line, #6b7280); border-radius: 10px; }
.as-le__row { display: flex; flex-wrap: wrap; gap: 8px; }
.as-le__err { margin: 0; font-weight: 600; color: var(--as-danger, #b3261e); }
[data-theme="dark"] .as-le__err { color: #fca5a5; }
.as-le__hint { margin: 0; font-size: 0.875rem; color: var(--muted, #4b5563); }
.as-le__sec { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.as-le__lbl { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-weight: 700; }
.as-le__cnt, .as-le__total { font-size: 0.875rem; font-weight: 400; color: var(--muted, #4b5563); margin: 0; }
.as-le__cnt[data-over="1"], .as-le__total[data-over="1"] { font-weight: 700; color: var(--as-danger, #b3261e); text-decoration: underline; }
[data-theme="dark"] .as-le__cnt[data-over="1"], [data-theme="dark"] .as-le__total[data-over="1"] { color: #fca5a5; }
.as-le__ed { min-height: 4.5rem; max-width: 100%; padding: 10px 12px; font: inherit; font-size: 1rem; line-height: 1.45; color: var(--ink, #1a1d23); background: var(--bg-elev, #fff); border: 1px solid var(--line, #6b7280); border-radius: 12px; overflow-wrap: anywhere; word-break: break-word; }
.as-le__sec[data-as-le-box="body"] .as-le__ed { min-height: 12rem; }
.as-le__ed p, .as-le__ed h2, .as-le__ed ul, .as-le__ed ol { margin: 0 0 0.6em; }
.as-le__ed > :last-child { margin-bottom: 0; }
.as-le__ed h2 { font-size: 1.2rem; line-height: 1.3; }
.as-le__ed ul, .as-le__ed ol { padding-left: 1.5rem; }
.as-le__ed a { color: var(--link, #0b57d0); text-decoration: underline; }
[data-theme="dark"] .as-le__ed a { color: #8ab4ff; }
.as-le__ed [data-ph] { display: inline-block; padding: 0 6px; margin: 0 1px; border: 1px solid var(--line, #6b7280); border-radius: 6px; background: var(--bg-soft, rgba(128, 128, 128, 0.16)); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9em; user-select: all; -webkit-user-select: all; }
@media (max-width: 640px) {
  .as-le__bar { position: static; }
  .as-le__btn { flex: 1 1 auto; }
}

/* Reiter „Einladung“ (Task 11): Formular, Logo, Vorschau, Versand */
.as-inv, .as-send { display: flex; flex-direction: column; gap: 12px; min-width: 0; max-width: 100%; margin-bottom: 24px; }
.as-inv *, .as-send * { box-sizing: border-box; }
.as-inv input[type="text"], .as-inv select, .as-send select { min-height: 44px; max-width: 100%; font: inherit; }
.as-inv input[type="text"] { width: 100%; }
.as-inv__copy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.as-inv__formality, .as-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 12px; border: 1px solid var(--line, #6b7280); border-radius: 12px; }
.as-inv__formality label, .as-logo__pos label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.as-logo__view { flex: 1 1 100%; }
.as-logo__view img { display: block; max-width: 100%; max-height: 120px; background: #fff; border: 1px solid var(--line, #6b7280); }
.as-logo__pos { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.as-inv__frame { width: 100%; height: 520px; max-width: 100%; border: 1px solid var(--line, #6b7280); border-radius: 12px; background: #fff; }
.as-inv__preview { display: flex; flex-direction: column; gap: 8px; }
.as-result { margin: 0; padding-left: 1.25rem; }
.as-result li[data-as-result]:not([data-as-result="sent"]) { font-weight: 600; }
.as-send .as-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
