* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html{
    text-align: center;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding: 20px;
    margin: 0 auto;
    display: block;
    width: 100%;
    text-align: left;
    max-width: 64rem;
    -webkit-text-size-adjust: 100%;
}

h1 {
    color: #2c3e50;
    padding-bottom: 10px;
    margin-top: 30px;
}

h2 {
    color: #2980b9;
    margin-top: 25px;
    padding-left: 10px;
    border-left: 4px solid #3498db;
}



/*ul, ol {*/
/*    padding-left: 20px;*/
/*    margin-bottom: 20px;*/
/*}*/

/*li {*/
/*    margin-bottom: 8px;*/
/*}*/

/*ul li {*/
/*    display: inline;*/
/*}*/

.feature-list li {
    background-color: #e8f4fc;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

table { border-collapse: collapse;}
th, td { border: 1px solid #ddd; padding: 0.4rem; text-align: center; }
th { background-color: #f2f2f2; font-weight: normal;  }
td input[type="number"], td select {
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    width: 80%;
    margin: 0;
    padding: 0;
}
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}
input[type="date"],
input[type="number"],
input[type="text"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 0.25rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    background-color: white;
}
input[type="number"]{
    max-width: 5rem;
    text-align: right;
}

input[type="date"]:focus,
input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}
/*button {*/
/*    background-color: #4a90e2;*/
/*    color: white;*/
/*    border: none;*/
/*    padding: 0.75rem 1.5rem;*/
/*    border-radius: 6px;*/
/*    font-size: 1rem;*/
/*    font-weight: 500;*/
/*    cursor: pointer;*/
/*    transition: all 0.3s ease;*/
/*    display: inline-block;*/
/*    margin: 0.5rem 0;*/
/*}*/

/*button:hover {*/
/*    background-color: #3a7cd6;*/
/*    transform: translateY(-2px);*/
/*    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);*/
/*}*/

/*button:active {*/
/*    transform: translateY(0);*/
/*}*/

/* Layout Sections */
.input-section {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 0rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    max-width: 100%;
}
input:invalid:required {
    border: 2px solid #ff8686;
}
input.invalid{
    border: 2px solid #ff8686;
}
/* Увеличение расстояния от цифр до кнопок */
/* Для Chrome и Safari */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin-left: 0.5rem;
}
.weight_input::-webkit-inner-spin-button,
.weight_input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    height: 0;
    opacity: 0;
}

/* Для Firefox */
input[type="number"] {
  margin-left: 0.5rem;
}
/* .weight_input{
    -moz-appearance: textfield;
} */

/* Для IE и Edge */
input[type="number"]::-ms-clear {
  margin-left: 0.5rem;
}
.weight_input::-ms-clear {
    display: none;
}
.site-head{
    border-bottom: 2px solid #2c3e50;
    padding: 8px;
}

a {
    color: #0088cc; /* Приятный синий */
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    font-weight: 500;
    font-size: large;
}
a.button {
    background-color: #4a90e2;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 0.5rem 1rem;
}

/* Эффект подчеркивания при наведении */
a:hover {
    color: #005a99; /* Более темный синий */
}

/* Тонкое подчеркивание */
a.thin-underline {
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px;
    transition: background-size 0.3s, color 0.3s;
}

a.thin-underline:hover {
    background-size: 100% 1px;
}

/* Дополнительные состояния */
a:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 2px;
}

a:active {
    transform: scale(0.98);
}


/* Date Input Section */
.date-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.date-input-group {
    flex: 1;
    min-width: 200px;
}

/* Gender Selector */
.gender-selector {
    display: flex;
    margin: 0.2rem 0;
    gap: 0.5rem;
}

.gender-selector label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.gender-selector input[type="radio"] {
    margin-right: 0.2rem;
}

.date-row-bs input[type="date"] {
    width: 100%;
    min-width: 0;
}

@media (max-width: 360px) {
    .date-row-bs {
        --bs-gutter-x: 0.35rem;
    }

    .date-row-bs label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .date-row-bs input[type="date"] {
        font-size: 1rem;
        padding: 0.2rem 0.35rem;
    }
}

.male-border {
    border: skyblue 4px solid;
}

.female-border {
    border: lightpink 4px solid;
}
/* 
.male-lb{
    border-left: skyblue 8px solid;
} */



.male-bg {
    background-color: skyblue;
    border-left: skyblue 8px solid;
}

.female-bg {
    background-color: lightpink;
    border-left: lightpink 8px solid;
}

/* Age Display */
.age-display {
    background-color: #e8f4fd;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-weight: 500;
    border-left: 4px solid #4a90e2;
}

.sds-ok {color: green}
.sds-notok {color: #ff0000
}
.poor-ratio {color: orange}
.ok-ratio {color: black}
#results {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.instructions {
    background-color: #f0f7ff;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
    border: 1px solid #d0e3ff;
}

.definitions {
    background-color: #f0f7ff;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
    border-left: 5px solid #d0e3ff;
}

.definition-item {
    margin-bottom: 15px;
}
#notions {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.hidden-element {
    display: none !important;
}
[hidden]{
    display: none;
}

.shown-element {
    display: initial !important;
}
.sex-formula-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
}

.sex-formula-item {
    flex: 1 1 0;
    min-width: 0;
}

.sex-formula-group {
    display: flex;
    flex: var(--group-items, 1) 1 0;
    min-width: 0;
    gap: 0.5rem;
}

.hidden-row {
    display: none !important;
}
.nbtd
{
    padding: 0;
    margin: 0;
}
/* Smooth transitions for dynamic changes */
#mainInputTable tr,
#mainInputTable th,
#mainInputTable td {
    transition: all 0.3s ease-in-out;
}
 @media (max-width: 768px) {

    #results,
    #notions,
    .input-section {
        display: block !important;
        max-width: 100%;
    }

    .tabs-container,
    .tabs-content {
        width: 100%;
        max-width: 100%;
    }

    .tabs-nav {
        flex-wrap: wrap;
    }

    #results table,
    #notions table,
    .input-section table {
        width: 100%;
        max-width: 100%;
        table-layout: auto;
    }

    #results th,
    #results td,
    #notions th,
    #notions td,
    .input-section th,
    .input-section td {
        white-space: normal;
        overflow-wrap: break-word;
    }

    .mobile-table-fit-wrap {
        width: 100%;
        overflow: hidden;
    }

    .mobile-table-fit-table {
        transform-origin: top left;
        will-change: transform;
    }

    #sex_formula_section .form-select {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: none !important;
        padding-right: 0.75rem; /* чтобы не оставалось лишнего места под стрелку */
    }

    #sex_formula_section .form-select:focus {
        background-image: none !important;
    }



    /*.date-inputs {
        flex-direction: column;
        gap: 1rem;
    }

    .gender-selector {
        gap: 0.5rem;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    th, td {
        padding: 0.5rem;
    }
*/

} 
     /* Custom Radio Buttons */
input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 50%;
    outline: none;
    margin-right: 8px;
    position: relative;
    cursor: pointer;
}

input[type="radio"]:checked {
    border-color: #4a90e2;
    background-color: #4a90e2;
}

input[type="radio"]:checked::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    margin-bottom: 0;
}
.telegram-link {
    color: #0088cc;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.telegram-link:before {
    content: "\f2c6";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}
.telegram-link:hover {
    color: #005a99;
}
.section-icon {
    margin-right: 0.75rem;
    color: #4a90e2;
    font-size: 1.25rem;
}

/* Copy Button Specific Styles */
#copyButton {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 0.5rem 1rem;
}

#copyButton:hover {
    background-color: #218838;
}

/* Animation for Results */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#results {
    animation: fadeIn 0.5s ease-out;
}

/* Основной контейнер */
.tabs-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
}
div.tabs-nav {
    padding: 0;
    margin: 0;
    border-bottom: none;
    display: inline-block;
}
/*!* Стили для навигации *!*/
ul.tabs-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid #ccc;
}

.tabs-nav li {
    margin-right: 5px;
    margin-bottom: 0;
}

.tabs-nav a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    transition: all 0.3s ease;
}

.tabs-nav a:hover {
    background-color: #e9e9e9;
}

.tabs-nav a.active {
    background-color: white;
    border-bottom: 1px solid white;
    margin-bottom: -1px;
    color: #0066cc;
}

/* Стили для контента */
.tabs-content {
    border: 1px solid #ccc;
    border-top: none;
    padding: 20px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Allow the tab container to wrap to multiple rows */
#calcTabs {
    margin-bottom:0;
    flex-wrap: nowrap;
}

/* Allow text inside the buttons to wrap into multiple lines */
#calcTabs .nav-link {
    margin-bottom:0;
/*    white-space: normal;      !* Allows text to wrap *!*/
/*    height: 100%;             !* Ensures all tabs in a row have equal height visually *!*/
/*    min-width: 120px;         !* Prevents tabs from becoming too skinny *!*/
/*    display: flex;*/
/*    align-items: center;      !* Centers text vertically if one tab is longer than others *!*/
/*    justify-content: center;*/
/*    text-align: center;*/
/*    line-height: 1.2;         !* Tightens line spacing for multi-line names *!*/
}

/*#calcTabs li.active{*/
/*    border-bottom:white 2px;*/
/*}*/

.meal-content {
    line-height: 1.5;
}

/* Класс для скрытия столбцов */
.hidden-column {
    display: none;
}

/*Cookie warning */
.cookie_warning {
    position: fixed;
    bottom: 0;
    left: 0;
    display: none;
    justify-content: center;
    width: 100%;
    padding: 30px;
    box-sizing: border-box;
    background-color: #e8f4fd;
}

.cookie_warning--active {
    display: flex;
}

.cookie_warning__text {
    margin-right: 30px;
}

.cookie_warning__read {
    display: block;
    margin-left: 15px;
}

.measurements-fit-wrap {
    width: 100%;
    overflow: hidden;
}

.measurements-fit-scale {
    transform-origin: top left;
    will-change: transform;
}

.measurements-table {
    margin-bottom: 0;
}

.measurements-table th,
.measurements-table td {
    padding: 0.3rem 0.35rem;
    font-size: 0.92rem;
}

.measurements-table th {
    line-height: 1.2;
}

.measurements-open-btn {
    white-space: nowrap;
}

@media (max-width: 768px) {
    #calcTabs {
        flex-wrap: nowrap;
        gap: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    #calcTabs .nav-item {
        flex: 0 0 7rem;
    }

    #calcTabs .nav-link {
        margin-bottom: 0;
        white-space: normal;
        overflow-wrap: break-word;
        word-break: normal;
        line-height: 1.2;
        font-size: 0.76rem;
        padding: 0.3rem 0.4rem;
    }

    .measurements-table {
        width: 100%;
        table-layout: auto;
    }

    .measurements-table th,
    .measurements-table td {
        padding: 0.14rem 0.18rem;
        font-size: 0.82rem;
        line-height: 1.25;
        vertical-align: middle;
        white-space: normal;
        overflow-wrap: normal;
        word-break: normal;
        hyphens: manual;
    }

    .measurements-open-btn {
        padding: 0.15rem 0.35rem;
        font-size: 0.75rem;
    }

    .measurements-open-label {
        display: none;
    }

    .measurements-pagination {
        flex-wrap: wrap;
        row-gap: 0.35rem;
    }
}