/* =========================================
   사용자 앱 전용 CSS (모바일 최적화)
   ========================================= */

/* ===== 앱 레이아웃 ===== */
.app-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
}

/* ===== 앱 헤더 ===== */
.app-header {
  background: var(--white);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.app-header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 14px;
}

.app-header-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.app-header-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ===== 메인 컨텐츠 영역 ===== */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 80px;
}

/* ===== 하단 탭바 ===== */
.app-tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-top: 1px solid var(--border-light);
  display: flex;
  z-index: 200;
  box-shadow: 0 -2px 8px rgba(26,39,68,0.07);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px 12px;
  gap: 4px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s;
}

.tab-item.active {
  color: var(--primary);
}

.tab-item-icon {
  font-size: 22px;
  line-height: 1;
}

.tab-item-label {
  font-size: 11px;
  font-weight: 600;
}

/* ===== 섹션 ===== */
.section {
  display: none;
}

.section.active {
  display: block;
}

/* ===== 홈 화면 ===== */
.home-welcome {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 22px 20px 20px;
  color: white;
}

.home-welcome-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.2;
}

.home-welcome-datetime {
  font-size: 13px;
  opacity: 0.85;
  font-weight: 400;
  letter-spacing: 0.2px;
}

.home-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.home-section-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 16px;
  background: var(--primary);
  border-radius: 2px;
}

.home-section {
  padding: 20px;
}

.home-section + .home-section {
  padding-top: 0;
}

/* ===== 홈 공지 카드 ===== */
.home-notice-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--primary);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(33,150,243,0.10);
}
.home-notice-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--primary);
}
.home-notice-card-label {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}
.home-notice-card-more {
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  cursor: pointer;
}
.home-notice-card-body { background: var(--white); }

.home-notice-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 0.12s;
  background: var(--white);
  border-bottom: none;
}
.home-notice-row.bordered { border-bottom: none; }
.home-notice-row:active { background: var(--primary-light); }
.home-notice-row.pinned { background: #f0f7ff; }
.home-notice-row.pinned.bordered { border-bottom: none; }

.home-notice-badge {
  font-size: 12px;
  flex-shrink: 0;
  opacity: 0.75;
}
.home-notice-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-notice-row.pinned .home-notice-title {
  font-weight: 700;
  color: var(--primary-dark);
}
.home-notice-date {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.home-notice-arrow {
  font-size: 14px;
  color: var(--primary-mid);
  flex-shrink: 0;
  margin-left: 1px;
}

/* ===== 홈 최근 분석결과 카드 (file-row 방식) ===== */
.home-result-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
}
.home-result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border-light);
}
.home-result-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.home-result-card-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.home-result-card-body {
  padding: 6px 0;
}
/* file-row를 홈 카드 안에서 자연스럽게 */
.home-result-card-body .file-row {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-light);
}
.home-result-card-body .file-row:last-child { border-bottom: none; }

/* ===== 공지 카드 (기존 배너 - 유지) ===== */
.notice-banner {
  background: var(--primary-light);
  border: 1px solid var(--primary-mid);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.notice-banner-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.notice-banner-text {
  flex: 1;
  min-width: 0;
}

.notice-banner-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notice-banner-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== 분석결과 바로가기 카드 ===== */
.quick-result-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  padding: 16px;
}

.quick-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.quick-result-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.quick-result-date {
  font-size: 12px;
  color: var(--text-muted);
}

.quick-result-actions {
  display: flex;
  gap: 8px;
}

.quick-action-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.quick-action-btn.mp3 {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.quick-action-btn.pdf {
  background: #FFF3E0;
  color: #E65100;
}

/* ===== 학습자료 미리보기 카드 ===== */
/* ===== 홈 학습자료 미리보기 - 16:9 카드 그리드 ===== */
.material-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.material-preview-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.material-preview-card:active {
  transform: scale(0.97);
  box-shadow: none;
}

/* 16:9 썸네일 영역 */
.material-preview-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  overflow: hidden;
  flex-shrink: 0;
}

.material-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.material-preview-info {
  padding: 8px 10px 10px;
}

.material-preview-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
  margin-bottom: 4px;
}

.material-preview-desc {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.material-cat-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.cat-video { background: #FEE2E2; color: #991B1B; }
.cat-paper { background: #EDE9FE; color: #5B21B6; }
.cat-other { background: #F1F5F9; color: #475569; }

/* ===== 분석결과 목록 ===== */
.result-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.result-card-header {
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}

.result-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.result-card-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.result-card-body {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-row-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 40px;
  flex-shrink: 0;
}

.file-row-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.file-btn {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.file-btn-play     { background: var(--primary-light); color: var(--primary-dark); }
.file-btn-view     { background: #FFF3E0; color: #E65100; }
.file-btn-download { background: #F1F5F9; color: #475569; }

/* ===== 미니바 플레이어 ===== */
.mini-player {
  position: fixed;
  bottom: 60px; /* 탭바 위 */
  left: 0; right: 0;
  z-index: 800;
  background: linear-gradient(135deg, #1A2744 0%, #2C3E6B 100%);
  box-shadow: 0 -2px 16px rgba(0,0,0,0.25);
}

.mini-player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  gap: 10px;
}

.mini-player-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

/* 음파 애니메이션 */
.mini-player-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
  flex-shrink: 0;
}
.mini-player-wave span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.5);
  height: 6px;
}
.mini-player-wave.active span:nth-child(1) { animation: wave 0.8s ease-in-out infinite; }
.mini-player-wave.active span:nth-child(2) { animation: wave 0.8s ease-in-out 0.15s infinite; }
.mini-player-wave.active span:nth-child(3) { animation: wave 0.8s ease-in-out 0.3s infinite; }
.mini-player-wave.active span:nth-child(4) { animation: wave 0.8s ease-in-out 0.45s infinite; }
@keyframes wave {
  0%, 100% { height: 4px; background: rgba(255,255,255,0.4); }
  50%       { height: 18px; background: #7EB6FF; }
}

.mini-player-info {
  flex: 1;
  min-width: 0;
}
.mini-player-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-player-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  margin-top: 2px;
}

.mini-player-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.mini-ctrl-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.mini-ctrl-btn:active { background: rgba(255,255,255,0.25); }

/* 미니바 진행 바 */
.mini-progress-bar {
  height: 3px;
  background: rgba(255,255,255,0.15);
}
.mini-progress-fill {
  height: 100%;
  background: #7EB6FF;
  width: 0%;
  transition: width 0.5s linear;
}

/* ===== 확장 플레이어 패널 ===== */
.expanded-player {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
}
.expanded-player.open { pointer-events: auto; }

.expanded-player-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.32s;
}
.expanded-player.open .expanded-player-backdrop {
  background: rgba(0,0,0,0.5);
}

.expanded-player-sheet {
  position: relative;
  background: linear-gradient(170deg, #1A2744 0%, #2C3E6B 60%, #1e3a5f 100%);
  border-radius: 24px 24px 0 0;
  padding: 0 24px 40px;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(.32,.72,0,1);
  color: white;
}
.expanded-player.open .expanded-player-sheet {
  transform: translateY(0);
}

.expanded-handle-row {
  display: flex;
  justify-content: center;
  padding: 14px 0 8px;
  cursor: pointer;
}
.expanded-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.3);
}

/* 앨범아트 */
.expanded-art {
  display: flex;
  justify-content: center;
  margin: 10px 0 18px;
}
.expanded-art-inner {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* 곡 정보 */
.expanded-info {
  text-align: center;
  margin-bottom: 16px;
}
.expanded-title {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.3;
}
.expanded-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
}

/* 로딩 */
.expanded-loading {
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 0 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}
.expanded-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* 시크바 */
.expanded-seek-area {
  margin-bottom: 10px;
}
.expanded-seekbar {
  width: 100%;
  height: 5px;
  border-radius: 3px;
  appearance: none;
  background: rgba(255,255,255,0.2);
  cursor: pointer;
  outline: none;
}
.expanded-seekbar::-webkit-slider-thumb {
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
  cursor: pointer;
}
.expanded-time-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-top: 6px;
}

/* 컨트롤 */
.expanded-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 0 18px;
}
.expanded-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: none;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
  position: relative;
}
.expanded-btn:active { transform: scale(0.90); }

.expanded-btn-seek {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
}
.expanded-btn-seek:hover { background: rgba(255,255,255,0.2); }
.expanded-btn-label {
  position: absolute;
  bottom: 9px;
  font-size: 9px;
  font-weight: 800;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0;
}

.expanded-btn-stop {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
}
.expanded-btn-stop:hover { background: rgba(255,255,255,0.2); }

.expanded-btn-play {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: white;
  color: #1A2744;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}
.expanded-btn-play:hover  { background: #E8F0FF; }
.expanded-btn-play.playing { background: #D0E8FF; }

/* 다운로드 버튼 */
.expanded-action-row {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.expanded-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 30px;
  background: rgba(255,255,255,0.13);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.18);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.expanded-action-btn:hover { background: rgba(255,255,255,0.22); }



/* ===== 📊 분석결과 배너 ===== */
.result-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1565C0 0%, #1976D2 45%, #2196F3 100%);
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.result-banner-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 80% 50%, rgba(144,202,249,0.25) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(33,150,243,0.2) 0%, transparent 70%);
  animation: aiBgPulse 4s ease-in-out infinite alternate;
}

.result-icon {
  font-size: 30px;
  display: block;
  position: relative;
  z-index: 3;
  animation: resultIconPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}
@keyframes resultIconPulse {
  0%,100% { transform: scale(1)    rotate(-4deg); }
  40%      { transform: scale(1.15) rotate(4deg); }
  70%      { transform: scale(1.05) rotate(-2deg); }
}

.result-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #90CAF9;
  flex-shrink: 0;
  box-shadow: 0 0 6px #90CAF9;
  animation: aiDotBlink 1.2s ease-in-out infinite;
}

/* ===== 🤖 AI 추천 배너 ===== */
.ai-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 45%, #0ea5e9 100%);
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

/* 배경 빛 효과 */
.ai-banner-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 80% 50%, rgba(99,179,237,0.25) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(139,92,246,0.2) 0%, transparent 70%);
  animation: aiBgPulse 4s ease-in-out infinite alternate;
}
@keyframes aiBgPulse {
  from { opacity: 0.7; }
  to   { opacity: 1; }
}

.ai-banner-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 2;
}

/* 로봇 + 파동 링 */
.ai-robot-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-robot {
  font-size: 30px;
  display: block;
  position: relative;
  z-index: 3;
  animation: aiRobotBounce 1.8s ease-in-out infinite;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}
@keyframes aiRobotBounce {
  0%,100% { transform: translateY(0) rotate(-3deg); }
  30%      { transform: translateY(-5px) rotate(3deg); }
  60%      { transform: translateY(-2px) rotate(-2deg); }
}

/* 파동 링 3개 */
.ai-robot-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.5);
  animation: aiRingExpand 2.4s ease-out infinite;
}
.ai-ring1 { width: 44px; height: 44px; animation-delay: 0s; }
.ai-ring2 { width: 44px; height: 44px; animation-delay: 0.8s; }
.ai-ring3 { width: 44px; height: 44px; animation-delay: 1.6s; }
@keyframes aiRingExpand {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* 텍스트 */
.ai-banner-text {
  flex: 1;
  min-width: 0;
}
.ai-banner-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  line-height: 1.4;
  letter-spacing: -0.2px;
}
.ai-banner-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  margin-top: 4px;
}

/* 깜빡이는 초록 점 */
.ai-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  box-shadow: 0 0 6px #4ade80;
  animation: aiDotBlink 1.2s ease-in-out infinite;
}
@keyframes aiDotBlink {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

/* 파티클 ✦ */
.ai-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.ai-particle {
  position: absolute;
  color: rgba(255,255,255,0.5);
  font-size: 10px;
  animation: aiParticleFloat 3s ease-in-out infinite;
}
.p1 { top: 15%; left: 72%; animation-delay: 0s;    font-size: 8px; }
.p2 { top: 60%; left: 85%; animation-delay: 0.7s;  font-size: 11px; }
.p3 { top: 25%; left: 92%; animation-delay: 1.4s;  font-size: 7px; }
.p4 { top: 70%; left: 65%; animation-delay: 2.1s;  font-size: 9px; }
@keyframes aiParticleFloat {
  0%,100% { transform: translateY(0)   rotate(0deg);   opacity: 0.5; }
  50%      { transform: translateY(-8px) rotate(180deg); opacity: 1; }
}

/* ===== 학습자료 탭 - 유튜브 스타일 1열 카드 ===== */
.material-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.material-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.material-card:active {
  transform: scale(0.98);
  box-shadow: none;
}

/* 16:9 썸네일 - 유튜브처럼 전체 너비 */
.material-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.material-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 재생 버튼 오버레이 */
.material-card-thumb .play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.15);
  transition: background 0.2s;
}
.material-card-thumb .play-overlay-icon {
  width: 48px;
  height: 48px;
  background: rgba(0,0,0,0.65);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  backdrop-filter: blur(2px);
}
.material-card:active .play-overlay {
  background: rgba(0,0,0,0.3);
}

.material-card-body {
  padding: 10px 12px 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.material-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

.material-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

.material-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.material-link-btn {
  padding: 4px 10px;
  background: var(--primary);
  color: white;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== 학습자료 상세 서브화면 ===== */
.material-detail-video-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  position: relative;
}
.material-detail-video-wrap iframe,
.material-detail-video-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.material-detail-body {
  padding: 16px;
}

.material-detail-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 8px;
}

.material-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.material-detail-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 16px;
}

.material-detail-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}
.material-detail-link-btn:active {
  background: var(--primary-dark);
}

/* ===== 학습자료 필터 ===== */
.filter-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
}

.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== 더보기 메뉴 ===== */
.more-list {
  padding: 8px 16px;
}

.more-item {
  display: flex;
  align-items: center;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  gap: 14px;
}

.more-item:last-child {
  border-bottom: none;
}

.more-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.more-item-label {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.more-item-arrow {
  color: var(--text-muted);
  font-size: 16px;
}

/* ===== 서브 화면 (더보기 하위) ===== */
.sub-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 300;
  max-width: 480px;
  margin: 0 auto;
  overflow-y: auto;
}

.sub-screen.open {
  display: block;
}

.sub-header {
  background: var(--white);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.sub-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.sub-header-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.sub-body {
  padding: 20px 16px;
  padding-bottom: 40px;
}

/* ===== 공지 목록 ===== */
.notice-item {
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  padding: 14px 16px;
  cursor: pointer;
  margin-bottom: 8px;
}

.notice-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.notice-item-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notice-pinned-badge {
  background: var(--primary);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  flex-shrink: 0;
}

.notice-item-date {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== 공지 상세 ===== */
.notice-detail-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.notice-detail-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.notice-detail-content {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.75;
  word-break: break-word;
}
/* Quill HTML 렌더링 스타일 */
.notice-detail-content p { margin: 0 0 8px 0; }
.notice-detail-content h1 { font-size: 1.5em; font-weight: 700; margin: 16px 0 8px; }
.notice-detail-content h2 { font-size: 1.3em; font-weight: 700; margin: 14px 0 6px; }
.notice-detail-content h3 { font-size: 1.1em; font-weight: 700; margin: 12px 0 6px; }
.notice-detail-content strong { font-weight: 700; }
.notice-detail-content em { font-style: italic; }
.notice-detail-content u { text-decoration: underline; }
.notice-detail-content a { color: var(--primary); text-decoration: underline; }
.notice-detail-content ul, .notice-detail-content ol { padding-left: 24px; margin: 8px 0; }
.notice-detail-content li { margin: 4px 0; }
.notice-detail-content img { max-width: 100%; border-radius: 10px; margin: 8px 0; display: block; }
/* 영상 래퍼: aspect-ratio 방식 (padding-top 방식 제거 - 상단 여백 문제 해결) */
.notice-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  margin: 12px 0;
  display: block;
}
.notice-video-wrap iframe,
.notice-video-wrap video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
  display: block;
}
/* notice-video-wrap 안의 iframe은 별도 스타일 무시 */
.notice-detail-content .notice-video-wrap iframe {
  aspect-ratio: unset;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  min-height: unset;
}
/* 래퍼 없는 단독 iframe fallback */
.notice-detail-content > iframe,
.notice-detail-content > .ql-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 10px;
  display: block;
  margin: 12px 0;
}

/* ===== 문의하기 ===== */
.inquiry-info-box {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.8;
  white-space: pre-wrap;
  font-family: 'Courier New', monospace;
  margin-bottom: 12px;
  word-break: break-all;
}

.inquiry-guide {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--primary-dark);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ===== 마이페이지 ===== */
.mypage-profile {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 28px 20px;
  color: white;
  text-align: center;
  margin-bottom: 4px;
}

.mypage-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 12px;
}

.mypage-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.mypage-info-list {
  background: var(--white);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}

.mypage-info-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}

.mypage-info-row:last-child {
  border-bottom: none;
}

.mypage-info-label {
  width: 90px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.mypage-info-value {
  flex: 1;
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
}

/* ===== 예약 화면 ===== */
.reservation-section {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 12px;
}

.reservation-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== 달력 ===== */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-light);
  font-size: 18px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.cal-nav-btn:hover { background: var(--primary-light); }
.cal-month-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-week-header { margin-bottom: 4px; }
.cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}
.cal-dow.sun { color: #EF4444; }
.cal-dow.sat { color: #3B82F6; }
.cal-day {
  position: relative;
  text-align: center;
  padding: 7px 2px;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.12s;
}
.cal-day:hover:not(.empty) { background: var(--primary-light); }
.cal-day.empty  { cursor: default; }
.cal-day.sun    { color: #EF4444; }
.cal-day.sat    { color: #3B82F6; }
.cal-day.today  {
  background: var(--primary-light);
  font-weight: 700;
  color: var(--primary-dark);
}
.cal-day.selected {
  background: var(--primary) !important;
  color: white !important;
  font-weight: 700;
}
/* 일정 있는 날 아래 점 */
.cal-day.has-dot::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}
.cal-day.selected.has-dot::after { background: white; }

/* 일정 상세 */
.cal-detail-empty {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
}
.cal-detail-card {
  background: var(--primary-light);
  border-radius: 10px;
  padding: 12px 14px;
  border-left: 3px solid var(--primary);
}
.cal-detail-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.cal-detail-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
  margin-top: 4px;
}
.cal-detail-label {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 32px;
  flex-shrink: 0;
}
.cal-detail-val {
  color: var(--text-primary);
  line-height: 1.5;
}

/* ===== 승인 대기 화면 ===== */
.pending-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}

.pending-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 20px;
}

.pending-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.pending-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 28px;
}

/* =============================================
   나의하루 전용 스타일
   ============================================= */

/* 탭바 5개 - 아이콘 크기 조정 */
.app-tabbar .tab-item-icon { font-size: 20px; }
.app-tabbar .tab-item-label { font-size: 10px; }

/* ── 나의하루 배너 ── */
.myday-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #065f46 0%, #059669 50%, #34d399 100%);
  padding: 18px 16px 16px;
}
.myday-banner-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 80% 50%, rgba(110,231,183,0.25) 0%, transparent 70%);
  animation: aiBgPulse 4s ease-in-out infinite alternate;
}
.myday-banner-content {
  position: relative; z-index: 2;
  display: flex; align-items: flex-start; gap: 14px;
}
.myday-banner-icon-wrap {
  width: 48px; height: 48px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  padding-top: 2px;
}
.myday-banner-icon {
  font-size: 32px;
  animation: aiRobotBounce 2s ease-in-out infinite;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
}
.myday-banner-title {
  font-size: 15px; font-weight: 800; color: #fff; letter-spacing: -0.2px;
}
/* AI 응원 멘트 인라인 (배너 안에 직접 표시) */
.myday-banner-cheer {
  font-size: 12.5px;
  color: rgba(255,255,255,0.92);
  margin-top: 5px;
  line-height: 1.5;
  font-weight: 500;
  word-break: keep-all;
}

/* ── 시간대 블록 카드 리스트 ── */
.myday-block-list {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.myday-block-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.13s, box-shadow 0.13s;
  position: relative;
  overflow: hidden;
}
.myday-block-card:active { transform: scale(0.98); box-shadow: none; }
.myday-block-card.done {
  border-color: #bbf7d0;
  background: linear-gradient(90deg,#f0fdf4 0%,#fff 100%);
}
.myday-block-card.active-now {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(33,150,243,0.15), var(--shadow-sm);
}
.myday-block-card.locked {
  opacity: 0.5; cursor: default;
}
/* 시간 지난 미완료 블록 */
.myday-block-card.missed {
  background: #fafafa;
  border-color: #e2e8f0;
  cursor: default;
  opacity: 0.7;
}
.myday-block-status.missed { color: #94a3b8; font-style: italic; }
.myday-block-icon { font-size: 28px; flex-shrink: 0; }
.myday-block-info { flex: 1; min-width: 0; }
.myday-block-name {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
}
.myday-block-time {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
}
.myday-block-status {
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.myday-block-status.done { color: #059669; }
.myday-block-status.now  { color: var(--primary); }
.myday-block-status.wait { color: var(--text-muted); }
/* 현재 시간대 강조 배지 */
.myday-now-badge {
  position: absolute; top: 10px; right: 12px;
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px;
}

/* ── 설문 화면 ── */
.myday-survey-wrap {
  display: flex; flex-direction: column;
  height: calc(100vh - 120px); /* 탭바 높이 제외 */
  padding: 0;
  overflow: hidden;
}
.myday-survey-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 8px;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.myday-back-btn {
  background: none; border: none; font-size: 15px;
  color: var(--primary); font-weight: 600; cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
}
.myday-back-btn:active { background: var(--primary-light); }
.myday-block-label {
  font-size: 14px; font-weight: 700; color: var(--text-primary);
}
.myday-progress-text {
  font-size: 13px; color: var(--text-muted); font-weight: 600;
}
/* 진행바 */
.myday-progress-bar-wrap {
  height: 4px; background: #e2e8f0; flex-shrink: 0;
}
.myday-progress-bar {
  height: 100%; background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}
/* 질문 영역 */
.myday-question-area {
  flex-shrink: 0;
  padding: 20px 20px 12px;
}
.myday-question-num {
  font-size: 12px; font-weight: 700; color: var(--primary);
  margin-bottom: 6px; letter-spacing: 0.5px;
}
.myday-question-text {
  font-size: 18px; font-weight: 800;
  color: var(--text-primary); line-height: 1.45;
}
/* 선택지 */
.myday-choices {
  flex: 1;
  padding: 8px 16px 16px;
  display: flex; flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.myday-choice-btn {
  flex: 1;
  background: var(--white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 16px; font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
  min-height: 0;
}
.myday-choice-btn:active,
.myday-choice-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: scale(0.97);
  box-shadow: 0 2px 12px rgba(33,150,243,0.3);
}

/* ── 완료 화면 ── */
.myday-done-wrap {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: calc(100vh - 120px);
  padding: 32px 24px; text-align: center;
}
.myday-done-icon { font-size: 60px; margin-bottom: 16px; }
.myday-done-title {
  font-size: 22px; font-weight: 800;
  color: var(--text-primary); margin-bottom: 10px;
}
.myday-done-msg {
  font-size: 14px; color: var(--text-muted); line-height: 1.6;
}

/* ── 홈 나의하루 미니카드 ── */
.home-myday-card {
  background: linear-gradient(90deg,#f0fdf4 0%,#ecfdf5 100%);
  border: 1.5px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.13s;
}
.home-myday-card:active { transform: scale(0.98); }
.home-myday-card-icon { font-size: 28px; flex-shrink: 0; }
.home-myday-card-body { flex: 1; min-width: 0; }
.home-myday-card-title {
  font-size: 14px; font-weight: 700; color: #065f46;
}
.home-myday-card-sub {
  font-size: 12px; color: #059669; margin-top: 2px;
}
.home-myday-card-arrow {
  font-size: 18px; color: #059669; flex-shrink: 0;
}

/* ===== 앱 안내 ===== */
.guide-section {
  margin-bottom: 20px;
}

.guide-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
}

.guide-section-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ===== 앱 푸터 ===== */
.app-footer {
  text-align: center;
  padding: 16px 20px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  background: var(--white);
}

/* ===== 로그인 페이지 ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  max-width: 480px;
  margin: 0 auto;
}

.auth-header {
  padding: 48px 24px 32px;
  text-align: center;
}

.auth-logo-mark {
  width: 64px;
  height: 64px;
  background: var(--primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 24px;
  margin: 0 auto 16px;
  box-shadow: 0 4px 16px rgba(33,150,243,0.3);
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.auth-body {
  flex: 1;
  padding: 0 20px 32px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-md);
}

.auth-tab-wrap {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 9px;
  text-align: center;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

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

.auth-footer {
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== 더보기 슬라이드 모달 (우측→좌측) ===== */
.more-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 400;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.more-modal-overlay.open {
  display: block;
  opacity: 1;
}

.more-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 82%;
  max-width: 360px;
  background: var(--white);
  z-index: 401;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.18);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.more-modal.open {
  transform: translateX(0);
}

/* 모달 헤더 */
.more-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
}

.more-modal-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.more-modal-logo-mark {
  width: 42px;
  height: 42px;
  background: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.more-modal-logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.more-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: white;
}

.more-modal-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
}

.more-modal-close {
  background: rgba(255,255,255,0.12);
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.more-modal-close:hover {
  background: rgba(255,255,255,0.22);
}

/* 모달 바디 */
.more-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0 8px;
}

.more-modal-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 8px 20px 4px;
}

.more-modal-list {
  padding: 0 12px;
}

.more-modal-item {
  display: flex;
  align-items: center;
  padding: 13px 8px;
  border-radius: 10px;
  cursor: pointer;
  gap: 12px;
  transition: background 0.15s;
  margin-bottom: 2px;
}

.more-modal-item:hover,
.more-modal-item:active {
  background: var(--primary-light);
}

.more-modal-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.more-modal-item-label {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.more-modal-item-arrow {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 300;
}

/* 모달 하단 (버전 정보) */
.more-modal-footer {
  flex-shrink: 0;
  padding: 12px 16px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

.more-modal-version-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.more-modal-version-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.version-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: pulse-dot 2.4s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.8); }
}

.more-version-status {
  font-size: 11px;
  color: var(--text-muted);
}

.more-version-status.update-available {
  color: #f97316;
  font-weight: 600;
}

.more-version-status.up-to-date {
  color: #22c55e;
  font-weight: 600;
}

.more-modal-update-btn {
  width: 100%;
  padding: 11px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.more-modal-update-btn:hover {
  background: var(--primary-dark);
}

.more-modal-update-btn:active {
  transform: scale(0.98);
}

.more-modal-update-btn:disabled {
  background: var(--border);
  cursor: not-allowed;
  transform: none;
}

/* ===== PWA 앱 설치 버튼 ===== */
.more-modal-install-btn {
  width: 100%;
  padding: 11px 16px;
  background: #1A2744;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.more-modal-install-btn:hover  { background: #2C3E6B; }
.more-modal-install-btn:active { transform: scale(0.98); }

/* iOS 설치 안내 */
.pwa-ios-guide {
  width: 100%;
  background: #EEF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #1E40AF;
  text-align: center;
  line-height: 1.6;
}
.pwa-ios-guide-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.more-modal-app-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

.more-modal-item-external:hover,
.more-modal-item-external:active {
  background: #f8f9fa;
}

.more-modal-icon-youtube {
  background: #fff0f0 !important;
}

.more-modal-icon-naver {
  background: #f0fff5 !important;
}

.more-modal-external-icon {
  font-size: 15px !important;
  color: var(--text-muted);
}

/* ===== 반응형 ===== */
@media (max-width: 360px) {
  .home-welcome-name { font-size: 17px; }
  .app-header-title { font-size: 15px; }
}

/* =============================================
   나의하루 — AI 응원 멘트 + 달력 + 통계 + 차트
   ============================================= */

/* ── AI 응원 멘트 ── */
.myday-cheer-wrap {
  margin: 0 16px 4px;
  background: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 100%);
  border: 1.5px solid #bae6fd;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  animation: mycheerFadeIn 0.5s ease;
}
@keyframes mycheerFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.myday-cheer-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.myday-cheer-robot {
  font-size: 24px;
  flex-shrink: 0;
  animation: cheerBounce 2.2s ease-in-out infinite;
}
@keyframes cheerBounce {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%       { transform: translateY(-5px) rotate(3deg); }
}
.myday-cheer-text {
  font-size: 13px;
  font-weight: 600;
  color: #0c4a6e;
  line-height: 1.55;
  padding-top: 2px;
}

/* ── 섹션 카드 공통 ── */
.myday-section-card {
  margin: 12px 16px 0;
  background: var(--white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-sm);
}
.myday-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.myday-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── 연속 기록 배지 ── */
.myday-streak-badge {
  background: linear-gradient(90deg, #f97316, #ef4444);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}

/* ── 달력 잔디 ── */
.myday-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.myday-cal-header {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  padding: 2px 0 4px;
}
.myday-cal-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 3px 1px;
  border-radius: 6px;
}
.myday-cal-cell.today {
  background: var(--primary-light);
  border: 1px solid var(--primary);
}
.myday-cal-cell.future .myday-cal-day {
  color: #cbd5e1;
}
.myday-cal-cell.empty .myday-cal-day {
  color: var(--text-muted);
}
.myday-cal-day {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

/* 잔디 점 */
.myday-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.myday-dot.full    { background: #10b981; box-shadow: 0 0 4px rgba(16,185,129,0.5); }
.myday-dot.partial { background: #f59e0b; }
.myday-dot.empty   { background: #e2e8f0; }

/* 달력 범례 */
.myday-calendar-legend {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  justify-content: center;
}
.myday-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ── 미니 통계 카드 ── */
.myday-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.myday-mini-stat-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 6px 8px;
  text-align: center;
  border: 1px solid var(--border-light);
}
.myday-mini-stat-icon  { font-size: 18px; margin-bottom: 4px; }
.myday-mini-stat-value {
  font-size: 16px; font-weight: 800;
  color: var(--primary); line-height: 1;
}
.myday-mini-stat-label {
  font-size: 10px; color: var(--text-muted);
  margin-top: 3px; line-height: 1.3;
}
.myday-mini-stat-sub {
  font-size: 10px; color: var(--text-secondary);
  margin-top: 2px;
}

/* ── 주간 차트 섹션 하단 여백 ── */
#myday-chart-wrap {
  margin-bottom: 20px;
}

/* ===== 다운로드 팝업 토스트 ===== */
.download-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 14px 20px;
  min-width: 240px;
  max-width: 320px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  border: 1px solid var(--border-light);
}
.download-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.download-toast-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.download-toast-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}
.download-toast-name {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.download-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 마이페이지 프로필 사진 ===== */
.mypage-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  cursor: pointer;
}
.mypage-avatar-wrap .mypage-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin: 0;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.5);
}
.mypage-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ===== 분석결과 핵심 포인트 ===== */
.result-key-points-wrap {
  background: var(--white);
  border-top: 1px solid var(--border-light);
  padding: 16px;
  margin-top: 12px;
}

.result-key-points-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.result-key-points-icon {
  font-size: 16px;
}

.result-key-points-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.result-key-points-content {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 80px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.result-key-points-content.expanded {
  max-height: 2000px;
}

.result-key-points-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 8px;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.result-key-points-toggle:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--primary);
  color: var(--primary);
}

.result-key-points-toggle:active {
  transform: scale(0.98);
}
