/* === ИЗОЛИРОВАННЫЕ СТИЛИ КАЛЬКУЛЯТОРА СТОЛБИКОМ === */
.wp-calc-wrapper, .wp-calc-wrapper * { 
    box-sizing: border-box !important; 
    line-height: normal !important;
}
.wp-calc-wrapper {
    width: 100% !important; display: flex !important; justify-content: center !important; margin: 20px 0 !important;
}

/* Очистка паразитных тегов WordPress */
.wp-calc-wrapper p { margin: 0 !important; padding: 0 !important; display: inline !important; line-height: normal !important; }
.wp-calc-wrapper br { display: none !important; margin: 0 !important; padding: 0 !important; height: 0 !important; }

.wp-calc-wrapper .calculator {
    width: 100% !important; max-width: 550px !important; background: #ffffff !important; padding: 20px !important;
    border-radius: 12px !important; box-shadow: 0 4px 15px rgba(0,0,0,0.08) !important; border: 1px solid #e2e8f0 !important;
}
.wp-calc-wrapper h2 { font-size: 20px !important; margin: 0 0 20px 0 !important; text-align: center !important; color: #333333 !important; }

/* Настройки строки ввода для компьютера */
.wp-calc-wrapper .inputs { 
    display: flex !important; gap: 10px !important; margin-bottom: 20px !important; align-items: center !important; 
}
.wp-calc-wrapper input, .wp-calc-wrapper select, .wp-calc-wrapper button {
    font-size: 16px !important; height: 46px !important; border: 1px solid #ccc !important; border-radius: 6px !important; padding: 10px !important; background: #fff !important; color: #333 !important;
}
.wp-calc-wrapper input { width: 100% !important; flex: 2 !important; }
.wp-calc-wrapper select { width: 65px !important; flex: 0 0 65px !important; text-align: center !important; }
.wp-calc-wrapper button { background-color: #007bff !important; color: white !important; border: none !important; cursor: pointer !important; font-weight: bold !important; padding: 0 20px !important; flex: 1 !important; }
.wp-calc-wrapper button:hover { background-color: #0056b3 !important; }

.wp-calc-wrapper .output-container { width: 100% !important; overflow-x: auto !important; background-color: #fafafa !important; border: 1px solid #ccc !important; border-radius: 6px !important; padding: 15px !important; margin-top: 15px !important; }
.wp-calc-wrapper .math-box { font-family: 'Courier New', Courier, monospace !important; font-size: 22px !important; line-height: 1.4 !important; display: inline-block !important; white-space: pre !important; color: #111111 !important; }
.wp-calc-wrapper .inline-result { margin-top: 15px !important; padding-top: 15px !important; border-top: 1px dashed #ccc !important; font-size: 18px !important; font-weight: bold !important; color: #333 !important; }
.wp-calc-wrapper .error-msg { color: #dc3545 !important; font-weight: bold !important; text-align: center !important; padding: 10px !important; }

/* УПЛОТНЕННЫЕ НАСТРОЙКИ МОБИЛЬНОЙ ВЕРСИИ */
@media (max-width: 480px) {
    .wp-calc-wrapper .calculator {
        padding: 12px 8px !important;
    }
    /* Удерживаем элементы строго в одной горизонтальной линии */
    .wp-calc-wrapper .inputs {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 6px !important; /* Минимальный зазор между полями на телефоне */
    }
    .wp-calc-wrapper input {
        flex: 2 !important;
        min-width: 0 !important;
        padding: 5px !important;
        font-size: 15px !important;
    }
    .wp-calc-wrapper select {
        flex: 0 0 45px !important;
        width: 45px !important;
        padding: 5px !important;
        font-size: 16px !important;
    }
    .wp-calc-wrapper button {
        flex: 1 1 auto !important;
        padding: 0 8px !important;
        font-size: 14px !important;
    }
}
/* === НОВЫЙ БЛОК ДЛЯ КНОПКИ ВЫЧИСЛЕНИЯ СТОЛБИКОМ === */
.wp-calc-wrapper .btn-row {
    width: 100% !important;
    text-align: center !important; /* Центрируем кнопку на ПК */
    margin-top: 15px !important;   /* Делаем аккуратный школьный отступ сверху от инпутов */
    clear: both !important;
}

/* Стили для адаптивности на смартфонах */
@media (max-width: 480px) {
    .wp-calc-wrapper .inputs {
        justify-content: center !important;
        gap: 8px !important;
    }
    
    /* Заставляем кнопку на телефонах растянуться по ширине полей ввода */
    .wp-calc-wrapper .btn-row button {
        width: 100% !important;
        max-width: 260px !important; /* Кнопка станет точно такой же ширины, как инпуты на мобильном */
        height: 42px !important;
    }
}
