.ai-image-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0;
}

/* Layout-Anpassungen für DokuWiki Alignment */
.ai-image-wrapper:has(.medialeft),
.ai-image-wrapper:has(.img_left) {
    float: left;
    margin: 0 1.5em 1em 0;
}

.ai-image-wrapper:has(.mediaright),
.ai-image-wrapper:has(.img_right) {
    float: right;
    margin: 0 0 1em 1.5em;
}

.ai-image-wrapper:has(.mediacenter),
.ai-image-wrapper:has(.img_center) {
    display: block;
    margin: 0 auto 1em auto;
    text-align: center;
}

.ai-image-wrapper img {
    display: block;
    margin: 0 !important;
}

/* Das KI-Badge (Basis) */
.ai-badge {
    position: absolute;
    font-size: 11px;
    font-weight: 400;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 10;
    letter-spacing: 0.3px;
}

/* Positionsklassen */
.ai-badge.ai-pos-top-left {
    top: 9px;
    left: 9px;
}

.ai-badge.ai-pos-top-right {
    top: 9px;
    right: 9px;
}

.ai-badge.ai-pos-bottom-left {
    bottom: 9px;
    left: 9px;
}

.ai-badge.ai-pos-bottom-right {
    bottom: 9px;
    right: 9px;
}