:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --text: #15181e;
  --muted: #5d6573;
  --line: #e3e6eb;
  --accent: #e5322d;
  --accent-ink: #ffffff;
  --accent-soft: #fdecea;
  --ok: #138a4a;
  --ok-soft: #e5f5ec;
  --warn: #b26a00;
  --warn-soft: #fff4e0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1f232b;
    --text: #eceef2;
    --muted: #9aa3b2;
    --line: #2a2f38;
    --accent: #ff5a52;
    --accent-ink: #ffffff;
    --accent-soft: #3a1d1c;
    --ok: #4cc786;
    --ok-soft: #173325;
    --warn: #f0b24a;
    --warn-soft: #3a2c12;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.02em; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* 헤더 */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; text-decoration: none; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-size: 15px; }
.site-nav { margin-left: auto; display: flex; gap: 4px; }
.site-nav a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: 15px; font-weight: 600; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 10px; font-size: 15px; cursor: pointer; }
@media (max-width: 720px) {
  .menu-btn { display: block; }
  .site-nav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px 12px; }
  .site-nav.open { display: flex; }
}

/* 히어로 */
.hero { padding: 40px 0 8px; }
.hero h1 { font-size: clamp(26px, 5vw, 38px); margin: 0 0 8px; }
.hero p { color: var(--muted); margin: 0; font-size: 17px; }

/* 카드 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 20px 0; }
.card h2 { font-size: 20px; margin: 0 0 12px; }

/* 폼 */
.search-form { display: flex; gap: 8px; }
.search-form input { flex: 1; min-width: 0; }
input[type="text"], input[type="number"], input[type="search"], select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; outline: none;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn { font: inherit; font-weight: 700; border: 0; border-radius: 10px; padding: 12px 20px; background: var(--accent); color: var(--accent-ink); cursor: pointer; white-space: nowrap; }
.btn:disabled { opacity: .6; cursor: progress; }
.hint { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } .search-form { flex-direction: column; } }
input[type="range"] { width: 100%; accent-color: var(--accent); }

/* 결과 */
.channel-head { display: flex; gap: 14px; align-items: center; }
.channel-head img { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); }
.channel-head h2 { margin: 0; font-size: 20px; }
.channel-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface-2); border-radius: 10px; padding: 12px; }
.stat span { display: block; color: var(--muted); font-size: 13px; }
.stat strong { font-size: 18px; }
.big-result { text-align: center; padding: 8px 0 4px; }
.big-result .label { color: var(--muted); font-size: 15px; }
.big-result .value { font-size: clamp(26px, 6vw, 40px); font-weight: 800; color: var(--accent); letter-spacing: -0.03em; }
.result-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
@media (max-width: 600px) { .result-row { grid-template-columns: 1fr; } }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.no { background: var(--warn-soft); color: var(--warn); }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.check-list li { display: grid; gap: 6px; }
.check-list .row { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.done > i { background: var(--ok); }
.note { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 14px; color: var(--muted); margin-top: 14px; }
.error { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 12px 14px; font-weight: 600; }
.video-list { display: grid; gap: 10px; }
.video { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; text-decoration: none; }
.video img { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.video strong { display: block; font-size: 15px; line-height: 1.4; }
.video span { color: var(--muted); font-size: 13px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .compare { grid-template-columns: 1fr; } }
.compare > div { background: var(--surface-2); border-radius: 12px; padding: 16px; }
.compare h3 { margin: 0 0 10px; font-size: 16px; }
.loading { text-align: center; color: var(--muted); padding: 24px 0; }

/* 본문 콘텐츠 */
.content { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; margin: 28px 0; }
.content h2 { font-size: 22px; margin: 28px 0 10px; }
.content h2:first-child { margin-top: 0; }
.content h3 { font-size: 18px; margin: 20px 0 8px; }
.content p, .content li { color: var(--text); }
.content table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 12px 0; }
.content th, .content td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; }
.content th { background: var(--surface-2); }
.table-scroll { overflow-x: auto; }
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
details summary { cursor: pointer; font-weight: 700; }
details p { margin: 8px 0 0; color: var(--muted); }

/* 쿠팡 */
#coupang { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 20px 0; }
#coupang h2 { font-size: 18px; margin: 0 0 12px; }
.coupang-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 600px) { .coupang-list { grid-template-columns: 1fr; } }
.coupang-item { display: block; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; text-decoration: none; }
.coupang-item strong { display: block; }
.coupang-item span { color: var(--muted); font-size: 14px; }
.disclosure { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

/* 다른 도구 */
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
@media (max-width: 720px) { .tools { grid-template-columns: 1fr; } }
.tool { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; }
.tool strong { display: block; margin-bottom: 4px; }
.tool span { color: var(--muted); font-size: 14px; }

/* 푸터 */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer p { margin: 4px 0; }

/* ===== 광고 자리 (높이를 미리 확보해 화면 밀림 방지) ===== */
.ad-slot { min-height: 100px; margin: 20px 0; }
.ad-slot[data-ad="content"] { min-height: 250px; }
.cp-banner { margin: 20px 0; min-height: var(--banner-h, 140px); }
.cp-banner iframe { display: block; width: 100%; }
.ad-slot.placeholder, .cp-banner.placeholder {
  display: grid; place-items: center; border: 2px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); font-size: 14px; background: repeating-linear-gradient(45deg, transparent 0 10px, var(--surface-2) 10px 20px);
}
.ad-slot.placeholder::before, .cp-banner.placeholder::before { content: attr(data-label); }
.content .ad-slot { margin: 24px 0; }

/* ===== 수익창출 판정 ===== */
.verdict { border-width: 2px; }
.verdict-head { margin-bottom: 14px; }
.verdict-label { display: block; color: var(--muted); font-size: 14px; font-weight: 600; }
.verdict-title { display: block; font-size: clamp(22px, 5vw, 30px); letter-spacing: -0.03em; margin: 2px 0 4px; }
.verdict-head p { margin: 0; color: var(--muted); }
.verdict-likely { border-color: var(--ok); }
.verdict-likely .verdict-title { color: var(--ok); }
.verdict-near .verdict-title, .verdict-early .verdict-title { color: var(--warn); }
.verdict-near, .verdict-early { border-color: var(--warn); }
.verdict-no .verdict-title, .verdict-unknown .verdict-title { color: var(--muted); }

/* ===== 표·태그·작은 막대 ===== */
.grow { flex: 1; min-width: 0; }
.btn-ghost { font: inherit; font-size: 14px; font-weight: 600; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; white-space: nowrap; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: 10px 6px; text-align: left; vertical-align: top; }
.data-table th { color: var(--muted); font-weight: 600; }
.data-table td a { text-decoration: none; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.data-table .num { text-align: right; white-space: nowrap; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.kv { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.kv li { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.kv span { color: var(--muted); }
.mini-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mini-bars li { display: grid; grid-template-columns: 96px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.mini-bars .mb-val { color: var(--muted); white-space: nowrap; }
.thumb-empty { display: block; width: 120px; aspect-ratio: 16/9; border-radius: 8px; background: var(--surface-2); }

/* ===== 최근 조회 ===== */
.recent { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.recent-label { color: var(--muted); font-size: 13px; margin-right: 4px; }
.chip { font: inherit; font-size: 13px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
