* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --secondary: #6b7280;
  --background: #f3f4f6;
  --surface: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --error: #ef4444;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 헤더 */
.header {
  text-align: center;
  padding: 40px 0 30px;
}

.logo {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.logo-link {
  text-decoration: none;
}

.logo-link:hover .logo {
  opacity: 0.8;
}

/* 서비스 소개 카드 */
.intro-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.intro-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.intro-text {
  color: #065f46;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
  font-weight: 500;
}

/* 메인 */
.main {
  flex: 1;
}

/* 업로드 영역 */
.upload-section {
  margin-bottom: 20px;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 60px 40px;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.3s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.05);
}

.upload-icon {
  width: 64px;
  height: 64px;
  color: var(--primary);
  margin-bottom: 20px;
}

.drop-text {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.drop-subtext {
  color: var(--text-light);
  margin-bottom: 16px;
}

.file-types {
  font-size: 0.85rem;
  color: var(--secondary);
}

/* 미리보기 */
.preview-section {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.preview-image {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 20px;
}

.preview-actions {
  display: flex;
  gap: 12px;
}

/* 버튼 */
.btn {
  flex: 1;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

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

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

.btn-secondary {
  background: var(--background);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--border);
}

/* 로딩 */
.loading-section {
  text-align: center;
  padding: 80px 20px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.loading-subtext {
  color: var(--text-light);
}

/* 결과 */
.result-section {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.result-header {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.result-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
}

.result-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.result-title h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.result-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--primary);
  color: white;
}

.tag-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.result-details h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text-light);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.detail-item {
  background: var(--background);
  padding: 16px;
  border-radius: 12px;
}

.detail-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

.detail-value {
  font-weight: 600;
  font-size: 1rem;
}

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

/* 가이드 섹션 */
.guide-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.guide-section:last-of-type {
  border-bottom: none;
  margin-bottom: 20px;
}

.guide-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

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

.section-header h3 {
  margin-bottom: 0;
}

.bin-info {
  display: flex;
  gap: 8px;
}

.bin-type {
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
}

.bin-color {
  background: var(--background);
  color: var(--text);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
}

/* 단계 리스트 */
.steps-list {
  list-style: none;
  counter-reset: step;
}

.steps-list li {
  position: relative;
  padding-left: 40px;
  padding-bottom: 16px;
  border-left: 2px solid var(--border);
  margin-left: 12px;
}

.steps-list li:last-child {
  padding-bottom: 0;
  border-left: 2px solid transparent;
}

.steps-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -13px;
  top: 0;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 팁 리스트 */
.tips-list {
  list-style: none;
}

.tips-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 12px;
  color: var(--text);
}

.tips-list li:last-child {
  margin-bottom: 0;
}

.tips-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 600;
}

/* 주의사항 */
.warnings-section {
  background: #fef3c7;
  margin-left: -24px;
  margin-right: -24px;
  padding: 20px 24px;
  border-radius: 0;
  border-bottom: none;
}

.warnings-section h3 {
  color: #92400e;
}

.warnings-list {
  list-style: none;
}

.warnings-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
  color: #92400e;
}

.warnings-list li:last-child {
  margin-bottom: 0;
}

.warnings-list li::before {
  content: "!";
  position: absolute;
  left: 0;
  width: 18px;
  height: 18px;
  background: #f59e0b;
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 환경 영향 */
.env-section {
  background: #ecfdf5;
  margin-left: -24px;
  margin-right: -24px;
  padding: 20px 24px;
  border-radius: 0;
}

.env-section h3 {
  color: #065f46;
}

.env-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.env-item {
  background: white;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
}

.env-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 8px;
  color: var(--primary);
}

.env-icon svg {
  width: 100%;
  height: 100%;
}

.env-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

.env-value {
  font-weight: 600;
  color: var(--primary-dark);
}

.recycled-into {
  background: white;
  padding: 16px;
  border-radius: 12px;
}

.recycled-products {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.recycled-products span {
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
}

/* 친환경 대안 */
.alternatives-section {
  background: #eff6ff;
  margin-left: -24px;
  margin-right: -24px;
  padding: 20px 24px;
  border-radius: 0 0 16px 16px;
  margin-bottom: 0 !important;
}

.alternatives-section h3 {
  color: #1e40af;
}

.alternatives-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alternative-item {
  background: white;
  padding: 16px;
  border-radius: 12px;
}

.alternative-item strong {
  display: block;
  color: #1e40af;
  margin-bottom: 4px;
}

.alternative-item p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 0;
}

/* 에러 */
.error-section {
  text-align: center;
  padding: 60px 20px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.error-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #fef2f2;
  color: var(--error);
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.error-message {
  color: var(--error);
  margin-bottom: 24px;
}

/* 푸터 */
.footer {
  text-align: center;
  padding: 30px 0 20px;
  color: var(--text-light);
  font-size: 0.85rem;
}

/* 유틸리티 */
.hidden {
  display: none !important;
}

/* 관리자 버튼 */
.btn-admin {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.btn-admin:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* 헤더 상단 */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.auth-buttons,
.user-menu {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-sm {
  flex: none;
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-icon {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.btn-full {
  flex: none;
  width: 100%;
}

/* 모달 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}

.modal-large {
  max-width: 500px;
}

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

.modal-header h2 {
  font-size: 1.3rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

.modal-footer-text {
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.modal-footer-text a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

/* 폼 */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-error {
  color: var(--error);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

/* 탭 메뉴 */
.tab-menu {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: var(--background);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

.tab-content {
  display: block;
}

.tab-content.hidden {
  display: none !important;
}

/* 프로필 헤더 */
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
}

.profile-info h3 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.profile-info p {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* 통계 그리드 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--background);
  padding: 16px;
  border-radius: 12px;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* 카테고리 차트 */
.category-stats h4 {
  font-size: 1rem;
  margin-bottom: 16px;
}

.category-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-bar-label {
  width: 80px;
  font-size: 0.85rem;
  color: var(--text);
}

.category-bar-track {
  flex: 1;
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.category-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s;
}

.category-bar-value {
  width: 40px;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 500;
}

/* 활동 내역 */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--background);
  border-radius: 12px;
}

.history-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.history-item-content {
  flex: 1;
}

.history-item-title {
  font-weight: 500;
  margin-bottom: 4px;
}

.history-item-meta {
  font-size: 0.8rem;
  color: var(--text-light);
  display: flex;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

/* 페이지네이션 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

#page-info {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* 배지 리스트 */
.badges-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.badge-item {
  padding: 16px;
  background: var(--background);
  border-radius: 12px;
  text-align: center;
  transition: all 0.2s;
}

.badge-item.earned {
  background: #ecfdf5;
  border: 2px solid var(--primary);
}

.badge-item.locked {
  opacity: 0.5;
}

.badge-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.badge-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.badge-desc {
  font-size: 0.75rem;
  color: var(--text-light);
}

.badge-date {
  font-size: 0.7rem;
  color: var(--primary);
  margin-top: 8px;
}

/* 반응형 */
@media (max-width: 480px) {
  .header {
    padding: 30px 0 20px;
  }

  .header-top {
    flex-wrap: wrap;
    gap: 8px;
  }

  .logo {
    font-size: 2rem;
  }

  .drop-zone {
    padding: 40px 20px;
  }

  .result-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .result-image {
    width: 120px;
    height: 120px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .badges-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== 대시보드 ==================== */
.dashboard {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* 팁 배너 (상단) */
.tip-banner {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: white;
}

.tip-banner-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.tip-banner p {
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
}

/* 가이드 & 사용량 바 */
.info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

/* 사용량 표시 */
.usage-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-light);
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.usage-info strong {
  color: var(--primary);
  font-weight: 700;
}

.usage-info.warning strong {
  color: #f59e0b;
}

.usage-info.exhausted {
  background: #fef2f2;
  color: #991b1b;
}

.usage-info.exhausted strong {
  color: #dc2626;
}

.usage-icon {
  font-size: 1rem;
}

/* 가이드 버튼 */
.btn-guide {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 20px;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.btn-guide:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-guide svg {
  flex-shrink: 0;
}

/* 가이드 모달 */
.guide-modal {
  max-width: 600px;
}

.guide-content {
  padding: 0;
}

.guide-step {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--background);
  border-radius: 12px;
}

.guide-step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.guide-step-info {
  flex: 1;
}

.guide-step-info h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text);
}

.guide-step-info p {
  color: var(--text-light);
  margin-bottom: 16px;
  line-height: 1.6;
}

.guide-image {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.guide-divider {
  display: flex;
  justify-content: center;
  margin: 16px 0;
  color: var(--primary);
}

.guide-tips {
  background: #ecfdf5;
  border-left: 4px solid var(--primary);
  padding: 20px;
  border-radius: 0 12px 12px 0;
  margin-bottom: 24px;
}

.guide-tips h4 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: #065f46;
}

.guide-tips ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guide-tips li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  color: #065f46;
  line-height: 1.6;
}

.guide-tips li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

/* 모바일 가이드 최적화 */
@media (max-width: 480px) {
  .guide-step {
    flex-direction: column;
    text-align: center;
  }

  .guide-step-number {
    margin: 0 auto;
  }

  .btn-guide {
    font-size: 0.85rem;
    padding: 8px 16px;
  }
}

/* 환경 통계 한 줄 */
.env-stats-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.env-stat-mini {
  flex: 1;
  background: var(--surface);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}

.stat-mini-icon {
  font-size: 1.2rem;
}

.stat-mini-text {
  font-size: 0.8rem;
  color: var(--text-light);
}

.stat-mini-text strong {
  color: var(--primary);
  font-weight: 700;
}

/* 퀵 가이드 */
.quick-guide {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.quick-guide h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text);
}

.guide-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.guide-chip {
  background: var(--background);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.guide-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.guide-chip.active {
  background: var(--primary);
  color: white;
}

.chip-icon {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.chip-label {
  font-size: 0.8rem;
  font-weight: 500;
}

.chip-color {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.chip-color.blue { background: #3b82f6; }
.chip-color.green { background: #22c55e; }
.chip-color.gray { background: #6b7280; }
.chip-color.yellow { background: #eab308; }
.chip-color.purple { background: #8b5cf6; }
.chip-color.white { background: #d1d5db; }

/* 가이드 상세 */
.guide-detail {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.guide-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.guide-detail-header h4 {
  font-size: 1.1rem;
  color: var(--text);
  margin: 0;
}

.guide-detail-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.guide-detail-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guide-detail-content li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  color: var(--text);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.guide-detail-content li:last-child {
  border-bottom: none;
}

.guide-detail-content li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 600;
}

/* 환경 뉴스 */
.eco-news {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.eco-news h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text);
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--background);
  border-radius: 10px;
}

.news-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #e0e7ff;
  color: #4338ca;
}

.news-badge.new {
  background: #fef3c7;
  color: #b45309;
}

.news-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
}

/* 컴팩트 뉴스 */
.eco-news.compact {
  padding: 16px;
}

.eco-news.compact h3 {
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.eco-news.compact .news-item {
  padding: 10px;
}

.eco-news.compact .news-item p {
  font-size: 0.8rem;
}

/* 관리자 모달 */
.admin-panel {
  padding: 20px 0;
}

.admin-section {
  margin-bottom: 24px;
}

.admin-section h4 {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-stats-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.admin-stat {
  background: var(--background);
  padding: 16px;
  border-radius: 12px;
  text-align: center;
}

.admin-stat-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}

.admin-stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
}

.admin-badges-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.admin-badge {
  background: var(--background);
  padding: 12px 8px;
  border-radius: 10px;
  text-align: center;
}

.admin-badge.earned {
  background: #ecfdf5;
  border: 2px solid var(--primary);
}

.admin-badge-icon {
  font-size: 1.5rem;
}

.admin-badge-name {
  font-size: 0.65rem;
  color: var(--text-light);
  margin-top: 4px;
  display: block;
}

.admin-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--background);
  border-radius: 10px;
  margin-bottom: 8px;
}

.admin-history-icon {
  font-size: 1.5rem;
}

.admin-history-info {
  flex: 1;
}

.admin-history-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.admin-history-meta {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* 반응형 - 대시보드 */
@media (max-width: 480px) {
  .intro-card {
    padding: 16px 20px;
  }

  .intro-icon {
    font-size: 1.5rem;
  }

  .intro-text {
    font-size: 0.9rem;
  }

  .info-bar {
    flex-direction: column;
    gap: 12px;
  }

  .btn-guide,
  .usage-info {
    width: 100%;
    justify-content: center;
  }

  .env-stats-row {
    flex-direction: column;
  }

  .guide-chips {
    grid-template-columns: repeat(2, 1fr);
  }

  .tip-banner {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .admin-badges-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================
   한국어 텍스트 줄바꿈 최적화
   ========================================== */
body,
p,
h1, h2, h3, h4, h5, h6,
li,
span,
.intro-text,
.drop-text,
.drop-subtext,
.tip-banner p,
.steps-list li,
.tips-list li,
.warnings-list li,
.result-title h2,
.guide-section h3,
.env-label,
.env-value {
  word-break: keep-all;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* ==========================================
   카메라/갤러리 선택 모달
   ========================================== */
.upload-choice-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.upload-choice-modal.hidden {
  display: none;
}

.upload-choice-content {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  box-shadow: var(--shadow);
}

.upload-choice-content h3 {
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: var(--text);
}

.upload-choice-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.upload-choice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  color: var(--text);
}

.upload-choice-btn:hover {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.05);
}

.upload-choice-btn:active {
  transform: scale(0.98);
}

.upload-choice-btn svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.upload-choice-btn span {
  font-weight: 500;
}

/* 모바일에서 더 큰 터치 영역 */
@media (max-width: 480px) {
  .upload-choice-btn {
    padding: 18px 20px;
  }

  .upload-choice-btn svg {
    width: 32px;
    height: 32px;
  }
}

/* ==========================================
   AI 면책 문구
   ========================================== */
.ai-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  margin-bottom: 16px;
}

.ai-disclaimer .disclaimer-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.ai-disclaimer p {
  font-size: 0.85rem;
  color: #92400e;
  line-height: 1.5;
  margin: 0;
}

/* ==========================================
   푸터 스타일 개선
   ========================================== */
.footer {
  text-align: center;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer .copyright {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ==========================================
   텍스트 검색 섹션
   ========================================== */
.text-search-section {
  margin-top: 24px;
  margin-bottom: 24px;
}

.text-search-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin-bottom: 16px;
}

.text-search-divider::before,
.text-search-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.text-search-divider span {
  padding: 0 16px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.text-search-box {
  display: flex;
  gap: 12px;
  background: var(--surface);
  padding: 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.text-search-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.text-search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.text-search-input::placeholder {
  color: var(--text-light);
  font-size: 0.9rem;
}

.text-search-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 8px;
}

/* 모바일 텍스트 검색 */
@media (max-width: 480px) {
  .text-search-box {
    flex-direction: column;
  }

  .text-search-input {
    width: 100%;
  }

  .text-search-input::placeholder {
    font-size: 0.85rem;
  }
}

/* ==========================================
   광고 컨테이너
   ========================================== */
.ad-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 24px 0;
  padding: 16px;
  background: var(--background);
  border-radius: 8px;
  min-height: 100px;
}

.ad-slot-1 {
  margin-top: 20px;
}

.ad-slot-2 {
  margin-top: 24px;
}

.ad-slot-3 {
  margin-top: 24px;
  margin-bottom: 8px;
}

/* 광고 플레이스홀더 (개발용) */
.ad-placeholder {
  color: var(--text-light);
  font-size: 0.85rem;
  padding: 20px 40px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: var(--surface);
}

/* 모바일 광고 크기 조정 */
@media (max-width: 480px) {
  .ad-container {
    padding: 12px;
    min-height: 80px;
  }
}
