/* ============================================================
   CSS CUSTOM PROPERTIES — Material Design Tokens
   ============================================================ */
:root {
  --color-white: #FFFFFF;
  --color-primary: #1A73E8;
  --color-primary-dark: #1557B0;
  --color-primary-light: #E8F0FE;
  --color-text: #202124;
  --color-text-secondary: #5F6368;
  --color-bg-light: #F1F3F4;
  --color-border: #E8EAED;
  --color-overlay: rgba(32, 33, 36, 0.5);
  --color-success: #0F9D58;
  --color-warning: #F9AB00;
  --color-error: #EA4335;

  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 24px;
  --radius-full: 50%;

  --shadow-1: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  --shadow-2: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
  --shadow-3: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);

  --header-height: 56px;
  --drawer-width: 300px;
  --transition-speed: 300ms;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   SKIP LINK
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 1000;
  padding: 8px 16px;
  background-color: var(--color-primary);
  color: var(--color-white);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 150ms ease;
}
.skip-link:focus { top: 8px; }
.skip-link:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

/* ============================================================
   HEADER
   ============================================================ */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}

.header-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--color-text);
  font-size: clamp(13px, 3.5vw, 18px); font-weight: 500; letter-spacing: -0.2px;
  white-space: nowrap;
}

/* Desktop nav */
#desktop-nav { display: none; }
#desktop-nav ul { list-style: none; display: flex; gap: 4px; align-items: center; }
#desktop-nav a {
  display: block; padding: 8px 16px;
  color: var(--color-text-secondary); text-decoration: none;
  font-size: 14px; font-weight: 500;
  border-radius: var(--radius-lg);
  transition: background-color 200ms ease, color 200ms ease;
}
#desktop-nav a:hover { background-color: var(--color-bg-light); color: var(--color-text); }
#desktop-nav a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }

/* Hamburger */
.hamburger-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  background: none; border: none; cursor: pointer;
  border-radius: var(--radius-full); color: var(--color-text-secondary);
  transition: background-color 200ms ease;
}
.hamburger-btn:hover { background-color: var(--color-bg-light); }
.hamburger-btn:focus-visible {
  outline: 2px solid var(--color-primary); outline-offset: 2px;
  background-color: var(--color-bg-light);
}
.hamburger-icon { display: flex; flex-direction: column; gap: 5px; width: 20px; }
.hamburger-icon span {
  display: block; height: 2px; background-color: currentColor;
  border-radius: 1px; transition: transform var(--transition-speed) ease, opacity var(--transition-speed) ease;
  transform-origin: center;
}
.hamburger-btn[aria-expanded="true"] .hamburger-icon span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn[aria-expanded="true"] .hamburger-icon span:nth-child(2) { opacity: 0; }
.hamburger-btn[aria-expanded="true"] .hamburger-icon span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   NAVIGATION DRAWER
   ============================================================ */
#nav-drawer {
  position: fixed; top: 0; left: 0;
  width: var(--drawer-width); max-width: 85vw;
  height: 100vh; height: 100dvh;
  background-color: var(--color-white); z-index: 200;
  transform: translateX(-100%);
  transition: transform var(--transition-speed) ease;
  display: flex; flex-direction: column;
  box-shadow: none; overflow-y: auto;
}
#nav-drawer.open { transform: translateX(0); box-shadow: var(--shadow-3); }
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--color-border);
  min-height: var(--header-height);
}
.drawer-header .header-logo {
  font-size: 14px;
  white-space: normal;
  line-height: 1.2;
}
.drawer-close-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  background: none; border: none; cursor: pointer;
  border-radius: var(--radius-full); color: var(--color-text-secondary);
  transition: background-color 200ms ease;
}
.drawer-close-btn:hover { background-color: var(--color-bg-light); }
.drawer-close-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.drawer-nav { padding: 8px 0; flex: 1; }
.drawer-nav ul { list-style: none; }
.drawer-nav a {
  display: flex; align-items: center;
  padding: 12px 24px; color: var(--color-text); text-decoration: none;
  font-size: 15px; font-weight: 500;
  transition: background-color 200ms ease; min-height: 48px;
}
.drawer-nav a:hover { background-color: var(--color-bg-light); }
.drawer-nav a:focus-visible {
  outline: 2px solid var(--color-primary); outline-offset: -2px;
  background-color: var(--color-primary-light);
}

/* Drawer overlay */
#drawer-overlay {
  position: fixed; inset: 0;
  background-color: var(--color-overlay); z-index: 150;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition-speed) ease;
}
#drawer-overlay.visible { opacity: 1; pointer-events: auto; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
#main-content { flex: 1; margin-top: var(--header-height); }

/* ============================================================
   HERO
   ============================================================ */
#hero {
  text-align: center; padding: 48px 16px 24px;
  background-color: var(--color-white);
}
#hero h1 {
  font-size: 28px; font-weight: 400; line-height: 1.3;
  color: var(--color-text); margin-bottom: 8px;
  letter-spacing: -0.5px; max-width: 600px;
  margin-left: auto; margin-right: auto;
}
#hero .tagline {
  font-size: 15px; color: var(--color-text-secondary);
  max-width: 480px; margin: 0 auto; line-height: 1.5;
}

/* ============================================================
   CALCULATOR SECTION
   ============================================================ */
#calculator { padding: 0 16px 32px; }

.calculator-card {
  max-width: 680px; margin: 0 auto;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: 20px;
}

.calculator-card h2 {
  font-size: 20px; font-weight: 400; color: var(--color-text);
  margin-bottom: 4px;
}

.calculator-card > .card-description {
  font-size: 14px; color: var(--color-text-secondary);
  margin-bottom: 24px; line-height: 1.5;
}

/* --- Form layout --- */
.calc-form { display: flex; flex-direction: column; gap: 20px; }

/* --- Label row (label + unit toggle) --- */
.label-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; flex-wrap: wrap; gap: 4px;
}
.label-row > span {
  font-size: 15px; font-weight: 500; color: var(--color-text);
}

/* Unit toggle pill */
.unit-toggle {
  display: flex; border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); overflow: hidden;
  flex-shrink: 0;
}
.unit-toggle button {
  padding: 4px 14px; font-size: 13px; font-weight: 500;
  font-family: var(--font-stack); cursor: pointer;
  background: none; border: none; color: var(--color-text-secondary);
  transition: background-color 200ms ease, color 200ms ease;
  white-space: nowrap;
}
.unit-toggle button.active {
  background-color: var(--color-primary);
  color: var(--color-white);
}
.unit-toggle button:focus-visible {
  outline: 2px solid var(--color-primary); outline-offset: -2px;
  position: relative; z-index: 1;
}

/* --- Gender radio cards --- */
.gender-options {
  display: flex; gap: 12px;
}
.gender-card {
  flex: 1; position: relative;
}
.gender-card input[type="radio"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.gender-card label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 16px;
  font-size: 15px; font-weight: 500;
  color: var(--color-text-secondary);
  background-color: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md); cursor: pointer;
  transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease;
  user-select: none;
}
.gender-card label:hover { border-color: var(--color-primary); background-color: var(--color-primary-light); }
.gender-card input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--color-primary); outline-offset: 2px;
}
.gender-card input[type="radio"]:checked + label {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.gender-icon { font-size: 20px; }

/* --- Standard inputs --- */
.input-group { display: flex; flex-direction: column; }

.input-group input[type="number"] {
  height: 48px; padding: 0 12px;
  font-size: 16px; font-family: var(--font-stack);
  color: var(--color-text);
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color 200ms ease, box-shadow 200ms ease;
  width: 100%;
}
.input-group input[type="number"]:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-light);
  outline: none;
}

/* Height dual inputs (ft + in) */
.height-dual {
  display: flex; gap: 12px;
}
.height-dual .input-group { flex: 1; }
.height-dual .input-group input { text-align: center; }

/* --- Activity radio cards --- */
.activity-options {
  display: flex; flex-direction: column; gap: 8px;
}
.activity-card { position: relative; }
.activity-card input[type="radio"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.activity-card label {
  display: flex; flex-direction: column;
  padding: 14px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md); cursor: pointer;
  transition: border-color 200ms ease, background-color 200ms ease;
  user-select: none;
}
.activity-card label:hover {
  border-color: var(--color-primary);
  background-color: var(--color-bg-light);
}
.activity-card input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--color-primary); outline-offset: 2px;
}
.activity-card input[type="radio"]:checked + label {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
}
.activity-card .act-title {
  font-size: 15px; font-weight: 500; color: var(--color-text);
  margin-bottom: 2px;
}
.activity-card input[type="radio"]:checked + label .act-title { color: var(--color-primary); }
.activity-card .act-desc {
  font-size: 13px; color: var(--color-text-secondary); line-height: 1.4;
}

/* --- Calculate button --- */
.btn-calculate {
  display: inline-flex; align-items: center; justify-content: center;
  height: 52px; padding: 0 40px;
  font-size: 16px; font-weight: 500; font-family: var(--font-stack);
  color: var(--color-white); background-color: var(--color-primary);
  border: none; border-radius: var(--radius-lg); cursor: pointer;
  transition: background-color 200ms ease, box-shadow 200ms ease;
  align-self: center; letter-spacing: 0.2px; min-width: 160px;
}
.btn-calculate:hover { background-color: var(--color-primary-dark); box-shadow: var(--shadow-2); }
.btn-calculate:focus-visible {
  outline: 2px solid var(--color-primary-dark); outline-offset: 2px;
  background-color: var(--color-primary-dark);
}

/* ============================================================
   RESULTS DASHBOARD
   ============================================================ */
.results-dashboard {
  max-width: 680px; margin: 24px auto 0;
  display: none;
}
.results-dashboard.visible {
  display: block;
  min-height: 480px;
}


/* Primary result card */
.result-primary {
  background-color: var(--color-primary-light);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 28px 24px; text-align: center;
  margin-bottom: 16px;
}
.result-primary .result-headline {
  font-size: 16px; color: var(--color-text-secondary);
  margin-bottom: 8px; line-height: 1.4;
}
.result-primary .result-calories {
  font-size: 42px; font-weight: 500; color: var(--color-primary);
  line-height: 1.1; letter-spacing: -1px;
}
.result-primary .result-calories-unit {
  font-size: 16px; color: var(--color-text-secondary);
  font-weight: 400;
}

/* Goal cards grid */
.goal-cards {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 16px;
}
.goal-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.goal-card .goal-icon {
  font-size: 20px; margin-bottom: 4px;
}
.goal-card h3 {
  font-size: 15px; font-weight: 500; color: var(--color-text);
  margin-bottom: 4px;
}
.goal-card .goal-cals {
  font-size: 24px; font-weight: 500; color: var(--color-primary);
  margin-bottom: 4px;
}
.goal-card .goal-desc {
  font-size: 13px; color: var(--color-text-secondary); line-height: 1.4;
}

/* BMR card */
.bmr-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 20px; margin-bottom: 16px;
  display: flex; gap: 12px; align-items: flex-start;
}
.bmr-card .bmr-icon { font-size: 24px; flex-shrink: 0; }
.bmr-card .bmr-text { font-size: 14px; color: var(--color-text); line-height: 1.5; }
.bmr-card .bmr-value { font-weight: 500; color: var(--color-primary); }

/* Macronutrient card */
.macro-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px; margin-bottom: 16px;
}
.macro-card h3 {
  font-size: 15px; font-weight: 500; color: var(--color-text);
  margin-bottom: 16px;
}
/* Macro bar chart */
.macro-bar {
  display: flex; height: 24px; border-radius: 12px; overflow: hidden;
  margin-bottom: 16px;
}
.macro-bar .macro-seg-protein {
  background-color: var(--color-primary);
}
.macro-bar .macro-seg-fat {
  background-color: var(--color-warning);
}
.macro-bar .macro-seg-carbs {
  background-color: var(--color-success);
}
.macro-legend {
  display: flex; flex-direction: column; gap: 10px;
}
.macro-legend-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--color-text);
}
.macro-swatch {
  width: 14px; height: 14px; border-radius: var(--radius-sm); flex-shrink: 0;
}
.macro-swatch-protein { background-color: var(--color-primary); }
.macro-swatch-fat { background-color: var(--color-warning); }
.macro-swatch-carbs { background-color: var(--color-success); }
.macro-grams { font-weight: 500; }

/* ============================================================
   FOOD TABLE SECTION
   ============================================================ */
#food-table-section {
  padding: 0 16px 48px;
}
.food-table-inner {
  max-width: 680px; margin: 0 auto;
}
.food-table-inner h2 {
  font-size: 20px; font-weight: 400; color: var(--color-text);
  margin-bottom: 8px;
}
.food-table-inner .food-desc {
  font-size: 14px; color: var(--color-text-secondary);
  margin-bottom: 16px;
}
.food-search-wrap {
  position: relative; margin-bottom: 16px;
}
.food-search-wrap input {
  width: 100%; height: 48px;
  padding: 0 16px 0 44px;
  font-size: 16px; font-family: var(--font-stack);
  color: var(--color-text);
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.food-search-wrap input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-light);
  outline: none;
}
.food-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--color-text-secondary); pointer-events: none;
  font-size: 18px;
}
.food-table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.food-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px; min-width: 500px;
}
.food-table thead { background-color: var(--color-bg-light); }
.food-table th {
  padding: 12px 16px; text-align: left;
  font-weight: 500; color: var(--color-text-secondary);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--color-border);
}
.food-table th:last-child, .food-table td:last-child { text-align: right; }
.food-table td {
  padding: 10px 16px; border-bottom: 1px solid var(--color-border);
  color: var(--color-text); vertical-align: top;
}
.food-table tbody tr:hover { background-color: var(--color-bg-light); }
.food-table .food-name { font-weight: 500; }
.food-table .food-serving { color: var(--color-text-secondary); font-size: 12px; }
.food-table .food-cals { font-weight: 500; color: var(--color-primary); text-align: right; white-space: nowrap; }
.food-no-results {
  text-align: center; padding: 32px 16px; color: var(--color-text-secondary);
  font-size: 14px;
}

/* ============================================================
   SEO CONTENT
   ============================================================ */
#seo-content { overflow: hidden; }
#seo-content section { padding: 32px 16px 40px; background-color: var(--color-bg-light); }
#seo-content .seo-inner { max-width: 680px; margin: 0 auto; }
#seo-content h2 {
  font-size: 20px; font-weight: 400; color: var(--color-text);
  margin-bottom: 12px;
}
#seo-content h3 {
  font-size: 17px; font-weight: 500; color: var(--color-text);
  margin: 24px 0 8px;
}
#seo-content p {
  font-size: 16px; color: var(--color-text-secondary); line-height: 1.6;
  margin-bottom: 12px;
}
#seo-content ul, #seo-content ol { margin: 4px 0 14px 22px; }
#seo-content li {
  font-size: 16px; color: var(--color-text-secondary);
  line-height: 1.6; margin-bottom: 6px;
}
#seo-content li strong { color: var(--color-text); }
/* Tables */
#seo-content table {
  width: 100%; border-collapse: collapse; margin: 14px 0 20px;
  font-size: 13px; display: block; overflow-x: auto;
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
}
#seo-content caption {
  font-size: 13px; color: var(--color-text-secondary);
  margin-bottom: 6px; text-align: left; font-style: italic;
}
#seo-content thead { background-color: var(--color-primary-light); }
#seo-content th {
  padding: 10px 12px; text-align: left; font-weight: 500;
  color: var(--color-text); border-bottom: 1px solid var(--color-border);
  font-size: 12px; white-space: nowrap;
}
#seo-content td {
  padding: 9px 12px; border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}
#seo-content tbody tr:last-child td { border-bottom: none; }
#seo-content tbody tr:hover { background-color: var(--color-bg-light); }
/* In-section callout */
#seo-content section aside {
  background-color: var(--color-primary-light);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md); padding: 14px 16px; margin: 16px 0;
}
#seo-content section aside p { font-size: 16px; color: var(--color-text); margin: 0; }
/* FAQ */
#seo-content details {
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  margin-bottom: 8px; background-color: var(--color-white); overflow: hidden;
}
#seo-content summary {
  padding: 14px 16px; font-size: 16px; font-weight: 500; color: var(--color-text);
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  transition: background-color 200ms ease;
}
#seo-content summary:hover { background-color: var(--color-bg-light); }
#seo-content summary::-webkit-details-marker { display: none; }
#seo-content summary::after {
  content: '+'; font-size: 20px; color: var(--color-primary);
  flex-shrink: 0; line-height: 1;
}
#seo-content details[open] summary::after { content: '\2212'; }
#seo-content details p {
  padding: 2px 16px 14px; border-top: 1px solid var(--color-border); margin: 0;
}
/* References */
#seo-content #references a { color: var(--color-primary); }
#seo-content #references li { margin-bottom: 14px; }

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
  background-color: var(--color-bg-light);
  border-top: 1px solid var(--color-border);
}
.footer-links {
  max-width: 680px; margin: 0 auto;
  padding: 32px 16px 24px;
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  justify-content: center;
}
.footer-links a {
  color: var(--color-text-secondary); text-decoration: none;
  font-size: 14px; padding: 4px 0;
  transition: color 200ms ease;
}
.footer-links a:hover { color: var(--color-primary); }
.footer-links a:focus-visible {
  outline: 2px solid var(--color-primary); outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding: 16px; text-align: center;
}
.footer-bottom p {
  font-size: 13px; color: var(--color-text-secondary); line-height: 1.5;
}
.footer-bottom .site-name { font-weight: 500; color: var(--color-text); }

/* ============================================================
   RESPONSIVE — Tablet (≥600px)
   ============================================================ */
@media (min-width: 600px) {
  #hero { padding: 64px 24px 32px; }
  #hero h1 { font-size: 36px; }
  #hero .tagline { font-size: 17px; }
  #calculator { padding: 0 24px 40px; }
  .calculator-card { padding: 32px; }
  #food-table-section { padding: 0 24px 48px; }
  #seo-content section { padding: 40px 24px 48px; }

  .goal-cards {
    flex-direction: row; flex-wrap: wrap;
  }
  .goal-cards .goal-card { flex: 1; min-width: 200px; }
}

/* ============================================================
   RESPONSIVE — Desktop (≥1024px)
   ============================================================ */
@media (min-width: 1024px) {
  #site-header { padding: 0 32px; }
  .hamburger-btn { display: none; }
  #desktop-nav { display: block; }
  #nav-drawer { display: none; }
  #drawer-overlay { display: none; }

  #hero { padding: 80px 32px 40px; }
  #hero h1 { font-size: 42px; }
  #calculator { padding: 0 32px 48px; }
  .calculator-card { padding: 40px; }
  #food-table-section { padding: 0 32px 56px; }
  #seo-content section { padding: 48px 32px 56px; }
  .footer-links { padding: 40px 32px 32px; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  #site-header, #nav-drawer, #drawer-overlay, .hamburger-btn, .skip-link { display: none !important; }
  #main-content { margin-top: 0; }
  body { font-size: 12pt; color: #000; }
}

/* ============================================================
   HIGH CONTRAST / FORCED COLORS
   ============================================================ */
@media (forced-colors: active) {
  .btn-calculate { border: 2px solid ButtonText; }
  .calculator-card, .goal-card, .bmr-card, .macro-card, .result-primary { border: 2px solid CanvasText; }
  .gender-card input[type="radio"]:checked + label,
  .activity-card input[type="radio"]:checked + label {
    border: 3px solid Highlight;
  }
  .unit-toggle button.active { border: 2px solid Highlight; }
  .hamburger-btn:focus-visible, .drawer-close-btn:focus-visible,
  .btn-calculate:focus-visible, a:focus-visible { outline: 3px solid Highlight; }
}

/* ============================================================
   SCROLL TO TOP BUTTON
   ============================================================ */
.scroll-to-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  color: var(--color-white);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 300ms ease, transform 300ms ease, background-color 200ms ease, box-shadow 200ms ease;
  z-index: 99;
}
.scroll-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.scroll-to-top-btn:hover {
  background-color: var(--color-primary-dark);
  box-shadow: var(--shadow-3);
  transform: scale(1.05);
}
.scroll-to-top-btn:active {
  transform: scale(0.95);
}
.scroll-to-top-btn:focus-visible {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 2px;
  background-color: var(--color-primary-dark);
}
@media print {
  .scroll-to-top-btn { display: none !important; }
}

/* Inline form validation error styling */
.error-msg {
  color: var(--color-error);
  font-size: 13px;
  margin-top: 4px;
  display: none;
}
.error-msg.visible {
  display: block;
}


