/* 잠자는 내 돈 — 공용 스타일
   수익형 단일 컬럼 표준(webs/_hubs/HUB_STANDARD.md §"🏆 수익형 페이지 아키텍처").
   페이지마다 인라인 CSS 를 따로 들고 있어서 폭이 900/760/1100 으로 제각각이었다.
   한 곳에 모아 두면 표준이 바뀔 때 한 번만 고치면 된다. */

:root {
  --topic: #0d9488;
  --topic-dark: #0f766e;
  --topic-light: #ccfbf1;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f8fafc;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--topic-dark); }

/* ===== 헤더 — 전체폭, 안쪽만 본문 폭 ===== */
.main-header {
  background: linear-gradient(135deg, var(--topic) 0%, var(--topic-dark) 100%);
  color: #fff;
  padding: 26px 16px 22px;
  text-align: center;
}
.header-inner { max-width: 640px; margin: 0 auto; }
.header-icon { font-size: 34px; line-height: 1; margin-bottom: 6px; }
.site-title { font-size: 25px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.5px; line-height: 1.35; }
.site-sub { font-size: 14px; margin: 0; opacity: .92; }
.main-header a { color: #fff; text-decoration: none; }
.breadcrumb-nav { max-width: 640px; margin: 10px auto 0; font-size: 12.5px; opacity: .9; }
.breadcrumb-nav a { text-decoration: underline; }
.breadcrumb-nav span { margin: 0 5px; }

/* 띠 헤더 — 전체폭 */
.band-header {
  background: var(--topic-dark);
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -.2px;
}

/* ===== 본문 — 단일 컬럼 640 ===== */
.layout-container {
  display: block;
  max-width: 640px;
  margin: 0 auto;
  padding: 22px 16px 52px;
}
/* 표·코드처럼 넓은 자식이 컨테이너를 밀어내 가로 스크롤이 생기는 걸 막는다 */
.layout-container > main,
.layout-container > * { min-width: 0; }

@media (max-width: 560px) {
  .layout-container { padding: 16px 12px 42px; }
  .site-title { font-size: 21px; }
}

/* ===== 인-콘텐츠 광고 =====
   ⛔ 카드·테두리·고정폭으로 가두지 않는다. 반응형 광고가 컨테이너보다 크면 모바일에서 잘린다. */
.native-ad { margin: 22px auto; text-align: center; }
.native-ad .adsbygoogle { display: block; min-height: 100px; }
.native-ad-tag { display: none; }

/* 카카오 채널 배너 — 컨트롤타워 ad-loader 가 채운다.
   ⚠ 못 채우면 빈 박스가 남으므로 최소 높이만 주고 비었을 때는 보이지 않게 둔다. */
.ad-slot {
  position: relative; display: block; width: 100%;
  border-radius: 12px; overflow: hidden; text-decoration: none;
  margin: 20px auto; min-height: 0;
}
.ad-slot:empty { display: none; }
.ad-slot.has-image { aspect-ratio: 4 / 1; background: linear-gradient(135deg, var(--topic), var(--topic-dark)); }
.ad-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ad-slot .ad-inner {
  position: relative; display: flex; flex-direction: column; justify-content: center;
  padding: 14px 18px; color: #fff; z-index: 1;
  background: linear-gradient(135deg, var(--topic), var(--topic-dark));
}
.ad-slot.has-image .ad-inner {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.2) 70%, rgba(0,0,0,0) 100%);
}
.ad-slot .ad-title { font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.ad-slot .ad-subtitle, .ad-slot .ad-desc { font-size: 12.5px; opacity: .92; margin-top: 2px; }
.ad-slot .ad-cta {
  align-self: flex-start; margin-top: 8px; padding: 5px 13px;
  background: #fff; color: var(--topic-dark); border-radius: 20px; font-size: 12px; font-weight: 700;
}
.ad-slot .ad-label {
  position: absolute; top: 6px; right: 9px; z-index: 2;
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,.8);
  background: rgba(0,0,0,.25); padding: 1px 6px; border-radius: 4px;
}

/* ===== 공통 카드 ===== */
.card, .why-box, .diag-section, .step-section, .faq-section, .related-section, .kakao-channel-promo {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  padding: 20px;
  margin-bottom: 20px;
}
.why-box { border-left: 4px solid var(--topic); }
h2 { font-size: 18px; font-weight: 800; margin: 0 0 12px; letter-spacing: -.3px; color: var(--topic-dark); }
h3 { font-size: 15.5px; font-weight: 700; margin: 16px 0 6px; }
p { margin: 0 0 10px; font-size: 14.5px; }
.lead { font-size: 15px; }
.muted { color: var(--muted); font-size: 13px; }

/* 핵심 숫자 3칸 */
.stat-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 20px; }
.stat-item {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 9px; text-align: center; min-width: 0;
}
.stat-num { display: block; font-size: 21px; font-weight: 800; color: var(--topic); letter-spacing: -.5px; }
.stat-label { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.45; margin-top: 3px; }
@media (max-width: 420px) { .stat-num { font-size: 18px; } .stat-label { font-size: 10.5px; } }

/* 표 — 좁은 화면에서 가로 스크롤은 표 안에서만 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top; }
th { background: var(--topic-light); color: var(--topic-dark); font-weight: 700; white-space: nowrap; }

/* 절차 단계 */
.step { display: flex; gap: 11px; padding: 12px 0; border-top: 1px solid var(--line); }
.step:first-of-type { border-top: none; }
.step-no {
  flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--topic); color: #fff;
  font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.step-body { flex: 1; min-width: 0; }
.step-body b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.step-body span { font-size: 13.5px; color: #374151; }

/* FAQ */
.faq-item { border-top: 1px solid var(--line); }
.faq-item:first-of-type { border-top: none; }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 13px 0; font-size: 14.5px; font-weight: 700;
  display: flex; justify-content: space-between; gap: 10px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--topic); font-weight: 400; font-size: 19px; }
.faq-item[open] summary::after { content: '−'; }
.faq-answer { font-size: 14px; color: #374151; padding: 0 0 14px; }

/* 토픽 카드 */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.topic-card {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 14px; text-decoration: none; color: var(--ink); transition: all .15s;
}
.topic-card:hover { border-color: var(--topic); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.tc-emoji { font-size: 26px; display: block; }
.tc-label { display: block; font-weight: 800; font-size: 15px; margin: 5px 0 3px; color: var(--topic-dark); }
.tc-desc { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* 관련 네트워크 — 우리 사이트는 같은 탭, 공식만 새 탭 */
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 9px; }
.related-card {
  display: flex; gap: 10px; align-items: center; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink);
}
.related-card:hover { border-color: var(--topic); background: #f0fdfa; }
.related-icon { font-size: 21px; flex: 0 0 auto; }
.related-title { font-weight: 700; font-size: 14px; }
.related-desc { font-size: 12px; color: var(--muted); line-height: 1.45; }
.official-badge {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px;
  background: var(--topic-light); color: var(--topic-dark); margin-left: 4px; vertical-align: middle;
}

/* 카카오 채널 */
.kc-card { display: flex; gap: 13px; align-items: center; }
.kc-icon { font-size: 30px; }
.kc-body { flex: 1; min-width: 0; }
.kc-btn {
  display: inline-block; margin-top: 8px; padding: 9px 18px; background: #FEE500; color: #3C1E1E;
  border-radius: 22px; font-weight: 800; font-size: 14px; text-decoration: none;
}

/* 주의·출처 */
.notice { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 13px 15px; font-size: 13.5px; }
.sources { font-size: 12.5px; color: var(--muted); }
.sources a { color: var(--muted); }

.btn-share {
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.45); color: #fff;
  padding: 7px 15px; border-radius: 20px; font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: inherit; margin-top: 10px;
}

.main-footer { text-align: center; padding: 26px 16px 34px; font-size: 12.5px; color: var(--muted); }
.main-footer p { margin: 0 0 5px; font-size: 12.5px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(14px);
  background: rgba(17,24,39,.94); color: #fff; padding: 10px 18px; border-radius: 22px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .22s; z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
