:root {
  /* Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-page: #eef2ff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-deeper: #1e40af;
  --accent-bg: #eff6ff;
  --accent-border: #93c5fd;
  --green: #22c55e;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;
  --red: #dc2626;
  --red-bg: #fef2f2;

  /* Spacing (4px scale) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-base: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 20px;
  --radius-full: 50%;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.08);
  --card-hover: 0 4px 16px rgba(0,0,0,0.05);

  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.85rem;
  --text-base: 0.95rem;
  --text-lg: 1.1rem;
  --text-xl: 1.3rem;

  /* Layout */
  --nav-bg: rgba(255,255,255,0.92);
  --nav-border: #e2e8f0;
  --modal-overlay: rgba(15, 23, 42, 0.5);
}

[data-theme="dark"] {
  --bg-primary: #1e1e2e;
  --bg-secondary: #262637;
  --bg-tertiary: #2e2e42;
  --bg-page: #13131d;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #3b3b54;
  --border-light: #2e2e42;
  --accent: #60a5fa;
  --accent-dark: #3b82f6;
  --accent-deeper: #2563eb;
  --accent-bg: rgba(59,130,246,0.12);
  --accent-border: rgba(96,165,250,0.3);
  --green: #4ade80;
  --green-bg: rgba(74,222,128,0.1);
  --green-border: rgba(74,222,128,0.25);
  --red: #f87171;
  --red-bg: rgba(248,113,113,0.1);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.3);
  --card-hover: 0 4px 16px rgba(0,0,0,0.2);
  --nav-bg: rgba(30,30,46,0.95);
  --nav-border: #3b3b54;
  --modal-overlay: rgba(0, 0, 0, 0.7);
}

* { margin: 0; padding: 0; box-sizing: border-box; touch-action: pan-x pan-y; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-primary);
  box-shadow: 0 0 40px rgba(30, 64, 175, 0.08);
  animation: appFadeIn 0.6s ease;
  padding-bottom: 80px;
}
@keyframes appFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
.header {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
  color: #fff;
  padding: var(--space-lg) 20px 28px;
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .header {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a2744 50%, #162032 100%);
}
.header::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(255,255,255,0.1) 0%, transparent 60%);
  animation: headerShimmer 8s ease-in-out infinite alternate;
}
@keyframes headerShimmer {
  0% { transform: translate(0, 0); }
  100% { transform: translate(10%, 5%); }
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.header-info {
  flex: 1;
}
.header h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.header .date {
  font-size: 0.82rem;
  opacity: 0.8;
  margin-top: 4px;
  font-weight: 400;
}

/* Header bottom row */
.header-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  position: relative;
}

/* Dark mode toggle */
.dark-toggle {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}
.dark-toggle:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

/* Progress Ring in Header */
.header-progress {
  display: flex;
  align-items: center;
  gap: var(--space-base);
  flex: 1;
  position: relative;
}
.progress-ring-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}
.progress-ring-wrap svg {
  transform: rotate(-90deg);
}
.progress-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.2);
  stroke-width: 5;
}
.progress-ring-bar {
  fill: none;
  stroke: #fff;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-ring-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
}
.progress-detail {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
}
.progress-detail strong {
  color: #fff;
  font-weight: 700;
}

/* Update Banner */
.update-banner {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  text-align: center;
  padding: 14px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 49;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 -2px 12px rgba(37, 99, 235, 0.3);
  animation: updateSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes updateSlideUp {
  from { transform: translateX(-50%) translateY(100%); }
  to { transform: translateX(-50%) translateY(0); }
}
.update-banner:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}
[data-theme="dark"] .update-banner {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--nav-border);
  display: flex;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1;
  padding: 10px 0 8px;
  text-align: center;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.nav-item .nav-icon {
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.3s;
}
.nav-item .nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.nav-item.active {
  color: var(--accent);
}
.nav-item.active .nav-icon {
  transform: scale(1.15);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
}

/* Tab content */
.tab-content {
  display: none;
  padding: 20px var(--space-base);
  animation: tabFadeIn 0.4s ease;
}
.tab-content.active { display: block; }
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Today tab - Empty State */
.today-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
  animation: fadeInUp 0.5s ease;
}
.today-empty .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: block;
  animation: emptyBounce 2s ease-in-out infinite;
}
@keyframes emptyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.today-empty .empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.today-empty .empty-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Completion celebration */
.completion-banner {
  text-align: center;
  padding: 28px 20px;
  background: linear-gradient(135deg, var(--green-bg), #dcfce7);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  border: 1px solid var(--green-border);
  animation: celebrateIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
[data-theme="dark"] .completion-banner {
  background: linear-gradient(135deg, rgba(74,222,128,0.08), rgba(74,222,128,0.15));
}
@keyframes celebrateIn {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}
.completion-banner .celebrate-icon {
  font-size: 2.8rem;
  display: block;
  margin-bottom: 10px;
  animation: celebrateBounce 1s ease-in-out infinite;
}
@keyframes celebrateBounce {
  0% { transform: scale(1) rotateY(0deg); }
  50% { transform: scale(1.1) rotateY(180deg); }
  100% { transform: scale(1) rotateY(360deg); }
}
.completion-banner .celebrate-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 4px;
}
.completion-banner .celebrate-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Care Message */
.care-message {
  text-align: center;
  padding: var(--space-base) 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-base);
  border: 1px solid var(--border-light);
  animation: fadeInUp 0.6s ease both;
}
.care-message.done {
  background: linear-gradient(135deg, var(--green-bg), #dcfce7);
  border-color: var(--green-border);
}
[data-theme="dark"] .care-message.done {
  background: linear-gradient(135deg, rgba(74,222,128,0.06), rgba(74,222,128,0.12));
}
.care-message .care-icon {
  font-size: 1.4rem;
  display: block;
  margin-bottom: 6px;
}
.care-message .care-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.5;
}
.care-message.done .care-text {
  color: var(--green);
}


.time-group {
  margin-bottom: 24px;
  animation: fadeInUp 0.5s ease both;
}
.time-group:nth-child(2) { animation-delay: 0.1s; }
.time-group:nth-child(3) { animation-delay: 0.2s; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.time-group-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-left: 4px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.time-group-label::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.supp-card {
  display: flex;
  align-items: center;
  padding: var(--space-base);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  gap: var(--space-base);
  border: 1px solid var(--border-light);
}
.supp-card:hover {
  background: var(--bg-tertiary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.supp-card.checked {
  background: var(--green-bg);
  border-color: var(--green-border);
}
.supp-card.checked:hover { background: var(--green-bg); }
.supp-card .check-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2.5px solid #cbd5e1;
  background: var(--bg-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  color: transparent;
}
.supp-card .check-btn:hover {
  border-color: var(--green);
  transform: scale(1.1);
}
.supp-card.checked .check-btn {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  animation: checkPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes checkPop {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.supp-card .info { flex: 1; }
.supp-card .name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: all 0.3s;
}
.supp-card.checked .name {
  text-decoration: line-through;
  color: var(--text-muted);
}
.supp-card .detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.supp-card .stock-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-xs) 10px;
  border-radius: var(--radius-pill);
  background: #e0e7ff;
  color: #3b82f6;
  flex-shrink: 0;
  transition: all 0.3s;
}
.supp-card .stock-badge.low {
  background: var(--red-bg);
  color: var(--red);
  animation: lowPulse 2s ease-in-out infinite;
}
@keyframes lowPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.supp-card .stock-area {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.supp-card .buy-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #ff6b6b, #ee5a24, #f0932b);
  background-size: 200% 200%;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  animation: buyGradient 3s ease infinite, buyBounce 2s ease-in-out infinite;
  box-shadow: 0 2px 8px rgba(238,90,36,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.supp-card .buy-btn:active {
  transform: scale(0.92);
  box-shadow: 0 1px 4px rgba(238,90,36,0.3);
}
.buy-btn-icon {
  font-size: 0.75rem;
}
.buy-btn-text {
  position: relative;
  z-index: 1;
}
.buy-btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: buyShine 2.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes buyGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes buyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}
@keyframes buyShine {
  0% { left: -100%; }
  60% { left: 150%; }
  100% { left: 150%; }
}
[data-theme="dark"] .supp-card .buy-btn {
  background: linear-gradient(135deg, #f97316, #ef4444, #f59e0b);
  background-size: 200% 200%;
  box-shadow: 0 2px 10px rgba(249,115,22,0.4);
}

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall 1.2s ease-out forwards;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translateY(600px) rotate(720deg) scale(0.3); }
}

/* Stats tab */
.stat-period {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.period-btn {
  flex: 1;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
}
.period-btn:hover { border-color: var(--accent-border); color: var(--accent); }
.period-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
[data-theme="dark"] .period-btn.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* Savings Hero */
.savings-hero {
  text-align: center;
  padding: 28px 20px;
  margin-bottom: var(--space-lg);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1.5px solid #fbbf24;
  box-shadow: 0 0 12px rgba(251,191,36,0.2);
  animation: fadeInUp 0.5s ease;
}
[data-theme="dark"] .savings-hero {
  background: linear-gradient(135deg, rgba(251,191,36,0.08), rgba(245,158,11,0.15));
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245,158,11,0.15);
}
.savings-hero-icon {
  font-size: 2.8rem;
  margin-bottom: 8px;
  animation: celebrateBounce 1s ease-in-out infinite;
}
.savings-hero-amount {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.savings-hero-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
  margin-bottom: 16px;
}
.savings-hero-bar-wrap {
  max-width: 280px;
  margin: 0 auto;
}
.savings-hero-bar {
  height: 10px;
  background: rgba(251,191,36,0.2);
  border-radius: 5px;
  overflow: hidden;
}
.savings-hero-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 5px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.savings-hero-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* Streak badge */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: linear-gradient(135deg, rgba(249,115,22,0.5), rgba(239,68,68,0.45));
  color: #fff;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
  animation: streakGlow 2s ease-in-out infinite;
}
@keyframes streakGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(249,115,22,0.3), 0 0 2px rgba(239,68,68,0.2); }
  50% { box-shadow: 0 0 16px rgba(249,115,22,0.5), 0 0 6px rgba(239,68,68,0.4); }
}
.streak-badge::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255,200,50,0.25) 0%, transparent 60%);
  animation: streakShimmer 3s ease-in-out infinite alternate;
}
@keyframes streakShimmer {
  0% { transform: translate(0, 0); }
  100% { transform: translate(20%, -10%); }
}
.streak-badge .streak-fire {
  font-size: 0.9rem;
  animation: fireFlicker 0.8s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 3px rgba(249,115,22,0.6));
}
@keyframes fireFlicker {
  0% { transform: scale(1) rotate(-3deg); }
  50% { transform: scale(1.15) rotate(3deg); }
  100% { transform: scale(1.05) rotate(-2deg); }
}

.stat-summary {
  display: flex;
  gap: 10px;
  margin-bottom: var(--space-lg);
}
.stat-box {
  flex: 1;
  text-align: center;
  padding: var(--space-base) var(--space-sm);
  background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all 0.3s;
  animation: fadeInUp 0.5s ease both;
}
.stat-box:nth-child(1) { animation-delay: 0s; }
.stat-box:nth-child(2) { animation-delay: 0.1s; }
.stat-box:nth-child(3) { animation-delay: 0.2s; }
.stat-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-box .value {
  font-size: 1.7rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-box .label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0.3px;
}

/* Stats empty */
.stats-empty {
  text-align: center;
  padding: 50px 20px;
  animation: fadeInUp 0.5s ease;
}
.stats-empty .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: block;
  animation: emptyBounce 2s ease-in-out infinite;
}
.stats-empty .empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.stats-empty .empty-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.chart-section h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.chart-bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
  animation: fadeInUp 0.5s ease both;
}
.chart-bar-row:nth-child(1) { animation-delay: 0s; }
.chart-bar-row:nth-child(2) { animation-delay: 0.08s; }
.chart-bar-row:nth-child(3) { animation-delay: 0.16s; }
.chart-bar-row:nth-child(4) { animation-delay: 0.24s; }
.chart-bar-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  width: 72px;
  text-align: right;
  flex-shrink: 0;
  word-break: keep-all;
}
.chart-bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.chart-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb, #1d4ed8);
  border-radius: var(--radius-md);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
  position: relative;
}
.chart-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
}
.chart-bar-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  width: 40px;
  flex-shrink: 0;
}

/* Manage tab */
.manage-group {
  margin-bottom: 24px;
}
.manage-group-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-left: 2px;
}
.add-btn {
  width: 100%;
  padding: var(--space-base);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-base);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
}
.add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Manage empty */
.manage-empty {
  text-align: center;
  padding: 50px 20px;
  animation: fadeInUp 0.5s ease;
}
.manage-empty .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: block;
  animation: emptyBounce 2s ease-in-out infinite;
}
.manage-empty .empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.manage-empty .empty-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.manage-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-base);
  margin-bottom: var(--space-md);
  border: 1px solid var(--border-light);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 0.4s ease both;
}
.manage-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.manage-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.manage-card-header .name { font-weight: 700; font-size: 0.95rem; color: var(--text-primary); }
.manage-card-actions {
  display: flex;
  gap: 6px;
}
.manage-card-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-sm);
  padding: 6px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.manage-card-actions button:hover { color: var(--accent); background: var(--accent-bg); }
.manage-card-actions .delete-btn:hover { color: var(--red); background: var(--red-bg); }
.manage-card .detail-row {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}
.manage-card .stock-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--modal-overlay);
  backdrop-filter: blur(4px);
  z-index: 100;
  justify-content: center;
  align-items: flex-end;
}
.modal-overlay.active {
  display: flex;
  animation: overlayFadeIn 0.3s ease;
}
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  background: var(--bg-primary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 28px var(--space-lg) var(--space-xl);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 20px;
}
.modal h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
  color: var(--text-primary);
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}
.form-group input, .form-group select {
  width: 100%;
  padding: var(--space-md) 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--accent);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.form-actions button {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-md);
  border: none;
  font-size: var(--text-base);
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-cancel {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.btn-cancel:hover { background: var(--border); }
.btn-save {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-save:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Event Ticker */
.event-ticker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(90deg, #fef3c7, #fde68a, #fef3c7);
  background-size: 200% 100%;
  animation: tickerShine 3s ease-in-out infinite, tickerGlow 2s ease-in-out infinite;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  border: none;
  box-shadow: 0 0 8px rgba(251,191,36,0.3), inset 0 0 8px rgba(251,191,36,0.15);
}
@keyframes tickerShine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes tickerGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(251,191,36,0.25), inset 0 0 6px rgba(251,191,36,0.1); }
  50% { box-shadow: 0 0 14px rgba(251,191,36,0.5), inset 0 0 10px rgba(251,191,36,0.2); }
}
[data-theme="dark"] .event-ticker {
  background: linear-gradient(90deg, rgba(251,191,36,0.1), rgba(245,158,11,0.18), rgba(251,191,36,0.1));
  background-size: 200% 100%;
  box-shadow: 0 0 8px rgba(245,158,11,0.2), inset 0 0 8px rgba(245,158,11,0.08);
}
.event-ticker-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: var(--space-xs) 10px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 2px 6px rgba(245,158,11,0.3);
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
[data-theme="dark"] .event-ticker-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 2px 8px rgba(245,158,11,0.4);
}
.event-ticker-wrap {
  flex: 1;
  height: 1.4em;
  overflow: hidden;
  position: relative;
}
.event-ticker-item {
  display: block;
  position: absolute;
  top: 0; left: 0; right: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #92400e;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4em;
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="dark"] .event-ticker-item {
  color: #fbbf24;
}
.event-ticker-item.active {
  opacity: 1;
  transform: translateY(0);
}
.event-ticker-item.out {
  opacity: 0;
  transform: translateY(-100%);
}

/* Notification permission banner */
.notif-banner {
  display: none;
  background: linear-gradient(90deg, #fef3c7, #fde68a);
  padding: 14px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #92400e;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}
[data-theme="dark"] .notif-banner {
  background: linear-gradient(90deg, rgba(254,243,199,0.15), rgba(253,230,138,0.15));
  color: #fbbf24;
}
.notif-banner:hover { background: linear-gradient(90deg, #fde68a, #fcd34d); }

/* CTA button */
.cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  width: 100%;
  padding: 18px var(--space-lg);
  margin-top: var(--space-lg);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 60%, #1e40af 100%);
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-lg);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35), 0 2px 4px rgba(0,0,0,0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: ctaPulse 3s ease-in-out infinite;
}
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35); }
  50% { box-shadow: 0 4px 28px rgba(37, 99, 235, 0.5); }
}
.cta-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: ctaShine 3s ease-in-out infinite;
}
@keyframes ctaShine {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}
.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.cta-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.35);
}
.cta-btn .cta-label {
  font-size: 1.05rem;
  font-weight: 700;
  position: relative;
}
.cta-btn .cta-click {
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-pill);
  letter-spacing: 1.5px;
  position: relative;
  backdrop-filter: blur(4px);
}

/* Calendar Heatmap */
.calendar-section {
  margin-top: 28px;
}
.calendar-section h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-weekday {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}
.calendar-day {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  transition: all 0.2s;
  overflow: hidden;
}
.calendar-day:hover {
  transform: scale(1.15);
  z-index: 1;
}
.calendar-day.empty { background: transparent; }
.calendar-day.future { background: var(--bg-secondary); color: var(--text-muted); }
.calendar-day.level-0 { background: var(--bg-tertiary); }
.calendar-day.level-1 { background: #dbeafe; color: #1e40af; }
.calendar-day.level-2 { background: #93c5fd; color: #1e3a8a; }
.calendar-day.level-3 { background: #3b82f6; color: #fff; }
.calendar-day.level-4 {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  color: #fff;
  border: 1.5px solid #fbbf24;
  box-shadow: 0 0 6px rgba(251,191,36,0.5), inset 0 0 4px rgba(251,191,36,0.15);
  animation: goldShimmer 2s ease-in-out infinite;
}
@keyframes goldShimmer {
  0%, 100% { box-shadow: 0 0 6px rgba(251,191,36,0.4), inset 0 0 4px rgba(251,191,36,0.1); }
  50% { box-shadow: 0 0 12px rgba(251,191,36,0.7), inset 0 0 6px rgba(251,191,36,0.25); }
}
[data-theme="dark"] .calendar-day.level-1 { background: rgba(59,130,246,0.2); color: #93c5fd; }
[data-theme="dark"] .calendar-day.level-2 { background: rgba(59,130,246,0.35); color: #bfdbfe; }
[data-theme="dark"] .calendar-day.level-3 { background: rgba(59,130,246,0.55); color: #fff; }
[data-theme="dark"] .calendar-day.level-4 {
  background: rgba(59,130,246,0.8);
  color: #fff;
  border: 1.5px solid #f59e0b;
  box-shadow: 0 0 6px rgba(245,158,11,0.5), inset 0 0 4px rgba(245,158,11,0.15);
  animation: goldShimmer 2s ease-in-out infinite;
}
.calendar-day.today {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.calendar-day.level-4.today {
  outline: none;
}
.calendar-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 10px;
  font-size: 0.68rem;
  color: var(--text-muted);
}
.calendar-legend-box {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}
.calendar-month-label {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.calendar-nav {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: var(--space-xs) 10px;
  transition: all 0.2s;
}
.calendar-nav:hover {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent);
}

/* Badge Section */
.badge-section {
  margin-top: 28px;
}
.badge-section h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.badge-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px var(--space-sm);
  text-align: center;
  transition: all 0.3s;
  position: relative;
}
.badge-card.locked {
  opacity: 0.45;
  filter: grayscale(0.8);
}
.badge-card.locked .badge-icon {
  font-size: 1.6rem;
  filter: grayscale(1);
}
.badge-card.locked::after {
  content: '🔒';
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.65rem;
}
.badge-card.unlocked {
  border-color: #f59e0b;
  background: linear-gradient(145deg, var(--bg-secondary), rgba(245,158,11,0.08));
  animation: badgeGlow 3s ease-in-out infinite;
}
[data-theme="dark"] .badge-card.unlocked {
  border-color: rgba(245,158,11,0.5);
  background: linear-gradient(145deg, var(--bg-secondary), rgba(245,158,11,0.1));
}
@keyframes badgeGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(245,158,11,0); }
  50% { box-shadow: 0 0 12px rgba(245,158,11,0.15); }
}
.badge-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 6px;
  line-height: 1;
}
.badge-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.badge-desc {
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1.3;
}
.badge-date {
  font-size: 0.58rem;
  color: var(--accent);
  margin-top: 4px;
  font-weight: 500;
}
.badge-category-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  margin: 18px 0 10px;
  padding-left: 4px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.badge-category-label:first-child {
  margin-top: 0;
}

/* Guide Popup */
.guide-popup-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--modal-overlay);
  backdrop-filter: blur(6px);
  z-index: 300;
  justify-content: center;
  align-items: center;
}
.guide-popup-overlay.active {
  display: flex;
  animation: overlayFadeIn 0.3s ease;
}
.guide-popup-content {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 0;
  max-width: 360px;
  width: 92%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: badgePopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1.5px solid var(--accent-border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.guide-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.guide-popup-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}
.guide-popup-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}
.guide-popup-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.guide-popup-step {
  display: flex;
  align-items: center;
  gap: var(--space-base);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.guide-popup-step:last-child {
  border-bottom: none;
}
.guide-popup-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.guide-popup-text {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
}
.guide-popup-emoji {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.guide-popup-notice {
  background: #fef3c7;
  color: #92400e;
  border-radius: var(--radius-md);
  padding: 14px var(--space-base);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 20px;
}
[data-theme="dark"] .guide-popup-notice {
  background: #422006;
  color: #fbbf24;
}
.guide-popup-section-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
  margin-top: 8px;
}
.guide-popup-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}
.guide-popup-ok {
  display: block;
  width: calc(100% - 48px);
  margin: 0 var(--space-lg) 20px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s;
}
.guide-popup-ok:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Coupon Popup */
.coupon-popup-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--modal-overlay);
  backdrop-filter: blur(6px);
  z-index: 300;
  justify-content: center;
  align-items: center;
}
.coupon-popup-overlay.active {
  display: flex;
  animation: overlayFadeIn 0.3s ease;
}
.coupon-popup-content {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 36px 28px 28px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  animation: badgePopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-lg);
}
.coupon-popup-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}
.coupon-popup-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 16px;
}
.coupon-popup-code {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 10px;
  letter-spacing: 2px;
  user-select: all;
}
.coupon-popup-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}
.coupon-popup-copy {
  display: block;
  width: 100%;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  margin-bottom: 10px;
  transition: all 0.3s;
}
.coupon-popup-copy:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.coupon-popup-link {
  display: block;
  width: 100%;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  margin-bottom: 10px;
  box-sizing: border-box;
  transition: all 0.3s;
}
.coupon-popup-link:hover {
  background: var(--accent);
  color: #fff;
}
.coupon-popup-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  padding: 8px;
}

/* Tip Popup */
.tip-popup-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--modal-overlay);
  backdrop-filter: blur(6px);
  z-index: 280;
  justify-content: center;
  align-items: center;
}
.tip-popup-overlay.active {
  display: flex;
  animation: overlayFadeIn 0.3s ease;
}
.tip-popup-content {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 28px var(--space-xl) var(--space-xl);
  text-align: center;
  max-width: 340px;
  width: 90%;
  animation: tipPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid var(--accent-border);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.15);
}
@keyframes tipPopIn {
  0% { opacity: 0; transform: scale(0.8) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.tip-popup-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.tip-popup-icon {
  font-size: 2rem;
  margin-bottom: 4px;
}
.tip-popup-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
}
.tip-popup-supp {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding: 6px 14px;
  display: inline-block;
  background: var(--accent-bg);
  border-radius: var(--radius-pill);
}
.tip-popup-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.65;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  text-align: center;
  word-break: keep-all;
}
.tip-popup-close {
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s;
  width: 100%;
}
.tip-popup-close:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Badge Popup */
.badge-popup-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--modal-overlay);
  backdrop-filter: blur(6px);
  z-index: 300;
  justify-content: center;
  align-items: center;
}
.badge-popup-overlay.active {
  display: flex;
  animation: overlayFadeIn 0.3s ease;
}
.badge-popup-content {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 40px var(--space-xl);
  text-align: center;
  max-width: 320px;
  width: 90%;
  animation: badgePopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid #f59e0b;
  box-shadow: 0 0 40px rgba(245,158,11,0.2);
}
@keyframes badgePopIn {
  0% { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
.badge-popup-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 16px;
  animation: badgePopBounce 1s ease-in-out infinite;
}
@keyframes badgePopBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.badge-popup-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #f59e0b;
  margin-bottom: 4px;
}
.badge-popup-reward {
  font-size: 0.9rem;
  font-weight: 700;
  color: #22c55e;
  margin-bottom: 6px;
}
.badge-popup-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.badge-popup-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}
.badge-popup-close {
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s;
}
.badge-popup-close:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Badge Detail Modal */
.badge-detail-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--modal-overlay);
  backdrop-filter: blur(6px);
  z-index: 250;
  justify-content: center;
  align-items: center;
}
.badge-detail-overlay.active {
  display: flex;
  animation: overlayFadeIn 0.3s ease;
}
.badge-detail-content {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 40px var(--space-xl) var(--space-xl);
  text-align: center;
  max-width: 320px;
  width: 90%;
  position: relative;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: badgeDetailIn 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.badge-detail-content.unlocked {
  border-color: #f59e0b;
  box-shadow: 0 0 40px rgba(245,158,11,0.2);
}
@keyframes badgeDetailIn {
  0% { opacity: 0; transform: scale(0.3) rotate(-360deg); }
  60% { transform: scale(1.05) rotate(10deg); }
  80% { transform: scale(0.98) rotate(-3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
.badge-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  line-height: 1;
}
.badge-detail-close:hover {
  background: var(--bg-tertiary);
  transform: scale(1.1);
}
.badge-detail-icon {
  font-size: 5rem;
  display: block;
  margin-bottom: 16px;
  line-height: 1;
}
.badge-detail-content.unlocked .badge-detail-icon {
  animation: badgeDetailSpin 1s ease-out;
}
@keyframes badgeDetailSpin {
  0% { transform: rotateY(0deg) scale(0.5); opacity: 0; }
  50% { transform: rotateY(540deg) scale(1.2); opacity: 1; }
  100% { transform: rotateY(720deg) scale(1); }
}
.badge-detail-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.badge-detail-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}
.badge-detail-status {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px var(--space-base);
  border-radius: var(--radius-pill);
  display: inline-block;
  margin-top: var(--space-sm);
}
.badge-detail-status.earned {
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(251,191,36,0.2));
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.3);
}
.badge-detail-status.locked {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Guide */
.guide-section {
  margin-top: var(--space-lg);
  background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.guide-toggle {
  width: 100%;
  padding: 14px var(--space-base);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Inter', sans-serif;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
}
.guide-toggle .arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.3s;
}
.guide-toggle.open .arrow { transform: rotate(180deg); }
.guide-body {
  display: none;
  padding: 0 var(--space-base) var(--space-base);
}
.guide-body.open {
  display: block;
  animation: tabFadeIn 0.3s ease;
}
.guide-step {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  align-items: flex-start;
}
.guide-step:last-child { margin-bottom: 0; }
.guide-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.guide-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.guide-text strong { color: var(--text-primary); }
.guide-notice {
  background: #fef3c7;
  color: #92400e;
  border-radius: var(--radius-md);
  padding: var(--space-md) 14px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 16px;
}
[data-theme="dark"] .guide-notice {
  background: #422006;
  color: #fbbf24;
}
.guide-section-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 8px;
  margin-top: 4px;
}
.guide-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Date Navigation */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-base);
}
.date-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.date-nav-btn:hover:not(:disabled) {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}
.date-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.date-nav-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 140px;
  text-align: center;
}
.go-today-btn {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.go-today-btn:hover {
  background: var(--accent);
  color: #fff;
}
.past-date-notice {
  background: linear-gradient(90deg, #fef3c7, #fde68a);
  padding: 10px var(--space-base);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  color: #92400e;
  text-align: center;
  margin-bottom: 14px;
}
[data-theme="dark"] .past-date-notice {
  background: linear-gradient(90deg, rgba(254,243,199,0.12), rgba(253,230,138,0.12));
  color: #fbbf24;
}

/* Past Complete Prompt */
.past-prompt-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--modal-overlay);
  backdrop-filter: blur(6px);
  z-index: 300;
  justify-content: center;
  align-items: center;
}
.past-prompt-overlay.active {
  display: flex;
  animation: overlayFadeIn 0.3s ease;
}
.past-prompt-content {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 36px 28px 28px;
  text-align: center;
  max-width: 300px;
  width: 85%;
  animation: badgePopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1.5px solid var(--accent-border);
  box-shadow: var(--shadow-lg);
}
.past-prompt-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
}
.past-prompt-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  line-height: 1.5;
}
.past-prompt-yes {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.past-prompt-yes:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.savings-track {
  margin-top: 16px;
  position: relative;
}
.savings-track-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 6px;
  font-weight: 500;
}
.savings-track-amount {
  color: rgba(255,255,255,0.95);
  font-weight: 700;
}
.savings-track-bar {
  position: relative;
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  overflow: visible;
}
.savings-track-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}
.savings-track-runner {
  position: absolute;
  top: -16px;
  font-size: 1.2rem;
  transform: translateX(-50%);
  transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  animation: runBounce 0.35s ease-in-out infinite alternate;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
  left: 0%;
}
@keyframes runBounce {
  0% { transform: translateX(-50%) translateY(0) rotate(-8deg); }
  100% { transform: translateX(-50%) translateY(-5px) rotate(4deg); }
}
.calendar-savings-summary {
  text-align: center;
  margin-top: var(--space-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}
.calendar-savings-summary span {
  color: #f59e0b;
  font-weight: 700;
}
.calendar-day.level-4 .day-stamp {
  font-size: 0.48rem;
  line-height: 1;
  font-weight: 800;
  color: #fbbf24;
  border: 1.5px solid #fbbf24;
  border-radius: 3px;
  padding: 1.5px 3px;
  margin-top: 2px;
  letter-spacing: -0.2px;
  transform: rotate(-8deg);
  opacity: 0.9;
  text-shadow: 0 0 2px rgba(0,0,0,0.3);
  animation: stampIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes stampIn {
  0% { transform: rotate(-8deg) scale(2); opacity: 0; }
  100% { transform: rotate(-8deg) scale(1); opacity: 0.9; }
}

/* Welcome Overlay */
.welcome-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  animation: overlayFadeIn 0.3s ease;
}
[data-theme="dark"] .welcome-overlay {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a2744 50%, #162032 100%);
}
.welcome-overlay.fade-out {
  animation: welcomeFadeOut 0.4s ease forwards;
}
@keyframes welcomeFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
.welcome-box {
  text-align: center;
  padding: 0 28px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.welcome-box .welcome-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}
.welcome-box .welcome-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}
.welcome-box .welcome-desc {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.75);
  margin-bottom: 36px;
  line-height: 1.5;
}
.welcome-box input {
  width: 100%;
  max-width: 280px;
  padding: 14px var(--space-base);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  outline: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-align: center;
  transition: all 0.3s;
  -webkit-appearance: none;
}
.welcome-box input::placeholder {
  color: rgba(255,255,255,0.5);
}
.welcome-box input:focus {
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.2);
}
.welcome-box .birthday-label {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  margin-top: 14px;
  margin-bottom: 6px;
}
.welcome-box .birthday-input {
  color-scheme: dark;
}
.welcome-box .birthday-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}
.welcome-box .welcome-btn {
  width: 100%;
  max-width: 280px;
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  background: #fff;
  color: #2563eb;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.welcome-box .welcome-btn:active {
  transform: scale(0.97);
  background: #f0f4ff;
}

/* Nickname display */
#nicknameDisplay {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.85;
  margin-left: 2px;
}

/* Nickname change section in manage tab */
.nickname-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px var(--space-base);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nickname-section .nickname-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.nickname-section .nickname-value {
  font-weight: 700;
  color: var(--text-primary);
}
.nickname-section .nickname-change-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.nickname-section .nickname-change-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* Reset button */
.reset-section {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
  text-align: center;
}
.reset-btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-base);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.reset-btn:active {
  color: var(--red);
  border-color: var(--red);
}

/* Event tab */
.event-sub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.event-sub-tab {
  flex: 1;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
}
.event-sub-tab:hover { border-color: var(--accent-border); color: var(--accent); }
.event-sub-tab.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
[data-theme="dark"] .event-sub-tab.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}
.event-sub-content {
  display: none;
  animation: tabFadeIn 0.4s ease;
}
.event-sub-content.active {
  display: block;
}
.event-badge.notice {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.event-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.event-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-base);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  animation: fadeInUp 0.4s ease both;
}
.event-card:nth-child(2) { animation-delay: 0.08s; }
.event-card:nth-child(3) { animation-delay: 0.16s; }
.event-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--accent-border);
}
.event-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  padding: var(--space-xs) 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  white-space: nowrap;
}
[data-theme="dark"] .event-badge {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}
.event-badge.ended {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}
[data-theme="dark"] .event-badge.ended {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}
.event-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}
.event-card-desc {
  display: none;
}
.event-arrow {
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.event-card:hover .event-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* Event card expanded layout for wider view */
@media (min-width: 360px) {
  .event-card {
    flex-wrap: wrap;
  }
  .event-card-title {
    flex: 1;
  }
  .event-card-desc {
    display: block;
    width: 100%;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -4px;
    padding-left: 62px;
    order: 4;
  }
}

/* Stock out animation */
.supp-card.stock-out {
  animation: stockOut 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes stockOut {
  0% { opacity: 1; transform: translateX(0) scale(1); }
  40% { opacity: 0.7; transform: translateX(10px) scale(0.98); }
  100% { opacity: 0; transform: translateX(-100%) scale(0.8); height: 0; padding: 0; margin: 0; border: 0; overflow: hidden; }
}

/* Repurchase Popup */
.repurchase-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--modal-overlay);
  backdrop-filter: blur(6px);
  z-index: 300;
  justify-content: center;
  align-items: center;
}
.repurchase-overlay.active {
  display: flex;
  animation: overlayFadeIn 0.3s ease;
}
.repurchase-content {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 36px 28px 28px;
  text-align: center;
  max-width: 300px;
  width: 85%;
  animation: badgePopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1.5px solid var(--accent-border);
  box-shadow: var(--shadow-lg);
}
.repurchase-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
}
.repurchase-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.repurchase-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}
.repurchase-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.repurchase-buy {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.3s;
  margin-bottom: 10px;
}
.repurchase-buy:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.repurchase-close {
  width: 100%;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}
.repurchase-close:hover {
  background: var(--border);
}

/* Event Detail */
.event-detail-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 150;
  justify-content: center;
}
.event-detail-overlay.active {
  display: flex;
  animation: overlayFadeIn 0.3s ease;
}
.event-detail {
  width: 100%;
  max-width: 480px;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.event-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 1;
}
.event-detail-back {
  background: none;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  flex-shrink: 0;
}
.event-detail-back:hover {
  background: var(--accent-bg);
}
.event-detail-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-detail-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.event-detail-img {
  display: block;
  width: 100%;
  height: auto;
}
.event-detail-cta {
  cursor: pointer;
  transition: opacity 0.2s;
}
.event-detail-cta:hover {
  opacity: 0.85;
}

/* Challenge Button on Today Tab */
.challenge-today-btn {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px var(--space-base);
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1.5px solid #fdba74;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-base);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 0.5s ease both;
}
[data-theme="dark"] .challenge-today-btn {
  background: linear-gradient(135deg, rgba(251,146,60,0.08), rgba(253,186,116,0.12));
  border-color: rgba(251,146,60,0.35);
}
.challenge-today-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.challenge-today-btn.completed {
  background: linear-gradient(135deg, var(--green-bg), #dcfce7);
  border-color: var(--green-border);
}
[data-theme="dark"] .challenge-today-btn.completed {
  background: linear-gradient(135deg, rgba(74,222,128,0.08), rgba(74,222,128,0.15));
  border-color: rgba(74,222,128,0.3);
}
.challenge-today-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}
.challenge-today-info {
  flex: 1;
  min-width: 0;
}
.challenge-today-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}
.challenge-today-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 500;
}

/* Challenge Detail Overlay */
.challenge-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 150;
  justify-content: center;
}
.challenge-overlay.active {
  display: flex;
  animation: overlayFadeIn 0.3s ease;
}
.challenge-detail {
  width: 100%;
  max-width: 480px;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.challenge-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 1;
}
.challenge-detail-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px;
}

/* Challenge Intro (before joining) */
.challenge-intro {
  text-align: center;
  animation: fadeInUp 0.5s ease;
}
.challenge-intro-icon {
  font-size: 4rem;
  margin-bottom: 12px;
  display: block;
  animation: celebrateBounce 1s ease-in-out infinite;
}
.challenge-intro-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.challenge-intro-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 28px;
}
.challenge-intro-desc strong {
  color: var(--accent);
}
.challenge-rules {
  text-align: left;
  margin-bottom: 32px;
}
.challenge-rule {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.challenge-rule:last-child { margin-bottom: 0; }
.challenge-rule-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* Challenge Code Input */
.challenge-code-group {
  margin-bottom: 20px;
}
.challenge-code-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-align: left;
}
.phone-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.phone-input-wrap:focus-within {
  border-color: var(--accent);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.phone-prefix {
  padding: 14px 0 14px 16px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  user-select: none;
}
.phone-suffix {
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding-left: 4px !important;
}
.phone-suffix:focus {
  border: none !important;
  box-shadow: none !important;
}
.challenge-code-input {
  width: 100%;
  padding: 14px var(--space-base);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  text-align: center;
  letter-spacing: 4px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.challenge-code-input:focus {
  border-color: var(--accent);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.challenge-code-input.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
  animation: codeShake 0.4s ease;
}
@keyframes codeShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.challenge-code-error {
  display: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--red);
  margin-top: 8px;
  text-align: center;
}

.challenge-join-btn {
  width: 100%;
  padding: 18px var(--space-lg);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 60%, #1e40af 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.challenge-join-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.challenge-join-btn:active {
  transform: translateY(-1px);
}

/* Challenge Progress View */
.challenge-progress-view {
  text-align: center;
  animation: fadeInUp 0.5s ease;
}
.challenge-ring-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0 auto 16px;
}
.challenge-ring-wrap svg {
  transform: rotate(-90deg);
}
.challenge-ring-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 8;
}
.challenge-ring-bar {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.challenge-ring-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.challenge-ring-pct {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.challenge-ring-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Challenge Status Message */
.challenge-status {
  font-size: 0.92rem;
  font-weight: 700;
  padding: var(--space-sm) 20px;
  border-radius: var(--radius-pill);
  display: inline-block;
  margin-bottom: 20px;
}
.challenge-status.on-track {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}
.challenge-status.behind {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(220,38,38,0.2);
}
[data-theme="dark"] .challenge-status.behind {
  border-color: rgba(248,113,113,0.25);
}

/* Challenge Stats Grid */
.challenge-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.challenge-stat-box {
  flex: 1;
  text-align: center;
  padding: var(--space-base) var(--space-sm);
  background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all 0.3s;
  animation: fadeInUp 0.5s ease both;
}
.challenge-stat-box:nth-child(1) { animation-delay: 0s; }
.challenge-stat-box:nth-child(2) { animation-delay: 0.1s; }
.challenge-stat-box:nth-child(3) { animation-delay: 0.2s; }
.challenge-stat-box .value {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.challenge-stat-box .label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Challenge Period */
.challenge-period {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  padding: var(--space-md) var(--space-base);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

/* Challenge Weekly Dots */
.challenge-weekly {
  text-align: left;
}
.challenge-weekly h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.challenge-dots {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.challenge-dot-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.challenge-dot-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
  font-weight: 500;
}
.challenge-dot {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  flex: 1;
  max-width: 40px;
  transition: all 0.2s;
}
.challenge-dot.perfect {
  background: var(--green);
  box-shadow: 0 0 6px rgba(34,197,94,0.3);
}
.challenge-dot.missed {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
}
.challenge-dot.empty {
  background: transparent;
}

/* Challenge Calendar */
.challenge-calendar-section {
  text-align: left;
  margin-top: 4px;
}
.challenge-calendar-section h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* Challenge Complete */
.challenge-complete {
  text-align: center;
  animation: celebrateIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.challenge-complete-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 12px;
  animation: celebrateBounce 1s ease-in-out infinite;
}
.challenge-complete-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 8px;
}
.challenge-complete-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}
.challenge-complete-desc strong {
  color: var(--accent);
  font-weight: 800;
}
.challenge-complete-badge {
  padding: var(--space-lg);
  background: linear-gradient(145deg, var(--bg-secondary), rgba(245,158,11,0.08));
  border: 2px solid #f59e0b;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  animation: badgeGlow 3s ease-in-out infinite;
}
[data-theme="dark"] .challenge-complete-badge {
  background: linear-gradient(145deg, var(--bg-secondary), rgba(245,158,11,0.1));
  border-color: rgba(245,158,11,0.5);
}
.challenge-complete-badge-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 8px;
}
.challenge-complete-badge-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.challenge-complete-badge-desc {
  font-size: 0.82rem;
  color: #f59e0b;
  font-weight: 600;
}
.challenge-complete-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}
.challenge-coupon-btn {
  display: block;
  width: 100%;
  padding: 18px var(--space-lg);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 60%, #1e40af 100%);
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-lg);
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.challenge-coupon-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.challenge-applied {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 20px var(--space-lg);
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #ef4444 100%);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
  animation: appliedPulse 2s ease-in-out infinite;
}
.challenge-applied-icon {
  font-size: 1.5rem;
}
.challenge-applied-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
}
@keyframes appliedPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35); }
  50% { transform: scale(1.02); box-shadow: 0 6px 28px rgba(245, 158, 11, 0.5); }
}

/* Install Banner */
.install-banner {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 9999;
  padding: 0 12px;
  animation: installSlideUp 0.4s ease;
}
@keyframes installSlideUp {
  from { transform: translateX(-50%) translateY(100%); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.install-banner-inner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px var(--space-base);
  box-shadow: 0 -2px 20px rgba(0,0,0,0.12);
}
[data-theme="dark"] .install-banner-inner {
  box-shadow: 0 -2px 20px rgba(0,0,0,0.4);
}
.install-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.install-banner-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.install-banner-text strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}
.install-banner-text span {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.install-banner-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--space-sm) 18px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.install-banner-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.install-banner-btn:active {
  transform: scale(0.97);
}
.install-banner-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}
.install-banner-close:hover {
  color: var(--text-primary);
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Dark mode補完 */
[data-theme="dark"] .supp-card .stock-badge {
  background: rgba(96,165,250,0.15);
  color: #93c5fd;
}
[data-theme="dark"] .btn-save {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
[data-theme="dark"] .repurchase-buy {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
[data-theme="dark"] .past-prompt-yes {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
[data-theme="dark"] .challenge-join-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 60%, #1d4ed8 100%);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
}
[data-theme="dark"] .challenge-coupon-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 60%, #1d4ed8 100%);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
}
[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}

/* Responsive */
@media (min-width: 480px) {
  body { padding: 0; }
}

/* Kakao Login */
#loginStep1,
#loginStep2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.kakao-login-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  margin-bottom: var(--space-md);
  transition: transform 0.2s, opacity 0.2s;
}
.kakao-login-btn:hover {
  transform: scale(1.02);
}
.kakao-login-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}
.kakao-login-btn img {
  display: block;
  height: 45px;
  border-radius: 6px;
}
.login-hint {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.6);
  margin-top: var(--space-sm);
  text-align: center;
}
.guest-login-btn {
  width: 100%;
  padding: 12px 20px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
  transition: all 0.2s;
}
.guest-login-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,1);
  transform: translateY(-1px);
}
.guest-login-btn:active {
  transform: translateY(0);
  opacity: 0.9;
}
/* Login Guide Card */
.login-guide-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: var(--space-xl);
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.05) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.login-guide-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  animation: bounce-icon 2s ease-in-out infinite;
}
@keyframes bounce-icon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.login-guide-text {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
  text-align: left;
}
.login-guide-text span {
  color: #fff;
  font-weight: 700;
}

/* Profile Setup (모바일 친화적) */
.profile-setup {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid rgba(255,255,255,0.2);
}
.profile-setup-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-bottom: var(--space-sm);
}
.profile-setup-desc {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.7);
  text-align: center;
  margin-bottom: var(--space-lg);
}
.profile-field {
  margin-bottom: var(--space-base);
}
.profile-field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  margin-bottom: var(--space-sm);
}
.profile-field input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.15);
  color: #fff;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
}
.profile-field input::placeholder {
  color: rgba(255,255,255,0.5);
}
.profile-field input:focus {
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.2);
}
.profile-field input[type="date"] {
  color-scheme: dark;
}
.profile-field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}
.profile-submit-btn {
  width: 100%;
  padding: 16px;
  margin-top: var(--space-base);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  background: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}
.profile-submit-btn:hover {
  background: #f0f4ff;
}
.profile-submit-btn:active {
  transform: scale(0.98);
}

/* Shake animation for validation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
.shake {
  animation: shake 0.4s ease-in-out;
  border-color: #ef4444 !important;
}

/* Dark mode for Kakao Login */
[data-theme="dark"] .login-hint {
  color: rgba(255,255,255,0.6);
}

/* ======================= */
/* Condition Check System  */
/* ======================= */

/* Condition Check Button (Today Tab) */
.condition-check-btn {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  padding: 16px 20px;
  margin: var(--space-base) 0;
  background: var(--accent-bg);
  border: 2px solid var(--accent-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Inter', sans-serif;
}
.condition-check-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.condition-check-btn.checked {
  background: var(--green-bg);
  border-color: var(--green-border);
}
.condition-check-btn .condition-check-icon {
  font-size: 1.5rem;
}
.condition-check-btn .condition-check-text {
  flex: 1;
  text-align: left;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
}
.condition-check-btn.checked .condition-check-text {
  color: var(--green);
}
.condition-check-btn .condition-check-arrow {
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.3s;
}
.condition-check-btn:hover .condition-check-arrow {
  transform: translateX(4px);
}

/* Condition Popup Overlay */
.condition-popup-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-primary);
  z-index: 200;
  overflow: hidden;
}
.condition-popup-overlay.active {
  display: flex;
  flex-direction: column;
  animation: slideInFromRight 0.3s ease;
}
@keyframes slideInFromRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.condition-popup {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}
.condition-popup-header {
  display: flex;
  align-items: center;
  gap: var(--space-base);
  padding: 16px 20px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.condition-popup-back {
  background: none;
  border: none;
  font-size: var(--text-base);
  color: var(--accent);
  cursor: pointer;
  padding: 8px;
  margin: -8px;
  font-family: 'Inter', sans-serif;
}
.condition-popup-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.condition-popup-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-base) 20px;
  padding-bottom: 100px;
}
.condition-popup-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding: var(--space-base) 20px;
  padding-bottom: calc(var(--space-base) + env(safe-area-inset-bottom, 0));
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
}
.condition-save-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s;
}
.condition-save-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Condition Card */
.condition-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-base);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.condition-card-header {
  padding: var(--space-md) var(--space-base);
}
.condition-card-name {
  font-size: var(--text-base);
  font-weight: 700;
}
.condition-items {
  padding: 0 var(--space-base) var(--space-base);
}
.condition-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-light);
}
.condition-item:last-child {
  border-bottom: none;
}
.condition-item-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.condition-item-icon {
  font-size: 1.1rem;
}
.condition-item-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}
.condition-score-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}
.condition-label-left,
.condition-label-right {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 36px;
}
.condition-label-left {
  text-align: right;
}
.condition-label-right {
  text-align: left;
}
.condition-scores {
  display: flex;
  gap: 4px;
}
.condition-score-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.condition-score-btn:hover {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  transform: scale(1.1);
}
.condition-score-btn.selected {
  border-color: var(--accent);
  background: var(--accent-bg);
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

/* Condition Empty State */
.condition-empty {
  text-align: center;
  padding: 60px 20px;
}
.condition-empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--space-base);
}
.condition-empty-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}
.condition-empty-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Condition Toast */
.condition-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
  z-index: 500;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.condition-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ======================= */
/* Condition Section (Stats Tab) */
/* ======================= */
.condition-section {
  margin: var(--space-lg) 20px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.condition-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-base);
}
.condition-period-btns {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-base);
}
.condition-period-btn {
  flex: 1;
  padding: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.condition-period-btn:hover {
  background: var(--bg-tertiary);
}
.condition-period-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Condition Graph Card */
.condition-graphs {
  display: flex;
  flex-direction: column;
  gap: var(--space-base);
}
.condition-graph-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-base);
  border: 1px solid var(--border-light);
}
.condition-graph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.condition-graph-name {
  font-size: var(--text-sm);
  font-weight: 700;
}
.condition-change {
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.condition-change.positive {
  background: var(--green-bg);
  color: var(--green);
}
.condition-change.negative {
  background: var(--red-bg);
  color: var(--red);
}
.condition-change.neutral {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.condition-graph-nodata {
  text-align: center;
  padding: var(--space-lg);
  color: var(--text-muted);
  font-size: var(--text-sm);
}
/* Line Graph */
.condition-line-graph {
  width: 100%;
  height: auto;
  max-height: 120px;
}
.condition-line-graph .grid-label {
  font-size: 8px;
  fill: var(--text-muted);
}
.condition-line-graph .x-label {
  font-size: 8px;
  fill: var(--text-secondary);
}

/* Condition Section Empty */
.condition-section-empty {
  text-align: center;
  padding: var(--space-xl) var(--space-base);
}
.condition-section-empty-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--space-md);
}
.condition-section-empty-text {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}
.condition-section-empty-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ======================= */
/* Coupon Box (관리 탭)     */
/* ======================= */
.coupon-empty {
  text-align: center;
  padding: var(--space-xl) var(--space-base);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
}
.coupon-empty-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--space-md);
}
.coupon-empty-text {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}
.coupon-empty-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.coupon-card {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: var(--radius-md);
  padding: var(--space-base);
  margin-bottom: var(--space-sm);
  border: 2px dashed #f59e0b;
  position: relative;
}
[data-theme="dark"] .coupon-card {
  background: linear-gradient(135deg, rgba(245,158,11,0.2) 0%, rgba(251,191,36,0.15) 100%);
  border-color: rgba(245,158,11,0.5);
}
.coupon-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}
.coupon-card-icon {
  font-size: 1.5rem;
}
.coupon-card-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: #92400e;
}
[data-theme="dark"] .coupon-card-name {
  color: #fbbf24;
}
.coupon-card-serial {
  font-size: 1.1rem;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  color: #78350f;
  background: rgba(255,255,255,0.6);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-align: center;
  margin-bottom: var(--space-sm);
  letter-spacing: 1px;
}
[data-theme="dark"] .coupon-card-serial {
  background: rgba(0,0,0,0.2);
  color: #fde68a;
}
.coupon-card-serial.pending {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0;
}
.coupon-card-date {
  font-size: var(--text-xs);
  color: #a16207;
  margin-bottom: var(--space-sm);
}
[data-theme="dark"] .coupon-card-date {
  color: #fcd34d;
}
.coupon-card-copy {
  width: 100%;
  padding: 10px;
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}
.coupon-card-copy:hover {
  background: #d97706;
}

/* Goal Coupon Popup Name */
.goal-coupon-name {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

/* Manage Group Header */
.manage-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.manage-group-header .manage-group-title {
  margin-bottom: 0;
}
.coupon-input-btn {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 12px;
  background: var(--accent-bg);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.coupon-input-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ========================================
   Notification Settings
   ======================================== */

/* 알림 설정 버튼 */
.notif-settings-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.notif-settings-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent);
}
.notif-settings-btn-icon {
  font-size: 1.5rem;
  margin-right: 12px;
}
.notif-settings-btn-text {
  flex: 1;
  text-align: left;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
}
.notif-settings-btn-arrow {
  font-size: var(--text-lg);
  color: var(--text-muted);
}

/* 알림 설정 팝업 오버레이 */
.notif-settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 1000;
  display: none;
  flex-direction: column;
}
.notif-settings-overlay.active {
  display: flex;
}

/* 알림 설정 팝업 */
.notif-settings-popup {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

/* 알림 설정 헤더 */
.notif-settings-header {
  display: flex;
  align-items: center;
  padding: 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.notif-settings-back {
  background: none;
  border: none;
  font-size: var(--text-base);
  color: var(--accent);
  cursor: pointer;
  padding: 8px 12px;
  margin-left: -12px;
  font-family: 'Inter', sans-serif;
}
.notif-settings-title {
  flex: 1;
  text-align: center;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-right: 48px;
}

/* 알림 설정 바디 */
.notif-settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 100px;
}

/* 알림 설정 그룹 */
.notif-setting-group {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.notif-setting-group.disabled {
  opacity: 0.5;
  pointer-events: none;
}
.notif-setting-group.collapsed .notif-setting-body {
  display: none;
}
.notif-setting-group.collapsed .notif-group-arrow {
  transform: rotate(-90deg);
}

/* 그룹 헤더 */
.notif-setting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}
.notif-setting-header:hover {
  background: var(--border);
}
.notif-group-arrow {
  font-size: var(--text-xs);
  color: var(--text-muted);
  transition: transform 0.2s;
}

/* 그룹 바디 */
.notif-setting-body {
  padding: 8px 0;
}

/* 설정 행 */
.notif-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.notif-setting-row.main-toggle {
  background: var(--accent-bg);
  border-radius: var(--radius-md);
}
.notif-setting-label {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

/* 토글 스위치 */
.notif-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}
.notif-toggle.small {
  width: 40px;
  height: 22px;
}
.notif-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.notif-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.3s;
  border-radius: 26px;
}
.notif-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.notif-toggle.small .notif-toggle-slider:before {
  height: 16px;
  width: 16px;
}
.notif-toggle input:checked + .notif-toggle-slider {
  background-color: var(--accent);
}
.notif-toggle input:checked + .notif-toggle-slider:before {
  transform: translateX(22px);
}
.notif-toggle.small input:checked + .notif-toggle-slider:before {
  transform: translateX(18px);
}

/* 시간 입력 */
.notif-time-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* 영양제별 알림 설정 */
.notif-supp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  margin: 4px 8px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
}
.notif-supp-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notif-supp-name {
  font-size: var(--text-sm);
  font-weight: 600;
}
.notif-supp-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* 빈 상태 */
.notif-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* Privacy Link */
.privacy-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-decoration: none;
}
.privacy-link:hover {
  color: var(--accent);
  text-decoration: underline;
}
