/* ============================================
   PUPIX - Orange Anti-gravity Design System
   ============================================ */

/* [Design Tokens] */
:root {
  --primary-color: #FF8225;
  --primary-light: #FFF5E1;
  --primary-dark: #cc6a1e;
  --accent-color: #E6721E;

  --app-bg: #fffdf9;
  --text-main: #332b26;
  --text-sub: #8c827a;
  --text-light: #b5ada6;

  --shadow-float: 0 20px 40px rgba(255, 130, 37, 0.15);
  --shadow-soft: 0 8px 24px rgba(255, 130, 37, 0.10);
  --shadow-btn: 0 5px 15px rgba(255, 130, 37, 0.15);

  --radius-card: 28px;
  --radius-btn: 20px;
  --radius-input: 16px;

  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.7);

  --nav-height: 70px;
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   [Reset & Base]
   ============================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  /* Prevent body elastic scroll on iOS */
}

body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #e5e5e5;
  display: flex;
  justify-content: center;
  height: 100dvh;
  /* use dvh for mobile browser toolbars */
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   [App Shell]
   ============================================ */
.app-container {
  width: 100%;
  max-width: 420px;
  background: var(--app-bg);
  background-image: radial-gradient(circle at 50% 0%, var(--primary-light), transparent 70%);
  position: relative;
  overflow: hidden;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1;
  min-height: 0;
  /* Crucial for flex child to scroll instead of expand */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 25px 20px;
  padding-bottom: calc(var(--nav-height) + 20px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

/* ============================================
   [Anti-gravity Animations]
   ============================================ */
@keyframes float1 {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }

  100% {
    transform: translateY(0px);
  }
}

@keyframes float2 {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-5px);
  }

  100% {
    transform: translateY(0px);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }

  100% {
    background-position: 200px 0;
  }
}

.floating-1 {
  animation: float1 4s ease-in-out infinite;
}

.floating-2 {
  animation: float2 5s ease-in-out infinite alternate-reverse;
}

.animate-in {
  animation: fadeInUp 0.5s ease-out forwards;
}

/* ============================================
   [Top Bar]
   ============================================ */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.logo-area {
  font-size: 15px;
  font-weight: 900;
  color: var(--accent-color);
  letter-spacing: 0.5px;
}

.lang-toggle {
  background: #fff;
  border: 2px solid var(--primary-color);
  color: var(--accent-color);
  border-radius: var(--radius-btn);
  padding: 6px 14px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: var(--transition-fast);
  font-family: inherit;
}

.lang-toggle:active {
  transform: scale(0.92);
  background: var(--primary-light);
}

/* Back Button */
.back-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 8px;
  border-radius: 12px;
  transition: var(--transition-fast);
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
}

.back-btn:active {
  transform: scale(0.92);
  background: var(--primary-light);
}

.back-btn .back-icon {
  font-size: 20px;
}

/* ============================================
   [Glass Cards]
   ============================================ */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-float);
  padding: 20px;
  margin-bottom: 20px;
}

/* ============================================
   [Typography]
   ============================================ */
h1 {
  font-size: 24px;
  color: var(--text-main);
  margin: 0 0 8px 0;
  font-weight: 800;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 20px;
  color: var(--text-main);
  margin: 0 0 16px 0;
  font-weight: 800;
}

p.subtitle {
  font-size: 14px;
  color: var(--text-sub);
  margin: 0 0 15px 0;
  font-weight: 500;
}

.section-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text-main);
}

.weather-badge {
  display: inline-block;
  background: var(--primary-light);
  padding: 8px 14px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-color);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
}

/* ============================================
   [Quick Actions Grid]
   ============================================ */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 25px;
}

.quick-btn {
  background: #fff;
  border-radius: var(--radius-btn);
  padding: 15px 5px;
  text-align: center;
  box-shadow: var(--shadow-float);
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  font-family: inherit;
}

.quick-btn:active {
  transform: scale(0.92);
  background: var(--primary-light);
  box-shadow: 0 10px 20px rgba(255, 130, 37, 0.2);
}

.quick-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.quick-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
}

/* ============================================
   [Status Tracking]
   ============================================ */
.status-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
}

.status-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-sub);
}

.status-val {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-main);
}

.status-bar-bg {
  width: 100%;
  height: 8px;
  background: #f2ede8;
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}

.status-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--primary-color);
  transition: width 1s ease-out;
}

/* ============================================
   [Schedule]
   ============================================ */
.schedule-item {
  display: flex;
  gap: 15px;
  border-left: 3px solid var(--primary-color);
  padding-left: 15px;
  margin-bottom: 15px;
}

.sched-time {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-color);
  margin-bottom: 4px;
}

.sched-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

/* ============================================
   [Bottom Navigation]
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 1000;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.06);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 16px;
  transition: var(--transition-fast);
  border: none;
  background: none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.nav-item:active {
  transform: scale(0.90);
}

.nav-icon {
  font-size: 22px;
  transition: var(--transition-fast);
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-sub);
  transition: var(--transition-fast);
}

.nav-item.active .nav-icon {
  transform: scale(1.15);
}

.nav-item.active .nav-label {
  color: var(--primary-color);
  font-weight: 800;
}

.nav-item.active {
  background: var(--primary-light);
}

/* ============================================
   [Pages - Common]
   ============================================ */
.page {
  display: none;
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.page.active {
  display: block;
  opacity: 1;
  animation: fadeInUp 0.4s ease-out forwards;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.page-header h2 {
  margin: 0;
}

/* ============================================
   [Walk Live Page]
   ============================================ */

/* walk & walk-summary — 뷰포트 기준 fixed (부모 높이에 무관하게 항상 정확) */
#page-walk.active,
#page-walk-summary.active {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  transform: none !important;
  z-index: 2000 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #f8f6f6 !important;
  overflow: hidden !important;
  animation: none !important;
  opacity: 1 !important;
}

/* 게시물 상세 페이지 — 풀스크린 오버레이 */
#page-post-detail.active {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  z-index: 1500 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #ffffff !important;
  overflow: hidden !important;
}

.post-detail-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.post-detail-comment-input-wrap {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid rgba(242, 108, 13, 0.1);
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

/* 랭킹 페이지 */
#page-ranking.active {
  margin: -25px -20px 0;
}

/* 펫마켓 페이지 */
#page-store.active {
  margin: -25px 0 0;
}

.walk-map-new-area {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.walk-map-new-area #walkMap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ── (구) 산책 헤더/패널 CSS (하위 호환 유지) ── */
.walk-live-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--app-bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.walk-live-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--text-main);
  font-family: inherit;
  transition: var(--transition-fast);
}

.walk-live-back-btn:active {
  background: var(--primary-light);
}

.walk-live-title-wrap {
  flex: 1;
  text-align: center;
}

.walk-live-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  display: block;
}

.walk-gps-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 3px;
}

.walk-gps-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.walk-gps-dot.connecting {
  background: #eab308;
}

.walk-gps-dot.active {
  background: #22c55e;
  animation: pulse 1.5s infinite;
}

.walk-gps-dot.error {
  background: #ef4444;
}

.walk-gps-dot.demo {
  background: #3b82f6;
}

.walk-gps-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
}

/* Map */
.walk-map-wrap {
  position: relative;
  height: 370px;
}

#walkMap {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.walk-map-pet-card {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.walk-map-pet-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.walk-map-pet-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.walk-map-pet-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  margin-top: 2px;
}

/* Stats Panel */
.walk-panel {
  background: var(--app-bg);
  border-radius: 28px 28px 0 0;
  margin-top: -28px;
  position: relative;
  z-index: 20;
  padding: 20px 20px calc(var(--nav-height) + 20px);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.06);
}

.walk-panel-handle {
  width: 40px;
  height: 4px;
  background: #e5e0db;
  border-radius: 2px;
  margin: 0 auto 20px;
}

.walk-panel-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 14px;
}

.walk-panel-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.walk-panel-stat {
  background: #fff;
  border-radius: 18px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.walk-panel-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.walk-panel-stat-value {
  font-size: 20px;
  font-weight: 900;
  color: var(--primary-color);
  line-height: 1.2;
}

.walk-panel-stat-value small {
  font-size: 11px;
  font-weight: 600;
}

.walk-panel-extra {
  background: #fff;
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  box-shadow: var(--shadow-soft);
}

.walk-extra-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.walk-extra-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
}

.walk-extra-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-color);
}

/* Controls */
.walk-panel-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.walk-ctrl-primary {
  flex: 1;
  height: 60px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: #fff;
  border: none;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  box-shadow: 0 8px 25px rgba(255, 130, 37, 0.35);
  transition: var(--transition-fast);
}

.walk-ctrl-primary:active {
  transform: scale(0.96);
}

.walk-ctrl-primary.paused {
  background: linear-gradient(135deg, #64748b, #475569);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.walk-ctrl-stop {
  flex: 1;
  height: 60px;
  border-radius: 20px;
  background: #fff;
  border: 2px solid #f1f0ee;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: inherit;
  box-shadow: var(--shadow-soft);
  transition: var(--transition-fast);
}

.walk-ctrl-stop:active {
  transform: scale(0.92);
}

.walk-ctrl-stop span:first-child {
  font-size: 20px;
  color: #ef4444;
}

.walk-ctrl-stop span:last-child {
  font-size: 10px;
  letter-spacing: 0.05em;
}

/* ============================================
   [Walk Page - Legacy (unused)]
   ============================================ */
.walk-hero {
  text-align: center;
  padding: 30px 0;
}

.walk-timer {
  font-size: 52px;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -2px;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.walk-distance {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 30px;
}

.walk-start-btn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: #fff;
  border: none;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 40px rgba(255, 130, 37, 0.4);
  transition: var(--transition-fast);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.walk-start-btn:active {
  transform: scale(0.92);
}

.walk-start-btn.walking {
  background: linear-gradient(135deg, #ff4444, #cc3333);
  box-shadow: 0 10px 40px rgba(255, 68, 68, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

.walk-start-btn .btn-icon {
  font-size: 32px;
}

.walk-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.walk-stat-card {
  background: #fff;
  border-radius: 20px;
  padding: 16px 10px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.walk-stat-icon {
  font-size: 22px;
  margin-bottom: 6px;
}

.walk-stat-value {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-main);
}

.walk-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
  margin-top: 4px;
}

.walk-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.walk-history-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
}

.walk-history-info {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

/* ============================================
   [Meal Page]
   ============================================ */
.meal-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.meal-summary-card {
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.meal-summary-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.meal-summary-value {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-main);
}

.meal-summary-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  margin-top: 4px;
}

.meal-log-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: #fff;
  border-radius: 18px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-soft);
}

.meal-log-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.meal-log-info {
  flex: 1;
}

.meal-log-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.meal-log-detail {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  margin-top: 2px;
}

.meal-log-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-color);
}

.add-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(255, 130, 37, 0.35);
  transition: var(--transition-fast);
  font-family: inherit;
  margin-top: 10px;
}

.add-btn:active {
  transform: scale(0.96);
}

/* ============================================
   [Health Page]
   ============================================ */
.health-score {
  text-align: center;
  padding: 20px 0;
}

.health-score-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), #fff);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-float);
  margin-bottom: 10px;
}

.health-score-number {
  font-size: 42px;
  font-weight: 900;
  color: var(--primary-color);
  line-height: 1;
}

.health-score-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  margin-top: 4px;
}

.health-score-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-sub);
}

.health-metrics {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.health-metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}

.health-metric-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.health-metric-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.health-metric-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.health-metric-value {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-main);
}

.health-metric-status {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
}

.status-good {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-warning {
  background: #fff3e0;
  color: #e65100;
}

/* ============================================
   [AI Scan Page]
   ============================================ */
.scan-hero {
  text-align: center;
  padding: 30px 0;
}

.scan-camera-area {
  width: 200px;
  height: 200px;
  border-radius: 40px;
  background: linear-gradient(135deg, var(--primary-light), #fff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-float);
  margin-bottom: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 3px dashed rgba(255, 130, 37, 0.3);
}

.scan-camera-area:active {
  transform: scale(0.95);
  border-color: var(--primary-color);
}

.scan-camera-icon {
  font-size: 60px;
}

.scan-instruction {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.scan-sub-instruction {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  margin-bottom: 25px;
}

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

.scan-feature-card {
  background: #fff;
  border-radius: 20px;
  padding: 18px 14px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.scan-feature-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.scan-feature-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}

.scan-feature-desc {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-sub);
  margin-top: 4px;
}

.scan-result {
  display: none;
  animation: fadeInUp 0.5s ease-out forwards;
}

.scan-result.active {
  display: block;
}

.scan-result-header {
  text-align: center;
  margin-bottom: 20px;
}

.scan-result-badge {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 800;
}

.badge-healthy {
  background: #e8f5e9;
  color: #2e7d32;
}

/* ============================================
   [Modal/Overlay]
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  width: 100%;
  max-height: 80vh;
  background: var(--app-bg);
  border-radius: 28px 28px 0 0;
  padding: 30px 20px;
  animation: slideUp 0.3s ease-out;
  overflow-y: auto;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 0 auto 20px;
}

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

.form-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 8px;
  display: block;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #f0ebe6;
  border-radius: var(--radius-input);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-main);
  background: #fff;
  transition: var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 130, 37, 0.15);
}

.form-input::placeholder {
  color: var(--text-light);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238c827a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* ============================================
   [Walk Summary Page]
   ============================================ */

.walk-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid rgba(244, 123, 37, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}

.walk-summary-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
  color: #1e293b;
}

.walk-summary-header-emoji {
  font-size: 20px;
}

.walk-summary-close-btn,
.walk-summary-share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(244, 123, 37, 0.08);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e293b;
  font-family: inherit;
  transition: background 0.15s;
}

.walk-summary-close-btn:active,
.walk-summary-share-btn:active {
  background: rgba(244, 123, 37, 0.2);
}

.walk-summary-scroll {
  background: #f8f7f5;
  flex: 1;
  overflow-y: auto;
}

/* Mini map */
.walk-summary-map-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.walk-summary-map {
  width: 100%;
  height: 200px;
  background: #e8e8e8;
}

.walk-summary-map-badges {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
}

.walk-summary-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Distance card */
.walk-sum-distance-card {
  background: linear-gradient(135deg, #f47b25, #ff9a4d);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.walk-sum-distance-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.85);
}

.walk-sum-distance-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.walk-sum-distance-value span {
  font-size: 48px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.walk-sum-distance-value small {
  font-size: 20px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

/* Stats 2x2 grid */
.walk-sum-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.walk-sum-stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.walk-sum-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.walk-sum-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: #1e293b;
  display: flex;
  align-items: baseline;
  gap: 3px;
}

/* Photo strip */
.walk-sum-photo-add {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 14px;
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.walk-sum-photo-thumb {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.07);
  background: #e2e8f0;
}

.walk-sum-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Community card */
.walk-sum-community-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* ============================================
   [Community - Overlays & Modals]
   ============================================ */

.comm-overlay {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.comm-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.comm-sheet {
  width: 100%;
  max-height: 80vh;
  background: #fffdf9;
  border-radius: 28px 28px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

.comm-sheet-handle {
  width: 40px;
  height: 4px;
  background: #e5e0db;
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.comm-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

/* Comment list */
.comm-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.comm-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
}

/* Comment item */
.comm-comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.comm-comment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.comm-comment-content {
  flex: 1;
  min-width: 0;
}

.comm-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.comm-comment-user {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}

.comm-comment-time {
  font-size: 11px;
  color: var(--text-sub);
}

.comm-comment-text {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.45;
  word-break: break-word;
}

.comm-comment-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.comm-comment-edit-btn,
.comm-comment-delete-btn {
  font-size: 12px;
  font-weight: 700;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  padding: 3px 10px;
  border-radius: 10px;
  transition: var(--transition-fast);
}

.comm-comment-edit-btn {
  color: var(--primary-color);
  background: var(--primary-light);
}

.comm-comment-delete-btn {
  color: #ef4444;
  background: #fef2f2;
}

.comm-comment-edit-btn:active,
.comm-comment-delete-btn:active {
  opacity: 0.7;
}

/* Inline edit textarea */
.comm-comment-edit-input {
  width: 100%;
  border: 1.5px solid var(--primary-color);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fffdf9;
  resize: none;
  margin-top: 4px;
  display: block;
}

.comm-comment-edit-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.comm-save-btn,
.comm-cancel-btn {
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 12px;
  border-radius: 10px;
  transition: var(--transition-fast);
}

.comm-save-btn {
  background: var(--primary-color);
  color: #fff;
}

.comm-cancel-btn {
  background: #f0ede9;
  color: var(--text-sub);
}

/* Comment input bar */
.comm-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  flex-shrink: 0;
}

.comm-input-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.comm-input {
  flex: 1;
  background: #f5f4f2;
  border: none;
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.comm-submit-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.comm-submit-btn:active {
  transform: scale(0.9);
}

/* Create post - top-down slide sheet */
.comm-post-sheet {
  max-height: 92vh !important;
  display: flex;
  flex-direction: column;
  border-radius: 0 0 28px 28px;
  animation: slideFromTop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 게시물 작성 오버레이만 상단 정렬 */
#createPostOverlay.comm-overlay {
  align-items: flex-start;
}

@keyframes slideFromTop {
  from {
    transform: translateY(-100%);
    opacity: 0.5;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.comm-post-sheet .comm-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.comm-post-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.comm-post-textarea-lg {
  width: 100%;
  min-height: 200px;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.6;
  resize: none;
  background: transparent;
  color: var(--text-main);
}

.comm-post-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
}

/* Create post - legacy (keep for compatibility) */
.comm-post-textarea {
  flex: 1;
  width: 100%;
  border: 1.5px solid #f0ebe6;
  border-radius: 16px;
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: none;
  background: #fffdf9;
  transition: var(--transition-fast);
}

.comm-post-textarea:focus {
  border-color: var(--primary-color);
}

/* Post options sheet */
.comm-options-sheet {
  max-height: fit-content;
}

.comm-option-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 20px;
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
}

.comm-option-item:active {
  background: var(--primary-light);
}

.comm-option-item.danger {
  color: #ef4444;
}

/* Search overlay */
.comm-search-overlay {
  align-items: flex-start;
}

.comm-search-box {
  width: 100%;
  background: white;
  padding: 14px 16px 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  animation: slideDown 0.2s ease;
}

.comm-search-results {
  margin-top: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.comm-search-result-item {
  padding: 12px 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}

.comm-search-result-item:last-child {
  border-bottom: none;
}

.comm-search-empty {
  padding: 20px 4px;
  font-size: 14px;
  color: var(--text-sub);
  text-align: center;
}

/* Notification toast */
.comm-notif-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  width: calc(100% - 40px);
  max-width: 380px;
  background: #fff;
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.comm-notif-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }

  to {
    transform: translateY(0);
  }
}

/* Bookmark active state */
.bookmark-btn.bookmarked .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
  color: var(--primary-color);
}

/* ============================================
   [Utility]
   ============================================ */
.mt-10 {
  margin-top: 10px;
}

.mb-20 {
  margin-bottom: 20px;
}

.text-center {
  text-align: center;
}

.text-primary {
  color: var(--primary-color);
}

.text-accent {
  color: var(--accent-color);
}

/* Hide scrollbar but keep functionality */
.app-content::-webkit-scrollbar {
  display: none;
}

.app-content {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Safe area for notch phones */
@supports (padding-top: env(safe-area-inset-top)) {
  .app-content {
    padding-top: calc(25px + env(safe-area-inset-top));
  }

  .bottom-nav {
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  }
}