/* CAL-001: fixed-shell Work Calendar with an independently scrolling week grid. */
.ps-work-calendar-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[data-ps-work-calendar-panel="1.0.0"],
[data-ps-work-calendar-frame="1.0.0"],
[data-ps-work-calendar-body="1.0.0"],
[data-ps-work-calendar-viewport="1.0.0"],
[data-ps-work-calendar-grid="1.0.0"] {
  min-width: 0;
}

[data-ps-work-calendar-frame="1.0.0"] {
  overflow: hidden !important;
}

[data-ps-work-calendar-viewport="1.0.0"] {
  max-width: 100%;
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

[data-ps-work-calendar-grid="1.0.0"] {
  min-width: 64rem !important;
}

[data-ps-work-calendar-week-header="1.0.0"],
[data-ps-work-calendar-all-day="1.0.0"] {
  background: white;
}

[data-ps-work-calendar-viewport="1.0.0"]:focus-visible {
  outline: 3px solid rgb(96 165 250 / 0.78) !important;
  outline-offset: -3px;
}

@media (min-width: 1024px) and (min-height: 640px) {
  html[data-ps-work-calendar-active="1.0.0"],
  html[data-ps-work-calendar-active="1.0.0"] body {
    height: 100%;
    overflow: hidden !important;
  }

  html[data-ps-work-calendar-active="1.0.0"] #root {
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  [data-ps-work-calendar-panel="1.0.0"] {
    margin-top: 0.75rem !important;
    min-height: 0;
  }

  [data-ps-work-calendar-frame="1.0.0"] {
    display: flex !important;
    flex-direction: column;
    height: var(--ps-work-calendar-available-height, calc(100dvh - 10rem)) !important;
    max-height: var(--ps-work-calendar-available-height, calc(100dvh - 10rem)) !important;
    min-height: 0;
  }

  [data-ps-work-calendar-toolbar="1.0.0"],
  [data-ps-work-calendar-status="1.0.0"] {
    flex: 0 0 auto;
  }

  [data-ps-work-calendar-body="1.0.0"] {
    display: grid !important;
    flex: 1 1 auto;
    grid-template-columns: clamp(10rem, 15vw, 12.75rem) minmax(0, 1fr) !important;
    min-height: 0;
    overflow: hidden;
  }

  [data-ps-work-calendar-sidebar="1.0.0"] {
    align-content: start;
    border-bottom: 0 !important;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  [data-ps-work-calendar-viewport="1.0.0"] {
    height: 100%;
    min-height: 0;
    overflow: auto !important;
    scroll-padding-top: calc(var(--ps-work-calendar-week-header-height, 72px) + 3.5rem);
  }

  [data-ps-work-calendar-grid="1.0.0"] {
    min-width: 0 !important;
    width: 100% !important;
  }

  [data-ps-work-calendar-week-header="1.0.0"],
  [data-ps-work-calendar-all-day="1.0.0"],
  [data-ps-work-calendar-time-grid="1.0.0"] {
    grid-template-columns: 3.25rem repeat(7, minmax(0, 1fr)) !important;
    min-width: 0;
    width: 100%;
  }

  [data-ps-work-calendar-week-header="1.0.0"] {
    position: sticky;
    top: 0;
    z-index: 32;
  }

  [data-ps-work-calendar-all-day="1.0.0"] {
    position: sticky;
    top: var(--ps-work-calendar-week-header-height, 72px);
    z-index: 31;
  }

  [data-ps-work-calendar-week-header="1.0.0"] > *,
  [data-ps-work-calendar-all-day="1.0.0"] > *,
  [data-ps-work-calendar-time-grid="1.0.0"] > * {
    min-width: 0;
  }

  [data-ps-work-calendar-week-header="1.0.0"] button,
  [data-ps-work-calendar-all-day="1.0.0"] button,
  [data-ps-work-calendar-time-grid="1.0.0"] button {
    max-width: 100%;
    min-width: 0;
  }
}

@media (min-width: 1024px) and (max-height: 720px) {
  [data-ps-work-calendar-toolbar="1.0.0"] {
    gap: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    padding-top: 0.5rem !important;
  }

  [data-ps-work-calendar-sidebar="1.0.0"] {
    gap: 0.5rem !important;
    padding: 0.5rem !important;
  }

  [data-ps-work-calendar-sidebar="1.0.0"] > div {
    gap: 0.5rem !important;
  }

  [data-ps-work-calendar-week-header="1.0.0"] button {
    gap: 0.125rem !important;
    padding-bottom: 0.5rem !important;
    padding-top: 0.5rem !important;
  }
}

@media (min-width: 1024px) and (max-width: 1100px) and (max-height: 700px) {
  [data-ps-work-calendar-body="1.0.0"] {
    grid-template-columns: 10rem minmax(0, 1fr) !important;
  }

  [data-ps-work-calendar-summary="1.0.0"] {
    display: none !important;
  }

  [data-ps-work-calendar-signal="1.0.0"] {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  [data-ps-work-calendar-week-header="1.0.0"],
  [data-ps-work-calendar-all-day="1.0.0"],
  [data-ps-work-calendar-time-grid="1.0.0"] {
    grid-template-columns: 2.875rem repeat(7, minmax(0, 1fr)) !important;
  }

  [data-ps-work-calendar-week-header="1.0.0"] button {
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
  }
}

@media (pointer: coarse) {
  [data-ps-work-calendar-toolbar="1.0.0"] button,
  [data-ps-work-calendar-sidebar="1.0.0"] button,
  [data-ps-work-calendar-sidebar="1.0.0"] label {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-ps-work-calendar-viewport="1.0.0"] {
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  [data-ps-work-calendar-viewport="1.0.0"]:focus-visible {
    outline: 2px solid Highlight !important;
  }
}
