/* KoreaUtil 사이트 스타일 — Graphite 디자인 토큰 계승 */
@font-face {
  font-family: "Pretendard Variable";
  src: url("/assets/fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Michroma";
  src: url("/assets/fonts/Michroma-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --maxw: 1180px;
  --header-h: 64px;
  --accent: hsl(72.9 100% 50.8%);
  --accent-ink: #101010;
  --r-card: 20px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

html { scroll-padding-top: calc(var(--header-h) + 16px); height: auto; overflow-x: clip; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  height: auto;
  overflow: visible;
  overflow-x: clip;
  background: var(--page-bg);
  color: var(--body-text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
input, select, textarea, button { font-family: inherit; letter-spacing: inherit; }
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle at 1px 1px, var(--color-border-subtle) 1px, transparent 0);
  background-size: 22px 22px;
  opacity: .55;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 42%);
}
:root[data-theme="dark"] body::before, html.dark body::before { opacity: .5; }

a { color: inherit; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in oklab, var(--page-bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--color-border-primary-surface);
}
.site-header__in { height: 100%; display: flex; align-items: center; gap: 20px; min-width: 0; }
.brand { display: flex; align-items: baseline; gap: 9px; text-decoration: none; flex-shrink: 0; }
.brand__mark {
  font-family: "Michroma", var(--font-sans);
  font-size: 19px; letter-spacing: .16em; line-height: 1;
  color: var(--heading-color);
}
.brand__dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 2px; transform: translateY(-4px); }
.brand__sub { font-size: 11px; letter-spacing: .14em; color: var(--color-text-secondary); text-transform: uppercase; }
.site-nav { display: flex; align-items: center; gap: 0; margin-left: 4px; min-width: 0; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  padding: 7px 9px; border-radius: 999px; font-size: 13px; color: var(--color-text-secondary);
  white-space: nowrap; transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--color-background-primary-soft-alpha); color: var(--color-text); }
.site-nav a[aria-current="page"] { background: var(--color-background-primary-soft); color: var(--color-text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; min-width: 0; }
.lang-switch {
  display: inline-flex; align-items: center; justify-content: center; height: 32px; min-width: 34px; padding: 0 8px;
  border-radius: 999px; border: 1px solid var(--color-border); font-size: 12px; letter-spacing: .04em;
  color: var(--color-text-secondary); text-decoration: none; flex-shrink: 0;
}
.lang-switch:hover { color: var(--color-text); border-color: var(--color-text-secondary); }
.icon-btn {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--color-text-secondary); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--color-background-primary-soft-alpha); color: var(--color-text); }
.icon-btn svg { width: 17px; height: 17px; }
[data-icon="sun"] { display: var(--lt, block) var(--dk, none); }
[data-icon="moon"] { display: var(--lt, none) var(--dk, block); }
@media (min-width: 1121px) {
  .site-header__in > .header-actions { margin-left: 12px; }
  .brand__sub { display: none; }
}
@media (max-width: 1500px) {
  .site-nav a { padding: 7px 6px; font-size: 12.5px; }
  .site-nav { gap: 0; }
  .site-nav { overflow-x: auto; scrollbar-width: none; }
}
@media (max-width: 1320px) { .site-nav a { padding: 7px 4px; font-size: 12px; } }
@media (max-width: 1120px) { .site-nav { display: none; } }

/* 모바일 헤더: 2줄 (브랜드+버튼 / 검색) — 390px에서도 절대 잘리지 않게 */
@media (max-width: 700px) {
  .site-header { height: auto; }
  .site-header .site-header__in {
    flex-wrap: wrap; align-items: center; gap: 8px 10px;
    padding-top: 9px; padding-bottom: 9px; min-height: 0;
  }
  .site-header .brand { order: 1; min-width: 0; }
  .site-header .brand__mark { font-size: 17px; letter-spacing: .14em; }
  .site-header .header-actions { display: contents; }
  .site-header .lang-switch { order: 2; margin-left: auto; height: 30px; min-width: 32px; }
  .site-header .icon-btn { order: 3; width: 32px; height: 32px; }
  .site-header .search-wrap { order: 4; flex: 1 1 100%; width: 100%; max-width: none; min-width: 0; }
  .site-header .search-input { height: 36px; font-size: 13.5px; }
}
@media (max-width: 380px) {
  .site-header .brand__mark { font-size: 16px; letter-spacing: .10em; }
  .site-header .site-header__in { gap: 6px 8px; }
}
@media (max-width: 640px) { .brand__sub { display: none; } }

/* ---------- 검색 ---------- */
.search-wrap { position: relative; flex: 0 1 250px; min-width: 120px; max-width: 250px; }
.search-input {
  width: 100%; height: 38px; border-radius: 999px; border: 1px solid var(--color-border);
  background: var(--color-surface-secondary); padding: 0 14px 0 36px; font-size: 14px; color: var(--color-text);
  transition: border-color .15s, background .15s;
}
.search-input::placeholder { color: var(--color-text-secondary); }
.search-input:focus { outline: none; border-color: var(--color-text-secondary); background: var(--color-surface); }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--color-text-secondary); pointer-events: none; }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; padding: 6px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px;
  box-shadow: var(--shadow); display: none; max-height: 380px; overflow: auto; z-index: 60;
}
body.search-open .search-results, .search-results:focus-within { display: block; }
.search-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-size: 14px; }
.search-item:hover { background: var(--color-background-primary-soft); }
.search-item__cat { font-size: 11px; color: var(--color-text-secondary); min-width: 62px; }
.search-item__title { color: var(--color-text); }
.search-empty { padding: 14px; font-size: 13px; color: var(--color-text-secondary); }
@media (max-width: 640px) { .search-wrap { max-width: none; } }

/* ---------- 버튼·배지 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: 10px; font-size: 14px; font-weight: 500;
  background: var(--app-primary); color: var(--app-primary-foreground);
  transition: opacity .15s, background .15s, transform .1s;
}
.btn:hover { opacity: .86; }
.btn:active { transform: scale(.985); }
.btn--ghost { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.btn--ghost:hover { background: var(--color-background-primary-soft-alpha); opacity: 1; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 11.5px; letter-spacing: .02em;
  border: 1px solid var(--color-border); color: var(--color-text-secondary);
  background: var(--color-surface);
}
.badge--dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* ---------- 히어로 ---------- */
.hero { padding: 76px 0 44px; }
.hero__eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--color-text-secondary); }
.hero h1 {
  font-size: clamp(34px, 5.4vw, 62px); line-height: 1.08; letter-spacing: -.01em;
  font-weight: 600; color: var(--heading-color); margin: 20px 0 18px; max-width: 24ch;
}
.hero h1 em { font-style: normal; color: var(--color-text-secondary); }
.hero__lead { max-width: 60ch; color: var(--color-text-secondary); font-size: 16.5px; line-height: 1.7; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 30px; }
.hero__stat { display: flex; align-items: baseline; gap: 7px; }
.hero__stat b { font-family: var(--font-mono); font-size: 19px; color: var(--color-text); font-weight: 500; }
.hero__stat span { font-size: 12.5px; color: var(--color-text-secondary); }

/* ---------- 카테고리 칩 ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 0 26px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px;
  border: 1px solid var(--color-border); border-radius: 999px; font-size: 13.5px;
  color: var(--color-text-secondary); background: transparent; transition: all .15s;
}
.chip:hover { color: var(--color-text); border-color: var(--color-text-secondary); }
.chip[aria-current="page"], .chip.is-on { background: var(--color-text); color: var(--page-bg); border-color: var(--color-text); }
.chip small { font-family: var(--font-mono); font-size: 11px; opacity: .65; }

/* ---------- 도구 그리드 ---------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 18px 0 20px; }
.section-head h2 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; color: var(--heading-color); }
.section-head p { font-size: 13px; color: var(--color-text-secondary); margin-top: 4px; }
.cat-block { margin-bottom: 54px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 12px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 20px 18px 18px; border: 1px solid var(--color-border); border-radius: var(--r-card);
  background: var(--color-surface); text-decoration: none; overflow: hidden;
  transition: border-color .18s var(--ease), transform .18s var(--ease), background .18s;
}
.tool-card::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .2s;
  background: var(--card-gradient-hover); pointer-events: none;
}
.tool-card:hover { border-color: var(--color-text-secondary); transform: translateY(-2px); }
.tool-card:hover::after { opacity: 1; }
.tool-card__cat { font-size: 11.5px; letter-spacing: .04em; color: var(--color-text-secondary); }
.tool-card h3 { font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; color: var(--color-text); }
.tool-card p { font-size: 13px; line-height: 1.55; color: var(--color-text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-card__go { margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--color-text-secondary); display: flex; align-items: center; gap: 5px; }
.tool-card:hover .tool-card__go { color: var(--color-text); }
.tool-card--sm h3 { font-size: 14.5px; }

/* ---------- 도구 페이지 ---------- */
.tool-head { padding: 40px 0 22px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--color-text-secondary); }
.crumbs a:hover { color: var(--color-text); }
.crumbs svg { width: 12px; height: 12px; opacity: .6; }
.tool-head h1 { font-size: clamp(27px, 3.6vw, 40px); line-height: 1.2; letter-spacing: -.01em; font-weight: 600; margin: 14px 0 10px; color: var(--heading-color); }
.tool-head__desc { color: var(--color-text-secondary); max-width: 72ch; font-size: 15.5px; }
.tool-head__meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }

.calc {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0;
  border: 1px solid var(--color-border); border-radius: 24px; overflow: hidden;
  background: var(--color-surface); box-shadow: var(--shadow-hairline, none);
  margin: 6px 0 42px;
}
.calc__form { padding: 22px; border-right: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 16px; background: var(--color-surface-secondary); }
.calc__result { padding: 22px; min-height: 260px; display: flex; flex-direction: column; gap: 16px; background: var(--color-surface); }
@media (max-width: 860px) {
  .calc { grid-template-columns: 1fr; }
  .calc__form { border-right: 0; border-bottom: 1px solid var(--color-border); }
}

.field label, .field__label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--color-text-secondary); margin-bottom: 7px; }
.field__label b { font-weight: 500; color: var(--color-text); }
.field__hint { font-size: 11.5px; color: var(--color-text-secondary); opacity: .8; }
.input, .field input[type="text"], .field input[type="number"], .field input[type="date"], .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: 11px;
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text); font-size: 15.5px; font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field textarea { font-size: 13.5px; line-height: 1.6; font-family: var(--font-mono); resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--color-text-secondary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-text) 9%, transparent);
}
.field input[type="date"] { color-scheme: dark; }
:root[data-theme="light"] .field input[type="date"] { color-scheme: light; }
.field select { appearance: none; background-image: var(--select-chevron); background-repeat: no-repeat; background-position: right 13px center; background-size: 11px 6px; padding-right: 38px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
.field label.check { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin: 0; min-height: 32px; font-size: 13.5px; color: var(--color-text); cursor: pointer; }
.field label.check input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; flex-shrink: 0; border: 1px solid var(--color-border); border-radius: 5px; background: var(--color-surface); position: relative; cursor: pointer; }
.field label.check input:checked { background: var(--color-text); border-color: var(--color-text); }
.field label.check input:checked::after { content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px; border-right: 2px solid var(--page-bg); border-bottom: 2px solid var(--page-bg); transform: rotate(45deg); }
.field label.check .field__hint { margin-left: auto; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick button {
  height: 27px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--color-border);
  font-size: 11.5px; color: var(--color-text-secondary); background: var(--color-surface);
}
.quick button:hover { color: var(--color-text); border-color: var(--color-text-secondary); }
.seg { display: flex; padding: 3px; gap: 3px; border-radius: 10px; background: var(--color-background-primary-soft); }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: flex; align-items: center; justify-content: center; height: 34px; border-radius: 8px;
  font-size: 13px; color: var(--color-text-secondary); cursor: pointer; transition: all .15s; white-space: nowrap;
}
.seg input:checked + span { background: var(--color-surface); color: var(--color-text); box-shadow: 0 1px 2px rgb(0 0 0 / .18); font-weight: 500; }
.calc__actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.calc__actions .btn { flex: 1; }

/* 결과 */
.res-primary { display: flex; flex-wrap: wrap; gap: 14px 28px; padding-bottom: 16px; border-bottom: 1px dashed var(--color-border); }
.res-primary__item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.res-primary__label { font-size: 12.5px; color: var(--color-text-secondary); }
.res-primary__value { font-family: var(--font-mono); font-size: clamp(24px, 3.4vw, 34px); font-weight: 500; letter-spacing: -.01em; color: var(--color-text); line-height: 1.15; }
.res-primary__sub { font-size: 12px; color: var(--color-text-secondary); }
.res-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--color-border); border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; }
.res-stats > div { background: var(--color-surface); padding: 11px 13px; display: flex; flex-direction: column; gap: 3px; }
.res-stats dt { font-size: 11.5px; color: var(--color-text-secondary); }
.res-stats dd { font-size: 14.5px; font-variant-numeric: tabular-nums; color: var(--color-text); }
@media (max-width: 340px) { .res-stats { grid-template-columns: 1fr; } }
.res-bars { display: flex; flex-direction: column; gap: 10px; }
.res-bar__top { display: flex; justify-content: space-between; font-size: 12px; color: var(--color-text-secondary); margin-bottom: 5px; }
.res-bar__top b { color: var(--color-text); font-variant-numeric: tabular-nums; font-weight: 500; }
.res-bar__track { height: 7px; border-radius: 999px; background: var(--color-background-primary-soft); overflow: hidden; }
.res-bar__track i { display: block; height: 100%; border-radius: 999px; background: var(--color-text); opacity: .78; }
.res-table { overflow: auto; border: 1px solid var(--color-border); border-radius: 12px; max-height: 360px; }
.res-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.res-table th { position: sticky; top: 0; background: var(--color-surface-secondary); text-align: left; font-weight: 500; color: var(--color-text-secondary); padding: 9px 11px; white-space: nowrap; }
.res-table td { padding: 8px 11px; border-top: 1px solid var(--color-border-subtle); color: var(--color-text); white-space: nowrap; }
.res-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.res-table__cap { font-size: 11.5px; color: var(--color-text-secondary); margin-top: 7px; }
.res-note { font-size: 12px; color: var(--color-text-secondary); line-height: 1.55; }
.res-error { padding: 16px; border-radius: 12px; border: 1px solid var(--color-border-danger-surface, var(--color-border)); background: var(--color-background-danger-surface); color: var(--color-text-danger-surface, var(--color-text)); font-size: 13.5px; }
.res-text { display: flex; flex-direction: column; gap: 8px; }
.res-text textarea { width: 100%; border-radius: 10px; border: 1px solid var(--color-border); background: var(--color-surface-secondary); color: var(--color-text); padding: 11px; font-family: var(--font-mono); font-size: 12.5px; resize: vertical; }
.res-copy { align-self: flex-start; }

/* 본문 프로즈 */
.prose { max-width: 780px; }
.prose section { padding: 26px 0; border-top: 1px solid var(--color-border); }
.prose h2 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; color: var(--heading-color); margin-bottom: 12px; }
.prose h3 { font-size: 15px; font-weight: 600; margin: 18px 0 6px; color: var(--color-text); }
.prose p { color: var(--color-text-secondary); font-size: 14.5px; line-height: 1.75; margin-bottom: 10px; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 6px 0 4px; }
.prose li { position: relative; padding-left: 14px; color: var(--color-text-secondary); font-size: 14px; line-height: 1.7; margin-bottom: 6px; }
.prose li::before { content: ""; position: absolute; left: 0; top: .72em; width: 4px; height: 4px; border-radius: 50%; background: var(--color-text-secondary); opacity: .55; }
.prose b, .prose strong { color: var(--color-text); font-weight: 600; }
.prose code { font-family: var(--font-mono); font-size: .88em; background: var(--color-background-primary-soft); padding: 2px 6px; border-radius: 5px; color: var(--color-text); }
.prose .formula {
  display: block; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--color-border);
  background: var(--color-surface-secondary); font-family: var(--font-mono); font-size: 13px;
  color: var(--color-text); line-height: 1.8; overflow-x: auto; white-space: pre-wrap;
}
.faq { border-top: 1px solid var(--color-border); }
.faq details { border-bottom: 1px solid var(--color-border); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 2px; font-size: 14.5px; color: var(--color-text); cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--color-text-secondary); font-size: 16px; }
.faq details[open] summary::after { content: "–"; }
.faq p { padding: 0 2px 16px; color: var(--color-text-secondary); font-size: 13.5px; line-height: 1.7; }
.source-list { display: flex; flex-wrap: wrap; gap: 6px; }
.source-list a, .source-list span { font-size: 11.5px; color: var(--color-text-secondary); border: 1px solid var(--color-border); border-radius: 999px; padding: 4px 9px; }
.source-list a:hover { color: var(--color-text); }
.disclaimer { margin-top: 8px; padding: 14px 16px; border-radius: 12px; background: var(--color-surface-secondary); color: var(--color-text-secondary); font-size: 12.5px; line-height: 1.65; border: 1px solid var(--color-border); }

/* 관련 도구 */
.related { margin: 6px 0 80px; }
.related h2 { font-size: 17px; font-weight: 600; margin-bottom: 14px; }
.related .tool-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* 광고 자리 */
.ad-slot { display: none; margin: 28px 0; min-height: 100px; border: 1px dashed var(--color-border); border-radius: 12px; align-items: center; justify-content: center; color: var(--color-text-secondary); font-size: 12px; }
.ad-slot.is-on { display: flex; }

/* 푸터 */
.site-footer { border-top: 1px solid var(--color-border); padding: 40px 0 56px; margin-top: 40px; position: relative; z-index: 1; }
.site-footer__in { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; }
.site-footer__brand { max-width: 340px; }
.site-footer__brand p { color: var(--color-text-secondary); font-size: 12.5px; margin-top: 10px; line-height: 1.65; }
.footer-col h4 { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-secondary); margin-bottom: 10px; }
.footer-col a { display: block; font-size: 13px; color: var(--color-text-secondary); padding: 3px 0; }
.footer-col a:hover { color: var(--color-text); }
.footer-bottom { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--color-border); display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; font-size: 11.5px; color: var(--color-text-secondary); }

/* 문서 페이지 */
.doc { max-width: 800px; padding: 52px 0 90px; }
.doc h1 { font-size: 32px; letter-spacing: -.01em; margin-bottom: 10px; }
.doc h2 { font-size: 18px; margin: 30px 0 10px; }
.doc p, .doc li { color: var(--color-text-secondary); font-size: 14px; line-height: 1.8; }
.doc li { margin-left: 18px; list-style: disc; }
.doc .meta { font-size: 12px; color: var(--color-text-secondary); }

@media (max-width: 640px) {
  .hero { padding: 48px 0 30px; }
  .wrap { padding: 0 16px; }
  .calc__form, .calc__result { padding: 16px; }
  .tool-card { padding: 16px 15px; }
  .hero h1 { font-size: clamp(29px, 8.8vw, 40px); line-height: 1.12; }
  .hero__lead { font-size: 15.5px; }
  .hero__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
  .hero__stat b { font-size: 18px; }
  .tool-grid { grid-template-columns: 1fr; }
  .prose { max-width: none; }
  .res-primary__value { font-size: clamp(22px, 6.6vw, 30px); overflow-wrap: anywhere; }
  .res-table { max-width: 100%; }
  .section-head { flex-wrap: wrap; align-items: flex-start; }
  .tool-head { padding: 28px 0 18px; }
  .doc h1 { font-size: 26px; }
  .calc { border-radius: 18px; }
}

/* ---------- 기준·출처 블록 (rates.json 자동 표기) ---------- */
.rate-src { padding: 26px 0; border-top: 1px solid var(--color-border); }
.rate-src h2 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; color: var(--heading-color); margin-bottom: 10px; }
.rate-src p { color: var(--color-text-secondary); font-size: 14px; line-height: 1.75; }
.rate-src__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-top: 12px; }
.rate-src__row { border: 1px solid var(--color-border); border-radius: 12px; padding: 12px 14px; background: var(--color-surface-secondary); min-width: 0; }
.rate-src__name { font-size: 13.5px; font-weight: 600; color: var(--color-text); }
.rate-src__meta { font-size: 11.5px; color: var(--color-text-secondary); margin-top: 2px; font-variant-numeric: tabular-nums; }
.rate-src__src a { display: block; margin-top: 6px; font-size: 11.5px; color: var(--color-text-secondary); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.rate-src__src a:hover { color: var(--color-text); }
.rate-src__next { margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--color-border); font-size: 11.5px; color: var(--color-text); }
.rate-src__stamp { margin-top: 12px; font-size: 11.5px; }
.rate-src__stamp a { text-decoration: underline; text-underline-offset: 2px; }
.badge--live::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--color-text-secondary); }
.badge--live.is-live { border-color: var(--accent); color: var(--color-text); }
.badge--live.is-live::before { background: var(--accent); }

/* 값·표 숫자는 고정폭 숫자로 */
.hero__stat b, .res-primary__value, .res-stats dd, .chip small, .rate-src__meta, .footer-bottom { font-variant-numeric: tabular-nums; }

/* ================================================================
   비주얼 그래픽 — 카테고리 일러스트 · 도구 라이브 다이어그램 · 결과 차트
   인라인 SVG. 색은 전부 테마 변수라 다크/라이트 모두 자동 대응.
   ================================================================ */

/* 아이콘 */
.vi--icon { width: 17px; height: 17px; display: block; flex: none; }
.vi--icon .ia { stroke: var(--accent); }

/* 카테고리 일러스트 (120 그리드) */
.cat-illo, .cat-hero__svg, .cat-card__illo, .viz-tile { display: block; width: 100%; height: 100%; color: var(--color-text); }
.cat-illo .ci-bg, .cat-hero__svg .ci-bg, .cat-card__illo .ci-bg, .viz-tile .ci-bg { fill: var(--color-surface-secondary); stroke: var(--color-border); }
.cat-illo .ci-glow, .cat-hero__svg .ci-glow, .cat-card__illo .ci-glow, .viz-tile .ci-glow { fill: var(--accent); opacity: .10; }
.cat-illo .ci-orbit, .cat-hero__svg .ci-orbit, .cat-card__illo .ci-orbit, .viz-tile .ci-orbit { color: var(--color-text-secondary); }
.cat-illo .ci-dot, .cat-hero__svg .ci-dot, .cat-card__illo .ci-dot, .viz-tile .ci-dot { fill: var(--accent); }
.cat-illo .ci-bar, .cat-hero__svg .ci-bar, .cat-card__illo .ci-bar, .viz-tile .ci-bar { fill: var(--color-text-secondary); opacity: .32; }
.cat-illo .ci-bar--on, .cat-hero__svg .ci-bar--on, .cat-card__illo .ci-bar--on, .viz-tile .ci-bar--on { fill: var(--accent); opacity: 1; }
.cat-illo .ia, .cat-hero__svg .ia, .cat-card__illo .ia, .viz-tile .ia { stroke: var(--accent); }

/* 홈 히어로 */
.hero--home { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 46px; align-items: center; }
.hero--home h1 { max-width: none; }
.hero__artwrap { min-width: 0; }
.hero-art { width: 100%; height: auto; display: block; }
.hero-art .viz-bg { fill: var(--color-surface); stroke: var(--color-border); }
.hero-art .viz-ring { fill: none; stroke: var(--color-border); }
.hero-art .viz-ring--soft { stroke-dasharray: 2 8; opacity: .8; }
.hero-art .viz-spoke { stroke: var(--color-border); stroke-width: 1; }
.hero-art .viz-node { fill: var(--color-surface-secondary); stroke: var(--color-border); }
.hero-art .viz-core { fill: var(--accent); }
.hero-art .viz-core-num { fill: var(--accent-ink); font-family: var(--font-mono); font-size: 30px; font-weight: 600; }
.hero-art .viz-core-lb { fill: var(--accent-ink); font-size: 10px; opacity: .72; letter-spacing: .02em; }
.hero-art .viz-dot { fill: var(--color-text-secondary); opacity: .16; }
.hero-art g[transform] > g { color: var(--color-text); }
.hero-art g[transform] > g .ia { stroke: var(--accent); }
@media (max-width: 1000px) {
  .hero--home { grid-template-columns: 1fr; gap: 26px; }
  .hero__artwrap { max-width: 380px; margin: 0 auto; width: 100%; }
}

/* 홈 카테고리 카드 */
.cat-index { margin: 8px 0 54px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cat-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 15px;
  border: 1px solid var(--color-border); border-radius: 18px; background: var(--color-surface);
  text-decoration: none; min-width: 0;
  transition: border-color .18s var(--ease), transform .18s var(--ease), background .18s;
}
.cat-card:hover { border-color: var(--color-text-secondary); transform: translateY(-2px); }
.cat-card__illo { width: 54px; height: 54px; flex: none; }
.cat-card__body { min-width: 0; flex: 1; }
.cat-card h3 { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; color: var(--color-text); }
.cat-card p { font-size: 11.5px; line-height: 1.45; color: var(--color-text-secondary); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 6px; font-size: 11px; color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }
.cat-card__arrow { opacity: .45; transition: transform .15s var(--ease), opacity .15s; }
.cat-card:hover .cat-card__arrow { opacity: 1; transform: translateX(3px); }
@media (max-width: 1020px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cat-card { padding: 12px; gap: 11px; border-radius: 16px; }
  .cat-card__illo { width: 44px; height: 44px; }
  .cat-card p { display: none; }
  .cat-card h3 { font-size: 13.5px; }
}

/* 도구 카드 아이콘 */
.tool-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.tool-card__ico {
  width: 26px; height: 26px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--color-background-primary-soft); color: var(--color-text-secondary);
  transition: color .15s, background .15s;
}
.tool-card__ico .vi--icon { width: 16px; height: 16px; }
.tool-card:hover .tool-card__ico { color: var(--accent); }

/* 카테고리 히어로 */
.cat-hero { display: flex; align-items: center; gap: 34px; padding: 54px 0 30px; }
.cat-hero__illo { width: 116px; height: 116px; flex: none; }
.cat-hero__copy { min-width: 0; }
.cat-hero__stat { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.cat-hero__stat b { font-family: var(--font-mono); font-size: 21px; font-weight: 500; color: var(--color-text); }
.cat-hero__stat span { font-size: 12px; color: var(--color-text-secondary); }
@media (max-width: 640px) {
  .cat-hero { gap: 16px; padding: 30px 0 20px; }
  .cat-hero__illo { width: 72px; height: 72px; }
}

/* 도구 페이지 히어로 다이어그램 */
.tool-head__grid { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 44px; align-items: center; }
.tool-head__main { min-width: 0; }
.tool-head__viz { min-width: 0; }
.tool-viz .viz { width: 100%; height: auto; display: block; }
.tool-viz .viz--narrow { display: none; }
@media (max-width: 1120px) {
  .tool-head__grid { grid-template-columns: 1fr; gap: 22px; }
  .tool-head__viz { max-width: 520px; }
}
@media (max-width: 640px) {
  .tool-head__viz { max-width: none; }
  .tool-viz .viz--wide { display: none; }
  .tool-viz .viz--narrow { display: block; }
}
.viz-bg { fill: var(--color-surface); stroke: var(--color-border); }
.viz-dot { fill: var(--color-text-secondary); opacity: .15; }
.viz-cat { fill: var(--color-text-secondary); font-family: var(--font-sans); font-size: 11px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; }
.viz-mono { fill: var(--color-text-secondary); font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; opacity: .75; }
.viz-chip { fill: var(--color-surface-secondary); stroke: var(--color-border); }
.viz-chip--on { stroke: color-mix(in oklab, var(--accent) 55%, var(--color-border)); }
.viz-chip-lb { fill: var(--color-text-secondary); font-family: var(--font-sans); font-size: 10px; }
.viz-chip-val { fill: var(--color-text); font-family: var(--font-mono); font-size: 15.5px; font-weight: 600; }
.viz-rule { stroke: var(--color-border); stroke-dasharray: 2 5; }
.viz-out { fill: var(--accent); }
.viz-live { fill: var(--color-text); opacity: .5; }
.viz-out-lb { fill: var(--accent-ink); font-family: var(--font-sans); font-size: 10px; font-weight: 600; letter-spacing: .04em; opacity: .68; }
.viz-out-val { fill: var(--accent-ink); font-family: var(--font-mono); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.viz-formula { fill: var(--color-text-secondary); font-family: var(--font-mono); font-size: 10px; opacity: .9; }
.viz-mini-track { fill: var(--color-text-secondary); opacity: .13; }
.viz-mini-fill { fill: var(--color-text); opacity: .75; }
.viz-mini-fill--soft { opacity: .28; }

/* 결과 차트 */
.res-chart { display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  padding: 16px; border: 1px solid var(--color-border); border-radius: 14px; background: var(--color-surface-secondary); }
.res-chart svg { flex: none; }
.ch-donut { width: 168px; height: 168px; }
.ch-ring { fill: none; stroke-width: 22; stroke-linecap: butt; }
.ch-ring--track { stroke: var(--color-border); opacity: .45; }
.ch-seg--1 { stroke: var(--accent); }
.ch-seg--2 { stroke: var(--color-text); opacity: .55; }
.ch-seg--3 { stroke: var(--color-text); opacity: .26; }
.ch-value { fill: var(--color-text); font-family: var(--font-mono); font-size: 24px; font-weight: 600; }
.ch-label { fill: var(--color-text-secondary); font-family: var(--font-sans); font-size: 10.5px; }
.ch-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 140px; }
.ch-legend__row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--color-text-secondary); }
.ch-legend__sw { width: 9px; height: 9px; border-radius: 3px; flex: none; background: var(--color-text); opacity: .55; }
.ch-legend__sw--1 { background: var(--accent); opacity: 1; }
.ch-legend__sw--3 { opacity: .28; }
.ch-legend__sw--4 { opacity: .42; }
.ch-legend__row b { margin-left: auto; color: var(--color-text); font-weight: 500; font-variant-numeric: tabular-nums; }
.ch-gauge { width: 100%; max-width: 320px; height: auto; }
.ch-gauge .g-band { fill: none; stroke-width: 14; stroke-linecap: butt; }
.ch-gauge .g-band--1 { stroke: var(--accent); opacity: 1; }
.ch-gauge .g-band--2 { stroke: var(--color-text); opacity: .48; }
.ch-gauge .g-band--3 { stroke: var(--color-text); opacity: .22; }
.ch-gauge .g-band--4 { stroke: var(--color-text); opacity: .34; }
.ch-gauge .g-band--5 { stroke: var(--color-text); opacity: .16; }
.ch-gauge .g-needle { stroke: var(--color-text); stroke-width: 1.5; stroke-linecap: round; opacity: .55; }
.ch-gauge .g-hub { fill: var(--color-text); stroke: var(--color-surface-secondary); stroke-width: 3; }
.ch-gauge .g-tick { fill: var(--color-text-secondary); font-family: var(--font-mono); font-size: 9.5px; }
.ch-gauge .g-now { fill: var(--color-text); font-family: var(--font-mono); font-size: 22px; font-weight: 600; }
.ch-gauge .g-cap { fill: var(--color-text-secondary); font-family: var(--font-sans); font-size: 11px; }
.ch-stack { width: 100%; min-width: 200px; flex: 1; }
.ch-stack__bar { display: flex; height: 24px; border-radius: 8px; overflow: hidden; background: var(--color-border); gap: 2px; }
.ch-stack__bar i { display: block; height: 100%; background: var(--color-text); opacity: .3; min-width: 2px; }
.ch-stack__bar i:first-child { background: var(--accent); opacity: 1; }
.ch-stack__bar i:nth-child(2) { opacity: .55; }
.ch-stack__cap { font-size: 11.5px; color: var(--color-text-secondary); margin-top: 8px; }
@media (max-width: 480px) {
  .ch-donut { width: 140px; height: 140px; }
  .res-chart { padding: 13px; gap: 12px; }
}

/* 결과 막대 — 라임 그라디언트로 */
.res-bar__track { height: 9px; }
:root { --bar-ink: var(--accent); }
:root[data-theme="light"] { --bar-ink: #7fae00; }
:root[data-theme="dark"], html.dark { --bar-ink: var(--accent); }
.res-bar__track i {
  background: linear-gradient(90deg, var(--bar-ink), color-mix(in oklab, var(--bar-ink) 62%, var(--page-bg)));
  opacity: 1;
  transition: width .45s var(--ease);
}
.res-bar__top { font-size: 12.5px; }
.res-bar__top b { font-family: var(--font-mono); }

@media (prefers-reduced-motion: reduce) {
  .res-bar__track i { transition: none; }
  .cat-card, .tool-card { transition: none; }
}
.viz-tag { fill: transparent; stroke: var(--color-border); }
.viz-tag-lb { fill: var(--color-text-secondary); font-family: var(--font-sans); font-size: 9.5px; }

/* ───────── 히어로 일러스트 (2026-12-05 고도화) ───────── */
.viz-stage { fill: var(--color-surface-secondary); stroke: var(--color-border); }
.viz-glow { fill: var(--accent); opacity: .07; }
.tool-viz .viz-chip { fill: var(--color-surface); }
.tool-viz .viz-chip--on { stroke: color-mix(in oklab, var(--accent) 62%, var(--color-border)); }
.tool-viz .viz-chip-lb { font-size: 9.5px; letter-spacing: .01em; }
.tool-viz .viz-chip-val { font-size: 13.5px; }
.tool-viz .viz-out-val { font-size: 24px; letter-spacing: -.01em; }
.tool-viz .viz-out-val--n { font-size: 21px; }
.viz-live-tag { fill: var(--accent-ink); font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; opacity: .45; }
.tool-viz .viz-formula { font-size: 9.5px; }

/* 장면(scene) 공통 스타일 — 색은 토큰만 쓴다 */
.sc .l { fill: none; stroke: var(--color-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.sc .l2 { fill: none; stroke: var(--color-text-secondary); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .6; }
.sc .f { fill: var(--color-surface); stroke: var(--color-border); stroke-width: 1.4; }
.sc .f2 { fill: var(--color-surface-secondary); stroke: var(--color-border); stroke-width: 1.2; }
.sc .fa { fill: var(--accent); }
.sc .sa { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sc .sh { fill: var(--color-text); opacity: .07; }
.sc .st { fill: var(--accent-ink); font-family: var(--font-mono); font-weight: 700; font-size: 13px; }
.sc .st2 { fill: var(--color-text-secondary); font-family: var(--font-sans); font-size: 10px; }
.sc .st3 { fill: var(--color-text); font-family: var(--font-sans); font-weight: 600; font-size: 11px; }
.tool-viz .viz-tag { stroke-dasharray: 3 4; opacity: .85; }
.tool-viz .viz-tag-lb { font-size: 10px; }
.tool-viz .viz-note { fill: color-mix(in oklab, var(--accent) 9%, transparent); stroke: color-mix(in oklab, var(--accent) 26%, var(--color-border)); }
.tool-viz .viz-note-dot { fill: var(--accent); }
.tool-viz .viz-note-lb { fill: var(--color-text-secondary); font-family: var(--font-sans); font-size: 10px; }
