.dw3d-farbmischer {
    --dw3d-border: #d8dee8;
    --dw3d-text: #152033;
    --dw3d-muted: #59677d;
    --dw3d-surface: #ffffff;
    --dw3d-soft: #f4f7fb;
    --dw3d-accent: #2563eb;
    --dw3d-accent-soft: #dbeafe;
    color: var(--dw3d-text);
    background: var(--dw3d-surface);
    border: 1px solid var(--dw3d-border);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(21, 32, 51, 0.08);
    font-family: inherit;
    max-width: 980px;
    padding: 24px;
}

.dw3d-farbmischer *,
.dw3d-farbmischer *::before,
.dw3d-farbmischer *::after {
    box-sizing: border-box;
}

.dw3d-farbmischer__head {
    margin-bottom: 18px;
}

.dw3d-farbmischer h2,
.dw3d-farbmischer h3,
.dw3d-farbmischer p {
    margin-top: 0;
}

.dw3d-farbmischer h2 {
    font-size: 1.75rem;
    line-height: 1.2;
    margin-bottom: 8px;
}

.dw3d-farbmischer h3 {
    font-size: 1rem;
    line-height: 1.35;
    margin-bottom: 12px;
}

.dw3d-farbmischer p {
    color: var(--dw3d-muted);
    line-height: 1.55;
}

.dw3d-farbmischer__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}

.dw3d-farbmischer__mode {
    appearance: none;
    background: var(--dw3d-soft);
    border: 1px solid var(--dw3d-border);
    border-radius: 8px;
    color: var(--dw3d-text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 44px;
    padding: 10px 14px;
}

.dw3d-farbmischer__mode:hover,
.dw3d-farbmischer__mode:focus-visible,
.dw3d-farbmischer__mode.is-active {
    background: var(--dw3d-accent-soft);
    border-color: var(--dw3d-accent);
    outline: none;
}

.dw3d-farbmischer__panel {
    display: none;
}

.dw3d-farbmischer__panel.is-active {
    display: block;
}

.dw3d-farbmischer__selectors {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dw3d-farbmischer__controls {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--dw3d-border);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    margin-top: 18px;
    padding: 14px 16px;
}

.dw3d-farbmischer__range {
    display: grid;
    flex: 1 1 360px;
    gap: 8px;
}

.dw3d-farbmischer__range span,
.dw3d-farbmischer__range strong {
    display: block;
    line-height: 1.25;
}

.dw3d-farbmischer__range input {
    accent-color: var(--dw3d-accent);
    width: 100%;
}

.dw3d-farbmischer__ghost {
    appearance: none;
    background: #ffffff;
    border: 1px solid var(--dw3d-border);
    border-radius: 8px;
    color: var(--dw3d-text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 42px;
    padding: 9px 12px;
}

.dw3d-farbmischer__ghost:hover,
.dw3d-farbmischer__ghost:focus-visible {
    border-color: var(--dw3d-accent);
    outline: 3px solid rgba(37, 99, 235, 0.2);
    outline-offset: 2px;
}

.dw3d-farbmischer__selector {
    background: var(--dw3d-soft);
    border: 1px solid var(--dw3d-border);
    border-radius: 8px;
    padding: 16px;
}

.dw3d-farbmischer__target-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dw3d-farbmischer__target-head h3 {
    margin-bottom: 0;
}

.dw3d-farbmischer__target-head label {
    flex: 0 1 260px;
}

.dw3d-farbmischer__target-head input {
    border: 1px solid var(--dw3d-border);
    border-radius: 8px;
    font: inherit;
    min-height: 42px;
    padding: 8px 10px;
    width: 100%;
}

.dw3d-farbmischer__target-head input:focus {
    border-color: var(--dw3d-accent);
    outline: 3px solid rgba(37, 99, 235, 0.2);
}

.dw3d-farbmischer__grid,
.dw3d-farbmischer__target-grid {
    display: grid;
    gap: 8px;
}

.dw3d-farbmischer__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dw3d-farbmischer__target-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
}

.dw3d-farbmischer__color {
    align-items: end;
    aspect-ratio: 1 / 1;
    border: 2px solid rgba(21, 32, 51, 0.16);
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    font: inherit;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    padding: 6px;
    position: relative;
    text-align: center;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
}

.dw3d-farbmischer__target-grid .dw3d-farbmischer__color {
    min-height: 70px;
}

.dw3d-farbmischer__color::after {
    background: linear-gradient(180deg, transparent 20%, rgba(0, 0, 0, 0.42) 100%);
    content: "";
    inset: 0;
    position: absolute;
}

.dw3d-farbmischer__color span {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.15;
    position: relative;
    z-index: 1;
}

.dw3d-farbmischer__color:hover,
.dw3d-farbmischer__color:focus-visible,
.dw3d-farbmischer__color.is-selected {
    border-color: #111827;
    outline: 3px solid rgba(37, 99, 235, 0.32);
    outline-offset: 2px;
}

.dw3d-farbmischer__result,
.dw3d-farbmischer__recommendation {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--dw3d-border);
    border-radius: 8px;
    display: flex;
    gap: 16px;
    margin-top: 18px;
    padding: 16px;
}

.dw3d-farbmischer__swatch {
    background: repeating-linear-gradient(45deg, #e5e7eb 0 8px, #f8fafc 8px 16px);
    border: 1px solid var(--dw3d-border);
    border-radius: 8px;
    flex: 0 0 auto;
    height: 96px;
    width: 96px;
}

.dw3d-farbmischer__pair {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.dw3d-farbmischer__pair-card {
    align-items: center;
    border: 1px solid var(--dw3d-border);
    border-radius: 8px;
    display: flex;
    gap: 10px;
    min-width: 180px;
    padding: 10px;
}

.dw3d-farbmischer__pair-swatch {
    border: 1px solid rgba(21, 32, 51, 0.18);
    border-radius: 8px;
    flex: 0 0 auto;
    height: 52px;
    width: 52px;
}

.dw3d-farbmischer__pair-card strong,
.dw3d-farbmischer__pair-card small {
    display: block;
}

.dw3d-farbmischer__pair-card small {
    color: var(--dw3d-muted);
    margin-top: 2px;
}

.dw3d-farbmischer__notice {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    color: #7c2d12;
    font-weight: 700;
    margin: 18px 0 0;
    padding: 12px 14px;
}

.dw3d-farbmischer.is-loading .dw3d-farbmischer__result,
.dw3d-farbmischer.is-loading .dw3d-farbmischer__recommendation {
    opacity: 0.72;
}

@media (max-width: 760px) {
    .dw3d-farbmischer {
        padding: 18px;
    }

    .dw3d-farbmischer__selectors {
        grid-template-columns: 1fr;
    }

    .dw3d-farbmischer__target-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .dw3d-farbmischer__target-head {
        align-items: stretch;
        flex-direction: column;
    }

    .dw3d-farbmischer__target-head label {
        flex-basis: auto;
    }

    .dw3d-farbmischer__result,
    .dw3d-farbmischer__recommendation {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .dw3d-farbmischer__grid,
    .dw3d-farbmischer__target-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .dw3d-farbmischer__color span {
        font-size: 0.64rem;
    }
}
