:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1d2433;
  --muted: #5b6475;
  --line: #e3e6ee;
  --primary: #2f6bff;
  --primary-dark: #1f54d6;
  --accent-bg: #eef3ff;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c;
    --card: #1b1f29;
    --text: #e8ebf2;
    --muted: #9aa3b5;
    --line: #2b3140;
    --primary: #5b8cff;
    --primary-dark: #7aa2ff;
    --accent-bg: #1f2840;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  line-height: 1.7;
  word-break: keep-all;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.site-header .inner {
  max-width: 880px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.logo { font-weight: 800; font-size: 1.15rem; color: var(--text); }
.logo span { color: var(--primary); }
.logo:hover { text-decoration: none; }
.site-header nav a { color: var(--muted); font-size: .92rem; margin-left: 14px; }

main { max-width: 880px; margin: 0 auto; padding: 20px 16px 40px; }
h1 { font-size: 1.6rem; margin: 8px 0 6px; line-height: 1.35; }
h2 { font-size: 1.2rem; margin: 32px 0 10px; }
h3 { font-size: 1.05rem; margin: 20px 0 6px; }
.lead { color: var(--muted); margin: 0 0 18px; }
.breadcrumb { font-size: .85rem; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 160px; }
input[type=text], input[type=number], input[type=date], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
textarea { min-height: 220px; resize: vertical; }
.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-group label {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; cursor: pointer; font-weight: 500; margin: 0;
}
.radio-group input { margin: 0; }

.btn {
  display: inline-block; border: 0; cursor: pointer;
  background: var(--primary); color: #fff;
  font: inherit; font-weight: 700;
  padding: 11px 22px; border-radius: 10px;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: var(--accent-bg); color: var(--primary); }

.result {
  background: var(--accent-bg);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 16px;
}
.result .big { font-size: 1.7rem; font-weight: 800; color: var(--primary); line-height: 1.3; }
.result .sub { color: var(--muted); font-size: .92rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat .k { font-size: .82rem; color: var(--muted); }
.stat .v { font-size: 1.3rem; font-weight: 800; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: right; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; }

.content p, .content li { color: var(--text); }
.content ul, .content ol { padding-left: 22px; }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }

.ad-slot { margin: 18px 0; min-height: 0; text-align: center; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tool-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; color: var(--text);
  transition: transform .12s, border-color .12s;
}
.tool-card:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-2px); }
.tool-card .ico { font-size: 1.6rem; }
.tool-card strong { display: block; margin-top: 4px; }
.tool-card p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }

.related { margin-top: 30px; }
.related ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.related a { display: inline-block; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; font-size: .9rem; }

.site-footer { border-top: 1px solid var(--line); background: var(--card); }
.site-footer .inner { max-width: 880px; margin: 0 auto; padding: 22px 16px; color: var(--muted); font-size: .85rem; }
.site-footer a { color: var(--muted); margin-right: 14px; }

/* ===== PDF 도구 ===== */
.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  background: var(--bg); padding: 34px 16px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--accent-bg); }
.dropzone .dz-icon { font-size: 2.2rem; }
.dropzone .dz-title { font-weight: 700; margin-top: 6px; }
.dropzone .dz-sub { color: var(--muted); font-size: .88rem; }
.dropzone input { display: none; }
.privacy-note { color: var(--muted); font-size: .85rem; margin: 10px 0 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.toolbar .info { color: var(--muted); font-size: .9rem; margin-right: auto; }
.btn.small { padding: 7px 14px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.thumb {
  position: relative; background: var(--card); border: 2px solid var(--line);
  border-radius: 10px; padding: 8px; text-align: center; cursor: pointer; user-select: none;
}
.thumb .cv { height: 150px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb canvas, .thumb img { max-width: 100%; max-height: 150px; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: transform .2s; background: #fff; }
.thumb .pn { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.thumb.selected { border-color: var(--primary); background: var(--accent-bg); }
.thumb.removed { opacity: .35; border-color: #e5484d; }
.thumb.removed::after { content: "삭제"; position: absolute; top: 8px; right: 8px; background: #e5484d; color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: 999px; }
.thumb.selected::after { content: "✓"; position: absolute; top: 8px; right: 8px; background: var(--primary); color: #fff; font-size: .8rem; width: 22px; height: 22px; line-height: 22px; border-radius: 50%; }
.thumb .rot-btns { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }
.thumb .rot-btns button { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 8px; padding: 2px 8px; cursor: pointer; font-size: .95rem; }
.file-list { list-style: none; padding: 0; margin: 12px 0; }
.file-list li {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px;
}
.file-list .fl-thumb { width: 44px; height: 56px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: 6px; overflow: hidden; }
.file-list .fl-thumb img, .file-list .fl-thumb canvas { max-width: 44px; max-height: 56px; }
.file-list .fl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.file-list .fl-meta { color: var(--muted); font-size: .8rem; }
.file-list button { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 8px; padding: 4px 9px; cursor: pointer; }
.progress { color: var(--muted); font-size: .9rem; min-height: 1.4em; }
.done-box { background: var(--accent-bg); border-radius: var(--radius); padding: 18px 20px; margin-top: 16px; }
.done-box .big { font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.done-box .next { margin-top: 10px; font-size: .92rem; }
.done-box .next a { display: inline-block; margin: 4px 6px 0 0; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 12px; }
.error-msg { color: #e5484d; font-weight: 600; }

@media (max-width: 560px) {
  h1 { font-size: 1.35rem; }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .tool-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tool-card { padding: 12px; }
  .tool-card .ico { font-size: 1.3rem; }
  .tool-card strong { font-size: .92rem; line-height: 1.35; }
  .tool-card p { font-size: .78rem; line-height: 1.45; }
  .site-header nav { display: none; }
  .result .big { font-size: 1.4rem; }
}
