/* R6(사용자 11-17): 지원근무자 현황 월 보기 — 오른쪽 칸 접힘 기본·손잡이, 접히면 달력을 크게, 달력 칩은 가운데 팝업.
   DESIGN R17 색(판 공용 --sxr-*), 왼쪽 세로 강조 막대 없음. 팝업 하나가 스크롤 주인(본문)이다. 402 이하는 전체 화면 시트. */

/* 달력 머리의 손잡이 */
html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-calendar-head .ops-ref-side-toggle {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 36px; margin-left: 12px; padding: 0 12px;
  border: 1px solid var(--sxr-line, #dcdcdc); border-radius: 8px; background: var(--sxr-card, #fff); color: var(--sxr-ink, #111827);
  font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-side-toggle svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-side-toggle:focus-visible {
  outline: 2px solid var(--ui-focus-color, #111827); outline-offset: 2px;
}
html[data-theme="dark"] body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-side-toggle:focus-visible { outline-color: #fff; }
html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-calendar-head { flex-wrap: wrap; row-gap: 8px; }

/* 오른쪽 칸이 접히면 달력을 크게: 칸 높이와 칩 글자를 키운다(달력 한 장이 판 폭을 다 쓴다). */
html body #opsSupportPanel#opsSupportPanel #opsSupportReferenceRoot .ops-ref-shell.is-month-view.has-collapsed-detail .ops-ref-calendar-grid {
  grid-auto-rows: minmax(132px, auto) !important;
}
html body #opsSupportPanel#opsSupportPanel #opsSupportReferenceRoot .ops-ref-shell.is-month-view.has-collapsed-detail .ops-ref-calendar-line {
  font-size: 13px;
}

/* 가운데 팝업 */
html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup {
  position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 24px; box-sizing: border-box;
}
html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup-backdrop {
  position: absolute; inset: 0; background: rgba(15, 23, 42, .45);
}
html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup-card {
  position: relative; display: flex; flex-direction: column; width: min(760px, 100%); max-height: calc(100dvh - 48px); min-height: 0;
  border: 1px solid var(--sxr-line, #dcdcdc); border-radius: 14px; background: var(--sxr-card, #fff);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .24); overflow: hidden;
}
html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
}
/* 팝업 안의 상세는 오른쪽 칸 높이·고정 위치를 쓰지 않는다(본문이 스크롤). */
html body #opsSupportPanel#opsSupportPanel#opsSupportPanel#opsSupportPanel#opsSupportPanel#opsSupportPanel .ops-ref-month-popup .ops-ref-detail-panel {
  position: static !important; height: auto !important; max-height: none !important; min-height: 0 !important;
  border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
}
html body #opsSupportPanel#opsSupportPanel#opsSupportPanel#opsSupportPanel#opsSupportPanel#opsSupportPanel .ops-ref-month-popup .ops-ref-detail-panel > .ops-ref-detail-body {
  overflow: visible !important;
}
/* 팝업 머리의 상세 닫기(×)는 팝업 닫기 버튼과 겹치므로 팝업 안에서는 숨긴다(닫기는 오른쪽 위 버튼 하나). */
html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup .ops-ref-drawer-close,
html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup .ops-ref-detail-collapse-btn { display: none !important; }
html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup .ops-ref-detail-head { padding-right: 56px; }
/* D-SX-013 (전체 QA 11-21): 요청 머리(.ops-ref-request-nav-head)는 components.css가 padding을 !important로 정해(오른쪽 16px)
   위 56px가 먹지 않았고, 오른쪽 위 닫기(40px, 오른쪽 10px)가 「요청 삭제」 가운데를 덮었다. 팝업 안 머리는 닫기 자리 50px에
   8px를 더 비운다. 오른쪽 칸(팝업 밖) 머리는 그대로다. */
html body:not(.soc-auth-shell-active) #opsSupportPanel#opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup .ops-ref-detail-head {
  padding-right: 58px !important;
}
html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup-close {
  position: absolute; top: 10px; right: 10px; z-index: 2; display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--sxr-line, #dcdcdc); border-radius: 10px; background: var(--sxr-card, #fff); color: var(--sxr-ink, #111827); cursor: pointer;
}
html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup-close svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
}
html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup-close:focus-visible {
  outline: 2px solid var(--ui-focus-color, #111827); outline-offset: 2px;
}
html[data-theme="dark"] body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup-close:focus-visible { outline-color: #fff; }
html[data-theme="dark"] body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup-backdrop { background: rgba(0, 0, 0, .6); }
html[data-theme="dark"] body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup-card { box-shadow: 0 24px 64px rgba(0, 0, 0, .55); }

/* R7(화면 검증 M-r6a): 1199px 이하는 「요청 안 연 날짜별 칸」을 숨기는 판 규칙(components.css)이 있다. 손잡이로 펼친 경우
   (is-month-side-open)만 그 칸을 보여 준다 — 손잡이 라벨·aria-expanded와 실제 화면이 같게. 칸은 달력 아래에 쌓인다. */
@media (max-width: 1199px) {
  html body #opsSupportPanel#opsSupportPanel#opsSupportPanel #opsSupportReferenceRoot .ops-ref-shell.is-month-view.is-month-side-open > .ops-ref-day-panel {
    display: grid !important;
  }
}

/* 휴대폰 폭: 팝업은 전체 화면 시트, 손잡이는 글자 없이도 이름이 남는다(aria-label). */
@media (max-width: 767px) {
  html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup { padding: 0; place-items: stretch; }
  html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup-card {
    width: 100%; max-height: none; height: 100dvh; border: 0; border-radius: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-calendar-head .ops-ref-side-toggle { min-height: 44px; margin-left: auto; }
  /* R7(M-r6a): 달력 머리는 560px 가로 스크롤 안에 있어 손잡이·범례가 화면 밖으로 나갔다. 휴대폰에서는 머리를 달력 카드 폭
     (컨테이너 opsrefmonth, 화면 폭)에 맞추고 가로 스크롤해도 왼쪽에 붙어 있게 한다. 범례·손잡이는 줄바꿈. */
  html body #opsSupportPanel#opsSupportPanel#opsSupportPanel #opsSupportReferenceRoot .ops-ref-shell.is-month-view .ops-ref-calendar-head {
    position: sticky; left: 0; z-index: 2; box-sizing: border-box; width: 100cqw; min-width: 0 !important; max-width: 100cqw;
    flex-wrap: wrap; row-gap: 8px; background: var(--ops-ref-surface, var(--sxr-card, #fff));
  }
  html body #opsSupportPanel#opsSupportPanel#opsSupportPanel #opsSupportReferenceRoot .ops-ref-shell.is-month-view .ops-ref-calendar-head .ops-ref-status-legend {
    flex: 1 1 100%; order: 3; flex-wrap: wrap;
  }
  html body #opsSupportPanel#opsSupportPanel #opsSupportReferenceRoot .ops-ref-shell.is-month-view.has-collapsed-detail .ops-ref-calendar-grid {
    grid-auto-rows: minmax(88px, auto) !important;
  }
}
@media (prefers-reduced-motion: no-preference) {
  html body #opsSupportPanel #opsSupportReferenceRoot .ops-ref-month-popup-card { animation: ops-ref-popup-in .16s ease-out; }
  @keyframes ops-ref-popup-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
