:root {
  --ink: #1f2421;
  --ink-soft: #4b5450;
  --paper: #faf8f3;
  --card: #ffffff;
  --line: #ddd6c8;
  --teal: #1f6f66;
  --teal-bg: #e3f1ee;
  --ochre: #a6740f;
  --ochre-bg: #f6ecd6;
  --brick: #a3402f;
  --brick-bg: #f6e2dd;
  --unsure: #6a4c93;
  --unsure-bg: #ece5f5;
  --accent: #3a5a74;
  font-family: 'IBM Plex Serif', Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-weight: 700;
  color: var(--ink);
}

header.top {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

header.top h1 { font-size: 1.3rem; margin: 0; }

.top-links { display: flex; gap: 1rem; align-items: center; font-size: 0.9rem; }
.top-links a { color: var(--accent); text-decoration: none; }
.top-links a:hover { text-decoration: underline; }
.tester-badge { font-size: 0.85rem; color: var(--ink-soft); }
.tester-badge strong { color: var(--ink); }

main.wrap { max-width: 900px; margin: 0 auto; padding: 1.5rem; }

.callout {
  background: var(--teal-bg);
  border: 1px solid var(--teal);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.home-wrap h2 { margin-top: 2rem; margin-bottom: 0.5rem; }
.home-wrap h3 { margin-top: 1.5rem; margin-bottom: 0.6rem; font-size: 1.05rem; color: var(--accent); }

.table-wrap { overflow-x: auto; margin-bottom: 1rem; }

.roles-table th, .roles-table td { vertical-align: top; }
.roles-table td:first-child { width: 15rem; }
.role-name { display: block; font-weight: 700; }
.role-machine { display: block; font-family: monospace; font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.2rem; }
.roles-table ul.role-accounts {
  list-style: none;
  padding-left: 0;
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
  color: #4a7fa5;
}
.roles-table ul.role-accounts li { margin-bottom: 0; padding-bottom: 0.3rem; }
.role-account-email { font-family: monospace; color: inherit; }
.role-accounts-note { margin: 0.6rem 0 0; font-size: 0.8rem; font-style: italic; color: var(--ink-soft); }
.role-who { margin: 0 0 0.7rem; color: var(--ink-soft); }
.roles-table td strong { display: block; margin-bottom: 0.2rem; }
.roles-table ul { margin: 0 0 0.7rem; padding-left: 1.2rem; }
.roles-table ul:last-child { margin-bottom: 0; }
.roles-table li { margin-bottom: 0.2rem; }

.start-testing { text-align: center; margin-top: 2rem; }
.start-btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.8rem 2rem;
  border-radius: 8px;
}
.start-btn:hover { opacity: 0.9; }

.chapter { margin-bottom: 2.5rem; }
.chapter-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0.4rem; margin: 0 -0.4rem 0.3rem; }
.chapter-num { color: var(--ink-soft); font-size: 0.9rem; }
.chapter-intro { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 1rem; }

.collapsible-head { cursor: pointer; user-select: none; border-radius: 6px; }
.collapsible-head:hover { background: var(--card); }
.collapsible-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.collapse-arrow { color: var(--ink-soft); font-size: 0.75em; flex: 0 0 auto; }
.progress-badge {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  white-space: nowrap;
}
.chapter-head .progress-badge { background: var(--paper); }

.progress-bar {
  background: var(--line);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.progress-bar-fill { background: var(--teal); height: 100%; }
.progress-label { font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 1rem; }

.scenario {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1.2rem;
  margin-bottom: 0.7rem;
  scroll-margin-top: 5rem;
}

.scenario.status-werkte { border-left-color: var(--teal); }
.scenario.status-randgeval { border-left-color: var(--ochre); }
.scenario.status-fail { border-left-color: var(--brick); }
.scenario.status-unsure { border-left-color: var(--unsure); }
.scenario.retest { border-color: var(--ochre); border-left-color: var(--ochre); box-shadow: 0 0 0 2px var(--ochre-bg); }

.scenario-toggle {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.15rem 0.3rem;
  margin: -0.15rem -0.3rem 0.4rem;
}
.scenario-toggle:hover { background: var(--paper); }
.scenario-id { font-family: monospace; color: var(--ink-soft); font-size: 0.85rem; flex: 0 0 auto; }
.scenario-title { font-weight: 600; }

.own-status-badge {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.own-status-badge.status-werkte { background: var(--teal-bg); color: var(--teal); border-color: var(--teal); }
.own-status-badge.status-randgeval { background: var(--ochre-bg); color: var(--ochre); border-color: var(--ochre); }
.own-status-badge.status-fail { background: var(--brick-bg); color: var(--brick); border-color: var(--brick); }
.own-status-badge.status-unsure { background: var(--unsure-bg); color: var(--unsure); border-color: var(--unsure); }

.scenario-badges { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.retest-badge { background: var(--ochre-bg); color: var(--ochre); }

.tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}
.tag.expected { background: var(--teal-bg); color: var(--teal); }
.tag.edge { background: var(--ochre-bg); color: var(--ochre); }
.tag.access { background: var(--brick-bg); color: var(--brick); }

.coverage-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #eee;
  color: var(--ink-soft);
}

.category-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--accent);
  color: var(--accent);
}

.category-group { margin: 1.8rem 0 0.8rem; padding-top: 0.8rem; border-top: 1px dashed var(--line); }
.category-heading { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0.4rem; margin: 0 -0.4rem; }
.category-heading h3 { font-size: 1rem; margin: 0; color: var(--accent); }
.category-intro { color: var(--ink-soft); font-size: 0.9rem; margin: 0.4rem 0 0; }

.scenario-meta {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: baseline;
}
.scenario-meta .k { font-weight: 600; color: var(--ink); }
.scenario-meta .meta-sep { color: var(--line); }
.scenario-account-email { font-family: monospace; }

.paths { font-size: 0.9rem; margin-bottom: 0.4rem; display: flex; gap: 0.4rem; align-items: baseline; flex-wrap: wrap; }
.paths .k { font-weight: 600; }
.paths code {
  font-family: monospace;
  font-size: 0.85rem;
  background: var(--teal-bg, #eee);
  color: var(--ink, #222);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.steps { margin: 0.4rem 0; padding-left: 1.3rem; }
.steps li { margin-bottom: 0.2rem; }

.expect { font-size: 0.9rem; margin-top: 0.5rem; }
.expect .k { font-weight: 600; display: block; }

.dev-note { font-size: 0.85rem; font-style: italic; color: var(--ink-soft); margin-top: 0.5rem; }

.coverage-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.5rem; border-left: 3px solid var(--line); padding-left: 0.6rem; }

.retest-row {
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.retest-flag-active { color: var(--ochre); font-weight: 600; }

.entries { margin-top: 0.8rem; border-top: 1px solid var(--line); padding-top: 0.6rem; }
.entry-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.entry-row.own { background: #f5f7f2; border-radius: 6px; padding: 0.5rem; }
.entry-tester { font-weight: 600; min-width: 6rem; }
.entry-status { padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.75rem; }
.entry-status.werkte { background: var(--teal-bg); color: var(--teal); }
.entry-status.randgeval { background: var(--ochre-bg); color: var(--ochre); }
.entry-status.fail { background: var(--brick-bg); color: var(--brick); }
.entry-status.unsure { background: var(--unsure-bg); color: var(--unsure); }
.entry-comment { flex: 1; color: var(--ink-soft); }
.entry-stale-badge {
  font-size: 0.7rem;
  font-style: italic;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

.own-controls { margin-top: 0.6rem; }
.own-stale-hint { font-size: 0.85rem; color: var(--ochre); margin: 0 0 0.5rem; }
.status-buttons { display: flex; gap: 0.4rem; margin-bottom: 0.4rem; flex-wrap: wrap; }
.status-buttons button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.status-buttons button.active.werkte { background: var(--teal); color: white; border-color: var(--teal); }
.status-buttons button.active.randgeval { background: var(--ochre); color: white; border-color: var(--ochre); }
.status-buttons button.active.fail { background: var(--brick); color: white; border-color: var(--brick); }
.status-buttons button.active.unsure { background: var(--unsure); color: white; border-color: var(--unsure); }

textarea.own-comment {
  width: 100%;
  min-height: 3rem;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.4rem;
  resize: vertical;
}

.own-actions { margin-top: 0.4rem; display: flex; gap: 0.8rem; align-items: center; }
.own-actions button { font-size: 0.8rem; }
.own-actions .clear-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0;
  text-decoration: underline;
}

.save-btn {
  border: none;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.save-btn:disabled { opacity: 0.5; cursor: default; }

.login-wrap {
  max-width: 420px;
  margin: 4rem auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2rem;
}
.login-wrap h1 { font-size: 1.4rem; margin-top: 0; }
.login-wrap label { display: block; font-size: 0.9rem; font-weight: 600; margin: 1rem 0 0.3rem; }
.login-wrap input[type="password"],
.login-wrap input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 1rem;
}
.login-wrap .tester-list { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.3rem; }
.login-wrap .tester-list label { font-weight: 400; display: flex; align-items: center; gap: 0.4rem; margin: 0; }
.login-wrap button.submit {
  margin-top: 1.5rem;
  width: 100%;
  padding: 0.6rem;
  border: none;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}
.login-error { color: var(--brick); font-size: 0.9rem; margin-top: 0.8rem; }

.custom-badge { background: var(--accent); color: white; }
.custom-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.add-scenario-wrap { margin-top: 0.5rem; }
.add-scenario-toggle {
  background: none;
  border: 1px dashed var(--line);
  color: var(--accent);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
}
.add-scenario-toggle:hover { border-color: var(--accent); }

.add-scenario-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.add-scenario-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.add-scenario-form input[type="text"],
.add-scenario-form textarea,
.add-scenario-form select {
  font-family: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.4rem;
  resize: vertical;
  color: var(--ink);
  font-weight: 400;
}
.add-scenario-actions { display: flex; gap: 0.8rem; align-items: center; }
.add-scenario-error { color: var(--brick); font-size: 0.85rem; }
.add-scenario-error[hidden] { display: none; }

.overzicht-filter { margin-bottom: 1rem; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }

table.overzicht-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.overzicht-table th, table.overzicht-table td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
table.overzicht-table a { color: var(--accent); text-decoration: none; }
table.overzicht-table a:hover { text-decoration: underline; }

.testdata-group { margin-bottom: 3rem; padding-top: 1.5rem; border-top: 2px solid var(--line); }
.testdata-group:first-of-type { padding-top: 0; border-top: none; }
.testdata-group > h2 { font-size: 1.3rem; margin-bottom: 0.3rem; }
.testdata-group > .chapter-intro { margin-bottom: 1.5rem; }

.testdata-section { margin-bottom: 2.5rem; }
.testdata-section:last-child { margin-bottom: 0; }
.testdata-section h3 { font-size: 1.05rem; margin-bottom: 0.3rem; color: var(--accent); }
.testdata-table-wrap { overflow-x: auto; }
.testdata-table-wrap table.overzicht-table { min-width: max-content; }
.testdata-table-wrap table.overzicht-table td { vertical-align: top; }
.testdata-password {
  font-family: monospace;
  font-size: 1rem;
  background: var(--teal-bg);
  color: var(--teal);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.testdata-password-callout { background: var(--ochre-bg); border-color: var(--ochre); }
.testdata-password-callout .testdata-password { font-size: 1.2rem; font-weight: 700; }

.account-email { font-family: monospace; font-size: 0.85rem; color: var(--ink-soft); }

.expandable-toggle {
  display: block;
  margin-top: 0.2rem;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}
