/* style.css — Quest Academy Design Tokens + Components */

/* ============================================
   FONT LOADING
   ============================================ */
/* Fonts loaded in HTML:
   Fraunces (display) — playful optical serif
   Plus Jakarta Sans (body) — friendly geometric sans
*/

/* ============================================
   TYPE SCALE
   ============================================ */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.9rem  + 0.5vw,  1.125rem);
  --text-lg:   clamp(1.125rem, 0.95rem + 0.85vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1rem    + 1.5vw,  2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);

  /* ============================================
     SPACING (4px grid)
     ============================================ */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ============================================
     FONTS
     ============================================ */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Plus Jakarta Sans', 'Helvetica Neue', sans-serif;

  /* ============================================
     RADIUS
     ============================================ */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* ============================================
     TRANSITIONS
     ============================================ */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* ============================================
     CONTENT WIDTHS
     ============================================ */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;
}

/* ============================================
   AURA FARM — DISCORD × ROBLOX PALETTE
   Discord blurple primary. Dark-first.
   Roblox bold gaming energy on every surface.
   ============================================ */

:root, [data-theme="light"] {
  /* --- Surfaces (Discord Light) --- */
  --color-bg:               #f2f3f5;
  --color-surface:          #ffffff;
  --color-surface-2:        #f2f3f5;
  --color-surface-offset:   #e3e5e8;
  --color-surface-offset-2: #d4d7dc;
  --color-surface-dynamic:  #c4c9d4;
  --color-divider:          #e3e5e8;
  --color-border:           #d4d7dc;

  /* --- Text --- */
  --color-text:           #060607;
  --color-text-muted:     #4e5058;
  --color-text-faint:     #80848e;
  --color-text-inverse:   #ffffff;

  /* --- Primary (Discord Blurple) --- */
  --color-primary:          #5865f2;
  --color-primary-hover:    #4752c4;
  --color-primary-active:   #3c45a5;
  --color-primary-highlight: #e8eafd;

  /* --- Subject Colors --- */
  /* Code Lab — Terminal Green */
  --color-code:           #1e8449;
  --color-code-highlight: #d4f5e2;

  /* Think Tank — Nitro Violet */
  --color-think:          #7c3aed;
  --color-think-highlight: #ede9fe;

  /* Maker Studio — Roblox Red */
  --color-maker:          #dc2626;
  --color-maker-highlight: #fee2e2;

  /* Money Smarts — Coin Gold */
  --color-money:          #d97706;
  --color-money-highlight: #fef3c7;

  /* Explore — Sky Blue */
  --color-explore:        #0369a1;
  --color-explore-highlight: #e0f2fe;

  /* --- Semantic --- */
  --color-success:           #1e8449;
  --color-success-highlight: #d4f5e2;
  --color-warning:           #d97706;
  --color-warning-highlight: #fef3c7;
  --color-error:             #dc2626;
  --color-error-highlight:   #fee2e2;

  /* --- Aura Bar (Blurple gradient) --- */
  --color-xp:     linear-gradient(90deg, #5865f2, #9096f4);
  --color-xp-bg:  #e3e5e8;

  /* --- Screen Time Bar --- */
  --color-screen:          #0369a1;
  --color-screen-highlight: #e0f2fe;
  --color-screen-bar:      linear-gradient(90deg, #0369a1, #38bdf8);
  --color-screen-bar-bg:   #e0f2fe;

  /* --- Shadows --- */
  --shadow-sm:   0 1px 3px oklch(0.2 0.02 240 / 0.08);
  --shadow-md:   0 4px 12px oklch(0.2 0.02 240 / 0.12);
  --shadow-lg:   0 12px 32px oklch(0.2 0.02 240 / 0.16);
  --shadow-glow: 0 0 20px oklch(from var(--color-primary) l c h / 0.2);
}

/* ============================================
   DARK MODE — Discord Server
   ============================================ */
[data-theme="dark"] {
  /* --- Surfaces (Discord Dark) --- */
  --color-bg:               #1e1f22;
  --color-surface:          #2b2d31;
  --color-surface-2:        #313338;
  --color-surface-offset:   #2e3035;
  --color-surface-offset-2: #383a40;
  --color-surface-dynamic:  #404249;
  --color-divider:          #3f4147;
  --color-border:           #4e5058;

  /* --- Text --- */
  --color-text:           #dbdee1;
  --color-text-muted:     #b5bac1;
  --color-text-faint:     #80848e;
  --color-text-inverse:   #ffffff;

  /* --- Primary (Discord Blurple — same both modes) --- */
  --color-primary:          #5865f2;
  --color-primary-hover:    #4752c4;
  --color-primary-active:   #3c45a5;
  --color-primary-highlight: #1f2060;

  /* --- Subject Colors (vivid on dark) --- */
  --color-code:           #23a55a;
  --color-code-highlight: #1a3327;

  --color-think:          #a17eff;
  --color-think-highlight: #2a1f4a;

  --color-maker:          #f23f43;
  --color-maker-highlight: #3d1214;

  --color-money:          #f0b232;
  --color-money-highlight: #3d2c0a;

  --color-explore:        #1d9bd1;
  --color-explore-highlight: #0f2535;

  /* --- Semantic --- */
  --color-success:           #23a55a;
  --color-success-highlight: #1a3327;
  --color-warning:           #f0b232;
  --color-warning-highlight: #3d2c0a;
  --color-error:             #f23f43;
  --color-error-highlight:   #3d1214;

  /* --- Aura Bar (Blurple) --- */
  --color-xp:     linear-gradient(90deg, #5865f2, #9096f4);
  --color-xp-bg:  #2b2d31;

  /* --- Screen Time Bar --- */
  --color-screen:          #1d9bd1;
  --color-screen-highlight: #0f2535;
  --color-screen-bar:      linear-gradient(90deg, #1d9bd1, #5bc0eb);
  --color-screen-bar-bg:   #1a2d3a;

  /* --- Shadows --- */
  --shadow-sm:   0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md:   0 4px 16px oklch(0 0 0 / 0.4);
  --shadow-lg:   0 8px 32px oklch(0 0 0 / 0.5);
  --shadow-glow: 0 0 24px oklch(from var(--color-primary) l c h / 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:               #1e1f22;
    --color-surface:          #2b2d31;
    --color-surface-2:        #313338;
    --color-surface-offset:   #2e3035;
    --color-surface-offset-2: #383a40;
    --color-surface-dynamic:  #404249;
    --color-divider:          #3f4147;
    --color-border:           #4e5058;
    --color-text:             #dbdee1;
    --color-text-muted:       #b5bac1;
    --color-text-faint:       #80848e;
    --color-text-inverse:     #ffffff;
    --color-primary:          #5865f2;
    --color-primary-hover:    #4752c4;
    --color-primary-active:   #3c45a5;
    --color-primary-highlight: #1f2060;
    --color-code:             #23a55a;
    --color-code-highlight:   #1a3327;
    --color-think:            #a17eff;
    --color-think-highlight:  #2a1f4a;
    --color-maker:            #f23f43;
    --color-maker-highlight:  #3d1214;
    --color-money:            #f0b232;
    --color-money-highlight:  #3d2c0a;
    --color-explore:          #1d9bd1;
    --color-explore-highlight: #0f2535;
    --color-success:           #23a55a;
    --color-success-highlight: #1a3327;
    --color-warning:           #f0b232;
    --color-warning-highlight: #3d2c0a;
    --color-error:             #f23f43;
    --color-error-highlight:   #3d1214;
    --color-xp:    linear-gradient(90deg, #5865f2, #9096f4);
    --color-xp-bg: #2b2d31;
    --shadow-sm:   0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md:   0 4px 16px oklch(0 0 0 / 0.4);
    --shadow-lg:   0 8px 32px oklch(0 0 0 / 0.5);
    --shadow-glow: 0 0 24px oklch(from var(--color-primary) l c h / 0.35);
  }
}

/* ============================================
   GLOBAL COMPONENT STYLES
   ============================================ */

/* Numeric values */
.tabular-nums {
  font-variant-numeric: tabular-nums lining-nums;
}

/* Card base */
.card {
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: box-shadow var(--transition-interactive),
              transform var(--transition-interactive),
              border-color var(--transition-interactive);
}

.card-interactive:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.card-interactive:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition-interactive),
              color var(--transition-interactive),
              box-shadow var(--transition-interactive),
              transform var(--transition-interactive);
  cursor: pointer;
  border: none;
  min-height: 44px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-primary:active {
  background: var(--color-primary-active);
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid oklch(from var(--color-text) l c h / 0.1);
}
.btn-ghost:hover {
  background: var(--color-surface-dynamic);
  color: var(--color-text);
}

.btn-subject {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-height: auto;
}

/* Badge/Chip */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
}

/* XP Progress Bar */
.xp-bar-wrap {
  background: var(--color-xp-bg);
  border-radius: var(--radius-full);
  height: 12px;
  overflow: hidden;
  position: relative;
}

.xp-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-xp);
  transition: width 800ms var(--ease-out);
  position: relative;
}

.xp-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, oklch(1 0 0 / 0.2) 50%, transparent 100%);
  animation: xp-shimmer 2s ease-in-out infinite;
}

@keyframes xp-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Screen Time Bar */
.screen-bar-wrap {
  background: var(--color-screen-bar-bg);
  border-radius: var(--radius-full);
  height: 12px;
  overflow: hidden;
  position: relative;
}

.screen-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-screen-bar);
  transition: width 800ms var(--ease-out);
  position: relative;
}

.screen-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, oklch(1 0 0 / 0.2) 50%, transparent 100%);
  animation: xp-shimmer 2s ease-in-out infinite;
}

/* Stars rating */
.stars {
  display: flex;
  gap: var(--space-1);
}
.stars .star {
  cursor: pointer;
  color: var(--color-text-faint);
  transition: color var(--transition-interactive), transform var(--transition-interactive);
}
.stars .star.filled,
.stars .star:hover,
.stars .star:hover ~ .star {
  color: var(--color-primary);
}
.stars .star:hover {
  transform: scale(1.2);
}

/* Navigation */
.nav-bar {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: oklch(from var(--color-surface) l c h / 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: var(--space-2);
}

.nav-links {
  display: flex;
  gap: var(--space-1);
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition-interactive),
              background var(--transition-interactive);
  min-height: 44px;
}

.nav-link:hover {
  color: var(--color-text);
  background: var(--color-surface-dynamic);
}

.nav-link.active {
  color: var(--color-primary);
  background: var(--color-primary-highlight);
  font-weight: 600;
}

.nav-link svg, .nav-link i {
  width: 18px;
  height: 18px;
}

/* Section headers */
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

/* Parent Mode Toggle */
.parent-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-interactive);
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
}

.parent-toggle.active {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  border-color: oklch(from var(--color-primary) l c h / 0.2);
}

/* Modals / Dialogs */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms var(--ease-out);
  padding: var(--space-4);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 300ms var(--ease-out);
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

/* Form elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.form-input,
.form-select,
.form-textarea {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid oklch(from var(--color-text) l c h / 0.12);
  background: var(--color-bg);
  font-size: var(--text-base);
  transition: border-color var(--transition-interactive),
              box-shadow var(--transition-interactive);
  min-height: 44px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.15);
  outline: none;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Subject color utilities */
.subject-code { color: var(--color-code); }
.subject-think { color: var(--color-think); }
.subject-maker { color: var(--color-maker); }
.subject-money { color: var(--color-money); }
.subject-explore { color: var(--color-explore); }

.bg-code { background: var(--color-code-highlight); color: var(--color-code); }
.bg-think { background: var(--color-think-highlight); color: var(--color-think); }
.bg-maker { background: var(--color-maker-highlight); color: var(--color-maker); }
.bg-money { background: var(--color-money-highlight); color: var(--color-money); }
.bg-explore { background: var(--color-explore-highlight); color: var(--color-explore); }

/* Level badge colors */
.level-explorer { background: var(--color-code-highlight); color: var(--color-code); }
.level-inventor { background: var(--color-think-highlight); color: var(--color-think); }
.level-scientist { background: var(--color-maker-highlight); color: var(--color-maker); }
.level-innovator { background: var(--color-money-highlight); color: var(--color-money); }
.level-visionary { background: var(--color-primary-highlight); color: var(--color-primary); }

/* Empty states */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--color-text-muted);
}
.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
}
.empty-state h3 {
  color: var(--color-text);
  margin-bottom: var(--space-2);
  font-family: var(--font-display);
}
.empty-state p {
  max-width: 36ch;
  margin-bottom: var(--space-6);
}

/* Responsive layout */
.page-content {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
  background-image: radial-gradient(ellipse 100% 280px at 50% 0%, oklch(from var(--color-primary) l c h / 0.05) 0%, transparent 100%);
  background-repeat: no-repeat;
}

@media (min-width: 768px) {
  .page-content {
    padding: var(--space-8);
  }
}

/* Grid layouts */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  gap: var(--space-4);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Scrollable horizontal */
.scroll-x {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-2);
  scrollbar-width: thin;
}

/* Skeleton loading */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-offset) 25%,
    var(--color-surface-dynamic) 50%,
    var(--color-surface-offset) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* Confetti animation for celebrations */
@keyframes confetti-fall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  z-index: 9999;
  pointer-events: none;
  animation: confetti-fall 3s ease-in forwards;
}

/* Page header with greeting */
.page-header {
  margin-bottom: var(--space-6);
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.page-header .subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
}

/* Stat Card */
.stat-card {
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.stat-card .stat-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-text);
  font-variant-numeric: tabular-nums lining-nums;
}

.stat-card .stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card .stat-icon svg {
  width: 18px;
  height: 18px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-faint);
}

/* ============================================
   MOBILE PORTRAIT — iPhone Optimized
   ============================================ */

/* iOS safe area support */
@supports (padding: env(safe-area-inset-bottom)) {
  :root {
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
    --safe-left: env(safe-area-inset-left);
    --safe-right: env(safe-area-inset-right);
  }
}

/* PWA standalone: extra top padding for status bar */
@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top, 0px);
  }
}

@media (min-width: 0px) { /* FORCED MOBILE VIEW */
  /* Bottom tab bar */
  .nav-bar {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    border-bottom: none;
    border-top: none;
    z-index: 100;
    padding: var(--space-1) var(--space-2);
    padding-bottom: calc(var(--space-1) + env(safe-area-inset-bottom, 8px));
    background: var(--color-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .nav-links {
    justify-content: space-around;
    gap: 0;
  }

  .nav-link {
    flex-direction: column;
    font-size: var(--text-xs);
    gap: 2px;
    padding: var(--space-1) var(--space-2);
    min-height: 48px;
    border-radius: var(--radius-md);
  }

  .nav-link .nav-text {
    display: block;
    font-size: 10px;
    letter-spacing: 0.01em;
  }

  .nav-link svg, .nav-link i {
    width: 22px;
    height: 22px;
  }

  .nav-right {
    display: none !important;
  }

  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 8px));
  }

  /* Page content — tighter padding for portrait */
  .page-content {
    padding: var(--space-4) var(--space-4);
    padding-bottom: var(--space-8);
  }

  /* Greeting — smaller on mobile */
  .page-header h1 {
    font-size: var(--text-xl);
    line-height: 1.2;
  }

  .page-header .subtitle {
    font-size: var(--text-sm);
  }

  /* Stat cards — 2x2 grid on mobile */
  .grid-stats {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }

  .stat-card {
    padding: var(--space-3);
    gap: var(--space-1);
  }

  .stat-card .stat-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
  }

  .stat-card .stat-icon svg {
    width: 14px;
    height: 14px;
  }

  .stat-card .stat-label {
    font-size: 10px;
  }

  .stat-card .stat-value {
    font-size: var(--text-lg);
  }

  /* Earnings +/- buttons — slightly smaller on mobile */
  .earnings-btn-group {
    top: var(--space-1);
    right: var(--space-1);
  }

  .earnings-add-btn,
  .earnings-burn-btn {
    width: 24px;
    height: 24px;
  }

  /* XP level bar — compact */
  .xp-bar-wrap {
    height: 10px;
  }

  /* Section titles — smaller */
  .section-title {
    font-size: var(--text-base);
    margin-bottom: var(--space-3);
  }

  /* Cards — tighter padding */
  .card {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
  }

  /* Weekly progress circles — fit 5 in a row */
  .grid-2 {
    gap: var(--space-3);
  }

  /* Habits grid — single column on mobile */
  .chores-grid {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }

  .chore-item {
    padding: var(--space-2) var(--space-3);
    min-height: 44px;
  }

  /* Full-page chore cards */
  .chore-card-full .card {
    padding: var(--space-3);
  }

  /* Modals — full width on mobile, bottom sheet style */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    max-width: 100%;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    padding: var(--space-5) var(--space-4);
    padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 16px));
    max-height: 90vh;
  }

  .modal h2 {
    font-size: var(--text-lg);
  }

  /* Buttons — full width in modals on mobile */
  .modal .btn {
    width: 100%;
    justify-content: center;
  }

  /* Parent actions — stack vertically */
  .parent-only {
    gap: var(--space-2);
  }

  /* Form inputs — larger touch targets */
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
    min-height: 48px;
    padding: var(--space-3);
  }

  /* Scroll horizontal sections — snap */
  .scroll-x {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .scroll-x > * {
    scroll-snap-align: start;
  }

  /* Badge sizing */
  .badge {
    font-size: 10px;
    padding: 2px var(--space-2);
  }

  /* Quest plan cards */
  .quest-plan-card {
    margin-bottom: var(--space-2);
  }

  /* Quest map week cards */
  .grid-3 {
    gap: var(--space-3);
  }

  /* Skills page */
  .grid-skills {
    grid-template-columns: 1fr;
  }

  /* Touch feedback for all interactive elements */
  .btn:active,
  .card-interactive:active,
  .chore-item:active,
  .nav-link:active {
    opacity: 0.85;
    transform: scale(0.97);
  }

  /* Prevent text selection on interactive elements */
  .btn,
  .nav-link,
  .chore-item,
  .parent-toggle {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
  }
}

/* Extra small phones (iPhone SE, etc.) */
@media (max-width: 375px) {
  .page-content {
    padding: var(--space-3) var(--space-3);
  }

  .stat-card .stat-value {
    font-size: var(--text-base);
  }

  .page-header h1 {
    font-size: var(--text-lg);
  }

  .grid-stats {
    gap: var(--space-2);
  }
}

/* Mobile Parent Mode FAB + Theme Toggle */
.mobile-fab-group {
  display: none;
}

@media (min-width: 0px) { /* FORCED MOBILE VIEW */
  .mobile-fab-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    position: fixed;
    top: calc(var(--space-3) + env(safe-area-inset-top, 0px));
    right: var(--space-3);
    z-index: 101;
  }

  .mobile-parent-fab,
  .mobile-theme-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--color-surface);
    color: var(--color-text-muted);
    border: 1px solid oklch(from var(--color-text) l c h / 0.1);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all var(--transition-interactive);
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-parent-fab:active,
  .mobile-theme-fab:active {
    transform: scale(0.9);
  }

  .parent-mode .mobile-parent-fab {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
  }
}

/* Hide/show utilities */
.hidden { display: none !important; }
.parent-only { display: none; }
.parent-mode .parent-only { display: flex; }

/* ============================================
   CHORES — Dashboard Mini Widget
   ============================================ */
.chores-card {
  border-color: oklch(from var(--color-warning) l c h / 0.15);
}
.chores-card.chores-complete {
  border-color: oklch(from var(--color-success) l c h / 0.2);
  background: var(--color-success-highlight);
}

.chores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: var(--space-2);
}

.chore-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--color-surface-offset);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-interactive);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  text-align: left;
  min-height: 44px;
}
.chore-item:hover {
  background: var(--color-surface-dynamic);
  border-color: oklch(from var(--color-text) l c h / 0.08);
}
.chore-item.chore-done {
  background: var(--color-success-highlight);
}
.chore-item.chore-done .chore-label {
  text-decoration: line-through;
  color: var(--color-text-muted);
}
.chore-item.chore-done .chore-xp {
  color: var(--color-success);
}

.chore-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chore-xp {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  flex-shrink: 0;
}

/* Chore checkbox (mini) */
.chore-check {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-interactive);
  color: transparent;
}
.chore-check.checked {
  background: var(--color-success);
  border-color: var(--color-success);
  color: var(--color-text-inverse);
}

/* Chore checkbox (full page) */
.chore-check-lg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2.5px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-interactive);
  color: transparent;
}
.chore-check-lg.checked {
  background: var(--color-success);
  border-color: var(--color-success);
  color: var(--color-text-inverse);
}

/* Full page chore card */
.chore-card-full {
  transition: all var(--transition-interactive);
}
.chore-card-full:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.chore-card-full:active {
  transform: translateY(0) scale(0.99);
  box-shadow: var(--shadow-sm);
}
.chore-card-done {
  background: var(--color-success-highlight);
  border-color: oklch(from var(--color-success) l c h / 0.15);
}

/* ============================================
   QUEST PLAN CARDS
   ============================================ */
.quest-plan-card summary {
  list-style: none;
}
.quest-plan-card summary::-webkit-details-marker {
  display: none;
}
.quest-plan-card summary::marker {
  display: none;
  content: '';
}
.quest-plan-card {
  transition: box-shadow 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.quest-plan-card:hover {
  box-shadow: var(--shadow-md);
}
.quest-plan-card[open] summary .lucide-chevron-down {
  transform: rotate(180deg);
}

/* ============================================
   EARNINGS ADD BUTTON
   ============================================ */
.earnings-add-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 1.5px solid oklch(from var(--color-money) l c h / 0.25);
  background: var(--color-money-highlight);
  color: var(--color-money);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.earnings-add-btn:hover {
  background: var(--color-money);
  color: white;
  border-color: var(--color-money);
  transform: scale(1.1);
}
.earnings-btn-group {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: flex;
  gap: 4px;
}
.earnings-burn-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 1.5px solid oklch(from var(--color-error) l c h / 0.25);
  background: var(--color-error-highlight);
  color: var(--color-error);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.earnings-burn-btn:hover {
  background: var(--color-error);
  color: white;
  border-color: var(--color-error);
  transform: scale(1.1);
}

/* ============================================
   HABIT SWIPE — Dot indicators & touch
   ============================================ */
.habit-swipe-container {
  position: relative;
  touch-action: pan-y pinch-zoom;
}

.habit-swipe-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-3) 0 var(--space-1);
}

.habit-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  background: var(--color-surface-offset);
  color: var(--color-text-faint);
  cursor: pointer;
  transition: all var(--transition-interactive);
  -webkit-tap-highlight-color: transparent;
}

.habit-dot.active {
  border-color: var(--color-primary);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  box-shadow: 0 0 8px oklch(from var(--color-primary) l c h / 0.15);
}

.habit-dot:not(.active):hover {
  border-color: var(--color-text-muted);
  color: var(--color-text-muted);
  background: var(--color-surface-dynamic);
}

/* Habit icon select in edit modal */
.habit-icon-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236d6a60' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 20px !important;
}

/* ============================================
   DASHBOARD UI IMPROVEMENTS
   ============================================ */

/* Staggered card entry animation */
@keyframes slide-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dash-section {
  animation: slide-up 380ms var(--ease-out) both;
}
.dash-section:nth-child(1) { animation-delay:  40ms; }
.dash-section:nth-child(2) { animation-delay: 100ms; }
.dash-section:nth-child(3) { animation-delay: 160ms; }
.dash-section:nth-child(4) { animation-delay: 220ms; }
.dash-section:nth-child(5) { animation-delay: 280ms; }
.dash-section:nth-child(6) { animation-delay: 340ms; }
.dash-section:nth-child(7) { animation-delay: 400ms; }
.dash-section:nth-child(8) { animation-delay: 460ms; }

/* Section header with coloured dot accent */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.section-header h2 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}
.section-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  flex-shrink: 0;
}

/* Today's subject pill */
.today-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  border: 1px solid;
  margin-top: var(--space-2);
}

/* Stat card — dashboard hover lift */
.stat-card-dash {
  cursor: default;
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}
.stat-card-dash:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.stat-card-dash:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Voice lesson pulsing icon */
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 oklch(from var(--color-primary) l c h / 0.45); }
  60%       { box-shadow: 0 0 0 10px oklch(from var(--color-primary) l c h / 0); }
}
.voice-cta-icon {
  animation: voice-pulse 2.8s ease-in-out infinite;
}

/* Screen time pip row */
.screen-pips {
  display: flex;
  gap: 4px;
  margin-top: var(--space-3);
}
.screen-pip {
  flex: 1;
  height: 8px;
  border-radius: var(--radius-full);
  transition: background 400ms var(--ease-out);
}
.screen-pip.filled  { background: var(--color-screen); }
.screen-pip.empty   { background: oklch(from var(--color-screen) l c h / 0.15); }

/* ============================================
   DARK MODE — screen tokens (media query cover)
   ============================================ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-screen:           #1d9bd1;
    --color-screen-highlight: #0f2535;
    --color-screen-bar:       linear-gradient(90deg, #1d9bd1, #5bc0eb);
    --color-screen-bar-bg:    #1a2d3a;
    --color-xp:               linear-gradient(90deg, #5865f2, #9096f4);
    --color-xp-bg:            #2b2d31;
  }
}

/* ============================================
   ACHIEVEMENT GLOW-UP
   ============================================ */
@keyframes achievement-shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

.achievement-icon-glow {
  background: linear-gradient(
    110deg,
    var(--color-primary-highlight) 30%,
    oklch(from var(--color-primary) l c h / 0.3) 50%,
    var(--color-primary-highlight) 70%
  );
  background-size: 300% auto;
  animation: achievement-shimmer 2.5s linear infinite;
  box-shadow: 0 0 0 2px oklch(from var(--color-primary) l c h / 0.25),
              0 4px 16px oklch(from var(--color-primary) l c h / 0.2);
}

.achievement-card-unlocked {
  transition: transform var(--transition-interactive), box-shadow var(--transition-interactive);
}
.achievement-card-unlocked:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px oklch(from var(--color-primary) l c h / 0.2);
}

/* ============================================
   HABIT COMPLETION CHART (sparkline bars)
   ============================================ */
.habit-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 48px;
  padding: var(--space-2) 0;
}
.habit-chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  cursor: default;
}
.habit-chart-bar {
  width: 100%;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  min-height: 3px;
  transition: height 400ms var(--ease-out), background 300ms;
}
.habit-chart-bar.all-done {
  background: var(--color-success);
}
.habit-chart-bar.partial {
  background: var(--color-warning);
}
.habit-chart-bar.none {
  background: var(--color-surface-dynamic);
}

/* ============================================
   DISCORD × ROBLOX — GAMING ENERGY POLISH
   ============================================ */

/* --- Bolder primary button (Roblox chunky feel) --- */
.btn-primary {
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 0 oklch(from var(--color-primary) 0.35 c h);
}
.btn-primary:hover {
  box-shadow: 0 3px 0 oklch(from var(--color-primary) 0.3 c h), var(--shadow-md);
}
.btn-primary:active {
  box-shadow: 0 1px 0 oklch(from var(--color-primary) 0.3 c h);
}

/* --- Page heading — heavy Fraunces for Roblox-style pop --- */
.page-header h1 {
  font-weight: 900;
  letter-spacing: -0.02em;
}

/* --- Nav active state — Discord sidebar indicator --- */
.nav-link.active {
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--color-primary);
}
@media (min-width: 0px) {
  /* Bottom bar: no underline shadow — active state shown by bg + color */
  .nav-link.active {
    box-shadow: none;
  }
}

/* --- Badges — chunkier pill (Roblox style) --- */
.badge {
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* --- Level badges — vivid fills --- */
.level-explorer  { background: var(--color-code-highlight);    color: var(--color-code);    font-weight: 800; }
.level-inventor  { background: var(--color-think-highlight);   color: var(--color-think);   font-weight: 800; }
.level-scientist { background: var(--color-maker-highlight);   color: var(--color-maker);   font-weight: 800; }
.level-innovator { background: var(--color-money-highlight);   color: var(--color-money);   font-weight: 800; }
.level-visionary {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  font-weight: 800;
  box-shadow: 0 0 8px oklch(from var(--color-primary) l c h / 0.35);
}

/* --- Aura bar — taller + glow for gaming feel --- */
.xp-bar-wrap { height: 14px; }
.xp-bar-fill::after {
  background: linear-gradient(90deg, transparent 0%, oklch(1 0 0 / 0.3) 50%, transparent 100%);
}

/* --- Modal overlay — Discord darker scrim --- */
.modal-overlay {
  background: oklch(0 0 0 / 0.72);
}

/* --- Card hover glow (subtle blurple) --- */
.card-interactive:hover {
  border-color: oklch(from var(--color-primary) l c h / 0.2);
  box-shadow: var(--shadow-md), 0 0 0 1px oklch(from var(--color-primary) l c h / 0.12);
}

/* --- Section labels — Discord uppercase caps style --- */
.section-header h2,
.stat-card .stat-label {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --- Chore done state — blurple tint (Discord reaction) --- */
.chore-item.chore-done {
  background: var(--color-primary-highlight);
  border-color: oklch(from var(--color-primary) l c h / 0.2);
}
.chore-check.checked,
.chore-check-lg.checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 0 6px oklch(from var(--color-primary) l c h / 0.4);
}

/* --- Achievement unlocked hover glow (bigger on dark) --- */
.achievement-card-unlocked:hover {
  box-shadow: 0 8px 24px oklch(from var(--color-primary) l c h / 0.25);
}

/* --- Scrollbar — blurple thumb --- */
::-webkit-scrollbar-thumb {
  background: oklch(from var(--color-primary) l c h / 0.4);
}
::-webkit-scrollbar-thumb:hover {
  background: oklch(from var(--color-primary) l c h / 0.65);
}

/* --- Selection highlight — Discord blurple --- */
::selection {
  background: oklch(from var(--color-primary) l c h / 0.3);
  color: var(--color-text);
}

/* --- Focus ring — Discord blurple --- */
:focus-visible {
  outline-color: var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

/* ============================================================
   NEW FEATURE STYLES
   ============================================================ */

/* --- Level-up overlay --- */
@keyframes level-up-pop {
  0%   { transform: scale(0.3) rotate(-10deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes level-up-glow {
  0%, 100% { box-shadow: 0 0 24px oklch(from var(--color-primary) l c h / 0.4); }
  50%       { box-shadow: 0 0 48px oklch(from var(--color-primary) l c h / 0.8); }
}
.level-up-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: oklch(0 0 0 / 0.85);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.level-up-card {
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  padding: var(--space-10) var(--space-12);
  text-align: center;
  animation: level-up-pop 600ms var(--ease-out) both, level-up-glow 2s ease-in-out 0.6s infinite;
  max-width: 320px;
}
.level-up-emoji { font-size: 72px; line-height: 1; margin-bottom: var(--space-4); }
.level-up-title { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 900; color: var(--color-primary); margin-bottom: var(--space-2); }
.level-up-name  { font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--space-3); }
.level-up-hint  { font-size: var(--text-xs); color: var(--color-text-muted); }

/* --- Burn-fly animation (fire particles going UP) --- */
@keyframes burn-fly {
  0%   { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-120vh) scale(0.2) rotate(180deg); opacity: 0; }
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* --- Habit heatmap (GitHub-style 365-day) --- */
.habit-heatmap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.habit-heatmap-cell { width: 11px; height: 11px; border-radius: 2px; flex-shrink: 0; }

/* --- Screen timer display --- */
.screen-timer-display {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  line-height: 1;
}
.screen-timer-display.urgent { color: var(--color-error); }

/* --- AURA shop grid --- */
.shop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.shop-item {
  background: var(--color-surface-offset);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  text-align: center;
  border: 2px solid transparent;
  transition: border-color var(--transition-interactive), transform var(--transition-interactive);
  cursor: pointer;
}
.shop-item:not([disabled]):hover { border-color: var(--color-primary); transform: translateY(-2px); }
.shop-item[disabled] { opacity: 0.45; cursor: not-allowed; }
.shop-item-emoji { font-size: 36px; line-height: 1; margin-bottom: var(--space-2); }
.shop-item-name  { font-weight: 700; font-size: var(--text-sm); margin-bottom: var(--space-1); }
.shop-item-desc  { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-3); }
.shop-item-cost  { display: inline-flex; align-items: center; gap: 4px; background: var(--color-primary-highlight); color: var(--color-primary); font-weight: 700; font-size: var(--text-xs); padding: 2px var(--space-2); border-radius: var(--radius-full); }

/* --- Spending log mini list --- */
.spend-log-item { display: flex; justify-content: space-between; align-items: center; padding: var(--space-1) 0; font-size: var(--text-xs); border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.06); }
.spend-log-item:last-child { border-bottom: none; }
.spend-log-add    { color: var(--color-success); font-weight: 700; }
.spend-log-deduct { color: var(--color-error);   font-weight: 700; }

/* --- Weekly habit summary card --- */
.habit-week-bar { height: 6px; border-radius: var(--radius-full); background: oklch(from var(--color-text) l c h / 0.08); overflow: hidden; margin-top: var(--space-2); }
.habit-week-bar-fill { height: 100%; border-radius: var(--radius-full); transition: width 600ms var(--ease-out); }
