@font-face { font-family: "Space Grotesk"; font-weight: 500; font-display: swap; src: url(/fonts/space-grotesk-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 600; font-display: swap; src: url(/fonts/space-grotesk-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-display: swap; src: url(/fonts/space-grotesk-latin-700-normal.woff2) format("woff2"); }
:root {
  --bg: #121016; --bg2: #19161f; --card: #211d29; --card2: #2a2533; --ink: #f1ece4; --muted: #a39cae; --line: #36303f;
  --gold: #c9a45c; --red: #9b3b3b; --teal: #6fa59b; --yes: #3f7d5c; --no: #c0504d; --yesText: var(--yesText); --errc: var(--errc);
  --scheme: dark; --head: "Space Grotesk", system-ui, sans-serif; --radius: 14px;
}
:root[data-theme="light"] {
  --bg: #f6f2ea; --bg2: #efe9de; --card: #fffdf9; --card2: #f2ece1; --ink: #231f2a; --muted: #6d6678; --line: #d9d0c2;
  --gold: #a67f2f; --red: #9b3b3b; --teal: #3f7f75; --yes: #2f7d55; --no: #b3403c; --yesText: #2f7d55; --errc: #b3342a; --scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 500 16px/1.45 "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.grow { flex: 1; }
i[data-ic], .ic { display: inline-flex; width: 1.15em; height: 1.15em; vertical-align: -.2em; }
i[data-ic] svg, .ic svg { width: 100%; height: 100%; }
.av { width: 100%; height: 100%; display: block; }
.pp { display: inline-block; width: 28px; height: 28px; flex: none; border-radius: 50%; }
.pp.s { width: 24px; height: 24px; }
.pp.l { width: 40px; height: 40px; }
.pp.guest { outline: 2px dashed var(--muted); outline-offset: -2px; }
.pp.fade { opacity: .38; }

/* header */
header.top { background: var(--bg2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; padding-top: env(safe-area-inset-top); }
header.top .bar { max-width: 640px; margin: 0 auto; padding: 6px 14px; display: flex; align-items: center; gap: 8px; }
.brand-logo { width: 44px; height: 44px; object-fit: contain; flex: none; }
header h1 { margin: 0; font: 700 24px/1 var(--head); letter-spacing: .2px; flex: 1; }
header h1 span { color: var(--gold); }
.me { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--gold); background: var(--card); padding: 0; cursor: pointer; display: grid; place-items: center; color: var(--gold); }
.me .pp { width: 100%; height: 100%; }
main { max-width: 640px; margin: 0 auto; padding: 10px 12px calc(96px + env(safe-area-inset-bottom)); }

/* onderbalk */
nav.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--bg2); border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); }
nav.bottom button { flex: 1; max-width: 120px; background: none; border: 0; color: var(--muted); padding: 8px 2px 6px; cursor: pointer; display: grid; justify-items: center; gap: 1px; font: 600 11px "Space Grotesk", system-ui; }
nav.bottom button i { width: 26px; height: 26px; }
nav.bottom button[aria-selected="true"] { color: var(--gold); }
nav.bottom button.plus { flex: none; width: 58px; height: 58px; max-width: none; margin: -18px 6px 0; padding: 0; border-radius: 50%; background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(155,59,59,.45); place-items: center; }
nav.bottom button.plus i { width: 30px; height: 30px; }

/* trainingsrij */
.ws { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 8px 0; display: grid; gap: 8px; }
.ws.best { border-color: var(--gold); }
.r1 { display: flex; align-items: center; gap: 10px; }
.datebox { flex: 0 0 48px; text-align: center; border-radius: 10px; background: var(--bg); padding: 3px 0 4px; border: 1px solid var(--line); line-height: 1; }
.datebox .w, .datebox .m { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; display: block; padding: 1px 0; }
.datebox .d { font: 700 22px/1.05 var(--head); color: var(--gold); display: block; }
.ws-main { flex: 1; min-width: 0; }
.ws-title { margin: 0; font: 600 17px/1.2 var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-meta { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.ws-meta span { display: inline-flex; align-items: center; gap: 3px; }
.rsvp { display: flex; gap: 6px; flex: none; }
.rb { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg2); color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; }
.rb i { width: 22px; height: 22px; }
.rb.on.y { background: var(--yes); border-color: var(--yes); color: #fff; }
.rb.on.n { background: var(--no); border-color: var(--no); color: #fff; }
.r2 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 30px; }
.r2 .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
.trainer { display: inline-flex; align-items: center; gap: 4px; background: none; border: 1.5px dashed var(--line); border-radius: 999px; padding: 2px 8px 2px 6px; color: var(--gold); cursor: pointer; }
.trainer.has { border-style: solid; border-color: var(--gold); }
.trainer .none { color: var(--muted); font-size: 12px; }
.mini { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); background: none; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; padding: 0; }
.mini i { width: 16px; height: 16px; }
.mini.gold { color: var(--gold); border-color: var(--gold); }
.who { display: inline-flex; flex-wrap: wrap; align-items: center; }
.who .pp { margin-right: -6px; box-shadow: 0 0 0 2px var(--card); }
.who .pp.self { box-shadow: 0 0 0 2px var(--gold); position: relative; }
.cnt { font: 600 13px "Space Grotesk", system-ui; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; margin-left: 10px; }
.cnt i { width: 15px; height: 15px; }
.cnt.y { color: var(--yesText); }
.note { font-size: 13px; color: #dcd5ec; display: flex; gap: 6px; align-items: flex-start; }
.empty { text-align: center; color: var(--muted); padding: 40px 12px; }
.empty .big { font-size: 40px; }

/* algemene blokken */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 8px 0; }
h2.section { font: 600 17px var(--head); margin: 20px 4px 2px; display: flex; align-items: center; gap: 6px; color: var(--gold); }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0; }
.people { display: flex; flex-wrap: wrap; gap: 10px; }
.tile { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; }
.tile .pp { width: 48px; height: 48px; display: block; }
.tile.add { width: 48px; height: 48px; border: 2px dashed var(--muted); color: var(--muted); display: grid; place-items: center; }
.tile.add i { width: 24px; height: 24px; }
.btn { border: 0; border-radius: 12px; padding: 10px 16px; font: 600 15px "Space Grotesk", system-ui; cursor: pointer; background: var(--red); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.icon-only { padding: 10px 12px; color: var(--errc); }
.btn.small { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; padding: 4px; display: inline-flex; align-items: center; gap: 4px; }
table.stats { width: 100%; border-collapse: collapse; font-size: 14px; }
table.stats th, table.stats td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.stats th { color: var(--muted); font-weight: 600; }
table.stats th i { width: 18px; height: 18px; }
table.stats .n { text-align: center; font-variant-numeric: tabular-nums; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
details.card summary { cursor: pointer; font: 600 15px var(--head); }
.loglist { margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.loglist li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.loglist b { color: var(--ink); }
.foot { margin-top: 22px; display: flex; gap: 14px; flex-wrap: wrap; }

/* formulieren */
.stack { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-size: 14px; font-weight: 700; }
input, select, textarea { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg2); width: 100%; color-scheme: var(--scheme); }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; }
.err { color: var(--errc); font-size: 14px; min-height: 1.2em; }
dialog { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100% - 20px)); background: var(--card); color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.55); max-height: 92vh; }
dialog::backdrop { background: rgba(10,8,24,.65); }
dialog .inner { padding: 18px; }
dialog h3 { margin: 0; font: 600 21px var(--head); display: flex; align-items: center; gap: 8px; }
.dlg-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.slot { display: grid; gap: 6px; }

/* lid-dialoog */
.mprev { display: flex; align-items: flex-end; gap: 14px; }
.mprev #mPreview .pp { width: 64px; height: 64px; display: block; }
.mprev label { flex: 1; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; padding: 0; }
.sw-own { position: relative; display: inline-flex; align-items: center; justify-content: center; background: conic-gradient(#e2543a, #f6c453, #5fb36a, #3b9bd9, #8a5cd0, #e2543a); color: #fff; font-weight: 700; font-size: 18px; overflow: hidden; }
.sw-own.set span { display: none; }
.sw-own input { position: absolute; inset: -8px; width: 60px; height: 60px; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.sw[aria-checked="true"] { border-color: #fff; box-shadow: 0 0 0 2px var(--card) inset; }
.avscroll { max-height: 38vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--bg2); }
.avscroll h4 { margin: 8px 0 6px; font: 600 12px var(--head); text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.avscroll h4:first-child { margin-top: 0; }
.avgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.avo { background: none; border: 3px solid transparent; border-radius: 50%; padding: 2px; cursor: pointer; aspect-ratio: 1; display: block; }
.avo[aria-pressed="true"] { border-color: var(--gold); }
.avo.txt { display: grid; place-items: center; font: 700 12px var(--head); color: var(--muted); border-radius: 12px; aspect-ratio: auto; grid-column: span 5; padding: 8px; border: 2px dashed var(--line); }
.avo.txt[aria-pressed="true"] { border-color: var(--gold); color: var(--ink); }

/* help */
.legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
.legend li { display: flex; align-items: center; gap: 10px; }
.lg { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); display: inline-grid; place-items: center; color: var(--gold); }
.lg.ok { background: var(--yes); border-color: var(--yes); color: #fff; }
.lg.no { background: var(--no); border-color: var(--no); color: #fff; }
.lg i { width: 18px; height: 18px; }
.legend li .lg + * { }

.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #fff; color: #1d1a24; padding: 10px 16px; border-radius: 999px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; pointer-events: auto; }
.toast .link { color: #b3302a; font-weight: 700; }

/* login */
#login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); text-align: center; }
.login-logo { width: 140px; height: 140px; object-fit: contain; display: block; margin: 0 auto 2px; }
.login-card h1 { font: 700 34px var(--head); margin: 0 0 4px; }
.login-card form { display: grid; gap: 12px; margin-top: 18px; text-align: left; }

/* opening */
#splash { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; transition: opacity .5s; }
#splash.out { opacity: 0; pointer-events: none; }
#logo3d { width: min(100%, 640px); height: 56vh; opacity: 0; }
.sp-tap { font-size: 12px; color: var(--muted); opacity: 0; margin-top: 8px; }
.curtain { position: absolute; top: 0; bottom: 0; width: 51%; z-index: 2; background: repeating-linear-gradient(90deg, #b3302a 0 26px, #9c2822 26px 38px); box-shadow: inset 0 -30px 40px rgba(0,0,0,.35); }
.curtain.l { left: 0; border-right: 2px solid #5a1410; }
.curtain.r { right: 0; border-left: 2px solid #5a1410; }
#splash.go .curtain.l { transform: translateX(-102%); transition: transform 1.2s cubic-bezier(.7,0,.2,1) .3s; }
#splash.go .curtain.r { transform: translateX(102%); transition: transform 1.2s cubic-bezier(.7,0,.2,1) .3s; }
#splash.go #logo3d { opacity: 1; transition: opacity .8s 1s; }
#splash.go .sp-tap { opacity: 1; transition: opacity .6s 1.8s; }
@media (prefers-reduced-motion: reduce) { #splash { display: none !important; } }

.tl { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mini.s { width: 22px; height: 22px; border-color: transparent; flex: none; }
.mini.s i, .mini.s .ic { width: 14px; height: 14px; }
table.stats td .pp { vertical-align: middle; margin-right: 6px; }
.brand-logo { width: 56px; height: 44px; }

.install { display: flex; align-items: center; gap: 12px; border-color: var(--gold); }
.install img { border-radius: 12px; flex: none; }
.install .hint { margin: 2px 0 0; }

/* jij-knop rechtsboven */
.me { width: auto; height: 42px; border-radius: 999px; padding: 0 10px 0 3px; gap: 4px; display: inline-flex; align-items: center; border: 2px solid var(--gold); background: var(--card); color: var(--ink); cursor: pointer; }
.me .pp { width: 34px; height: 34px; }
.me .chev { width: 16px; height: 16px; color: var(--gold); }
.me.none { padding: 0 12px; font: 600 14px "Space Grotesk", system-ui; color: var(--gold); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 30%, transparent); } }
/* je keuze: kleur + tekst */
.mine { display: inline-flex; align-items: center; gap: 4px; font: 600 12px "Space Grotesk", system-ui; padding: 1px 8px 1px 5px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--muted); }
.mine .ic { width: 14px; height: 14px; }
.mine.y { background: var(--yes); border-color: var(--yes); color: #fff; }
.mine.n { background: var(--no); border-color: var(--no); color: #fff; }
.mine.q { border-style: dashed; color: var(--gold); border-color: var(--gold); animation: pulse 1.8s ease-in-out infinite; }
.rb.dim { opacity: .4; }
.rb.on { box-shadow: inset 0 0 0 3px var(--card); }
.themebox { display: grid; gap: 6px; }
.seg { display: flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { flex: 1; background: none; border: 0; padding: 9px 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 14px "Space Grotesk", system-ui; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--gold); color: #16131c; }
.seg button i { width: 18px; height: 18px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; opacity: 0; }
.ws { cursor: pointer; }
.ws button { cursor: pointer; }
.pl { display: flex; flex-wrap: wrap; gap: 10px 8px; }
.pc { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 56px; font: 600 12px var(--head); color: var(--ink); background: none; border: 0; padding: 0; }
.pc .pp { width: 48px; height: 48px; display: block; }
.pc.g .pp { outline: 2px dashed var(--muted); outline-offset: -2px; }
.tile.lbl { display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 10px; font: 600 12px var(--head); color: var(--ink); width: 56px; }
#detailBody .dh { display: flex; gap: 12px; align-items: center; }
#detailBody .dh .datebox { flex: none; }
#detailBody h4 { margin: 16px 0 8px; font: 600 13px var(--head); color: var(--muted); display: flex; align-items: center; gap: 6px; text-transform: uppercase; letter-spacing: .04em; }
#detailBody h4 i { width: 16px; height: 16px; }
#detailBody .none { color: var(--muted); font-size: 14px; }
#detailBody .rsvp { display: flex; gap: 8px; margin-top: 14px; }
.rb.y { color: var(--yes); border-color: var(--yes); }
.rb.n { color: var(--no); border-color: var(--no); }
.rb.on.y, .rb.on.n { color: #fff; }
.rb.dim { opacity: .6; }

.rb { flex: none; box-sizing: border-box; }
.rb.dim { opacity: .75; }
.me .meini { font: 700 15px "Space Grotesk", system-ui; letter-spacing: .3px; }

.mecur { display: flex; align-items: center; gap: 12px; font: 700 22px var(--head); }
.mecur .pp { width: 56px; height: 56px; display: block; }

#detailBody h4 .add { margin-left: auto; width: 28px; height: 28px; border-color: var(--gold); color: var(--gold); }
#detailBody h4 .add i { width: 16px; height: 16px; }
#detailBody .dlg-actions { flex-wrap: wrap; gap: 8px; }

#detailBody .dtop { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
#detailBody .dtop .hint { font-size: 13px; color: var(--muted); }
.dform { display: grid; gap: 10px; }
.dform label { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.dform input, .dform select, .dform textarea { font: 500 18px var(--head); color: var(--ink); background: var(--bg2); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; width: 100%; box-sizing: border-box; min-height: 44px; }
.dform textarea { font-size: 16px; font-weight: 400; }
.dform input.dtitle { font-size: 24px; font-weight: 600; background: none; border: 0; border-bottom: 2px dashed var(--line); border-radius: 0; padding: 4px 0 6px; }
.dform .dgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.dform .dtimes { display: flex; align-items: flex-end; gap: 8px; }
.dform .dtimes label { flex: 1; }
.dform .dtimes input { font-size: 28px; text-align: center; min-height: 56px; }
.dform .dtimes .arrow { width: 20px; height: 20px; color: var(--muted); margin-bottom: 18px; transform: rotate(-90deg); }
.btn.danger { color: var(--errc); }
#detailBody .dlg-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
#detailBody .dlg-actions .grow { flex: 1; }
.dform { grid-template-columns: minmax(0, 1fr); }
.dform label, .dform .dgrid > *, .dform .dtimes > label { min-width: 0; }
.dform .dtimes input { font-size: 22px; padding: 6px 4px; }
#detailDialog { overflow: hidden; }
#detailDialog .inner { max-height: 90vh; max-height: 90dvh; overflow-y: auto; overflow-x: hidden; padding-bottom: 0; }
#detailBody .dlg-actions { position: sticky; bottom: 0; background: var(--card); padding: 12px 0 14px; margin-top: 12px; border-top: 1px solid var(--line); }
.dform .dgrid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.dform input[type="date"], .dform select { font-size: 16px; padding: 8px; }
.dform .dtimes input { font-size: 18px; }
.dform input, .dform select { min-width: 0; max-width: 100%; }
#detailBody .dlg-actions { flex-wrap: nowrap; }
