.cm-cube-finder {
    border-radius: 16px;
    padding: 24px 20px 26px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #fff5e6, #e4f7ff);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cm-header h2 {
    margin: 0 0 4px;
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b6b, #ffa502);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cm-header p {
    margin: 0 0 16px;
    font-size: 0.95rem;
    color: #444;
}

.cm-progress-bar {
    position: relative;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 16px;
}

.cm-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1e90ff, #2ed573, #ffa502);
    transition: width 0.25s ease;
}

/* Steps */

.cm-step {
    margin-top: 8px;
}

.cm-step h3 {
    margin-bottom: 6px;
    font-size: 1.15rem;
}

.cm-step-subtitle {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: #666;
}

/* Pills */

.cm-pill {
    display: inline-flex;
    align-items: center;
    margin: 4px 6px 8px 0;
    cursor: pointer;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.9rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.15s ease;
}

.cm-pill input[type="radio"] {
    display: none;
}

.cm-pill span {
    white-space: nowrap;
}

.cm-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Brand accents */

.cm-brand-moyu { border-color: #ff6b6b; }
.cm-brand-gan { border-color: #1e90ff; }
.cm-brand-qiyi { border-color: #2ed573; }
.cm-brand-any { border-color: #ffa502; }

.cm-pill input[type="radio"]:checked + span,
.cm-card-option input[type="radio"]:checked + .cm-card .cm-card-title {
    font-weight: 700;
}

/* When checked, highlight the pill */

.cm-pill input[type="radio"]:checked + span {
    color: #111;
}

.cm-pill input[type="radio"]:checked ~ span,
.cm-pill input[type="radio"]:checked + span {
    position: relative;
}

.cm-pill input[type="radio"]:checked ~ span::after,
.cm-pill input[type="radio"]:checked + span::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #1e90ff;
}

/* Card options */

.cm-card-option {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
}

.cm-card-option input[type="radio"] {
    display: none;
}

.cm-card {
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.15s ease;
}

.cm-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.cm-card-text {
    font-size: 0.85rem;
    color: #555;
}

/* coloured variants */

.cm-card-speed {
    border-left: 4px solid #ff6b6b;
}

.cm-card-control {
    border-left: 4px solid #1e90ff;
}

.cm-card-budget {
    border-left: 4px solid #2ed573;
}

.cm-card-option:hover .cm-card {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.cm-card-option input[type="radio"]:checked + .cm-card {
    border-color: #1e90ff;
    box-shadow: 0 0 0 2px rgba(30, 144, 255, 0.2);
}

/* Nav buttons */

.cm-nav {
    margin-top: 14px;
    display: flex;
    gap: 8px;
}

.cm-btn-primary,
.cm-btn-ghost {
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.15s ease;
}

.cm-btn-primary {
    background: linear-gradient(135deg, #ff6b6b, #ffa502);
    color: #fff;
    font-weight: 600;
}

.cm-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.4);
}

.cm-btn-ghost {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.cm-btn-ghost:hover {
    background: #fff;
}

/* Loading */

#cm-cube-finder-loading {
    margin-top: 18px;
    text-align: center;
    font-size: 0.95rem;
    color: #444;
}

.cm-loading-spinner {
    margin: 0 auto 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid rgba(0, 0, 0, 0.08);
    border-top-color: #1e90ff;
    animation: cm-spin 0.8s linear infinite;
}

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

/* Results */

.cm-results-header h3 {
    margin: 18px 0 4px;
    font-size: 1.1rem;
}

.cm-results-header p {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: #555;
}

.cm-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.cm-result-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.15s ease;
}

.cm-result-item a {
    text-decoration: none;
    color: inherit;
}

.cm-result-thumb {
    margin-bottom: 6px;
}

.cm-result-item img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.cm-result-item h4 {
    font-size: 0.9rem;
    min-height: 34px;
    margin: 4px 0;
}

.cm-price {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: #111;
}

.cm-view-link {
    font-size: 0.8rem;
    text-decoration: underline;
    color: #1e90ff;
}

.cm-result-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.08);
}

/* Block editor placeholder */

.cm-block-editor-placeholder {
    border-radius: 8px;
    border: 1px dashed #ddd;
    padding: 12px;
    background: #f8f9ff;
}

.cm-block-editor-placeholder h3 {
    margin-top: 0;
    margin-bottom: 4px;
}