/* PE-Class v1.20.72 — 학교스포츠클럽 명단·출석 스크롤 경계 */

/* 출석 응답 전에는 QR 버튼만 먼저 그려지지 않도록 제어행 전체를 함께 대기시킵니다. */
html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"]
  .clubPcAttendanceFilterBar[aria-busy="true"] {
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (min-width: 769px) {
  /* 넓은 화면에서는 클럽 허브의 바깥 스크롤 대신 각 데이터 표가 스크롤을 소유합니다. */
  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"][data-club-section="manage"] .clubSectionPanels,
  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"][data-club-section="attendance"] .clubSectionPanels {
    overflow: hidden !important;
  }

  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"]
    :is(
      .clubSectionPanel[data-club-section-panel="manage"],
      .clubSectionPanel[data-club-section-panel="attendance"]
    ) {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* 부서 명단: 제목·작업 버튼은 고정하고 학생 행만 내부 스크롤합니다. */
  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"] .clubManageGrid {
    align-items: stretch !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"] .clubDepartmentPanel {
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }

  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"] .clubMemberPanel {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"] .clubMemberPanel > h3,
  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"] .clubMemberHead,
  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"] .clubMemberQuickActions {
    flex: 0 0 auto !important;
  }

  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"] .clubMemberPanel #clubMemberBox {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"] .clubMemberTableWrap {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 120px !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
  }

  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"] .clubMemberTable thead th {
    position: sticky !important;
    z-index: 4 !important;
    top: 0 !important;
    background: #f4f8fb !important;
  }

  /* 출석 입력: 제어행과 표 머리글은 고정하고 학생 행부터 스크롤합니다. */
  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"]
    :is(.clubPcAttendanceWorkspace, .clubPcAttendanceMain) {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"] .clubPcAttendanceFilterBar,
  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"] .clubPcAttendanceOverview {
    flex: 0 0 auto !important;
  }

  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"] .clubAttendancePanel {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"] .clubAttendancePanel #clubAttendanceBox {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"] .clubAttendancePanel .tableScroll {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
  }

  html[data-pe-tab="clubs"] #app.clubScreen[data-club-windows-pc="true"]
    .clubAttendancePanel .clubAttendanceTable thead th {
    position: sticky !important;
    z-index: 5 !important;
    top: 0 !important;
    background: #f4f8fb !important;
  }
}

/* iPhone 15 Pro: 하단 작업 독을 뷰포트 끝에 밀착합니다. Fold 접힘 규칙은 유지합니다. */
@media (max-width: 768px) {
  html.pe87IPhone[data-pe-tab="clubs"] body.mobileClubView .mobileClubAttendanceDock {
    bottom: 0 !important;
  }
}
