/* ============================================================
   КОНТЕЙНЕР
   ============================================================ */
.ind-calc-container {
    max-width: 750px;
    margin: 0 auto;
    padding: 10px;
    font-family: Arial, sans-serif;
}

.ind-calc-title {
    text-align: center;
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    color: #333;
}

/* ============================================================
   ВЫБОР ТИПА МАРКИРОВКИ
   ============================================================ */
.ind-type-selector {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 20px;
    padding: 10px 0 15px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.ind-type-label {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.ind-type-option {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
}

.ind-type-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #ff6b00;
    cursor: pointer;
}

/* ============================================================
   ТАБЛИЦА
   ============================================================ */
.ind-calc {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    line-height: 1.3em;
    border: 0 !important;
    table-layout: fixed;
}

.ind-calc tr,
.ind-calc td {
    border: 0 !important;
}

.ind-calc .ind-result-input {
    box-sizing: border-box;
    width: 100% !important;
    padding: 4px 6px;
    font-size: 0.9rem;
    border: 1px solid #aaa;
    border-radius: 4px;
    background-color: #f9f9f9;
    color: #222;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

.ind-calc td {
    padding: 0.25em 0 !important;
}

.ind-calc td.ind-padh {
    padding: 0.25em 0 0 !important;
    font-style: italic;
    text-align: center;
    line-height: 1em !important;
    font-size: 0.75rem;
}

.ind-calc td.ind-pad {
    padding: 0.2em 0 !important;
    font-style: italic;
    border-bottom: solid 1px #cdcdcd !important;
    font-size: 0.75rem;
}

.ind-calc td.ind-padleft {
    padding: 0.2em 0.5em 0.2em 0 !important;
    font-style: italic !important;
    text-align: left !important;
    font-size: 0.75rem;
    white-space: nowrap;
}

.ind-w80 td {
    width: 32px !important;
}

.ind-ctr td,
.ind-ctr {
    text-align: center !important;
}

td.ind-tleft {
    text-align: left !important;
}

/* ============================================================
   УВЕЛИЧЕННЫЕ РАДИО-КНОПКИ
   ============================================================ */
.ind-calc input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
    cursor: pointer;
    accent-color: #ff6b00;
    transform: scale(1);
    margin: 0 !important;
    flex-shrink: 0;
}

.ind-calc input[type="radio"]:hover {
    transform: scale(1.15);
}

.ind-calc input[type="radio"]:checked {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.3);
}

/* ============================================================
   ЗАГОЛОВКИ
   ============================================================ */
.ind-header {
    padding-top: 8px !important;
    text-align: center;
}

.ind-header h5 {
    margin: 0.3em 0;
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

/* ============================================================
   РЕЗУЛЬТАТ
   ============================================================ */
.ind-result-label {
    vertical-align: middle;
    text-align: center;
    font-size: 0.85rem;
}

/* ============================================================
   ЦВЕТА ЯЧЕЕК
   ============================================================ */
.ind-white { background-color: #ffffff !important; }
.ind-black { background-color: #000000 !important; }
.ind-silver { background-color: #c0c0c0 !important; }
.ind-gold { background-color: #DAA520 !important; }
.ind-brown { background-color: #8B4513 !important; }
.ind-red { background-color: #CC0000 !important; }
.ind-yellow { background-color: #FFD700 !important; }
.ind-green { background-color: #008000 !important; }
.ind-gray { background-color: #808080 !important; }
.ind-orange { background-color: #FF8C00 !important; }
.ind-blue { background-color: #00008B !important; }
.ind-violet { background-color: #9400D3 !important; }

/* ============================================================
   ГОРИЗОНТАЛЬНАЯ МАРКИРОВКА (РЕЗИСТОР)
   ============================================================ */
.ind-resistor-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 0 8px 0;
}

.ind-resistor-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 4px;
    position: relative;
    background: transparent;
}

.ind-resistor-body .ind-cap {
    width: 22px;
    height: 40px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #c5d4b0, #b0d4b0, #b0d4bf);
    border-radius: 4px 0 0 4px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), inset 0 -2px 4px rgba(0,0,0,0.1);
}

.ind-resistor-body .ind-cap-right {
    border-radius: 0 4px 4px 0;
}

.ind-resistor-body .ind-band {
    height: 34px;
    width: 10px;
    margin: 0 1.5px;
    border-radius: 2px;
    flex-shrink: 0;
    box-shadow: 
        inset 0 1px 3px rgba(255,255,255,0.5),
        inset 0 -1px 3px rgba(0,0,0,0.25);
    transition: background-color 0.15s ease;
    background-color: #ccc;
    position: relative;
    z-index: 2;
}

.ind-resistor-body .ind-lead {
    width: 16px;
    height: 2.5px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #c8c8c8, #9a9a9a, #c8c8c8);
    border-radius: 1px;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.3);
}

.ind-resistor-body .ind-lead-left {
    margin-right: -2px;
}
.ind-resistor-body .ind-lead-right {
    margin-left: -2px;
}

.ind-resistor-4 {
    width: 240px;
    max-width: 100%;
}

.ind-digit-labels {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 240px;
    margin-top: 3px;
    font-size: 0.6rem;
    color: #888;
}

.ind-digit-labels span {
    text-align: center;
    flex: 1;
}

/* ============================================================
   ВЕРТИКАЛЬНАЯ МАРКИРОВКА (МАТРИЦА 2×2) — ОБА ВЫВОДА СНИЗУ
   ============================================================ */
.ind-matrix-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 0 8px 0;
}

.ind-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 6px 16px;
    padding: 12px 20px;
    background: linear-gradient(180deg, #c8c8c8, #9a9a9a, #c8c8c8);
    border-radius: 30px;
    box-shadow: 
        inset 0 2px 8px rgba(0,0,0,0.2),
        0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
}

.ind-matrix-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.ind-matrix-segment {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,0.4),
        inset 0 -2px 4px rgba(0,0,0,0.2),
        0 1px 2px rgba(0,0,0,0.1);
    transition: background-color 0.15s ease;
    background-color: #ccc;
    border: 1px solid rgba(0,0,0,0.08);
}

.ind-matrix-label {
    font-size: 0.5rem;
    color: #555;
    text-align: center;
    font-weight: 500;
}

/* ============================================================
   ВЫВОДЫ (НОЖКИ) — ОБА СНИЗУ
   ============================================================ */
.ind-matrix-leads {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: -2px;
    position: relative;
    z-index: 1;
}

.ind-matrix-lead {
    width: 2.5px;
    height: 16px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #c8c8c8, #9a9a9a, #c8c8c8);
    border-radius: 1px;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.3);
}

/* ============================================================
   МОБИЛЬНАЯ ВЕРСИЯ
   ============================================================ */
@media (max-width: 600px) {
    .ind-calc-container {
        padding: 5px;
    }

    .ind-calc-title {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .ind-type-selector {
        gap: 8px 12px;
        padding: 8px 0 12px 0;
    }

    .ind-type-label {
        font-size: 0.75rem;
    }

    .ind-type-option {
        font-size: 0.75rem;
    }

    .ind-calc td {
        padding: 0.1em 0 !important;
    }

    .ind-calc td.ind-padleft {
        font-size: 0.5rem !important;
        padding: 0.1em 0.15em 0.1em 0 !important;
        letter-spacing: -0.3px;
        max-width: 35px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ind-calc input[type="radio"] {
        width: 22px !important;
        height: 22px !important;
    }

    .ind-w80 td {
        width: 26px !important;
        font-size: 0.5rem !important;
        padding: 0.1em 0 !important;
    }

    .ind-calc td.ind-pad {
        font-size: 0.5rem !important;
        padding: 0.1em 0 !important;
    }

    .ind-calc td.ind-padh {
        font-size: 0.55rem !important;
    }

    .ind-calc .ind-result-input {
        font-size: 0.6rem !important;
        padding: 3px 4px !important;
        white-space: normal !important;
        word-break: break-word !important;
        text-overflow: clip !important;
        min-height: 30px;
    }

    .ind-result-label {
        font-size: 0.6rem !important;
    }

    /* Горизонтальный резистор */
    .ind-resistor-4 {
        width: 180px !important;
    }

    .ind-resistor-body {
        height: 32px !important;
        padding: 0 3px !important;
    }

    .ind-resistor-body .ind-cap {
        height: 32px !important;
        width: 10px !important;
    }

    .ind-resistor-body .ind-band {
        height: 26px !important;
        width: 8px !important;
        margin: 0 1px !important;
    }

    .ind-resistor-body .ind-lead {
        width: 10px !important;
        height: 2px !important;
    }

    .ind-digit-labels {
        font-size: 0.45rem !important;
        max-width: 180px !important;
    }

    /* Вертикальная матрица */
    .ind-matrix {
        gap: 4px 12px !important;
        padding: 10px 14px !important;
    }

    .ind-matrix-segment {
        width: 22px !important;
        height: 22px !important;
    }

    .ind-matrix-label {
        font-size: 0.4rem !important;
    }

    .ind-matrix-leads {
        gap: 14px !important;
    }

    .ind-matrix-lead {
        height: 12px !important;
        width: 2px !important;
    }

    .ind-header h5 {
        font-size: 0.8rem !important;
    }
}

/* ============================================================
   ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ
   ============================================================ */
@media (max-width: 400px) {
    .ind-resistor-4 {
        width: 150px !important;
    }

    .ind-resistor-body .ind-band {
        width: 6px !important;
        margin: 0 0.8px !important;
    }

    .ind-resistor-body .ind-cap {
        width: 8px !important;
    }

    .ind-resistor-body .ind-lead {
        width: 8px !important;
    }

    .ind-digit-labels {
        font-size: 0.4rem !important;
        max-width: 150px !important;
    }

    .ind-matrix {
        gap: 3px 8px !important;
        padding: 8px 10px !important;
    }

    .ind-matrix-segment {
        width: 18px !important;
        height: 18px !important;
    }

    .ind-matrix-label {
        font-size: 0.35rem !important;
    }

    .ind-matrix-leads {
        gap: 10px !important;
    }

    .ind-matrix-lead {
        height: 10px !important;
        width: 1.5px !important;
    }

    .ind-calc .ind-result-input {
        font-size: 0.5rem !important;
        padding: 2px 3px !important;
        min-height: 25px;
    }

    .ind-calc td.ind-padleft {
        font-size: 0.4rem !important;
        max-width: 25px;
    }

    .ind-calc input[type="radio"] {
        width: 18px !important;
        height: 18px !important;
    }

    .ind-w80 td {
        width: 20px !important;
        font-size: 0.4rem !important;
    }
}