:root {
  --fg: #1a1a2e;
  --muted: #5b5b73;
  --accent: #2b5ce6;
  --error: #c0392b;
  --border: #d2d6e0;
  --surface: #ffffff;
  --bg: #f4f6fb;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.survey-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.survey-root {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: 0 1px 3px rgba(20, 20, 50, 0.06);
}

.survey-progress {
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- sections & questions --- */
.survey-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.survey-stimulus {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.survey-stimulus-text {
  margin: 0 0 0.5rem;
}

.survey-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.5rem 0;
  border-radius: 6px;
}

.survey-zoom-trigger {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0.5rem 0;
  padding: 0;
  overflow: hidden;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: zoom-in;
}

.survey-zoom-trigger .survey-image { margin: 0; }

.survey-zoom-trigger:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* Keep the full-screen graph viewer above launcher and legacy game layers. */
.pswp { --pswp-bg: rgba(0, 0, 0, 0.94); z-index: 10000; }

.survey-question {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.survey-group {
  display: block;
}

.survey-prompt {
  display: block;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.survey-required {
  color: var(--error);
}

.survey-display .survey-prompt {
  font-weight: 400;
}

/* --- inputs --- */
.survey-input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.survey-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.survey-number {
  width: 12rem;
  max-width: 100%;
}

.survey-number-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.survey-unit {
  color: var(--muted);
}

.survey-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.survey-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.survey-option:hover {
  border-color: var(--accent);
}

.survey-option-input {
  margin-top: 0.2rem;
}

.survey-other {
  margin-top: 0.5rem;
}

/* --- matrix --- */
.survey-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.survey-matrix th,
.survey-matrix td {
  padding: 0.5rem 0.4rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.survey-matrix-rowlabel {
  text-align: left;
  font-weight: 400;
}

.survey-scale-head {
  font-weight: 600;
  vertical-align: bottom;
  color: var(--muted);
}

/* --- errors --- */
.survey-error {
  color: var(--error);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

.has-error .survey-input,
.has-error .survey-matrix {
  border-color: var(--error);
}

.has-error .survey-prompt {
  color: var(--error);
}

/* --- navigation --- */
.survey-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
}

.survey-button {
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 1.6rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.survey-button:first-child {
  background: transparent;
  color: var(--accent);
}

.survey-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.survey-status {
  margin-top: 1rem;
  color: var(--muted);
}

.survey-complete,
.launcher-panel {
  padding: 0.5rem 0;
}

.launcher-panel h2 {
  margin-top: 0;
}

.launcher-text {
  margin: 0 0 1rem;
}

.survey-complete {
  text-align: center;
}

.survey-mock-banner {
  max-width: 720px;
  margin: 0 auto 1rem;
  padding: 0.6rem 1rem;
  background: #fff3cd;
  border: 1px solid #ffe69c;
  border-radius: 8px;
  font-size: 0.9rem;
}
