/* ── FODMAP Tracker — Mobile-first PWA ──────────────────────────────────────── */
:root {
  --bg: #0f0a1a;
  --surface: #1a1228;
  --surface2: #241a36;
  --border: #2d2145;
  --text: #e8e0f0;
  --text2: #9985b5;
  --accent: #7c3aed;
  --accent2: #a78bfa;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f59e0b;
  --blue: #3b82f6;
  --pink: #ec4899;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body { padding-bottom: calc(72px + var(--safe-bottom)); }

/* ── App bar ───────────────────────────────────────────────────────────────── */
.app-bar {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center;
  backdrop-filter: blur(12px);
}
.app-bar h1 { font-size: 18px; font-weight: 700; }
.app-bar h1 span { color: var(--accent2); }
.app-bar .subtitle { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* ── Menu button & drawer ─────────────────────────────────────────────────── */
.menu-btn {
  background: none; border: none; color: var(--text);
  font-size: 22px; cursor: pointer; padding: 4px 8px;
  border-radius: 8px; transition: background .15s;
}
.menu-btn:hover { background: var(--surface2); }

.menu-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 150; opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.menu-overlay.open { opacity: 1; pointer-events: auto; }

.menu-drawer {
  position: fixed; top: 0; right: -280px; width: 280px; height: 100%;
  background: var(--surface); border-left: 1px solid var(--border);
  z-index: 200; padding: 0;
  transition: right .25s ease;
  display: flex; flex-direction: column;
}
.menu-drawer.open { right: 0; }

.menu-header {
  font-size: 16px; font-weight: 700; padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.menu-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 16px 20px;
  background: none; border: none; border-bottom: 1px solid var(--border);
  color: var(--text); font-size: 14px; cursor: pointer;
  text-align: left; transition: background .15s;
}
.menu-item:hover { background: var(--surface2); }
.menu-item span { font-size: 18px; }

/* ── Intro page ───────────────────────────────────────────────────────────── */
.intro-fodmap-card {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border-radius: 10px; padding: 10px;
  font-size: 13px;
}
.intro-fodmap-card span { font-size: 20px; min-width: 28px; text-align: center; }
.intro-sub { font-size: 11px; color: var(--text2); margin-top: 2px; }
.intro-step {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; line-height: 1.6;
}
.intro-step:last-child { border-bottom: none; }
.intro-step-nr {
  min-width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}

/* ── Bottom nav ────────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: var(--safe-bottom);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 10px 4px 8px; gap: 4px;
  font-size: 10px; color: var(--text2);
  cursor: pointer; transition: color .15s;
  text-decoration: none; border: none; background: none;
}
.nav-item.active { color: var(--accent2); }
.nav-item .nav-icon { font-size: 22px; line-height: 1; }

/* ── Pages ─────────────────────────────────────────────────────────────────── */
.page { display: none; padding: 16px 16px 24px; animation: fadeIn .2s; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.card-header h2 { font-size: 15px; font-weight: 600; }
.card-header .badge {
  font-size: 11px; padding: 3px 10px; border-radius: 20px;
  background: var(--surface2); color: var(--text2);
}

/* ── Section headers ───────────────────────────────────────────────────────── */
.section-title {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text2); margin: 20px 0 12px;
}

/* ── Search / Input ────────────────────────────────────────────────────────── */
.search-box {
  position: relative; margin-bottom: 12px;
}
.search-box input {
  width: 100%; padding: 12px 16px 12px 40px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); font-size: 15px;
  outline: none; transition: border-color .15s;
}
.search-box input:focus { border-color: var(--accent); }
.search-box input::placeholder { color: var(--text2); }
.search-box .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 16px; color: var(--text2);
}

.input-field {
  width: 100%; padding: 12px 16px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); font-size: 15px;
  outline: none; transition: border-color .15s;
}
.input-field:focus { border-color: var(--accent); }

/* ── Food list ─────────────────────────────────────────────────────────────── */
.food-results { max-height: 280px; overflow-y: auto; }
.food-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-radius: 10px; cursor: pointer;
  transition: background .15s; margin-bottom: 2px;
}
.food-item:hover, .food-item:active { background: var(--surface2); }
.food-item .food-name { font-size: 15px; font-weight: 500; }
.food-item .food-tags { display: flex; gap: 4px; margin-top: 4px; }
.food-tag {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: rgba(124, 58, 237, 0.2); color: var(--accent2);
}
.food-tag.hoog { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.food-tag.safe { background: rgba(34, 197, 94, 0.2); color: #86efac; }

/* ── Selected foods ────────────────────────────────────────────────────────── */
.selected-foods { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; min-height: 32px; }
.selected-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--accent); color: white;
  padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 500;
}
.selected-chip .remove { cursor: pointer; opacity: .7; font-size: 16px; }
.selected-chip .remove:hover { opacity: 1; }

/* ── Toggle bar ───────────────────────────────────────────────────────────── */
.toggle-bar {
  display: flex; gap: 4px; margin-bottom: 14px;
  background: var(--surface2); border-radius: 10px; padding: 3px;
}
.toggle-btn {
  flex: 1; padding: 8px; border: none; border-radius: 8px;
  background: transparent; color: var(--text2);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.toggle-btn.active { background: var(--accent); color: white; }

/* ── Dish ingredient tags ─────────────────────────────────────────────────── */
.dish-ingredients {
  font-size: 11px; color: var(--text2); margin-top: 4px;
  line-height: 1.4;
}
.dish-fodmap-summary {
  display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap;
}

/* ── Duration selector ─────────────────────────────────────────────────────── */
.duration-selector {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.duration-btn {
  flex: 1; min-width: 0; padding: 8px 4px; border-radius: 10px;
  background: var(--surface2); border: 2px solid var(--border);
  color: var(--text); font-size: 12px; cursor: pointer;
  text-align: center; transition: all .15s;
}
.duration-btn.active { border-color: var(--accent); background: rgba(124, 58, 237, 0.15); }

/* ── Portion selector ──────────────────────────────────────────────────────── */
.portion-selector {
  display: flex; gap: 6px; margin: 12px 0; flex-wrap: wrap;
}
.portion-btn {
  flex: 1; padding: 10px; border-radius: 10px;
  background: var(--surface2); border: 2px solid var(--border);
  color: var(--text); font-size: 13px; cursor: pointer;
  text-align: center; transition: all .15s;
}
.portion-btn.active { border-color: var(--accent); background: rgba(124, 58, 237, 0.15); }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: all .15s; text-align: center;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #6d28d9; }
.btn-primary:disabled { background: var(--surface2); color: var(--text2); cursor: not-allowed; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

/* ── Severity slider ───────────────────────────────────────────────────────── */
.severity-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; gap: 12px;
}
.severity-label { font-size: 14px; min-width: 80px; }
.severity-options { display: flex; gap: 6px; }
.severity-btn {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface2); border: 2px solid var(--border);
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s; color: var(--text);
}
.severity-btn.active { border-color: var(--accent); background: rgba(124, 58, 237, 0.2); transform: scale(1.1); }

/* ── Bristol chart ─────────────────────────────────────────────────────────── */
.bristol-layout {
  display: flex; gap: 10px;
}
.bristol-scale {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 2px 0;
  font-size: 10px; color: var(--text2); font-weight: 600;
  min-width: 20px;
}
.bristol-scale-bar {
  flex: 1; width: 6px; border-radius: 3px;
  background: linear-gradient(to bottom, var(--red), var(--orange) 30%, var(--green) 45%, var(--green) 55%, var(--orange) 70%, var(--red));
}
.bristol-grid { display: grid; gap: 6px; flex: 1; }
.bristol-option {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--surface2); border: 2px solid transparent;
  cursor: pointer; transition: all .15s;
}
.bristol-option.active { border-color: var(--accent); background: rgba(124, 58, 237, 0.12); }
.bristol-option .b-emoji { font-size: 20px; min-width: 28px; text-align: center; }
.bristol-option .b-img { width: 52px; min-width: 52px; height: 34px; display: flex; align-items: center; }
.bristol-option .b-img svg { width: 100%; height: 100%; }
.bristol-option .b-label { font-size: 14px; font-weight: 600; }
.bristol-option .b-desc { font-size: 12px; color: var(--text2); }

/* ── Trial banner ─────────────────────────────────────────────────────────── */
/* Onboarding flashcards */
.onboarding-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: none; flex-direction: column;
}
.onboarding-overlay.active { display: flex; }
.onboarding-slides { flex: 1; position: relative; overflow: hidden; }
.onboarding-slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 28px; text-align: center;
  opacity: 0; transform: translateX(100%); transition: all 0.35s ease;
  pointer-events: none;
}
.onboarding-slide.active {
  opacity: 1; transform: translateX(0); pointer-events: auto;
}
.onboarding-slide.exit {
  opacity: 0; transform: translateX(-100%);
}
.onboarding-img { width: 140px; height: auto; margin-bottom: 20px; }
.onboarding-icon { font-size: 48px; margin-bottom: 16px; }
.onboarding-slide h2 { font-size: 22px; margin-bottom: 12px; color: var(--text); }
.onboarding-slide p { font-size: 15px; color: var(--text2); line-height: 1.7; margin-bottom: 8px; max-width: 340px; }
.onboarding-sub { font-size: 13px !important; color: var(--text2); opacity: 0.7; }
.onboarding-steps {
  display: flex; flex-direction: column; gap: 16px;
  margin-bottom: 24px;
}
.onboarding-step {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 20px; font-size: 15px;
  color: var(--text); min-width: 260px;
}
.onboarding-step-icon { font-size: 24px; }
.onboarding-nav {
  padding: 20px 28px 36px; display: flex; justify-content: space-between; align-items: center;
}
.onboarding-prev-btn {
  background: none; color: var(--text2); border: none;
  padding: 12px 16px; font-size: 15px; cursor: pointer; min-width: 80px;
}
.onboarding-dots { display: flex; gap: 8px; }
.onboarding-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--surface2); transition: background 0.2s;
}
.onboarding-dot.active { background: var(--accent); width: 24px; border-radius: 4px; }
.onboarding-next-btn {
  background: var(--accent); color: white; border: none;
  padding: 12px 28px; border-radius: 12px; font-size: 15px;
  font-weight: 600; cursor: pointer;
}
.onboarding-start-btn { margin-top: 16px; width: auto; padding: 14px 36px; }

/* Rapport paywall */
.rapport-blurred {
  filter: blur(5px); -webkit-filter: blur(5px);
  pointer-events: none; user-select: none;
  opacity: 0.5;
}
.rapport-paywall {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 20px; text-align: center;
  z-index: 10;
}

/* Menu submenu */
.menu-submenu-toggle { position: relative; }
.menu-chevron {
  margin-left: auto; font-size: 18px; color: var(--text2);
  transition: transform 0.2s;
}
.menu-chevron.open { transform: rotate(90deg); }
.menu-submenu {
  max-height: 0; overflow: hidden; transition: max-height 0.25s ease;
}
.menu-submenu.open { max-height: 200px; }
.menu-sub-item { padding-left: 36px !important; font-size: 14px !important; }

/* Menu trial info */
.menu-trial-info {
  margin-top: auto; padding: 16px 0 24px;
  border-top: 1px solid var(--border);
}
.menu-trial-active {
  font-size: 12px; color: var(--text2); text-align: center;
  padding: 12px 16px; line-height: 1.5; font-style: italic;
}
.menu-trial-expired {
  font-size: 13px; color: #fca5a5; text-align: center;
  padding: 12px 16px; line-height: 1.5; font-style: italic;
}

/* ── Day selector ─────────────────────────────────────────────────────────── */
.day-selector {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-bottom: 16px;
}
.day-nav {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 20px;
  width: 36px; height: 36px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.day-nav:hover { background: var(--border); }
.day-nav:disabled { opacity: .2; cursor: not-allowed; }
.day-label {
  font-size: 15px; font-weight: 600; min-width: 140px; text-align: center;
}

/* ── Dashboard ─────────────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-card {
  background: var(--surface2); border-radius: 12px; padding: 14px; text-align: center;
}
.stat-card .stat-value { font-size: 28px; font-weight: 700; }
.stat-card .stat-label { font-size: 12px; color: var(--text2); margin-top: 4px; }

.log-entry {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.log-entry:last-child { border-bottom: none; }
.log-icon { font-size: 24px; min-width: 32px; text-align: center; padding-top: 2px; }
.log-info { flex: 1; }
.log-info .log-title { font-size: 14px; font-weight: 500; }
.log-info .log-detail { font-size: 12px; color: var(--text2); margin-top: 2px; }
.log-time { font-size: 12px; color: var(--text2); white-space: nowrap; }
.log-actions { display: flex; align-items: center; gap: 2px; }
.log-edit, .log-delete {
  background: none; border: none; color: var(--text2);
  font-size: 14px; cursor: pointer; padding: 2px 4px;
  opacity: .4; transition: opacity .15s, color .15s;
  line-height: 1; min-width: 24px; text-align: center;
}
.log-edit:hover { opacity: 1; }
.log-delete:hover { opacity: 1; color: var(--red); }

/* ── Edit dialog ──────────────────────────────────────────────────────────── */
.edit-dialog {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  max-width: 340px; width: 100%;
}
.edit-label {
  font-size: 12px; color: var(--text2); display: block; margin-bottom: 6px;
}
.edit-foods-list {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 32px;
}
.edit-food-chip {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface2); border: 1px solid var(--border);
  padding: 5px 8px 5px 10px; border-radius: 16px; font-size: 13px;
}
.edit-food-name {
  cursor: pointer; transition: color .15s;
}
.edit-food-name:hover { color: var(--accent2); text-decoration: underline; }
.edit-food-remove {
  background: none; border: none; color: var(--text2);
  font-size: 16px; cursor: pointer; padding: 0 2px;
  opacity: .5; transition: opacity .15s, color .15s;
  line-height: 1;
}
.edit-food-remove:hover { opacity: 1; color: var(--red); }

/* ── Edit dropdown ────────────────────────────────────────────────────────── */
.edit-dropdown {
  position: relative; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; transition: border-color .15s;
}
.edit-dropdown.open { border-color: var(--accent); }
.edit-dropdown-selected {
  padding: 10px 14px; font-size: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.edit-dropdown-selected::after {
  content: '▾'; color: var(--text2); font-size: 12px;
}
.edit-dropdown.open .edit-dropdown-selected::after { content: '▴'; }
.edit-dropdown-options {
  display: none; position: absolute; left: 0; right: 0; top: 100%;
  margin-top: 4px; z-index: 10;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.edit-dropdown.open .edit-dropdown-options { display: block; }
.edit-dropdown-option {
  padding: 10px 14px; font-size: 14px;
  transition: background .1s; cursor: pointer;
}
.edit-dropdown-option:hover { background: var(--surface2); }
.edit-dropdown-option.active { color: var(--accent2); font-weight: 600; }

/* ── Confirm dialog ───────────────────────────────────────────────────────── */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.confirm-dialog {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  max-width: 320px; width: 100%; text-align: center;
}
.confirm-dialog p { font-size: 15px; margin-bottom: 20px; }
.confirm-buttons { display: flex; gap: 10px; }
.confirm-buttons .btn { flex: 1; padding: 10px; font-size: 14px; }
.btn-danger { background: var(--red); color: white; border: none; }

/* ── Milestone dialog ─────────────────────────────────────────────────────── */
.milestone-dialog {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px;
  max-width: 320px; width: 100%; text-align: center;
}
.milestone-dialog .darmie-prof { width: 120px; height: auto; }

/* ── Day rating ────────────────────────────────────────────────────────────── */
.rating-slider {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin: 16px 0;
}
.rating-btn {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface2); border: 2px solid var(--border);
  font-size: 18px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; color: var(--text);
}
.rating-btn.active { border-color: var(--accent); background: rgba(124, 58, 237, 0.2); transform: scale(1.1); }
.rating-btn.low { color: var(--red); }
.rating-btn.mid { color: var(--orange); }
.rating-btn.high { color: var(--green); }

.rating-submitted {
  display: flex; align-items: center; gap: 12px;
  justify-content: center; padding: 8px 0;
}
.rating-submitted-score {
  font-size: 28px; font-weight: 700;
}
.rating-submitted-score.low { color: var(--red); }
.rating-submitted-score.mid { color: var(--orange); }
.rating-submitted-score.high { color: var(--green); }
.rating-submitted-label {
  font-size: 14px; color: var(--text2);
}

/* ── Rapport ───────────────────────────────────────────────────────────────── */
.suspect-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  border-left: 4px solid var(--border);
}
.suspect-card.hoog { border-left-color: var(--red); }
.suspect-card.midden { border-left-color: var(--orange); }
.suspect-card.laag { border-left-color: var(--green); }

.suspect-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.suspect-name { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.suspect-badge {
  font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 600;
}
.suspect-badge.hoog { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.suspect-badge.midden { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.suspect-badge.laag { background: rgba(34, 197, 94, 0.2); color: #86efac; }

.suspect-bar {
  height: 8px; background: var(--surface2); border-radius: 4px;
  margin: 10px 0; overflow: hidden;
}
.suspect-bar-fill {
  height: 100%; border-radius: 4px; transition: width .5s ease-out;
}
.suspect-bar-fill.hoog { background: var(--red); }
.suspect-bar-fill.midden { background: var(--orange); }
.suspect-bar-fill.laag { background: var(--green); }

.suspect-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  margin: 10px 0;
}
.suspect-stat { text-align: center; }
.suspect-stat .ss-val { font-size: 16px; font-weight: 700; }
.suspect-stat .ss-label { font-size: 11px; color: var(--text2); }

.suspect-explanation {
  font-size: 13px; color: var(--text2); line-height: 1.6;
  background: var(--surface2); padding: 12px; border-radius: 10px;
  margin-top: 10px;
}
.info-btn {
  background: none; border: 1px solid var(--border); color: var(--text2);
  font-size: 12px; width: 18px; height: 18px; border-radius: 50%;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  vertical-align: middle; margin-left: 2px; padding: 0;
  transition: all .15s;
}
.info-btn:hover { border-color: var(--accent); color: var(--accent2); }
.suspect-sameday {
  font-size: 12px; color: var(--orange); line-height: 1.5;
  background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 10px; border-radius: 8px; margin-top: 8px;
}

.disclaimer {
  background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px; padding: 14px; margin-bottom: 16px;
  font-size: 13px; color: var(--orange); line-height: 1.5;
}

.recommendation {
  background: rgba(124, 58, 237, 0.1); border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 12px; padding: 16px; margin-bottom: 16px;
  font-size: 14px; line-height: 1.6;
}

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text2);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; line-height: 1.6; }

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 90px; left: 12px; right: 12px;
  transform: none;
  background: var(--accent); color: white;
  padding: 16px 20px; border-radius: 16px;
  font-size: 14px; font-weight: 500;
  opacity: 0; transition: opacity .3s;
  z-index: 200; pointer-events: none;
  white-space: normal; text-align: left;
  display: flex; align-items: center; gap: 14px;
  max-width: 92vw;
}
.toast.show { opacity: 1; }

/* ── Mascotte (Darmie) ────────────────────────────────────────────────────── */
.darmie-icon { width: 36px; height: 36px; min-width: 36px; vertical-align: middle; }
.darmie-party-icon { width: 60px; height: auto; min-width: 60px; vertical-align: middle; }

.darmie-prof { width: 90px; height: auto; min-width: 90px; border-radius: 0; }
.darmie-prof-block {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 16px;
}
.darmie-prof-block .darmie-prof-col {
  display: flex; flex-direction: column; align-items: center;
}
.darmie-prof-intro {
  display: flex; flex-direction: column; align-items: center;
  margin-top: -4px;
}
.darmie-prof-arrow {
  font-size: 16px; color: var(--accent2); line-height: 1;
}
.darmie-prof-name {
  font-size: 10px; font-weight: 700; color: var(--accent2);
  white-space: nowrap; letter-spacing: .02em;
}
.darmie-prof-bubble {
  flex: 1;
  background: rgba(124, 58, 237, 0.1); border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 14px; border-top-left-radius: 4px;
  padding: 14px; font-size: 14px; line-height: 1.6;
}

/* ── Confetti ─────────────────────────────────────────────────────────────── */
.confetti-container {
  position: fixed; inset: 0; z-index: 250;
  pointer-events: none; overflow: hidden;
}
.confetti-piece {
  position: absolute; top: -12px;
  opacity: .9;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  80%  { opacity: .8; }
  100% { transform: translateY(105vh) rotate(720deg) scale(.4); opacity: 0; }
}
.confetti-emoji {
  font-size: 20px; background: none !important;
  width: auto !important; height: auto !important;
  border-radius: 0 !important;
}

/* ── Nerd Stats ───────────────────────────────────────────────────────────── */
.nerd-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.nerd-table td {
  padding: 6px 4px; border-bottom: 1px solid var(--border);
}
.nerd-table td:first-child { color: var(--text2); }
.nerd-table td:last-child { text-align: right; font-family: 'SF Mono', 'Menlo', monospace; font-size: 11px; }
.nerd-group {
  margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.nerd-group:last-child { border-bottom: none; margin-bottom: 0; }
.nerd-group-header {
  font-size: 14px; font-weight: 700; margin-bottom: 8px;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Barcode scan button ──────────────────────────────────────────────────── */
.btn-scan {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px; margin-bottom: 14px;
  background: var(--surface2); border: 1px dashed var(--border);
  border-radius: 12px; color: var(--text2); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.btn-scan:hover, .btn-scan:active {
  background: var(--border); color: var(--text); border-color: var(--accent);
}
.btn-scan-icon { font-size: 18px; }

/* ── Scanner overlay ─────────────────────────────────────────────────────── */
.scanner-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg);
  display: none; flex-direction: column;
}
.scanner-overlay.open { display: flex; }
.scanner-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.scanner-header h2 { font-size: 16px; font-weight: 600; }
.scanner-close {
  background: none; border: none; color: var(--text);
  font-size: 22px; cursor: pointer; padding: 4px 8px;
  border-radius: 8px; transition: background .15s;
}
.scanner-close:hover { background: var(--surface2); }
#scanner-reader {
  flex: 1; background: #000; overflow: hidden;
}
#scanner-reader video { width: 100%; height: 100%; object-fit: cover; }
.scanner-status {
  padding: 14px 20px; text-align: center;
  font-size: 14px; color: var(--text2);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ── Scanner result overlay ──────────────────────────────────────────────── */
.scanner-result-overlay {
  position: fixed; inset: 0; z-index: 310;
  background: rgba(0,0,0,.7);
  display: none; align-items: flex-end; justify-content: center;
  padding: 0;
}
.scanner-result-overlay.open { display: flex; }
.scanner-result-card {
  background: var(--surface);
  border-top-left-radius: 20px; border-top-right-radius: 20px;
  border: 1px solid var(--border); border-bottom: none;
  padding: 20px; width: 100%; max-width: 500px;
  max-height: 85vh; overflow-y: auto;
  animation: slideUp .25s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(100%); } to { transform: translateY(0); }
}
.scanner-result-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.scanner-result-header h2 { font-size: 17px; font-weight: 700; flex: 1; margin-right: 12px; }
.scanner-product-img {
  max-width: 120px; max-height: 120px; border-radius: 12px;
  object-fit: contain; background: #fff; padding: 4px;
}
.scanner-matched-list, .scanner-unmatched-list {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.scanner-match-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 12px; font-size: 13px;
  cursor: pointer; transition: all .15s;
}
.scanner-match-chip.selected {
  border-color: var(--accent); background: rgba(124, 58, 237, 0.15);
}
.scanner-match-chip .match-tags { display: flex; gap: 3px; }
.scanner-unmatched-chip {
  background: var(--surface2); border: 1px solid var(--border);
  padding: 6px 10px; border-radius: 10px;
  font-size: 12px; color: var(--text2);
}

/* ── Time input ────────────────────────────────────────────────────────────── */
input[type="time"] {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; color: var(--text);
  font-size: 15px; color-scheme: dark;
}

/* ── Scanner FODMAP resultaat ──────────────────────────────────────────────── */
.scanner-fodmap-list { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.scanner-fodmap-row { display: flex; justify-content: space-between; align-items: center; }

/* ── Custom food dialoog ──────────────────────────────────────────────────── */
.custom-trigger-prompt {
  margin-bottom: 12px; padding: 10px; background: var(--surface2);
  border-radius: 10px;
}
.custom-trigger-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.trigger-chip {
  padding: 5px 12px; border-radius: 20px; font-size: 12px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text2); cursor: pointer; transition: all 0.15s;
}
.trigger-chip.active {
  background: rgba(239, 68, 68, 0.15); border-color: #ef4444;
  color: #fca5a5;
}
.custom-food-search-box input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; color: var(--text);
  font-size: 14px; color-scheme: dark; box-sizing: border-box;
}
.custom-ingredient-results {
  max-height: 150px; overflow-y: auto; margin: 6px 0;
}
.custom-ingredient-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-bottom: 1px solid var(--border);
  cursor: pointer; font-size: 13px; color: var(--text);
}
.custom-ingredient-item:hover { background: var(--surface2); }
.custom-ingredient-list { margin: 8px 0; }
.custom-ingredient-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.custom-ingredient-name {
  font-size: 13px; color: var(--text); min-width: 80px; flex-shrink: 0;
}
.custom-pct-slider {
  flex: 1; accent-color: var(--accent); height: 24px;
  -webkit-appearance: none; appearance: none;
  background: transparent; touch-action: none; cursor: pointer;
}
.custom-pct-slider::-webkit-slider-runnable-track {
  height: 6px; background: var(--surface2); border-radius: 3px;
}
.custom-pct-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface);
  margin-top: -8px; box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.custom-pct-slider::-moz-range-track {
  height: 6px; background: var(--surface2); border-radius: 3px; border: none;
}
.custom-pct-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.custom-pct-label {
  font-size: 12px; color: var(--accent2); min-width: 32px; text-align: right;
  font-weight: 600;
}
.custom-remove {
  background: none; border: none; color: var(--text2); font-size: 16px;
  cursor: pointer; padding: 0 4px;
}
#custom-total-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 0; height: 8px; background: var(--surface2);
  border-radius: 4px; overflow: visible; position: relative;
}
.custom-total-fill {
  height: 100%; border-radius: 4px; transition: width 0.2s, background 0.2s;
}
.custom-total-fill.low { background: var(--text2); }
.custom-total-fill.ok { background: #f59e0b; }
.custom-total-fill.good { background: #22c55e; }
.custom-total-fill.over { background: #ef4444; }
#custom-total-label {
  font-size: 11px; font-weight: 600; color: var(--text2); flex-shrink: 0;
}
.custom-fodmap-preview { min-height: 24px; }

/* ── Nerd-stats uitleg ─────────────────────────────────────────────────────── */
.nerd-explainer h3 {
  font-size: 14px; color: var(--text); margin: 16px 0 6px; font-weight: 600;
}
.nerd-explainer h3:first-child { margin-top: 4px; }
.nerd-explainer p {
  font-size: 13px; color: var(--text2); line-height: 1.7; margin: 0 0 8px;
}
.nerd-explainer ul {
  font-size: 13px; color: var(--text2); line-height: 1.7;
  margin: 0 0 8px; padding-left: 20px;
}

/* ── Symptoom-secties binnen één card ──────────────────────────────────────── */
.symptom-section {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.symptom-section:first-of-type { border-top: none; }
.symptom-section-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 16px; font-weight: 600; color: var(--text);
  margin-bottom: 12px;
}

/* ── Verleden-bevestiging ──────────────────────────────────────────────────── */
.past-confirm-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.past-confirm-overlay.show { opacity: 1; }
.past-confirm-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px; max-width: 320px; width: 90%;
  text-align: center;
}
.past-confirm-box p { color: var(--text); font-size: 16px; margin: 0 0 20px; line-height: 1.5; }
.past-confirm-btns { display: flex; gap: 10px; }
.past-confirm-yes, .past-confirm-no {
  flex: 1; padding: 12px; border-radius: 12px; border: none;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.past-confirm-yes { background: var(--accent); color: #fff; }
.past-confirm-no { background: var(--surface2); color: var(--text2); }
