.test-strategy-widget {
    margin: 1.5rem 0;
    padding: 1.2rem;
    border-radius: 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.tsw-toolbar,
.tsw-controls {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tsw-tab,
.tsw-controls button {
    border: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 0.65rem 1rem;
    background: white;
    color: #334155;
    border: 1px solid #cbd5e1;
    font-weight: 700;
    transition: all 0.2s ease;
}

.tsw-tab:hover,
.tsw-controls button:hover {
    transform: translateY(-1px);
    background: #0f172a;
    color: white;
    border-color: #0f172a;
}

.tsw-tab.active {
    background: #5b5fa8;
    color: white;
    border-color: #5b5fa8;
}

.tsw-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
}

.tsw-rule-card,
.tsw-test-card,
.tsw-plan-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 1rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.tsw-rule-card h3,
.tsw-test-card h3,
.tsw-plan-card h3 {
    margin-top: 0.25rem;
    margin-bottom: 0.45rem;
}

.tsw-mini-label {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.tsw-rule-line {
    margin-top: 0.8rem;
}

#tswRuleBadge {
    display: inline-block;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(91, 95, 168, 0.10);
    color: #4b4f9c;
    font-weight: 800;
}

.tsw-result-pill {
    display: inline-block;
    margin-top: 0.65rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    font-weight: 800;
    background: #f0fdf4;
    color: #14532d;
    border: 1px solid #bbf7d0;
}

.tsw-result-pill.reject {
    background: #fff7ed;
    color: #7c2d12;
    border-color: #fed7aa;
}

.tsw-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.tsw-value-card {
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 18px;
    padding: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tsw-value-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.tsw-value-card.active {
    border-color: #5b5fa8;
    background: rgba(91, 95, 168, 0.08);
}

.tsw-value-card strong {
    display: block;
    font-size: 1.25rem;
    color: #0f172a;
}

.tsw-value-card span {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.82rem;
    font-weight: 800;
}

.tsw-value-card small {
    display: block;
    color: #64748b;
    margin-top: 0.45rem;
    line-height: 1.35;
}

.tsw-plan-card.highlight {
    outline: 3px solid rgba(230, 0, 79, 0.35);
    animation: tswPulse 0.8s ease;
}

.tsw-table {
    margin-bottom: 0;
}

@keyframes tswPulse {
    0% { transform: scale(1); }
    45% { transform: scale(1.015); }
    100% { transform: scale(1); }
}

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