:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #1d2433;
  --muted: #5f6b85;
  --border: #d6deeb;
  --yes: #16a34a;
  --yes-hover: #15803d;
  --no: #dc2626;
  --no-hover: #b91c1c;
  --accent: #2563eb;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #eef3fb 0%, #f8fbff 100%);
  color: var(--text);
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

h1, h2, h3, p { margin-top: 0; }
.subtitle { color: var(--muted); margin-bottom: 0; }

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(35, 51, 84, 0.08);
}

.main-card { padding: 28px; min-height: 420px; }
.side-card { padding: 24px; }
.step-indicator {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 18px;
}

.question {
  font-size: 31px;
  line-height: 1.3;
  margin-bottom: 28px;
}

.button-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 14px 22px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, background-color 0.12s ease;
}

button:hover { transform: translateY(-1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

button.yes { background: var(--yes); color: white; }
button.yes:hover { background: var(--yes-hover); }
button.no { background: var(--no); color: white; }
button.no:hover { background: var(--no-hover); }
button.secondary {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
}

.result-box {
  border: 1px solid #c7d2fe;
  background: #f8faff;
  border-radius: 16px;
  padding: 22px;
}

.result-tag {
  display: inline-block;
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  margin-bottom: 16px;
}

.result-text {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 10px;
}

.result-help {
  color: var(--muted);
  line-height: 1.5;
}

.history-list {
  margin: 0;
  padding-left: 22px;
}

.history-list li {
  margin-bottom: 14px;
  line-height: 1.45;
}

.answer-badge {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-left: 8px;
  vertical-align: middle;
  font-size: 0;
  line-height: 0;
  padding: 0;
}

.answer-yes { background: var(--yes); }
.answer-no { background: var(--no); }
.answer-unknown {
  background: #f0b550;
  color: #fff;
}

.legend {
  display: flex;
  gap: 18px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-right: 6px;
}
.dot.yes { background: var(--yes); }
.dot.no { background: var(--no); }
.dot.unknown { background: #f0b550; }

.notice {
  margin-top: 20px;
  padding: 14px;
  border-radius: 12px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .question, .result-text { font-size: 24px; }
  .app-header { flex-direction: column; }
}

.unknown-btn {
  background: #f59e0b;
  color: #fff;
}

.unknown-btn:hover {
  background: #d97706;
}

.main-question-panel {
  margin-bottom: 18px;
}

.subflow-panel {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  padding: 18px;
}

.subflow-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.subflow-step {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 13px;
  font-weight: 700;
}

.subflow-question {
  margin-bottom: 14px;
  line-height: 1.5;
}

.subflow-placeholder {
  color: var(--muted);
}

.unknown-resolution-banner {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 12px;
}

.unknown-resolution-label {
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 4px;
}

.unknown-resolution-text {
  font-weight: 600;
  color: #78350f;
}

.main-tree-locked {
  opacity: 0.6;
  pointer-events: none;
}

.main-tree-locked button:disabled {
  cursor: not-allowed;
}

/* Multi-choice buttons (WMO / nWMO / geen) */
.multi-option-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  transition: transform 0.1s ease, opacity 0.2s ease;
}

.multi-option-btn:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

/* WMO */
.multi-option-btn[data-option-index="0"] {
  background-color: #3498DB; /* blauw */
}

/* nWMO */
.multi-option-btn[data-option-index="1"] {
  background-color: #9B59B6; /* paars */
}

/* Geen WMO of nWMO */
.multi-option-btn[data-option-index="2"] {
  background-color: #BDC3C7; /* lichtgrijs */
  color: #2c3e50;
}

.multi-option-btn[data-option-index="3"] {
  background-color: #f59e0b;
  color: #fff;
}

.multi-option-btn[data-option-index="3"]:hover {
  background-color: #d97706;
}
.answer-wmo { 
  background: #3498DB;
}

.answer-nwmo { 
  background: #9B59B6;
}

.answer-none { 
  background: #BDC3C7;
  color: #2c3e50;
}

.dot.wmo { background: #3498DB; }
.dot.nwmo { background: #9B59B6; }
.dot.none { background: #BDC3C7; }

.checklist-links {
  margin-top: 24px;
  padding: 20px;
  border-radius: 12px;
  background: #f7f7f7;
}

.checklist-links h3 {
  margin-top: 0;
}

.checklist-phase {
  margin-top: 18px;
}

.checklist-phase ul {
  padding-left: 20px;
}

.checklist-phase li {
  margin-bottom: 10px;
}

.checklist-phase a {
  font-weight: 600;
}

.checklist-meta {
  display: block;
  font-size: 0.9rem;
  opacity: 0.8;
  margin-top: 2px;
}

.links-loading {
  margin-top: 20px;
  font-style: italic;
}