/* r388: ImageMagick-filtertab gebruikt het bestaande canvas; geen dubbele preview rechts. */

#bioEdit .profile-bio-picture-edit-panel[data-picture-edit-panel="filter"]:not([hidden]) {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #f2f2f2 !important;
}

#bioEdit .profile-bio-picture-filter-layout {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    overflow: visible !important;
    background: #f2f2f2 !important;
}

#bioEdit .profile-bio-picture-filter-controls {
    box-sizing: border-box !important;
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    flex-direction: column !important;
    align-items: stretch !important;
    overflow: visible !important;
    background: transparent !important;
}

#bioEdit .profile-bio-picture-filter-card {
    box-sizing: border-box !important;
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 18px !important;
    flex: 0 0 auto !important;
    flex-direction: column !important;
    gap: 14px !important;
    overflow: visible !important;
    background: #fff !important;
    border: 0 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}

#bioEdit .profile-bio-picture-filter-card > .notification {
    margin: 0 !important;
}

#bioEdit .profile-bio-picture-filter-adjust {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
}

#bioEdit .profile-bio-picture-filter-adjust > summary {
    box-sizing: border-box !important;
    display: flex !important;
    width: 100% !important;
    min-height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center !important;
    gap: 9px !important;
    color: #222 !important;
    font: 700 14px/1.3 "Segoe UI", Tahoma, sans-serif !important;
    cursor: pointer !important;
    list-style: none !important;
}

#bioEdit .profile-bio-picture-filter-adjust > summary::-webkit-details-marker {
    display: none !important;
}

#bioEdit .profile-bio-picture-filter-adjust > summary::after {
    display: block !important;
    min-width: 20px !important;
    height: 1px !important;
    margin-left: 3px !important;
    flex: 1 1 auto !important;
    order: 2 !important;
    content: "" !important;
    background: #d1d1d1 !important;
}

#bioEdit .profile-bio-picture-filter-adjust > summary::before {
    box-sizing: border-box !important;
    display: block !important;
    width: 8px !important;
    height: 8px !important;
    margin: 0 3px 0 5px !important;
    flex: 0 0 8px !important;
    order: 3 !important;
    content: "" !important;
    border-right: 2px solid #555 !important;
    border-bottom: 2px solid #555 !important;
    transform: rotate(45deg) translate(-1px, -1px) !important;
    transform-origin: center !important;
    transition: transform .16s ease !important;
}

#bioEdit .profile-bio-picture-filter-adjust[open] > summary::before {
    transform: rotate(225deg) translate(-1px, -1px) !important;
}

#bioEdit .profile-bio-picture-filter-adjust .profile-bio-picture-collapsible-content {
    display: block !important;
    width: 100% !important;
    padding: 12px 0 0 !important;
}

#bioEdit .profile-bio-picture-filter-adjust:not([open]) > .profile-bio-picture-collapsible-content {
    display: none !important;
}

#bioEdit .profile-bio-picture-filter-strength {
    display: grid !important;
    width: 100% !important;
    gap: 6px !important;
}

#bioEdit .profile-bio-picture-filter-strength > span {
    display: flex !important;
    justify-content: space-between !important;
    gap: 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

#bioEdit .profile-bio-picture-filter-strength output {
    color: #235f96 !important;
}

#bioEdit .profile-bio-picture-filter-strength input[type="range"] {
    width: 100% !important;
    margin: 0 !important;
}

#bioEdit .profile-bio-picture-filter-reset {
    width: auto !important;
    min-width: 138px !important;
    max-width: 100% !important;
    margin: 12px 0 0 !important;
    flex: 0 0 auto !important;
}

#bioEdit .profile-bio-picture-filter-sheets {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    flex-direction: column !important;
}

#bioEdit .profile-bio-picture-filter-sheet-tabs {
    display: flex !important;
    width: 100% !important;
    min-height: 31px !important;
    align-items: flex-end !important;
    overflow: visible !important;
}

#bioEdit .profile-bio-picture-filter-sheet-tabs > button {
    position: relative !important;
    display: none !important;
    min-width: 112px !important;
    min-height: 31px !important;
    margin: 0 -1px -1px 0 !important;
    padding: 6px 14px 7px !important;
    align-items: center !important;
    justify-content: center !important;
    color: #111 !important;
    font: 13px/1.2 "Segoe UI", Tahoma, sans-serif !important;
    white-space: nowrap !important;
    background: linear-gradient(#fafafa, #e6e6e6 48%, #d7d7d7) !important;
    border: 1px solid #8b8b8b !important;
    border-radius: 4px 4px 0 0 !important;
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .95) !important;
}

#bioEdit .profile-bio-picture-filter-sheet-tabs > button.is-active {
    z-index: 2 !important;
    display: inline-flex !important;
    background: #f0f0f0 !important;
    border-bottom-color: #f0f0f0 !important;
}

#bioEdit .profile-bio-picture-filter-category-select {
    position: relative !important;
    z-index: 1 !important;
    display: inline-flex !important;
    width: 43px !important;
    min-width: 43px !important;
    height: 31px !important;
    margin: 0 0 -1px !important;
    align-items: center !important;
    justify-content: center !important;
    color: #222 !important;
    background: linear-gradient(#fafafa, #e6e6e6, #d7d7d7) !important;
    border: 1px solid #8b8b8b !important;
    border-radius: 4px 4px 0 0 !important;
}

#bioEdit .profile-bio-picture-filter-category-select svg {
    width: 19px !important;
    height: 19px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.65 !important;
    pointer-events: none !important;
}

#bioEdit .profile-bio-picture-filter-category-select select {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    cursor: pointer !important;
}

#bioEdit .profile-bio-picture-filter-sheet-panels {
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 250px !important;
    padding: 10px !important;
    background: #f0f0f0 !important;
    border: 1px solid #8b8b8b !important;
    border-radius: 0 7px 7px 7px !important;
}

#bioEdit .profile-bio-picture-filter-sheet-panels > section[hidden] {
    display: none !important;
}

#bioEdit .profile-bio-picture-filter-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 8px !important;
}

#bioEdit .profile-bio-picture-filter-option {
    box-sizing: border-box !important;
    display: grid !important;
    min-width: 0 !important;
    min-height: 62px !important;
    padding: 8px !important;
    place-items: center !important;
    color: #222 !important;
    font: 700 13px/1.25 "Segoe UI", Tahoma, sans-serif !important;
    text-align: center !important;
    cursor: pointer !important;
    background: #fff !important;
    border: 1px solid #aaa !important;
    border-radius: 0 !important;
    box-shadow: inset 1px 1px 0 #fff !important;
}

#bioEdit .profile-bio-picture-filter-option:hover,
#bioEdit .profile-bio-picture-filter-option:focus-visible,
#bioEdit .profile-bio-picture-filter-option.is-active {
    color: #173f6d !important;
    background: #dcecff !important;
    border-color: #316ac5 !important;
    outline: 1px solid #316ac5 !important;
    outline-offset: -2px !important;
}

#bioEdit .profile-bio-picture-filter-preview {
    box-sizing: border-box !important;
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 24px !important;
    place-items: center !important;
    overflow: hidden !important;
    background-color: #e5e5e5 !important;
    background-image:
        linear-gradient(45deg, #cfcfcf 25%, transparent 25%),
        linear-gradient(-45deg, #cfcfcf 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #cfcfcf 75%),
        linear-gradient(-45deg, transparent 75%, #cfcfcf 75%) !important;
    background-size: 20px 20px !important;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0 !important;
}

#bioEdit .profile-bio-picture-filter-preview-stage {
    position: relative !important;
    display: grid !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    place-items: center !important;
    overflow: hidden !important;
}

#bioEdit .profile-bio-picture-filter-preview-stage img {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
    object-fit: contain !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

#bioEdit .profile-bio-picture-filter-preview-name {
    position: absolute !important;
    z-index: 3 !important;
    left: 0 !important;
    bottom: 0 !important;
    max-width: calc(100% - 24px) !important;
    padding: 8px 12px !important;
    color: #fff !important;
    background: rgba(0, 0, 0, .66) !important;
}

#bioEdit .profile-bio-picture-filter-preview-name strong {
    display: block !important;
    overflow: hidden !important;
    font: 700 15px/1.3 "Segoe UI", Tahoma, sans-serif !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#bioEdit .profile-bio-picture-filter-preview-name span {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
}

#bioEdit .profile-bio-picture-filter-preview-loading {
    position: absolute !important;
    inset: 0 !important;
    z-index: 5 !important;
    display: grid !important;
    padding: 24px !important;
    place-items: center !important;
    color: #244b70 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-align: center !important;
    background: rgba(255, 255, 255, .82) !important;
}

#bioEdit .profile-bio-picture-filter-preview-loading[hidden] {
    display: none !important;
}

#bioEdit .profile-bio-picture-filter-unavailable {
    display: grid !important;
    gap: 6px !important;
    color: #374151 !important;
    font-size: 15px !important;
    line-height: 1.45 !important;
}

@media (max-width: 900px) {
    #bioEdit .profile-bio-embedded-picture-editor.is-filter-tab .profile-bio-picture-edit-panels,
    #bioEdit .profile-bio-picture-edit-panel[data-picture-edit-panel="filter"]:not([hidden]) {
        overflow: auto !important;
    }

    #bioEdit .profile-bio-picture-filter-layout {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: auto minmax(330px, 52vh) !important;
        height: auto !important;
        min-height: 100% !important;
        overflow: visible !important;
    }

    #bioEdit .profile-bio-picture-filter-controls {
        height: auto !important;
        padding: 16px !important;
        overflow: visible !important;
    }

    #bioEdit .profile-bio-picture-filter-preview {
        min-height: 330px !important;
        padding: 16px !important;
    }
}

@media (max-width: 560px) {
    #bioEdit .profile-bio-picture-filter-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}


/* Het normale canvas boven de tabs blijft de enige preview. */
#bioEdit .profile-bio-embedded-picture-editor .profile-bio-picture-edit-preview {
    display: grid !important;
}

#bioEdit .profile-bio-picture-filter-layout {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
}

#bioEdit .profile-bio-picture-filter-controls {
    width: 100% !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
}

#bioEdit .profile-bio-picture-filter-preview {
    display: none !important;
}

#bioEdit .profile-bio-picture-filter-status {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

#bioEdit .profile-bio-picture-filter-card[aria-busy="true"] {
    cursor: progress !important;
}

@media (max-width: 900px) {
    #bioEdit .profile-bio-picture-filter-layout {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
    }

    #bioEdit .profile-bio-picture-filter-controls {
        padding: 0 !important;
    }
}
