:root {
  --green-primary: #2d6a4f;
  --green-light: #52b788;
  --green-dark: #1b4332;
  --orange-accent: #f4722b;
  --orange-light: #ff9a5c;
  --dark: #1a1a2e;
  --charcoal: #2c3e50;
  --white: #ffffff;
  --gray-light: #f8f9fa;
  --gray-mid: #dee2e6;
  --text-muted: #888888;
  --text-soft: #555555;
  --font-main: 'Poppins', sans-serif;
  --radius-card: 20px;
  --radius-sm: 12px;
  --shadow-card: 0 8px 24px rgba(0,0,0,0.10);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.15);
  --nav-height: 70px;
  --transition: all 0.25s ease;
}

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

body {
  font-family: var(--font-main);
  background: var(--gray-light);
  color: var(--charcoal);
  min-height: 100vh;
  padding-bottom: var(--nav-height);
  -webkit-tap-highlight-color: transparent;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-weight: 700; color: var(--dark); }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p  { font-size: 0.92rem; line-height: 1.65; color: #555; }
small { font-size: 0.78rem; }

/* ── Page wrapper ── */
.page-wrapper { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--white); position: relative; }

/* ── Top Bar ── */
.top-bar {
  background: var(--green-primary);
  color: var(--white);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-bar .app-name { font-size: 1rem; font-weight: 700; letter-spacing: 0.5px; }
.top-bar .top-actions { display: flex; gap: 14px; align-items: center; }
.top-bar .icon-btn { background: rgba(255,255,255,0.15); border: none; color: var(--white); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.9rem; }
.rider-badge { background: var(--orange-accent); color: var(--white); font-size: 0.68rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-height);
  background: var(--white);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.10);
  display: flex;
  z-index: 1000;
  border-top: 1px solid var(--gray-mid);
}
.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #aaa;
  text-decoration: none;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: var(--transition);
  cursor: pointer;
}
.bottom-nav .nav-item i { font-size: 1.25rem; }
.bottom-nav .nav-item.active { color: var(--green-primary); }
.bottom-nav .nav-item:hover { color: var(--green-light); }

/* Center "Record" action — raised FAB style */
.bottom-nav .nav-fab { color: #fff; position: relative; }
.bottom-nav .nav-fab i {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-accent), var(--orange-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; color: #fff;
  box-shadow: 0 6px 18px rgba(244,114,43,0.5);
  border: 4px solid var(--white);
  transition: transform 0.15s ease;
}
.bottom-nav .nav-fab span { margin-top: 26px; color: var(--orange-accent); font-weight: 700; }
.bottom-nav .nav-fab:hover i { transform: translateX(-50%) scale(1.08); color: #fff; }
.bottom-nav .nav-fab:active i { transform: translateX(-50%) scale(0.94); }
[data-theme="dark"] .bottom-nav .nav-fab i { border-color: var(--white); }

/* ── Cards ── */
.card-base {
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: var(--transition);
}
.card-base:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.module-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 12px;
  text-align: center;
  cursor: pointer;
  gap: 10px;
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  text-decoration: none;
  color: var(--charcoal);
}
.module-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--charcoal); }
.module-card .icon-wrap {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: var(--white);
}
.module-card .card-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Hero Gradient Banner ── */
.hero-banner {
  background: linear-gradient(135deg, var(--green-primary), var(--green-dark));
  color: var(--white);
  padding: 24px 20px;
  border-radius: 0 0 30px 30px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 150px; height: 150px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

/* ── Buttons ── */
.btn-primary-green {
  background: linear-gradient(135deg, var(--green-primary), var(--green-light));
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(45,106,79,0.35);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary-green:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(45,106,79,0.45); }

.btn-orange {
  background: linear-gradient(135deg, var(--orange-accent), var(--orange-light));
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 12px 28px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(244,114,43,0.35);
}
.btn-orange:hover { transform: translateY(-2px); }

.btn-outline {
  background: transparent;
  color: var(--green-primary);
  border: 2px solid var(--green-primary);
  border-radius: 50px;
  padding: 10px 24px;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-outline:hover { background: var(--green-primary); color: var(--white); }

/* ── Section Headings ── */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 20px;
}
.section-title h2 { font-size: 1.05rem; font-weight: 700; }
.section-title .see-all { margin-left: auto; font-size: 0.78rem; color: var(--green-primary); font-weight: 600; text-decoration: none; }

/* ── Progress Bar ── */
.progress-wrap { background: rgba(255,255,255,0.25); border-radius: 50px; height: 8px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; border-radius: 50px; background: var(--orange-accent); transition: width 0.6s ease; }

/* ── Stat Pill ── */
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--white);
}

/* ── Tip Card ── */
.tip-card {
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border-left: 4px solid var(--green-primary);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 0 20px 20px;
}
.tip-card .tip-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--green-primary); margin-bottom: 6px; }
.tip-card p { font-size: 0.85rem; color: var(--charcoal); margin: 0; }

/* ── Lock overlay (premium gate) ── */
.premium-lock {
  position: relative;
}
.premium-lock::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(3px);
  border-radius: inherit;
  z-index: 2;
}
.lock-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--charcoal);
}
.lock-badge i { font-size: 1.6rem; color: var(--orange-accent); }
.lock-badge span { font-size: 0.7rem; font-weight: 700; white-space: nowrap; }

/* ── Chatbot ── */
.chatbot-btn {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  right: 20px;
  width: 54px; height: 54px;
  background: linear-gradient(135deg, var(--green-primary), var(--green-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(45,106,79,0.45);
  z-index: 500;
  transition: var(--transition);
}
.chatbot-btn:hover { transform: scale(1.1); }

.chatbot-window {
  position: fixed;
  bottom: calc(var(--nav-height) + 80px);
  right: 16px;
  width: 300px;
  max-height: 420px;
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 499;
  display: none;
  overflow: hidden;
}
.chatbot-window.active { display: flex; }
.chatbot-header { background: var(--green-primary); color: var(--white); padding: 14px 16px; font-size: 0.85rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.chatbot-header .close-chat { margin-left: auto; cursor: pointer; opacity: 0.8; }
.chatbot-messages { flex: 1; padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 80%; padding: 8px 12px; border-radius: 14px; font-size: 0.8rem; line-height: 1.5; }
.chat-msg.bot { background: #f0f4f8; color: var(--charcoal); border-bottom-left-radius: 4px; align-self: flex-start; }
.chat-msg.user { background: var(--green-primary); color: var(--white); border-bottom-right-radius: 4px; align-self: flex-end; }
.chatbot-input-row { display: flex; padding: 10px; gap: 8px; border-top: 1px solid var(--gray-mid); }
.chatbot-input-row input { flex: 1; border: 1px solid var(--gray-mid); border-radius: 50px; padding: 8px 14px; font-family: var(--font-main); font-size: 0.8rem; outline: none; }
.chatbot-input-row button { background: var(--green-primary); color: var(--white); border: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 0.85rem; }
.typing-dots span { display: inline-block; width: 6px; height: 6px; background: #aaa; border-radius: 50%; margin: 0 2px; animation: dotBounce 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ── Gear grid ── */
.gear-grid { width: 100%; border-collapse: separate; border-spacing: 4px; }
.gear-grid th { font-size: 0.68rem; font-weight: 700; color: var(--charcoal); padding: 6px 4px; text-align: center; background: var(--gray-light); border-radius: 6px; }
.gear-cell {
  width: 40px; height: 40px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  color: var(--white);
}
.gear-cell:hover { transform: scale(1.1); border-color: var(--dark); }
.gear-cell.selected { border-color: var(--dark); transform: scale(1.15); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.gear-easy   { background: #2d6a4f; }
.gear-medium { background: #f4a942; color: var(--dark); }
.gear-hard   { background: #f4722b; }
.gear-danger { background: #c0392b; }

/* ── Challenge calendar ── */
.challenge-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 0 20px; }
.day-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--gray-light);
  color: #aaa;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  position: relative;
}
.day-cell.done { background: var(--green-primary); color: var(--white); }
.day-cell.today { border-color: var(--orange-accent); color: var(--charcoal); background: #fff8f5; }
.day-cell.locked { background: #f0f0f0; color: #ccc; cursor: not-allowed; }
.day-cell.locked::after { content: '\f023'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; font-size: 0.6rem; bottom: 3px; right: 4px; color: var(--orange-accent); }

/* ── Utility classes ── */
.px-20 { padding-left: 20px; padding-right: 20px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-green { color: var(--green-primary); }
.text-orange { color: var(--orange-accent); }
.text-white { color: var(--white); }
.fw-700 { font-weight: 700; }
.text-center { text-align: center; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.w-100 { width: 100%; }

/* ── Animations ── */
@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spinWheel {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes pulseGreen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45,106,79,0.4); }
  50%       { box-shadow: 0 0 0 12px rgba(45,106,79,0); }
}
.fade-in-up { animation: fadeInUp 0.5s ease both; }
.pulse-green { animation: pulseGreen 2s infinite; }

/* ─────────────────────────────────────────────────────────────
   UX ENHANCEMENTS (toasts, ripple, reveal, skeletons, polish)
   ───────────────────────────────────────────────────────────── */

/* ── Smooth, GPU-friendly base transitions ── */
.module-card, .level-card, .challenge-strip, .btn-primary-green,
.btn-orange, .btn-outline, .submit-btn, .start-btn, .stat-card {
  will-change: transform;
}
.module-card:active, .level-card:active, .challenge-strip:active,
.stat-card:active, .ride-item:active {
  transform: scale(0.97);
  transition: transform 0.08s ease;
}
.btn-primary-green:active, .btn-orange:active, .submit-btn:active,
.start-btn:active, .btn-outline:active { transform: translateY(1px) scale(0.98); }

/* Snappier nav with a sliding active indicator */
.bottom-nav .nav-item { position: relative; }
.bottom-nav .nav-item.active::before {
  content: ''; position: absolute; top: 0; left: 50%;
  width: 28px; height: 3px; border-radius: 0 0 4px 4px;
  background: var(--green-primary); transform: translateX(-50%);
  animation: navPop 0.3s ease both;
}
.bottom-nav .nav-item.active i { animation: navBounce 0.4s ease; }
@keyframes navPop  { from { width: 0; opacity: 0; } to { width: 28px; opacity: 1; } }
@keyframes navBounce { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-4px); } }

/* Accessible focus ring */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible,
.module-card:focus-visible, .level-card:focus-visible {
  outline: 3px solid rgba(244,114,43,0.55); outline-offset: 2px; border-radius: 10px;
}

/* ── Scroll reveal ── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22,1,0.36,1); }
.reveal.revealed { opacity: 1; transform: none; }

/* ── Page transitions ── */
.page-enter { opacity: 0; }
.page-enter.page-enter-active { opacity: 1; transition: opacity 0.32s ease; }
.page-leave { opacity: 0; transform: translateY(-8px); transition: opacity 0.18s ease, transform 0.18s ease; }

/* ── Ripple ── */
.ripple-ink {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(255,255,255,0.45); transform: scale(0);
  animation: rippleOut 0.6s ease-out; z-index: 1;
}
.module-card .ripple-ink, .stat-card .ripple-ink, .nav-item .ripple-ink { background: rgba(45,106,79,0.18); }
@keyframes rippleOut { to { transform: scale(2.2); opacity: 0; } }

/* ── Toasts ── */
.toast-host {
  position: fixed; left: 50%; bottom: calc(var(--nav-height) + 18px);
  transform: translateX(-50%); z-index: 4000;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: max-content; max-width: 90vw; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: rgba(26,26,46,0.96); color: #fff;
  padding: 12px 18px; border-radius: 14px;
  font-size: 0.84rem; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.28);
  opacity: 0; transform: translateY(16px) scale(0.96);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22,1,0.36,1);
  pointer-events: auto; cursor: pointer;
}
.toast.show { opacity: 1; transform: none; }
.toast i { font-size: 1.05rem; }
.toast-action {
  background: rgba(255,255,255,0.18); color: #fff; border: none;
  border-radius: 50px; padding: 5px 14px; margin-left: 4px;
  font-family: var(--font-main); font-weight: 700; font-size: 0.78rem; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.toast-action:hover { background: rgba(255,255,255,0.32); }
.toast-success { background: linear-gradient(135deg,#1b4332,#2d6a4f); }
.toast-success i { color: #95d5b2; }
.toast-error   { background: linear-gradient(135deg,#7a1f17,#c0392b); }
.toast-error i { color: #ffd0c8; }
.toast-info i  { color: #6dd5fa; }

/* ── Skeleton loaders ── */
.skeleton {
  position: relative; overflow: hidden;
  background: #e9edf1; border-radius: 8px; color: transparent !important;
}
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
  transform: translateX(-100%); animation: shimmer 1.3s infinite;
}
.skeleton-line { height: 12px; margin: 6px 0; border-radius: 6px; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ── Install prompt bar ── */
.install-bar {
  position: fixed; left: 50%; bottom: calc(var(--nav-height) + 16px);
  transform: translate(-50%, 140%); width: calc(100% - 32px); max-width: 448px;
  background: #fff; border-radius: 18px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.22); z-index: 3500;
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
}
.install-bar.show { transform: translate(-50%, 0); }
.install-bar > i { font-size: 1.6rem; color: var(--green-primary); }
.install-text { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.install-text strong { font-size: 0.85rem; color: var(--dark); }
.install-text span { font-size: 0.7rem; color: #888; }
.install-yes { background: var(--green-primary); color: #fff; border: none; border-radius: 50px; padding: 8px 16px; font-family: var(--font-main); font-weight: 700; font-size: 0.8rem; cursor: pointer; }
.install-no { background: none; border: none; color: #aaa; font-size: 1.4rem; cursor: pointer; line-height: 1; padding: 0 4px; }

/* ── Quick-reply chips (chatbot) ── */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 4px; }
.chip {
  background: #eef4f1; color: var(--green-primary); border: 1px solid #d6e6df;
  border-radius: 50px; padding: 6px 12px; font-size: 0.72rem; font-weight: 600;
  font-family: var(--font-main); cursor: pointer; transition: var(--transition);
}
.chip:hover { background: var(--green-primary); color: #fff; }

/* ── Custom scrollbar ── */
.chatbot-messages::-webkit-scrollbar { width: 6px; }
.chatbot-messages::-webkit-scrollbar-thumb { background: #cdd6dd; border-radius: 4px; }

/* ── Respect reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ─────────────────────────────────────────────────────────────
   DARK MODE  (toggle persists in localStorage as 'theme')
   Attribute-prefixed selectors beat the per-page inline <style>
   rules on specificity, so surfaces re-skin without !important.
   ───────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --white: #1b2230;
  --gray-light: #0f141b;
  --gray-mid: #2a3340;
  --charcoal: #e6eaf0;
  --dark: #f1f5fa;
  --shadow-card: 0 6px 20px rgba(0,0,0,0.45);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.6);
  --text-muted: #7c8794;
  --text-soft: #9aa4b2;
  color-scheme: dark;
}

/* Smooth the flip between themes */
body, .page-wrapper, .module-card, .card-base, .bottom-nav,
.stat-card, .ride-item, .tip-card { transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; }

/* Base text */
[data-theme="dark"] p { color: #9aa4b2; }

/* White card surfaces */
[data-theme="dark"] .today-card,
[data-theme="dark"] .calc-section,
[data-theme="dark"] .history-item,
[data-theme="dark"] .food-card,
[data-theme="dark"] .part-card,
[data-theme="dark"] .fact-pill,
[data-theme="dark"] .maint-card,
[data-theme="dark"] .schedule-card,
[data-theme="dark"] .fact-card,
[data-theme="dark"] .music-section,
[data-theme="dark"] .compare-table,
[data-theme="dark"] .payment-section,
[data-theme="dark"] .safety-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .log-form,
[data-theme="dark"] .ride-item,
[data-theme="dark"] .exercise-card,
[data-theme="dark"] .playlist-item,
[data-theme="dark"] .route-card,
[data-theme="dark"] .surface-card { background: #1b2230; color: var(--charcoal); }

/* Routes page text + tags */
[data-theme="dark"] .rs-item, [data-theme="dark"] .route-desc { color: #9aa4b2; }
[data-theme="dark"] .rs-item b { color: var(--charcoal); }
[data-theme="dark"] .tag { background: #16251d; color: #7fd1a8; }

/* Green tint surfaces */
[data-theme="dark"] .meta-badge,
[data-theme="dark"] .food-badge,
[data-theme="dark"] .part-desc-box,
[data-theme="dark"] .priority-opt,
[data-theme="dark"] .ride-icon,
[data-theme="dark"] .ex-anim-box,
[data-theme="dark"] .gcash-box,
[data-theme="dark"] .surface-green { background: #16251d; color: #7fd1a8; border-color: #2f5a45; }

/* Warm tint surfaces */
[data-theme="dark"] .priority-rec,
[data-theme="dark"] .surface-warm { background: #33240f; color: #f0a35a; }

/* Pill buttons / tabs (white) */
[data-theme="dark"] .diet-tab,
[data-theme="dark"] .filter-btn { background: #1b2230; color: #9aa4b2; border-color: #2a3340; }

/* Grey tracks & headers */
[data-theme="dark"] .progress-track,
[data-theme="dark"] .phase-toggle { background: #232c39; }
[data-theme="dark"] .ct-header,
[data-theme="dark"] .col-header-free { background: #232c39; color: #9aa4b2; }

/* Inputs */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea { background: #141a23; color: var(--charcoal); border-color: #2a3340; }
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #5d6775; }
[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus { background: #1b2230; border-color: var(--green-light); }

/* Dark-on-light text now needs to be light */
[data-theme="dark"] .ride-name,
[data-theme="dark"] .food-name,
[data-theme="dark"] .part-name,
[data-theme="dark"] .sc-title,
[data-theme="dark"] .ex-name,
[data-theme="dark"] .pl-name,
[data-theme="dark"] .calendar-title,
[data-theme="dark"] .food-desc { color: var(--charcoal); }

/* Muted secondary text */
[data-theme="dark"] .ride-meta,
[data-theme="dark"] .sl,
[data-theme="dark"] .freq,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .ex-desc,
[data-theme="dark"] .part-desc { color: #7c8794; }

/* Component surfaces from the shared sheet */
[data-theme="dark"] .chat-msg.bot { background: #232c39; color: var(--charcoal); }
[data-theme="dark"] .chip { background: #1f2937; color: #7fd1a8; border-color: #2f5a45; }
[data-theme="dark"] .skeleton { background: #232c39; }
[data-theme="dark"] .install-bar { background: #1b2230; }
[data-theme="dark"] .install-text span { color: #7c8794; }
[data-theme="dark"] .tip-card { background: linear-gradient(135deg,#13251a,#16291b); border-left-color: var(--green-light); }
[data-theme="dark"] .tip-card p, [data-theme="dark"] .tip-card .tip-label { color: #cfe9d8; }
[data-theme="dark"] .day-cell { background: #1a212b; color: #5d6775; }
[data-theme="dark"] .day-cell.today { background: #2a2018; color: var(--charcoal); }
[data-theme="dark"] .day-cell.locked { background: #161c24; color: #3a4350; }
[data-theme="dark"] .chatbot-messages::-webkit-scrollbar-thumb { background: #3a4350; }

/* Theme toggle button (injected into the top bar) */
.theme-toggle i { transition: transform 0.4s cubic-bezier(0.22,1,0.36,1); }
[data-theme="dark"] .theme-toggle i { transform: rotate(180deg); }

/* ── Confetti ── */
.confetti-host { position: fixed; inset: 0; pointer-events: none; z-index: 5000; overflow: hidden; }
.confetti-piece {
  position: absolute; top: -16px; opacity: 0;
  animation-name: confettiFall; animation-timing-function: cubic-bezier(0.3,0.6,0.5,1);
  animation-fill-mode: forwards;
}
@keyframes confettiFall {
  0%   { opacity: 1; transform: translateY(-10px) rotateZ(0deg); }
  100% { opacity: 0; transform: translateY(105vh) rotateZ(720deg); }
}

/* Celebration pop for the completed-day button */
@keyframes celebratePop {
  0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); }
}
.celebrate { animation: celebratePop 0.5s ease; }

/* ── Swipe-to-delete (ride tracker) ── */
.ride-swipe { position: relative; border-radius: 14px; overflow: hidden; margin-bottom: 10px; }
.ride-swipe .ride-item { margin-bottom: 0; position: relative; z-index: 2; touch-action: pan-y; transition: transform 0.25s cubic-bezier(0.22,1,0.36,1); }
.ride-swipe .ride-delete {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(135deg,#c0392b,#e74c3c);
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; padding-right: 22px; color: #fff; font-weight: 700; font-size: 0.95rem; cursor: pointer;
}
.ride-swipe .ride-delete .swipe-hint { font-size: 0.72rem; opacity: 0.9; }
