:root {
  --bg: #f7f8fa; --surface: #ffffff; --text: #0f172a; --muted: #5b6475; --line: #e3e7ee;
  --accent: #2f6df6; --accent-ink: #ffffff; --accent-soft: #e9f0ff; --ok: #0f9d58; --warn: #e8a400; --bad: #d93025; --info: #1a73e8;
  --radius: 12px; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1117; --surface: #161b22; --text: #e6edf3; --muted: #9aa4b2; --line: #2a313c; --accent: #5b8cff; --accent-soft: #1b2740; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* 헤더 */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 56px; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--text); line-height: 1; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 28px; height: 28px; color: var(--accent); flex: none; }
.logo-word { font-weight: 800; font-size: 20px; letter-spacing: -0.03em; }
.logo-word b { color: var(--accent); font-weight: 800; }
.tagline { color: var(--muted); font-size: 14px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-select select { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
@media (max-width: 640px) { .tagline { display: none; } .header-inner { justify-content: space-between; } }

/* 본문 + 사이드 광고 */
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 16px; padding-bottom: 24px; }
@media (min-width: 1100px) { .page { grid-template-columns: minmax(0, 1fr) 300px; } }
.side { display: none; }
@media (min-width: 1100px) { .side { display: block; } .side .ad { position: sticky; top: 16px; } }
.main { min-width: 0; }
h1 { font-size: clamp(24px, 4vw, 32px); line-height: 1.25; margin: 8px 0 8px; letter-spacing: -0.02em; }
h2 { font-size: 20px; margin: 0 0 12px; }
.lead { color: var(--muted); margin: 0 0 16px; }
.crumbs { font-size: 13px; color: var(--muted); }

/* 광고 구좌: 자리를 미리 잡아 CLS 를 막는다. 광고 ID 가 없으면 접힌다. */
.ad { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: var(--radius); margin: 16px 0; }
.ad-label { position: absolute; top: 4px; left: 8px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); opacity: .7; }
.ad ins { width: 100%; }
.ad-top { min-height: 100px; }
@media (min-width: 768px) { .ad-top { min-height: 90px; } }
.ad-inContent, .ad-midContent, .ad-afterFaq, .ad-homeFeed { min-height: 250px; }
.ad-sidebar { min-height: 600px; width: 300px; margin-top: 0; }
.ad-bottom { min-height: 90px; }
.ads-off .ad { display: none; }
/* 광고가 없으면 사이드 칸을 비워 두지 않는다 → 본문이 헤더와 같은 중심선 */
@media (min-width: 1100px) { .ads-off .page { grid-template-columns: minmax(0, 1fr); } }
.ads-off .side { display: none; }
.adslots .ad { display: flex; background: repeating-linear-gradient(45deg, var(--accent-soft), var(--accent-soft) 10px, transparent 10px, transparent 20px); border: 1px dashed var(--accent); }
.adslots .ad::after { content: attr(class); font: 12px var(--mono); color: var(--muted); }

/* 홈: 전체 도구 인덱스 (404 도 같은 톤). 캐릭터 없이 굵은 타이포 + 파스텔 색 블록 + 스티커 카드.
   .home 안에서만 적용 → 도구 페이지(관련 도구 카드 포함)는 영향 없음 */
.home {
  --ink: #2c2433; --stroke: #2c2433; --sticker: 3px 3px 0 var(--ink); --dot: rgba(44, 36, 51, .09);
  --tint-dev: #e7e8ff; --tint-everyday: #ffedcf; --tint-fun: #ffe2d4; --tint-hero: #eaf3ff;
  --solid-dev: #8b8ff5; --solid-everyday: #f5b83d; --solid-fun: #f28c6b;
  --r-lg: 22px; --r-md: 16px;
}
@media (prefers-color-scheme: dark) {
  .home { --ink: #000; --stroke: #48505f; --dot: rgba(230, 237, 243, .06);
    --tint-dev: #252a4a; --tint-everyday: #3a301d; --tint-fun: #3f2a24; --tint-hero: #172338;
    --solid-dev: #7b80e8; --solid-everyday: #d9a033; --solid-fun: #d9775a; }
}

/* 히어로: 가운데 정렬 타이포 + 모서리 색 블록(장식) */
.home .hero { position: relative; overflow: hidden; isolation: isolate; margin-top: 8px; padding: 44px 20px 32px; text-align: center;
  background: radial-gradient(var(--dot) 1.2px, transparent 1.4px) 0 0 / 18px 18px, var(--tint-hero);
  border: 2px solid var(--stroke); border-radius: var(--r-lg); box-shadow: var(--sticker); }
.home .hero::before, .home .hero::after { content: ""; position: absolute; z-index: -1; border: 2px solid var(--stroke); }
.home .hero::before { width: 120px; height: 120px; left: -40px; top: -40px; border-radius: 28px; background: var(--solid-everyday); transform: rotate(14deg); }
.home .hero::after { width: 150px; height: 150px; right: -56px; bottom: -64px; border-radius: 50%; background: var(--solid-dev); }
.home .hero-text { position: relative; max-width: 760px; margin: 0 auto; }
.home .hero-text::after { content: ""; position: absolute; z-index: -1; width: 46px; height: 46px; right: -6px; top: -22px; border: 2px solid var(--stroke);
  border-radius: 12px; background: var(--solid-fun); transform: rotate(-12deg); }
.home .hero h1 { font-size: clamp(30px, 6vw, 58px); line-height: 1.08; letter-spacing: -0.04em; font-weight: 850; margin: 0 auto 14px; max-width: 14ch; text-wrap: balance; }
.home .hero p { color: var(--muted); margin: 0 auto; max-width: 46ch; font-size: clamp(15px, 2vw, 18px); text-wrap: pretty; }
.home .search { display: block; margin: 24px auto 16px; max-width: 560px; }
.home .search input { width: 100%; display: block; padding: 15px 18px 15px 48px; font: inherit; font-size: 16px; color: var(--text); border-radius: 999px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8f9c' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E") no-repeat 18px 50% / 20px;
  border: 2px solid var(--stroke); box-shadow: var(--sticker); }
.home .search input:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.home .stats { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; margin: 0; font-size: 14px; color: var(--muted); }
.home .stats li { padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line); }
.home .stats b { color: var(--text); font-weight: 800; }
@media (max-width: 560px) {
  .home .hero { padding: 34px 16px 24px; }
  .home .hero::before { width: 84px; height: 84px; left: -34px; top: -34px; }
  .home .hero::after { width: 100px; height: 100px; right: -44px; bottom: -48px; }
  .home .hero-text::after { display: none; }
  .home .stats { font-size: 13px; gap: 6px; }
}

/* 추천 도구 + 분류 바로가기 (벤토: 큰 칸 1 + 숫자 칸 3) */
.home .shelf { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 22px 0 8px; }
@media (min-width: 900px) { .home .shelf { grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); } }
.home .featured { display: flex; align-items: center; gap: 16px; padding: 20px; color: var(--text); min-width: 0;
  background: var(--surface); border: 2px solid var(--stroke); border-radius: var(--r-md); box-shadow: var(--sticker); transition: transform .15s, box-shadow .15s; }
.home .featured:hover { text-decoration: none; transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.home .featured-text { min-width: 0; }
.home .featured strong { display: block; font-size: 18px; line-height: 1.3; }
.home .featured small { display: block; color: var(--muted); font-size: 14px; line-height: 1.45; }
.home .featured .badge { display: inline-block; margin-bottom: 6px; font-size: 12px; font-weight: 800; padding: 1px 10px; border-radius: 999px;
  background: #ffd75e; color: #2c2433; border: 2px solid var(--stroke); }
.home .featured .arrow { margin-left: auto; font-size: 22px; color: var(--accent); flex: none; }
.home .tool-icon.big { width: 56px; height: 56px; font-size: 28px; border-radius: 16px; background: var(--tint-dev); flex: none; }
.home .jumps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home .jump { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 14px 16px; min-height: 112px; color: var(--text);
  border: 2px solid var(--stroke); border-radius: var(--r-md); box-shadow: var(--sticker); transition: transform .15s, box-shadow .15s; }
.home .jump:hover { text-decoration: none; transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.home .jump::after { content: ""; position: absolute; right: -18px; top: -18px; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--stroke); opacity: .9; }
.home .jump-dev { background: var(--tint-dev); } .home .jump-dev::after { background: var(--solid-dev); }
.home .jump-everyday { background: var(--tint-everyday); } .home .jump-everyday::after { background: var(--solid-everyday); border-radius: 14px; transform: rotate(18deg); }
.home .jump-fun { background: var(--tint-fun); } .home .jump-fun::after { background: var(--solid-fun); border-radius: 50% 50% 50% 8px; }
.home .jump-n { font-size: clamp(32px, 4vw, 44px); font-weight: 850; line-height: 1; letter-spacing: -0.04em; }
.home .jump strong { display: block; font-size: 15px; line-height: 1.25; }
.home .jump small { display: none; }
@media (max-width: 560px) {
  .home .featured { padding: 16px 14px; gap: 12px; }
  .home .featured strong { font-size: 16px; }
  .home .tool-icon.big { width: 46px; height: 46px; font-size: 24px; border-radius: 13px; }
  .home .jumps { gap: 8px; }
  .home .jump { min-height: 92px; padding: 10px; }
  .home .jump::after { width: 40px; height: 40px; right: -14px; top: -14px; }
  .home .jump strong { font-size: 12.5px; word-break: keep-all; }
}

/* 분류 섹션 */
.home .cat { margin-top: 36px; }
.home .cat h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: clamp(19px, 2.6vw, 24px); letter-spacing: -0.02em; margin-bottom: 14px; }
.home .cat-mark { width: 18px; height: 18px; flex: none; border: 2px solid var(--stroke); border-radius: 6px; background: var(--solid-dev); transform: rotate(12deg); }
.home .cat-everyday .cat-mark { background: var(--solid-everyday); border-radius: 50%; transform: none; }
.home .cat-fun .cat-mark { background: var(--solid-fun); border-radius: 50% 50% 50% 4px; }
.home .soon .cat-mark { display: none; }
.home .count { font-size: 13px; font-weight: 800; border-radius: 999px; padding: 1px 10px; color: var(--ink); background: var(--tint-dev); border: 2px solid var(--stroke); }
@media (prefers-color-scheme: dark) { .home .count { color: var(--text); } }
.home .cat-everyday .count { background: var(--tint-everyday); } .home .cat-fun .count { background: var(--tint-fun); }
.home .tool-grid { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 14px; }
.home .tool-card { border: 2px solid var(--line); border-radius: var(--r-md); padding: 14px; min-width: 0; transition: transform .15s, box-shadow .15s, border-color .15s; }
.home .tool-card:hover { border-color: var(--stroke); transform: translate(-2px, -2px); box-shadow: var(--sticker); }
.home .tool-card .tool-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--tint-hero); flex: none; }
.home .cat-dev .tool-icon { background: var(--tint-dev); }
.home .cat-everyday .tool-icon { background: var(--tint-everyday); }
.home .cat-fun .tool-icon { background: var(--tint-fun); }
.home .soon .tool-card { border-style: dashed; }
.home .msg { margin-top: 24px; text-align: center; }
@media (max-width: 560px) { .home .cat { margin-top: 28px; } .home .tool-grid { gap: 10px; } }

/* 404 */
.home .lost { display: flex; align-items: center; gap: 28px; margin-top: 8px; padding: 28px;
  background: radial-gradient(var(--dot) 1.2px, transparent 1.4px) 0 0 / 18px 18px, var(--tint-dev);
  border: 2px solid var(--stroke); border-radius: var(--r-lg); box-shadow: var(--sticker); }
.home .lost-art { width: 120px; height: auto; flex: none; }
.home .lost h1 { font-size: clamp(44px, 7vw, 72px); letter-spacing: -0.04em; margin: 0; line-height: 1; }
.home .lost p { margin: 8px 0 14px; color: var(--muted); }
.home .lang-pills { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.home .lang-pills a { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 14px; color: var(--text); background: var(--surface); border: 2px solid var(--stroke); }
.home .lang-pills a:hover { text-decoration: none; box-shadow: 2px 2px 0 var(--ink); }
@media (max-width: 560px) { .home .lost { flex-direction: column; text-align: center; padding: 22px 16px; } .home .lang-pills { justify-content: center; } .home .lost-art { width: 96px; } }
@media (prefers-reduced-motion: reduce) { .home .featured, .home .jump, .home .tool-card { transition: none; } .home .featured:hover, .home .jump:hover, .home .tool-card:hover { transform: none; } }

/* 도구 카드 그리드 (홈·관련 도구 공용) */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tool-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s; }
.tool-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(47, 109, 246, .10); }
.tool-card strong { display: block; font-size: 15px; }
.tool-card small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.tool-card.is-soon { opacity: .6; border-style: dashed; }
.tool-card.is-soon:hover { transform: none; box-shadow: none; border-color: var(--line); }
.tool-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); font-size: 18px; }
[data-kw][hidden], [data-cat][hidden] { display: none; }

/* 도구 영역 */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.privacy { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row > * { flex: 0 1 220px; }
@media (max-width: 640px) { .row > * { flex: 1 1 100%; } }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=number], select, textarea {
  font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text);
}
textarea { font-family: var(--mono); font-size: 14px; min-height: 220px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
button, .btn { font: inherit; font-size: 14px; font-weight: 600; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button:hover { border-color: var(--accent); }
.out { font-family: var(--mono); font-size: 14px; white-space: pre-wrap; word-break: break-all; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-height: 48px; }
.msg { font-size: 14px; margin: 4px 0 8px; min-height: 1.4em; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--ok); }
.big { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.split { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 800px) { .split { grid-template-columns: 1fr 1fr; } }

/* 설명·FAQ */
.content { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-top: 16px; }
.content ol { padding-left: 20px; margin: 0; }
.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 16px 0 32px; }
.site-footer p { margin: 4px 0; }

/* 한국어는 어절 단위로 줄바꿈(글자 중간에서 끊기지 않게) */
html[lang="ko"] body { word-break: keep-all; overflow-wrap: anywhere; }

/* 쿠팡 파트너스 블록: 자리를 미리 잡아 CLS 방지 */
.partner { margin: 16px 0; min-height: 160px; text-align: center; overflow: hidden; }
.partner-note { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
@media (max-width: 679px) { .partner { min-height: 120px; } }
