/* =============================================================
   My Food Checklist — style.css
   © 2026 Island Sun Design LLC. Created by Ryan Bishop.
   https://IslandSunDesign.com
   ============================================================= */

:root {
  --mango:        #FF8C00;
  --papaya:       #FF5E3A;
  --lime:         #5CB82E;
  --dragonfruit:  #D94FA1;
  --banana:       #FDE04B;
  --deep:         #1A1207;
  --content-bg:   #1A1207;
  --card-bg:      #261C0E;
  --card-border:  #3D2D14;
  --wish-bg:      #221220;
  --wish-border:  #4A1E3E;
  --tried-bg:     #141F0E;
  --tried-border: #223318;
  /* new bg controls */
  --body-bg:        #1A1207;
  --tab-nav-bg:     #1A1207;
  --progress-bar-bg:#0a0804;
  --cat-browser-bg: #1A1207;
  --tab-h:        92px;
  --bar-h:        60px;
  --radius:       16px;
  --shadow:       0 3px 18px rgba(0,0,0,0.35);
  /* text */
  --text-primary:   rgba(255,248,239,0.88);
  --text-secondary: rgba(255,248,239,0.55);
  --text-muted:     rgba(255,248,239,0.36);
  /* ui */
  --header-bg:      #1A1207;
  --settings-bg:    rgba(255,255,255,0.04);
  --settings-border:#3D2D14;
  --input-bg:       rgba(0,0,0,0.3);
  --input-border:   rgba(255,255,255,0.15);
  --filter-bg:      rgba(255,255,255,0.06);
  --scrollbar-thumb:#4a3520;
  --badge-rare-bg:  rgba(255,200,50,0.15);
  --badge-rare-col: #FDE04B;
}

/* ── LIGHT MODE ───────────────────────────────────────── */
body.light-mode {
  --deep:         #f5f0e8;
  --content-bg:   #faf6f0;
  --card-bg:      #ffffff;
  --card-border:  #e2d5c3;
  --wish-bg:      #fff0f8;
  --wish-border:  #f0c0e0;
  --tried-bg:     #f0faf0;
  --tried-border: #b8ddba;
  /* new bg controls */
  --body-bg:        #faf6f0;
  --tab-nav-bg:     #f5f0e8;
  --progress-bar-bg:#ffffff;
  --cat-browser-bg: #f5f0e8;
  --text-primary:   rgba(40,25,10,0.92);
  --text-secondary: rgba(40,25,10,0.60);
  --text-muted:     rgba(40,25,10,0.40);
  --header-bg:      #f5f0e8;
  --settings-bg:    rgba(0,0,0,0.04);
  --settings-border:#d5c8b5;
  --input-bg:       rgba(255,255,255,0.9);
  --input-border:   rgba(0,0,0,0.18);
  --filter-bg:      rgba(0,0,0,0.06);
  --scrollbar-thumb:#c8b89a;
  --shadow:         0 3px 18px rgba(0,0,0,0.12);
  --badge-rare-bg:  rgba(255,160,0,0.12);
  --badge-rare-col: #b86000;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--body-bg);
  color: var(--text-primary);
  font-family: 'Google Sans', 'Product Sans', sans-serif;
  min-height: 100vh;
  padding-bottom: calc(var(--bar-h) + 8px);
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* ══════════════════════════════════════════
   HEADER — compact 3-column row
   ══════════════════════════════════════════ */
header {
  /* Dark mode default: deep dark bg with gradient as a very subtle top edge accent */
  background: var(--header-bg);
  border-top: 3px solid transparent;
  border-image: linear-gradient(135deg, var(--mango) 0%, var(--papaya) 52%, var(--dragonfruit) 100%) 1;
  padding: 14px 24px 16px;
  position: relative;
  overflow: hidden;
}
/* Soft gradient wash — barely visible in dark mode */
header::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg,
    rgba(255,140,0,0.07) 0%,
    rgba(255,94,58,0.05) 52%,
    rgba(217,79,161,0.06) 100%);
  pointer-events: none;
}

/* Light mode: warm off-white bg, slightly stronger accent wash */
body.light-mode header {
  background: #faf6f0;
  border-image: linear-gradient(135deg, var(--mango) 0%, var(--papaya) 52%, var(--dragonfruit) 100%) 1;
}
body.light-mode header::before {
  background: linear-gradient(135deg,
    rgba(255,140,0,0.06) 0%,
    rgba(255,94,58,0.04) 52%,
    rgba(217,79,161,0.05) 100%);
}

/* ── Header text colors: adapt to mode ── */
.header-eyebrow {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
/* ── Logo text ── */
.header-logo-img-wrap {
  margin: 4px 0 2px;
}
/* Legacy img classes kept for footer compat */
.header-logo-img {
  display: block;
  height: 44px;
  width: auto;
  max-width: 320px;
}
.header-logo-light { display: none; }
.header-logo-dark  { display: block; }
body.light-mode .header-logo-dark  { display: none; }
body.light-mode .header-logo-light { display: block; }

/* Text + icon logo */
.header-logo-text {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--mango);
  text-decoration: none;
}
.header-logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: var(--mango);
  filter: drop-shadow(0 0 6px rgba(255,140,0,0.25));
}
.header-logo-wordmark {
  font-family: 'Google Sans', 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  letter-spacing: -0.01em;
  line-height: 1;
  /* Gradient text that works on both dark & light */
  background: linear-gradient(120deg, var(--mango) 0%, var(--papaya) 55%, var(--dragonfruit) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.light-mode .header-logo-wordmark {
  background: linear-gradient(120deg, #d96e00 0%, #c43a00 55%, #ad0066 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
body.light-mode .header-logo-icon {
  color: #d96e00;
}
.footer-logo-text .header-logo-icon { width: 28px; height: 28px; }
.footer-logo-text .header-logo-wordmark { font-size: 1.1rem; }

@media (max-width: 900px) {
  .header-logo-icon { width: 30px; height: 30px; }
  .header-logo-wordmark { font-size: 1.1rem; }
}
@media (max-width: 480px) {
  .header-logo-icon { width: 24px; height: 24px; }
  .header-logo-wordmark { font-size: 0.95rem; }
}
header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.1;
}
header h1 em {
  font-style: normal;
  font-weight: 900;
  background: linear-gradient(90deg, var(--mango) 0%, var(--papaya) 60%, var(--dragonfruit) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline;
}
header .tagline {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 300;
  line-height: 1.4;
}

/* Disclaimer card — adapts to mode */
.disclaimer-card {
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
}
.disclaimer-card .disc-title {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mango);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
header .warning {
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
header .promo {
  font-size: 0.64rem;
  color: var(--text-muted);
  padding-top: 5px;
  border-top: 1px solid var(--settings-border);
}
header .promo a {
  color: var(--mango);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,140,0,0.35);
  transition: border-color 0.2s, color 0.2s;
}
header .promo a:hover { opacity: 0.8; }

/* Counts box */
.header-counts {
  display: flex;
  align-items: stretch;
  width: 100%;
  background: var(--settings-bg);
  border: 1px solid var(--settings-border);
  border-radius: 14px;
  overflow: hidden;
}
.header-count-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 5px;
  gap: 2px;
}
.header-count-num {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  font-weight: 900;
  color: var(--mango);
  line-height: 1;
}
.header-count-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.header-count-divider {
  width: 1px;
  background: var(--settings-border);
  margin: 8px 0;
  flex-shrink: 0;
}
/* Tried count — distinct from dishes/cuisines */
.header-count-item:last-child {
  background: rgba(92, 184, 46, 0.08);
  border-left: 1px solid rgba(92, 184, 46, 0.2);
  position: relative;
}
body.light-mode .header-count-item:last-child {
  background: rgba(61, 160, 32, 0.07);
  border-left-color: rgba(61, 160, 32, 0.18);
}
#tried-count-num {
  color: #7DD44A;
}
body.light-mode #tried-count-num {
  color: #3a9e1e;
}
.header-count-item:last-child .header-count-label {
  color: rgba(125, 212, 74, 0.7);
}
body.light-mode .header-count-item:last-child .header-count-label {
  color: rgba(45, 140, 20, 0.75);
}

/* Share icons */
.share-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.share-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--settings-bg);
  border: 1px solid var(--settings-border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.78rem;
  transition: background 0.18s, transform 0.15s, border-color 0.18s, color 0.18s;
  cursor: pointer;
  flex-shrink: 0;
}
.share-btn:hover { background: rgba(255,140,0,0.15); border-color: var(--mango); color: var(--mango); transform: scale(1.12); }
.share-btn svg  { width: 13px; height: 13px; fill: currentColor; }

.header-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 0.85fr;
  align-items: center;
  gap: 14px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

/* COL 1 — branding */
.header-col-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* COL 2 — friendly note */
.header-col-disclaimer {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* COL 3 — counts + share */
.header-col-share {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Mobile: single column */
@media (max-width: 720px) {
  .header-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 10px;
  }
  .header-col-logo       { align-items: center; }
  .header-col-disclaimer { justify-content: center; }
  .header-col-share      { align-items: center; }
  header h1              { font-size: clamp(1.8rem, 7vw, 2.8rem); }
  .disclaimer-card       { max-width: 100%; }
  .header-eyebrow        { display: none; }
  .header-counts         { max-width: 200px; }
}

/* ══════════════════════════════════════════
   STICKY HEADER (tab-nav + filter-bar together)
   ══════════════════════════════════════════ */
#sticky-header {
  position: relative;
  top: auto;
  z-index: 100;
}

#sticky-search {
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}

/* ══════════════════════════════════════════
   TAB NAV
   ══════════════════════════════════════════ */
#tab-nav {
  position: relative; /* was sticky — now handled by #sticky-header */
  top: auto;
  z-index: auto;
  background: var(--tab-nav-bg);
  display: flex;
  align-items: center;
  height: auto;
  padding: 10px 12px;
  gap: 6px;
  box-shadow: none; /* shadow now on sticky-header */
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
#tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom: none;
  color: var(--text-muted);
  font-family: 'Google Sans', 'Product Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 50px;
  transition: color 0.22s, background 0.22s, border-color 0.22s, box-shadow 0.22s;
  letter-spacing: 0.3px;
  padding: 8px 16px;
}
.tab-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.15); color: var(--text-primary); }

/* ── TABLET ─────────────────── */
@media (max-width: 900px) and (min-width: 481px) {
  #tab-nav { padding: 8px 8px; gap: 4px; }
  .tab-btn { font-size: 0.72rem; padding: 7px 12px; }
  .tab-btn .tab-icon { font-size: 1rem; }
}

/* ── MOBILE ─────── */
@media (max-width: 480px) {
  #tab-nav { padding: 8px 4px; gap: 3px; height: auto; }
  .tab-btn {
    flex: 1 1 0;
    font-size: 0.62rem;
    padding: 7px 6px;
    gap: 4px;
  }
  .tab-btn .tab-label { display: none; }
  .tab-btn .tab-count { font-size: 0.52rem; padding: 1px 4px; min-width: 16px; }
}
.tab-btn .tab-icon  { font-size: 1.1rem; line-height: 1; transition: transform 0.22s; }
.tab-btn .tab-label { line-height: 1; text-align: center; }
.tab-btn .tab-count {
  font-size: 0.63rem;
  background: rgba(255,255,255,0.09);
  border-radius: 50px;
  padding: 1px 7px;
  min-width: 22px;
  text-align: center;
  transition: background 0.25s, color 0.25s;
}
/* Spacer pip for Help + Settings */
.tab-count-pip {
  background: transparent !important;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  font-size: 0.45rem !important;
  opacity: 0.45;
  pointer-events: none;
}
.tab-btn.active { color: #fff; background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); box-shadow: 0 2px 12px rgba(0,0,0,0.3); }
.tab-btn.active .tab-icon { transform: scale(1.1); }
.tab-btn[data-tab="checklist"].active  { background: rgba(255,140,0,0.2); border-color: rgba(255,140,0,0.4); color: var(--banana); }
.tab-btn[data-tab="wishlist"].active   { background: rgba(255,80,120,0.18); border-color: rgba(255,80,120,0.35); color: var(--dragonfruit); }
.tab-btn[data-tab="tried"].active      { background: rgba(92,184,46,0.18); border-color: rgba(92,184,46,0.35); color: var(--lime); }
.tab-btn[data-tab="help"].active       { background: rgba(100,184,255,0.18); border-color: rgba(100,184,255,0.35); color: #64b8ff; }
.tab-btn[data-tab="settings"].active   { background: rgba(253,224,75,0.15); border-color: rgba(253,224,75,0.3); color: var(--banana); }
.tab-btn[data-tab="checklist"].active  .tab-count { background: var(--mango); color: #fff; }
.tab-btn[data-tab="wishlist"].active   .tab-count { background: var(--dragonfruit); color: #fff; }
.tab-btn[data-tab="tried"].active      .tab-count { background: var(--lime); color: #fff; }
.tab-btn[data-tab="help"].active       .tab-count-pip { color: #64b8ff; opacity: 0.8; }
.tab-btn[data-tab="settings"].active   .tab-count-pip { color: var(--banana); opacity: 0.8; }

/* Light mode tabs */
body.light-mode .tab-btn { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.1); color: rgba(40,25,10,0.5); }
body.light-mode .tab-btn:hover { background: rgba(0,0,0,0.09); color: rgba(40,25,10,0.8); }
body.light-mode .tab-btn.active { background: rgba(255,140,0,0.12); border-color: rgba(255,140,0,0.3); color: var(--mango); }
body.light-mode .tab-btn[data-tab="wishlist"].active { background: rgba(255,80,120,0.1); border-color: rgba(255,80,120,0.25); color: var(--dragonfruit); }
body.light-mode .tab-btn[data-tab="tried"].active { background: rgba(92,184,46,0.1); border-color: rgba(92,184,46,0.25); color: #3da020; }
body.light-mode .tab-btn[data-tab="help"].active { background: rgba(100,184,255,0.1); border-color: rgba(100,184,255,0.25); color: #3a7fc1; }
body.light-mode .tab-btn[data-tab="settings"].active { background: rgba(200,150,0,0.1); border-color: rgba(200,150,0,0.25); color: #a07000; }

body.light-mode #progress-bar-wrapper {
  background: #e8e0d4;
  border-top: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
}

@keyframes tabFlash {
  0%   { background: rgba(255,255,255,0.07); }
  35%  { background: rgba(92,184,46,0.45); color: #fff; }
  100% { background: rgba(255,255,255,0.07); }
}
.tab-btn.flash { animation: tabFlash 0.55s ease forwards; }

/* Tabs */

/* TAB PANELS */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* TAB TOOLBAR */
.tab-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 14px 0;
  max-width: 1200px;
  margin: 0 auto;
}
.reset-all-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,80,80,0.1);
  border: 1px solid rgba(255,80,80,0.22);
  color: rgba(255,140,140,0.75);
  border-radius: 50px;
  padding: 6px 16px;
  font-family: 'Google Sans', 'Product Sans', sans-serif;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.15s;
  white-space: nowrap;
}
.reset-all-btn:hover { background: rgba(255,80,80,0.2); border-color: rgba(255,100,100,0.45); color: #ff9090; transform: translateY(-1px); }

/* ══════════════════════════════════════════
   FILTER BAR
   ══════════════════════════════════════════ */
#filter-bar-wrapper {
  /* layout handled by inline <style> block */
}
/* Legacy stubs — new filter UI uses .dd-wrap / .dd-btn / .dd-panel from inline styles */
.filter-tags { display: none; }
.filter-tag  { display: none; }
#filter-toggle-btn { display: none !important; }
#filter-dropdown   { display: none !important; }
#filter-clear-mobile { display: none !important; }

/* ══════════════════════════════════════════
   CATEGORY BROWSER (All Foods tab)
   ══════════════════════════════════════════ */
#cat-browser {
  background: var(--cat-browser-bg);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 10px 0 12px;        /* no side padding — handled by inner */
}
#cat-browser-inner {
  max-width: 1200px; margin: 0 auto;
  cursor: grab;
  user-select: none;
}
#cat-browser-inner.dragging { cursor: grabbing; }
#cat-browser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 14px;
}
#cat-browser-label {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(255,255,255,0.28);
  margin-bottom: 0;
  display: flex; align-items: center; gap: 6px;
}
/* Scroll hint arrow — bounces left-right once on load */
#cat-browser-label::after {
  content: '‹ ›';
  font-size: 0.7rem;
  letter-spacing: -0.02em;
  opacity: 0.45;
  animation: cat-hint-slide 1.1s ease-in-out 0.6s both;
}
@keyframes cat-hint-slide {
  0%   { transform: translateX(0);    opacity: 0; }
  20%  { opacity: 0.55; }
  40%  { transform: translateX(-5px); opacity: 0.55; }
  70%  { transform: translateX(4px);  opacity: 0.45; }
  100% { transform: translateX(0);    opacity: 0.35; }
}
#cat-browser-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,0.22);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
#cat-browser-dismiss:hover {
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.07);
}

/* Wrapper that holds the grid + fade masks */
#cat-browser-scroll-wrap {
  position: relative;
}
/* Left + right fade overlays — pointer-events:none so they don't block dragging */
#cat-browser-scroll-wrap::before,
#cat-browser-scroll-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 52px;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.25s;
}
#cat-browser-scroll-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--cat-browser-bg), transparent);
}
#cat-browser-scroll-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--cat-browser-bg), transparent);
}
/* Hide left fade when scrolled to start, right fade when at end */
#cat-browser-scroll-wrap.at-start::before { opacity: 0; }
#cat-browser-scroll-wrap.at-end::after    { opacity: 0; }

#cat-browser-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 14px 4px;       /* side padding inside scroll so chips clear the fades */
}
#cat-browser-grid::-webkit-scrollbar { display: none; }
.cat-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 0 0 72px;              /* uniform fixed width */
  width: 72px;
  padding: 8px 4px 7px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  cursor: pointer; color: var(--text-muted);
  font-family: 'Google Sans', 'Product Sans', sans-serif;
  font-size: 0.68rem; font-weight: 500;
  transition: background 0.17s, border-color 0.17s, color 0.17s, transform 0.13s;
  white-space: nowrap;
  scroll-snap-align: start;
  text-align: center;
}
.cat-chip:hover {
  background: rgba(255,255,255,0.11); border-color: rgba(255,255,255,0.2);
  color: var(--text-primary); transform: translateY(-1px);
}
.cat-chip.active {
  background: rgba(255,140,0,0.2); border-color: rgba(255,140,0,0.5);
  color: var(--banana);
}
.cat-chip-icon { font-size: 1.3rem; line-height: 1; display: block; }
.cat-chip-name { line-height: 1.15; display: block; overflow: hidden; text-overflow: ellipsis; width: 100%; text-align: center; }
.cat-chip-all  { font-weight: 600; }

body.light-mode #cat-browser { background: var(--cat-browser-bg); border-bottom-color: rgba(0,0,0,0.08); }
body.light-mode #cat-browser-label { color: rgba(40,25,10,0.35); }
body.light-mode #cat-browser-dismiss { color: rgba(40,25,10,0.25); }
body.light-mode #cat-browser-dismiss:hover { color: rgba(40,25,10,0.55); background: rgba(0,0,0,0.06); }
body.light-mode .cat-chip { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); color: rgba(40,25,10,0.55); }
body.light-mode .cat-chip:hover { background: rgba(0,0,0,0.09); color: rgba(40,25,10,0.9); }
body.light-mode .cat-chip.active { background: rgba(255,140,0,0.14); border-color: rgba(255,140,0,0.4); color: var(--mango); }

/* ── Footer disc link ── */
.footer-disc-link { color: rgba(253,224,75,0.7); text-decoration: underline; text-underline-offset: 2px; }
.footer-disc-link:hover { color: var(--banana); }
body.light-mode .footer-disc-link { color: rgba(180,100,0,0.8); }
body.light-mode .footer-disc-link:hover { color: var(--mango); }

/* ── Card view icon button in filter bar ── */
#card-view-bar-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; cursor: pointer; color: var(--text-muted);
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.15s;
}
#card-view-bar-btn:hover {
  background: rgba(255,255,255,0.13); border-color: rgba(255,255,255,0.25);
  color: var(--text-primary); transform: translateY(-1px);
}
#card-view-bar-btn.active-view {
  background: rgba(255,140,0,0.18); border-color: rgba(255,140,0,0.45);
  color: var(--banana);
}
body.light-mode #card-view-bar-btn {
  background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.14); color: rgba(40,25,10,0.5);
}
body.light-mode #card-view-bar-btn:hover {
  background: rgba(0,0,0,0.1); color: rgba(40,25,10,0.85);
}

/* ══════════════════════════════════════════
   CARD VIEW MODAL
   ══════════════════════════════════════════ */
#card-view-modal {
  position: fixed; inset: 0; z-index: 1200;
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 120px;
}
#card-view-modal.open { display: flex; }
#card-view-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
  animation: cvmFadeIn 0.22s ease;
}
#card-view-modal.fading #card-view-modal-backdrop { animation: cvmFadeOut 0.3s ease forwards; }
@keyframes cvmFadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes cvmFadeOut { from { opacity:1; } to { opacity:0; } }

#card-view-modal-inner {
  position: relative; z-index: 1;
  background: var(--card-bg); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px; padding: 20px; width: 320px; max-width: calc(100vw - 32px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
  animation: cvmSlideIn 0.22s cubic-bezier(.22,1,.36,1);
}
#card-view-modal.fading #card-view-modal-inner { animation: cvmSlideOut 0.3s cubic-bezier(.22,1,.36,1) forwards; }
@keyframes cvmSlideIn  { from { opacity:0; transform: translateY(-12px) scale(0.97); } to { opacity:1; transform: none; } }
@keyframes cvmSlideOut { from { opacity:1; transform: none; } to { opacity:0; transform: translateY(-12px) scale(0.97); } }

#card-view-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
#card-view-modal-title {
  font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700;
  color: var(--text-primary);
}
#card-view-modal-close {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%; width: 28px; height: 28px; cursor: pointer;
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; transition: background 0.15s;
}
#card-view-modal-close:hover { background: rgba(255,255,255,0.15); color: #fff; }

#card-view-modal-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.cvm-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 16px 10px; background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.09); border-radius: 12px; cursor: pointer;
  color: var(--text-muted); transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.15s;
  font-family: inherit;
}
.cvm-btn:hover {
  background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2);
  color: var(--text-primary); transform: translateY(-2px);
}
.cvm-btn.active {
  background: rgba(255,140,0,0.18); border-color: rgba(255,140,0,0.5);
  color: var(--banana);
}
.cvm-label { font-size: 0.82rem; font-weight: 600; line-height: 1; }
.cvm-desc  { font-size: 0.68rem; color: rgba(255,255,255,0.35); line-height: 1; }
.cvm-btn.active .cvm-desc { color: rgba(253,224,75,0.55); }

body.light-mode #card-view-modal-inner { background: #fff; border-color: rgba(0,0,0,0.1); }
body.light-mode #card-view-modal-close { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.1); color: rgba(40,25,10,0.5); }
body.light-mode .cvm-btn { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); color: rgba(40,25,10,0.55); }
body.light-mode .cvm-btn:hover { background: rgba(0,0,0,0.08); color: rgba(40,25,10,0.9); }
body.light-mode .cvm-btn.active { background: rgba(255,140,0,0.12); border-color: rgba(255,140,0,0.4); color: var(--mango); }
body.light-mode .cvm-desc { color: rgba(40,25,10,0.35); }
body.light-mode .cvm-btn.active .cvm-desc { color: rgba(180,100,0,0.6); }

/* ══════════════════════════════════════════
   FOOD GRID
   ══════════════════════════════════════════ */
.food-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 12px; padding: 14px 14px 18px; max-width: 1200px; margin: 0 auto;
}
@media (min-width: 580px) { .food-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 880px) { .food-grid { grid-template-columns: repeat(3, 1fr); } }

/* ══════════════════════════════════════════
   FOOD CARD
   ══════════════════════════════════════════ */
.food-card {
  background: var(--card-bg); border: 1.5px solid var(--card-border);
  border-radius: var(--radius); padding: 14px 14px 11px; cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s, background 0.2s;
  box-shadow: var(--shadow); opacity: 0; user-select: none; position: relative;
}
.food-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(255,140,0,0.22); border-color: rgba(255,140,0,0.55); }
.food-card.checked {
  background: #2F2010; border-color: transparent;
  box-shadow: 0 0 0 1.5px var(--mango), 0 0 0 3.5px rgba(255,94,58,0.32), 0 6px 24px rgba(255,140,0,0.28), inset 0 0 0 1px rgba(255,140,0,0.07);
}
.food-card.hidden-filter { display: none; }
#grid-wishlist .food-card { background: var(--wish-bg); border-color: var(--wish-border); }
#grid-wishlist .food-card:hover { border-color: rgba(217,79,161,0.6); box-shadow: 0 8px 28px rgba(217,79,161,0.2); }
#grid-wishlist .food-card.checked {
  background: #2A1024; border-color: transparent;
  box-shadow: 0 0 0 1.5px var(--dragonfruit), 0 0 0 3.5px rgba(217,79,161,0.28), 0 6px 24px rgba(217,79,161,0.22);
}
#grid-tried .food-card { background: var(--tried-bg); border-color: var(--tried-border); cursor: default; }
#grid-tried .food-card:hover { transform: none; box-shadow: var(--shadow); }
#grid-tried .food-card.checked {
  background: #182810; border-color: transparent;
  box-shadow: 0 0 0 1.5px var(--lime), 0 0 0 3.5px rgba(92,184,46,0.26), 0 6px 24px rgba(92,184,46,0.18);
}
/* ── Card top row: name + action btn ── */
.card-top { display: flex; align-items: flex-start; gap: 6px; }
.food-name { font-size: 0.96rem; font-weight: 600; color: var(--text-primary); line-height: 1.3; flex: 1; min-width: 0; word-break: break-word; }

/* Description — full width, below card-top */
.food-card .food-desc { font-size: 12px; opacity: 0.5; margin-top: 4px; line-height: 1.35; }
.food-card:hover .food-desc { opacity: 0.8; }

/* food-meta row: tags + year */
.food-meta { display: flex; gap: 5px; margin-top: 7px; align-items: center; flex-wrap: wrap; }

/* ── Wish / Checklist Button (new labeled design) ── */
.wish-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 7px; cursor: pointer; padding: 4px 8px;
  color: var(--text-muted); flex-shrink: 0;
  transition: background 0.17s, border-color 0.17s, color 0.17s, transform 0.15s;
  font-family: inherit; font-size: 0.72rem; font-weight: 600; white-space: nowrap;
  line-height: 1;
}
.wish-btn:hover { background: rgba(217,79,161,0.15); border-color: rgba(217,79,161,0.4); color: #E880C8; transform: translateY(-1px); }
.wish-btn.wishlisted { background: rgba(217,79,161,0.18); border-color: rgba(217,79,161,0.5); color: #E880C8; }
.wish-btn.wishlisted:hover { background: rgba(217,79,161,0.08); border-color: rgba(217,79,161,0.25); color: var(--text-muted); }
body.light-mode .wish-btn { color: rgba(0,0,0,0.35); border-color: rgba(0,0,0,0.15); background: rgba(0,0,0,0.04); }
body.light-mode .wish-btn:hover { background: rgba(217,79,161,0.1); border-color: rgba(217,79,161,0.4); color: var(--dragonfruit); }
body.light-mode .wish-btn.wishlisted { background: rgba(217,79,161,0.12); border-color: rgba(217,79,161,0.4); color: var(--dragonfruit); }
.wish-btn-label { pointer-events: none; }

/* ── Card Actions bar (bottom) ── */
.card-actions {
  margin-top: 8px; padding-top: 7px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; gap: 6px; align-items: center;
}
.card-actions .wish-btn { margin-left: auto; }
body.light-mode .card-actions { border-top-color: rgba(0,0,0,0.08); }
#grid-wishlist .food-card .card-actions { border-top-color: rgba(217,79,161,0.12); }
#grid-tried    .food-card .card-actions { border-top-color: rgba(92,184,46,0.12); }

/* ── View Details button ── */
.card-detail-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px; padding: 4px 10px; cursor: pointer;
  color: var(--text-muted); font-family: inherit; font-size: 0.72rem; font-weight: 600;
  transition: background 0.17s, border-color 0.17s, color 0.17s; white-space: nowrap;
}
.card-detail-btn:hover { background: rgba(255,140,0,0.1); border-color: rgba(255,140,0,0.4); color: var(--mango); }
body.light-mode .card-detail-btn { color: rgba(0,0,0,0.35); border-color: rgba(0,0,0,0.15); }
body.light-mode .card-detail-btn:hover { background: rgba(255,140,0,0.08); border-color: rgba(255,140,0,0.4); color: #b85c00; }
#grid-wishlist .food-card .card-detail-btn:hover { color: #E880C8; background: rgba(217,79,161,0.1); border-color: rgba(217,79,161,0.35); }
#grid-tried    .food-card .card-detail-btn:hover { color: #7DD44A; background: rgba(92,184,46,0.1);  border-color: rgba(92,184,46,0.35); }

/* Remove-btn remains icon-only */
.remove-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.78rem; padding: 2px 5px; border-radius: 6px;
  line-height: 1; flex-shrink: 0; color: rgba(255,255,255,0.18);
  transition: color 0.17s, background 0.17s, transform 0.17s; font-weight: 600;
}
.remove-btn:hover { color: #ff6b6b; background: rgba(255,80,80,0.12); transform: scale(1.15); }
.food-card.checked        .food-name { color: #FFB347; }
#grid-wishlist .food-card .food-name { color: rgba(255,200,240,0.88); }
#grid-tried    .food-card .food-name { color: rgba(160,230,120,0.9); }

/* ══════════════════════════════════════════
   CARD VIEW MODES
   ══════════════════════════════════════════ */

/* ── List view ── */
.food-grid.view-list {
  grid-template-columns: 1fr !important;
  gap: 6px;
}
.food-grid.view-list .food-card {
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  column-gap: 10px;
  align-items: start;
}
.food-grid.view-list .card-top { grid-column: 1; grid-row: 1; }
.food-grid.view-list .food-desc { grid-column: 1; grid-row: 2; }
.food-grid.view-list .food-meta { grid-column: 1; grid-row: 3; margin-top: 4px; }
.food-grid.view-list .card-actions { grid-column: 2; grid-row: 1 / 4; border-top: none; border-left: 1px solid rgba(255,255,255,0.06); margin-top: 0; padding-top: 0; padding-left: 10px; flex-direction: column; justify-content: center; align-self: stretch; }
.food-grid.view-list .card-actions .wish-btn { margin-left: 0; }
body.light-mode .food-grid.view-list .card-actions { border-left-color: rgba(0,0,0,0.08); }
.food-grid.view-list .card-tick { display: none; }

/* ── Compact view ── */
.food-grid.view-compact {
  grid-template-columns: 1fr !important;
  gap: 3px;
}
.food-grid.view-compact .food-card {
  padding: 7px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.food-grid.view-compact .card-top { flex: 1; min-width: 0; margin: 0; }
.food-grid.view-compact .food-desc { display: none; }
.food-grid.view-compact .food-meta { display: none; }
.food-grid.view-compact .card-actions { margin-top: 0; padding-top: 0; border-top: none; flex-shrink: 0; }
.food-grid.view-compact .card-tick { display: none; }
.food-grid.view-compact .food-card:hover { transform: translateX(3px) translateY(0); }

/* ── Magazine view ── */
.food-grid.view-magazine {
  grid-template-columns: 1fr !important;
  gap: 14px;
}
@media (min-width: 700px) { .food-grid.view-magazine { grid-template-columns: repeat(2, 1fr) !important; } }
.food-grid.view-magazine .food-card { padding: 18px 18px 14px; }
.food-grid.view-magazine .food-name { font-size: 1.05rem; }
.food-grid.view-magazine .food-desc { display: block !important; opacity: 0.75; font-size: 0.82rem; margin-top: 6px; line-height: 1.45; }
.food-grid.view-magazine .food-meta { margin-top: 10px; gap: 6px; }
.food-grid.view-magazine .card-actions { margin-top: 12px; padding-top: 10px; }
.food-grid.view-magazine .nationality, .food-grid.view-magazine .category-tag { font-size: 0.72rem; padding: 3px 10px; }

/* ── Survey / Handwriting view ── */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&display=swap');

/* Dark mode survey tokens */
:root {
  --survey-paper:      #221a10;
  --survey-line:       rgba(160,140,220,0.10);
  --survey-margin:     rgba(200,80,80,0.28);
  --survey-ink:        rgba(255,248,235,0.80);
  --survey-ink-dim:    rgba(255,248,235,0.28);
  --survey-box:        rgba(255,248,235,0.35);
  --survey-box-checked:rgba(255,248,235,0.55);
  --survey-check-ink:  rgba(80,210,120,0.90);
  --survey-strike:     rgba(80,210,120,0.55);
  --survey-shadow:     0 4px 24px rgba(0,0,0,0.55);
}
/* Light mode survey tokens */
body.light-mode {
  --survey-paper:      #fffef7;
  --survey-line:       rgba(100,120,200,0.11);
  --survey-margin:     rgba(210,50,50,0.32);
  --survey-ink:        rgba(30,15,2,0.82);
  --survey-ink-dim:    rgba(30,15,2,0.32);
  --survey-box:        rgba(30,15,2,0.40);
  --survey-box-checked:rgba(30,15,2,0.65);
  --survey-check-ink:  rgba(20,110,40,0.88);
  --survey-strike:     rgba(20,110,40,0.50);
  --survey-shadow:     0 2px 16px rgba(0,0,0,0.13), inset 0 0 0 1px rgba(0,0,0,0.06);
}

.food-grid.view-survey {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  background: var(--survey-paper);
  border-radius: 10px;
  padding: 24px 18px 28px;
  box-shadow: var(--survey-shadow);
  border: none;
  /* ruled lines sit on top of the paper colour */
  background-image:
    repeating-linear-gradient(
      transparent,
      transparent 28px,
      var(--survey-line) 28px,
      var(--survey-line) 29px
    );
  background-size: 100% 29px;
  background-position: 0 14px;
  position: relative;
}
/* Red margin line */
.food-grid.view-survey::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 38px;
  width: 1.5px;
  background: var(--survey-margin);
  border-radius: 1px;
  pointer-events: none;
}
@media (min-width: 600px) {
  .food-grid.view-survey { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .food-grid.view-survey { grid-template-columns: repeat(4, 1fr); }
}
.food-grid.view-survey .food-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 6px 0 8px;
  margin: 0;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  cursor: pointer;
  min-height: 29px;
  height: 29px;
  overflow: hidden;
}
.food-grid.view-survey .food-card:hover { transform: none !important; box-shadow: none !important; }

/* Hide everything except checkbox and name */
.food-grid.view-survey .card-top     { display: contents; }
.food-grid.view-survey .food-desc,
.food-grid.view-survey .food-meta,
.food-grid.view-survey .card-actions,
.food-grid.view-survey .card-tick,
.food-grid.view-survey .rare-badge   { display: none !important; }

/* Checkbox square */
.food-grid.view-survey .survey-check {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  border: 1.75px solid var(--survey-box);
  border-radius: 2px;
  background: transparent;
  position: relative;
  transition: border-color 0.15s;
}

/* Checked: green hand-drawn ✓ strokes */
.food-grid.view-survey .food-card.checked .survey-check {
  border-color: var(--survey-box-checked);
}
.food-grid.view-survey .food-card.checked .survey-check::before,
.food-grid.view-survey .food-card.checked .survey-check::after {
  content: '';
  position: absolute;
  background: var(--survey-check-ink);
  border-radius: 2px;
  transform-origin: left center;
}
.food-grid.view-survey .food-card.checked .survey-check::before {
  /* short left leg of ✓ */
  width: 5px; height: 1.75px;
  bottom: 3px; left: 1px;
  transform: rotate(45deg);
}
.food-grid.view-survey .food-card.checked .survey-check::after {
  /* long right leg of ✓ */
  width: 9px; height: 1.75px;
  bottom: 5px; left: 3px;
  transform: rotate(-50deg);
}

/* Food name in handwriting font */
.food-grid.view-survey .food-name {
  font-family: 'Caveat', cursive !important;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  color: var(--survey-ink) !important;
  line-height: 1 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  letter-spacing: 0.01em;
}
.food-grid.view-survey .food-card.checked .food-name {
  text-decoration: line-through;
  text-decoration-color: var(--survey-strike);
  color: var(--survey-ink-dim) !important;
}

/* ── Wide view — 4-column dense grid ── */
.food-grid.view-wide {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 6px;
}
@media (min-width: 500px) { .food-grid.view-wide { grid-template-columns: repeat(3, 1fr) !important; } }
@media (min-width: 750px) { .food-grid.view-wide { grid-template-columns: repeat(4, 1fr) !important; } }
@media (min-width: 1100px){ .food-grid.view-wide { grid-template-columns: repeat(5, 1fr) !important; } }
.food-grid.view-wide .food-card {
  padding: 9px 10px 8px;
}
.food-grid.view-wide .food-name  { font-size: 0.78rem; line-height: 1.3; }
.food-grid.view-wide .food-desc  { display: none; }
.food-grid.view-wide .food-meta  { margin-top: 5px; gap: 4px; }
.food-grid.view-wide .nationality,
.food-grid.view-wide .category-tag { font-size: 0.6rem; padding: 2px 6px; }
.food-grid.view-wide .year       { display: none; }
.food-grid.view-wide .card-actions { margin-top: 7px; padding-top: 6px; }
.food-grid.view-wide .card-detail-btn { font-size: 0.67rem; padding: 3px 7px; gap: 4px; }
.food-grid.view-wide .atlas-flag { display: none; }

/* ── Atlas view — flag-forward cards ── */
.atlas-flag {
  display: none; /* hidden by default; shown only in atlas view */
}
.food-grid.view-atlas {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 8px;
}
@media (min-width: 500px) { .food-grid.view-atlas { grid-template-columns: repeat(3, 1fr) !important; } }
@media (min-width: 750px) { .food-grid.view-atlas { grid-template-columns: repeat(4, 1fr) !important; } }
@media (min-width: 1050px){ .food-grid.view-atlas { grid-template-columns: repeat(5, 1fr) !important; } }
.food-grid.view-atlas .food-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 10px 10px;
  gap: 0;
  position: relative;
}
.food-grid.view-atlas .atlas-flag {
  display: block;
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 7px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.food-grid.view-atlas .card-top {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-bottom: 4px;
}
.food-grid.view-atlas .food-name {
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: center;
}
.food-grid.view-atlas .card-tick {
  position: absolute;
  top: 8px; right: 8px;
}
.food-grid.view-atlas .food-desc  { display: none; }
.food-grid.view-atlas .food-meta  { justify-content: center; margin-top: 5px; gap: 3px; }
.food-grid.view-atlas .year       { display: none; }
.food-grid.view-atlas .nationality { font-size: 0.6rem; padding: 2px 7px; }
.food-grid.view-atlas .category-tag { display: none; }
.food-grid.view-atlas .card-actions {
  margin-top: 8px; padding-top: 7px;
  width: 100%; justify-content: center;
}
.food-grid.view-atlas .card-detail-btn { font-size: 0.67rem; padding: 3px 7px; }

/* ── Settings: view mode picker ── */
.view-mode-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 10px;
}
@media (max-width: 700px) { .view-mode-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 500px) { .view-mode-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 380px) { .view-mode-grid { grid-template-columns: repeat(2, 1fr); } }
.view-mode-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; padding: 14px 8px 10px;
  background: var(--settings-bg); border: 1.5px solid var(--settings-border);
  border-radius: 12px; cursor: pointer; color: var(--text-secondary);
  transition: background 0.17s, border-color 0.17s, color 0.17s, transform 0.15s;
  font-family: inherit;
}
.view-mode-btn span { font-size: 0.8rem; font-weight: 600; }
.view-mode-btn small { font-size: 0.65rem; opacity: 0.55; }
.view-mode-btn:hover { border-color: rgba(255,140,0,0.4); color: var(--mango); transform: translateY(-2px); }
.view-mode-btn.active { background: rgba(255,140,0,0.1); border-color: var(--mango); color: var(--mango); }
body.light-mode .view-mode-btn.active { background: rgba(255,140,0,0.08); }
.card-tick {
  font-size: 0.88rem; color: var(--mango); font-weight: 700;
  opacity: 0; transition: opacity 0.2s; pointer-events: none; flex-shrink: 0;
}
.food-card.checked .card-tick { opacity: 1; }
.food-meta { display: flex; gap: 6px; margin-top: 7px; align-items: center; flex-wrap: wrap; }
.nationality {
  font-size: 0.69rem; background: rgba(255,140,0,0.18); color: #FFA040;
  border-radius: 50px; padding: 2px 8px; font-weight: 500;
}
.food-card.checked        .nationality { background: rgba(255,140,0,0.22); color: var(--mango); }
#grid-wishlist .food-card .nationality { background: rgba(217,79,161,0.18); color: #E880C8; }
#grid-tried    .food-card .nationality { background: rgba(92,184,46,0.18);  color: #7DD44A; }
.category-tag {
  font-size: 0.69rem; background: rgba(100,160,255,0.15); color: #88BBFF;
  border-radius: 50px; padding: 2px 8px; font-weight: 500;
  cursor: pointer; border: none; transition: background 0.17s, color 0.17s;
}
.category-tag:hover         { background: rgba(100,160,255,0.28); color: #AACCFF; }
.category-tag.active-filter { background: rgba(100,160,255,0.5);  color: #fff; }
.food-card.checked        .category-tag       { background: rgba(255,140,0,0.15); color: rgba(255,179,71,0.85); }
.food-card.checked        .category-tag:hover { background: rgba(255,140,0,0.26); color: var(--mango); }
#grid-wishlist .food-card .category-tag       { background: rgba(217,79,161,0.15); color: rgba(232,128,200,0.85); }
#grid-wishlist .food-card .category-tag:hover { background: rgba(217,79,161,0.28); color: #E880C8; }
#grid-tried    .food-card .category-tag       { background: rgba(92,184,46,0.15);  color: rgba(125,212,74,0.85); }
#grid-tried    .food-card .category-tag:hover { background: rgba(92,184,46,0.26);  color: #7DD44A; }
.year { font-size: 0.69rem; color: var(--text-muted); font-weight: 300; margin-left: auto; }
.badge-rare {
  display: inline-block; margin-left: 4px; font-size: 0.58rem;
  background: linear-gradient(135deg, var(--dragonfruit), var(--papaya));
  color: #fff; border-radius: 50px; padding: 1px 6px;
  vertical-align: middle; font-weight: 700; letter-spacing: 0.3px;
  box-shadow: 0 1px 6px rgba(217,79,161,0.4);
}

/* Card animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.food-card.visible { animation: fadeInUp 0.38s ease forwards; }
@keyframes flyToTab {
  0%   { opacity: 1; transform: scale(1) translate(0,0); }
  55%  { opacity: 0.7; transform: scale(0.55) translate(calc(var(--fly-x)*0.8), calc(var(--fly-y)*0.8)); }
  100% { opacity: 0; transform: scale(0.1) translate(var(--fly-x), var(--fly-y)); }
}
.food-card.flying { animation: flyToTab 0.44s cubic-bezier(0.5,0,0.8,0.6) forwards !important; pointer-events: none; z-index: 50; }
@keyframes introFly {
  0%   { opacity: 1; transform: scale(1) translate(0,0); }
  100% { opacity: 0; transform: scale(0.15) translate(var(--fly-x), var(--fly-y)); }
}
.food-card.intro-flying { animation: introFly 0.5s cubic-bezier(0.5,0,0.8,0.6) forwards !important; pointer-events: none; }
@keyframes flyToChecklist {
  0%   { opacity: 1; transform: scale(1) translate(0,0); }
  50%  { opacity: 0.6; transform: scale(0.6) translate(calc(var(--fly-x)*0.7), calc(var(--fly-y)*0.7)); }
  100% { opacity: 0; transform: scale(0.1) translate(var(--fly-x), var(--fly-y)); }
}
.food-card.flying-back { animation: flyToChecklist 0.46s cubic-bezier(0.5,0,0.8,0.6) forwards !important; pointer-events: none; z-index: 50; }
@keyframes cardRemove {
  0%   { opacity: 1; transform: scale(1); max-height: 200px; margin-bottom: 0; }
  40%  { opacity: 0; transform: scale(0.88) translateY(8px); }
  100% { opacity: 0; transform: scale(0.82); max-height: 0; padding-top: 0; padding-bottom: 0; margin-bottom: -12px; }
}
.food-card.removing { animation: cardRemove 0.42s cubic-bezier(0.4,0,0.6,1) forwards !important; pointer-events: none; overflow: hidden; }

/* ══════════════════════════════════════════
   LOAD MORE
   ══════════════════════════════════════════ */
.load-more-wrapper { text-align: center; padding: 18px 0 6px; }
.load-more-btn {
  background: rgba(255,255,255,0.08); color: var(--banana);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 50px; padding: 11px 28px;
  font-family: 'Google Sans', 'Product Sans', sans-serif; font-weight: 500; font-size: 0.9rem;
  cursor: pointer; transition: background 0.2s, transform 0.15s;
}
.load-more-btn:hover { background: rgba(255,255,255,0.14); transform: translateY(-1px); }

/* ══════════════════════════════════════════
   SETTINGS PANEL
   ══════════════════════════════════════════ */
#panel-settings {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}
.settings-section {
  background: var(--settings-bg);
  border: 1px solid var(--settings-border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}
.settings-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-section-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
}
.settings-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.settings-btn,
.import-file-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 50px;
  padding: 10px 20px;
  font-family: 'Google Sans', 'Product Sans', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
  border: none;
  white-space: nowrap;
}
.settings-btn:hover, .import-file-label:hover   { transform: translateY(-2px); cursor: pointer; }
.settings-btn:active, .import-file-label:active  { transform: translateY(0); }
.settings-btn.export-json {
  background: linear-gradient(135deg, var(--mango), var(--papaya));
  color: #fff;
  box-shadow: 0 4px 18px rgba(255,94,58,0.3);
}
.settings-btn.export-csv {
  background: linear-gradient(135deg, #3a7bd5, #2563ae);
  color: #fff;
  box-shadow: 0 4px 18px rgba(58,123,213,0.3);
}
.settings-btn.import-btn {
  background: var(--settings-bg);
  border: 1px solid var(--input-border);
  color: var(--text-primary);
}
.settings-btn.import-btn:hover { background: var(--filter-bg); }
.settings-btn.print-btn {
  background: linear-gradient(135deg, var(--lime), #3da020);
  color: #fff;
  box-shadow: 0 4px 18px rgba(92,184,46,0.3);
}
.settings-btn.clear-import {
  background: rgba(255,80,80,0.12);
  border: 1px solid rgba(255,80,80,0.22);
  color: rgba(255,140,140,0.85);
}
.settings-btn.copy-btn {
  background: var(--filter-bg);
  border: 1px solid var(--input-border);
  color: var(--text-secondary);
}
.settings-btn.copy-btn.copied { background: rgba(92,184,46,0.2); border-color: rgba(92,184,46,0.4); color: #7DD44A; }

/* Import textarea */
.import-area {
  width: 100%;
  min-height: 110px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'Google Sans', 'Product Sans', sans-serif;
  font-size: 0.78rem;
  color: var(--text-primary);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  display: block;
  margin-bottom: 10px;
}
.import-area::placeholder { color: var(--text-muted); }
.import-area:focus { border-color: var(--mango); }

/* Export display textarea */
.export-area {
  width: 100%;
  min-height: 90px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'Google Sans', 'Product Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--text-secondary);
  resize: none;
  outline: none;
  display: block;
  margin-bottom: 10px;
  cursor: text;
}

/* Status / feedback messages */
.settings-status {
  font-size: 0.78rem;
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 8px;
  display: none;
  line-height: 1.4;
}
.settings-status.ok    { background: rgba(92,184,46,0.15);  color: #7DD44A;  border: 1px solid rgba(92,184,46,0.3);  display: block; }
.settings-status.error { background: rgba(255,80,80,0.15);  color: #ff8888;  border: 1px solid rgba(255,80,80,0.3);  display: block; }
.settings-status.info  { background: rgba(100,160,255,0.12);color: #88BBFF;  border: 1px solid rgba(100,160,255,0.25);display: block; }

/* ══════════════════════════════════════════
   PRINT PREVIEW MODAL
   ══════════════════════════════════════════ */
#print-modal {
  display: none;
  position: fixed; inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: 30px 16px 60px;
}
#print-modal.open { display: block; }
#print-modal-inner {
  background: #fff;
  color: #1a1207;
  max-width: 720px;
  margin: 0 auto;
  border-radius: 12px;
  padding: 48px 52px 40px;
  position: relative;
  font-family: Georgia, 'Times New Roman', serif;
}
#print-modal-close {
  position: absolute; top: 16px; right: 18px;
  background: rgba(0,0,0,0.08); border: none; border-radius: 50%;
  width: 34px; height: 34px; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #555; transition: background 0.18s;
}
#print-modal-close:hover { background: rgba(0,0,0,0.16); }

/* Print modal content styles */
#print-modal-inner h2 {
  font-family: Georgia, serif; font-size: 1.6rem; font-weight: 700;
  color: #1a1207; margin-bottom: 4px; line-height: 1.2;
}
#print-modal-inner .print-sub {
  font-size: 0.82rem; color: #777; margin-bottom: 20px;
  font-family: Arial, sans-serif;
}
#print-modal-inner hr { border: none; border-top: 2px solid #eee; margin: 18px 0; }
#print-modal-inner .print-section-title {
  font-family: Georgia, serif; font-size: 1rem; font-weight: 700;
  color: #1a1207; margin: 20px 0 10px; letter-spacing: 0.02em;
}
.print-food-list {
  list-style: none; padding: 0; margin: 0 0 16px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 24px;
}
.print-food-list li {
  font-family: Arial, sans-serif; font-size: 0.8rem;
  color: #333; padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex; align-items: baseline; gap: 6px;
}
.print-food-list li .pf-num {
  font-size: 0.68rem; color: #aaa; flex-shrink: 0; min-width: 22px;
}
.print-food-list li .pf-nat {
  font-size: 0.68rem; color: #888; margin-left: auto; flex-shrink: 0;
}
.print-disclaimer {
  background: #fffbf0; border: 1px solid #ffe0a0; border-radius: 8px;
  padding: 12px 16px; margin: 20px 0;
  font-family: Arial, sans-serif; font-size: 0.76rem; color: #7a5c00; line-height: 1.6;
}
.print-disclaimer strong { color: #5a4000; }
.print-byline {
  text-align: center; margin-top: 22px; padding-top: 16px;
  border-top: 1px solid #eee;
  font-family: Arial, sans-serif; font-size: 0.75rem; color: #999;
  line-height: 1.7;
}
.print-byline a { color: #FF8C00; text-decoration: none; }
.print-byline a:hover { text-decoration: underline; }

/* Modal action bar */
#print-modal-actions {
  display: flex; gap: 10px; align-items: center; justify-content: flex-end;
  margin-top: 22px; flex-wrap: wrap;
}

/* ══════════════════════════════════════════
   ACHIEVEMENTS TAB BUTTON
   ══════════════════════════════════════════ */
.tab-btn-achievements {
  font-size: 1.15rem;
  padding: 8px 14px;
  position: relative;
}
.tab-btn-achievements::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50px;
  background: linear-gradient(135deg, rgba(255,200,50,0.18), rgba(255,140,0,0.10));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.tab-btn-achievements:hover::after,
.tab-btn-achievements.active::after { opacity: 1; }
.tab-btn-achievements .tab-icon { font-size: 1.15rem; line-height: 1; }
/* Pulse on unlock */
@keyframes achPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,180,0,0.7); }
  70%  { box-shadow: 0 0 0 12px rgba(255,180,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,180,0,0); }
}
.tab-btn-achievements.ach-pulse { animation: achPulse 0.65s ease-out; }

/* ══════════════════════════════════════════
   ACHIEVEMENTS PANEL
   ══════════════════════════════════════════ */
.achievements-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}

/* ── Stats bar ── */
.ach-stats-bar {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--settings-bg);
  border: 1px solid var(--settings-border);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.ach-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}
.ach-stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--mango);
  line-height: 1;
}
.ach-stat-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 3px;
}
.ach-stat-div {
  width: 1px;
  height: 36px;
  background: var(--settings-border);
  flex-shrink: 0;
}
.ach-progress-wrap {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ach-progress-track {
  flex: 1;
  height: 8px;
  background: var(--settings-border);
  border-radius: 50px;
  overflow: hidden;
}
.ach-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mango), var(--papaya));
  border-radius: 50px;
  transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
.ach-progress-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 32px;
  text-align: right;
}

/* ── Achievement grid ── */
.ach-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 520px) { .ach-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 780px) { .ach-grid { grid-template-columns: repeat(4, 1fr); } }

.ach-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  background: var(--settings-bg);
  border: 1.5px solid var(--settings-border);
  border-radius: 16px;
  padding: 18px 12px 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.17s, box-shadow 0.17s, border-color 0.17s;
}
.ach-card--locked {
  opacity: 0.52;
}
.ach-card--earned {
  border-color: rgba(255,180,0,0.28);
  background: linear-gradient(160deg, rgba(255,180,0,0.07) 0%, var(--settings-bg) 60%);
}
.ach-card--earned:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(255,180,0,0.18);
  border-color: rgba(255,180,0,0.5);
}
/* Tier corner ribbon */
.ach-card--earned[data-tier="bronze"]::before   { content:''; }
.ach-card--earned[data-tier="silver"]::before   { content:''; }
.ach-card--earned[data-tier="gold"]::before     { content:''; }
.ach-card--earned[data-tier="platinum"]::before { content:''; }
.ach-card--earned::before {
  position: absolute;
  top: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 28px 28px 0;
  border-color: transparent;
}
.ach-card--earned[data-tier="bronze"]::before   { border-right-color: #CD7F32; }
.ach-card--earned[data-tier="silver"]::before   { border-right-color: #B0B8C1; }
.ach-card--earned[data-tier="gold"]::before     { border-right-color: #FFB300; }
.ach-card--earned[data-tier="platinum"]::before { border-right-color: #C5C6C7; }

.ach-card-icon {
  font-size: 2.2rem;
  line-height: 1;
  transition: transform 0.2s;
}
.ach-card--earned:hover .ach-card-icon { transform: scale(1.15) rotate(-5deg); }

.ach-card-body { width: 100%; }
.ach-card-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  line-height: 1.2;
}
.ach-card-desc {
  font-size: 0.64rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-bottom: 8px;
}
.ach-card-earned-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.ach-tier-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Progress bar on locked cards */
.ach-card-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ach-card-bar-track {
  flex: 1;
  height: 4px;
  background: var(--settings-border);
  border-radius: 50px;
  overflow: hidden;
}
.ach-card-bar-fill {
  height: 100%;
  border-radius: 50px;
  transition: width 0.4s ease;
  opacity: 0.7;
}
.ach-card-bar-label {
  font-size: 0.58rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 28px;
  text-align: right;
}

/* ── Unlock toast ── */
#ach-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(24px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
#ach-toast.ach-toast--in {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#ach-toast.ach-toast--out {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
#ach-toast-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 1.5px solid var(--toast-col, var(--mango));
  border-radius: 16px;
  padding: 12px 20px 12px 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04);
  min-width: 220px;
  max-width: 90vw;
}
#ach-toast-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
#ach-toast-eyebrow {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--toast-col, var(--mango));
  margin-bottom: 2px;
}
#ach-toast-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}
#ach-toast-tier {
  font-size: 0.65rem;
  font-weight: 600;
  margin-top: 1px;
}

/* Light mode tweaks */
body.light-mode .ach-card--earned {
  background: linear-gradient(160deg, rgba(255,180,0,0.06) 0%, var(--settings-bg) 60%);
}
body.light-mode #ach-toast-inner {
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

/* ══════════════════════════════════════════
   HELP PANEL
   ══════════════════════════════════════════ */
.help-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 18px 48px;
}
.help-heading {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 600px) {
  .help-grid { grid-template-columns: 1fr; }
}
.help-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--settings-bg);
  border: 1px solid var(--settings-border);
  border-radius: 12px;
  padding: 14px 16px;
}
.help-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 1px;
}
.help-item div {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.help-item strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
}
.help-note {
  background: rgba(255,140,0,0.08);
  border: 1px solid rgba(255,140,0,0.2);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.help-note strong { color: var(--banana); }
body.light-mode .help-heading { border-bottom-color: rgba(0,0,0,0.1); }
body.light-mode .help-note { background: rgba(255,140,0,0.06); border-color: rgba(255,140,0,0.2); }

/* ── Help: Points grid ── */
.help-points-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 28px;
}
.help-points-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 14px 12px; text-align: center;
}
.help-points-card-rare {
  background: rgba(253,185,75,0.07); border-color: rgba(253,185,75,0.25);
}
.help-points-card-info {
  background: rgba(130,180,255,0.06); border-color: rgba(130,180,255,0.18);
}
.help-points-val {
  font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 700;
  background: linear-gradient(135deg, var(--mango), var(--banana));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1; margin-bottom: 6px;
}
.help-points-desc { font-size: 0.76rem; color: var(--text-secondary); line-height: 1.4; }
.help-points-desc strong { color: var(--banana); -webkit-text-fill-color: unset; }
body.light-mode .help-points-card { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); }
body.light-mode .help-points-card-rare { background: rgba(255,140,0,0.06); border-color: rgba(255,140,0,0.2); }
body.light-mode .help-points-card-info { background: rgba(0,80,200,0.04); border-color: rgba(0,80,200,0.12); }
@media (max-width: 500px) { .help-points-grid { grid-template-columns: 1fr 1fr; } .help-points-card-info { grid-column: span 2; } }

/* ══════════════════════════════════════════
   BACK-TO-TOP BUTTON
   ══════════════════════════════════════════ */
/* ── Fixed action cluster (bottom-right) ── */
/* ══════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════ */
.empty-state { text-align: center; padding: 56px 20px; color: rgba(255,255,255,0.3); }
.empty-state .empty-icon { font-size: 2.8rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.96rem; font-style: italic; line-height: 1.7; }
.empty-state strong { color: rgba(255,255,255,0.5); font-style: normal; }

/* ══════════════════════════════════════════
   NO RESULTS
   ══════════════════════════════════════════ */
#no-results { display: none; text-align: center; padding: 40px 20px; color: rgba(255,255,255,0.35); font-style: italic; font-size: 0.95rem; }
#no-results.visible { display: block; }

/* ══════════════════════════════════════════
   PROGRESS BAR — 4-column gamified layout
   col1: % + bar   col2: eaten/exotic   col3: pts   col4: actions
   ══════════════════════════════════════════ */
#progress-bar-wrapper {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: var(--progress-bar-bg); height: var(--bar-h); padding: 0 12px;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center; gap: 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.6);
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* shared divider between all pb cols */
#pb-col-progress,
#pb-col-eaten,
#pb-col-score {
  border-right: 1px solid rgba(255,255,255,0.07);
  padding-right: 12px; margin-right: 12px; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
}

/* ── COL 1: % + bar ── */
#pb-col-progress { min-width: 0; gap: 2px; }
#pb-progress-header { display: flex; align-items: baseline; gap: 6px; }
#progress-label {
  color: var(--banana); font-family: 'Playfair Display', serif;
  font-size: 1rem; font-weight: 700; line-height: 1;
  transition: color 0.25s;
}
#progress-label.pct-empty {
  color: rgba(255,255,255,0.28);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 400;
}
body.light-mode #progress-label.pct-empty { color: rgba(40,25,10,0.28); }
#progress-subtext {
  color: rgba(255,255,255,0.35); font-size: 0.65rem; white-space: nowrap;
}
#progress-track {
  height: 7px; background: rgba(255,255,255,0.1);
  border-radius: 99px; overflow: hidden; width: 100%;
}
#progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--lime), var(--banana));
  border-radius: 99px; transition: width 0.45s ease;
}
#progress-count { color: rgba(255,255,255,0.38); font-size: 0.65rem; }

/* ── COL 2: eaten / exotic ── */
#pb-col-eaten {
  flex-direction: row; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.pb-stat-row { display: flex; flex-direction: column; align-items: center; }
.pb-stat-num { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700; color: #fff; line-height: 1; }
.pb-stat-lbl { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.07em; color: rgba(255,255,255,0.3); margin-top: 2px; }
.pb-stat-divider { width: 1px; height: 22px; background: rgba(255,255,255,0.1); }
.pb-stat-exotic .pb-stat-num { color: var(--banana); }
.pb-stat-exotic .pb-stat-lbl { color: rgba(253,224,75,0.45); }

/* ── COL 3: points ── */
#pb-col-score {
  align-items: center; flex-shrink: 0; text-align: center; gap: 1px;
}
#pb-score-num {
  font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; line-height: 1;
  background: linear-gradient(135deg, var(--mango), var(--banana));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
#pb-score-label {
  font-size: 0.58rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(255,255,255,0.28); margin-top: 1px;
}
#pb-wishlist-pts {
  font-size: 0.6rem; color: rgba(253,224,75,0.5); font-weight: 600; white-space: nowrap;
  margin-top: 2px;
}

/* ── COL 4: action buttons ── */
#progress-bar-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0; padding-left: 4px;
}

/* light mode */
body.light-mode #progress-bar-wrapper  { background: var(--progress-bar-bg); border-top-color: rgba(0,0,0,0.1); }
body.light-mode #pb-col-progress,
body.light-mode #pb-col-eaten,
body.light-mode #pb-col-score          { border-right-color: rgba(0,0,0,0.08); }
body.light-mode #progress-subtext      { color: rgba(40,25,10,0.35); }
body.light-mode #progress-count        { color: rgba(40,25,10,0.38); }
body.light-mode .pb-stat-num           { color: rgba(40,25,10,0.85); }
body.light-mode .pb-stat-lbl           { color: rgba(40,25,10,0.35); }
body.light-mode .pb-stat-exotic .pb-stat-num { color: var(--mango); }
body.light-mode .pb-stat-exotic .pb-stat-lbl { color: rgba(180,100,0,0.55); }
body.light-mode #pb-score-num          { background: linear-gradient(135deg, var(--mango), #b36a00); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
body.light-mode #pb-score-label        { color: rgba(40,25,10,0.32); }
body.light-mode #pb-wishlist-pts       { color: rgba(160,90,0,0.6); }
body.light-mode .pb-stat-divider       { background: rgba(0,0,0,0.1); }

/* mobile — collapse col2 labels, hide subtext */
@media (max-width: 560px) {
  #progress-bar-wrapper { grid-template-columns: 1fr auto auto auto; gap: 0; padding: 0 8px; }
  #progress-subtext { display: none; }
  #pb-col-eaten { gap: 5px; }
  .pb-stat-lbl { display: none; }
  .pb-stat-num { font-size: 0.9rem; }
  #pb-score-label, #pb-wishlist-pts { display: none; }
  #pb-score-num { font-size: 0.95rem; }
}
@media (max-width: 380px) {
  #pb-col-eaten { display: none; }
}

/* Progress bar action buttons */
#progress-bar-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
#progress-print-btn {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.6);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  width: 34px; height: 34px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s, transform 0.15s, border-color 0.18s, color 0.18s;
}
#progress-print-btn:hover { background: rgba(255,214,0,0.15); border-color: rgba(253,224,75,0.4); color: var(--banana); transform: translateY(-1px); }
body.light-mode #progress-print-btn { background: rgba(0,0,0,0.06); color: rgba(40,25,10,0.5); border-color: rgba(0,0,0,0.15); }
body.light-mode #progress-print-btn:hover { background: rgba(255,140,0,0.1); color: var(--mango); }

#save-btn {
  background: linear-gradient(135deg, var(--mango), var(--papaya));
  color: #fff; border: none; border-radius: 8px; padding: 7px 14px;
  font-family: 'Google Sans', 'Product Sans', sans-serif; font-weight: 600; font-size: 0.82rem; cursor: pointer;
  box-shadow: 0 3px 14px rgba(255,94,58,0.35);
  transition: transform 0.15s, box-shadow 0.15s, background 0.3s;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; height: 34px;
}
#save-btn:hover  { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,94,58,0.48); }
#save-btn:active { transform: translateY(0); }
#save-btn.done   { background: linear-gradient(135deg, var(--lime), #3da020); }
#save-btn .s-icon { font-size: 0.9rem; }

#back-top-btn {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  width: 34px; height: 34px;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s, transform 0.15s, border-color 0.18s, color 0.18s;
  flex-shrink: 0;
}
#back-top-btn:hover  { background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.45); color: #fff; transform: translateY(-1px); }
#back-top-btn:active { transform: translateY(0); }
body.light-mode #back-top-btn { background: rgba(0,0,0,0.07); color: rgba(40,25,10,0.5); border-color: rgba(0,0,0,0.15); }
body.light-mode #back-top-btn:hover { background: rgba(0,0,0,0.14); color: rgba(40,25,10,0.8); }

/* ══════════════════════════════════════════
   COOKIE NOTICE
   ══════════════════════════════════════════ */
#cookie-notice {
  position: fixed; bottom: var(--bar-h); left: 0; right: 0;
  background: #2a1e0c; border-top: 2px solid rgba(253,224,75,0.35);
  padding: 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  z-index: 400; font-size: 0.79rem; color: rgba(255,255,255,0.65);
}
#cookie-notice p { flex: 1; line-height: 1.45; }
#cookie-notice strong { color: var(--banana); }
#dismiss-cookie {
  background: var(--mango); color: #fff; border: none; border-radius: 50px;
  padding: 6px 16px; font-size: 0.79rem; cursor: pointer;
  font-family: 'Google Sans', 'Product Sans', sans-serif; font-weight: 500; white-space: nowrap; flex-shrink: 0;
}
#dismiss-cookie:hover { background: var(--papaya); }

/* LOADING */
#loading-msg { text-align: center; padding: 50px 20px; color: rgba(255,255,255,0.3); font-style: italic; }

/* ══════════════════════════════════════════
   FOOTER — 3-column layout
   ══════════════════════════════════════════ */
#site-footer {
  margin-top: 32px;
  background: linear-gradient(175deg, rgba(255,140,0,0.06) 0%, rgba(26,18,7,0) 40%);
  border-top: 1px solid rgba(255,140,0,0.14);
  padding: 40px 20px 0;
}

/* 3-column grid — equal thirds */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 36px 28px;
  max-width: 1100px;
  margin: 0 auto 0;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col-cta { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* Col headings */
.footer-col-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mango);
  margin-bottom: 14px;
  opacity: 0.8;
}

/* Brand col */
.footer-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--banana);
  margin-bottom: 10px;
}
.footer-logo em { font-style: italic; }
.footer-about {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}
.footer-social-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-share-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 2px;
}
.footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.17s, transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
  border: none;
}
.footer-social:hover { opacity: 0.85; transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,0.35); }

/* Nav col */
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.footer-nav-btn:hover {
  background: rgba(255,140,0,0.12);
  color: var(--mango);
  border-color: rgba(255,140,0,0.25);
}

/* CTA col */
.footer-cta-card {
  background: linear-gradient(135deg, rgba(255,140,0,0.12), rgba(217,79,161,0.07));
  border: 1px solid rgba(255,140,0,0.22);
  border-radius: 14px;
  padding: 20px 20px 18px;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
.footer-cta-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mango);
  opacity: 0.75;
  margin-bottom: 4px;
}
.footer-cta-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--banana);
  margin-bottom: 8px;
  line-height: 1.2;
}
.footer-cta-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
  flex: 1;
}
.footer-cta-btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--mango), var(--papaya));
  color: #fff !important;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50px;
  text-decoration: none !important;
  border-bottom: none !important;
  box-shadow: 0 3px 14px rgba(255,140,0,0.3);
  transition: transform 0.17s, box-shadow 0.17s;
}
.footer-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(255,140,0,0.45); }

/* Copyright bar */
/* ── Footer disclaimers bar ── */
.footer-disclaimers {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px;
  padding: 12px 0 10px; max-width: 1100px; margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.66rem; color: rgba(255,255,255,0.25); line-height: 1.5;
}
.footer-disc-item { display: flex; align-items: flex-start; gap: 5px; }
.footer-disc-item svg { margin-top: 1px; opacity: 0.45; flex-shrink: 0; }
.footer-disc-sep { color: rgba(255,255,255,0.12); line-height: 1.5; }
@media (max-width: 620px) { .footer-disc-sep { display: none; } }
body.light-mode .footer-disclaimers { border-top-color: rgba(0,0,0,0.07); color: rgba(40,25,10,0.3); }
body.light-mode .footer-disc-sep    { color: rgba(0,0,0,0.1); }

.footer-copy {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  padding: 14px 0 18px;
  max-width: 1100px;
  margin: 0 auto;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.18);
  line-height: 1.6;
}
.footer-copy a { color: rgba(255,140,0,0.45); text-decoration: none; }
.footer-copy a:hover { color: var(--mango); }
@media (max-width: 520px) {
  .footer-copy { flex-direction: column; }
  .footer-copy-right { opacity: 0.7; }
}

/* Light mode footer */
body.light-mode #site-footer { background: linear-gradient(175deg, rgba(255,140,0,0.04), transparent); border-top-color: rgba(255,140,0,0.2); }
body.light-mode .footer-logo { color: #a04000; }
body.light-mode .footer-about { color: rgba(40,25,10,0.45); }
body.light-mode .footer-social { opacity: 0.92; }
body.light-mode .footer-social:hover { opacity: 1; }
body.light-mode .footer-nav-btn { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); color: rgba(40,25,10,0.65); }
body.light-mode .footer-nav-btn:hover { background: rgba(255,140,0,0.1); border-color: rgba(255,140,0,0.25); color: var(--mango); }
body.light-mode .footer-cta-card { background: linear-gradient(135deg, rgba(255,140,0,0.08), rgba(217,79,161,0.04)); border-color: rgba(255,140,0,0.25); }
body.light-mode .footer-cta-brand { color: #a04000; }
body.light-mode .footer-cta-desc { color: rgba(40,25,10,0.6); }
body.light-mode .footer-copy { color: rgba(40,25,10,0.3); }
body.light-mode .footer-copy a { color: rgba(255,140,0,0.6); }

/* ── HELP STEPS ────────────────────────────────────── */
.help-intro {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 680px;
}
.help-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 36px;
  position: relative;
}
.help-steps::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: linear-gradient(to bottom, var(--mango), rgba(217,79,161,0.3));
  opacity: 0.25;
}
.help-step {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 16px 18px 16px 0;
  position: relative;
}
.help-step-num {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mango), var(--papaya));
  color: #fff;
  font-weight: 900;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(255,140,0,0.3);
  position: relative;
  z-index: 1;
}
.help-step-body {
  flex: 1;
  padding-top: 8px;
}
.help-step-body strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.help-step-body p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}
.help-highlight {
  color: var(--mango);
  font-weight: 600;
}
.help-heading-second {
  margin-top: 8px;
}
body.light-mode .help-intro { color: rgba(40,25,10,0.6); }
body.light-mode .help-step-body p { color: rgba(40,25,10,0.6); }
body.light-mode .help-step-body strong { color: rgba(40,25,10,0.88); }

/* ══════════════════════════════════════════
   THEME TOGGLE
   ══════════════════════════════════════════ */
.theme-toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}
.feature-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 4px;
}
.feature-toggle-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.feature-toggle-btn {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 50px;
  background: rgba(255,140,0,0.2);
  border: 1.5px solid rgba(255,140,0,0.3);
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
  flex-shrink: 0;
  padding: 0;
}
.feature-toggle-btn:focus-visible { outline: 2px solid var(--mango); outline-offset: 2px; }
.feature-toggle-btn.off {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}
.feature-toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--mango);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), background 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.feature-toggle-btn.off .feature-toggle-thumb {
  transform: none;
  background: rgba(255,255,255,0.3);
}
.feature-toggle-btn:not(.off) .feature-toggle-thumb {
  transform: translateX(24px);
}
.theme-label {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.theme-toggle-btn {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 50px;
  background: rgba(255,140,0,0.2);
  border: 1.5px solid rgba(255,140,0,0.3);
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
  flex-shrink: 0;
  padding: 0;
}
.theme-toggle-btn:focus-visible { outline: 2px solid var(--mango); outline-offset: 2px; }
.theme-toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--mango);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), background 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
body.light-mode .theme-toggle-btn {
  background: rgba(255,200,50,0.25);
  border-color: rgba(255,200,50,0.5);
}
body.light-mode .theme-toggle-thumb {
  transform: translateX(24px);
  background: #FFB300;
}
#theme-label-dark  { opacity: 1; }
#theme-label-light { opacity: 0.45; }
body.light-mode #theme-label-dark  { opacity: 0.45; }
body.light-mode #theme-label-light { opacity: 1; }

/* ══════════════════════════════════════════
   LIGHT MODE OVERRIDES
   ══════════════════════════════════════════ */
body.light-mode #tab-nav { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
body.light-mode .tab-btn { color: rgba(40,25,10,0.45); border-color: rgba(0,0,0,0.08); }
body.light-mode .tab-btn:hover { border-color: rgba(0,0,0,0.15); }
body.light-mode .tab-btn.active { border-color: rgba(0,0,0,0.12); }
body.light-mode .tab-btn.active { color: #1a1207; background: rgba(0,0,0,0.06); }
body.light-mode .food-card:hover { box-shadow: 0 8px 28px rgba(255,140,0,0.18); }
body.light-mode .food-card.checked { background: #fff8e8; border-color: rgba(255,140,0,0.4); }
body.light-mode .food-card.checked .food-name { color: #b85c00; }
body.light-mode .nationality { background: rgba(255,140,0,0.12); color: #b05000; }
body.light-mode .category-tag { background: rgba(60,120,220,0.1); color: #2255aa; }
body.light-mode .category-tag:hover { background: rgba(60,120,220,0.2); color: #1144aa; }
body.light-mode .remove-btn { color: rgba(40,25,10,0.3); }
body.light-mode .wish-btn { filter: grayscale(1) opacity(0.3); }
body.light-mode #filter-bar { background: rgba(0,0,0,0.05); border-bottom-color: rgba(0,0,0,0.1); }
body.light-mode #filter-search { background: rgba(255,255,255,0.9); border-color: rgba(0,0,0,0.15); color: rgba(40,25,10,0.88); }
body.light-mode #filter-search::placeholder { color: rgba(40,25,10,0.4); }
body.light-mode .filter-tag { background: rgba(0,0,0,0.08); color: rgba(40,25,10,0.6); border-color: rgba(0,0,0,0.12); }
body.light-mode .filter-tag.active { background: var(--mango); color: #fff; }
body.light-mode #progress-bar-wrapper { background: var(--progress-bar-bg); border-top-color: rgba(0,0,0,0.08); box-shadow: 0 -3px 18px rgba(0,0,0,0.08); }
body.light-mode #progress-track { background: rgba(0,0,0,0.1); }
body.light-mode #progress-label, body.light-mode #progress-count { color: rgba(40,25,10,0.6); }
body.light-mode #save-btn { box-shadow: 0 6px 28px rgba(255,94,58,0.25); }
body.light-mode .empty-state { color: rgba(40,25,10,0.45); }
body.light-mode .empty-icon { filter: grayscale(0.3) opacity(0.7); }
body.light-mode .tab-toolbar { border-bottom-color: rgba(0,0,0,0.1); }
body.light-mode .reset-all-btn { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.15); color: rgba(40,25,10,0.55); }
body.light-mode .reset-all-btn:hover { background: rgba(255,80,80,0.1); border-color: rgba(255,80,80,0.3); color: #cc3333; }
body.light-mode #no-results { color: rgba(40,25,10,0.5); }
body.light-mode .load-more-btn { background: rgba(0,0,0,0.07); border-color: rgba(0,0,0,0.15); color: rgba(40,25,10,0.6); }
body.light-mode .load-more-btn:hover { background: rgba(255,140,0,0.12); border-color: rgba(255,140,0,0.35); color: #b05000; }
body.light-mode .settings-btn.copy-btn { color: rgba(40,25,10,0.65); }
body.light-mode .cookie-notice-inner, body.light-mode #cookie-notice { background: rgba(255,255,255,0.97); border-top-color: rgba(0,0,0,0.1); color: rgba(40,25,10,0.75); box-shadow: 0 -3px 18px rgba(0,0,0,0.08); }
body.light-mode #dismiss-cookie { background: var(--mango); color: #fff; border-color: transparent; }
body.light-mode .print-modal-inner, body.light-mode #print-modal-inner { background: #fff; color: rgba(40,25,10,0.88); }
body.light-mode .year { color: rgba(40,25,10,0.3); }

/* ══════════════════════════════════════════
   PRINT STYLES
   ══════════════════════════════════════════ */
@media print {
  body > *:not(#print-modal) { display: none !important; }
  #print-modal { display: block !important; position: static; background: none; padding: 0; }
  #print-modal-inner { box-shadow: none; border-radius: 0; max-width: 100%; padding: 0; }
  #print-modal-close, #print-modal-actions { display: none !important; }
  .print-food-list { grid-template-columns: 1fr 1fr 1fr; }
}

/* ══════════════════════════════════════════
   PALETTE PICKER
   ══════════════════════════════════════════ */
.palette-section {
  margin-top: 20px;
}
.palette-section-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.palette-swatch {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 10px 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.palette-swatch:hover {
  border-color: var(--mango);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.palette-swatch-active {
  border-color: var(--mango) !important;
  box-shadow: 0 0 0 3px rgba(255,140,0,0.25), 0 4px 16px rgba(0,0,0,0.2) !important;
}
.palette-swatch-dots {
  display: flex;
  gap: 5px;
  margin-bottom: 6px;
}
.palette-swatch-dots span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.palette-swatch-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.palette-custom-row {
  margin-top: 4px;
}
.palette-custom-btn {
  background: none;
  border: 1px dashed var(--card-border);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.palette-custom-btn:hover {
  border-color: var(--mango);
  color: var(--mango);
}
.palette-custom-editor {
  margin-top: 14px;
  background: var(--settings-bg);
  border: 1px solid var(--settings-border);
  border-radius: 12px;
  padding: 18px 16px 14px;
}
.palette-custom-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.palette-custom-group-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--mango);
  margin: 14px 0 8px;
}
.palette-custom-group-label:first-of-type { margin-top: 0; }
.palette-custom-group-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-size: 0.68rem;
}
.palette-color-inputs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.palette-color-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  cursor: pointer;
  width: 68px;
}
.palette-color-input-wrap span {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: center;
  line-height: 1.2;
}
.palette-color-input-wrap small {
  font-size: 0.58rem;
  color: var(--text-muted);
  opacity: 0.65;
  text-align: center;
  line-height: 1.3;
  display: block;
}
.palette-color-input-wrap input[type="color"] {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 2px solid var(--card-border);
  cursor: pointer;
  padding: 2px;
  background: none;
}
.palette-custom-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* ══════════════════════════════════════════
   FOOTER LOGO IMAGE
   ══════════════════════════════════════════ */
.footer-logo-img-wrap {
  margin-bottom: 10px;
}
.footer-logo-img {
  max-width: 180px;
  height: auto;
  display: block;
}
.footer-logo-dark  { display: block; }
.footer-logo-light { display: none; }
body.light-mode .footer-logo-dark  { display: none; }
body.light-mode .footer-logo-light { display: block; }

/* ══════════════════════════════════════════
   PRINT FILTER ROW (inside print modal)
   ══════════════════════════════════════════ */
#print-filter-row {
  display: flex;
  gap: 8px;
  margin: 10px 0 14px;
  justify-content: center;
}
.print-filter-toggle {
  background: var(--settings-bg);
  border: 1px solid var(--settings-border);
  border-radius: 50px;
  padding: 5px 16px;
  font-size: 0.8rem;
  font-family: 'Google Sans', 'Product Sans', sans-serif;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.18s;
}
.print-filter-toggle.active {
  background: var(--mango);
  border-color: var(--mango);
  color: #fff;
  font-weight: 600;
}

/* ══════════════════════════════════════════
   PRINT DROPDOWN IN SEARCH BAR
   ══════════════════════════════════════════ */
#print-dd-wrap .dd-btn {
  padding: 7px 10px;
  gap: 4px;
  flex-shrink: 0;
}
.dd-panel-print {
  right: 0;
  left: auto;
  min-width: 180px;
}

/* Nat/category bubbles are clickable */
.nat-link, .category-tag { cursor: pointer; }

/* ══════════════════════════════════════════
   FOOD DETAIL MODAL
   ══════════════════════════════════════════ */
#food-detail-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#food-detail-modal.open {
  display: flex;
}
#food-detail-inner {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 24px 24px;
  position: relative;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
}
#food-detail-close {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--settings-bg);
  border: 1px solid var(--settings-border);
  border-radius: 50%;
  width: 30px; height: 30px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s, color 0.18s;
}
#food-detail-close:hover { background: var(--papaya); color: #fff; border-color: var(--papaya); }
#fdm-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
#fdm-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.2;
  padding-right: 30px;
}
#fdm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.fdm-nat {
  background: var(--wish-bg);
  border: 1px solid var(--wish-border);
  border-radius: 50px;
  padding: 3px 10px;
  font-size: 0.75rem;
  color: var(--dragonfruit);
  cursor: pointer;
  transition: background 0.18s;
}
.fdm-nat:hover { background: var(--wish-border); }
.fdm-cat {
  background: var(--tried-bg);
  border: 1px solid var(--tried-border);
  border-radius: 50px;
  padding: 3px 10px;
  font-size: 0.75rem;
  color: var(--lime);
  cursor: pointer;
  transition: background 0.18s;
}
.fdm-cat:hover { background: var(--tried-border); }
.fdm-yr {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 3px 0;
}
#fdm-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.fdm-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mango);
  margin-bottom: 6px;
}
#fdm-ingredients {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}
#fdm-ingredients-wrap { margin-bottom: 14px; }
/* ── Food Detail: 3-icon action bar ── */
#fdm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  margin-top: 16px;
  border-top: 1px solid var(--card-border);
  border-radius: 0 0 10px 10px;
  overflow: hidden;
}
.fdm-action-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px 6px;
  background: var(--settings-bg);
  border: none;
  border-right: 1px solid var(--card-border);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-family: 'Google Sans', 'Product Sans', sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 0.17s, color 0.17s;
}
.fdm-action-col:last-child { border-right: none; }
.fdm-action-col:hover,
.fdm-action-col.active { background: var(--card-border); color: var(--mango); }
.fdm-action-col svg { opacity: 0.75; transition: opacity 0.17s; }
.fdm-action-col:hover svg,
.fdm-action-col.active svg { opacity: 1; }

/* ── Food Detail: Overlay panels ── */
.fdm-overlay {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--card-border);
  border-radius: 10px;
  background: var(--settings-bg);
  margin-top: 10px;
  overflow: hidden;
  animation: fdm-slide-in 0.18s ease;
}
.fdm-overlay.open { display: flex; }

@keyframes fdm-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fdm-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px 8px;
  border-bottom: 1px solid var(--card-border);
}
.fdm-overlay-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mango);
}
.fdm-overlay-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.fdm-overlay-close:hover { color: var(--papaya); background: var(--card-border); }
.fdm-overlay-links {
  display: flex;
  flex-direction: column;
}
.fdm-overlay-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 0.84rem;
  font-family: 'Google Sans', 'Product Sans', sans-serif;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--card-border);
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.fdm-overlay-link:last-child { border-bottom: none; }
.fdm-overlay-link:hover { background: var(--card-border); color: var(--text-primary); }
.fdm-overlay-link svg { flex-shrink: 0; opacity: 0.9; }
.fdm-overlay-link-btn {
  background: none;
  border: none;
  text-align: left;
  width: 100%;
}
#fdm-share-notice {
  font-size: 0.8rem;
  color: var(--lime);
  padding: 8px 14px;
  border-top: 1px solid var(--card-border);
}
