/* hyDiet v11 — AI calorie tracker, meal planner & personal trainer hub */
/* Design system: v11 tokens, iOS glass aesthetic, spring physics. No hardcoded colors except --hd-accent. */

:root {
  --hd-accent: #22c55e;
  --hd-accent-dim: color-mix(in srgb, #22c55e 12%, transparent);
  --hd-accent-glow: color-mix(in srgb, #22c55e 20%, transparent);
  --hd-cyan: #06b6d4;
  --hd-amber: #f59e0b;
  --hd-panel: var(--bg-card, rgba(6, 15, 9, .95));
  --hd-radius: 16px;
  --hd-spring: cubic-bezier(.2, .9, .3, 1);
}

/* ═══════════════════════════════════════════════════════════════════
   LAYOUT — side nav desktop / bottom bar mobile
   ═══════════════════════════════════════════════════════════════════ */
.hd-shell {
  display: flex;
  height: 100%;
  min-height: 100dvh;
  background: var(--bg-deep, #000b06);
  color: var(--text, rgba(255,255,255,.92));
  font-family: 'Inter', system-ui, sans-serif;
}

/* Side nav — desktop */
.hd-sidenav {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--bg-deep, #000b06) 85%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--border, rgba(255,255,255,.08));
  padding: 16px 8px;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
}
.hd-sidenav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 16px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.06));
  margin-bottom: 8px;
}
.hd-sidenav-logo iconify-icon {
  color: var(--hd-accent);
  font-size: 26px;
}
.hd-sidenav-logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text, rgba(255,255,255,.92));
}
.hd-sidenav-logo-text span {
  color: var(--hd-accent);
}

.hd-sidenav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--muted, rgba(200,255,240,.55));
  font-size: 13px;
  font-weight: 500;
  transition: all .22s var(--hd-spring);
  cursor: pointer;
  background: none;
  width: 100%;
  text-align: left;
  touch-action: manipulation;
  min-height: 44px;
}
.hd-sidenav-link iconify-icon {
  font-size: 18px;
  flex-shrink: 0;
  color: var(--muted, rgba(200,255,240,.4));
  transition: color .2s;
}
.hd-sidenav-link:hover,
.hd-sidenav-link.active {
  background: var(--hd-accent-dim);
  border-color: color-mix(in srgb, var(--hd-accent) 25%, transparent);
  color: var(--text, rgba(255,255,255,.92));
}
.hd-sidenav-link:hover iconify-icon,
.hd-sidenav-link.active iconify-icon {
  color: var(--hd-accent);
}
.hd-sidenav-link.active {
  font-weight: 600;
}

/* Main content area */
.hd-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ═══════════════════════════════════════════════════════════════════
   TAB NAVIGATION — shared component
   ═══════════════════════════════════════════════════════════════════ */
.hd-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.hd-tabs::-webkit-scrollbar { display: none; }

.hd-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border, rgba(255,255,255,.08));
  background: none;
  color: var(--muted, rgba(200,255,240,.55));
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s var(--hd-spring);
  touch-action: manipulation;
  min-height: 36px;
}
.hd-tab-btn:hover {
  background: var(--hd-accent-dim);
  border-color: color-mix(in srgb, var(--hd-accent) 30%, transparent);
  color: var(--text, rgba(255,255,255,.92));
}
.hd-tab-btn.active {
  background: var(--hd-accent);
  border-color: var(--hd-accent);
  color: #000;
  font-weight: 600;
}
.hd-tab-btn iconify-icon { font-size: 15px; }

.hd-tab-pane { display: none; padding: 0 16px 24px; }
.hd-tab-pane.active { display: block; }

/* ═══════════════════════════════════════════════════════════════════
   MACRO RING — SVG donut chart
   ═══════════════════════════════════════════════════════════════════ */
.hd-macro-ring {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}
.hd-macro-ring svg {
  transform: rotate(-90deg);
  animation: hd-ring-fill .9s var(--hd-spring) both;
}
.hd-macro-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.hd-macro-ring-calories {
  font-size: 28px;
  font-weight: 700;
  color: var(--text, rgba(255,255,255,.92));
  line-height: 1;
}
.hd-macro-ring-label {
  font-size: 11px;
  color: var(--muted, rgba(200,255,240,.45));
  text-transform: uppercase;
  letter-spacing: .08em;
}
@keyframes hd-ring-fill {
  from { opacity: 0; transform: rotate(-90deg) scale(.85); }
  to   { opacity: 1; transform: rotate(-90deg) scale(1); }
}

/* Macro legend dots */
.hd-macro-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.hd-macro-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.hd-macro-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hd-macro-dot-protein  { background: var(--hd-accent); }
.hd-macro-dot-carbs    { background: var(--hd-amber); }
.hd-macro-dot-fat      { background: var(--hd-cyan); }
.hd-macro-legend-name  { color: var(--muted, rgba(200,255,240,.55)); width: 52px; }
.hd-macro-legend-value { color: var(--text, rgba(255,255,255,.92)); font-weight: 600; margin-left: auto; }

/* ═══════════════════════════════════════════════════════════════════
   MEAL SLOTS — accordion sections
   ═══════════════════════════════════════════════════════════════════ */
.hd-meal-slot {
  background: color-mix(in srgb, var(--bg-card, rgba(6,15,9,.95)) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: var(--hd-radius);
  overflow: hidden;
  transition: border-color .2s;
  margin-bottom: 12px;
}
.hd-meal-slot:hover { border-color: color-mix(in srgb, var(--hd-accent) 20%, transparent); }

.hd-meal-slot-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  min-height: 54px;
}
.hd-meal-slot-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--hd-accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hd-meal-slot-icon iconify-icon {
  font-size: 18px;
  color: var(--hd-accent);
}
.hd-meal-slot-name {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
}
.hd-meal-slot-kcal {
  font-size: 12px;
  color: var(--muted, rgba(200,255,240,.55));
}
.hd-meal-slot-chevron {
  font-size: 16px;
  color: var(--muted, rgba(200,255,240,.35));
  transition: transform .25s var(--hd-spring);
}
.hd-meal-slot.open .hd-meal-slot-chevron { transform: rotate(180deg); }

.hd-meal-slot-body {
  display: none;
  padding: 0 12px 12px;
  gap: 8px;
  flex-direction: column;
}
.hd-meal-slot.open .hd-meal-slot-body { display: flex; }

/* ═══════════════════════════════════════════════════════════════════
   FOOD CARDS
   ═══════════════════════════════════════════════════════════════════ */
.hd-food-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-surface, rgba(255,255,255,.04)) 60%, transparent);
  border: 1px solid var(--border, rgba(255,255,255,.06));
  transition: all .18s var(--hd-spring);
}
.hd-food-card:hover {
  background: color-mix(in srgb, var(--bg-surface, rgba(255,255,255,.04)) 100%, transparent);
  border-color: color-mix(in srgb, var(--hd-accent) 18%, transparent);
}
.hd-food-card-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--hd-accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.hd-food-card-thumb iconify-icon {
  font-size: 20px;
  color: var(--hd-accent);
}
.hd-food-card-info { flex: 1; min-width: 0; }
.hd-food-card-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hd-food-card-meta {
  font-size: 11px;
  color: var(--muted, rgba(200,255,240,.45));
  margin-top: 2px;
}
.hd-food-card-kcal {
  font-size: 13px;
  font-weight: 600;
  color: var(--hd-accent);
  flex-shrink: 0;
}
.hd-food-card-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--danger, #ff4d6d);
  opacity: .4;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: opacity .15s;
  touch-action: manipulation;
  min-height: 32px;
  min-width: 32px;
  justify-content: center;
}
.hd-food-card:hover .hd-food-card-del { opacity: .8; }
.hd-food-card-del:hover { opacity: 1 !important; }

/* ═══════════════════════════════════════════════════════════════════
   SNAP BUTTON — camera / barcode scan CTA
   ═══════════════════════════════════════════════════════════════════ */
.hd-snap-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 48px;
  background: var(--hd-accent);
  color: #000;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all .22s var(--hd-spring);
  box-shadow: 0 0 0 0 var(--hd-accent-glow);
  animation: hd-pulse-glow 2.4s ease-in-out infinite;
  touch-action: manipulation;
  min-height: 52px;
  font-family: inherit;
}
.hd-snap-btn:active { transform: scale(.96); }
.hd-snap-btn iconify-icon { font-size: 22px; }

@keyframes hd-pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--hd-accent-glow), 0 4px 20px var(--hd-accent-dim); }
  50%       { box-shadow: 0 0 0 8px transparent, 0 4px 30px color-mix(in srgb, #22c55e 35%, transparent); }
}

/* ═══════════════════════════════════════════════════════════════════
   WEEK PLANNER GRID — 7-col × 4-row
   ═══════════════════════════════════════════════════════════════════ */
.hd-week-grid {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  gap: 6px;
  overflow-x: auto;
  min-width: 600px;
}
.hd-week-grid-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted, rgba(200,255,240,.45));
  padding: 6px 4px;
  text-align: center;
}
.hd-week-grid-header.today {
  color: var(--hd-accent);
}
.hd-week-grid-row-label {
  font-size: 11px;
  color: var(--muted, rgba(200,255,240,.45));
  display: flex;
  align-items: center;
  padding: 0 4px;
}
.hd-week-cell {
  background: color-mix(in srgb, var(--bg-card, rgba(6,15,9,.95)) 70%, transparent);
  border: 1px solid var(--border, rgba(255,255,255,.06));
  border-radius: 10px;
  padding: 8px 6px;
  min-height: 68px;
  font-size: 11px;
  cursor: pointer;
  transition: all .18s var(--hd-spring);
  touch-action: manipulation;
}
.hd-week-cell:hover {
  border-color: color-mix(in srgb, var(--hd-accent) 30%, transparent);
  background: var(--hd-accent-dim);
}
.hd-week-cell.filled { border-color: color-mix(in srgb, var(--hd-accent) 40%, transparent); }
.hd-week-cell-meal {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  color: var(--text, rgba(255,255,255,.8));
  font-size: 10px;
}
.hd-week-cell-meal iconify-icon { font-size: 11px; color: var(--hd-accent); }

/* ═══════════════════════════════════════════════════════════════════
   RECIPE CARDS
   ═══════════════════════════════════════════════════════════════════ */
.hd-recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.hd-recipe-card {
  background: color-mix(in srgb, var(--bg-card, rgba(6,15,9,.95)) 85%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: var(--hd-radius);
  overflow: hidden;
  transition: all .22s var(--hd-spring);
  cursor: pointer;
  touch-action: manipulation;
}
.hd-recipe-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--hd-accent) 30%, transparent);
  box-shadow: 0 8px 30px rgba(0,0,0,.3);
}
.hd-recipe-card:active { transform: scale(.98); }
.hd-recipe-card-photo {
  width: 100%;
  height: 130px;
  object-fit: cover;
  background: var(--hd-accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hd-recipe-card-photo iconify-icon {
  font-size: 40px;
  color: var(--hd-accent);
  opacity: .5;
}
.hd-recipe-card-body { padding: 12px; }
.hd-recipe-card-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hd-recipe-card-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--muted, rgba(200,255,240,.5));
}
.hd-recipe-card-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  background: var(--hd-accent-dim);
  color: var(--hd-accent);
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════════
   PANTRY ITEMS
   ═══════════════════════════════════════════════════════════════════ */
.hd-pantry-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-card, rgba(6,15,9,.95)) 75%, transparent);
  border: 1px solid var(--border, rgba(255,255,255,.06));
  margin-bottom: 8px;
  transition: border-color .18s;
}
.hd-pantry-item:hover { border-color: color-mix(in srgb, var(--hd-accent) 20%, transparent); }
.hd-pantry-item-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.hd-pantry-item-name {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
}
.hd-pantry-item-qty {
  font-size: 12px;
  color: var(--muted, rgba(200,255,240,.55));
}
.hd-pantry-item-expiry {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

.hd-expiry-green {
  background: color-mix(in srgb, var(--hd-accent) 15%, transparent);
  color: var(--hd-accent);
}
.hd-expiry-amber {
  background: color-mix(in srgb, var(--hd-amber) 15%, transparent);
  color: var(--hd-amber);
}
.hd-expiry-red {
  background: color-mix(in srgb, var(--danger, #ff4d6d) 15%, transparent);
  color: var(--danger, #ff4d6d);
}

/* ═══════════════════════════════════════════════════════════════════
   WEIGHT / PROGRESS GRAPH
   ═══════════════════════════════════════════════════════════════════ */
.hd-weight-graph {
  width: 100%;
  background: color-mix(in srgb, var(--bg-card, rgba(6,15,9,.95)) 80%, transparent);
  border: 1px solid var(--border, rgba(255,255,255,.06));
  border-radius: var(--hd-radius);
  padding: 16px;
  overflow: hidden;
}
.hd-weight-graph svg {
  width: 100%;
  height: 160px;
  overflow: visible;
}
.hd-weight-graph-line {
  fill: none;
  stroke: var(--hd-accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hd-weight-graph-area {
  fill: url(#hd-graph-gradient);
  opacity: .25;
}
.hd-weight-graph-dot {
  fill: var(--hd-accent);
  stroke: var(--bg-deep, #000b06);
  stroke-width: 2;
}

/* ═══════════════════════════════════════════════════════════════════
   7-DAY COMPLIANCE HEATMAP
   ═══════════════════════════════════════════════════════════════════ */
.hd-heatmap {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}
.hd-heatmap-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.hd-heatmap-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 4px;
  background: var(--hd-accent-dim);
  transition: all .3s var(--hd-spring);
}
.hd-heatmap-bar.logged  { background: var(--hd-accent); }
.hd-heatmap-bar.partial { background: color-mix(in srgb, var(--hd-accent) 50%, var(--hd-amber)); }
.hd-heatmap-bar.missed  { background: color-mix(in srgb, var(--danger, #ff4d6d) 40%, transparent); }
.hd-heatmap-day {
  font-size: 10px;
  color: var(--muted, rgba(200,255,240,.4));
  letter-spacing: .04em;
}

/* ═══════════════════════════════════════════════════════════════════
   TRAINER CLIENT CARDS (Trainer Hub)
   ═══════════════════════════════════════════════════════════════════ */
.hd-trainer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.hd-trainer-client-card {
  background: color-mix(in srgb, var(--bg-card, rgba(6,15,9,.95)) 85%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: var(--hd-radius);
  padding: 16px;
  transition: all .22s var(--hd-spring);
  cursor: pointer;
  touch-action: manipulation;
}
.hd-trainer-client-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--hd-accent) 25%, transparent);
  box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
.hd-trainer-client-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.hd-client-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--hd-accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--hd-accent);
  border: 2px solid color-mix(in srgb, var(--hd-accent) 30%, transparent);
}
.hd-client-name { font-size: 14px; font-weight: 600; }
.hd-client-goal { font-size: 11px; color: var(--muted, rgba(200,255,240,.5)); margin-top: 2px; }

.hd-compliance-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.hd-compliance-dot.logged   { background: var(--hd-accent); box-shadow: 0 0 6px var(--hd-accent-glow); }
.hd-compliance-dot.partial  { background: var(--hd-amber); }
.hd-compliance-dot.missed   { background: var(--danger, #ff4d6d); }
.hd-compliance-dot.inactive { background: var(--muted, rgba(200,255,240,.25)); }

.hd-trainer-client-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 11px;
}
.hd-trainer-stat { color: var(--muted, rgba(200,255,240,.5)); }
.hd-trainer-stat span { color: var(--text, rgba(255,255,255,.85)); font-weight: 600; }

/* Trainer alert card */
.hd-trainer-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--danger, #ff4d6d) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger, #ff4d6d) 30%, transparent);
  margin-bottom: 10px;
}
.hd-trainer-alert iconify-icon {
  font-size: 18px;
  color: var(--danger, #ff4d6d);
  flex-shrink: 0;
  margin-top: 1px;
}
.hd-trainer-alert-text { font-size: 13px; }
.hd-trainer-alert-name { font-weight: 600; }
.hd-trainer-alert-msg  { color: var(--muted, rgba(200,255,240,.55)); font-size: 12px; margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════════
   RECEIPT SCANNER OVERLAY
   ═══════════════════════════════════════════════════════════════════ */
.hd-scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 9900;
  background: rgba(0,0,0,.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--hd-spring);
}
.hd-scan-overlay.active { opacity: 1; pointer-events: auto; }

.hd-scan-frame {
  width: 280px;
  height: 380px;
  border: 2px solid var(--hd-accent);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}
.hd-scan-frame::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--hd-accent), transparent);
  animation: hd-scan-line 2s ease-in-out infinite;
}
@keyframes hd-scan-line {
  0%   { top: 0;    opacity: 1; }
  50%  { top: calc(100% - 3px); opacity: 1; }
  100% { top: 0;    opacity: 0; }
}
.hd-scan-corners::before,
.hd-scan-corners::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--hd-accent);
  border-style: solid;
}
.hd-scan-corners::before { top: -2px; left: -2px; border-width: 2px 0 0 2px; border-radius: 4px 0 0 0; }
.hd-scan-corners::after  { bottom: -2px; right: -2px; border-width: 0 2px 2px 0; border-radius: 0 0 4px 0; }

/* ═══════════════════════════════════════════════════════════════════
   LANDING PAGE — phone mockup
   ═══════════════════════════════════════════════════════════════════ */
.hd-phone-mock {
  width: 220px;
  height: 440px;
  border-radius: 36px;
  background: color-mix(in srgb, var(--bg-card, rgba(6,15,9,.95)) 90%, transparent);
  border: 2px solid var(--border, rgba(255,255,255,.12));
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 40px var(--hd-accent-dim), inset 0 1px 0 rgba(255,255,255,.08);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.hd-phone-mock::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 6px;
  border-radius: 3px;
  background: var(--border, rgba(255,255,255,.15));
}
.hd-phone-mock-inner {
  position: absolute;
  inset: 24px 4px 4px;
  overflow: hidden;
  border-radius: 24px;
}

/* ═══════════════════════════════════════════════════════════════════
   GENERIC SHARED COMPONENTS
   ═══════════════════════════════════════════════════════════════════ */
.hd-card {
  background: color-mix(in srgb, var(--bg-card, rgba(6,15,9,.95)) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: var(--hd-radius);
  padding: 20px;
}

.hd-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hd-section-title iconify-icon {
  font-size: 18px;
  color: var(--hd-accent);
}

.hd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  background: none;
  color: var(--text, rgba(255,255,255,.85));
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all .18s var(--hd-spring);
  touch-action: manipulation;
  min-height: 36px;
}
.hd-btn:hover { background: var(--bg-surface, rgba(255,255,255,.04)); }
.hd-btn.primary {
  background: var(--hd-accent);
  border-color: var(--hd-accent);
  color: #000;
  font-weight: 600;
}
.hd-btn.primary:hover { filter: brightness(1.08); }
.hd-btn:active { transform: scale(.96); }

.hd-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-surface, rgba(255,255,255,.04)) 80%, transparent);
  border: 1px solid var(--border, rgba(255,255,255,.1));
  color: var(--text, rgba(255,255,255,.92));
  font-size: 16px; /* prevents iOS auto-zoom */
  font-family: inherit;
  transition: border-color .18s;
  outline: none;
  min-height: 44px;
}
.hd-input:focus {
  border-color: var(--hd-accent);
  box-shadow: 0 0 0 3px var(--hd-accent-dim);
}
.hd-input::placeholder { color: var(--muted, rgba(200,255,240,.35)); }

/* Stat tiles */
.hd-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.hd-stat-tile {
  background: color-mix(in srgb, var(--bg-card, rgba(6,15,9,.95)) 80%, transparent);
  border: 1px solid var(--border, rgba(255,255,255,.07));
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}
.hd-stat-tile-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--hd-accent);
  line-height: 1;
}
.hd-stat-tile-label {
  font-size: 11px;
  color: var(--muted, rgba(200,255,240,.45));
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE — bottom tab bar, full-width panes, 44px targets
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .hd-shell { flex-direction: column; }

  .hd-sidenav {
    display: none; /* replaced by bottom tab bar on mobile */
  }

  .hd-main {
    padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px));
  }

  /* Mobile bottom tab bar */
  .hd-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    background: color-mix(in srgb, var(--bg-deep, #000b06) 90%, transparent);
    backdrop-filter: saturate(200%) blur(28px);
    border-top: 1px solid var(--border, rgba(255,255,255,.08));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    height: calc(62px + env(safe-area-inset-bottom, 0px));
  }

  .hd-bottom-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    border: none;
    background: none;
    color: var(--muted, rgba(200,255,240,.4));
    font-size: 10px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: color .18s var(--hd-spring);
    touch-action: manipulation;
    min-height: 44px;
  }
  .hd-bottom-tab iconify-icon { font-size: 22px; }
  .hd-bottom-tab.active { color: var(--hd-accent); }
  .hd-bottom-tab.active iconify-icon {
    filter: drop-shadow(0 0 6px var(--hd-accent-glow));
  }

  /* Full-width panes */
  .hd-tab-pane { padding: 0 12px 20px; }

  /* Touch targets */
  .hd-food-card-del { min-height: 44px; min-width: 44px; }
  .hd-snap-btn { min-height: 56px; font-size: 16px; }

  /* Recipe grid single column */
  .hd-recipe-grid { grid-template-columns: 1fr 1fr; }

  /* Trainer grid single column */
  .hd-trainer-grid { grid-template-columns: 1fr; }

  /* Stats row 2 cols */
  .hd-stats-row { grid-template-columns: 1fr 1fr; }

  /* Macro ring smaller */
  .hd-macro-ring { width: 120px; height: 120px; }
  .hd-macro-ring-calories { font-size: 22px; }

  /* Week grid horizontal scroll */
  .hd-week-grid { min-width: 560px; gap: 4px; }
  .hd-week-cell { min-height: 56px; }
}

/* Desktop — hide bottom bar */
@media (min-width: 769px) {
  .hd-bottom-bar { display: none; }
}
