/* ===== 스터디 UI — 미니멀: 흰 배경, 시스템 폰트, 무채색 ===== */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #ffffff;
  color: #1a1a1a;
  font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 32px 20px 80px; }

h1 { font-size: 1.5em; margin: 0 0 16px; }
h2 { font-size: 1.15em; margin: 24px 0 10px; }
p { margin: 0.6em 0; }
.lead { color: #444; }
.muted { color: #888; font-size: 0.9em; }
u { text-underline-offset: 3px; }

.progress { color: #777; font-size: 0.9em; margin-bottom: 14px; }

.card {
  border: 1px solid #ddd; border-radius: 6px;
  padding: 16px 18px; margin: 14px 0; background: #fafafa;
}
pre.consent {
  white-space: pre-wrap; font-family: inherit; font-size: 0.96em;
  margin: 0; color: #333;
}

/* 버튼 */
.btn-primary {
  display: block; width: fit-content; margin: 18px 0 0 auto;
  background: #333; color: #fff; border: none;
  padding: 11px 28px; font-size: 1em; border-radius: 5px; cursor: pointer;
}
.btn-primary:hover { background: #000; }

/* 동의 버튼 — 중앙 정렬 + 크게 */
.btn-consent {
  margin: 28px auto 0;
  padding: 16px 52px; font-size: 1.15em; border-radius: 6px;
}

/* 인구통계 라디오 */
.q-label { font-weight: 700; margin-bottom: 8px; }

/* 응답필수 표시 — 빨간 * */
.req {
  color: #c0392b;
  font-weight: 700;
  margin-left: 4px;
}
.opt { display: block; padding: 4px 0; cursor: pointer; }

/* 자유 입력 (성명·연락처·자유응답) */
.text-input {
  width: 100%; padding: 9px 11px; margin-top: 4px;
  font-family: inherit; font-size: 1em;
  border: 1px solid #ccc; border-radius: 5px;
}
textarea.text-input { resize: vertical; line-height: 1.6; }

/* ===== 설문 (4문항 Likert) ===== */
.survey-h { border-top: 1px solid #ddd; padding-top: 18px; }
.survey-q { margin: 16px 0; }
.survey-text { margin-bottom: 8px; }
.likert {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  justify-content: space-between;
}
.likert-end { font-size: 0.78em; color: #333; text-align: center; width: 60px; line-height: 1.2; }
.likert-pt {
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer; padding: 2px 6px;
}
.likert-pt span { font-size: 0.85em; color: #555; }

/* ===== DC Inside 재현 자극 ===== */
.dc {
  border: 1px solid #c8c8c8; border-radius: 4px;
  margin: 16px 0 8px; background: #fff;
  font-size: 0.95em;
}
.dc-title {
  font-size: 1.05em; font-weight: 700; color: #111;
  padding: 14px 16px 8px;
}
.dc-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  padding: 0 16px 10px; border-bottom: 1px solid #e3e3e3;
  font-size: 0.82em; color: #888;
}
.dc-writer { color: #3b6aa0; }
.dc-body {
  padding: 18px 16px; color: #222; white-space: pre-wrap; line-height: 1.75;
}
/* Post image */
.dc-imgwrap { padding: 0 16px 14px; text-align: center; }
.dc-img {
  max-width: 100%; width: auto; height: auto; max-height: 340px;
  border: 1px solid #e3e3e3; border-radius: 6px; display: inline-block; vertical-align: top;
}
@media (max-width: 520px) { .dc-img { max-height: 280px; } }

/* YouTube video mockup (static placeholder — not a real embed) */
.yt-mock {
  margin: 0 16px 14px; border: 1px solid #e3e3e3; border-radius: 8px;
  overflow: hidden; background: #fff;
}
.yt-thumb {
  position: relative; width: 100%; padding-bottom: 56.25%; /* 16:9 */
  background: linear-gradient(135deg, #4a4a52 0%, #1c1c22 100%);
}
.yt-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 68px; height: 48px; background: #ff0000; border-radius: 13px;
}
.yt-play::after {
  content: ""; position: absolute; top: 50%; left: 53%; transform: translate(-50%, -50%);
  border-style: solid; border-width: 11px 0 11px 19px;
  border-color: transparent transparent transparent #fff;
}
.yt-badge {
  position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.65); color: #fff;
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 3px; letter-spacing: .3px;
}
.yt-dur {
  position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.8); color: #fff;
  font-size: 11px; padding: 1px 5px; border-radius: 3px;
}
.yt-info { display: flex; gap: 9px; padding: 10px 12px; align-items: flex-start; }
.yt-ava { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #c4302b; }
.yt-text { display: flex; flex-direction: column; }
.yt-vtitle { font-size: 13.5px; font-weight: 600; color: #0f0f0f; line-height: 1.3; }
.yt-meta { font-size: 11.5px; color: #606060; margin-top: 2px; }
.yt-note { margin: 6px 16px 14px; font-size: 11.5px; color: #8a6d3b; font-style: italic; line-height: 1.4; }
.dc-rec {
  display: flex; justify-content: center; gap: 10px;
  padding: 8px 16px 14px;
}
.dc-rec-up, .dc-rec-down {
  border: 1px solid #ccc; border-radius: 3px;
  padding: 5px 16px; font-size: 0.85em; color: #666;
}
.dc-rec-up { color: #c0392b; }
.dc-rec-down { color: #2c5aa0; }
.dc-cmt-head {
  background: #f4f4f4; border-top: 1px solid #e3e3e3;
  padding: 8px 16px; font-size: 0.85em; font-weight: 700; color: #555;
}
.dc-cmt-list { padding: 0 16px; }
.dc-cmt { padding: 11px 0; border-bottom: 1px solid #eee; }
.dc-cmt:last-child { border-bottom: none; }
.dc-cmt-info { display: flex; gap: 10px; font-size: 0.8em; color: #999; margin-bottom: 3px; }
.dc-cmt-time { color: #aaa; }
.dc-cmt-text { color: #222; }

/* ===== 댓글 묶음(메서드별) 평가 블록 — Study 1 통합형 ===== */
.cmset {
  border: 1px solid #d6d6d6; border-radius: 6px;
  margin: 18px 0; padding: 0 0 14px; background: #fcfcfc;
}
.cmset-head {
  background: #f0f2f4; border-bottom: 1px solid #e3e3e3;
  padding: 9px 16px; font-weight: 700; color: #444; font-size: 0.92em;
  border-radius: 6px 6px 0 0;
}
.cmset-tag {
  display: inline-block; min-width: 22px; text-align: center;
  background: #333; color: #fff; border-radius: 4px;
  padding: 1px 8px; margin-left: 4px; font-size: 0.92em;
}
.cmset .dc-cmt-list { padding: 6px 16px 0; }
.cmset .survey-h {
  margin: 10px 16px 0; padding-top: 14px; font-size: 1.02em;
}
.cmset .survey { padding: 0 16px; }

/* ===== Study 2 채팅 ===== */
.topic-card {
  border: 1px solid #ccc; border-left: 4px solid #555;
  border-radius: 4px; padding: 12px 16px; margin: 8px 0 14px; background: #fafafa;
}
.topic-label { font-size: 0.8em; color: #888; font-weight: 700; margin-bottom: 4px; }
.topic-text { color: #222; }

.chat {
  border: 1px solid #ccc; border-radius: 6px;
  height: min(380px, 52vh); overflow-y: auto; padding: 14px; background: #fff;
}
.msg {
  max-width: 78%; padding: 9px 13px; margin: 7px 0;
  border-radius: 12px; white-space: pre-wrap; line-height: 1.6;
}
.msg-user { background: #333; color: #fff; margin-left: auto; border-bottom-right-radius: 3px; }
.msg-bot  { background: #eee; color: #1a1a1a; margin-right: auto; border-bottom-left-radius: 3px; }

.chat-input { display: flex; gap: 8px; margin-top: 10px; }
.chat-input textarea {
  flex: 1; resize: none; padding: 9px 11px; font-family: inherit; font-size: 1em;
  border: 1px solid #ccc; border-radius: 5px;
}
.btn-send {
  background: #333; color: #fff; border: none; padding: 0 22px;
  border-radius: 5px; cursor: pointer; font-size: 1em;
}
.btn-send:hover { background: #000; }
.btn-send:disabled { background: #aaa; cursor: default; }
.turn-note { color: #888; font-size: 0.88em; margin-top: 8px; }

.hidden { display: none; }

/* 완료 코드 */
.code-box {
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 1.3em;
  background: #f0f0f0; border: 1px dashed #999; border-radius: 5px;
  padding: 14px; text-align: center; margin: 14px 0; letter-spacing: 1px;
}

/* ===== 모바일 (좁은 화면) ===== */
@media (max-width: 520px) {
  body { font-size: 15px; }
  .wrap { padding: 24px 14px 64px; }
  /* Likert: 끝 라벨 축소, 7점은 한 줄 유지, 라디오 터치 영역 확대 */
  .likert { gap: 2px; }
  .likert-end { width: 40px; font-size: 0.68em; }
  .likert-pt { padding: 9px 4px; }
  .dc-meta { gap: 8px; }
  .msg { max-width: 86%; }
  .btn-send { padding: 0 16px; }
}
