.vtl {
    --vtl-border: #d8e0ea;
    --vtl-accent: #2458cf;
    --vtl-text: #172033;
    --vtl-muted: #536176;
    --vtl-surface: #f6f8fc;

    width: 100%;
    max-width: none;
    margin: 24px 0;
    padding: 16px;
    box-sizing: border-box;
    border: 1px solid var(--vtl-border);
    border-radius: 16px;
    background: #fff;
    color: var(--vtl-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.45;
    isolation: isolate;
    color-scheme: light;
}

.vtl *,
.vtl *::before,
.vtl *::after {
    box-sizing: border-box;
}

.vtl [hidden] {
    display: none !important;
}

.vtl .vtl-header {
    margin: 0 0 14px;
}

.vtl .vtl-header h2 {
    margin: 0 0 4px;
    padding: 0;
    color: var(--vtl-text);
    font-size: 24px;
    line-height: 1.25;
}

.vtl .vtl-header p {
    margin: 0;
    color: var(--vtl-muted);
    font-size: 13px;
}

.vtl .vtl-mount {
    min-width: 0;
}

.vtl .vtl-top,
.vtl .vtl-bottom {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vtl .vtl-top {
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--vtl-border);
    border-radius: 12px;
    background: var(--vtl-surface);
}

.vtl .vtl-bottom {
    padding-top: 12px;
}

.vtl .vtl-row {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.vtl .vtl-row-center {
    align-items: center;
}

.vtl .vtl-field {
    display: flex;
    flex: 1 1 160px;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    margin: 0;
    color: var(--vtl-text);
    font-size: 12px;
    font-weight: 600;
}

.vtl .vtl-field-wide {
    flex-basis: 260px;
}

.vtl .vtl-field-small {
    flex: 0 1 110px;
}

.vtl .vtl-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 13px;
}

.vtl input,
.vtl select,
.vtl textarea,
.vtl button {
    font: inherit;
    letter-spacing: normal;
    text-transform: none;
}

.vtl input[type="text"],
.vtl input[type="number"],
.vtl select,
.vtl textarea {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid #b8c4d5;
    border-radius: 7px;
    background: #fff;
    color: var(--vtl-text);
    box-shadow: none;
    font-size: 14px;
    font-weight: 400;
}

.vtl input[type="color"] {
    display: block;
    width: 100%;
    height: 40px;
    margin: 0;
    padding: 4px;
    border: 1px solid #b8c4d5;
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
}

.vtl input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.vtl textarea {
    min-height: 110px;
    resize: vertical;
}

.vtl button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    max-width: 100%;
    margin: 0;
    padding: 9px 13px;
    border: 1px solid #b8c4d5;
    border-radius: 7px;
    background: #fff;
    color: var(--vtl-text);
    box-shadow: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    white-space: normal;
}

.vtl button:hover:not(:disabled) {
    border-color: var(--vtl-accent);
    background: #edf3ff;
    color: #173d94;
}

.vtl button.vtl-primary {
    border-color: var(--vtl-accent);
    background: var(--vtl-accent);
    color: #fff;
}

.vtl button.vtl-primary:hover:not(:disabled) {
    background: #1945ac;
    color: #fff;
}

.vtl button.vtl-danger {
    color: #a32232;
}

.vtl button:disabled,
.vtl input:disabled,
.vtl select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vtl button:focus-visible,
.vtl input:focus-visible,
.vtl select:focus-visible,
.vtl textarea:focus-visible,
.vtl summary:focus-visible,
.vtl canvas:focus-visible {
    outline: 3px solid #86aefb;
    outline-offset: 3px;
}

.vtl details {
    width: 100%;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--vtl-border);
    border-radius: 8px;
    background: #fff;
}

.vtl summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.vtl details[open] > summary {
    margin-bottom: 10px;
}

.vtl .vtl-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vtl .vtl-stage {
    position: relative;
    width: 100%;
    height: var(--vtl-height, 70vh);
    min-height: 420px;
    overflow: hidden;
    border: 1px solid var(--vtl-border);
    border-radius: 12px;
    background: #fff;
}

.vtl canvas {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    touch-action: none;
    cursor: grab;
}

.vtl canvas.vtl-dragging {
    cursor: grabbing;
}

.vtl .vtl-help,
.vtl .vtl-status {
    margin: 0;
    color: var(--vtl-muted);
    font-size: 12px;
}

.vtl .vtl-status {
    min-height: 20px;
    padding: 7px 10px;
    border-radius: 6px;
    background: #f0f5fc;
    overflow-wrap: anywhere;
}

.vtl .vtl-status.vtl-error {
    background: #fff0f1;
    color: #9b1c2d;
}

.vtl .vtl-zoom {
    display: inline-block;
    min-width: 58px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.vtl:fullscreen,
.vtl.vtl-full {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 12px;
    border: 0;
    border-radius: 0;
    background: #fff;
    overflow: auto;
}

.vtl.vtl-full {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
}

.vtl:fullscreen .vtl-header,
.vtl.vtl-full .vtl-header {
    flex: 0 0 auto;
    margin-bottom: 8px;
}

.vtl:fullscreen .vtl-mount,
.vtl.vtl-full .vtl-mount {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.vtl:fullscreen .vtl-top,
.vtl.vtl-full .vtl-top {
    flex: 0 0 auto;
    max-height: 40vh;
    overflow: auto;
}

.vtl:fullscreen .vtl-stage,
.vtl.vtl-full .vtl-stage {
    flex: 1 1 auto;
    height: auto;
    min-height: 180px;
}

.vtl:fullscreen .vtl-bottom,
.vtl.vtl-full .vtl-bottom {
    flex: 0 0 auto;
}

@media (max-width: 640px) {
    .vtl {
        padding: 10px;
        border-radius: 10px;
    }

    .vtl .vtl-top {
        padding: 8px;
    }

    .vtl .vtl-stage {
        min-height: 350px;
    }

    .vtl .vtl-field {
        flex-basis: 140px;
    }

    .vtl .vtl-field-small {
        flex-basis: 90px;
    }

    .vtl button {
        min-height: 42px;
        padding: 9px 10px;
    }

    .vtl .vtl-header h2 {
        font-size: 21px;
    }
}
/* Buttonfarben gegen Überschreibungen durch das Theme absichern */

/* Normale Buttons */
.vtl button,
.vtl button[type="button"] {
    background-color: #ffffff !important;
    background-image: none !important;
    color: #172033 !important;
    -webkit-text-fill-color: currentColor !important;
    border: 1px solid #b8c4d5 !important;
    text-shadow: none !important;
}

/* Normale Buttons: Hover */
.vtl button:hover:not(:disabled),
.vtl button[type="button"]:hover:not(:disabled) {
    background-color: #edf3ff !important;
    color: #173d94 !important;
    border-color: #2458cf !important;
}

/* Blaue Hauptbuttons */
.vtl button.vtl-primary,
.vtl button[type="button"].vtl-primary {
    background-color: #2458cf !important;
    color: #ffffff !important;
    border-color: #2458cf !important;
}

/* Blaue Hauptbuttons: Hover */
.vtl button.vtl-primary:hover:not(:disabled),
.vtl button[type="button"].vtl-primary:hover:not(:disabled) {
    background-color: #1945ac !important;
    color: #ffffff !important;
    border-color: #1945ac !important;
}

/* Löschen-Button */
.vtl button.vtl-danger,
.vtl button[type="button"].vtl-danger {
    background-color: #ffffff !important;
    color: #a32232 !important;
    border-color: #d6a5ac !important;
}

.vtl button.vtl-danger:hover:not(:disabled),
.vtl button[type="button"].vtl-danger:hover:not(:disabled) {
    background-color: #fff0f1 !important;
    color: #821b28 !important;
    border-color: #a32232 !important;
}

/* Eventuelle Textelemente innerhalb der Buttons */
.vtl button * {
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
}

/* Deaktivierte Buttons bleiben lesbar */
.vtl button:disabled,
.vtl button[type="button"]:disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
}