/* Keep report cards and Kitty controls inside their panels on tablet and mobile. */
@media (max-width: 1000px) {
  html body #kai-workspace.kai-theme .reports-page.reports-view-page .reports-library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    padding: 12px !important;
  }

  html body #kai-workspace.kai-theme .reports-page.reports-view-page .reports-library-card {
    grid-template-columns: 36px minmax(0, 1fr) !important;
    align-items: start !important;
    min-width: 0 !important;
  }

  html body #kai-workspace.kai-theme .reports-page.reports-view-page .reports-library-card-copy {
    min-width: 0 !important;
    overflow-wrap: anywhere;
  }

  html body #kai-workspace.kai-theme .reports-page.reports-view-page .reports-library-card-copy:has(.counter-sheet-date) {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 5px !important;
  }

  html body #kai-workspace.kai-theme .reports-page.reports-view-page .reports-library-card-copy:has(.counter-sheet-date) > small,
  html body #kai-workspace.kai-theme .reports-page.reports-view-page .reports-library-card-copy:has(.counter-sheet-date) > strong,
  html body #kai-workspace.kai-theme .reports-page.reports-view-page .reports-library-card-copy .counter-sheet-date {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  html body #kai-workspace.kai-theme .reports-page.reports-view-page .reports-library-card-copy .counter-sheet-date,
  html body #kai-workspace.kai-theme .reports-page.reports-view-page .reports-library-card-copy .counter-sheet-date input {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 260px !important;
    min-width: 0 !important;
  }

  html body #kai-workspace.kai-theme .reports-page.reports-view-page .reports-library-card .reports-action-group {
    grid-column: 2 !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  html body #kai-workspace.kai-theme .reports-page.reports-view-page .reports-library-card .reports-action-group .btn {
    flex: 1 1 78px !important;
    min-width: 0 !important;
    min-height: 34px !important;
    padding: 6px 7px !important;
    font-size: 10px !important;
    white-space: nowrap !important;
  }

  html body #kai-workspace.kai-theme .rake-entry-page .rake-single-misc-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html body #kai-workspace.kai-theme .rake-entry-page .rake-single-misc-grid > strong {
    grid-column: 1 !important;
  }

  html body #kai-workspace.kai-theme .rake-entry-page .rake-single-misc-grid .rake-miscellaneous-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  html body #kai-workspace.kai-theme .rake-entry-page .rake-single-misc-grid .rake-miscellaneous-row label,
  html body #kai-workspace.kai-theme .rake-entry-page .rake-single-misc-grid .rake-miscellaneous-row input {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 560px) {
  html body #kai-workspace.kai-theme .reports-page.reports-view-page .reports-library-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 480px) {
  html body #kai-workspace.kai-theme .reports-page.reports-view-page .reports-library-card .reports-action-group {
    flex-wrap: wrap !important;
  }

  html body #kai-workspace.kai-theme .reports-page.reports-view-page .reports-library-card .reports-action-group .btn {
    flex: 1 1 96px !important;
  }

  html body #kai-workspace.kai-theme .rake-entry-page .rake-single-misc-grid .rake-miscellaneous-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
