/* ==========================================================================
   NAMETrend — 공통 스타일
   디자인 기준: docs/spec/Design-system.md (토큰·컴포넌트 단일 기준)
   ========================================================================== */

/* --- 1. 디자인 토큰 -------------------------------------------------------- */
:root {
  /* 브랜드 바이올렛 (홈·헤더 강조 — nametrend 리디자인) */
  --brand-violet:        #6647f0;
  --brand-violet-strong: #5b4bd6;

  /* 성별 색상 (dot·차트·게이지 전역 일관) — nametrend 참조 팔레트 */
  --male:   #0091ff;
  --female: #ff5b8a;
  --unisex: #00c07a;
  --total:  #6b7280;

  /* 순위 변동 (전년 대비) — 국내 관례: 상승=빨강 / 하락=파랑. 성별색(--female 핑크·--male 시안블루)과 구분되는 색조 */
  --rank-up:   #ef4452;
  --rank-down: #3b82f6;

  /* 표면 */
  --bg:          #ffffff;
  --bg-muted:    #f9fafc;
  --card:        #ffffff;
  --border:      #e5e7eb;
  --border-soft: #eef0f3;

  /* 텍스트 */
  --text:        #1f2430;
  --text-body:   #4b5563;
  --text-muted:  #9ca3af;
  --text-faint:  #c9c9d0; /* 순위 4위+ 번호 등 (nametrend 리디자인) */

  /* 인터랙션 (활성 pill) */
  --active-bg: #171717;
  --active-fg: #ffffff;

  /* 검색 안내 테이블 */
  --guide-head-bg: #37404f;
  --guide-head-fg: #ffffff;
  --guide-row-bg:  #fdefb1;
  --guide-code-bg: #fbe79a;
  --guide-row-fg:  #3f3f2e;

  /* 반경 / 그림자 */
  --radius-card: 12px;
  --radius-btn:  8px;
  --radius-pill: 9999px;
  --shadow-card: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-pop:  0 4px 12px rgba(16,24,40,.10);

  /* 레이아웃 */
  --container: 1080px; /* nametrend 참조 폭 */
  --header-h: 64px;

  --font-sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
               "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
}

/* --- 2. 리셋 / 베이스 ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }

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

/* full-bleed 섹션 안에서 내용은 컨테이너 폭 유지 */
.section { padding: 64px 0; }
.section--muted { background: var(--bg-muted); }
.section__head { text-align: center; margin-bottom: 36px; }
.section__title { font-size: 24px; font-weight: 700; color: var(--text); }
.section__desc  { margin-top: 10px; color: var(--text-muted); font-size: 15px; }

/* --- 3. 헤더 / 네비 -------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
}
.site-header__brand { display: inline-flex; align-items: center; gap: 10px; justify-self: start; }
.logo { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.logo b    { color: var(--text); }
.logo span { color: var(--brand-violet); margin-left: 3px; }
.logo-badge {
  font-size: 12px; font-weight: 700; letter-spacing: -.01em; line-height: 1;
  color: #fff; background: var(--brand-violet);
  border-radius: var(--radius-pill); padding: 5px 10px;
}

.searchbar {
  display: flex; align-items: center; gap: 8px;
  width: 300px; max-width: 42vw;
  padding: 8px 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
}
.searchbar:focus-within { border-color: #cbd2dc; background: #fff; }
.searchbar .ic { width: 16px; height: 16px; flex: none; stroke: currentColor; }
.searchbar input {
  flex: 1 1 auto; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-size: 14px; color: var(--text);
}
.searchbar input::placeholder { color: var(--text-muted); }
.kbd { display: inline-flex; gap: 3px; flex: none; }
.kbd kbd {
  font-family: var(--font-sans); font-size: 11px; line-height: 1;
  color: var(--text-muted);
  background: #fff; border: 1px solid var(--border);
  border-radius: 5px; padding: 3px 5px;
}

.site-nav { justify-self: end; display: flex; gap: 6px; }
.site-nav a {
  padding: 8px 15px; border-radius: var(--radius-pill);
  font-size: 16px; font-weight: 600; color: var(--text-body);
}
.site-nav a:hover { background: var(--bg-muted); color: var(--text); }
.site-nav a.is-active { background: var(--active-bg); color: var(--active-fg); }

/* 햄버거 토글 (기본: 데스크톱에서 숨김) */
.nav-toggle {
  display: none; justify-self: end;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 0;
  background: transparent; border: 0; cursor: pointer;
}
.nav-toggle__bar {
  display: block; width: 22px; height: 2px; margin: 0 auto;
  background: var(--text); border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle.is-open .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 태블릿(≤720px): 네비를 햄버거 드롭다운으로 */
@media (max-width: 720px) {
  .site-header__inner { position: relative; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: calc(100% + 8px); right: 20px;
    flex-direction: column; gap: 4px;
    min-width: 180px; padding: 8px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-card); box-shadow: var(--shadow-pop);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { display: block; }
}

/* --- 4. 히어로 ------------------------------------------------------------- */
.hero { text-align: center; padding: 84px 0 76px; }
.hero__title {
  font-size: 40px; font-weight: 800; letter-spacing: -.02em;
  color: var(--text); display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap;
  justify-content: center;
}
.name-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 16px 4px 12px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-pill); box-shadow: var(--shadow-card);
  font-size: 32px;
}
.hero__subtitle { margin-top: 22px; font-size: 18px; font-weight: 700; color: var(--text); }
.hero__desc {
  margin: 12px auto 0; max-width: 480px;
  font-size: 15px; color: var(--text-muted);
}
.hero__cta { margin-top: 28px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* --- 5. 버튼 -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 24px; border: 0; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 700; line-height: 1;
}
/* 강조(액션) 버튼 = 검정 채움(헤더 네비 활성과 동일 색). '확인·저장·복사' 등 액션에만. 디자인 §5.1 */
.btn--primary { background: var(--active-bg); color: var(--active-fg); }
.btn--primary:hover { background: #000; color: #fff; }
.btn--outline {
  background: var(--card); border: 1px solid var(--border); color: var(--text-body);
}
.btn--outline:hover { background: var(--bg-muted); color: var(--text); }
.btn--outline[disabled] { opacity: .45; cursor: default; }
/* 기본(중립) 버튼 — 넓은 pill 아웃라인. 단독 CTA 재사용(홈으로·전체 보기). 강조/액션은 .btn--primary. 디자인 §5.1 */
.btn--pill {
  background: #fff; border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-pill); padding: 14px 28px; font-size: 16px;
}
.btn--pill:hover { background: var(--bg-muted); color: var(--text); border-color: var(--border); }

/* --- 6. 성별 dot --------------------------------------------------------- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot--male   { background: var(--male); }
.dot--female { background: var(--female); }
.dot--unisex { background: var(--unisex); }
.dot--total  { background: var(--total); }
.dot--lg { width: 12px; height: 12px; }

/* --- 7. 카드 -------------------------------------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  padding: 22px;
}
.card__title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 16px; }

/* 데이터 현황 3카드 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat-card__label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
}
.stat-card__label .ic { width: 15px; height: 15px; stroke: currentColor; }
.stat-card__value { margin-top: 12px; font-size: 24px; font-weight: 700; color: var(--text); }

/* --- 8. 검색 안내 테이블 -------------------------------------------------- */
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.guide { border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-card); }
.guide__head {
  background: var(--guide-head-bg); color: var(--guide-head-fg);
  text-align: center; font-weight: 700; font-size: 14px; padding: 11px;
}
.guide__rows { list-style: none; margin: 0; padding: 0; }
.guide__rows li {
  display: grid; grid-template-columns: 96px 1fr;
  background: var(--guide-row-bg); color: var(--guide-row-fg);
  border-top: 2px solid #fff;
}
.guide__rows .code {
  background: var(--guide-code-bg); text-align: center; font-weight: 700;
  padding: 10px 8px; font-size: 14px;
}
.guide__rows .desc { padding: 10px 14px; font-size: 14px; }

/* --- 9. 페이지 헤더 (제목 + 필터) ----------------------------------------- */
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 40px 0 20px; flex-wrap: wrap;
}
.page-title { font-size: 24px; font-weight: 800; color: var(--text); }

/* 이름순위 헤더·연도 필터 (W-7-2) */
.rank-head { margin: 40px 0 18px; }
.page-desc { color: var(--text-body); font-size: 14px; margin-top: 6px; }
.filters { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.year-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.year-btn {
  padding: 6px 13px; font-size: 13px; font-weight: 600; line-height: 1;
  border: 1px solid var(--border); background: #fff; color: var(--text-body);
  border-radius: 999px;
}
.year-btn:hover { background: var(--bg-muted); color: var(--text); }
.year-btn.is-active { background: var(--active-bg); border-color: var(--active-bg); color: var(--active-fg); }

/* 드롭다운 */
.select {
  appearance: none; -webkit-appearance: none;
  padding: 8px 34px 8px 14px; font-size: 14px; color: var(--text);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--border); border-radius: var(--radius-btn);
}

/* 세그먼트 토글 */
.segment { display: inline-flex; gap: 4px; }
.segment button {
  padding: 8px 16px; border: 1px solid var(--border); background: #fff;
  border-radius: var(--radius-btn); font-size: 14px; font-weight: 600; color: var(--text-body);
}
.segment button.is-active { background: var(--active-bg); border-color: var(--active-bg); color: var(--active-fg); }

/* --- 10. 랭킹 테이블 ------------------------------------------------------ */
.rank-table { width: 100%; border-collapse: collapse; }
.rank-table thead th {
  text-align: left; font-size: 13px; font-weight: 500; color: var(--text-muted);
  background: var(--bg-muted); padding: 11px 16px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.rank-table thead th:first-child { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.rank-table thead th:last-child  { border-top-right-radius: 10px; border-bottom-right-radius: 10px; text-align: right; }
.rank-table tbody td { padding: 11px 16px; border-bottom: 1px solid var(--border-soft); font-size: 15px; }
.rank-table tbody tr:hover { background: var(--bg-muted); }
.rank-table .col-rank  { width: 90px; color: var(--text-body); }
.rank-table .col-count { text-align: right; color: var(--text-body); }
.rank-medal { display: inline-block; width: 22px; text-align: center; margin-right: 4px; }
.rank-name { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; color: var(--text); }
.rank-name:hover { color: var(--male); }

.pagination { display: flex; justify-content: center; gap: 8px; margin: 20px 0 8px; }

/* --- 11. 이름 상세 -------------------------------------------------------- */
.detail-title {
  text-align: center; margin: 34px 0 20px;
  font-size: 30px; font-weight: 800; color: var(--text);
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.summary-box {
  background: var(--bg-muted); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 16px 20px; text-align: center;
  color: var(--text-body); font-size: 14.5px; margin-bottom: 20px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* 요약 통계 테이블 (통계/상세 좌측 카드) */
.summary-table { width: 100%; border-collapse: collapse; text-align: center; }
.summary-table th {
  font-size: 14px; font-weight: 700; color: var(--text); padding: 6px 8px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.summary-table td { padding: 14px 8px 6px; font-size: 17px; font-weight: 600; color: var(--text); }

/* 성별 비율 게이지 카드 */
.gauge-wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gauge-side { text-align: center; min-width: 64px; }
.gauge-side .lbl { font-size: 13px; color: var(--text-muted); }
.gauge-side .pct { font-size: 18px; font-weight: 800; }
.gauge-side .pct .u { font-size: 12px; font-weight: 700; }
.pct--male   { color: var(--male); }
.pct--female { color: var(--female); }
.gauge-chart { flex: 1 1 auto; height: 92px; }

/* 비슷한 이름 grid */
.similar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.similar-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-btn);
  font-size: 14px; font-weight: 600; color: var(--text);
}
.similar-item:hover { background: var(--bg-muted); border-color: var(--border); }

/* 요약 3섹션 · 이름 탐색 (W-7-3) */
.detail-summary { align-items: stretch; }
.summary-desc { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.summary-line { font-size: 15px; line-height: 1.6; color: var(--text-body); }
.summary-line:first-child { font-weight: 700; color: var(--text); }
.detail-side { display: flex; flex-direction: column; gap: 16px; }
.cumulative__period { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.gauge-tendency { margin-top: 12px; text-align: center; font-size: 13px; font-weight: 600; color: var(--text-body); }
.card__sub { font-size: 13px; color: var(--text-muted); margin: -6px 0 14px; }
.surname-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.surname-tag {
  padding: 7px 16px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-size: 15px; font-weight: 700; color: var(--text); background: #fff;
}
.surname-tag:hover { background: var(--bg-muted); border-color: #cbd2dc; color: var(--male); }

/* --- 12. 차트 ------------------------------------------------------------ */
.chart-card { margin-bottom: 16px; }
.chart { width: 100%; height: 300px; }
.chart--tall { height: 340px; }

/* --- 13. 푸터 ------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--border); margin-top: 72px; }
.site-footer__inner {
  max-width: var(--container); margin: 0 auto; padding: 24px 20px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-muted);
}
.site-footer__inner b { color: var(--text); }
.site-footer__updated { color: var(--brand-violet); }
.site-footer__updated::before { content: " · "; color: var(--text-muted); }
@media (max-width: 720px) {
  .site-footer__inner { flex-direction: column; gap: 12px; text-align: center; }
  .site-footer__updated { display: block; }
  .site-footer__updated::before { content: none; }
}

/* --- 13.5 홈: 검색 허브 + 남/여 TOP 10 (nametrend 리디자인) -------------- */

/* 히어로 (검색 허브) */
.home-hero { text-align: center; padding: 72px 0 52px; }
.home-hero__eyebrow { font-size: 15px; font-weight: 700; color: var(--brand-violet); letter-spacing: -.01em; }
.home-hero__title { margin-top: 16px; font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1.3; color: var(--text); }
.home-hero__title .br-mobile { display: none; }
.home-hero__desc { margin: 18px auto 0; max-width: 32ch; font-size: 18px; font-weight: 400; line-height: 1.55; color: var(--text-muted); }

/* 검색 (통합 pill — 테두리 안 입력 + 검정 버튼) */
.home-search {
  display: flex; align-items: center; gap: 8px;
  max-width: 600px; 
	margin: 45px auto 30px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 7px 7px 7px 24px;
}
.home-search:focus-within { border-color: #cbd2dc; box-shadow: var(--shadow-pop); }
.home-search__input {
  flex: 1 1 auto; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-size: 17px; color: var(--text);
}
.home-search__input::placeholder { color: var(--text-muted); }
.home-search__btn {
  flex: none; padding: 13px 30px; border: 0; border-radius: var(--radius-pill);
  background: var(--active-bg); color: #fff; font-size: 15px; font-weight: 700;
}
.home-search__btn:hover { background: #000; color: #fff; }

/* 빠른 메뉴 (pill 태그 — 급상승은 보라 아웃라인) */
.home-quick { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; /*margin-top: 22px;*/ }
.home-quick__item {
  font-size: 14px; font-weight: 700; color: var(--text);
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 9px 17px;
}
.home-quick__item:hover { background: var(--bg-muted); color: var(--text); }
.home-quick__item--hot { color: var(--brand-violet); border-color: var(--brand-violet); }
.home-quick__item--hot:hover { background: rgba(109,92,231,.06); color: var(--brand-violet); }

/* TOP 10 영역 */
.home-top { padding: 24px 0 56px; }

/* 남/여 카드 2개 */
.home-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.home-card {
  background: #fff; border: 1px solid var(--border); border-radius: 20px;
  padding: 26px 26px 16px;
}
.home-card__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.home-card__title { font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.home-card__all { font-size: 14px; font-weight: 600; color: var(--brand-violet); flex: none; }
.home-card__all:hover { opacity: .72; }

/* 순위 리스트 (순위·이름·N명 — 1~3위 진하게) */
.home-rank { list-style: none; margin: 0; padding: 0; }
.home-rank__item {
  display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 14px;
  padding: 12px 2px; border-top: 1px solid var(--border-soft);
}
.home-rank__item:first-child { border-top: 0; }
.home-rank__no { font-size: 17px; font-weight: 700; text-align: center; color: var(--text-faint); }
.home-rank__no--top { color: var(--text); }
.home-rank__namewrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.home-rank__name { font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.home-rank__name:hover { color: var(--brand-violet); }
.home-rank__count { font-size: 15px; font-weight: 500; color: var(--text-muted); }

/* 하단 전체 보기 (pill 아웃라인) */
.home-more { text-align: center; margin-top: 40px; }

/* 서비스 소개 (검색 키워드 노출용 — 타이포는 .home-card__title·.home-rank__count 스케일 답습) */
.home-about { padding: 0 0 64px; text-align: center; }
.home-about__title { font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.home-about__desc { margin: 12px auto 0; max-width: 60ch; font-size: 15px; line-height: 1.7; color: var(--text-muted); }
.home-about__desc strong { font-weight: 600; color: var(--text); }

@media (max-width: 720px) {
  .home-cards { grid-template-columns: 1fr; }
  .home-hero__title { font-size: 36px; }
  .home-hero__title .br-mobile { display: inline; }
}

/* --- 13.6 참조 리디자인: 이름순위 · 성씨별 · 이름상세 (nametrend) --------- */

/* 상단 검색바 (이름순위 상단) — 홈 검색바 축소 */
.page-search { max-width: 560px; margin: 60px auto 30px; }

/* 페이지 히어로 (제목·설명·eyebrow) */
.phead { margin: 60px 0 0; }
.phead__eyebrow { font-size: 16px; font-weight: 700; letter-spacing: -.01em; color: var(--brand-violet); margin-bottom: 14px; }
.phead__title { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--text); }
.phead__title .accent { color: var(--brand-violet); }
.phead__desc { margin-top: 10px; font-size: 17px; font-weight: 400; letter-spacing: -.01em; color: var(--text-body); }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip {
  font-family: inherit; font-size: 14px; font-weight: 700; letter-spacing: -.01em; line-height: 1;
  border-radius: var(--radius-pill); padding: 8px 15px; cursor: pointer;
  background: #fff; color: var(--text); border: 1px solid var(--border);
}
.chip:hover { background: var(--bg-muted); color: var(--text); }
.chip.is-active { background: var(--active-bg); color: #fff; border-color: var(--active-bg); }
.chip--lg { font-size: 16px; padding: 9px 16px; min-width: 44px; text-align: center; }
.chip--add {
  width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 400; color: var(--text-faint);
  background: #fff; border: 1px solid var(--border); border-radius: 50%; cursor: pointer;
}
.chip--add:hover { background: var(--bg-muted); color: var(--text-body); }
/* 더보기 펼침(연도 칩) — .chip--extra는 기본 숨김, .chips.is-expanded면 노출하고 더보기 버튼을 감춘다 */
.chip--more { color: var(--text-muted); }
.chip--extra { display: none; }
.chips.is-expanded .chip--extra { display: block; }
.chips.is-expanded .chip--more { display: none; }

/* 필터 카드 (이름순위 — 연도/성별을 한 카드로, 라벨 좌측 · nametrend ranking_1) */
.filter-card { margin-top: 24px; padding: 0 24px; background: #fff; border: 1px solid var(--border); border-radius: 16px; }
.filter-row { display: flex; align-items: flex-start; gap: 20px; padding: 18px 0; }
.filter-row__label { flex-shrink: 0; width: 44px; font-size: 14px; font-weight: 700; letter-spacing: -.01em; color: var(--text-body); line-height: 38px; }
.filter-row__divider { height: 1px; background: var(--border); }
.filter-row .chips { flex: 1; }

/* 이름 리스트 테이블 (grid — 이름순위·성씨별 공유) */
.nlist { margin-top: 20px; }
.nlist__head {
  display: grid; grid-template-columns: var(--nlist-c1, 128px) 1fr 150px; align-items: center;
  background: var(--bg-muted); border-radius: 10px; padding: 12px 20px;
  font-size: 13px; font-weight: 600; letter-spacing: -.005em; color: var(--text-muted);
}
.nlist__head .r { text-align: right; }
.nlist--narrow { --nlist-c1: 52px; }
.nlist__row {
  display: grid; grid-template-columns: var(--nlist-c1, 128px) 1fr 150px; align-items: center;
  padding: 15px 20px; border-radius: 10px; color: inherit;
}
.nlist__body .nlist__row:nth-child(even) { background: var(--bg-muted); }
.nlist__body .nlist__row:hover { background: #eef0f3; }
.nlist__rank { display: flex; align-items: center; gap: 10px; }
.nlist__star { color: #ffb400; font-size: 14px; line-height: 1; }
.nlist__pos { font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--text-body); }
.nlist__pos--top { font-weight: 700; color: var(--text); }
.nlist__namewrap { display: flex; align-items: center; gap: 11px; min-width: 0; }
.nlist__name { font-size: 19px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.nlist__meta { font-size: 17px; font-weight: 500; letter-spacing: -.01em; color: var(--text-body); text-align: right; }
/* 전년 대비 변동 표기가 붙는 순위 리스트 — 순위 번호·마크 폭을 고정해 변동 마크 열을 맞춘다 */
.nlist--delta .nlist__pos { min-width: 26px; }
.nlist--delta .nlist__rank .rdelta { min-width: 34px; }
/* 리스트 아래 범례 한 줄(마크 색 설명 겸용) */
.nlist__note { margin-top: 12px; font-size: 13px; color: var(--text-muted); }
.nlist__note .rdelta { margin: 0 1px; }

/* 순위 변동 마크 (전년 대비) — 순위 리스트·홈 TOP10 공용. 상승=빨강 / 하락=파랑 / 변동없음=흐린 대시 */
.rdelta { font-size: 13px; font-weight: 700; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.rdelta--up   { color: var(--rank-up); }
.rdelta--down { color: var(--rank-down); }
.rdelta--same { color: var(--text-faint); }
.rdelta--new  { font-size: 11px; font-weight: 800; color: var(--rank-up); }

/* 페이저 (pill) */
.pager { display: flex; justify-content: center; gap: 12px; margin-top: 36px; }
.pager__btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: 15px; font-weight: 700; letter-spacing: -.01em;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 12px 24px; color: var(--text); cursor: pointer;
}
.pager__btn:hover { background: var(--bg-muted); color: var(--text); }
.pager__btn[disabled] { color: var(--text-faint); cursor: default; }

/* 이름 상세 (카드 그리드) */
.dhead { position: relative; text-align: center; padding: 44px 0 48px; margin: 10px 0 10px 0;}
.dhead__actions { position: absolute; top: 6px; right: 0; display: inline-flex; align-items: center; gap: 2px; }
.dheart, .dshare {
  border: 0; background: transparent; cursor: pointer;
  padding: 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-pill);
}
.dheart:hover, .dshare:hover { background: var(--bg-muted); }
.dheart svg, .dshare svg { display: block; }
.dshare svg { fill: none; stroke: #b3b3b3; }

/* 공유 팝업 (링크 복사) */
.share-pop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.share-pop[hidden] { display: none; }
.share-pop__dim { position: absolute; inset: 0; background: rgba(16,24,40,.45); }
.share-pop__panel {
  position: relative; z-index: 1; width: 100%; max-width: 360px;
  background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow-pop); padding: 24px;
}
.share-pop__title { text-align: center; font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 18px; }
.share-pop__url {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-btn);
  background: var(--bg-muted); color: var(--text-body); font-size: 14px; font-family: inherit;
}
.share-pop__actions { display: flex; gap: 8px; margin-top: 12px; }
.share-pop__actions .btn { flex: 1; justify-content: center; }
.dheart svg path { fill: none; stroke: #b3b3b3; transition: fill .15s, stroke .15s; }
.dheart[aria-pressed="true"] svg path { fill: var(--female); stroke: var(--female); }
.dhead__name-row { display: inline-flex; align-items: center; justify-content: center; gap: 14px; }
.dhead__name-row .dot { width: 18px; height: 18px; }
.dhead__name { font-size: 46px; font-weight: 800; letter-spacing: -.035em; color: var(--text); }
.dhead__badge { margin-top: 16px; }
.dbadge {
  display: inline-block; font-size: 14px; font-weight: 700; letter-spacing: -.01em;
  border-radius: var(--radius-pill); padding: 7px 16px; background: #fff; border: 1px solid currentColor;
}
.dbadge--male   { color: var(--male); }
.dbadge--female { color: var(--female); }
.dbadge--unisex { color: var(--unisex); }
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
.dcard { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 28px 30px; }
.dcard--full { grid-column: 1 / -1; }
.dcard--sori { border: 1px solid rgba(102, 71, 240, 0.32); background: #fcfbff; }
.dcard__title { font-size: 17px; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 0 0 18px; }
.dcard__note { font-size: 14px; font-weight: 400; color: var(--text-muted); margin: -10px 0 18px; }
.help-btn {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 18px; height: 18px; margin-left: 6px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%;
  background: #fff; color: var(--text-muted);
  font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.help-btn:hover { color: var(--brand-violet); border-color: var(--brand-violet); }

/* 상세: 요약 불릿 */
.dsummary { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.dsummary li { display: flex; gap: 11px; align-items: flex-start; }
.dsummary .bullet { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; margin-top: 9px; }
.dsummary .lead { font-size: 17px; font-weight: 700; line-height: 1.5; letter-spacing: -.01em; color: var(--text); }
.dsummary .sub { font-size: 15px; font-weight: 400; line-height: 1.6; letter-spacing: -.01em; color: var(--text-body); }

/* 상세: 누적 현황 + 성별 막대바 */
.cume__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cume__title { font-size: 17px; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 0; }
.cume__period { font-size: 11px; font-weight: 500; color: var(--text-faint); }
.cume__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.cume__label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.cume__value { font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--text-body); margin-top: 6px; }
.cume__divider { height: 1px; background: var(--border); margin: 22px 0; }
.genbar__legend { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.genbar__legend .m { color: var(--male); }
.genbar__legend .f { color: var(--female); }
.genbar__track { display: flex; height: 12px; border-radius: var(--radius-pill); overflow: hidden; margin-top: 10px; background: var(--bg-muted); }
.genbar__m { background: var(--male); }
.genbar__f { background: var(--female); }

/* 상세: 어울리는 성씨(원형 칩) */
.surname-circles { display: flex; flex-wrap: wrap; gap: 10px; }
.surname-circle {
  width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: 50%;
}
.surname-circle--add { color: var(--text-faint); font-size: 24px; font-weight: 400; cursor: pointer; font-family: inherit; }
.surname-circle--add:disabled { opacity: .4; cursor: default; } /* 성씨 10개 상한 도달 */

/* 성씨 피커 칩(단일선택 + 삭제) — surname-picker 컴포넌트 */
.surname-chip { position: relative; display: inline-flex; }
.surname-chip__sel {
  width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: 50%; cursor: pointer;
}
.surname-chip__sel:hover { background: var(--bg-muted); }
.surname-chip.is-active .surname-chip__sel { background: var(--active-bg); color: var(--active-fg); border-color: var(--active-bg); }
.surname-chip__del {
  position: absolute; top: -4px; right: -4px; z-index: 2;
  width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-size: 12px; line-height: 1; color: #fff;
  background: var(--text-muted); border: 1px solid #fff; border-radius: 50%; cursor: pointer;
  opacity: 0; transition: opacity .12s;
}
.surname-chip:hover .surname-chip__del, .surname-chip:focus-within .surname-chip__del { opacity: 1; }
.surname-chip__del:hover { background: #ff4d4f; }

/* 성씨 추가 (+) 팝오버 */
.surname-add { position: relative; display: inline-block; }
.surname-add__pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 6px; width: 232px; padding: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-pop);
}
.surname-add__pop[hidden] { display: none; }
.surname-add__opt {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-size: 16px; font-weight: 700; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: 50%; cursor: pointer;
}
.surname-add__opt:hover { background: var(--bg-muted); border-color: var(--brand-violet); color: var(--brand-violet); }

/* (+) 검색 입력(피커) — 팝오버 안 인라인 입력 */
.surname-add__search { flex: 0 0 100%; min-width: 0; display: flex; gap: 6px; }
.surname-add__input {
  flex: 1; min-width: 0; height: 38px; padding: 0 12px;
  font-family: inherit; font-size: 15px; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-btn); outline: none;
}
.surname-add__input:focus { border-color: var(--brand-violet); }
.surname-add__go {
  flex-shrink: 0; height: 38px; padding: 0 14px;
  font-family: inherit; font-size: 14px; font-weight: 700; color: #fff;
  background: var(--brand-violet); border: 0; border-radius: var(--radius-btn); cursor: pointer;
}
.surname-add__go:hover { background: var(--brand-violet-strong); }
.surname-add__go:disabled { opacity: .5; cursor: default; }
.surname-add__msg { flex-basis: 100%; font-size: 13px; font-weight: 600; color: #ff4d4f; }
.surname-add__msg:empty { display: none; }

/* 상세: 어울리는 성씨 — '성+이름'(1줄 3개). 선택 없으면 전체, 클릭 시 발음오행 팝업.
   상태 마크(✓/−/✕)는 목업(추후 실 상생상태로 교체). */
.surname-match { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.surname-match__item {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  font-family: inherit; letter-spacing: -.01em; text-align: left;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 8px 12px 8px 16px; cursor: pointer;
}
.surname-match__item:hover { background: var(--bg-muted); border-color: var(--brand-violet); }
.surname-match__name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.surname-match__mark {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 800; line-height: 1;
}
.surname-match__mark--ok  { background: var(--unisex); }
.surname-match__mark--mid { background: #ffb400; }
.surname-match__mark--bad { background: #ff4d4f; }

/* 발음오행 팝업(임시 데이터 — 실계산 W-7-4) */
.sori-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.sori-modal[hidden] { display: none; }
.sori-modal__backdrop { position: absolute; inset: 0; background: rgba(16, 24, 40, .45); }
.sori-modal__panel {
  position: relative; z-index: 1; width: 100%; max-width: 380px;
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-pop); padding: 26px 26px 22px;
}
.sori-modal__close {
  position: absolute; top: 12px; right: 14px; width: 32px; height: 32px;
  font-family: inherit; font-size: 22px; line-height: 1; color: var(--text-muted);
  background: transparent; border: 0; cursor: pointer;
}
.sori-modal__close:hover { color: var(--text); }
.sori-modal__title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 0 0 16px; }
.sori-modal__list { margin: 0; }
.sori-modal__row { padding: 12px 0; border-top: 1px solid var(--border-soft); }
.sori-modal__row:first-child { border-top: 0; }
.sori-modal__row dt { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.sori-modal__row dd { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.5; }
.sori-modal__list .sori-modal__ohaeng { font-size: 18px; letter-spacing: .04em; }
.sori-modal__list .sori-modal__grade { display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill); font-weight: 800; color: #fff; }
.sori-modal__grade--vgood { background: #00a267; }
.sori-modal__grade--good  { background: var(--unisex); }
.sori-modal__grade--mid   { background: #ffb400; }
.sori-modal__grade--bad   { background: #ff7a45; }
.sori-modal__grade--vbad  { background: #ff4d4f; }

/* 발음오행 설명 팝업 (정보성) */
.info-pop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.info-pop[hidden] { display: none; }
.info-pop__dim { position: absolute; inset: 0; background: rgba(16, 24, 40, .45); }
.info-pop__panel {
  position: relative; z-index: 1; width: 100%; max-width: 420px;
  background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow-pop); padding: 28px;
}
.info-pop__title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 0 0 16px; }
.info-pop__body p { font-size: 15px; line-height: 1.6; color: var(--text-body); margin: 0 0 12px; }
.info-pop__body p:last-child { margin-bottom: 0; }
.info-pop__body a { color: var(--brand-violet); font-weight: 600; text-decoration: underline; }
.info-pop__img { display: block; width: 100%; max-width: 280px; height: auto; margin: 6px auto 0; }
.info-pop__actions { display: flex; justify-content: center; margin-top: 20px; }
.info-pop__actions .btn { min-width: 120px; justify-content: center; }

/* 상세: 비슷한 이름 */
.similar3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.similar3 a {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 9px 14px;
}
.similar3 a:hover { background: var(--bg-muted); }

/* 상세: 차트 범례 */
.chart-legend { display: flex; justify-content: center; gap: 22px; margin-top: 12px; }
.chart-legend span { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-body); }
.chart-legend .swatch { width: 9px; height: 9px; border-radius: 50%; }

/* 반응형 (참조 리디자인 페이지) */
@media (max-width: 720px) {
  .dgrid { grid-template-columns: 1fr; }
  .similar3 { grid-template-columns: repeat(2, 1fr); }
  .surname-match { grid-template-columns: repeat(2, 1fr); }
  .phead__title { font-size: 27px; }
  .nlist__head, .nlist__row { --nlist-c1: 88px; }
  /* 변동 마크가 붙는 리스트는 순위 열을 조금 넓히고 간격을 좁힌다(88px엔 번호+마크가 안 들어감) */
  .nlist--delta .nlist__head, .nlist--delta .nlist__row { --nlist-c1: 100px; }
  .nlist--delta .nlist__rank { gap: 7px; }
  .dcard { padding: 22px 20px; }
}

/* --- 14. 반응형 ---------------------------------------------------------- */
@media (max-width: 720px) {
  .guide-grid, .grid-2, .stat-grid, .similar-grid { grid-template-columns: 1fr; }
  .hero__title { font-size: 30px; }
  .name-badge { font-size: 24px; }
  .searchbar { width: 200px; }
  .kbd { display: none; }
}
@media (max-width: 560px) {
  .site-header__inner { grid-template-columns: auto 1fr; }
  .logo-badge { display: none; }        /* 모바일: 배지 숨김 */
  .searchbar { display: none; }         /* 모바일: 검색바 축약 (프로토타입) */
  .table-scroll { overflow-x: auto; }
}
