:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #2c2c2a;
  --muted: #6b7280;
  --line: #e3e5ea;
  --brand: #534AB7;
  --brand-soft: #EEEDFE;
  --blue: #185FA5;
  --green: #0F6E56;
  --amber: #BA7517;
  --red: #A32D2D;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 22px 18px 60px;
  min-height: 100vh;
}

.screen { display: none; }
.screen.active { display: block; }

h1.title {
  font-size: 23px;
  line-height: 1.4;
  margin: 6px 0 10px;
  color: #26215C;
}

.lead {
  font-size: 14px;
  color: var(--muted);
  background: var(--brand-soft);
  border-radius: 10px;
  padding: 12px 14px;
  line-height: 1.7;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  width: 100%;
  margin-top: 12px;
  transition: opacity .15s ease;
}
.btn:hover { opacity: .92; }
.btn.secondary {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
}
.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

label.field {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 5px;
}
input, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
}
.note { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.6; }

/* test screen */
#moduleTitle { font-size: 16px; font-weight: 600; color: var(--brand); }
#progress { font-size: 13px; color: var(--muted); margin-top: 2px; }
#instruction {
  font-size: 14px;
  color: var(--ink);
  background: var(--brand-soft);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
  line-height: 1.7;
}
#stage {
  position: relative;
  width: 100%;
  height: 320px;
  background: #11131a;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: manipulation;
}
.fixation {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #9aa6b8;
}
.ready-text {
  position: absolute;
  top: 14px; left: 0; right: 0;
  text-align: center;
  color: #cfd4e0;
  font-size: 14px;
}
.stim-square {
  width: 170px; height: 170px;
  border-radius: 16px;
}
.stim-arrow {
  font-size: 130px;
  color: #ffd166;
  font-weight: 700;
  line-height: 1;
}
#feedback {
  min-height: 26px;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  margin-top: 14px;
}
#feedback.ok { color: var(--green); }
#feedback.bad { color: var(--red); }
#feedback.info { color: var(--blue); }

/* report */
.report-module {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 14px;
}
.report-module h3 { margin: 0 0 8px; font-size: 15px; color: #26215C; }
.metric-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}
.metric-row:last-child { border-bottom: none; }
.metric-row .v { font-weight: 600; }
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
table.report-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
table.report-table th, table.report-table td { border: 1px solid var(--line); padding: 7px 8px; text-align: left; }
table.report-table th { background: #f0effa; }
.callout {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
  margin-top: 12px;
}
.callout.blue { background: #E6F1FB; color: #042C53; }
.callout.green { background: #E1F5EE; color: #04342C; }
.callout.amber { background: #FAEEDA; color: #412402; }
.section-title { font-size: 17px; color: #26215C; margin: 26px 0 4px; font-weight: 600; }
.hidden { display: none !important; }
.mi-meta { font-size: 13px; color: var(--muted); text-align: center; margin: 2px 0 6px; }
