/*
 * Do Progetto / English Reservation (page ID 465, CF7 ID 478)
 * Smartphone-only, enqueued exclusively on the administrator preview.
 * Presentation only: no changes to CF7 fields, validation or delivery.
 */
@media screen and (max-width: 600px) {
    /* Make room for input controls: the old English stylesheet adds 50px. */
    #form_area {
        width: 100% !important;
        max-width: 100%;
        margin: 16px 0 24px !important;
        padding: 0;
        box-sizing: border-box;
        font-size: 14px;
        line-height: 1.7;
    }

    #form_area .wpcf7,
    #form_area form {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Outer CF7 table only. Leave equipment table to its own rules below. */
    #form_area #info2,
    #form_area #info2 > tbody,
    #form_area #info2 > tbody > tr,
    #form_area #info2 > tr {
        display: block !important;
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    #form_area #info2 {
        border-spacing: 0 !important;
        margin: 0;
        overflow: visible !important;
    }

    #form_area #info2 > tbody > tr,
    #form_area #info2 > tr {
        margin: 0 0 16px;
    }

    #form_area #info2 > tbody > tr > td,
    #form_area #info2 > tr > td {
        display: block !important;
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        padding: 0 !important;
        margin: 0;
        box-sizing: border-box;
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.65;
        font-size: 14px;
    }

    #form_area #info2 > tbody > tr > td:first-child:not([colspan]),
    #form_area #info2 > tr > td:first-child:not([colspan]) {
        margin: 0 0 6px;
        font-weight: 600;
    }

    #form_area #info2 > tbody > tr > td[colspan],
    #form_area #info2 > tr > td[colspan] {
        margin: 5px 0 0;
        font-weight: normal;
    }

    /* Full-width text fields and textareas, but keep date selects compact. */
    #form_area input.text_form,
    #form_area textarea.area_form,
    #form_area input[type="text"],
    #form_area input[type="email"] {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        padding: 10px 11px;
        margin: 2px 0 0;
        box-sizing: border-box;
        font-size: 16px;
        line-height: 1.5;
        border: 1px solid #a0a0a0;
        border-radius: 3px;
    }

    #form_area textarea.area_form {
        min-height: 175px;
        resize: vertical;
    }

    #form_area #info2 select {
        display: inline-block;
        width: auto;
        max-width: 100%;
        min-height: 36px;
        margin: 3px 3px 3px 1px;
        padding: 3px 1px;
        box-sizing: border-box;
        font-size: 14px;
        vertical-align: middle;
    }

    #form_area #info2 .text_70 {
        font-size: 13px;
        line-height: 1.65;
        margin: 0 0 8px;
    }

    #form_area input[type="file"] {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        font-size: 13px;
        line-height: 1.6;
        margin: 3px 0 0;
    }

    /* Purpose / receipt choices: full-row, finger-friendly controls. */
    #form_area #info2 .wpcf7-list-item {
        display: block;
        margin: 0 0 5px !important;
    }

    #form_area #info2 .wpcf7-list-item label {
        display: inline-flex;
        align-items: flex-start;
        gap: 8px;
        min-height: 35px;
        padding: 6px 0;
        box-sizing: border-box;
        line-height: 1.55;
    }

    #form_area #info2 input[type="checkbox"] {
        flex: 0 0 auto;
        width: 17px;
        height: 17px;
        margin: 2px 0 0;
    }

    /* Equipment subtable: two columns, not the outer table's block layout. */
    #form_area #info2 table,
    #form_area #info2 table > tbody {
        display: block !important;
        width: 100% !important;
        max-width: 100%;
        overflow: visible !important;
        box-sizing: border-box;
        border-spacing: 0;
    }

    #form_area #info2 table > tbody > tr,
    #form_area #info2 table > tr {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(106px, 42%);
        gap: 10px;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #eee;
    }

    #form_area #info2 table > tbody > tr > td,
    #form_area #info2 table > tr > td {
        display: block !important;
        width: auto !important;
        max-width: 100%;
        min-width: 0;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 13px;
        font-weight: normal;
        line-height: 1.5;
        box-sizing: border-box;
        overflow-wrap: anywhere;
    }

    #form_area #info2 table > tbody > tr > td:last-child,
    #form_area #info2 table > tr > td:last-child {
        text-align: right;
    }

    #form_area #info2 table select {
        min-height: 35px;
    }

    /* Required notice + submit action. */
    #form_area #cout {
        display: block;
        position: static;
        float: none;
        width: auto !important;
        max-width: 100%;
        margin: 12px 0 8px !important;
        padding: 0;
        font-size: 12px;
        line-height: 1.6;
    }

    #form_area input[type="submit"] {
        display: block;
        width: 100% !important;
        max-width: 100%;
        min-height: 48px;
        padding: 11px 14px;
        margin: 8px 0 0;
        box-sizing: border-box;
        border: 1px solid #d8bec5;
        border-radius: 3px;
        background: #faf7f8;
        color: #903;
        font-size: 16px;
        font-weight: bold;
        cursor: pointer;
    }

    #form_area .wpcf7-not-valid-tip,
    #form_area .wpcf7-response-output {
        font-size: 13px;
        line-height: 1.6;
        overflow-wrap: anywhere;
    }
}
