/* ===== VARIABLES ===== */
:root {
  --bg: #0a0b0f;
  --bg2: #111318;
  --bg3: #181b22;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --text: #f0f1f5;
  --text-sub: #8b8fa8;
  --text-dim: #5a5e72;
  --accent: #4ade80;
  --accent-dim: rgba(74,222,128,0.12);
  --accent2: #60a5fa;
  --accent2-dim: rgba(96,165,250,0.12);
  --red: #f87171;
  --red-dim: rgba(248,113,113,0.12);
  --orange: #fb923c;
  --orange-dim: rgba(251,146,60,0.12);
  --yellow: #fbbf24;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --sidebar-w: 220px;
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
}

[data-theme="light"] {
  --bg: #f0f2f8;
  --bg2: #e4e7f0;
  --bg3: #d8dce8;
  --surface: rgba(255,255,255,0.7);
  --surface-hover: rgba(255,255,255,0.9);
  --border: rgba(0,0,0,0.06);
  --border-hover: rgba(0,0,0,0.12);
  --text: #1a1c26;
  --text-sub: #5a5e72;
  --text-dim: #9399b2;
  --shadow: 0 4px 24px rgba(100,120,180,0.12);
  --shadow-lg: 0 8px 48px rgba(100,120,180,0.2);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
 font-family:"Roboto Mono", monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family:"Roboto Mono", monospace; line-height: 1.2; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, select { font-family: inherit; outline: none; }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ===== PAGES ===== */
.page { display: none; }
.page.active { display: flex; }

/* ===== GLASS CARD ===== */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.glass-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #0a0f0a;
  font-weight: 700;
}
.btn-primary:hover { background: #22c55e; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(74,222,128,0.3); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--border-hover); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(248,113,113,0.2);
}
.btn-danger:hover { background: rgba(248,113,113,0.2); }

.btn-lg { padding: 16px 32px; font-size: 1.05rem; width: 100%; }

/* ===== FORM ELEMENTS ===== */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.82rem; font-weight: 500; color: var(--text-sub); letter-spacing: 0.04em; text-transform: uppercase; }

input, select {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
select option { background: var(--bg2); color: var(--text); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-error { color: var(--red); font-size: 0.85rem; min-height: 20px; padding-top: 2px; }

/* ===== ONBOARDING ===== */
#onboarding {
  min-height: 100vh;
  position: relative;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ob-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.ob-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: orbFloat 8s ease-in-out infinite alternate;
}
.ob-orb1 { width: 500px; height: 500px; background: #166534; top: -150px; left: -100px; animation-delay: 0s; }
.ob-orb2 { width: 400px; height: 400px; background: #1e3a8a; bottom: -100px; right: -80px; animation-delay: 3s; }
.ob-orb3 { width: 300px; height: 300px; background: #374151; top: 40%; left: 40%; animation-delay: 1.5s; }

@keyframes orbFloat {
  from { transform: translate(0,0) scale(1); }
  to { transform: translate(30px, 20px) scale(1.05); }
}

.ob-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 580px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: fadeUp 0.6s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.ob-brand { text-align: center; }
.ob-logo { font-size: 3rem; display: block; margin-bottom: 8px; filter: drop-shadow(0 0 20px var(--accent)); }
.ob-brand h1 { font-family:"Roboto Mono", monospace; font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em; }
.ob-brand p { color: var(--text-sub); margin-top: 4px; }

.ob-form { display: flex; flex-direction: column; gap: 18px; }
.ob-form h2 { font-size: 1.2rem; font-weight: 600; color: var(--text-sub); margin-bottom: 4px; }

/* ===== SIDEBAR ===== */
#app { min-height: 100vh; }
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 28px 16px 20px;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  margin-bottom: 36px;
}
.logo-icon { font-size: 1.4rem; filter: drop-shadow(0 0 8px var(--accent)); }
.logo-text {font-family:"Roboto Mono", monospace; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-sub);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(74,222,128,0.15);
}
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.dev-credit {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 10px;
  padding: 0 4px;
  letter-spacing: 0.02em;
}
.dev-credit span {
  color: var(--accent);
  font-weight: 700;
  font-family: "Roboto Mono", monospace;
}
.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-sub);
  font-size: 1rem;
  transition: all var(--transition);
}
.theme-toggle:hover { background: var(--surface-hover); color: var(--text); }

/* ===== MOBILE HEADER ===== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  align-items: center;
  justify-content: space-between;
  z-index: 99;
  backdrop-filter: blur(12px);
}
.hamburger { background: none; color: var(--text); font-size: 1.2rem; }
.mobile-logo {font-family:"Roboto Mono", monospace;font-weight: 800; font-size: 1rem; }
.theme-toggle-sm { background: none; color: var(--text-sub); font-size: 1rem; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  padding: 36px 32px;
  min-height: 100vh;
}

/* ===== SUB PAGES ===== */
.sub-page { display: none; animation: fadeUp 0.35s ease both; }
.sub-page.active { display: block; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.page-title { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.page-sub { color: var(--text-sub); margin-top: 4px; font-size: 0.9rem; }

.date-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--text-sub);
  white-space: nowrap;
  font-weight: 500;
}

/* ===== STAT CARDS ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition);
  animation: fadeUp 0.4s ease both;
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--border-hover); box-shadow: var(--shadow-lg); }

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-sub);
}
.stat-value {
  font-family:"Roboto Mono", monospace;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  transition: color var(--transition);
}
.stat-sub { font-size: 0.8rem; color: var(--text-dim); }
.stat-icon { font-size: 1.2rem; margin-bottom: 4px; }

.stat-green { border-color: rgba(74,222,128,0.2); }
.stat-green .stat-value { color: var(--accent); }
.stat-blue { border-color: rgba(96,165,250,0.2); }
.stat-blue .stat-value { color: var(--accent2); }
.stat-orange { border-color: rgba(251,146,60,0.2); }
.stat-orange .stat-value { color: var(--orange); }
.stat-red { border-color: rgba(248,113,113,0.2); }
.stat-red .stat-value { color: var(--red); }
.stat-yellow { border-color: rgba(251,191,36,0.2); }
.stat-yellow .stat-value { color: var(--yellow); }

/* ===== ROW 2COL ===== */
.row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* ===== TREND CARD ===== */
.trend-card {
  display: flex;
  align-items: center;
  gap: 18px;
}
.trend-icon {
  font-size: 2.4rem;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface-hover);
}
.trend-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.trend-msg { font-size: 0.82rem; color: var(--text-sub); }

.trend-up .trend-icon { background: var(--red-dim); }
.trend-down .trend-icon { background: var(--accent-dim); }
.trend-stable .trend-icon { background: var(--accent2-dim); }

/* ===== PROGRESS CARD ===== */
.progress-card { display: flex; flex-direction: column; gap: 14px; }
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-sub);
}
.progress-pct {
 font-family:"Roboto Mono", monospace;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}
.progress-track {
  height: 10px;
  background: var(--bg3);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #22d3ee);
  border-radius: 999px;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ===== CHART ===== */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-head h3 { font-size: 1rem; font-weight: 700; }
.tag {
  font-size: 0.75rem;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
  color: var(--text-sub);
}
.chart-wrap { height: 200px; position: relative; }
.chart-wrap-lg { height: 340px; position: relative; }

.chart-filters { display: flex; gap: 6px; }
.filter-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-sub);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(74,222,128,0.25);
}

/* ===== LOG PAGE ===== */
.log-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.log-card { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.log-icon { font-size: 2.8rem; filter: drop-shadow(0 0 16px var(--accent)); }
.log-card h3 { font-size: 1.3rem; font-weight: 700; }
.log-date { color: var(--text-sub); font-size: 0.85rem; }
.log-input-wrap { position: relative; width: 100%; }
.log-input {
  font-family:"Roboto Mono", monospace;
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  padding: 16px 60px 16px 16px;
  border-radius: 14px;
  width: 100%;
}
.log-unit {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--text-sub);
  font-weight: 600;
}
.log-hint { font-size: 0.78rem; color: var(--text-dim); }

.bmi-breakdown { display: flex; flex-direction: column; gap: 14px; }
.bmi-breakdown h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.stat-row:last-child { border-bottom: none; }
.stat-row-label { color: var(--text-sub); }
.stat-row-value { font-weight: 700; font-family:"Roboto Mono", monospace; }

/* ===== HISTORY TABLE ===== */
.table-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; }
.history-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.history-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.history-table tr:last-child td { border-bottom: none; }
.history-table tbody tr:hover td { background: var(--surface-hover); }

.change-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.change-down { background: var(--accent-dim); color: var(--accent); }
.change-up { background: var(--red-dim); color: var(--red); }
.change-neutral { background: var(--surface-hover); color: var(--text-dim); }

.table-action-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-sub);
  border: 1px solid var(--border);
  margin-right: 6px;
  transition: all var(--transition);
}
.table-action-btn:hover { background: var(--surface-hover); color: var(--text); }
.table-action-btn.del:hover { background: var(--red-dim); color: var(--red); border-color: rgba(248,113,113,0.3); }

.entry-count {
  font-size: 0.82rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  color: var(--text-sub);
  align-self: center;
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-dim);
}

/* ===== CHART PAGE STATS ===== */
.cards-grid-sm {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

/* ===== SETTINGS ===== */
.settings-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.settings-right { display: flex; flex-direction: column; gap: 16px; }
.setting-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.danger-card { border-color: rgba(248,113,113,0.2); }
.danger-card h3 { color: var(--red); margin-bottom: 8px; }
.danger-card p { color: var(--text-sub); font-size: 0.85rem; margin-bottom: 14px; }
.settings-grid .glass-card { display: flex; flex-direction: column; gap: 16px; }
.settings-grid form { display: flex; flex-direction: column; gap: 14px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%;
  max-width: 400px;
  margin: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeUp 0.3s ease;
}
.modal h3 { font-size: 1.2rem; font-weight: 700; }
.modal p { color: var(--text-sub); font-size: 0.9rem; }
.modal-btns { display: flex; gap: 10px; margin-top: 4px; }
.modal-btns .btn { flex: 1; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 300;
  max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: rgba(74,222,128,0.3); color: var(--accent); }
.toast.error { border-color: rgba(248,113,113,0.3); color: var(--red); }

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    z-index: 100;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-overlay { display: block; }
  .mobile-header { display: flex; }
  .main-content { margin-left: 0; padding: 80px 16px 24px; }
  .row-2col { grid-template-columns: 1fr; }
  .log-layout { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 1.5rem; }
  .ob-brand h1 { font-size: 1.8rem; }
  .log-input { font-size: 1.8rem; }
}


/* ===== MOTIVATE PAGE ===== */
.motivate-hero {
  position: relative;
  overflow: hidden;
  padding: 36px 32px;
  border-color: rgba(74,222,128,0.25);
  background: linear-gradient(135deg, rgba(74,222,128,0.08) 0%, rgba(96,165,250,0.06) 100%);
  margin-bottom: 28px;
}
.motivate-hero::before {
  content: '"';
  position: absolute;
  top: -20px; left: 16px;
  font-size: 10rem;
  color: var(--accent);
  opacity: 0.06;
  font-family: Georgia, serif;
  line-height: 1;
  pointer-events: none;
}
.motivate-hero-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 18px;
}
.motivate-hero-quote {
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--text);
  font-style: italic;
  max-width: 680px;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.motivate-hero-quote.fade-out { opacity: 0; transform: translateY(8px); }
.motivate-hero-author {
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--text-sub);
  font-weight: 600;
}

.motivate-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}

/* Science fact cards */
.science-fact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeUp 0.5s ease both;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.science-fact-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.science-fact-icon { font-size: 1.8rem; line-height: 1; }
.science-fact-value {
  font-family: "Roboto Mono", monospace;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}
.science-fact-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.science-fact-desc {
  font-size: 0.8rem;
  color: var(--text-sub);
  line-height: 1.5;
  margin-top: 2px;
}

/* Habits tips grid */
.motivate-tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.habit-tip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeUp 0.5s ease both;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  cursor: default;
}
.habit-tip-card:hover {
  border-color: rgba(96,165,250,0.25);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.habit-tip-num {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent2);
  text-transform: uppercase;
}
.habit-tip-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.habit-tip-body {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.6;
}
.habit-tip-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent2);
  background: var(--accent2-dim);
  border-radius: 999px;
  padding: 2px 10px;
  align-self: flex-start;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }
.stat-card:nth-child(6) { animation-delay: 0.3s; }
.stat-card:nth-child(7) { animation-delay: 0.35s; }
.stat-card:nth-child(8) { animation-delay: 0.4s; }

/* ===== NUMBER COUNTER ===== */
@keyframes countUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.counting { animation: countUp 0.5s ease both; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ===== PWA INSTALL BANNER ===== */
.pwa-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid rgba(74,222,128,0.3);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(74,222,128,0.1);
  z-index: 400;
  width: calc(100% - 48px);
  max-width: 480px;
  animation: fadeUp 0.4s ease both;
}
.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pwa-banner-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px var(--accent));
}
.pwa-banner-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.pwa-banner-sub {
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-top: 2px;
}
.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pwa-install-btn {
  padding: 8px 18px;
  font-size: 0.85rem;
  white-space: nowrap;
}
.pwa-dismiss-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  padding: 4px 8px;
  cursor: pointer;
  transition: color var(--transition);
}
.pwa-dismiss-btn:hover { color: var(--text); }

/* ===== SIDEBAR INSTALL BTN ===== */
.sidebar-install-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  margin-top: 8px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  font-family: "Roboto Mono", monospace;
}
.sidebar-install-btn:hover {
  background: rgba(74,222,128,0.2);
  box-shadow: 0 4px 16px rgba(74,222,128,0.15);
}

/* ===== PWA GUIDE MODAL ===== */
.pwa-guide-modal { max-width: 460px; gap: 20px; }
.pwa-guide-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pwa-guide-logo {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px var(--accent));
  flex-shrink: 0;
}
.pwa-guide-header h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 2px; }
.pwa-guide-header p { font-size: 0.78rem; color: var(--text-sub); margin: 0; }
.pwa-guide-header .pwa-dismiss-btn { margin-left: auto; flex-shrink: 0; }

.pwa-guide-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.pwa-guide-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.pwa-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-sub);
  line-height: 1.5;
}
.pwa-step strong { color: var(--text); }
.pwa-step-num {
  min-width: 22px;
  height: 22px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
