/* Aplicado depois da interface comum: campos nativos preservam teclado e escrita do SO. */
.report-editor :is(input.control, textarea.control, select.control) {
    font-size: 16px;
    line-height: 1.6;
    min-height: 52px;
    scroll-margin-block: 140px 100px
}

.report-editor textarea.control {
    min-height: 120px;
    max-height: 640px;
    resize: vertical;
    overflow-y: auto
}

.report-editor :is(button, .button, .report-na, summary) {
    min-height: 48px;
    touch-action: manipulation
}

.report-editor input[type=checkbox] {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin: 8px 10px 8px 0
}

.inspection-media {
    border-top: 1px solid var(--line);
    padding-top: 20px;
    margin-top: 24px;
    min-width: 0
}

.inspection-media h4 {
    font-size: 1rem;
    margin: 0 0 10px
}

.media-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-block: 14px
}

.media-actions .button {
    font-size: 15px
}

.media-status {
    font-size: .9rem;
    overflow-wrap: anywhere
}

.media-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px
}

.media-card {
    margin: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft)
}

.media-card>img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    margin: 0 auto 16px;
    border-radius: 6px;
    background: white
}

.media-card figcaption {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.media-card label {
    font-weight: 600
}

.media-card .button {
    align-self: flex-start
}

.ink-pad {
    padding: 16px;
    border: 2px solid var(--blue);
    border-radius: 12px;
    margin-block: 20px
}

.ink-pad canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2/1;
    background: white;
    border: 1px solid #8798a8;
    border-radius: 6px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    margin-block: 12px
}

.ink-pad>label {
    display: flex;
    align-items: center;
    min-height: 48px
}

.inspection-media video {
    display: block;
    background: #101820;
    width: 100%;
    max-height: 60dvh;
    object-fit: contain;
    border-radius: 10px
}

.report-photo {
    margin: 20px 0;
    break-inside: avoid;
    padding-bottom: 20px;
    border-bottom: 1px solid #ccc
}

.report-photo>img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 195mm;
    object-fit: contain;
    margin: 0 auto 12px
}

.report-photo figcaption {
    font-size: 10pt;
    color: #111;
    overflow-wrap: anywhere
}

.report-photo small {
    font-size: 8pt
}

@media(pointer:coarse) {
    body[data-inspection-flow] .flow-steps {
        position: static
    }

    .report-editor .flow-error-link {
        padding-block: 14px
    }

    .report-editor .report-na {
        min-width: 48px
    }

    .report-editor .flow-item summary {
        padding-block: 12px
    }
}

@media(max-width:650px) {
    body[data-inspection-flow] .flow-steps {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        padding: 12px 2px
    }

    body[data-inspection-flow] .flow-steps button {
        flex: 0 0 auto;
        font-size: 14px;
        min-height: 48px
    }

    .flow-item {
        padding: 14px
    }

    .media-actions>.button {
        flex: 1 1 180px
    }

    .ink-pad {
        padding: 10px
    }

    .report-editor .report-table-row {
        padding: 12px
    }
}

body[data-inspection-flow] .flow-pagination {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    gap: 12px
}

body[data-inspection-flow].inspection-keyboard-open .flow-pagination {
    position: static;
    box-shadow: none
}

@media print {

    .inspection-media,
    .ink-pad {
        display: none !important
    }

    .report-photo {
        break-inside: avoid
    }

    .report-photo>img {
        max-height: 185mm
    }
}
