/* ==========================================================================
   TeamCalendar — 라이트 테마 디자인 기획팀 캘린더 (시안 기반)
   접두사: tcal-
   ========================================================================== */

.tcal {
  /* 셀 안 일정 텍스트/아이콘 크기 — 조정 시 여기만 변경 */
  --tcal-fs-base: 20px;    /* 일반 주간 텍스트 */
  --tcal-fs-today: 22px;   /* 현재 주간 텍스트 */
  --tcal-icon-base: 16px;  /* 일반 주간 분류 아이콘 */
  --tcal-icon-today: 18px; /* 현재 주간 분류 아이콘 */

  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #333;
  margin: 8px 20px 20px;
  overflow: hidden;
}

/* 요일 헤더 + 주 행을 감싸는 그리드 박스 */
.tcal-grid {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── 헤더: 년월 네비 + 범례 */
.tcal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  flex-shrink: 0;
}

.tcal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tcal-month-label {
  font-size: 24px;
  font-weight: 700;
  color: #222;
  margin-right: 4px;
}

.tcal-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
}

.tcal-nav-btn:hover {
  background: #f5f5f5;
}

.tcal-today-btn {
  height: 30px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  color: #555;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
}

.tcal-today-btn:hover {
  background: #f5f5f5;
}

.tcal-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 0.5px solid rgba(166, 158, 126, 0.4);
  background: #FBFBFB;
}

.tcal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 18px;
  color: #666;
}

.tcal-legend .tcal-ev-icon.svg-icon {
  margin-top: 0;
}

/* 헤더 오른쪽: 셀 색 설명 + 범례 */
.tcal-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 셀 구분 색 설명 — 범례 왼쪽, 셀명 #666 + 앞에 셀 색 dot */
.tcal-legend-cells {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  color: #666;
}

.tcal-legend-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* dot 색은 tcal-cell-* 클래스의 color를 그대로 사용 */
.tcal-cell-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ── 요일 헤더 (tcal-body 안에서 sticky — 스크롤바 폭을 본문과 공유해 칸 정렬 유지) */
.tcal-day-headers {
  position: sticky;
  top: 0;
  z-index: 5; /* 레인 이벤트(z-index 1)·셀 위 */
  display: grid;
  grid-template-columns: var(--tcal-cols, repeat(7, 1fr));
  background: #F6F4EE;
  border-radius: 10px 10px 0 0;
  flex-shrink: 0;
  z-index: 2;
}
.tcal-day-headers:before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  z-index: -1;
}
.tcal-day-headers::after {
  content: ' ';
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #A69E7E 0%, transparent 100%);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  padding:1px 1px 0 1px;
  box-sizing: border-box;
}

.tcal-day-header {
  position: relative;
  padding: 8px 10px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #666;
}
.tcal-day-header:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, #A69E7E 0%, transparent 100%);
}

.tcal-day-header:last-child {
  border-right: none;
}

.tcal-day-header.sat { color: #3b82f6; }
.tcal-day-header.sun { color: #ef4444; }

/* ── 주 행 */
.tcal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  /* html scrollbar-color 상속 차단 — 아래 webkit 커스텀이 먹히게 */
  scrollbar-color: auto;
}

/* 커스텀 스크롤 — 메인(.dept-task-scroller)과 동일한 모양
   (주의: scrollbar-width / 상속된 scrollbar-color 가 있으면 Chrome이 webkit 커스텀을 무시한다) */
.tcal-body::-webkit-scrollbar {
  width: 6px;
}

.tcal-body::-webkit-scrollbar-track {
  background: transparent;
}

.tcal-body::-webkit-scrollbar-thumb {
  background: #e0d9d2;
  border-radius: 3px;
}

.tcal-body::-webkit-scrollbar-thumb:hover {
  background: #b0a79e;
}

.tcal-week {
  display: grid;
  grid-template-columns: var(--tcal-cols, repeat(7, 1fr));
  border-left:1px solid #DCE0E5;
  border-right:1px solid #DCE0E5;
  border-bottom: 1px solid #DCE0E5;
  /* grow 금지: 빈 공간으로 주가 늘어나면 세로선이 끊긴 것처럼 보임. 내용은 body 스크롤 */
  flex: 0 0 auto;
  min-height: 100px;
}

/* 셀은 항상 주의 전체 행(띠 + 레인들 + 잔여)을 배경으로 차지.
   레인 아이템과 영역이 겹치므로 열도 명시 지정해야 자동 배치로 밀려나지 않음.
   flex로 주 높이가 늘어날 때(오늘 주) 세로 구분선·배경이 끝까지 채워지도록 stretch 고정.
   overflow:hidden은 grid stretch를 막는 경우가 있어 clip 사용 */
.tcal-week .tcal-day-cell {
  grid-row: 1 / -1;
  align-self: stretch;
  min-height: 100%;
  overflow: clip;
}

.tcal-week .tcal-day-cell:nth-child(1) { grid-column: 1; }
.tcal-week .tcal-day-cell:nth-child(2) { grid-column: 2; }
.tcal-week .tcal-day-cell:nth-child(3) { grid-column: 3; }
.tcal-week .tcal-day-cell:nth-child(4) { grid-column: 4; }
.tcal-week .tcal-day-cell:nth-child(5) { grid-column: 5; }
.tcal-week .tcal-day-cell:nth-child(6) { grid-column: 6; }
.tcal-week .tcal-day-cell:nth-child(7) { grid-column: 7;  border-right: none; }

/* 같은 주의 날짜 띠 높이 통일 + 레인 행 공유
   (행 구성 auto/repeat(n)/1fr은 주별로 인라인 스타일로 지정됨) */
@supports (grid-template-rows: subgrid) {
  .tcal-week .tcal-day-cell {
    display: grid;
    grid-template-rows: subgrid;
  }

  .tcal-week .tcal-day-cell .tcal-date-strip {
    grid-row: 1;
  }

  /* 셀 잔여 영역(출근 블록 등)은 날짜 띠 바로 아래부터 시작 */
  .tcal-week .tcal-day-cell .tcal-events {
    grid-row: 2 / -1;
  }
}

/* 주 단위 레인 이벤트: 시작 칸에서 일요일까지 흐르고, 주 끝에서만 말줄임.
   바깥은 그리드 배치용으로 클릭을 통과시키고(내용 없는 빈 구간은 셀 클릭으로),
   안쪽(.tcal-lane-inner)만 내용 크기만큼 클릭을 받음 */
.tcal-lane-event {
  position: relative; /* 위치 지정된 셀(.tcal-day-cell)보다 위에 그려지도록 */
  z-index: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  padding: 1px 8px;
  align-items: center;
  pointer-events: none;
}

.tcal-lane-inner {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.tcal-lane-event.clickable .tcal-lane-inner {
  cursor: pointer;
}

.tcal-lane-event.clickable .tcal-lane-inner:hover .tcal-ev-text {
  text-decoration: underline;
}

.tcal-lane-event .tcal-ev-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.tcal-lane-event.other-month {
  opacity: 0.45;
}

/* 완료 항목: 같은 날 첫 번째는 아이콘+'완료 / ' 표시,
   두 번째부터(.follow)는 숨기되 자리(정렬)는 유지 */
.tcal-lane-event.kind-complete.follow .tcal-ev-icon,
.tcal-lane-event.kind-complete.follow .tcal-ev-prefix {
  visibility: hidden;
}

/* 접두사는 한 단어로 유지 */
.tcal-ev-prefix {
  flex-shrink: 0;
  white-space: pre;
}

/* ── 일정지연 기간 바: 시작일~종료일을 가로지르는 그라데이션
   좌측: 이슈 아이콘 + 프로젝트명 / 우측: 일정 지연(+N) */
.tcal-delay-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  padding: 1px 12px 1px 8px;
  font-size: var(--tcal-fs-base);
  font-weight: 500;
  pointer-events: none; /* 빈 구간 클릭은 셀(날짜 선택)로 통과 */
}

.tcal-week.today-week .tcal-delay-bar {
  font-size: var(--tcal-fs-today);
  font-weight: 600;
}

/* 배경: 텍스트가 흐려지지 않도록 별도 레이어에만 opacity 적용 */
.tcal-delay-bar::before {
  content: '';
  position: absolute;
  inset: 1px 0;
  background: linear-gradient(90deg, #FFE5B0 0%, #C68745 100%);
  opacity: 0.5;
}

.tcal-delay-bar.head::before {
  border-radius: 50px 0 0 50px;
}

.tcal-delay-bar-content {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
}

.tcal-delay-bar-content:hover .tcal-ev-text {
  text-decoration: underline;
}

.tcal-delay-bar-content .tcal-ev-icon.svg-icon {
  margin-top: 0;
}

.tcal-delay-bar .tcal-ev-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* 주 경계로 이어진 구간임을 알리는 표시. 이름은 매 주 반복해 그린다. */
.tcal-delay-bar-cont {
  flex-shrink: 0;
  color: #8a6d4b;
  font-size: 0.85em;
  line-height: 1;
}

.tcal-delay-bar-tail {
  position: relative;
  flex-shrink: 0;
  color: #695642;
  font-weight: 600;
  pointer-events: auto;
}

/* 오늘이 속한 주: 주황 테두리 그룹 강조 + 최소 높이·타이포로 구분(빈 flex 확장 없음) */
.tcal-week.today-week {
  position: relative;
  border-radius: 8px;
  border-top: 5px solid #DB9762;
  border-right: 2px solid #DB9762;
  border-bottom: 5px solid #DB9762;
  border-left: 2px solid #DB9762;
  box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.25);
  overflow: hidden;
  flex: 0 0 auto;
  min-height: 180px;
  align-content: start;
}

/* 가장자리 비네트(그라데이션) 오버레이 — 셀 위에 얹어서 표현 */
.tcal-week.today-week::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(371.36% 50% at 50% 50%, rgba(255, 255, 255, 0.00) 86.06%, #FFF6ED 100%);
  mix-blend-mode: multiply;
  pointer-events: none;
  border-radius: 6px;
}

/* ── 날짜 셀 */
.tcal-day-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-right: 1px solid #DCE0E5;
  background: #fff; /* 프로젝트 내용 영역은 흰색 */
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  transition: background 0.12s;
}
.tcal-day-cell:hover {
  background: #fcfcfc;
}

/* 선택된 날짜 셀 강조 (재클릭 시 해제) — 배경색만, 테두리 없음 */
.tcal-day-cell.selected {
  background: #FFFAF4;
}

.tcal-day-cell.selected .tcal-date-strip {
  background: #FFF3E5;
}

/* 일자 라인 (날짜 숫자 띠) */
.tcal-date-strip {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: #F9F9F9;
  padding: 4px 8px;
  flex-shrink: 0;
  min-width: 0;
  overflow: hidden; /* 내용이 띠 영역 밖으로 비어져 나가지 않도록 */
}

/* 날짜 옆 항목 그룹: 일정/휴가/시차를 한 줄씩 세로 리스트로 */
.tcal-strip-list {
  flex: 1;
  min-width: 0;
  display: flex;
  column-gap: 16px;
  flex-wrap: wrap;
}

/* 리스트 항목 한 줄 (앞 라인 정렬) */
.tcal-strip-event {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  font-size: var(--tcal-fs-base);
  font-weight: 500; /* 현재 주간은 600으로 덮어씀 */
  color: #444;
}

/* 휴가/시차 줄이 연속될 때 두 번째부터 아이콘 숨김 (앞에 일정 줄이 있어도 첫 휴가/시차 아이콘은 유지) */
.tcal-strip-event.kind-vac + .tcal-strip-event.kind-vac .tcal-ev-icon{
  visibility: hidden;
}
/* 한 줄 전체 차지: 시차 인원(한 줄에 하나씩), 접기/펼치기 버튼이 있는 줄 */
.tcal-strip-event.flex-line,
.tcal-strip-event.full-line {
  width: 100%;
}
.tcal-strip-event .tcal-ev-icon.svg-icon {
  margin-top: 0;
}

.tcal-strip-event .tcal-ev-assignee,
.tcal-strip-event .tcal-ev-time {
  line-height: 1.4;
}

.tcal-strip-event .tcal-ev-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.tcal-strip-event .tcal-ev-assignee {
  min-width: 0;
  flex-shrink: 9; /* 폭이 부족하면 시간보다 이름을 먼저 줄임 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: keep-all;
}

/* 시간 라벨도 영역을 넘지 않게 — 전역 flex-shrink: 0을 띠 안에서는 해제 */
.tcal-strip-event .tcal-ev-time {
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 인원 펼침 상태: 이름 전체가 보이도록 줄바꿈 허용 */
.tcal-strip-event.open {
  align-items: flex-start;
}
.tcal-strip-event.open:has(+ .tcal-strip-event.open) {
  align-items: center;
}
.tcal-strip-event.open .tcal-ev-icon.svg-icon {
  margin-top: 6px;
}
.tcal-strip-event.open .tcal-ev-assignee {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  min-width: auto;
}
.tcal-strip-event.open .tcal-ev-time {
  align-self: center;
}

/* 인원 펼침/접기 셰브론 버튼 — 셀 오른쪽 끝 고정.
   띠 배경(#F9F9F9)에 묻히지 않게 흰 배경 + 테두리 (오늘/네비 버튼과 동일 문법) */
.tcal-strip-more {
  flex-shrink: 0;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  background: #fff;
  border: 1px solid #D7D7D7;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  line-height: 1;
  color: #666;
  cursor: pointer;
  transition: all 0.12s;
}

.tcal-strip-more svg {
  display: block;
  transition: transform 0.15s;
}

/* 펼침 상태: 셰브론 회전 (∨ → ∧) */
.tcal-strip-more.open svg {
  transform: rotate(180deg);
}

.tcal-strip-more:hover {
  background: #FFF6ED;
  border-color: #DB9762;
  color: #d97a2e;
}

.tcal-date-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  font-size: 18px;
  font-weight: 600;
  color: #555;
  border-radius: 50%;
}

.tcal-date-num.sat { color: #3b82f6; }
.tcal-date-num.sun { color: #ef4444; }

.tcal-date-num.today {
  background: #AA7F5D;
  color: #fff;
  box-shadow: 0 0 7px 0 #4E2E09 inset;
}

.tcal-day-cell.other-month .tcal-date-num {
  color: #c8c8c8;
}

.tcal-day-cell.other-month .tcal-events {
  opacity: 0.45;
}

/* ── 이벤트 라인 (셀 잔여 영역 — 출근 블록 등) */
.tcal-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 8px 8px;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden; /* 내부 컨텐츠가 셀 밖으로 비어져 나가지 않도록 */
}

.tcal-event {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: var(--tcal-fs-base);
  font-weight: 500; /* 현재 주간은 600으로 덮어씀 */
  line-height: 1.35;
  word-break: keep-all;
  overflow: hidden;
  -webkit-text-stroke-width: 5px;
  -webkit-text-stroke-color: #fff;
  paint-order: stroke fill;
}

/* 셀 안 텍스트: 기본 20px, 현재 주간 24px (보조 정보·아이콘은 비례 축소) */
/* 담당자 이름은 본문과 동일 크기·굵기 (기본 20px·500 / 현재 주간 22px·600) */
.tcal-event .tcal-ev-assignee,
.tcal-strip-event .tcal-ev-assignee {
  font-size: 1em;
  font-weight: inherit;
}

/* 시간 라벨만 본문보다 한 단계 작게 */
.tcal-event .tcal-ev-time,
.tcal-strip-event .tcal-ev-time {
  font-size: 0.8em;
  font-weight: inherit;
}

/* 아이콘 크기: 기본 16px, 현재 주간 18px
   (.tcal-ev-icon의 font-size: 14px가 1em 기준을 줄이지 않도록 덮어씀) */
.tcal-event .tcal-ev-icon.svg-icon,
.tcal-strip-event .tcal-ev-icon.svg-icon {
  font-size: var(--tcal-icon-base);
}

.tcal-week.today-week .tcal-event .tcal-ev-icon.svg-icon,
.tcal-week.today-week .tcal-strip-event .tcal-ev-icon.svg-icon {
  font-size: var(--tcal-icon-today);
}

.tcal-event .tcal-ev-icon.svg-icon svg,
.tcal-strip-event .tcal-ev-icon.svg-icon svg {
  width: auto;
  height: 1em;
}

.tcal-week.today-week .tcal-event,
.tcal-week.today-week .tcal-strip-event {
  font-size: var(--tcal-fs-today);
  font-weight: 600;
}

/* ── 출근 일정 블록: [아이콘] 출근 / 프로젝트명 / (펼침) 시간·타이틀·구분선·출근자 */
.tcal-work-event {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--tcal-fs-base);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
}

.tcal-week.today-week .tcal-work-event {
  font-size: var(--tcal-fs-today);
  font-weight: 600;
}

.tcal-work-head {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #FF550A;
  font-weight: 600;
}

.tcal-work-head .tcal-ev-icon.svg-icon {
  margin-top: 0;
  font-size: var(--tcal-icon-base);
}

.tcal-week.today-week .tcal-work-head .tcal-ev-icon.svg-icon {
  font-size: var(--tcal-icon-today);
}

.tcal-work-head .tcal-ev-icon.svg-icon svg {
  width: auto;
  height: 1.1em;
}

/* 프로젝트명: 클릭 시 상세 펼침 */
.tcal-work-project {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  text-align: left;
  font-size: 1em; /* 다른 일정 텍스트와 동일 (기본 20px / 현재 주간 22px) */
  font-weight: inherit;
  color: #444;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 셀 구분 색(.tcal-cell-*)보다 우선하도록 .tcal 한정자 추가 */
.tcal .tcal-work-project:hover {
  color: #FF550A;
  text-decoration: underline;
}

/* 펼침 상세: 시간 / 타이틀 / 구분선 / 출근자 — 한 줄씩 */
.tcal-work-detail {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  border-top: 1.3px solid #DCE0E5;
  background: linear-gradient(180deg, #FBEFE8 0%, #F6F6F6 6.73%);
  mix-blend-mode: multiply;
  cursor: default;
  max-width: 100%;
}

.tcal-work-line {
  word-break: keep-all;
  overflow-wrap: anywhere; /* 긴 영문/URL이 박스를 넘지 않도록 */
  min-width: 0;
}

.tcal-work-line.time {
  color: #FF550A;
  font-size: 18px;
}

.tcal-work-line.title {
  color: #695642;
  font-size: 20px;
  font-weight: 700;
}

.tcal-work-line.assignee {
  color: #695642;
  font-size: 20px;
  font-weight: 500;
}

.tcal-work-divider {
  border-top: 1px solid #DCE0E5;
  margin: 2px 0;
}

/* 이벤트 텍스트는 한 줄 말줄임 */
.tcal-week .tcal-event .tcal-ev-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tcal-event.clickable:hover .tcal-ev-text {
  text-decoration: underline;
}

.tcal-ev-icon {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1.7;
}

.tcal-event.kind-start,
.tcal-ev-icon.kind-start { color: #15803d; }

.tcal-event.kind-complete,
.tcal-ev-icon.kind-complete { color: #FF550A; }

.tcal-event.kind-issue,
.tcal-ev-icon.kind-issue { color: #2563eb; font-weight: 600; }

.tcal-event.kind-issue { font-weight: 500; }

.tcal-event.kind-delay { color: #8a8a8a; }

/* ── 수동 일정: 분류는 앞 아이콘(일정/휴가·시차)으로 구분 */
.tcal-event.kind-custom { color: #444; }

/* 분류 칩 선택 색은 분류와 무관하게 동일 (아래 .tcal-cat-chip.active 참고) */

/* 담당자 이름 (없으면 팀 공통) */
.tcal-ev-assignee {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 600;
  color: #555;
  line-height: 1.6;
}

/* 시간 라벨 (10:00 / 09:00~18:00) */
.tcal-ev-time {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 600;
  color: #888;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

/* 수동 일정 삭제 버튼 */
.tcal-ev-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #bbb;
  cursor: pointer;
  transition: all 0.12s;
}

.tcal-ev-del:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* ── 일정 등록 팝업 */
.tcal-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  overflow-y: auto; /* 팝업이 화면보다 길어지는 극단 상황에만 배경 쪽 스크롤 */
  padding: 24px 0;
}

.tcal-popup {
  width: 520px;
  max-width: calc(100vw - 48px);
  margin: auto; /* 작을 땐 중앙 정렬, 길어지면 배경 스크롤과 함께 자연 배치 */
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tcal-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tcal-popup-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* 등록 날짜 변경 입력 (강조 18px) */
.tcal-popup-date {
  padding: 5px 10px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  color: #222;
  cursor: pointer;
  outline: none;
}

.tcal-popup-date:focus {
  border-color: #DB9762;
  box-shadow: 0 0 0 2px rgba(219, 151, 98, 0.18);
}

.tcal-popup-title {
  font-size: 18px; /* 강조 */
  font-weight: 700;
  color: #222;
}

.tcal-popup-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #888;
  cursor: pointer;
  transition: all 0.12s;
}

.tcal-popup-close:hover {
  background: #f0f0f0;
  color: #333;
}

/* 카테고리 선택 칩 */
.tcal-cat-chips {
  display: flex;
  gap: 8px;
}

.tcal-cat-chip {
  flex: 1;
  padding: 7px 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  transition: all 0.12s;
}

.tcal-cat-chip:hover {
  background: #f8f8f8;
}

/* 선택된 분류: 일정/휴가/시차/출근 모두 동일한 색 */
.tcal-cat-chip.active {
  background: #FFF6ED;
  border-color: #d97a2e;
  color: #d97a2e;
}

/* 대상 선택 (팀 전체 / 담당자) */
.tcal-popup-target-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tcal-target-toggle {
  display: flex;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.tcal-target-btn {
  padding: 6px 16px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  transition: all 0.12s;
}

.tcal-target-btn.active {
  background: #fff;
  color: #d97a2e;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* 담당자 선택 칩 (다중 선택) */
.tcal-member-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
}

.tcal-member-chip {
  padding: 5px 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  color: #777;
  cursor: pointer;
  transition: all 0.12s;
}

.tcal-member-chip:hover {
  border-color: #DB9762;
}

.tcal-member-chip.active {
  background: #FFF6ED;
  border-color: #d97a2e;
  color: #d97a2e;
}

.tcal-member-empty {
  font-size: 16px;
  color: #aaa;
}

/* 시간 선택 행 */
.tcal-popup-time-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tcal-popup-time-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #666;
}

.tcal-popup-time {
  padding: 7px 10px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  color: #333;
  cursor: pointer;
  outline: none;
}

.tcal-popup-time:focus {
  border-color: #DB9762;
  box-shadow: 0 0 0 2px rgba(219, 151, 98, 0.18);
}

/* 목록 안 시간 변경용 소형 셀렉트 */
.tcal-popup-time.small {
  padding: 3px 6px;
  font-size: 16px;
  border-radius: 6px;
}

/* ── 출근 관련 프로젝트 검색 선택 */
.tcal-project-row {
  flex: 1;
  min-width: 0;
}

.tcal-project-search {
  position: relative;
  flex: 1;
  min-width: 0;
}

.tcal-project-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 32px 7px 10px; /* 오른쪽은 해제(×) 버튼 자리 */
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  color: #333;
  outline: none;
}

.tcal-project-search-input:focus {
  border-color: #DB9762;
  box-shadow: 0 0 0 2px rgba(219, 151, 98, 0.18);
}

.tcal-project-search-input::placeholder {
  color: #b8b8b8;
}

.tcal-project-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #bbb;
  cursor: pointer;
}

.tcal-project-search-clear:hover {
  background: #f0f0f0;
  color: #666;
}

.tcal-project-search-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.tcal-project-search-item {
  flex-shrink: 0; /* max-height 초과 시 항목이 짓눌리지 않고 스크롤되도록 */
  padding: 7px 10px;
  background: none;
  border: none;
  border-radius: 6px;
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tcal-project-search-item:hover,
.tcal-project-search-item.active {
  background: #FFF6ED;
}

.tcal-project-search-empty {
  padding: 8px 10px;
  font-size: 16px;
  color: #aaa;
}

/* 타이틀 위 / 입력창 아래 세로 필드 (팝업 공통) */
.tcal-popup-field {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.tcal-popup-field-title {
  font-size: 16px;
  font-weight: 600;
  color: #666;
}

/* 필드 안에서 가로로 묶이는 내용 (휴가 기간: 시작 고정 ~ 종료 입력) */
.tcal-popup-field-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* 프로젝트 검색은 필드 폭 전체 사용 */
.tcal-popup-field > .tcal-project-search {
  align-self: stretch;
}

/* 시간 행의 체크박스(매주 반복/과부하)는 입력창 라인에 맞춤 */
.tcal-popup-time-row > .tcal-popup-repeat {
  align-self: flex-end;
  padding-bottom: 9px;
}

/* 시차: 시작시간 ~ 종료시간 사이 구분 기호 (입력창 라인에 맞춤) */
.tcal-popup-tilde {
  align-self: flex-end;
  padding-bottom: 9px;
  font-size: 16px;
  color: #888;
}


/* 셀별 그룹 (검색어 없을 때의 탐색 모드) */
.tcal-project-group {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.tcal-project-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 7px 10px;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}

.tcal-project-group-head:hover {
  background: #f5f5f5;
}

.tcal-project-group-name {
  font-size: 16px;
  font-weight: 700;
  color: #555; /* 셀 그룹은 tcal-cell-* 색으로 덮어써짐 */
}

.tcal-project-group-count {
  font-size: 14px;
  color: #999;
  background: #f0f0f0;
  border-radius: 9px;
  padding: 1px 8px;
}

.tcal-project-group-chev {
  margin-left: auto;
  color: #999;
  transition: transform 0.15s;
}

.tcal-project-group-chev.open {
  transform: rotate(180deg);
}

/* 그룹 안 항목은 들여쓰기 */
.tcal-project-search-item.in-group {
  padding-left: 24px;
}

/* 목록 항목의 관련 프로젝트 라벨 */
.tcal-popup-item-project {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 16px;
  color: #888;
  background: #f6f6f6;
  border-radius: 4px;
  padding: 2px 8px;
}

/* 휴가 기간 시작일 (선택한 날짜 고정 표시) */
.tcal-popup-date-start {
  padding: 7px 10px;
  background: #f6f6f6;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  color: #777;
}

/* 매주 반복 체크박스 */
.tcal-popup-repeat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  user-select: none;
}

.tcal-popup-repeat input[type='checkbox'] {
  width: 17px;
  height: 17px;
  accent-color: #d97a2e;
  cursor: pointer;
}

/* 입력 + 등록 버튼 */
.tcal-popup-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tcal-popup-issue-row .tcal-issue-del {
  flex-shrink: 0;
}

.tcal-popup-input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  color: #333;
  outline: none;
}

.tcal-popup-input:focus {
  border-color: #DB9762;
  box-shadow: 0 0 0 2px rgba(219, 151, 98, 0.18);
}

.tcal-popup-input::placeholder {
  color: #b8b8b8;
}

/* 팝업 푸터: 등록 버튼 */
.tcal-popup-footer {
  border-top: 1px solid #eee;
  padding-top: 14px;
}

/* 등록 성공/실패 인라인 피드백 (캘린더 창엔 토스트가 없으므로) */
.tcal-popup-feedback {
  display: block;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}
.tcal-popup-feedback.success {
  color: var(--green);
}
.tcal-popup-feedback.error {
  color: var(--red);
}

.tcal-popup-submit {
  width: 100%;
  padding: 11px 0;
  background: #d97a2e;
  border: none;
  border-radius: 8px;
  font-size: 18px; /* 강조 */
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.12s;
}

.tcal-popup-submit:hover:not(:disabled) {
  background: #c46a22;
}

.tcal-popup-submit:disabled {
  background: #e8d5c2;
  cursor: default;
}

/* 해당 날짜의 등록된 일정 목록 */
.tcal-popup-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid #eee;
  padding-top: 12px;
}

.tcal-popup-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 2px;
  font-size: 16px;
  color: #333;
}

/* 항목 줄: 1줄 아이콘+프로젝트명 / 2줄 담당자 / 3줄 시간 / 4줄 타이틀 */
.tcal-popup-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #888;
}

/* 첫 줄: 삭제 버튼은 오른쪽 끝으로 */
.tcal-popup-item-row.head .tcal-ev-del {
  margin-left: auto;
}

/* 둘째 줄부터는 아이콘 폭만큼 들여쓰기해 앞 라인 정렬 */
.tcal-popup-item-row.indent {
  padding-left: 26px;
}

/* 일정 항목: 시간과 타이틀 입력창 사이 세로 구분선 */
.tcal-popup-item-divider {
  flex-shrink: 0;
  width: 1px;
  height: 22px;
  background: #DCE0E5;
}

/* 팝업 목록 안 시간/기간 라벨도 기본 16px */
.tcal-popup-item .tcal-ev-time {
  font-size: 16px;
}

/* 담당자 (클릭 시 팀원 칩으로 수정) */
.tcal-popup-assignee-btn {
  padding: 0;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  text-align: left;
  word-break: keep-all;
}

.tcal-popup-assignee-btn:hover {
  color: #d97a2e;
  text-decoration: underline;
}

.tcal-popup-item .tcal-ev-icon.svg-icon {
  margin-top: 0;
}

/* 목록 항목 내용 (휴가/시차 — 수정 불가 텍스트) */
.tcal-popup-item-text {
  flex: 1;
  min-width: 0;
  word-break: keep-all;
}

/* 목록 항목 내용 입력창 (수정용) — 평소에도 입력창임이 드러나도록 테두리 항상 표시 */
.tcal-popup-item-input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  color: #333;
  outline: none;
  transition: all 0.12s;
}

.tcal-popup-item-input:hover {
  border-color: #DB9762;
}

.tcal-popup-item-input:focus {
  border-color: #DB9762;
  box-shadow: 0 0 0 2px rgba(219, 151, 98, 0.15);
}

/* 내용 변경 시 나타나는 수정 버튼 */
.tcal-popup-item-save {
  flex-shrink: 0;
  padding: 4px 12px;
  background: #d97a2e;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.12s;
}

.tcal-popup-item-save:hover {
  background: #c46a22;
}

/* SVG 아이콘 (일정 분류) */
.tcal-ev-icon.svg-icon {
  display: inline-flex;
  align-items: center;
}

.tcal-ev-icon.svg-icon svg {
  display: block;
}

/* ── 별도 창(?view=calendar) 래퍼 */
.app.calendar-child {
  position: relative;
  height: 100%;
}

.tcal-window {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 12px;
}

.tcal-window .tcal {
  margin: 0;
}

/* 별도 창: 주 행이 남은 높이를 나눠 바닥까지 채움.
   shrink=0 이라 주가 많을 때는 기존대로 .tcal-body 스크롤.
   임베드 캘린더는 .tcal-week 기본값(flex: 0 0 auto)을 그대로 사용 */
.app.calendar-child .tcal-week,
.app.calendar-child .tcal-week.today-week {
  flex: 1 0 auto;
}

/* ── 프로젝트 명 셀 구분 색 (담당 셀 기준, 2개 셀 이상은 셀협업)
   진한 색 = 텍스트/아이콘 면, 연한 색(--tcal-start-stroke) = 시작 아이콘 테두리
   마지막에 선언해 kind별 색 등 앞선 규칙을 덮어씀 */
.tcal .tcal-cell-ux     { color: var(--team-cell-ux); --tcal-start-stroke: #BFF6E6; } /* UX셀 */
.tcal .tcal-cell-video  { color: var(--team-cell-video); --tcal-start-stroke: #A4B0E3; } /* 영상셀 */
.tcal .tcal-cell-edit   { color: var(--team-cell-edit); --tcal-start-stroke: #F4DEFD; } /* 편집셀 */
.tcal .tcal-cell-collab { color: var(--team-cell-collab); --tcal-start-stroke: #FFE5B0; } /* 셀협업 */
