:root {
  --bg: #f4f3ef;
  --card: #ffffff;
  --ink: #1d1d1b;
  --muted: #6b6a64;
  --line: #e2e0d8;
  --accent: #d6461f;
  --accent-ink: #ffffff;
  --ok: #2e7d4f;
  --warn: #b7791f;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --card: #1f1f1d;
    --ink: #efede6;
    --muted: #a19f97;
    --line: #34332f;
    --accent: #ff6a3d;
    --accent-ink: #141413;
    --ok: #5fc48a;
    --warn: #e5b04d;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 60px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
h1 { font-size: 1.6rem; margin: 0 0 6px; }
h2 { font-size: 1.15rem; margin: 0; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 200px; min-width: 0; }
input[type=text], input[type=password] {
  width: 100%; font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button, .btn {
  font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 12px 16px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.ok { background: var(--ok); color: #fff; }
button.small, .btn.small { padding: 7px 11px; font-size: .875rem; }
button:disabled { opacity: .5; cursor: default; }
.btn.big { width: 100%; padding: 18px; font-size: 1.1rem; }
.pill { font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.pill.pending { color: var(--warn); border-color: var(--warn); }
.pill.approved { color: var(--ok); border-color: var(--ok); }
.pill.rejected { color: var(--muted); }
ul.people { list-style: none; padding: 0; margin: 12px 0 0; }
ul.people li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
ul.people li .name { font-weight: 600; flex: 1 1 120px; overflow-wrap: anywhere; }
.qr { background: #fff; padding: 10px; border-radius: 10px; display: inline-block; line-height: 0; }
.qr img, .qr svg { width: 160px; height: 160px; image-rendering: pixelated; }
.link { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; overflow-wrap: anywhere; color: var(--muted); }
.error { color: var(--accent); font-weight: 600; min-height: 1.2em; }
.hidden { display: none !important; }
details summary { cursor: pointer; font-weight: 600; }
.steps { padding-left: 1.2em; margin: 8px 0 0; }
.steps li { margin-bottom: 6px; }
.spinner { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: .75rem; padding: 2px 8px; font-weight: 700; }

.power-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--line); flex: 0 0 auto; }
.power-dot.on { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); }
.power-dot.busy { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }
.power-dot.off { background: var(--muted); }
.power-dot.err { background: var(--accent); }
@keyframes pulse { 50% { opacity: .35; } }

.badge.admin { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); margin-left: 8px; font-size: .75rem; }

.chanbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.chan { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: .8125rem; font-weight: 600; }
.chan.all { background: var(--line); color: var(--muted); }
.chanx { background: none; border: 0; color: inherit; font-size: 1rem; line-height: 1; padding: 0 0 0 2px; cursor: pointer; min-height: 0; }
.chantoggle { font-size: .75rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); min-height: 0; }
.chantoggle.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

.people li > .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--line); }
.people li > .dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.presence { font-size: .75rem; color: var(--muted); }
.presence.on { color: var(--ok); font-weight: 600; }
.badge.live { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); margin-left: 6px; }

/* tweede regel per deelnemer */
ul.people li .mline { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-left: 19px; }
ul.people li .mline .macts { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
@media (max-width: 480px) { ul.people li .mline .macts { margin-left: 0; flex-basis: 100%; } }


/* groepsnaam = knop die de instellingen openklapt; crewlijst staat erboven */
.gtitle { background: none; border: 0; padding: 0; color: inherit; cursor: pointer; text-align: left; }
.gtitle h2 { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.gtitle .chev { font-size: .8em; opacity: .6; transition: transform .15s; display: inline-block; }
.gtitle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.gsettings { margin: 12px 0 4px; padding: 14px; border-radius: 12px; border: 1px solid rgba(127,127,127,.25); background: rgba(127,127,127,.06); }

/* beheerpagina voor een crewlid dat beheerder is: alleen de eigen groep, geen serverinstellingen */
body.crewbeheer .card.power, body.crewbeheer #updateBar, body.crewbeheer #wifiCard, body.crewbeheer #berylCard,
body.crewbeheer #newCard, body.crewbeheer #logout, body.crewbeheer #versionLine { display: none !important; }
