.customs-calc {
    font-family: "Manrope", system-ui, sans-serif;
    --color-primary: #0088c4;  /* LAB-TD фирменный */
    --color-accent:  #EF6E11;  /* Оранжевый */
    --border: 1px solid rgba(0,0,0,0.12);
}

/* --- layout --- */
.customs-calc .container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 5px;
}

.customs-calc .k-bg {
    background: #ffffff;
    padding: 40px 32px;
    border-radius: 16px;
    border: none;
    box-shadow: none;
}

/* --- GRID 3×2 --- */
.customs-calc .k-cacl {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
@media(max-width: 900px) {
    .customs-calc .k-cacl { grid-template-columns: repeat(2, 1fr); }
}
@media(max-width: 600px) {
    .customs-calc .k-cacl { grid-template-columns: 1fr; }
}

/* --- form items --- */
.customs-calc .k-label {
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
    text-align: left;
    font-size: 18px;
    white-space: nowrap;
}

.customs-calc input,
.customs-calc select {
    border: var(--border);
    border-radius: 15px;
    padding: 12px;
    width: 100%;
    text-align: center;
    transition: .15s;
    height: 48px;
    line-height: 48px;
    box-sizing: border-box;
    font-size: 16px;
}

.customs-calc input:focus,
.customs-calc select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,90,141,0.25);
}

.customs-calc input:hover,
.customs-calc select:hover {
    border-color: var(--color-primary);
}

/* Double input */
.customs-calc .k-power { display: flex; }
.customs-calc .k-halved-first  { flex: 70%; border-radius: 15px 0 0 15px;}
.customs-calc .k-halved-second { flex: 30%; border-radius: 0 15px 15px 0; max-width: 30%; }

/* Checkbox style */
.customs-calc .k-checkbox {
    display: flex;
    align-items: center;
    border: var(--border);
    border-radius: 8px;
    padding: 11px 14px;
    height: 48px;
}
.customs-calc .k-checkbox-input {
    transform: scale(1.2);
    margin-left: auto;
    cursor: pointer;
}

/* Блок EAES (по умолчанию скрыт полностью) */
.customs-calc .k-from-eaes {
    grid-column: 1 / -1;
    background: #f6f9ff;
    border: 1px solid rgba(0,122,255,0.2);
    border-radius: 8px;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    display: grid;
    max-height: 0;            /* визуально = НЕТ */
    opacity: 0;
    padding: 0 16px;          /* по вертикали убрано */
    overflow: hidden;
    transform: translateY(-10px);
    pointer-events: none;     /* отключаем взаимодействие */
    visibility: hidden;       /* выключаем из потока */

    transition:
            max-height .4s ease,
            opacity .4s ease,
            padding .4s ease,
            transform .4s ease,
            visibility .4s;
}

/* Включается красиво */
.customs-calc .k-from-eaes.visible {
    max-height: 600px;        /* достаточно под 2 строки */
    opacity: 1;
    padding: 16px;            /* Появляется СВЕРХУ */
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;      /* теперь участвует */
}


/* === TOGGLE SWITCH === */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 100%;
    height: 48px;
    cursor: pointer;
}
.toggle-switch input { display: none; }
.toggle-switch .slider {
    position: absolute;
    inset: 0;
    background: #cccccc;
    border: var(--border);
    border-radius: 8px;
    transition: .3s;
    display: flex;
    align-items: center;
    padding: 4px;
}
.toggle-switch .slider::before {
    content: "";
    width: 50%;
    height: 100%;
    background: #ffffff;
    border-radius: 6px;
    transition: .3s;
}
.toggle-switch input:checked + .slider {
    background: #005A8D;
}
.toggle-switch input:checked + .slider::before {
    transform: translateX(100%);
}
.toggle-switch .slider::after {
    content: "Нет";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #555555;
    font-weight: 600;
    font-size: 14px;
}
.toggle-switch input:checked + .slider::after {
    content: "Да";
    left: 14px;
    right: auto;
    color: #ffffff;
}

/* Button */
.customs-calc .k-button-to-left {
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: row;
    gap: 20px;
}
.customs-calc .btn {
    background: #EF6E11;
    color: #ffffff;
    font-size: 16px;
    padding: 12px 32px;
    border: none;
    cursor: pointer;
    transition: .2s;
}
.customs-calc .btn:hover {
    background: #d45f0e;
}

/* Tabs */
.report-tabs {
    display: flex;
    gap: 10px;
    /*margin-bottom: 12px;*/
    /*border-bottom: var(--border);*/
}
.report-tabs button {
    background: #EAF3FF;
    color: #1C4E91;
    padding: 10px 18px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
}
.report-tabs button.active {
    background: #ffffff;
    border-color: #0088c4;
    color: #0088c4;
    border-bottom: none;
}
.report-tabs button:hover {
    text-decoration: underline;
}

/* Report container */
.report-content {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    /*border: var(--border);*/
    min-height: 120px;
}

/* Report block */
.report-block {
    width: 100%;
    max-width: 100%;
    background: none;
    box-shadow: none;
    border: none;
    padding: 0;
}

/* GRID внутри отчёта */
.report-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    width: 100%;
    margin-top: 10px;
}
@media(max-width: 700px) {
    .report-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

}

.cell {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.cell .name   { font-weight: 600; }
.cell .value  { margin-top: 2px; font-weight: 500; }
.cell .comment {
    margin-top: 4px;
    font-size: 13px;
    color: #666666;
}
.cell.total {
    font-weight: 700;
    border-bottom: none;
}

/* === FINISH: LAB-TD STYLE IMPROVEMENTS === */
.customs-calc h3 {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.3px;
    /*color: #0088c4;*/
}

.customs-calc .k-bg {
    padding: 32px 24px;
}
.report-content { padding: 12px; }

/* === MOBILE FIX: tabs full-width === */
@media (max-width: 600px) {
    .report-tabs {
        flex-direction: column;
        gap: 6px;
        border-bottom: none;
        margin-bottom: 12px;
    }

    .report-tabs button {
        width: 100%;
        border-radius: 6px;
        border-bottom: var(--border); /* видимый бордер */
    }

    /* Активная вкладка – с фирменным цветом */
    .report-tabs button.active {
        border-bottom: 1px solid #0088c4; /* LAB-TD цвет */
        color: #0088c4;
        background: #ffffff;
    }
    .btn {
        width: 100%;
    }

    .customs-calc .k-button-to-left {
        margin-top: 20px;
        margin-bottom: 20px;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
}

/* === Итоговые строки в отчёте === */
.cell.total {
    background: #0088c4;
    color: #ffffff;
    padding: 14px 16px;
    border-radius: 8px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.comment {
    white-space: pre-line;
}
.cell-wide {
    grid-column: span 2;
}
.country-select {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.country-select button {
    background: #EAF3FF;
    color: #1C4E91;
    padding: 10px 18px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
}

.country-select button:hover {
    background: #1C4E91;
    color: #fff;
}

.country-select button.active {
    background: #1C4E91;        /* твой фирменный цвет */
    color: #fff;
}

select.k-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: none;
    border: 1px solid #e3e3e3;
    border-radius: 12px;

    height: 48px;
    padding: 0 14px;
    box-sizing: border-box;

    font-size: 16px;
    font-family: inherit;
    line-height: 48px;
}

.k-power {
    display: flex;
    align-items: center;
}
select.k-input,
select[name="mpt-average"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: none !important;

    height: 48px;
    padding: 0 14px;
    line-height: 48px;
    width: 100%;
    border: 1px solid #e3e3e3;
    border-radius: 12px;
    font-size: 16px;
    box-sizing: border-box;
}

select.k-input option,
select[name="mpt-average"] option {
    text-align: center;
    padding-left: 12px;
}

.k-select-wrapper {
    position: relative;
}

.k-select-wrapper::after {
    content: "";
    font-size: 12px;
    color: #888;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* === FIX FOR 320px MOBILE VIEW === */
@media (max-width: 340px) {

    .customs-calc .container {
        padding: 0 2px;              /* уменьшили поля */
    }

    .customs-calc .k-bg {
        padding: 20px 12px;          /* мягче внутри */
        box-sizing: border-box;
        max-width: 100%;
        overflow-x: hidden;
    }

    .k-label {
        white-space: normal;         /* разрешаем перенос строк */
        font-size: 16px;
    }

    .country-select button {
        padding: 8px 12px;           /* уменьшить */
        font-size: 13px;
    }

    .customs-calc input,
    .customs-calc select {
        font-size: 14px;
        height: 44px;
    }

    .toggle-switch {
        width: 100%;                 /* гарант ширины */
        max-width: 100%;
    }

    .k-from-eaes {
        padding: 12px !important;
        display: flex !important;
        flex-direction: column;
    }
}
/* === FULL MOBILE FIX (на 320px и ниже) === */
@media (max-width: 340px) {
    html, body {
        max-width: 100vw;
        overflow-x: hidden !important;
    }

    .customs-calc .container,
    .customs-calc .k-bg {
        max-width: 100vw !important;
        padding: 12px !important;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .k-cacl,
    .k-from-eaes,
    .report-content,
    .report-tabs,
    .k-power,
    input,
    select {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Критичный фикс: текст перестаёт выезжать */
    .k-label,
    .country-select button {
        white-space: normal !important;
        font-size: 14px !important;
    }

    /* Из-за ::after уехало вправо — фикс */
    .toggle-switch .slider::after {
        font-size: 12px;
        right: 6px !important;
    }

    /* Уменьшаем padding у кнопок */
    .country-select button {
        padding: 6px 10px !important;
    }
}
.example-cars {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.example-btn {
    background: #EAF3FF;
    color: #1C4E91;
    padding: 10px 18px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
}

.example-btn:hover {
    background: #1C4E91;
    color: #fff;
}

/* ——— СТИЛЬ ТОЛЬКО ДЛЯ этого чекбокса ——— */
#eaes-wrapper .eaes-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;          /* убираем рамку */
}

/* чекбокс как текст — по размеру шрифта */
#eaes-toggle {
    width: 1.2em;
    height: 1.2em;
    cursor: pointer;
    accent-color: var(--color-primary);   /* фирменный цвет */
}

/* подпись — слева, чекбокс справа */
#eaes-wrapper .eaes-checkbox span {
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
}
.full-row {
    flex-direction: row !important;
    gap: 20px;
    display: flex;
    .k-label {
        margin-bottom: 0px !important;
    }
}

.full-row.visible {
    display: flex !important;
}

.info-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: #007bff;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    margin-left: 6px;
}

/* Модальное окно */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6);
    display: none; /* скрыто */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;
    max-width: 600px;
    max-height: 90vh;
    overflow: auto;
    border-radius: 8px;
}

.modal-content img {
    max-width: 100%;
    display: block;
    margin-bottom: 10px;
}

.modal-close {
    display: block;
    text-align: right;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
}
.welcome-box {
    padding: 20px;
    background: #f8f8f8;
    border-radius: 6px;
}

.example-cars {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}
.recycle-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.recycle-table th,
.recycle-table td {
    border: 1px solid #ddd;
    padding: 4px 6px;
    text-align: center;
}

.recycle-table tr.recycle-active {
    background: #EAF3FF;
    font-weight: 600;
}


.modal-content {
    
    h4 {
    font-weight: 700;
    font-size: 20px;
}
    p b {
        font-weight: 600;
    }
}
.example-title {
    margin-bottom: 8px;
    font-size: 22px;
}

.back-to-list {
    display: inline-block;
    margin-bottom: 12px;
    color: #0088c4;
    cursor: pointer;
    text-decoration: none;
}

.example-note {
    background: #f6f9ff;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

@media(max-width: 600px) {
    .back-to-list {
    margin-top: 14px;
    width: 100%;
}

}
/* Описание таблиц */
.table-description {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Крестик — в угол справа */
.modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 10px;
    line-height: 1;
}
.modal-content {
    position: relative;
    padding-top: 20px !important; /* чтобы не липло */
}
.input-tooltip {
    position: fixed;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.15);
    padding: 14px 16px;
    border-radius: 10px;
    max-width: 90vw;
    width: max-content;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease;
}
.input-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
/* === ANIMATION: report block fade-in === */
.report-appear {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .4s ease, transform .4s ease;
}
.report-appear.show {
    opacity: 1;
    transform: translateY(0);
}

/* === ANIMATION: stagger cells === */
.cell {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .35s ease, transform .35s ease;
}
.cell.cell-show {
    opacity: 1;
    transform: translateY(0);
}
