  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --bg: #0a0a0a;
    --surface: #141414;
    --border: #272727;
    --border-bright: #3a3a3a;
    --text: #e8e8e8;
    --muted: #666;
    --dimmed: #3d3d3d;
    --accent: #e8e8e8;
    --red:    #e05252;
    --blue:   #5b8dee;
    --green:  #5ec97a;
    --yellow: #d4aa3f;
    --orange: #d97b3a;
    --purple: #9b7fe8;
    --pink:   #d965a0;
    --font-mono: 'IBM Plex Mono', monospace;
    --font-sans: 'IBM Plex Sans', sans-serif;
    --radius: 6px;
    --transition: 0.22s ease;
  }

  html, body {
    width: 100%; height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 300;
    overflow: hidden;
  }

  /* ── Layout ── */
  #app {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%; height: 100%;
    padding: 2rem 1.5rem;
  }

  .page {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 500px;
    animation: fadein 0.4s ease;
  }
  .page.active { display: flex; }

  @keyframes fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ── Header ── */
  .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
  }

  .task-title {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .nav-arrows {
    display: flex;
    gap: 8px;
  }

  .nav-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: border-color var(--transition), background var(--transition);
    font-family: var(--font-mono);
  }
  .nav-btn:hover { border-color: var(--border-bright); background: var(--surface); }
  .nav-btn:disabled { opacity: 0.25; cursor: not-allowed; }
  .nav-btn.hidden { visibility: hidden; }

  /* ── Typography ── */
  .section-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1.2rem;
  }

  h2 {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 1rem;
    line-height: 1.3;
    color: var(--text);
  }

  p {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 300;
    line-height: 1.75;
    color: #bbb;
    margin-bottom: 0.85rem;
  }

  ul { list-style: none; margin-bottom: 1rem; }
  ul li {
    font-family: var(--font-sans);
    font-size: 14px;
    color: #bbb;
    padding: 5px 0 5px 18px;
    position: relative;
    line-height: 1.6;
  }
  ul li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--dimmed);
  }

  .warn {
    border: 1px solid #5a3030;
    background: #1a0d0d;
    border-radius: var(--radius);
    padding: 12px 16px;
    font-family: var(--font-sans);
    font-size: 13px;
    color: #e08080;
    margin-top: 1rem;
  }

  /* ── Buttons ── */
  .btn {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.05em;
    padding: 10px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border-bright);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform 0.1s;
    margin-top: 1.5rem;
  }
  .btn:hover { background: var(--surface); border-color: #555; }
  .btn:active { transform: scale(0.97); }

  .btn-primary {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
  }
  .btn-primary:hover { background: #ccc; border-color: #ccc; }

  /* ── Response input ── */
  .input-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    width: 100%;
    margin-bottom: 1.5rem;
  }
  #response-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 18px;
    letter-spacing: 0.15em;
    text-align: center;
  }
  #response-field::placeholder { color: var(--dimmed); letter-spacing: normal; font-size: 13px; }

  /* ── Stimulus display ── */
  #stim-area {
    width: 100%;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    margin-bottom: 1.2rem;
    position: relative;
    overflow: hidden;
  }

  #stim-word {
    font-family: var(--font-mono);
    font-size: 64px;
    font-weight: 600;
    letter-spacing: -1px;
    line-height: 1;
    transition: opacity 0.1s, transform 0.12s;
    user-select: none;
  }
  #stim-word.flash {
    opacity: 0.4;
    transform: scale(1.06);
  }

  #stim-hint {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--dimmed);
    margin-top: 14px;
    font-family: var(--font-mono);
  }

  /* ── Progress ── */
  .progress-wrap {
    width: 100%;
    height: 2px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 1.2rem;
    overflow: hidden;
  }
  .progress-fill {
    height: 100%;
    background: var(--text);
    border-radius: 2px;
    transition: width 0.35s ease;
  }

  /* ── Stats row ── */
  .stats-row {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 1.2rem;
  }
  .stat {
    flex: 1;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
  }
  .stat-lbl {
    display: block;
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
  }
  .stat-val {
    display: block;
    font-size: 20px;
    font-weight: 500;
    color: var(--text);
  }

  /* ── Feedback ── */
  #feedback-line {
    font-size: 12px;
    color: var(--muted);
    min-height: 18px;
    text-align: center;
    width: 100%;
    transition: color 0.2s;
    font-family: var(--font-mono);
  }
  #feedback-line.ok  { color: var(--green); }
  #feedback-line.bad { color: var(--red); }

  /* ── Results ── */
  .result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin: 1.2rem 0;
  }

  .result-card {
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
  }
  .result-card .rc-lbl {
    display: block;
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
  }
  .result-card .rc-val {
    display: block;
    font-size: 28px;
    font-weight: 500;
  }

  .trial-log {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 0.5rem;
  }
  .trial-log-header {
    display: grid;
    grid-template-columns: 0.8fr 2fr 2fr 1.2fr 1.5fr;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 7px 12px;
    gap: 8px;
  }
  .trial-log-header span {
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .trial-log-body { max-height: 180px; overflow-y: auto; }
  .trial-row {
    display: grid;
    grid-template-columns: 0.8fr 2fr 2fr 1.2fr 1.5fr;
    padding: 6px 12px;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    align-items: center;
  }
  .trial-row:last-child { border-bottom: none; }
  .trial-row span { font-family: var(--font-mono); color: #aaa; }
  .badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.1em;
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
  }
  .badge.ok  { background: #0e2a15; color: var(--green); }
  .badge.bad { background: #2a0e0e; color: var(--red); }

  /* ── Chart ── */
  .chart-wrap {
    width: 100%;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 0.5rem;
  }
  .chart-wrap canvas { max-height: 220px; }

  /* ── Step instruction ── */
  .step-num {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
  }
  .step-demo {
    font-family: var(--font-mono);
    font-size: 48px;
    font-weight: 600;
    margin: 1.2rem 0;
    letter-spacing: 0.1em;
  }

  .btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

  /* scrollbar */
  .trial-log-body::-webkit-scrollbar { width: 4px; }
  .trial-log-body::-webkit-scrollbar-track { background: var(--surface); }
  .trial-log-body::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 4px; }
  /* Override just these two rules from the previous CSS */
  .check-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
  margin: 24px 0;
}

.check-item {
  display: flex;
  align-items: flex-start;
  justify-content:space-between;
  gap: 16px;
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
  user-select: none;
  
  
}

.check-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
}

.check-item:active {
  transform: scale(0.995);
}

/* Hide the real checkbox but keep it accessible. */
.check-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* The fake box we actually style. */
.check-box {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  position: relative;
  top:50%;
  transform: translateY(-50%);
  
  
}

/* Checkmark — drawn with two rotated lines via a single ::after. */
.check-box::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 2px;
  width: 6px;
  height: 12px;
  border: solid #111;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
  

}

/* Checked state. */
.check-item input:checked ~ .check-box {
  background: #5ec97a;
  border-color: #5ec97a;
}
.check-item input:checked ~ .check-box::after {
  transform: rotate(45deg) scale(1);
  
}

/* Whole card gets a subtle accent when checked. */
.check-item:has(input:checked) {
  background: rgba(94, 201, 122, 0.08);
  border-color: rgba(94, 201, 122, 0.35);
  
}

/* Keyboard focus ring. */
.check-item input:focus-visible ~ .check-box {
  outline: 2px solid #5ec97a;
  outline-offset: 3px;
}
input[type="radio"]{
  display: none;
}
.check-content {
  display: flex;
  flex-direction: column;
  
  gap: 4px;
  width: 87%;
}

.check-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text, #eee);
  line-height: 1.3;
}

.check-desc {
  font-size: 14px;
  color: var(--muted, #999);
  line-height: 1.45;
}
.check-box {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;          /* ← was 6px */
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  position: relative;
}

/* Replace the checkmark with a filled inner dot */
.check-box::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border: none;                /* ← drop the checkmark borders */
  border-radius: 50%;
  background: #111;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s ease;
}

.check-item input:checked ~ .check-box::after {
  
  transform: translate(-50%, -50%) scale(1);   /* ← updated */
}