:root {
  --bg: #f4f2ed; --surface: #ffffff; --text: #141413; --muted: #6b6a65; --border: #dcd9d2; --fill: #141413; --on-fill: #ffffff; --critical: #b23b32; --ok: #2e7d32; --warn-bg: #fff3c4; --warn-text: #5c4600; --inset: #ece9e2;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000000; --surface: #222120; --text: #f1efea; --muted: #a09d96; --border: #3a3836; --fill: #f1efea; --on-fill: #141413; --critical: #ff8a80; --ok: #7bd88f; --warn-bg: #3d3300; --warn-text: #ffe58a; --inset: #1a1918; }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body, system-ui, sans-serif); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
#app { min-height: 100%; }
h1, h2, h3 { font-family: var(--font-display, system-ui, sans-serif); letter-spacing: -.02em; margin: 0; }
[hidden] { display: none !important; }
.logo { display: block; height: 56px; margin: 0 auto 24px; }
.logo--dark { display: none; }
@media (prefers-color-scheme: dark) { .logo--light { display: none; } .logo--dark { display: block; } }
/* Twee logo's naast elkaar: Glas-Bender Visuals | organisator */
.brand { display: flex; align-items: center; gap: 18px; min-width: 0; }
.brand .logo { margin: 0; flex: 0 1 auto; min-width: 0; object-fit: contain; }
.brand__sep { flex: none; width: 1px; align-self: stretch; min-height: 28px; background: var(--border); }
.box .brand { justify-content: center; margin: 0 auto 24px; }
.box .brand .logo { height: 52px; max-width: 46%; width: auto; }

/* Inloggen, aanmelden */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.box { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px 24px; }
.box h1 { font-size: 1.4rem; font-weight: 800; text-align: center; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 14px; text-align: center; margin: 0 0 20px; }
.hint--small { font-size: 12px; margin: 10px 0 14px; }
.field { display: block; margin: 0 0 12px; }
.field__l { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 4px 14px; }
.field__row { display: flex; align-items: center; gap: 0; position: relative; }
.field__row .inp { margin: 0; padding-right: 76px; }
.field__tog { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; padding: 8px 10px; }
.inp { width: 100%; height: 46px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); color: var(--text); font: inherit; font-size: 16px; outline: none; margin-bottom: 12px; }
.field .inp { margin-bottom: 0; }
.inp:focus { border-color: var(--text); }
.inp--code { text-align: center; letter-spacing: .4em; font-size: 22px; font-weight: 700; }
.btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 46px; border-radius: 999px; border: 1px solid var(--fill); background: var(--fill); color: var(--on-fill); font-family: var(--font-display, system-ui, sans-serif); font-weight: 700; font-size: 14px; letter-spacing: .02em; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); width: auto; padding: 0 16px; height: 36px; font-size: 13px; }
.btn--sm { width: auto; height: 36px; padding: 0 16px; font-size: 13px; }
.btn--link { margin-top: 4px; }
.link { background: none; border: 0; padding: 4px; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.row-links { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 12px; }
.center { text-align: center; margin: 10px 0 0; }
.msg { min-height: 20px; margin: 12px 0; font-size: 13px; text-align: center; color: var(--muted); }
.msg--err { color: var(--critical); }
.msg--ok { color: var(--ok); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choices--col { grid-template-columns: 1fr; }
.choice { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); color: var(--text); font: inherit; cursor: pointer; }
.choice b { font-family: var(--font-display, system-ui, sans-serif); font-size: 14px; }
.choice span { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.choice:hover, .choice[aria-pressed="true"] { border-color: var(--text); }
.choice[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--text); }
@media (max-width: 420px) { .choices { grid-template-columns: 1fr; } }

/* Verplichte 2FA-popup */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.modal__box { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px 22px; }
.modal__box h2 { font-size: 1.25rem; font-weight: 800; text-align: center; margin-bottom: 6px; }
.qr { display: flex; justify-content: center; margin: 4px 0 8px; }
.qr svg { width: 200px; height: 200px; border-radius: 10px; }
.secret { display: block; margin-top: 4px; font-family: var(--font-mono, ui-monospace, monospace); font-size: 13px; color: var(--text); word-break: break-all; }

/* Bovenbalk met huisstijl: logo links, titel (event) gecentreerd, rechts de gebruiker, accountmenu en uitloggen */
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--surface); flex: none; min-height: 84px; }
.top__brand { display: flex; align-items: center; gap: 14px; min-width: 0; justify-self: start; }
.top .logo { height: 52px; width: auto; max-width: 280px; margin: 0; object-fit: contain; flex: none; }
.top__title { min-width: 0; max-width: 46vw; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.top__title h1 { font-size: 1.35rem; font-weight: 800; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__sub { color: var(--muted); font-size: 13px; white-space: nowrap; }
.top__right { display: flex; align-items: center; gap: 12px; justify-self: end; flex: none; }
.top__who { font-size: 13px; color: var(--muted); white-space: nowrap; }
.top__acct { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--inset); color: var(--text); font-family: var(--font-display, system-ui, sans-serif); font-weight: 800; font-size: 13px; letter-spacing: .02em; cursor: pointer; flex: none; }
.top__acct:hover, .top__acct[aria-expanded="true"] { border-color: var(--text); }
.top__menu { display: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 18px; cursor: pointer; flex: none; }
.page { max-width: 880px; margin: 0 auto; padding: 28px 16px 48px; }
.page h1 { font-size: clamp(1.3rem, 4vw, 1.9rem); font-weight: 800; }
.sub { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.pick { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; max-width: 560px; }
.pick__a { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 20px; color: var(--text); text-decoration: none; }
.pick__a:hover { border-color: var(--text); }
.pick small { display: block; color: var(--muted); }
.mockbar { background: var(--warn-bg); color: var(--warn-text); font-size: 13px; padding: 7px 16px; text-align: center; flex: none; }
.mockbar b { letter-spacing: .08em; margin-right: 6px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.card h2 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }

/* Eventscherm: de pagina zelf scrolt niet; tijdlijn (vast), foto's (scrollt) en rechts uploaden + details zijn drie kolommen over de volle breedte */
#app.is-event { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.ev3 { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr) 340px; gap: 16px; padding: 16px 20px; }
.side, .gridcol, .rightcol { min-height: 0; }

/* Tijdlijn: opgebouwd zoals de zijbalk bij Contacten in /admin (titel + zoeken, groepen, ingesprongen items met aantal rechts) */
.side { overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 12px; display: flex; flex-direction: column; }
.vnav__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; padding-left: 12px; }
.vnav__title { font-family: var(--font-display, system-ui, sans-serif); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); flex: none; }
.vnav__search { flex: 1 1 0; min-width: 0; max-width: 150px; height: 32px; font-size: 12px; margin: 0; padding: 0 12px; }
.tl2 { display: flex; flex-direction: column; gap: 4px; }
.tl2__item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 6px 12px; text-align: left; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.tl2__item:hover { background: var(--inset); color: var(--text); }
.tl2__item.is-active { background: var(--fill); color: var(--on-fill); }
.tl2__all { font-weight: 700; color: var(--text); }
.tl2__all.is-active { color: var(--on-fill); }
.tl2__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl2__item small { flex: none; font-size: 11px; font-weight: 600; opacity: .7; margin-left: auto; font-variant-numeric: tabular-nums; }
.tl2__t { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.tl2__item.is-active .tl2__t { color: inherit; }
.tl2__sep { flex: none; opacity: .4; }
.tl2__dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.tl2__item.is-active .tl2__dot { background: currentColor; }
.tl2__day { margin-top: 14px; }
.tl2__date { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 4px 12px; padding-right: 12px; font-family: var(--font-display, system-ui, sans-serif); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tl2__date small { font-weight: 600; letter-spacing: 0; text-transform: none; opacity: .8; }
.tl2__subs { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px 18px; padding-left: 10px; border-left: 1px solid var(--border); }
.tl2__subs .tl2__item { min-height: 36px; padding: 4px 12px; font-size: 13px; }
.tl2__none { margin: 8px 12px; color: var(--muted); font-size: 13px; }
.side__user { display: none; margin-top: auto; padding: 12px 12px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; align-items: center; justify-content: space-between; gap: 10px; }

/* Foto's: alleen dit vak scrolt; de viewer ligt erover (en dimt dus alleen dit vak) */
.gridcol { position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.gridcol__bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 18px 10px; flex: none; }
.gridcol__t h2 { font-size: 1.1rem; font-weight: 800; }
.gridscroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.ph { margin: 0; }
.ph__img { display: block; width: 100%; padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; background: var(--inset); cursor: pointer; aspect-ratio: 3 / 2; box-shadow: 0 0 0 1px var(--border); }
.ph__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ph.is-selected .ph__img { border-color: var(--text); }
.ph figcaption { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); padding: 4px 4px 0; font-variant-numeric: tabular-nums; }
.ph__own { color: var(--ok); }
.mup { display: none; }
.viewer { position: absolute; inset: 0; z-index: 5; background: rgba(6, 6, 6, .8); -webkit-backdrop-filter: blur(14px) saturate(.7); backdrop-filter: blur(14px) saturate(.7); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 64px 16px; gap: 10px; overflow-y: auto; }
.viewer[hidden] { display: none; }
.viewer__stage { position: relative; flex: 1; min-height: 0; width: 100%; }
/* Eén afbeelding die het vak vult (object-fit: contain), zonder animatie of overgang. */
.viewer__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.viewer__wait { position: absolute; inset: 0; display: grid; place-items: center; color: #a09d96; font-size: 13px; pointer-events: none; }
.viewer__cap { color: #e8e6e1; font-size: 13px; flex: none; }
.viewer__acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; flex: none; }
.viewer__acts .btn { width: auto; }
.viewer__acts .btn { background: #f1efea; color: #141413; border-color: #f1efea; }
.viewer__acts .btn--ghost { background: transparent; color: #f1efea; border-color: #6b6a65; }
.viewer__lock { color: #a09d96; font-size: 13px; }
.viewer__x { position: absolute; top: 10px; right: 14px; background: none; border: 0; color: #fff; font-size: 34px; cursor: pointer; line-height: 1; z-index: 2; }
.viewer__n { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); border: 0; color: #fff; font-size: 30px; width: 44px; height: 64px; border-radius: 10px; cursor: pointer; z-index: 2; }
.viewer__n--p { left: 10px; } .viewer__n--n { right: 10px; }
.viewer__details { display: none; width: 100%; max-width: 520px; color: #e8e6e1; font-size: 13px; }

/* Rechts: uploadvak (ongeveer twee miniaturen hoog) en details */
.rightcol { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.dz { flex: none; height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 16px; border: 2px dashed var(--border); border-radius: 16px; background: var(--surface); color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.dz b { color: var(--text); font-family: var(--font-display, system-ui, sans-serif); font-size: 15px; }
.dz small { margin-top: 6px; font-size: 11.5px; opacity: .8; }
.dz__icon { font-size: 34px; line-height: 1; color: var(--text); opacity: .7; margin-bottom: 4px; }
.dz:hover, .dz:focus-visible, .dz.is-over { border-color: var(--text); background: var(--inset); outline: none; }
.dz--off { cursor: default; opacity: .65; }
.dz--off:hover { border-color: var(--border); background: var(--surface); }
.det { flex: 1 1 auto; min-height: 0; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; }   /* loopt door tot onderaan, gelijk met de grid */
.det .card { border: 0; padding: 0; background: none; }
.det__list { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 14px; font-size: 13px; }
.det__list dt { color: var(--muted); }
.det__list dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.det__list dd.det__fname { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; }
.det__note, .det__loading { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.viewer__details .det__list dt { color: #a09d96; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--fill); color: var(--on-fill); padding: 10px 18px; border-radius: 999px; font-size: 13px; z-index: 120; max-width: calc(100vw - 32px); text-align: center; }
.scrim { display: none; }

/* Smalle schermen: tijdlijn als lade, uploaden als knop boven de foto's, details in de viewer */
@media (max-width: 1100px) {
  .ev3 { grid-template-columns: 300px minmax(0, 1fr); }
  .rightcol { display: none; }
  .mup { display: inline-flex; }
  .viewer__details { display: block; }
  .viewer__stage { flex: 1 0 58%; }   /* de foto houdt minstens 58% van de hoogte; de details staan eronder (scrollen) */
}
@media (max-width: 820px) {
  .top { grid-template-columns: auto minmax(0, 1fr) auto; padding: 8px 12px; gap: 8px; min-height: 60px; }
  .top .logo { height: 34px; max-width: 110px; }
  .brand { gap: 10px; }
  .brand__sep { min-height: 22px; }
  .top .brand .logo { height: 28px; max-width: 80px; }
  .top__title { max-width: none; }
  .top__title h1 { font-size: 1rem; }
  .top__sub, .top__who { display: none; }
  .chips { padding: 0 12px 8px; }
  .top__menu { display: inline-grid; place-items: center; }
  .top__right .btn { height: 34px; padding: 0 12px; font-size: 12px; }
  .ev3 { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(340px, 88vw); z-index: 60; border-radius: 0 16px 16px 0; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 12px 32px rgba(0,0,0,.45); }
  .side.is-open { transform: none; }
  .side__user { display: flex; }
  #app.is-event .top__who, #app.is-event .top__logout { display: none; }
  .scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.5); }
  .scrim.is-open { display: block; }
  .gridcol__bar { padding: 12px 12px 8px; flex-wrap: wrap; }
  .gridscroll { padding: 4px 12px 14px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
  .viewer { padding: 52px 12px 12px; }
  .viewer__n { width: 36px; height: 52px; font-size: 24px; }
}

/* Filter op fotograaf */
.chips { display: flex; gap: 8px; padding: 0 18px 10px; flex: none; overflow-x: auto; scrollbar-width: thin; }
.chips[hidden] { display: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; flex: none; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip small { font-size: 11px; font-weight: 700; opacity: .7; font-variant-numeric: tabular-nums; }
.chip:hover { color: var(--text); border-color: var(--text); }
.chip.is-on { background: var(--fill); color: var(--on-fill); border-color: var(--fill); }

/* Accountmenu en dialogen */
.menu { position: fixed; z-index: 90; min-width: 240px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 8px; box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.menu__head { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 1px; border-bottom: 1px solid var(--border); margin-bottom: 6px; min-width: 0; }
.menu__head b { font-family: var(--font-display, system-ui, sans-serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu__head span, .menu__head small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu__i { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.menu__i:hover, .menu__i:focus-visible { background: var(--inset); outline: none; }
.menu__i--danger { color: var(--critical); }
.menu__sep { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.modal__x { position: absolute; top: 10px; right: 14px; background: none; border: 0; color: var(--muted); font-size: 28px; line-height: 1; cursor: pointer; }
.modal__box { position: relative; }
.modal__h3 { font-size: .95rem; font-weight: 700; margin: 4px 0; }
.btn--danger { background: var(--critical); border-color: var(--critical); color: #fff; }

.menu__i--wa { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; text-decoration: none; }
.menu__i--wa small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.det__disclaimer { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.viewer__details .det__disclaimer { border-top-color: #4a4846; color: #a09d96; }

/* Foto's die je niet zelf hebt geüpload: geen lang-indrukken-menu, geen selecteren of slepen van de afbeelding (de klik om te bekijken blijft werken) */
.ph.is-locked img, .viewer__img.is-locked { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
