@media (max-width: 520px) and (max-height: 300px) {
    /* General adjustments for small screens */
    h1, h2 {
        margin-bottom: 10px;
        font-size: 18px;
    }
    
    .small-screen-title {
        position: absolute;
        top: 5px;
        left: 0;
        width: 100%;
        text-align: center;
        margin: 0;
        padding: 5px 0;
        font-size: 16px;
    }
    
    .small-screen-layout {
        padding: 10px;
    }
    
    input[type="text"], input[type="tel"] {
        margin-bottom: 10px;
        padding: 8px;
        font-size: 16px;
    }
    
    button {
        padding: 8px 20px;
        font-size: 14px;
        min-width: 120px;
        margin-top: 5px;
    }
    
    /* Specific for camera view in landscape mode */
    .small-screen-flex-container {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        height: calc(100% - 30px);
        margin-top: 25px;
    }
    
    .small-screen-camera {
        width: 50%;
        height: 100%;
        margin-bottom: 0;
        margin-right: 10px;
    }
    
    .small-screen-controls {
        width: 46%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .small-screen-checkbox {
        width: 100% !important;
        max-width: none !important;
        padding: 8px !important;
        margin-bottom: 5px !important;
        font-size: 10px !important;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .small-screen-checkbox p, 
    .small-screen-checkbox label {
        font-size: 10px !important;
        margin-bottom: 5px !important;
        line-height: 1.2 !important;
    }
    
    .small-screen-checkbox div {
        gap: 6px !important;
    }
    
    .small-screen-capture-btn {
        margin-top: 5px !important;
    }
    
    .small-screen-icon {
        width: 40px !important;
        height: 40px !important;
    }
    
    /* For name and phone entry */
    .content-foreground.small-screen-layout {
        padding-top: 0;
        padding-bottom: 0;
    }
    
    .input-container {
        margin-bottom: 10px;
    }
}

/* Even smaller screens */
@media (max-width: 520px) and (max-height: 300px) {
    .small-screen-camera {
        width: 45%;
    }
    
    .small-screen-controls {
        width: 52%;
    }
    
    .small-screen-checkbox {
        padding: 5px !important;
    }
    
    .small-screen-checkbox p, 
    .small-screen-checkbox label {
        font-size: 9px !important;
    }
    
    .small-screen-icon {
        width: 35px !important;
        height: 35px !important;
    }
}

/* Sound consent overlay updated styles */
#sound-consent-overlay p {
    font-size: 12px;
    margin-bottom: 6px;
    max-width: 600px;
    color: #0e3366;
}

#sound-consent-overlay h2 {
    font-size: 20px;
    margin-bottom: 13px;
    color: #0e3366;
}

#consent-button {
    padding: 11px 26px;
    background-color: #003366;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Make sound consent overlay responsive for small screens */
@media (max-width: 520px) and (max-height: 300px) {
    #sound-consent-overlay {
        width: 80%;
        padding: 15px;
    }
    
    #sound-consent-overlay h2 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    #sound-consent-overlay p {
        font-size: 10px;
        margin-bottom: 4px;
    }
    
    #consent-button {
        padding: 8px 20px;
        font-size: 12px;
    }
    .name-overlay-text {
        display: inline-block;
        background-color: white;
        opacity: 0.8;
        color: #113a72;
        font-size: 12px;
        padding: 15px 20px;
        border-radius: 20px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        font-weight: bold;
    }
    #take-photo-btn {
        margin-top: 5px;
    }
    p {
        margin-bottom: 10px;
    }
    .hand-examples {
        display: flex
    ;
        justify-content: center;
        margin-bottom: 5px;
        width: 100%;
        gap: 15px;
    }
    
}
