@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a28;
  --bg-card-hover: #1e1e30;
  --accent-primary: #6c63ff;
  --accent-secondary: #ff6584;
  --accent-green: #43e97b;
  --accent-orange: #f7971e;
  --accent-blue: #4facfe;
  --text-primary: #ffffff;
  --text-secondary: #a0a0c0;
  --text-muted: #606080;
  --border: rgba(255,255,255,0.07);
  --gradient-purple: linear-gradient(135deg, #6c63ff 0%, #a855f7 100%);
  --gradient-green: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --gradient-orange: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
  --gradient-red: linear-gradient(135deg, #ff6584 0%, #ff4b6e 100%);
  --gradient-blue: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.4);
  --radius: 16px;
  --radius-sm: 10px;
}

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

body {
  font-family: 'Noto Sans KR', 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* ── Layout ── */
.app-container { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 240px; min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-icon {
  width: 42px; height: 42px;
  background: var(--gradient-purple);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 10px;
}
.sidebar-logo h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.sidebar-logo p { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 16px 12px; }
.nav-section-title {
  font-size: 10px; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 12px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.2s;
  margin-bottom: 2px; color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
}
.nav-item:hover { background: rgba(108,99,255,0.12); color: var(--text-primary); }
.nav-item.active {
  background: var(--gradient-purple);
  color: #fff;
  box-shadow: 0 4px 16px rgba(108,99,255,0.4);
}
.nav-item .auth-msg {
  font-size: 13px;
  margin-bottom: 15px;
  text-align: center;
  min-height: 18px;
}

/* ── Type Selector (Meal/Exercise) ── */
.type-selector {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
}
.type-selector .type-btn {
  padding: 8px 16px; border-radius: 20px;
  background: var(--bg-primary); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer; font-size: 13px;
  transition: all 0.2s;
}
.type-selector .type-btn.active {
  background: var(--gradient-purple); color: #fff; border-color: transparent;
}

/* ── Meal Item Record ── */
.meal-record-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.meal-record-item:last-child { margin-bottom: 0; }
.meal-record-info { flex: 1; }
.meal-record-type {
  font-size: 11px; font-weight: 700; color: var(--accent-primary);
  background: rgba(108,99,255,0.1); padding: 2px 8px; border-radius: 10px; margin-right: 8px;
}
.meal-record-name { font-size: 14px; font-weight: 500; }
.meal-record-cal { font-size: 18px; font-weight: 700; color: var(--accent-green); text-align: right; }
.meal-record-del {
  background: transparent; border: none; font-size: 18px; color: var(--text-muted); cursor: pointer; padding: 4px; margin-left: 12px;
}
.meal-record-del:hover { color: var(--accent-secondary); }

/* ── Modal (Meal Add) ── */
.modal {
  display: none;
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal.show { display: flex; }
.modal-dialog {
  background: var(--bg-card);
  width: 100%; max-width: 420px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  padding: 24px;
  animation: fadeUp 0.3s ease;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px; margin-bottom: 16px;
}
.modal-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-body { padding: 10px 0; }
.modal-footer { margin-top: 20px; }
.form-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; display: block; }
.form-control {
  width: 100%; padding: 12px;
  background: var(--bg-primary); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: 8px;
  outline: none; transition: border 0.3s;
}
.form-control:focus { border-color: var(--accent-primary); }
.nav-item .nav-icon { font-size: 18px; width: 22px; text-align: center; }

.sidebar-profile {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.profile-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--gradient-purple);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.profile-info p { font-size: 13px; font-weight: 600; }
.profile-info span { font-size: 11px; color: var(--text-muted); }

/* ── Main Content ── */
.main-content {
  margin-left: 240px; flex: 1; padding: 24px;
  max-width: calc(100vw - 240px);
}

/* ── Page ── */
.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Page Header ── */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.page-header p { color: var(--text-secondary); margin-top: 4px; font-size: 14px; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.3s;
}
.card:hover { border-color: rgba(108,99,255,0.3); transform: translateY(-2px); box-shadow: var(--shadow-card); }

.card-title {
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}

/* ── Stat Cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative; overflow: hidden;
  transition: all 0.3s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.purple::before { background: var(--gradient-purple); }
.stat-card.green::before { background: var(--gradient-green); }
.stat-card.orange::before { background: var(--gradient-orange); }
.stat-card.blue::before { background: var(--gradient-blue); }
.stat-card.red::before { background: var(--gradient-red); }

.stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 12px;
}
.stat-icon.purple { background: rgba(108,99,255,0.2); }
.stat-icon.green { background: rgba(67,233,123,0.2); }
.stat-icon.orange { background: rgba(247,151,30,0.2); }
.stat-icon.blue { background: rgba(79,172,254,0.2); }
.stat-icon.red { background: rgba(255,101,132,0.2); }

.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.stat-change {
  font-size: 11px; font-weight: 600; margin-top: 8px;
  padding: 3px 8px; border-radius: 20px; display: inline-block;
}
.stat-change.negative { background: rgba(255,101,132,0.15); color: var(--accent-secondary); }
.stat-change.positive { background: rgba(67,233,123,0.15); color: var(--accent-green); }
.stat-change.neutral { background: rgba(108,99,255,0.15); color: var(--accent-primary); }

/* ── Grid layouts ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.grid-auto { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 20px; }

/* ── Progress bar ── */
.progress-bar {
  height: 8px; background: rgba(255,255,255,0.08);
  border-radius: 4px; overflow: hidden; margin-top: 8px;
}
.progress-fill {
  height: 100%; border-radius: 4px;
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}
.progress-fill.purple { background: var(--gradient-purple); }
.progress-fill.green { background: var(--gradient-green); }
.progress-fill.orange { background: var(--gradient-orange); }
.progress-fill.red { background: var(--gradient-red); }

/* ── Body composition ── */
.body-comp-item { margin-bottom: 16px; }
.body-comp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.body-comp-label { font-size: 13px; color: var(--text-secondary); }
.body-comp-value { font-size: 13px; font-weight: 700; }
.body-comp-range { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Meal Plan ── */
.week-nav {
  display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 20px;
}
.week-nav h3 { flex: 1; font-size: 16px; font-weight: 700; text-align: center; }
.week-nav-btn {
  background: rgba(108,99,255,0.15); border: none;
  color: var(--accent-primary); font-size: 20px;
  width: 36px; height: 36px; border-radius: 8px;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.week-nav-btn:hover { background: var(--accent-primary); color: white; }

.meal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.meal-day-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: all 0.3s;
}
.meal-day-card.today { border-color: var(--accent-primary); box-shadow: 0 0 20px rgba(108,99,255,0.3); }
.meal-day-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }

.meal-day-header {
  padding: 10px; text-align: center;
  background: rgba(255,255,255,0.04); border-bottom: 1px solid var(--border);
}
.meal-day-name { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.meal-day-date { font-size: 20px; font-weight: 800; margin-top: 2px; }
.meal-day-card.today .meal-day-date { color: var(--accent-primary); }

.meal-slots { padding: 10px; }
.meal-slot { margin-bottom: 10px; }
.meal-slot-label {
  font-size: 10px; color: var(--text-muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;
}
.meal-item {
  background: rgba(255,255,255,0.04); border-radius: 8px;
  padding: 8px; font-size: 12px;
}
.meal-item-name { font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.meal-item-cal { font-size: 10px; color: var(--accent-primary); margin-top: 2px; font-weight: 600; }
.meal-total {
  padding: 8px 10px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.meal-total-label { font-size: 11px; color: var(--text-muted); }
.meal-total-cal { font-size: 13px; font-weight: 800; color: var(--accent-green); }

/* ── Calorie summary bar ── */
.calorie-summary {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 30px;
}
.cal-item { text-align: center; }
.cal-item .value { font-size: 22px; font-weight: 800; }
.cal-item .label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.cal-divider { width: 1px; height: 40px; background: var(--border); }
.cal-bar-wrap { flex: 1; }
.cal-bar-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.cal-bar { height: 10px; background: rgba(255,255,255,0.08); border-radius: 5px; overflow: hidden; }
.cal-bar-fill { height: 100%; border-radius: 5px; background: var(--gradient-green); transition: width 1s; }

/* ── Exercise Log ── */
.exercise-form {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.form-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.form-group input, .form-group select {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
  color: var(--text-primary); font-size: 14px;
  font-family: inherit; outline: none; transition: all 0.2s;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
.form-group select option { background: var(--bg-card); }

.btn {
  padding: 10px 20px; border-radius: 10px; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.2s;
  display: flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--gradient-purple); color: white; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(108,99,255,0.4); }
.btn-danger { background: rgba(255,101,132,0.2); color: var(--accent-secondary); border: 1px solid rgba(255,101,132,0.3); }
.btn-danger:hover { background: var(--accent-secondary); color: white; }

.exercise-list { display: flex; flex-direction: column; gap: 10px; }
.exercise-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  display: flex; align-items: center; gap: 16px;
  transition: all 0.2s;
}
.exercise-item:hover { border-color: rgba(108,99,255,0.3); }
.exercise-type-badge {
  padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.badge-running { background: rgba(67,233,123,0.2); color: var(--accent-green); }
.badge-weight { background: rgba(108,99,255,0.2); color: var(--accent-primary); }
.badge-cycling { background: rgba(79,172,254,0.2); color: var(--accent-blue); }
.badge-swimming { background: rgba(0,242,254,0.2); color: #00f2fe; }
.badge-other { background: rgba(247,151,30,0.2); color: var(--accent-orange); }

.exercise-detail { flex: 1; }
.exercise-name { font-size: 15px; font-weight: 700; }
.exercise-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.exercise-calories { font-size: 18px; font-weight: 800; color: var(--accent-orange); }

/* ── Running Records ── */
.record-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.record-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  text-align: center; transition: all 0.3s;
}
.record-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: rgba(67,233,123,0.4); }
.record-card .record-icon { font-size: 32px; margin-bottom: 12px; }
.record-card .record-value { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.record-card .record-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.record-card .record-date { font-size: 11px; color: var(--accent-primary); margin-top: 8px; }

/* ── Chart container ── */
.chart-container { position: relative; height: 200px; margin-top: 10px; }

/* ── Body gauge ── */
.gauge-wrap { display: flex; flex-direction: column; align-items: center; padding: 10px 0; }
.gauge-label { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.gauge-value { font-size: 24px; font-weight: 800; }

/* ── Goal card ── */
.goal-item { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.goal-icon { font-size: 24px; flex-shrink: 0; }
.goal-detail { flex: 1; }
.goal-title { font-size: 14px; font-weight: 600; }
.goal-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.goal-pct { font-size: 14px; font-weight: 700; color: var(--accent-primary); }

/* ── Tabs ── */
.tab-bar { display: flex; gap: 4px; background: var(--bg-secondary); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 20px; }
.tab-btn {
  flex: 1; padding: 9px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-secondary);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.2s;
}
.tab-btn.active { background: var(--bg-card); color: var(--text-primary); }

/* ── Nutrition circles ── */
.nutrition-circles { display: flex; justify-content: space-around; padding: 16px 0; }
.nutrition-circle { text-align: center; }
.circle-ring { position: relative; width: 80px; height: 80px; margin: 0 auto 8px; }
.circle-ring svg { transform: rotate(-90deg); }
.circle-ring .circle-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 6; }
.circle-ring .circle-fill { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s; }
.circle-center { position: absolute; top:50%;left:50%;transform:translate(-50%,-50%); font-size:16px;font-weight:800; }
.nutrition-label { font-size: 11px; color: var(--text-muted); }
.nutrition-gram { font-size: 13px; font-weight: 700; }

/* ── Mobile top bar ── */
.mobile-topbar { display: none; }

/* ── Bottom nav (mobile) ── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  flex-direction: row;
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  padding: 6px 4px; cursor: pointer;
  color: var(--text-muted); font-size: 10px; font-weight: 600;
  transition: all 0.2s; border: none; background: none; font-family: inherit;
}
.bottom-nav-item .bnav-icon { font-size: 20px; line-height: 1; }
.bottom-nav-item.active { color: var(--accent-primary); }
.bottom-nav-item.active .bnav-icon { filter: drop-shadow(0 0 6px rgba(108,99,255,0.8)); }

/* ── Meal grid responsive wrapper ── */
.meal-grid-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -24px 20px;
  padding: 0 24px 12px;
}
.meal-grid-inner {
  display: grid;
  grid-template-columns: repeat(7, minmax(160px, 1fr));
  gap: 10px;
  min-width: 100%;
}

/* ── Tablet ── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  /* Sidebar drawer */
  .sidebar {
    transform: translateX(-240px);
    box-shadow: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 200;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0,0,0,0.6);
  }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.55); z-index: 199; backdrop-filter: blur(2px);
  }
  .sidebar-overlay.show { display: block; }

  /* Layout */
  .main-content {
    margin-left: 0; max-width: 100vw;
    padding: 14px 14px calc(72px + env(safe-area-inset-bottom));
  }

  /* Top bar */
  .mobile-topbar {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 150;
    backdrop-filter: blur(12px);
  }
  .mobile-menu-btn {
    background: rgba(108,99,255,0.12); border: 1px solid var(--border);
    color: var(--text-primary); font-size: 18px;
    width: 36px; height: 36px; border-radius: 8px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .mobile-title { font-size: 17px; font-weight: 800; flex: 1; }

  /* Bottom nav */
  .bottom-nav { display: flex; }

  /* Grid layouts */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-2, .grid-auto, .grid-3 { grid-template-columns: 1fr; gap: 12px; }
  .record-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Form */
  .form-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .form-group input, .form-group select { font-size: 16px; } /* iOS zoom 방지 */

  /* Meal grid - 가로 스크롤 */
  .meal-grid-wrapper { margin: 0 -14px 16px; padding: 0 14px 12px; }
  .meal-grid-inner { grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: 8px; }

  /* Page header */
  .page-header h1 { font-size: 20px; }
  .page-header p { font-size: 13px; }

  /* Calorie summary */
  .calorie-summary {
    flex-wrap: wrap; gap: 12px; padding: 14px;
  }
  .cal-bar-wrap { width: 100%; order: 10; }
  .cal-divider { display: none; }

  /* Stat card */
  .stat-value { font-size: 22px; }

  /* Exercise item */
  .exercise-item { flex-wrap: wrap; gap: 10px; }
  .exercise-detail { min-width: 0; }

  /* Nutrition circles */
  .circle-ring { width: 64px; height: 64px; }
  .circle-ring svg { width: 64px; height: 64px; }
  .circle-center { font-size: 13px; }

  /* Body comp */
  .card { padding: 14px; }

  /* Running highlight inline */
  .running-highlight-flex { flex-direction: column; gap: 14px !important; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .meal-grid-inner { grid-template-columns: repeat(7, minmax(120px, 1fr)); }
  .form-row { grid-template-columns: 1fr; }
}

/* ── Animations ── */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }
.pulse { animation: pulse 2s infinite; }

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

.badge-today {
  background: var(--gradient-purple); color: white;
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700;
}

/* ── Tag ── */
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.tag-purple { background: rgba(108,99,255,0.2); color: var(--accent-primary); }
.tag-green { background: rgba(67,233,123,0.2); color: var(--accent-green); }
.tag-orange { background: rgba(247,151,30,0.2); color: var(--accent-orange); }
.tag-red { background: rgba(255,101,132,0.2); color: var(--accent-secondary); }

/* ── Divider ── */
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Inbody visual bar ── */
.inbody-bar-wrap { margin: 6px 0 14px; }
.inbody-scale {
  position: relative; height: 28px;
  background: linear-gradient(90deg, #4facfe 0%, #43e97b 40%, #43e97b 60%, #f7971e 80%, #ff6584 100%);
  border-radius: 14px; margin: 8px 0 4px;
}
.inbody-marker {
  position: absolute; top: -4px; width: 4px; height: 36px;
  background: white; border-radius: 2px; transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(255,255,255,0.8);
}
.inbody-scale-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); padding: 0 4px; }

/* ── Auth Overlay ── */
.auth-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(10,10,15,0.85); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-box {
  background: var(--bg-card); width: 100%; max-width: 400px;
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5); padding: 32px;
}
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-icon { font-size: 40px; margin-bottom: 12px; }
.auth-tabs { display: flex; gap: 4px; background: var(--bg-primary); padding: 4px; border-radius: 12px; margin-bottom: 24px; }
.auth-tab {
  flex: 1; padding: 10px; border: none; background: transparent;
  color: var(--text-secondary); font-size: 14px; font-weight: 600;
  cursor: pointer; border-radius: 8px; transition: all 0.2s;
}
.auth-tab.active { background: var(--bg-card); color: var(--text-primary); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.auth-msg { font-size: 13px; text-align: center; min-height: 20px; margin-bottom: 16px; }
.input-group { margin-bottom: 16px; }
.input-group label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.input-group input {
  width: 100%; padding: 12px; background: var(--bg-primary);
  border: 1px solid var(--border); border-radius: 8px; color: #fff;
  outline: none; transition: border 0.3s;
}
.input-group input:focus { border-color: var(--accent-primary); }

