/* ─────────────────────────────────────────────────────────────
   블로그 단일 스타일시트 — 라이트/다크, 모바일 우선
   카테고리 색은 요소의 --h(hue) 하나로 정해진다.
   ───────────────────────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --surface: #ffffff;
  --line: #e7e9ee;
  --text: #16181d;
  --text-2: #4a4f5a;
  --muted: #8a909c;
  --brand: #2b59ff;
  --brand-ink: #ffffff;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --thumb-l1: 94%;
  --thumb-l2: 86%;
  --thumb-ink: 22%;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --bg-soft: #1a1d22;
    --surface: #181b20;
    --line: #2a2e35;
    --text: #eceef2;
    --text-2: #b6bbc5;
    --muted: #7f8692;
    --brand: #7b9bff;
    --brand-ink: #0d1020;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --thumb-l1: 24%;
    --thumb-l2: 17%;
    --thumb-ink: 88%;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.65;
  word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 99; background: var(--brand); color: var(--brand-ink); padding: 8px 12px; border-radius: 8px; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--brand); }

/* ── 헤더 ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { display: flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #9b5cff);
  position: relative;
}
.logo-mark::after { content: ""; position: absolute; inset: 7px 7px 11px 7px; border-radius: 3px; background: var(--bg); opacity: .92; }
.search { margin-left: auto; flex: 0 1 280px; }
.search input {
  width: 100%; height: 38px; padding: 0 14px 0 36px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-soft) no-repeat 12px 50%/16px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a909c' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  color: var(--text); font: inherit; font-size: 14px; outline: none; transition: border-color .15s, background-color .15s;
}
.search input:focus { border-color: var(--brand); background-color: var(--surface); }
.search-lg { margin: 24px 0; max-width: 420px; }
.search-lg input { height: 46px; font-size: 16px; }

.cat-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a {
  flex: none; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: background-color .15s, color .15s;
}
.cat-nav a:hover { background: var(--bg-soft); color: var(--text); }
.cat-nav a[aria-current="page"] { background: var(--text); color: var(--bg); }

main.wrap { padding-top: 28px; padding-bottom: 64px; min-height: 60vh; }

/* ── 홈 ───────────────────────────────────────────────── */
.intro { margin: 8px 0 28px; }
.intro h1 { margin: 0; font-size: clamp(26px, 4.4vw, 38px); line-height: 1.25; letter-spacing: -.035em; font-weight: 800; max-width: 18em; }
.home-grid { display: grid; gap: 40px; }
@media (min-width: 1000px) { .home-grid.has-side { grid-template-columns: minmax(0, 1fr) 300px; } }

.cards { display: grid; gap: 28px 22px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* 홈 1페이지는 사이드바 옆이라 폭이 좁다: 1100px 미만은 2열, 그 이상은 3열에 제목을 조금 줄인다 */
@media (min-width: 1000px) and (max-width: 1099px) { .has-side .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .has-side .cards-3 .card-title { font-size: 16.5px; } }

/* ── 카드 ─────────────────────────────────────────────── */
.card { display: flex; flex-direction: column; min-width: 0; }
.card-thumb {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  aspect-ratio: 16 / 9; padding: 18px 20px; border-radius: var(--radius); overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, hsl(var(--h) 90% var(--thumb-l2)) 0%, transparent 60%),
    linear-gradient(160deg, hsl(var(--h) 70% var(--thumb-l1)), hsl(calc(var(--h) + 30) 60% var(--thumb-l2)));
  color: hsl(var(--h) 55% var(--thumb-ink));
  transition: transform .25s ease, box-shadow .25s ease;
}
.card-thumb::after {
  content: ""; position: absolute; right: -30px; bottom: -30px; width: 140px; height: 140px; border-radius: 50%;
  border: 22px solid hsl(var(--h) 80% var(--thumb-ink) / .08);
}
.card:hover .card-thumb { transform: translateY(-2px); box-shadow: var(--shadow); }
.thumb-cat { margin-top: auto; font-size: 15px; font-weight: 800; letter-spacing: -.01em; opacity: .7; }
.card-body { padding: 14px 2px 0; }
.chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: hsl(var(--h) 80% 50% / .12); color: hsl(var(--h) 60% 45%);
}
@media (prefers-color-scheme: dark) { .chip { color: hsl(var(--h) 80% 72%); } }
.card-title { margin: 8px 0 6px; font-size: 18px; line-height: 1.4; letter-spacing: -.025em; font-weight: 700; }
.card-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.card-desc { margin: 0 0 8px; color: var(--text-2); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin: 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 10px; }

.card-lg { margin-bottom: 36px; }
@media (min-width: 760px) {
  .card-lg { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; align-items: center; }
  .card-lg .card-body { padding: 0; }
}
.card-lg .card-title { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.32; letter-spacing: -.035em; }
.card-lg .card-desc { font-size: 16px; -webkit-line-clamp: 3; }

/* ── 사이드 ───────────────────────────────────────────── */
.side { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 1000px) { .side { position: sticky; top: 120px; align-self: start; } }
.side-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 10px; background: var(--surface); }
.side-box h2 { margin: 0 0 10px; font-size: 15px; letter-spacing: -.02em; }
.rank { list-style: none; margin: 0; padding: 0; }
.rank a { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; line-height: 1.45; font-weight: 600; }
.rank li:first-child a { border-top: 0; }
.rank a:hover span:last-child { text-decoration: underline; }
.rank-n { flex: none; width: 20px; color: var(--brand); font-weight: 800; font-variant-numeric: tabular-nums; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list a { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14.5px; font-weight: 600; }
.cat-list .dot { width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--h) 75% 55%); }
.cat-list em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 13px; }

/* ── 목록·페이저·빈 상태 ─────────────────────────────── */
.list-head { margin: 4px 0 28px; }
.list-head h1 { margin: 0; font-size: clamp(26px, 4vw, 34px); letter-spacing: -.035em; }
.list-head .muted { margin: 6px 0 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 44px 0 0; font-size: 15px; color: var(--muted); }
.pager a { padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-weight: 600; }
.pager a:hover { border-color: var(--text); }
.empty { padding: 64px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ── 글 ───────────────────────────────────────────────── */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 30; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .1s linear; }

.post { max-width: 760px; margin: 0 auto; }
@media (min-width: 1100px) { .post { max-width: 1040px; } }
.post-head { max-width: 760px; margin: 0 0 28px; }
.crumbs { display: flex; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.crumbs a:last-child { color: hsl(var(--h) 60% 48%); font-weight: 700; }
@media (prefers-color-scheme: dark) { .crumbs a:last-child { color: hsl(var(--h) 80% 72%); } }
.post-head h1 { margin: 0 0 14px; font-size: clamp(27px, 4.6vw, 40px); line-height: 1.28; letter-spacing: -.04em; font-weight: 800; }
.post-lede { margin: 0 0 16px; font-size: 17.5px; color: var(--text-2); line-height: 1.6; }
.post-head .meta { padding-top: 14px; border-top: 1px solid var(--line); }
.checked { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.checked::before { content: "✓ "; font-weight: 800; color: hsl(150 55% 40%); }
.checked.stale { color: var(--text-2); }
.checked.stale::before { content: "⚠️ "; }

.post-layout { display: grid; gap: 40px; }
@media (min-width: 1100px) { .post-layout { grid-template-columns: minmax(0, 760px) 240px; } }
.post-body { max-width: 760px; min-width: 0; width: 100%; }
.post-aside { display: none; }
@media (min-width: 1100px) { .post-aside { display: block; } .post-body .toc { display: none; } }
.toc-sticky { position: sticky; top: 120px; font-size: 13.5px; border-left: 2px solid var(--line); padding-left: 16px; }
.toc-sticky p { margin: 0 0 8px; font-weight: 800; font-size: 13px; color: var(--muted); }
.toc-sticky ol { list-style: none; margin: 0; padding: 0; }
.toc-sticky a { display: block; padding: 5px 0; color: var(--text-2); line-height: 1.45; transition: color .15s; }
.toc-sticky a:hover, .toc-sticky a.active { color: var(--text); font-weight: 700; }

.toc { margin: 0 0 32px; padding: 16px 20px; border-radius: 14px; background: var(--bg-soft); }
.toc summary { cursor: pointer; font-weight: 800; font-size: 15px; }
.toc ol { margin: 10px 0 0; padding-left: 20px; }
.toc li { margin: 4px 0; }
.toc a { color: var(--text-2); }
.toc a:hover { color: var(--text); text-decoration: underline; }

/* ── 본문 타이포 ──────────────────────────────────────── */
.prose { font-size: 17.5px; line-height: 1.85; letter-spacing: -.01em; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.25em; }
.prose h2 {
  margin: 2.2em 0 .8em; padding-top: .2em; font-size: 1.42em; line-height: 1.38; letter-spacing: -.035em; font-weight: 800;
}
.prose h2::before { content: ""; display: block; width: 28px; height: 4px; border-radius: 2px; margin-bottom: 14px; background: hsl(var(--h, 220) 80% 55%); }
.prose h3 { margin: 1.8em 0 .6em; font-size: 1.16em; line-height: 1.45; letter-spacing: -.025em; font-weight: 750; }
.prose strong { font-weight: 750; background: linear-gradient(transparent 62%, hsl(var(--h, 220) 90% 60% / .22) 0); }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose ul, .prose ol { margin: 0 0 1.25em; padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--muted); }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--line); color: var(--text-2); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose code { font-size: .9em; padding: 2px 6px; border-radius: 6px; background: var(--bg-soft); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0 1.8em; font-size: .9em; line-height: 1.55; display: block; overflow-x: auto; }
@media (min-width: 620px) { .prose table { display: table; } }
.prose th, .prose td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--bg-soft); font-weight: 750; white-space: nowrap; }
.prose details { margin: 1em 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; }
.prose details summary { cursor: pointer; font-weight: 700; }

.summary-box {
  margin: 1.6em 0 2em; padding: 20px 22px 8px; border-radius: 16px;
  background: hsl(var(--h, 220) 85% 60% / .08); border: 1px solid hsl(var(--h, 220) 70% 55% / .22);
}
.summary-box::before { content: "핵심 요약"; display: block; margin-bottom: 8px; font-size: 13px; font-weight: 800; color: hsl(var(--h, 220) 60% 45%); }
@media (prefers-color-scheme: dark) { .summary-box::before { color: hsl(var(--h, 220) 80% 72%); } }
.summary-box ul { padding-left: 1.1em; }
.callout { margin: 1.5em 0; padding: 16px 18px 2px 46px; border-radius: 14px; position: relative; font-size: .95em; }
.callout::before { position: absolute; left: 16px; top: 15px; font-size: 17px; line-height: 1.6; }
.callout.tip { background: hsl(150 60% 45% / .1); }
.callout.tip::before { content: "💡"; }
.callout.warn { background: hsl(35 95% 55% / .13); }
.callout.warn::before { content: "⚠️"; }

.editor-note { margin: 2.4em 0 0; padding: 16px 20px 4px; border-left: 3px solid hsl(var(--h, 220) 60% 50%); border-radius: 0 14px 14px 0; background: var(--bg-soft); }
.editor-note-label { margin: 0 0 6px; font-size: 13px; font-weight: 800; color: hsl(var(--h, 220) 60% 45%); }
@media (prefers-color-scheme: dark) { .editor-note-label { color: hsl(var(--h, 220) 80% 72%); } .checked::before { color: hsl(150 55% 60%); } }

.sources { margin-top: 2.6em; padding: 18px 20px; border-radius: 14px; background: var(--bg-soft); font-size: 14.5px; line-height: 1.6; }
.sources h2 { margin: 0 0 8px; font-size: 15px; }
.sources h2::before { display: none; }
.sources ul { margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; }
.tags a { padding: 5px 12px; border-radius: 999px; background: var(--bg-soft); color: var(--text-2); font-size: 14px; text-decoration: none; }
.tags a:hover { color: var(--text); }
.disclaimer { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.65; color: var(--muted); }
.disclaimer a { color: inherit; }

.prevnext { display: grid; gap: 12px; margin: 36px 0 0; }
@media (min-width: 620px) { .prevnext { grid-template-columns: 1fr 1fr; } }
.pn { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; font-size: 15px; font-weight: 650; line-height: 1.45; text-decoration: none !important; color: var(--text) !important; transition: border-color .15s; }
.pn:hover { border-color: var(--text); }
.pn small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.pn.next { text-align: right; }

.related { margin: 64px auto 0; padding-top: 36px; border-top: 1px solid var(--line); }
.related > h2 { margin: 0 0 22px; font-size: 22px; letter-spacing: -.03em; }
.related .card-title { font-size: 16px; }

/* ── 광고 ─────────────────────────────────────────────── */
.ad { margin: 2em 0; min-height: 100px; text-align: center; }
.ad-label { display: block; margin-bottom: 4px; font-size: 11px; color: var(--muted); letter-spacing: .05em; }
.ad-feed { margin: 0 0 36px; }

/* ── 고정 페이지 ──────────────────────────────────────── */
.prose-wrap { max-width: 760px; margin: 0 auto; }
.page h1 { margin: 8px 0 28px; font-size: clamp(26px, 4vw, 34px); letter-spacing: -.035em; }
.page .prose { font-size: 16.5px; }
.contact-mail { font-size: 20px; font-weight: 800; }

/* ── 푸터 ─────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 36px 0 44px; font-size: 14px; color: var(--text-2); }
.footer-brand { margin: 0 0 12px; font-weight: 800; color: var(--text); }
.footer-brand span { font-weight: 500; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 16px; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-note { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.footer-copy { margin: 0; font-size: 13px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ── 이미지 ───────────────────────────────────────────── */
.card-thumb.has-img { padding: 0; background: var(--bg-soft); }
.card-thumb.has-img::after { display: none; }
.card-thumb.has-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo { margin: 2em 0 2.2em; }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 750; object-fit: cover; border-radius: 14px; background: var(--bg-soft); }
.photo figcaption { margin-top: 8px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.photo figcaption span { display: block; font-size: 12px; }
.photo figcaption a { color: inherit; text-decoration: none; }
.post-hero { max-width: 760px; margin: -8px 0 32px; }
.post-hero img { border-radius: 18px; }

/* ── 계산기 ───────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cat-nav .nav-tools { color: var(--brand); }
.cat-nav .nav-tools[aria-current="page"] { background: var(--brand); color: var(--brand-ink); }

.tool { max-width: 1040px; margin: 0 auto; }
.tool-head { max-width: 760px; margin: 0 0 24px; }
.tool-head h1 { margin: 0 0 12px; font-size: clamp(27px, 4.6vw, 38px); line-height: 1.28; letter-spacing: -.04em; font-weight: 800; }
.tool-head .meta { padding-top: 12px; border-top: 1px solid var(--line); }

.tool-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 900px) { .tool-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; } .result { position: sticky; top: 120px; } }

.calc { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.calc-field { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.calc-field > label, .calc-field > legend { display: block; margin-bottom: 7px; padding: 0; font-size: 14.5px; font-weight: 700; }
.calc-row { display: flex; gap: 8px; }
.calc-input { position: relative; flex: 1; min-width: 0; }
.calc-input input {
  width: 100%; height: 48px; padding: 0 52px 0 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right;
  transition: border-color .15s, box-shadow .15s;
}
.calc-input input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.calc-input input[aria-invalid="true"] { border-color: #e5484d; }
.calc-input input:disabled { opacity: .45; }
.calc-input em { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 14px; color: var(--muted); pointer-events: none; }
.calc-help { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.calc-help:empty { display: none; }
.calc-err { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: #e5484d; }
.calc-err:empty { display: none; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { flex: 1 1 auto; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span, .seg button {
  display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-align: center;
  font: inherit; font-size: 14.5px; font-weight: 600; color: var(--text-2); background: var(--bg); cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background-color .15s, color .15s;
}
.seg input:checked + span, .seg button.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--bg)); color: var(--text); }
.seg input:focus-visible + span, .seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.calc-actions { display: flex; gap: 8px; margin-top: 22px; }
.btn-primary, .btn-ghost { height: 50px; border-radius: 12px; font: inherit; font-size: 16px; font-weight: 750; cursor: pointer; }
.btn-primary { flex: 1; border: 0; background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { padding: 0 18px; border: 1px solid var(--line); background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-2); }

.result-empty { padding: 40px 20px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); font-size: 15px; }
.result-card { padding: 24px 22px 18px; border-radius: var(--radius); background: hsl(var(--h) 70% 50% / .08); border: 1px solid hsl(var(--h) 60% 50% / .22); }
.result-label { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--text-2); }
.result-main { margin: 0; font-size: clamp(30px, 6vw, 40px); line-height: 1.2; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.result-main small { font-size: .5em; font-weight: 700; color: var(--muted); }
.result-main-sm { font-size: 22px; }
.result-sub { margin: 6px 0 0; font-size: 14.5px; color: var(--text-2); }
.result-rows { margin: 18px 0 0; padding: 0; }
.result-rows div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 10px 0; border-top: 1px solid hsl(var(--h) 40% 50% / .18); font-size: 15px; }
.result-rows dt { color: var(--text-2); }
.result-rows dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.result-rows .hl dt, .result-rows .hl dd { color: var(--text); font-weight: 800; }
.result-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.score-bar { display: block; flex-basis: 100%; height: 6px; margin-top: 2px; border-radius: 3px; background: hsl(var(--h) 30% 50% / .15); overflow: hidden; }
.score-bar i { display: block; height: 100%; background: hsl(var(--h) 70% 55%); }
.schedule { margin-top: 16px; border-top: 1px solid hsl(var(--h) 40% 50% / .18); padding-top: 12px; }
.schedule summary { cursor: pointer; font-size: 14.5px; font-weight: 700; color: var(--brand); }
.schedule-scroll { max-height: 360px; overflow: auto; margin-top: 10px; border-radius: 10px; background: var(--surface); }
.schedule table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.schedule th { position: sticky; top: 0; background: var(--bg-soft); padding: 8px; text-align: right; font-weight: 700; white-space: nowrap; }
.schedule td { padding: 6px 8px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
.schedule th:first-child, .schedule td:first-child { text-align: center; }

.tool-body { max-width: 760px; margin-top: 12px; }
.tool-body .ad { margin: 2.4em 0; }

.tool-cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .tool-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .tools-all { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tool-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color .15s, transform .2s, box-shadow .2s; }
.tool-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.tool-card b { font-size: 17px; letter-spacing: -.02em; }
.tool-card span:not(.tool-icon) { font-size: 14px; color: var(--text-2); line-height: 1.55; }
.tool-card em { margin-top: auto; padding-top: 6px; font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.tool-icon { font-size: 26px; line-height: 1; }
.tool-card[hidden] { display: none; }
.tools-filter { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 0 0 22px; }
.tools-filter .seg { flex: 0 1 auto; }
.tools-search { flex: 1 1 220px; max-width: 320px; height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); color: var(--text); font: inherit; font-size: 15px; }
.tools-search:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.tools-lists { display: grid; gap: 20px; margin-top: 36px; }
@media (min-width: 760px) { .tools-lists { grid-template-columns: 1fr 1fr; } }
.tool-related .tool-card b { font-size: 16px; }

.tool-cta { display: grid; gap: 10px; margin: 2.4em 0 0; }
.tool-cta a { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); background: color-mix(in srgb, var(--brand) 6%, var(--bg)); text-decoration: none !important; color: var(--text) !important; transition: border-color .15s; }
.tool-cta a:hover { border-color: var(--brand); }
.tool-cta b { display: block; font-size: 16px; }
.tool-cta small { display: block; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.tool-cta i { margin-left: auto; font-style: normal; font-size: 20px; color: var(--brand); }
.result.stale .result-card { opacity: .35; filter: grayscale(1); }
.result.stale::before { content: "입력값을 고친 뒤 다시 계산하세요"; display: block; margin-bottom: 8px; font-size: 13.5px; font-weight: 700; color: #e5484d; }
.tool-grid > * { min-width: 0; }   /* 긴 상환표가 화면 폭을 밀지 않고 안에서 스크롤되게 */
@media (max-width: 480px) { .schedule th, .schedule td { padding: 6px 5px; font-size: 12px; } .calc { padding: 18px 16px; } .result-card { padding: 20px 16px 14px; } }
