
/* 셈고리 — 핀테크 카드형 (업계 표준을 정석대로). 기준: 토스·카카오뱅크·뱅크샐러드 수준의 마감 */
:root {
  --ground: #f2f4f6;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --ink: #191f28;
  --ink-2: #4e5968;
  --ink-3: #59636e;
  --line: #e5e8eb;
  --accent: #0c7c59;
  --accent-ink: #075a41;
  --accent-soft: #e6f4ee;
  --radius: 20px;
  --radius-s: 14px;
  --chevron: #b0b8c1;
  --scrollbar: #c9ced4;
  --shadow: 0 1px 2px rgba(25, 31, 40, .04), 0 4px 16px rgba(25, 31, 40, .04);
  --font: "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; scrollbar-color: var(--scrollbar) transparent; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.65; letter-spacing: -0.01em;
  word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--accent-ink); }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 3px; border-radius: 8px; }

/* ── 머리 ─────────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: baseline; gap: 10px;
  padding: 16px max(20px, calc((100% - 840px) / 2)) 10px;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
}
.brand { font-size: 21px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.brand-note { font-size: 13px; color: var(--ink-3); }

.site-nav { position: sticky; top: 52px; z-index: 9; background: color-mix(in srgb, var(--ground) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); }
.site-nav ul {
  display: flex; gap: 8px; list-style: none; margin: 0; padding: 4px max(20px, calc((100% - 840px) / 2)) 12px;
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: 20px;
}
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav li { flex: none; scroll-snap-align: start; }
.site-nav a {
  display: flex; align-items: center; gap: 6px; padding: 7px 14px 7px 8px;
  background: var(--surface); border-radius: 999px; color: var(--ink-2);
  font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow); transition: background-color .2s, color .2s;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.site-nav a[aria-current="page"] .seg-no { background: #fff; color: var(--ink); }

.seg-no {
  display: inline-grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--seg, var(--accent)); color: #fff;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0;
}

/* ── 본문 틀 ─────────────────────────────── */
main { max-width: 880px; margin: 0 auto; padding: 8px 20px 24px; }
h1 { font-size: clamp(28px, 6.4vw, 40px); line-height: 1.28; letter-spacing: -0.035em; font-weight: 700; margin: 22px 0 12px; text-wrap: balance; }
h2 { font-size: 21px; line-height: 1.35; letter-spacing: -0.03em; font-weight: 700; margin: 44px 0 14px; text-wrap: balance; }
h3 { font-size: 18px; line-height: 1.4; letter-spacing: -0.025em; font-weight: 700; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.lead { font-size: 17px; color: var(--ink-2); max-width: 62ch; margin: 0 0 8px; }
main > p:not(.lead):not(.muted):not(.table-note) { color: var(--ink-2); max-width: 66ch; }
.muted { color: var(--ink-3); font-size: 14px; }

.crumbs { font-size: 14px; color: var(--ink-3); margin-top: 12px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.seg-head { display: flex; align-items: center; gap: 12px; margin: 18px 0 10px; }
.seg-head h1 { margin: 0; }
.seg-head .seg-no { width: 40px; height: 40px; font-size: 18px; }

/* ── 카드 ─────────────────────────────── */
.card, .glance, .prepare, details { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card { padding: 22px 22px 18px; margin: 0 0 12px; }
.card > h3 { font-size: 19px; }
.card > p.muted { margin-bottom: 10px; }
.card p strong { color: var(--ink); font-weight: 700; }
.card p { color: var(--ink-2); font-size: 15.5px; }
.card dl {
  display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px;
  margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); font-size: 14.5px;
}
.card dt { color: var(--ink-3); }
.card dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.tags span { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }

.card.featured { background: var(--accent-soft); box-shadow: none; }
.card.featured .tags span { background: #fff; border-color: transparent; }
.card.featured dl { border-top-color: color-mix(in srgb, var(--accent) 18%, transparent); }
.card.featured a { font-weight: 700; }
.badge {
  display: inline-block; vertical-align: 2px; margin-left: 4px; padding: 2px 9px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0; line-height: 1.5; white-space: nowrap;
}

/* 준비물: 번호 체크리스트 */
.prepare { padding: 20px 22px; margin: 20px 0 12px; }
.prepare h2 { font-size: 17px; margin: 0 0 10px; }
.prepare ol { list-style: none; counter-reset: p; margin: 0; padding: 0; display: grid; gap: 8px; }
.prepare li { counter-increment: p; display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; font-size: 15.5px; }
.prepare li::before {
  content: counter(p); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: color-mix(in srgb, var(--seg, var(--accent)) 12%, #fff); color: var(--seg, var(--accent));
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* 한눈에 보기 */
.glance { padding: 20px 22px; margin: 12px 0; }
.glance h2 { font-size: 17px; margin: 0 0 12px; }
.glance h3 { font-size: 15px; margin: 18px 0 8px; color: var(--ink-2); }
.glance dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 15px; }
.glance dt { color: var(--ink-3); }
.glance dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.glance ul { margin: 0; padding: 0 0 0 18px; display: grid; gap: 8px; font-size: 15px; color: var(--ink-2); }
.glance ul .muted { font-size: 13px; }
.glance > .muted { margin: 10px 0 0; font-size: 13px; }

/* 비교표 */
.tablewrap {
  overflow-x: auto; margin: 0 0 8px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
thead th { background: var(--surface-2); color: var(--ink-3); font-weight: 500; font-size: 13px; text-align: left; padding: 12px 14px; white-space: nowrap; }
tbody th, tbody td { padding: 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
tbody th { font-weight: 700; color: var(--ink); min-width: 150px; position: sticky; left: 0; background: var(--surface); }
tbody td { color: var(--ink-2); }
tbody td:not(:last-child) { white-space: nowrap; }
tbody td:last-child { min-width: 240px; }
tbody tr:first-child th, tbody tr:first-child td { border-top: 0; }
tbody th .badge { margin: 6px 0 0; display: table; }
tbody th a { color: var(--accent); }
.table-note { font-size: 13px; color: var(--ink-3); margin: 0 4px 8px; max-width: 72ch; }

/* 목록 카드 그리드 (홈 용도 카드·다른 계산 보기) */
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.grid a {
  display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 2px; align-items: center;
  height: 100%; padding: 18px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
}
.grid a:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(25, 31, 40, .05), 0 10px 24px rgba(25, 31, 40, .07); }
.grid a:active { transform: scale(.985); }
.grid strong { font-size: 17px; letter-spacing: -0.025em; }
.grid .muted { grid-column: 2; font-size: 13.5px; }
.grid .first { grid-column: 1 / -1; margin-top: 8px; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.grid a { position: relative; padding-right: 40px; }
.grid a::after {
  content: ""; position: absolute; right: 20px; top: 26px; width: 8px; height: 8px;
  border-top: 2px solid var(--chevron); border-right: 2px solid var(--chevron); transform: rotate(45deg);
}
.grid a:active { background: var(--surface-2); }

/* 첫 화면 답 한 줄 */
.answer {
  margin: 14px 0 0; padding: 14px 18px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); color: var(--ink); font-size: 15.5px; max-width: none;
}

/* 상황별로 고르면 */
.picks { margin: 12px 0; padding: 20px 22px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.picks h2 { font-size: 17px; margin: 0 0 6px; }
.picks ul { list-style: none; margin: 0; padding: 0; }
.picks li { display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--line); }
.picks li:first-child { border-top: 0; padding-top: 6px; }
.picks .when { font-size: 14px; color: var(--ink-3); }
.picks a { font-weight: 700; color: var(--ink); text-decoration: none; position: relative; padding-right: 18px; justify-self: start; }
.picks a::after {
  content: ""; position: absolute; right: 2px; top: 50%; width: 7px; height: 7px; margin-top: -4px;
  border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: rotate(45deg);
}
.picks a:hover { color: var(--accent); }
.card:target { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow); }

/* 추천 카드의 주 행동 버튼 */
.cta {
  display: block; margin: 16px 0 4px; padding: 14px 16px; border-radius: 14px;
  background: var(--accent); color: #fff !important; text-align: center; font-weight: 700; font-size: 16px;
  text-decoration: none; transition: background-color .2s;
}
.cta:hover { background: var(--accent-ink); }
.cta:active { transform: scale(.99); }

/* 고르는 법 — 펼치는 카드 */
details { padding: 0; margin: 0 0 8px; overflow: hidden; }
summary {
  list-style: none; cursor: pointer; padding: 18px 52px 18px 22px; position: relative;
  font-weight: 700; font-size: 16px; letter-spacing: -0.02em;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 9px; height: 9px; margin-top: -6px;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
details p { padding: 0 22px 20px; margin: 0; color: var(--ink-2); font-size: 15.5px; max-width: 70ch; }

/* ── 바닥 정보 띠 ─────────────────────────────── */
.site-foot { max-width: 880px; margin: 32px auto 0; padding: 22px 20px 48px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13.5px; }
.site-foot p { margin: 0 0 6px; }
.site-foot .band { color: var(--ink-2); }
.site-foot a { color: var(--ink-2); }

/* ── 데스크톱 ─────────────────────────────── */
@media (min-width: 760px) {
  .site-head { padding-top: 22px; }
  .site-nav { top: 62px; }
  h1 { margin-top: 32px; }
  .card { padding: 26px 28px 22px; }
  .prepare ol { grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .grid.segs li:first-child { grid-column: 1 / -1; }
}

/* ── 모바일: 비교표를 줄마다 카드로 ─────────────────────────────── */
@media (max-width: 759px) {
  .tablewrap:not(.summary) { overflow: visible; background: none; box-shadow: none; }
  .tablewrap:not(.summary) table { min-width: 0; display: block; }
  .tablewrap:not(.summary) thead { display: none; }
  .tablewrap:not(.summary) tbody { display: grid; gap: 8px; }
  .tablewrap:not(.summary) tr {
    display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 16px 18px;
    background: var(--surface); border-radius: var(--radius-s); box-shadow: var(--shadow);
  }
  .tablewrap:not(.summary) tbody th { grid-column: 1 / -1; position: static; padding: 0 0 4px; border: 0; min-width: 0; font-size: 16px; }
  .tablewrap:not(.summary) tbody td { padding: 0; border: 0; white-space: normal; min-width: 0; font-size: 14px; }
  .tablewrap:not(.summary) tbody td::before { content: attr(data-label); color: var(--ink-3); margin-right: 8px; }
  .tablewrap:not(.summary) tbody td:last-child { grid-column: 1 / -1; }
  .summary table { min-width: 0; font-size: 14px; }
  .summary thead th, .summary tbody td { padding: 12px 10px; }
  .summary tbody td:last-child { min-width: 0; }
  .summary td:first-child, .summary th:first-child { overflow-wrap: normal; word-break: keep-all; white-space: normal; width: auto; }
  .summary td:not(:first-child), .summary thead th:not(:first-child) { width: 1%; white-space: nowrap; text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
