/* =========================================================
   6.06 Assembly Instructions Widget
   ========================================================= */

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

.aiw-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.aiw-tab,
.aiw-instruction-btn,
.aiw-controls button {
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aiw-tab {
    background: white;
    color: #334155;
    border: 1px solid #cbd5e1;
}

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

.aiw-main-grid {
    display: grid;
    grid-template-columns: 0.95fr 1.35fr;
    gap: 1rem;
    align-items: stretch;
}

.aiw-panel,
.aiw-machine-panel,
.aiw-explain-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 1rem;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.aiw-panel h3,
.aiw-explain-card h3 {
    margin-top: 0;
}

.aiw-instruction-list {
    display: grid;
    gap: 0.55rem;
    margin-top: 1rem;
}

.aiw-instruction-btn {
    width: 100%;
    text-align: left;
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.aiw-instruction-btn:hover,
.aiw-instruction-btn.active {
    background: rgba(91, 95, 168, 0.12);
    border-color: rgba(91, 95, 168, 0.32);
    color: #34387f;
}

.aiw-register-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.aiw-register-card {
    padding: 0.85rem;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    text-align: center;
    transition: all 0.25s ease;
}

.aiw-register-card span {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.aiw-register-card strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.35rem;
    color: #0f172a;
}

.aiw-memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.55rem;
}

.aiw-memory-cell {
    padding: 0.65rem;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.25s ease;
}

.aiw-memory-cell span {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
}

.aiw-memory-cell strong {
    display: block;
    margin-top: 0.25rem;
    color: #0f172a;
    font-size: 1.05rem;
}

.aiw-explain-card {
    margin-top: 1rem;
}

.aiw-chip {
    display: inline-flex;
    margin: 0 0 0.75rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(230, 0, 79, 0.08);
    color: #e6004f;
    font-weight: 850;
    letter-spacing: 0.03em;
}

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

.aiw-controls button {
    background: #0f172a;
    color: white;
}

.aiw-controls button:last-child {
    background: white;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.aiw-highlight {
    background: #fff7ed !important;
    border-color: #fb923c !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 28px rgba(251, 146, 60, 0.22);
}

.aiw-target {
    background: #eff6ff !important;
    border-color: #60a5fa !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 28px rgba(96, 165, 250, 0.22);
}

.aiw-updated {
    background: #f0fdf4 !important;
    border-color: #4ade80 !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 28px rgba(74, 222, 128, 0.22);
}

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

    .aiw-register-row,
    .aiw-memory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
