/* ==================== ПАНЕЛЬ ПРЕРЫВАНИЙ ==================== */

/* ----- Статус (IE, маски, SID/SOD) ----- */
.interrupt-status {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.75rem;
}

.interrupt-status-row {
    display: flex;
    gap: 8px;
    align-items: center;
    color: #888;
    flex-wrap: wrap;
}

.int-badge {
    display: inline-block;
    min-width: 20px;
    padding: 2px 6px;
    background-color: rgba(183, 255, 105, 0.15);
    border: 1px solid rgba(183, 255, 105, 0.4);
    border-radius: 4px;
    color: #B7FF69;
    font-weight: 600;
    text-align: center;
}

body.light-theme .int-badge {
    background-color: rgba(72, 0, 150, 0.1);
    border-color: rgba(72, 0, 150, 0.4);
    color: #480096;
}

/* ----- Кнопки TRAP / RST — в один ряд (4 колонки) ----- */
.interrupt-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    width: 100%;
}

.interrupt-btn {
    padding: 6px 4px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-align: center;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.interrupt-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.interrupt-btn.trap  { border-color: rgba(255, 80, 80, 0.5);  color: #ff8080; }
.interrupt-btn.rst75 { border-color: rgba(255, 165, 0, 0.5);  color: #FFA500; }
.interrupt-btn.rst65 { border-color: rgba(255, 200, 100, 0.5); color: #FFC864; }
.interrupt-btn.rst55 { border-color: rgba(183, 148, 246, 0.5); color: #B794F6; }
.interrupt-btn.intr  { border-color: rgba(100, 180, 255, 0.5); color: #64B4FF; }

/* ----- Ряд INTR + поле вектора + SID ----- */
.interrupt-intr-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
}

/* Поле ввода вектора RST */
.interrupt-intr-input {
    width: 44px;
    padding: 5px 6px;
    background-color: #151515;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #FFFFFF;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.78rem;
    text-align: center;
    outline: none;
    flex-shrink: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.interrupt-intr-input:focus {
    border-color: #64B4FF;
    box-shadow: 0 0 0 2px rgba(100, 180, 255, 0.15);
}

body.light-theme .interrupt-intr-input {
    background-color: #ffffff;
    border-color: #ddd;
    color: #000000;
}

body.light-theme .interrupt-intr-input:focus {
    border-color: #0056B3;
    box-shadow: 0 0 0 2px rgba(0, 86, 179, 0.15);
}

/* SID с галочкой — прижат вправо */
.interrupt-sid-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;                /* прижимаем SID к правому краю ряда */
    font-family: 'Source Code Pro', monospace;
    font-size: 0.78rem;
    color: #888;
    cursor: pointer;
    user-select: none;
    padding: 5px 8px;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.interrupt-sid-label:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #B7FF69;
    border-color: rgba(183, 255, 105, 0.3);
}

.interrupt-sid-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
    accent-color: #B7FF69;
}

body.light-theme .interrupt-sid-label {
    background-color: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #666;
}

body.light-theme .interrupt-sid-label:hover {
    background-color: rgba(0, 0, 0, 0.08);
    color: #480096;
    border-color: rgba(72, 0, 150, 0.3);
}

body.light-theme .interrupt-sid-label input[type="checkbox"] {
    accent-color: #480096;
}

/* ----- Адаптация для маленьких экранов ----- */
@media (max-width: 480px) {
    .interrupt-btn {
        font-size: 0.65rem;
        padding: 5px 2px;
    }

    .interrupt-buttons {
        gap: 3px;
    }

    .interrupt-intr-row {
        gap: 5px;
    }

    .interrupt-intr-input {
        width: 38px;
        padding: 4px 5px;
        font-size: 0.72rem;
    }

    .interrupt-sid-label {
        padding: 4px 6px;
        font-size: 0.72rem;
        gap: 4px;
    }

    .interrupt-sid-label input[type="checkbox"] {
        width: 12px;
        height: 12px;
    }
}

.keyboard-input-status-success {
    color: #B7FF69 !important;
    font-weight: 600;
}

.keyboard-input-status-warning {
    color: #FFA500 !important;
    font-weight: 600;
}

body.light-theme .keyboard-input-status-success {
    color: #480096 !important;
}

body.light-theme .keyboard-input-status-warning {
    color: #B45F06 !important;
}