:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #1b1f24;
  --muted: #5c6670;
  --border: #d8dde3;
  --accent: #1f5fbf;
  --accent-soft: #e3ecfa;
  --good: #1d7a46;
  --good-soft: #e2f3e9;
  --bad: #b3261e;
  --bad-soft: #fbe6e4;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111418; --surface: #1a1f25; --surface-2: #232a32; --text: #e7eaee; --muted: #9aa4ae;
    --border: #313a44; --accent: #6ea2ff; --accent-soft: #1d2b42; --good: #5cc98a; --good-soft: #17301f;
    --bad: #ff8a80; --bad-soft: #3a1c1a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111418; --surface: #1a1f25; --surface-2: #232a32; --text: #e7eaee; --muted: #9aa4ae;
  --border: #313a44; --accent: #6ea2ff; --accent-soft: #1d2b42; --good: #5cc98a; --good-soft: #17301f;
  --bad: #ff8a80; --bad-soft: #3a1c1a; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); }
kbd {
  font: 12px/1 ui-monospace, monospace; padding: 2px 6px; border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 4px; background: var(--surface-2);
}
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .5rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.brand { font-weight: 650; }
.brand-sub { font-size: .8rem; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.step-label { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.progress { width: 160px; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .3s; }

.container { max-width: 1200px; width: 100%; margin: 0 auto; padding: 24px 16px 48px; flex: 1; }
.narrow { max-width: 760px; margin: 0 auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }

.footer { max-width: 1200px; width: 100%; margin: 0 auto; padding: 12px 16px 20px; display: flex; justify-content: space-between; gap: 12px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }

/* buttons */
.actions { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.actions .spacer { flex: 1; }
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 550; padding: 10px 18px; border-radius: 8px; cursor: pointer;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 6px 12px; font-size: .875rem; }
.btn:focus-visible, .cand:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* consent */
.logos { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.logo { display: block; height: auto; }
.logo-uni { width: 200px; max-width: 48%; }
.logo-citec { width: 92px; max-width: 24%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-uni { filter: invert(1); } }
:root[data-theme="dark"] .logo-uni { filter: invert(1); }
.consent-text p { margin: 0 0 .9rem; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 8px; margin-top: 10px; cursor: pointer; background: var(--surface-2); }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }

/* instructions */
.criteria { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 16px 0; }
.criterion { border: 1px solid var(--border); border-radius: 8px; padding: 14px; background: var(--surface-2); }
.criterion .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .8rem; font-weight: 700; margin-right: 6px; }
.criterion b { display: inline; }
.criterion p { margin: 6px 0 0; font-size: .925rem; color: var(--muted); }
ul.notes { padding-left: 20px; }
ul.notes li { margin: 6px 0; }

/* trial */
.trial-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.trial-head h1 { margin: 0; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }

.prior-panel { padding: 16px; }
.prior-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.prior-head .controls { margin-top: 0; }
.prior-vids { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.prior-tile { margin: 0; }
.examples { margin: 8px 0 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.example-pair { margin-top: 16px; }
.prior-tile figcaption { margin-top: 6px; font-size: .95rem; }
.description { margin: 0; font-size: 1.05rem; line-height: 1.6; padding: 12px 14px; background: var(--surface-2); border-left: 4px solid var(--accent); border-radius: 6px; }
.vid-wrap { position: relative; background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; }
.vid-wrap video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.enlarge { position: absolute; top: 8px; right: 8px; border: 0; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; width: 32px; height: 32px; font-size: 16px; cursor: pointer; }
.enlarge:hover { background: rgba(0,0,0,.8); }
.caption { margin: 8px 0 0; font-size: .95rem; }

.controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.question { margin: 24px 0 12px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.question .controls { margin-top: 0; }
ol.parts { padding-left: 22px; }
ol.parts li { margin: 6px 0; }
.question h2 { margin: 0; }
.question p { margin: 4px 0 0; color: var(--muted); }

.cands { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cands.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Task 1: [A] [event + original] [B]; the middle column is exactly as tall as the cards next to it */
.cands.with-ref { grid-template-columns: minmax(0, 1fr) minmax(0, .5fr) minmax(0, 1fr); }
.ref-col { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 2px solid transparent; }
.ref-col .cand-top { justify-content: center; margin-bottom: 0; }
.ref-col .prior-tile { display: flex; flex-direction: column; }
.ref-col .prior-tile figcaption { text-align: center; font-size: .875rem; margin-top: 4px; }
@media (min-width: 801px) {
  .ref-col .prior-tile { flex: 1 1 0; min-height: 0; }
  .ref-col .vid-wrap { flex: 1 1 0; min-height: 0; aspect-ratio: auto !important; }
  .ref-col .vid-wrap video { position: absolute; inset: 0; }
}
.cand {
  position: relative; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s; text-align: left;
}
.cand:hover { border-color: var(--accent); }
.cand.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cand-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.letter { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 6px; background: var(--surface-2); font-weight: 750; }
.cand.selected .letter { background: var(--accent); color: #fff; }
.pick { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cand.selected .pick { color: var(--accent); font-weight: 650; }
.pick .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; display: inline-block; }
.cand.selected .pick .dot { background: currentColor; box-shadow: inset 0 0 0 3px var(--surface); }

/* training feedback */
.cand.correct { border-color: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.cand.wrong { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.cand-note { margin-top: 8px; font-size: .875rem; padding: 8px 10px; border-radius: 6px; }
.cand.correct .cand-note { background: var(--good-soft); color: var(--good); }
.cand:not(.correct) .cand-note { background: var(--surface-2); color: var(--muted); }
.feedback { margin-top: 16px; padding: 14px 16px; border-radius: 8px; border: 1px solid; }
.feedback.ok { background: var(--good-soft); border-color: var(--good); }
.feedback.no { background: var(--bad-soft); border-color: var(--bad); }
.feedback b { display: block; margin-bottom: 4px; }

.hint-line { font-size: .85rem; color: var(--muted); }

/* form */
.field { margin: 16px 0; }
.field label.lbl { display: block; font-weight: 600; margin-bottom: 6px; }
.field input[type=text], .field select, .field textarea {
  width: 100%; font: inherit; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
}
.field textarea { min-height: 100px; resize: vertical; }

.pid { font: 600 1.25rem ui-monospace, monospace; padding: 10px 14px; background: var(--surface-2); border-radius: 8px; display: inline-block; letter-spacing: .05em; }
.notice { padding: 12px 14px; border-radius: 8px; background: var(--accent-soft); margin: 16px 0; }
.notice.warn { background: var(--bad-soft); }

/* modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.75); }
.modal-body { position: relative; width: min(1100px, 100%); background: var(--surface); border-radius: var(--radius); padding: 16px; }
.modal-body video { width: 100%; max-height: 78vh; background: #000; border-radius: 6px; display: block; }
.modal-close { position: absolute; top: -14px; right: -14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface); color: var(--text); font-size: 16px; cursor: pointer; box-shadow: var(--shadow); }

@media (max-width: 800px) {
  .prior-vids { grid-template-columns: 1fr; }
  .cands, .cands.n3 { grid-template-columns: 1fr; }
  .cands.with-ref { grid-template-columns: 1fr; }
  .cands.with-ref .ref-col { order: -1; display: grid; grid-template-columns: 1fr 1fr; padding: 0; }
  .cands.with-ref .ref-col .cand-top { grid-column: 1 / -1; justify-content: flex-start; }
  .progress { width: 80px; }
  .card { padding: 16px; }
  .brand-sub { display: none; }
}
ul.consent-statements { padding: 14px 14px 14px 34px; margin: 0 0 1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
ul.consent-statements li { margin: 6px 0; }

/* footer: ethics ID, data-protection link and the GDPR privacy notice */
.footer-legal { flex: 1 1 520px; max-width: 860px; min-width: 0; }
.footer-legal p { margin: 0 0 .4rem; overflow-wrap: anywhere; }
.footer-legal a { color: inherit; text-decoration: underline; }

/* German translation (toggled with the "Deutsch" button in the top bar) */
.de { display: none; }
body.show-de .de { display: block; }
.de:not(.description) { margin: 4px 0 12px; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 4px; font-size: .95em; }
.de.de-title { font-size: 1.05rem; font-weight: 600; margin-top: -4px; }
.de.de-question { font-weight: 600; }
.description.de { margin-top: 8px; border-left-style: dashed; }
.lang-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
