:root,
:root[data-theme="dark"] {
  --bg: #111;
  --fg: #eee;
  --muted: #888;
  --accent: #4aa3ff;
  --card: #1c1c1c;
  --border: #2a2a2a;
}

:root[data-theme="light"] {
  --bg: #f6f6f7;
  --fg: #1a1a1c;
  --muted: #666;
  --accent: #1e6fe0;
  --card: #ffffff;
  --border: #dcdee0;
}

html { color-scheme: light dark; }

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

header h1 { font-size: 1.2rem; margin: 0; }

#progress { color: var(--muted); font-size: 0.9rem; }

#theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  margin-left: 12px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
#theme-toggle:hover { background: var(--card); }

header > .right {
  display: flex;
  align-items: center;
}

#instructions p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 12px 0;
}

figure {
  margin: 0;
  text-align: center;
}

#stimulus {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 8px;
  border: 1px solid var(--border);
}

#base-prompt {
  color: var(--fg);
  font-size: 1.05rem;
  margin: 12px auto 0;
  font-style: italic;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: block;
  width: fit-content;
  max-width: 90%;
  text-align: center;
}

#options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}

@media (max-width: 600px) {
  #options { grid-template-columns: 1fr; }
}

.option {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}

.option:has(input:checked) {
  border-color: var(--accent);
}

.option input[type=radio] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.badge {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 12px;
  background: var(--border);
  font-weight: bold;
  color: var(--fg);
  font-size: 0.8rem;
}

.profile { list-style: none; margin: 0; padding: 0; }
.profile li { font-size: 0.9rem; padding: 2px 0; }
.axis { color: var(--muted); text-transform: capitalize; }
.value { color: var(--fg); }

footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

button#submit {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}
button#submit:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}

#error { color: #e66; font-size: 0.9rem; }
.done { text-align: center; font-size: 1.2rem; color: var(--muted); margin: 24px 0 12px; }

button#new-session {
  display: block;
  margin: 12px auto 0;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
}
button#new-session:hover { background: var(--card); }
