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

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

.aw-mode-btn,
.aw-controls button {
    border: none;
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    background: #0f172a;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

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

.aw-mode-btn.active {
    background: #5b5fa8;
}

.aw-main-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 1rem;
    align-items: stretch;
}

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

.aw-label,
.aw-step-counter {
    display: inline-block;
    margin-bottom: 0.45rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.aw-code-card pre {
    margin: 0.35rem 0 0.65rem;
    padding: 0.8rem 1rem;
    border-radius: 16px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 1.05rem;
    white-space: pre-wrap;
}

.aw-memory-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.aw-variable-box {
    min-height: 150px;
    padding: 1rem;
    border-radius: 20px;
    background: white;
    border: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.aw-variable-box.active {
    transform: translateY(-4px);
    border-color: #5b5fa8;
    background: #eef2ff;
}

.aw-var-name {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.aw-var-value {
    margin-top: 0.7rem;
    color: #0f172a;
    font-size: 2rem;
}

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

.aw-step-card h3 {
    margin: 0.2rem 0 0.4rem;
}

.aw-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.8rem;
}

.aw-controls button:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
    box-shadow: none;
}

@media (max-width: 760px) {
    .aw-main-grid,
    .aw-memory-panel {
        grid-template-columns: 1fr;
    }

    .aw-variable-box {
        min-height: 110px;
    }
}
