*{box-sizing:border-box;margin:0;padding:0}
html,body{min-height:100%}
body{
  font-family:'Pretendard',-apple-system,'Segoe UI','Apple SD Gothic Neo','Malgun Gothic',sans-serif;
  background:#fafafa;
  color:#0f172a;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
.hidden{display:none !important}

a{color:inherit;text-decoration:none}

button,.cta,.ghost,.ask-cta,.admin-pill{
  cursor:pointer;border:none;font-family:inherit;font-weight:600;
  border-radius:12px;padding:12px 18px;font-size:14px;
}
.cta{
  background:linear-gradient(135deg,#7c3aed 0%,#ec4899 100%);
  color:#fff;width:100%;font-size:16px;padding:14px;
  box-shadow:0 4px 14px rgba(124,58,237,0.3);
  transition:transform .15s,box-shadow .15s;
}
.cta:hover{transform:translateY(-1px);box-shadow:0 6px 20px rgba(124,58,237,0.4)}
.ghost{background:#f1f5f9;color:#475569;padding:10px 16px}
.ghost:hover{background:#e2e8f0}

/* ───── 비번 게이트 ───── */
.gate{
  min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px;
  background:linear-gradient(135deg,#a78bfa 0%,#f472b6 50%,#fb923c 100%);
}
.gate-card{
  background:#fff;border-radius:24px;padding:32px 28px;
  max-width:380px;width:100%;
  box-shadow:0 20px 50px rgba(0,0,0,0.15);
  text-align:center;
}
.brand{margin-bottom:24px}
.brand-emoji{font-size:48px;margin-bottom:8px}
.brand h1{font-size:26px;font-weight:800;margin-bottom:4px;background:linear-gradient(135deg,#7c3aed 0%,#ec4899 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.brand p{color:#64748b;font-size:14px}
.gate-card input{
  width:100%;padding:14px 16px;border:2px solid #f1f5f9;border-radius:12px;
  font-size:16px;margin-bottom:12px;font-family:inherit;
  text-align:center;letter-spacing:2px;
}
.gate-card input:focus{outline:none;border-color:#a78bfa}
.gate-hint{font-size:12px;color:#94a3b8;margin-top:14px}

/* ───── 메인 레이아웃 ───── */
#main{max-width:760px;margin:0 auto;padding:20px}

.topbar{
  display:flex;justify-content:space-between;align-items:center;
  padding:8px 0 20px;
}
.logo{display:flex;align-items:center;gap:8px;font-weight:800;font-size:18px}
.logo-emoji{font-size:24px}
.logo-text{background:linear-gradient(135deg,#7c3aed 0%,#ec4899 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.admin-pill{background:#fff;border:1px solid #e2e8f0;color:#475569;font-size:12px;padding:6px 12px;border-radius:999px}
.admin-pill:hover{background:#f8fafc}

/* ───── 히어로 ───── */
.hero{padding:24px 0 32px;text-align:center}
.hero-title{font-size:32px;font-weight:800;letter-spacing:-0.5px}
.emoji-wave{display:inline-block;animation:wave 1.6s ease-in-out infinite}
@keyframes wave{0%,100%{transform:rotate(0deg)}25%{transform:rotate(15deg)}75%{transform:rotate(-10deg)}}
.hero-sub{color:#64748b;margin-top:6px;font-size:14px}

.search-box{
  background:#fff;border-radius:20px;padding:8px;
  display:flex;align-items:flex-end;gap:8px;
  margin-top:24px;
  box-shadow:0 4px 20px rgba(15,23,42,0.06);
  border:1px solid #f1f5f9;
}
.search-box textarea{
  flex:1;border:none;outline:none;resize:none;
  padding:14px;font-size:15px;font-family:inherit;
  background:transparent;min-height:24px;line-height:1.5;
}
.ask-cta{
  background:linear-gradient(135deg,#7c3aed 0%,#ec4899 100%);
  color:#fff;padding:14px 20px;border-radius:14px;
  white-space:nowrap;flex-shrink:0;
}
.ask-cta:hover{filter:brightness(1.1)}
.ask-cta:disabled{opacity:0.6;cursor:not-allowed}

.example-chips{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:16px}
.chip-tap{
  background:#fff;border:1px solid #e2e8f0;color:#475569;
  font-size:13px;padding:7px 13px;border-radius:999px;cursor:pointer;
  transition:all .15s;
}
.chip-tap:hover{background:#fafafa;border-color:#a78bfa;color:#7c3aed}

/* ───── 답변 ───── */
.answer{
  background:#fff;border-radius:18px;padding:22px;margin-bottom:24px;
  box-shadow:0 4px 20px rgba(15,23,42,0.06);
}
.answer-q{font-size:13px;color:#64748b;margin-bottom:10px;font-weight:600}
.answer-q::before{content:'Q. ';color:#a78bfa;font-weight:700}
.answer-body{font-size:15px;line-height:1.7;color:#0f172a;white-space:pre-wrap}
.answer-body h1,.answer-body h2,.answer-body h3{font-weight:700;margin:10px 0 6px}
.answer-body strong{color:#7c3aed}
.answer-body code{background:#f1f5f9;padding:2px 6px;border-radius:4px;font-size:13px}
.answer-sources{margin-top:14px;display:flex;flex-wrap:wrap;gap:6px}
.source-chip{background:#ede9fe;color:#5b21b6;font-size:11px;padding:4px 10px;border-radius:6px;font-weight:600}

/* ───── 자료 목록 ───── */
.docs{margin-top:16px}
.docs-h{font-size:18px;font-weight:800;margin-bottom:12px}
.categories{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:14px}
.cat-pill{
  background:#fff;border:1px solid #e2e8f0;color:#475569;
  font-size:13px;padding:6px 12px;border-radius:999px;cursor:pointer;
  transition:all .15s;
}
.cat-pill.active{background:#0f172a;color:#fff;border-color:#0f172a}
.docs-list{display:flex;flex-direction:column;gap:10px}
.doc-card{
  background:#fff;border-radius:14px;padding:16px;
  cursor:pointer;transition:transform .15s,box-shadow .15s;
  border:1px solid #f1f5f9;
}
.doc-card:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(0,0,0,0.06)}
.doc-cat{display:inline-block;font-size:11px;background:#ede9fe;color:#5b21b6;padding:2px 8px;border-radius:5px;font-weight:600;margin-bottom:6px}
.doc-title{font-weight:700;font-size:15px;margin-bottom:4px}
.doc-snippet{font-size:13px;color:#64748b;line-height:1.5}

.empty{
  background:#fff;border-radius:14px;padding:40px 20px;text-align:center;
  color:#94a3b8;font-size:14px;border:1px dashed #e2e8f0;
}
.empty-emoji{font-size:36px;margin-bottom:8px}

/* ───── 모달 (문서 보기) ───── */
.modal{position:fixed;inset:0;background:rgba(0,0,0,0.5);display:flex;align-items:center;justify-content:center;padding:16px;z-index:100}
.modal-content{background:#fff;border-radius:18px;max-width:680px;width:100%;max-height:90vh;overflow-y:auto;padding:24px}
.modal-content h2{font-size:20px;font-weight:800;margin-bottom:10px}
.modal-content .doc-body{font-size:14px;line-height:1.7;color:#334155;white-space:pre-wrap;margin-bottom:16px}

/* ───── 푸터 ───── */
.foot{
  margin-top:40px;padding:20px 0;
  text-align:center;color:#94a3b8;font-size:12px;
  display:flex;justify-content:center;gap:8px;flex-wrap:wrap;
}
.foot a{color:#7c3aed;font-weight:600}

@media (max-width:480px){
  .hero-title{font-size:26px}
  .search-box{flex-direction:column;align-items:stretch;border-radius:18px}
  .ask-cta{width:100%}
}
