/* 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: 44px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px 14px !important;
    min-width: 0 !important;
  }

  html body #kai-workspace.kai-theme .reports-page.reports-view-page .reports-library-card .reports-library-card-icon {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    flex: 0 0 44px !important;
    align-self: center !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;
    gap: 8px !important;
    min-width: 0 !important;
    width: 100% !important;
    margin: 2px 0 0 !important;
  }

  html body #kai-workspace.kai-theme .reports-page.reports-view-page .reports-library-card .reports-action-group .btn {
    flex: 0 1 auto !important;
    min-width: 88px !important;
    min-height: 36px !important;
    padding: 7px 12px !important;
    font-size: 12px !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;
  }
}

.expense-ledger-header-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.expense-report-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.kitty-report-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

@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;
  }

  .kitty-report-actions {
    width: 100%;
  }

  .kitty-report-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
  }
}
