:root {
    --ui-icon-size: 16px;
    --ui-icon-stroke: 1.75;
    --ui-focus-width: 2px;
    --ui-focus-offset: 3px;
    --ui-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --ui-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round'%3E%3Cpath d='m6 6 12 12M6 18 18 6'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] {
    --ui-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a8a8a8' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

:root select:not([multiple]):not([size]) {
    appearance: none;
    -webkit-appearance: none;
    background-image: var(--ui-chevron);
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: var(--ui-icon-size);
    padding-right: 38px;
}

.ui-icon-arrow-up-right {
    display: inline-block;
    width: var(--ui-icon-size);
    height: var(--ui-icon-size);
    flex-shrink: 0;
    vertical-align: -0.125em;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 17 10-10M7 7h10v10'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 17 10-10M7 7h10v10'/%3E%3C/svg%3E") center / contain no-repeat;
}

:root .product-select-trigger {
    padding-right: 38px;
}

:root input[type="search"]::-webkit-search-cancel-button {
    appearance: none;
    -webkit-appearance: none;
    width: var(--ui-icon-size);
    height: var(--ui-icon-size);
    background: var(--muted);
    mask: var(--ui-close) center / contain no-repeat;
    -webkit-mask: var(--ui-close) center / contain no-repeat;
    cursor: pointer;
}

:root .product-select-trigger::after,
:root .product-option-group::before,
:root details:not(.app-user-menu) > summary::before {
    content: "";
    display: block;
    width: var(--ui-icon-size);
    height: var(--ui-icon-size);
    flex: 0 0 var(--ui-icon-size);
    border: 0;
    background: var(--muted);
    mask: var(--ui-chevron) center / contain no-repeat;
    -webkit-mask: var(--ui-chevron) center / contain no-repeat;
}

:root .product-select-trigger::after {
    top: 50%;
    transform: translateY(-50%);
}

:root .product-option-group::before {
    transform: none;
}

:root .product-option-group[aria-expanded="false"]::before,
:root details:not(.app-user-menu):not([open]) > summary::before {
    transform: rotate(-90deg);
}

:root details:not(.app-user-menu) > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
}

:root details:not(.app-user-menu) > summary::marker {
    content: "";
}

:root details:not(.app-user-menu) > summary::-webkit-details-marker {
    display: none;
}

:root .layer-substrate-toggle svg,
:root .app-user-trigger svg {
    stroke-width: var(--ui-icon-stroke);
}

:root :is(.chart-close, .dialog-close, .comparison-remove, .layer-row-delete) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    line-height: 0;
}

:root :is(.chart-close, .dialog-close, .comparison-remove) {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
}

:root :is(.chart-close, .dialog-close, .comparison-remove, .layer-row-delete)::before {
    content: "";
    width: var(--ui-icon-size);
    height: var(--ui-icon-size);
    flex: 0 0 var(--ui-icon-size);
    background: currentColor;
    mask: var(--ui-close) center / contain no-repeat;
    -webkit-mask: var(--ui-close) center / contain no-repeat;
}

:root :is(a, button, input, select, summary, textarea):focus-visible {
    outline: var(--ui-focus-width) solid var(--blue-strong);
    outline-offset: var(--ui-focus-offset);
}

:root :is(.product-option-group, .comparison-image-button, .comparison-bar-option):focus-visible {
    outline-offset: calc(-1 * var(--ui-focus-width));
}

:root :is(select, input, textarea):disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

@media (forced-colors: active) {
    :root select:not([multiple]):not([size]) {
        appearance: auto;
        -webkit-appearance: auto;
        background-image: none;
    }

    :root .product-select-trigger::after,
    :root .product-option-group::before,
    :root details:not(.app-user-menu) > summary::before,
    .ui-icon-arrow-up-right,
    :root :is(.chart-close, .dialog-close, .comparison-remove, .layer-row-delete)::before {
        background: CanvasText;
        forced-color-adjust: none;
    }
}
