/* Adaptações compartilhadas; impressão e PDFs mantêm suas dimensões próprias. */
@media screen {
 .cf-shell .main,.cf-shell #view,.cf-shell .panel,.cf-shell .card,
 .cf-shell .grid > *, .modal .grid > *, .cf-shell .field,.modal .field {min-width:0;}
 .cf-shell .cf-header-context,.cf-shell .cf-header-context > div {min-width:0;}
 .cf-shell .topbar h1,.cf-shell :is(h2,h3,p,dd),.modal :is(h2,h3,p,dd) {overflow-wrap:anywhere;}
 .cf-shell :is(input,select,textarea),.modal :is(input,select,textarea) {max-width:100%;min-width:0;}
 .cf-shell :is(img,video),.modal :is(img,video) {max-width:100%;}
 .cf-table-scroll {width:100%;max-width:100%;min-width:0;overflow:auto;overscroll-behavior-inline:contain;}
 .cf-table-scroll:focus-visible {outline:3px solid var(--cf-primary,#0659a8);outline-offset:2px;}
 .cf-shell .sidebar {overscroll-behavior:contain;}
 .cf-shell .cf-sidebar-footer {margin-top:auto;display:grid;gap:16px;flex-shrink:0;padding-top:16px;}
 .cf-shell .cf-sidebar-footer .logout {margin-top:0;width:100%;}
 .cf-shell .cf-sidebar-footer .cf-brand {justify-content:center;}
 .cf-shell .cf-header-tools {flex-shrink:0;}
 body:has(.cf-shell) .modal-backdrop {overflow-y:auto;align-items:safe center;}
 body:has(.cf-shell) .modal {max-width:100%;overscroll-behavior:contain;scroll-padding-block:20px;}
 body:has(.cf-shell) dialog {max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);min-width:0;overflow:auto;overscroll-behavior:contain;}
 body:has(.cf-shell) dialog :is(fieldset,.field) {min-inline-size:0;}
 @media(max-width:1023px) {
  .cf-shell .topbar {flex-direction:row;align-items:center;height:auto;min-height:76px;padding-block:12px;}
  .cf-shell .grid.cols-3,.cf-shell .grid.cols-4 {grid-template-columns:repeat(2,minmax(0,1fr));}
  .cf-shell .cf-icon-button {min-height:44px;min-width:44px;}
 }
 @media(max-width:767px) {
  .cf-shell .topbar h1 {font-size:clamp(1rem,4.8vw,1.25rem);}
  .cf-shell .main {padding-inline:max(12px,env(safe-area-inset-left));padding-bottom:calc(40px + env(safe-area-inset-bottom));}
  .cf-shell .sidebar {padding-bottom:calc(24px + env(safe-area-inset-bottom));}
  .cf-shell .grid.cols-2,.cf-shell .grid.cols-3,.modal .grid.cols-2,.modal .grid.cols-3,.modal .grid.cols-4 {grid-template-columns:minmax(0,1fr);}
  .modal .grid > [style*="grid-column"],.cf-shell .grid > .field[style*="grid-column"] {grid-column:1 / -1!important;}
  .cf-shell :is(input,select,textarea),body:has(.cf-shell) .modal :is(input,select,textarea) {font-size:16px;}
  body:has(.cf-shell) dialog :is(input,select,textarea) {font-size:16px;max-width:100%;min-width:0;}
  body:has(.cf-shell) dialog :is(button,.btn) {min-height:44px;white-space:normal;}
  .cf-shell :is(.btn,.cf-icon-button,.link-button,.logout),body:has(.cf-shell) .modal :is(.btn,.modal-close,.link-button) {min-height:44px;}
  .cf-shell .cf-icon-button,body:has(.cf-shell) .modal .modal-close {min-width:44px;}
  .cf-shell .toolbar,.cf-shell .actions,.modal .actions {flex-wrap:wrap;gap:10px;}
  .cf-shell .toolbar > * {max-width:100%;min-width:0;}
  .cf-shell .btn,.modal .btn {white-space:normal;overflow-wrap:anywhere;}
  .cf-shell .treatment-plan-card .responsive-table {overflow-x:auto;}
  body:has(.cf-shell) .modal-backdrop {padding:8px;padding-bottom:max(8px,env(safe-area-inset-bottom));}
  body:has(.cf-shell) .modal {max-height:calc(100dvh - 16px - env(safe-area-inset-bottom));}
 }
 @media(max-width:380px) {
  .cf-shell .grid.cols-4 {grid-template-columns:minmax(0,1fr);}
  .cf-shell .panel,.cf-shell .card {padding:12px;}
 }
}
@media print {
 .cf-table-scroll {overflow:visible;max-width:none;}
}
