:root {
  --child1: #3b82f6;       /* 세련된 블루 */
  --child2: #ec4899;       /* 세련된 핑크 */
  --child1-light: rgba(59, 130, 246, 0.08);
  --child2-light: rgba(236, 72, 153, 0.08);
  --bg: #f3f4f6;           /* 연한 그레이 배경 */
  --card: rgba(255, 255, 255, 0.75); /* 유리 효과용 반투명 배경 */
  --card-solid: #ffffff;
  --border: rgba(229, 231, 235, 0.7);
  --text: #1f2937;
  --muted: #6b7280;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-border: rgba(255, 255, 255, 0.6);
}

body.dark {
  --bg: #0f172a;           /* 슬레이트 딥 블루 */
  --card: rgba(30, 41, 59, 0.75);
  --card-solid: #1e293b;
  --border: rgba(51, 65, 85, 0.5);
  --text: #f8fafc;
  --muted: #94a3b8;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.25), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
  --glass-bg: rgba(15, 23, 42, 0.4);
  --glass-border: rgba(255, 255, 255, 0.08);
  --child1-light: rgba(59, 130, 246, 0.15);
  --child2-light: rgba(236, 72, 153, 0.15);
}

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body {
  font-family: 'Plus Jakarta Sans', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, var(--child1-light) 0px, transparent 50%),
    radial-gradient(at 100% 0%, var(--child2-light) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  padding: 24px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── 헤더 영역 ── */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  animation: drive 3s ease-in-out infinite;
}

@keyframes drive {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

.header-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--child1) 0%, var(--child2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.header-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.header-tag {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

.header-sep {
  color: var(--border);
  font-size: 12px;
}

.header-child {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}

.child1-color {
  color: var(--child1);
  background: var(--child1-light);
}

.child2-color {
  color: var(--child2);
  background: var(--child2-light);
}

.header-desc {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

/* ── 테마 토글 버튼 ── */
.theme-toggle {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  outline: none;
}
.theme-toggle:hover {
  transform: scale(1.08) rotate(12deg);
  box-shadow: var(--shadow-lg);
  background: var(--card-solid);
}
.theme-toggle:active {
  transform: scale(0.95);
}
.theme-toggle .moon-icon { display: none; }
body.dark .theme-toggle .sun-icon { display: none; }
body.dark .theme-toggle .moon-icon { display: block; }
.sun-icon, .moon-icon { font-size: 18px; }

/* ── 배너 디자인 (충돌 및 경고) ── */
#conflict-banner, #gap-warnings {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  animation: slideDown 0.25s ease-out;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#conflict-banner { 
  background: rgba(254, 242, 242, 0.85); 
  border: 1.5px solid rgba(239, 68, 68, 0.4); 
}
body.dark #conflict-banner {
  background: rgba(127, 29, 29, 0.25);
  border-color: rgba(239, 68, 68, 0.4);
}
#conflict-banner h2 { font-size: 15px; color: #dc2626; margin-bottom: 8px; font-weight: 700; }
body.dark #conflict-banner h2 { color: #f87171; }
#conflict-banner ul { padding-left: 4px; list-style: none; }
#conflict-banner li { font-size: 12.5px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text); }
#conflict-banner li:last-child { margin-bottom: 0; }

#gap-warnings { 
  background: rgba(255, 251, 235, 0.85); 
  border: 1.5px solid rgba(245, 158, 11, 0.4); 
}
body.dark #gap-warnings {
  background: rgba(120, 53, 4, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
}
#gap-warnings h2 { font-size: 15px; color: #d97706; margin-bottom: 8px; font-weight: 700; }
body.dark #gap-warnings h2 { color: #fbbf24; }
#gap-warnings ul { padding-left: 18px; }
#gap-warnings li { color: var(--text); font-size: 12.5px; margin-bottom: 5px; }
#gap-warnings li:last-child { margin-bottom: 0; }

.conflict-tag {
  display: inline-block; border-radius: 6px; padding: 2px 8px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.conflict-tag.parent { background: #ef4444; color: #fff; }
.conflict-tag.double { background: #8b5cf6; color: #fff; }

.hidden { display: none !important; }

/* ── 통계 및 복원 버튼 ── */
.stats-row { 
  display: flex; 
  gap: 16px; 
  align-items: center;
  flex-wrap: wrap; 
  margin-bottom: 20px; 
}
.stat-card {
  background: var(--card); 
  border: 1px solid var(--border);
  border-radius: var(--radius); 
  padding: 16px 20px; 
  min-width: 200px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.stat-card .label { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; }
.stat-card .value { font-size: 32px; font-weight: 800; color: #ef4444; line-height: 1.1; }
.stat-card .unit { font-size: 15px; font-weight: 500; color: var(--muted); }

.stats-actions {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  align-items: center;
}
.btn-reset {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-reset:hover {
  color: #ef4444;
  border-color: #fca5a5;
  background: rgba(239, 68, 68, 0.05);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.btn-reset:active {
  transform: translateY(0);
}

/* ── 요일 칩 ── */
.riding-days { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.day-chip {
  padding: 6px 14px; border-radius: 99px;
  font-size: 12.5px; font-weight: 600;
  background: var(--border); color: var(--muted);
  border: 1px solid transparent;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}
.day-chip:hover {
  background: var(--muted);
  color: var(--bg);
  transform: translateY(-1px);
}
.day-chip.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.day-chip.has-riding { 
  background: rgba(239, 68, 68, 0.08); 
  color: #ef4444; 
  border: 1px solid rgba(239, 68, 68, 0.25); 
}
.day-chip.has-riding.active {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}
body.dark .day-chip.has-riding {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}
body.dark .day-chip.has-riding.active {
  background: #f87171;
  color: #0f172a;
  border-color: #f87171;
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.4);
}

/* ── 범례 ── */
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.legend-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.child1 { background: var(--child1); box-shadow: 0 0 6px var(--child1); }
.dot.child2 { background: var(--child2); box-shadow: 0 0 6px var(--child2); }

/* ── 아이 필터 버튼 ── */
.child-filter {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.filter-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: var(--card-solid);
  color: var(--muted);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.filter-btn:hover { 
  border-color: var(--muted); 
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.filter-btn:active {
  transform: translateY(0);
}
.filter-btn.active:not(.child1):not(.child2) {
  background: var(--text); color: var(--bg); border-color: var(--text);
}
.filter-btn.child1.active {
  background: var(--child1-light); color: var(--child1);
  border-color: var(--child1);
}
.filter-btn.child2.active {
  background: var(--child2-light); color: var(--child2);
  border-color: var(--child2);
}
.btn-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.btn-dot.child1 { background: var(--child1); }
.btn-dot.child2 { background: var(--child2); }

/* ── 브리핑 패널 ── */
.briefing-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: slideDown 0.2s ease-out;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.briefing-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 10px;
}
.briefing-child-name {
  font-size: 17px; font-weight: 800; margin-right: 8px;
}
.briefing-child-name.child1 { color: var(--child1); }
.briefing-child-name.child2 { color: var(--child2); }
.briefing-school-time { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.briefing-count { font-size: 13px; color: var(--muted); font-weight: 600; }

.briefing-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.briefing-empty { font-size: 13.5px; color: var(--muted); text-align: center; padding: 20px 0; }

.briefing-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  border: 1px solid var(--border);
}
body.dark .briefing-row {
  background: rgba(255, 255, 255, 0.02);
}
.briefing-info {
  flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0;
}
.briefing-subject {
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--border); border-radius: 4px; padding: 2px 7px;
}
.briefing-name { font-size: 14px; font-weight: 700; color: var(--text); }
.briefing-schedule { font-size: 12.5px; color: var(--muted); width: 100%; margin-top: 4px; }

.badge.sm { font-size: 10px; padding: 2px 8px; }

/* 공통 수정/삭제 버튼 */
.briefing-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.edit-btn, .delete-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  transition: all 0.15s ease;
  border: 1px solid var(--border);
}
.edit-btn {
  background: var(--card-solid);
  color: var(--muted);
}
.edit-btn:hover {
  border-color: var(--child1);
  color: var(--child1);
  background: var(--child1-light);
}
.delete-btn {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  font-size: 16px;
}
.delete-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

/* 학원 추가 버튼 */
.btn-add-academy {
  width: 100%; padding: 12px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px; font-weight: 700;
  cursor: pointer; transition: all 0.15s ease;
}
.btn-add-academy:hover { 
  border-color: var(--muted); 
  color: var(--text); 
  background: rgba(0, 0, 0, 0.02); 
}
body.dark .btn-add-academy:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* 추가/수정 폼 */
.add-form {
  background: rgba(0, 0, 0, 0.01);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 12px;
  display: flex; flex-direction: column; gap: 12px;
  animation: slideDown 0.2s ease-out;
}
.add-form.edit-mode {
  border-left: 4px solid var(--child1);
  background: var(--child1-light);
}
.form-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.form-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.form-row label:first-child {
  min-width: 90px; font-size: 12.5px; font-weight: 700; color: var(--muted); flex-shrink: 0;
}
.form-row input[type="text"],
.form-row select {
  flex: 1; padding: 8px 12px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 13px; min-width: 140px;
  background: var(--card-solid); color: var(--text);
  outline: none;
}
.form-row input[type="text"]:focus,
.form-row select:focus { border-color: var(--muted); }

.day-checks { display: flex; gap: 6px; flex-wrap: wrap; }
.day-check {
  display: flex; align-items: center; gap: 4px;
  font-size: 12.5px; cursor: pointer;
  padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--card-solid); user-select: none; transition: all 0.15s;
}
.day-check input { cursor: pointer; }
.day-check:has(input:checked) { 
  background: var(--child1-light); 
  border-color: var(--child1); 
  color: var(--child1); 
  font-weight: 700; 
}

.time-inputs {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted);
}
.time-inputs input[type="time"] {
  padding: 7px 10px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 13px; background: var(--card-solid); color: var(--text);
  outline: none;
}

.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.btn-cancel {
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card-solid); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-submit {
  padding: 8px 20px; border-radius: 8px; border: none;
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow);
}
.btn-submit:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── 주간 그리드 ── */
.week-grid { 
  display: grid; 
  grid-template-columns: repeat(5, 1fr); 
  gap: 12px; 
  margin-bottom: 30px; 
}
.day-col { display: flex; flex-direction: column; gap: 8px; }
.day-header {
  text-align: center; font-weight: 800; font-size: 14px;
  padding: 10px 0; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.day-header.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}
.day-header.clickable:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  transform: translateY(-1px);
}
.day-col.active-day-col .day-header {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  box-shadow: var(--shadow-lg);
}

/* ── 이벤트 카드 ── */
.event-card {
  border-radius: var(--radius); 
  padding: 12px;
  background: var(--card); 
  border: 1px solid var(--border);
  border-left: 4px solid transparent;
  font-size: 12.5px; 
  flex: 1; 
  min-width: 0;
  box-shadow: var(--shadow);
}
.event-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.event-card.child1 { border-left-color: var(--child1); }
.event-card.child2 { border-left-color: var(--child2); }
.event-card .time { color: var(--muted); font-size: 11px; margin-bottom: 4px; font-weight: 600; }
.event-card .name { font-weight: 700; margin-bottom: 4px; word-break: keep-all; color: var(--text); font-size: 13px; }
.event-card .event-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.needs-parent {
  display: inline-block; background: rgba(239, 68, 68, 0.08); color: #ef4444;
  border-radius: 4px; padding: 2px 6px; font-size: 10px; font-weight: 700;
  border: 1px solid rgba(239, 68, 68, 0.15);
}
body.dark .needs-parent {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.empty-day { color: var(--muted); font-size: 12.5px; text-align: center; padding: 16px 0; font-weight: 500; }

/* ── 동시 등원 그룹 ── */
.event-group.simultaneous {
  border-radius: var(--radius);
  border: 1.5px solid #f59e0b;
  background: rgba(254, 243, 199, 0.4);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
}
body.dark .event-group.simultaneous {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.5);
}
.simultaneous-label {
  font-size: 10.5px; font-weight: 800; color: #d97706;
  letter-spacing: 0.02em;
  padding: 0 4px;
}
body.dark .simultaneous-label { color: #fbbf24; }
.event-row {
  display: flex; gap: 6px;
}
.event-row .event-card {
  box-shadow: none;
}
/* 동시 등원 내부 카드는 배경색으로 아이 구분 강화 */
.event-row .event-card.child1 { background: var(--child1-light); }
.event-row .event-card.child2 { background: var(--child2-light); }

/* ── 충돌 카드 애니메이션 및 스타일 ── */
.event-card.conflict {
  border: 1.5px solid #ef4444 !important;
  border-left: 4px solid #ef4444 !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3) !important;
  position: relative;
}
.event-card.conflict::after {
  content: "⚠️";
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 12px;
}
.event-card.conflict:hover {
  animation: shake 0.35s ease-in-out;
}
@keyframes shake {
  0%, 100% { transform: translateX(0) translateY(-2px); }
  20%, 60% { transform: translateX(-3px) translateY(-2px); }
  40%, 80% { transform: translateX(3px) translateY(-2px); }
}

/* ── 등록된 학원 ── */
.section-title { font-size: 18px; margin-bottom: 16px; font-weight: 800; }
.academy-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; }
.academy-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  box-shadow: var(--shadow);
}
.academy-card .header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}
.academy-card .acad-name { font-weight: 800; font-size: 15px; color: var(--text); }
.academy-card .info { font-size: 13px; color: var(--text); font-weight: 500; }
.academy-card .info.muted { color: var(--muted); margin-top: 4px; font-size: 12px; }

.badge {
  display: inline-block; border-radius: 99px; padding: 3px 10px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
  border: 1px solid transparent;
}
.badge.학교앞셔틀 { background: #d1fae5; color: #065f46; border-color: rgba(6, 95, 70, 0.15); }
.badge.외부셔틀    { background: #fef3c7; color: #92400e; border-color: rgba(146, 64, 14, 0.15); }
.badge.부모라이딩  { background: #fee2e2; color: #7f1d1d; border-color: rgba(127, 29, 29, 0.15); }
.badge.단지내도보  { background: #f3f4f6; color: #4b5563; border-color: rgba(75, 85, 99, 0.15); }

body.dark .badge.학교앞셔틀 { background: rgba(16, 185, 129, 0.15); color: #34d399; }
body.dark .badge.외부셔틀    { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
body.dark .badge.부모라이딩  { background: rgba(239, 68, 68, 0.15); color: #f87171; }
body.dark .badge.단지내도보  { background: rgba(156, 163, 175, 0.15); color: #d1d5db; }

.verified-badge   { font-size: 11.5px; color: #16a34a; font-weight: 700; }
.unverified-badge { font-size: 11.5px; color: #94a3b8; font-weight: 500; }

/* ── 반응형 레이아웃 ── */
@media (max-width: 768px) {
  body { padding: 16px; }
  .app-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .theme-toggle { position: absolute; top: 16px; right: 16px; }
  .week-grid { grid-template-columns: 1fr; gap: 12px; }
  .day-col { border-bottom: 1.5px solid var(--border); padding-bottom: 16px; }
  .day-col:last-child { border-bottom: none; }
  .stats-row { flex-direction: column; align-items: stretch; }
  .stats-actions { justify-content: flex-start; margin-top: 8px; }
  .event-row { flex-direction: column; }
  .simultaneous-label { font-size: 9.5px; }
}

/* ── 아코디언 ── */
.accordion {
  margin-bottom: 24px;
}
.accordion-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.accordion-btn:hover { background: var(--card-solid); }
.accordion-arrow {
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.2s;
}
.accordion-body {
  overflow: hidden;
  max-height: 2000px;
  transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
  opacity: 1;
}
.accordion-body.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

/* ── 부모 동선 타임라인 ── */
.timeline-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 10px;
}
.timeline-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text);
}
.timeline-day-desc {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}
.timeline-list {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 20px;
  border-left: 2px solid var(--border);
  margin-left: 10px;
  gap: 16px;
}
.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 타임라인 불릿 점 */
.timeline-item::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  border: 2px solid var(--card-solid);
  z-index: 2;
  transition: all 0.2s ease;
}
.timeline-item.child1::before {
  background: var(--child1);
  box-shadow: 0 0 5px var(--child1);
}
.timeline-item.child2::before {
  background: var(--child2);
  box-shadow: 0 0 5px var(--child2);
}
.timeline-item.parent-action::before {
  background: #f59e0b;
  border-color: var(--card-solid);
  width: 14px;
  height: 14px;
  left: -29px;
  top: 4px;
  box-shadow: 0 0 6px #f59e0b;
}
body.dark .timeline-item.parent-action::before {
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
}

/* ── 챗봇 FAB ── */
.chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--child1), var(--child2));
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(59, 130, 246, 0.5);
}
.chat-fab:active { transform: scale(0.95); }
.chat-fab-icon { font-size: 24px; }

/* ── 챗봇 오버레이 ── */
.chat-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 950;
  backdrop-filter: blur(2px);
}
.chat-overlay.show { display: block; }

/* ── 챗봇 패널 ── */
.chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 100vw;
  height: 100dvh;
  background: var(--card-solid);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-panel.open { transform: translateX(0); }

/* 헤더 */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--child1) 0%, var(--child2) 100%);
  color: #fff;
  flex-shrink: 0;
}
.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-ai-badge {
  font-size: 10px;
  font-weight: 800;
  background: rgba(255,255,255,0.25);
  padding: 2px 7px;
  border-radius: 99px;
  letter-spacing: 0.05em;
}
.chat-title {
  font-size: 15px;
  font-weight: 700;
}
.chat-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.chat-close:hover { background: rgba(255,255,255,0.35); }

/* 메시지 영역 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}
.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--child1), #6366f1);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble.ai {
  align-self: flex-start;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-bubble.ai.error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* 타이핑 인디케이터 */
.chat-bubble.typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
}
.chat-bubble.typing span {
  display: block;
  width: 7px;
  height: 7px;
  background: var(--muted);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.chat-bubble.typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-bubble.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

/* 추천 칩 */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.suggestion-chip {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.suggestion-chip:hover {
  background: var(--child1-light);
  border-color: var(--child1);
  color: var(--child1);
  transform: translateY(-1px);
}

/* 입력 영역 */
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 24px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--child1); }
.chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--child1), var(--child2));
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.chat-send:hover {
  transform: scale(1.08);
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.4);
}

/* ── 앱 연동 액션 하이라이트 ── */
@keyframes flash-pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
.flash-highlight {
  animation: flash-pulse 0.6s ease 3;
  outline: 2px solid #f59e0b;
  border-radius: var(--radius);
}

/* ── 다크모드 챗봇 ── */
body.dark .chat-panel {
  background: var(--card-solid);
  border-left-color: var(--border);
}
body.dark .chat-input {
  background: #0f172a;
  border-color: var(--border);
  color: var(--text);
}

/* ── 모바일 챗봇 ── */
@media (max-width: 480px) {
  .chat-panel { width: 100vw; }
  .chat-fab { bottom: 20px; right: 20px; }
}

.timeline-time {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.timeline-item.parent-action .timeline-time {
  color: #d97706;
}
body.dark .timeline-item.parent-action .timeline-time {
  color: #fbbf24;
}

.timeline-content {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body.dark .timeline-content {
  background: rgba(255, 255, 255, 0.02);
}
.timeline-item.parent-action .timeline-content {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.3);
  border-left: 4px solid #f59e0b;
}
body.dark .timeline-item.parent-action .timeline-content {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  border-left-color: #fbbf24;
}

.timeline-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.timeline-item-desc {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}
.timeline-empty {
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
  padding: 20px 0;
  font-weight: 500;
}
