* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: #f4f6f9;
  color: #1e293b;
  padding: 24px 16px;
}

.container {
  max-width: 640px;
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
}

.subtitle {
  font-size: 0.92rem;
  color: #64748b;
  margin-top: 6px;
}

.card {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

h2 {
  font-size: 1.12rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.optional-tag {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
}

.step-desc {
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 14px;
  line-height: 1.45;
}

/* [PAGE 1: 초기 설정 페이지 스타일] */
.setup-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 480px) {
  .setup-two-col {
    grid-template-columns: 1fr;
  }
}

.setup-two-col label,
.custom-goal-box label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  gap: 6px;
  min-width: 0;
}

input[type="number"],
input[type="date"] {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.98rem;
  color: #0f172a;
  background-color: #f8fafc;
  transition: border-color 0.2s, background-color 0.2s;
}

input[type="number"]:focus,
input[type="date"]:focus {
  outline: none;
  border-color: #3b82f6;
  background-color: #ffffff;
}

.bep-preview-box {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 16px;
}

.bep-preview-box h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 8px;
}

.preview-main {
  font-size: 1.05rem;
  color: #0f172a;
  margin-bottom: 4px;
}

.preview-main strong {
  color: #2563eb;
  font-size: 1.2rem;
}

.preview-sub {
  font-size: 0.88rem;
  color: #475569;
}

.divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 22px 0;
}

.custom-goal-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
}

.custom-goal-box input {
  background-color: #ffffff;
  font-weight: 700;
  font-size: 1.05rem;
}

.goal-avg-hint {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #059669;
  font-weight: 600;
}

/* 체중 목표 설정 전용 박스 */
.weight-setup-box {
  background-color: #fdf4ff;
  border: 1px solid #f5d0fe;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 22px;
}

.weight-setup-box .setup-two-col {
  margin-bottom: 10px;
}

.weight-setup-box input {
  background-color: #ffffff;
}

.weight-pace-hint {
  font-size: 0.88rem;
  color: #86198f;
  font-weight: 700;
  line-height: 1.4;
}

.btn-primary {
  padding: 13px 18px;
  background-color: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: #2563eb;
}

.full-width {
  width: 100%;
}

/* [PAGE 2: 상단 정보 바] */
.top-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #ffffff;
  padding: 12px 18px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  gap: 8px;
  flex-wrap: wrap;
}

#currentPlanBadge {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
}

.btn-outline {
  padding: 6px 12px;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: background-color 0.15s;
}

.btn-outline:hover {
  background-color: #e2e8f0;
}

/* [데일리 입력 영역] */
.daily-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 10px;
  flex-wrap: wrap;
}

.daily-header h2 {
  margin-bottom: 0;
  white-space: nowrap;
}

.date-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-actions input[type="date"] {
  width: auto;
  padding: 8px 10px;
}

.btn-delete-day {
  padding: 8px 10px;
  background-color: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s;
}

.btn-delete-day:hover {
  background-color: #fecaca;
}

.check-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

@media (max-width: 480px) {
  .check-group {
    grid-template-columns: 1fr;
  }
}

.check-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 10px;
  background-color: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s;
}

.check-btn:hover {
  border-color: #cbd5e1;
}

.check-btn.active {
  background-color: #ecfdf5;
  border-color: #10b981;
  color: #047857;
}

.numeric-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 480px) {
  .numeric-group {
    grid-template-columns: 1fr;
  }
}

.numeric-item {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.numeric-item label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}

.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn input {
  flex: 1;
  width: 100%;
  min-width: 0;
  background-color: #ffffff;
  text-align: right;
}

.btn-secondary {
  padding: 0 14px;
  background-color: #475569;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.btn-secondary:hover {
  background-color: #334155;
}

/* [요약 영역 스타일] */
.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-header h2 {
  margin-bottom: 0;
}

.bep-badge {
  font-size: 0.82rem;
  font-weight: 700;
  background-color: #eff6ff;
  color: #2563eb;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.money-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.saved-amount {
  font-size: 1.85rem;
  font-weight: 800;
  color: #10b981;
}

.goal-amount {
  font-size: 0.95rem;
  color: #64748b;
}

.progress-track {
  width: 100%;
  height: 16px;
  background-color: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background-color: #10b981;
  transition: width 0.35s ease, background-color 0.35s ease;
}

.bep-status-msg {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
}

.stats-list {
  list-style: none;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-label {
  color: #475569;
  font-weight: 600;
}

.stat-value {
  color: #0f172a;
  font-weight: 700;
}

/* [달력 영역 스타일] */
.calendar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-top h2 {
  margin-bottom: 0;
}

.legend {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  color: #475569;
  font-weight: 600;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.perfect-dot {
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
}

.gym-dot {
  background-color: #d1fae5;
  border: 1px solid #10b981;
}

.selected-dot {
  background-color: #ffffff;
  border: 2px solid #3b82f6;
}

.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8fafc;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.calendar-nav h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.nav-btn {
  padding: 6px 12px;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: background-color 0.15s;
}

.nav-btn:hover {
  background-color: #f1f5f9;
}

.weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  text-align: center;
}

.weekdays div {
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  padding-bottom: 6px;
}

.weekdays .sun {
  color: #ef4444;
}

.weekdays .sat {
  color: #3b82f6;
}

.day-cell {
  min-height: 92px;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 2px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  transition: transform 0.1s, border-color 0.15s, background-color 0.15s;
}

.day-cell:hover {
  border-color: #94a3b8;
}

.day-cell.empty {
  background-color: transparent;
  border: none;
  cursor: default;
}

.day-cell.attended {
  background-color: #ecfdf5;
  border-color: #6ee7b7;
}

.day-cell.perfect {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #f59e0b;
}

.day-cell.selected {
  border: 2px solid #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}

.day-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.day-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
}

.day-cell.sun .day-num {
  color: #ef4444;
}

.day-cell.sat .day-num {
  color: #3b82f6;
}

.perfect-crown {
  font-size: 0.72rem;
}

.perfect-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #b45309;
  background-color: #fde68a;
  padding: 1px 5px;
  border-radius: 999px;
}

.badges {
  font-size: 0.72rem;
  letter-spacing: -1px;
  min-height: 15px;
}

.hours-tag {
  font-size: 0.68rem;
  color: #b45309;
  font-weight: 700;
  background-color: #fef3c7;
  padding: 1px 4px;
  border-radius: 4px;
}

.day-cell.perfect .hours-tag {
  background-color: #ffffff;
  border: 1px solid #fcd34d;
}

.weight-tag {
  font-size: 0.68rem;
  color: #1d4ed8;
  font-weight: 700;
  background-color: #dbeafe;
  padding: 1px 4px;
  border-radius: 4px;
}