/* Dashboard Panel Styles */
.dashboard-panel {
  padding: 0; /* 좌우 padding 제거 - 부모(main-v2-main-content)의 padding 사용 */
  width: 100%;
  box-sizing: border-box; /* padding을 포함한 너비 계산 */
  animation: fadeIn 0.3s ease;
  /* scrollbar-gutter 제거: 스크롤 필요할 때만 스크롤바 표시 */
}

/* Personal Insight Section */
.personal-insight-section {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
  border-radius: 16px;
  padding: 10px; /* 내부 패딩 추가 */
  width: 100%;
  box-sizing: border-box; /* padding을 포함한 너비 계산 */
  box-shadow: var(--shadow-lg);
}

.greeting-header {
  margin-bottom: 20px; /* 구분선 위 여백 — 아래는 .personal-insight-divider가 담당 */
  text-align: center;
}

.greeting-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--brand-color, #E4B34A);
  margin: 0 0 8px 0;
  animation: typing 1s ease;
}

.greeting-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin: 0;
}

/* 인사말·섹션 간 구분선 */
.personal-insight-divider {
  border: none;
  height: 1px;
  margin: 0 0 28px 0;
  width: 100%;
  background: var(--border-primary);
  opacity: 0.65;
}

/* 구분선 바로 다음 배틀 헤더는 기본 section-header 상단 마진과 겹치지 않도록 */
.personal-insight-divider + .battle-section .section-header {
  margin-top: 0;
}

.personal-insight-divider + .my-analyses-section .section-header {
  margin-top: 0;
}

/* 재생 통계 블록 위쪽은 구분선 여백으로 충분 — emotion 섹션 기본 margin-top과 이중 여백 방지 */
.personal-insight-divider + .emotion-stats-section {
  margin-top: 0;
}

/* Track Cards Grid */
.track-cards-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}

/* Track Card */
.track-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.track-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.track-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.new-feedback-badge {
  background: #e74c3c;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Cover Block */
.track-summary {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.cover-block {
  flex: 0 0 30%;
  max-width: 30%;
  width: 30%;
  min-width: 120px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.track-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.track-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.track-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: var(--text-secondary);
}

/* Creator Note */
.creator-note {
  background: var(--bg-tertiary);
  border-left: 4px solid var(--accent-primary);
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 4px;
  position: relative;
}

.creator-note.clickable,
.creator-note-placeholder.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.creator-note.clickable:hover {
  background: var(--bg-hover);
  border-left-color: var(--accent-hover);
}

.creator-note-placeholder {
  border: 2px dashed var(--border-secondary);
  padding: 16px;
  text-align: center;
  color: var(--text-secondary);
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 600;
}

.creator-note-placeholder:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.creator-note-label {
  font-weight: 600;
  color: var(--accent-primary);
  display: block;
  margin-bottom: 4px;
}

.creator-note-text {
  color: var(--text-secondary);
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.creator-note-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1;
}

.creator-note:hover .creator-note-delete-btn {
  opacity: 1;
}

.creator-note-delete-btn:hover {
  background: var(--bg-danger, #dc3545);
  color: white;
}

.creator-note-delete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.creator-note-delete-btn:disabled:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* Unified Feedback Stack */
.feedback-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.feedback-item {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 16px;
}

.feedback-ai {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-left: 4px solid #667eea;
}

.feedback-human {
  border-left: 4px solid var(--accent-primary);
}

.feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.feedback-source {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #667eea;
}

.ai-icon {
  stroke: #667eea;
  width: 16px;
  height: 16px;
}

.feedback-length {
  font-size: 12px;
  color: var(--text-secondary);
}

.reviewer-info {
  flex: 1;
}

.reviewer-name {
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 4px;
}

.reviewer-title {
  font-size: 13px;
  color: var(--text-secondary);
  display: block;
}

.feedback-excerpt {
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0 0 12px 0;
}

.read-full-btn {
  padding: 6px 12px;
  background: transparent;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.read-full-btn:hover {
  background: var(--accent-primary);
  color: white;
}

/* CTA Buttons */
.cta-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.cta-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
  border: none;
  font-size: 14px;
  cursor: pointer;
}

.cta-btn-primary {
  background: var(--accent-primary);
  color: white;
}

.cta-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.cta-btn-secondary {
  background: transparent;
  color: var(--accent-primary);
  border: 2px solid var(--accent-primary);
}

.cta-btn-secondary:hover {
  background: var(--accent-primary);
  color: white;
}

/* CTA Soft-disabled + CSS Tooltip */
.cta-btn.cta-inactive {
  background: #2A2A2A;
  color: var(--text-secondary);
  opacity: 0.7;
  cursor: not-allowed;
  position: relative;
}

.cta-btn.cta-inactive:hover {
  transform: none;
  box-shadow: none;
}

.cta-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.cta-btn[data-tooltip]:hover::after {
  opacity: 1;
}

/* View All Button */
.view-all-btn {
  display: block;
  margin: 24px auto 0;
  padding: 12px 32px;
  background: transparent;
  color: var(--accent-primary);
  border: 2px solid var(--accent-primary);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-all-btn:hover {
  background: var(--accent-primary);
  color: white;
}

/* No Track Message */
.no-track-message {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  grid-column: 1 / -1; /* 전체 grid 열을 차지 */
}

.no-track-message p {
  font-size: 18px;
  margin: 0;
  line-height: 1.5;
  max-width: 800px; /* 더 넓은 최대 너비 */
  width: 100%;
}

.no-track-message .cta-btn {
  min-width: 200px;
}

/* Dashboard Error */
.dashboard-error {
  padding: 40px;
  text-align: center;
  color: var(--text-error, #e74c3c);
}

.dashboard-error p {
  font-size: 18px;
  margin-bottom: 8px;
}

.dashboard-error small {
  color: var(--text-secondary);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typing {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Section Titles — 인사말과 동일 색, 크기는 한 단계 작게 */
.section-title,
.dashboard-section-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--brand-color, #e4b34a);
  margin: 0;
}

/* Section Header - 제목과 더보기 링크 인라인 배치 */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 32px 0 16px 0;
}

.section-header:first-of-type {
  margin-top: 0;
}

.section-see-all {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-see-all:hover {
  color: var(--accent-primary);
}

.section-see-all::after {
  content: '→';
  font-size: 12px;
}

/* Recent Uploads Section */
.recent-uploads-section {
  margin-bottom: 40px;
}

/* 기존 그리드 스타일 유지 (하위 호환) */
.recent-uploads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: 14px;
}

/* 새로운 캐러셀 스타일 */
.recent-uploads-carousel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
  margin: 0 -4px;
  padding-left: 4px;
  padding-right: 4px;
}

.recent-uploads-carousel::-webkit-scrollbar {
  height: 6px;
}

.recent-uploads-carousel::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

.recent-uploads-carousel::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 3px;
}

.recent-uploads-carousel::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

.recent-uploads-carousel .recent-upload-card {
  flex: 0 0 154px;
  scroll-snap-align: start;
}

.recent-upload-card {
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.recent-upload-card:hover {
  /* transform 제거: 크기와 위치 변화 없음 */
  transform: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); /* 강조용 그림자만 적용 */
}

.upload-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 2px solid transparent;
  transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.recent-upload-card:hover .upload-card-cover {
  border-color: var(--accent-primary, #3498db);
}

.recent-upload-card:hover .upload-card-cover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.15) 100%);
  pointer-events: none;
  z-index: 1;
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.recent-upload-card:hover .upload-cover-image {
  filter: brightness(1.1) contrast(1.05);
}

.upload-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.upload-card-cover .play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.upload-card-cover:hover .play-btn {
  opacity: 1;
}

.upload-card-info {
  padding: 11px;
}

.upload-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 3px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-card-artist {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 6px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-card-meta {
  font-size: 10px;
  color: var(--text-secondary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.upload-card-date {
  color: var(--text-tertiary);
}

/* Battle Section */
.battle-section {
  margin-bottom: 40px;
}

.battles-container {
  display: flex;
  flex-direction: column;
  gap: 17px;
  margin-top: 20px;
}

.battle-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 17px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.battle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.battle-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.battle-time-remaining {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 500;
}

.battle-tracks {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}

.battle-track {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.battle-track-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.battle-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.battle-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.battle-track-cover .play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.battle-track-cover:hover .play-btn {
  opacity: 1;
}

.battle-track-info {
  text-align: center;
}

.battle-track-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 3px 0;
}

.battle-track-artist {
  font-size: 10px;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
}

.vote-btn {
  padding: 7px 14px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.vote-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.vote-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.battle-vote-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.vote-count {
  font-size: 10px;
  color: var(--text-secondary);
}

.vote-percentage {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-primary);
}

.battle-vote-hint {
  font-size: 8px;
  color: var(--text-secondary);
  text-align: center;
}

.battle-vs-divider {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
}

/* My Analyses Section */
.my-analyses-section {
  margin-bottom: 40px;
}

.analyses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.analysis-card {
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.analysis-card:hover {
  /* transform 제거 */
  transform: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.analysis-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 2px solid transparent;
  transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.analysis-card:hover .analysis-card-cover {
  border-color: var(--accent-primary, #3498db);
}

.analysis-card:hover .analysis-card-cover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.15) 100%);
  pointer-events: none;
  z-index: 1;
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.analysis-cover-clickable {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.analysis-cover-clickable:hover {
  opacity: 0.9;
}

.analysis-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.analysis-card:hover .analysis-cover-image {
  filter: brightness(1.1) contrast(1.05);
}

.analysis-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.analysis-card-info {
  padding: 11px;
}

.analysis-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 3px 0;
}

.analysis-card-artist {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
}

.analysis-creator-note {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.analysis-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.review-btn,
.ai-btn {
  padding: 8px 16px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 100px;
}

.review-btn:hover,
.ai-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* Section Footer */
.section-footer {
  margin-top: 20px;
  text-align: center;
}

.see-all-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.see-all-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state p {
  margin: 0;
  font-size: 16px;
}

/* Responsive */

/* Tablet (769-1023px): 2 columns */
@media (min-width: 769px) and (max-width: 1023px) {
  .track-cards-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .no-track-message {
    padding: 36px 30px;
    grid-column: 1 / -1; /* 전체 grid 열을 차지 */
  }

  .no-track-message p {
    font-size: 17px;
    max-width: 100%;
    width: 100%;
    padding: 0 20px;
  }

  .no-track-message .cta-btn {
    min-width: 190px;
  }
}

/* Large screens (1024px and above) */
@media (min-width: 1024px) {
  .no-track-message {
    padding: 50px 40px;
    grid-column: 1 / -1; /* 전체 grid 열을 차지 */
  }

  .no-track-message p {
    max-width: 900px;
    width: 100%;
    font-size: 20px;
  }

  .no-track-message .cta-btn {
    min-width: 220px;
    font-size: 16px;
    padding: 14px 28px;
  }
}

/* Responsive: Recent Uploads, Battles, Analyses */
/* Tablet (769px - 1023px): 약간 작게 */
@media (min-width: 769px) and (max-width: 1023px) {
  .recent-uploads-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .analyses-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
}

/* Mobile (481px - 768px): 중간 크기 */
@media (max-width: 768px) {
  .recent-uploads-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }

  /* 캐러셀 카드 크기 축소 */
  .recent-uploads-carousel .recent-upload-card {
    flex: 0 0 140px;
  }

  .section-header {
    margin: 24px 0 12px 0;
  }

  .section-title,
  .dashboard-section-title {
    font-size: 18px;
  }

  .battle-tracks {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .battle-vs-divider {
    order: -1;
    margin: 0;
  }

  .analyses-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }
}

/* Mobile Mini (481-768px): 2 columns with stacked layout */
@media (min-width: 481px) and (max-width: 768px) {
  .dashboard-panel {
    padding: 0; /* 좌우 padding 제거 - 부모의 padding 사용 */
  }

  .personal-insight-section {
    padding: 10px; /* 내부 패딩 유지 */
  }

  .greeting-title {
    font-size: 20px;
  }

  .section-title,
  .dashboard-section-title {
    font-size: 18px;
  }

  .greeting-header {
    margin-bottom: 16px;
  }

  .personal-insight-divider {
    margin-bottom: 22px;
  }

  .track-cards-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
  }

  .track-card {
    padding: 12px;
  }

  /* Stack image on top of text */
  .track-summary {
    flex-direction: column;
    gap: 12px;
  }

  .cover-block {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: auto;
  }

  .track-main {
    width: 100%;
  }

  .track-title {
    font-size: 16px;
  }

  .cta-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .cta-btn {
    width: 100%;
    text-align: center;
    padding: 8px 16px;
    font-size: 13px;
  }

  .no-track-message {
    padding: 32px 20px;
    gap: 16px;
    grid-column: 1 / -1; /* 전체 grid 열을 차지 */
  }

  .no-track-message p {
    font-size: 16px;
    max-width: 100%;
    width: 100%;
    padding: 0 10px;
  }

  .no-track-message .cta-btn {
    min-width: 180px;
    width: auto;
    max-width: 100%;
  }
}

/* Mobile Drawer (≤480px): 1 column */
@media (max-width: 576px) {
  .dashboard-panel {
    padding: 0; /* 좌우 padding 제거 - 부모의 padding 사용 */
  }

  .personal-insight-section {
    padding: 10px; /* 내부 패딩 유지 */
  }

  .greeting-title {
    font-size: 20px;
  }

  .section-header {
    margin: 20px 0 10px 0;
  }

  .section-title,
  .dashboard-section-title {
    font-size: 18px;
  }

  .section-see-all {
    font-size: 13px;
  }

  .recent-uploads-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }

  /* 캐러셀 카드 크기 더 축소 */
  .recent-uploads-carousel {
    gap: 10px;
  }

  .recent-uploads-carousel .recent-upload-card {
    flex: 0 0 130px;
  }

  .analyses-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }

  .track-cards-container {
    grid-template-columns: 1fr;
  }

  .track-card {
    padding: 16px;
  }

  .track-summary {
    flex-direction: column;
    gap: 16px;
  }

  .cover-block {
    width: 100%;
    max-width: 100%;
  }

  .track-title {
    font-size: 20px;
  }

  .cta-buttons {
    flex-direction: column;
  }

  .cta-btn {
    width: 100%;
    text-align: center;
  }

  .no-track-message {
    padding: 24px 16px;
    gap: 16px;
    grid-column: 1 / -1; /* 전체 grid 열을 차지 */
  }

  .no-track-message p {
    font-size: 14px;
    line-height: 1.6;
    max-width: 100%;
    width: 100%;
    padding: 0 8px;
    word-break: keep-all;
  }

  .no-track-message .cta-btn {
    width: 100%;
    max-width: 280px;
    padding: 12px 20px;
    font-size: 14px;
    min-width: auto;
  }
}

/* 감정 통계 블록: 하단 고정 플레이어 위로 스크롤 시 요약이 보이도록 (main-v2 --main-content-bottom-pad와 정렬) */
.emotion-stats-section {
  /* 재생 통계 카드(.play-stats-card)와 Emotion Tags 제목 사이 간격 */
  margin-top: 28px;
  margin-bottom: 8px;
  scroll-margin-bottom: var(
    --main-content-bottom-pad,
    calc(var(--player-h) + 32px + env(safe-area-inset-bottom, 0px))
  );
}

/* 대시보드 공통 카드 표면 (재생 통계·감정 차트) */
.play-stats-section .play-stats-card,
.emotion-chart-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

.emotion-chart-card {
  margin-top: 12px;
}

.emotion-chart-card #emotion-chart-container {
  position: relative;
  height: 250px;
  width: 100%;
}

.emotion-stats-summary {
  margin-top: 12px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

.play-stats-total {
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.play-stats-total:last-child {
  margin-bottom: 0;
}

.play-stats-subsection {
  margin-top: 16px;
}

.play-stats-total + .play-stats-empty {
  margin-top: 12px;
}

.play-stats-subtitle {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--accent-primary, #f1c40f);
}

.play-stats-list {
  margin: 0;
}

.play-stats-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-primary);
  font-size: 14px;
  color: var(--text-primary);
}

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

.play-stats-item span:first-child {
  min-width: 0;
  word-break: break-word;
}

.play-stats-count {
  color: var(--text-tertiary);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.play-stats-empty,
.play-stats-message {
  margin: 0;
  color: var(--text-tertiary);
  font-style: italic;
  font-size: 14px;
}
