/* ============================================================================
 * Spierkracht — "Athletic Volt" design system
 * Diep koel antraciet + elektrisch volt accent. Performance-instrument look.
 * ==========================================================================*/
:root {
  /* neutralen — koel-gebiast, gekozen (geen dood grijs) */
  --bg: #0B0E12;
  --bg-2: #10151B;
  --surface: #151B23;
  --surface-2: #1C242F;
  --line: #262F3B;
  --line-2: #333E4C;
  --text: #EDF1F6;
  --muted: #808E9F;
  --muted-2: #5B6573;

  /* signatuur */
  --volt: #C7F53B;
  --volt-dim: #A9D62E;
  --ink: #0B0E12;           /* tekst op volt */

  /* semantisch (los van accent) */
  --good: #3DD68C;
  --warn: #F6B44A;
  --bad: #FF5C6C;
  --water: #38BDF8;

  --r: 14px;
  --r-sm: 10px;
  --r-lg: 22px;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  --shadow-volt: 0 6px 20px rgba(199, 245, 59, 0.22);
  --maxw: 640px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --num: "SF Mono", "SFMono-Regular", ui-monospace, "Roboto Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 520px at 50% -8%, #182233 0%, rgba(24, 34, 51, 0) 62%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  letter-spacing: -0.006em;
}

#app { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* utilities */
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.page-title { font-size: 1.55rem; font-weight: 850; letter-spacing: -0.03em; margin: 2px 0 16px; text-wrap: balance; }
.tabular, .pbar-num, .reps, .dd-sets, .fi-time, .fi-macros, .macro-mini, .sum-val, .nstat-val, .meal-time { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: rgba(11, 14, 18, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 850; letter-spacing: -0.03em; font-size: 1.12rem; }
.brand .logo { font-size: 1.15rem; filter: drop-shadow(0 0 10px rgba(199, 245, 59, 0.35)); }
.logo.big { font-size: 3.2rem; filter: drop-shadow(0 0 24px rgba(199, 245, 59, 0.4)); }
.topbar-sub { display: flex; align-items: center; gap: 7px; font-size: 0.74rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; box-shadow: 0 0 8px currentColor; }

/* ------------------------------------------------------------------ main */
#view { flex: 1; padding: 20px 16px 100px; }

/* ------------------------------------------------------------------ cards */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; border-radius: var(--r) var(--r) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
}
.card h3 { margin: 0 0 8px; font-size: 1.02rem; font-weight: 750; }
.wc-title { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }

/* ------------------------------------------------------------------ tabbar */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; max-width: var(--maxw); margin: 0 auto;
  background: rgba(16, 21, 27, 0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 7px 6px calc(7px + env(safe-area-inset-bottom, 0));
}
.tab {
  flex: 1; background: none; border: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 2px; border-radius: 12px; cursor: pointer; font: inherit; position: relative;
  transition: color 0.15s;
}
.tab-ico { font-size: 1.2rem; line-height: 1; transition: transform 0.15s; }
.tab-lbl { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.tab.active { color: var(--volt); }
.tab.active .tab-ico { transform: translateY(-1px) scale(1.06); filter: drop-shadow(0 0 8px rgba(199, 245, 59, 0.5)); }
.tab.active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 3px; background: var(--volt); box-shadow: 0 0 10px var(--volt);
}

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 12px;
  padding: 13px 16px; font: inherit; font-weight: 750; cursor: pointer;
  transition: transform 0.08s, filter 0.15s, background 0.15s, border-color 0.15s; width: 100%;
}
.btn:hover { border-color: var(--muted-2); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; }
.btn.primary { background: var(--volt); border: none; color: var(--ink); font-weight: 850; letter-spacing: 0.01em; box-shadow: var(--shadow-volt); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.big { padding: 16px; font-size: 1.05rem; }
.btn.ghost { background: transparent; }
.btn.danger-ghost { background: transparent; border-color: rgba(255, 92, 108, 0.4); color: var(--bad); margin-top: 10px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.btn-row .btn { width: auto; flex: 1; min-width: 150px; }

/* ------------------------------------------------------------------ forms */
.form label, .measure-form label, .onboard label, .add-form > label, .amount-row label { display: flex; flex-direction: column; gap: 6px; font-size: 0.74rem; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
input, select, textarea {
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text);
  border-radius: var(--r-sm); padding: 12px; font: inherit; font-weight: 600; width: 100%; letter-spacing: normal; text-transform: none;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--volt); box-shadow: 0 0 0 3px rgba(199, 245, 59, 0.18); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.field { margin-bottom: 14px; }
.field-label { display: block; font-size: 0.74rem; font-weight: 750; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.day-row { display: flex; gap: 6px; flex-wrap: wrap; }
.day-toggle {
  flex: 1; min-width: 40px; background: var(--bg-2); border: 1px solid var(--line-2);
  color: var(--muted); border-radius: var(--r-sm); padding: 11px 4px; font: inherit; font-weight: 800;
  text-transform: uppercase; cursor: pointer; transition: all 0.12s; letter-spacing: 0.02em;
}
.day-toggle.on { background: var(--volt); border-color: transparent; color: var(--ink); }
.switch-row { flex-direction: row !important; align-items: center; gap: 10px; color: var(--text) !important; font-weight: 800 !important; cursor: pointer; text-transform: none !important; letter-spacing: normal !important; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--volt); flex-shrink: 0; }
.fasting-field { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px; }
.fasting-times { margin: 12px 0 0; }

/* ------------------------------------------------------------------ onboarding */
.onboard { max-width: var(--maxw); margin: 0 auto; padding: 30px 16px 60px; }
.onboard-hero { text-align: center; margin-bottom: 24px; }
.onboard-hero h1 { font-size: 2.4rem; margin: 8px 0 10px; letter-spacing: -0.04em; font-weight: 850; }
.onboard-hero p { color: var(--muted); max-width: 440px; margin: 0 auto; }

/* ------------------------------------------------------------------ today */
.today-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.today-date { color: var(--muted); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.today-head .page-title { margin: 4px 0 0; }
.ring-wrap { flex-shrink: 0; }

/* snelle statusregel */
.quickbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.qstat {
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 12px 4px; font: inherit; color: var(--text); cursor: default;
}
button.qstat { cursor: pointer; transition: border-color 0.12s, transform 0.08s; }
button.qstat:not(:disabled):hover { border-color: var(--volt); }
button.qstat:not(:disabled):active { transform: scale(0.97); }
button.qstat:disabled { opacity: 0.55; }
.q-ico { font-size: 1.1rem; line-height: 1; }
.q-val { font-size: 1.05rem; font-weight: 850; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.q-lbl { font-size: 0.6rem; color: var(--muted); font-weight: 750; text-transform: uppercase; letter-spacing: 0.03em; }
@media (max-width: 460px) {
  .quickbar { grid-template-columns: repeat(2, 1fr); }
}

.phase-card { border-left: 3px solid var(--accent); }
.phase-name { font-weight: 850; font-size: 1.05rem; margin-bottom: 5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; letter-spacing: -0.02em; }
.badge { background: rgba(246, 180, 74, 0.15); color: var(--warn); font-size: 0.64rem; font-weight: 850; padding: 3px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.05em; }
.badge.sm { font-size: 0.58rem; padding: 2px 7px; }

.workout-card .wc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.chip { font-size: 0.68rem; font-weight: 800; padding: 4px 10px; border-radius: 20px; background: var(--bg-2); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.chip.done { background: rgba(61, 214, 140, 0.16); color: var(--good); }
.chip.prog { background: rgba(199, 245, 59, 0.16); color: var(--volt-dim); }

/* voltooide training — duidelijk gevierd */
.workout-card.done { border: 1px solid rgba(61, 214, 140, 0.5); background: linear-gradient(180deg, rgba(61, 214, 140, 0.1), var(--surface)); }
.workout-card.done .wc-title { color: var(--good); }
.done-msg { margin: 10px 0 12px; font-weight: 600; }
.ex-preview li.ex-done span:first-child { color: var(--good); font-weight: 700; }
.ex-preview li.ex-done .reps { color: var(--muted-2); text-decoration: line-through; }

/* groene status-tegel in de statusregel */
.qstat-done { border-color: rgba(61, 214, 140, 0.5) !important; background: linear-gradient(180deg, rgba(61, 214, 140, 0.14), var(--surface)) !important; }
.qstat-done .q-val { color: var(--good); }
.ex-preview { list-style: none; margin: 4px 0 14px; padding: 0; }
.ex-preview li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.ex-preview li:last-child { border-bottom: none; }
.ex-preview .reps { color: var(--muted); font-weight: 750; }

.rest-card p { margin: 6px 0 0; }
.notice { background: rgba(199, 245, 59, 0.06); border-color: rgba(199, 245, 59, 0.22); }

/* nutrition */
.nutri-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.nstat { text-align: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 4px; }
.nstat-val { font-size: 1.4rem; font-weight: 850; letter-spacing: -0.03em; }
.nstat-unit { font-size: 0.66rem; font-weight: 800; margin-left: 2px; opacity: 0.7; }
.nstat-lbl { font-size: 0.68rem; color: var(--muted); font-weight: 700; margin-top: 3px; text-transform: uppercase; letter-spacing: 0.04em; }
.tip { background: rgba(56, 189, 248, 0.08); border: 1px solid rgba(56, 189, 248, 0.14); border-radius: var(--r-sm); padding: 11px 13px; font-size: 0.9rem; margin: 8px 0; }

/* eetvenster */
.fasting-card { border-left: 3px solid var(--good); }
.meal-plan { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; margin: 14px 0; }
.meal { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 6px; text-align: center; }
.meal-time { display: block; font-weight: 850; }
.meal-prot { display: block; font-size: 0.7rem; color: var(--muted); font-weight: 700; margin-top: 3px; }

/* voortgangsbalken + water */
.food-progress { margin: 14px 0 6px; display: flex; flex-direction: column; gap: 12px; }
.food-totals { display: flex; flex-direction: column; gap: 14px; }
.pbar-wrap { width: 100%; }
.pbar-top { display: flex; justify-content: space-between; font-size: 0.78rem; font-weight: 750; margin-bottom: 5px; }
.pbar-num { color: var(--muted); }
.pbar-num .over { color: var(--bad); font-weight: 850; }
.pbar { height: 8px; background: var(--bg-2); border-radius: 20px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4); }
.pbar-fill { height: 100%; border-radius: 20px; transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.pbar-fill.over { background: var(--bad) !important; }
.macro-mini { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; font-size: 0.82rem; color: var(--muted); }
.macro-mini .over { color: var(--bad); font-weight: 800; }

.water-tracker { margin: 4px 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.water-btns { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.water-btns .chip-btn { flex: 1; min-width: 90px; }

/* habits */
.habit-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.habit { display: flex; align-items: center; gap: 12px; padding: 10px 4px; cursor: pointer; font-weight: 650; }
.habit input { width: 21px; height: 21px; accent-color: var(--volt); flex-shrink: 0; }

.motiv { text-align: center; font-style: italic; color: var(--text); background: linear-gradient(135deg, rgba(199, 245, 59, 0.1), rgba(56, 189, 248, 0.06)); border-color: transparent; font-weight: 500; }

/* ------------------------------------------------------------------ workout log */
.workout-head { margin-bottom: 16px; }
.ex-card { padding: 15px; }
.ex-head { margin-bottom: 8px; }
.ex-name { font-weight: 850; font-size: 1.02rem; letter-spacing: -0.02em; }
.ex-cue { font-size: 0.84rem; color: var(--muted); background: var(--bg-2); border-radius: var(--r-sm); padding: 9px 11px; margin-bottom: 8px; }
.prev { font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }
.suggest { font-size: 0.85rem; color: var(--volt-dim); font-weight: 700; margin-bottom: 12px; }
.hint { margin-top: 6px; color: var(--volt-dim); }
.sets { display: flex; flex-direction: column; gap: 8px; }
.set-row { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 8px; align-items: center; }
.set-row.single { grid-template-columns: 34px 1fr; }
.set-row.head { font-size: 0.64rem; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.set-row.head span { text-align: center; }
.set-row.head span:first-child { text-align: left; }
.setno { text-align: center; font-weight: 850; color: var(--muted); }

/* stepper: − [input] + */
.stepper { display: flex; align-items: stretch; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.stepper .step {
  flex: 0 0 40px; border: none; background: transparent; color: var(--text);
  font-size: 1.35rem; font-weight: 700; line-height: 1; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center; transition: background 0.12s;
}
.stepper .step:active { background: rgba(199, 245, 59, 0.16); }
.stepper input {
  flex: 1; min-width: 0; text-align: center; border: none; border-radius: 0;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  background: transparent; font-weight: 800; font-size: 1rem; padding: 12px 2px;
}
.stepper input:focus { box-shadow: none; }
.stepper:focus-within { border-color: var(--volt); box-shadow: 0 0 0 3px rgba(199, 245, 59, 0.16); }

.copy-prev { background: none; border: none; color: var(--volt-dim); font: inherit; font-size: 0.78rem; font-weight: 800; cursor: pointer; padding: 2px 4px; text-decoration: underline; }
.copy-prev:hover { color: var(--volt); }

.autosave-note { text-align: center; color: var(--good); font-weight: 800; font-size: 0.9rem; margin: 12px 0; transition: transform 0.2s ease; }
.autosave-note.pulse { transform: scale(1.07); }

/* rusttimer-balk */
.rest-bar {
  position: fixed; left: 0; right: 0; bottom: calc(66px + env(safe-area-inset-bottom, 0)); z-index: 25;
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; background: rgba(21, 27, 35, 0.96); backdrop-filter: blur(12px);
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); left: 12px; right: 12px;
}
.rest-label { font-weight: 800; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.rest-controls { display: flex; align-items: center; gap: 8px; }
.rest-count { font-weight: 850; font-size: 1.25rem; font-variant-numeric: tabular-nums; color: var(--volt); min-width: 56px; text-align: center; }
.rest-count.done { color: var(--good); font-size: 1rem; }
.rest-bar.running { border-color: var(--volt); }
.rest-bar.done { border-color: var(--good); }
.video-link { display: inline-flex; align-items: center; gap: 4px; color: var(--water); font-weight: 750; font-size: 0.8rem; text-decoration: none; white-space: nowrap; }
.video-link:hover { text-decoration: underline; }
.lib-ex .video-link { margin-top: 8px; }
.ex-cue .video-link { margin-left: 6px; }

/* ------------------------------------------------------------------ voeding */
.food-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.food-head .page-title { margin: 0; }
.back-btn { background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); border-radius: var(--r-sm); padding: 9px 13px; font: inherit; font-weight: 750; cursor: pointer; }
.back-btn:active { transform: scale(0.97); }
.sugg-group { margin-top: 14px; }
.sugg-label { font-size: 0.74rem; font-weight: 800; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.sugg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); border-radius: 20px; padding: 8px 13px; font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; transition: all 0.12s; }
.chip-btn:hover { border-color: var(--volt); color: var(--volt); }
.chip-btn:active { transform: scale(0.96); }
.date-card { display: flex; flex-direction: column; gap: 8px; }
.date-pick { display: flex; align-items: center; gap: 12px; font-size: 0.74rem; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.date-pick input { width: auto; flex: 1; }
.link-back-today { background: none; border: none; color: var(--volt-dim); font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; text-decoration: underline; padding: 0; }
.link-back-today:hover { color: var(--volt); }
.dd-edit {
  display: inline-flex; align-items: center; gap: 6px; width: auto;
  margin: 2px 0 12px; padding: 8px 12px;
  background: rgba(199, 245, 59, 0.12); border: 1px solid rgba(199, 245, 59, 0.4);
  color: var(--volt-dim); border-radius: 20px; font: inherit; font-size: 0.82rem; font-weight: 750;
  cursor: pointer; transition: background 0.12s, border-color 0.12s;
}
.dd-edit:hover { background: rgba(199, 245, 59, 0.2); border-color: var(--volt); color: var(--volt); }
.dd-edit:active { transform: scale(0.97); }
.chip-btn.fav { border-color: rgba(199, 245, 59, 0.4); }
.add-form { display: flex; flex-direction: column; gap: 11px; }
.cat-browse { display: flex; flex-direction: column; gap: 7px; }
.browse-label { font-size: 0.72rem; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chip { font-size: 0.8rem; }
.hidden-select { display: none; }

/* voedingsbibliotheek (volledige pagina) */
.lib-filter { position: sticky; top: 58px; z-index: 10; display: flex; flex-direction: column; gap: 10px; }
.lib-search { width: 100%; }
.lib-cat.on { background: var(--volt); border-color: transparent; color: var(--ink); }
.lib-count { margin: 0 2px 10px; }
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
  display: flex; align-items: stretch; gap: 6px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--text); transition: border-color 0.12s;
}
.lib-item:hover { border-color: var(--volt); }
.li-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 13px 4px 13px 14px; cursor: pointer; }
.li-body:active { transform: scale(0.995); }
.li-fav {
  flex: 0 0 46px; background: none; border: none; border-left: 1px solid var(--line);
  color: var(--muted-2); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center; transition: color 0.12s, transform 0.08s;
}
.li-fav:hover { color: var(--volt); }
.li-fav:active { transform: scale(1.2); }
.li-fav.on { color: var(--volt); }

/* ster-knop in het toevoegscherm */
.selected-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fav-toggle { background: var(--bg-2); border: 1px solid var(--line-2); color: var(--muted); border-radius: 20px; padding: 7px 12px; font: inherit; font-size: 0.8rem; font-weight: 750; cursor: pointer; white-space: nowrap; transition: all 0.12s; }
.fav-toggle:hover { border-color: var(--volt); color: var(--volt); }
.fav-toggle.on { background: rgba(199, 245, 59, 0.14); border-color: rgba(199, 245, 59, 0.5); color: var(--volt); }
.li-main { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.li-name { font-weight: 750; font-size: 0.95rem; }
.li-cat { font-size: 0.66rem; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
.li-macros { font-size: 0.84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.li-per { color: var(--muted-2); font-size: 0.76rem; }
.selected-food { font-size: 0.86rem; font-weight: 750; color: var(--volt-dim); }
.selected-food:empty { display: none; }
.search-results { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; margin-top: -4px; }
.sr-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 12px; font: inherit; color: var(--text); cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.sr-item:hover { border-color: var(--volt); background: var(--surface-2); }
.sr-item:active { transform: scale(0.99); }
.sr-name { font-weight: 700; font-size: 0.92rem; }
.sr-cat { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
.sr-empty { color: var(--muted); font-size: 0.86rem; padding: 12px; text-align: center; background: var(--bg-2); border-radius: var(--r-sm); }
.amount-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; }
.unit-label { padding-bottom: 12px; font-weight: 800; color: var(--text); white-space: nowrap; }
.macro-preview { display: flex; flex-wrap: wrap; gap: 6px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; font-size: 0.86rem; font-weight: 700; color: var(--muted); }
.macro-preview .mp-kcal { color: var(--volt); font-weight: 850; }
.small-btn { padding: 10px 12px; font-size: 0.85rem; }
.custom-form { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.save-custom { margin: 4px 0 10px; font-size: 0.86rem !important; font-weight: 700 !important; }
.food-list { display: flex; flex-direction: column; }
.food-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.food-item:last-child { border-bottom: none; }
.fi-main { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.fi-time { font-size: 0.74rem; font-weight: 800; color: var(--volt-dim); flex-shrink: 0; }
.fi-name { font-size: 0.9rem; font-weight: 650; }
.fi-macros { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.fi-macros .link-del { font-size: 1.15rem; text-decoration: none; color: var(--muted-2); }
.fi-macros .link-del:hover { color: var(--bad); }

/* ------------------------------------------------------------------ voortgang */
.summary-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.sum-stat { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 10px; text-align: center; }
.sum-lbl { font-size: 0.66rem; color: var(--muted); font-weight: 750; text-transform: uppercase; letter-spacing: 0.05em; }
.sum-val { font-size: 1.3rem; font-weight: 850; margin: 4px 0; letter-spacing: -0.03em; }
.sum-delta { font-size: 0.75rem; font-weight: 800; }
.sum-delta .good, .metric-row .good { color: var(--good); }
.sum-delta .bad { color: var(--bad); }
.measure-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.measure-form label:first-child { grid-column: 1 / -1; }
.measure-form .btn { grid-column: 1 / -1; }
.chart-card h3 { margin-bottom: 12px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted-2); font-size: 10px; }
.chart-last { fill: var(--text); font-size: 11px; font-weight: 800; }
.chart-empty { color: var(--muted); font-size: 0.9rem; padding: 32px 10px; text-align: center; background: var(--bg-2); border-radius: var(--r-sm); }
.metric-list { display: flex; flex-direction: column; }
.metric-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.metric-row:last-child { border-bottom: none; }
.link-del { background: none; border: none; color: var(--muted); font: inherit; font-size: 0.78rem; cursor: pointer; text-decoration: underline; padding: 0; }
.link-del:hover { color: var(--bad); }
.ring-bg { fill: none; stroke: var(--line-2); }
.ring-label { fill: var(--text); font-size: 17px; font-weight: 850; }
.ring-sub { fill: var(--muted); font-size: 11px; font-weight: 800; }

/* ------------------------------------------------------------------ agenda */
.agenda-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.agenda-head .page-title { margin: 0; }
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-label { font-weight: 800; min-width: 130px; text-align: center; text-transform: capitalize; letter-spacing: -0.01em; }
.nav-btn { width: 38px; height: 38px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0; }
.nav-btn:active { transform: scale(0.95); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-weekdays span { text-align: center; font-size: 0.64rem; font-weight: 800; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.04em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  aspect-ratio: 1 / 1; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 4px; cursor: pointer; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  color: var(--text); font: inherit; overflow: hidden; transition: border-color 0.12s, background 0.12s;
}
.cal-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-cell.sched-train { border-top: 3px solid var(--cal-accent); }
.cal-cell.today { outline: 2px solid var(--volt); outline-offset: -2px; }
.cal-cell.sel { background: var(--surface-2); border-color: var(--volt); }
.cal-cell:not(.empty):hover { background: var(--surface-2); }
.cal-num { font-size: 0.8rem; font-weight: 800; align-self: flex-end; padding-right: 2px; }
.cal-markers { display: flex; flex-wrap: wrap; gap: 1px; justify-content: center; align-items: center; flex: 1; font-size: 0.7rem; line-height: 1; }
.cm-miss { color: var(--muted-2); font-size: 1.1rem; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 14px 2px; font-size: 0.74rem; color: var(--muted); }
.cal-legend .lg-dot { letter-spacing: 1px; }
.day-detail { margin-top: 14px; }
.dd-date { font-weight: 850; font-size: 1.12rem; text-transform: capitalize; margin-bottom: 12px; letter-spacing: -0.02em; }
.dd-line { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.dd-lbl { color: var(--muted); font-weight: 700; }
.dd-section { margin-top: 14px; }
.dd-h { font-weight: 800; font-size: 0.92rem; margin-bottom: 7px; }
.dd-ex { display: flex; justify-content: space-between; gap: 10px; font-size: 0.86rem; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.dd-ex:last-child { border-bottom: none; }
.dd-sets { color: var(--muted); text-align: right; }
.dd-habits { display: flex; flex-wrap: wrap; gap: 6px; }
.dd-habit { font-size: 0.76rem; font-weight: 700; padding: 5px 10px; border-radius: 20px; background: var(--bg-2); }
.dd-habit.on { background: rgba(61, 214, 140, 0.16); color: var(--good); }
.dd-habit.off { color: var(--muted-2); }
.dd-target { margin-top: 8px; }
.dd-note { width: 100%; min-height: 84px; resize: vertical; font-size: 0.9rem; }
.dd-note-saved { font-size: 0.76rem; color: var(--good); font-weight: 800; height: 16px; opacity: 0; transition: opacity 0.3s; margin-top: 4px; }
.dd-note-saved.show { opacity: 1; }

/* ------------------------------------------------------------------ library */
.lib-day { margin-bottom: 20px; }
.lib-day h3 { font-size: 1.05rem; padding-bottom: 6px; border-bottom: 2px solid var(--volt); display: inline-block; margin-bottom: 10px; font-weight: 850; letter-spacing: -0.02em; }
.lib-ex { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 14px; margin-bottom: 8px; }
.lib-ex-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lib-ex-name { font-weight: 750; }
.tag { font-size: 0.66rem; font-weight: 800; padding: 3px 9px; border-radius: 20px; background: var(--bg-2); color: var(--muted); white-space: nowrap; text-transform: uppercase; letter-spacing: 0.03em; }
.lib-cue { font-size: 0.84rem; color: var(--muted); margin-top: 6px; }
.data-card .muted { margin-top: 0; }

/* ------------------------------------------------------------------ motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 420px) {
  .nutri-grid { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  #view { padding: 18px 12px 100px; }
}
