/* ═══════════════════════════════════════════════════════════════
   style.css  –  실험 연구 웹페이지  (PC 가로 최적화)
   ═══════════════════════════════════════════════════════════════ */

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

/* ── 디자인 토큰 ─────────────────────────────────────────────── */
:root {
  --primary:       #5d5d5d;
  --primary-d:     #4d4d4d;
  --primary-lite:  #f2f2f2;
  --ctrl-color:    #575757;
  --ctrl-lite:     #efefef;
  --exp-color:     #747474;
  --exp-lite:      #f0f0f0;
  --success:       #7f7f7f;
  --danger:        #b91c1c;
  --bg:            #f4f4f4;
  --card-bg:       #ffffff;
  --border:        #e7e7e7;
  --text:          #282828;
  --muted:         #727272;
  --radius:        10px;
  --shadow:        0 2px 16px rgba(0,0,0,.08);
  --shadow-sm:     0 1px 6px  rgba(0,0,0,.05);
  --content-max:   900px;
}

html, body { height: 100%; }
body {
  font-family: 'Pretendard', 'Noto Sans KR', system-ui, sans-serif;
  background: var(--bg);
  color: #111111;
  line-height: 1.7;
  min-height: 100vh;
}

/* ── 단계 전환 ───────────────────────────────────────────────── */
.step        { display: none; }
.step.active { display: block; animation: fadeUp .28s ease; }

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

/* ══════════════════════════════════════════════════════════════
   PAGE WRAP
══════════════════════════════════════════════════════════════ */
.page-wrap {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 3rem 2.5rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.page-wrap--center {
  text-align: center;
  align-items: center;
}

/* ── 페이지 헤더 ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--border);
}

.page-header h1 {
  font-size: 1.55rem;
  font-weight: 800;
  color: #111111;
  line-height: 1.25;
}

.page-sub {
  font-size: .9rem;
  color: #111111;
  line-height: 1.6;
}

/* ── 카드 ────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.6rem 2rem;
}

/* ── 안내 박스 ───────────────────────────────────────────────── */
.notice-box {
  background: var(--primary-lite);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  margin-bottom: 1rem;
}

.notice-lead {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: .5rem;
  color: #111111;
}

.notice-list {
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .32rem;
  font-size: .88rem;
  color: #111111;
}

/* ── 구분선 ──────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: .6rem 0; }

/* ── 동의 체크박스 ───────────────────────────────────────────── */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  cursor: pointer;
  font-size: .93rem;
  line-height: 1.6;
  padding: .9rem 1.1rem;
  background: #fafafa;
  border: 1.5px solid #d3d3d3;
  border-radius: var(--radius);
  transition: background .14s;
}
.check-row:hover { background: var(--primary-lite); }
.check-row input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--primary);
  flex-shrink: 0;
  margin-top: .2rem;
}

/* ── 공통 버튼 ───────────────────────────────────────────────── */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .7rem 2rem;
  border-radius: var(--radius);
  border: none;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .14s, transform .1s, opacity .14s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #111111;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-d);
  transform: translateY(-1px);
}
.btn-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--border);
  color: #111111;
}
.btn-secondary:hover { background: #d4d4d4; }

.btn-full { width: 100%; }
.btn-row { display: flex; justify-content: flex-end; margin-top: .4rem; }

/* ══════════════════════════════════════════════════════════════
   STEP 1 : 조건 선택 버튼
══════════════════════════════════════════════════════════════ */
.branch-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.8rem;
}

.branch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  /* PC 가로: 높이 충분히 확보 */
  padding: 3rem 2rem;
  background: var(--card-bg);
  border: 2.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow-sm);
  font-size: 1.35rem;
  font-weight: 800;
  color: #111111;
  letter-spacing: -.01em;
  transition: border-color .18s, box-shadow .18s, transform .15s, background .15s;
}

.branch-btn:hover {
  border-color: var(--ctrl-color);
  background: var(--ctrl-lite);
  box-shadow: 0 6px 24px rgba(0,0,0,.15);
  transform: translateY(-3px);
}

.branch-btn--exp:hover {
  border-color: var(--exp-color);
  background: var(--exp-lite);
  box-shadow: 0 6px 24px rgba(0,0,0,.15);
}

.branch-btn:active { transform: translateY(0); }

/* ══════════════════════════════════════════════════════════════
   STEP 2 / 3 : 지시문
══════════════════════════════════════════════════════════════ */
.instruct-card {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  padding: 2.4rem 2.8rem;
}

/* 강조 첫 문장 */
.instruct-lead {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111111;
  line-height: 1.5;
}

/* 본문 단락 묶음 */
.instruct-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: .96rem;
  color: #111111;
  line-height: 1.85;
}

/* 병변 번호 목록 */
.lesion-list {
  padding-left: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  font-size: .93rem;
  line-height: 1.7;
  color: #111111;
}
.lesion-list strong { font-weight: 700; }

/* 병변 이름 나열 단락 */
.lesion-names {
  margin: 1rem 0;
  font-size: 1.08rem;
  line-height: 2;
  text-align: center;
}
.lesion-names strong {
  font-weight: 700;
  font-size: 1.12rem;
}

/* "준비되었으면" 강조 단락 */
.instruct-ready {
  font-weight: 600;
  color: #111111;
}

/* 화살표 버튼 (→) */
.btn-arrow {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  border: 2.5px solid var(--primary);
  background: #ffffff;
  color: #111111;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .14s, color .14s, transform .1s;
  flex-shrink: 0;
}
.btn-arrow:hover {
  background: var(--primary);
  color: #111111;
  transform: translateX(4px);
}

/* ══════════════════════════════════════════════════════════════
   STEP 4 : 설문 폼
══════════════════════════════════════════════════════════════ */
.survey-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

fieldset {
  border: none;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

legend {
  font-weight: 700;
  font-size: .96rem;
  color: #111111;
  margin-bottom: .25rem;
  line-height: 1.5;
}

/* 라디오 그리드 (Q1 연령대) – PC에서 4칸 가로 */
.radio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .65rem;
}

.radio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .75rem .4rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .88rem;
  font-weight: 500;
  transition: border-color .14s, background .14s;
  text-align: center;
  background: #ffffff;
  white-space: nowrap;
}
.radio-card input[type="radio"] { accent-color: var(--primary); }
.radio-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-lite);
  color: #111111;
  font-weight: 700;
}
.radio-card:hover { border-color: var(--primary); background: #f7f7f7; }

/* 리커트 척도 행 (Q2, Q3) */
.scale-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.scale-label-end {
  font-size: .75rem;
  color: #111111;
  line-height: 1.3;
  text-align: center;
  min-width: 50px;
  flex-shrink: 0;
  white-space: nowrap;
}

.scale-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  color: #111111;
  padding: .55rem .1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: all .14s;
  background: #ffffff;
}
.scale-item input[type="radio"] {
  accent-color: var(--primary);
  width: 1rem;
  height: 1rem;
}
.scale-item:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-lite);
  color: #111111;
}
.scale-item:hover { border-color: var(--primary); background: #f7f7f7; }

/* 자극물 박스 */
.stimulus-box {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}
.stimulus-text {
  font-size: .9rem;
  color: #111111;
  line-height: 1.75;
}

/* textarea */
textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem .9rem;
  font-size: .9rem;
  font-family: inherit;
  resize: vertical;
  color: #111111;
  transition: border-color .14s;
  background: #ffffff;
}
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,0,0,.1);
}

/* 폼 하단 */
.form-footer-card { padding: 1.2rem 2rem; }

/* ── 공통 텍스트 ─────────────────────────────────────────────── */
.muted { font-size: .88rem; color: #111111; }

/* ══════════════════════════════════════════════════════════════
   STEP 5 / E : 완료·오류
══════════════════════════════════════════════════════════════ */
.result-card {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 3rem 3.5rem;
  text-align: center;
  max-width: 460px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.result-card h2 { font-size: 1.35rem; font-weight: 800; }

.result-icon {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 900;
}
.result-icon--ok  { background: #f4f4f4; color: #111111; }
.result-icon--err { background: #e8e8e8; color: #111111; }

/* ══════════════════════════════════════════════════════════════
   STEP-LEARNING : 자동 이미지 슬라이드
══════════════════════════════════════════════════════════════ */
#step-learning {
  background: var(--bg);   /* 다른 페이지와 동일한 옅은 회색 */
}

.learning-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  min-height: 100vh;
  gap: 1.4rem;
  /* 클릭·드래그·선택 모두 차단 */
  user-select: none;
  -webkit-user-select: none;
}

#learn-img {
  max-width: min(48vh, 54vw);   /* 80 * 0.6 = 48, 90 * 0.6 = 54 */
  max-height: 43.2vh;           /* 72 * 0.6 = 43.2 */
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  /* 이미지 자체에도 pointer-events 차단 */
  pointer-events: none;
}

#learn-label {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111111;
  letter-spacing: .02em;
  text-align: center;
  pointer-events: none;
}

/* 임시 skip 버튼 */
.btn-skip {
  margin-top: .6rem;
  padding: .4rem 1.1rem;
  border: 1.5px dashed var(--muted);
  border-radius: 6px;
  background: transparent;
  color: #111111;
  font-size: .8rem;
  cursor: pointer;
  /* skip 버튼만 pointer-events 허용 (나머지는 none) */
  pointer-events: auto;
  transition: border-color .14s, color .14s;
}
.btn-skip:hover {
  border-color: var(--primary);
  color: #111111;
}

/* ══════════════════════════════════════════════════════════════
   STEP-TASK : 과제 페이지 — 2열 한 화면 레이아웃
══════════════════════════════════════════════════════════════ */

/* 과제 화면 전체: 뷰포트 꽉 채우기 */
.task-screen {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  padding: .5rem 1rem .3rem;
  box-sizing: border-box;
  overflow: hidden;
}

/* skip 버튼 행 */
.task-skip-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: .2rem;
}

/* 진행바 — 인라인 가로형 */
.task-prog-inline {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: .4rem;
}
.task-prog-inline .task-progress-text {
  font-size: .8rem;
  color: #111111;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.task-prog-inline .task-progress-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

/* 기존 진행바 (다른 곳 호환) */
.task-progress-bar {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.task-progress-text {
  font-size: .85rem;
  color: #111111;
  font-weight: 600;
  text-align: right;
}
.task-progress-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.task-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width .4s ease;
  width: 0%;
}

/* 2열 컨테이너 */
.task-cols {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

/* 왼쪽: 이미지 열 */
.task-col-img {
  flex: 0 0 42%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9f9f9;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* 과제/시험 이미지 — 왼쪽 열 채우기 */
.task-img-main {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* 오른쪽: 박스 스택 열 */
.task-col-boxes {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  overflow-y: auto;
}

/* 개별 박스 */
.task-box {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .7rem .9rem;
  transition: border-color .2s;
}
.task-box--active {
  border-color: var(--primary);
}
/* 잠긴 박스(응답 완료): 배경 연하게, 입력 불가 */
.task-box--locked {
  background: #f8f8f8;
  border-color: var(--border);
  opacity: .85;
  pointer-events: none;
}
.task-box-label {
  font-size: .78rem;
  font-weight: 700;
  color: #111111;
  margin: 0 0 .25rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.task-box-desc {
  font-size: .82rem;
  color: #111111;
  margin: 0 0 .4rem;
  line-height: 1.5;
}

/* 작은 버튼 */
.btn-sm {
  padding: .38rem .9rem;
  font-size: .88rem;
}

/* task-img-card (구 코드 호환) */
.task-img-card {
  display: flex;
  justify-content: center;
  padding: 1.2rem;
}
.task-img {
  max-width: 100%;
  max-height: 264px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}
.task-phase { display: flex; flex-direction: column; gap: 1.2rem; }

/* 객관식 선택지 */
.task-choices {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-top: .6rem;
}
/* compact 모드 (박스 내부) */
.task-choices--compact {
  gap: .22rem;
  margin-top: .3rem;
}

.task-choice {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .95rem;
  background: #ffffff;
  transition: border-color .14s, background .14s;
  user-select: none;
}
/* compact 박스 안 선택지 */
.task-choices--compact .task-choice {
  padding: .32rem .7rem;
  font-size: .85rem;
  gap: .5rem;
}
.task-choice:hover { border-color: var(--primary); background: var(--primary-lite); }
.task-choice input[type="radio"] {
  accent-color: var(--primary);
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.task-choice:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-lite);
  font-weight: 700;
  color: #111111;
}

/* 선택지 알파벳 (A. B. C. ...) */
.task-choice-alpha {
  font-weight: 700;
  color: #111111;
  min-width: 1.4rem;
  flex-shrink: 0;
}
.task-choice:has(input:checked) .task-choice-alpha {
  color: #111111;
}

/* 신뢰도 슬라이더 (실험조건 전용 중간 페이지) */
.confidence-wrap {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: .9rem;
}

.confidence-slider {
  width: 100%;
  accent-color: var(--primary);
  height: 6px;
  cursor: pointer;
}

.confidence-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.confidence-label-end {
  font-size: .82rem;
  color: #111111;
  min-width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}

.confidence-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #111111;
  min-width: 3rem;
  text-align: center;
}

/* AI 피드백 */
.ai-label-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: .8rem;
  font-size: 1rem;
}
.ai-badge {
  display: inline-block;
  background: #efefef;
  color: #111111;
  border-radius: 5px;
  padding: .2rem .6rem;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}
.ai-reason {
  font-size: .93rem;
  color: #111111;
  line-height: 1.8;
  padding: .9rem 1rem;
  background: #fafafa;
  border-left: 3px solid #575757;
  border-radius: 0 6px 6px 0;
}

/* ══════════════════════════════════════════════════════════════
   수학 문제 페이지
══════════════════════════════════════════════════════════════ */
.math-timer-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .6rem;
  margin-bottom: .8rem;
}
.math-timer-label {
  font-size: .88rem;
  color: #111111;
  font-weight: 500;
}
.math-timer {
  font-size: 1.4rem;
  font-weight: 700;
  color: #111111;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  background: var(--primary-lite);
  padding: .25rem .8rem;
  border-radius: 8px;
}
.math-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 3rem 2.5rem;
}
.math-question {
  font-size: 2.6rem;
  font-weight: 700;
  color: #111111;
  letter-spacing: .02em;
  text-align: center;
  line-height: 1.2;
}
.math-input-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  width: 100%;
  max-width: 420px;
}
#math-form {
  margin-inline: auto;
  justify-content: center;
}
#math-form .math-input { min-width: 0; }
.math-input {
  flex: 1;
  height: 3.4rem;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0 1rem;
  background: #fafafa;
  color: #111111;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -moz-appearance: textfield;
}
.math-input::-webkit-inner-spin-button,
.math-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.math-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,0,0,.15);
  background: #ffffff;
}
.math-input-row .btn-primary {
  height: 3.4rem;
  min-width: 5rem;
  font-size: 1rem;
  border-radius: 12px;
}

/* ── 사후 설문 인구통계 ────────────────────────────────────────── */
.demog-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 1rem;
}
.demog-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.demog-label {
  min-width: 5rem;
  font-weight: 600;
  font-size: .95rem;
  color: #111111;
  flex-shrink: 0;
}
.demog-input {
  flex: 1;
  max-width: 280px;
  height: 2.8rem;
  padding: 0 1rem;
  font-size: 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
  color: #111111;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.demog-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,0,0,.13);
  background: #ffffff;
}
.demog-radio-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.demog-radio {
  display: flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  padding: .5rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .93rem;
  transition: border-color .15s, background .15s;
}
.demog-radio:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-lite);
  color: #111111;
  font-weight: 600;
}
.demog-radio input { display: none; }

/* ══════════════════════════════════════════════════════════════
   AI 지식·태도 설문 (step-ai-survey)
══════════════════════════════════════════════════════════════ */

/* 섹션 안내문 */
.ai-survey-section {
  font-size: .93rem;
  color: #111111;
  line-height: 1.8;
  background: var(--primary-lite);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .85rem 1.1rem;
  margin: 1.2rem 0 .6rem;
}

/* 문항 래퍼 – 등장 시 fade-in */
.ai-survey-item {
  padding: .9rem 0;
  border-bottom: 1px solid var(--border);
  animation: fadeUp .22s ease;
}
.ai-survey-item:last-child { border-bottom: none; }

/* 문항 텍스트 */
.ai-survey-q {
  font-size: 1rem;
  font-weight: 600;
  color: #111111;
  line-height: 1.6;
  margin-bottom: .7rem;
}

/* 맞다/틀리다 선택지 행 */
.ai-choice-yn {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
}

/* 4점 리커트 선택지 행 */
.ai-choice-likert4 {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
}

/* 공통 라디오 라벨 */
.ai-radio-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: .93rem;
  background: #ffffff;
  transition: border-color .14s, background .14s;
  user-select: none;
}
.ai-radio-label:hover {
  border-color: var(--primary);
  background: var(--primary-lite);
}
.ai-radio-label input[type="radio"] {
  accent-color: var(--primary);
  width: .95rem;
  height: .95rem;
  flex-shrink: 0;
}
.ai-radio-label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-lite);
  font-weight: 700;
  color: #111111;
}


/* ══════════════════════════════════════════════════════════════
   반응형
══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .page-wrap { padding: 2rem 1rem 3rem; gap: 1.2rem; }
  .page-header h1 { font-size: 1.3rem; }
  .card { padding: 1.2rem 1rem; }
  .instruct-card { padding: 1.6rem 1.2rem; }
  .branch-wrap { gap: 1rem; }
  .branch-btn { padding: 1.6rem 1rem; font-size: 1.1rem; }
  .radio-grid { grid-template-columns: repeat(2, 1fr); }
  .scale-row { gap: .3rem; }
  .scale-label-end { min-width: 36px; font-size: .7rem; }
  .result-card { padding: 2rem 1.2rem; }
}

/* ── 인라인 에러 메시지 ─────────────────────────────── */
.inline-err {
  color: #111111;
  font-size: .9rem;
  font-weight: 600;
  margin: .6rem 0 0;
  padding: .4rem .8rem;
  background: #f7f7f7;
  border-left: 3px solid #b91c1c;
  border-radius: 4px;
}


/* Thesis: minimal monochrome interface */
:root {
  --primary:#111111; --primary-d:#111111; --primary-lite:#f3f3f3;
  --ctrl-color:#111111; --ctrl-lite:#f3f3f3;
  --exp-color:#111111; --exp-lite:#f3f3f3;
  --success:#111111; --danger:#b91c1c;
  --bg:#ffffff; --card-bg:#ffffff; --border:#d4d4d4;
  --text:#111111; --muted:#111111;
  --radius:4px; --shadow:none; --shadow-sm:none;
}
body { background:#ffffff; }
.card, .result-card, .branch-btn { box-shadow:none; }
.btn-primary, .btn-arrow { background:#ededed; border:1px solid #111111; color:#111111; box-shadow:none; }
.btn-primary:hover:not(:disabled), .btn-arrow:hover:not(:disabled) { background:#d8d8d8; color:#111111; box-shadow:none; }
.branch-btn:hover, .branch-btn--exp:hover { background:#f3f3f3; box-shadow:none; transform:none; }
.inline-err, .result-icon--err, .error-msg { color:#b91c1c; }
.result-icon--err { background:#f3f3f3; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline:2px solid #111111; outline-offset:3px; }
::placeholder { color:#111111; opacity:1; }
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { animation:none!important; transition:none!important; } }

.btn-primary:disabled { opacity:1; background:#f3f3f3; border-color:#d4d4d4; }
.task-box--locked { opacity:1; }

/* Common two-group protocol */
[hidden] { display:none!important; }
.branch-wrap { flex-wrap:wrap; }
.branch-btn { min-width:230px; font-size:1.1rem; }
.stimulus-empty { width:100%; min-height:280px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.5rem; border:1px solid #d4d4d4; background:#f3f3f3; color:#111111; }
.trial-progress { font-size:.9rem; margin-bottom:1rem; color:#111111; }
.learn-name { text-align:center; margin-top:1rem; font-size:1.4rem; font-weight:700; }
.jol-question { display:block; line-height:1.8; font-size:1.05rem; margin-bottom:1.5rem; }
.jol-question span { font-size:.93rem; }
.written-answer { display:block; width:100%; margin-top:1rem; }
#category-reference { border-bottom:1px solid #d4d4d4; padding-bottom:1rem; margin-bottom:1rem; line-height:2; }
.score-display { margin:2rem 0; font-size:1.3rem; }
.score-display strong { font-size:3rem; }
.preview-score-note { font-size:.88rem; margin-top:1rem; }
.review-task-layout { display:grid; grid-template-columns:minmax(240px, 1fr) minmax(320px, 1.25fr); gap:1rem; align-items:start; }
.task-boxes { display:flex; flex-direction:column; gap:1rem; }
.task-box h2 { font-size:1rem; margin-bottom:.7rem; }
.ai-result-empty { min-height:100px; border:1px solid #d4d4d4; padding:1rem; background:#f3f3f3; }
.ai-result-empty p + p { margin-top:.7rem; }
.initial-instruction { border-top:1px solid #d4d4d4; margin-top:1.5rem; padding-top:1.5rem; white-space:normal; }
@media(max-width:760px) { .review-task-layout { grid-template-columns:1fr; } .branch-btn { min-width:180px; } }

/* Input hints are gray; participant-entered values remain black. */
input, textarea, select { color:#111111; -webkit-text-fill-color:#111111; }
input::placeholder, textarea::placeholder { color:#808080; -webkit-text-fill-color:#808080; opacity:1; }
.temporary-controls { max-width:900px; margin:0 auto; padding:0 2.5rem 2rem; display:flex; justify-content:flex-end; }
.preview-footer { max-width:900px; margin:0 auto; padding:1rem 2.5rem; font-size:.85rem; color:#111111; display:flex; flex-wrap:wrap; align-items:center; gap:1rem; }
.preview-footer button { border:1px solid #111111; background:#ffffff; color:#111111; padding:6px 12px; border-radius:4px; cursor:pointer; font:inherit; }

/* Increase only the intervention instruction text (from .96rem to 1.1rem). */
.instruct-body .intervention-instruction { display:flex; flex-direction:column; gap:1.85em; font-size:1.1rem; line-height:1.85; font-weight:400; }
.intervention-instruction p { font-weight:400; }
.intervention-instruction strong { font-weight:700; }

.intervention-instruction .intervention-evidence { font-size:1.2rem; }
