: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 { min-height: 250px; }
.ad-sidebar { min-height: 600px; width: 300px; margin-top: 0; }
.ad-bottom { min-height: 90px; }
.ads-off .ad { 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); }

/* 홈: 전체 도구 인덱스 */
.hero { padding: 40px 0 12px; text-align: center; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); margin-bottom: 10px; }
.hero p { color: var(--muted); margin: 0 auto; max-width: 560px; }
.stats { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0; }
.stats li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--muted); }
.stats b { color: var(--text); }
.search input { max-width: 520px; display: block; margin: 0 auto; padding: 14px 18px; font-size: 16px; border-radius: 999px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(47, 109, 246, .08); }
.featured { position: relative; display: flex; align-items: center; gap: 16px; margin: 24px 0 8px; padding: 20px; border-radius: 16px; color: var(--text);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid var(--line); }
.featured:hover { text-decoration: none; border-color: var(--accent); }
.featured strong { display: block; font-size: 18px; }
.featured small { color: var(--muted); }
.featured .badge { position: absolute; top: 10px; right: 14px; font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.featured .arrow { margin-left: auto; font-size: 22px; color: var(--accent); }
.tool-icon.big { width: 52px; height: 52px; font-size: 26px; border-radius: 14px; }
.cat { margin-top: 28px; }
.cat h2 { display: flex; align-items: center; gap: 8px; }
.count { font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 8px; }
.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; }
.search { display: block; }
.search input { width: 100%; border: 1px solid var(--line); }
