/* 빌드가 만드는 파일 — tools/lib/site.js 의 CSS_COMMON 을 순서대로 합친 것. 직접 고치지 마세요. */
/* ---- core/tokens.css ---- */
/* ==========================================================
   core/tokens.css — 디자인 토큰
   색 · 반경 · 그림자 · 폰트 · 헤더 높이. 값은 여기서만 정의한다.
   다른 파일에서는 #색상값을 직접 쓰지 말고 var(--토큰)을 쓴다.

   로또해봄·오늘해봄·급식몇등·물가몇등과 같은 ink/line/surface 스케일, 반경,
   그림자, 글꼴, 레이아웃 폭을 공유하고 책몇등 전용 색만 추가했다.

   색의 역할 (섞어 쓰지 않는다)
     · 브랜드    잉크 인디고 — 로고 · 주 버튼 · 선택된 메뉴. 데이터 의미 없음
     · 종이      따뜻한 미색 — 히어로·표지 주변 배경. 책 느낌만 담당
     · 순위 비교 더 인기 ▲ 빨강 / 덜 인기 ▼ 파랑 / 같음 회색
                 (국내 순위 표기 관례. 항상 기호·숫자와 같이 쓴다)
     · 메달      1~3위 순위 숫자 전용 금·은·동
   ========================================================== */

:root {
  /* ---- 브랜드 ---- */
  --brand: #5048E5;
  --brand-2: #6C66F0;
  --brand-deep: #3A32C4;
  --brand-soft: #EEEDFD;
  --brand-line: #D5D3FB;
  --brand-tint: #F6F5FF;

  /* ---- 종이 ---- */
  --paper: #FBF8F2;
  --paper-2: #F5EFE3;
  --paper-line: #EADFCB;

  /* ---- 숫자 · 순위 ---- */
  --navy: #16213E;
  --navy-2: #2B3A63;
  --navy-soft: #EEF1F8;

  /* ---- 순위 비교 ---- */
  --up: #E5484D;   --up-deep: #C22F35;   --up-soft: #FFF0F0;
  --down: #2F6BEA; --down-deep: #1F54C7; --down-soft: #EEF3FF;
  --same: #8A93A6; --same-soft: #F1F3F7;

  /* ---- 메달 ---- */
  --gold: #E9A100;   --gold-soft: #FFF6DC;
  --silver: #8E9AB0; --silver-soft: #F1F4F9;
  --bronze: #CD7240; --bronze-soft: #FDF0E7;
  /* 흰 바탕 위 순위 숫자용 — 메달색을 조금 진하게 (글자 대비 3:1 이상) */
  --gold-ink: #8F6300; --silver-ink: #5E6A80; --bronze-ink: #9C4A1D;

  /* ---- 상태 ---- */
  --ok: #16A36D;   --ok-deep: #0B7A50;   --ok-soft: #E7F7F0;   --ok-line: #BEEBD8;
  --warn: #F08C00; --warn-deep: #A85A04; --warn-soft: #FFF3DF; --warn-line: #FBDCA8;
  --info: #2F7BFF; --info-deep: #1B5FD6; --info-soft: #EDF4FF; --info-line: #CFE0FF;

  /* ---- 텍스트 · 표면 (다크모드 없음: 항상 밝게) ---- */
  --ink: #1D2433;
  --ink-2: #4A5366;
  --ink-3: #667085;
  --ink-4: #98A0B0;
  --line: #E8EBF1;
  --line-2: #F1F3F7;
  --surface: #FFFFFF;
  --surface-2: #F6F8FB;

  /* ---- 반경 · 그림자 ---- */
  --r-sm: 10px; --r-md: 14px; --r-lg: 22px; --r-xl: 28px;
  --shadow-1: 0 1px 2px rgba(29, 36, 51, .05), 0 2px 8px rgba(29, 36, 51, .05);
  --shadow-2: 0 1px 2px rgba(29, 36, 51, .04), 0 14px 36px -12px rgba(29, 36, 51, .14);
  --shadow-pop: 0 24px 50px -18px rgba(29, 36, 51, .32);
  --shadow-brand: 0 12px 24px -10px rgba(58, 50, 196, .55);
  --shadow-book: 0 1px 1px rgba(29, 36, 51, .08), 0 6px 14px -6px rgba(29, 36, 51, .35);
  --focus-ring: 0 0 0 4px rgba(80, 72, 229, .16);

  /* ---- 글꼴 · 치수 ---- */
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
          "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --hdr-h: 60px;
  --nav-h: 48px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* 모바일은 서브내비 없이 햄버거 메뉴를 쓴다 (components/header.css) */
@media (max-width: 767px) {
  :root { --nav-h: 0px; }
}

/* ---- core/base.css ---- */
/* ==========================================================
   core/base.css — 리셋 · 기본 글꼴 · 유틸리티 · 접근성 · 모션
   요소 선택자와 전역 유틸리티만 둔다. 컴포넌트 모양은 components/ 로.
   ========================================================== */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  color-scheme: light;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hdr-h) + var(--nav-h) + 12px);
  /* 모달·메뉴가 스크롤을 잠가도 데스크톱 화면이 옆으로 밀리지 않게 */
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -.01em;
  color: var(--ink);
  background: var(--surface);
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

/* ---------- 아이콘 (스프라이트 <use href="...#i-..."> ) ---------- */
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 24px; height: 24px; }

/* ---------- 유틸리티 ---------- */
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }

/* ---------- 접근성 ---------- */
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 10px; }
main:focus { outline: none; }
.skip {
  position: fixed; left: 50%; top: 10px; z-index: 300; transform: translate(-50%, -160%);
  padding: 10px 18px; border-radius: 12px; background: var(--ink); color: #fff;
  font-size: 14px; font-weight: 700; transition: transform .2s;
}
.skip:focus { transform: translate(-50%, 0); }

/* ---------- 모션 ---------- */
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }
@keyframes pop { 0% { transform: scale(.96); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes fade-up { 0% { transform: translateY(8px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes grow-x { 0% { transform: scaleX(0); } 100% { transform: scaleX(1); } }
@keyframes grow-y { 0% { transform: scaleY(0); } 100% { transform: scaleY(1); } }


/* 필터를 바꿔 다시 그린 목록 */
.swap-in > * { animation: fade-up .32s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---- core/layout.css ---- */
/* ==========================================================
   core/layout.css — 페이지 뼈대
   .wrap(최대 폭) · .section(세로 간격) · .sec-head(섹션 제목)
   · .page-hero(하위 페이지 공통 상단) · .basis(기준 줄) · 2단 레이아웃
   ========================================================== */

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 780px; }

.section { position: relative; padding: 36px 0; }
.section.section-top { padding-top: 20px; }
.section-tint { background: var(--surface-2); }
.section-paper { background: var(--paper); }

/* ---------- 섹션 제목 ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.sec-head > div:first-child { min-width: 0; }
.sec-eyebrow { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--brand-deep); }
.sec-title { font-size: 21px; font-weight: 800; line-height: 1.3; letter-spacing: -.035em; }
.sec-desc { margin-top: 5px; font-size: 14px; color: var(--ink-3); }

/* ---------- 하위 페이지 공통 상단 (제목 위 경로 표시 없음) ---------- */
.page-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(620px 300px at 94% -30%, #E4E2FD 0%, rgba(228, 226, 253, 0) 66%),
    linear-gradient(180deg, var(--paper) 0%, #fff 100%);
  border-bottom: 1px solid var(--line-2);
}
.page-hero-inner { position: relative; padding-top: 18px; padding-bottom: 22px; }
.page-kicker { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 13.5px; font-weight: 800; color: var(--brand-deep); }
.page-kicker .ico { width: 16px; height: 16px; }
.page-hero h1 { margin-top: 0; font-size: 26px; font-weight: 800; line-height: 1.28; letter-spacing: -.045em; }
.page-hero h1 em { font-style: normal; color: var(--brand-deep); }
.page-hero-desc { margin-top: 8px; font-size: 15px; color: var(--ink-2); max-width: 42em; }
.page-hero-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }

/* ---------- 기준 줄: 집계 기간 · 수집일 · 출처 ---------- */
/* 줄이 바뀌어도 새 줄 맨 앞에 "·" 가 남지 않게: 항목마다 왼쪽 21px 칸에 구분점을 두고,
   왼쪽으로 21px 넓힌 상자를 clip-path 로 잘라 줄 첫머리의 구분점만 가린다. */
.basis {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin-left: -21px;
  clip-path: inset(-8px -8px -8px 15px);
  font-size: 12.5px; font-weight: 600; color: var(--ink-3);
}
.basis > * { margin-left: 21px; }
.basis > .ico + * { margin-left: 5px; }
/* 아이콘 + 긴 안내 한 줄: 문장이 통째로 다음 줄로 밀리면 줄 첫머리 가림(clip-path)에
   첫 글자가 잘린다("차이 = …" → "이 = …"). 아이콘 옆에 붙인 채 안에서 줄바꿈한다. */
.basis > .ico + span:last-child { flex: 1 1 0; min-width: 0; }
.basis .ico { width: 14px; height: 14px; color: var(--ink-4); }
.basis > span + span::before, .basis > span + a::before, .basis > a + span::before { content: "·"; display: inline-block; width: 21px; margin-left: -21px; text-align: center; color: var(--ink-4); }
.basis a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.basis a:hover { text-decoration-color: var(--ink-3); }
.basis.is-stale { color: var(--warn-deep); }

/* ---------- 목록 + 옆 요약 ---------- */
.split { display: grid; gap: 16px; }
.side { display: grid; gap: 12px; align-content: start; min-width: 0; }

.stack-16 > * + * { margin-top: 16px; }

@media (min-width: 768px) {
  .wrap { padding: 0 24px; }
  .sec-title { font-size: 26px; }
  .sec-desc { font-size: 15px; }
  .page-hero-inner { padding-top: 26px; padding-bottom: 30px; }
  .page-hero h1 { font-size: 36px; }
  .page-hero-desc { font-size: 16px; }
}
@media (min-width: 960px) {
  .split { grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
}
/* 옆 요약이 화면보다 길면 고정하지 않는다 — 노트북 높이에서 아래 카드가 끝까지 안 보이는 문제 */
@media (min-width: 960px) and (min-height: 940px) {
  .side-sticky { position: sticky; top: calc(var(--hdr-h) + var(--nav-h) + 16px); }
}
@media (min-width: 1024px) {
  .section { padding: 52px 0; }
}

/* ---- components/header.css ---- */
/* ==========================================================
   components/header.css — 상단 헤더
   .hdr · .logo · .hdr-search(검색 열기) · .my-pill(내 동네·또래) · .icon-btn
   · .subnav(데스크톱 메뉴) · .mobile-menu(767px 이하 서랍 메뉴)
   마크업은 tools/lib/layout.js 의 header() 에서 만든다.
   ========================================================== */

.hdr {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.hdr.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 20px -14px rgba(29, 36, 51, .25); }
.hdr-top { height: var(--hdr-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hdr-actions { display: flex; align-items: center; gap: 6px; min-width: 0; }

/* ---------- 로고 ---------- */
.logo { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 20px; font-weight: 800; letter-spacing: -.05em; color: var(--ink); }
.logo svg { width: 32px; height: 32px; }
.logo b { color: var(--brand); font-weight: 800; }

/* ---------- 검색 열기 버튼 (데스크톱은 입력창 모양, 모바일은 아이콘) ---------- */
.hdr-search {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border-radius: 12px; background: var(--surface-2); color: var(--ink-3);
  font-size: 14px; font-weight: 600; transition: background .15s;
}
.hdr-search:hover { background: #EEF1F6; }
.hdr-search .ico { width: 18px; height: 18px; }
.hdr-search kbd {
  margin-left: 20px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; font: 700 11px/1.6 var(--font); color: var(--ink-4);
}

/* ---------- 내 지역 알약 ---------- */
.my-pill {
  display: inline-flex; align-items: center; gap: 5px; max-width: 36vw; height: 36px; padding: 0 13px 0 10px;
  border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep);
  font-size: 13.5px; font-weight: 800; white-space: nowrap; transition: background .15s, box-shadow .15s;
}
.my-pill:hover { background: #E2E0FC; }
.my-pill .ico { width: 15px; height: 15px; color: var(--brand); }
.my-pill .txt { overflow: hidden; text-overflow: ellipsis; }
.my-pill.is-empty { background: #fff; color: var(--ink-2); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--line); }
.my-pill.is-empty:hover { box-shadow: inset 0 0 0 1.5px #D5DAE3; }
.my-pill.is-empty .ico { color: var(--ink-4); }

/* ---------- 아이콘 버튼 ---------- */
.icon-btn {
  position: relative; width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center; color: var(--ink-2); transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.menu-toggle { display: none; }

/* ---------- 데스크톱 서브내비 ---------- */
.subnav {
  height: var(--nav-h); display: flex; align-items: center; gap: 4px;
  overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 6px;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  flex: none; height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px;
  border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background .2s, color .2s;
}
.subnav a:hover { background: var(--surface-2); color: var(--ink); }
.subnav a.is-active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }
/* 태블릿 폭에서는 메뉴 8개가 넘쳐 스크롤바 없이 숨으므로 간격을 줄여 한 줄에 담는다 */
@media (min-width: 768px) and (max-width: 1023px) { .subnav { gap: 2px; } .subnav a { padding: 0 10px; font-size: 13.5px; } }

/* ---------- 모바일 서랍 메뉴 ---------- */
.menu-dim, .menu-shell { display: none; }

@media (max-width: 767px) {
  .hdr { background: rgba(255, 255, 255, .96); }
  .subnav { display: none; }
  .menu-toggle { display: grid; }
  .hdr-actions { gap: 2px; }

  .hdr-search { width: 40px; padding: 0; justify-content: center; background: none; color: var(--ink-2); }
  .hdr-search:hover { background: var(--surface-2); }
  .hdr-search .ico { width: 21px; height: 21px; }
  .hdr-search span, .hdr-search kbd { display: none; }
  .my-pill { height: 34px; padding: 0 11px 0 9px; font-size: 13px; }

  /* 닫힌 서랍이 문서 가로 폭을 늘리지 않게 뷰포트 크기 셸로 잘라낸다 */
  .menu-shell { position: fixed; inset: 0; z-index: 120; display: block; overflow: hidden; pointer-events: none; }
  .menu-dim {
    position: fixed; inset: 0; z-index: 110; display: block;
    background: rgba(29, 36, 51, .28); opacity: 0; pointer-events: none; transition: opacity .24s ease;
  }
  .menu-dim.open { opacity: 1; pointer-events: auto; }
  .mobile-menu {
    position: absolute; top: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column; width: min(86vw, 340px);
    padding-bottom: env(safe-area-inset-bottom); background: #fff; pointer-events: auto;
    box-shadow: -18px 0 46px -20px rgba(29, 36, 51, .32);
    transform: translateX(104%); visibility: hidden;
    transition: transform .3s var(--ease), visibility 0s linear .3s;
  }
  .mobile-menu.open { transform: none; visibility: visible; transition-delay: 0s; }
  body.menu-open { overflow: hidden; }

  .mobile-menu-head {
    min-height: 64px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px 0 20px; border-bottom: 1px solid var(--line);
  }
  .mobile-menu-head strong { font-size: 19px; font-weight: 800; letter-spacing: -.035em; }
  .mobile-menu-nav { min-height: 0; display: grid; gap: 2px; padding: 12px; overflow-y: auto; }
  .mobile-menu-nav a, .mobile-menu-nav button {
    width: 100%; min-height: 46px; display: flex; align-items: center; gap: 10px;
    padding: 0 14px; border-radius: 14px; color: var(--ink-2); font-size: 15px; font-weight: 700; text-align: left;
  }
  .mobile-menu-nav .ico { color: var(--ink-4); }
  .mobile-menu-nav a.is-active { background: var(--brand-soft); color: var(--brand-deep); }
  .mobile-menu-nav a.is-active .ico { color: var(--brand); }
  .mobile-menu-nav .grp { margin: 10px 0 2px; padding: 0 14px; font-size: 12px; font-weight: 800; letter-spacing: .02em; color: var(--ink-3); }
  .mobile-menu-util { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
  .mobile-menu-util a {
    min-height: 42px; display: flex; align-items: center; padding: 0 12px;
    border-radius: 12px; color: var(--ink-3); font-size: 13.5px; font-weight: 600;
  }
  .mobile-menu-util a:hover { background: var(--surface-2); }
}

/* 손가락으로 누르는 화면에서 내 동네 알약을 조금 더 크게 */
@media (pointer: coarse) and (max-width: 767px) {
  .my-pill { height: 38px; }
}

/* ---- components/button.css ---- */
/* ==========================================================
   components/button.css — 버튼 · 텍스트 링크 · 맨 위로
   .btn + (.btn-brand | .btn-navy | .btn-soft | .btn-line | .btn-tint) + (.btn-sm | .btn-lg | .btn-block)
   ========================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px; border-radius: 14px;
  font-size: 15px; font-weight: 700; white-space: nowrap;
  transition: transform .12s, box-shadow .2s, background .2s, color .2s;
}
.btn:active { transform: scale(.98); }
.btn .ico { width: 18px; height: 18px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* 주 행동 — 한 화면에 하나만 */
.btn-brand {
  color: #fff; text-shadow: 0 1px 1px rgba(30, 24, 120, .25);
  background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 55%, #4038D0 100%);
  box-shadow: var(--shadow-brand);
}
.btn-brand:hover { box-shadow: 0 16px 30px -10px rgba(58, 50, 196, .6); }

.btn-navy { color: #fff; background: var(--navy); box-shadow: 0 12px 24px -12px rgba(22, 33, 62, .55); }
.btn-navy:hover { background: #1E2B4F; }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-soft:hover { background: #EDF0F5; }
.btn-line { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-line:hover { box-shadow: inset 0 0 0 1.5px #D5DAE3; }
.btn-tint { background: var(--brand-soft); color: var(--brand-deep); }
.btn-tint:hover { background: #E2E0FC; }

.btn-sm { height: 38px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn-sm .ico { width: 16px; height: 16px; }
.btn-lg { height: 54px; border-radius: 16px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- 텍스트 링크 ---------- */
.link { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-size: 14px; font-weight: 700; color: var(--brand-deep); white-space: nowrap; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link .ico { width: 16px; height: 16px; }

/* ---------- 맨 위로 ---------- */
.to-top {
  position: fixed; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 60;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--ink-2); border: 1px solid var(--line);
  box-shadow: 0 10px 24px -10px rgba(29, 36, 51, .35);
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none;
  visibility: hidden; /* 안 보일 때 Tab 으로 잡히지 않게 */
  transition: opacity .25s, transform .25s, background .15s, visibility 0s linear .25s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.to-top:hover { background: var(--surface-2); }
/* 모바일: 목록 오른쪽 숫자(대출 건수·순위)를 덜 가리게 조금 작고 반투명하게 */
@media (max-width: 767px) {
  .to-top { right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 42px; height: 42px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px); }
}
@media (min-width: 1024px) {
  .to-top { right: 28px; bottom: calc(28px + env(safe-area-inset-bottom)); width: 50px; height: 50px; }
}

/* ---- components/control.css ---- */
/* ==========================================================
   components/control.css — 선택 컨트롤
   .seg(세그먼트) · .chips/.chip(연령·주제 탭) · .fbar(보기 기준 한 묶음)
   · .tag(작은 라벨) · .select(드롭다운) · .field(입력창)
   선택 상태는 aria-pressed="true" 로 표시한다.
   ========================================================== */

/* ---------- 세그먼트 ---------- */
.seg { display: inline-flex; gap: 2px; max-width: 100%; padding: 4px; border-radius: 13px; background: var(--surface-2); }
.seg button {
  flex: 1 0 auto; height: 34px; padding: 0 14px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 14px; font-weight: 600; color: var(--ink-3); white-space: nowrap;
  transition: background .2s, color .2s, box-shadow .2s;
}
.seg button .ico { width: 15px; height: 15px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 800; box-shadow: var(--shadow-1); }
.seg button[aria-pressed="true"] .ico { color: var(--brand); }

/* ---------- 칩 ---------- */
/* position: 선택 칩을 가운데로 옮길 때 offsetLeft 기준이 이 줄이 되게.
   padding: 가로 스크롤 줄에서 포커스 테두리(3px+2px)가 잘리지 않게 */
.chips { position: relative; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -4px -6px; padding: 6px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap-chips { flex-wrap: wrap; overflow: visible; }
/* 마우스로 쓰는 넓은 화면: 스크롤바를 숨긴 가로 줄은 넘친 칩을 볼 방법이 없어 줄을 바꾼다 */
@media (hover: hover) and (pointer: fine) and (min-width: 768px) { .chips { flex-wrap: wrap; overflow: visible; } }
.chip {
  flex: none; height: 38px; padding: 0 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: all .15s;
}
.chip:hover { box-shadow: inset 0 0 0 1.5px #D5DAE3; color: var(--ink); }
.chip .ico { width: 16px; height: 16px; }
.chip small { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; font-weight: 700; box-shadow: none; }
.chip[aria-pressed="true"] small { color: rgba(255, 255, 255, .62); }
.chip-sm { height: 32px; padding: 0 12px; font-size: 13px; }
a.chip.is-on { background: var(--navy); color: #fff; font-weight: 700; box-shadow: none; }
.chip:active, .seg button:active { transform: scale(.97); }

/* 손가락으로 누르는 화면은 누를 자리를 조금 더 크게 */
@media (pointer: coarse) {
  .chip { height: 40px; }
  .chip-sm { height: 36px; }
  .seg button { height: 38px; }
}

/* ---------- 보기 기준 (전체/또래별/주제별 + 칩) ---------- */
.fbar { display: grid; gap: 10px; min-width: 0; }
.fbar-mode { justify-self: start; }
.fbar-chips { animation: fade-up .25s var(--ease) both; }
.fbar-hint { margin: -2px 2px 0; font-size: 13px; color: var(--ink-3); }

/* ---------- 태그 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
/* 긴 세부 분류('기술과학 > 공학, 공업일반 > …')는 좁은 화면에서 줄을 바꾼다 */
.bh-tags .tag { max-width: 100%; height: auto; min-height: 24px; padding-block: 3px; white-space: normal; }
.tag .ico { width: 13px; height: 13px; }
.tag-brand { background: var(--brand-soft); color: var(--brand-deep); }
.tag-navy { background: var(--navy-soft); color: var(--navy-2); }
.tag-mute { background: var(--surface-2); color: var(--ink-3); }
.tag-paper { background: var(--paper-2); color: #7A5B22; }

/* ---------- 드롭다운 ---------- */
.select {
  position: relative; display: inline-flex; align-items: center; height: 42px; min-width: 0;
  border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .15s;
}
.select:hover { box-shadow: inset 0 0 0 1.5px #D5DAE3; }
.select:focus-within { box-shadow: inset 0 0 0 2px var(--brand), var(--focus-ring); }
.select select {
  appearance: none; -webkit-appearance: none; width: 100%; height: 100%; padding: 0 36px 0 14px;
  border: 0; border-radius: 12px; background: none; outline: none; cursor: pointer;
  font-size: 14.5px; font-weight: 700; color: var(--ink);
}
.select > .ico:last-child { position: absolute; right: 11px; width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; }
.select > .pre { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--brand); pointer-events: none; }
.select > .pre ~ select { padding-left: 34px; }

/* ---------- 입력창 ---------- */
.field {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px;
  border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .15s;
}
.field:focus-within { box-shadow: inset 0 0 0 2px var(--brand), var(--focus-ring); }
.field .ico { color: var(--ink-4); }
.field input, .field textarea {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none;
  font-size: 16px; font-weight: 500; color: var(--ink);
}
.field textarea { min-height: 150px; padding: 14px 0; resize: vertical; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); font-weight: 500; }

/* ---- components/card.css ---- */
/* ==========================================================
   components/card.css — 카드 컨테이너
   .card(그림자) · .card-flat(테두리만) · .card-pad · .card-head · .card-title · .card-foot
   · .kpi(숫자 한 칸) · .banner(가로 배너 링크)
   ========================================================== */

.card { background: #fff; border: 1px solid rgba(232, 235, 241, .9); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.card-flat { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-pad { padding: 18px; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; letter-spacing: -.03em; }
.card-title > .ico { color: var(--brand); }
.card-title > .ico.gold { color: var(--gold); }
.card-sub { margin-top: 2px; font-size: 13px; color: var(--ink-3); }

/* 카드 하단 기준 · 링크 줄 */
.card-foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2);
}
.card-foot-end { justify-content: flex-end; }

/* ---------- 숫자 한 칸 ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kpi { display: grid; gap: 2px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); min-width: 0; }
.kpi-k { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.kpi-k .ico { width: 14px; height: 14px; color: var(--ink-4); }
.kpi-v { font-size: 22px; font-weight: 900; letter-spacing: -.04em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpi-v small { margin-left: 2px; font-size: 13px; font-weight: 700; color: var(--ink-3); letter-spacing: -.01em; }
.kpi-s { font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 360px) { .kpi { padding: 12px; } .kpi-v { font-size: 20px; } }

/* ---------- 가로 배너 링크 ---------- */
.banner {
  display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--r-lg);
  background: #fff; border: 1px solid var(--line); transition: box-shadow .2s, border-color .2s;
}
.banner:hover { border-color: #D5DAE3; box-shadow: var(--shadow-2); }
.banner-ico { width: 46px; height: 46px; flex: none; border-radius: 15px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-deep); }
.banner-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.banner-txt b { font-size: 16px; font-weight: 800; letter-spacing: -.03em; }
.banner-txt span { font-size: 13.5px; color: var(--ink-3); }
.banner-go { color: var(--ink-4); }

@media (min-width: 768px) {
  .card-pad { padding: 24px; }
  .card-title { font-size: 18px; }
}

/* ---- components/cover.css ---- */
/* ==========================================================
   components/cover.css — 책 표지 (core/render.js 의 cover())
   정보나루 표지 이미지가 있으면 <img> 가 위를 덮고, 없거나 깨지면
   ISBN 으로 정한 색(.cv-0~11)과 무늬(.cvs-0~5)의 '만든 표지'가 보인다.
   크기: .cover-xs · .cover-sm(목록) · .cover-md(카드, 폭 100%) · .cover-lg(책 상세)
   ========================================================== */

.cover {
  --cv-bg: #2F3E9E; --cv-ink: #fff; --cv-ac: #FFD66B;
  position: relative; flex: none; display: block; overflow: hidden;
  aspect-ratio: 2 / 3; border-radius: 2px 6px 6px 2px;
  background: var(--cv-bg); color: var(--cv-ink);
  box-shadow: var(--shadow-book);
  container-type: inline-size;
}
/* 책등 그림자와 제본선 */
.cover::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background: linear-gradient(90deg, rgba(0, 0, 0, .2) 0, rgba(0, 0, 0, 0) 5%, rgba(255, 255, 255, .16) 6.5%, rgba(255, 255, 255, 0) 10%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.cover img { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; }

.cover-xs { width: 32px; }
.cover-sm { width: 42px; }
.cover-md { width: 100%; border-radius: 3px 8px 8px 3px; }
.cover-lg { width: 148px; border-radius: 3px 10px 10px 3px; box-shadow: 0 2px 3px rgba(29, 36, 51, .1), 0 24px 40px -16px rgba(29, 36, 51, .45); }
@media (min-width: 768px) {
  .cover-sm { width: 46px; }
  .cover-lg { width: 196px; }
}

/* ---------- 만든 표지의 글자 (md · lg 만) ---------- */
.cv-title, .cv-author { position: absolute; left: 12%; right: 10%; z-index: 1; }
.cv-title {
  top: 10%; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 11px; font-size: clamp(9px, 11.5cqw, 24px); font-weight: 800; line-height: 1.28; letter-spacing: -.04em;
  word-break: keep-all;
}
.cv-author { bottom: 8%; font-size: 9px; font-size: clamp(8px, 7.2cqw, 14px); font-weight: 600; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 색 (배경 · 글자 · 무늬) ---------- */
.cv-0  { --cv-bg: #2F3E9E; --cv-ink: #FFFFFF; --cv-ac: #FFD66B; }
.cv-1  { --cv-bg: #E8604C; --cv-ink: #FFFFFF; --cv-ac: #FFE2A8; }
.cv-2  { --cv-bg: #1F7A6D; --cv-ink: #FFFFFF; --cv-ac: #BDF0E2; }
.cv-3  { --cv-bg: #F2C94C; --cv-ink: #3A2E05; --cv-ac: #FFFFFF; }
.cv-4  { --cv-bg: #7B5EA7; --cv-ink: #FFFFFF; --cv-ac: #F5D0FE; }
.cv-5  { --cv-bg: #2D2F36; --cv-ink: #F5EFE6; --cv-ac: #E8604C; }
.cv-6  { --cv-bg: #F4E9DA; --cv-ink: #2B2B2B; --cv-ac: #C2410C; }
.cv-7  { --cv-bg: #3B82C4; --cv-ink: #FFFFFF; --cv-ac: #FFE7A1; }
.cv-8  { --cv-bg: #C44569; --cv-ink: #FFFFFF; --cv-ac: #FFD1DC; }
.cv-9  { --cv-bg: #5E8C3A; --cv-ink: #FFFFFF; --cv-ac: #F1F7C8; }
.cv-10 { --cv-bg: #0F4C5C; --cv-ink: #F0E6D2; --cv-ac: #E9B949; }
.cv-11 { --cv-bg: #DDE6F0; --cv-ink: #1D2433; --cv-ac: #2F6BEA; }

/* ---------- 무늬 ---------- */
.cv-art { position: absolute; inset: 0; z-index: 0; }
/* 0 해: 오른쪽 아래 큰 원 */
.cvs-0 .cv-art { background: radial-gradient(circle at 78% 74%, var(--cv-ac) 0 24%, transparent 24.5%); }
/* 1 띠: 가운데 가로 두 줄 */
.cvs-1 .cv-art { background: linear-gradient(180deg, transparent 58%, var(--cv-ac) 58% 63%, transparent 63% 67%, var(--cv-ac) 67% 69%, transparent 69%); }
/* 2 아치: 아래쪽 반원 */
.cvs-2 .cv-art { background: radial-gradient(ellipse 58% 34% at 50% 100%, var(--cv-ac) 0 98%, transparent 100%); opacity: .95; }
/* 3 점: 아래 절반 점무늬 */
.cvs-3 .cv-art {
  background-image: radial-gradient(circle, var(--cv-ac) 1.4px, transparent 1.8px);
  background-size: 9px 9px; background-position: 4px 4px;
  -webkit-mask-image: linear-gradient(180deg, transparent 52%, #000 60%); mask-image: linear-gradient(180deg, transparent 52%, #000 60%);
}
/* 4 사선: 왼쪽 아래 삼각 */
.cvs-4 .cv-art { background: linear-gradient(135deg, transparent 58%, var(--cv-ac) 58.5%); opacity: .9; }
/* 5 액자: 안쪽 테두리 + 작은 원 */
.cvs-5 .cv-art {
  inset: 7% 8%; border: 1.5px solid var(--cv-ac); border-radius: 2px; opacity: .85;
  background: radial-gradient(circle at 50% 70%, var(--cv-ac) 0 12%, transparent 12.5%);
}
/* 작은 표지는 무늬만 조금 더 크게 */
.cover-xs.cvs-3 .cv-art, .cover-sm.cvs-3 .cv-art { background-size: 6px 6px; }

/* ---- components/book-list.css ---- */
/* ==========================================================
   components/book-list.css — 순위 목록 (core/render.js)
   .blist > .brow(한 줄: 순위 | 표지 | 제목·지은이 | 비교 | 대출)
   · .rk(순위 숫자) · .dl(비교 배지) · .top3(표지 크게 1~3위)
   · .bcard(책 카드) · .bshelf(가로로 넘기는 책장) · .tmove(급상승 변동)
   · .sp-list(특히 인기 짧은 목록) · .rlist-more(더 보기) · .mix(주제 분포)
   ========================================================== */

/* 순위 목록을 담는 카드 */
.rank-card { padding: 14px 10px; }
.rank-card .top3 { padding: 0 4px; }
.rank-card .card-foot { margin: 12px 6px 0; }

.blist { display: grid; gap: 2px; }
.brow { position: relative; border-radius: 14px; transition: background .15s; }
.brow:hover { background: var(--surface-2); }
.brow-link {
  display: grid; align-items: center; column-gap: 12px;
  grid-template-columns: 26px auto minmax(0, 1fr);
  min-height: 78px; padding: 8px 10px 8px 6px; border-radius: 14px;
}
.brow.has-cmp .brow-link { grid-template-columns: 26px auto minmax(0, 1fr) auto; }
.brow-link.is-static { cursor: default; }

/* 순위 숫자 */
.rk { font-size: 17px; font-weight: 900; line-height: 1; text-align: center; color: var(--ink-2); font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.rk-1 { color: var(--gold-ink); }
.rk-2 { color: var(--silver-ink); }
.rk-3 { color: var(--bronze-ink); }

.brow-info { display: grid; gap: 3px; min-width: 0; }
.brow-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 15.5px; font-weight: 800; line-height: 1.38; letter-spacing: -.03em;
}
.brow-link:hover .brow-title { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.brow-link.is-static:hover .brow-title { text-decoration: none; }
.brow-meta { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.brow-cmp { display: grid; justify-items: end; gap: 4px; text-align: right; }
.brow-base { font-size: 12px; font-weight: 700; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.brow-loans { display: none; font-size: 12.5px; color: var(--ink-3); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.brow-loans b { font-size: 14px; font-weight: 800; color: var(--ink-2); }

/* ---------- 비교 배지 ---------- */
.dl {
  display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.dl .ico { width: 9px; height: 9px; }
.dl-up { background: var(--up-soft); color: var(--up-deep); }
.dl-down { background: var(--down-soft); color: var(--down-deep); }
.dl-same { background: var(--same-soft); color: var(--ink-2); }
.dl-only { background: var(--paper-2); color: #7A5B22; }
.dl-new { background: var(--brand-soft); color: var(--brand-deep); }
.dl-new .ico { width: 12px; height: 12px; }

/* ---------- 급상승 변동 ---------- */
.trow .brow-link { grid-template-columns: 26px auto minmax(0, 1fr) auto; }
.tmove { display: grid; justify-items: end; gap: 4px; }
.tmove-path { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tmove-path .ico { width: 12px; height: 12px; color: var(--ink-4); }
.tmove-path b { color: var(--ink); font-weight: 800; }

/* ---------- TOP 3 ---------- */
.top3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.t3 > a, .t3 > .is-static {
  height: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 12px 12px 14px; border-radius: 18px; background: var(--paper); border: 1px solid var(--paper-line);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.t3 > a:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: #E2D3B6; }
.t3 .cover { width: min(100%, 124px); margin: 0 auto 8px; }
.t3-rank { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 900; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.t3-rank .ico { width: 14px; height: 14px; color: var(--gold); }
.t3-1 .t3-rank { color: #9A6400; }
.t3-2 .t3-rank { color: #56627A; }
.t3-3 .t3-rank { color: #9C4A1D; }
.t3-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 14.5px; font-weight: 800; line-height: 1.38; letter-spacing: -.035em;
}
.t3-author { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.t3-cmp { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: auto; padding-top: 4px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
/* 좁은 카드에서 '전국 순위권 밖' 같은 긴 배지가 카드 밖으로 잘리지 않게 줄바꿈한다 */
.t3 > a, .t3 > .is-static { min-width: 0; }
.t3-cmp { max-width: 100%; }
.t3-cmp .dl { max-width: 100%; height: auto; min-height: 22px; padding-block: 3px; white-space: normal; line-height: 1.25; }

/* ---------- 책 카드 ---------- */
.bcard { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.bcard .cover { margin-bottom: 8px; transition: transform .2s var(--ease), box-shadow .2s; }
a.bcard:hover .cover { transform: translateY(-3px) rotate(-.6deg); box-shadow: 0 2px 3px rgba(29, 36, 51, .1), 0 16px 26px -12px rgba(29, 36, 51, .45); }
.bcard-kicker { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: var(--brand-deep); }
.bcard-kicker .ico { width: 13px; height: 13px; }
.bcard-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 14.5px; font-weight: 800; line-height: 1.38; letter-spacing: -.035em;
}
a.bcard:hover .bcard-title { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.bcard-author { font-size: 12.5px; color: var(--ink-3); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcard-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--ink-3); }

/* 가로로 넘기는 책장 → 넓은 화면에서는 격자 */
.bshelf {
  display: grid; grid-auto-flow: column; grid-auto-columns: 124px; gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 -16px; padding: 4px 16px 8px;
  /* 스냅 기준을 안쪽 여백에 맞춘다 — 없으면 첫 카드가 화면 왼쪽 끝에 붙어 잘린다 */
  scroll-padding-inline: 16px;
}
.bshelf::-webkit-scrollbar { display: none; }
.bshelf > * { scroll-snap-align: start; }

@media (min-width: 768px) {
  .rank-card { padding: 18px 14px; }
  .brow-link { grid-template-columns: 34px auto minmax(0, 1fr); column-gap: 16px; padding: 8px 14px 8px 8px; }
  .brow.has-cmp .brow-link { grid-template-columns: 34px auto minmax(0, 1fr) auto; }
  .brow.has-loans .brow-link { grid-template-columns: 34px auto minmax(0, 1fr) 84px; }
  .brow.has-cmp.has-loans .brow-link { grid-template-columns: 34px auto minmax(0, 1fr) auto 84px; }
  .brow-loans { display: block; }
  .trow .brow-link { grid-template-columns: 34px auto minmax(0, 1fr) auto; }
  .rk { font-size: 19px; }
  .brow-title { font-size: 16px; }
  .top3 { gap: 14px; }
  .t3 > a { padding: 16px 16px 16px; }
  .t3-title { font-size: 15.5px; }
  .bshelf { grid-auto-columns: 140px; gap: 20px; margin: 0 -24px; padding: 4px 24px 8px; scroll-padding-inline: 24px; }
}
@media (max-width: 767px) {
  /* 대출 건수만 있는 목록은 모바일에서 제목 아래에 붙인다 */
  .brow.has-loans:not(.has-cmp) .brow-link { grid-template-columns: 26px auto minmax(0, 1fr) auto; }
  .brow.has-loans:not(.has-cmp) .brow-loans { display: block; }
}
@media (max-width: 380px) {
  .brow-link { column-gap: 10px; }
  .cover-sm { width: 38px; }
  .brow-title { font-size: 15px; }
  .t3 > a { padding: 10px 9px 12px; }
  .t3-title { font-size: 13.5px; }
}
@media (min-width: 1024px) {
  .bshelf.shelf-grid { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 4px 0 0; }
}

/* ---------- 특히 인기 (render.js specialList) ---------- */
.sp-list { display: grid; gap: 2px; }
.sp-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 60px; padding: 5px 6px; border-radius: 12px; }
.sp-row:hover { background: var(--surface-2); }
.sp-txt { display: grid; min-width: 0; line-height: 1.38; }
.sp-txt b { font-size: 14.5px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-txt span { font-size: 12.5px; color: var(--ink-3); }
.sp-go { width: 16px; height: 16px; color: var(--ink-4); }
.sp-empty { padding: 12px 6px; font-size: 13.5px; color: var(--ink-3); }

/* ---------- 더 보기 ---------- */
.rlist-more {
  width: 100%; height: 48px; margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 14px; background: var(--surface-2); font-size: 14px; font-weight: 700; color: var(--ink-2);
}
.rlist-more:hover { background: #EDF0F5; }
.rlist-more .ico { width: 17px; height: 17px; }

/* ---------- 주제 분포 (render.js kdcMix) ---------- */
.mix-bar { display: flex; gap: 3px; height: 14px; border-radius: 7px; overflow: hidden; }
.mix-bar span { min-width: 4px; transform-origin: left; animation: grow-x .6s var(--ease) both; }
.mix-legend { display: grid; gap: 6px; margin-top: 12px; }
.mix-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 40px; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.mix-legend i { width: 12px; height: 12px; border-radius: 4px; }
.mix-legend b { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.mix-legend span { text-align: right; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.mix-0 { background: var(--brand); }
.mix-1 { background: #8C86F2; }
.mix-2 { background: #C9C6FA; }
.mix-3 { background: #E4CFA6; }
.mix-4 { background: #D5DAE3; }

/* ---- components/glance.css ---- */
/* ==========================================================
   components/glance.css — 한눈에 보기 (기획서 12.3)
   답 한 문장 + "어떤 데이터인가요?" + "알아둘 점"
   마크업은 tools/lib/layout.js 의 glance()
   ========================================================== */

.glance {
  display: grid; gap: 14px; padding: 18px; border-radius: var(--r-lg);
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
.glance-answer { font-size: 16.5px; font-weight: 700; line-height: 1.55; letter-spacing: -.03em; color: var(--ink); }
.glance-answer b { font-weight: 900; }
.glance-answer a { color: inherit; text-decoration: underline; text-decoration-color: var(--brand-line); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.glance-answer a:hover { text-decoration-color: var(--brand); }

.glance-sub { display: grid; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--line); }
.glance-sub p { font-size: 13px; line-height: 1.65; color: var(--ink-3); }
.glance-sub a { font-weight: 700; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }

@media (min-width: 768px) {
  .glance { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; padding: 22px 24px; }
  .glance-answer { font-size: 18px; }
  .glance-sub { padding-top: 0; padding-left: 24px; border-top: 0; border-left: 1px dashed var(--line); }
  .glance-solo { grid-template-columns: minmax(0, 1fr); }
}

/* ---- components/chart.css ---- */
/* ==========================================================
   components/chart.css — 작은 그래프 (라이브러리 없이 HTML/CSS)
   .hbars(가로 막대 순위: 독서량·독서율) · .mbars(월별 대출 세로 막대)
   · .ladder(연령대별 순위 사다리) · .tmap(17개 시도 타일 지도) · .kw(키워드)
   값은 인라인 style 의 --v(0~1) 로 넣는다.
   ========================================================== */

/* ---------- 가로 막대 ---------- */
.hbars { display: grid; gap: 2px; }
.hbar {
  display: grid; grid-template-columns: 22px 44px minmax(0, 1fr) 52px; align-items: center; column-gap: 10px;
  min-height: 34px; padding: 0 6px; border-radius: 10px; font-size: 14px;
}
a.hbar:hover { background: var(--surface-2); }
.hbar-rk { font-size: 12.5px; font-weight: 800; color: var(--ink-3); text-align: center; font-variant-numeric: tabular-nums; }
.hbar-name { font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.hbar-track { position: relative; height: 12px; border-radius: 6px; background: var(--line-2); }
.hbar-track i {
  position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--v) * 100%); border-radius: 6px;
  background: linear-gradient(90deg, #A9A4F6, var(--brand)); transform-origin: left; animation: grow-x .7s var(--ease) both;
}
.hbar-track b { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--navy); left: calc(var(--avg) * 100%); }
.hbar-val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.hbar.is-me { background: var(--brand-tint); }
.hbar.is-me .hbar-name { color: var(--brand-deep); }
.hbar.is-low .hbar-track i { background: linear-gradient(90deg, #D5DAE3, #AEB6C4); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 14px; height: 8px; border-radius: 4px; background: var(--brand); }
.chart-legend i.avg { width: 2px; height: 12px; border-radius: 1px; background: var(--navy); }

/* ---------- 월별 세로 막대 ---------- */
.mbars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: 4px; height: 168px; padding-top: 22px; }
.mbar { position: relative; display: grid; grid-template-rows: 1fr auto; height: 100%; min-width: 0; }
.mbar-col { position: relative; align-self: end; height: calc(var(--v) * 100%); min-height: 3px; border-radius: 6px 6px 3px 3px; background: #CFCBF9; transform-origin: bottom; animation: grow-y .6s var(--ease) both; }
.mbar.is-last .mbar-col { background: var(--brand); }
.mbar.is-max .mbar-col::before {
  content: attr(data-v); position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%);
  font-size: 11px; font-weight: 800; color: var(--ink-2); white-space: nowrap;
}
.mbar-m { margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--ink-3); text-align: center; white-space: nowrap; }
.mbar.is-last .mbar-m { color: var(--brand-deep); font-weight: 800; }
/* 좁은 화면에서는 달 이름을 하나 건너 적어 겹치지 않게 (마지막 달은 항상) */
@media (max-width: 400px) { .mbar:nth-child(odd):not(.is-last) .mbar-m { visibility: hidden; } }

/* ---------- 연령대별 순위 사다리 ---------- */
.ladder { display: grid; gap: 6px; }
.lad {
  display: grid; grid-template-columns: 30px 88px minmax(0, 1fr) 70px; align-items: center; column-gap: 10px;
  min-height: 44px; padding: 4px 8px; border-radius: 12px;
}
a.lad:hover { background: var(--surface-2); }
.lad-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); }
.lad-ico .ico { width: 17px; height: 17px; }
.lad-name { display: grid; line-height: 1.25; }
.lad-name b { font-size: 14.5px; font-weight: 800; }
.lad-name small { font-size: 11.5px; color: var(--ink-3); }
.lad-track { position: relative; height: 10px; border-radius: 5px; background: var(--line-2); overflow: hidden; }
.lad-track i { position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 100%); border-radius: 5px; background: #B7B2F7; transform-origin: left; animation: grow-x .7s var(--ease) both; }
.lad-val { text-align: right; font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }
.lad-val.is-out { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.lad.is-best { background: var(--brand-tint); }
.lad.is-best .lad-ico { background: var(--brand); color: #fff; }
.lad.is-best .lad-track i { background: var(--brand); }
.lad.is-best .lad-val { color: var(--brand-deep); }

/* ---------- 17개 시도 타일 지도 ---------- */
.tmap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-width: 420px; }
.tile {
  position: relative; display: grid; align-content: space-between; gap: 2px; min-height: 64px; padding: 8px 10px;
  border-radius: 12px; background: var(--line-2); color: var(--ink-2); transition: transform .15s, box-shadow .15s;
}
a.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.tile-n { font-size: 13px; font-weight: 800; }
.tile-r { font-size: 17px; font-weight: 900; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: inherit; }
.tile-r small { font-size: 11px; font-weight: 700; }
.tile.t-out .tile-r { font-size: 11.5px; font-weight: 700; }
.tile.t-missing { background: #F5EBD7; color: var(--ink-2); }
.tile.t-missing .tile-r { font-size: 11px; font-weight: 700; }
.tile.t-1 { background: var(--brand); color: #fff; }
.tile.t-2 { background: #6F68E8; color: #fff; } /* 흰 글자 대비 4.5:1 이상 */
.tile.t-3 { background: #C9C6FA; color: var(--brand-deep); }
.tile.t-4 { background: var(--brand-soft); color: var(--brand-deep); }
.tile.is-me { box-shadow: inset 0 0 0 2.5px var(--navy); }
.tile.is-me::after { content: "내 동네"; position: absolute; top: 6px; right: 7px; font-size: 10px; font-weight: 800; opacity: .85; }
/* 좁은 타일에서는 글자 배지가 시도명과 겹치므로 점으로만 */
@media (max-width: 400px) { .tile.is-me::after { content: ""; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: currentColor; } }
.tmap-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 12px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.tmap-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tmap-legend i { width: 12px; height: 12px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(29, 36, 51, .12); }
/* 범례 색은 위 타일(.tile.t-*)과 같은 값 — 한 파일에서만 관리 */
.tmap-legend .lg-1 { background: var(--brand); }
.tmap-legend .lg-2 { background: #6F68E8; }
.tmap-legend .lg-3 { background: #C9C6FA; }
.tmap-legend .lg-4 { background: var(--brand-soft); }
.tmap-legend .lg-out { background: var(--line-2); }
.tmap-legend .lg-missing { background: #F5EBD7; }

/* ---------- 키워드 ---------- */
.kw { display: flex; flex-wrap: wrap; gap: 8px; }
.kw span {
  display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); font-weight: 700; white-space: nowrap;
  font-size: calc(12.5px + var(--w) * 5px);
}
.kw span.kw-top { background: var(--brand-soft); color: var(--brand-deep); }

@media (min-width: 768px) {
  .hbar { grid-template-columns: 26px 54px minmax(0, 1fr) 60px; }
  .mbars { height: 190px; gap: 8px; }
  .mbar-m { font-size: 12px; }
  .tile { min-height: 70px; }
}

/* ---- components/feedback.css ---- */
/* ==========================================================
   components/feedback.css — 안내 · 상태 표시
   .notice(알림) · .disclaimer(필수 고지) · .empty(빈 상태) · .sk(스켈레톤)
   · .toast · .faq(자주 묻는 질문)
   ========================================================== */

/* ---------- 알림 ---------- */
.notice {
  display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border-radius: var(--r-md);
  font-size: 13.5px; line-height: 1.65; font-weight: 500;
}
.notice > .ico { width: 18px; height: 18px; margin-top: 2px; }
.notice b { font-weight: 800; }
.notice-warn { background: var(--warn-soft); color: var(--warn-deep); border: 1px solid var(--warn-line); }
.notice-mute { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.notice-paper { background: var(--paper); color: #6A5226; border: 1px solid var(--paper-line); }

/* ---------- 필수 고지 문구 ---------- */
.disclaimer {
  display: flex; gap: 12px; padding: 16px 18px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 13.5px; line-height: 1.7; color: var(--ink-2);
}
.disclaimer > .ico { width: 20px; height: 20px; margin-top: 1px; color: var(--ink-4); }
.disclaimer a { font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 빈 상태 ---------- */
.empty {
  display: grid; justify-items: center; gap: 6px; padding: 36px 20px; text-align: center;
  border-radius: var(--r-lg); background: var(--surface-2); border: 1px dashed #DCE1EA;
}
.empty-ico {
  width: 56px; height: 56px; margin-bottom: 6px; border-radius: 18px; display: grid; place-items: center;
  background: #fff; color: var(--ink-4); box-shadow: var(--shadow-1);
}
.empty-ico .ico { width: 28px; height: 28px; }
.empty b { font-size: 16px; font-weight: 800; letter-spacing: -.03em; }
.empty p { max-width: 28em; font-size: 14px; color: var(--ink-3); }
.empty .btn { margin-top: 10px; }

/* ---------- 스켈레톤 ---------- */
.sk {
  background: linear-gradient(90deg, #EEF1F6 25%, #F6F8FB 37%, #EEF1F6 63%);
  background-size: 400px 100%; border-radius: 12px; animation: shimmer 1.4s linear infinite;
}
.sk-list { display: grid; gap: 8px; }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
  padding: 12px 18px 12px 12px; border-radius: 16px;
  background: var(--navy); color: #fff; box-shadow: 0 16px 40px -12px rgba(22, 33, 62, .5);
  font-size: 14px; font-weight: 600;
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-ico { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--brand); }
.toast-ico.warn { background: var(--warn); }

/* ---------- 자주 묻는 질문 ---------- */
.faq { display: grid; gap: 8px; }
.faq details { border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); transition: border-color .15s; }
.faq details[open] { border-color: #D8DCF8; }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 12px 16px;
  font-size: 15px; font-weight: 800; letter-spacing: -.02em; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq-chev { width: 18px; height: 18px; color: var(--ink-4); transition: transform .2s; }
.faq details[open] .faq-chev { transform: rotate(180deg); }
.faq-a { padding: 0 16px 16px; font-size: 14px; line-height: 1.75; color: var(--ink-2); }
.faq-a a { font-weight: 700; color: var(--brand-deep); text-decoration: underline; text-underline-offset: 3px; }
.freshness-banner { padding: 10px 20px; background: #FFF1D6; color: #59421B; text-align: center; font-size: 13px; font-weight: 700; line-height: 1.5; }

/* ---- components/modal.css ---- */
/* ==========================================================
   components/modal.css — 모달 (모바일 바텀시트 → 데스크톱 가운데)
   .modal-dim > .modal(.modal-head / .modal-body / .modal-foot)
   모달 안에서 쓰는 .region-grid(지역 선택)
   동작은 components/modal.js
   ========================================================== */

.modal-dim {
  position: fixed; inset: 0; z-index: 130; display: grid; align-items: end;
  background: rgba(29, 36, 51, .36); opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity .24s, visibility 0s linear .24s;
}
/* 닫힌 모달 안의 버튼·링크로 Tab 이 들어가지 않게 visibility 로 숨긴다 */
.modal-dim.open { opacity: 1; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.modal {
  width: 100%; max-height: 90vh; max-height: 90dvh; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom); border-radius: 24px 24px 0 0; background: #fff;
  transform: translateY(100%); transition: transform .3s var(--ease);
}
.modal-dim.open .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.035em; }
.modal-sub { margin-top: 1px; font-size: 12.5px; color: var(--ink-3); }
.modal-body { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px; }
.modal-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line); }
body.modal-open { overflow: hidden; }

@media (min-width: 768px) {
  .modal-dim { place-items: center; }
  .modal { max-width: 480px; border-radius: 24px; transform: translateY(20px) scale(.98); }
  .modal-wide { max-width: 640px; }
  .modal-dim.open .modal { transform: none; }
}

/* ---------- 지역 선택 그리드 (모달 · 홈 · 검색 공통) ---------- */
.region-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.region-grid button, .region-grid a {
  position: relative; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; gap: 4px;
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 15px; font-weight: 700; color: var(--ink-2); transition: all .15s;
}
.region-grid button:hover, .region-grid a:hover { box-shadow: inset 0 0 0 1.5px #D5DAE3; color: var(--ink); }
.region-grid [aria-pressed="true"] { background: var(--navy); color: #fff; box-shadow: none; }
.region-grid-sm button, .region-grid-sm a { height: 40px; font-size: 14px; border-radius: 11px; }
@media (min-width: 520px) { .region-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- 내 동네 · 내 또래 (components/prefs.js) ---------- */
.prefs-label { display: flex; align-items: center; gap: 6px; margin: 4px 2px 10px; font-size: 14px; font-weight: 800; }
.prefs-label .ico { color: var(--brand); }
.prefs-label ~ .prefs-label { margin-top: 20px; }
.prefs-foot { display: grid; grid-template-columns: auto 1fr; gap: 8px; }

/* ---- components/search.css ---- */
/* ==========================================================
   components/search.css — 통합 검색 모달 (components/search.js)
   ========================================================== */

.srch-input {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; margin-bottom: 14px;
  border-radius: 16px; background: var(--surface-2); transition: box-shadow .15s, background .15s;
}
.srch-input:focus-within { background: #fff; box-shadow: inset 0 0 0 2px var(--brand), var(--focus-ring); }
.srch-input .ico { color: var(--ink-4); }
.srch-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; font-size: 16px; font-weight: 600; }
.srch-input input::placeholder { color: var(--ink-4); font-weight: 500; }

.srch-body { min-height: 180px; }
.srch-label { margin: 14px 2px 8px; font-size: 12.5px; font-weight: 800; color: var(--ink-3); }
.srch-label:first-child { margin-top: 0; }
.srch-list { display: grid; gap: 2px; }
.srch-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 10px; border-radius: 13px; transition: background .12s; }
.srch-row:hover, .srch-row.is-active { background: var(--surface-2); }
.srch-row.is-active { box-shadow: inset 0 0 0 2px var(--brand); } /* 키보드로 고른 줄은 테두리로도 표시 */
.srch-wait { padding: 10px 12px; font-size: 13px; color: var(--ink-3); }
.srch-txt { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.srch-txt b { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.srch-txt span { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-go { width: 17px; height: 17px; color: var(--ink-4); }
.srch-row .cover { margin: 0 2px; }
.srch-ico { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-deep); }
.srch-ico .ico { width: 17px; height: 17px; }
.srch-rank { flex: none; font-size: 12px; font-weight: 800; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---- components/ad.css ---- */
/* ==========================================================
   components/ad.css — 광고 자리
   승인된 광고 코드를 연결하기 전에는 방문자에게 빈 슬롯을 보여주지 않는다.
   body.ads-ready(광고 연결 후) 또는 body.dev(?dev=1 시안 확인)일 때만 보인다.

   배치 원칙 (기획서 9장)
   · 검색 · 지역 선택 · 랭킹 첫 결과를 광고로 가리지 않는다.
   · 콘텐츠를 확인한 뒤 자연스럽게 보이는 중간 · 하단에만 둔다.
   ========================================================== */

.ad {
  position: relative; max-width: 728px; min-height: 100px; margin: 0 auto;
  display: grid; place-items: center; text-align: center;
  border-radius: 14px; border: 1.5px dashed #D8DDE6;
  background: repeating-linear-gradient(45deg, #FAFBFD 0 10px, #F4F6F9 10px 20px);
  color: #A2AABA; font-size: 12px;
}
.ad::before { content: "광고"; position: absolute; top: 7px; left: 12px; font-size: 11px; font-weight: 700; color: #A9B1BF; }
.ad strong { display: block; font-size: 13px; font-weight: 700; color: #97A0B1; }
.ad-row { padding: 8px 0; }
@media (min-width: 768px) { .ad { min-height: 90px; } }

body:not(.ads-ready):not(.dev) .ad,
body:not(.ads-ready):not(.dev) .ad-row { display: none; }

/* ---- components/footer.css ---- */
/* ==========================================================
   components/footer.css — 푸터
   마크업은 tools/lib/layout.js 의 footer() 에서 만든다.
   ========================================================== */

.ftr {
  padding: 36px 0 calc(56px + env(safe-area-inset-bottom));
  background: var(--surface-2); border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-3);
}
.ftr .logo { font-size: 18px; }
.ftr-desc { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.ftr-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; margin: 22px 0 18px; }
.ftr-col h2 { margin-bottom: 6px; font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.ftr-col a { display: flex; align-items: center; min-height: 32px; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.ftr-col a:hover { color: var(--ink); }
.ftr-regions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin-bottom: 18px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ftr-regions b { margin-right: 12px; font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.ftr-regions a { display: inline-flex; align-items: center; min-height: 30px; padding: 0 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.ftr-regions a:hover { color: var(--ink); }
/* 손가락으로 누르는 화면은 링크 높이를 넉넉히 */
@media (pointer: coarse) { .ftr-col a { min-height: 40px; } .ftr-regions a { min-height: 40px; } }
.ftr-note { max-width: 62em; line-height: 1.75; }
.ftr-note b { color: var(--ink-2); }
.ftr-note a, .ftr-copy a { text-decoration: underline; text-underline-offset: 3px; }
.ftr-copy { margin-top: 18px; font-size: 12px; }

@media (min-width: 768px) {
  .ftr-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
