/* 자체 호스팅 서브셋 폰트 — 외부 CDN 의존 없음
   local() 을 먼저 두어, 사용자 PC에 Pretendard 가 이미 있으면 내려받지 않음 */
@font-face {
  font-family: 'Pretendard';
  font-weight: 400;
  font-display: swap;
  src: local('Pretendard Regular'),
       url('/assets/fonts/Pretendard-Regular.subset.woff2') format('woff2');
}
@font-face {
  font-family: 'Pretendard';
  font-weight: 700;
  font-display: swap;
  src: local('Pretendard Bold'),
       url('/assets/fonts/Pretendard-Bold.subset.woff2') format('woff2');
}
/* 500·900 을 요청하면 브라우저가 가장 가까운 실제 굵기(400·700)를 씁니다.
   가짜로 굵게 그리는 합성이 아니라 진짜 폰트라서 품질 저하가 없습니다. */

:root {
  --ink: #171a21;
  --ink-soft: #5b6270;
  --hero-sub: #454b58;
  --paper: #ffffff;
  --surface: #f4f6f8;
  --border: #e2e6eb;
  --accent: #0e9b6b;
  --accent-hover: #0c8259;
  --accent-soft: #e3f7ef;
  --danger: #b91c1c;
  /* 조견표 위험 단계 색상 — 계산기 결과 카드(lv-*)와 같은 계열 */
  --lv-ok: #0e9b6b;
  --lv-mild: #185fa5;
  --lv-caution: #a16207;
  --lv-warn: #b4530f;
  --lv-danger: #b91c1c;
  --grid-line: rgba(23,26,33,0.055);
  --grid-line-strong: rgba(23,26,33,0.09);
  --glow: rgba(14,155,107,0.18);
  --font-main: 'Pretendard', -apple-system, 'Malgun Gothic', 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef0f3; --ink-soft: #9aa2b1; --hero-sub: #c7cdd6;
    --paper: #12141a; --surface: #1a1d25; --border: #2b2f3a;
    --accent: #2fd08f; --accent-hover: #45db9c; --accent-soft: #12332a;
    --danger: #f87171;
    --lv-ok: #2fd08f; --lv-mild: #7ab6f0; --lv-caution: #dcae5a;
    --lv-warn: #f0a06a; --lv-danger: #f87171;
    --grid-line: rgba(238,240,243,0.06); --grid-line-strong: rgba(238,240,243,0.1);
    --glow: rgba(47,208,143,0.18);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  /* 배경 글로우 같은 장식 레이어가 가로 스크롤을 만들지 않도록 잘라낸다.
     hidden 과 달리 clip 은 스크롤 컨테이너를 만들지 않아 sticky 요소에 영향이 없다. */
  overflow-x: clip;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-strong) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px, 140px 140px, 140px 140px;
  background-position: -1px -1px;
}

button, input, select { font-family: var(--font-main); }
a { color: var(--accent); }

/* ---------------- 헤더 ---------------- */
.spt-header {
  border-bottom: 1px solid var(--border);
  background: var(--paper);
}
.spt-header-inner {
  max-width: 940px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.spt-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.spt-logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
}
.spt-nav { display: flex; gap: 20px; }
.spt-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}
.spt-nav a:hover { color: var(--accent); }

/* ---------------- 히어로 ---------------- */
.spt-hero {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 20px 10px;
  text-align: center;
}
.spt-hero h1 {
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin: 0 0 14px;
}
.spt-hero h1 em { font-style: normal; color: var(--accent); }
.spt-hero p {
  color: var(--hero-sub);
  font-weight: 500;
  font-size: 17px;
  margin: 0;
}

/* ---------------- 홈 카드 목록 ---------------- */
.spt-list {
  position: relative;
  max-width: 940px;
  margin: 40px auto 0;
  padding: 0 20px;
}
.spt-list::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -40px;
  transform: translateX(-50%);
  width: 940px;
  /* 부모 폭을 넘지 않게 한다. 100vw 는 스크롤바 폭까지 포함해서
     스크롤바가 보이는 창에서 가로 스크롤을 만들기 때문에 쓰지 않는다. */
  max-width: 100%;
  height: 460px;
  background: radial-gradient(ellipse at center, var(--glow), rgba(0,0,0,0) 68%);
  pointer-events: none;
  z-index: -1;
}
.spt-section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  margin: 0 0 14px;
}
.spt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}
.spt-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(23,26,33,0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.spt-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(23,26,33,0.09);
}
.spt-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.spt-card h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.spt-card p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.spt-card-go { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 700; color: var(--accent); }
.spt-card.is-soon {
  background: var(--surface);
  border-style: dashed;
  cursor: default;
}
.spt-card.is-soon .spt-card-icon { background: var(--border); color: var(--ink-soft); }
.spt-card.is-soon h3 { color: var(--ink-soft); }
.spt-soon-badge { margin-top: auto; padding-top: 6px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }

/* ---------------- 계산기 위젯 컨테이너 ---------------- */
.spt-tool-wrap {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 32px auto 0;
  padding: 0 20px;
}
.spt-tool-wrap::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 940px;
  /* 부모 폭을 넘지 않게 한다. 100vw 는 스크롤바 폭까지 포함해서
     스크롤바가 보이는 창에서 가로 스크롤을 만들기 때문에 쓰지 않는다. */
  max-width: 100%;
  height: 520px;
  background: radial-gradient(ellipse at center, var(--glow), rgba(0,0,0,0) 68%);
  pointer-events: none;
  z-index: -1;
}

/* ---------------- 광고 자리 ---------------- */
.spt-ad-slot {
  position: relative;
  z-index: 1;
  max-width: 940px;
  margin: 36px auto;
  padding: 0 20px;
}
.spt-ad-inner {
  min-height: 100px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 12px;
  background: var(--paper);
}

/* ---------------- 본문 설명 ---------------- */
.spt-explainer {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 8px auto 48px;
  padding: 0 20px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.85;
}
.spt-explainer h2 {
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  margin: 36px 0 14px;
}
.spt-explainer h2:first-child { margin-top: 0; }
/* 홈에서는 카드 목록 아래에 놓이므로 위쪽 여백을 더 준다 */
.spt-explainer--home { margin-top: 48px; }
.spt-explainer h3 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 10px;
}
.spt-explainer strong { color: var(--ink); }
.spt-explainer ul { padding-left: 20px; }
.spt-explainer li { margin-bottom: 6px; }

/* ---------------- 본문 참조표 (변환표 등) ---------------- */
.spt-table-wrap {
  margin: 18px 0 10px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--paper);
  -webkit-overflow-scrolling: touch;
}
.spt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.6;
}
.spt-table th {
  text-align: left;
  padding: 11px 16px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.spt-table td {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-soft);
  white-space: nowrap;
}
.spt-table td:first-child { color: var(--ink); font-weight: 700; }
.spt-table tbody tr:last-child td { border-bottom: 0; }
.spt-table tbody tr:hover td { background: var(--accent-soft); }
.spt-table-cap {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 4px;
}
/* 조견표 — 가로·세로축이 있는 격자형 */
.spt-table--grid th,
.spt-table--grid td { text-align: center; padding: 9px 12px; }
.spt-table--grid th:first-child,
.spt-table--grid td:first-child { text-align: left; }
.spt-table .lv-ok      { color: var(--lv-ok); font-weight: 600; }
.spt-table .lv-mild    { color: var(--lv-mild); font-weight: 600; }
.spt-table .lv-caution { color: var(--lv-caution); font-weight: 700; }
.spt-table .lv-warn    { color: var(--lv-warn); font-weight: 700; }
.spt-table .lv-danger  { color: var(--lv-danger); font-weight: 700; }

/* 설명문이 들어가는 표 — 첫 열(라벨)만 한 줄로 두고 나머지는 줄바꿈을 허용해
   모바일에서 표가 옆으로 길어지는 것을 막는다 */
.spt-table--desc th:not(:first-child),
.spt-table--desc td:not(:first-child) { white-space: normal; }

/* 조견표 범례 */
.spt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.5;
}
.spt-legend li { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ink-soft); }
.spt-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.spt-legend i.lv-ok      { background: var(--lv-ok); }
.spt-legend i.lv-mild    { background: var(--lv-mild); }
.spt-legend i.lv-caution { background: var(--lv-caution); }
.spt-legend i.lv-warn    { background: var(--lv-warn); }
.spt-legend i.lv-danger  { background: var(--lv-danger); }

@media (max-width: 640px) {
  .spt-table { font-size: 14px; }
  .spt-table th { padding: 10px 12px; }
  .spt-table td { padding: 8px 12px; }
  .spt-table--grid th,
  .spt-table--grid td { padding: 8px 9px; }
}

/* ---------------- 자주 묻는 질문 ---------------- */
.spt-faq {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto 48px;
  padding: 0 20px;
}
.spt-faq-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 18px;
}
.spt-faq-item {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 12px;
}
.spt-faq-item:last-child { margin-bottom: 0; }
.spt-faq-item h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 8px;
}
.spt-faq-item p {
  margin: 0;
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-soft);
}
@media (max-width: 640px) {
  .spt-faq-item { padding: 16px 18px; }
  .spt-faq-title { font-size: 20px; }
}

/* ---------------- 가이드 글 ---------------- */
.spt-article {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 40px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.9;
}
.spt-article-head { margin-bottom: 36px; }
.spt-article-cat {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 10px;
}
.spt-article-cat a { color: var(--accent); text-decoration: none; }
.spt-article h1 {
  font-size: clamp(28px, 4.5vw, 38px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.35;
  margin: 0 0 18px;
}
.spt-article-lead {
  font-size: 17px;
  line-height: 1.85;
  color: var(--hero-sub);
  margin: 0;
  padding: 18px 20px;
  background: var(--surface);
  border-radius: 12px;
}
.spt-article h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 48px 0 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.spt-article h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 30px 0 10px;
}
.spt-article p { margin: 0 0 18px; color: var(--ink-soft); }
.spt-article strong { color: var(--ink); font-weight: 700; }
.spt-article a { color: var(--accent); }
.spt-article ul, .spt-article ol { margin: 0 0 18px; padding-left: 22px; color: var(--ink-soft); }
.spt-article li { margin-bottom: 10px; }
.spt-formula {
  background: var(--accent-soft);
  color: var(--accent) !important;
  font-weight: 700;
  font-size: 18px;
  text-align: center;
  padding: 20px;
  border-radius: 12px;
  margin: 0 0 22px !important;
}
.spt-inline-cta {
  margin: 26px 0 !important;
  padding: 16px 20px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
}
.spt-inline-cta a { font-weight: 700; text-decoration: none; }
.spt-article-note {
  margin-top: 40px !important;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.75;
}

/* ---------------- 개발기 본문 요소 ---------------- */
.spt-quote {
  margin: 0 0 22px !important;
  padding: 18px 22px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  font-size: 17px;
  line-height: 1.75;
  font-weight: 700;
  color: var(--ink) !important;
}
.spt-code {
  margin: 0 0 22px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  max-width: 100%;
}
.spt-code code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-soft);
  white-space: pre;
}
.spt-article :not(pre) > code {
  padding: 2px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--ink);
}
.spt-article ol.spt-numbered { padding-left: 20px; }
.spt-article ol.spt-numbered li { margin-bottom: 12px; line-height: 1.8; }

/* ---------------- 개발기 이전/다음 글 ---------------- */
.spt-postnav {
  max-width: 820px;
  margin: 0 auto 48px;
  padding: 0 20px;
}
.spt-postnav-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
}
.spt-postnav-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.spt-postnav-link {
  display: block;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color .15s ease;
}
.spt-postnav-link:hover { border-color: var(--accent); }
.spt-postnav-dir {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}
.spt-postnav-link strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--ink);
}
.spt-postnav-all { margin: 16px 0 0; font-size: 14px; }
.spt-postnav-all a { color: var(--accent); text-decoration: none; font-weight: 700; }

@media (max-width: 640px) {
  .spt-code code { font-size: 12.5px; }
  .spt-quote { font-size: 16px; padding: 16px 18px; }
}

/* ---------------- 함께 쓰면 좋은 계산기 ---------------- */
.spt-related {
  max-width: 820px;
  margin: 0 auto 48px;
  padding: 0 20px;
}
.spt-related-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 14px;
}
.spt-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.spt-related-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.spt-related-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.spt-related-icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}
.spt-related-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.spt-related-body strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.spt-related-body span {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ---------------- 푸터 ---------------- */
.spt-footer-links {
  max-width: 940px;
  margin: 44px auto 0;
  padding: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}
.spt-footer-links a {
  font-size: 12px;
  color: var(--ink-soft);
  text-decoration: none;
}
.spt-footer-links a:hover { color: var(--accent); }
.spt-footer-copy {
  text-align: center;
  font-size: 11px;
  color: var(--ink-soft);
  padding: 0 20px 32px;
  margin: 0;
}

/* =========================================================
   계산기 공통 UI
   ========================================================= */
.calc-hint {
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
  margin: 0 0 14px;
}
.calc-board {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 1px 2px rgba(23,26,33,0.04), 0 10px 28px rgba(23,26,33,0.08);
}
.calc-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.calc-go-wrap { display: flex; justify-content: center; margin-top: 28px; }
.calc-go {
  height: 58px;
  padding: 0 52px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(14,155,107,0.32);
  transition: background 0.15s ease, transform 0.1s ease;
}
.calc-go:hover { background: var(--accent-hover); }
.calc-go:active { transform: translateY(1px); }

.calc-result { margin-top: 28px; }
/* 자바스크립트가 꺼져 있을 때 계산기 자리에 표시되는 안내 */
.calc-noscript {
  margin: 0;
  padding: 28px 24px;
  background: var(--paper);
  border: 1px dashed var(--border);
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-soft);
  text-align: center;
}
.calc-noscript strong { color: var(--ink); }

.calc-error { color: var(--danger); font-weight: 600; font-size: 16px; margin: 0; }
.calc-note {
  margin: 14px 0 0;
  padding: 12px 16px;
  background: rgba(185, 28, 28, 0.06);
  border: 1px solid rgba(185, 28, 28, 0.25);
  border-radius: 10px;
  font-size: 14px;
  color: var(--danger);
}

/* 날짜 입력 (생활 계산기) */
.rc-pair input[type="date"] {
  width: auto;
  min-width: 160px;
  font-size: 17px;
  font-weight: 600;
}

/* 금액 입력 (퇴직금 계산기) — 넓은 칸 + 한글 단위 표시 */
.rc-pair input.sv-money {
  width: 240px;
  font-size: 22px;
  text-align: right;
  padding-right: 6px;
}
.sv-unit {
  display: block;
  min-height: 15px;
  line-height: 1.2;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
  padding-right: 6px;
}
@media (max-width: 640px) {
  .rc-pair input.sv-money { width: 100%; min-width: 200px; }
}

/* 결과 카드 상태별 색상 (BMI·체감온도) */
.calc-answer-card.bmi-under,
.calc-answer-card.lv-mild   { background: #e6f1fb; }
.calc-answer-card.bmi-under .calc-answer-big,
.calc-answer-card.lv-mild .calc-answer-big { color: #185fa5; }

.calc-answer-card.bmi-normal,
.calc-answer-card.lv-ok     { background: var(--accent-soft); }

.calc-answer-card.bmi-over,
.calc-answer-card.lv-caution { background: #fdf3dd; }
.calc-answer-card.bmi-over .calc-answer-big,
.calc-answer-card.lv-caution .calc-answer-big { color: #a16207; }

.calc-answer-card.bmi-obese1,
.calc-answer-card.lv-warn   { background: #fbe9dd; }
.calc-answer-card.bmi-obese1 .calc-answer-big,
.calc-answer-card.lv-warn .calc-answer-big { color: #b4530f; }

.calc-answer-card.bmi-obese2,
.calc-answer-card.bmi-obese3,
.calc-answer-card.lv-danger { background: #fbe6e6; }
.calc-answer-card.bmi-obese2 .calc-answer-big,
.calc-answer-card.bmi-obese3 .calc-answer-big,
.calc-answer-card.lv-danger .calc-answer-big { color: #b91c1c; }

.bmi-verdict, .fl-verdict { font-weight: 700; color: var(--ink) !important; }
.fl-desc { background: var(--surface); border-color: var(--border); color: var(--ink-soft); }

/* BMI 지표 막대 */
.bmi-bar-wrap { margin-top: 20px; }
.bmi-bar {
  position: relative;
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
}
.bmi-seg { display: block; height: 100%; }
.bmi-seg.s-under  { width: 14%; background: #85b7eb; }
.bmi-seg.s-normal { width: 18%; background: #5dcaa5; }
.bmi-seg.s-over   { width: 8%;  background: #efc06b; }
.bmi-seg.s-obese  { width: 60%; background: #e88b6b; }
.bmi-marker {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 20px;
  background: var(--ink);
  border-radius: 2px;
  transform: translateX(-2px);
}
.bmi-scale {
  display: flex;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.bmi-scale span { flex: none; }
.bmi-scale span:nth-child(1) { width: 14%; text-align: right; }
.bmi-scale span:nth-child(2) { width: 18%; text-align: right; }
.bmi-scale span:nth-child(3) { width: 8%;  text-align: right; }
.bmi-scale span:nth-child(4) { width: 20%; text-align: right; }

/* 에어컨 시뮬레이터 */
.ac-group { margin-bottom: 22px; }
.ac-group:last-of-type { margin-bottom: 0; }
.ac-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
}
.ac-label strong { color: var(--accent); }
.ac-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-opts .calc-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ac-opt-desc { font-size: 11px; font-weight: 500; opacity: 0.75; }
.ac-help { font-size: 12px; color: var(--ink-soft); margin: 8px 0 0; }
.ac-result-label {
  display: block;
  width: 100%;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 2px;
}
#ac-hours {
  width: 100%;
  accent-color: var(--accent);
  height: 32px;
}

/* 수수료 계산기 — 요율 프리셋 */
.rc-pair input.fee-rate {
  width: 140px;
  font-size: 22px;
  text-align: right;
  padding-right: 6px;
}
.fee-presets {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}
.fee-preset-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-right: 4px;
}
.fee-preset {
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.fee-preset:hover { border-color: var(--accent); color: var(--accent); }

/* 윤달 체크박스 (음력 변환기) */
.lc-leap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.lc-leap input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* 주기 예측 표 (배란일 계산기) */
.ov-table-wrap { margin-top: 20px; overflow-x: auto; }
.ov-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.ov-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ov-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-soft);
  white-space: nowrap;
}
.ov-table td strong { color: var(--accent); }
.ov-table tr:last-child td { border-bottom: 0; }
.calc-answer-card {
  background: var(--accent-soft);
  border-radius: 16px;
  padding: 28px 32px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.calc-answer-big {
  font-size: 48px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.calc-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.calc-chip {
  font-size: 13px;
  font-weight: 600;
  background: var(--paper);
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.calc-steps {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
/* 본문을 flex 아이템으로 쪼개면 <sup>·<strong> 같은 인라인 요소마다 gap 이 벌어지고
   줄바꿈도 되지 않는다. 블록으로 두고 번호 배지만 인라인으로 띄운다. */
.calc-steps li {
  counter-increment: step;
  display: block;
  padding: 10px 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  border-top: 1px solid var(--border);
}
.calc-steps li:first-child { border-top: 0; }
.calc-steps li::before {
  content: counter(step);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -4px;
  margin-right: 10px;
}

/* 탭 */
.calc-tabs {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.calc-tab {
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.calc-tab:hover { border-color: var(--accent); color: var(--accent); }
.calc-tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* =========================================================
   분수 계산기
   ========================================================= */
.fc-frac-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.fc-frac-card input {
  border: none;
  background: transparent;
  text-align: center;
  font-weight: 700;
  color: var(--ink);
  outline: none;
}
.fc-whole {
  width: 92px;
  height: 64px;
  font-size: 24px;
  border-right: 1px solid var(--border) !important;
  padding-right: 14px;
  margin-right: 2px;
}
.fc-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.fc-stack::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  top: 50%;
  height: 2px;
  background: var(--ink);
}
.fc-stack input { width: 92px; height: 30px; font-size: 20px; }
.fc-op {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

/* =========================================================
   비율 계산기
   ========================================================= */
.rc-pair {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
}
.rc-pair input {
  width: 92px;
  height: 46px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  outline: none;
}
.rc-pair input::placeholder { color: var(--ink-soft); opacity: 0.55; }
.rc-labeled { flex-direction: column; align-items: stretch; gap: 2px; padding: 8px 16px 10px; }
.rc-field-label {
  font-size: 11px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
  text-align: center;
}
.rc-colon { font-size: 24px; font-weight: 800; color: var(--ink-soft); }
.rc-equals { font-size: 26px; font-weight: 800; color: var(--accent); }
.rc-slash { color: var(--ink-soft); font-weight: 700; }

/* =========================================================
   반응형
   ========================================================= */
@media (max-width: 640px) {
  .calc-board { padding: 22px 16px; border-radius: 16px; }
  .calc-row { gap: 12px; }
  .calc-go { width: 100%; }
  .calc-answer-card { flex-direction: column; align-items: flex-start; gap: 12px; padding: 22px 20px; }
  .calc-answer-big { font-size: 40px; }
  .fc-frac-card { justify-content: center; padding: 12px; gap: 8px; }
  .fc-whole { width: 72px; padding-right: 10px; }
  .fc-stack input { width: 72px; }
  .rc-pair { padding: 12px; gap: 8px; }
  .rc-pair input { width: 72px; }
  /* 숫자 4칸이 한 줄에 들어가는 입력(최소공배수) — 좁은 화면에서 칸을 줄여 넘침을 막는다 */
  .rc-pair.rc-quad { padding: 10px; gap: 5px; }
  .rc-pair.rc-quad input { width: 56px; font-size: 20px; }
  .rc-pair.rc-quad .rc-colon { font-size: 18px; }
}
@media (max-width: 560px) {
  .spt-grid { grid-template-columns: 1fr; }
  .spt-nav { gap: 14px; }
}
