/* ==========================================================================
   뒷삭 레이더 — 웹 리포트 스타일 (빌드 없는 순수 CSS)
   ========================================================================== */
:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-soft-2: #f1f5f9;
  --line: #e6ebf2;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #5b6b82;
  --muted-2: #94a3b8;
  --brand: #0f172a;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --danger: #e11d48;
  --danger-soft: #fff1f2;
  --ok: #059669;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 1px 3px rgba(15, 23, 42, .05), 0 18px 40px -24px rgba(15, 23, 42, .25);
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { letter-spacing: -.02em; line-height: 1.25; margin: 0; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--bg-soft-2); padding: .12em .4em; border-radius: 6px; font-size: .88em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -9999px; top: 0; background: #fff; padding: 10px 16px; z-index: 99;
  border-radius: 0 0 10px 0; box-shadow: var(--shadow);
}
.skip:focus { left: 0; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--brand); color: #fff;
}
.brand-text { font-size: 16px; letter-spacing: -.3px; }
.nav { display: flex; gap: 22px; }
.nav a { color: var(--muted); font-size: 14px; font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }

/* ---------------------------------------------------------------- ads */
.ad-slot {
  position: relative;
  min-height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.ad-slot .ad-ph {
  display: none;
  width: 100%; min-height: 90px;
  align-items: center; justify-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted-2);
  font-size: 12px;
  background: repeating-linear-gradient(45deg, #fafbfd, #fafbfd 10px, #f5f7fa 10px, #f5f7fa 20px);
  text-align: center;
  padding: 12px;
}
.ad-slot[hidden], .ad-top[hidden], .ad-infeed[hidden] { display: none; }
.ad-slot ins.adsbygoogle { width: 100%; }
.ads-preview .ad-slot .ad-ph { display: flex; }
.ads-preview .ad-slot ins { display: none; }
.ad-top { margin-top: 18px; }
.ad-top .ad-slot { min-height: 96px; }
.ad-slot.tall { min-height: 600px; }
.ad-slot.tall .ad-ph { min-height: 600px; }
.ad-infeed { margin: 26px 0; }
.ad-infeed .ad-slot { min-height: 110px; }

/* ---------------------------------------------------------------- hero */
.hero { padding: 54px 0 26px; text-align: center; }
.hero h1 {
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 800;
  margin-bottom: 16px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(180deg, transparent 58%, rgba(225, 29, 72, .18) 58%);
  color: var(--danger);
}
.lede {
  max-width: 680px; margin: 0 auto 30px;
  color: var(--muted); font-size: 16.5px;
}
.lede strong { color: var(--text); font-weight: 600; }

.dropzone {
  max-width: 720px; margin: 0 auto;
  padding: 34px 26px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(180deg, #fcfdff, var(--bg-soft));
  transition: border-color .18s, background .18s, transform .18s;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.006); }
.dz-icon { color: var(--accent); display: inline-grid; place-items: center; margin-bottom: 6px; }
.dz-title { font-size: 17px; font-weight: 700; margin: 6px 0 4px; }
.dz-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.dz-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.dz-status { margin: 14px 0 0; font-size: 13px; color: var(--muted); min-height: 1.2em; }
.dz-status.error { color: var(--danger); }
.dz-status.warn { color: #b45309; }
.dz-status.ok { color: var(--ok); }
.hero-alt { margin-top: 22px; font-size: 13.5px; color: var(--muted); }

/* ---------------------------------------------------------------- buttons */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 11px 20px; font-size: 14.5px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: .16s ease;
}
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: #1e293b; transform: translateY(-1px); }
.btn.subtle { background: #fff; border-color: var(--line-strong); color: var(--text); }
.btn.subtle:hover { background: var(--bg-soft); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------------------------------------------------------- layout */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
  padding-bottom: 40px;
}
.content-col { min-width: 0; }
.side-col { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 16px; }

/* ---------------------------------------------------------------- results */
.results {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  background: #fff;
  margin-bottom: 36px;
  /* sticky 헤더(62px) 아래로 스크롤 정렬 — 제목이 헤더에 가리지 않게 */
  scroll-margin-top: 78px;
}
/* 앵커로 이동하는 섹션도 sticky 헤더를 피합니다 */
section[id] { scroll-margin-top: 74px; }
.results-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.results-head h2 { font-size: 22px; margin: 8px 0 4px; }
.result-meta { color: var(--muted); font-size: 13px; margin: 0; }
.results-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.results-actions .btn { padding: 8px 13px; font-size: 13px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  background: var(--bg-soft-2); color: var(--text);
  font-size: 12px; font-weight: 600; letter-spacing: -.1px;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.badge.threads::before { background: #000; }
.badge.instagram::before { background: #d62976; }
.badge.x::before { background: #0f172a; }
.badge.facebook::before { background: #1877f2; }
.badge.meta::before { background: #0866ff; }
.badge.demo::before { background: #f59e0b; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0 12px; }
.card {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; padding: 16px;
}
.stat-card { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-num { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.stat-desc { font-size: 11.5px; color: var(--muted-2); line-height: 1.4; }
.stat-card.accent-danger { background: var(--danger-soft); border-color: #fecdd3; }
.stat-card.accent-danger .stat-num { color: var(--danger); }
.mini-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.mini-stats b { color: var(--text); }

.tabs { display: flex; gap: 6px; margin: 6px 0 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.tab {
  appearance: none; border: 1px solid transparent; background: transparent;
  padding: 8px 13px; border-radius: 9px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--muted); font-family: inherit;
  transition: .15s;
}
.tab i { font-style: normal; font-size: 11.5px; color: var(--muted-2); margin-left: 3px; }
.tab:hover { background: var(--bg-soft); color: var(--text); }
.tab.active { background: var(--brand); color: #fff; }
.tab.active i { color: rgba(255, 255, 255, .7); }

.table-tools { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.table-tools input, .table-tools select {
  padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 9px;
  font-size: 13.5px; font-family: inherit; background: #fff; color: var(--text);
}
.table-tools input { flex: 1 1 220px; }
.table-tools input:focus, .table-tools select:focus { outline: 2px solid rgba(37, 99, 235, .25); border-color: var(--accent); }

.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 560px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-soft);
  text-align: left; font-size: 12px; font-weight: 700; color: var(--muted);
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  letter-spacing: .02em;
}
.table td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fbfcfe; }
.col-no { width: 56px; color: var(--muted-2); }
.col-name { width: 32%; }
.col-state { width: 108px; }
.table td.col-no { color: var(--muted-2); font-size: 12.5px; }
.acct { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; }
.avatar {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: #3730a3;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.acct-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.acct-name:hover { color: var(--accent); }
.state-tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  white-space: nowrap;
}
.state-tag.lost { background: var(--danger-soft); color: #be123c; }
.state-tag.notback { background: #fff7ed; color: #b45309; }
.state-tag.fan { background: #ecfdf5; color: #047857; }
.state-tag.mutual { background: #eef2ff; color: #4338ca; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; margin: 0; }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.pager button {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.pager button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager button:disabled { opacity: .4; cursor: default; }

/* ---------------------------------------------------------------- prose */
.prose { margin: 44px 0; }
.prose h2 { font-size: 24px; margin-bottom: 14px; }
.prose p { color: #334155; }
.prose .three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.card.mini { background: #fff; }
.card.mini h3 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.card.mini p { font-size: 13.5px; color: var(--muted); margin: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.blue { background: var(--accent); }
.dot.red { background: var(--danger); }
.dot.green { background: var(--ok); }

.steps { list-style: none; padding: 0; margin: 20px 0 0; counter-reset: step; }
.steps li {
  position: relative; padding: 0 0 22px 46px; border-left: 2px solid var(--line);
  margin-left: 14px;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: -15px; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
}
.steps h3 { font-size: 16px; margin-bottom: 6px; }
.steps p { font-size: 14.5px; margin-bottom: 0; }

.checks { padding-left: 20px; color: #334155; font-size: 14.5px; }
.checks li { margin-bottom: 6px; }
.fine { font-size: 13px; color: var(--muted); }

details {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px;
  margin-bottom: 10px; background: #fff;
}
details[open] { background: var(--bg-soft); }
summary { cursor: pointer; font-weight: 600; font-size: 14.5px; }
summary::marker { color: var(--muted-2); }
details p { margin: 10px 0 0; font-size: 14px; color: var(--muted); }

/* ---------------------------------------------------------------- side */
.card.tip h3 { font-size: 14px; margin-bottom: 8px; }
.card.support p { margin: 0 0 12px; font-size: 13px; color: var(--muted); line-height: 1.55; }
.card.support .btn { width: 100%; justify-content: center; }
.card.support .support-qr { display: block; margin: 0 auto 8px; border-radius: 8px; image-rendering: pixelated; }
.card.support .support-qr[hidden] { display: none; }
.card.support .support-hint { font-size: 12px; text-align: center; margin-bottom: 10px; }
.card.support[hidden] { display: none; }
.card.tip ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.card.tip li { margin-bottom: 5px; }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); margin-top: 30px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; padding: 28px 20px 10px; flex-wrap: wrap; }
.footer-inner strong { font-size: 15px; }
.footer-inner p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: var(--muted); }
.copyright { font-size: 12px; color: var(--muted-2); padding: 12px 20px 28px; }

/* ---------------------------------------------------------------- coupang */
.coupang-slot { margin: 26px 0 4px; }
.coupang-slot:empty { display: none; }
.side-col .coupang-slot { margin: 0; }
.coupang-card {
  display: flex; flex-direction: column; gap: 9px;
  padding: 16px 16px 13px;
  background: linear-gradient(180deg, #fffafa, #ffffff 60%);
  border: 1px solid var(--line);
  border-left: 3px solid #e52528;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.coupang-badge {
  align-self: flex-start;
  padding: 2px 9px; border-radius: 999px;
  background: #fff1f2; border: 1px solid #fecdd3;
  color: #b91c1c; font-size: 11px; font-weight: 700; letter-spacing: -.1px;
}
.coupang-title { font-size: 15px; font-weight: 700; margin: 0; line-height: 1.35; }
.coupang-sub { font-size: 12.5px; line-height: 1.55; color: var(--muted); margin: 0; }
.coupang-frame {
  display: block; width: 100%; height: 200px;
  border: 0; border-radius: 10px; background: var(--bg-soft);
}
.coupang-ph {
  margin: 0; padding: 9px 11px;
  border: 1px dashed var(--line-strong); border-radius: 9px;
  background: var(--bg-soft); color: var(--muted-2);
  font-size: 11.5px; line-height: 1.5;
}
.coupang-cta {
  align-self: flex-start;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 17px; border-radius: 9px;
  background: #e52528; color: #fff;
  font-size: 13.5px; font-weight: 700;
  transition: background .16s ease;
}
.coupang-cta:hover { background: #c81e21; color: #fff; text-decoration: none; }
.coupang-disclosure { margin: 0; font-size: 11px; line-height: 1.5; color: var(--muted-2); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side-col { position: static; }
  .ad-slot.tall, .ad-slot.tall .ad-ph { min-height: 250px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .prose .three { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .hero { padding: 34px 0 18px; }
  .hero h1 br { display: none; }
  .dropzone { padding: 26px 16px; border-radius: 16px; }
  .results { padding: 16px; border-radius: 14px; }
  .cards { gap: 8px; }
  .stat-num { font-size: 24px; }
  .stat-desc { display: none; }
  .nav { display: none; }
  .table { font-size: 13.5px; table-layout: fixed; }
  .table thead th, .table td { padding: 9px 8px; }
  .col-name, .table td.col-name { display: none; }
  .col-state { width: 84px; }
  .table .col-no { width: 36px; }
  .avatar { width: 26px; height: 26px; font-size: 11px; }
  .acct { gap: 8px; }
  summary { min-height: 44px; display: flex; align-items: center; }
  .results-head h2 { font-size: 19px; }
  .coupang-card { padding: 14px 14px 12px; }
  .coupang-frame { height: 160px; }
  .coupang-cta { align-self: stretch; text-align: center; }
  .footer-inner { padding: 22px 20px 6px; }

  /* 터치 조작: 최소 40~44px 타깃 */
  .btn { min-height: 44px; padding: 11px 18px; }
  .results-actions .btn { min-height: 40px; padding: 9px 13px; }
  .tab { min-height: 40px; }
  .pager button { min-height: 40px; min-width: 40px; }
  /* iOS/안드로이드가 포커스 시 화면을 확대하지 않도록 16px 이상 유지 */
  .table-tools input, .table-tools select { font-size: 16px; min-height: 44px; }
  /* 탭 4개를 2×2로 정렬해 어색한 줄바꿈 제거 */
  .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .tab { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
