/* =====================================================================
   정책파도 (POLICYWAVE) — 공용 디자인 시스템
   ---------------------------------------------------------------------
   왜 한 파일로? 초보자가 색/폰트/간격을 한 곳에서만 바꾸면 사이트 전체가
   바뀌도록 'CSS 변수(--변수)'로 토큰화했습니다. 색을 바꾸고 싶으면
   :root 안의 값만 수정하세요. (best practice: 디자인 토큰 중앙관리)
   ===================================================================== */

/* ---------- 1. 디자인 토큰 (여기만 바꾸면 전체 테마 변경) ---------- */
:root {
  /* 브랜드 색 */
  --brand: #6366f1;          /* 메인 보라-남색 */
  --brand-2: #8b5cf6;        /* 그라데이션 짝 */
  --brand-ink: #4f46e5;      /* 진한 강조(버튼 hover 등) */

  /* 카테고리 색 (data-category와 매칭) */
  --cat-ai: #6366f1;
  --cat-life: #10b981;
  --cat-money: #f59e0b;

  /* 표면/텍스트 (라이트 모드 기본값) */
  --bg: #f7f8fb;             /* 페이지 배경 */
  --surface: #ffffff;        /* 카드/헤더 배경 */
  --surface-2: #f1f3f8;      /* 옅은 영역 */
  --border: #e7e9f0;         /* 경계선 */
  --text: #1a1d29;           /* 본문 글자 */
  --text-soft: #5b6072;      /* 보조 글자 */
  --text-faint: #9aa0b4;     /* 더 옅은 글자 */

  /* 모양/그림자 */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20,22,40,.06), 0 1px 3px rgba(20,22,40,.05);
  --shadow-md: 0 4px 12px rgba(20,22,40,.08), 0 2px 4px rgba(20,22,40,.05);
  --shadow-lg: 0 18px 40px rgba(20,22,40,.14);

  /* 레이아웃 */
  --maxw: 1180px;            /* 피드 최대폭 */
  --readw: 720px;            /* 글 본문 최대폭(가독성 황금폭) */
  --header-h: 60px;
  --bottomnav-h: 62px;

  /* 폰트 — Pretendard 우선, 없으면 시스템 한글 폰트로 폴백 */
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
          "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui,
          "Segoe UI", Roboto, sans-serif;
}

/* 다크 모드: <html data-theme="dark"> 일 때 토큰만 교체 */
[data-theme="dark"] {
  --bg: #0e1016;
  --surface: #171a23;
  --surface-2: #1f2330;
  --border: #2a2f3e;
  --text: #eef0f6;
  --text-soft: #aab0c4;
  --text-faint: #767d94;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 14px rgba(0,0,0,.45);
  --shadow-lg: 0 18px 44px rgba(0,0,0,.6);
}

/* ---------- 2. 기본 리셋 ---------- */
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* 페이지마다 스크롤바 유무로 가로폭이 덜컹거리는 것 방지 (항상 스크롤바 자리 확보) */
  scrollbar-gutter: stable;
  overflow-y: scroll;
}

/* 헤더/푸터를 JS로 채우기 전에도 '자리'를 미리 잡아둬 레이아웃 점프(덜컹) 방지 */
#hdr { min-height: var(--header-h); }
#ftr { min-height: 220px; display: block; }
@media (min-width: 700px) { #ftr { min-height: 200px; } }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  word-break: keep-all;        /* 한글 줄바꿈을 단어 단위로 (가독성 ↑) */
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { line-height: 1.3; font-weight: 800; letter-spacing: -.02em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* 모바일 하단 탭바에 가리지 않도록 본문 하단 여백 확보 */
.page { padding-bottom: calc(var(--bottomnav-h) + 24px); }
@media (min-width: 860px) { .page { padding-bottom: 40px; } }

/* ---------- 3. 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 16px;
  max-width: var(--maxw); margin: 0 auto; padding: 0 18px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 900; font-size: 19px; letter-spacing: -.03em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; color: #fff; font-size: 16px;
  box-shadow: var(--shadow-sm);
}
.brand .logo svg { width: 18px; height: 18px; }

/* 데스크톱 메뉴 — 대메뉴 최소화 (홈/인기/카테고리▾/소개) */
.nav-desktop { display: none; align-items: center; margin-left: 8px; gap: 4px; }
.nav-desktop a, .nav-desktop .dropdown > button {
  display: inline-flex; align-items: center; gap: 4px; height: 38px;
  padding: 0 12px; border-radius: 10px; font-weight: 700; font-size: 15px; line-height: 1;
  color: var(--text-soft); background: none; border: 0; cursor: pointer; font-family: inherit;
}
.nav-desktop a:hover, .nav-desktop .dropdown > button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-desktop a.active { color: var(--brand-ink); background: color-mix(in srgb, var(--brand) 12%, transparent); }

.dropdown { position: relative; display: inline-flex; align-items: center; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: .16s ease;
}
.dropdown:hover .dropdown-menu, .dropdown:focus-within .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.dropdown-menu a:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-menu .emoji { font-size: 18px; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-soft);
  display: grid; place-items: center; font-size: 18px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.btn-write {
  display: none; align-items: center; gap: 6px; height: 40px; padding: 0 16px;
  border-radius: 11px; border: 0; font-weight: 800; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow-sm);
}
.btn-write:hover { filter: brightness(1.05); text-decoration: none; color: #fff; }

@media (min-width: 860px) {
  .nav-desktop { display: flex; }
  .btn-write { display: inline-flex; }
  .menu-toggle { display: none; }
  /* 데스크톱에선 모바일 메뉴가 절대 보이지 않도록 확실히 차단 */
  .mobile-sheet { display: none !important; }
}

/* 모바일 햄버거 시트 */
.menu-toggle { display: grid; }
.mobile-sheet {
  position: fixed; inset: 0; z-index: 60; display: none;
}
.mobile-sheet.open { display: block; }
.mobile-sheet .scrim { position: absolute; inset: 0; background: rgba(10,12,20,.45); }
.mobile-sheet .panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(82vw, 320px);
  background: var(--surface); padding: 18px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
}
.mobile-sheet .panel a {
  padding: 14px 12px; border-radius: 12px; font-size: 17px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 12px;
}
.mobile-sheet .panel a:hover { background: var(--surface-2); text-decoration: none; }
.mobile-sheet .panel hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }

/* ---------- 4. 히어로 ---------- */
.hero { padding: 30px 0 14px; }
.hero h1 { font-size: clamp(26px, 6vw, 40px); margin: 0 0 8px; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand), var(--brand-2) 60%, #ec4899);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--text-soft); font-size: clamp(15px, 3.5vw, 18px); margin: 0 0 18px; max-width: 640px; }

/* 검색창 */
.searchbar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 999px; padding: 4px 6px 4px 18px; max-width: 560px;
  box-shadow: var(--shadow-sm); transition: border-color .15s;
}
.searchbar:focus-within { border-color: var(--brand); }
.searchbar svg { width: 20px; height: 20px; color: var(--text-faint); flex: none; }
.searchbar input {
  flex: 1; border: 0; outline: 0; background: none; color: var(--text);
  font-size: 16px; padding: 12px 0; font-family: inherit;
}
.searchbar button {
  border: 0; border-radius: 999px; height: 40px; padding: 0 20px; font-weight: 800;
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

/* 카테고리 칩 (가로 스크롤) */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 4px; -ms-overflow-style: none; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: var(--surface); border: 1.5px solid var(--border); color: var(--text-soft);
  white-space: nowrap; transition: .12s;
}
.chip:hover { color: var(--text); border-color: var(--text-faint); text-decoration: none; }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* PC(데스크톱)에서는 히어로(타이틀·부제·검색·칩)를 가운데 정렬.
   홈과 카테고리(서브카테고리) 페이지 모두 적용. 모바일은 왼쪽 정렬 유지. */
@media (min-width: 860px) {
  .hero { text-align: center; padding-top: 44px; }
  .hero p, .hero .breadcrumb { margin-left: auto; margin-right: auto; }
  .hero .searchbar { margin-left: auto; margin-right: auto; }
  .hero .chips { justify-content: center; }
}

/* ---------- 5. 섹션 제목 ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; }
.section-head h2 { font-size: 20px; margin: 0; display: flex; align-items: center; gap: 8px; }
.section-head a { font-size: 14px; font-weight: 700; color: var(--text-soft); }

/* ---------- 6. 카드 피드 (masonry 느낌의 반응형 그리드) ---------- */
.feed {
  display: grid; gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .feed { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .feed { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px){ .feed { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.card .thumb {
  aspect-ratio: 3 / 2; display: grid; place-items: center; font-size: 46px;
  position: relative; color: #fff;
}
.card .thumb .cat-tag {
  position: absolute; top: 10px; left: 10px; font-size: 12px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.92); color: #1a1d29;
}
.card .thumb .new-badge {
  position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 800;
  padding: 3px 8px; border-radius: 999px; background: #ef4444; color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); z-index: 2; letter-spacing: .02em;
}
.card .body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .title { font-size: 16px; font-weight: 800; color: var(--text); margin: 0; letter-spacing: -.02em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .excerpt { font-size: 13.5px; color: var(--text-soft); margin: 0; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-faint); }
.card .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

/* 큰 피처드 카드 (홈 상단) */
.feed-featured { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 8px; }
@media (min-width: 760px) { .feed-featured { grid-template-columns: 1fr 1fr; } }
/* 썸네일 높이를 '고정'으로 둬서 두 추천 카드의 높이를 일치시키고
   색만 가득한 빈 배너가 생기지 않게 합니다(이모지도 정중앙에 보이게). */
.card-hero .thumb { aspect-ratio: auto; height: 200px; font-size: 60px; }
.card-hero .title { font-size: clamp(18px, 2.6vw, 22px); -webkit-line-clamp: 2; }
.card-hero .excerpt { font-size: 14.5px; -webkit-line-clamp: 2; }
@media (min-width: 760px) { .card-hero .thumb { height: 220px; } }

/* 검색 결과 없을 때 */
.empty { text-align: center; color: var(--text-faint); padding: 60px 20px; }
.empty .big { font-size: 44px; margin-bottom: 8px; }

/* ---------- 7. 광고 슬롯 (애드센스 자리) ---------- */
.ad-slot {
  margin: 22px auto; max-width: var(--readw); min-height: 90px;
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  display: grid; place-items: center; color: var(--text-faint);
  font-size: 12px; background: var(--surface-2);
}
.ad-slot::before { content: "광고 영역 (애드센스 코드 삽입 위치)"; }
.ad-slot.filled { border: 0; background: none; min-height: 0; }
.ad-slot.filled::before { content: ""; }

/* ▼▼▼ 광고 자리 전부 숨김 (애드센스 승인 후 아래 한 줄을 지우면 다시 보입니다) ▼▼▼ */
.ad-slot { display: none !important; }
/* ▲▲▲ 여기까지 ▲▲▲ */

/* ---------- 7-1. 플로팅 저장/즐겨찾기 버튼 ---------- */
.quick-save {
  position: fixed; right: 16px; bottom: calc(var(--bottomnav-h) + 14px); z-index: 55;
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px;
  border: 0; border-radius: 999px; font-family: inherit; font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow-lg); cursor: pointer; transition: transform .15s, background .15s;
  animation: qs-pop .4s ease both;
}
.quick-save:hover { transform: translateY(-2px); }
.quick-save .star { font-size: 18px; line-height: 1; }
.quick-save.saved { background: var(--surface); color: var(--brand-ink); border: 1.5px solid var(--brand); }
@keyframes qs-pop { from { opacity: 0; transform: translateY(16px) scale(.9); } to { opacity: 1; transform: none; } }
@media (min-width: 860px) { .quick-save { right: 24px; bottom: 24px; height: 52px; font-size: 16px; } }

/* ---------- 7-2. 관리자 로그인 게이트 ---------- */
.admin-gate { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: grid; place-items: center; padding: 20px; }
.admin-gate .card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 30px 26px; width: min(92vw, 360px); box-shadow: var(--shadow-lg); text-align: center; }
.admin-gate .logo-lg { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; color: #fff; }
.admin-gate .logo-lg svg { width: 30px; height: 30px; }
.admin-gate h1 { font-size: 20px; margin: 0 0 4px; }
.admin-gate p { color: var(--text-soft); font-size: 14px; margin: 0 0 18px; }
.admin-gate .err { color: #ef4444; font-size: 13px; min-height: 18px; margin-top: 8px; font-weight: 700; }
.admin-gate .hint { color: var(--text-faint); font-size: 12px; margin-top: 14px; }

/* ---------- 7-3. 통계 ---------- */
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin: 6px 0 16px; }
@media (min-width: 520px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px 14px; text-align: center; }
.stat-tile .num { font-size: 26px; font-weight: 800; color: var(--brand-ink); }
.stat-tile .lab { font-size: 12.5px; color: var(--text-soft); margin-top: 4px; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stat-table th, .stat-table td { border-bottom: 1px solid var(--border); padding: 10px 8px; text-align: left; }
.stat-table th { color: var(--text-faint); font-weight: 700; font-size: 12.5px; }
.stat-table td.n { text-align: right; font-weight: 800; color: var(--brand-ink); }
.stat-empty { color: var(--text-faint); text-align: center; padding: 24px; font-size: 14px; }

/* ---------- 8. 글(article) 본문 — 매거진급 가독성 ---------- */
.article-wrap { max-width: var(--readw); margin: 0 auto; padding: 0 18px; }
.article-head { padding: 24px 0 8px; }
.breadcrumb { font-size: 13px; color: var(--text-faint); margin-bottom: 14px; }
.breadcrumb a { color: var(--text-soft); }
.article-head h1 { font-size: clamp(24px, 5.2vw, 36px); margin: 0 0 14px; letter-spacing: -.03em; }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--text-soft); font-size: 14px; }
.article-meta .avatar {
  width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tag { font-size: 13px; font-weight: 700; color: var(--brand-ink); background: color-mix(in srgb, var(--brand) 10%, transparent); padding: 5px 12px; border-radius: 999px; }
.tag:hover { text-decoration: none; filter: brightness(.97); }

.article-cover {
  aspect-ratio: 16/8; border-radius: var(--radius); display: grid; place-items: center;
  font-size: 80px; color: #fff; margin: 8px 0 26px;
}

/* 본문 타이포 — 이 .prose 안의 규칙이 '문서 정렬' 품질을 만듭니다 */
.prose { font-size: 17.5px; line-height: 1.85; color: var(--text); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: 24px; margin-top: 2em; padding-top: .2em; letter-spacing: -.02em; }
.prose h3 { font-size: 20px; margin-top: 1.6em; }
.prose p { margin: 0; }
.prose strong { font-weight: 800; }
.prose a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .4em 0; }
.prose li::marker { color: var(--brand); font-weight: 700; }
.prose blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--brand);
  color: var(--text-soft); font-size: 18px; font-style: normal;
}
.prose blockquote p { margin: 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.2em 0; }
.prose img { border-radius: var(--radius); margin: 1.6em 0; }
.prose code {
  background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-size: .9em;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
}
.prose pre {
  background: #0d1117; color: #e6edf3; padding: 18px; border-radius: var(--radius-sm);
  overflow-x: auto; font-size: 14px; line-height: 1.6;
}
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 1.4em 0; }
.prose th, .prose td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.prose th { background: var(--surface-2); font-weight: 800; }
/* 정보 강조 박스 */
.callout {
  margin: 1.6em 0; padding: 16px 18px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--border));
  font-size: 16px;
}
.callout strong { color: var(--brand-ink); }

/* 글 하단: 공유 + 작성자 */
.share-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 30px 0; }
.share-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700; font-size: 14px;
}
.share-btn:hover { background: var(--surface-2); text-decoration: none; }

/* 관련 글(파도타기) */
.related { margin: 40px 0; }
.related h2 { font-size: 20px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.next-read {
  display: block; margin: 30px 0; padding: 20px; border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, var(--surface)), var(--surface));
  border: 1px solid var(--border);
}
.next-read .label { font-size: 12px; font-weight: 800; color: var(--brand-ink); letter-spacing: .04em; }
.next-read .t { font-size: 18px; font-weight: 800; color: var(--text); margin-top: 4px; }
.next-read:hover { text-decoration: none; box-shadow: var(--shadow-md); }

/* ---------- 9. 일반 페이지(소개/약관 등) ---------- */
.doc { max-width: var(--readw); margin: 0 auto; padding: 30px 18px; }
.doc h1 { font-size: clamp(26px, 5vw, 34px); margin: 0 0 8px; }
.doc .sub { color: var(--text-soft); margin: 0 0 24px; }
.doc h2 { font-size: 21px; margin: 1.8em 0 .6em; }
.doc p, .doc li { color: var(--text); line-height: 1.8; }
.doc a { color: var(--brand-ink); }

/* ---------- 10. 모바일 하단 탭바 (50대 친화 큰 버튼) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: var(--bottomnav-h);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--border);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-faint); font-size: 11px; font-weight: 700;
}
.bottom-nav a.active { color: var(--brand-ink); }
.bottom-nav a:hover { text-decoration: none; }
.bottom-nav svg { width: 23px; height: 23px; }
.bottom-nav .fab {
  flex: 0 0 auto; width: 54px; margin-top: -18px;
}
.bottom-nav .fab span {
  width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  box-shadow: var(--shadow-md);
}
.bottom-nav .fab svg { width: 26px; height: 26px; }
@media (min-width: 860px) { .bottom-nav { display: none; } }

/* ---------- 11. 푸터 ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 40px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 30px 18px; display: grid; gap: 18px; }
@media (min-width: 700px) { .footer-inner { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-inner .brand { font-size: 17px; }
.footer-col h4 { font-size: 13px; color: var(--text-faint); margin: 0 0 10px; letter-spacing: .03em; }
.footer-col a { display: block; padding: 5px 0; color: var(--text-soft); font-size: 14px; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding: 16px 18px; text-align: center; color: var(--text-faint); font-size: 13px; }
.footer-bottom .container { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; align-items: center; }

/* ---------- 12. 버튼/폼 공용 (관리자에서도 사용) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 11px 18px; border-radius: 12px; font-weight: 800; font-size: 15px; transition: .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { border: 0; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.btn-primary:hover { filter: brightness(1.06); color: #fff; }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }

label.field { display: block; margin: 16px 0; }
label.field .lab { display: block; font-weight: 800; font-size: 14px; margin-bottom: 6px; }
label.field .hint { font-weight: 500; color: var(--text-faint); font-size: 12.5px; }
.input, textarea.input, select.input {
  width: 100%; border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 12px 14px; font-size: 16px; font-family: inherit; outline: 0;
}
.input:focus { border-color: var(--brand); }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.6; }

/* 접근성: 키보드 포커스 표시 */
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 50%, transparent); outline-offset: 2px; border-radius: 6px; }

/* 토스트 알림 */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottomnav-h) + 18px); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .25s; z-index: 100; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 860px) { .toast { bottom: 24px; } }
