body.fe-editor-active {
    cursor: crosshair;
}

.fe-element {
    position: relative;
    cursor: pointer;
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: outline-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.fe-element:hover {
    outline-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.fe-element:hover::before {
    content: attr(data-fe-type) " #" attr(data-fe-id);
    position: absolute;
    top: -1.65rem;
    left: 0;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 3px 8px;
    border-radius: 6px;
    pointer-events: none;
    box-shadow: 0 6px 14px rgba(30, 64, 175, 0.35);
    z-index: 20;
}

.fe-element.fe-editing {
    outline-color: #2563eb;
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.2);
    cursor: text;
}

/* Editierbarer Bereich: volle Kontrolle für den Browser */
.fe-element.fe-editing [contenteditable="true"] {
    cursor: text;
    outline: none;
}

.fe-element[contenteditable="true"] {
    min-height: 1.2rem;
}

.fe-toolbar {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.35);
    backdrop-filter: blur(8px);
    z-index: 10020;
}

.fe-toolbar-format {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.fe-toolbar-sep {
    width: 1px;
    height: 1.2rem;
    background: rgba(148, 163, 184, 0.25);
    margin: 0 0.25rem;
    flex-shrink: 0;
}

.fe-toolbar button {
    border: 0;
    border-radius: 8px;
    padding: 0.38rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
    background: #334155;
    cursor: pointer;
    transition: transform 0.1s ease, background-color 0.15s ease;
}

.fe-toolbar button:hover {
    transform: translateY(-1px);
}

.fe-toolbar .fe-btn-save {
    background: #059669;
    color: #fff;
}

.fe-toolbar .fe-btn-cancel {
    background: #475569;
}

.fe-toolbar .fe-btn-hide {
    background: #1d4ed8;
}

.fe-toolbar .fe-btn-danger,
.fe-toolbar [data-action="delete"] {
    background: #dc2626;
    color: #fff;
}

/* Format-Buttons kompakter */
.fe-toolbar [data-format] {
    padding: 0.28rem 0.5rem;
    min-width: 2rem;
    text-align: center;
    font-family: serif;
    background: #1e293b;
}

.fe-toolbar [data-format]:hover,
.fe-toolbar [data-format].fe-fmt-active {
    background: #2563eb;
    color: #fff;
}

.fe-toolbar [data-action="save"] {
    background: #059669;
    color: #fff;
}

.fe-element--hidden {
    opacity: 0.4;
    filter: grayscale(0.4);
}

.fe-element.fe-dragging {
    opacity: 0.35;
}

.fe-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px dashed #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    margin: 0.35rem 0;
    transition: all 0.15s ease;
}

.fe-add-btn:hover {
    background: #dbeafe;
    transform: scale(1.06);
}

.fe-delete-confirm {
    position: fixed;
    inset: 0;
    z-index: 10030;
    background: rgba(15, 23, 42, 0.55);
    display: grid;
    place-items: center;
}

.fe-delete-confirm__dialog {
    width: min(430px, 92vw);
    border-radius: 14px;
    background: #fff;
    padding: 1rem;
    box-shadow: 0 18px 46px rgba(2, 6, 23, 0.35);
}

.fe-delete-confirm__dialog strong {
    display: block;
    font-size: 1rem;
    color: #0f172a;
}

.fe-delete-confirm__dialog p {
    margin: 0.6rem 0 0;
    color: #475569;
}

.fe-delete-confirm__actions {
    margin-top: 0.95rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
}

.fe-delete-confirm__actions button {
    border: 0;
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
}

.fe-delete-confirm__actions [data-action="ok"] {
    background: #dc2626;
    color: #fff;
}
