/* ==========================================================================
   Timetable page (E-1 Part 2a) — 주간 격자 + 셀 모달
   새로운 컴포넌트 구조 (TimetableGrid + SessionModal) 기반
   ========================================================================== */

/* -------------------- Page -------------------- */
.tt-page {
  padding: 20px 24px 60px;
  max-width: none !important;
}

/* -------------------- Toolbar -------------------- */
.tt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
}
.tt-toolbar-l { display: inline-flex; align-items: center; gap: var(--space-2); }
.tt-toolbar-r { display: inline-flex; align-items: center; gap: var(--space-3); }

.tt-nav-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--border);
  color: var(--fg-primary);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--dur-base) var(--ease-out);
}
.tt-nav-btn:hover { background: var(--color-bg-sunken); border-color: var(--slate-300); }
.tt-nav-btn i { width: 16px; height: 16px; }

.tt-nav-today {
  height: 34px; padding: 0 14px;
  border-radius: var(--radius);
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--color-border-default);
  font-size: var(--text-caption); font-weight: var(--weight-semibold);
  cursor: pointer;
}
.tt-nav-today:hover { background: var(--color-brand-primary-subtle); border-color: var(--accent); }

.tt-range { margin-left: var(--space-3); display: flex; flex-direction: column; line-height: 1.2; }
.tt-range-main {
  font-size: 16px; font-weight: var(--weight-semibold);
  color: var(--fg-primary); font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.tt-range-sub { font-size: var(--text-micro); color: var(--fg-secondary); margin-top: 1px; }

.tt-mode {
  display: inline-flex;
  background: var(--color-border-subtle);
  border-radius: var(--radius);
  padding: 3px;
}
.tt-mode-btn {
  height: 28px; padding: 0 14px;
  background: transparent; border: 0; border-radius: 4px;
  font-size: var(--text-caption); font-weight: var(--weight-medium);
  color: var(--fg-secondary); cursor: pointer;
}
.tt-mode-btn:not(:disabled):hover { color: var(--fg-primary); }
.tt-mode-btn.on { background: #fff; color: var(--fg-primary); font-weight: var(--weight-semibold); box-shadow: var(--shadow-sm); }
.tt-mode-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tt-mode-btn.is-placeholder { opacity: 0.55; }
.tt-mode-btn.is-placeholder:hover { opacity: 0.8; }

.tt-weekend-toggle,
.tt-crop-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-caption); color: var(--fg-secondary); cursor: pointer;
  user-select: none;
}
.tt-weekend-toggle input,
.tt-crop-toggle input { cursor: pointer; }

/* hotfix21.41 — zoom 버튼 그룹 (1× / 1.5× / 2×) */
.tt-zoom {
  display: inline-flex;
  background: var(--bg-muted, #F1F5F9);
  border-radius: var(--radius-sm, 6px);
  padding: 2px;
  gap: 2px;
}
.tt-zoom-btn {
  border: 0;
  background: transparent;
  padding: 4px 8px;
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  color: var(--fg-secondary, #64748B);
  cursor: pointer;
  border-radius: 4px;
  min-width: 32px;
}
.tt-zoom-btn:hover { color: var(--fg-primary, #0F172A); }
.tt-zoom-btn.on {
  background: #fff;
  color: var(--fg-primary, #0F172A);
  font-weight: var(--weight-semibold, 600);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(15,23,42,0.08));
}

/* -------------------- Filters -------------------- */
.tt-filters {
  display: flex; align-items: center; gap: var(--space-2);
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

/* ==========================================================================
   TimetableGrid 컴포넌트
   - 48px 고정 time col + 1fr × N 요일 컬럼
   - 30분 슬롯 × 26 rows (09:00–22:00)
   - 행 높이 40px
   ========================================================================== */

.tg-wrap {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-3);
}

/* ─────── Head ─────── */
/* hotfix21.14 (rev4): 디자인 토큰 기반 light head — tokens.css palette 충실.
   - 평일 bg = --color-brand-primary-subtle (teal-50, brand soft) — 사이드바·본문과 brand 통일.
     [오늘] 버튼과 같은 brand-soft tone 사용 → 시각언어 일관성.
   - 주말 bg = --slate-100 (neutral) — "주말 = 휴무" 의미 매핑.
   - 라벨 = --color-text-secondary (slate-700), 날짜 = --color-text-muted (slate-500).
   - border = --color-border-default (slate-200).
   - today underline = --accent (teal-500) 3px 강조.
   - theme 전환 시 평일 bg 자동 매칭 (.theme-yellow → warning-50, .theme-rose → rose-50). */
.tg-head {
  display: grid;
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border-default);
  position: sticky; top: 0; z-index: 5;
}
.tg-head-time-col {
  border-right: 1px solid var(--color-border-default);
  background: var(--color-bg-sunken);
}
.tg-head-day {
  position: relative;
  padding: 10px 8px 12px;
  text-align: center;
  border-right: 1px solid var(--color-border-default);
  background: var(--color-brand-primary-subtle);   /* 평일 default — brand soft (teal-50)
                                                      = .cl-cat-화상 배지와 같은 토큰 */
}
.tg-head-day:last-child { border-right: 0; }
.tg-head-label {
  font-size: 16px; font-weight: var(--weight-bold);
  letter-spacing: 0; color: var(--color-text-secondary);
  margin-bottom: 2px;
}
.tg-head-date {
  font-size: 12px; font-weight: var(--weight-medium);
  letter-spacing: 0; font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}
/* 토/일 — blue-100 (.cl-cat-초등 배지와 같은 톤, 시각언어 통일). */
.tg-head-day.sat,
.tg-head-day.sun {
  background: #DBEAFE;                                /* blue-100 — courses.css .cl-cat-초등 매칭 */
}

/* 모든 day 셀 아래 라인 — [오늘] 버튼 글씨 색(brand accent teal) 으로 통일.
   today 는 두께(1 → 3px) 로 차별화. */
.tg-head-day::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);                          /* teal-500 — [오늘] 글씨 색 */
}
.tg-head-day.today::after {
  height: 3px;
}

/* ─────── Body ─────── */
.tg-body {
  display: grid;
  position: relative;
}

.tg-time-col {
  border-right: 1px solid var(--border);
  background: var(--color-bg-sunken);
  display: flex; flex-direction: column;
}
/* hotfix21.9: 시간 라벨 굵기 톤다운 (semibold → medium), 색도 secondary 로. */
.tg-time-slot {
  height: 60px;
  padding: 0 6px;
  text-align: right;
  font-size: 11.5px;
  font-weight: var(--weight-medium);
  color: var(--fg-secondary);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: flex-start; justify-content: flex-end;
  position: relative;
  letter-spacing: -0.02em;
}
.tg-time-slot.hour { border-top: 1.5px solid var(--color-border-default); }
.tg-time-slot.hour:first-child { border-top: 0; }
.tg-time-slot span {
  transform: translateY(-8px);
  line-height: 1;
  background: var(--color-bg-sunken);
  padding: 0 4px;
}
.tg-time-slot:first-child span { transform: translateY(2px); }

/* Main grid — 세션 + 배경 cell + now line 이 모두 여기 안에 위치 */
.tg-grid {
  display: grid;
  position: relative;
}

/* 배경 cell — 30분 단위 빈 영역.
   CORE #2 hotfix21.20: 그리드 라인 한 단계 진하게 — 사용자 피드백 (선이 너무 안 보임).
   - 정시: 1px solid slate-300 (#CBD5E1) — 시간 단위 명확
   - 30분: 1px dotted slate-200 (#E2E8F0) — 정시보다 한 단계 연함, 위계 유지
   - 수직: slate-200 (default border) — 요일 컬럼 분리 */
.tg-bg-cell {
  border-right: 1px solid var(--color-border-default);   /* slate-200 */
  border-top: 1px dotted #E2E8F0;          /* 30분 선 — slate-200 점선 */
  background: #fff;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out);
}
.tg-bg-cell:last-child { border-right: 0; }
.tg-bg-cell.hour {
  border-top: 1px solid #CBD5E1;            /* 정시 선 — slate-300 실선 */
}
.tg-bg-cell.first-row {
  border-top: 0;                            /* 격자 최상단은 라인 안 그림 */
}
/* hotfix21.10 ② 토/일 본문 셀 — 아주 연한 파란 톤(주말). today 가 평일이면 teal 살짝,
   주말이면 파란 톤 유지(주말 표시 우선, today 는 head 의 빨간 bar 가 이미 표시).
   hotfix21.11: 톤 더 연하게 (0.25 → 0.10). */
.tg-bg-cell.sat,
.tg-bg-cell.sun { background: rgba(186, 230, 253, 0.10); }              /* sky-200 매우 옅게 */
.tg-bg-cell.today:not(.sat):not(.sun) { background: rgba(14, 149, 148, 0.035); }
.tg-bg-cell:hover { background: var(--color-bg-sunken); }
.tg-bg-cell.today:not(.sat):not(.sun):hover { background: rgba(14, 149, 148, 0.08); }
.tg-bg-cell.sat:hover,
.tg-bg-cell.sun:hover { background: rgba(186, 230, 253, 0.22); }

/* ─────── Session cell (grid item) ─────── */
/* CORE #2 hotfix21.4: chip 영역 극대화 — 하단 padding 줄여서 chip 더 들어가게 */
.tg-cell {
  position: relative;
  margin: 3px 4px;
  padding: 6px 8px 4px 12px;
  border: 0;
  background: #fff;
  border-radius: 7px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15,23,42,0.05);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  font-family: var(--font-sans);
  transition: box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
  z-index: 2;
  min-width: 0;
}
.tg-cell:hover:not(:disabled) {
  z-index: 10;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.tg-cell:disabled { cursor: not-allowed; }

/* 좌측 4px 세로 바 — class_type 색상 */
.tg-cell-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--slate-400);
  border-radius: 6px 0 0 6px;
}

/* class_type 별 색상 매핑 (Part 2a §2) */
.tg-type-regular   .tg-cell-bar { background: var(--teal-500); }
.tg-type-special   .tg-cell-bar { background: #F97316; }
.tg-type-online    .tg-cell-bar { background: #0EA5E9; }
.tg-type-consult   .tg-cell-bar { background: #A855F7; }
.tg-type-cancelled .tg-cell-bar { background: var(--slate-300); }

.tg-type-regular   { background: #F0FDFA; }
.tg-type-regular:hover:not(:disabled) { background: #E3F3F3; }
.tg-type-special   { background: #FFFBEB; }
.tg-type-special:hover:not(:disabled) { background: #FEF3C7; }
.tg-type-online    { background: #F0F9FF; }
.tg-type-online:hover:not(:disabled) { background: #E0F2FE; }
.tg-type-consult   { background: #FAF5FF; }
.tg-type-consult:hover:not(:disabled) { background: #F3E8FF; }
.tg-type-cancelled {
  background: #F8FAFC;
  border: 1px dashed var(--slate-300);
  opacity: 0.65;
}
.tg-type-cancelled:hover:not(:disabled) { background: #F1F5F9; }

/* 셀 내부 타이포 (CORE #2 hotfix21.2)
 *  - row1: badge + 수업명 + (우측) 강사명 (조건부) + 카메라/일지 아이콘
 *  - row2 (.tg-cell-students): 학생 chip 들 — 항상 보임
 */
.tg-cell-body {
  min-width: 0;
  flex: 1 1 auto;
  display: flex; flex-direction: column;
  gap: 4px;
  overflow: hidden;
}
.tg-cell-row1 {
  display: flex; align-items: center; gap: 6px;
  min-width: 0;
  flex-shrink: 0;
}
.tg-cell-row1-r {
  display: inline-flex; align-items: center; gap: 5px;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 6px;
}
.tg-cell-badge {
  flex-shrink: 0;
  display: inline-flex; align-items: center;
  padding: 0 5px;
  height: 16px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: 0.01em;
}
.tg-badge-regular   { background: var(--teal-50);  color: var(--teal-600); }
.tg-badge-special   { background: #FEF3C7;         color: #B45309; }
.tg-badge-online    { background: #E0F2FE;         color: #0369A1; }
.tg-badge-consult   { background: #F3E8FF;         color: #7E22CE; }
.tg-badge-cancelled { background: var(--slate-200); color: var(--slate-600); }

.tg-cell-name {
  font-size: 12.5px;
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  min-width: 0;
  flex: 1 1 auto;
}
.tg-cell-teacher-r {
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  white-space: nowrap;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* invariant 호환: 강사명 sr-only — DOM 안에는 항상 텍스트 살아있게 */
.tg-cell-teacher-sr {
  position: absolute;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* CORE #2 P6 (2026-05-05): 학생 시간 충돌 anomaly chip — P5 검출 결과 시각화.
 *  D7: 등록 OK + admin 시간표 chip 만 표시. 클릭 동작 없음 (단순 표시). */
.tg-cell-anomaly-chip {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #FEF3C7;
  color: #B45309;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  line-height: 1;
  cursor: help;
}
/* legacy 호환 (예전 .tg-cell-teacher 셀렉터) */
.tg-cell-teacher {
  font-weight: var(--weight-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

/* CORE #2 hotfix21.6: 적응형 "수강생 N명" 헤더 — chip 이 다 들어가고도 셀에 여유가
   있을 때만 표시. JS 측 hysteresis 로 toggle 진동 방지. */
.tg-cell-students-hd {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
  margin-bottom: 1px;
  font-size: 11.5px;
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
  letter-spacing: -0.01em;
  line-height: 1.2;
  flex-shrink: 0;
}
.tg-cell-students-hd-ic {
  width: 12px; height: 12px;
  color: var(--fg-muted);
  flex-shrink: 0;
}

/* 학생 이름 chip 영역 — 항상 보임. capacity 초과 chip 은 overflow hidden 으로 잘리고
   JS 가 +N chip 을 자동 추가.
   hotfix21.10: flex → CSS Grid (auto-fill, minmax) 으로 전환.
    - 모든 row 의 chip 이 같은 column 너비 유지 (auto-fill 이 cell 너비에 맞춰 column 수 결정)
    - 마지막 row 가 짧으면 좌측부터 채우고 우측은 빈 grid cell (스트레칭 안 함) — 사용자 요청.
    - row gap 4 → 3 으로 줄여 row pitch 25px 로 chip 한 줄 더 들어가게 (fit 개선). */
.tg-cell-students {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 3px 4px;
  align-content: flex-start;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  line-height: 1.2;
  margin-top: 4px;
}
/* hotfix21.12: 측정 iter 중에는 visibility hidden 으로 깜박임 가림. stable 시 reveal. */
.tg-cell-students.tg-measuring {
  visibility: hidden;
}
/* CORE #2 hotfix21.5: chip 톤 — cell 배경(연한 type 색) 위에 흰 chip 올려서 대비 강화.
   기존: 청록 cell + 청록 chip → 톤 비슷해서 안 띔.
   개선: chip = 흰 배경 + type 색 테두리 + type 색 텍스트. 흰색이 cell 위에 떠서 분리됨. */
/* hotfix21.10: grid cell 안에서 텍스트 가운데 정렬. 너비는 grid column 이 결정. */
.tg-cell-stuchip {
  display: flex; align-items: center; justify-content: center;
  height: 22px;
  padding: 0 6px;
  background: #fff;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: var(--weight-medium);
  color: #1E293B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  letter-spacing: -0.015em;
  min-width: 0;  /* grid item 이 column 보다 안 커지게 */
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.tg-cell-stuchip:hover {
  background: #fff;
  border-color: #64748B;
  transform: translateY(-0.5px);
  box-shadow: 0 1px 3px rgba(15,23,42,0.10);
}
/* type 별 chip 액센트 — 테두리 + 텍스트 색만 type 톤. 배경은 흰색 유지로 대비 강화. */
.tg-type-regular .tg-cell-stuchip {
  border-color: #5EEAD4;      /* teal-300 */
  color: #115E59;             /* teal-800 */
}
.tg-type-regular .tg-cell-stuchip:hover { border-color: #14B8A6; }
.tg-type-special .tg-cell-stuchip {
  border-color: #FDBA74;      /* orange-300 */
  color: #9A3412;             /* orange-800 */
}
.tg-type-special .tg-cell-stuchip:hover { border-color: #F97316; }
.tg-type-online .tg-cell-stuchip {
  border-color: #7DD3FC;      /* sky-300 */
  color: #075985;             /* sky-800 */
}
.tg-type-online .tg-cell-stuchip:hover { border-color: #0EA5E9; }
.tg-type-consult .tg-cell-stuchip {
  border-color: #D8B4FE;      /* purple-300 */
  color: #6B21A8;             /* purple-800 */
}
.tg-type-consult .tg-cell-stuchip:hover { border-color: #A855F7; }

/* CORE #2 Phase 4 (hotfix21.13): chip 색깔 lifecycle — attendance.status tone 매핑.
   ATTENDANCE_TONE: ok / warn / danger / muted / neutral(default).
   - default(neutral=pending): tone class 없음 → 기존 type theme 유지 (정규반=teal 등)
   - ok / warn / danger / muted: tone class 가 type theme 를 source-order 로 override.
   spec: MdTexts/challenge200-timetable-redesign_v1_0503.md §2.2
   매핑: present/makeup_done=ok / notified_absent·makeup_planned·test_planned·consult_planned·late·early_leave=warn
        / absent=danger / cancelled=muted */
.tg-cell-stuchip.tg-stu-ok {
  background: #ECFDF5;          /* emerald-50 */
  border-color: #34D399;        /* emerald-400 */
  color: #047857;               /* emerald-700 */
}
.tg-cell-stuchip.tg-stu-ok:hover { border-color: #059669; background: #D1FAE5; }
.tg-cell-stuchip.tg-stu-warn {
  background: #FFFBEB;          /* amber-50 */
  border-color: #FBBF24;        /* amber-400 */
  color: #92400E;               /* amber-800 */
}
.tg-cell-stuchip.tg-stu-warn:hover { border-color: #D97706; background: #FEF3C7; }
.tg-cell-stuchip.tg-stu-danger {
  background: #FEF2F2;          /* red-50 */
  border-color: #F87171;        /* red-400 */
  color: #B91C1C;               /* red-700 */
}
.tg-cell-stuchip.tg-stu-danger:hover { border-color: #DC2626; background: #FEE2E2; }
.tg-cell-stuchip.tg-stu-muted {
  background: #F1F5F9;          /* slate-100 */
  border-color: #CBD5E1;        /* slate-300 */
  color: #64748B;               /* slate-500 */
  text-decoration: line-through;
  text-decoration-color: rgba(100, 116, 139, 0.5);
}
.tg-cell-stuchip.tg-stu-muted:hover { border-color: #94A3B8; }

/* +N chip (overflow) — hotfix21.8: 흰색 계열로 톤다운. 다크는 너무 튀어서 사용자 요청.
   배경 살짝 회색 + 점선 테두리 + slate-500 텍스트 → "더 있음" 힌트 느낌. */
.tg-cell-stuchip-more {
  background: #F8FAFC !important;        /* slate-50 */
  border: 1px dashed #94A3B8 !important; /* slate-400 dashed — '+ 더 있음' 시각 힌트 */
  color: #64748B !important;             /* slate-500 */
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.tg-cell-stuchip-more:hover {
  background: #F1F5F9 !important;        /* slate-100 */
  border-color: #64748B !important;
  color: #334155 !important;             /* slate-700 */
}

/* row1 우측의 카메라/일지 아이콘 */
.tg-cell-camera {
  width: 12px; height: 12px;
  color: #0EA5E9;
  flex-shrink: 0;
}
.tg-cell-log {
  width: 12px; height: 12px;
  color: #F97316;
  flex-shrink: 0;
}

/* hotfix21.10: .tg-cell-warn-dot 제거 — Phase 4 chip 색깔(lifecycle)로 대체. */

/* 30분 (1-slot) 셀: 60px 안에 row1 + 학생 chip 1줄 정도. chip wrap 막아 자연스럽게 잘림. */
.tg-cell[style*="span 1"] .tg-cell-students {
  flex-wrap: nowrap;
  overflow: hidden;
}
.tg-cell[style*="span 1"] .tg-cell-stuchip {
  height: 17px;
  font-size: 10.5px;
  padding: 0 6px;
}

/* ─────── 현재 시각 빨간 선 ─────── */
.tg-now-line {
  position: relative;
  pointer-events: none;
  height: 0;
  z-index: 11;
  align-self: start;
}
.tg-now-line::before {
  content: '';
  position: absolute;
  left: -2px; right: -2px;
  top: 0;
  height: 2px;
  background: #FB7185;
  box-shadow: 0 0 6px rgba(251,113,133,0.4);
  transform: translateY(-1px);
}
.tg-now-line .tg-now-badge {
  position: absolute;
  left: 4px; top: 0;
  transform: translateY(-50%);
  padding: 2px 6px;
  background: #FB7185; color: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 3px rgba(251,113,133,0.4);
  font-size: 10px;
  font-weight: var(--weight-bold);
  line-height: 1.2;
}

/* ==========================================================================
   Legend
   ========================================================================== */
.tt-legend {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  overflow-x: auto;
}
.tt-legend-strip {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  min-width: max-content;
}
.tt-legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-caption);
  color: var(--fg-secondary);
  flex-shrink: 0;
}
.tt-legend-divider {
  display: inline-block;
  width: 1px; height: 16px;
  background: var(--divider);
  flex-shrink: 0;
}
.tt-legend-ic { width: 12px; height: 12px; color: var(--fg-secondary); }

/* class_type color chips */
.tg-legend-chip {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}
.tg-legend-regular   { background: var(--teal-500); }
.tg-legend-special   { background: #F97316; }
.tg-legend-online    { background: #0EA5E9; }
.tg-legend-consult   { background: #A855F7; }
.tg-legend-cancelled {
  background: #F8FAFC;
  border: 1px dashed var(--slate-400);
}

.tt-legend-chip { display: inline-block; width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
.tt-legend-now { width: 16px; height: 2px; background: #FB7185; border-radius: 1px; }

/* ==========================================================================
   SessionModal
   ========================================================================== */
.sm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  animation: sm-fade 0.15s ease-out;
}
@keyframes sm-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.sm-modal {
  background: #fff;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 640px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 80px);
  animation: sm-slide 0.2s ease-out;
}
@keyframes sm-slide {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sm-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--divider);
}
.sm-hd-l { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.sm-title {
  margin: 0;
  font-size: 18px;
  font-weight: var(--weight-bold);
  color: var(--fg-primary);
  letter-spacing: -0.015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sm-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  line-height: 1.5;
}
.sm-pill-cancelled { background: var(--slate-100); color: var(--slate-600); }
/* hotfix21.30: chip-based 추가 학생 식별 pill — 1회 참여 / 보충. */
.sm-pill-once   { background: #FAF5FF; color: #6B21A8; border: 1px dashed #9333EA; }
.sm-pill-makeup { background: #F3E8FF; color: #6B21A8; border: 1px solid #9333EA; }

.sm-close {
  width: 32px; height: 32px;
  border: 0; border-radius: var(--radius);
  background: transparent;
  color: var(--fg-secondary);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--dur-base) var(--ease-out);
  flex-shrink: 0;
}
.sm-close:hover { background: var(--color-border-subtle); color: var(--fg-primary); }
.sm-close i { width: 18px; height: 18px; }

/* 기본정보 */
.sm-info {
  padding: 14px 20px;
  background: var(--color-bg-sunken);
  border-bottom: 1px solid var(--divider);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
}
.sm-info-row { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.sm-info-k {
  color: var(--fg-secondary);
  font-size: 11px;
  font-weight: var(--weight-medium);
  min-width: 44px;
}
.sm-info-v { color: var(--fg-primary); font-weight: var(--weight-medium); }

/* 섹션 */
.sm-sec {
  padding: 16px 20px;
  border-bottom: 1px solid var(--divider);
}
.sm-sec:last-of-type { border-bottom: 0; }
.sm-sec-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.sm-sec-hd h3 {
  margin: 0;
  font-size: 14px;
  font-weight: var(--weight-semibold);
  color: var(--fg-primary);
}
.sm-sec-count { color: var(--fg-secondary); font-weight: var(--weight-regular); font-size: 13px; }
.sm-sec-hint { font-size: 11px; color: var(--fg-muted); }

.sm-empty {
  padding: 24px; text-align: center;
  color: var(--fg-muted);
  font-size: 13px;
  background: var(--color-bg-sunken);
  border-radius: var(--radius);
}

/* 학생 row */
.sm-student-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
  max-height: 320px; overflow-y: auto;
}
.sm-student-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius);
  transition: border-color var(--dur-base) var(--ease-out);
}
.sm-student-row:hover { border-color: var(--color-border-default); }
.sm-student-l {
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 0; flex: 1;
  flex-wrap: wrap;
}
.sm-student-no {
  font-size: 11px; color: var(--fg-muted); font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  width: 22px;
}
.sm-student-name {
  font-size: 13px; font-weight: var(--weight-semibold); color: var(--fg-primary);
}
.sm-student-grade {
  display: inline-block;
  padding: 1px 6px;
  background: var(--color-bg-sunken);
  color: var(--color-text-secondary);
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: var(--weight-medium);
}

/* 출결 버튼 그룹 */
.sm-att-group {
  display: inline-flex; gap: 4px;
  flex-shrink: 0;
}
.sm-att-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--color-border-default);
  background: #fff;
  border-radius: var(--radius);
  font-size: 11.5px;
  font-weight: var(--weight-medium);
  color: var(--fg-secondary);
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
}
.sm-att-btn:hover { background: var(--color-bg-sunken); color: var(--fg-primary); }
.sm-att-btn.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: var(--weight-semibold);
}
.sm-att-btn.on.sm-att-absent {
  background: var(--danger-50);
  border-color: var(--danger-600);
  color: var(--danger-600);
}
.sm-att-btn.on.sm-att-late {
  background: var(--warning-50);
  border-color: var(--warning-600);
  color: var(--warning-700);
}
.sm-att-btn.on.sm-att-early_leave {
  background: var(--slate-100);
  border-color: var(--slate-500);
  color: var(--slate-700);
}
.sm-att-mark { font-size: 13px; line-height: 1; }
.sm-att-label { font-size: 11px; }
.sm-att-cancelled {
  display: inline-flex; align-items: center;
  height: 28px; padding: 0 12px;
  background: var(--slate-100); color: var(--slate-600);
  border-radius: var(--radius);
  font-size: 11.5px; font-weight: var(--weight-semibold);
}

/* Placeholder 섹션 */
.sm-sec-placeholder {
  background: var(--color-bg-sunken);
}
.sm-memo {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 13px;
  resize: vertical;
  min-height: 56px;
  margin-bottom: 8px;
  background: #fff;
}
.sm-memo:focus { outline: none; border-color: var(--color-border-focus); box-shadow: 0 0 0 3px var(--accent-soft); }
.sm-placeholder-row {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.sm-ph-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 10px;
  border: 1px solid var(--color-border-default);
  background: #fff;
  border-radius: var(--radius);
  font-size: 12px; color: var(--fg-secondary);
  cursor: pointer;
}
.sm-ph-btn:hover { background: var(--color-bg-sunken); color: var(--fg-primary); }
.sm-ph-btn i { width: 12px; height: 12px; }
.sm-color-picker { display: inline-flex; align-items: center; gap: 6px; }
.sm-ph-label { font-size: 11px; color: var(--fg-muted); }
.sm-color-dot {
  width: 18px; height: 18px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
}
.sm-color-dot.sm-color-teal   { background: var(--teal-500); }
.sm-color-dot.sm-color-orange { background: #F97316; }
.sm-color-dot.sm-color-sky    { background: #0EA5E9; }
.sm-color-dot.sm-color-purple { background: #A855F7; }
.sm-color-dot.sm-color-slate  { background: var(--slate-400); }

/* 하단 */
.sm-ft {
  padding: 12px 20px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--divider);
  gap: 12px;
}
.sm-ft-note { font-size: 11px; color: var(--fg-muted); }
.sm-btn-close {
  padding: 8px 16px;
  background: var(--color-bg-brand);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-size: 13px; font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out);
}
.sm-btn-close:hover { background: var(--navy-mid); }

/* ==========================================================================
   Phase 4: StudentChipModal (.scm-)
   - sm-backdrop / sm-modal / sm-hd / sm-close / sm-ft / sm-btn-close 재사용
   - scm- prefix 는 학생 모달 전용 섹션 (이번 주 / 최근 출결 / 메모 log / 액션)
   spec: MdTexts/challenge200-timetable-redesign_v1_0503.md §2.1
   ========================================================================== */
.scm-modal { max-width: 720px; }
.scm-school { font-size: 11.5px; color: var(--fg-muted); margin-left: 6px; }
.scm-pill-grade { background: var(--accent-soft); color: var(--accent); }

/* tone pill (chip 톤과 동일 매핑) — 이번 주 수업 / 최근 출결 row 의 status 표시 */
.scm-status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  background: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--color-border-subtle);
  line-height: 1.5;
  white-space: nowrap;
}
.scm-status-pill.scm-tone-ok     { background: #ECFDF5; color: #047857; border-color: #34D399; }
.scm-status-pill.scm-tone-warn   { background: #FFFBEB; color: #92400E; border-color: #FBBF24; }
.scm-status-pill.scm-tone-danger { background: #FEF2F2; color: #B91C1C; border-color: #F87171; }
.scm-status-pill.scm-tone-muted  { background: #F1F5F9; color: #64748B; border-color: #CBD5E1; }

/* 이번 주 수업 list */
.scm-week-list, .scm-recent-list, .scm-memo-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.scm-week-item .scm-week-row {
  width: 100%;
  display: grid;
  grid-template-columns: 24px 40px 96px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}
.scm-week-item .scm-week-row:hover {
  border-color: var(--color-border-default);
  background: var(--color-bg-sunken);
}
.scm-week-item.is-this .scm-week-row {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.scm-week-day {
  font-size: 13px; font-weight: var(--weight-semibold);
  color: var(--fg-primary); text-align: center;
}
.scm-week-date, .scm-week-time {
  font-size: 12px; color: var(--fg-secondary);
  font-variant-numeric: tabular-nums;
}
.scm-week-name {
  font-size: 13px; color: var(--fg-primary);
  font-weight: var(--weight-medium);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}

/* 최근 출결 list */
.scm-recent-item {
  display: grid;
  grid-template-columns: 50px 110px 1fr;
  gap: 12px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius);
  font-size: 12.5px;
  align-items: center;
}
.scm-recent-date { color: var(--fg-secondary); font-variant-numeric: tabular-nums; }
.scm-recent-reason {
  color: var(--fg-muted); font-size: 11.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 선택한 자리: status row + memo block */
.scm-sec-context { background: var(--color-bg-sunken); }
.scm-status-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.scm-status-label {
  font-size: 11.5px; font-weight: var(--weight-medium);
  color: var(--fg-muted);
  display: inline-flex; align-items: center; gap: 4px;
  flex-wrap: wrap;
}
.scm-status-divider { color: var(--fg-muted); }
.scm-status-current { font-size: 10.5px; padding: 1px 6px; }
.scm-status-options {
  display: inline-flex; flex-wrap: wrap; gap: 6px;
}
.scm-status-btn {
  display: inline-flex; align-items: center;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--color-border-default);
  background: #fff;
  border-radius: var(--radius);
  font-size: 12px; font-weight: var(--weight-medium);
  color: var(--fg-secondary);
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
}
.scm-status-btn:hover { background: var(--color-bg-sunken); color: var(--fg-primary); }
.scm-status-btn.is-on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: var(--weight-semibold);
}
.scm-status-btn.is-on.scm-tone-ok     { background: #ECFDF5; border-color: #34D399; color: #047857; }
.scm-status-btn.is-on.scm-tone-warn   { background: #FFFBEB; border-color: #FBBF24; color: #92400E; }
.scm-status-btn.is-on.scm-tone-danger { background: #FEF2F2; border-color: #F87171; color: #B91C1C; }

/* 메모 log block */
.scm-memo-block {
  background: #fff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.scm-memo-label {
  font-size: 12px; font-weight: var(--weight-semibold);
  color: var(--fg-primary);
  margin-bottom: 6px;
}
.scm-memo-empty {
  font-size: 12px; color: var(--fg-muted);
  padding: 8px 0;
}
.scm-memo-item {
  padding: 6px 0;
  border-bottom: 1px dashed var(--color-border-subtle);
}
.scm-memo-item:last-child { border-bottom: 0; }
.scm-memo-meta {
  display: flex; gap: 8px;
  font-size: 11px; color: var(--fg-muted);
  margin-bottom: 2px;
}
.scm-memo-author { font-weight: var(--weight-medium); }
.scm-memo-body {
  font-size: 12.5px; color: var(--fg-primary);
  line-height: 1.4;
  white-space: pre-wrap;
}
.scm-memo-add {
  margin-top: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.scm-memo-add .sm-memo {
  margin-bottom: 0; min-height: 44px; font-size: 12.5px;
}
.scm-memo-btn {
  align-self: flex-start;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius);
  font-size: 11.5px; font-weight: var(--weight-semibold);
  cursor: pointer;
}
.scm-memo-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.scm-memo-btn:not(:disabled):hover { background: var(--accent); color: #fff; }

/* 학생 단위 메모 */
.scm-sec-student-memo .scm-pin { font-size: 14px; margin-right: 4px; }
.scm-toggle {
  background: transparent;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--fg-secondary);
  cursor: pointer;
}
.scm-toggle:hover { background: var(--color-bg-sunken); color: var(--fg-primary); }

/* 액션 버튼 row */
.scm-ft {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.scm-actions {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.scm-action-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius);
  font-size: 12px; font-weight: var(--weight-medium);
  color: var(--fg-secondary);
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
}
.scm-action-btn i { width: 13px; height: 13px; }
.scm-action-btn:hover:not(:disabled) {
  background: var(--color-bg-sunken);
  color: var(--fg-primary);
  border-color: var(--accent);
}
.scm-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.scm-action-makeup {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.scm-action-makeup:not(:disabled):hover { background: var(--accent); color: #fff; }
.scm-ft .sm-btn-close { align-self: flex-end; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1279px) {
  .sm-info { grid-template-columns: 1fr; gap: 6px; }
  .scm-week-item .scm-week-row { grid-template-columns: 24px 40px 80px 1fr auto; gap: 6px; }
}
@media (max-width: 900px) {
  .sm-student-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .sm-att-group { flex-wrap: wrap; }
  .scm-actions { flex-direction: column; }
  .scm-action-btn { justify-content: flex-start; }
}

/* ==========================================================================
   CORE #2 Phase 5 (hotfix21.22) — DnD 시각 표시
   ========================================================================== */

/* drag source — 옅게 (드래깅 중인 원본). */
.tg-cell.tg-cell-dragging-source {
  opacity: 0.3;
  cursor: grabbing;
}
.tg-cell-stuchip.tg-cell-stuchip-dragging-source {
  opacity: 0.3;
}

/* DnD 활성 시 카드 hover cursor 표시 — admin 시간표만 enableDnd=true. */
.tt-page .tg-cell { cursor: grab; }
.tt-page .tg-cell.is-cancelled { cursor: not-allowed; }
.tt-page .tg-cell:active { cursor: grabbing; }

/* drop preview — grid column/row span 으로 위치된다. */
.tg-drop-preview {
  position: relative;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  z-index: 6;
  margin: 1px;
  padding: 4px 6px;
  text-align: center;
  transition: background 120ms, border-color 120ms;
}
.tg-drop-preview-label { font-size: 12px; }
.tg-drop-preview-reason { font-size: 10px; opacity: 0.85; margin-top: 2px; }

.tg-drop-preview.tone-ok {
  background: rgba(20, 184, 166, 0.18);
  border: 2px dashed #14B8A6;
  color: #0F766E;
}
.tg-drop-preview.tone-danger {
  background: rgba(220, 38, 38, 0.18);
  border: 2px dashed #DC2626;
  color: #991B1B;
}
.tg-drop-preview.tone-warn {
  background: rgba(249, 115, 22, 0.18);
  border: 2px dashed #F97316;
  color: #9A3412;
}
.tg-drop-preview.tone-info {
  background: rgba(147, 51, 234, 0.15);
  border: 2px dashed #9333EA;
  color: #6B21A8;
}

/* Ghost — fixed position, pointermove 따라다닌다. */
.tg-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.85;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}
.tg-ghost-card {
  background: #ECFEFF;
  border: 2px solid #06B6D4;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  transform: scale(1.02);
  transform-origin: top left;
}
.tg-ghost-card-name { font-weight: 600; margin-bottom: 2px; color: #0E7490; }
.tg-ghost-card-time { font-size: 10px; color: #155E75; }
.tg-ghost-chip {
  background: #fff;
  border: 2px solid #06B6D4;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 11px;
  transform: scale(1.08);
  transform-origin: top left;
}

/* hotfix21.29: 보충 카드 — 좌측 bar / badge 보라 (spec §2.10 의 informational tone). */
.tg-cell.tg-cell-makeup .tg-cell-bar { background: #9333EA; }
.tg-cell.tg-cell-makeup .tg-cell-badge {
  background: #F3E8FF;
  color: #6B21A8;
  border-color: #9333EA;
}

/* chip 종류 마킹 — this_only / makeup */
.tg-cell-stuchip-once {
  border: 1px dashed #9333EA;
  background: #FAF5FF;
  color: #6B21A8;
}
.tg-cell-stuchip-makeup {
  border: 1px solid #9333EA;
  background: #F3E8FF;
  color: #6B21A8;
}
.tg-cell-stuchip-kindmark {
  display: inline-block;
  margin-left: 3px;
  width: 12px; height: 12px;
  line-height: 12px;
  text-align: center;
  border-radius: 50%;
  background: #9333EA;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
}

/* ScopeModal — modal-overlay/content 컨벤션 활용 + 자체 sub element */
.tg-scope-modal { min-width: 420px; max-width: 540px; }
.tg-scope-sub {
  font-size: 13px;
  color: var(--fg-secondary, #475569);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border-default, #E2E8F0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tg-scope-sub-text { flex: 1; min-width: 0; }
/* hotfix21.32: 시간 길이 dropdown — sub 줄 우측 끝. makeup/duplicate 옵션에만 적용. */
.tg-scope-duration-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--fg-secondary, #475569);
}
.tg-scope-duration-label { color: var(--fg-muted, #64748B); }
.tg-scope-duration-inline select {
  padding: 4px 8px;
  border: 1px solid var(--color-border-default, #E2E8F0);
  border-radius: 4px;
  font-size: 12px;
  background: #fff;
  color: var(--fg-primary, #0F172A);
  font-family: inherit;
  min-width: 80px;
}
.tg-scope-conflict {
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.tg-scope-conflict.tone-danger {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: #991B1B;
}
.tg-scope-conflict.tone-warn {
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.25);
  color: #9A3412;
}
.tg-scope-conflict-ic { font-size: 14px; }
.tg-scope-override {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 12px;
  cursor: pointer;
}
.tg-scope-options { display: flex; flex-direction: column; gap: 8px; }
.tg-scope-option {
  text-align: left;
  padding: 10px 12px;
  background: var(--color-bg-sunken, #F8FAFC);
  border: 1px solid var(--color-border-default, #E2E8F0);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
  font-family: inherit;
  color: var(--fg-primary, #0F172A);
}
.tg-scope-option:not(:disabled):hover {
  background: #F0FDFA;
  border-color: #06B6D4;
}
.tg-scope-option:disabled { opacity: 0.5; cursor: not-allowed; }
.tg-scope-option strong { display: block; font-weight: 600; margin-bottom: 2px; }
.tg-scope-option em {
  display: block;
  color: var(--fg-muted, #64748B);
  font-style: normal;
  font-size: 11px;
}
/* hotfix21.31: 보충 옵션 안 시간 길이 select. button 안에 있어 stopPropagation 으로 click 분리. */
.tg-scope-option-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--color-border-default, #E2E8F0);
  border-radius: 4px;
  font-size: 12px;
  color: var(--fg-secondary, #475569);
}
.tg-scope-option-controls select {
  flex: 1;
  padding: 4px 6px;
  border: 1px solid var(--color-border-default, #E2E8F0);
  border-radius: 4px;
  font-size: 12px;
  background: #fff;
  color: var(--fg-primary, #0F172A);
  font-family: inherit;
}

/* ==========================================================================
   CORE #2 Phase 5 hotfix21.23 — Undo/Redo Floating Widget
   ========================================================================== */

/* hotfix21.24→21.25: 등장 애니메이션 — 아래→위 부드러운 slide-up (ease-out, no bounce).
   widget 이 처음 mount(페이지 진입) 또는 닫고 다시 등장할 때만 발화.
   이미 떠 있는 상태에서 새 action push 는 텍스트만 갱신, 애니메이션 X. */
@keyframes tg-undo-slide-up {
  0%   { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}

.tg-undo-widget {
  position: fixed;
  bottom: 24px;
  right: 88px;     /* default: Tweaks FAB(우하단) 옆 */
  z-index: 200;
  background: #fff;
  border: 1px solid var(--color-border-default, #E2E8F0);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  padding: 10px 12px;
  width: 260px;
  font-size: 12px;
  color: var(--fg-primary, #0F172A);
  /* hotfix21.24→21.26→21.27: drag 중 투명 transition (500ms ease-out). animation 종료 후 활성. */
  transition: opacity 500ms ease-out;
  animation: tg-undo-slide-up 280ms ease-out both;
  will-change: opacity, transform;
  /* hotfix21.26: widget 전체 drag handle. button 위에서는 cursor:pointer override. */
  cursor: grab;
  user-select: none;
}
/* hotfix21.24: 사용자가 직접 위치 옮긴 경우 — left/top 사용. default(right/bottom) override. */
.tg-undo-widget.tg-undo-widget-custom {
  right: auto;
  bottom: auto;
}

/* drag 중에는 시야 양보 — TimetableGrid 가 body[data-tg-dragging] 토글.
   hotfix21.26: 0.2 + !important — animation fill:both 의 opacity 1 을 cascade 로 override.
   transition 300ms 로 쓱 투명, drop 후 쓱 돌아옴. */
body[data-tg-dragging="true"] .tg-undo-widget {
  opacity: 0.2 !important;
  pointer-events: none;
}

/* hotfix21.26: grip 제거, widget 전체가 drag handle.
   button/close 영역만 cursor:pointer + drag 비활성. */
.tg-undo-widget.is-moving { transition: none; cursor: grabbing; }
.tg-undo-widget.is-moving * { cursor: grabbing !important; }

.tg-undo-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tg-undo-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--color-bg-sunken, #F8FAFC);
  border: 1px solid var(--color-border-default, #E2E8F0);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: var(--fg-primary, #0F172A);
  transition: background 120ms, border-color 120ms;
}
.tg-undo-btn:not(:disabled):hover {
  background: #F0FDFA;
  border-color: #06B6D4;
}
.tg-undo-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tg-undo-btn-undo .tg-undo-ic { color: #06B6D4; font-size: 14px; }
.tg-undo-btn-redo .tg-undo-ic { color: #64748B; font-size: 14px; }
/* hotfix21.26: X 버튼 — 클릭 hit area 확장 (28×28). 모름직에 가까이 가도 잡힘. */
.tg-undo-close {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--fg-muted, #64748B);
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 120ms, color 120ms;
}
.tg-undo-close:hover { background: var(--color-bg-sunken, #F8FAFC); color: var(--fg-primary, #0F172A); }

.tg-undo-desc {
  margin-top: 8px;
  font-size: 12px;
  color: var(--fg-primary, #0F172A);
  font-weight: 500;
  word-break: keep-all;
}
.tg-undo-meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--fg-muted, #64748B);
}

@media (max-width: 768px) {
  .tg-undo-widget { width: calc(100vw - 32px); right: 16px; left: 16px; bottom: 12px; }
  .tg-undo-widget.tg-undo-widget-custom { right: auto; bottom: auto; }
}

/* ==========================================================================
   hotfix21.33 — spec §2.10 겹침 시각 표시 (좌하단 점/띠)
   ==========================================================================
   .tg-cell-overlap          : wrapper, 좌하단 absolute, hover 시 tooltip(title)
   .tg-cell-overlap-dot      : 단일 색 — 6px 원형 점
   .tg-cell-overlap-strip    : 다중 색 — 가로 띠 (색별 분할)
   .tg-overlap-red/orange/purple : 색깔 매핑 */
.tg-cell-overlap {
  position: absolute;
  left: 8px;
  bottom: 5px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  pointer-events: auto;   /* tooltip(title) hover 작동 */
  z-index: 3;
}
/* hotfix27.2: 클릭 가능 — 카드 위로 올리기. */
.tg-cell-overlap.is-clickable { cursor: pointer; padding: 2px 4px; margin: -2px -4px; border-radius: 4px; }
.tg-cell-overlap.is-clickable:hover { background: rgba(255,255,255,0.5); }
.tg-cell-overlap-dot .tg-cell-overlap-mark {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.85);
}
.tg-cell-overlap-strip {
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.85);
}
.tg-cell-overlap-strip .tg-cell-overlap-mark {
  display: inline-block;
  width: 9px;
  height: 5px;
}
.tg-overlap-red    { background: #DC2626; }   /* blocking */
.tg-overlap-orange { background: #F59E0B; }   /* soft */
.tg-overlap-purple { background: #A855F7; }   /* informational */

/* ==========================================================================
   hotfix21.53 — stack group hover popover
   ========================================================================== */
.tg-cell-popover-anchor {
  z-index: 1200 !important;   /* hover 시 popover 와 함께 다른 카드 위 */
}
.tg-cell-stack-popover {
  position: absolute;
  top: -8px;
  left: calc(100% + 8px);
  width: 320px;
  max-width: 360px;
  max-height: 480px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 10px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
  z-index: 1300;
  font-family: var(--font-sans);
  font-weight: var(--weight-regular, 400);
  text-align: left;
  cursor: default;
  animation: tg-cell-stack-popover-in 140ms ease-out;
}
@keyframes tg-cell-stack-popover-in {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}
.tg-cell-stack-popover-hd {
  padding: 10px 14px;
  font-size: 11px;
  color: var(--fg-muted, #94A3B8);
  font-weight: var(--weight-semibold, 600);
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border, #E2E8F0);
}
.tg-cell-stack-popover-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}
.tg-cell-stack-popover-item {
  padding: 10px 14px;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, border-left-color 120ms ease;
}
.tg-cell-stack-popover-item:hover {
  background: #F8FAFC;
  border-left-color: var(--teal-500, #14B8A6);
}
.tg-cell-stack-popover-item.is-self {
  background: #F0FDFA;
  border-left-color: var(--teal-500, #14B8A6);
}
.tg-cell-stack-popover-item-hd {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.tg-cell-stack-popover-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  background: #F1F5F9;
  color: var(--fg-secondary, #64748B);
  font-size: 10px;
  font-weight: var(--weight-semibold, 600);
}
.tg-cell-stack-popover-name {
  flex: 1;
  font-size: 13px;
  font-weight: var(--weight-semibold, 600);
  color: var(--fg-primary, #0F172A);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tg-cell-stack-popover-time {
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  color: var(--fg-secondary, #64748B);
}
.tg-cell-stack-popover-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--fg-muted, #94A3B8);
  margin-bottom: 6px;
}
.tg-cell-stack-popover-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tg-cell-stack-popover-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid var(--border, #E2E8F0);
  background: #fff;
  font-size: 11px;
  color: var(--fg-primary, #0F172A);
}
.tg-cell-stack-popover-chip-more {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 10px;
  background: #F1F5F9;
  color: var(--fg-muted, #94A3B8);
  font-size: 11px;
}

/* ==========================================================================
   hotfix21.38 — Phase 6 §2.11 검색 / 하이라이트
   ========================================================================== */
/* dim: 매치 안 된 카드 — 30% 투명. transition 으로 부드럽게. */
.tg-grid[data-tg-search="true"] .tg-cell.tg-cell-search-dim {
  opacity: 0.3;
}
.tg-grid[data-tg-search="true"] .tg-cell.tg-cell-search-dim:hover:not(:disabled) {
  opacity: 0.5;
}
/* match: 100% 불투명, 살짝 box-shadow 강화로 부각. */
.tg-cell-search-match {
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.4), 0 2px 6px rgba(15, 23, 42, 0.08);
}
.tg-cell-search-match:hover:not(:disabled) {
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.55), var(--shadow-md);
}
/* 매치 안 된 카드의 chip 도 흐리게. 매치된 카드의 chip 는 search-match chip 만 강조. */
.tg-grid[data-tg-search="true"] .tg-cell-search-dim .tg-cell-stuchip {
  opacity: 0.8;
}
.tg-cell-stuchip-search-match {
  border-color: var(--teal-500, #14B8A6) !important;
  border-width: 2px !important;
  background: #CCFBF1 !important;
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.3);
}

/* ==========================================================================
   TimetableSearchBar inline (필터 toolbar 안 — 초기화 버튼 왼쪽)
   ========================================================================== */
.tg-search-inline {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 10px;
  height: 32px;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 8px;
  background: #fff;
  font-family: var(--font-sans);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.tg-search-inline.is-focused {
  border-color: var(--teal-500, #14B8A6);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.tg-search-inline.has-query {
  border-color: var(--teal-500, #14B8A6);
}
.tg-search-inline-ic {
  font-size: 12px;
  opacity: 0.55;
  flex-shrink: 0;
}
.tg-search-inline-input {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--fg-primary, #0F172A);
  width: 220px;
  height: 100%;
  padding: 0;
}
.tg-search-inline-input::placeholder { color: var(--fg-muted, #94A3B8); }
.tg-search-inline-clear {
  border: 0;
  background: transparent;
  font-size: 11px;
  color: var(--fg-muted, #94A3B8);
  cursor: pointer;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tg-search-inline-clear:hover {
  background: #F1F5F9;
  color: var(--fg-primary, #0F172A);
}
.tg-search-inline-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 280px;
  max-width: 360px;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  z-index: 100;
  padding: 4px 0;
  animation: tg-search-inline-in 140ms ease-out;
}
@keyframes tg-search-inline-in {
  from { transform: translateY(-4px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.tg-search-inline-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tg-search-inline-result {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
}
.tg-search-inline-result:hover { background: #F8FAFC; }
.tg-search-inline-result-kind {
  font-size: 11px;
  color: var(--fg-muted, #94A3B8);
  flex-shrink: 0;
  width: 26px;
}
.tg-search-inline-result-name {
  color: var(--fg-primary, #0F172A);
  font-weight: 500;
}
.tg-search-inline-result-sub {
  margin-left: auto;
  color: var(--fg-muted, #94A3B8);
  font-size: 12px;
}
.tg-search-inline-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--fg-muted, #94A3B8);
  text-align: center;
}

/* ==========================================================================
   NewClassModal — Phase 6 §2.12 빈 영역 신규 등록
   ========================================================================== */
.tg-newclass-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
}
.tg-newclass-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tg-newclass-label {
  flex-shrink: 0;
  width: 56px;
  font-size: 13px;
  color: var(--fg-secondary, #64748B);
}
.tg-newclass-value {
  font-size: 13px;
  color: var(--fg-primary, #0F172A);
  font-family: var(--font-mono, monospace);
}
.tg-newclass-input {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  outline: 0;
  font-family: var(--font-sans);
}
.tg-newclass-input:focus {
  border-color: var(--teal-500, #14B8A6);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.tg-newclass-time-pair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tg-newclass-time {
  width: 80px;
  flex: 0 0 auto;
  font-family: var(--font-mono, monospace);
  text-align: center;
}
.tg-newclass-time-sep {
  color: var(--fg-muted, #94A3B8);
}
.tg-newclass-error {
  padding: 8px 10px;
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  border-radius: 6px;
  color: #B91C1C;
  font-size: 12px;
}
.tg-newclass-hint {
  font-size: 12px;
  color: var(--fg-muted, #94A3B8);
}
/* hotfix21.43 — 신규 입력 시 중복 경고 */
.tg-newclass-input.is-warn {
  border-color: #F59E0B;
  background: #FFFBEB;
}
.tg-newclass-input.is-warn:focus {
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}
.tg-newclass-warn {
  padding: 8px 10px;
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  border-radius: 6px;
  color: #92400E;
  font-size: 12px;
}
.tg-newclass-warn-link {
  border: 0;
  background: transparent;
  color: #B45309;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
}
.tg-newclass-warn-link:hover { color: #78350F; }

/* hotfix21.44 — 신규 class 모드 학생 선택 영역 */
.tg-newclass-students {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px dashed var(--border, #E2E8F0);
  padding-top: 12px;
  margin-top: 4px;
}
.tg-newclass-students-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tg-newclass-students-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}
.tg-newclass-students-grade {
  flex: 0 0 auto;
  width: 100px;
  height: 28px;
}
.tg-newclass-students-only {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--fg-secondary, #64748B);
  cursor: pointer;
  user-select: none;
}
.tg-newclass-students-only input { cursor: pointer; }
.tg-newclass-students-count {
  font-size: 11px;
  color: var(--fg-muted, #94A3B8);
  margin-left: auto;
}
.tg-newclass-students-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding: 6px;
  background: #F8FAFC;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 6px;
}
.tg-newclass-students-empty {
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--fg-muted, #94A3B8);
  padding: 16px 0;
}
.tg-newclass-stuchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 14px;
  background: #fff;
  font-size: 12px;
  color: var(--fg-primary, #0F172A);
  cursor: pointer;
  user-select: none;
  transition: background 120ms ease, border-color 120ms ease;
}
.tg-newclass-stuchip input { display: none; }
.tg-newclass-stuchip:hover { background: #F1F5F9; }
.tg-newclass-stuchip.is-on {
  background: #CCFBF1;
  border-color: var(--teal-500, #14B8A6);
  color: #0F766E;
  font-weight: 600;
}
.tg-newclass-stuchip-grade {
  font-size: 10px;
  color: var(--fg-muted, #94A3B8);
  font-family: var(--font-mono, monospace);
}
.tg-newclass-stuchip.is-on .tg-newclass-stuchip-grade { color: #0F766E; }

/* hotfix21.56.1 — chip drop 시 preselect 출처 안내 + 시간 충돌 경고 chip */
.tg-newclass-preselect-hint {
  font-size: 12px;
  color: #0F766E;
  background: #F0FDFA;
  border: 1px solid #99F6E4;
  border-radius: 6px;
  padding: 6px 10px;
  margin: 0 0 8px 0;
}
.tg-newclass-stuchip.is-conflict {
  border-color: #FCA5A5;
  background: #FEF2F2;
}
.tg-newclass-stuchip.is-conflict.is-on {
  border-color: #EF4444;
  background: #FECACA;
  color: #991B1B;
}
.tg-newclass-stuchip-warn {
  margin-left: 4px;
  color: #DC2626;
  font-size: 11px;
}

/* ==========================================================================
   hotfix21.46 — 검색 우측 패널 (TimetableStudentPanel)
   ========================================================================== */
/* hotfix21.47: backdrop 제거. side panel inline 형태로. */
.tg-stupanel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-left: 1px solid var(--border, #E2E8F0);
  box-shadow: -16px 0 32px rgba(15, 23, 42, 0.12);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  animation: tg-stupanel-slide 220ms ease-out;
}
@keyframes tg-stupanel-slide {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.tg-stupanel-hd {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border, #E2E8F0);
}
.tg-stupanel-hd-l {
  flex: 1;
  min-width: 0;
}
.tg-stupanel-name {
  font-size: 18px;
  font-weight: var(--weight-semibold, 600);
  color: var(--fg-primary, #0F172A);
}
.tg-stupanel-meta {
  font-size: 12px;
  color: var(--fg-muted, #94A3B8);
  margin-top: 2px;
}
.tg-stupanel-close {
  border: 1px solid var(--border, #E2E8F0);
  background: #fff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--fg-secondary, #64748B);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tg-stupanel-close:hover { background: #F1F5F9; }
.tg-stupanel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 24px;
}
.tg-stupanel-sect-title {
  font-size: 12px;
  color: var(--fg-secondary, #64748B);
  font-weight: var(--weight-semibold, 600);
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
.tg-stupanel-empty {
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
  color: var(--fg-muted, #94A3B8);
}
.tg-stupanel-sessions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tg-stupanel-session {
  display: grid;
  grid-template-columns: 24px 84px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.tg-stupanel-session:hover {
  border-color: var(--teal-500, #14B8A6);
  background: #F0FDFA;
}
.tg-stupanel-session-day {
  font-family: var(--font-mono, monospace);
  font-weight: var(--weight-semibold, 600);
  color: var(--fg-primary, #0F172A);
  text-align: center;
}
.tg-stupanel-session-time {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: var(--fg-secondary, #64748B);
}
.tg-stupanel-session-name {
  color: var(--fg-primary, #0F172A);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tg-stupanel-session-teacher {
  display: none;
}
.tg-stupanel-session-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: var(--weight-semibold, 600);
  background: #F1F5F9;
  color: var(--fg-secondary, #64748B);
}
.tg-stupanel-session-status.tone-ok      { background: #CCFBF1; color: #0F766E; }
.tg-stupanel-session-status.tone-warn    { background: #FEF3C7; color: #92400E; }
.tg-stupanel-session-status.tone-danger  { background: #FEE2E2; color: #B91C1C; }
.tg-stupanel-session-status.tone-muted   { background: #F1F5F9; color: #64748B; }
.tg-stupanel-session.tone-danger { border-color: #FCA5A5; }
.tg-stupanel-session.tone-warn   { border-color: #FCD34D; }
.tg-stupanel-session.tone-ok     { border-color: #5EEAD4; }

@media (max-width: 600px) {
  .tg-stupanel { width: 100%; max-width: 100%; }
}

/* drop preview tone-empty (drag 그린 영역, ok tone 재사용) */
.tg-drop-preview { pointer-events: none; }

/* legend chip — 충돌 색용 (점 모양 흉내) */
.tg-legend-overlap {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.85);
}
.tg-legend-overlap-red    { background: #DC2626; }
.tg-legend-overlap-orange { background: #F59E0B; }
.tg-legend-overlap-purple { background: #A855F7; }
