/* ============================================================
   청년 생활법률 상담 AI — 디자인 시스템 (신뢰감 네이비)
   ============================================================ */
:root {
  /* 색 — 네이비/슬레이트 */
  --navy-900: #0a1b3a;
  --navy-800: #0e2549;
  --navy-700: #143263;
  --navy-600: #1c4587;
  --brand:    #2563eb;
  --brand-d:  #1d4ed8;
  --accent:   #ef6a43;  /* 따뜻한 포인트(코랄) — 주요 액션/강조에만 */
  --accent-d: #d8572f;
  --ink:      #0f172a;
  --text:     #334155;
  --muted:    #64748b;
  --line:     #e2e8f0;
  --line-2:   #eef2f7;
  --bg:       #f6f8fc;
  --card:     #ffffff;
  --ok:       #15803d;
  --warn-bg:  #fffbeb;
  --warn-bd:  #fcd34d;
  /* 형태 */
  --r-sm: 8px;  --r: 12px;  --r-lg: 16px;  --r-pill: 999px;
  --sh-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --sh-md: 0 4px 12px rgba(15,23,42,.06), 0 2px 6px rgba(15,23,42,.04);
  --sh-lg: 0 18px 48px rgba(12,31,68,.12);
  --ring:  0 0 0 4px rgba(37,99,235,.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Pretendard", -apple-system, "Noto Sans KR", sans-serif;
  margin: 0; color: var(--text); background: var(--bg);
  line-height: 1.6; -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  display: flex; flex-direction: column; min-height: 100vh;  /* 푸터 하단 고정 */
}
h1, h2, h3 { color: var(--ink); letter-spacing: -0.02em; }
a { color: var(--brand-d); }

/* ── Navbar ───────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.navbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
  color: #fff; border-radius: 10px; font-size: 19px; box-shadow: var(--sh-sm);
}
.brand-mark.sm { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
.brand-mark svg { width: 22px; height: 22px; }
.brand-mark.sm svg { width: 17px; height: 17px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { color: var(--ink); font-size: 15px; font-weight: 700; }
.brand-text em { color: var(--muted); font-size: 11px; font-style: normal; letter-spacing: .04em; }
.theme-toggle { background: none; border: 0; padding: 4px 0; cursor: pointer; line-height: 0; }
.tt-track {
  position: relative; display: inline-block; width: 54px; height: 28px;
  border-radius: var(--r-pill); background: #d7e0ec; border: 1px solid var(--line);
  transition: background .22s ease, border-color .16s ease;
}
.tt-knob {
  position: absolute; top: 2px; left: 2px; width: 23px; height: 23px;
  display: grid; place-items: center; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); color: #f59e0b;
  transition: transform .22s cubic-bezier(.4,1.4,.5,1), background .22s ease, color .22s ease;
}
.tt-knob svg { width: 14px; height: 14px; }
.theme-toggle .ic-sun { display: block; }
.theme-toggle .ic-moon { display: none; }
.theme-toggle:hover .tt-track { border-color: var(--brand); }
[data-theme="dark"] .tt-track { background: #34507e; }
[data-theme="dark"] .tt-knob { transform: translateX(26px); background: #15203a; color: #cbd9f0; }
[data-theme="dark"] .theme-toggle .ic-sun { display: none; }
[data-theme="dark"] .theme-toggle .ic-moon { display: block; }

/* ── Layout ───────────────────────────────────────────── */
main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; flex: 1 0 auto; }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  position: relative; text-align: center;
  padding: 76px 24px 64px; margin: 28px 0 8px;
  background:
    radial-gradient(1100px 460px at 50% -12%, #eaf1fe 0%, rgba(234,241,254,0) 62%),
    linear-gradient(180deg, #fbfcff 0%, var(--card) 100%);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--sh-md);
  overflow: hidden;
}
.eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--navy-600); background: #eef3fe; border: 1px solid #dce7fc;
  padding: 6px 13px; border-radius: var(--r-pill); margin-bottom: 22px;
}
.hero-title { font-size: 48px; font-weight: 800; line-height: 1.2; margin: 0 0 18px; letter-spacing: -0.025em; }
.hero-title .accent { color: var(--navy-600); }
.hero-title .grad {
  background: linear-gradient(120deg, var(--brand) 10%, var(--navy-700) 90%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: 17.5px; color: var(--muted); margin: 0 auto 30px; max-width: 560px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.trust-row {
  display: flex; gap: 22px; justify-content: center; flex-wrap: wrap;
  margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line-2);
}
.trust-item { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13.5px; }
.trust-item .dot, .tag .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 3px rgba(21,128,61,.13);
}

/* ── 히어로: 입력창 주인공 + 스코프 + 일러스트 ─────────── */
.hero-illust { display: block; margin: 0 auto 16px; width: 156px; height: auto; }
.hero-search {
  display: flex; align-items: center; gap: 8px; max-width: 540px; margin: 4px auto 14px;
  background: #fff; border: 1.5px solid #cdd9ec; border-radius: 16px;
  padding: 8px 8px 8px 16px; box-shadow: var(--sh-md);
  transition: border-color .16s, box-shadow .16s;
}
.hero-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(239,106,67,.16); }
.hero-search .ask-ic { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.hero-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; font-size: 15.5px; font-family: inherit;
  color: var(--ink); background: none; padding: 11px 0;
}
.hero-go {
  border: 0; border-radius: 11px; background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 600; font-family: inherit; padding: 12px 22px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background .16s;
}
.hero-go:hover { background: var(--accent-d); }
.hero-go svg { width: 16px; height: 16px; }
[data-theme="dark"] .hero-search { background: var(--card); border-color: #2c4368; }
/* 예시 placeholder — 다크 모드에서 잘 보이도록 밝게 (기본 회색은 너무 어두움) */
.hero-search input::placeholder,
.ask input::placeholder { color: var(--muted); opacity: 1; }
[data-theme="dark"] .hero-search input::placeholder,
[data-theme="dark"] .ask input::placeholder { color: #cbd9ef; }
.hero-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 4px; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-size: 15px; font-weight: 600; font-family: inherit;
  padding: 13px 22px; border-radius: var(--r); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: all .16s ease;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.28); }
.btn-primary:hover { background: var(--brand-d); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(37,99,235,.34); }
.btn-ghost { background: #fff; color: var(--navy-700); border-color: var(--line); box-shadow: var(--sh-sm); }
.btn-ghost:hover { border-color: #c7d4e8; background: #fbfcff; }
.btn-outline {
  background: #fff; color: var(--accent-d); border-color: #f6cdbe;
  margin-top: 18px; width: 100%; padding: 12px;
}
.btn-outline:hover { background: #fdeee8; border-color: var(--accent); }
.ic-sm { width: 18px; height: 18px; }

/* ── Features ─────────────────────────────────────────── */
.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin: 36px 0; scroll-margin-top: 80px;
}
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 24px; box-shadow: var(--sh-sm); transition: transform .16s ease, box-shadow .16s ease;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); border-color: #d7e2f3; }
.feature-icon {
  display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 16px;
  background: linear-gradient(135deg, #eef3fe, #e3ecfd); border-radius: 12px; color: var(--navy-600);
}
.feature-icon svg { width: 24px; height: 24px; }
.feature h3 { font-size: 17px; margin: 0 0 8px; }
.feature p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.62; }

/* ── Examples ─────────────────────────────────────────── */
.examples { text-align: center; margin: 8px 0 60px; }
.ex-label { display: block; color: var(--muted); font-size: 14px; margin-bottom: 14px; font-weight: 500; }
.ex-chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.chip {
  font-family: inherit; font-size: 14px; color: var(--navy-700);
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 9px 16px; cursor: pointer; box-shadow: var(--sh-sm); transition: all .16s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent-d); background: #fdf0ea; transform: translateY(-1px); }

/* ── Section header ───────────────────────────────────── */
.section-head { text-align: center; max-width: 600px; margin: 64px auto 28px; scroll-margin-top: 80px; }
.kicker {
  display: inline-block; font-size: 17px; font-weight: 700; letter-spacing: .01em;
  color: var(--brand-d); margin-bottom: 14px;
}
.section-head h2 { font-size: 30px; font-weight: 800; margin: 0 0 12px; line-height: 1.3; }
.section-head p { color: var(--muted); font-size: 16px; margin: 0; line-height: 1.65; }

/* ── Domain cards (4분야) ─────────────────────────────── */
.domains { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 28px 0; }
.domain-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px 20px; text-align: center; box-shadow: var(--sh-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.domain-card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); border-color: var(--tint, var(--brand)); }
.domain-icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 14px;
  background: var(--tint-bg, #eef3fe); color: var(--tint, var(--navy-600)); border-radius: 14px;
}
.domain-icon svg { width: 27px; height: 27px; }
.domain-card h3 { font-size: 18px; margin: 0 0 4px; }
.domain-card > p { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.domain-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.domain-tags span {
  font-size: 12px; color: var(--text); background: #f1f5f9;
  padding: 4px 10px; border-radius: var(--r-pill);
}
.d-labor   { --tint: #2563eb; --tint-bg: #eaf1fe; }
.d-housing { --tint: #0d9488; --tint-bg: #e6f7f4; }
.d-consumer{ --tint: #d97706; --tint-bg: #fdf2e3; }
.d-finance { --tint: #7c3aed; --tint-bg: #f1ebfe; }

/* ── Steps (이용 방법) ────────────────────────────────── */
.steps { display: flex; align-items: stretch; justify-content: center; gap: 12px; margin: 28px 0; }
.step {
  flex: 1; max-width: 280px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 24px 20px; text-align: center; box-shadow: var(--sh-sm);
}
.step-num {
  display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--navy-700), var(--brand)); color: #fff;
  border-radius: 50%; font-weight: 700; font-size: 15px;
}
.step h4 { font-size: 16px; margin: 0 0 6px; }
.step p { color: var(--muted); font-size: 13.5px; margin: 0; line-height: 1.6; }
.step-arrow { display: flex; align-items: center; color: #cbd5e1; font-size: 22px; }

/* ── CTA band ─────────────────────────────────────────── */
.cta-band {
  text-align: center; margin: 64px 0 24px; padding: 56px 32px;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-600));
  border-radius: 22px; box-shadow: var(--sh-lg); color: #fff;
}
.cta-band h2 { color: #fff; font-size: 28px; font-weight: 800; margin: 0 0 10px; }
.cta-band p { color: #c7d6ef; font-size: 16px; margin: 0 0 26px; }
.btn-cta { background: var(--accent); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.28); }
.btn-cta:hover { background: var(--accent-d); transform: translateY(-1px); }

/* ── Consult (search + results) ───────────────────────── */
#consult { padding: 36px 0 64px; max-width: 760px; margin: 0 auto; }
.back {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; font-family: inherit; font-size: 14px;
  color: var(--muted); cursor: pointer; padding: 6px 0; margin-bottom: 18px;
}
.back:hover { color: var(--brand-d); }
.ask-title { font-size: 24px; font-weight: 800; margin: 8px 0 6px; }
.ask-help { color: var(--muted); font-size: 14.5px; margin: 0 0 18px; line-height: 1.6; }
.ask {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 8px 8px 8px 16px; box-shadow: var(--sh-md); transition: box-shadow .16s, border-color .16s;
}
.ask:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.ask-ic { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.ask input {
  flex: 1; border: 0; outline: 0; font-size: 15.5px; font-family: inherit;
  color: var(--ink); background: none; padding: 10px 0;
}
.ask #go {
  border: 0; border-radius: 10px; background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 600; font-family: inherit; padding: 11px 24px; cursor: pointer;
  transition: background .16s;
}
.ask #go:hover { background: var(--accent-d); }

#status {
  display: flex; align-items: center; gap: 10px;
  color: var(--brand-d); margin: 22px 4px; font-size: 14.5px;
}
.spinner {
  width: 16px; height: 16px; border: 2px solid #cfdcf6; border-top-color: var(--brand);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 로딩 3단계 스텝퍼 */
.stepper { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.step-item { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--muted); transition: color .2s ease; }
.step-item.done { color: var(--ok); }
.step-item.active { color: var(--brand-d); font-weight: 600; }
.step-ic { display: grid; place-items: center; width: 18px; height: 18px; flex-shrink: 0; }
.step-ic svg { width: 15px; height: 15px; }
.step-dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #cbd5e1; }
.step-sep { flex: 0 0 16px; height: 1px; background: var(--line); }
[data-theme="dark"] .step-dot { border-color: #3a4a63; }

#tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 24px 4px 6px; }
.tags-label { color: var(--muted); font-size: 13px; margin-right: 2px; }
.tag {
  display: inline-flex; align-items: center; gap: 7px;
  background: #eef3fe; color: var(--navy-700); padding: 5px 13px;
  border-radius: var(--r-pill); font-size: 13px; font-weight: 600; border: 1px solid #dce7fc;
}

/* ── Result card ──────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px; margin: 18px 0; box-shadow: var(--sh-md);
  animation: rise .28s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card.out {
  display: flex; gap: 14px; align-items: flex-start; background: var(--warn-bg); border-color: var(--warn-bd);
}
.out-ic {
  flex-shrink: 0; display: grid; place-items: center; width: 28px; height: 28px;
  background: #f59e0b; color: #fff; border-radius: 50%; font-weight: 700;
}
.card.out p { margin: 2px 0; color: #92400e; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-domain {
  background: #eef3fe; color: var(--navy-700); border: 1px solid #dce7fc;
  font-size: 14px; font-weight: 700; padding: 5px 13px; border-radius: 8px;
}
[data-theme="dark"] .card-domain { background: #182742; color: #9cc0ff; border-color: #294066; }
.card-label { color: var(--muted); font-size: 13px; }
/* 카드 내 섹션 — 통일된 헤더 + 구분선 */
.card-section { margin-top: 20px; }
.card-section + .card-section {
  margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line);
}
.block-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 15.5px; font-weight: 700; color: var(--ink); margin: 0 0 13px;
}
.block-ic {
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 8px; background: #eef3fe; color: var(--brand); flex-shrink: 0;
}
.block-ic svg { width: 16px; height: 16px; }
.answer-caption { font-size: 12.5px; color: var(--muted); margin: -3px 0 14px 37px; }
.answer { font-size: 15.5px; color: #1e293b; line-height: 1.78; margin: 0; }
.answer p { margin: 0 0 11px; }
.answer p:last-child { margin-bottom: 0; }
.answer strong { color: var(--ink); font-weight: 700; }
.answer .ans-list { list-style: none; counter-reset: ans; margin: 6px 0 0; padding: 0; }
.answer .ans-list li {
  position: relative; padding: 11px 0 11px 40px; border-top: 1px solid var(--line-2);
}
.answer .ans-list li:first-child { border-top: 0; padding-top: 4px; }
.answer .ans-list li::before {
  counter-increment: ans; content: counter(ans);
  position: absolute; left: 0; top: 9px; width: 25px; height: 25px;
  display: grid; place-items: center; background: #eef3fe; color: var(--brand-d);
  border-radius: 50%; font-size: 13px; font-weight: 700;
}
.answer .ans-list li:first-child::before { top: 2px; }

.section-label {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 10px;
}
.cites { margin-bottom: 0; }
.cite {
  background: #f8fafc; border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; margin-bottom: 8px;
}
.cite summary {
  display: flex; align-items: flex-start; gap: 12px;
  cursor: pointer; list-style: none; font-size: 14.5px; color: var(--ink);
}
.cite summary::-webkit-details-marker { display: none; }
.cite summary::after {
  content: "+"; color: var(--muted); font-size: 18px; font-weight: 400;
  align-self: center; flex-shrink: 0;
}
.cite[open] summary::after { content: "−"; }
/* 에디토리얼 조문 헤더: §마크 + 조문/법령명 */
.cite-head { display: flex; align-items: flex-start; gap: 11px; flex: 1; min-width: 0; }
.cite-mark { font-size: 21px; font-weight: 800; line-height: 1.05; color: var(--navy-600); flex-shrink: 0; }
.cite-meta { display: flex; flex-direction: column; min-width: 0; }
.cite-article { font-size: 14.5px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.cite-law { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
[data-theme="dark"] .cite-mark { color: #9cc0ff; }
.cite .date {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex-shrink: 0;
  color: var(--ok); font-size: 12px; font-weight: 600; background: #ecfdf3; padding: 3px 9px; border-radius: 6px;
}
.cite .date svg { width: 12px; height: 12px; }
.cite .snippet {
  font-size: 14px; color: #475569; line-height: 1.7; margin: 12px 0 10px;
  padding-left: 13px; border-left: 3px solid #cbd5e1;
}
.cite .snippet strong { color: var(--ink); font-weight: 700; }
.cite .snippet span { display: block; }
.law-lead { color: var(--ink); font-weight: 600; margin-bottom: 7px; }
.law-hang { margin-top: 9px; }
.law-ho { padding-left: 18px; margin-top: 4px; }
.law-mok { padding-left: 34px; margin-top: 3px; color: #64748b; }
.law-lead:first-child, .law-hang:first-child { margin-top: 0; }
.cite-link { font-size: 13px; font-weight: 600; }

.contacts { margin-bottom: 4px; }
.contact {
  display: flex; gap: 12px; align-items: center;
  background: #eef3fe; border: 1px solid #dce7fc; border-radius: var(--r);
  padding: 12px 14px; margin-bottom: 8px; font-size: 14px;
}
.contact-ic {
  display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0;
  background: var(--navy-600); color: #fff; border-radius: 8px; font-size: 14px;
}
.contact-ic svg { width: 16px; height: 16px; }
.contact .phone { color: var(--brand-d); font-weight: 700; }
.contact .note { color: var(--muted); font-size: 13px; }

/* 문서 초안 — 카드와 어울리는 문서 시트 형태 */
.draft-doc {
  margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r);
  background: #fbfcfe; overflow: hidden; animation: rise .28s ease both;
}
.draft-doc-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid var(--line-2);
}
.draft-doc-title { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--ink); }
.draft-doc-title svg { width: 15px; height: 15px; color: var(--navy-600); }
.draft-doc-head .copy-btn { margin-left: auto; }
.draft-doc-body {
  margin: 0; padding: 16px 18px; white-space: pre-wrap; word-break: break-word;
  font-family: inherit; font-size: 13.5px; line-height: 1.8; color: var(--text);
}
[data-theme="dark"] .draft-doc { background: #10192b; }
[data-theme="dark"] .draft-doc-head { background: #16223a; border-color: var(--line-2); }
[data-theme="dark"] .draft-doc-title svg { color: #9cc0ff; }

/* ── 답변 단어 단위 reveal (타이핑 느낌) ─────────────────── */
.answer .w { opacity: 0; }
.answer .w.on { opacity: 1; transition: opacity .18s ease; }
@media (prefers-reduced-motion: reduce) { .answer .w { opacity: 1; } }

/* ── 복사 버튼 ────────────────────────────────────────── */
.copy-btn {
  display: inline-flex; align-items: center; gap: 5px; margin-left: auto;
  background: none; border: 0; font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--muted); cursor: pointer; padding: 4px 9px; border-radius: 8px; transition: all .15s ease;
}
.copy-btn:hover { color: var(--accent-d); background: #fdf0ea; }
[data-theme="dark"] .copy-btn:hover { color: var(--accent); background: #281d16; }
.copy-btn svg { width: 14px; height: 14px; }

/* ── 토스트 ───────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(12px);
  display: inline-flex; align-items: center; gap: 8px; z-index: 100;
  background: #0f172a; color: #fff; padding: 11px 18px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; box-shadow: var(--sh-lg);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.toast svg { width: 16px; height: 16px; color: #4ade80; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Footer ───────────────────────────────────────────── */
footer { border-top: 1px solid var(--line); background: #fff; margin-top: 40px; }
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 32px 24px; }
.footer-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.footer-brand strong { color: var(--ink); font-size: 14px; }
.footer-note { color: var(--muted); font-size: 13px; max-width: 640px; margin: 0 0 12px; line-height: 1.7; }
.footer-copy { color: #94a3b8; font-size: 12px; margin: 0; }

.hidden { display: none; }

/* ── Scroll reveal ────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .6s cubic-bezier(.2,.6,.2,1), transform .6s cubic-bezier(.2,.6,.2,1);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
/* 그리드 내 카드 순차 등장(stagger) */
.domains > .reveal:nth-child(2) { transition-delay: .07s; }
.domains > .reveal:nth-child(3) { transition-delay: .14s; }
.domains > .reveal:nth-child(4) { transition-delay: .21s; }
.features > .reveal:nth-child(2) { transition-delay: .09s; }
.features > .reveal:nth-child(3) { transition-delay: .18s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 760px) {
  .features { grid-template-columns: 1fr; }
  .domains { grid-template-columns: repeat(2, 1fr); }
  .steps { flex-direction: column; align-items: stretch; }
  .step { max-width: none; }
  .step-arrow { transform: rotate(90deg); justify-content: center; }
  .section-head { margin: 48px auto 24px; }
  .section-head h2, .cta-band h2 { font-size: 24px; }
  .cta-band { padding: 44px 24px; }
  .hero { padding: 56px 20px 44px; }
  .hero-title { font-size: 32px; }
  .hero-sub { font-size: 16px; }
  .hero-sub br { display: none; }
  .nav-domains { display: none; }
  main { padding: 0 16px; }

  /* 상담·결과 화면 */
  #consult { padding: 24px 0 48px; }
  .ask-title { font-size: 21px; }
  .ask-help { font-size: 14px; }
  .ask { padding: 7px 7px 7px 14px; }
  .ask input { font-size: 15px; }
  .ask #go { padding: 11px 16px; }
  .card { padding: 20px 18px; }
  .card-head { flex-wrap: wrap; gap: 8px; }
  .cite summary { flex-wrap: wrap; }
  .answer { font-size: 15px; }
  .answer .ans-list li { padding-left: 34px; }
  .draft-doc-body { font-size: 12.5px; padding: 14px 15px; }
}

@media (max-width: 440px) {
  .domains { grid-template-columns: 1fr; }

  /* 상담·결과 — 초협소 화면 */
  .navbar-inner { padding: 11px 16px; }
  .brand-text em { display: none; }
  .ask { flex-wrap: wrap; gap: 8px; }
  .ask #go { flex: 1 0 100%; }   /* 아이콘+입력칸은 한 줄, 버튼만 아래 전체폭 */
  .hero-search { flex-wrap: wrap; gap: 8px; }
  .hero-go { flex: 1 0 100%; justify-content: center; }
  .card { padding: 18px 15px; }
  .answer .ans-list li { padding-left: 30px; }
  .contact { flex-wrap: wrap; }
}

/* ============================================================
   다크 모드 — [data-theme="dark"] 토큰 + 하드코딩 색 오버라이드
   ============================================================ */
[data-theme="dark"] {
  --brand: #5b94ff; --brand-d: #84acff;
  --accent: #f4805d; --accent-d: #f4805d;
  --ink: #eaf1fb; --text: #c4d0e0; --muted: #8b97a8;
  --line: #27374f; --line-2: #1d2940;
  --bg: #0b1220; --card: #141e30;
  --sh-sm: 0 1px 2px rgba(0,0,0,.4);
  --sh-md: 0 4px 14px rgba(0,0,0,.45);
  --sh-lg: 0 18px 48px rgba(0,0,0,.55);
}
[data-theme="dark"] .navbar { background: rgba(13,20,34,.82); }
[data-theme="dark"] .hero {
  background:
    radial-gradient(1100px 460px at 50% -12%, #17274a 0%, rgba(23,39,74,0) 62%),
    linear-gradient(180deg, #131e33 0%, var(--card) 100%);
}
[data-theme="dark"] .hero-title .accent { color: #9cc0ff; }
[data-theme="dark"] .hero-title .grad, [data-theme="dark"] .grad {
  background: linear-gradient(120deg, #79a8ff 10%, #bcd3ff 90%);
  -webkit-background-clip: text; background-clip: text;
}
[data-theme="dark"] .eyebrow,
[data-theme="dark"] .feature-icon,
[data-theme="dark"] .domain-icon,
[data-theme="dark"] .block-ic,
[data-theme="dark"] .tag,
[data-theme="dark"] .cite,
[data-theme="dark"] .contact,
[data-theme="dark"] .ans-list li::before { background: #182742; }
[data-theme="dark"] .eyebrow { border-color: #294066; color: #9cc0ff; }
[data-theme="dark"] .tag { border-color: #294066; color: #cfe0ff; }
[data-theme="dark"] .contact { border-color: #294066; }
[data-theme="dark"] .btn-ghost,
[data-theme="dark"] .chip,
[data-theme="dark"] .ask { background: var(--card); }
[data-theme="dark"] .domain-tags span { background: #1e2c45; color: var(--text); }
[data-theme="dark"] .answer { color: var(--ink); }
[data-theme="dark"] .cite .snippet { color: #aebccf; border-color: #33455f; }
[data-theme="dark"] .cite .date { background: #0e2e1e; color: #57d394; }
[data-theme="dark"] .step-arrow { color: #3a4a63; }
[data-theme="dark"] footer { background: var(--card); }
[data-theme="dark"] .card.out { background: #2a2412; border-color: #5b4a1c; }
[data-theme="dark"] .card.out p { color: #f2d98c; }
/* 라이트용 짙은 네이비 글자 → 다크에서 잘 보이게 */
[data-theme="dark"] .btn-ghost { color: var(--ink); }
[data-theme="dark"] .btn-ghost:hover { background: #1b2840; border-color: var(--brand); }
[data-theme="dark"] .chip { color: #cfe0ff; }
[data-theme="dark"] .chip:hover { background: #1b2840; color: #fff; }
[data-theme="dark"] .feature-icon { color: #84acff; }
[data-theme="dark"] .feature:hover { border-color: var(--brand); }
[data-theme="dark"] .law-mok { color: #93a3b8; }
[data-theme="dark"] .law-ho { color: #aebccf; }
[data-theme="dark"] .btn-outline { background: #281d16; color: #f4a98e; border-color: #5b3a2c; }
[data-theme="dark"] .btn-outline:hover { background: #33271d; border-color: var(--accent); color: #f9c3ac; }
