:root {
  --primary-color: #E85555; 
  --primary-gradient: linear-gradient(135deg, #F05A5A 0%, #D83A3A 100%);
  --primary-shadow: rgba(232, 85, 85, 0.3);
  
  --bg-color: #F4F6F8;
  --surface-color: #FFFFFF;
  --box-bg-color: #F8F9FA;
  
  --text-main: #1A1A1A;
  --text-sub: #757575;
  --text-light: #A0A0A0;
  --text-white: #FFFFFF;
  
  --border-color: #EAECEF;
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  
  --agent-bg: #E8F5E9;
  --agent-text: #2E7D32;
  
  --header-height: 60px;
  --bottom-nav-height: 68px;
  --content-padding: 20px;
}

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  -ms-overflow-style: none;
  scrollbar-width: none;
}

::-webkit-scrollbar {
  display: none;
}

body {
  font-family: 'Pretendard', -apple-system, sans-serif;
  background-color: #E9ECEF;
  display: flex;
  justify-content: center;
  color: var(--text-main);
}

.app-container {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 20px rgba(0,0,0,0.05);
  /* 페이지 안의 요소 하나가 계산 실수 등으로 카드 폭을 살짝 넘기더라도, 화면 전체가 가로로
     밀리면서 오른쪽에 흰 여백이 생기는 것을 막는 안전장치. */
  overflow-x: hidden;
}

.app-header {
  height: var(--header-height);
  background-color: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--content-padding);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.header-title { 
  font-size: 18px; 
  font-weight: 700; 
}

.header-icon { 
  font-size: 22px; 
  color: var(--text-main); 
  cursor: pointer; 
  transition: color 0.2s; 
}

.header-icon.active { 
  color: var(--primary-color); 
}

.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 20px var(--content-padding)
  calc(var(--bottom-nav-height) + 24px)
  var(--content-padding);
}

.greeting-section { 
  margin-bottom: 24px; 
}

.greeting-title { 
  font-size: 24px; 
  font-weight: 700; 
  line-height: 1.4; 
  color: var(--text-main); 
}

.greeting-title .highlight { 
  color: var(--primary-color); 
}

.greeting-sub { 
  font-size: 14px; 
  color: var(--text-sub); 
  margin-top: 6px; 
}

.routine-full-card {
  background-color: var(--surface-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
  margin-bottom: 24px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.badge-agent {
  display: inline-flex;
  align-items: center;
  background-color: var(--agent-bg);
  color: var(--agent-text);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  gap: 6px;
}

.badge-agent i { 
  font-size: 8px; 
}

.heart-btn { 
  font-size: 22px; 
  color: var(--border-color); 
  cursor: pointer; 
  transition: color 0.2s; 
}

.heart-btn.active { 
  color: var(--primary-color); 
}

.routine-title { 
  font-size: 22px; 
  font-weight: 700; 
  margin-bottom: 12px; 
}

.routine-desc { 
  font-size: 14.5px;
  color: var(--text-sub); 
  line-height: 1.6; 
  margin-bottom: 24px; 
}

.section-title { 
  font-size: 16px; 
  font-weight: 700; 
  color: var(--text-sub); 
  margin-bottom: 12px; 
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.step-item {
  background-color: var(--box-bg-color);
  border-radius: var(--border-radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
}

.step-num {
  width: 28px;
  height: 28px;
  background-color: #FFF0F0;
  color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  margin-right: 16px;
}

.step-name { 
  font-size: 16px; 
  font-weight: 600; 
  margin-right: 8px; 
}

.step-detail { 
  font-size: 15px; 
  color: var(--text-sub); 
}

.effects-box {
  background-color: var(--box-bg-color);
  border-radius: var(--border-radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.effects-label { 
  font-size: 13px; 
  font-weight: 700; 
  color: var(--text-main); 
  margin-bottom: 8px; 
}

.effects-value { 
  font-size: 16px; 
  font-weight: 700; 
  color: var(--primary-color); 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  margin-bottom: 6px; 
}

.effects-note { 
  font-size: 12px; 
  color: var(--text-light); 
}

.effects-note-list { display: flex; flex-direction: column; gap: 6px; }
.effects-note-item { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--text-light); line-height: 1.5; }
.effects-note-item .dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--text-light); }

.btn {
  width: 100%;
  padding: 18px;
  border-radius: var(--border-radius-md);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  border: none;
  cursor: pointer;
  margin-bottom: 12px;
  transition: transform 0.1s;
}

.btn:active { 
  transform: scale(0.98); 
}

.btn-primary { 
  background: var(--primary-gradient); 
  color: var(--text-white); 
  box-shadow: 0 6px 16px var(--primary-shadow); 
}

.btn-secondary { 
  background-color: var(--surface-color); 
  color: var(--text-main); 
  border: 1px solid var(--border-color); 
}

.app-bottom-nav {
  height: var(--bottom-nav-height);
  background-color: var(--surface-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom);
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 100;
}

.nav-item { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  color: var(--text-light); 
  text-decoration: none; 
  font-size: 11px; 
  gap: 6px; 
  width: 48px; 
}

.nav-item i { 
  font-size: 22px; 
}

.nav-item.active { 
  color: var(--primary-color); 
  font-weight: 700; 
}



/* ==========================================
   Form Elements (Floating Label)
   ========================================== */
.floating-group {
  position: relative;
  margin-bottom: 16px;
}

.floating-input {
  width: 100%;
  height: 56px;
  padding: 20px 16px 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background-color: var(--surface-color);
  font-size: 16px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}

.floating-input:focus {
  border-color: var(--primary-color);
}

.floating-label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-sub);
  transition: all 0.2s ease;
  pointer-events: none;
}

/* 포커스 되거나 값이 있을 때 라벨 상단 이동 */
.floating-input:focus ~ .floating-label,
.floating-input:not(:placeholder-shown) ~ .floating-label {
  top: 14px;
  font-size: 12px;
  color: var(--primary-color);
}

/* 체크박스 스타일 */
.checkbox-label {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--text-sub);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
}


/* ==========================================
   Common Modal Popup
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  width: 80%;
  max-width: 320px;
  background-color: var(--surface-color);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay.show .modal-container {
  transform: scale(1);
}

.modal-content {
  padding: 32px 20px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  display: flex;
}

.modal-btn {
  flex: 1;
  padding: 16px;
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-color);
  cursor: pointer;
}

.modal-btn:active {
  background-color: var(--box-bg-color);
}


/* ==========================================
   공통 영상 플레이어 스타일 (코칭 및 운동 상세)
   ========================================== */
.video-container {
  width: 100%;
  /* aspect-ratio는 이 요소가 flex-direction:column인 .app-main의 flex 자식이라 메인축(세로) 크기
     계산에 반영되지 않아 0px로 접혔다(flex+aspect-ratio 상호작용 이슈). flex 여부와 무관하게 항상
     width 기준으로 계산되는 padding-bottom 비율 트릭으로 대체 — 오래되고 검증된 방식. */
  height: 0;
  padding-bottom: 56.25%; /* 9 / 16 */
  background-color: #000;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ==========================================
   공통 탭 스타일
   ========================================== */

/* 공통 탭 메뉴 */
.tab-menu { display: flex; border-bottom: 1px solid var(--border-color); background-color: var(--surface-color); }
.tab-item { flex: 1; text-align: center; padding: 14px 0; font-size: 15px; font-weight: 600; color: var(--text-light); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s; }
.tab-item.active { color: var(--primary-color); border-bottom: 2px solid var(--primary-color); }

/* 공통 필터 영역 */
.filter-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; background-color: var(--bg-color); }
.filter-pill { flex-shrink: 0; padding: 8px 16px; background-color: var(--surface-color); border: 1px solid var(--border-color); border-radius: 20px; font-size: 13px; color: var(--text-sub); font-weight: 600; cursor: pointer; }
.filter-pill.active { background-color: var(--primary-color); color: var(--text-white); border-color: var(--primary-color); }