/* One readable record per row on phones/tablets; never compress clinical tables into letter-wide columns. */
@media(max-width:1100px){
 .tablewrap{min-width:0;max-width:100%}
 table.mobile-record-table{display:block!important;width:100%!important;min-width:0!important;table-layout:auto}
 .mobile-record-table>thead{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap}
 .mobile-record-table>tbody{display:block!important;width:100%;padding:0!important}
 .mobile-record-table>tbody>tr{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px;width:auto!important;min-width:0;padding:16px!important;border-bottom:1px solid var(--border);margin:0}
 .mobile-record-table>tbody>tr>:is(td,th){display:block!important;min-width:0!important;max-width:none!important;width:auto!important;padding:4px 0!important;border:0;white-space:normal!important;overflow-wrap:break-word;word-break:normal;line-height:1.6}
 .mobile-record-table>tbody>tr>:is(td,th):first-child,.mobile-record-table>tbody>tr>:last-child,.mobile-record-table [colspan]{grid-column:1/-1}
 .mobile-record-table>tbody>tr>:is(td,th)::before{content:attr(data-label);display:block;font-size:11px;font-weight:600;letter-spacing:.02em;color:var(--secondary);margin-bottom:4px}
 .mobile-record-table>tbody>tr>[colspan]::before{display:none}
 .mobile-record-table :is(.plan-patient-identity,.person,.worker-identity){min-width:0;max-width:100%}
 .mobile-record-table :is(button,.tag,.registry-badge){white-space:normal;max-width:100%;overflow-wrap:break-word}
 .mobile-record-table button{min-height:44px;margin:3px 4px 3px 0}
 .mobile-record-table .compact-actions{flex-direction:row;flex-wrap:wrap}
 .mobile-record-table details{max-width:100%}
}
@media(max-width:600px){
 .content,.card,.cardhead,.cardhead>*,.heading>*,.toolbar>*,.row>*,fieldset{min-width:0}
 .cardhead,.toolbar,.row,.heading{flex-wrap:wrap}
 .cardhead{gap:14px}.cardhead>.row{width:100%}.cardhead .row>label{flex:1 1 150px;max-width:100%}
 .content :is(input,select,textarea){max-width:100%;min-width:0;box-sizing:border-box;font-size:16px}
 .content :is(button,.tag){max-width:100%;white-space:normal;overflow-wrap:break-word}
 .content button{min-height:44px}.content .row{gap:8px}
 .mobile-record-table>tbody>tr{padding:14px!important;gap:10px}
 dialog .tablewrap{min-width:0}dialog fieldset{min-width:0;max-width:100%;box-sizing:border-box}
 dialog :is(.plan-detail-grid,.plan-document-grid,.correction-values){grid-template-columns:minmax(0,1fr)}
 dialog :is(dl,dd,dt){min-width:0;max-width:100%;overflow-wrap:break-word}
 dialog .actions{gap:10px}dialog .actions button{min-height:44px}
}
@media(max-width:480px){
 .mobile-record-table>tbody>tr{grid-template-columns:minmax(0,1fr)}
 .mobile-record-table>tbody>tr>*{grid-column:1/-1}
 .mobile-record-table .plan-activity-value,.mobile-record-table .plan-activity-secondary{white-space:normal}
}
