        :root {
            --bg-color: #26263D;          /* Ваш глубокий фон */
            --term-bg: #090b11;           /* Фон окна логов */
            --tx-color: #00ff66;          /* Зеленый для передачи (TX) */
            --rx-color: #ffcc00;          /* Желтый для приема (RX) */
            --sys-color: #00ffcc;         /* Бирюзовый для системы и заголовка */
            //--timestamp-color: #556677;   /* Серый для времени */
            --timestamp-color: #68798b;   /* Серый для времени */
        }

        .close-modal {
            position: absolute;
            top: 15px;
            right: 15px;
            background: rgba(255, 255, 255, 0.1);
            border: none;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            z-index: 2001;
            transition: all 0.3s ease;
        }

        .close-modal:hover {
            background: rgba(255, 0, 102, 0.3);
            transform: rotate(90deg);
        }

        /* Стиль для вывода критических аппаратных ошибок (красный цвет) */
        .line-err { 
            color: #ff6868; 
            text-shadow: 0 0 5px rgba(255, 85, 85, 0.3);
        }

        /* Стиль для номеров строк в логе */
        .line-number {
            color: #4f5373; /* Приглушенный серый цвет */
            margin-right: 10px;
            display: inline-block;
            min-width: 35px; /* Фиксированная ширина, чтобы текст не прыгал при росте цифр */
            text-align: right;
            user-select: none; /* Чтобы номера не выделялись при копировании текста */
        }

        /* Полная блокировка скролла всей страницы и центрирование */
        body {
            font-family: 'Courier New', Courier, monospace;
            background-color: var(--bg-color);
            color: #ffffff;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            width: 100vw;
            overflow: hidden;
        }

        /* Фиксированный контейнер терминала строго по центру экрана */
        .terminal-container {
            width: 800px;
            height: 570px;
            background: #141722;
            border: 2px solid #3b3f5c;
            border-radius: 20px;
            padding: 20px;
            display: flex;
            flex-direction: column;
            box-shadow: 0 10px 30px rgba(0,0,0,0.5);
            //box-sizing: border-box;
            position: relative; /* Критично для позиционирования индикаторов */
        }

        /* Статичный бирюзовый заголовок по центру */
        h2.title {
            margin: 0 0 35px 0;
            color: var(--sys-color);
            text-align: center;
            text-transform: uppercase;
            letter-spacing: 2px;
            font-size: 1.3rem;
            user-select: none;
        }

        .controls {
            display: flex;
            gap: 12px;
            align-items: center;
            margin-bottom: 15px;
            flex-wrap: nowrap;
        }

        button, select, input {
            font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
            background: #1c2130;	    
            color: #fff;
            border: 1px solid #3b3f5c;
            padding: 8px 12px;
            font-size: 13px;
            border-radius: 8px;
            outline: none;
            box-sizing: border-box;
        }

        input {
            font-family: 'Courier New', Courier, monospace;
	    color: var(--tx-color);
	    height: 36px;
	}

        /* Точечное исправление выпадающего списка скорости */
        select {
            padding-right: 28px; /* Добавляем зазор: теперь стрелка не прилипает к рамке */
            min-width: 140px;    /* Фиксируем ширину, чтобы панель выглядела аккуратно */
            cursor: pointer;
        }

        button {
            cursor: pointer;
            font-weight: 500;
	    background: #1c2130;
	    transition: all 0.3s ease;
        }
        button:hover:not(:disabled) { background: #282f44; }

        /* Стили для кнопки подключения */
        #connectBtn { 
	//background-color: #1b7a31; // border-color: #24963e; 
	background: linear-gradient(0deg, #0087C0, #ACE1F9);
	}

        #connectBtn:hover { 
	//background-color: #1b7a31; // border-color: #24963e; 
	//box-shadow: 0 0px 20px rgba(0, 136, 255, 0.75);
	transform: translateY(-2px);
	box-shadow: 0 15px 30px rgb(0, 0, 0, 0.75);
        //box-shadow: 0 15px 30px rgba(0, 136, 255, 0.4);
	}
        
	#connectBtn.connected { 
	background: linear-gradient(0deg, #b62b2b, #d33838);
	//background-color: #b62b2b; 
	// border-color: #d33838; 
	}

        /* Кнопки управления логами */
        #clearBtn { background-color: #3b3f5c; border-color: #4f5373; }
        #clearBtn:hover { background-color: #4f5373; }
        
        #saveBtn { background-color: #213b5c; border-color: #2e5280; }
        #saveBtn:hover { background-color: #2e5280; }

        /* Абсолютное позиционирование блока индикаторов в стиле Mac OS (свернуть-развернуть-закрыть) */
        .led-container {
            position: absolute;
            top: 29px;
            right: 77px;
            display: flex;
            gap: 8px; /* Стильное расстояние Mac OS */
            align-items: center;
            user-select: none;
            z-index: 10;
        }

        /* Виртуальный светодиод в стиле Mac OS с внутренней тенью для эффекта объема */
        .led {
            width: 12px;
            height: 12px;
            background-color: #3b3f5c; /* Дефолтная темная заливка */
            border-radius: 50%;
            //box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
            transition: background-color 0.15s ease, box-shadow 0.15s ease;
            position: relative;
        }

        /* Всплывающие подсказки Mac-кнопок при наведении */
.led::after {
    content: attr(data-hint);
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: #1c2130;
    
    /* ИСПРАВЛЕНО: Теперь цвет управляется из HTML, а по умолчанию остается желтым */
    color: var(--hint-color, var(--tx-color, #00ff66));

    
    padding: 3px 6px;
    font-size: 14px;
    border-radius: 3px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    border: 1px solid #3b3f5c;
}
        .led:hover::after { opacity: 1; }

        /* ИСПРАВЛЕНИЕ: Активные неоновые состояния индикаторов с эффектом размытия сияния (blur) */
        #ledCom.active { 
            background-color: #00ff66; 
            box-shadow: 0 0 12px 2px rgba(0,255,102,0.6), inset 0 1px 2px rgba(255,255,255,0.4); 
        }
        #ledRx.active { 
            background-color: #ffcc00; 
            box-shadow: 0 0 12px 2px rgba(255,204,0,0.6), inset 0 1px 2px rgba(255,255,255,0.4); 
        }
        #ledTx.active { 
            background-color: #00ff66; 
            box-shadow: 0 0 12px 2px rgba(0,255,102,0.6), inset 0 1px 2px rgba(255,255,255,0.4); 
        }

        /* Поле ввода */
        input[type="text"] {
            flex-grow: 1;
            background: var(--term-bg);
            min-width: 150px;
        }
        input[type="text"]:focus { border-color: var(--sys-color); }

        /* Окно данных со своим независимым скроллом */
        #terminal {
            flex-grow: 1;
            background-color: var(--term-bg);
            border: 1px solid #282f44;
            border-radius: 4px;
            padding: 12px;
            overflow-y: scroll;
            margin-bottom: 15px;
            box-shadow: inset 0 0 8px rgba(0,0,0,0.7);
        }

        /* Кастомизация полосы прокрутки внутри #terminal */
        #terminal::-webkit-scrollbar { width: 8px; }
        #terminal::-webkit-scrollbar-track { background: var(--term-bg); }
        #terminal::-webkit-scrollbar-thumb { background: #282f44; border-radius: 4px; }
        #terminal::-webkit-scrollbar-thumb:hover { background: #3b3f5c; }

        /* Форматирование строк лога */
        .term-line { margin: 2px 0; line-height: 1.3; white-space: pre-wrap; word-break: break-all; font-size: 13px; }
        .timestamp { color: var(--timestamp-color); margin-right: 8px; user-select: none; }
        .direction { font-weight: bold; margin-right: 6px; user-select: none; }

        .line-tx { color: var(--tx-color); }
        .line-rx { color: var(--rx-color); }
        .line-sys { color: var(--sys-color); }

        /* ANSI цвета */
        .ansi-bold { font-weight: bold; }
        .ansi-red { color: #ff5555; }
        .ansi-green { color: #55ff55; }
        .ansi-yellow { color: #ffff55; }
        .ansi-blue { color: #5555ff; }
        .ansi-white { color: #ffffff; }

            .hide-time-label {
                display: flex;
                align-items: center;
                gap: 5px;
                color: #fff;
                font-family: sans-serif;
                font-size: 14px;
                cursor: pointer;
                user-select: none;
                margin-left: 10px;
            }
            .hide-time-label input {
                cursor: pointer;
            }
            
            /* Магия CSS: если чекбокс нажат, скрываем все таймштампы в терминале */
            #hideDateTime:checked ~ .led-container, 
            #hideDateTime:checked ~ #terminal .timestamp {
                display: none !important;
            }

.top-info {
    height: 30px;
    width: fit-content;
    font-weight: 400;
    padding: 6px 10px;
    border-radius: 10px 0px 0px 10px;
    color: #00ffcc;
    background-image: linear-gradient(90deg, #3b3f5c, #141722);
    transform: translateY(-10px);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 5px 0px 20px 0px;
}

.footer-bottom {
    margin-top: auto !important; /* Намертво прижимает блок к нижнему краю при любой высоте родителя */
    text-align: center;         /* Центрирует текст копирайта по горизонтали */
    
    /* Ваши оригинальные стили без изменений */
    padding-top: 18px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.copyright a {
    color:#909092;
    text-decoration:none;
    font-weight:500;
    transition:.3s;
}

.hide-time-label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #fff;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    margin-left: 10px;
    }
            
.hide-time-label input {
    cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
	padding: 0;
	width: 22px;
	//height: 25px;
}

/* ==========================================================================
   UPDATED CODES: OLEDDUINO SMD CALCULATOR & FA FIX
   ========================================================================== */

/* Фикс для принудительного отображения иконки закрытия Font Awesome */
.close-modal i.fas.fa-times::before {
    content: "\f00d" !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
}

/* Главный контейнер калькулятора */
#calculator {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    max-width: 710px; 
    margin: 15px auto;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Стилизация отдельных колонок вычислений */
#calculator .calc-column {
    flex: 1;
    min-width: 250px; 
    // background: rgba(20, 23, 34, 0.6);
    padding: 20px;
    border-radius: 12px;
    // border: 1px solid rgba(255, 255, 255, 0.05);
    box-sizing: border-box;
}

#calculator .column-title {
    font-size: 13px;
    color: #7c7c8a;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    margin-bottom: 5px;
}

/* Настройки SMD чипов */
#calculator .smd-component {
    width: 180px;
    height: 90px;
    margin: 20px auto 10px auto;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.85), 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

#calculator .smd-component:hover {
    transform: scale(1.02);
}

#calculator .resistor-theme {
    background-color: #26263d;
    border-left: 14px solid #d1d1d6;
    border-right: 14px solid #d1d1d6;
}

#calculator .capacitor-theme {
    background-color: #a0785a; 
    border-left: 14px solid #b8b8bc;
    border-right: 14px solid #b8b8bc;
}

#calculator .smd-input {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-family: 'Courier New', Courier, monospace;
    font-size: 30px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    padding: 0;
    margin: 0;
}

#calculator .smd-input::placeholder {
    color: rgba(255, 255, 255, 0.15);
    letter-spacing: 0;
    font-size: 22px;
}

#calculator .error-msg {
    color: #ff6868;
    font-size: 16px;
    text-align: center;
    min-height: 16px;
    margin-bottom: 10px;
}

#calculator .result-box {
    // background-color: rgba(0, 0, 0, 0.25);
    padding: 12px;
    border-radius: 6px;
    // border: 1px dashed rgba(124, 124, 138, 0.25);
    text-align: center;
}

#calculator .result-label {
    display: block;
    font-size: 15px;
    color: #7c7c8a;
    text-transform: uppercase;
    margin-bottom: 4px;
}

#calculator .result-val {
    font-size: 24px;
    font-weight: 700;
    color: #04d361;
    text-shadow: 0 0 8px rgba(4, 211, 97, 0.15);
}

/* ==========================================================================
   ОБНОВЛЕННЫЕ СТИЛИ ПОДСКАЗОК (CALCULATOR-INFO)
   ========================================================================== */

#calculator .calculator-info {
    width: 100%;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #7c7c8a;
    box-sizing: border-box;
}

/* Центрированный общий заголовок */
#calculator .info-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    margin-bottom: 15px;
    width: 100%;
}

/* Контейнер двух колонок подсказок */
#calculator .info-columns {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

/* Индивидуальная колонка подсказок */
#calculator .info-col {
    flex: 1;
    min-width: 240px;
    font-size: 14px;
    color: #ffde6a;
    line-height: 1.6;
    text-align: left;
    box-sizing: border-box;
}

#calculator .info-col b {
    color: #e1e1e6;
}

/* ВЕРТИКАЛЬНЫЙ РАЗДЕЛИТЕЛЬ С ЭФФЕКТОМ ГРАДИЕНТА И БЛЕСКА */
.kit-feature-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    //width: 80px;
    flex-shrink: 0;
}

/* Линия со светящимся неоновым градиентом */
.kit-divider-line {
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, 
        transparent, 
        rgba(0, 114, 255, 0.4), 
        rgba(0, 255, 136, 0.4), 
        transparent
    );
    /* Эффект интенсивного хай-тек блеска вокруг оси */
    //box-shadow: 0 0 10px rgba(0, 255, 136, 0.3), 0 0 20px rgba(0, 114, 255, 0.2);
}

/* Шильдик текста VS */
.kit-divider-text {
    position: absolute;
    background: #1f1f31; /* Цвет в точности перекрывает линию сзади */
    color: #00ffcc;
    font-size: 50px;
    font-weight: 100;
    padding: 12px 0; /* Отступы сверху и снизу создают бесшовный разрыв линии */
    letter-spacing: 1px;
    z-index: 2;
}

/* Микро-фикс для радиокнопок внутри колонки ввода, чтобы они смотрелись аккуратно */
.mcu-switch-zone { display: flex; justify-content: center; gap: 25px; margin: 10px auto 0 auto; }
.mcu-radio { cursor: pointer; font-size: 13px; color: #7c7c8a; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.mcu-radio input[type="radio"] { accent-color: #04d361; margin: 0; }
.mcu-radio input[type="radio"]:checked + span { color: #ffffff; }

/* Микро-фикс для выравнивания таблицы результатов в правой колонке */
.mcu-result-grid { display: flex; flex-direction: column; gap: 10px; padding-top: 15px !important; }
.mcu-res-row { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #7c7c8a; padding-bottom: 6px; }
.mcu-res-row:last-child { border-bottom: none; }
.mcu-res-lbl { font-size: 16px; color: #7c7c8a; font-weight: 700; font-family: monospace; text-transform: uppercase; }
.mcu-res-val { font-family: 'Courier New', Courier, monospace; font-size: 28px; font-weight: 700; color: #04d361; word-break: break-all; text-align: right; }

/* ==========================================================================
   ДОБАВЛЕНО: СТРОГИЙ АДАПТИВНЫЙ РЕЖИМ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ (ДО 768px)
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Освобождаем фон body для комфортного вертикального скролла на смартфонах */
    body {
        height: auto !important;
        min-height: 100vh !important;
        width: 100% !important;
        overflow-y: auto !important;
        padding: 20px 10px !important;
        box-sizing: border-box !important;
    }

    /* 2. Делаем контейнер терминала гибким, чтобы он не зажимал калькулятор по высоте */
    .terminal-container {
        width: 100% !important;
        max-width: 480px !important; /* Идеальный размер под экран телефона */
        height: auto !important;     /* Сбрасываем жесткие 570px */
        padding: 15px !important;
        box-sizing: border-box !important; /* Фиксирует внутренние отступы */
    }

    /* 3. Перестраиваем колонки калькулятора в вертикальную стопку */
    #calculator {
        flex-direction: column !important;
        width: 100% !important;
        gap: 20px !important;
    }

    #calculator .calc-column {
        width: 100% !important;
        min-width: 100% !important;
        padding: 10px 0 !important;
    }

    /* 4. РАЗВЕРТЫВАНИЕ РАЗДЕЛИТЕЛЬНОЙ ЛИНИИ В ГОРИЗОНТАЛЬНОЕ ПОЛОЖЕНИЕ */
    .kit-feature-divider {
        width: 100% !important;
        height: 20px !important; /* Создаем небольшой зазор между блоками ввода и вывода */
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .kit-divider-line {
        width: 100% !important;  /* Линия растягивается по горизонтали */
        height: 1px !important;   /* Становится тонкой горизонтальной полосой */
        /* Разворачиваем светящийся неоновый градиент слева направо */
        background: linear-gradient(to right, 
            transparent, 
            rgba(0, 114, 255, 0.4), 
            rgba(0, 255, 136, 0.4), 
            transparent
        ) !important;
    }

    /* 5. Убираем или скрываем ненужные элементы на мобильной версии */
    .kit-divider-text {
        display: none !important; /* Прячем текст VS, так как на калькуляторе он не нужен */
    }

    /* 6. ИСПРАВЛЕНИЕ ВЫЛЕТА БЛОКА ПОДСКАЗОК (.calculator-info) */
    #calculator .calculator-info {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 15px 5px 0 5px !important;
    }

    #calculator .info-columns {
        flex-direction: column !important; /* Колонки описания встают друг под друга */
        gap: 15px !important;
        width: 100% !important;
    }

    #calculator .info-col {
        width: 100% !important;
        min-width: 100% !important;
        text-align: left !important;
    }

    /* 7. Оптимизация шрифтов результатов для мелких дисплеев (чтобы BIN код не ломал сетку) */
    .mcu-res-val {
        font-size: 20px !important; /* Уменьшаем с 28px, чтобы длинный двоичный код влезал в экран */
    }
}

/* ==========================================================================
   ИСПРАВЛЕНО: СТРОГАЯ МОБИЛЬНАЯ АДАПТАЦИЯ (НА ПК НИЧЕГО НЕ МЕНЯЕТСЯ)
   ========================================================================== */
@media (max-width: 768px) {
    /* Разрешаем перенос элементов ТОЛЬКО на экранах смартфонов */
    .controls {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 10px !important;
        height: auto !important;
        width: 100% !important;
    }

    /* Растягиваем кнопки и селектор до конца строки ТОЛЬКО на мобилках */
    .controls select, 
    .controls button {
        flex-grow: 1 !important;
        min-width: 100px !important;
    }

    /* Выравниваем чекбокс по центру ТОЛЬКО на мобилках */
    .hide-time-label {
        width: 100% !important;
        justify-content: center !important;
        margin: 5px 0 !important;
        font-size: 13px !important;
        margin-left: 0 !important;
    }

    /* Спускаем Mac OS индикаторы вниз по центру ТОЛЬКО на мобилках */
    .led-container {
        position: static !important; /* Отменяем Mac OS абсолют на смартфонах */
        width: 100% !important;
        justify-content: center !important;
        margin-top: 5px !important;
        padding-bottom: 10px !important;
    }

    /* Корректируем поле ввода логов под узкий экран телефона */
    #terminal {
        height: 250px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Поле ввода команды на всю ширину ТОЛЬКО на мобилках */
    #inputField {
        width: 100% !important;
        min-width: 100% !important;
        margin-bottom: 5px !important;
    }
}
