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

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

.at-instruction-btn,
.at-controls button {
    appearance: none;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: white;
    color: #334155;
    padding: 0.55rem 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.at-instruction-btn:hover,
.at-controls button:hover {
    transform: translateY(-1px);
    border-color: #4f46e5;
}

.at-instruction-btn.active,
.at-controls button.primary {
    background: #4f46e5;
    border-color: #4f46e5;
    color: white;
}

.at-flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: stretch;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.at-card,
.at-detail-card,
.at-step-card,
.at-code-panel > div {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.at-card {
    min-height: 125px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.at-card::before,
.at-detail-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid transparent;
    pointer-events: none;
}

.at-card.active-stage::before,
.at-detail-card.active-stage::before {
    border-color: #4f46e5;
    box-shadow: inset 0 0 0 999px rgba(79, 70, 229, 0.06);
}

.at-card-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 800;
}

.at-card strong {
    color: #0f172a;
    font-size: 1.05rem;
    word-break: break-word;
}

.at-card small {
    color: #64748b;
}

.at-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4f46e5;
    font-size: 2rem;
    font-weight: 900;
}

.at-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}

.at-detail-card {
    position: relative;
    color: #334155;
}

.at-detail-card strong {
    display: block;
    color: #312e81;
    margin-bottom: 0.35rem;
}

.at-code-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 1rem 0;
}

.at-code-panel h3 {
    margin-top: 0;
    color: #334155;
}

.at-code-panel pre {
    margin: 0;
    padding: 0.85rem;
    border-radius: 14px;
    background: #0f172a;
    color: #e0e7ff;
    overflow-x: auto;
    font-size: 0.95rem;
    line-height: 1.45;
}

.at-step-card {
    border-color: #c7d2fe;
}

.at-step-counter {
    margin: 0 0 0.25rem;
    color: #4f46e5;
    font-weight: 800;
}

.at-step-card h3 {
    margin-top: 0;
    color: #1e1b4b;
}

.at-step-card p:last-of-type {
    margin-bottom: 1rem;
}

@media (max-width: 780px) {
    .at-flow {
        grid-template-columns: 1fr;
    }

    .at-arrow {
        transform: rotate(90deg);
        min-height: 28px;
    }

    .at-detail-grid,
    .at-code-panel {
        grid-template-columns: 1fr;
    }
}
