.stamp-case-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    gap: 8px;
    margin-top: 10px;
}

.stamp-case-card {
    position: relative;
    max-width: 230px;
    padding: 10px;
    border: 2px solid #e2e2e2;
    background: #fff;
    text-align: center;
}

.stamp-case-card:has(input:checked) {
    border-color: #d62828;
}

.stamp-case-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0;
    cursor: pointer;
}

.stamp-case-preview img {
    max-width: 100%;
    object-fit: contain;
}

.stamp-case-model {
    line-height: 1.35;
}

.stamp-case-colors {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.stamp-case-colors:has(label) {
    margin-top: 6px;
}

.stamp-case-color {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    margin: 0;
    cursor: pointer;
}

.stamp-case-color::before {
    content: '';
    grid-area: 1 / 1;
    width: 21px;
    height: 21px;
    border: 1px solid #aaa;
    background: var(--stamp-case-color);
}

.stamp-case-colors input:checked + .stamp-case-color::before {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.stamp-case-colors input:checked + .stamp-case-color::after {
    content: '✓';
    grid-area: 1 / 1;
    color: #fff;
    font-size: 12px;
    line-height: 1;
    text-shadow: 0 0 2px #000, 0 0 3px #000;
}

.stamp-case-choice {
    width: 100%;
    margin: 4px 0 0;
    padding: 4px;
    border: 1px solid #e2e2e2;
    font-size: 12px;
    line-height: 1.35;
    cursor: pointer;
}

.stamp-case-colors input:checked + .stamp-case-choice {
    border-color: currentColor;
}

.stamp-case-colors input:focus-visible + label,
.stamp-case-card:has(input:focus-visible:last-child) .stamp-case-preview {
    outline: 2px solid #d62828;
}

.stamp-case-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    line-height: 1.35;
}

.stamp-case-details span:empty {
    display: none;
}

.stamp-case-details:has(span:not(:empty)) {
    margin-top: 4px;
}
