/* ================================================
   우리아이 시간표 — 스타일시트 v2.1
   컨셉: 따뜻하고 부드러운 미니멀 육아앱 (토스/카카오뱅크 레퍼런스)
   ================================================ */

/* ── CSS 변수 ── */
:root {
  /* 메인 컬러 */
  --primary:        #5B6CFF;
  --primary-light:  #8B95FF;
  --primary-soft:   #EEF0FF;
  --primary-dark:   #3D4FE0;

  /* 배경 */
  --bg:             #F7F8FC;
  --bg-white:       #FFFFFF;
  --bg-muted:       #F0F1F8;

  /* 텍스트 */
  --text-h:         #1A1D2E;
  --text-body:      #3D4156;
  --text-sub:       #7C7F9A;
  --text-muted:     #B8BAD0;

  /* 테두리 */
  --border:         #ECEEF8;
  --border-soft:    #F3F4FB;

  /* 카테고리 (파스텔) */
  --cat-학교수업-bg:  #E5E7EB;
  --cat-학교수업-fg:  #4B5563;
  --cat-학교수업-bar: #9CA3AF;

  --cat-방과후-bg:    #FEF3C7;
  --cat-방과후-fg:    #92400E;
  --cat-방과후-bar:   #F59E0B;

  --cat-학원-bg:      #EDE9FE;
  --cat-학원-fg:      #5B21B6;
  --cat-학원-bar:     #7C3AED;

  --cat-예체능-bg:    #DBEAFE;
  --cat-예체능-fg:    #1E40AF;
  --cat-예체능-bar:   #3B82F6;

  --cat-기타-bg:      #DCFCE7;
  --cat-기타-fg:      #166534;
  --cat-기타-bar:     #22C55E;

  /* 레이아웃 */
  --header-h:   58px;
  --nav-h:      70px;
  --radius-xl:  20px;
  --radius-lg:  16px;
  --radius-md:  12px;
  --radius-sm:  8px;

  /* 그림자 */
  --shadow-sm:  0 1px 4px rgba(91,108,255,0.06), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(91,108,255,0.10), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:  0 8px 32px rgba(91,108,255,0.14), 0 2px 8px rgba(0,0,0,0.06);
}

/* ── 리셋 & 기본 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }


/* ════════════════════════════════════════════════
   헤더
════════════════════════════════════════════════ */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-logo { font-size: 1.3rem; }
.app-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-h);
  letter-spacing: -0.4px;
}

/* + 버튼 — 헤더 우측 */
.btn-add-fab {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(91,108,255,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-add-fab:active { transform: scale(0.92); box-shadow: 0 2px 6px rgba(91,108,255,0.25); }


/* ════════════════════════════════════════════════
   메인 영역
════════════════════════════════════════════════ */
.app-main {
  margin-top: var(--header-h);
  margin-bottom: var(--nav-h);
  min-height: calc(100vh - var(--header-h) - var(--nav-h));
  padding: 20px 16px;
}

/* 탭 전환 */
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeUp 0.22s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 섹션 타이틀 */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-h);
  letter-spacing: -0.3px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}


/* ════════════════════════════════════════════════
   하단 내비게이션
════════════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg-white);
  display: flex;
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 10px 0 8px;
  transition: color 0.18s;
  letter-spacing: 0;
}
.nav-btn i {
  font-size: 1.2rem;
  transition: transform 0.18s;
}
.nav-btn.active {
  color: var(--primary);
}
.nav-btn.active i { transform: scale(1.1); }
.nav-btn:active { opacity: 0.65; }


/* ════════════════════════════════════════════════
   공통 카드
════════════════════════════════════════════════ */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.card-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 14px;
}

/* 빈 상태 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 24px 40px;
  text-align: center;
}
.empty-icon { font-size: 3rem; margin-bottom: 14px; line-height: 1; }
.empty-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-h);
  margin-bottom: 6px;
}
.empty-sub {
  font-size: 0.875rem;
  color: var(--text-sub);
  margin-bottom: 24px;
  line-height: 1.6;
}
.empty-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 12px;
}

.hidden { display: none !important; }


/* ════════════════════════════════════════════════
   버튼
════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  padding: 13px 28px;
  border-radius: 14px;
  font-size: 0.93rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 4px 14px rgba(91,108,255,0.3);
}
.btn-primary:active { transform: scale(0.96); box-shadow: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-muted);
  color: var(--text-body);
  padding: 13px 20px;
  border-radius: 14px;
  font-size: 0.93rem;
  font-weight: 600;
}
.btn-secondary:active { opacity: 0.7; }

.btn-warning {
  background: #FFF3CD;
  color: #92400E;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
}
.btn-danger {
  background: #FEE2E2;
  color: #B91C1C;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
}
.btn-danger-outline {
  background: transparent;
  color: #EF4444;
  border: 1.5px solid #FCA5A5;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 10px;
}
.btn-danger-outline:active { background: #FEF2F2; }

.btn-icon-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
}
.btn-icon-text i { font-size: 0.75rem; }

/* 샘플 버튼 */
.btn-sample {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  color: #92400E;
  padding: 13px 24px;
  border-radius: 14px;
  font-size: 0.93rem;
  font-weight: 700;
  border: 1.5px solid #FCD34D;
  box-shadow: 0 3px 10px rgba(245,158,11,0.18);
  transition: transform 0.12s;
  margin-top: 8px;
}
.btn-sample:active { transform: scale(0.96); }


/* ════════════════════════════════════════════════
   카테고리 배지
════════════════════════════════════════════════ */
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.cat-badge.학교수업 { background: var(--cat-학교수업-bg); color: var(--cat-학교수업-fg); }
.cat-badge.방과후   { background: var(--cat-방과후-bg);   color: var(--cat-방과후-fg); }
.cat-badge.학원     { background: var(--cat-학원-bg);     color: var(--cat-학원-fg); }
.cat-badge.예체능   { background: var(--cat-예체능-bg);   color: var(--cat-예체능-fg); }
.cat-badge.기타     { background: var(--cat-기타-bg);     color: var(--cat-기타-fg); }


/* ════════════════════════════════════════════════
   홈 탭
════════════════════════════════════════════════ */

/* 상단 배너 카드 */
.home-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-xl);
  padding: 22px 22px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.home-banner::after {
  content: '';
  position: absolute;
  top: -30px; right: -20px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}
.banner-left { flex: 1; }
.banner-greeting {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.banner-date {
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 3px;
}
.banner-sub {
  font-size: 0.78rem;
  opacity: 0.72;
}
.banner-icon {
  font-size: 2.6rem;
  opacity: 0.9;
  margin-left: 12px;
}

/* 오늘 일정 영역 레이블 */
.home-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-sub);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding-left: 2px;
}

/* 자녀별 오늘 일정 카드 */
.today-schedule-list { display: flex; flex-direction: column; gap: 10px; }

.child-today-block {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.child-today-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}
.child-color-pill {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.child-today-name {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text-h);
}
.child-today-meta {
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-left: auto;
}

/* 오늘 일정 아이템 — v2.2에서 재정의됨 (아래 v2.2 섹션 참조) */

.today-item-time-block {
  background: var(--bg);
  border-radius: 10px;
  padding: 6px 10px;
  text-align: center;
  min-width: 60px;
  flex-shrink: 0;
}
.today-time-start {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-h);
  line-height: 1.2;
}
.today-time-end {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.today-item-info { flex: 1; min-width: 0; }
.today-item-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-h);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-item-memo {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.today-item-arrow {
  color: var(--text-muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.no-schedule-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 8px 4px 2px;
  text-align: center;
}


/* ════════════════════════════════════════════════
   시간표 탭
════════════════════════════════════════════════ */
/* 자녀 탭 선택 */
.child-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.child-tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--bg-white);
  color: var(--text-sub);
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: all 0.18s;
}
.child-tab-btn .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
}
.child-tab-btn.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-light);
}

/* 주간 시간표 */
.weekly-timetable {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.timetable-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.timetable-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 320px;
}

/* 헤더 행 */
.timetable-table thead tr {
  background: var(--primary-soft);
}
.timetable-table th {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 11px 4px;
  text-align: center;
  border-right: 1px solid var(--border);
  letter-spacing: 0.2px;
}
.timetable-table th:first-child { background: var(--bg-muted); color: var(--text-sub); }
.timetable-table .time-col { width: 48px; min-width: 48px; }

/* 셀 */
.timetable-table td {
  border: 1px solid var(--border-soft);
  vertical-align: top;
  padding: 3px;
  font-size: 0.75rem;
  background: var(--bg-white);
}

/* 시간 셀 */
.time-cell {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
  padding: 5px 2px;
  background: var(--bg);
  font-weight: 600;
  white-space: nowrap;
}

/* 일정 블록 */
.schedule-block {
  border-radius: 9px;
  padding: 5px 7px;
  margin: 2px;
  cursor: pointer;
  transition: opacity 0.12s, transform 0.12s;
  position: relative;
  overflow: hidden;
}
.schedule-block::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}
.schedule-block:active { opacity: 0.72; transform: scale(0.97); }

.schedule-block.학교수업 { background: var(--cat-학교수업-bg); }
.schedule-block.학교수업::before { background: var(--cat-학교수업-bar); }
.schedule-block.방과후   { background: var(--cat-방과후-bg); }
.schedule-block.방과후::before   { background: var(--cat-방과후-bar); }
.schedule-block.학원     { background: var(--cat-학원-bg); }
.schedule-block.학원::before     { background: var(--cat-학원-bar); }
.schedule-block.예체능   { background: var(--cat-예체능-bg); }
.schedule-block.예체능::before   { background: var(--cat-예체능-bar); }
.schedule-block.기타     { background: var(--cat-기타-bg); }
.schedule-block.기타::before     { background: var(--cat-기타-bar); }

.block-name {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  word-break: keep-all;
  padding-left: 5px;
  color: var(--text-h);
}
.block-time {
  font-size: 0.63rem;
  color: var(--text-sub);
  padding-left: 5px;
  margin-top: 2px;
  opacity: 0.85;
}


/* ════════════════════════════════════════════════
   통합보기 탭
════════════════════════════════════════════════ */
/* 요일 선택 */
.day-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 5px;
  box-shadow: var(--shadow-sm);
}
.day-btn {
  flex: 1;
  padding: 9px 4px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 700;
  background: transparent;
  color: var(--text-sub);
  transition: all 0.18s;
}
.day-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(91,108,255,0.3);
}

/* 통합 테이블 */
.overview-table-wrap {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.overview-table {
  width: 100%;
  border-collapse: collapse;
}
.overview-table th {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 13px 10px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.overview-table th.time-header {
  width: 58px; min-width: 58px;
  background: var(--bg-muted);
  color: var(--text-sub);
  font-size: 0.75rem;
}
.overview-table td {
  border: 1px solid var(--border-soft);
  padding: 8px 7px;
  vertical-align: top;
  min-width: 80px;
}
.overview-table td.time-td {
  background: var(--bg);
  text-align: center;
  padding: 10px 5px;
}
.time-td-main {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-h);
}
.time-td-end {
  font-size: 0.66rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 통합보기 일정 블록 */
.overview-block {
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 5px;
  cursor: pointer;
  transition: opacity 0.12s;
  position: relative;
  overflow: hidden;
}
.overview-block::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.overview-block:last-child { margin-bottom: 0; }
.overview-block:active { opacity: 0.72; }

.overview-block.학교수업 { background: var(--cat-학교수업-bg); }
.overview-block.학교수업::before { background: var(--cat-학교수업-bar); }
.overview-block.방과후   { background: var(--cat-방과후-bg); }
.overview-block.방과후::before   { background: var(--cat-방과후-bar); }
.overview-block.학원     { background: var(--cat-학원-bg); }
.overview-block.학원::before     { background: var(--cat-학원-bar); }
.overview-block.예체능   { background: var(--cat-예체능-bg); }
.overview-block.예체능::before   { background: var(--cat-예체능-bar); }
.overview-block.기타     { background: var(--cat-기타-bg); }
.overview-block.기타::before     { background: var(--cat-기타-bar); }

.ov-block-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-h);
  padding-left: 6px;
}
.ov-block-time {
  font-size: 0.72rem;
  color: var(--text-sub);
  padding-left: 6px;
  margin-top: 2px;
}

/* 겹침 행 */
.conflict-row > td:not(.time-td) { background: #FFFBEB !important; }
.conflict-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  margin-bottom: 5px;
}

/* 통합보기 범례 */
.overview-legend {
  padding: 10px 14px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 빈 통합보기 */
.overview-empty-day {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.overview-empty-day .e-icon { font-size: 2rem; margin-bottom: 10px; }
.overview-empty-day p { font-size: 0.88rem; }


/* ════════════════════════════════════════════════
   ⏱️ 시간 비례 캘린더 레이아웃 v2.3
   (시간표 & 통합보기 공통)
════════════════════════════════════════════════ */

/* ── 외부 래퍼 (주간 시간표용) ── */
.cal-wrap {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* ── 스크롤 영역 ── */
.cal-scroll-area {
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(100vh - 200px);
  min-height: 320px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  /* 스크롤바 스타일 */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.cal-scroll-area::-webkit-scrollbar { width: 5px; }
.cal-scroll-area::-webkit-scrollbar-track { background: transparent; }
.cal-scroll-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── 헤더 행 (요일명 / 자녀명) ── */
.cal-header-row {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-white);
  border-bottom: 1.5px solid var(--border);
  box-shadow: 0 2px 6px rgba(91,108,255,0.06);
}

.cal-time-gutter {
  flex-shrink: 0;
  width: 50px;
  min-width: 50px;
  background: var(--bg);
  border-right: 1px solid var(--border);
}

/* 요일 헤더 */
.cal-col-header {
  flex: 1;
  min-width: 56px;
  padding: 10px 4px 9px;
  text-align: center;
  font-size: 0.83rem;
  font-weight: 700;
  color: #A5A8C2;           /* 비선택: 연한 회색 */
  border-left: 1px solid var(--border-soft);
  letter-spacing: 0.4px;
  transition: color 0.15s, background 0.15s;
}
.cal-col-header.today {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 800;
}

/* 통합보기 자녀 컬럼 헤더 */
.ov-col-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-h);
}

/* ── 바디 (이벤트 절대 배치 기준) ── */
.cal-body {
  display: flex;
  position: relative;
  width: 100%;
}

/* ── 시간축 ── */
.cal-time-axis {
  position: relative;
  flex-shrink: 0;
  width: 50px;
  min-width: 50px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  pointer-events: none;
  z-index: 2;
}

.cal-time-label {
  position: absolute;
  right: 7px;
  transform: translateY(-50%);
  white-space: nowrap;
  user-select: none;
}
/* 정시 라벨: 진하게 선명하게 */
.cal-time-label.hour {
  font-size: 0.73rem;        /* ≈ 11.7px */
  font-weight: 700;
  color: #6B7280;            /* 중간 회색 — 충분히 읽힘 */
  letter-spacing: -0.3px;
}
/* 30분 라벨: 숨김 (격자선만 표시) */
.cal-time-label.half {
  display: none;
}

/* ── 요일/자녀 컬럼 ── */
.cal-day-col {
  position: relative;
  flex: 1;
  min-width: 56px;
  border-left: 1px solid var(--border-soft);
  background: #FFFFFF;
}
/* 오늘 컬럼 — 아주 연한 파란 배경 */
.cal-day-col.today {
  background: #F8F9FF;
}

/* ── 격자선 ── */
.cal-grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.cal-grid-line {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
}
/* 정시선: 뚜렷하게 */
.cal-grid-line.hour {
  background: #E2E4F0;
  z-index: 1;
}
/* 30분선: 매우 연하게 */
.cal-grid-line.half {
  background: #F0F1F8;
  z-index: 0;
}

/* ── 이벤트 블록 ── */
.cal-event {
  position: absolute;
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 6px rgba(0,0,0,0.04);
  /* hover/active 트랜지션 */
  transition: box-shadow 0.15s ease, transform 0.12s ease;
  /* 내부 패딩은 inner에서 처리 */
}

/* hover — 살짝 올라오는 느낌 */
.cal-event:hover {
  box-shadow: 0 4px 12px rgba(91,108,255,0.18), 0 2px 6px rgba(0,0,0,0.08);
  transform: translateY(-1px) scale(1.01);
  z-index: 8;
}
/* active (터치/클릭) */
.cal-event:active {
  transform: scale(0.97);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* ── 카테고리별 배경 + 왼쪽 4px 컬러라인 ── */
.cal-event.학교수업 {
  background: var(--cat-학교수업-bg);
  border-left: 4px solid var(--cat-학교수업-bar);
}
.cal-event.방과후 {
  background: var(--cat-방과후-bg);
  border-left: 4px solid var(--cat-방과후-bar);
}
.cal-event.학원 {
  background: var(--cat-학원-bg);
  border-left: 4px solid var(--cat-학원-bar);
}
.cal-event.예체능 {
  background: var(--cat-예체능-bg);
  border-left: 4px solid var(--cat-예체능-bar);
}
.cal-event.기타 {
  background: var(--cat-기타-bg);
  border-left: 4px solid var(--cat-기타-bar);
}

/* ── 겹침(동시) 일정 — border 강조 ── */
.cal-event.conflict {
  outline: 1.5px solid rgba(245,158,11,0.55);
  outline-offset: -1px;
}

/* ── 이벤트 내부 레이아웃 ── */
.cal-event-inner {
  padding: 4px 5px 3px 5px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  height: 100%;
  overflow: hidden;
}

/* 이름: 줄바꿈 허용, 최대 2줄 */
.cal-event-name {
  font-size: 0.71rem;
  font-weight: 700;
  color: var(--text-h);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
}

/* 시간 텍스트 */
.cal-event-time {
  font-size: 0.63rem;
  font-weight: 500;
  color: #6B7280;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 준비물 수 */
.cal-event-bag {
  font-size: 0.60rem;
  color: var(--text-muted);
  line-height: 1;
}

/* ── ⚡ 겹침 아이콘 (이름 앞) ── */
.cal-conflict-dot {
  font-size: 0.62rem;
  margin-right: 2px;
  opacity: 0.8;
}

/* ── 캘린더 빈 상태 메시지 ── */
.cal-empty-msg {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

/* ── 통합보기 자녀 컬럼 ── */
.ov-child-col { }

/* ════════════════════════════════════════════════
   설정 탭
════════════════════════════════════════════════ */
.settings-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.settings-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.settings-card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-h);
}

/* 자녀 목록 */
.children-list, .schedule-list { display: flex; flex-direction: column; gap: 9px; }

.child-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.child-item-color {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.child-item-info { flex: 1; }
.child-item-name { font-size: 0.92rem; font-weight: 700; color: var(--text-h); }
.child-item-meta { font-size: 0.78rem; color: var(--text-sub); margin-top: 2px; }

.child-item-actions { display: flex; gap: 6px; }
.btn-sm-edit, .btn-sm-delete {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
}
.btn-sm-edit   { background: var(--primary-soft); color: var(--primary); }
.btn-sm-delete { background: #FEE2E2; color: #B91C1C; }

/* 일정 목록 */
.schedule-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.schedule-item-cat-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.schedule-item-info { flex: 1; }
.schedule-item-name { font-size: 0.9rem; font-weight: 700; color: var(--text-h); }
.schedule-item-meta { font-size: 0.78rem; color: var(--text-sub); margin-top: 2px; }
.schedule-item-days { font-size: 0.74rem; color: var(--text-muted); margin-top: 3px; }

.schedule-item-actions { display: flex; gap: 6px; }

/* 앱 정보 */
.app-info { text-align: center; }
.app-info p { font-size: 0.88rem; color: var(--text-sub); font-weight: 600; }
.info-sub { font-size: 0.78rem !important; color: var(--text-muted) !important; margin-top: 4px; font-weight: 400 !important; }


/* ════════════════════════════════════════════════
   모달 (바텀 시트)
════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,17,35,0.45);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: overlayIn 0.2s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg-white);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  animation: sheetUp 0.28s cubic-bezier(0.34,1.1,0.64,1);
}
/* 모달 핸들바 */
.modal::before {
  content: '';
  display: block;
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto 0;
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px;
  position: sticky;
  top: 0;
  background: var(--bg-white);
  z-index: 1;
  border-bottom: 1px solid var(--border-soft);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; color: var(--text-h); }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
}
.modal-body { padding: 18px 20px; }
.modal-footer {
  padding: 12px 20px 28px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  border-top: 1px solid var(--border-soft);
}

/* ── 액션 시트 (+ 버튼용) ── */
.action-sheet .modal {
  border-radius: 20px 20px 0 0;
}
.action-sheet-list {
  padding: 8px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.action-sheet-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  background: var(--bg);
  text-align: left;
  transition: background 0.15s;
}
.action-sheet-btn:active { background: var(--border); }
.action-sheet-icon {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.action-sheet-text strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-h);
}
.action-sheet-text span {
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-top: 1px;
  display: block;
}
.action-sheet-cancel {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 20px;
  padding: 15px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--text-sub);
  text-align: center;
}

/* ── 폼 ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 7px;
  letter-spacing: 0.1px;
}
.required { color: var(--primary); }

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="time"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.93rem;
  background: var(--bg);
  color: var(--text-h);
  outline: none;
  transition: border-color 0.18s, background 0.18s;
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-light);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(91,108,255,0.08);
}
.form-group textarea { resize: none; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* 색상 선택 */
.color-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.color-option {
  width: 34px; height: 34px;
  border-radius: 10px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.color-option.active {
  border-color: var(--primary);
  transform: scale(1.18);
  box-shadow: 0 3px 10px rgba(91,108,255,0.3);
}

/* 카테고리 선택 */
.category-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cat-btn {
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-sub);
  transition: all 0.15s;
}
.cat-btn.active {
  border-color: var(--primary-light);
  background: var(--primary-soft);
  color: var(--primary);
}

/* 요일 체크박스 */
.day-checkbox-group { display: flex; gap: 7px; }
.day-check { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.day-check input[type="checkbox"] { display: none; }
.day-check span {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-sub);
  transition: all 0.15s;
}
.day-check input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 3px 8px rgba(91,108,255,0.3);
}

/* 일정 상세 */
#scheduleDetailBody { display: flex; flex-direction: column; gap: 13px; }
.detail-row { display: flex; gap: 12px; align-items: flex-start; }
.detail-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 56px;
  padding-top: 1px;
}
.detail-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-h);
  flex: 1;
  line-height: 1.5;
}


/* ════════════════════════════════════════════════
   토스트
════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-h);
  color: #fff;
  padding: 11px 22px;
  border-radius: 24px;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 300;
  white-space: nowrap;
  animation: toastIn 0.22s cubic-bezier(0.34,1.2,0.64,1);
  box-shadow: 0 6px 20px rgba(0,0,0,0.22);
  letter-spacing: -0.2px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}


/* ════════════════════════════════════════════════
   반응형
════════════════════════════════════════════════ */
@media (max-width: 360px) {
  .app-main { padding: 16px 12px; }
  .day-checkbox-group { gap: 5px; }
  .day-check span { width: 34px; height: 34px; font-size: 0.78rem; }
  .cat-btn { padding: 7px 9px; font-size: 0.75rem; }
  .home-banner { padding: 18px 16px; }
  .banner-icon { font-size: 2rem; }
}
@media (min-width: 520px) {
  .modal { border-radius: 20px; margin-bottom: 20px; }
  .modal::before { display: none; }
}

/* 스크롤바 */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ════════════════════════════════════════════════
   추가 세부 polish
════════════════════════════════════════════════ */

/* 홈 - 빈 상태 버튼 간격 */
#homeEmptyState .btn-primary { margin-bottom: 0; }
#homeEmptyState .btn-sample  { margin-top: 10px; }

/* 홈 - 일정 카드 hover 효과 */
.today-item:active { background: var(--bg); border-radius: 10px; }

/* 통합보기 테이블 가로 스크롤 */
#overviewTable > div { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.overview-table { min-width: 280px; }

/* 설정 샘플 카드 강조 */
#sampleDataCard {
  border: 1.5px dashed #FCD34D;
  background: linear-gradient(135deg, #FFFDF0, #FFF);
}

/* 시간표 테이블 — 요일 헤더 오늘 하이라이트 */
.timetable-table th.today-col {
  background: var(--primary);
  color: #fff;
}

/* 카드 빈 상태 패딩 줄이기 */
.settings-card .empty-state { padding: 24px 16px; }

/* 일정 없음 힌트 카드 */
.no-sched-card {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* FAB 회전 애니메이션 */
.btn-add-fab.open { transform: rotate(45deg); }

/* 모달 footer 버튼 정렬 */
.modal-footer .btn-secondary { margin-right: auto; }

/* overview table td min-height */
.overview-table td { min-height: 52px; }

/* 홈 섹션 라벨 카드 내 */
.home-section-label {
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

/* 액션시트 cancel 버튼 hover */
.action-sheet-cancel:active { background: var(--border); }


/* ════════════════════════════════════════════════
   v2.1 추가 스타일 — 준비물 & 알림
════════════════════════════════════════════════ */

/* ── 하단 탭 5개: 폰트 더 작게 ── */
.nav-btn span { font-size: 0.63rem; }

/* ── 자녀 필터 칩 (준비물 탭) ── */
.child-filter {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 24px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 2px solid var(--border);
  background: var(--bg-white);
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.filter-chip .chip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.filter-chip.active {
  background: var(--primary-soft);
  border-color: var(--primary-light);
  color: var(--primary);
}
.filter-chip.all.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── 준비물 카드 ── */
.bag-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
.bag-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}
.bag-child-pill {
  width: 26px; height: 26px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.bag-card-child-name {
  font-size: 0.9rem; font-weight: 700; color: var(--text-h);
}
.bag-card-meta {
  font-size: 0.75rem; color: var(--text-sub); margin-left: auto;
}

/* 준비물 아이템 행 */
.bag-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: opacity 0.15s;
}
.bag-item:last-child { border-bottom: none; padding-bottom: 0; }
.bag-item:first-child { padding-top: 0; }
.bag-item.checked { opacity: 0.42; }

/* 체크박스 커스텀 */
.bag-checkbox {
  width: 22px; height: 22px;
  border-radius: 7px;
  border: 2px solid var(--border);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  cursor: pointer;
}
.bag-checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
}
.bag-checkbox.checked::after {
  content: '';
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: block;
}

.bag-item-info { flex: 1; min-width: 0; }
.bag-item-name {
  font-size: 0.9rem; font-weight: 700; color: var(--text-h);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bag-item-name.checked { text-decoration: line-through; color: var(--text-muted); }
.bag-item-schedule {
  font-size: 0.73rem; color: var(--text-sub); margin-top: 2px;
}
.bag-item-memo {
  font-size: 0.73rem; color: var(--text-muted); margin-top: 1px;
}

/* 알림 배지 */
.bag-alert-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  background: #FEF9C3;
  color: #92400E;
  border: 1px solid #FDE68A;
  white-space: nowrap;
  flex-shrink: 0;
}

.bag-item-actions {
  display: flex; gap: 5px; flex-shrink: 0;
}

/* 이번 주 요일 헤더 */
.week-day-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 8px;
}
.week-day-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.week-day-badge.today {
  background: #FF6B8A;
}
.week-day-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── 홈 — 오늘 준비물 ── */
.home-bag-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
.home-bag-child-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.home-bag-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-soft);
}
.home-bag-item:last-child { border-bottom: none; padding-bottom: 0; }

/* ── 홈 — 다가오는 알림 ── */
.alert-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.alert-item:last-child { border-bottom: none; padding-bottom: 0; }
.alert-item:first-child { padding-top: 0; }
.alert-item.past { opacity: 0.38; }

.alert-time-chip {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 58px;
  text-align: center;
}
.alert-time-chip.bag-type {
  background: #FEF9C3;
  color: #92400E;
}
.alert-time-chip.past {
  background: var(--bg-muted);
  color: var(--text-muted);
}

.alert-item-info { flex: 1; }
.alert-item-text {
  font-size: 0.88rem; font-weight: 600; color: var(--text-h);
  line-height: 1.4;
}
.alert-item-sub {
  font-size: 0.75rem; color: var(--text-sub); margin-top: 2px;
}
.alert-item-icon { font-size: 1rem; margin-top: 1px; flex-shrink: 0; }

/* ── 알림 설정 (설정 탭) ── */
.alert-settings-body { display: flex; flex-direction: column; gap: 0; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-soft);
}
.setting-row:last-child { border-bottom: none; }
.setting-row-info { flex: 1; }
.setting-row-title { font-size: 0.9rem; font-weight: 700; color: var(--text-h); }
.setting-row-sub   { font-size: 0.76rem; color: var(--text-sub); margin-top: 2px; }

.setting-select {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-h);
  background: var(--bg);
  outline: none;
  -webkit-appearance: none;
  min-width: 110px;
  text-align: right;
  cursor: pointer;
}
.setting-select.sm { min-width: 90px; font-size: 0.78rem; padding: 6px 8px; }
.setting-select:focus { border-color: var(--primary-light); background: var(--bg-white); }

.setting-divider {
  height: 1px; background: var(--border);
  margin: 6px 0;
}

/* ── 토글 스위치 ── */
.toggle-switch {
  position: relative;
  display: inline-flex;
  width: 46px; height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch.sm { width: 38px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.2s;
}
.toggle-track::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  transition: transform 0.2s;
}
.toggle-switch.sm .toggle-track::after { width: 16px; height: 16px; }

.toggle-switch input:checked + .toggle-track { background: var(--primary); }
.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(20px);
}
.toggle-switch.sm input:checked + .toggle-track::after {
  transform: translateX(16px);
}

/* ── 인라인 알림 행 ── */
.inline-alert-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.inline-alert-hint {
  font-size: 0.78rem;
  color: var(--text-sub);
}

/* 준비물 빈 상태 (주간 섹션) */
.bag-empty-week {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
}

/* ════════════════════════════════════════════════
   통합보기 — 동시 알림 행 & 인라인 상세 팝업
════════════════════════════════════════════════ */

/* 동시 알림 행 (테이블 위에 한 번만) */
.conflict-notice-row td {
  padding: 0;
  border: none;
}
.conflict-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, #FEF9C3, #FFFBEB);
  border-left: 3px solid #F59E0B;
  border-radius: 0;
  padding: 8px 14px;
  margin: 4px 0 0;
}
.conflict-notice-icon { font-size: 0.95rem; flex-shrink: 0; }
.conflict-notice-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: #92400E;
  line-height: 1.4;
}

/* 충돌 행 배경 (일정 셀만 강조) */
.conflict-row > td:not(.time-td) {
  background: #FFFBEB !important;
}

/* ── 통합보기 인라인 상세 팝업 ── */
.ov-detail-popup {
  position: fixed;
  inset: 0;
  background: rgba(15,17,35,0.4);
  z-index: 250;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.ov-detail-popup.visible { opacity: 1; }

.ov-detail-card {
  background: var(--bg-white);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.34, 1.1, 0.64, 1);
}
.ov-detail-popup.visible .ov-detail-card {
  transform: translateY(0);
}

/* 핸들바 */
.ov-detail-card::before {
  content: '';
  display: block;
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto 0;
}

.ov-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.ov-detail-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-h);
  line-height: 1.2;
}
.ov-detail-child {
  font-size: 0.76rem;
  color: var(--text-sub);
  margin-top: 2px;
}
.ov-detail-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--text-sub);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.ov-detail-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ov-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.ov-detail-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 54px;
  padding-top: 2px;
}
.ov-detail-val {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-h);
  flex: 1;
  line-height: 1.5;
}

/* 준비물 섹션 */
.ov-detail-bags {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 2px;
}
.ov-detail-bag-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 8px;
}
.ov-detail-bag-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ov-detail-bag-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-h);
}
.ov-detail-bag-item.checked {
  text-decoration: line-through;
  color: var(--text-muted);
}
.ov-detail-bag-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ov-detail-bag-memo {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.ov-detail-footer {
  display: flex;
  gap: 8px;
  padding: 12px 18px 24px;
  border-top: 1px solid var(--border-soft);
}


/* ════════════════════════════════════════════════
   v2.2 추가 스타일 — 홈 카드 / 다가오는 일정 / 준비물 탭 바
════════════════════════════════════════════════ */

/* ── 홈 카드 (섹션별 카드 구조) ── */
.home-card {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 18px 16px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
}

.home-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-h);
  margin-bottom: 14px;
  letter-spacing: -0.2px;
}

.home-card-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.home-card-date {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-sub);
  background: var(--bg);
  padding: 3px 9px;
  border-radius: 20px;
}

.home-card-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg);
  border-radius: var(--radius-md);
}

/* ── 오늘 일정 카드 내 — 카테고리 색상 바 ── */
.today-cat-bar {
  width: 4px;
  border-radius: 4px;
  align-self: stretch;
  flex-shrink: 0;
  min-height: 36px;
}

/* 오늘 일정 아이템에 색상 바 포함 */
.today-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}
.today-item:last-child { border-bottom: none; padding-bottom: 0; }
.today-item:first-child { padding-top: 0; }

/* ── 다가오는 일정 카드 아이템 ── */
.upcoming-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background 0.12s;
}
.upcoming-item:last-child { border-bottom: none; padding-bottom: 0; }
.upcoming-item:first-child { padding-top: 0; }
.upcoming-item:active { background: var(--bg); border-radius: 10px; }

.upcoming-date-badge {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 44px;
  text-align: center;
}

.upcoming-cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.upcoming-item-info { flex: 1; min-width: 0; }
.upcoming-item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-h);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.upcoming-item-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-sub);
}

/* child-color-pill 소형 */
.child-color-pill.sm {
  width: 18px;
  height: 18px;
  font-size: 0.65rem;
  border-radius: 6px;
}

/* ── 준비물 탭 탭바 ── */
.bag-tab-bar {
  display: flex;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: 14px;
  gap: 2px;
}

.bag-tab-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-sub);
  background: transparent;
  transition: all 0.18s;
  text-align: center;
}

.bag-tab-btn.active {
  background: var(--bg-white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ── 준비물 패널 빈 상태 ── */
.bag-panel-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 24px 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-top: 4px;
}

