@media (max-width: 1200px){
    .result{
        margin-top: 2%;
        left: 0;
        max-width: 100%;
    }

    #img_huesos{
        display: none;
    }
}

@media only screen and (min-width: 800px){
    #grid_container_min {
        position: relative;
        max-width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        padding: 1%;
        align-items: start;
    }

    #guide{
        display: none;
    }
}

@media only screen and (min-width: 1200px){
    .grid_container {
        position: relative;
        max-width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        padding: 1%;
        align-items: start;
    }

    #guide{
        display: none;
    }
}

#img_huesos{
    display: block;
    width: 100%;
    height: auto;
    max-height: 560px;
    object-fit: contain;
    border-radius: 14px;
    border: 1px solid #d9e3dd;
    box-shadow: 0 6px 16px rgba(36, 49, 44, 0.06);
    background: #fff;
}

#card{
    position: relative;
    padding: 1em 1.1em;
    max-width: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #d9e3dd;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(36, 49, 44, 0.07);
    font-family: 'Roboto', Arial, sans-serif;
}

.form-grid{
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 18px;
    row-gap: 6px;
    align-items: start;
}

.label{
    display: block;
    overflow-wrap: break-word;
    font-size: 13px;
    font-weight: 600;
    color: #24312c;
    margin: 0;
}

.square{
    margin: 0.2em 0 0.45em 0;
    border-radius: 9px;
    border: 1px solid #d9e3dd;
    background: #fff;
    width: 100%;
    max-width: 100%;
    padding: 0.46em 0.7em;
    text-align: right;
    font-size: 14px;
    color: #24312c;
    outline: none;
    min-height: 36px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.square:focus{
    border-color: #6f9b8d;
    box-shadow: 0 0 0 3px rgba(111, 155, 141, 0.16);
}

#modelSelectorWrapper{
    margin-bottom: 2px;
}

#modelSelectorWrapper p,
#card p{
    font-size: 13px;
    line-height: 1.4;
    padding: 0.7em 0.85em;
    margin: 0.35em 0 0.5em 0;
}

.button-slot{
    display: flex;
    align-items: end;
}

.button-slot-left{
    justify-content: flex-start;
    margin-top: 0.1em;
}

.button-slot-right{
    justify-content: flex-start;
    margin-top: 0.1em;
}

.button{
    background-color: #2f5d50;
    border-radius: 10px;
    border: none;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 132px;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    padding: 10px 18px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 5px 12px rgba(47, 93, 80, 0.16);
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.button:hover{
    background-color: #244a3f;
    color: #fff;
    transform: translateY(-1px);
}

.button-secondary{
    background-color: #517a6d;
}

.button-secondary:hover{
    background-color: #3d6157;
}

.result{
    overflow-y: auto;
    position: relative;
    left: 0;
    padding: 0.85em 0.9em;
    max-width: 100%;
    background: #ffffff;
    border: 1px solid #d9e3dd;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(36, 49, 44, 0.07);
}

.result h3{
    text-align: center;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #2f5d50;
    margin: 0 0 0.55em 0;
}

.result li{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #f7faf8;
    border: 1px solid #d9e3dd;
    border-radius: 12px;
    padding: 0.6em 0.75em;
    margin-bottom: 0.55em;
    color: #24312c;
}

.result p{
    overflow-wrap: break-word;
    text-align: left;
    font-family: 'Roboto', Arial, sans-serif;
    background: #eef3f0;
    font-size: 14px;
    line-height: 1.4;
    padding: 0.75em 0.85em;
    border-radius: 10px;
    color: #24312c;
    margin: 0;
}

ol{
    font-family: 'Roboto', Arial, sans-serif;
    margin-left: 0;
    padding-left: 0;
    list-style-position: inside;
}

#guia_item{
    display: block;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

/* Ajuste específico cuando no aparece selector de modelo */
#card form:not(:has(#modelSelectorWrapper[style*="display: none"])) .form-grid {
    row-gap: 6px;
}

/* Tablet */
@media (max-width: 1024px){
    #card{
        padding: 0.95em;
    }

    .form-grid{
        column-gap: 14px;
        row-gap: 4px;
    }

    .label{
        font-size: 12.5px;
    }

    .square{
        min-height: 35px;
        padding: 0.42em 0.65em;
        margin-bottom: 0.42em;
    }

    .button{
        min-width: 118px;
        padding: 9px 15px;
    }

    #img_huesos{
        max-height: 520px;
    }
}

/* Móvil */
@media (max-width: 799px){
    .form-grid{
        grid-template-columns: 1fr;
    }

    .button-slot,
    .button-slot-left,
    .button-slot-right{
        justify-content: flex-start;
    }

    #card{
        padding: 1em;
    }

    .result{
        padding: 0.85em;
    }

    .result h3{
        font-size: 19px;
    }

    #img_huesos{
        max-height: none;
    }
}

.range-help{
    display: block;
    margin-top: -2px;
    margin-bottom: 6px;
    font-size: 11.5px;
    line-height: 1.3;
    color: #5b6b64;
}

.input-out-of-range{
    border-color: #c94b49 !important;
    background-color: #fff4f4 !important;
    box-shadow: 0 0 0 3px rgba(201, 75, 73, 0.14) !important;
}