:root {
  --color-primary: #2d5a27;
  --color-primary-hover: #1e4019;
  --color-secondary: #4a7c59;
  --color-secondary-hover: #3d6b4a;
  --color-accent: #e07b39;
  --color-accent-hover: #c96a2a;
  --color-bg: #fff8f4;
  --color-surface: #ffffff;
  --color-surface-alt: #f5f0ea;
  --color-border: #e0d9d1;
  --color-text: #1f1b17;
  --color-text-muted: #6b6258;
  --color-text-inverse: #ffffff;
  --color-error: #c0392b;
  --color-success: #27ae60;
  --color-warning: #e67e22;
  --color-skeleton: #e8e3dd;
  --color-skeleton-shine: #f2ede8;
  --color-bg-secondary: #d03921;

  /* Meal type badge tokens */
  --color-badge-breakfast-bg: #dbeafe;
  --color-badge-breakfast-text: #1e40af;
  --color-badge-breakfast-border: #bfdbfe;
  --color-badge-lunch-bg: #dcfce7;
  --color-badge-lunch-text: #166534;
  --color-badge-lunch-border: #bbf7d0;
  --color-badge-dinner-bg: #fee2e2;
  --color-badge-dinner-text: #991b1b;
  --color-badge-dinner-border: #fecaca;
  --color-badge-dessert-bg: #fce7f3;
  --color-badge-dessert-text: #9d174d;
  --color-badge-dessert-border: #fbcfe8;
  --color-badge-snack-bg: #fff7ed;
  --color-badge-snack-text: #9a3412;
  --color-badge-snack-border: #fed7aa;

  --font-display: 'Newsreader', Georgia, serif;
  --font-sans: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;

  --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;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  --transition: 0.2s ease;
  --navbar-height: 64px;
}

[data-theme="dark"] {
  --color-bg: #1a1714;
  --color-surface: #242018;
  --color-surface-alt: #2e2a24;
  --color-border: #3d3730;
  --color-text: #f0ece6;
  --color-text-muted: #9a9088;
  --color-skeleton: #2e2a24;
  --color-skeleton-shine: #3d3730;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-color: var(--color-primary);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration-color: var(--color-primary-hover);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  font-family: var(--font-sans);
}

input,
textarea,
select {
  font-family: var(--font-sans);
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
}

h1 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  line-height: 1.3;
}

h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  line-height: 1.4;
}

.text-muted {
  color: var(--color-text-muted);
}

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

.text-xs {
  font-size: var(--font-size-xs);
}

.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
}

.page-loader::after {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
