:root {
  --bg: #0a0c0f; --surface: #12161b; --surface-2: #181d24; --line: #262d37;
  --text: #eef2f6; --muted: #93a0b0;
  --accent: #c8ff3d; --accent-ink: #0a0c0f; --accent-soft: rgba(200, 255, 61, .09);
  --accent-2: #ff6a3d; --blue: #4cc9f0; --danger: #ff6b6b;
  --r: 14px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', Impact, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; }
h1, h2 { font-family: var(--display); text-transform: uppercase; letter-spacing: .01em; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 780px; }
.is-hidden { display: none !important; }
.print-only { display: none; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* header / footer */
.site-header { border-bottom: 1px solid var(--line); background: rgba(10, 12, 15, .85); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.7rem; letter-spacing: .04em; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
.site-footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 24px 0; color: var(--muted); font-size: .85rem; }

/* buttons */
.btn { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 12px 22px; font-weight: 600; transition: transform .1s, background .15s, border-color .15s; }
.btn:hover { border-color: #3a4552; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: #d6ff6b; }
.btn.ghost { background: transparent; }
.btn.lg { padding: 16px 32px; font-size: 1.05rem; }
.btn.sm { padding: 7px 14px; font-size: .85rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* hero */
#hero { background: radial-gradient(900px 400px at 75% -10%, rgba(200, 255, 61, .14), transparent 60%), radial-gradient(700px 400px at 0% 20%, rgba(255, 106, 61, .08), transparent 60%); }
.hero-inner { padding: 72px 16px 40px; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 12px; }
#hero h1 { font-size: clamp(2.8rem, 8vw, 5.4rem); max-width: 14ch; }
#hero h1 em { font-style: normal; color: var(--accent); }
.lead { color: var(--muted); font-size: 1.15rem; max-width: 56ch; margin: 22px 0 30px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.features { list-style: none; padding: 0; margin: 56px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.features li { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 18px; }
.features b { display: block; margin-bottom: 4px; }
.features span { color: var(--muted); font-size: .92rem; }

/* wizard */
#wizard { padding: 36px 0 0; }
.progress { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.progress-track { flex: 1; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
#progress-bar { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
#progress-label { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.wizard-card h2 { font-size: 2.2rem; }
.wizard-card h3 { margin: 28px 0 12px; }
.sub { color: var(--muted); margin: 8px 0 24px; }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 18px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.opt { text-align: left; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, background .15s; }
.opt strong { font-size: 1rem; }
.opt span { color: var(--muted); font-size: .88rem; line-height: 1.4; }
.opt:hover { border-color: #3a4552; }
.opt.is-sel { border-color: var(--accent); background: var(--accent-soft); }
.tag { display: inline-block; min-width: 1.5em; color: var(--accent); }
.pills, .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pill, .chip { background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 20px; font-weight: 600; }
.pill.is-sel, .chip.is-sel { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip { padding: 8px 16px; }
.fields { margin-top: 18px; }
.fields.one { grid-template-columns: minmax(0, 1fr); max-width: 320px; margin-top: 20px; }
.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.input { display: flex; align-items: center; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px; }
.input:focus-within { border-color: var(--accent); }
.input input { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); font: inherit; font-size: 1.25rem; font-weight: 600; padding: 12px 0; outline: none; }
.input em { font-style: normal; color: var(--muted); }
.errors p { color: var(--danger); font-size: .92rem; margin-top: 10px; }
.errors:not(:empty) { margin-top: 18px; }

/* results */
#results { padding: 36px 0 0; }
.res-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; }
.res-head h2 { font-size: clamp(2.4rem, 6vw, 3.6rem); }
.tabs { display: flex; gap: 6px; overflow-x: auto; position: sticky; top: 60px; z-index: 10; background: var(--bg); padding: 10px 0; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; border-radius: 999px; padding: 9px 18px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tab.is-sel { background: var(--accent); color: var(--accent-ink); }
.tab-panel > * + * { margin-top: 16px; }
.notice { border: 1px solid var(--line); background: var(--surface); border-left: 3px solid var(--accent); border-radius: 10px; padding: 12px 16px; font-size: .92rem; }
.notice.warn { border-left-color: var(--accent-2); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; }
.stat span { color: var(--muted); font-size: .82rem; }
.stat b { font-family: var(--display); font-size: 2.6rem; line-height: 1.05; font-weight: 700; }
.stat em { font-style: normal; color: var(--muted); font-size: .85rem; }
.stat.hl { border-color: var(--accent); background: var(--accent-soft); }
.stat.hl b { color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1.25fr; gap: 16px; }
.card h3 { margin-bottom: 14px; }
.macro-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 14px; }
.donut { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.donut > div { width: 108px; height: 108px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut b { font-family: var(--display); font-size: 1.8rem; line-height: 1; }
.donut span { color: var(--muted); font-size: .78rem; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 180px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto 44px; gap: 10px; align-items: center; padding: 6px 0; }
.legend i { width: 12px; height: 12px; border-radius: 4px; }
.legend b { white-space: nowrap; }
.legend em { font-style: normal; color: var(--muted); text-align: right; font-size: .85rem; }
.big-line { display: flex; flex-direction: column; margin-bottom: 8px; }
.big-line b { font-family: var(--display); font-size: 1.9rem; color: var(--accent); }
.big-line span { color: var(--muted); font-size: .9rem; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 13px; }
.chart .chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.chart .target-line { stroke: var(--accent-2); stroke-dasharray: 5 5; }
.chart .dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.tips { margin: 0; padding-left: 20px; }
.tips li { margin: 8px 0; }
.disclaimer { padding-top: 6px; }

/* eating */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.day-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 14px; }
.day-head h3 { font-family: var(--display); font-size: 1.8rem; text-transform: uppercase; margin: 0; }
.day-total { color: var(--muted); font-size: .9rem; }
.day-total b { color: var(--text); }
.day-total .ok { color: var(--accent); }
.day-total .off { color: var(--accent-2); }
.meals { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.meal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.meal header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.slot { color: var(--accent); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.meal h4 { font-size: 1.05rem; margin-top: 3px; line-height: 1.25; font-weight: 700; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; font-size: .8rem; }
.badges b { background: var(--accent); color: var(--accent-ink); padding: 2px 10px; border-radius: 99px; }
.badges span { background: var(--surface-2); border: 1px solid var(--line); padding: 2px 10px; border-radius: 99px; color: var(--muted); }
.ing { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.ing li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.ing li:last-child { border-bottom: 0; }
.ing li span { display: inline-block; min-width: 68px; color: var(--accent); font-weight: 600; }
.note { color: var(--muted); font-size: .85rem; }

/* training */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.wk { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 6px; text-align: center; opacity: .6; }
.wk.on { opacity: 1; border-color: var(--accent); background: var(--accent-soft); }
.wk span { display: block; color: var(--muted); font-size: .75rem; font-weight: 600; }
.wk b { font-size: .8rem; line-height: 1.2; display: block; margin-top: 2px; }
.sessions { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.session header { margin-bottom: 12px; }
.session h3 { font-family: var(--display); font-size: 1.7rem; text-transform: uppercase; margin: 2px 0 0; }
.ex-row { display: grid; grid-template-columns: 1fr 46px 96px 96px; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; font-size: .92rem; }
.ex-row.head { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; padding-top: 0; }
.ex-row:last-child { border-bottom: 0; }
.ex-row i { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 10px; border-radius: 50%; background: var(--surface-2); color: var(--accent); font-style: normal; font-size: .75rem; font-weight: 700; }
.ex-row .rest { color: var(--muted); }

/* grocery */
.groc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.groc ul { list-style: none; margin: 0; padding: 0; }
.groc label { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.groc input { width: 18px; height: 18px; accent-color: var(--accent); }
.groc .qty { color: var(--accent); font-weight: 600; font-size: .9rem; }
.groc input:checked ~ .nm, .groc input:checked ~ .qty { text-decoration: line-through; opacity: .45; }

/* responsive */
@media (max-width: 800px) {
  .g3, .g4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two { grid-template-columns: 1fr; }
  .sessions { grid-template-columns: 1fr; }
  .hero-inner { padding-top: 44px; }
}
@media (max-width: 520px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .wk b { font-size: .65rem; }
  .ex-row { grid-template-columns: 1fr 40px 84px; }
  .ex-row .rest { display: none; }
  .meals, .groc-grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
}

/* print / PDF */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .is-hidden { display: block !important; }
  .no-print, .site-header, .site-footer, .tabs, .toolbar, .swap, .actions { display: none !important; }
  #hero, #wizard { display: none !important; }
  .print-only { display: block; }
  .print-title { font-family: var(--display); font-size: 22pt; font-weight: 800; margin-bottom: 10px; }
  .container { max-width: none; padding: 0; }
  #results { padding: 0; }
  .res-head { margin-bottom: 8px; }
  .card, .stat, .meal, .notice, .features li, .wk { background: #fff !important; border-color: #ccc !important; color: #111; }
  .muted, .note, .stat span, .stat em, .day-total, .legend em, .ex-row .rest, .big-line span { color: #555 !important; }
  .stat.hl b, .big-line b, .slot, .ing li span, .groc .qty, .tag, .day-total .ok { color: #3f6a00 !important; }
  .badges b { background: #e6f5c8; color: #111; }
  .badges span { background: #fff; border-color: #ccc; color: #444; }
  .day-total b { color: #111; }
  .donut > div { background: #fff; }
  .chart .axis { fill: #555; }
  .chart .chart-line { stroke: #3f6a00; }
  .chart .grid-line { stroke: #ddd; }
  .chart .dot { fill: #3f6a00; stroke: #fff; }
  .wk { opacity: 1; }
  .tab-panel { break-before: page; }
  #panel-overzicht { break-before: auto; }
  .day-panel, .session, .groc, .meal, .card, .stats { break-inside: avoid; }
  .day-panel { break-before: page; margin-top: 0; }
  #panel-eten .day-panel:first-of-type { break-before: auto; }
  .meals { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .meal { padding: 10px; gap: 6px; }
  .groc input:checked ~ .nm, .groc input:checked ~ .qty { text-decoration: none; opacity: 1; }
  .sessions { grid-template-columns: 1fr; }
}


/* =========================================================
   v2: account, dialogen, tracker, recepten, PWA
   ========================================================= */
.no-server .needs-server { display: none !important; }
.bar { gap: 12px; }
.bar-right { display: flex; align-items: center; gap: 8px; }
.account-nav { display: flex; gap: 8px; align-items: center; }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 1.5rem; line-height: 1; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translate(-50%, 30px); background: var(--accent); color: var(--accent-ink); font-weight: 600; padding: 12px 20px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.offline-bar { background: var(--accent-2); color: #0a0c0f; text-align: center; padding: 8px 16px; font-size: .88rem; font-weight: 600; }
.ios-hint { margin-top: 6px; }

/* dialogen */
.dlg { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 24px; width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.dlg.wide { width: min(760px, calc(100vw - 24px)); padding: 0; position: relative; }
.dlg::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(3px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dlg-head h3 { font-family: var(--display); font-size: 1.8rem; text-transform: uppercase; margin: 0; }
.dlg-x { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(10, 12, 15, .6); }
.dlg form > * + * { margin-top: 14px; }
.btn.block { display: block; width: 100%; }
.stack { display: grid; gap: 10px; margin-top: 16px; }
.alt { text-align: center; color: var(--muted); font-size: .9rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.form-error { color: var(--danger); font-size: .9rem; min-height: 0; }
.form-error:empty { display: none; }
.form-error.ok { color: var(--accent); }
.btn.danger { color: var(--danger); border-color: rgba(255, 107, 107, .4); }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #0a0c0f; }
#delete-box { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

/* recept */
.recipe-art { aspect-ratio: 16 / 7; background: var(--surface-2); overflow: hidden; border-radius: 18px 18px 0 0; }
.recipe-art img, .recipe-art .art { width: 100%; height: 100%; object-fit: cover; display: block; }
.recipe-main { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 12px; }
.recipe-main h3 { font-family: var(--display); font-size: 2.2rem; text-transform: uppercase; margin: 0; }
.recipe-cols { display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px; margin-top: 8px; }
.recipe-cols h4 { font-size: 1rem; margin-bottom: 8px; }
.recipe-cols h4 small { color: var(--muted); font-weight: 400; }
.steps { margin: 0; padding-left: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 12px 38px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .85rem; display: grid; place-items: center; }
.badges .tagc { border-color: rgba(200, 255, 61, .4); color: var(--accent); }
.card-actions { display: flex; gap: 6px; flex: none; }
.daytype { font-family: var(--font); font-size: .8rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; margin-left: 8px; vertical-align: middle; }
.daytype.train { color: var(--accent); border-color: rgba(200, 255, 61, .4); }
.meal header h4 { padding-right: 4px; }

/* tracker */
.cta-card p { color: var(--muted); max-width: 60ch; margin-bottom: 16px; }
.two.even { grid-template-columns: 1fr 1fr; align-items: start; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.inline-form .input input { font-size: 1.05rem; padding: 10px 0; }
.inline-form .btn { height: 48px; }
.pr-form { grid-template-columns: 1fr 1fr; }
.pr-form .field.wide { grid-column: 1 / -1; }
.pr-form .btn { grid-column: 1 / -1; }
.small-stats { margin: 14px 0; grid-template-columns: repeat(3, 1fr); }
.small-stats .stat b { font-size: 2rem; }
.small-stats .stat em { font-size: .75rem; }
.log { list-style: none; padding: 0; margin: 14px 0 0; }
.log li { display: grid; grid-template-columns: 62px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.log li span { color: var(--muted); }
.sub-h { margin: 18px 0 0; font-size: .9rem; color: var(--muted); }
.pr-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .92rem; align-items: center; }
.pr-row.head { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; padding-top: 0; }
.pr-row small { display: block; color: var(--muted); font-size: .75rem; }
.pr-row .e1 { color: var(--accent); font-weight: 700; }
.notice .link { margin-left: 6px; }

@media (max-width: 800px) {
  .two.even { grid-template-columns: 1fr; }
  .recipe-cols { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 520px) {
  .hide-sm { display: none !important; }
  .inline-form { grid-template-columns: 1fr 1fr; }
  .inline-form .btn { grid-column: 1 / -1; }
  .small-stats { grid-template-columns: 1fr; }
  .card-actions { flex-direction: column; }
  .bar-right { gap: 6px; }
  .recipe-main { padding: 18px; }
  .recipe-main h3 { font-size: 1.8rem; }
}
@media print {
  .card-actions, .toast, .offline-bar, #panel-voortgang { display: none !important; }
  .daytype { border-color: #ccc; color: #555 !important; }
}

.badges .warnb { background: rgba(255, 106, 61, .15); border: 1px solid var(--accent-2); color: var(--accent-2); font-weight: 600; }
@media print { .badges .warnb { background: #fff; color: #b33; border-color: #b33; } }
