/* Zahlenverbindungstest – Testbogen-Optik: weißes Blatt auf grauem Tisch,
   schwarz gedruckte Kreise, Kugelschreiberblau für Linien und Aktionen, Rotstift für Fehler. */

@font-face {
  font-family: 'ZVT Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/zvt-hyperlegible-latin-400-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'ZVT Hyperlegible';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/zvt-hyperlegible-latin-600-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'ZVT Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/zvt-hyperlegible-latin-700-normal.woff2) format('woff2');
}

:root {
  color-scheme: light;
  --desk: #e6e9ed;
  --paper: #ffffff;
  --ink: #1b1e22;
  --pencil: #5d646e;
  --rule: #c7cdd5;
  --rule-soft: #e1e5ea;
  --pen: #1f3fa6;
  --pen-dark: #172f7d;
  --pen-tint: #e9eefb;
  --red: #c62828;
  --red-tint: #fde4e1;
  --amber: #8a5300;
  --amber-tint: #fdf1db;
  --green: #2e7d4f;
  --green-tint: #e3f2e9;
  --font: 'ZVT Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--desk);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

h1 { font-size: 28px; line-height: 1.2; margin: 0 0 16px; font-weight: 700; }
h2 { font-size: 18px; line-height: 1.3; margin: 28px 0 8px; font-weight: 700; }
p { margin: 0 0 14px; max-width: 64ch; }
.lead { font-size: 19px; }
.muted { color: var(--pencil); }
a { color: var(--pen); }

:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }
h1:focus { outline: none; }

/* ---------------------------------------------------------------- Kopfzeile */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 8px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.bar-title { font-weight: 700; white-space: nowrap; }
.bar-org { font-weight: 400; color: var(--pencil); margin-left: 6px; }

.steps {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}
.steps li {
  padding: 4px 10px;
  color: var(--pencil);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.steps li.is-done::before { content: '✓\00a0'; color: var(--green); font-weight: 700; }
.steps li.is-current { color: var(--ink); font-weight: 700; border-bottom-color: var(--pen); }

/* ---------------------------------------------------------------- Blatt */

.desk { padding: 32px 16px 56px; }

.sheet-card {
  max-width: 680px;
  margin: 0 auto;
  padding: 36px 40px 32px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: 0 18px 30px -26px rgba(27, 30, 34, 0.5);
}

.checklist { margin: 0 0 18px; padding-left: 22px; }
.checklist li { margin: 4px 0; max-width: 60ch; }

.privacy { margin: 18px 0; color: var(--pencil); font-size: 15px; }
.privacy summary { cursor: pointer; color: var(--ink); }
.privacy p { margin-top: 8px; }

.demo { display: block; margin: 8px 0 20px; border: 1px solid var(--rule-soft); }

.warn {
  padding: 10px 14px;
  background: var(--amber-tint);
  border-left: 4px solid var(--amber);
  color: #4d2f00;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.btn {
  font: inherit;
  font-weight: 700;
  padding: 11px 22px;
  border: 2px solid var(--pen);
  border-radius: 6px;
  background: var(--pen);
  color: #fff;
  cursor: pointer;
}
.btn:hover:not(:disabled) { background: var(--pen-dark); border-color: var(--pen-dark); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-quiet { background: transparent; color: var(--pen); }
.btn-quiet:hover:not(:disabled) { background: var(--pen-tint); color: var(--pen-dark); }
.btn-small { padding: 6px 12px; font-size: 15px; border-width: 1px; }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red-tint); border-color: var(--red); }

.results { border-collapse: collapse; margin-top: 12px; }
.results th, .results td { padding: 6px 18px 6px 0; text-align: left; border-bottom: 1px solid var(--rule-soft); }

/* ---------------------------------------------------------------- Testfläche */

body.testing { overflow: hidden; }
body.testing .desk { padding: 0; }

.stage {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 36px;
}
.board-wrap { position: relative; }
#board {
  display: block;
  background: #fff;
  box-shadow: 0 0 0 1px var(--rule), 0 18px 30px -26px rgba(27, 30, 34, 0.5);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 96px;
  font-weight: 700;
  color: var(--pen);
  pointer-events: none;
}
.hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  margin: 0 auto;
  text-align: center;
  font-weight: 700;
  color: var(--red);
}
.hint.is-quiet { color: var(--pencil); font-weight: 400; }

@media (max-width: 760px) {
  .bar { flex-wrap: wrap; }
  .bar-org { display: none; }
  .sheet-card { padding: 28px 20px 24px; }
  h1 { font-size: 24px; }
  .lead { font-size: 18px; }
}

/* ================================================================ Interviewer */

body.admin { background: var(--desk); }
.admin .bar nav { display: flex; gap: 12px; align-items: center; }
.admin main { max-width: 1240px; margin: 0 auto; padding: 24px 16px 64px; }
.admin h1 { font-size: 26px; margin-bottom: 4px; }
.admin h2 { font-size: 17px; margin: 0 0 12px; }

.panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 20px 22px;
  margin-bottom: 20px;
}

.alert { padding: 12px 16px; margin-bottom: 20px; border-left: 4px solid var(--amber); background: var(--amber-tint); }
.alert-bad { border-left-color: var(--red); background: var(--red-tint); }
.alert-good { border-left-color: var(--green); background: var(--green-tint); }

.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.field span { color: var(--pencil); }
.field input, .field select, .field textarea {
  font: inherit;
  font-size: 16px;
  padding: 9px 11px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
.field input[type='text'], .field input[type='password'] { min-width: 280px; }
.field textarea { width: 100%; min-height: 84px; resize: vertical; }
.field-wide { flex: 1 1 100%; }

.linkbox { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.linkbox input {
  flex: 1 1 420px;
  font: inherit;
  font-size: 15px;
  padding: 9px 11px;
  border: 1px solid var(--pen);
  border-radius: 4px;
  background: var(--pen-tint);
  color: var(--ink);
}

table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
.list th { text-align: left; font-weight: 600; color: var(--pencil); padding: 8px 10px; border-bottom: 2px solid var(--rule); white-space: nowrap; }
.list td { padding: 9px 10px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.list tr:hover td { background: #f7f8fa; }
.list .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list a { color: var(--ink); font-weight: 600; text-decoration: none; }
.list a:hover { color: var(--pen); text-decoration: underline; }
.table-scroll { overflow-x: auto; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.b-open { background: var(--rule-soft); color: var(--pencil); }
.b-active, .b-running { background: var(--pen-tint); color: var(--pen); }
.b-done, .b-ok { background: var(--green-tint); color: var(--green); }
.b-mittel, .b-aborted { background: var(--amber-tint); color: var(--amber); }
.b-hoch { background: var(--red-tint); color: var(--red); }
.b-info, .b-expired { background: var(--rule-soft); color: var(--pencil); }

.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.head .meta { color: var(--pencil); font-size: 15px; }
.head .tools { display: flex; flex-wrap: wrap; gap: 8px; }
.head form { margin: 0; }

.score { width: 100%; border-collapse: collapse; font-size: 16px; }
.score th { text-align: left; font-weight: 600; color: var(--pencil); padding: 6px 12px 6px 0; border-bottom: 2px solid var(--rule); font-size: 14px; }
.score td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.score .big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score .sub { display: block; color: var(--pencil); font-size: 13px; }
.ratio { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 14px; font-size: 15px; color: var(--pencil); }
.ratio strong { color: var(--ink); font-size: 18px; }

.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 1060px) { .grid2 { grid-template-columns: 1fr; } }

.viewer-canvas { width: 100%; }
.viewer canvas { display: block; box-shadow: 0 0 0 1px var(--rule); background: #fff; }
.bar .home { color: inherit; text-decoration: none; }
.admin .bar nav form { margin: 0; }
.reload-note { font: inherit; font-size: 14px; color: var(--pen); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.viewer-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.viewer-bar .tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tab { font: inherit; font-size: 14px; padding: 5px 11px; border: 1px solid var(--rule); background: #fff; border-radius: 4px; cursor: pointer; color: var(--ink); }
.tab[aria-pressed='true'] { background: var(--pen); color: #fff; border-color: var(--pen); }
.tab:disabled { color: var(--rule); cursor: default; }
.viewer-status { margin-left: auto; font-size: 15px; color: var(--pencil); font-variant-numeric: tabular-nums; }
.player { display: flex; gap: 10px; align-items: center; margin-top: 10px; font-size: 14px; color: var(--pencil); }
.player input[type='range'] { flex: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; font-size: 13px; color: var(--pencil); }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--pen); vertical-align: middle; margin-right: 6px; }
.legend i.trail { border-top: 2px solid rgba(31, 63, 166, 0.35); }
.legend i.err { width: 12px; height: 12px; border: 2px solid var(--red); border-radius: 50%; }
.legend i.miss { width: 6px; height: 6px; border: 0; border-radius: 50%; background: rgba(93, 100, 110, 0.55); }

.flags { list-style: none; margin: 0; padding: 0; }
.flags li { padding: 8px 0 8px 12px; border-left: 4px solid var(--rule); margin-bottom: 8px; font-size: 15px; }
.flags li.f-hoch { border-left-color: var(--red); }
.flags li.f-mittel { border-left-color: var(--amber); }
.flags .part { font-weight: 700; margin-right: 6px; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; font-size: 15px; }
dl.kv dt { color: var(--pencil); }
dl.kv dd { margin: 0; font-variant-numeric: tabular-nums; }

details.more { margin-top: 4px; }
details.more > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 28px; margin-top: 12px; }
.cols h3 { font-size: 15px; margin: 0 0 6px; }

.audit { font-size: 14px; }
.audit td:first-child { white-space: nowrap; color: var(--pencil); }

.login { max-width: 420px; margin: 8vh auto 0; }
.danger-zone { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.small { font-size: 14px; color: var(--pencil); }
.empty { color: var(--pencil); padding: 18px 0; }
.guide { margin: 10px 0 0; padding-left: 22px; font-size: 15px; }
.guide li { margin: 6px 0; max-width: 90ch; }
