/* 비교 가이드 사이트 공통 스타일 */
:root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --muted: #666;
  --line: #e3e3e3;
  --accent: #0b5fff;
  --accent-soft: #eef4ff;
  --card: #f8f9fb;
  --ecc: #7a6c00;
  --pce: #0b5fff;
  --pub: #0a7a42;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "Segoe UI", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.65;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; gap: 6px 16px; min-height: 60px; padding-top: 6px; padding-bottom: 6px; flex-wrap: wrap; max-width: 1360px; }
.brand { font-weight: 800; font-size: 16px; color: var(--ink); white-space: nowrap; flex-shrink: 0; }
.brand .brand-sub { color: #44546b; }
.nav { display: flex; gap: 6px 10px; margin-left: auto; font-size: 13.5px; flex-wrap: wrap; }
.nav a { color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.nav a.active, .nav a:hover { color: var(--ink); }

/* hero */
.hero { padding: 48px 0 32px; }
.hero h1 { font-size: 30px; margin: 0 0 10px; letter-spacing: -0.5px; }
.hero p { color: var(--muted); margin: 0 0 20px; max-width: 720px; }
.searchbar { display: flex; gap: 8px; max-width: 560px; }
.searchbar input {
  flex: 1; padding: 12px 14px; font-size: 15px; border: 1px solid var(--line);
  border-radius: 8px; outline: none;
}
.searchbar input:focus { border-color: var(--accent); }
.searchbar button {
  padding: 12px 20px; font-size: 15px; background: #44546b; color: #fff;
  border: 0; border-radius: 8px; cursor: pointer;
}

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 28px 0; }
.card {
  border: 1px solid var(--line); border-radius: 10px; padding: 18px; background: #fff;
  transition: box-shadow .15s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.07); }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0; font-size: 13.5px; color: var(--muted); }
.card .count { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--accent); }

/* compare table */
.table-wrap { overflow-x: auto; }
.toolbar { display: flex; gap: 10px; margin: 20px 0; flex-wrap: wrap; }
.toolbar input, .toolbar select {
  padding: 10px 12px; font-size: 14px; border: 1px solid var(--line); border-radius: 8px;
}
.toolbar input { flex: 1; min-width: 200px; }
table.compare th { white-space: nowrap; }
.compare td.src .flag { margin: 2px 0 6px; }
.compare { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0 40px; table-layout: fixed; }
table.compare th, table.compare td {
  border: 1px solid var(--line); padding: 10px 12px; vertical-align: top; text-align: left;
  overflow-wrap: anywhere;
}
table.compare th { background: var(--card); font-size: 13px; }
table.compare td.item { font-weight: 700; }
/* 비교표 가독성: 지브라 스트라이핑 + 경로 셀 타이포 */
table.compare tbody tr:nth-child(even) td { background: #f8fafc; }
table.compare td.path { font-size: 13px; line-height: 1.7; }
table.compare .psep { color: #b6bfcc; font-size: 11px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px; margin-bottom: 4px; }
.badge.ecc { background: #fff8e1; color: var(--ecc); border: 1px solid #f0e2a0; }
.badge.pce { background: var(--accent-soft); color: var(--pce); border: 1px solid #c9dcff; }
.badge.pub { background: #e8f7ef; color: var(--pub); border: 1px solid #bfe6cf; }
.flag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px; background: #f5f5f5; color: #616161; border: 1px solid #e0e0e0; margin: 4px 0; }
.checking { color: var(--muted); font-size: 12px; }
.src { font-size: 12px; color: var(--muted); }
.src a { color: var(--muted); text-decoration: underline; }

/* graph */
.graph-layout { display: flex; gap: 16px; margin: 20px 0 40px; }
.top-graph-layout { display: flex; gap: 16px; margin: 0 0 40px; align-items: flex-start; }
.top-graph-layout .graph-box { flex: 1; min-width: 0; }
.top-graph-layout .graph-side { width: 340px; flex-shrink: 0; position: sticky; top: 12px; max-height: 560px; overflow-y: auto; }
#graph-canvas { flex: 1; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; min-height: 520px; cursor: grab; }
.graph-side { width: 320px; border: 1px solid var(--line); border-radius: 10px; padding: 18px; background: #fff; font-size: 14px; }
.graph-side h3 { margin-top: 0; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin: 10px 0; flex-wrap: wrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }

/* results */
.result { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 10px 0; background: #fff; }
.result h3 { margin: 0 0 6px; font-size: 16px; }
.result .meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.result p { margin: 4px 0; font-size: 14px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 24px 0 40px; font-size: 13px; color: var(--muted); }
.site-footer .wrap { display: flex; gap: 20px; flex-wrap: wrap; }

h2.section { font-size: 20px; margin: 36px 0 6px; }
p.lead { color: var(--muted); }
.note { background: #fffbe6; border: 1px solid #f0e2a0; border-radius: 8px; padding: 12px 16px; font-size: 13.5px; margin: 16px 0; }
@media (max-width: 760px) {
  .graph-layout { flex-direction: column; }
  .graph-side { width: auto; }
  .top-graph-layout { flex-direction: column; }
  .top-graph-layout .graph-side { width: auto; position: static; max-height: none; }
  .hero h1 { font-size: 24px; }
  .brand { font-size: 15px; }
  .nav { gap: 6px 12px; font-size: 13px; margin-left: 0; width: 100%; }
  .site-header .wrap { min-height: 56px; }
  /* 비교표 → 카드형 */
  table.compare thead { display: none; }
  table.compare, table.compare tbody, table.compare tr, table.compare td { display: block; width: auto; }
  table.compare { border: 0; margin: 10px 0 30px; }
  table.compare tr { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 14px; background: #fff; overflow: hidden; }
  table.compare td { border: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; }
  table.compare td:last-child { border-bottom: 0; }
  table.compare td::before { content: attr(data-th); display: block; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
  table.compare td.item { background: var(--card); font-size: 16px; white-space: normal; }
  table.compare td.item::before { display: none; }
  table.compare tbody tr:nth-child(even) td { background: transparent; }
  table.compare tbody tr:nth-child(even) td.item { background: var(--card); }
}
@media (max-width: 1280px) {
  .brand .brand-sub { display: none; }
}
@media (max-width: 560px) {
  .brand .brand-sub { display: none; }
}
.rel-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rel-chips button { border: 1px solid var(--line); background: #f8fafc; border-radius: 20px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; }
.rel-chips button:hover { border-color: #0b5fff; color: #0b5fff; }
.rel-chips a { border: 1px solid var(--line); background: #f8fafc; border-radius: 20px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; text-decoration: none; color: inherit; display: inline-block; }
.rel-chips a:hover { border-color: #0b5fff; color: #0b5fff; }
td.rel { min-width: 130px; }
tr.flash td { animation: rowflash 2s ease; }
@keyframes rowflash { 0%, 60% { background: #fff7d6; } 100% { background: transparent; } }
/* 지식그래프 컨트롤 */
.g-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.g-controls .rel-chips button.on { border-color: #0b5fff; color: #0b5fff; background: #eef4ff; font-weight: 700; }
.rel-chips button.on { border-color: #0b5fff; color: #0b5fff; background: #eef4ff; font-weight: 700; }
.g-toggles { display: flex; gap: 14px; align-items: center; font-size: 13.5px; margin-left: auto; flex-wrap: wrap; }
.g-toggles label { display: flex; gap: 5px; align-items: center; cursor: pointer; white-space: nowrap; }
.g-search { display: flex; gap: 6px; align-items: center; }
.g-search input { border: 1px solid var(--line); border-radius: 20px; padding: 5px 12px; font-size: 13px; width: 170px; }
.g-search input:focus { outline: none; border-color: #0b5fff; }
#g-count { font-size: 12.5px; color: #666; min-width: 30px; }
.g-reset-btn { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.g-reset-btn:hover { border-color: #0b5fff; color: #0b5fff; }
@media (max-width: 760px) { .g-toggles { margin-left: 0; } }
/* 전체화면 그래프용 슬라이딩 패널 */
.graph-slide-panel {
  position: fixed; top: 0; right: 0; z-index: 60;
  width: min(400px, 94vw); height: 100vh; height: 100dvh;
  background: #fff; border-left: 1px solid var(--line); border-radius: 0;
  box-shadow: -12px 0 32px rgba(15,23,42,.14);
  transform: translateX(105%); transition: transform .28s ease;
  overflow-y: auto;
}
.graph-slide-panel.open { transform: translateX(0); }
.panel-close {
  position: sticky; top: 0; float: right;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff;
  font-size: 18px; line-height: 1; cursor: pointer; color: #555;
}
.panel-close:hover { background: #f1f5f9; }
.g-terms { font-size: 12px; color: var(--muted); }
.g-terms a { color: #0b5fff; text-decoration: none; }
.g-terms a:hover { text-decoration: underline; }
.nouse { color: #b3261e; font-weight: 600; }

/* 구글 아웃링크 아이콘 (개요 리스트·사이드바) */
.g-link { color: #9aa5b1; opacity: .55; flex-shrink: 0; display: inline-flex; padding: 4px; border-radius: 6px; vertical-align: middle; }
.g-link:hover { color: var(--accent); opacity: 1; background: #eef4ff; }
.g-link svg { display: block; }
