.tool-actions {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    display: flex;
    gap: 0.4rem;
    z-index: 10;
}

.tool-actions-area {
    position: relative;
    display: flex;
    justify-content: end;
}

.tool-error-message {
    position: absolute;
    left: 0;
    bottom: 0;
    max-width: 50%;
    padding-right: 0.5rem;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: none;
    margin: 0;
    display: block;
}

.tool-error-message.is-visible{
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.custom-h3-margin {
    margin-top: 0.3rem;
    margin-bottom: -0.1rem;
}

.tbh-form.is-expanded .tool-actions {
    display: flex;
}

.tbh-form {
    width: unset !important;
    position: relative;
    background: radial-gradient(circle at 18% 12%,
    rgba(80,130,220,0.28) 0%,
    rgba(80,130,220,0.12) 32%,
    transparent 62%);
    padding: 0 1.5rem 1.2rem 1.5rem;
    border-radius: 1rem;
    border-top: 1px solid #2c3f68;
    border-right: 1px solid #5082dc;
    border-bottom: 5px solid #2c3f68;
    border-left: 5px solid #2c3f68;
    box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.06),
            0 8px 18px rgba(0,0,0,0.22),
            0 0 0 1px rgba(80,130,220,0.12);
    .tbh-header,
    .tbh-sub-header {
        background: linear-gradient(
                90deg,
                #0a101e 0%,
                #1c2d55 40%,
                #3b4c7a 80%,
                #5082dc 100%
        );
        box-shadow:
                inset 0 1px 0 rgba(255,255,255,0.06),
                0 8px 18px rgba(0,0,0,0.35);
        text-align: center;
    }

    .tbh-header {
        padding: 0.5rem 0.5rem 0.9rem;
        border-radius: 1rem 1rem 0 0;
        margin-left: -1.8rem;
        margin-right: -1.55rem;
        margin-top: -0.07rem !important;
    }

    .tbh-sub-header {
        padding: 0.5rem;
        border-radius: 0 2rem 2rem 0;
        margin-left: -1.8rem;
    }
}

.radio {
    width: 1.2rem !important;
    height: 2.27rem !important;
}

.bmr-results-input {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem;
    text-align: center;
    background:
            linear-gradient(
                    180deg,
                    rgba(80,130,220,0.35),
                    rgba(60,90,160,0.22)
            );
    border: 1px solid rgba(80,130,220,0.65);
    border-radius: 2rem;
    box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.35),
            0 6px 14px rgba(0,0,0,0.18);
    margin: 0.4rem auto 1rem auto;
}

.bmr-results-input {
    animation: resultFadeIn 0.55s ease-out both;
}

@keyframes resultFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tbh-health-form {
    display: flex;
    justify-content: center;
    position: relative;
}

.health-bmi-result,
.health-fat-result,
.health-bmr-result,
.bmr-explanation,
.health-section {
    align-content: center;
}

.health-section {
    font-weight: bold;
    font-size: 0.8rem;
    line-height: 1.2;
    padding: 0 1rem;
}

.health-bmi-result,
.health-fat-result,
.health-bmr-result {
    display: none;
}

.pale-blue {
    background-color: #c6d6da;
}

.light-blue {
    background-color: #4cc2df;
}

.green {
    background-color: #4eb74a;
}

.light-orange {
    background-color: #f69a21;
}

.orange {
    background-color: #f27e1c;
}

.red {
    background-color: #f5473e;
}

.health-scale {
    display: grid;
    grid-template-columns: 20% 20% 20% 20% 20%;
    width: 100%;
    height: 3rem;
    position: relative;
}

.health-marker {
    position: absolute;
    top: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #ffcc00;
    padding: 0.5rem 1rem;
    border-radius: 50%;
    font-weight: bold;
    color: black;
    font-size: 0.8rem;
    text-align: center;
    display: inline-block;
    transition: left 0.5s ease, top 0.5s ease;
}

.health-marker::after {
    content: "";
    position: absolute;
    bottom: -0.4rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #ffcc00;
}

/* Used in script */
.test-result-transition {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out, max-height 0.4s ease-out;
}

.test-result-visible {
    opacity: 1;
    transform: translateY(0);
    max-height: 100vh;
    overflow: visible;
}

@media screen and (max-width: 600px) {
    .health-section {
        padding: 1rem 0;
        height: 3rem;
    }

    .health-scale {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(5, auto);
        height: auto;
        overflow: visible;
    }

    .health-marker {
        left: -1rem;
        transform: translate(0, -50%);
    }

    .health-marker::after {
        left: 95%;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-left: 10px solid #ffcc00;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
    }
}

@media screen and (max-width: 425px) {
    .tbh-form {
        padding: 0 1rem 1rem 1rem;
    }

    .tbh-sub-header {
        margin-left: -1rem !important;
        margin-right: 0 !important;
    }

    .tbh-header {
        margin-left: -1.3rem !important;
        margin-right: -1rem !important;
    }
}