/* Mobile editing and detail layouts. Desktop presentation is unchanged. */
@media (max-width:899px) {
    .workspace-content form .grid > *,
    .workspace-content .mobile-detail-page,
    .workspace-content .mobile-detail-row > * { min-width:0; }

    .workspace-content form :is(input, select, textarea):not([type=checkbox]):not([type=radio]):not([type=hidden]) {
        max-width:100%;
    }
    .workspace-content form textarea { min-height:112px; }
    .workspace-content form label:has(input[type=checkbox]),
    .workspace-content form label:has(input[type=radio]) {
        min-height:44px;
        padding-top:8px;
        padding-bottom:8px;
    }
    .workspace-content #motivos_operacao_container { max-height:256px; overscroll-behavior-y:contain; }
    .workspace-content #motivos_operacao_container label { display:flex; align-items:center; gap:8px; }
    .workspace-content #motivos_operacao_container input[type=checkbox] { flex-shrink:0; }
    .workspace-content .material-results-list,
    .workspace-content #empresa_results_list,
    .workspace-content #carro_results_list {
        max-height:min(256px, 35dvh);
        overscroll-behavior-y:contain;
        overflow-wrap:anywhere;
    }
    .workspace-content :is(.material-results-list, #empresa_results_list, #carro_results_list) > * {
        min-height:44px;
        display:flex;
        flex-direction:column;
        justify-content:center;
    }
    .workspace-content :is(.remove-motivo, .buscar-componente, .remover-componente, #generatePassword, #togglePassword) {
        min-width:44px;
        min-height:44px;
        flex-shrink:0;
    }
    .workspace-content .mobile-detail-page p,
    .workspace-content .mobile-detail-page code { overflow-wrap:anywhere; }
    .workspace-content .mobile-material-item > div { min-width:0; max-width:100%; flex-wrap:wrap; }
}
@media (max-width:639px) {
    /* Avoid stacking the desktop page's extra side padding inside the mobile shell. */
    .workspace-content .mobile-detail-page { padding:0; }
    .workspace-content .mobile-detail-page :is(.px-6, .p-6) { padding-left:16px; padding-right:16px; }
    .workspace-content .mobile-detail-row {
        grid-template-columns:minmax(0, 1fr);
        align-items:start;
        gap:8px;
    }
    .workspace-content .mobile-detail-row > span { justify-self:start; }
    .workspace-content .mobile-detail-page .flex.justify-end { gap:8px; }
    .workspace-content .mobile-detail-page .flex.justify-end > a {
        min-height:44px;
        flex:1;
        display:inline-flex;
        align-items:center;
        justify-content:center;
        margin:0;
    }
    .workspace-content .mobile-history-change { flex-direction:column; gap:8px; }
    .workspace-content .mobile-history-change > span,
    .workspace-content .mobile-history-change > code { margin-left:0; min-width:0; max-width:100%; }
    .workspace-content .mobile-history-change code { white-space:pre-wrap; word-break:break-word; }
    .workspace-content #materiais-list .item-row { padding:16px; gap:16px; }
    .workspace-content #materiais-list .item-row > .flex { flex-wrap:wrap; gap:12px; }
    .workspace-content #materiais-list .item-row input[type=checkbox] { width:20px; height:20px; }
    .workspace-content #addItemBtn { min-height:44px; width:100%; justify-content:center; }
    .workspace-content #componentes-body .flex > input { flex:1; min-width:0; }
    .workspace-content #componentes-body .flex > button { flex-shrink:0; }
}
