.ct-widget {
    margin: 1.5rem 0;
    padding: 1.25rem;
    border-radius: 24px;
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border: 1px solid #dbe4ff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.ct-problem-picker,
.ct-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.ct-problem-btn,
.ct-strand,
.ct-controls button {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    background: white;
    color: #334155;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ct-problem-btn:hover,
.ct-strand:hover,
.ct-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.ct-problem-btn.active,
.ct-strand.active,
.ct-controls button:first-child,
.ct-controls button:nth-child(2) {
    background: #5b5fa8;
    border-color: #5b5fa8;
    color: white;
}

.ct-widget-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1.05fr);
    gap: 1rem;
    align-items: stretch;
}

.ct-problem-card,
.ct-explanation-card,
.ct-output-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1rem 1.15rem;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.ct-label,
.ct-step-count {
    display: inline-block;
    margin-bottom: 0.35rem;
    color: #64748b;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
}

.ct-problem-card h3,
.ct-explanation-card h3 {
    margin-top: 0.2rem;
    margin-bottom: 0.45rem;
    color: #0f172a;
}

.ct-strand-wheel {
    display: grid;
    grid-template-columns: repeat(5, minmax(100px, 1fr));
    gap: 0.55rem;
    align-content: center;
}

.ct-strand {
    min-height: 84px;
    border-radius: 18px;
    white-space: normal;
    line-height: 1.2;
}

.ct-strand.active {
    transform: scale(1.03);
    box-shadow: 0 12px 26px rgba(91, 95, 168, 0.24);
}

.ct-explanation-card {
    margin-top: 1rem;
}

.ct-progress-bar {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin: 1rem 0;
}

.ct-progress-bar span {
    display: block;
    height: 100%;
    width: 20%;
    background: linear-gradient(90deg, #5b5fa8, #e6004f);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.ct-output-card {
    margin-top: 1rem;
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #14532d;
}

@media (max-width: 760px) {
    .ct-widget-layout {
        grid-template-columns: 1fr;
    }

    .ct-strand-wheel {
        grid-template-columns: 1fr;
    }

    .ct-strand {
        min-height: auto;
    }
}
