/* 공명 회생진단 — 대화형(챗) 자가진단 화면 스타일. v=20260716-chat */
:root {
  --sc-bg: #eef1f6;
  --sc-surface: #ffffff;
  --sc-ink: #0f1218;
  --sc-body: #3d424d;
  --sc-muted: #6b7280;
  --sc-line: rgba(15, 18, 24, 0.09);
  --sc-navy: #1a2640;
  --sc-point: #16407a;
  --sc-navy-soft: rgba(26, 38, 64, 0.06);
  /* 카카오톡 톤 */
  --sc-kakao-bg: #b2c7d9;
  --sc-kakao-yellow: #fee500;
  --sc-kakao-ink: #3c1e1e;
  --sc-kakao-time: #5a7183;
  --sc-accent: #dc4a50;
  --sc-accent-soft: rgba(220, 74, 80, 0.08);
  --sc-trust: #1a6b4a;
  --sc-trust-soft: rgba(26, 107, 74, 0.08);
  --sc-radius: 16px;
  --sc-shadow: 0 12px 34px rgba(26, 38, 64, 0.10);
}
* { box-sizing: border-box; }
.sc-body {
  margin: 0;
  background:
    radial-gradient(circle at 8% -4%, rgba(26, 38, 64, 0.07), transparent 34%),
    radial-gradient(circle at 96% 4%, rgba(220, 74, 80, 0.05), transparent 30%),
    var(--sc-bg);
  color: var(--sc-body);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
}
.sc-body a { color: inherit; text-decoration: none; }
.sc-body button { font: inherit; cursor: pointer; }
.sc-shell { width: min(640px, 100%); margin: 0 auto; padding: 0 16px; }

/* ── 헤더 ── */
.sc-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--sc-line);
}
.sc-header-inner {
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sc-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--sc-navy);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.sc-brand img { width: 26px; height: 26px; border-radius: 50%; object-fit: contain; }
.sc-header-phone {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1.5px solid rgba(26, 38, 64, 0.22);
  border-radius: 999px;
  color: var(--sc-navy);
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
  transition: background 0.15s;
}
.sc-header-phone:hover { background: var(--sc-navy-soft); }
.sc-progress { height: 4px; background: rgba(26, 38, 64, 0.08); }
.sc-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--sc-navy), #33507f);
  transition: width 0.3s ease;
}

/* ── 히어로 ── */
.sc-hero { padding: 30px 4px 18px; text-align: left; }
.sc-hero-eyebrow { margin: 0 0 6px; color: var(--sc-accent); font-size: 13px; font-weight: 900; }
.sc-hero h1 {
  margin: 0;
  color: var(--sc-ink);
  font-size: clamp(25px, 6vw, 34px);
  line-height: 1.28;
  font-weight: 900;
  letter-spacing: -0.04em;
  word-break: keep-all;
}
.sc-hero-sub { margin: 10px 0 0; color: var(--sc-body); font-size: 16px; word-break: keep-all; }
.sc-hero-sub strong { color: var(--sc-ink); }
.sc-hero-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.sc-hero-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(26, 38, 64, 0.12);
  border-radius: 999px;
  background: #fff;
  color: var(--sc-navy);
  font-size: 12.5px;
  font-weight: 800;
}

/* ── 채팅창 (카카오톡 스타일) ──
   내부 스크롤 박스를 두지 않는다. 대화는 페이지에 그대로 흐르고,
   답을 고르면 다음 질문이 화면 맨 위에 오도록 페이지가 움직인다. */
.sc-chat-card {
  position: relative;
  margin-top: 6px;
  padding: 12px 12px 16px;
  border: 1px solid #9fb6c9;
  border-radius: 18px;
  background: var(--sc-kakao-bg);
  box-shadow: var(--sc-shadow);
}
.sc-chat-day {
  position: sticky;
  top: 70px;
  z-index: 2;
  margin: 0 auto 10px;
  width: fit-content;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.sc-chat { display: flex; flex-direction: column; gap: 0; }

/* 말풍선 (카카오톡) — 한 화면에 많이 담기도록 촘촘하게 */
.sc-row { display: flex; margin-top: 6px; }
.sc-row.bot { justify-content: flex-start; }
.sc-row.user { justify-content: flex-end; }
.sc-bot-block { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 7px; max-width: 92%; }
.sc-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  overflow: hidden;
  background: #dfe6ee;
}
.sc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-avatar.ghost { visibility: hidden; height: 0; }
.sc-bot-name {
  margin: 0 0 3px;
  color: #33454f;
  font-size: 11.5px;
  font-weight: 700;
}
.sc-bot-name b { font-weight: 700; }
.sc-bubble-line { display: flex; align-items: flex-end; gap: 4px; }
.sc-bubble-line + .sc-bubble-line { margin-top: 3px; }
.sc-row.user .sc-bubble-line { justify-content: flex-end; max-width: 86%; }
.sc-time {
  flex: 0 0 auto;
  padding-bottom: 2px;
  color: var(--sc-kakao-time);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.sc-bubble {
  width: fit-content;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 3px 14px 14px 14px;
  border: 0;
  background: #fff;
  color: #1a1a1a;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.sc-bubble strong { color: var(--sc-point); font-weight: 800; }
.sc-bubble.hint { color: #5c6b78; font-size: 12.5px; background: rgba(255, 255, 255, 0.72); }
.sc-row.user .sc-bubble {
  border-radius: 14px 3px 14px 14px;
  background: var(--sc-kakao-yellow);
  color: var(--sc-kakao-ink);
  font-weight: 600;
}

/* 타이핑 표시 */
.sc-typing { display: inline-flex; gap: 4px; padding: 14px 16px; background: #fff; }
.sc-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(26, 38, 64, 0.35);
  animation: scTyping 1.1s infinite ease-in-out;
}
.sc-typing i:nth-child(2) { animation-delay: 0.15s; }
.sc-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes scTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* 답변 칩 */
.sc-options { display: flex; flex-direction: column; gap: 5px; margin: 8px 0 2px; padding-left: 41px; }
.sc-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 9px 13px;
  border: 1.5px solid rgba(26, 38, 64, 0.16);
  border-radius: 11px;
  background: #fff;
  color: var(--sc-ink);
  text-align: left;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
  word-break: keep-all;
  transition: border-color 0.14s, background 0.14s, transform 0.14s;
}
.sc-chip::after { content: "›"; color: rgba(26, 38, 64, 0.35); font-size: 16px; font-weight: 900; }
.sc-chip:hover { border-color: var(--sc-navy); background: #f6f9ff; transform: translateY(-1px); }
.sc-chip.selected {
  border-color: var(--sc-navy);
  background: #fffbe0;
}
.sc-chip.selected::after { content: "✓"; color: var(--sc-navy); }
.sc-options-multi-note { margin: 0 0 3px; padding-left: 41px; color: #33454f; font-size: 12px; font-weight: 700; }
.sc-options-actions { display: flex; gap: 8px; margin-top: 7px; padding-left: 41px; }
.sc-confirm {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: var(--sc-navy);
  color: #fff;
  font-size: 14.5px;
  font-weight: 900;
  transition: transform 0.12s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(26, 38, 64, 0.18);
}
.sc-confirm:hover { transform: translateY(-1px); }
.sc-confirm:disabled { opacity: 0.5; transform: none; cursor: default; }
.sc-back {
  margin: 6px 0 0 41px;
  padding: 6px 4px;
  border: 0;
  background: none;
  color: #3d5666;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  width: fit-content;
}
.sc-error {
  margin: 6px 0 0 41px;
  padding: 8px 12px;
  width: fit-content;
  border-radius: 10px;
  background: #fff;
  color: #b42318;
  font-size: 13.5px;
  font-weight: 800;
}

/* 결과 카드 */
.sc-result-card {
  margin: 8px 0 2px 41px;
  border: 1px solid rgba(26, 107, 74, 0.25);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #f6fff9, #eefaf2);
}
.sc-result-head { padding: 18px 18px 4px; }
.sc-result-band {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--sc-trust);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.sc-result-band.warn { background: #b7791f; }
.sc-result-head h2 {
  margin: 0;
  color: var(--sc-point);
  font-size: 23px;
  line-height: 1.35;
  font-weight: 900;
  letter-spacing: -0.03em;
  word-break: keep-all;
}
.sc-result-head p { margin: 9px 0 0; color: #33513f; font-size: 14.5px; font-weight: 650; line-height: 1.75; word-break: keep-all; }
.sc-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
}
.sc-result-grid article {
  padding: 13px 14px;
  border: 1px solid rgba(26, 107, 74, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}
.sc-result-grid span { display: block; margin-bottom: 4px; color: var(--sc-muted); font-size: 12px; font-weight: 750; }
.sc-result-grid strong { display: block; color: var(--sc-point); font-size: 17.5px; line-height: 1.4; word-break: keep-all; }
.sc-result-grid p { margin: 5px 0 0; color: var(--sc-muted); font-size: 12px; line-height: 1.5; word-break: keep-all; }
.sc-result-details { padding: 0 14px 14px; display: grid; gap: 8px; }
.sc-result-details details {
  border: 1px solid rgba(26, 38, 64, 0.1);
  border-radius: 12px;
  background: #fff;
  padding: 0 14px;
}
.sc-result-details summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  color: var(--sc-ink);
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}
.sc-result-details summary::-webkit-details-marker { display: none; }
.sc-result-details summary::after { content: "＋"; color: var(--sc-muted); }
.sc-result-details details[open] summary::after { content: "－"; }
.sc-result-details ul { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 6px; }
.sc-result-details li {
  position: relative;
  padding: 9px 10px 9px 28px;
  border-radius: 8px;
  background: #f7f9fc;
  color: #344054;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
  word-break: keep-all;
}
.sc-result-details li::before { content: "✓"; position: absolute; left: 10px; top: 9px; color: var(--sc-trust); font-weight: 900; }

/* 상담 카드 */
.sc-consult-card {
  margin: 8px 0 2px 41px;
  padding: 18px;
  border: 1px solid rgba(26, 38, 64, 0.14);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(26, 38, 64, 0.08);
}
.sc-consult-card h3 { margin: 0; color: var(--sc-ink); font-size: 18px; font-weight: 900; letter-spacing: -0.02em; word-break: keep-all; }
.sc-consult-card > p { margin: 7px 0 0; color: var(--sc-muted); font-size: 13.5px; font-weight: 650; line-height: 1.65; word-break: keep-all; }
.sc-consult-fields { display: grid; gap: 8px; margin-top: 14px; }
.sc-consult-fields input,
.sc-consult-fields textarea {
  width: 100%;
  border: 1.5px solid rgba(15, 18, 24, 0.12);
  border-radius: 12px;
  padding: 13px 14px;
  font: inherit;
  font-size: 15.5px;
  color: var(--sc-ink);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sc-consult-fields textarea { min-height: 84px; resize: vertical; }
.sc-consult-fields input:focus,
.sc-consult-fields textarea:focus { border-color: var(--sc-navy); box-shadow: 0 0 0 3px rgba(26, 38, 64, 0.08); }
.sc-consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid var(--sc-line);
  border-radius: 12px;
  background: #fafbfd;
  color: var(--sc-body);
  font-size: 12.5px;
  line-height: 1.6;
  cursor: pointer;
  word-break: keep-all;
}
.sc-consent input { width: 17px; height: 17px; margin-top: 2px; flex-shrink: 0; accent-color: var(--sc-navy); }
.sc-consent a { text-decoration: underline; text-underline-offset: 2px; }
.sc-consult-submit {
  width: 100%;
  min-height: 54px;
  margin-top: 12px;
  border: 0;
  border-radius: 14px;
  background: var(--sc-accent);
  color: #fff;
  font-size: 16.5px;
  font-weight: 900;
  box-shadow: 0 6px 18px rgba(220, 74, 80, 0.24);
  transition: transform 0.12s, box-shadow 0.15s;
}
.sc-consult-submit:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(220, 74, 80, 0.3); }
.sc-consult-submit:disabled { opacity: 0.55; transform: none; cursor: default; }
.sc-consult-alt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.sc-consult-alt a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1.5px solid rgba(26, 38, 64, 0.18);
  border-radius: 12px;
  background: #fff;
  color: var(--sc-navy);
  font-size: 14.5px;
  font-weight: 850;
  transition: background 0.15s;
}
.sc-consult-alt a:hover { background: var(--sc-navy-soft); }
.sc-consult-state { margin: 10px 0 0; color: var(--sc-trust); font-size: 13.5px; font-weight: 800; }
.sc-consult-state.error { color: #b42318; }

/* 관련 사례 */
.sc-related { margin: 8px 0 2px 41px; display: grid; gap: 7px; }
.sc-related strong { color: var(--sc-ink); font-size: 14px; font-weight: 900; }
.sc-related a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--sc-line);
  border-radius: 12px;
  background: #fff;
  color: var(--sc-navy);
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.4;
  word-break: keep-all;
}
.sc-related a:hover { border-color: var(--sc-navy); }

/* 다시 진단 */
.sc-restart {
  display: block;
  margin: 10px 0 2px auto;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: #3d5666;
  font-size: 12.5px;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
  width: fit-content;
}

/* 하단 */
.sc-foot-note { margin: 16px 4px 0; color: var(--sc-muted); font-size: 12px; line-height: 1.7; word-break: keep-all; }
.sc-noscript { margin: 10px 0 0; padding: 14px; border-radius: 12px; background: #fff8f2; color: #704214; font-size: 14px; }
.sc-noscript a { text-decoration: underline; }
.sc-footer { margin-top: 36px; padding: 22px 0 30px; border-top: 1px solid var(--sc-line); }
.sc-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--sc-muted); font-size: 12.5px; }
.sc-footer-inner nav { display: flex; gap: 14px; font-weight: 700; }

@media (max-width: 480px) {
  .sc-shell { padding: 0 10px; }
  /* 히어로를 짧게 — 질문 하나와 선택지 전부가 첫 화면에 들어가야 한다 */
  .sc-hero { padding: 11px 4px 7px; }
  /* 헤더 브랜드·h1과 겹치는 문구라 모바일에서는 접는다 */
  .sc-hero-eyebrow { display: none; }
  .sc-hero h1 { font-size: 21px; line-height: 1.24; }
  .sc-hero-sub { margin-top: 4px; font-size: 13px; line-height: 1.5; }
  .sc-hero-badges { margin-top: 7px; gap: 4px; }
  .sc-hero-badges span { min-height: 23px; padding: 0 8px; font-size: 11px; }
  .sc-chat-card { padding: 8px 8px 12px; border-radius: 14px; }
  .sc-chat-day { top: 66px; margin-bottom: 7px; padding: 4px 11px; font-size: 11px; }
  .sc-chip { min-height: 38px; padding: 7px 11px; font-size: 13.5px; border-radius: 10px; }
  .sc-options { gap: 4px; margin-top: 6px; }
  .sc-foot-note { margin-top: 10px; font-size: 11px; }
  .sc-bot-block { max-width: 96%; grid-template-columns: 32px minmax(0, 1fr); gap: 6px; }
  .sc-avatar { width: 32px; height: 32px; border-radius: 11px; }
  .sc-options, .sc-options-actions, .sc-options-multi-note { padding-left: 38px; }
  .sc-back, .sc-error { margin-left: 38px; }
  .sc-result-card, .sc-consult-card, .sc-related { margin-left: 38px; }
  .sc-result-grid { grid-template-columns: 1fr 1fr; }
  .sc-footer-inner { flex-direction: column; align-items: flex-start; }
}
