:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f2f2f2;
  --line: rgba(0,0,0,.1);
  --text: #0f0f0f;
  --muted: #606060;
  --blue: #065fd4;
  --sky: #065fd4;
  --violet: #8b5cf6;
  --green: #2ba640;
  --red: #ff0000;
  --amber: #ff8c00;
  --radius: 12px;
  --radius-sm: 12px;
  --shadow: 0 0 0 1px rgba(0,0,0,.05);
  --shadow-hover: 0 4px 16px rgba(0,0,0,.1);
  --font: "Pretendard Variable",Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,"Noto Sans KR","Malgun Gothic",sans-serif;
  --mono: "JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1284px, calc(100% - 48px)); margin: 0 auto; }
.site-main { padding-bottom: 48px; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.header-inner {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  display: inline-flex;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  background: var(--red);
  border: none;
  color: #fff;
}
.brand strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.03em;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 1px;
}
.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.main-nav > a {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: color .15s, background .15s;
}
.main-nav > a:hover {
  color: var(--text);
  background: var(--panel-2);
}
.main-nav > a[aria-current="page"] {
  color: var(--text);
  background: var(--panel-2);
  font-weight: 600;
}

/* ── Site switch dropdown ── */
.site-switch {
  position: relative;
}
.site-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.site-switch-btn:hover {
  color: var(--text);
  background: var(--panel-2);
}
.site-switch-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  padding: 6px;
  z-index: 100;
}
.site-switch.open .site-switch-menu {
  display: block;
}
.site-switch-menu a,
.site-switch-menu span {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: background .12s;
}
.site-switch-menu a:hover {
  background: var(--panel-2);
}
.site-switch-menu .current {
  color: var(--muted);
  cursor: default;
}

/* ── Hero ── */
.hero {
  padding: 36px 0 12px;
}
.hero-card {
  display: grid;
  gap: 16px;
  padding: 32px 36px;
  border-radius: var(--radius);
  border: none;
  background: #f9f9f9;
  box-shadow: none;
}
.hero-card h1,
.hero-card h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -.03em;
  color: var(--text);
  background: none;
  -webkit-background-clip: border-box;
  -webkit-text-fill-color: var(--text);
  background-clip: border-box;
}
.hero-card p {
  margin: 0;
  max-width: 840px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 15px;
}

/* ── Badges ── */
.eyebrow,
.badge {
  display: inline-flex;
  width: max-content;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  border: none;
  background: var(--red);
  color: #fff;
}

/* ── Actions ── */
.hero-actions,
.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover {
  background: var(--panel-2);
  border-color: rgba(0,0,0,.15);
}
.btn-primary {
  border: none;
  background: var(--red);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover {
  background: #cc0000;
  box-shadow: 0 1px 4px rgba(255,0,0,.2);
}
.btn-soft {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-soft:hover {
  color: var(--text);
  background: var(--panel-2);
}

/* ── Sections ── */
.section {
  padding: 16px 0 20px;
}
.section-head {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.section-head h2,
.section-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
}
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ── Grid ── */
.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 16px;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ── Cards ── */
.card,
.panel,
.stat,
.notice,
.table-wrap,
.map-card,
.filter-bar,
.video-card,
.topic-card,
.channel-card,
.region-card,
.survey-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: box-shadow .2s, border-color .2s;
}
.card:hover,
.topic-card:hover,
.video-card:hover,
.channel-card:hover,
.region-card:hover,
.survey-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(0,0,0,.15);
}
.card,
.panel,
.notice,
.table-wrap,
.map-card,
.filter-bar,
.video-card,
.topic-card,
.channel-card,
.region-card,
.survey-card {
  padding: 20px;
}

/* ── Stats ── */
.stat {
  padding: 20px;
  text-align: center;
}
.stat strong {
  display: block;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 4px;
  color: var(--text);
  background: none;
  -webkit-background-clip: border-box;
  -webkit-text-fill-color: var(--text);
  background-clip: border-box;
}
.stat span,
.meta,
.muted,
.notice p,
.card p,
.panel p,
.topic-card p,
.video-card p,
.channel-card p,
.region-card p,
.survey-card p {
  color: var(--muted);
  line-height: 1.65;
}
.stat-label {
  font-size: 13px;
  color: var(--muted);
}

/* ── KPI chips ── */
.kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.kpi {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 18px;
  background: var(--panel-2);
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* ── Card typography ── */
.topic-card h3,
.video-card h3,
.channel-card h3,
.region-card h3,
.survey-card h3,
.panel h3,
.card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.topic-card h4,
.video-card h4,
.channel-card h4,
.region-card h4,
.survey-card h4,
.card h4 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

/* ── Tags (YouTube chip style) ── */
.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  transition: background .15s;
}
.tag:hover {
  background: #e5e5e5;
}

/* ── Lead badges ── */
.lead-badge {
  display: inline-flex;
  width: max-content;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  border: none;
}
.lead-left { background: rgba(6,95,212,.1); color: #065fd4; }
.lead-right { background: rgba(255,0,0,.08); color: #cc0000; }
.lead-neutral { background: rgba(96,96,96,.1); color: #606060; }

/* ── Progress bars ── */
.progress-list {
  display: grid;
  gap: 10px;
}
.progress-item {
  display: grid;
  gap: 4px;
}
.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.progress-head strong {
  font-weight: 500;
}
.progress-head span {
  color: var(--muted);
  font-size: 13px;
}
.progress-track {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--panel-2);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--red);
  transition: width .5s cubic-bezier(.16, 1, .3, 1);
}
.progress-bar.left {
  background: var(--blue);
}
.progress-bar.right {
  background: var(--red);
}
.progress-bar.neutral {
  background: #909090;
}

/* ── Map ── */
.map-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.map-header h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.map-header p { margin: 0; color: var(--muted); font-size: 14px; }
.map-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.legend {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 18px;
  font-size: 12px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.legend-left { background: rgba(6,95,212,.08); color: #065fd4; }
.legend-neutral { background: rgba(96,96,96,.08); color: #606060; }
.legend-right { background: rgba(255,0,0,.06); color: #cc0000; }
.korea-map {
  width: 100%;
  max-width: 520px;
  display: block;
  margin: 0 auto;
}
.map-text {
  fill: #ffffff;
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}
.map-subtext {
  fill: rgba(255,255,255,.7);
  font-size: 11px;
  pointer-events: none;
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f9f9f9; }

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  background: #f9f9f9;
  border: none;
  box-shadow: none;
}
.field {
  display: grid;
  gap: 6px;
  min-width: 180px;
  flex: 1 1 180px;
}
.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: none;
}
textarea {
  min-height: 140px;
  padding: 14px;
  resize: vertical;
}
.search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── YouTube embed ── */
.embed-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius);
  background: #000;
}

/* ── Meta list ── */
.meta-list {
  display: grid;
  gap: 0;
  margin: 12px 0 0;
}
.meta-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

/* ── Flash messages ── */
.flash {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
}
.flash-success { background: #e8f5e9; color: #1b5e20; }
.flash-error { background: #ffeef0; color: #cc0000; }
.flash-info { background: #e3f2fd; color: #065fd4; }

/* ── Empty state ── */
.empty {
  padding: 48px 26px;
  border-radius: var(--radius);
  border: 1px dashed rgba(0,0,0,.15);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 36px;
  color: var(--muted);
  font-size: 13px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.footer-grid strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}
.footer-grid p {
  line-height: 1.7;
}
.version-footer {
  text-align: center;
  padding: 16px 0 20px;
  font-size: 11px;
  color: var(--muted);
  opacity: .4;
  font-family: var(--mono);
  letter-spacing: .04em;
}

/* ── Responsive ── */
@media (max-width: 980px) {
  .grid-2, .grid-3, .grid-4, .footer-grid { grid-template-columns: 1fr; }
  .hero-card { padding: 24px; }
  .container { width: min(100% - 24px, 1284px); }
}
@media (max-width: 640px) {
  .main-nav { gap: 2px; }
  .main-nav > a { padding: 6px 8px; font-size: 13px; }
  .hero { padding: 24px 0 8px; }
}
