:root {
  --bg: #09090B; --card: #131316; --card2: #1B1B1F; --line: #1F1F24; --line2: #2A2A30;
  --text: #FAFAFA; --text2: #A1A1AA; --text3: #8B8B94; --icon: #71717A; --circle: #6B6B74;
  --lime: #C8F25A; --lime-bg: #1E2410; --lime-row: rgba(200, 242, 90, .07);
  --amber: #F5B74E; --amber-bg: #241E10; --red: #F87171; --red-bg: #2A1414;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font-size: 15px; line-height: 1.35; -webkit-font-smoothing: antialiased; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text2); } .muted3 { color: var(--text3); }
.lime { color: var(--lime); } .amber { color: var(--amber); }
.hidden { display: none !important; }

#app { position: fixed; inset: 0; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; }
#view { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(var(--safe-t) + 18px) 20px calc(var(--safe-b) + 124px); display: flex; flex-direction: column; gap: 16px; scrollbar-width: none; }
#view::-webkit-scrollbar, .sheet-body::-webkit-scrollbar { display: none; }
#view > *, .sheet-body > * { flex-shrink: 0; }
#view.has-rest { padding-bottom: calc(var(--safe-b) + 196px); }

/* Kop */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding-top: 6px; }
.head-sub { font-size: 13px; font-weight: 500; color: var(--text3); }
.h1 { font-size: 34px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; }
.h1.sm { font-size: 30px; }
.caps { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 4px; }
.sec-head .sub { font-size: 13px; color: var(--text2); }
.head-actions { display: flex; gap: 8px; align-items: center; }

/* Kaarten */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
.card.lg { border-radius: 24px; }
.card.clip { overflow: hidden; }
.pad { padding: 18px; } .pad-l { padding: 20px; }
.stack { display: flex; flex-direction: column; } .gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; } .gap14 { gap: 14px; } .gap16 { gap: 16px; } .gap18 { gap: 18px; }
.rowflex { display: flex; align-items: center; gap: 12px; } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; } .grow { flex: 1 1 auto; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sep { height: 1px; background: var(--line); margin-left: 56px; }
.sep.full { margin-left: 0; } .sep.m16 { margin-left: 16px; }
.icon-box { width: 34px; height: 34px; border-radius: 10px; background: var(--card2); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.icon-box.sm { width: 28px; height: 28px; border-radius: 8px; }
.icon-box.amber { background: var(--amber-bg); } .icon-box.lime { background: var(--lime-bg); }
.big { font-size: 48px; font-weight: 700; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.val { font-size: 28px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.unit { font-size: 14px; color: var(--text2); font-weight: 400; letter-spacing: 0; }
.t12 { font-size: 12px; } .t13 { font-size: 13px; } .t14 { font-size: 14px; } .t15 { font-size: 15px; } .t17 { font-size: 17px; } .t20 { font-size: 20px; } .t22 { font-size: 22px; }
.w500 { font-weight: 500; } .w600 { font-weight: 600; } .w700 { font-weight: 700; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; text-align: left; color: var(--text); width: 100%; }
.cell { background: var(--card2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }

/* Rijen en vinkjes */
.row { width: 100%; display: flex; align-items: center; gap: 14px; padding: 0 16px; min-height: 58px; background: transparent; border: 0; color: var(--text); text-align: left; }
.row .lines { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px 0; }
.row .name { font-size: 15px; font-weight: 500; }
.row .name.dim { color: var(--text2); }
.row .sub { font-size: 12px; color: var(--text3); }
.row.cur { background: var(--card2); }
.row-wrap { display: flex; align-items: center; }
.row-wrap .row { flex: 1 1 auto; min-width: 0; }
.row-wrap .info-btn { margin-right: 6px; }
.lrow { position: relative; display: flex; align-items: center; }
.lrow + .lrow::before { content: ''; position: absolute; top: 0; left: 64px; right: 0; height: 1px; background: var(--line); }
.lrow.cur { background: var(--card2); }
.lrow .row { flex: 1 1 auto; min-width: 0; }
.check { width: 26px; height: 26px; border-radius: 999px; border: 1.5px solid var(--circle); flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.check.on { background: var(--lime); border-color: var(--lime); }
.streak { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text3); font-variant-numeric: tabular-nums; }
.info-btn { width: 44px; height: 44px; margin-right: -10px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; color: var(--text3); }
.cat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px; }
.cat-head h2 { flex: 1 1 auto; font-size: 15px; font-weight: 600; }

/* Knoppen */
.btn { min-height: 50px; border-radius: 14px; border: 0; background: var(--text); color: var(--bg); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; text-decoration: none; white-space: nowrap; }
.btn.block { width: 100%; }
.btn.outline { background: transparent; color: var(--text); border: 1px solid var(--line2); }
.btn.lime { background: var(--lime); color: var(--bg); }
.btn.danger { background: var(--red); color: var(--bg); }
.btn.ghost-danger { background: transparent; color: var(--red); border: 1px solid #3A1F1F; }
.btn.sm { min-height: 44px; border-radius: 999px; font-size: 13px; padding: 0 16px; }
.btn:disabled { opacity: .4; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--card2); font-size: 12px; color: #D4D4D8; }
.chip.lime { background: var(--lime-bg); color: var(--lime); font-weight: 600; }
.chip.amber { background: var(--amber-bg); color: var(--amber); font-weight: 600; }
.chip-btn { white-space: nowrap; flex: 0 0 auto; min-height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: #D4D4D8; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.pill { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.icon-btn { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); display: flex; align-items: center; justify-content: center; color: var(--text); flex: 0 0 auto; }
.icon-btn-spacer { width: 44px; flex: 0 0 auto; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.seg button { min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--text2); font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--text); color: var(--bg); }

/* Weekstrip */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.week .d { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.week .l { font-size: 11px; font-weight: 500; color: var(--text3); }
.week .n { width: 38px; height: 38px; border-radius: 999px; border: 1.5px solid transparent; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.week .today .n { border-color: var(--text); background: var(--card2); }
.week .today .l { color: var(--text); }
.week .future .n { color: var(--text3); }
.week .bar, .bar { height: 3px; border-radius: 2px; background: #26262B; display: flex; overflow: hidden; }
.week .bar { width: 22px; }
.bar > span { height: 100%; border-radius: 2px; background: var(--lime); }
.bar.h4 { height: 4px; } .bar.h6 { height: 6px; border-radius: 3px; background: var(--line); } .bar.h8 { height: 8px; border-radius: 4px; background: var(--line); }
.segs { display: flex; gap: 3px; flex: 1 1 auto; }
.segs span { flex: 1 1 0; height: 5px; border-radius: 3px; background: #2A2A30; }
.segs span.on { background: var(--lime); }

/* Meldingen */
.alert { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; min-height: 64px; width: 100%; background: transparent; border: 0; text-align: left; color: var(--text); text-decoration: none; }
.alert .lines { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alert .t { font-size: 14px; font-weight: 600; } .alert .s { font-size: 12px; color: var(--text2); line-height: 1.4; }
.score-btns { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding: 0 14px 14px; }
.score-btns button { min-height: 44px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card2); font-weight: 700; font-size: 16px; }

/* Training */
.set-grid { display: grid; grid-template-columns: 30px minmax(0, 1fr) 70px 58px 44px; gap: 8px; align-items: center; padding: 4px; border-radius: 14px; }
.set-grid.headrow { font-size: 11px; font-weight: 500; color: var(--text3); padding-top: 0; padding-bottom: 0; }
.set-grid.done { background: var(--lime-row); }
.set-in { width: 100%; height: 42px; border-radius: 10px; border: 1px solid transparent; background: var(--card2); text-align: center; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); padding: 0 4px; }
.set-in:focus { outline: none; border-color: var(--line2); }
.set-in::placeholder { color: #6B6B74; font-weight: 500; }
.set-check { width: 44px; height: 44px; border: 0; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; }
.box-check { width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--circle); display: flex; align-items: center; justify-content: center; }
.box-check.on { background: var(--lime); border-color: var(--lime); }
.badge { width: 34px; height: 34px; border-radius: 10px; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: 0 0 auto; }
.badge.cur { background: var(--text); color: var(--bg); }
.badge.done { background: var(--lime); }
.ex-row { touch-action: pan-y; }
.ex-row.dragging { position: relative; z-index: 3; background: var(--card2); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.drag-handle { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; touch-action: none; margin-right: -10px; }
.note-box { padding: 12px 14px; border-radius: 14px; background: var(--card2); font-size: 13px; color: var(--text2); line-height: 1.45; }

/* Zwevend */
#floating { position: absolute; left: 16px; right: 16px; bottom: calc(var(--safe-b) + 90px); z-index: 20; pointer-events: none; }
#floating > * { pointer-events: auto; }
.glass { background: rgba(24, 24, 28, .88); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.rest { height: 66px; border-radius: 22px; padding: 0 8px 0 18px; display: flex; align-items: center; gap: 8px; }
.rest .mini { min-height: 44px; min-width: 44px; padding: 0 10px; border-radius: 999px; border: 1px solid #3F3F46; background: transparent; color: var(--text); font-size: 13px; font-weight: 600; }

#tabbar { position: absolute; left: 16px; right: 16px; bottom: calc(var(--safe-b) + 12px); height: 64px; padding: 6px; border-radius: 32px; display: flex; align-items: center; gap: 4px; z-index: 30; }
#tabbar button { flex: 1 1 0; height: 52px; border-radius: 26px; border: 0; background: transparent; color: var(--text3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; }
#tabbar button.on { background: rgba(255, 255, 255, .09); color: var(--text); font-weight: 600; }
#tabbar button.on svg { stroke: var(--lime); }

/* Sheets */
#sheet-root .sheet { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; animation: up .22s ease-out; }
#sheet-root .sheet.no-anim, .no-anim .dialog { animation: none; }
@keyframes up { from { transform: translateY(28px); } to { transform: none; } }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: calc(var(--safe-t) + 10px) 16px 10px; }
.sheet-title { flex: 1 1 auto; text-align: center; font-size: 17px; font-weight: 600; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 20px calc(var(--safe-b) + 32px); display: flex; flex-direction: column; gap: 16px; scrollbar-width: none; }
.sheet-foot { padding: 12px 20px calc(var(--safe-b) + 14px); border-top: 1px solid var(--line); background: var(--bg); display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1 1 0; }
.dialog-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px calc(var(--safe-b) + 16px); }
.dialog { width: 100%; max-width: 488px; background: var(--card); border: 1px solid var(--line2); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 10px; animation: up .2s ease-out; }
.dialog-title { font-size: 17px; font-weight: 700; } .dialog-text { font-size: 14px; color: var(--text2); line-height: 1.45; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }

/* Formulieren */
.field { width: 100%; min-height: 50px; border-radius: 14px; border: 1px solid var(--line2); background: var(--card2); padding: 0 14px; font-size: 17px; color: var(--text); }
.field:focus { outline: none; border-color: #4A4A52; }
textarea.field { min-height: 120px; padding: 12px 14px; line-height: 1.45; resize: vertical; }
select.field { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8B8B94 50%), linear-gradient(135deg, #8B8B94 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 15px) 22px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.label { font-size: 13px; color: var(--text2); margin-bottom: 6px; display: block; }
.big-input { font-size: 40px; font-weight: 700; text-align: center; min-height: 76px; letter-spacing: -.02em; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick button { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card2); font-weight: 600; font-variant-numeric: tabular-nums; }
.quick button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.days-pick { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.days-pick button { min-height: 44px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card2); font-weight: 600; font-size: 13px; color: var(--text2); }
.days-pick button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.lr { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.lr .side { font-size: 14px; font-weight: 600; color: var(--text2); }

/* Grafieken */
.chart { width: 100%; height: auto; display: block; }
.heat { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.heat span { height: 38px; border-radius: 9px; }
.legend { display: flex; justify-content: flex-end; align-items: center; gap: 6px; font-size: 11px; color: var(--text3); }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* Foto's */
.photos4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ph { display: flex; flex-direction: column; gap: 6px; }
.ph .img { aspect-ratio: 3 / 4; border-radius: 12px; background: var(--card2); border: 1px solid #232328; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph .cap { font-size: 11px; color: var(--text2); text-align: center; line-height: 1.3; }
.photo-slot { display: flex; flex-direction: column; gap: 8px; }
.photo-slot label { aspect-ratio: 3 / 4; border-radius: 16px; background: var(--card2); border: 1px dashed #3A3A42; display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; overflow: hidden; color: var(--text3); font-size: 13px; cursor: pointer; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 170px); transform: translateX(-50%) translateY(20px); opacity: 0; transition: .25s; z-index: 80; background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; pointer-events: none; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Startmoment */
.onb { min-height: 100%; display: flex; flex-direction: column; gap: 18px; padding-top: 24px; }
.onb .logo { width: 64px; height: 64px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.onb .lead { font-size: 16px; color: var(--text2); line-height: 1.5; }
.steps-dots { display: flex; gap: 6px; }
.steps-dots span { height: 4px; flex: 1 1 0; border-radius: 2px; background: var(--line2); }
.steps-dots span.on { background: var(--lime); }
.bullets { display: flex; flex-direction: column; gap: 12px; }
.bullets .b { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--text2); line-height: 1.45; }
.bullets .b b { color: var(--text); font-weight: 600; }
.bullets .b svg { flex: 0 0 auto; margin-top: 1px; }
