/* 보험 EASY — 정돈된 기본 스타일 */
:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --line: #e3e6eb;
  --text: #1c2430;
  --muted: #5f6b7a;
  --faint: #8a94a3;
  --brand: #1f3a5f;
  --brand-hover: #172e4c;
  --brand-soft: #eaf0f7;
  --risk: #b4442e;
  --risk-soft: #fbf1ee;
  --ok: #2f6f57;
  --radius: 8px;
  font-family: "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); line-height: 1.6; word-break: keep-all; overflow-wrap: break-word; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

.wrap { width: min(1080px, calc(100% - 48px)); margin: 0 auto; }

/* ---------- 상단 바 ---------- */
.topbar { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-logo { display: block; height: 28px; width: auto; }
.brand-name { font-size: 16px; font-weight: 700; line-height: 1.3; }
.brand-name small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.main-nav { display: flex; gap: 4px; }
.nav-link { padding: 8px 14px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link.active { color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.prototype-badge { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; white-space: nowrap; }

/* ---------- 화면 전환 ---------- */
.view-section { display: none; }
.view-section.active { display: block; }

/* ---------- 공통 라벨 / 버튼 ---------- */
.eyebrow, .label, .mini-label { margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--brand); letter-spacing: 0; }
.btn-primary { padding: 13px 22px; border: 0; border-radius: var(--radius); background: var(--brand); color: #fff; font-size: 15px; font-weight: 700; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-link { padding: 8px 0; border: 0; background: none; color: var(--brand); font-size: 15px; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- 홈 ---------- */
.hero { padding: 80px 0 64px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.3; margin-bottom: 20px; }
.hero-lede { font-size: 17px; color: var(--muted); max-width: 480px; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.disclaimer { margin-top: 28px; font-size: 13px; color: var(--faint); max-width: 480px; }

.example { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 24px; }
.example-row { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.example-row + .example-row { margin-top: 12px; }
.example-row span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.example-row p { font-size: 15px; }
.example-row.easy { border-color: #c9d6e6; background: var(--brand-soft); }
.example-row.easy p { font-weight: 700; color: var(--brand); }
.example-note { margin-top: 14px; font-size: 13px; color: var(--risk); font-weight: 500; }

.strip { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.strip > div { padding: 28px 24px 28px 0; }
.strip > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.strip strong { display: block; font-size: 16px; margin-bottom: 6px; }
.strip p { font-size: 14px; color: var(--muted); }

.flow { padding: 64px 0 72px; border-top: 1px solid var(--line); }
.flow h2 { font-size: 22px; margin-bottom: 28px; }
.flow-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.flow-grid > div { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); }
.flow-grid span { display: block; font-size: 13px; color: var(--faint); margin-bottom: 8px; }
.flow-grid strong { display: block; font-size: 16px; margin-bottom: 4px; }
.flow-grid p { font-size: 14px; color: var(--muted); }

/* ---------- 공통 페이지 머리말 ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 56px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.page-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 8px; }
.page-head p { color: var(--muted); font-size: 15px; }
.note { font-size: 13px; color: var(--muted); background: var(--surface); border-radius: 6px; padding: 6px 10px; white-space: nowrap; }

/* ---------- 약관 ---------- */
.terms-toolbar { display: flex; gap: 10px; margin-bottom: 20px; }
.search-box { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.search-box span { color: var(--faint); }
.search-box input { width: 100%; padding: 12px 0; border: 0; outline: 0; background: transparent; font-size: 15px; }
.terms-toolbar select { min-width: 150px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); font-size: 15px; }
.term-layout { display: grid; grid-template-columns: 180px 1fr; gap: 28px; align-items: start; }
.term-index { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px; }
.term-index button { padding: 10px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); text-align: left; font-size: 14px; }
.term-index button:hover { background: var(--surface); color: var(--text); }
.term-index button.active { background: var(--brand); color: #fff; font-weight: 500; }
.term-results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.term-card { padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.term-card.risk { border-left: 3px solid var(--risk); }
.term-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.term-card-top .mini-label { margin: 0; color: var(--faint); font-weight: 400; font-size: 12px; }
.term-tag { font-size: 12px; font-weight: 500; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 4px; }
.term-tag.risk-tag { color: var(--risk); background: var(--risk-soft); }
.term-card h3 { font-size: 16px; margin-bottom: 8px; }
.term-card > p { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.term-easy { padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.term-easy strong { display: block; font-size: 12px; color: var(--ok); margin-bottom: 2px; font-weight: 500; }
.loading { padding: 24px; color: var(--muted); font-size: 14px; }

/* ---------- VOC 대시보드 ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi-card { padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; }
.kpi-card > span { font-size: 13px; color: var(--muted); }
.kpi-card strong { display: block; margin: 8px 0 4px; font-size: 26px; font-weight: 700; color: var(--text); }
.kpi-card small { font-size: 12px; color: var(--faint); }
.kpi-card.accent strong { color: var(--risk); }
.dashboard-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 14px; margin-top: 14px; }
.dashboard-card { padding: 22px; border: 1px solid var(--line); border-radius: 10px; }
.card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.card-heading h3 { font-size: 16px; }
.pill { font-size: 12px; color: var(--muted); background: var(--surface); padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.bar-chart { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 84px 1fr 40px; align-items: center; gap: 10px; font-size: 14px; }
.bar-track { height: 8px; border-radius: 4px; background: var(--surface); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--brand); }
.bar-row b { font-weight: 500; text-align: right; color: var(--muted); }
.voice-list { display: grid; gap: 10px; }
.voice-item { padding: 12px 14px; border-radius: 8px; background: var(--surface); font-size: 14px; }
.voice-item span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.action-plan { margin: 14px 0 72px; padding: 22px; border: 1px solid var(--line); border-radius: 10px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; }
.action-plan h3 { font-size: 16px; }
.action-plan ol { margin: 0; padding-left: 20px; font-size: 14px; color: var(--muted); }
.action-plan li + li { margin-top: 6px; }

/* ---------- 푸터 ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 13px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer strong { color: var(--text); font-size: 14px; }

/* ---------- 태블릿 이하 ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding: 48px 0; }
  .flow-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .action-plan { grid-template-columns: 1fr; }
  .term-layout { grid-template-columns: 1fr; }
  .term-index { position: static; flex-direction: row; flex-wrap: wrap; }
  .term-results { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .note { white-space: normal; }
}

/* ---------- 모바일 ---------- */
@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .topbar-inner { flex-wrap: wrap; padding: 12px 0; gap: 10px; min-height: 0; }
  .prototype-badge, .brand-logo { display: none; }
  .main-nav { width: 100%; overflow-x: auto; }
  .nav-link { padding: 8px 10px; font-size: 13px; white-space: nowrap; }
  .hero { padding: 36px 0; }
  .hero h1 { font-size: 2rem; }
  .strip { grid-template-columns: 1fr; }
  .strip > div, .strip > div + div { padding: 18px 0; border-left: 0; border-top: 1px solid var(--line); }
  .flow-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-card { padding: 14px; }
  .kpi-card strong { font-size: 22px; }
  .terms-toolbar { flex-direction: column; }
  .terms-toolbar select { width: 100%; min-height: 46px; }
  .term-index { flex-wrap: nowrap; overflow-x: auto; }
  .term-index button { white-space: nowrap; }
  .bar-row { grid-template-columns: 72px 1fr 34px; font-size: 13px; }
}

/* ---------- 계약 질문하기 ---------- */
.ask-layout { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; padding-bottom: 72px; }
.ask-side { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.field select, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); font-size: 14px; resize: vertical; }
.field-note { margin: -8px 0 0; font-size: 12px; color: var(--risk); }
.quick { display: flex; flex-direction: column; gap: 6px; }
.quick .mini-label { margin-bottom: 4px; }
.quick button { text-align: left; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 13px; }
.quick button:hover { border-color: var(--brand); color: var(--brand); }
.quick button:disabled { opacity: .5; cursor: not-allowed; }
.consult-box { padding: 16px; border-radius: 10px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--muted); }
.consult-box .btn-primary { text-align: center; text-decoration: none; }
.consult-box .btn-primary.is-disabled { background: var(--faint); cursor: not-allowed; }
.chat { border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; min-height: 520px; overflow: hidden; }
.chat-log { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; max-height: 560px; }
.msg { max-width: 85%; padding: 12px 14px; border-radius: 10px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; background: var(--surface); }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; }
.msg.pending { color: var(--muted); }
.msg.error { color: var(--risk); background: var(--risk-soft); }
.chat-form { display: flex; gap: 8px; padding: 14px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 15px; }
.chat-form input:disabled { background: var(--surface); }
.chat-form .btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.chat-disclaimer { padding: 0 14px 14px; font-size: 12px; color: var(--faint); }
@media (max-width: 860px) {
  .ask-layout { grid-template-columns: 1fr; }
  .chat { min-height: 0; }
}
@media (max-width: 640px) {
  .msg { max-width: 94%; }
  .chat-form { flex-direction: column; }
}

/* ---------- 자주 묻는 질문 TOP ---------- */
.faq { margin: 56px 0 72px; padding-top: 32px; border-top: 1px solid var(--line); }
.faq-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.faq-head h3 { font-size: 20px; }
.faq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.faq-item { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); text-align: left; }
.faq-item:hover { border-color: var(--brand); }
.faq-rank { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 700; }
.faq-text { display: flex; flex-direction: column; gap: 2px; }
.faq-text strong { font-size: 15px; font-weight: 500; color: var(--text); }
.faq-text small { font-size: 12px; color: var(--muted); }
.faq-hint { margin-top: 12px; font-size: 12px; color: var(--faint); }
