/* Layout only. Keeps every screen inside the viewport at laptop, tablet, and phone widths. */

header.h-16 {
  height: auto !important;
  min-height: 4rem;
  flex-wrap: wrap !important;
  align-items: center;
  row-gap: 8px;
  padding-top: 8px;
  padding-bottom: 8px;
  max-width: 100%;
  overflow: visible !important;
}

header.h-16 > .flex-1,
header.h-16 > .shrink-0,
header [id$="-header-actions"] {
  flex: 1 1 100% !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  min-width: 0 !important;
  max-width: 100%;
}

header.h-16 > .shrink-0 > * {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: 100%;
}

header.h-16 > .shrink-0 {
  flex-wrap: wrap !important;
  justify-content: flex-start;
  row-gap: 8px;
}

header [id$="-header-actions"],
header [id$="-header-actions"] > .flex,
header [id$="-header-actions"] .flex {
  flex-wrap: wrap !important;
  min-width: 0 !important;
  max-width: 100%;
  height: auto !important;
  row-gap: 8px;
}

header [style*="18rem"],
header [style*="width: 18rem"] {
  width: min(18rem, 100%) !important;
  max-width: 100% !important;
}

aside.app-sidebar {
  min-width: 0 !important;
  overflow-x: hidden !important;
}

@media (min-width: 768px) and (max-width: 1440px) {
  aside.app-sidebar {
    position: relative !important;
    transform: none !important;
    width: 13.5rem !important;
    max-width: 13.5rem !important;
    flex: 0 0 13.5rem !important;
  }

  aside.app-sidebar.is-collapsed {
    width: 3.75rem !important;
    min-width: 3.75rem !important;
    max-width: 3.75rem !important;
    flex-basis: 3.75rem !important;
  }

  aside.app-sidebar .app-sidebar-label {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

main {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

main > div,
main .h-full,
main .min-w-0 {
  min-width: 0 !important;
  max-width: 100%;
}

main :is(.overflow-x-auto, .overflow-auto, .overflow-hidden, .admin-cases-table-wrap, .case-list-table-wrap):has(table) {
  overflow-x: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body main .overflow-x-auto > table,
body main .overflow-auto > table,
body main .case-list-table-wrap:not(.admin-cases-table-wrap) table.case-management-table,
body main table.dashboard-reviews-table {
  width: max-content !important;
  min-width: 100% !important;
  max-width: none !important;
  table-layout: auto !important;
}

body main .overflow-x-auto > table :is(th, td),
body main table.dashboard-reviews-table :is(th, td) {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 22rem !important;
}

body main .overflow-x-auto > table :is(th, td):last-child,
body main table.dashboard-reviews-table :is(th, td):last-child,
body main table.agreements-table :is(th, td):last-child {
  position: static !important;
  right: auto !important;
}

html body main:has(.admin-cases-table-wrap) {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

html body main:has(.admin-cases-table-wrap) > div,
html body main:has(.admin-cases-table-wrap) > div > div,
html body main:has(.admin-cases-table-wrap) > div > div > div {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  overflow: hidden !important;
}

html body main div.case-list-table-wrap.admin-cases-table-wrap {
  display: block !important;
  box-sizing: border-box !important;
  flex: 1 1 auto !important;
  align-self: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: auto !important;
  contain: inline-size;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

html body main div.case-list-table-wrap.admin-cases-table-wrap > table.case-management-table {
  width: max-content !important;
  min-width: 100% !important;
  max-width: none !important;
  table-layout: auto !important;
}

html body main div.case-list-table-wrap.admin-cases-table-wrap > table.case-management-table :is(th, td) {
  position: static !important;
  right: auto !important;
  left: auto !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 18rem !important;
}

html body main div.case-list-table-wrap.admin-cases-table-wrap > table.case-management-table :is(th, td):last-child {
  position: static !important;
  right: auto !important;
  left: auto !important;
  overflow: visible !important;
  text-overflow: clip !important;
  width: 10.5rem !important;
  min-width: 10.5rem !important;
  max-width: none !important;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

@media (min-width: 1100px) {
  html body main div.case-list-table-wrap.admin-cases-table-wrap > table.case-management-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }
}

#dashboard-reviews,
#dashboard-reviews .overflow-hidden,
#dashboard-reviews .overflow-x-auto {
  max-width: 100% !important;
  min-width: 0 !important;
}

#dashboard-reviews .overflow-x-auto {
  overflow-x: auto !important;
}

@media (max-width: 1100px) {
  main .grid[style*="repeat(4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  main .grid[style*="repeat(4"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

.case-detail-shell {
  max-width: 100% !important;
  min-width: 0 !important;
}

.case-detail-shell > div {
  height: auto !important;
  max-height: calc(100dvh - 8rem) !important;
  min-height: 0 !important;
}

.case-detail-shell [style*="210px"] {
  grid-template-columns: minmax(7.5rem, 38%) minmax(0, 1fr) !important;
}

.lien-files,
.lp3,
.lp2-page {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

@media (max-width: 900px) {
  .lp3-split {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .lp3 {
    height: auto !important;
    min-height: 0 !important;
  }

  .lien-files-head,
  .lien-open-file,
  .lien-files-actions {
    flex-wrap: wrap;
  }

  .lien-files-table {
    width: max-content !important;
    min-width: 100% !important;
    table-layout: auto !important;
  }
}

.review-modal,
.lp2-preview-modal,
.lp3-preview,
.lp3-modal {
  max-width: calc(100vw - 16px) !important;
  max-height: calc(100dvh - 16px) !important;
}

.review-modal-foot .flex {
  flex-wrap: wrap !important;
}

@media (max-width: 700px) {
  .lp2-preview-backdrop,
  .lp3-preview-back {
    padding: 8px !important;
  }

  .lp2-preview-letter {
    padding: 16px !important;
    min-height: 0 !important;
    max-width: 100%;
  }

  .lp2-preview-letter .template-twocol {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .lp2-preview-letter .template-nowrap {
    white-space: normal !important;
  }
}

iframe[title="Welcome"] {
  min-height: 0 !important;
  height: calc(100dvh - 9rem) !important;
  max-width: 100%;
}

.min-w-\[1180px\],
.min-w-\[960px\],
.min-w-\[860px\],
.min-w-\[760px\],
.min-w-\[720px\] {
  min-width: 0 !important;
}

main .flex-1.overflow-auto,
main .overflow-auto {
  max-width: 100% !important;
  overflow-x: auto !important;
}

.personal-profile-card,
.personal-grid,
.personal-field,
.personal-control,
.personal-actions {
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 767px) {
  header button.md\:hidden {
    display: inline-flex !important;
  }

  aside.app-sidebar.-translate-x-full:not(.translate-x-0) {
    transform: translateX(-100%) !important;
  }

  aside.app-sidebar.translate-x-0 {
    transform: none !important;
    max-width: min(18rem, 88vw) !important;
  }
}

.agreements-screen,
[data-agreements-pane],
.agreements-screen .overflow-x-hidden {
  overflow-x: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body main table.agreements-table {
  table-layout: auto !important;
  width: max-content !important;
  min-width: 100% !important;
  max-width: none !important;
}

body main table.agreements-table :is(th, td) {
  width: auto !important;
  min-width: 0 !important;
  max-width: 14rem !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body main table.agreements-table :is(th, td):last-child {
  position: static !important;
  right: auto !important;
  max-width: none !important;
  overflow: visible !important;
}

@media (max-width: 700px) {
  main [style*="14rem minmax"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  main [style*="14rem + 12px"] {
    margin-left: 0 !important;
  }

  #dashboard-reviews .flex,
  #dashboard-reviews [style*="18rem"] {
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

.hmlr-upload,
.hmlr-file-list,
.hmlr-file-row,
.hmlr-file-name,
.hmlr-add {
  max-width: 100%;
  min-width: 0;
}

.hmlr-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.hmlr-file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.hmlr-file-name {
  flex: 1 1 12rem;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.hmlr-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hmlr-file-button {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.hmlr-add {
  flex: 0 0 auto;
  justify-content: flex-start !important;
  gap: 4px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  max-height: 9rem;
  overflow: auto;
}

.lien-test-backdrop {
  overflow: hidden !important;
  padding: 8px !important;
}

.lien-test-modal {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  width: min(720px, calc(100vw - 16px)) !important;
  height: min(640px, calc(100dvh - 16px)) !important;
  max-height: calc(100dvh - 16px) !important;
  overflow: hidden !important;
}

.lien-test-modal-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.lien-test-modal-foot {
  flex: 0 0 auto !important;
  position: relative !important;
  z-index: 2 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}

.lien-test-modal-actions {
  flex-wrap: wrap !important;
}

.hmlr-upload-body {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding-top: 16px !important;
  padding-bottom: 12px !important;
}

.hmlr-upload-body > .hmlr-wizard {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.hmlr-upload-body > .hmlr-wizard > h3 {
  flex: 0 0 auto;
}

.hmlr-upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
}

.hmlr-add-label {
  position: sticky;
  top: 0;
  z-index: 1;
  width: 100%;
  background: inherit;
}

@media (max-width: 800px) {
  .hmlr-upload-body {
    padding-top: 10px !important;
    padding-bottom: 8px !important;
  }

  .hmlr-upload {
    gap: 6px;
  }

  .hmlr-add {
    max-height: 5.25rem;
  }

  .hmlr-file-row {
    padding: 6px 8px;
  }

  .lien-test-modal-foot {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    gap: 6px !important;
  }
}
