:root {
  --bg: #f4f5f7;
  --ink: #111111;
  --muted: #5f6b7a;
  --line: #e4e6ea;
  --card: #ffffff;
  --brand: #1d4ed8;
  --brand-ink: #ffffff;
  --header: #111111;
  --ph: #e8eaed;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(17, 17, 17, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Noto Sans KR", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--ink); }
.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  background: var(--header);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
  flex-wrap: wrap;
}
.logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: -0.03em;
}
.nav { display: flex; flex-wrap: wrap; gap: 2px; }
.nav-link {
  color: #f2f2f2;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
}
.nav-link:hover { background: rgba(29, 78, 216, 0.22); color: #ffffff; }
main.wrap { flex: 1 0 auto; padding-bottom: 48px; }
.hero { padding: 44px 0 12px; }
.eyebrow {
  color: var(--brand);
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}
h1 { font-size: clamp(1.7rem, 4.2vw, 2.55rem); letter-spacing: -0.045em; margin: 0 0 12px; line-height: 1.25; }
h2 { letter-spacing: -0.03em; }
.lead { color: var(--muted); max-width: 40rem; margin: 0 0 20px; }
.rank-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  align-items: end;
  box-shadow: var(--shadow);
}
.rank-form label { flex: 1 1 220px; display: grid; gap: 6px; font-weight: 600; }
.rank-form input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font: inherit;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-ghost { background: #fff; border-color: var(--line); }
.rich {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 8px 0 28px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
}
.stat strong { display: block; font-size: 1.6rem; letter-spacing: -0.04em; }
.stat span { color: var(--muted); font-size: 0.88rem; }
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 36px;
}
.feature {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
}
.feature h2 { margin: 0 0 8px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.section-head a { font-weight: 700; text-decoration: none; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 12px 0 32px;
}
.ch-card {
  display: flex;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}
.ch-card img, .ch-card__ph, .channel-hero__img, .channel-hero__ph {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--ph);
  flex-shrink: 0;
}
.ch-card__body { display: grid; gap: 4px; }
.ch-card__body span, .muted { color: var(--muted); font-size: 0.9rem; }
.delta { font-weight: 700; color: #0b7a3b; }
.channel-hero {
  display: flex;
  gap: 20px;
  padding: 32px 0 12px;
  align-items: flex-start;
}
.channel-hero__img, .channel-hero__ph { width: 120px; height: 120px; border-radius: 28px; }
.channel-hero__body { flex: 1; min-width: 0; }
.channel-handle { color: var(--muted); margin: 0 0 12px; font-size: 0.92rem; }
.channel-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 160px));
  gap: 12px;
  margin: 0 0 14px;
  max-width: 360px;
}
.channel-metrics .stat {
  min-width: 0;
  overflow: hidden;
}
.channel-metrics .stat strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-links { margin: 0; }
.badge {
  display: inline-block;
  background: #e8eefc;
  color: var(--brand);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 700;
}
.trend-section {
  max-width: 900px;
}
.chart-box {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 320px;
  max-height: 320px;
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
}
#trend-chart {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 320px;
}
.rank-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 4px;
}
.rank-tab {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  font-weight: 700;
}
.rank-tab.is-active {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
}
.table-wrap { overflow-x: auto; margin: 12px 0 32px; }
.rank-table { width: 100%; border-collapse: collapse; background: #fff; }
.rank-table th, .rank-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.rank-name { display: flex; align-items: center; gap: 10px; }
.rank-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--ph);
  flex-shrink: 0;
}
.rank-thumb--ph { display: inline-block; }
.faq { padding: 36px 0 48px; }
.faq h1 { margin-bottom: 16px; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.flash { background: #fff; border: 1px solid var(--line); padding: 10px 14px; border-radius: 10px; }
.err { color: #b42318; }
.site-footer {
  background: #111111;
  color: #c5c9d1;
  padding: 28px 0 36px;
  font-size: 0.9rem;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.footer-brand { color: #fff; font-weight: 700; margin: 0 0 6px; }
.footer-legal { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 16px; margin: 0; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--brand); }
@media (max-width: 800px) {
  .rich, .card-grid, .features { grid-template-columns: 1fr; }
  .channel-hero { flex-direction: column; }
  .nav { width: 100%; }
  .channel-metrics { grid-template-columns: 1fr 1fr; }
}
.insight-section {
  max-width: 900px;
  margin: 28px 0 40px;
}
.insight-section h3 {
  margin: 18px 0 8px;
  font-size: 1.05rem;
}
.insight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.insight-tag {
  background: #e8eefc;
  color: var(--brand);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 700;
}
.insight-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.insight-list li {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 8px;
  display: grid;
  gap: 4px;
}
.insight-list a {
  color: var(--brand);
  word-break: break-all;
}
.insight-meta {
  color: var(--muted);
  font-size: 0.85rem;
}
#insight-run { margin: 8px 0 4px; }
#insight-error { margin-top: 8px; }
