html,
body {
    width: 100%;
    height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(145deg, #f1f0ec 0%, #dedbd5 58%, #c9c6bf 100%);
    background-attachment: fixed;
    overflow: hidden;
}

.ip-canvas-origin,
#leinwand {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
}

.ip-ground-canvas {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    border: 0;
    border-radius: 0;
}

.ip-image-reference-canvas {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    display: block;
    border: 0;
    pointer-events: none;
}

.ip-image-reference-canvas[hidden] {
    display: none;
}

#speicher,
#c {
    display: block;
    border: 0 !important;
    border-radius: 0 !important;
}

.ip-canvas-frame {
    position: absolute;
    z-index: 4;
    top: 0;
    left: 0;
    pointer-events: none;
    border-radius: 5px;
    box-shadow: inset 0 0 0 2px #cdcdcd;
}

.ip-image-idea-drawer {
    position: fixed;
    z-index: 20;
    top: 24px;
    left: 24px;
    width: min(330px, calc(100vw - 84px));
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.ip-image-idea-drawer.is-collapsed {
    transform: translateX(calc(-100% - 24px));
}

.ip-image-idea-panel {
    max-height: calc(100vh - 48px);
    overflow-x: hidden;
    overflow-y: auto;
    color: #55483c;
    border: 1px solid rgba(120, 96, 72, 0.58);
    border-radius: 18px;
    background: rgba(229, 216, 202, 0.96);
    box-shadow:
        0 18px 40px rgba(67, 49, 33, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
}

.ip-image-idea-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 9px 14px;
    border-bottom: 1px solid rgba(120, 96, 72, 0.34);
    background: linear-gradient(135deg, rgba(255, 250, 244, 0.62), rgba(151, 128, 101, 0.18));
    font-family: ArvoRegular, Georgia, serif;
    font-size: 16px;
}

.ip-image-idea-edge-toggle {
    position: absolute;
    top: 18px;
    right: -46px;
    display: grid;
    place-items: center;
    width: 46px;
    height: 64px;
    padding: 0;
    color: #fffaf5;
    border: 1px solid rgba(91, 69, 50, 0.62);
    border-left: 0;
    border-radius: 0 14px 14px 0;
    background: linear-gradient(160deg, #806a55, #5f4d3c);
    box-shadow: 7px 8px 18px rgba(62, 44, 29, 0.22);
    font-size: 19px;
    cursor: pointer;
}

.ip-image-idea-edge-toggle:hover,
.ip-image-idea-edge-toggle:focus-visible {
    filter: brightness(1.1);
    outline: 3px solid rgba(255, 248, 240, 0.68);
    outline-offset: -4px;
}

.ip-image-idea-form,
.ip-image-layer-controls {
    padding: 14px;
}

.ip-image-idea-label,
.ip-image-style-fieldset legend,
.ip-image-layer-opacity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 0 7px;
    font-size: 12px;
    font-weight: 700;
}

#imageIdeaPrompt {
    width: 100%;
    min-height: 116px;
    resize: vertical;
    padding: 10px 11px;
    color: #493e34;
    border: 1px solid rgba(112, 89, 69, 0.42);
    border-radius: 11px;
    outline: 0;
    background: rgba(255, 252, 248, 0.88);
    box-shadow: inset 0 2px 5px rgba(77, 58, 42, 0.08);
    font: 13px/1.45 Arial, sans-serif;
}

#imageIdeaPrompt:focus {
    border-color: #657873;
    box-shadow: 0 0 0 3px rgba(101, 120, 115, 0.22);
}

.ip-image-style-fieldset {
    margin: 13px 0 0;
    padding: 0;
    border: 0;
}

.ip-image-idea-level-label {
    display: block;
    margin: 13px 0 6px;
    font-size: 12px;
    font-weight: 700;
}

.ip-image-idea-level {
    width: 100%;
    min-height: 38px;
    padding: 7px 9px;
    color: #493e34;
    border: 1px solid rgba(112, 89, 69, 0.42);
    border-radius: 9px;
    background: rgba(255, 252, 248, 0.88);
    font-size: 12px;
}

.ip-image-style-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.ip-image-style-option {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.ip-image-style-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ip-image-style-option > span {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 48px;
    padding: 7px 8px;
    border: 1px solid rgba(112, 89, 69, 0.34);
    border-radius: 10px;
    background: rgba(255, 250, 244, 0.55);
    font-size: 11px;
    line-height: 1.2;
}

.ip-image-style-option input:checked + span {
    color: #3f4b48;
    border-color: #53635f;
    background: #edf4f1;
    box-shadow: inset 0 0 0 2px #657873;
}

.ip-image-style-option input:focus-visible + span {
    outline: 3px solid rgba(101, 120, 115, 0.32);
    outline-offset: 2px;
}

.ip-image-idea-generate,
.ip-image-idea-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 40px;
    margin-top: 13px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.ip-image-idea-generate {
    color: #fff;
    border: 1px solid #53635f;
    background: linear-gradient(145deg, #71847f, #53635f);
    box-shadow: 0 5px 12px rgba(57, 72, 68, 0.24);
}

.ip-image-idea-generate:disabled {
    cursor: wait;
    opacity: 0.68;
}

.ip-image-idea-remove {
    color: #7a433d;
    border: 1px solid rgba(133, 71, 62, 0.38);
    background: rgba(255, 245, 242, 0.72);
}

.ip-image-idea-status {
    min-height: 18px;
    margin-top: 9px;
    color: #5b5148;
    font-size: 11px;
    line-height: 1.35;
}

.ip-image-idea-status.is-error {
    color: #9a3e35;
}

.ip-template-import {
    padding: 13px 14px;
    border-bottom: 1px solid rgba(120, 96, 72, 0.28);
    background: rgba(246, 250, 248, 0.48);
}

.ip-template-import > strong {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4d4136;
    font-size: 13px;
}

.ip-template-import > p {
    margin: 5px 0 10px;
    color: #6a5c50;
    font-size: 11px;
    line-height: 1.4;
}

.ip-template-import-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 40px;
    margin: 0;
    padding: 8px 11px;
    color: #fff;
    border: 1px solid #53635f;
    border-radius: 9px;
    background: linear-gradient(145deg, #71847f, #53635f);
    box-shadow: 0 4px 10px rgba(54, 71, 66, 0.2);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.ip-template-import-button:hover,
.ip-template-import-button:focus-within {
    background: #536762;
    outline: 2px solid rgba(83, 103, 98, 0.45);
    outline-offset: 2px;
}

.ip-gallery-template-picker {
    margin-top: 10px;
    padding: 8px;
    border: 1px solid rgba(112, 89, 69, 0.32);
    border-radius: 10px;
    background: rgba(255, 252, 248, 0.94);
}

.ip-gallery-template-picker[hidden] {
    display: none;
}

.ip-gallery-template-picker-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    color: #4d4136;
    font-size: 12px;
}

.ip-gallery-template-picker-heading button {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: #5f5146;
    border: 1px solid rgba(112, 89, 69, 0.3);
    border-radius: 7px;
    background: #fffaf5;
}

.ip-gallery-template-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    max-height: 270px;
    overflow-y: auto;
    color: #6a5c50;
    font-size: 11px;
}

.ip-gallery-template-item {
    min-width: 0;
    padding: 4px;
    color: #5b4e43;
    border: 1px solid rgba(112, 89, 69, 0.28);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.ip-gallery-template-item:hover,
.ip-gallery-template-item:focus-visible {
    border-color: #657873;
    outline: 2px solid rgba(101, 120, 115, 0.36);
    outline-offset: 1px;
}

.ip-gallery-template-item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 5px;
    background: #eee9e2;
}

.ip-gallery-template-item span {
    display: block;
    padding: 4px 2px 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
}

.ip-photo-idea-section {
    margin-top: 13px;
    padding-top: 13px;
    border-top: 1px solid rgba(120, 96, 72, 0.28);
}

.ip-photo-idea-section[hidden] {
    display: none;
}

.ip-photo-idea-section > strong {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4d4136;
    font-size: 13px;
}

.ip-photo-idea-section > p {
    margin: 5px 0 10px;
    color: #6a5c50;
    font-size: 11px;
    line-height: 1.35;
}

.ip-photo-style-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.ip-photo-style-grid label {
    cursor: pointer;
}

.ip-photo-style-grid input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ip-photo-style-grid label > span {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 39px;
    padding: 7px 8px;
    color: #615348;
    border: 1px solid rgba(120, 96, 72, 0.34);
    border-radius: 9px;
    background: rgba(255, 251, 246, 0.72);
    font-size: 11px;
    font-weight: 700;
}

.ip-photo-style-grid input:checked + span {
    color: #3f514c;
    border-color: #657873;
    background: #edf4f1;
    box-shadow: inset 0 0 0 2px rgba(101, 120, 115, 0.52);
}

.ip-photo-style-grid input:focus-visible + span {
    outline: 2px solid rgba(101, 120, 115, 0.58);
    outline-offset: 1px;
}

.ip-photo-idea-generate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 42px;
    margin-top: 9px;
    padding: 8px 10px;
    color: #fff;
    border: 0;
    border-radius: 9px;
    background: #657873;
    box-shadow: 0 4px 10px rgba(54, 71, 66, 0.2);
    font-size: 12px;
    font-weight: 700;
}

.ip-photo-idea-generate:hover,
.ip-photo-idea-generate:focus-visible {
    background: #536762;
    outline: 2px solid rgba(83, 103, 98, 0.45);
    outline-offset: 2px;
}

.ip-photo-idea-generate:disabled {
    cursor: wait;
    opacity: 0.62;
}

.ip-image-layer-controls {
    padding-top: 12px;
    border-top: 1px solid rgba(120, 96, 72, 0.28);
}

.ip-image-stage-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 700;
}

.ip-image-stage-heading output {
    color: #53635f;
}

.ip-image-stage-title {
    display: block;
    color: #4d4136;
    font-size: 13px;
}

.ip-image-stage-instruction {
    min-height: 34px;
    margin: 4px 0 9px;
    color: #6a5c50;
    font-size: 11px;
    line-height: 1.35;
}

.ip-image-stage-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.ip-image-stage-transfer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 40px;
    margin: 9px 0 2px;
    padding: 8px 10px;
    color: #3f514c;
    border: 1px solid rgba(83, 105, 98, 0.52);
    border-radius: 9px;
    background: rgba(225, 239, 233, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    font-size: 11px;
    font-weight: 700;
}

.ip-image-stage-transfer:hover,
.ip-image-stage-transfer:focus-visible {
    color: #2f403b;
    background: #edf7f3;
    outline: 2px solid rgba(101, 120, 115, 0.45);
    outline-offset: 1px;
}

.ip-image-stage-transfer:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.ip-image-layer-controls.is-direct-template .ip-image-stage-heading,
.ip-image-layer-controls.is-direct-template .ip-image-stage-title,
.ip-image-layer-controls.is-direct-template .ip-image-stage-instruction,
.ip-image-layer-controls.is-direct-template .ip-image-stage-navigation,
.ip-image-layer-controls.is-direct-template .ip-image-stage-transfer {
    display: none;
}

.ip-image-stage-navigation button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 34px;
    color: #4d514d;
    border: 1px solid rgba(83, 99, 95, 0.38);
    border-radius: 9px;
    background: rgba(237, 244, 241, 0.78);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.ip-image-stage-navigation button:disabled {
    cursor: default;
    opacity: 0.42;
}

.ip-image-layer-controls[hidden] {
    display: none;
}

.ip-image-layer-visibility {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.ip-image-layer-visibility input {
    width: 18px;
    height: 18px;
    accent-color: #657873;
}

#imageIdeaOpacity {
    width: 100%;
    accent-color: #657873;
}

.ip-painting-review {
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid rgba(120, 96, 72, 0.28);
}

.ip-painting-review > strong {
    display: block;
    font-size: 13px;
}

.ip-painting-review > p {
    margin: 4px 0 10px;
    color: #6a5c50;
    font-size: 11px;
    line-height: 1.35;
}

.ip-painting-review-actions,
.ip-painting-improvement-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.ip-painting-review button {
    min-height: 38px;
    padding: 7px 8px;
    color: #44524e;
    border: 1px solid rgba(83, 99, 95, 0.42);
    border-radius: 9px;
    background: rgba(237, 244, 241, 0.84);
    font-size: 11px;
    font-weight: 700;
}

.ip-painting-review button:disabled {
    cursor: wait;
    opacity: 0.58;
}

.ip-painting-review > label,
.ip-painting-improvement-controls > label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 10px 0 5px;
    font-size: 11px;
    font-weight: 700;
}

#paintingImproveStrength,
#paintingImprovementOpacity {
    width: 100%;
}

#paintingImproveStrength {
    min-height: 34px;
    padding: 5px 8px;
    color: #493e34;
    border: 1px solid rgba(112, 89, 69, 0.42);
    border-radius: 8px;
    background: rgba(255, 252, 248, 0.88);
    font-size: 11px;
}

.ip-painting-review-status {
    min-height: 16px;
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.35;
}

.ip-painting-review-status.is-error {
    color: #9a3e35;
}

.ip-painting-tips-result {
    margin-top: 9px;
    padding: 9px;
    border-radius: 9px;
    background: rgba(255, 252, 248, 0.64);
    font-size: 11px;
    line-height: 1.4;
}

.ip-painting-tips-result ul {
    margin: 7px 0 0;
    padding-left: 18px;
}

.ip-painting-tips-result li + li {
    margin-top: 7px;
}

.ip-painting-improvement-controls {
    margin-top: 10px;
    padding: 9px;
    border: 1px solid rgba(83, 99, 95, 0.28);
    border-radius: 10px;
    background: rgba(237, 244, 241, 0.58);
}

.ip-painting-improvement-controls[hidden],
.ip-painting-tips-result[hidden] {
    display: none;
}

.ip-ai-improvement-canvas {
    position: absolute;
    z-index: 4;
    top: 0;
    left: 0;
    pointer-events: none;
    border-radius: 5px;
}

@media (max-width: 640px) {
    .ip-image-idea-drawer {
        top: 12px;
        left: 12px;
        width: min(310px, calc(100vw - 70px));
    }

    .ip-image-idea-drawer.is-collapsed {
        transform: translateX(calc(-100% - 12px));
    }

    .ip-image-idea-panel {
        max-height: calc(100vh - 24px);
    }
}

.ip-substrate-dialog {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(62, 48, 36, 0.48);
    backdrop-filter: blur(7px);
}

.ip-substrate-dialog.is-hidden {
    display: none;
}

.ip-substrate-dialog-card {
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 24px;
    border: 1px solid rgba(120, 96, 72, 0.58);
    border-radius: 22px;
    background: rgba(231, 215, 198, 0.98);
    box-shadow: 0 28px 70px rgba(45, 31, 20, 0.35);
}

.ip-substrate-dialog-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    color: #594735;
}

.ip-substrate-dialog-heading > .bi {
    font-size: 32px;
}

.ip-substrate-dialog-heading h1 {
    margin: 0 0 3px;
    font-family: ArvoRegular, Georgia, serif;
    font-size: clamp(22px, 3vw, 30px);
}

.ip-substrate-dialog-heading p {
    margin: 0;
    color: #75614e;
}

.ip-substrate-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.ip-substrate-option {
    display: grid;
    gap: 9px;
    padding: 9px;
    color: #5f4d3c;
    border: 1px solid rgba(120, 96, 72, 0.42);
    border-radius: 14px;
    background: rgba(250, 242, 233, 0.72);
    box-shadow: 0 5px 12px rgba(80, 59, 40, 0.13);
    font-family: ArvoRegular, Georgia, serif;
    font-size: 15px;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.ip-substrate-option:hover,
.ip-substrate-option:focus-visible {
    border-color: #705945;
    outline: none;
    box-shadow: 0 9px 20px rgba(80, 59, 40, 0.22);
    transform: translateY(-2px);
}

.ip-substrate-preview {
    display: block;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(85, 65, 48, 0.3);
    border-radius: 9px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: inset 0 0 12px rgba(50, 35, 22, 0.1);
}

.substrate-watercolor-smooth {
    background-image: url('../bilder/untergruende/aquarell-glatt-ultraweit.png');
}

.substrate-watercolor-medium {
    background-image: url('../bilder/untergruende/aquarell-mittel-ultraweit.png');
}

.substrate-watercolor-rough {
    background-image: url('../bilder/untergruende/aquarell-rau-ultraweit.png');
}

.substrate-canvas-fine {
    background-image: url('../bilder/untergruende/leinwand-fein-ultraweit.png');
}

.substrate-canvas-medium {
    background-image: url('../bilder/untergruende/leinwand-mittel-ultraweit.png');
}

.substrate-canvas-coarse {
    background-image: url('../bilder/untergruende/leinwand-grob-ultraweit.png');
}

.substrate-drawing-pastel {
    background-image: url('../bilder/untergruende/zeichenpapier-pastell-ultraweit.png');
}

.substrate-drawing-ink {
    background-image: url('../bilder/untergruende/zeichenpapier-tusche-ultraweit.png');
}

.substrate-drawing-marker {
    background-image: url('../bilder/untergruende/zeichenpapier-filzstift-ultraweit.png');
}

.ip-palette-drawer {
    position: fixed;
    z-index: 20;
    top: 24px;
    right: 0;
    width: 286px;
    transform: translateX(0);
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.ip-palette-drawer.is-collapsed {
    transform: translateX(100%);
}

.ip-palette-drawer .palette.ip-public-palette {
    position: relative !important;
    z-index: 1;
    top: auto !important;
    left: auto !important;
    width: 286px;
    max-height: calc(100vh - 48px);
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(120, 96, 72, 0.58);
    border-radius: 18px;
    background: rgba(218, 197, 176, 0.96);
    box-shadow:
        0 18px 40px rgba(67, 49, 33, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(8px);
}

.ip-palette-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 14px;
    color: #5f4d3c;
    border-bottom: 1px solid rgba(120, 96, 72, 0.35);
    background: linear-gradient(135deg, rgba(255, 250, 244, 0.52), rgba(151, 128, 101, 0.2));
    font-family: ArvoRegular, Georgia, serif;
    font-size: 16px;
    letter-spacing: 0.02em;
    user-select: none;
}

.ip-palette-header .bi {
    font-size: 18px;
}

.ip-substrate-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: calc(100% - 24px);
    margin: 10px 12px 0;
    padding: 7px 10px;
    color: #66513d;
    border: 1px solid rgba(120, 96, 72, 0.38);
    border-radius: 9px;
    background: rgba(255, 248, 240, 0.46);
    font-size: 12px;
    cursor: pointer;
}

.ip-substrate-summary:hover,
.ip-substrate-summary:focus-visible {
    background: rgba(255, 250, 245, 0.82);
    outline: 2px solid rgba(112, 89, 69, 0.4);
}

.ip-palette-edge-toggle {
    position: absolute;
    z-index: 2;
    top: 18px;
    left: -46px;
    display: grid;
    place-items: center;
    width: 46px;
    height: 64px;
    padding: 0;
    color: #fffaf5;
    border: 1px solid rgba(91, 69, 50, 0.62);
    border-right: 0;
    border-radius: 14px 0 0 14px;
    background: linear-gradient(160deg, #806a55, #5f4d3c);
    box-shadow: -7px 8px 18px rgba(62, 44, 29, 0.22);
    font-size: 20px;
    cursor: pointer;
    transition: filter 150ms ease, width 150ms ease;
}

.ip-palette-edge-toggle:hover,
.ip-palette-edge-toggle:focus-visible {
    width: 50px;
    filter: brightness(1.1);
    outline: 3px solid rgba(255, 248, 240, 0.68);
    outline-offset: -4px;
}

.ip-active-tool-mini {
    position: absolute;
    top: 50%;
    right: 54px;
    max-width: 150px;
    padding: 5px 10px 6px;
    overflow: hidden;
    color: #4e4943;
    border: 1px solid rgba(91, 82, 72, 0.34);
    border-radius: 999px;
    background: rgba(245, 244, 240, 0.94);
    box-shadow: 0 4px 12px rgba(50, 45, 40, 0.2);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translateY(-50%);
}

.ip-public-palette .ip-public-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: auto;
    padding: 12px;
}

.ip-public-buttons > .ip-control-offset-xs,
.ip-public-buttons > .ip-control-offset-sm {
    float: none;
    margin: 0;
}

.ip-public-buttons > .col-12 {
    grid-column: 1 / -1;
    width: auto;
    margin-top: 6px;
    padding: 0 4px;
}

.ip-public-palette .ip-tool-button {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 7px;
    color: #66513d;
    border: 1px solid rgba(120, 96, 72, 0.42) !important;
    border-radius: 11px;
    background-color: rgba(250, 242, 233, 0.82);
    box-shadow:
        0 3px 7px rgba(80, 59, 40, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.78);
    font-size: 18px;
    transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.ip-public-palette .ip-tool-button:hover,
.ip-public-palette .ip-tool-button:focus-visible {
    color: #49392b;
    border-color: rgba(105, 81, 59, 0.64) !important;
    background-color: #fff8f0;
    box-shadow:
        0 5px 12px rgba(80, 59, 40, 0.22),
        inset 0 1px 0 #fff;
    transform: translateY(-1px);
}

.ip-public-palette .ip-tool-button:active {
    box-shadow: inset 0 2px 5px rgba(80, 59, 40, 0.24);
    transform: translateY(1px);
}

.ip-ink-nib-icon {
    width: 23px;
    height: 23px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.65;
}

.ip-sponge-icon {
    width: 25px;
    height: 25px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
}

.ip-felt-tip-icon {
    width: 24px;
    height: 24px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.65;
}

.ip-public-palette .ip-tool-button.acryl {
    background-image: none !important;
}

.ip-acrylic-brush-icon {
    width: 25px;
    height: 25px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.55;
}

.ip-public-palette .ip-tool-button.is-active,
.ip-public-palette .ip-tool-button.is-active:hover,
.ip-public-palette .ip-tool-button.is-active:focus-visible {
    color: #3f4b48;
    border-color: #53635f !important;
    background-color: #edf4f1;
    box-shadow:
        inset 0 0 0 3px #657873,
        0 5px 13px rgba(57, 72, 68, 0.28);
    transform: translateY(-1px);
}

.ip-public-buttons > .ip-history-control {
    grid-column: span 2;
}

.ip-settings-toggle-row,
.ip-color-measure-row,
.ip-settings-panel {
    grid-column: 1 / -1;
}

.ip-color-measure-switch {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    margin: 0;
    padding: 6px 10px 6px 42px;
    border: 1px solid rgba(120, 96, 72, 0.36);
    border-radius: 11px;
    background: rgba(246, 237, 228, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.ip-color-measure-switch .form-check-input {
    width: 34px;
    height: 18px;
    margin-top: 0;
    margin-left: -32px;
    border-color: rgba(103, 85, 69, 0.55);
    cursor: pointer;
}

.ip-color-measure-switch .form-check-input:checked {
    border-color: #657873;
    background-color: #657873;
}

.ip-color-measure-switch .form-check-input:focus {
    border-color: #657873;
    box-shadow: 0 0 0 3px rgba(101, 120, 115, 0.22);
}

.ip-color-measure-switch .form-check-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    width: 100%;
    color: #5f4b39;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.ip-color-measure-switch small {
    color: #897664;
    font-size: 10px;
    font-weight: 600;
}

.ip-settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 9px 11px;
    color: #5f4b39;
    border: 1px solid rgba(120, 96, 72, 0.36);
    border-radius: 11px;
    background: rgba(246, 237, 228, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.ip-settings-toggle:hover,
.ip-settings-toggle:focus-visible {
    color: #42352a;
    background: rgba(255, 248, 240, 0.9);
    outline: 2px solid rgba(101, 120, 115, 0.48);
    outline-offset: 1px;
}

.ip-settings-panel {
    display: grid;
    gap: 10px;
    padding: 2px 0 0;
}

.ip-settings-panel[hidden] {
    display: none;
}

.ip-settings-panel > .col-12 {
    width: auto;
    margin: 0;
    padding: 0 4px;
}

.ip-rotary-control {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 4px 3px 2px;
}

.ip-rotary-knob {
    --ink-nib-angle: 315deg;
    position: relative;
    flex: 0 0 70px;
    width: 70px;
    height: 70px;
    padding: 0;
    border: 1px solid rgba(91, 75, 61, 0.62);
    border-radius: 50%;
    background:
        radial-gradient(circle at 38% 32%, #fff8ef 0 7%, transparent 8%),
        radial-gradient(circle, #d9c3ac 0 48%, #b99f85 70%, #8c725a 100%);
    box-shadow:
        inset 0 2px 3px rgba(255, 255, 255, 0.65),
        inset 0 -5px 8px rgba(75, 55, 38, 0.22),
        0 4px 9px rgba(67, 49, 34, 0.22);
    cursor: grab;
    touch-action: none;
}

.ip-rotary-knob:active {
    cursor: grabbing;
}

.ip-rotary-knob:focus-visible {
    outline: 3px solid rgba(101, 120, 115, 0.7);
    outline-offset: 2px;
}

.ip-rotary-indicator {
    position: absolute;
    top: calc(50% - 2px);
    left: 50%;
    width: 27px;
    height: 4px;
    border-radius: 1px 4px 4px 1px;
    background: #514235;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: rotate(var(--ink-nib-angle));
    transform-origin: 0 50%;
}

.ip-rotary-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border: 1px solid rgba(65, 49, 36, 0.48);
    border-radius: 50%;
    background: #c5aa8f;
    transform: translate(-50%, -50%);
}

.ip-rotary-help {
    max-width: 130px;
    color: #6c5a49;
    font-size: 11px;
    line-height: 1.35;
}

.ip-public-palette .ip-history-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
}

.ip-public-palette .ip-history-button:disabled {
    color: rgba(102, 81, 61, 0.48);
    background-color: rgba(235, 224, 213, 0.62);
    box-shadow: inset 0 1px 3px rgba(80, 59, 40, 0.12);
    opacity: 1;
    transform: none;
}

.ip-public-palette .ip-tool-button.paintbrush,
.ip-public-palette .ip-tool-button.spray,
.ip-public-palette .ip-tool-button.scribble,
.ip-public-palette .ip-tool-button.wachs,
.ip-public-palette .ip-tool-button.acryl,
.ip-public-palette .ip-tool-button.kreuzstrich,
.ip-public-palette .ip-tool-button.strich,
.ip-public-palette .ip-tool-button.quadrat,
.ip-public-palette .ip-tool-button.kreisico,
.ip-public-palette .ip-tool-button.pipette {
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.ip-public-palette .ip-color-swatch {
    width: 100%;
    height: 44px;
    border: 2px solid rgba(120, 96, 72, 0.6);
    border-radius: 11px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.ip-public-palette .ip-slider-horizontal {
    width: 100%;
}

.ip-slider-scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 7px;
    color: #847465;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.ip-public-palette .noUi-target,
.ip-ellipse-panel .noUi-target {
    border: 0;
    border-radius: 999px;
    background: #b9b4ad;
    box-shadow:
        inset 0 1px 3px rgba(57, 52, 47, 0.28),
        0 1px 0 rgba(255, 255, 255, 0.64);
}

.ip-public-palette .noUi-horizontal,
.ip-ellipse-panel .noUi-horizontal {
    height: 7px;
}

.ip-public-palette .noUi-connect,
.ip-ellipse-panel .noUi-connect {
    background: linear-gradient(90deg, #7f7770, #555f5d);
}

.ip-public-palette .noUi-horizontal .noUi-handle,
.ip-ellipse-panel .noUi-horizontal .noUi-handle,
.ip-public-palette .noUi-vertical .noUi-handle {
    width: 22px !important;
    height: 22px !important;
    border: 3px solid #f8f7f4;
    border-radius: 50%;
    background: #68635d;
    box-shadow:
        0 3px 9px rgba(42, 38, 34, 0.3),
        inset 0 0 0 1px rgba(0, 0, 0, 0.08);
    cursor: grab;
    opacity: 1;
    transition: box-shadow 120ms ease, transform 120ms ease;
}

.ip-public-palette .noUi-horizontal .noUi-handle,
.ip-ellipse-panel .noUi-horizontal .noUi-handle {
    top: -8px;
    right: -11px;
}

.ip-public-palette .noUi-vertical .noUi-handle {
    top: -11px;
    left: -8px;
}

.ip-public-palette .noUi-handle::before,
.ip-public-palette .noUi-handle::after,
.ip-ellipse-panel .noUi-handle::before,
.ip-ellipse-panel .noUi-handle::after {
    display: none;
}

.ip-public-palette .noUi-handle:hover,
.ip-public-palette .noUi-active,
.ip-ellipse-panel .noUi-handle:hover,
.ip-ellipse-panel .noUi-active {
    box-shadow: 0 4px 13px rgba(42, 38, 34, 0.42);
    transform: scale(1.08);
    cursor: grabbing;
}

.ip-public-palette .noUi-tooltip,
.ip-ellipse-panel .noUi-tooltip {
    display: none;
}

.ip-public-palette .ip-control-label {
    display: block;
    margin-top: 7px;
    color: #66513d;
    font-size: 12px;
    font-weight: 600;
}

.ip-control-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
    color: #625d56;
    font-size: 11px;
    font-weight: 650;
}

.ip-control-heading output {
    min-width: 38px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(92, 87, 81, 0.12);
    color: #57534e;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.ip-public-palette #colorpicker {
    display: flex;
    align-items: flex-start;
    height: 172px;
    width: 100%;
    margin: 0;
    padding: 10px;
    border: 1px solid rgba(120, 96, 72, 0.48);
    border-radius: 12px;
    background: rgba(245, 232, 219, 0.48);
    box-shadow: inset 0 3px 9px rgba(94, 70, 47, 0.13);
}

.ip-public-palette #red,
.ip-public-palette #green,
.ip-public-palette #blue {
    flex: 0 0 7px;
    height: 140px;
    margin: 8px 10px;
}

.ip-public-palette #red .noUi-connect {
    background: linear-gradient(#e56a61, #a83d36);
}

.ip-public-palette #green .noUi-connect {
    background: linear-gradient(#64b77d, #397b4d);
}

.ip-public-palette #blue .noUi-connect {
    background: linear-gradient(#63a9d8, #356f9c);
}

.ip-ellipse-panel {
    height: auto;
    padding: 12px 16px 10px;
    border: 1px solid rgba(104, 91, 78, 0.34);
    border-radius: 12px;
    background: rgba(239, 237, 232, 0.96);
    box-shadow: 0 9px 24px rgba(54, 49, 44, 0.18);
}


.ip-public-palette #result {
    flex: 0 0 60px;
    width: 60px;
    height: 140px;
    margin: 8px 7px;
}

.ip-recent-colors {
    display: grid;
    flex: 0 0 50px;
    grid-template-columns: repeat(2, 22px);
    grid-template-rows: repeat(3, 36px) 20px;
    gap: 4px;
    margin: 8px 0 8px auto;
}

.ip-recent-color {
    width: 22px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(83, 68, 55, 0.58);
    border-radius: 7px;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.42),
        0 2px 5px rgba(70, 53, 39, 0.16);
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.ip-recent-color:not(:disabled):hover,
.ip-recent-color:not(:disabled):focus-visible {
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.72),
        0 3px 8px rgba(55, 42, 32, 0.28);
    outline: 2px solid #657873;
    outline-offset: 1px;
    transform: translateY(-1px);
}

.ip-recent-color:disabled {
    border-style: dashed;
    border-color: rgba(103, 85, 69, 0.28);
    background: rgba(255, 255, 255, 0.18) !important;
    box-shadow: none;
    cursor: default;
}

.ip-clear-recent-colors {
    grid-column: 1 / -1;
    width: 48px;
    height: 20px;
    padding: 0;
    border: 1px solid rgba(103, 85, 69, 0.38);
    border-radius: 6px;
    color: #675649;
    background: rgba(255, 255, 255, 0.34);
    font-size: 11px;
    line-height: 18px;
    cursor: pointer;
    transition: color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.ip-clear-recent-colors:not(:disabled):hover,
.ip-clear-recent-colors:not(:disabled):focus-visible {
    color: #8e332d;
    background: rgba(255, 255, 255, 0.68);
    box-shadow: 0 2px 5px rgba(70, 53, 39, 0.2);
    outline: 2px solid #657873;
    outline-offset: 1px;
}

.ip-clear-recent-colors:disabled {
    opacity: 0.35;
    cursor: default;
}

@media(max-width:400px){
  .palette {
   position:absolute;
   left:50%;
   top:10px;
   z-index:10;

  }
  .palbutt {
   position:absolute;
   left:50%;
   bottom:25px;
   z-index:10;
   width:250px;
  }
	.abstand{
	margin-top:0px;
	}
    .corpus {
        margin-left:0%;
        margin-right:0%;
        width:100%;
        height:1000px;
        background:#DAC5B0;
    }
    .paint {
        font-family: 'Finger Paint', cursive;
        font-size:32px;
        padding:5px;
    }
	.logohoehe{
        position:absolute;
        top:2%;
        left:2%;
        width:15%;
        z-index:10;
	}    
}

@media(min-width:400px){
  .palette {
   position:absolute;
   left:50%;
   top:10px;
   z-index:10;

  }
  .palbutt {
   position:absolute;
   left:50%;
   bottom:25px;
   z-index:10;
   width:250px;
  }
    .corpus {
        margin-left:0%;
        margin-right:0%;
        width:100%;
        height:1000px;
        background:#DAC5B0;
    }
    .paint {
        font-family: 'Finger Paint', cursive;
        font-size:32px;
        padding:5px;
    }
	.logohoehe{
        position:absolute;
        top:2%;
        left:2%;
        width:15%;
        z-index:10;
	}    
}


@media(min-width:640px){
  .palette {
   position:absolute;
   left:60%;
   top:10px;
   z-index:10;

  }
  .palbutt {
   position:absolute;
   left:60%;
   bottom:25px;
   z-index:10;
   width:250px;
  }
	.abstand{
	margin-top:0px;
	}
    .corpus {
        margin-left:14%;
        margin-right:14%;
        width:72%;
        height:1000px;
        background:#DAC5B0;
    }
    .paint {
        font-family: 'Finger Paint', cursive;
        font-size:48px;
        padding:10px;
    }
	.logohoehe{
        position:absolute;
        top:2%;
        left:2%;
        width:12%;
        z-index:10;
	}    
}
@media(min-width:768px){
  .palette {
   position:absolute;
   left:65%;
   top:10%;
   z-index:10;

  }
  .palbutt {
   position:absolute;
   left:70%;
   bottom:25px;
   z-index:10;
   width:250px;
  }
	.abstand{
	margin-top:0px;
	}
    .corpus {
        margin-left:15%;
        margin-right:15%;
        width:70%;
        height:1000px;
        background:#DAC5B0;
    }
    .paint {
        font-family: 'Finger Paint', cursive;
        font-size:56px;
        padding:10px;
    }
	.logohoehe{
        position:absolute;
        top:2%;
        left:2%;
        width:10%;
        z-index:10;
	}    
}
@media(min-width:992px){
  .palette {
   position:absolute;
   left:75%;
   top:15%;
   z-index:10;

  }
  .palbutt {
   position:absolute;
   left:75%;
   bottom:25px;
   z-index:10;
   width:250px;
  }
	.abstand{
	margin-top:0px;
	}

    .paint {
        font-family: 'Finger Paint', cursive;
        font-size:72px;
        padding:20px;
    }
    .corpus {
        margin-left:15%;
        margin-right:15%;
        width:70%;
        height:1000px;
        background:#DAC5B0;
    }
	.logohoehe{
        position:absolute;
        top:2%;
        left:2%;
        width:8%;
        z-index:10;
	}    
}
@media(min-width:1424px){
  .palette {
   position:absolute;
   left:80%;
   top:20%;
   z-index:10;
   width:250px;
  }
  .palbutt {
   position:absolute;
   left:80%;
   bottom:25px;
   z-index:10;
   width:250px;
  }
	.abstand{
	margin-top:0px;
	}

    .paint {
        font-family: 'Finger Paint', cursive;
        font-size:84px;
        padding:20px;
    }
    .corpus {
        margin-left:15%;
        margin-right:15%;
        width:70%;
        height:1000px;
        background:#DAC5B0;
    }
	.logohoehe{
        position:absolute;
        top:2%;
        left:2%;
        width:8%;
        z-index:10;
	}
}

@media (max-width: 400px) {
    .ip-palette-drawer,
    .ip-palette-drawer .palette.ip-public-palette {
        width: min(286px, calc(100vw - 46px));
    }

    .ip-substrate-dialog {
        padding: 12px;
    }

    .ip-substrate-dialog-card {
        padding: 16px;
    }

    .ip-substrate-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}




