.scc-viewer {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    font-family: inherit;
}

.scc-viewer__stage {
    flex: 1 1 340px;
    min-width: 260px;
    max-width: 600px;
}

.scc-viewer__canvas-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    background-color: #f4f4f4;
    border-radius: 8px;
    overflow: hidden;
}

.scc-viewer__canvas {
    width: 100%;
    height: 100%;
}

.scc-viewer__canvas canvas {
    display: block;
}

.scc-viewer__status {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    color: #333;
}

.scc-viewer__status[hidden] {
    display: none;
}

.scc-viewer__status--error {
    color: #a00;
}

.scc-viewer__retry {
    border: 1px solid #a00;
    background: #fff;
    color: #a00;
    border-radius: 4px;
    padding: 6px 14px;
    cursor: pointer;
}

.scc-viewer__toolbar {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.scc-viewer__toolbar button {
    flex: 1;
    border: 1px solid #ccc;
    background: #fafafa;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 13px;
    cursor: pointer;
}

.scc-viewer__toolbar button:hover {
    background: #eee;
}

.scc-viewer__panel {
    flex: 2 1 320px;
    min-width: 260px;
}

.scc-viewer__group h4 {
    margin: 0 0 8px;
    font-size: 14px;
}

.scc-viewer__group + .scc-viewer__group {
    margin-top: 18px;
}

.scc-swatches {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.scc-swatch {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: var(--scc-radius-tl, 50%) var(--scc-radius-tr, 50%) var(--scc-radius-br, 50%) var(--scc-radius-bl, 50%);
    border: 2px solid rgba(0, 0, 0, 0.15);
    cursor: pointer;
    padding: 0;
}

.scc-swatch:hover,
.scc-swatch:focus-visible {
    border-color: #000;
    outline: none;
}

.scc-swatch.is-selected {
    border-color: #000;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000;
}

.scc-swatch__tip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #fff;
    font-size: 11px;
    line-height: 1.4;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
}

.scc-swatch:hover .scc-swatch__tip,
.scc-swatch:focus-visible .scc-swatch__tip {
    opacity: 1;
}

.scc-viewer__selection {
    margin-top: 18px;
    font-size: 13px;
    color: #444;
}

.scc-admin-notice {
    border-left: 4px solid #d63638;
    background: #fff;
    padding: 8px 12px;
}

@media (max-width: 640px) {
    .scc-viewer {
        flex-direction: column;
    }

    .scc-viewer__stage {
        flex-basis: auto;
        max-width: none;
        width: 100%;
    }
}
