/* cka-log: een vriendelijke community voor één leerling. */

@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree/files/figtree-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 300 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage-grotesque/files/bricolage-grotesque-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono/files/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 800; font-style: normal; font-display: swap;
}

:root {
  --k8s: #326ce5;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage", "Figtree", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --pill: 999px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

[data-theme="dark"] {
  --bg: #131a28;
  --surface: #1b2335;
  --surface-2: #232d43;
  --surface-3: #2c3852;
  --line: #2a3550;
  --line-2: #38466a;
  --text: #edf1f8;
  --text-2: #b9c3d6;
  --muted: #8592ab;
  --accent: #5b8cf2;
  --accent-strong: #326ce5;
  --accent-soft: rgba(91, 140, 242, .16);
  --on-accent: #ffffff;
  --focus: #8fb1ff;
  --code-bg: #141b2a;
  --term-bg: #0c1220;
  --shadow: 0 12px 40px rgba(3, 8, 20, .45);
  --banner-mix: 26%;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #eef2f8;
  --surface: #ffffff;
  --surface-2: #f2f5fa;
  --surface-3: #e5eaf3;
  --line: #e0e6f0;
  --line-2: #cbd4e3;
  --text: #182236;
  --text-2: #3e4a62;
  --muted: #687691;
  --accent: #326ce5;
  --accent-strong: #2557c4;
  --accent-soft: rgba(50, 108, 229, .1);
  --on-accent: #ffffff;
  --focus: #326ce5;
  --code-bg: #f4f7fc;
  --term-bg: #0f1626;
  --shadow: 0 12px 40px rgba(24, 34, 54, .14);
  --banner-mix: 18%;
  color-scheme: light;
}

/* Kleuren per community (CKA-domein) en per flair. */
.c-troubleshooting { --c: #f0545c; }
.c-cluster { --c: #4d86f0; }
.c-networking { --c: #1fb5c9; }
.c-workloads { --c: #9b7bf7; }
.c-storage { --c: #f5a524; }
.c-linux { --c: #3fbf7f; }
.c-containers { --c: #e46fb2; }
.c-algemeen { --c: #8b95a7; }
.c-home { --c: #326ce5; }
.f-geleerd { --f: #3fbf7f; }
.f-vraag { --f: #4d86f0; }
.f-vastgelopen { --f: #f0545c; }
.f-lab { --f: #9b7bf7; }
.f-examenvraag { --f: #f5a524; }
.u1 { --u: #f0545c; } .u2 { --u: #f58a4b; } .u3 { --u: #e8b021; } .u4 { --u: #7cc44f; } .u5 { --u: #2fb86b; }

* { box-sizing: border-box; }
html { scroll-padding-top: 80px; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 24px; height: 24px; }
kbd {
  font: 500 11px var(--mono); min-width: 20px; text-align: center;
  padding: 1px 6px; border-radius: 6px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-2); border-bottom-width: 2px;
}
::selection { background: var(--accent-strong); color: #fff; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent-strong); color: #fff; padding: 8px 14px; border-radius: var(--pill); }
.skip:focus { left: 8px; }

/* ---------------- topbar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; flex: none; width: 236px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--k8s); color: #fff; font-size: 22px; line-height: 1;
  transition: transform .7s var(--ease);
}
.logo:hover .logo-mark { transform: rotate(180deg); }
.logo-word { font: 700 21px/1 var(--display); letter-spacing: -.03em; }
.search {
  flex: 1; max-width: 560px; margin: 0 auto; height: 40px;
  display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px;
  background: var(--surface-2); border: 1px solid transparent; border-radius: var(--pill);
  color: var(--muted); cursor: text; transition: border-color .15s, background .15s;
}
.search:hover { border-color: var(--line-2); }
.search:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: 15px var(--font); }
.search input::placeholder { color: var(--muted); }
.search-icon { display: flex; }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--pill);
  font: 650 14px var(--font); white-space: nowrap; cursor: pointer;
  border: 1px solid transparent; background: var(--surface-2); color: var(--text);
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent-strong); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent-strong) 85%, #fff); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-outline { background: transparent; border-color: var(--line-2); }
.btn-outline:hover { border-color: var(--text-2); background: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-danger:hover { color: #f0545c; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer; transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.menu-btn { display: none; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font: 750 12px var(--font); letter-spacing: -.02em;
  background: var(--uc, #326ce5); color: #fff;
  background-image: linear-gradient(140deg, rgba(255,255,255,.22), rgba(0,0,0,.12));
}
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.md { width: 40px; height: 40px; font-size: 14px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar.xl { width: 76px; height: 76px; font-size: 26px; border: 4px solid var(--surface); margin-top: -44px; align-self: flex-start; }

/* Community-avatar: gekleurde cirkel met domeinicoon. */
.cav {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--c); color: #fff;
}
.cav svg.i { width: 14px; height: 14px; stroke-width: 2.25; }
.cav.md { width: 32px; height: 32px; } .cav.md svg.i { width: 18px; height: 18px; }
.cav.xl { width: 76px; height: 76px; border: 4px solid var(--surface); } .cav.xl svg.i { width: 38px; height: 38px; stroke-width: 2; }

/* ---------------- shell ----------------
   [ menu vast links | feed (max 740) + zijkolom, samen gecentreerd ] */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.content {
  display: grid; grid-template-columns: minmax(0, 740px) 316px; justify-content: center;
  gap: 24px; padding: 20px 24px 48px; min-width: 0;
}
main { min-width: 0; outline: none; }
.rail { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; scrollbar-width: thin; }

/* left nav */
.leftnav {
  position: sticky; top: 60px; align-self: start; height: calc(100vh - 60px); overflow-y: auto;
  padding: 16px 16px 24px; background: var(--surface); border-right: 1px solid var(--line); scrollbar-width: thin;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 14px; font-weight: 500;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-3); color: var(--text); font-weight: 650; }
.nav-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-item .weight { font-size: 11.5px; font-weight: 650; color: var(--muted); background: var(--surface-2); padding: 1px 7px; border-radius: var(--pill); }
.nav-item.active .weight { background: var(--surface); }
.nav-sep { height: 1px; background: var(--line); margin: 14px 12px; }
.nav-head { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 4px 12px 6px; }
.nav-fdot { width: 10px; height: 10px; border-radius: 50%; background: var(--f); margin: 0 7px; flex: none; }

/* ---------------- banner ---------------- */
.banner { margin-bottom: 16px; }
.banner-band {
  height: 92px; border-radius: var(--r);
  background-color: color-mix(in srgb, var(--c) var(--banner-mix), var(--surface));
  background-size: 88px 88px;
}
.banner-row { display: flex; align-items: center; gap: 16px; padding: 10px 16px 0; }
.banner-row > .cav.xl { margin-top: -44px; align-self: flex-start; }
.banner-row h1 { font: 750 28px/1.1 var(--display); letter-spacing: -.025em; margin: 0 0 4px; }
.banner-row .sub { color: var(--muted); font-size: 14px; margin: 0; }
.banner-row .grow { flex: 1; min-width: 0; }
.banner-row .btn { flex: none; }

/* ---------------- composer + sort ---------------- */
.composer {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px;
}
.composer-input {
  flex: 1; height: 40px; display: flex; align-items: center; padding: 0 16px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--pill);
  color: var(--muted); font-size: 14.5px; cursor: text;
}
.composer-input:hover { border-color: var(--accent); background: var(--surface); }
.composer .icon-btn { width: 36px; height: 36px; color: var(--muted); }
.composer .icon-btn:hover { color: var(--f, var(--text)); }

.sortbar { display: flex; align-items: center; gap: 4px; margin: 4px 0 12px; flex-wrap: wrap; }
.sorts { display: flex; gap: 4px; }
.sort {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--pill);
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.sort:hover { background: var(--surface-2); color: var(--text); }
.sort.active { background: var(--surface-3); color: var(--text); }
.sortbar .spacer { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 12px;
  border-radius: var(--pill); background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600;
}
.chip .x { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; }
.chip:hover .x { background: var(--accent); color: #fff; }

/* ---------------- post card ---------------- */
.post {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 16px 10px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s;
}
.post:hover { border-color: var(--line-2); }
.post.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.post-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.post-meta .comm { font-weight: 700; color: var(--text); }
.post-meta .comm:hover { text-decoration: underline; }
.post-meta .dot::before { content: "•"; }
.post-meta .key { margin-left: auto; font: 500 12px var(--mono); color: var(--muted); }
.post h3 { font: 650 19px/1.3 var(--display); letter-spacing: -.012em; margin: 8px 0 6px; }
.post.solved h3 { color: var(--text-2); }
.post .excerpt {
  margin: 0 0 10px; color: var(--text-2); font-size: 14.5px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.flairs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }

.flair {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: var(--pill);
  font-size: 12.5px; font-weight: 650; white-space: nowrap;
  background: color-mix(in srgb, var(--f) 18%, transparent); color: color-mix(in srgb, var(--f) 80%, var(--text));
}
.flair svg.i { width: 14px; height: 14px; }
.status {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--pill);
  font-size: 12.5px; font-weight: 600; border: 1px solid var(--line-2); color: var(--text-2);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--s); }
.s-nieuw { --s: #5b8cf2; } .s-in_behandeling { --s: #e8b021; } .s-opgelost { --s: #2fb86b; } .s-heropend { --s: #9b7bf7; }
.prio-hoog { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: #f0545c; }
.prio-laag { font-size: 12.5px; color: var(--muted); }

.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.act {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--pill);
  background: var(--surface-2); border: 0; font-size: 13px; font-weight: 650; color: var(--text-2); cursor: pointer;
}
.act:hover { background: var(--surface-3); color: var(--text); }
.vote { display: inline-flex; align-items: center; height: 32px; border-radius: var(--pill); background: var(--surface-2); }
.vote button {
  width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--text-2);
  display: grid; place-items: center; cursor: pointer;
}
.vote button:hover:not(:disabled) { background: var(--surface-3); color: var(--accent); }
.vote button.down:hover:not(:disabled) { color: #f58a4b; }
.vote button:disabled { opacity: .3; cursor: default; }
.vote .n { min-width: 14px; text-align: center; font-weight: 750; font-size: 14px; color: var(--u); font-variant-numeric: tabular-nums; }
.vote .lbl { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 2px 0 4px; }
.tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 13px; font-weight: 600; color: var(--accent); }
.tag:hover { text-decoration: underline; }

/* ---------------- empty state ---------------- */
.empty {
  text-align: center; padding: 56px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.empty .big { font-size: 56px; line-height: 1; color: var(--k8s); display: inline-block; margin-bottom: 12px; }
.empty h2 { font: 700 22px var(--display); margin: 0 0 6px; letter-spacing: -.02em; }
.empty p { color: var(--text-2); margin: 0 auto 18px; max-width: 42ch; }

/* ---------------- rail cards ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; overflow: hidden; }
.card-head { padding: 14px 16px 0; display: flex; align-items: center; gap: 10px; }
.card-head h2 { font: 700 15px var(--display); letter-spacing: -.01em; margin: 0; flex: 1; }
.card-body { padding: 10px 16px 16px; font-size: 14px; color: var(--text-2); }
.card-body p { margin: 0 0 12px; }
.card-band { height: 34px; background-color: color-mix(in srgb, var(--c) var(--banner-mix), var(--surface)); background-size: 64px 64px; }
.stats { display: flex; gap: 20px; margin: 4px 0 14px; }
.stats div { display: flex; flex-direction: column; }
.stats b { font: 750 18px var(--display); color: var(--text); font-variant-numeric: tabular-nums; }
.stats span { font-size: 12.5px; color: var(--muted); }
.card .btn { width: 100%; }
.card-divider { height: 1px; background: var(--line); margin: 12px 0; }

.radar-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 4px 10px; align-items: center; padding: 6px 0; }
.radar-row .nm { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radar-row .w { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.radar-row .bar { grid-column: 2 / 4; height: 6px; border-radius: var(--pill); background: var(--surface-3); overflow: hidden; }
.radar-row .bar i { display: block; height: 100%; border-radius: inherit; background: var(--c); transition: width .6s var(--ease); }
.radar-total { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.radar-total b { font: 800 30px var(--display); color: var(--text); letter-spacing: -.03em; }
.radar-total span { font-size: 13px; color: var(--muted); }

.keys-mini { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; font-size: 13.5px; }

/* ---------------- examendomeinen ---------------- */
.cav.lg { width: 48px; height: 48px; } .cav.lg svg.i { width: 24px; height: 24px; }
.weightbar-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 16px; }
.weightbar { display: flex; gap: 4px; height: 76px; }
.seg-part {
  border: 0; font: inherit; text-align: left; cursor: pointer;
  min-width: 0; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; justify-content: space-between;
  background: var(--c); color: #fff; overflow: hidden; transition: filter .15s;
}
.seg-part:hover { filter: brightness(1.12); }
.seg-part b { font: 800 22px/1 var(--display); letter-spacing: -.03em; }
.seg-part span { font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .95; }
.weightbar-note { margin: 12px 0 0; font-size: 14px; color: var(--text-2); }
.weightbar-note b { color: var(--text); }

.domain { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px 8px; margin-bottom: 12px; scroll-margin-top: 80px; border-top: 4px solid var(--c); }
.domain-head { display: flex; align-items: center; gap: 14px; }
.domain-head .grow { flex: 1; min-width: 0; }
.domain-head h2 { font: 750 21px/1.2 var(--display); letter-spacing: -.02em; margin: 0 0 2px; }
.domain-head .comm { font-size: 13.5px; font-weight: 650; color: var(--muted); }
.domain-head .comm:hover { color: var(--accent); text-decoration: underline; }
.domain-weight { text-align: right; flex: none; }
.domain-weight b { display: block; font: 800 34px/1 var(--display); letter-spacing: -.04em; color: var(--c); }
.domain-weight span { font-size: 12.5px; color: var(--muted); }
.domain-desc { color: var(--text-2); margin: 12px 0; max-width: 64ch; }
.domain-progress { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.domain-progress .bar { flex: 0 0 140px; height: 6px; border-radius: var(--pill); background: var(--surface-3); overflow: hidden; }
.domain-progress .bar i { display: block; height: 100%; background: var(--c); border-radius: inherit; }
.domain h3 { font: 700 14.5px var(--display); margin: 0 0 4px; }
.topics { list-style: none; margin: 0; padding: 0; }
.topics li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.topics li > div { flex: 1; min-width: 0; padding-left: 14px; position: relative; }
.topics li > div::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.topics .nl { margin: 0; font-size: 14.5px; color: var(--text); }
.topics .en { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.topics .btn { flex: none; opacity: .65; }
.topics li:hover .btn { opacity: 1; }
.source { font-size: 13px; color: var(--muted); margin: 4px 4px 0; }
.source a { color: var(--accent); font-weight: 600; }

/* ---------------- ticket page ---------------- */
.post-page { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px 18px; }
.post-page .post-meta { font-size: 13.5px; }
.post-page .back { width: 32px; height: 32px; background: var(--surface-2); }
.post-page .who { display: flex; flex-direction: column; line-height: 1.25; }
.post-page .who .comm { font-size: 13.5px; }
.post-page .who small { font-size: 12.5px; color: var(--muted); }
.post-page h1 { font: 700 28px/1.2 var(--display); letter-spacing: -.025em; margin: 14px 0 10px; text-wrap: balance; }
.post-page .body { margin: 6px 0 16px; }

.comment-box { margin: 18px 0 8px; scroll-margin: 90px; }
.cmt-reply {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px -8px; padding: 5px 10px; border: 0; border-radius: var(--pill);
  background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.cmt-reply:hover { background: var(--surface-2); color: var(--text); }
.cmt-reply:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.comment-box .fake {
  width: 100%; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 18px; border-radius: var(--pill);
  border: 1px solid var(--line-2); color: var(--muted); cursor: text; background: var(--surface); font: inherit; font-size: 15px; text-align: left;
}
.comment-box .fake kbd { margin-left: auto; }
.comment-box .fake:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.comment-box .fake:hover { border-color: var(--text-2); }
.comment-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; align-items: center; }
.comment-actions .hint { margin-right: auto; font-size: 12.5px; color: var(--muted); }

.tabsline { display: flex; gap: 4px; margin: 20px 0 8px; }
.thread { margin-top: 4px; }
.cmt { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 10px; padding-top: 14px; }
.cmt .rail-line { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cmt .rail-line::after { content: ""; flex: 1; width: 2px; border-radius: 2px; background: var(--line); }
.cmt .rail-line:hover::after { background: var(--accent); }
.cmt-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); height: 32px; }
.cmt-head b { color: var(--text); font-weight: 700; }
.op { font-size: 11px; font-weight: 800; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 4px; }
.cmt .md { font-size: 15px; padding-bottom: 6px; }

/* Claude, de AI-mentor */
.avatar.claude { background: var(--surface-3); color: #f5a524; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #f5a524 55%, transparent); }
.avatar.claude svg.i { width: 16px; height: 16px; }
.op.mentor { color: #e8a21f; background: color-mix(in srgb, #f5a524 16%, transparent); }
.cmt.from-claude .rail-line::after, .ai-typing .rail-line::after { background: color-mix(in srgb, #f5a524 35%, var(--line)); }
.ai-live .stream { white-space: pre-wrap; margin: 0; }
.caret { display: inline-block; width: 8px; height: 1.05em; margin-left: 2px; vertical-align: -2px; border-radius: 2px; background: #f5a524; animation: blink 1s steps(1) infinite; }
.typing-label { margin: 0; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #f5a524; animation: hop 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }
.act.ai-act { color: #e8a21f; }
.act.ai-act:hover:not(:disabled) { background: color-mix(in srgb, #f5a524 16%, var(--surface-2)); color: #f5a524; }
.act:disabled { opacity: .5; cursor: not-allowed; }

.activity { list-style: none; margin: 8px 0 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.activity li:last-child { border-bottom: 0; }
.activity .ic { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.activity .ic svg.i { width: 16px; height: 16px; }
.activity time { display: block; font-size: 12.5px; color: var(--muted); }
.activity .old { color: var(--muted); text-decoration: line-through; }
.activity .new { color: var(--text); font-weight: 600; }
.activity details { margin-top: 6px; }
.activity summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
.activity details pre { white-space: pre-wrap; font: 12.5px/1.5 var(--mono); background: var(--code-bg); padding: 10px 12px; border-radius: var(--r-sm); max-height: 280px; overflow: auto; margin: 6px 0 0; }

/* ticket details card */
.dl { display: grid; gap: 14px; }
.dl-row .k { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.workflow { display: flex; flex-wrap: wrap; gap: 6px; }
.meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.meter button {
  height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2);
  font-weight: 750; font-size: 14px; color: var(--muted); cursor: pointer; transition: all .15s;
}
.meter button:hover { border-color: var(--u); color: var(--u); }
.meter button.on { background: var(--u); border-color: var(--u); color: #fff; }
.meter-hint { font-size: 13px; color: var(--text-2); margin-top: 6px; }
.related { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.related li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin: 0 -8px; border-radius: var(--r-sm); }
.related li:hover { background: var(--surface-2); }
.related a { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.related .rk { font: 500 11.5px var(--mono); color: var(--muted); }
.related .rt { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related .rm { opacity: 0; width: 28px; height: 28px; }
.related li:hover .rm { opacity: 1; }
.add-link { display: flex; gap: 6px; margin-top: 8px; }
.add-link input { height: 34px; }

/* ---------------- forms ---------------- */
.form-page h1 { font: 750 26px var(--display); letter-spacing: -.025em; margin: 0 0 16px; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.field { margin-bottom: 18px; }
.field > label, .field > .label { display: block; font-size: 13.5px; font-weight: 650; color: var(--text-2); margin-bottom: 8px; }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
input[type="text"], input[type="password"], input:not([type]), input[type="search"].plain, select, textarea {
  width: 100%; font: 15px var(--font); color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 14px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238592ab' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.title-wrap { position: relative; }
.title-input { font: 650 18px var(--display) !important; padding: 14px 70px 14px 16px !important; letter-spacing: -.01em; }
.counter { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.community-pick { display: inline-flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border: 1px solid var(--line-2); border-radius: var(--pill); background: var(--surface); }
.community-pick select { border: 0; background-color: transparent; padding: 6px 32px 6px 2px; font-weight: 700; box-shadow: none !important; width: auto; }

.flair-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.flair-pick button {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: var(--pill);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-weight: 650; font-size: 14px; cursor: pointer;
}
.flair-pick button:hover { border-color: var(--f); color: var(--text); }
.flair-pick button.on { background: color-mix(in srgb, var(--f) 20%, transparent); border-color: var(--f); color: var(--text); }
.flair-pick button svg.i { color: var(--f); width: 16px; height: 16px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--pill); padding: 3px; gap: 2px; }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: var(--pill); background: none; color: var(--muted); font-weight: 650; font-size: 13.5px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.form-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.form-actions .hint { margin-right: auto; font-size: 12.5px; color: var(--muted); }

.editor { border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-2); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.editor-bar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.editor-bar .seg { margin-right: 6px; }
.editor-bar .ins {
  height: 30px; padding: 0 10px; border-radius: 8px; border: 0; background: none; color: var(--muted);
  font: 600 12.5px var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.editor-bar .ins:hover { background: var(--surface-3); color: var(--text); }
.editor-bar .ins code { font: 500 11.5px var(--mono); }
.editor textarea { border: 0 !important; border-radius: 0; box-shadow: none !important; background: transparent !important; min-height: 240px; resize: vertical; font: 14px/1.6 var(--mono); padding: 14px 16px; }
.editor .preview { padding: 14px 16px; min-height: 240px; }
.editor.small textarea, .editor.small .preview { min-height: 110px; }

/* ---------------- rendered markdown ---------------- */
.md { font-size: 15.5px; line-height: 1.68; overflow-wrap: anywhere; max-width: 72ch; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--display); letter-spacing: -.015em; line-height: 1.3; margin: 1.4em 0 .5em; }
.md h1 { font-size: 1.45em; } .md h2 { font-size: 1.25em; } .md h3 { font-size: 1.08em; }
.md p, .md ul, .md ol, .md blockquote, .md table { margin: 0 0 1em; }
.md ul, .md ol { padding-left: 1.4em; }
.md li { margin: .2em 0; }
.md li::marker { color: var(--muted); }
.md ul:has(> li > input[type=checkbox]) { list-style: none; padding-left: .2em; }
.md input[type=checkbox] { accent-color: var(--accent-strong); width: 16px; height: 16px; vertical-align: -3px; margin: 0 8px 0 0; }
.md blockquote { border-left: 4px solid var(--accent); margin-left: 0; padding: 10px 16px; color: var(--text-2); background: var(--accent-soft); border-radius: 0 12px 12px 0; }
.md blockquote p:last-child { margin: 0; }
.md code { font: .86em var(--mono); background: var(--surface-2); border: 1px solid var(--line); padding: .1em .4em; border-radius: 6px; }
.md pre code { background: none; border: 0; padding: 0; font-size: 13px; line-height: 1.6; }
.md table { border-collapse: separate; border-spacing: 0; font-size: 14px; display: block; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.md th, .md td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.md tr:last-child td { border-bottom: 0; }
.md th { background: var(--surface-2); font-weight: 700; }
.md hr { border: 0; height: 1px; background: var(--line); margin: 1.6em 0; }
.md img { max-width: 100%; border-radius: 12px; }
.md a { color: var(--accent); font-weight: 600; }
.md a:hover { text-decoration: underline; }
.md a.tref { font: 600 .84em var(--mono); background: var(--accent-soft); padding: .15em .5em; border-radius: var(--pill); }
.md strong { font-weight: 750; color: var(--text); }

.code, .term { margin: 0 0 1.1em; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); max-width: 100%; }
.code-head, .term-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px 0 14px; font: 600 12px var(--font); }
.code-head { color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.code-head span { flex: 1; }
.code pre, .term pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.code pre { background: var(--code-bg); }
.copy {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: var(--pill);
  border: 0; background: transparent; color: var(--muted); font: 600 12px var(--font); cursor: pointer;
}
.copy:hover { background: var(--surface-3); color: var(--text); }
.term { border-color: #1e2a40; background: var(--term-bg); }
.term-bar { background: #161f33; color: #8d9ab3; border-bottom: 1px solid #1e2a40; }
.term-bar .copy { margin-left: auto; color: #8d9ab3; }
.term-bar .copy:hover { background: #243049; color: #fff; }
.term .dot { width: 11px; height: 11px; border-radius: 50%; }
.term .dot.r { background: #ff5f57; } .term .dot.y { background: #febc2e; } .term .dot.g { background: #28c840; }
.term-title { margin-left: 8px; font: 500 12px var(--mono); }
.term pre { background: var(--term-bg); color: #c9d3e3; }
.term pre code { font: 13px/1.6 var(--mono); }
.t-line { display: block; min-height: 1.6em; }
.t-prompt { color: #4ade80; font-weight: 700; user-select: none; }
.t-input { color: #f5f8fc; }
.t-out { color: #9fadc4; }
.t-bad { color: #ff7a7a; font-weight: 700; }
.t-warn { color: #fbbf24; }
.t-good { color: #4ade80; }
.term .hljs-built_in, .term .hljs-keyword { color: #82aaff; }
.term .hljs-string { color: #f2c97d; }
.term .hljs-variable, .term .hljs-template-variable { color: #d4a7ff; }
.term .hljs-comment { color: #5f6f8c; }
.term .hljs-meta { color: #5ed4e0; }

.hljs-comment, .hljs-quote { color: var(--muted); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-type { color: #6e9bf5; }
.hljs-attr, .hljs-attribute, .hljs-property, .hljs-section { color: #22b3c7; }
.hljs-string, .hljs-regexp { color: #d99a1c; }
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-variable, .hljs-template-variable, .hljs-params { color: #a685f7; }
.hljs-title, .hljs-name, .hljs-function { color: #34b36f; }
.hljs-meta, .hljs-bullet, .hljs-punctuation { color: var(--muted); }
.hljs-deletion { color: #f0545c; } .hljs-addition { color: #34b36f; }

/* ---------------- overlays ---------------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(8, 12, 22, .6); display: grid; place-items: center; padding: 20px; }
.modal { width: min(440px, 100%); background: var(--surface); border-radius: var(--r-lg); padding: 18px 22px 22px; box-shadow: var(--shadow); animation: pop .18s var(--ease); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal h2 { font: 700 19px var(--display); margin: 0; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.keys dt { text-align: right; } .keys dd { margin: 0; color: var(--text-2); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: var(--pill);
  background: var(--text); color: var(--bg); font-weight: 650; font-size: 14px; box-shadow: var(--shadow);
  animation: rise .22s var(--ease);
}
.toast.err { background: #e5484d; color: #fff; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------- responsive ---------------- */
@media (min-width: 1181px) { .rail-inline { display: none; } }
@media (max-width: 1180px) {
  .content { grid-template-columns: minmax(0, 740px); }
  .rail { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .leftnav {
    position: fixed; z-index: 40; left: 0; top: 60px; width: 280px;
    transform: translateX(-100%); transition: transform .2s var(--ease); box-shadow: var(--shadow);
  }
  body.nav-open .leftnav { transform: none; }
  .menu-btn { display: grid; }
  .logo { width: auto; }
}
@media (max-width: 640px) {
  .content { padding: 12px 10px 40px; }
  .topbar { gap: 6px; padding: 0 8px; }
  .logo-word, .search kbd, .create-btn span:last-child, #help-btn { display: none; }
  .create-btn { width: 40px; padding: 0; }
  .banner-band { height: 64px; }
  .banner-row { padding: 8px 4px 0; gap: 12px; }
  .banner-row > .cav.xl, .banner-row > .avatar.xl { width: 56px; height: 56px; margin-top: -32px; border-width: 3px; font-size: 20px; }
  .banner-row > .cav.xl svg.i { width: 28px; height: 28px; }
  .banner-row h1 { font-size: 21px; }
  .banner-row .btn { display: none; }
  .composer .icon-btn { display: none; }
  .sortbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -10px; margin-right: -10px; padding: 0 10px; }
  .sort { flex: none; padding: 0 12px; }
  .post { padding: 12px 12px 10px; }
  .post h3 { font-size: 17px; }
  .post-page { padding: 14px 14px 16px; }
  .post-page h1 { font-size: 23px; }
  .row { grid-template-columns: 1fr; }
  .form-card { padding: 14px; }
  .editor-bar .ins code, .editor-bar .ins:last-child { display: none; }
  .weightbar { height: auto; flex-direction: column; }
  .seg-part { flex-direction: row; align-items: center; gap: 10px; padding: 8px 12px; }
  .seg-part b { font-size: 16px; }
  .domain { padding: 14px 14px 6px; }
  .domain-weight b { font-size: 26px; }
  .topics .btn span { display: none; }
  .md { font-size: 15px; }
}


/* ---------- Reactievenster: zwevend rechtsonder, of los (Picture-in-Picture) ---------- */
.dock {
  position: fixed; right: 20px; bottom: 20px; z-index: 50; width: min(600px, calc(100vw - 24px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden;
  animation: dock-in .18s var(--ease);
}
@keyframes dock-in { from { transform: translateY(12px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dock { animation: none; } }
.dock-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.dock-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.dock-title b { color: var(--text); font-family: var(--mono); font-size: 13px; }
.dock-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; min-width: 30px; justify-content: center; padding: 0 8px;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); font: 700 13px var(--font); cursor: pointer;
}
.dock-btn:hover { background: var(--surface-3); color: var(--text); }
.dock-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.dock-form { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 10px; }
.dock .editor textarea { min-height: 200px; max-height: 55vh; }
.dock-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dock-foot .hint { margin-right: auto; font-size: 12.5px; color: var(--muted); }
.dock.min .dock-form { display: none; }
.dock.min { width: 300px; }
.dock.min [data-dock=pip] span { display: none; }

/* Los venster: het reactievak vult het hele venster. */
body.pip { margin: 0; height: 100vh; background: var(--surface); }
.dock.in-pip { position: static; width: auto; height: 100vh; border: 0; border-radius: 0; box-shadow: none; animation: none; }
.dock.in-pip [data-dock=min], .dock.in-pip [data-dock=close] { display: none; }
.dock.in-pip .editor { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.dock.in-pip .editor textarea, .dock.in-pip .editor .preview { flex: 1; max-height: none; min-height: 0; resize: none; overflow: auto; }
@media (max-width: 640px) { .dock { right: 12px; bottom: 12px; } .dock-btn span { display: none; } }

/* Delen als HTML */
button.nav-item { width: 100%; border: 0; background: none; font-family: inherit; text-align: left; cursor: pointer; }
.export-modal .export-intro { margin: 0 0 16px; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.export-modal input[name=name] { width: 100%; }
.export-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.export-check input { width: 17px; height: 17px; accent-color: var(--accent-strong); }
.export-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }


/* ================= samen leren: mensen, aanwezigheid, wedstrijden ================= */
:root { --samen: #1fb5c9; --race: #e05297; --gold: #f2b43a; }

/* Iemand: u/naam met een eigen kleur */
.by { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--text-2); }
.by .avatar { box-shadow: 0 0 0 2px var(--surface); }
.small { font-size: 12.5px; }

/* Eigen / Samen / Wedstrijd */
.mode { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--pill); font-size: 12px; font-weight: 750; }
.mode svg.i { width: 14px; height: 14px; }
.mode.m-samen { color: var(--samen); background: color-mix(in srgb, var(--samen) 15%, transparent); }
.mode.m-wedstrijd { color: var(--race); background: color-mix(in srgb, var(--race) 15%, transparent); }
.post.m-samen { border-left: 3px solid var(--samen); }
.post.m-wedstrijd { border-left: 3px solid var(--race); }
.post h3 svg.i { color: var(--race); vertical-align: -2px; }

/* Topbar: online maatjes, Claude-status, mijn menu */
.online { display: flex; align-items: center; gap: 2px; }
.online-av { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; }
.online-av:hover { background: var(--surface-2); }
.dot-on { position: absolute; right: 3px; bottom: 3px; width: 9px; height: 9px; border-radius: 50%; background: #3fbf7f; box-shadow: 0 0 0 2px var(--surface); }
.claude-status { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #e8a21f; }
.claude-status:hover { background: var(--surface-2); }
.claude-status .dot-on { right: 4px; bottom: 4px; }
.claude-status.off { color: var(--muted); } .claude-status.off .dot-on { background: var(--muted); }
.claude-status.away .dot-on { background: #8592ab; }
.claude-status.busy .dot-on { background: #f5a524; animation: pulse 1.2s ease-in-out infinite; }
.claude-status b { position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--pill); background: var(--race); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }
@keyframes pulse { 50% { transform: scale(1.35); opacity: .6; } }
.me-wrap { position: relative; }
.me-btn { border: 0; background: none; padding: 2px; border-radius: 50%; cursor: pointer; display: grid; }
.me-btn:hover .avatar { box-shadow: 0 0 0 3px var(--accent-soft); }
.me-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow);
}
.menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head b { display: block; font-size: 14px; } .menu-head small { color: var(--muted); font-size: 12.5px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-2); font: 600 14px var(--font); cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.nav-av { position: relative; width: 24px; display: grid; place-items: center; }
.nav-av .dot-on { right: -2px; bottom: -2px; width: 8px; height: 8px; }

/* Op een ticket: wie kijkt mee, wie typt */
.watchers { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 12.5px; color: var(--muted); }
.watchers:empty { display: none; }
.watchers .avatar { box-shadow: 0 0 0 2px var(--surface); }
.watchers span { margin-left: 4px; }
.watchers:not(:empty) + .key { margin-left: 12px; }
.cmt .uname { color: color-mix(in srgb, var(--uc, var(--text)) 70%, var(--text)); }
.cmt.mine .rail-line::after { background: color-mix(in srgb, var(--uc) 35%, var(--line)); }
.op.private { display: inline-flex; align-items: center; gap: 4px; color: var(--race); background: color-mix(in srgb, var(--race) 14%, transparent); }
.op.private svg.i { width: 11px; height: 11px; }
.op.thread-of { color: var(--uc); background: color-mix(in srgb, var(--uc) 15%, transparent); }
.typing.peer i { background: var(--uc); }
.typing-label.queued { color: var(--text-2); }
.dock-note { margin: 0; padding: 8px 14px; font-size: 13px; color: var(--text-2); display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--race) 8%, var(--surface)); }
.meter.ro button { cursor: default; } .meter.ro button:hover:not(.on) { border-color: var(--line-2); color: var(--muted); }

/* Wedstrijd */
.race-gate {
  text-align: center; padding: 28px 24px 26px; margin: 8px 0 14px; border-radius: var(--r);
  border: 1px dashed color-mix(in srgb, var(--race) 55%, var(--line-2));
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--race) 14%, transparent), transparent 70%);
}
.race-gate .race-ic { width: 56px; height: 56px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--race); color: #fff; margin-bottom: 10px; }
.race-gate h2 { font: 750 22px var(--display); letter-spacing: -.02em; margin: 0 0 8px; }
.race-gate p { max-width: 54ch; margin: 0 auto 10px; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.race-gate .btn { margin-top: 8px; height: 44px; padding: 0 24px; background: var(--race); }
.race-bar {
  position: sticky; top: 68px; z-index: 5; display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; padding: 12px 14px;
  border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-2);
}
.race-bar > svg.i { width: 26px; height: 26px; flex: none; }
.race-bar div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.race-bar b { font: 750 16px var(--display); }
.race-bar span { font-size: 13px; color: var(--muted); }
.race-bar.live { border-color: color-mix(in srgb, var(--race) 50%, var(--line-2)); }
.race-bar.live > svg.i { color: var(--race); }
.race-bar .clock { font: 750 24px var(--mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.race-bar.done { background: color-mix(in srgb, var(--gold) 14%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 45%, var(--line-2)); position: static; }
.race-bar.done > svg.i { color: var(--gold); }
.race-bar.wait { position: static; }
.board { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; counter-reset: rank; }
.board li { display: grid; grid-template-columns: 24px 1fr auto 44px; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.board .who { display: flex; flex-direction: column; min-width: 0; }
.board .who b { font-size: 14px; color: var(--text); } .board .who small { font-size: 12px; color: var(--muted); }
.board .time { font: 600 13px var(--mono); color: var(--text-2); font-variant-numeric: tabular-nums; }
.board .score { text-align: right; font: 800 18px var(--display); color: var(--text); }
.board .score small { font-size: 11px; color: var(--muted); font-weight: 600; }
.board li.winner { background: color-mix(in srgb, var(--gold) 18%, var(--surface-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 55%, transparent); }
.card-head h2 svg.i { vertical-align: -3px; }

/* Wij samen */
.wij-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 16px; }
.wij-col { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--uc); border-radius: var(--r); padding: 16px; }
.wij-col header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.wij-col h2 { font: 750 19px var(--display); margin: 0; letter-spacing: -.02em; }
.wij-col header a { font-size: 13px; }
.wij-total { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.wij-total b { font: 800 40px/1 var(--display); letter-spacing: -.04em; }
.wij-total span { color: var(--muted); font-size: 13px; }
.wij-total.lead b { color: var(--uc); }
.wij-col .stats { flex-wrap: wrap; gap: 14px; }
.wij-races .card-head .btn { width: auto; }
.race-list { list-style: none; margin: 0; padding: 0; }
.race-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.race-list li:last-child { border-bottom: 0; }
.race-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.race-title span { display: flex; flex-direction: column; min-width: 0; }
.race-title b { color: var(--text); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-title small { color: var(--muted); font-size: 12px; }
.race-title:hover b { text-decoration: underline; }
.race-people { display: flex; gap: 10px; }
.rp { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.rp b { color: var(--text); } .rp small { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.rp.win b { color: var(--gold); }
.race-result { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text); font-size: 13.5px; white-space: nowrap; }
.race-result svg.i { color: var(--gold); }

/* Met wie? (bij een nieuwe post) */
.mode-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode-pick button {
  --m: var(--accent); display: flex; align-items: flex-start; gap: 10px; text-align: left; padding: 12px; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); cursor: pointer; font: inherit;
}
.mode-pick button.m-samen { --m: var(--samen); } .mode-pick button.m-wedstrijd { --m: var(--race); }
.mode-pick button svg.i { color: var(--m); margin-top: 1px; }
.mode-pick button span { display: flex; flex-direction: column; gap: 2px; }
.mode-pick b { color: var(--text); font-size: 14px; } .mode-pick small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.mode-pick button:hover { border-color: var(--m); }
.mode-pick button.on { border-color: var(--m); background: color-mix(in srgb, var(--m) 12%, var(--surface)); box-shadow: inset 0 0 0 1px var(--m); }

/* Instellingen */
.settings .form-card { margin-bottom: 16px; }
.settings h2 { display: flex; align-items: center; gap: 8px; font: 750 17px var(--display); margin: 0 0 14px; letter-spacing: -.01em; }
.settings .help { font-size: 13px; color: var(--muted); margin: 0 0 12px; line-height: 1.5; }
.settings code { font: 12.5px var(--mono); background: var(--surface-2); padding: .1em .4em; border-radius: 6px; }
.static { height: 44px; display: flex; align-items: center; color: var(--text-2); font-weight: 600; }
.inline-form { display: flex; gap: 8px; margin-bottom: 12px; }
.inline-form input { flex: 1; }
.inline-form .btn { height: 44px; }
.plain-list { list-style: none; margin: 4px 0 0; padding: 0; }
.plain-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.plain-list li span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.plain-list b { font-size: 14px; } .plain-list small { font-size: 12.5px; color: var(--muted); }
.secret { margin: 4px 0 14px; padding: 14px; border-radius: 12px; background: color-mix(in srgb, var(--gold) 10%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line-2)); }
.secret p { margin: 0 0 8px; font-size: 13.5px; color: var(--text-2); }
.copybox { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.copybox code { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.5 var(--mono); background: var(--code-bg); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.copybox .btn { flex: none; }
.claude-row > span { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

/* Inloggen / uitnodiging */
body.auth-mode .topbar, body.auth-mode .shell, body.auth-mode .dock { display: none !important; }
.auth {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px;
  background:
    radial-gradient(60% 50% at 15% 10%, color-mix(in srgb, var(--k8s) 22%, transparent), transparent 70%),
    radial-gradient(50% 45% at 90% 90%, color-mix(in srgb, var(--race) 14%, transparent), transparent 70%),
    var(--bg);
}
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px 28px 24px; box-shadow: var(--shadow); }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth h1 { font: 750 26px/1.15 var(--display); letter-spacing: -.025em; margin: 0 0 8px; }
.auth-note { color: var(--text-2); font-size: 14px; line-height: 1.55; margin: 0 0 18px; }
.auth-note.small { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }
.auth-form .btn { width: 100%; height: 46px; margin-top: 4px; }
.auth-err { display: none; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; color: #f0545c; background: color-mix(in srgb, #f0545c 12%, transparent); }
.auth-err.show { display: block; }
.auth-actions { display: flex; gap: 8px; }
.auth-foot { color: var(--muted); font-size: 13px; margin-top: 18px; text-align: center; max-width: 44ch; }

@media (max-width: 640px) {
  .mode-pick { grid-template-columns: 1fr; }
  .online, #theme-btn { display: none; }
  .search { min-width: 0; padding: 0 10px; }
  .claude-status { width: 32px; }
  .race-list li { grid-template-columns: 1fr; gap: 6px; }
  .watchers span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .claude-status.busy .dot-on { animation: none; } }

/* ---------- chat ---------- */
.chat-btn { position: relative; }
.chat-btn.on { background: var(--accent-soft); color: var(--accent); }
.chat-btn .badge, .room .badge {
  position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--pill);
  background: #e5484d; color: #fff; font: 800 11px/18px var(--font); text-align: center; box-shadow: 0 0 0 2px var(--surface);
}
.chat {
  position: fixed; top: 60px; right: 0; bottom: 0; z-index: 40; width: min(440px, 100vw);
  display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line-2);
  box-shadow: var(--shadow); animation: chat-in .2s var(--ease);
}
@keyframes chat-in { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .chat { animation: none; } }
body.chat-open .dock { right: 460px; }
@media (max-width: 1100px) { body.chat-open .dock { right: 20px; } }

.chat-head { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 10px; border-bottom: 1px solid var(--line); }
.chat-rooms { flex: 1; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.room {
  position: relative; display: inline-flex; align-items: center; gap: 7px; flex: none; height: 38px; padding: 0 12px 0 6px;
  border: 0; border-radius: var(--pill); background: transparent; color: var(--text-2); font: 650 14px var(--font); cursor: pointer;
}
.room:hover { background: var(--surface-2); color: var(--text); }
.room.on { background: var(--accent-soft); color: var(--text); }
.room:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.room .badge { position: static; box-shadow: none; margin-left: 2px; }
.room-av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--k8s); color: #fff; font: 800 14px var(--display); }
.room-av.big { width: 52px; height: 52px; font-size: 24px; }
.room-av-wrap { position: relative; display: inline-flex; }
.room-av-wrap .dot-on { position: absolute; right: -1px; bottom: -1px; }
.chat-sub { display: flex; align-items: center; gap: 7px; padding: 7px 16px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-2); }

.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0 12px; overscroll-behavior: contain; }
.chat-more { text-align: center; color: var(--muted); font-size: 12.5px; padding: 10px; }
.chat-day { display: flex; align-items: center; gap: 10px; margin: 14px 16px 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.chat-day::before, .chat-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.chat-day span { text-transform: capitalize; }
.chat-empty { text-align: center; padding: 48px 28px; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chat-empty h3 { margin: 12px 0 4px; font: 700 18px var(--display); color: var(--text); }
.chat-empty p { margin: 0; font-size: 14px; line-height: 1.55; max-width: 34ch; }

.msg { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 6px 16px 4px; }
.msg.grouped { padding-top: 1px; }
.msg:hover { background: var(--surface-2); }
.msg-av { display: flex; justify-content: center; padding-top: 2px; }
.msg-av time { visibility: hidden; font-size: 10.5px; color: var(--muted); padding-top: 4px; }
.msg.grouped:hover .msg-av time { visibility: visible; }
.msg-main { min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 1px; }
.msg-head b { font-size: 14.5px; color: color-mix(in srgb, var(--uc) 55%, var(--text)); }
.msg.ai .msg-head b { color: #e8a21f; }
.msg-head time { font-size: 12px; color: var(--muted); }
.msg-body { font-size: 14.5px; line-height: 1.55; max-width: none; }
.msg-body p { margin: 0 0 .45em; }
.msg-body pre { margin: .4em 0 .6em; font-size: 12.5px; }
.msg-body.plain { white-space: pre-wrap; }
.msg.mine .msg-main { border-left: 2px solid transparent; }
.msg.ai .msg-body { border-left: 3px solid color-mix(in srgb, #f5a524 50%, transparent); padding-left: 10px; }
.edited { color: var(--muted); font-size: 11.5px; margin-left: 4px; }

.msg-tools {
  position: absolute; top: -12px; right: 14px; display: none; gap: 2px; padding: 2px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.msg:hover .msg-tools, .msg:focus-within .msg-tools { display: flex; }
.msg-tools button { width: 30px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.msg-tools button:hover { background: var(--surface-2); color: var(--text); }
.msg-tools button.sure { background: #e5484d; color: #fff; }

.reacts { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 2px; }
.react {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: var(--pill);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); font: 700 12.5px var(--font); cursor: pointer;
}
.react:hover { border-color: var(--accent); }
.react.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.picker { display: inline-flex; gap: 2px; margin-top: 4px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--pill); background: var(--surface); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.picker button { width: 32px; height: 30px; border: 0; border-radius: 50%; background: transparent; font-size: 17px; cursor: pointer; }
.picker button:hover { background: var(--surface-2); transform: scale(1.15); }

.msg-edit textarea { width: 100%; resize: vertical; min-height: 60px; font: 14.5px/1.5 var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--accent); border-radius: 10px; padding: 8px 10px; }
.msg-edit div { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.msg-edit small { color: var(--muted); font-size: 12px; margin-left: auto; }

.chat-jump {
  position: absolute; bottom: 132px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; border: 0; border-radius: var(--pill); background: var(--accent-strong); color: #fff; font: 700 13px var(--font); cursor: pointer; box-shadow: var(--shadow);
}
.chat-typing { min-height: 22px; padding: 0 18px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.chat-compose { padding: 8px 12px 12px; border-top: 1px solid var(--line); }
.chat-compose textarea {
  display: block; width: 100%; resize: none; min-height: 44px; max-height: 180px; padding: 11px 14px; font: 15px/1.45 var(--font);
  color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px;
}
.chat-compose textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-compose-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.chat-hint { flex: 1; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: var(--pill);
  border: 1px solid color-mix(in srgb, #f5a524 45%, var(--line-2)); background: color-mix(in srgb, #f5a524 10%, transparent);
  color: #e8a21f; font: 700 12.5px var(--font); cursor: pointer;
}
.chip-btn:hover { background: color-mix(in srgb, #f5a524 18%, transparent); }
.chat-compose .btn svg.i { margin-right: 2px; }

@media (max-width: 640px) {
  .chat { width: 100vw; border-left: 0; }
  .chat-hint { display: none; }
  .msg:hover .msg-tools { display: none; }
  .msg.act .msg-tools { display: flex; top: -16px; }
  .msg-tools button { width: 36px; height: 34px; }
  .chat-compose .btn-primary { margin-left: auto; }
}
/* Op brede schermen schuift de pagina opzij in plaats van onder de chat te verdwijnen. */
@media (min-width: 1500px) { body.chat-open .shell { padding-right: 440px; } body.chat-open .dock { right: 460px; } }
