.app-main:has(.calendar-day-records-content) {
  z-index: 70;
  overflow: visible;
}

.app-main:has(.calendar-day-records-content) .app-modal-panel {
  display: flex;
  width: min(48rem, calc(100vw - 2rem));
  max-width: 48rem;
  height: min(46rem, calc(100dvh - 2rem));
  max-height: calc(100dvh - 2rem);
  flex-direction: column;
  border: 1px solid rgba(244, 196, 48, 0.42);
  border-radius: 12px;
  background: #171717;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72);
}

.app-main:has(.calendar-day-records-content) .app-modal-panel > div:first-child {
  z-index: 20;
  flex: 0 0 auto;
  min-height: 64px;
  background: #111;
}

.app-main:has(.calendar-day-records-content) .app-modal-panel > div:first-child h2 {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.app-main:has(.calendar-day-records-content) .app-modal-panel > div:nth-child(2) {
  min-height: 0;
  max-height: none !important;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 1rem;
  background: rgba(12, 12, 12, 0.9);
}

.calendar-day-records-content > div:first-child,
.calendar-day-records-content > div:last-child > button {
  background: #242424 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}

.calendar-day-records-content > div:last-child > button {
  min-height: 108px;
}

.calendar-day-records-content > div:last-child > button:hover {
  background: #2d2d2d !important;
  border-color: rgba(244, 196, 48, 0.62) !important;
}

body:has(.calendar-day-records-content) {
  overflow: hidden;
}

body:has(.calendar-day-records-content) .tsc-report-launcher {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 639px) {
  .app-main:has(.calendar-day-records-content) .app-modal-panel {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .app-main:has(.calendar-day-records-content) .app-modal-panel > div:first-child {
    min-height: 60px;
    padding: calc(0.75rem + env(safe-area-inset-top)) 1rem 0.75rem;
  }

  .app-main:has(.calendar-day-records-content) .app-modal-panel > div:nth-child(2) {
    padding: 0.75rem 1rem calc(1rem + env(safe-area-inset-bottom));
  }

  .calendar-day-records-content > div:last-child > button {
    min-height: 0;
    padding: 0.875rem;
  }
}
