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

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

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

.pcw-toolbar button:hover,
.pcw-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
}

.pcw-toolbar button.active {
    background: #5b5fa8;
    color: white;
    border-color: #5b5fa8;
}

.pcw-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: stretch;
    margin: 1rem 0;
}

.pcw-code-card,
.pcw-step-card,
.pcw-state-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.pcw-code-card h3,
.pcw-step-card h3 {
    margin-top: 0;
}

.pcw-code-card pre {
    margin: 0;
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.5;
}

.pcw-code-card.active,
.pcw-state-card.active {
    border-color: #5b5fa8;
    box-shadow: 0 0 0 3px rgba(91, 95, 168, 0.12), 0 10px 26px rgba(15, 23, 42, 0.08);
}

.pcw-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    align-self: center;
    border-radius: 999px;
    background: #0f172a;
    color: white;
    font-size: 1.4rem;
    font-weight: 900;
}

.pcw-arrow.returning {
    transform: rotate(180deg);
    background: #16a34a;
}

.pcw-state-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin: 1rem 0;
}

.pcw-state-card {
    display: grid;
    gap: 0.35rem;
}

.pcw-state-card strong {
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pcw-state-card span {
    color: #0f172a;
    font-weight: 800;
}

.pcw-step-card {
    margin-top: 1rem;
}

.pcw-step-counter {
    margin: 0 0 0.5rem;
    color: #64748b;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pcw-output {
    margin: 1rem 0;
    padding: 0.8rem 1rem;
    border-radius: 16px;
    background: #0f172a;
    color: white;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
}

@media (max-width: 820px) {
    .pcw-layout,
    .pcw-state-grid {
        grid-template-columns: 1fr;
    }

    .pcw-arrow {
        transform: rotate(90deg);
        margin: 0 auto;
    }

    .pcw-arrow.returning {
        transform: rotate(270deg);
    }
}
