:where([data-aip-product], .aip-photo-upload, .aip-personal-gallery) {
    --aip-accent: #c58e8b;
    --aip-accent-dark: #a96e6b;
    --aip-border: #d9dce4;
    --aip-muted: #737c8a;
    --aip-text: #222b35;
    --aip-focus: #965957;
}

[data-aip-product] {
    display: grid;
    gap: 12px;
    margin-block: 24px 12px;
}

[data-aip-product] p {
    margin: 0;
}

.aip-shop-preview-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    padding: 13px 20px;
    border: 1px solid var(--aip-accent);
    border-radius: 8px;
    background: white;
    color: var(--aip-accent-dark);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.aip-shop-preview-trigger svg,
.aip-photo-upload svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.aip-shop-preview-trigger:disabled,
.aip-photo-action:disabled,
.aip-design-choice:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.aip-shop-preview-trigger[aria-busy="true"] {
    opacity: 1;
    cursor: wait;
}

.aip-shop-spinner {
    width: 22px;
    height: 22px;
    box-sizing: border-box;
    flex-shrink: 0;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: aip-preview-spin .8s linear infinite;
}

@keyframes aip-preview-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .aip-shop-spinner {
        animation: none;
    }
}

.aip-shop-preview-trigger:focus-visible,
.aip-photo-action:focus-visible,
.aip-design-choice:focus-visible,
.aip-personal-gallery button:focus-visible,
.aip-preview-acknowledgement input:focus-visible {
    outline: 3px solid var(--aip-focus);
    outline-offset: 4px;
}

.aip-shop-status,
.aip-shop-quota,
.aip-shop-hint {
    line-height: 1.5;
    font-size: 13px;
}

.aip-shop-hint {
    color: var(--aip-muted);
}

.aip-shop-status:empty {
    display: none;
}

.aip-photo-action {
    min-height: 36px;
    border: 0;
    padding: 5px 0;
    background: transparent;
    color: var(--aip-accent-dark);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.aip-pilot .aip-photo-native,
.aip-photo-native {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
}

.aip-photo-upload {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    min-height: 112px;
    box-sizing: border-box;
    border: 1px dashed var(--aip-border);
    border-radius: 10px;
    background: white;
    color: var(--aip-text);
    min-width: 0;
}

.aip-photo-upload > svg {
    margin-left: auto;
    color: var(--aip-muted);
}

.aip-photo-thumbnail {
    width: 72px;
    height: 84px;
    object-fit: cover;
    border: 1px solid var(--aip-border);
    border-radius: 8px;
    flex-shrink: 0;
}

.aip-photo-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
    font-size: 14px;
}

.aip-photo-filename {
    color: var(--aip-muted);
    overflow-wrap: anywhere;
    font-size: 12px;
}

.aip-photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.aip-preview-acknowledgement {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-block: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.aip-preview-acknowledgement input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--aip-accent-dark);
    flex-shrink: 0;
}

.aip-design-history {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.aip-design-history h2 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.aip-design-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    max-height: 260px;
    overflow-y: auto;
    padding: 5px;
}

.aip-design-choice {
    display: grid;
    gap: 6px;
    border: 1px solid var(--aip-border);
    border-radius: 8px;
    padding: 5px;
    color: inherit;
    background: white;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    min-width: 0;
    touch-action: manipulation;
}

.aip-design-choice {
    width: 94px;
}

.aip-design-choice img {
    width: 100%;
    height: 78px;
    object-fit: contain;
}

.aip-design-choice[aria-pressed="true"] {
    border-color: var(--aip-accent-dark);
    box-shadow: inset 0 0 0 1px var(--aip-accent-dark);
}

.aip-personal-gallery {
    min-width: 0;
}

.aip-pilot__field[hidden],
.aip-photo-upload [hidden],
.aip-personal-gallery [hidden],
[data-aip-product] [hidden] {
    display: none;
}

@media (max-width: 749px) {
    .aip-photo-upload {
        gap: 12px;
        padding: 12px;
    }

    .aip-photo-upload > svg {
        display: none;
    }
}
