/* Bakewell — AG-GENTECH Recipe Card App
   Themes: Darkwood (dark) | Parchment (light)
   Bottom nav for iOS */

/* ============================================================
   Darkwood — Dark Mode (Default)
   ============================================================ */
:root {
  --primary: #1A6B4A;
  --primary-hover: #14573C;
  --primary-muted: rgba(26,107,74,0.12);
  --primary-glow: rgba(26,107,74,0.2);
  --gold: #C9A84C;
  --gold-muted: rgba(201,168,76,0.15);

  --bg-body: #101A14;
  --bg-card: #1C2A22;
  --bg-widget: #243028;
  --bg-input: #162018;

  --text-primary: #E8DCC8;
  --text-secondary: #A89878;
  --text-muted: #6B6050;

  --green: #2D9B6E;
  --red: #C04848;
  --heart: #e74c6f;
  --yellow: #D4A030;
  --orange: #C87A30;

  --border: #2A3A30;
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
  --radius: 8px;
  --radius-lg: 12px;

  --nav-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font-display: 'MedievalSharp', cursive;
  --font-body: 'EB Garamond', Georgia, serif;
}

/* ============================================================
   Parchment — Light Mode
   ============================================================ */
body.theme-parchment {
  --primary: #1A6B4A;
  --primary-hover: #14573C;
  --primary-muted: rgba(26,107,74,0.08);
  --primary-glow: rgba(26,107,74,0.12);
  --gold: #B8962E;
  --gold-muted: rgba(184,150,46,0.12);

  --bg-body: #F5ECD7;
  --bg-card: #FAF4E6;
  --bg-widget: #F0E8D4;
  --bg-input: #FFF9EE;

  --text-primary: #1C1008;
  --text-secondary: #4A3828;
  --text-muted: #6B5A48;

  --green: #2D7A5A;
  --red: #A03838;
  --yellow: #B88A20;
  --orange: #A86828;

  --border: #D8CCAE;
  --shadow: 0 1px 4px rgba(44,24,16,0.08);
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  background: var(--bg-body);
}
body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  position: fixed;
  inset: 0;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* Allow text selection only in input fields and textareas */
input, textarea { -webkit-user-select: text; user-select: text; }

/* Ensure iOS safe areas are covered with app bg color */
html::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg-body);
  z-index: 9999;
}
/* Category hint glow */
.cat-hint-glow {
  font-size: 0.6rem;
  color: #C9A84C;
  font-family: var(--font-body);
  font-style: italic;
  margin-left: 8px;
  opacity: 0;
  animation: catHintPulse 8s ease-in-out infinite;
}
@keyframes catHintPulse {
  0%, 70%, 100% { opacity: 0; }
  80%, 90% { opacity: 0.7; text-shadow: 0 0 8px rgba(201,168,76,0.4); }
}

/* Build stamp — version indicator */
.build-stamp { display: none;
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--nav-height) + 6px);
  left: 10px; z-index: 999;
  font-size: 0.6rem; color: var(--gold); opacity: 0.6;
  font-family: monospace; pointer-events: none;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; }

/* ============================================================
   PARTICLE CANVAS
   ============================================================ */
#particle-canvas { position: fixed; inset: 0; z-index: 0; }

/* ============================================================
   BOOT SEQUENCE
   ============================================================ */
#boot-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: radial-gradient(circle at 50% 45%, #1A3A28, #122A1C 50%, #0A1810);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
#boot-text {
  margin-top: 20px; font-size: 28px;
  font-family: var(--font-display); letter-spacing: 4px;
  color: var(--gold); opacity: 0;
}
#boot-sub {
  font-size: 9px; font-weight: 600; letter-spacing: 5px;
  color: var(--text-muted); text-transform: uppercase;
  margin-top: 4px; opacity: 0; font-family: var(--font-body);
}

/* ============================================================
   BOTTOM NAV BAR
   ============================================================ */
/* ============================================================
   BOTTOM NAV — Center circle with notch cutout
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  height: calc(var(--nav-height) + var(--safe-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding-bottom: var(--safe-bottom);
  background: transparent;
  border: none;
}
/* SVG notch background */
.bottom-nav-bg {
  position: absolute;
  bottom: var(--safe-bottom);
  left: 0; right: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: -1;
  pointer-events: none;
}
/* Fill safe area below the SVG */
.bottom-nav::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: var(--safe-bottom);
  background: var(--bg-card);
  z-index: -1;
}

/* Regular nav buttons (Gathering, Cook, Pantry, Shop) */
.bottom-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 0 4px;
  height: var(--nav-height);
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-family: var(--font-body);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
  touch-action: manipulation;
  min-width: 44px;
  min-height: 44px;
}
.bottom-nav-btn.active { color: var(--gold); }
.bottom-nav-btn svg { color: inherit; }

/* Center raised circle — Recipes */
.bottom-nav-center {
  position: relative;
  width: 62px;
  height: 62px;
  min-width: 62px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, border-color 0.2s, box-shadow 0.2s;
  touch-action: manipulation;
  font-size: 0.55rem;
  font-family: var(--font-body);
  margin-bottom: 14px;
  z-index: 1;
}
.bottom-nav-center.active {
  color: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(201,168,76,0.3);
}
.bottom-nav-center span {
  font-size: 0.5rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.bottom-nav-center svg { color: inherit; }

/* ============================================================
   HEADER BUTTONS — notifications + profile, fixed top-right
   ============================================================ */
.header-buttons {
  position: fixed;
  top: calc(var(--safe-top) + 14px);
  right: 16px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-notif-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, border-color 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  padding: 0;
}
.header-notif-btn:active { color: var(--gold); border-color: var(--gold); }
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-family: var(--font-body);
}
.header-profile-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, border-color 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  padding: 0;
  overflow: hidden;
}
.header-profile-btn:active {
  color: var(--gold);
  border-color: var(--gold);
}
.header-profile-btn svg {
  width: 20px;
  height: 20px;
}

/* ============================================================
   PAGE SYSTEM
   ============================================================ */
/* Page-specific dual-tone themes */
#page-list {
  --page-primary: #1A6B4A;
  --page-accent: #C9A84C;
  --page-bg: #101A14;
  --page-card: #1C2A22;
}
#page-detail {
  --page-primary: #722F37;
  --page-accent: #C9A84C;
  --page-bg: #1A1214;
  --page-card: #2A2022;
}
#page-edit {
  --page-primary: #3A5A8C;
  --page-accent: #C9A84C;
  --page-bg: #10141A;
  --page-card: #1C222A;
}
#page-pantry {
  --page-primary: #7B4A2A;
  --page-accent: #C9A84C;
  --page-bg: #1A1410;
  --page-card: #2A2218;
}
#page-canmake {
  --page-primary: #C9A84C;
  --page-accent: #1A6B4A;
  --page-bg: #141810;
  --page-card: #222A1C;
}
#page-shopping {
  --page-primary: #C9A84C;
  --page-accent: #8B1A1A;
  --page-bg: #1A1410;
  --page-card: #2A2218;
}
#page-profile {
  --page-primary: #722F37;
  --page-accent: #C9A84C;
  --page-bg: #141018;
  --page-card: #221C2A;
}
#page-feed {
  --page-primary: #3A5A8C;
  --page-accent: #C9A84C;
  --page-bg: #101418;
  --page-card: #1C2028;
}

/* Light mode page themes */
body.theme-parchment #page-list {
  --page-bg: #F5ECD7;
  --page-card: #FAF4E6;
}
body.theme-parchment #page-detail {
  --page-primary: #722F37;
  --page-bg: #F5ECE0;
  --page-card: #FAF2EA;
}
body.theme-parchment #page-edit {
  --page-primary: #3A5A8C;
  --page-bg: #ECF0F5;
  --page-card: #F2F6FA;
}
body.theme-parchment #page-pantry {
  --page-primary: #7B4A2A;
  --page-bg: #F5EEE0;
  --page-card: #FAF4E8;
}
body.theme-parchment #page-canmake {
  --page-bg: #F5ECD7;
  --page-card: #FAF4E6;
}
body.theme-parchment #page-shopping {
  --page-bg: #F5EEE0;
  --page-card: #FAF4E8;
}
body.theme-parchment #page-profile {
  --page-bg: #F0EAF5;
  --page-card: #F8F4FA;
}
body.theme-parchment #page-feed {
  --page-bg: #ECF0F5;
  --page-card: #F2F6FA;
}

/* Parchment overrides for components that use dark hardcoded values */
body.theme-parchment .bottom-nav-bg path {
  fill: var(--bg-card);
}
body.theme-parchment .bottom-nav::after {
  background: var(--bg-card);
}
body.theme-parchment .bottom-nav-center {
  background: var(--bg-card);
  border-color: var(--border);
}
body.theme-parchment .bottom-nav-center.active {
  background: var(--bg-body);
  border-color: var(--gold);
}
body.theme-parchment .header-profile-btn,
body.theme-parchment .header-notif-btn {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: 0 1px 4px rgba(44,24,16,0.08);
}
body.theme-parchment .modal-overlay {
  background: rgba(44,24,16,0.5);
}
body.theme-parchment .nickname-modal {
  background: var(--bg-card);
  border-color: var(--border);
}
body.theme-parchment .feed-card {
  background: var(--bg-card);
  border-color: var(--border);
}
body.theme-parchment .feed-card-art {
  border-right-color: var(--border);
}
body.theme-parchment .profile-stats {
  background: var(--bg-card);
  border-color: var(--border);
}
body.theme-parchment .profile-stat + .profile-stat {
  border-left-color: var(--border);
}
body.theme-parchment .profile-save-cta {
  background: var(--bg-card);
  border-color: rgba(184,150,46,0.25);
}
body.theme-parchment .profile-email-badge {
  background: var(--bg-card);
  border-color: var(--border);
}
body.theme-parchment .publish-badge {
  background: rgba(184,150,46,0.08);
  border-color: rgba(184,150,46,0.2);
}
body.theme-parchment .visibility-option {
  background: var(--bg-widget);
  border-color: var(--border);
}
body.theme-parchment .visibility-option.selected {
  border-color: var(--gold);
  background: rgba(184,150,46,0.1);
}
body.theme-parchment .feed-sort {
  background: var(--bg-widget);
  border-color: var(--border);
}
body.theme-parchment .feed-sort-btn.active {
  background: var(--gold);
  color: #fff;
}
body.theme-parchment .feed-filter-btn {
  border-color: var(--border);
}
body.theme-parchment .feed-filter-btn.active {
  border-color: var(--gold);
  background: rgba(184,150,46,0.1);
}
body.theme-parchment .heart-btn-large {
  background: var(--bg-widget);
  border-color: var(--border);
}
body.theme-parchment .profile-baker-code {
  background: var(--bg-widget);
  border-color: var(--border);
}
body.theme-parchment .theme-toggle-btn {
  background: var(--bg-widget);
  border-color: var(--border);
}
body.theme-parchment .theme-option.active {
  background: var(--gold);
  color: #fff;
}
body.theme-parchment .notif-unread {
  background: rgba(184,150,46,0.06);
}
body.theme-parchment .skeleton-art,
body.theme-parchment .skeleton-line {
  background: var(--bg-widget);
}
body.theme-parchment .trending-card {
  background: var(--bg-card);
  border-color: var(--border);
}
body.theme-parchment .shared-check {
  border-color: var(--border);
}
body.theme-parchment .shared-list-item.checked .shared-check {
  border-color: var(--green);
  background: rgba(45,122,90,0.12);
}
body.theme-parchment .recipe-card-publish {
  border-top-color: var(--border);
}
body.theme-parchment .comment-item {
  border-bottom-color: var(--border);
}
body.theme-parchment .friend-item {
  border-bottom-color: var(--border);
}
body.theme-parchment .feed-card-actions {
  border-top-color: var(--border);
}
body.theme-parchment .profile-footer {
  border-top-color: var(--border);
}

.page {
  display: none;
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0; right: 0;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 1;
  background: var(--page-bg, var(--bg-body));
  will-change: scroll-position;
  overscroll-behavior-y: contain;
}
.page.active { display: block; }

/* Page content inherits page theme colors */
.page .recipe-card { background: var(--page-card, var(--bg-card)); }
.page .section-title { color: var(--page-primary, var(--primary)); }
.page .recipe-meta-value { color: var(--page-accent, var(--gold)); }
.page .step-number { color: var(--page-accent, var(--gold)); }
.page .ingredient-qty { color: var(--page-accent, var(--gold)); }
.page .recipe-notes { border-left-color: var(--page-accent, var(--gold)); }
.page .drop-cap::first-letter { color: var(--page-accent, var(--gold)); }
.page .celtic-divider { color: var(--page-primary, var(--primary)); }
.page .form-title { color: var(--page-primary, var(--primary)); }
.page .pantry-title { color: var(--page-primary, var(--primary)); }
.page .btn-primary { background: var(--page-primary, var(--primary)); }

.page-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 16px 24px;
}

.page-top-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--page-accent, var(--gold));
}
.page-top-logo { width: 30px; height: 30px; }

/* ============================================================
   RECIPE LIST
   ============================================================ */
.list-toolbar {
  display: flex; gap: 10px; margin-bottom: 20px; align-items: center;
}
.search-input {
  flex: 1; padding: 10px 14px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary);
  font-size: 16px; font-family: var(--font-body);
  outline: none; transition: border-color 0.2s; -webkit-appearance: none;
}
.search-input:focus { border-color: var(--primary); }
.search-input::placeholder { color: var(--text-muted); }

.btn-add {
  width: 44px; height: 44px; min-width: 44px;
  border-radius: 50%; border: none;
  background: var(--primary); color: #fff;
  font-size: 24px; font-weight: 300;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(26,107,74,0.3);
}
.btn-add:active { transform: scale(0.92); background: var(--primary-hover); }

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.recipe-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  cursor: pointer; transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  contain: layout style;
}
.recipe-card:active { transform: scale(0.98); }

.recipe-card-photo {
  aspect-ratio: 3 / 2;
  background: linear-gradient(135deg, var(--primary-muted), var(--gold-muted));
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: 40px; font-family: var(--font-display); opacity: 0.6;
}
.recipe-card-body { padding: 14px 16px; }
.recipe-card-title {
  font-family: var(--font-display); font-size: 1.15rem;
  color: var(--text-primary); margin-bottom: 6px;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.recipe-card-meta {
  display: flex; gap: 12px; font-size: 0.8rem;
  color: var(--text-muted); margin-bottom: 8px; align-items: center;
}
.recipe-card-meta svg { width: 14px; height: 14px; flex-shrink: 0; }
.recipe-card-meta-item { display: flex; align-items: center; gap: 4px; }
.recipe-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-pill {
  font-size: 0.7rem; padding: 2px 8px; border-radius: 10px;
  background: var(--primary-muted); color: var(--primary);
  font-weight: 600; letter-spacing: 0.3px;
}

/* Published recipe indicator on cards */
.recipe-card-publish {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-muted);
}
.recipe-card-vis {
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
}
.recipe-card-stat {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
}
.recipe-card-stat svg { flex-shrink: 0; }
.recipe-card-stat-heart { color: var(--heart); }

/* Category tabs — horizontal scroll with snap indicator */
.category-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab {
  padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text-muted);
  font-size: 0.85rem; font-family: var(--font-body); white-space: nowrap;
  cursor: pointer; transition: all 0.15s; -webkit-tap-highlight-color: transparent;
  min-height: 44px; display: flex; align-items: center;
}
.category-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.category-tab.drag-over { border-color: var(--gold); background: var(--gold-muted); color: var(--gold); }
.category-tab-add {
  background: none; border-style: dashed; color: var(--text-muted);
  font-size: 1rem; padding: 6px 12px;
}

/* Swipe indicator — category name + dots */
.swipe-indicator {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; margin-bottom: 12px;
}
.swipe-label {
  font-family: var(--font-display); font-size: 1rem;
  color: var(--page-accent, var(--gold)); letter-spacing: 1px;
}
.swipe-dots { display: flex; gap: 6px; }
.swipe-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted); opacity: 0.3;
  transition: all 0.2s;
}
.swipe-dot.active {
  background: var(--page-accent, var(--gold)); opacity: 1;
  width: 18px; border-radius: 3px;
}

/* Swipe panels */
.swipe-panels {
  position: relative;
  min-height: 200px;
}
.swipe-panels.slide-left .recipe-grid,
.swipe-panels.slide-left .empty-state {
  animation: slideInLeft 0.25s ease-out;
}
.swipe-panels.slide-right .recipe-grid,
.swipe-panels.slide-right .empty-state {
  animation: slideInRight 0.25s ease-out;
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(-60px); }
  to { opacity: 1; transform: translateX(0); }
}

/* FAB — Floating Action Button */
.fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 16px);
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--gold);
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(201,168,76,0.4);
  z-index: 90;
  transition: transform 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.fab:active { transform: scale(0.9); }
/* FAB is always visible */

/* Quick-add sheet */
/* ── FAB radial menu ── */
.fab-backdrop {
  position: fixed; inset: 0; z-index: 89;
  background: rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.fab-backdrop.open { opacity: 1; pointer-events: auto; }

.fab-menu {
  position: fixed;
  right: 16px;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 16px);
  z-index: 91;
  pointer-events: none;
}
.fab-node {
  position: absolute;
  bottom: 0; right: 0;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--gold);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.4);
  opacity: 0; transform: scale(0.3);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}
.fab-node.open {
  opacity: 1; transform: scale(1);
  pointer-events: auto;
}
.fab-node:active { transform: scale(0.9) !important; }

.fab-node-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}
.fab-node-icon svg { width: 22px; height: 22px; }

.fab-node-label {
  position: absolute;
  right: 60px; top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.fab-node.open .fab-node-label { opacity: 1; }

.fab.menu-open {
  transform: rotate(45deg);
  background: var(--red);
  box-shadow: 0 4px 16px rgba(192,72,72,0.4);
}

/* ── Card design editor ── */
.card-edit-btn {
  position: absolute; bottom: 8px; right: 8px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.15);
  color: var(--gold); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.card-edit-btn:active { background: rgba(0,0,0,0.8); }
.card-edit-btn svg { width: 14px; height: 14px; }

.card-share-btn {
  position: absolute; bottom: 8px; left: 8px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.15);
  color: var(--gold); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.card-share-btn:active { background: rgba(0,0,0,0.8); }
.card-share-btn svg { width: 14px; height: 14px; }

.card-editor {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  width: 100%; max-width: 440px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  max-height: 85vh; overflow-y: auto;
}
.card-editor-preview {
  aspect-ratio: 3/2; border-radius: var(--radius);
  overflow: hidden; position: relative; margin-bottom: 16px;
}
.card-editor-preview .recipe-card-icon {
  width: 70%; height: 70%;
}
.icon-picker-section {
  margin-bottom: 12px;
}
.icon-picker-label {
  font-size: 0.7rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.icon-picker-row {
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 6px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.icon-picker-row::-webkit-scrollbar { display: none; }
.icon-option {
  flex: 0 0 52px; height: 52px;
  border-radius: var(--radius); border: 2px solid var(--border);
  background: var(--bg-input); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; -webkit-tap-highlight-color: transparent;
  padding: 4px;
}
.icon-option.active { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-muted); }
.icon-option:active { transform: scale(0.92); }
.icon-option svg { width: 100%; height: 100%; }

.theme-picker {
  display: flex; gap: 12px; margin-top: 12px; margin-bottom: 16px;
  justify-content: center;
}
.theme-swatch {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--border); cursor: pointer;
  position: relative; transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.theme-swatch.active { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-muted); }
.theme-swatch::after {
  content: ''; position: absolute; inset: 4px;
  border-radius: 50%;
}

/* Voice button */
.voice-btn.recording {
  color: var(--red) !important;
  animation: voicePulse 1s ease-in-out infinite;
}
@keyframes voicePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Wizard steps ── */
@keyframes wizardStepIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.wizard-step {
  animation: wizardStepIn 0.25s ease-out;
  margin-bottom: 14px;
}
.wizard-step-label {
  font-family: var(--font-display); color: var(--gold);
  font-size: 0.85rem; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 8px;
}
.wizard-choices { display: flex; gap: 8px; flex-wrap: wrap; }
.wizard-choice {
  padding: 10px 16px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--bg-input);
  color: var(--text-secondary); font-size: 0.9rem;
  font-family: var(--font-body); cursor: pointer;
  min-height: 44px; display: flex; align-items: center;
  transition: all 0.15s; -webkit-tap-highlight-color: transparent;
}
.wizard-choice:active,
.wizard-choice.selected {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* Completed step chips */
.wizard-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.wizard-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 16px;
  background: var(--primary-muted); color: var(--text-primary);
  font-size: 0.8rem; font-family: var(--font-body);
  cursor: pointer; transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.wizard-chip:active { background: var(--gold-muted); }
.wizard-chip-label { color: var(--text-muted); font-size: 0.7rem; margin-right: 2px; }

.wizard-generate {
  width: 100%; padding: 14px; font-size: 1.05rem;
  font-family: var(--font-display); background: var(--gold);
  color: #fff; border: none; border-radius: var(--radius);
  cursor: pointer; transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
  animation: wizardStepIn 0.3s ease-out;
}
.wizard-generate:active { opacity: 0.8; }

/* ── Free-form AI ── */
.freeform-area { display: flex; flex-direction: column; gap: 12px; }
.freeform-area textarea {
  min-height: 80px; resize: none;
  font-size: 0.95rem; line-height: 1.5;
}
.freeform-followup { margin-top: 12px; animation: wizardStepIn 0.25s ease-out; }
.freeform-followup-q { margin-bottom: 12px; }
.freeform-followup-label {
  font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 6px;
}

/* ── Creation footer ── */
.creation-footer {
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.creation-footer-link {
  background: none; border: none; color: var(--text-muted);
  font-size: 0.75rem; font-family: var(--font-body);
  cursor: pointer; padding: 6px 0;
  -webkit-tap-highlight-color: transparent;
}
.creation-footer-link:active { color: var(--gold); }

/* ── Recipe card icon overlay ── */
.recipe-card-photo { position: relative; overflow: hidden; }
.recipe-card-icon {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 80%; height: 80%;
  pointer-events: none; z-index: 1;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}
.recipe-hero { position: relative; overflow: hidden; }
.recipe-hero-icon {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 55%; max-width: 240px;
  pointer-events: none; z-index: 1;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.3));
}

/* Cooking mode */
.cooking-mode {
  position: fixed; inset: 0; z-index: 300;
  background: #0A0E0B;
  display: none; flex-direction: column;
}
.cooking-mode.active { display: flex; }

.cooking-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
  color: var(--gold);
}
.cooking-title { font-family: var(--font-display); font-size: 1.1rem; }
.cooking-progress { font-size: 0.8rem; color: var(--text-muted); }
.cooking-close {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid #2A3A30; background: none;
  color: var(--text-secondary); font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.cooking-progress-bar {
  height: 3px; background: #1C2A22; margin: 0 16px;
}
.cooking-progress-fill {
  height: 100%; background: var(--gold);
  transition: width 0.3s ease;
}

.cooking-steps-container {
  flex: 1;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cooking-steps-container::-webkit-scrollbar { display: none; }

.cooking-step {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  text-align: center;
}
.cooking-step-number {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--gold);
  opacity: 0.5;
  margin-bottom: 16px;
}
.cooking-step-text {
  font-family: var(--font-body);
  font-size: 1.5rem;
  color: #E8DCC8;
  line-height: 1.6;
  max-width: 500px;
}
.cooking-step-timer {
  margin-top: 20px;
  padding: 10px 24px;
  border-radius: 24px;
  border: 1px solid var(--gold);
  background: rgba(201,168,76,0.1);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.2rem;
  cursor: pointer;
}

.cooking-nav-hint {
  text-align: center;
  padding: 16px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 1px;
}

/* Category manager modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.5); display: flex;
  align-items: center; justify-content: center; padding: 20px;
}
.category-manager {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; width: 100%; max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.category-manager-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.category-manager-add { display: flex; gap: 8px; margin-bottom: 16px; }
.category-manager-add .form-input { flex: 1; }
.category-manager-list { list-style: none; }
.category-manager-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  color: var(--text-primary); font-size: 0.95rem;
}

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state-text { font-family: var(--font-display); font-size: 1.2rem; }

/* ============================================================
   RECIPE DETAIL
   ============================================================ */
.recipe-hero {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--primary-muted), var(--gold-muted));
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: 64px; font-family: var(--font-display);
  opacity: 0.5; margin-bottom: 24px;
}
.recipe-title {
  font-family: var(--font-display); font-size: 2rem;
  color: var(--text-primary); margin-bottom: 12px; line-height: 1.1;
}
.recipe-description {
  font-size: 1.05rem; color: var(--text-secondary);
  line-height: 1.7; margin-bottom: 20px;
}
.drop-cap::first-letter {
  font-family: var(--font-display); font-size: 3.5em;
  float: left; line-height: 0.75; margin: 0.05em 0.1em 0 0; color: var(--gold);
}
.recipe-meta-bar {
  display: flex; gap: 24px; padding: 14px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.recipe-meta-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1;
}
.recipe-meta-value { font-family: var(--font-display); font-size: 1.3rem; color: var(--gold); }
.recipe-meta-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.celtic-divider { text-align: center; margin: 28px 0; opacity: 0.4; }
.celtic-divider svg { max-width: 200px; width: 100%; }

.section-title { font-family: var(--font-display); font-size: 1.4rem; color: var(--text-primary); margin-bottom: 14px; }

.ingredients-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; margin-bottom: 8px; }
.ingredient-item { display: flex; gap: 6px; padding: 6px 0; border-bottom: 1px dotted var(--border); font-size: 0.95rem; }
.ingredient-qty { color: var(--gold); font-weight: 600; white-space: nowrap; }
.ingredient-name { color: var(--text-primary); }
.ingredient-have { position: relative; }
.ingredient-have::before { content: ''; width: 6px; height: 6px; border-radius: 50%; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); }
.ingredient-have.have-full::before { background: var(--green); }
.ingredient-have.have-half::before { background: var(--yellow); }
.ingredient-have.have-low::before { background: var(--orange); }
.ingredient-have.have-out::before { background: var(--red); }

.steps-list { list-style: none; margin-bottom: 8px; }
.step-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.step-item:last-child { border-bottom: none; }
.step-number { font-family: var(--font-display); font-size: 1.6rem; color: var(--gold); line-height: 1; min-width: 28px; padding-top: 2px; }
.step-text { font-size: 1rem; line-height: 1.6; color: var(--text-primary); }

/* Substitution indicators */
.ingredient-sub { margin-top: 4px; }
.sub-toggle {
  border: none; background: none; color: var(--gold);
  font-size: 0.75rem; cursor: pointer; padding: 2px 0;
  font-family: var(--font-body); opacity: 0.8;
}
.sub-toggle:hover { opacity: 1; }
.sub-detail { display: none; margin-top: 4px; padding-left: 4px; }
.sub-detail.open { display: block; }
.sub-option {
  padding: 6px 8px; margin-bottom: 4px;
  background: var(--bg-widget); border-radius: 6px;
  font-size: 0.8rem; line-height: 1.4;
}
.sub-option strong { color: var(--page-accent, var(--gold)); display: block; }
.sub-ratio { color: var(--text-secondary); display: block; font-size: 0.75rem; }
.sub-note { color: var(--text-muted); font-style: italic; font-size: 0.7rem; }

/* "Can I Make This?" badge */
.can-make-badge {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; margin-bottom: 20px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-widget);
}
.can-make-pct { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; }
.can-make-label { font-size: 0.85rem; color: var(--text-secondary); }
.can-make-subs { font-size: 0.75rem; color: var(--gold); margin-left: auto; }

.recipe-notes { font-style: italic; color: var(--text-secondary); border-left: 3px solid var(--gold); padding: 8px 16px; margin-top: 8px; line-height: 1.6; }

.detail-actions { display: flex; gap: 10px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }

/* ============================================================
   RECIPE EDITOR
   ============================================================ */
.form-title { font-family: var(--font-display); font-size: 1.6rem; color: var(--text-primary); margin-bottom: 20px; }
.form-section { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 0.75rem; font-weight: 700;
  color: var(--text-secondary); letter-spacing: 0.5px;
  text-transform: uppercase; margin-bottom: 6px; font-family: var(--font-body);
}
.form-input {
  width: 100%; padding: 12px 14px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary);
  font-size: 16px; font-family: var(--font-body);
  outline: none; transition: border-color 0.2s; -webkit-appearance: none;
  touch-action: manipulation;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-muted); }
textarea.form-input { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.form-inline-error { font-size: 0.8rem; color: var(--red); margin-top: 4px; }

.category-group { display: flex; flex-wrap: wrap; gap: 6px; }
.category-btn {
  padding: 8px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text-secondary);
  font-size: 0.85rem; font-family: var(--font-body);
  cursor: pointer; transition: all 0.15s; -webkit-tap-highlight-color: transparent;
}
.category-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.ingredient-rows { margin-bottom: 8px; }
.ingredient-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.ingredient-row .form-input.qty-input { width: 60px; flex-shrink: 0; text-align: center; }
.ingredient-row .form-input.item-input { flex: 1; }

.unit-picker { position: relative; }
.unit-picker-btn {
  padding: 10px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-input); color: var(--text-primary);
  font-size: 0.85rem; font-family: var(--font-body);
  cursor: pointer; white-space: nowrap; min-width: 52px; text-align: center;
}
.unit-picker-dropdown {
  display: none; position: absolute; top: 100%; left: 0; z-index: 200;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  padding: 6px; grid-template-columns: repeat(3, 1fr); gap: 4px; min-width: 180px;
}
.unit-picker-dropdown.open { display: grid; }
.unit-option {
  padding: 6px 8px; border: 1px solid transparent; border-radius: 4px;
  background: none; color: var(--text-secondary); font-size: 0.8rem;
  font-family: var(--font-body); cursor: pointer; text-align: center;
}
.unit-option:hover { background: var(--primary-muted); color: var(--primary); }
.unit-option.active { background: var(--primary); color: #fff; }

.row-remove {
  width: 32px; height: 32px; min-width: 32px; border: none; background: none;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: all 0.15s;
}
.row-remove:hover { color: var(--red); background: rgba(192,72,72,0.1); }

.add-row-btn {
  padding: 8px 16px; border: 1px dashed var(--border); border-radius: var(--radius);
  background: none; color: var(--text-muted); font-size: 0.85rem;
  font-family: var(--font-body); cursor: pointer; width: 100%; transition: all 0.15s;
}
.add-row-btn:hover { border-color: var(--primary); color: var(--primary); }

.step-rows { margin-bottom: 8px; }
.step-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-start; }
.step-row-number { font-family: var(--font-display); font-size: 1.3rem; color: var(--gold); min-width: 24px; padding-top: 8px; }
.step-row textarea { flex: 1; min-height: 60px; }

.tag-input-wrap {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); min-height: 44px; align-items: center; cursor: text;
}
.tag-input-wrap:focus-within { border-color: var(--primary); }
.tag-input-field {
  border: none; background: none; color: var(--text-primary);
  font-size: 0.9rem; font-family: var(--font-body); outline: none; min-width: 80px; flex: 1;
}
.tag-pill-removable {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.75rem; padding: 3px 6px 3px 10px; border-radius: 10px;
  background: var(--primary-muted); color: var(--primary); font-weight: 600;
}
.tag-pill-x {
  width: 16px; height: 16px; border: none; background: none;
  color: var(--primary); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
}

.form-actions { display: flex; gap: 10px; margin-top: 24px; }

/* ============================================================
   PANTRY (Steward Mode)
   ============================================================ */
.pantry-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.pantry-title { font-family: var(--font-display); font-size: 1.6rem; color: var(--text-primary); }

.pantry-add { display: flex; gap: 8px; margin-bottom: 20px; }
.pantry-add .form-input { flex: 1; }

.pantry-list { list-style: none; }
.pantry-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border); gap: 12px;
}
.pantry-item-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pantry-item-name { font-size: 0.95rem; color: var(--text-primary); }
.pantry-item-qty {
  font-size: 0.75rem; color: var(--page-accent, var(--gold)); cursor: pointer;
  font-weight: 600;
}
.pantry-qty-add {
  font-size: 0.65rem; color: var(--text-muted); background: none; border: none;
  cursor: pointer; padding: 0; text-align: left; font-family: var(--font-body);
}
.pantry-qty-add:hover { color: var(--page-accent, var(--gold)); }

.level-group { display: flex; gap: 2px; background: var(--bg-input); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.level-btn {
  padding: 4px 8px; border: none; background: none;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
  cursor: pointer; color: var(--text-muted); font-family: var(--font-body); transition: all 0.15s;
}
.level-btn.active-full { background: var(--green); color: #fff; }
.level-btn.active-half { background: var(--yellow); color: #fff; }
.level-btn.active-low { background: var(--orange); color: #fff; }
.level-btn.active-out { background: var(--red); color: #fff; }

.pantry-remove { border: none; background: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 4px; }
/* Pantry sections */
.pantry-section { margin-bottom: 16px; }
.pantry-section-header {
  font-family: var(--font-display); font-size: 0.95rem; color: var(--text-primary);
  padding: 6px 0 6px 10px; border-left: 3px solid var(--gold);
  margin-bottom: 6px;
}

.staple-badge { color: var(--gold); font-size: 0.85rem; }
.expiry-badge {
  font-size: 0.65rem; padding: 1px 6px; border-radius: 8px;
  background: var(--bg-widget); color: var(--text-muted);
}
.expiry-badge.expiring { background: rgba(212,160,48,0.15); color: var(--yellow); }
.expiry-badge.expired { background: rgba(192,72,72,0.15); color: var(--red); }

/* Expiry alert on What Can I Make */
.expiry-alert {
  padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px;
  background: rgba(212,160,48,0.1); border: 1px solid var(--yellow);
  font-size: 0.85rem; color: var(--yellow);
}

/* What Can I Make cards */
.canmake-section-title {
  font-family: var(--font-display); font-size: 1.1rem; margin: 16px 0 8px;
}
.canmake-card {
  padding: 12px 14px; margin-bottom: 8px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  cursor: pointer; transition: transform 0.15s;
}
.canmake-card:active { transform: scale(0.98); }
.canmake-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.canmake-card-title { font-family: var(--font-display); font-size: 1rem; color: var(--text-primary); }
.canmake-card-pct { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; }
.canmake-bar { height: 4px; background: var(--bg-widget); border-radius: 2px; margin-bottom: 6px; }
.canmake-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.canmake-missing { font-size: 0.8rem; color: var(--text-muted); }
.canmake-expiry-badge { font-size: 0.75rem; color: var(--yellow); margin-bottom: 4px; }

/* Shopping list */
.shopping-list { list-style: none; }
.shopping-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.shopping-item.checked { opacity: 0.5; }
.shopping-check {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border); background: none;
  color: var(--text-muted); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.shopping-check.checked { border-color: var(--green); color: var(--green); }
.shopping-item-name { flex: 1; font-size: 0.95rem; color: var(--text-primary); }
.shopping-item.checked .shopping-item-name { text-decoration: line-through; }
.shopping-staple-badge {
  font-size: 0.6rem; padding: 1px 6px; border-radius: 8px;
  background: rgba(201,168,76,0.15); color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.shopping-recipe-badge {
  font-size: 0.6rem; padding: 1px 6px; border-radius: 8px;
  background: var(--primary-muted); color: var(--primary);
  max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.checked-list .shopping-item { border-bottom-style: dashed; }

.pantry-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-style: italic; }

.autocomplete-wrap { position: relative; flex: 1; }
.autocomplete-list {
  display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  max-height: 180px; overflow-y: auto; margin-top: 4px;
}
.autocomplete-list.open { display: block; }
.autocomplete-option { padding: 8px 12px; cursor: pointer; font-size: 0.9rem; color: var(--text-primary); }
.autocomplete-option:hover { background: var(--primary-muted); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  padding: 10px 20px; border: none; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 600; cursor: pointer; letter-spacing: 0.3px;
  transition: all 0.15s; -webkit-tap-highlight-color: transparent; font-family: var(--font-body);
  touch-action: manipulation; min-height: 44px;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--bg-widget); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-danger { background: none; color: var(--red); border: 1px solid var(--red); }

.back-button {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 14px 8px 8px; border: 1px solid var(--border);
  border-radius: 20px; background: var(--bg-card);
  color: var(--text-secondary); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; margin-bottom: 16px; transition: all 0.15s;
  -webkit-tap-highlight-color: transparent; font-family: var(--font-body);
}
.back-button:active { transform: scale(0.95); border-color: var(--primary); color: var(--primary); }

.confirm-inline { display: flex; gap: 8px; align-items: center; font-size: 0.85rem; color: var(--text-secondary); }

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container {
  position: fixed; bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 8px);
  left: 16px; right: 16px; z-index: 500;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25); font-size: 0.85rem;
  max-width: 400px; margin: 0 auto; pointer-events: auto; animation: toastIn 0.3s ease;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .recipe-grid { grid-template-columns: 1fr; }
  .ingredients-grid { grid-template-columns: 1fr; }
  .recipe-meta-bar { gap: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .recipe-title { font-size: 1.6rem; }
  .recipe-hero { aspect-ratio: 4 / 3; }
}

.hidden { display: none !important; }

/* ============================================================
   PROFILE PAGE
   ============================================================ */
.profile-hero {
  text-align: center;
  padding: 24px 16px 16px;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: 0 0 20px rgba(201,168,76,0.15);
}
.profile-avatar svg {
  display: block;
  width: 100%;
  height: 100%;
}
.profile-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.profile-baker-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-widget);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.profile-baker-code:active { border-color: var(--gold); }
.baker-code-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.baker-code-value {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--gold);
  letter-spacing: 2px;
}
.profile-bio {
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  margin: 12px 0 0;
  line-height: 1.5;
}
.profile-joined {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 16px 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.profile-stat {
  flex: 1;
  text-align: center;
  padding: 16px 8px;
}
.profile-stat + .profile-stat {
  border-left: 1px solid var(--border);
}
.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--gold);
}
.stat-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.profile-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 20px;
}
.profile-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.profile-save-cta {
  text-align: center;
  margin: 0 16px 20px;
  padding: 24px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--gold-muted, rgba(201,168,76,0.3));
  border-radius: var(--radius-lg);
}
.save-cta-icon { margin-bottom: 10px; }
.save-cta-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.save-cta-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 16px;
}

.profile-email-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 16px 20px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.profile-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin: 0 0 8px;
}
.theme-toggle-btn {
  display: flex;
  background: var(--bg-widget);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.theme-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-family: var(--font-body);
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}
.theme-option.active {
  background: var(--gold);
  color: var(--bg-body);
  font-weight: 600;
  border-radius: 20px;
}

.profile-footer {
  text-align: center;
  padding: 20px 16px 40px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.profile-signout {
  color: var(--text-muted);
  font-size: 0.8rem;
}
.profile-signout:active { color: var(--red); }
.profile-version {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 8px;
  opacity: 0.5;
}

/* ============================================================
   NICKNAME / EDIT PROFILE / SAVE ACCOUNT MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  padding: 20px;
}
.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.nickname-modal {
  width: 100%;
  max-width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px 24px;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.25s;
}
.modal-overlay.visible .nickname-modal {
  transform: translateY(0);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-12px); }
  30% { transform: translateX(10px); }
  45% { transform: translateX(-8px); }
  60% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}

.nickname-icon { margin-bottom: 12px; }
.nickname-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.nickname-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0 0 20px;
  line-height: 1.4;
}
.nickname-field {
  text-align: center;
  font-size: 1.1rem !important;
  font-family: var(--font-display) !important;
  margin-bottom: 16px;
}
.nickname-submit {
  width: 100%;
  margin-bottom: 8px;
}
.nickname-skip {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.btn-text {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 8px;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   VISIBILITY PICKER
   ============================================================ */
.visibility-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.visibility-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-widget);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-body);
  color: var(--text-primary);
}
.visibility-option.selected {
  border-color: var(--gold);
  background: rgba(201,168,76,0.08);
}
.vis-icon { color: var(--text-muted); flex-shrink: 0; }
.visibility-option.selected .vis-icon { color: var(--gold); }
.vis-text { flex: 1; }
.vis-label { font-size: 0.9rem; font-weight: 600; }
.vis-desc { font-size: 0.7rem; color: var(--text-muted); margin-top: 1px; }
.vis-check { opacity: 0; transition: opacity 0.15s; color: var(--gold); }
.visibility-option.selected .vis-check { opacity: 1; }

/* ============================================================
   PUBLISH BADGE (on recipe detail)
   ============================================================ */
.publish-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 16px 0;
  padding: 10px 16px;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--gold);
  cursor: pointer;
}
.publish-badge:active { background: rgba(201,168,76,0.15); }
.publish-badge-icon { color: var(--green); }

/* ============================================================
   HEART BUTTON
   ============================================================ */
.heart-btn, .heart-btn-large {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font-body);
  padding: 6px 10px;
  border-radius: 20px;
  transition: color 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.heart-btn-large {
  font-size: 1rem;
  padding: 10px 20px;
  background: var(--bg-widget);
  border: 1px solid var(--border);
}
.heart-btn:active, .heart-btn-large:active { transform: scale(0.9); }
.heart-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  transition: fill 0.2s, stroke 0.2s;
}
.heart-btn.hearted, .heart-btn-large.hearted {
  color: var(--heart);
}
.heart-btn.hearted .heart-icon, .heart-btn-large.hearted .heart-icon {
  fill: var(--heart);
  stroke: var(--heart);
}
.heart-count {
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   FEED PAGE
   ============================================================ */
.feed-header {
  padding: 0 0 12px;
}
.feed-sort {
  display: flex;
  gap: 0;
  background: var(--bg-widget);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.feed-sort-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.feed-sort-btn.active {
  background: var(--gold);
  color: var(--bg-body);
  font-weight: 600;
}
.feed-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feed-empty {
  text-align: center;
  padding: 60px 20px;
}

/* Feed Card — horizontal layout with art thumbnail */
.feed-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.1s;
}
.feed-card:active { transform: scale(0.98); }
.feed-card-row {
  display: flex;
  align-items: stretch;
}
.feed-card-art {
  width: 110px;
  min-width: 110px;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border);
}
.feed-card-art svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.feed-card-art-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  opacity: 0.7;
}
.feed-card-art-icon svg {
  width: 100%;
  height: 100%;
}
.feed-card-content {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.feed-card-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.feed-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.feed-avatar svg { width: 100%; height: 100%; display: block; }
.feed-author-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.feed-card-body {
  padding: 0;
}
.feed-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.feed-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.feed-card-meta {
  display: flex;
  gap: 12px;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.feed-card-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 14px 10px;
  border-top: 1px solid var(--border);
}
.feed-comment-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.feed-author-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   PUBLISHED RECIPES ON PROFILE
   ============================================================ */
.profile-section-header {
  padding: 0 16px;
  margin-bottom: 8px;
}
.profile-section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
  margin: 0;
}
.published-recipe-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.pub-recipe-title {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-family: var(--font-body);
}
.pub-recipe-meta {
  display: flex;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.pub-hearts { color: var(--heart); display: inline-flex; align-items: center; gap: 3px; }
.pub-vis { text-transform: capitalize; display: inline-flex; align-items: center; gap: 3px; }

/* ============================================================
   FRIENDS LIST
   ============================================================ */
.friend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}
.friend-item:last-child { border-bottom: none; }
.friend-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.friend-avatar svg { width: 100%; height: 100%; display: block; }
.friend-info { flex: 1; min-width: 0; }
.friend-name { font-size: 0.85rem; color: var(--text-primary); }
.friend-code { font-size: 0.65rem; color: var(--text-muted); letter-spacing: 1px; }

/* ============================================================
   COOK PHOTOS
   ============================================================ */
.cook-photo-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ============================================================
   NOTIFICATIONS
   ============================================================ */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-unread { background: rgba(201,168,76,0.05); margin: 0 -16px; padding: 12px 16px; }
.notif-icon { flex-shrink: 0; width: 28px; text-align: center; display: flex; align-items: center; justify-content: center; color: var(--gold); }
.notif-body { flex: 1; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.4; }
.notif-time { font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   FEED SEARCH
   ============================================================ */
.feed-search-bar { margin-bottom: 10px; }
.feed-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.feed-filter-btn {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.feed-filter-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.1);
}
.feed-filter-btn:active { transform: scale(0.95); }

/* ============================================================
   COMMENTS
   ============================================================ */
.comment-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 12px;
}
.comment-input {
  flex: 1;
  resize: none;
  font-size: 0.85rem !important;
  min-height: 40px;
}
.comment-submit {
  padding: 8px 16px;
  font-size: 0.8rem;
  white-space: nowrap;
}
.comment-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.comment-avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}
.comment-author {
  font-size: 0.8rem;
  color: var(--text-primary);
  font-weight: 600;
}
.comment-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: auto;
}
.comment-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: 32px;
}

/* ============================================================
   INTERACTIVE FEEDBACK — visual cues for clickable elements
   ============================================================ */

/* Feed card author — clickable to view profile */
.feed-card-author {
  cursor: pointer;
  border-radius: var(--radius);
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background 0.15s;
}
.feed-card-author:active {
  background: rgba(201,168,76,0.1);
}
.feed-author-name {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s, color 0.15s;
}
.feed-card-author:hover .feed-author-name,
.feed-card-author:active .feed-author-name {
  text-decoration-color: var(--gold);
  color: var(--gold);
}

/* Feed author bar in detail — clickable */
.feed-author-bar {
  cursor: pointer;
  transition: background 0.15s;
  border-radius: var(--radius);
  padding: 8px 6px 12px;
  margin: 0 -6px 4px;
}
.feed-author-bar:active {
  background: rgba(201,168,76,0.08);
}

/* Heart button — bigger tap target + pulse animation */
.heart-btn, .heart-btn-large {
  position: relative;
}
.heart-btn::after, .heart-btn-large::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 20px;
}
.heart-btn:active .heart-icon, .heart-btn-large:active .heart-icon {
  transform: scale(1.3);
}
.heart-icon {
  transition: transform 0.15s, fill 0.2s, stroke 0.2s;
}
.heart-btn.hearted .heart-icon {
  animation: heartPop 0.3s ease-out;
}
@keyframes heartPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* Heart button hover glow */
.heart-btn:hover, .heart-btn-large:hover {
  color: var(--heart);
}
.heart-btn:hover .heart-icon {
  stroke: var(--heart);
}

/* Feed card — lift on hover */
.feed-card {
  transition: transform 0.1s, box-shadow 0.15s;
}
.feed-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* Feed card art — subtle zoom on hover */
.feed-card:hover .feed-card-art svg {
  transform: scale(1.05);
  transition: transform 0.3s;
}

/* Comment form — glow on focus */
.comment-input:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 2px rgba(201,168,76,0.15);
}

/* Baker Code — copy hint */
.profile-baker-code {
  position: relative;
}
.profile-baker-code::after {
  content: 'tap to copy';
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  white-space: nowrap;
}
.profile-baker-code:hover::after,
.profile-baker-code:active::after {
  opacity: 1;
}

/* Friends list items — hover state */
.friend-item {
  transition: background 0.15s;
  border-radius: var(--radius);
  margin: 0 -8px;
  padding-left: 24px;
  padding-right: 24px;
}
.friend-item[style*="cursor:pointer"]:hover,
.friend-item[onclick]:hover {
  background: rgba(201,168,76,0.06);
}
.friend-item[style*="cursor:pointer"]:active,
.friend-item[onclick]:active {
  background: rgba(201,168,76,0.12);
}
.friend-item[style*="cursor:pointer"] .friend-name {
  text-decoration: underline dotted transparent;
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s;
}
.friend-item[style*="cursor:pointer"]:hover .friend-name {
  text-decoration-color: var(--gold);
}

/* Notification items — hover */
.notif-item {
  transition: background 0.15s;
  border-radius: var(--radius);
  cursor: pointer;
}
.notif-item:hover {
  background: rgba(201,168,76,0.05);
}
.notif-item:active {
  background: rgba(201,168,76,0.1);
}

/* Published recipe items on profile */
.published-recipe-item {
  transition: background 0.15s;
  cursor: pointer;
}
.published-recipe-item:hover {
  background: rgba(201,168,76,0.05);
}

/* Visibility picker options — stronger select feedback */
.visibility-option:active {
  transform: scale(0.98);
}

/* Profile avatar — glow ring on hover */
.profile-avatar {
  transition: box-shadow 0.2s;
}
.profile-avatar:hover {
  box-shadow: 0 0 20px rgba(201,168,76,0.3);
}

/* Header buttons — subtle bounce on notification */
.header-notif-btn:has(.notif-badge[style*="display: flex"]),
.header-notif-btn:has(.notif-badge:not([style*="display: none"])) {
  animation: notifPulse 2s ease-in-out infinite;
}
@keyframes notifPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Feed sort buttons — stronger active state */
.feed-sort-btn {
  transition: color 0.15s, background 0.15s, transform 0.1s;
}
.feed-sort-btn:active { transform: scale(0.95); }

/* "I Made This" button highlight */
.cook-photo-item {
  transition: background 0.15s;
  border-radius: var(--radius);
  padding: 8px 6px;
  margin: 0 -6px;
}

/* Report/block text links */
.btn-text[style*="color:var(--text-muted)"] {
  transition: color 0.15s;
}
.btn-text[style*="color:var(--text-muted)"]:hover {
  color: var(--red) !important;
}

/* Save to My Recipes button — success feedback handled in JS, but add hover */
.btn-primary:hover {
  filter: brightness(1.1);
}
.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ============================================================
   SKELETON LOADERS
   ============================================================ */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
}
.skeleton-row {
  display: flex;
  align-items: stretch;
}
.skeleton-art {
  width: 110px;
  min-width: 110px;
  min-height: 100px;
  background: var(--bg-widget);
}
.skeleton-content {
  flex: 1;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--bg-widget);
}
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w90 { width: 90%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-pulse {
  animation: skeletonPulse 1.5s ease-in-out infinite;
}
@keyframes skeletonPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* ============================================================
   PULL-TO-REFRESH
   ============================================================ */
.pull-indicator {
  text-align: center;
  height: 0;
  overflow: hidden;
  color: var(--gold);
  font-size: 0.75rem;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: height 0.2s, opacity 0.2s;
  opacity: 0;
}

/* ============================================================
   BOOKMARK BUTTON
   ============================================================ */
.bookmark-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, transform 0.15s;
}
.bookmark-btn:active { transform: scale(0.85); }
.bookmark-btn:hover { color: var(--gold); }
.bookmark-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  transition: fill 0.2s, stroke 0.2s;
}
.bookmark-btn.bookmarked { color: var(--gold); }
.bookmark-btn.bookmarked .bookmark-icon {
  fill: var(--gold);
  stroke: var(--gold);
}

/* ============================================================
   TRENDING SECTION
   ============================================================ */
.trending-label {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.trending-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.trending-scroll::-webkit-scrollbar { display: none; }
.trending-card {
  flex-shrink: 0;
  width: 140px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.1s;
}
.trending-card:active { transform: scale(0.97); }
.trending-art {
  width: 140px;
  height: 90px;
  overflow: hidden;
  position: relative;
}
.trending-art-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  opacity: 0.7;
}
.trending-art-icon svg {
  width: 100%;
  height: 100%;
}
.trending-art svg {
  width: 100%;
  height: 100%;
  display: block;
}
.trending-info {
  padding: 8px 10px;
}
.trending-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trending-author {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.trending-stats {
  font-size: 0.7rem;
  color: var(--heart);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ============================================================
   SHARED GROCERY LISTS
   ============================================================ */
.shared-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.2s;
}
.shared-list-item.checked { opacity: 0.5; }
.shared-check {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: none;
  color: var(--green);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.shared-list-item.checked .shared-check {
  border-color: var(--green);
  background: rgba(45,155,110,0.15);
}
.shared-check:active { transform: scale(0.9); }
.shared-item-text { flex: 1; min-width: 0; }
.shared-item-name {
  font-size: 0.9rem;
  color: var(--text-primary);
}
.shared-item-name.line-through { text-decoration: line-through; }
.shared-item-by {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
}
.shared-remove {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.shared-remove:hover { color: var(--red); background: rgba(192,72,72,0.1); }

/* ============================================================
   PAYWALL — lock badges, tier cards, nav dimming
   ============================================================ */
.nav-lock-badge {
  position: absolute;
  top: 2px;
  right: 8px;
  pointer-events: none;
  z-index: 2;
}
.bottom-nav-btn.nav-locked {
  opacity: 0.55;
}
.bottom-nav-btn.nav-locked span {
  color: var(--text-muted);
}

.fab-node.fab-locked {
  opacity: 0.4;
}
.fab-node.fab-locked .fab-node-label {
  color: var(--text-muted);
}

.paywall-tier-card {
  background: var(--bg-widget);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

/* ============================================================
   SIDEBAR NAV — desktop only (>= 769px)
   ============================================================ */
.sidebar-nav {
  display: none;
}

@media (min-width: 769px) {
  .sidebar-nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 220px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 0;
    z-index: 100;
    overflow-y: auto;
  }

  .sidebar-logo {
    padding: 20px 20px 24px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--gold);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
  }

  .sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: color 0.15s, background 0.15s;
    border-left: 3px solid transparent;
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar-item:hover {
    color: var(--text-primary);
    background: var(--primary-muted);
  }

  .sidebar-item.active {
    color: var(--gold);
    border-left-color: var(--gold);
    background: var(--gold-muted);
  }

  .sidebar-item.nav-locked {
    opacity: 0.55;
  }

  .sidebar-item svg {
    flex-shrink: 0;
  }

  /* Hide bottom nav on desktop */
  .bottom-nav {
    display: none !important;
  }

  /* Shift content right for sidebar */
  .page {
    margin-left: 220px;
  }

  /* Header buttons stay in content area */
  .header-buttons {
    left: 236px;
    right: auto;
  }

  /* FAB in content area */
  .fab {
    left: auto;
    right: 24px;
    bottom: 24px;
  }
  .fab-menu {
    left: auto;
    right: 24px;
  }

  /* Wider recipe grid */
  .swipe-panels {
    max-width: 1200px;
  }

  /* Recipe detail max-width for readability */
  #recipe-detail-content {
    max-width: 800px;
    margin: 0 auto;
  }

  /* Page top titles don't need to be as centered */
  .page-top-title {
    max-width: 1200px;
  }

  /* Wider modals */
  .category-manager {
    max-width: 500px;
  }
}

/* Profile tier badge */
.profile-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 4px 14px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.3px;
}
.tier-aichef {
  background: linear-gradient(135deg, rgba(201,168,76,0.2), rgba(26,107,74,0.15));
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.3);
}
.tier-plus {
  background: var(--primary-muted);
  color: var(--green);
  border: 1px solid rgba(45,155,110,0.25);
}
.tier-free {
  background: var(--bg-widget);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Cook mode free counter */
.cook-counter-badge {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold-muted);
  color: var(--gold);
  font-size: 0.7rem;
  font-family: var(--font-body);
  padding: 3px 12px;
  border-radius: 10px;
  z-index: 10;
  letter-spacing: 0.5px;
}
