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

.pb-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.pb-example-btn,
.pb-controls button {
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1rem;
    background: #0f172a;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.pb-example-btn:hover,
.pb-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

.pb-example-btn.active {
    background: #5b5fa8;
}

.pb-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 1rem;
    align-items: stretch;
}

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

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

.pb-code-card pre {
    margin: 0;
    padding: 1rem;
    border-radius: 16px;
    background: #0f172a;
    color: #e2e8f0;
    overflow-x: auto;
    line-height: 1.55;
    min-height: 260px;
}

.pb-code-card code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.pb-code-line {
    display: block;
    padding: 0.12rem 0.35rem;
    border-radius: 8px;
}

.pb-code-line.active {
    background: rgba(251, 191, 36, 0.24);
    color: #fef3c7;
}

.pb-input-row {
    display: grid;
    grid-template-columns: 1fr 110px;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.7rem;
}

.pb-input-row label {
    font-weight: 700;
    color: #334155;
}

.pb-input-row input {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font: inherit;
}

.pb-variable-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 1rem;
}

.pb-var-card {
    padding: 0.75rem;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.pb-var-card span {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pb-var-card strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.15rem;
    color: #0f172a;
}

.pb-output-box {
    margin-top: 1rem;
    padding: 0.9rem;
    border-radius: 18px;
    background: #ecfeff;
    border: 1px solid #a5f3fc;
}

.pb-output-box span {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    color: #155e75;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pb-output-box strong {
    display: block;
    margin-top: 0.25rem;
    color: #164e63;
    font-size: 1.1rem;
}

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

.pb-step-counter {
    margin: 0 0 0.4rem;
    color: #5b5fa8;
    font-weight: 800;
}

.pb-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

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

    .pb-variable-grid {
        grid-template-columns: 1fr;
    }
}
