.io-port-widget {
    margin: 1.5rem 0;
    padding: 1.25rem;
    border-radius: 24px;
    border: 1px solid #dbeafe;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.io-port-layout {
    display: grid;
    grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.7fr);
    gap: 1rem;
    align-items: stretch;
}

.io-device-panel,
.io-flow-panel,
.usb-check-panel {
    padding: 1rem;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.io-device-panel h3,
.usb-check-panel h3 {
    margin-top: 0;
}

.io-device-buttons {
    display: grid;
    gap: 0.6rem;
}

.io-device-btn,
.usb-check-options button {
    appearance: none;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    color: #334155;
    padding: 0.7rem 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.io-device-btn:hover,
.usb-check-options button:hover {
    transform: translateY(-1px);
    border-color: #93c5fd;
    background: #eff6ff;
}

.io-device-btn.active {
    background: #0f172a;
    color: white;
    border-color: #0f172a;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.io-flow-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.io-flow-card {
    min-width: 112px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.8rem;
    border-radius: 18px;
    background: #f8fafc;
    border: 2px solid #dbeafe;
    color: #0f172a;
    font-weight: 800;
    line-height: 1.25;
    transition: all 0.25s ease;
}

.io-flow-card.highlight {
    background: #dbeafe;
    border-color: #2563eb;
    transform: translateY(-2px);
}

.cpu-card {
    background: #0f172a;
    color: white;
    border-color: #0f172a;
}

.io-arrow {
    color: #2563eb;
    font-size: 1.35rem;
    font-weight: 900;
}

.io-port-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.io-fact-card {
    padding: 0.9rem;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.io-fact-card span {
    display: block;
    color: #64748b;
    font-size: 0.86rem;
    margin-bottom: 0.35rem;
}

.io-fact-card strong {
    color: #0f172a;
    font-size: 1rem;
}

.io-explanation {
    padding: 1rem;
    border-radius: 18px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #7c2d12;
    line-height: 1.6;
}

.usb-check-panel {
    margin-top: 1rem;
}

.usb-check-options {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.usb-check-feedback {
    margin-bottom: 0;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-weight: 700;
}

.usb-check-feedback.correct {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #14532d;
}

.usb-check-feedback.incorrect {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #7c2d12;
}

@media (max-width: 760px) {
    .io-port-layout {
        grid-template-columns: 1fr;
    }

    .io-flow-card {
        min-width: 96px;
        min-height: 60px;
        font-size: 0.9rem;
    }
}
