/* 필라맵 — 화면 기준은 G:\workspace\UIUX.md, 구조는 fish/static/css/site.css 를 따른다.
 * 토큰·대비는 docs/mockup/home.html 머리 주석이 정본이다(2026-10-14, WCAG 2.x 상대휘도로 계산).
 * 🔥 색은 토큰으로만. 새 색을 만들면 대비를 재서 여기 주석에 남긴다.
 * 강조색(--accent)은 '리포머 캐리지 파랑' — 화면당 주 버튼 하나 몫이다. 내비·탭바 현재 위치에는 쓰지 않는다(CLAUDE.md 예외).
 * 빨강(--crit)은 오류·위험 전용.
 * 수치 순서: 라이트 = paper(흰) / sunken, 다크 = paper / surface / sunken. */
:root {
  --paper: #ffffff;
  --surface: #ffffff;
  --sunken: #f3f4f7;
  --ink: #161b26;        /* 17.2 / 15.7 — 본문 */
  --ink-2: #3a4252;      /* 10.1 / 9.2  — 부제 */
  --muted: #5b6475;      /* 6.0 / 5.4   — 보조 설명 */
  --line: #e2e5ea;       /* 비텍스트 */
  --line-strong: #c3c8d1;
  --accent: #2c45b0;     /* 8.1 / 7.4 · --accent-soft 위 6.8 · 흰 글자 8.1 */
  --accent-soft: #e7ebfb;
  --good: #1d7450;       /* 5.7 / 5.2 */
  --warn: #7a6200;       /* 5.9 / 5.3 */
  --crit: #b3123a;       /* 6.9 / 6.2 — 오류·위험 전용 */
  --on-accent: #ffffff;
  --map-land: #eef0f4;   /* 비텍스트 — 지도를 받기 전 자리 면 */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10131a;
    --surface: #181c25;
    --sunken: #212633;
    --ink: #eef0f5;      /* 16.3 / 15.0 / 13.3 */
    --ink-2: #c9cedb;    /* 11.8 / 10.8 / 9.6 */
    --muted: #9aa2b4;    /* 7.3 / 6.7 / 5.9 */
    --line: #2c3240;
    --line-strong: #454d5e;
    --accent: #93a6ff;   /* 8.1 / 7.4 / 6.6 · --accent-soft 위 6.2 · --on-accent 글자 8.1 */
    --accent-soft: #1f2850;
    --good: #5cc493;     /* 8.6 / 7.9 / 7.0 */
    --warn: #d6bd4a;     /* 9.9 / 9.1 / 8.1 */
    --crit: #ff8aa0;     /* 8.3 / 7.6 / 6.8 */
    --on-accent: #10131a;
    --map-land: #1b2030;
  }
}
/* famousbros 공용 부품(fb.css) 값 — 기존 토큰을 가리킨다(G:\workspace\DESIGN.md '토큰'). 다크는 가리키는 토큰이 바뀌어 따라간다.
   실측(2026-10-16, WCAG 2.x): 라이트 ink 17.2 · muted 6.0 (surface·paper #fff) · accent #2c45b0 위 흰 글자 8.1
                              다크   ink 15.0 · muted 6.7 (surface #181c25) / paper 위 muted 7.3 · accent #93a6ff 위 #10131a 8.1 */
:root {
  --fb-bg: var(--paper);
  --fb-surface: var(--surface);
  --fb-ink: var(--ink);
  --fb-muted: var(--muted);
  --fb-line: var(--line);
  --fb-accent: var(--accent);
  --fb-on-accent: var(--on-accent);
  --fb-display: inherit;   /* 웹폰트 없음 */
  --fb-max: 880px;         /* .wrap 과 같은 폭 */
}
* { box-sizing: border-box; }
:root { color-scheme: light dark; }
html { scroll-padding-top: 88px; }   /* 떠 있는 내비가 앵커 목적지를 덮지 않게 */
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  overflow-wrap: break-word; -webkit-text-size-adjust: 100%;
}
img, svg { max-width: 100%; }
a { color: var(--accent); }
a:hover { text-decoration: underline; }
/* 접근성 기본 — 게을러도 되는 항목이 아니다 */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
.wrap { max-width: 880px; margin: 0 auto; padding-inline: 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 12px 16px; z-index: 2000; }

/* ---------------------------------------------------------------- 머리·내비 (왼쪽 위 로고 = 홈) — 틀은 fb.css 의 .fb-nav(떠 있는 유리 막대) */
.logo { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.logo svg { width: 28px; height: 28px; color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: 15px; white-space: nowrap; }   /* fb-nav__links 와 같은 알약 */
.nav a:hover { background: var(--sunken); }
/* 현재 위치는 강조색이 아니라 굵기 + 면 — 강조색은 주 버튼 몫으로 남긴다 */
.nav a[aria-current="page"] { color: var(--ink); font-weight: 800; background: var(--sunken); }

/* 2차 띠 — '등록 전 확인' 묶음(/check/·/guide/). 글자 --ink-2 on --paper(10.1 · 다크 11.8), 현재 위치도 굵기 + 면. 줄바꿈, 가로 스크롤 없음 */
.band { border-bottom: 1px solid var(--line); }
.band__in { display: flex; flex-wrap: wrap; gap: 0 4px; padding-block: 4px; }
.band a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 10px; border-radius: 6px; color: var(--ink-2); font-size: 15px; text-decoration: none; }
.band a:hover { background: var(--sunken); }
.band a[aria-current="page"] { color: var(--ink); font-weight: 800; background: var(--sunken); }

/* ---------------------------------------------------------------- 본문 블록 — 제목은 자기 본문에 붙인다(위 > 아래) */
main { padding-bottom: 48px; }
section { margin-top: 44px; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.3; }
h1 { font-size: 26px; margin: 32px 0 8px; }
h2 { font-size: 20px; margin: 44px 0 8px; }
section > h2:first-child { margin-top: 0; }
h3 { font-size: 17px; margin: 24px 0 4px; }
.lede { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
.note { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.crumb { margin-top: 16px; font-size: 14px; }
.crumb a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); }
.crumb + h1 { margin-top: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border-radius: 999px; font: inherit; font-weight: 700; text-decoration: none; border: 0; cursor: pointer; }   /* fb-btn 과 같은 알약 */
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { text-decoration: none; filter: brightness(1.08); }
/* 보조 단추 — 테두리 꼴. 강조색 면은 주 버튼 하나 몫 */
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-ghost:hover { background: var(--sunken); text-decoration: none; }
.textlink { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; text-decoration: underline; text-underline-offset: 3px; }

/* 홈 머리 — 틀은 fb.css 의 .fb-hero(3D 메달 하나). 위 section 의 44px 위 여백은 히어로 자체 여백과 겹치므로 뺀다 */
section.fb-hero { margin-top: 0; }
.fb-hero__h { font-size: clamp(32px, 5vw, 48px); }   /* 제목이 길어(두 마디) 880px 본문에서 60px 면 네 줄이 된다 */
.figbox figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------------------------------------------------------------- 목록 — 줄 전체가 링크(누르러 온 줄) */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows li { border-bottom: 1px solid var(--line); }
.rows a { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 4px; min-height: 64px; color: var(--ink); text-decoration: none; }
.rows a:hover { background: var(--sunken); }
.rows a:hover .t { text-decoration: underline; }
.rows .t { font-weight: 700; }
.rows .m { grid-column: 1; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.rows .s { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 14px; color: var(--good); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.rows .s.off { color: var(--muted); font-weight: 400; }
.more { margin-top: 8px; }
.empty { padding: 16px; background: var(--sunken); border-radius: 10px; color: var(--ink-2); }
.empty p { margin: 0 0 4px; }

/* 필터 칩 — 지금 고른 칩은 굵기·테두리로(강조색 아님). 선택지 수는 5칸 규칙이 아니다(UIUX) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.chips a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 22px; color: var(--ink-2); text-decoration: none; font-size: 15px; }
.chips a:hover { background: var(--sunken); }
.chips a[aria-current="true"] { border: 2px solid var(--ink); color: var(--ink); font-weight: 700; padding: 0 13px; }
.chips + .chips { margin-top: -4px; }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 16px; font-variant-numeric: tabular-nums; }
.pager a, .pager span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; }
.pager span { color: var(--muted); }

/* ---------------------------------------------------------------- 지도 — Leaflet 1.9.4 자체 서빙 + circleMarker */
.map { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--map-land); z-index: 0; }
.map--mini { aspect-ratio: 16 / 7; margin-top: 8px; }
.map__off { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--muted); font-size: 14px; }
.map.on .map__off { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.legend .o { background: var(--good); }
.legend .c { border: 2.5px solid var(--ink-2); }
.near { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; padding: 0 4px; background: none; border: 0; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.near[hidden] { display: none; }
.leaflet-popup-content a { display: inline-flex; align-items: center; min-height: 44px; }
/* Leaflet 확대·축소 단추는 기본 30px — 탭 대상 44px 로 키운다 */
/* leaflet.css 가 site.css 뒤에 실려 같은 꼴은 진다 — .map 을 붙여 이긴다 */
.map .leaflet-bar a, .map.leaflet-touch .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; font-size: 22px; }
.map.leaflet-container a.leaflet-popup-close-button { width: 44px; height: 44px; font-size: 22px; line-height: 44px; }

/* 장소 상세 — 손을 쓰는 값은 '가장 빠른 접수 마감일' 하나라 그것만 크게 */
.addr { color: var(--ink-2); margin: 0; font-variant-numeric: tabular-nums; }
.addr a { color: var(--ink-2); display: inline-flex; align-items: center; min-height: 44px; }
.act { margin-top: 24px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; align-items: center; }
.act .k { margin: 0; color: var(--muted); font-size: 14px; }
.act .v { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.act .w { margin: 0; color: var(--ink-2); font-size: 15px; }
.tip { margin-top: 8px; padding: 12px 16px; background: var(--sunken); border-radius: 10px; }
.tip p { margin: 0; }
.tip a { display: inline-flex; align-items: center; min-height: 44px; }

/* 등록 전 확인 — 실제 순서가 있는 단계라 번호를 쓴다 */
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; background: var(--sunken); border-radius: 10px; }
.steps a { display: block; padding: 12px 16px 12px 52px; min-height: 44px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.steps a:hover b { text-decoration: underline; }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 12px; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--ink-2); color: var(--ink-2); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.steps b { display: block; }
.steps span { color: var(--muted); font-size: 14px; }

/* 기구 격자 — 칸 전체가 링크 */
.gear { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gear a { display: block; min-height: 88px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
.gear a:hover { border-color: var(--line-strong); background: var(--sunken); }
.gear b { display: block; }
.gear span { font-size: 13px; color: var(--muted); }
.gear svg { display: block; margin: 4px 0; color: var(--ink-2); }

/* 그림(drawings.py) — 선은 currentColor(--ink-2), 움직이는 판은 --accent-soft 면 + --accent 선(목업 리포머와 같음) */
.fig { display: block; width: 100%; height: auto; color: var(--ink-2); }
.fig .moving { fill: var(--accent-soft); stroke: var(--accent); }
.figbox { margin: 16px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-width: 520px; }
.nofig { margin: 16px 0 0; padding: 12px 16px; border-radius: 10px; background: var(--sunken); color: var(--muted); font-size: 14px; }

/* 읽는 본문 */
.prose { max-width: 40em; }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 4px; }
.prose a { text-underline-offset: 3px; }
.prose code { font-size: 14px; background: var(--sunken); padding: 0 4px; border-radius: 4px; overflow-wrap: anywhere; }
.inl { display: inline; }
.srcs { font-size: 14px; color: var(--muted); padding-left: 1.2em; }
.srcs a { color: var(--ink-2); display: inline-flex; min-height: 44px; align-items: center; }
.warnbox { margin: 16px 0; padding: 12px 16px; border-left: 4px solid var(--warn); background: var(--sunken); border-radius: 0 10px 10px 0; }
.warnbox p { margin: 0; }
.warnbox p + p { margin-top: 8px; }

/* 표 — 숫자 칸 tabular-nums, 좁으면 표만 가로로 밀린다(UIUX 예외: 표·코드·도식) */
.tbl { overflow-x: auto; margin: 8px 0 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 14px; }
td.n, th.n { text-align: right; }
tfoot td { font-weight: 700; }

/* 계산 폼 — 칸 44px, 결과는 큰 숫자 하나(손을 쓰는 숫자 = 1회 가격 / 예상 환급액) */
.calc { display: grid; gap: 12px; margin: 16px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.calc fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.calc legend { font-weight: 700; margin-bottom: 4px; padding: 0; }
.calc label { display: grid; gap: 4px; font-size: 15px; color: var(--ink-2); }
.calc .radio { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.calc input[type="radio"] { width: 20px; height: 20px; margin: 0; }
.calc input[type="text"] { min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; width: 100%; max-width: 280px; }
.calc .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.result { margin-top: 16px; padding: 16px; border-radius: 12px; background: var(--sunken); }
.result .k { margin: 0; color: var(--muted); font-size: 14px; }
.result .v { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.result .w { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
.err { color: var(--crit); font-weight: 700; }
.formula { font-variant-numeric: tabular-nums; background: var(--sunken); border-radius: 8px; padding: 12px 16px; margin: 8px 0; overflow-x: auto; }

/* 동작 앞뒤 이동 */
.prevnext { display: flex; justify-content: space-between; gap: 8px; margin-top: 32px; flex-wrap: wrap; }
.prevnext a { display: inline-flex; align-items: center; min-height: 44px; }

/* 쿠팡 파트너스 칸 — fish 와 같은 꼴. 대가성 문구는 --muted(6.0 · 다크 7.3). 새 색 없음 */
.cpn { margin: 24px 0; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.cpn__h { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); }
.cpn__d { margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
.cpn__l { list-style: none; margin: 0; padding: 0; }
.cpn__l li + li { border-top: 1px solid var(--line); }
.cpn__i { position: relative; display: flex; gap: 12px; align-items: center; padding: 12px 0; }
.cpn__img { flex: none; width: 88px; height: 88px; object-fit: contain; border-radius: 8px; background: #fff; }
.cpn__t { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cpn__a { color: var(--ink); font-weight: 700; line-height: 1.4; text-decoration: none; }
.cpn__a::after { content: ""; position: absolute; inset: 0; }
.cpn__i:hover .cpn__a { text-decoration: underline; }
.cpn__n { margin: 0; color: var(--muted); font-size: 14px; }
.cpn__go { color: var(--accent); font-size: 14px; font-weight: 700; }
.cpn__b { display: block; width: 100%; border: 0; }

/* 더보기 격자 — 제목 있는 두 묶음. --ink-2 on --sunken(9.2 · 다크 9.6) */
.mgroup { font-size: 16px; margin: 24px 0 8px; }
.mgrid { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mgrid a { display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 12px 8px; border-radius: 12px; background: var(--sunken); color: var(--ink-2); font-size: 14px; line-height: 1.35; text-align: center; text-decoration: none; word-break: keep-all; }
.mgrid a:hover { background: var(--line); text-decoration: underline; }

/* ---------------------------------------------------------------- 꼬리 — 틀은 fb.css 의 .fb-foot */

/* ---------------------------------------------------------------- 모바일(≤720px) 하단 탭바 5칸 — 순수 링크
 * 탭 글자 --ink-2 on --surface(10.1 · 다크 10.8). 현재 탭은 강조색이 아니라 굵기 + 위 막대(--ink).
 * z-index 는 Leaflet 단추(1000)보다 위. */
.tabbar { display: none; }
@media (max-width: 720px) {
  .nav { display: none; }
  .act .btn-primary, .calc .btn-primary { width: 100%; }
  .gear { grid-template-columns: repeat(2, 1fr); }
  .map { aspect-ratio: 4 / 5; }
  .map--mini { aspect-ratio: 16 / 9; }
  .act { grid-template-columns: 1fr; }
  .band__in { gap: 0; }
  .band a { padding: 0 6px; font-size: 14px; }
  .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 23px; }
  /* 탭바 생김새는 fb 탭바(바닥에서 띄운 유리 알약), 칸은 이 사이트 것(DESIGN.md 예외). 현재 탭은 강조색이 아니라 굵기 + --sunken 면 */
  body { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 1100;
            padding: 4px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--fb-glass-line);
            box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 55%, transparent), var(--fb-shadow); }
  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .tabbar { background: var(--fb-glass); -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%); }
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border-radius: 999px; font-size: 12px; color: var(--ink-2); text-decoration: none; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--ink); font-weight: 800; background: var(--sunken); }
  .tabbar a:focus-visible { outline-offset: -4px; }
  /* 글을 칠 때는 탭바를 내린다 — 폰 키보드 위에 떠서 입력 칸을 가렸다(fish) */
  body:has(:is(input:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"]), textarea, select):focus) .tabbar { display: none; }
  body.kb .tabbar { display: none; }
}
