/* 툴모아 — 공용 스타일 */
:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #1a2233;
  --muted: #5b6779;
  --line: #e3e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff4ff;
  --accent: #059669;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* 헤더 */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .inner {
  max-width: 860px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.logo { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.logo:hover { text-decoration: none; }
.logo .dot { color: var(--primary); }
.gnb { display: flex; gap: 14px; font-size: 14px; flex-wrap: wrap; }
.gnb a { color: var(--muted); font-weight: 500; }
.gnb a:hover { color: var(--primary); text-decoration: none; }

/* 본문 공통 */
main { padding: 28px 0 48px; }
h1 { font-size: 26px; letter-spacing: -0.5px; margin: 0 0 6px; }
.page-desc { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
h2 { font-size: 20px; margin: 36px 0 12px; letter-spacing: -0.3px; }
h3 { font-size: 17px; margin: 24px 0 8px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

/* 폼 */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-left: 4px; }
input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 180px; line-height: 1.7; }

.row { display: flex; gap: 12px; }
.row > .field { flex: 1; }

.radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-group label {
  flex: 1; min-width: 90px;
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 8px; text-align: center; font-size: 14px; font-weight: 600;
  cursor: pointer; background: #fff; color: var(--muted);
  transition: all .15s;
}
.radio-group input { display: none; }
.radio-group input:checked + span { color: var(--primary); }
.radio-group label:has(input:checked) {
  border-color: var(--primary); background: var(--primary-light); color: var(--primary);
}

.btn {
  display: inline-block; width: 100%;
  background: var(--primary); color: #fff;
  border: 0; border-radius: 10px;
  padding: 14px 20px; font-size: 16px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.btn:hover { background: var(--primary-dark); }
.btn-sub {
  background: #fff; color: var(--muted); border: 1.5px solid var(--line);
  width: auto; padding: 10px 16px; font-size: 14px;
}
.btn-sub:hover { background: var(--bg); }

/* 결과 */
.result { display: none; }
.result.show { display: block; }
.result-hero {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff; border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 16px;
}
.result-hero .label { font-size: 14px; opacity: .85; }
.result-hero .value { font-size: 32px; font-weight: 800; letter-spacing: -1px; }
.result-hero .value small { font-size: 18px; font-weight: 600; }

table.result-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.result-table th, table.result-table td {
  padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right;
}
table.result-table th { color: var(--muted); font-weight: 600; text-align: left; }
table.result-table td.strong { font-weight: 700; }
table.result-table tr.total td, table.result-table tr.total th { border-top: 2px solid var(--text); font-weight: 800; }

.scroll-x { overflow-x: auto; }
.scroll-x table { min-width: 520px; }

/* 광고 슬롯 (승인 후 코드 삽입) */
.ad-slot {
  margin: 24px 0; min-height: 100px;
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #f2f5f9, #f2f5f9 10px, #eef1f6 10px, #eef1f6 20px);
  border: 1px dashed var(--line); border-radius: 10px;
  color: #aab4c2; font-size: 12px;
}

/* 홈 그리드 */
.tool-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.tool-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  color: var(--text); display: block;
  transition: transform .12s, border-color .12s;
}
.tool-card:hover { transform: translateY(-2px); border-color: var(--primary); text-decoration: none; }
.tool-card .emoji { font-size: 26px; }
.tool-card .name { font-weight: 700; font-size: 16px; margin: 8px 0 4px; }
.tool-card .desc { font-size: 13.5px; color: var(--muted); }

.section-title { font-size: 18px; font-weight: 800; margin: 32px 0 14px; }

/* SEO 콘텐츠 영역 */
.content { font-size: 15px; color: #333f52; }
.content ul, .content ol { padding-left: 22px; }
.content li { margin-bottom: 6px; }
.notice {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
  padding: 12px 16px; font-size: 13.5px; color: #92400e; margin: 16px 0;
}

/* 관련 도구 */
.related { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.related a {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font-size: 13.5px; font-weight: 600; color: var(--text);
}
.related a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* 제휴 오퍼 카드 (계산 결과 하단) */
.partner-card { border-color: #c7d7f5; background: #fbfdff; }
.partner-head { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.partner-offer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px;
  background: #fff; color: var(--text);
  transition: border-color .12s, transform .12s;
}
.partner-offer:hover { border-color: var(--primary); transform: translateY(-1px); text-decoration: none; }
.po-title { font-weight: 700; font-size: 14.5px; }
.po-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.po-btn {
  flex-shrink: 0; background: var(--primary); color: #fff;
  border-radius: 8px; padding: 9px 14px; font-size: 13px; font-weight: 700;
  white-space: nowrap;
}
.partner-offer:hover .po-btn { background: var(--primary-dark); }
.partner-disclosure { font-size: 11.5px; color: #9aa4b4; margin-top: 6px; }

@media (max-width: 640px) {
  .partner-offer { flex-direction: column; align-items: stretch; text-align: left; }
  .po-btn { text-align: center; }
}

/* 푸터 */
.site-footer {
  border-top: 1px solid var(--line); background: var(--card);
  padding: 28px 0; font-size: 13px; color: var(--muted);
}
.site-footer .inner { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.site-footer a { color: var(--muted); margin-right: 14px; }

/* 글자수 카운터 */
.counter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.counter-box {
  background: var(--primary-light); border-radius: 10px; padding: 14px; text-align: center;
}
.counter-box .num { font-size: 22px; font-weight: 800; color: var(--primary-dark); }
.counter-box .lbl { font-size: 12.5px; color: var(--muted); }

@media (max-width: 640px) {
  .tool-grid { grid-template-columns: 1fr; }
  .counter-grid { grid-template-columns: repeat(2, 1fr); }
  .row { flex-direction: column; gap: 0; }
  h1 { font-size: 22px; }
  .result-hero .value { font-size: 26px; }
}
