/* Phone/tablet field workflow. Keep all values in the original form. */
.navbar .navbar-brand { min-width: 0; max-width: calc(100% - 72px); white-space: normal; }
.navbar-brand img { flex-shrink: 0; }
.navbar-brand span { overflow-wrap: anywhere; }
.mobile-row-heading { display: none; }
.survey-doc-form input[readonly] { background-color: #e9f1ec; }
.table-responsive { overscroll-behavior-x: contain; }
#workspaceSaveError { position: sticky; bottom: 0; background: #fff; padding: 1rem; z-index: 1080; }
.modal-fullscreen .modal-content { height: 100dvh; }
.modal-fullscreen .modal-body.doc-modal-body { flex: 1 1 auto; max-height: none; min-height: 0; }
.modal-fullscreen .modal-footer { flex-shrink: 0; padding-bottom: max(.75rem, env(safe-area-inset-bottom)); }
.modal-fullscreen .modal-header { padding-top: max(1rem, env(safe-area-inset-top)); }
.modal-header .modal-title { overflow-wrap: anywhere; }
.modal-header .btn-close { flex-shrink: 0; }
@media (pointer: coarse), (max-width: 1024px) {
  .btn, .nav-link, .dropdown-item, .form-control, .form-select, .row-toggle { min-height: 44px; }
  .form-control, .form-select, .input-group-sm > .form-control, .input-group-sm > .form-select { font-size: 16px; }
  .btn-close { min-width: 28px; min-height: 28px; padding: 8px !important; }
  .form-check-input { width: 1.5rem; height: 1.5rem; }
  .survey-doc-form .table input:not([type=hidden]):not([type=checkbox]):not([type=radio]),
  .survey-doc-form .table select { min-width: 110px; }
  .survey-doc-form .table input[type=date], .survey-doc-form .table input[type=time] { min-width: 150px; }
  .survey-doc-form .table th { white-space: normal; min-width: 90px; }
  .doc-modal-body .row { row-gap: .75rem; }
  .modal-footer { gap: .5rem; }
  .navbar-toggler { min-height: 44px; }
}
@media (max-width: 575.98px) {
  .navbar-brand { font-size: 1rem; margin-right: 0; }
  .dashboard-shell > .row { --bs-gutter-y: 1rem; }
  .dashboard-shell { padding-inline: 12px; }
  .dashboard-shell .card-body { padding: 1rem; }
  .doc-modal-body { padding: 12px; }
  .modal-fullscreen .modal-footer .btn { flex: 1 1 110px; white-space: normal; }
  .survey-doc-form .d-flex { flex-wrap: wrap; gap: .5rem; }
  .survey-doc-form label[style*="min-width"] { min-width: 0 !important; }
  .survey-doc-form input[style*="min-width"] { min-width: 0 !important; max-width: 100% !important; }
  .mobile-entry-table, .mobile-entry-table tbody { display: block; width: 100%; }
  .mobile-entry-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .mobile-entry-table .mobile-entry-row { display: grid; grid-template-columns: minmax(0,1fr); border: 1px solid #92bda5; border-radius: .75rem; margin-bottom: 12px; overflow: hidden; }
  .mobile-entry-table .mobile-entry-row > td { display: block; width: auto !important; padding: 10px 12px; border: 0; }
  .mobile-entry-table .mobile-entry-row > td::before { content: attr(data-label); display: block; font-weight: 600; margin-bottom: 6px; color: #2f4858; }
  .mobile-entry-table .mobile-row-heading { display: block; padding: 0; border: 0; min-width: 0; }
  .row-toggle { width: 100%; display: flex; justify-content: space-between; text-align: left; border-radius: 0; background: #cee9d5; color: #234367; padding: 12px; font-weight: 600; }
  .row-toggle::after { content: "−"; }
  .row-toggle[aria-expanded=false]::after { content: "+"; }
  .mobile-entry-table .row-collapsed > td { display: none; }
  .mobile-entry-table input:not([type=checkbox]):not([type=radio]), .mobile-entry-table select { width: 100%; min-width: 0 !important; }
  .mobile-entry-table tfoot, .mobile-entry-table tfoot tr { display: block; }
  .mobile-entry-table tfoot td { display: inline-block; max-width: 100%; }
  .doc-modal-body .nav-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .doc-modal-body .nav-tabs .nav-link { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
