/* styles.css — 부동산모아: 부동산 계산기 + 정책 위키·Q&A. 절제된 도구형 UI, 장식용 이모지 없음. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e6ea;
  --text: #1c2127;
  --text-dim: #5a6473;
  --accent: #0e9f6e;
  --accent-dark: #0b7d57;
  --ok: #1a7f48;
  --ok-bg: #e8f6ee;
  --warn: #9a6700;
  --warn-bg: #fff7e6;
  --error: #c0362c;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(20, 30, 45, .06), 0 4px 16px rgba(20, 30, 45, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 1100px;
  --maxw-narrow: 860px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; }

/* ---------- 헤더(웹컴포넌트가 주입) ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.hwrap { max-width: var(--maxw); margin: 0 auto; padding: 11px 22px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; background: linear-gradient(135deg, var(--accent), #34c98a); color: #fff; border-radius: 9px; flex: 0 0 34px; }
.topnav a.nav-chat { color: var(--accent); }
.topnav a.nav-chat[aria-current="page"], .topnav a.nav-chat:hover { background: var(--ok-bg); color: var(--accent-dark); }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.topnav a { color: var(--text-dim); font-weight: 600; font-size: 14px; padding: 7px 12px; border-radius: var(--radius-sm); }
.topnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topnav a[aria-current="page"] { color: var(--accent); background: var(--surface-2); }

/* ---------- 페이지 레이아웃 ---------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: 26px 22px 8px; }
.page.narrow { max-width: var(--maxw-narrow); }
.breadcrumb { font-size: 12.5px; color: var(--text-dim); margin: 0 0 12px; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--accent); }
.page > h1 { font-size: 25px; margin: 0 0 8px; letter-spacing: -.02em; }
.page .lead { font-size: 15.5px; color: var(--text-dim); margin: 0 0 20px; max-width: 70ch; }

/* ---------- 홈 히어로 ---------- */
.hero { text-align: center; padding: 30px 22px 8px; max-width: var(--maxw); margin: 0 auto; }
.hero h1 { font-size: 30px; margin: 0 0 10px; letter-spacing: -.03em; }
.hero p { font-size: 16px; color: var(--text-dim); margin: 0 auto; max-width: 60ch; }
.hero .search { margin: 22px auto 0; max-width: 520px; }

/* 검색 */
.search input {
  width: 100%; border: 1px solid var(--border); border-radius: 999px; padding: 13px 20px;
  font-size: 15px; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.search input:focus { outline: none; border-color: var(--accent); }

/* ---------- 도구 카드 그리드 ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 14px; margin: 18px 0; }
.tool-grid .tool-card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); color: var(--text); transition: transform .12s, border-color .12s;
}
.tool-grid .tool-card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }
.tool-card .tc-cat { font-size: 11.5px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.tool-card h3 { margin: 6px 0 6px; font-size: 16.5px; }
.tool-card p { margin: 0; font-size: 13.5px; color: var(--text-dim); }
.tool-grid .tool-card.hidden { display: none; }
.cat-block { margin: 26px 0; }
.cat-block > h2 { font-size: 18px; margin: 0 0 4px; display: flex; align-items: baseline; gap: 10px; }
.cat-block > h2 a { font-size: 13px; font-weight: 600; }
.no-results { color: var(--text-dim); font-size: 14px; padding: 8px 2px; }

/* 가이드/콘텐츠 카드 그리드(홈 '가이드' 등) */
.tool-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 14px; margin: 12px 0; }
.tool-cards .tool-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); color: var(--text); transition: transform .12s, border-color .12s; }
.tool-cards .tool-card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }
.tool-cards .tool-card h3 { margin: 0 0 6px; font-size: 15.5px; color: var(--accent); }
.tool-cards .tool-card p { margin: 0; font-size: 13.5px; color: var(--text-dim); }

/* ---------- 계산기/도구 카드 ---------- */
.calc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.calc-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: 13.5px; font-weight: 600; color: var(--text-dim); }
.field .hint { font-size: 12px; color: var(--text-dim); font-weight: 400; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > .field { flex: 1 1 180px; min-width: 0; }

input[type="text"], input[type="number"], input[type="date"], input[type="url"], select, textarea {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 15px;
  background: var(--surface); color: var(--text); width: 100%; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 44px; }
.input-suffix .suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 13.5px; pointer-events: none; }

/* 토글(라디오/세그먼트) */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; background: var(--surface-2); gap: 2px; flex-wrap: wrap; }
.seg button { border: none; background: transparent; padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--text-dim); }
.seg button.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

/* 체크박스 줄 */
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: auto; }

/* 버튼 */
.btn-primary { background: var(--accent); color: #fff; border: none; padding: 12px 24px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 700; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { opacity: .55; cursor: default; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); padding: 10px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; }
.btn-secondary:hover { background: #e6eaef; }
.btn-text { border: none; background: none; color: var(--accent); font-size: 13.5px; font-weight: 600; padding: 6px 8px; border-radius: 6px; }
.btn-text:hover { background: var(--surface-2); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 4px; }

/* ---------- 결과 영역 ---------- */
.calc-result { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.calc-result.empty { display: none; }
.result-headline { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.result-headline .rh-label { font-size: 14px; color: var(--text-dim); font-weight: 600; }
.result-big { font-size: 30px; font-weight: 800; color: var(--accent); letter-spacing: -.02em; }
.result-sub { font-size: 13.5px; color: var(--text-dim); margin-top: 2px; }

/* 명세 표(공제 내역 등) */
.spec { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; }
.spec th, .spec td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.spec td.num, .spec th.num { text-align: right; font-variant-numeric: tabular-nums; }
.spec tr.total td { font-weight: 800; border-top: 2px solid var(--border); border-bottom: none; }
.spec tr.total td.num { color: var(--accent); }
.spec tbody tr:hover { background: var(--surface-2); }
.spec caption { text-align: left; font-size: 12.5px; color: var(--text-dim); padding: 6px 0; }

/* 스크롤 표(상환 스케줄) */
.table-scroll { max-height: 360px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 14px; }
.table-scroll table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-scroll th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
.table-scroll th, .table-scroll td { padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table-scroll td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 작은 통계 카드 묶음 */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; margin-top: 16px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.stat .s-label { font-size: 12.5px; color: var(--text-dim); }
.stat .s-value { font-size: 20px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* 상태/알림 */
.status { font-size: 13.5px; color: var(--text-dim); margin-top: 10px; }
.status.busy { color: var(--accent); }
.status.ok { color: var(--ok); font-weight: 600; }
.status.warn { color: var(--warn); }
.status.error { color: var(--error); font-weight: 600; }

.disclaimer { display: flex; align-items: flex-start; gap: 9px; background: var(--warn-bg); border: 1px solid #ffe0a3; color: #7a5200; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 12.5px; margin-top: 16px; line-height: 1.55; }
.disclaimer .d-icon { flex: 0 0 16px; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; background: #f0a500; color: #fff; font-weight: 800; font-size: 11px; margin-top: 1px; }

.privacy-note { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ok); background: var(--ok-bg); border: 1px solid #cfead9; padding: 6px 12px; border-radius: 999px; margin-bottom: 16px; }

/* ---------- 드롭존(이미지 도구) ---------- */
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 34px 20px; text-align: center; transition: border-color .15s, background .15s; outline: none; }
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: #eef4ff; }
.dropzone.dragover { border-color: var(--accent); background: #e6efff; }
.dz-icon { color: var(--accent); display: flex; justify-content: center; margin-bottom: 8px; }
.dz-prompt { margin: 0; font-weight: 600; }
.dz-hint { margin: 4px 0 0; font-size: 12.5px; color: var(--text-dim); }
.filelist { margin-top: 18px; }
.filelist.hidden { display: none; }
.filelist-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.filelist-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 10px; }
.file-card, .result-card { display: flex; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); position: relative; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--surface-2); flex: 0 0 44px; }
.thumb.doc { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--accent); }
.file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.file-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 11.5px; color: var(--text-dim); }
.file-remove, .btn-download { border: none; border-radius: 6px; font-size: 12.5px; font-weight: 600; padding: 6px 10px; }
.file-remove { background: none; color: var(--text-dim); }
.file-remove:hover { color: var(--error); background: var(--surface-2); }
.btn-download { background: var(--accent); color: #fff; }
.btn-download:hover { background: var(--accent-dark); }
.qr-preview { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.qr-canvas { background: #fff; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* ---------- 정적 콘텐츠(SEO/AdSense) ---------- */
.site-content, .page-extra { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.page.narrow ~ .page-extra, .narrow-extra { max-width: var(--maxw-narrow); }
.content-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 26px; margin: 18px 0; }
.content-section h2 { margin: 0 0 12px; font-size: 20px; }
.content-section h3 { margin: 18px 0 6px; font-size: 16px; }
.content-section p, .content-section li { color: #333a44; }
.content-section p { margin: 8px 0; }
.content-section ul, .content-section ol { margin: 8px 0; padding-left: 20px; }
.content-section li { margin: 4px 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 14px; }
.step { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.step .snum { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 8px; }
.step h3 { margin: 0 0 4px; font-size: 15px; }
.step p { margin: 0; font-size: 13.5px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 14px; margin-top: 12px; }
.feature { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--surface); }
.feature h3 { margin: 0 0 4px; font-size: 15px; }
.feature p { margin: 0; font-size: 13.5px; color: var(--text-dim); }

/* 관련 도구 */
.related { margin: 18px 0; }
.related h2 { font-size: 17px; margin: 0 0 12px; }
.related .rlist { display: flex; flex-wrap: wrap; gap: 10px; }
.related .rlist a { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 8px 15px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.related .rlist a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* FAQ */
.faq-item { border-top: 1px solid var(--border); padding: 14px 0; }
.faq-item:first-of-type { border-top: none; }
.faq-item summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--accent); font-weight: 700; }
.faq-item[open] summary::after { content: '\2013'; }
.faq-item p { margin: 10px 0 0; color: #333a44; font-size: 14px; }

/* 광고 슬롯 */
.ad-slot { margin: 18px auto; text-align: center; max-width: var(--maxw); padding: 0 22px; }
.ad-slot ins { display: block; }
.ad-label { font-size: 10.5px; color: #9aa3ad; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }

/* 사이트 푸터(웹컴포넌트가 주입) */
.site-footer { max-width: var(--maxw); margin: 30px auto 0; padding: 24px 22px 36px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 13px; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 10px; }
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent); }
.site-footer .copyright { font-size: 12px; line-height: 1.6; }

/* 법적/정보 페이지 */
.page-wrap { max-width: 820px; margin: 0 auto; padding: 28px 22px 0; }
.page-wrap h1 { font-size: 26px; margin: 0 0 6px; }
.page-wrap h2 { font-size: 18px; margin: 22px 0 6px; }
.page-wrap p, .page-wrap li { color: #333a44; line-height: 1.7; }
.page-wrap .updated { color: var(--text-dim); font-size: 13px; margin-bottom: 18px; }

/* ---------- 생활 도구(로또/추첨/비밀번호) ---------- */
.lotto-sets { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.lotto-set { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lotto-set .set-no { font-size: 12.5px; color: var(--text-dim); font-weight: 700; width: 28px; flex: 0 0 28px; }
.ball { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #1c2127; font-weight: 800; font-size: 15px; flex: 0 0 38px; }
.pick-result { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.pick-result .chip { background: var(--accent); color: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 15px; }
.pw-output { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.pw-output input { font-family: var(--mono); font-size: 17px; letter-spacing: .04em; flex: 1 1 auto; min-width: 0; }
.pw-strength { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.pw-strength > span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

/* 키보드 포커스 표시(WCAG 2.4.7) */
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}

/* 공통 헤더 공간 예약(웹컴포넌트 주입 시 레이아웃 시프트 방지) */
site-header { display: block; min-height: 56px; }
site-footer { display: block; }
@media (max-width: 760px) { site-header { min-height: 96px; } }

/* 모션 최소화 선호 대응 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .tool-grid .tool-card:hover, .tool-cards .tool-card:hover { transform: none; }
}

/* 결과 차트 */
.calc-chart { margin-top: 20px; }
.chart { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.chart-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.chart-legend li { display: flex; align-items: center; gap: 8px; color: var(--text); }
.ch-dot { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 12px; }
.chart-line { display: block; width: 100%; }
.chart-line svg { display: block; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.chart-cap { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; }
.stack-bar { display: flex; height: 28px; border-radius: 7px; overflow: hidden; width: 100%; min-width: 220px; border: 1px solid var(--border); }
.sb-seg { min-width: 2px; }

/* 본문 바로가기(skip link) */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; font-weight: 700; }
.skip-link:focus { left: 0; }
#main:focus { outline: none; }

/* 스크롤 표 키보드 포커스 */
.table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 모바일 터치 타깃 확대(권장 44px 근접) */
@media (max-width: 760px) {
  .topnav a { padding: 10px 13px; }
  .seg button { padding: 9px 15px; }
  .btn-text { padding: 9px 10px; }
}

.hidden { display: none !important; }

/* ---------- 반응형 ---------- */
@media (max-width: 760px) {
  .hwrap { padding: 10px 14px; gap: 12px; flex-wrap: wrap; }
  .topnav { width: 100%; margin-left: 0; justify-content: flex-start; }
  .page, .hero, .site-content, .page-extra, .ad-slot { padding-left: 14px; padding-right: 14px; }
  .hero h1 { font-size: 24px; }
  .page > h1 { font-size: 21px; }
  .result-big { font-size: 25px; }
  .calc { padding: 18px; }
  .content-section { padding: 18px; }
  .steps { grid-template-columns: 1fr; }
  .filelist-body { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
}

/* ============ 정책 Q&A 챗봇 ============ */
.chat-wrap { max-width: var(--maxw-narrow); margin: 0 auto; padding: 18px 22px 0; }
.chat-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; height: min(66vh, 620px); overflow: hidden; }
.chat-log { flex: 1 1 auto; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 10px; max-width: 100%; }
.msg .avatar { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.msg.bot .avatar { background: var(--ok-bg); color: var(--accent-dark); }
.msg.user { flex-direction: row-reverse; }
.msg.user .avatar { background: var(--surface-2); color: var(--text-dim); }
.bubble { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 15px; font-size: 14.5px; line-height: 1.65; max-width: 80%; overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--accent); border-color: var(--accent); color: #fff; }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 6px 0; padding-left: 20px; }
.bubble a { color: var(--accent-dark); font-weight: 600; }
.msg.user .bubble a { color: #fff; text-decoration: underline; }
.bubble code { font-family: var(--mono); background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.sources { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 12.5px; }
.sources .src-title { color: var(--text-dim); font-weight: 700; margin-bottom: 5px; }
.sources a { display: inline-flex; align-items: center; gap: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; margin: 0 6px 6px 0; font-size: 12.5px; font-weight: 600; color: var(--text); }
.sources a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.typing span { display: inline-block; width: 7px; height: 7px; margin: 0 1px; border-radius: 50%; background: var(--text-dim); opacity: .4; animation: blink 1.2s infinite both; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: .9; } }
.chat-form { border-top: 1px solid var(--border); padding: 12px; display: flex; gap: 10px; background: var(--surface); }
.chat-form textarea { flex: 1 1 auto; min-height: 46px; max-height: 140px; resize: none; border-radius: 10px; }
.chat-send { flex: 0 0 auto; align-self: stretch; background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 0 20px; font-weight: 700; font-size: 15px; }
.chat-send:hover { background: var(--accent-dark); } .chat-send:disabled { opacity: .5; cursor: default; }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.chat-suggest button { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; font-size: 13px; color: var(--text); font-weight: 600; }
.chat-suggest button:hover { border-color: var(--accent); color: var(--accent); }

/* ============ 정책 위키 ============ */
.wiki-hero { background: linear-gradient(135deg, #0e9f6e, #0b7d57); color: #fff; border-radius: var(--radius); padding: 26px 28px; margin: 0 0 18px; }
.wiki-hero h1 { margin: 0 0 8px; font-size: 24px; }
.wiki-hero p { margin: 0; opacity: .92; font-size: 14.5px; max-width: 60ch; }
.wiki-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.wiki-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); color: var(--text); transition: transform .12s, border-color .12s; }
.wiki-card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }
.wiki-card .w-meta { font-size: 12px; color: var(--text-dim); display: flex; gap: 8px; flex-wrap: wrap; }
.wiki-card .w-tag { color: var(--accent); font-weight: 700; }
.wiki-card h3 { margin: 6px 0; font-size: 16.5px; }
.wiki-card p { margin: 0; font-size: 13.5px; color: var(--text-dim); }
.wiki-article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 30px; }
.wiki-article .w-updated { font-size: 13px; color: var(--text-dim); margin: 0 0 18px; }
.wiki-article h2 { font-size: 19px; margin: 24px 0 8px; padding-top: 6px; }
.wiki-article h3 { font-size: 16px; margin: 16px 0 6px; }
.wiki-article p, .wiki-article li { color: #333a44; line-height: 1.75; }
.wiki-article ul, .wiki-article ol { padding-left: 22px; }
.wiki-cite { font-size: 13px; color: var(--text-dim); }

/* ============ 홈 정책 배너 ============ */
.policy-banner { background: linear-gradient(135deg, #0e9f6e, #0b7d57); color: #fff; border-radius: var(--radius); padding: 22px 26px; margin: 26px 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; box-shadow: var(--shadow); }
.policy-banner h2 { margin: 0 0 4px; font-size: 19px; }
.policy-banner p { margin: 0; opacity: .92; font-size: 14px; max-width: 52ch; }
.policy-banner .pb-cta { background: #fff; color: var(--accent-dark); border-radius: 999px; padding: 11px 22px; font-weight: 800; font-size: 14.5px; white-space: nowrap; }
.policy-banner .pb-cta:hover { text-decoration: none; opacity: .92; }

/* ============ 어드민 백오피스 ============ */
.admin-shell { max-width: var(--maxw); margin: 0 auto; padding: 22px; }
.admin-login { max-width: 380px; margin: 60px auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.admin-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.admin-panel h2 { font-size: 17px; margin: 0 0 14px; }
.admin-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.doc-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.doc-item .d-title { font-weight: 600; font-size: 14px; }
.doc-item .d-meta { font-size: 12px; color: var(--text-dim); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge.published { background: var(--ok-bg); color: var(--accent-dark); }
.badge.draft { background: var(--warn-bg); color: var(--warn); }
@media (max-width: 760px) {
  .chat-box { height: min(70vh, 560px); }
  .bubble { max-width: 88%; }
  .policy-banner { flex-direction: column; align-items: flex-start; }
}
