/* 썸코치 웹 P0 — Berry & Cream 토큰 (덱/Flutter와 동일 계열)
   원칙: 화면당 강조 하나(호감 온도), 나머지는 조용하게. */

:root {
  --plum: #6d2e46;
  --plum-deep: #571f36;
  --blush: #a26769;
  --cream: #f4ede3;
  --paper: #ffffff;
  --ink: #2b2323;
  --mute: #8a7b7b;
  --ok: #3e7c4f;
  --warn: #b05b2c;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ---------- 공통 요소 ---------- */
h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 18px; font-weight: 800; }
.sub { color: var(--mute); font-size: 15px; margin-top: 8px; }
.spacer { flex: 1; }

.btn {
  display: block;
  width: 100%;
  padding: 15px;
  border: 0;
  border-radius: var(--radius);
  background: var(--plum);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.btn:active { background: var(--plum-deep); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.ghost {
  background: transparent;
  color: var(--plum);
  border: 1.5px solid var(--plum);
}
.btn.quiet { background: transparent; color: var(--mute); font-weight: 600; }
.btn + .btn { margin-top: 10px; }
.btn.kakao { background: #fee500; color: #191600; }

.card {
  background: var(--paper);
  border-radius: 16px;
  padding: 18px;
}
.card + .card { margin-top: 12px; }

/* 진행바 */
.progress { height: 4px; background: var(--paper); border-radius: 2px; margin-bottom: 28px; }
.progress > i { display: block; height: 100%; background: var(--plum); border-radius: 2px; transition: width .25s ease; }

/* 선택지 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  padding: 10px 16px;
  border-radius: 20px;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.chip.on { background: var(--plum); color: #fff; }

.choice-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.choice {
  text-align: left;
  padding: 17px;
  border-radius: var(--radius);
  border: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.choice.on { background: var(--plum); color: #fff; }

.field {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
}
.field::placeholder { color: var(--mute); }
.field:focus { outline: 2px solid var(--plum); }

.label { font-weight: 700; font-size: 15px; margin-top: 22px; }

/* ---------- 홈 ---------- */
.partner-name { font-size: 20px; font-weight: 800; }
.partner-stage { color: var(--blush); font-size: 14px; margin-top: 4px; }
.temp-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 16px; }
.temp-big { font-size: 46px; font-weight: 800; color: var(--plum); line-height: 1; }
.temp-note { color: var(--mute); font-size: 13px; padding-bottom: 5px; }

/* ---------- 분석 ---------- */
.paste {
  flex: 1;
  min-height: 240px;
  resize: none;
  margin-top: 12px;
}

/* ---------- 결과 ---------- */
.affinity {
  background: var(--plum);
  color: #fff;
  border-radius: 16px;
  padding: 22px;
}
.affinity .temp { font-size: 56px; font-weight: 800; line-height: 1; }
.affinity .trend { color: #ecdce2; font-size: 14px; }
.affinity ul { margin: 14px 0 0; padding-left: 18px; font-size: 14px; }

.signal { display: flex; gap: 10px; align-items: baseline; }
.signal .tag { font-weight: 700; white-space: nowrap; }
.signal .tag.positive { color: var(--ok); }
.signal .tag.caution { color: var(--warn); }
.signal .tag.neutral { color: var(--mute); }
.signal .quote { color: var(--ink); }

.sug { position: relative; }
.sug .type { color: var(--blush); font-size: 13px; font-weight: 700; }
.sug .text { font-size: 16px; font-weight: 600; margin-top: 5px; padding-right: 44px; }
.sug .meta { color: var(--mute); font-size: 12.5px; margin-top: 6px; }
.sug .copy {
  position: absolute; top: 12px; right: 10px;
  border: 0; background: none; cursor: pointer;
  font-size: 18px; color: var(--plum); padding: 6px;
}
.coach-note { color: var(--mute); font-size: 13px; margin-top: 10px; }

/* 프로필 델타 시트 */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(43, 35, 35, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 430px;
  background: var(--cream);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
}
.kv { display: flex; gap: 10px; margin-top: 8px; font-size: 15px; }
.kv b { width: 76px; flex: none; color: var(--mute); font-weight: 600; }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet-actions .btn { margin-top: 0; }

/* ---------- 시뮬레이터 ---------- */
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 0 12px; }
.bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15px;
  white-space: pre-wrap;
}
.bubble.me { align-self: flex-end; background: var(--plum); color: #fff; }
.bubble.them { align-self: flex-start; background: var(--paper); }
.typing { color: var(--mute); font-size: 12px; padding: 4px 0; }
.chat-input { display: flex; gap: 8px; }
.chat-input input { flex: 1; margin-top: 0; border-radius: 24px; }
.chat-input .send {
  flex: none; width: 48px; height: 48px;
  border: 0; border-radius: 50%;
  background: var(--plum); color: #fff;
  font-size: 18px; cursor: pointer;
}

.report h3 { font-size: 15px; margin-top: 14px; }
.report h3.good { color: var(--ok); }
.report h3.improve { color: var(--blush); }
.report h3.tip { color: var(--plum); }
.report p, .report li { font-size: 15px; }
.report ul { padding-left: 18px; margin-top: 4px; }

/* 상단 바 */
.topbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.topbar .back { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--ink); padding: 4px 8px 4px 0; }
.topbar .title { font-weight: 700; }
.topbar .end { margin-left: auto; border: 0; background: none; color: var(--plum); font-weight: 700; cursor: pointer; font-size: 15px; }

/* 토스트 */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 20px; font-size: 14px;
  max-width: 90vw;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- 스크린샷 업로드 ---------- */
.image-area { flex: 1; margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.thumb {
  position: relative; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden;
  background: var(--paper); border: 0; padding: 0; cursor: default;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.add {
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--plum); cursor: pointer;
  border: 1.5px dashed var(--blush);
}
.thumb-idx {
  position: absolute; top: 6px; left: 6px;
  background: var(--plum); color: #fff; font-size: 11px; font-weight: 700;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.thumb-x {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: rgba(43,35,35,0.7); color: #fff; font-size: 14px; cursor: pointer;
}

/* ---------- 온보딩 상단 (이전 / 단계 표시) ---------- */
.onb-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; min-height: 28px;
}
.onb-back {
  border: 0; background: none; padding: 4px 8px 4px 0;
  color: var(--plum); font-size: 15px; font-weight: 600;
  font-family: inherit; cursor: pointer;
}
.onb-step { color: var(--mute); font-size: 13px; }

/* ---------- 안내 페이지 ---------- */
.link-btn {
  border: 0; background: none; padding: 6px 0;
  color: var(--blush); font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; text-align: left;
}
.about-h { font-weight: 700; font-size: 15px; }
.about-p { color: var(--mute); font-size: 14px; margin-top: 4px; line-height: 1.6; }
.about-step { display: flex; gap: 12px; }
.about-step + .about-step { margin-top: 16px; }
.about-num {
  flex: none; width: 24px; height: 24px; margin-top: 2px;
  border-radius: 50%; background: var(--plum); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}