/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { line-height: 1.7; font-synthesis: none; -webkit-font-smoothing: antialiased; }
img, picture, svg, video { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ===== Tokens ===== */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --border: #e8e8ec;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --text-muted: #6b7280;
  --text-subtle: #9ca3af;
  --accent: #1e3a8a;
  --accent-hover: #1e40af;
  --accent-soft: #eff6ff;
  --accent-text: #1e3a8a;
  --success: #047857;
  --success-soft: #ecfdf5;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 30px -10px rgba(15, 23, 42, 0.15);

  --container: 1120px;
  --container-narrow: 760px;

  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ===== Base ===== */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-feature-settings: "ss01", "ss02", "tnum";
  letter-spacing: -0.005em;
  /* 한글이 단어 중간("주택금융공\n사")에서 꺾이지 않도록 어절 단위로만 줄바꿈.
     overflow-wrap은 공백 없는 긴 토큰(URL 등)이 좁은 컨테이너를 밀어내는 것을 방지. */
  word-break: keep-all;
  overflow-wrap: break-word;
}
/* 표 안에서는 keep-all을 풀어준다 — 긴 단지명·금액이 셀 폭을 밀어내
   모바일에서 표가 화면을 넘는 것을 방지 (CJK 기본 줄바꿈 허용). */
table th, table td { word-break: normal; }
@media (min-width: 768px) { body { font-size: 17px; } }

h1, h2, h3, h4, h5 { line-height: 1.35; letter-spacing: -0.02em; font-weight: 700; color: var(--text); }
h1 { font-size: 2.0rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
@media (min-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.3rem; }
}

p { color: var(--text); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== Layout ===== */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container-narrow { width: 100%; max-width: var(--container-narrow); margin: 0 auto; padding: 0 20px; }

.section { padding: 56px 0; }
@media (min-width: 768px) { .section { padding: 80px 0; } }

.section-head { margin-bottom: 32px; }
.section-head .eyebrow { color: var(--accent); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 8px; }
.section-head h2 { margin-bottom: 8px; }
.section-head p { color: var(--text-muted); max-width: 580px; }

/* ===== Header ===== */
html, body { overflow-x: hidden; }
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .row {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 56px; gap: 10px; position: relative;
  flex-wrap: nowrap;
}
@media (min-width: 768px) {
  .site-header .row { min-height: 64px; }
}
.brand {
  font-weight: 800; font-size: 1.2rem; letter-spacing: -0.03em;
  display: inline-flex; align-items: center; gap: 8px; color: var(--text);
  flex-shrink: 0;
}
@media (min-width: 768px) { .brand { font-size: 1.25rem; } }
.brand-mark {
  display: inline-block; width: 26px; height: 26px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><rect width='64' height='64' rx='14' fill='%232563eb'/><g fill='none' stroke='%23ffffff' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'><circle cx='25' cy='27' r='9'/><path d='M25 36 L 22 44'/><path d='M27 40 L 35 48 L 51 26'/></g></svg>");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}
@media (min-width: 768px) { .brand-mark { width: 28px; height: 28px; } }

/* 네비는 항상 [로고·톺다]와 [KR/EN] 사이 한 줄에 컴팩트하게. 좁으면 가로 스크롤. */
.nav {
  display: flex; align-items: center;
  flex: 1 1 auto; min-width: 0;
  gap: 14px;
  margin: 0; padding: 0; border: 0; background: transparent;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  white-space: nowrap;
  justify-content: flex-start;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  font-size: 0.86rem; font-weight: 600; color: var(--text-muted);
  padding: 6px 2px;
  transition: color 0.15s; white-space: nowrap;
  flex-shrink: 0;
}
.nav a:hover, .nav a.active { color: var(--text); }

@media (min-width: 768px) {
  .nav { gap: 24px; justify-content: center; }
  .nav a { font-size: 0.92rem; padding: 8px 0; }
}
@media (min-width: 1024px) { .nav { gap: 28px; } }

.nav-cta {
  font-size: 0.9rem; font-weight: 600; padding: 8px 14px;
  border-radius: var(--radius-sm); background: var(--text); color: #fff;
  transition: background 0.15s;
}
.nav-cta:hover { background: var(--accent); }

/* 상단 안내 링크는 햄버거 메뉴 안에서만 노출한다. */
.nav a[href$="about.html"] { display: none; }
.nav-toggle {
  display: inline-flex !important; align-items: center; justify-content: center;
  flex: 0 0 auto; padding: 4px; margin-left: 0;
  background: transparent !important; border: 0 !important; box-shadow: none !important;
  color: var(--text);
  order: 10;
}
.nav-toggle:hover { background: transparent !important; color: var(--accent); }
.nav-toggle svg { width: 22px; height: 22px; stroke-width: 1.8; }

.mobile-menu {
  display: none;
  position: absolute; left: 0; right: 0; top: 100%; z-index: 60;
  background: rgba(255,255,255,0.98);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 16px 30px -24px rgba(15, 23, 42, 0.35);
  padding: 10px 20px 14px;
}
.mobile-menu.open { display: grid; gap: 2px; }
.mobile-menu a { padding: 10px 0; font-size: 1rem; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 600; }
.mobile-menu a:last-child { border-bottom: 0; }
@media (min-width: 768px) {
  .mobile-menu {
    left: auto; right: max(20px, calc((100vw - var(--container)) / 2 + 20px));
    width: min(360px, calc(100vw - 40px));
    border: 1px solid var(--border); border-top: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
}

/* ===== Hero ===== */
.hero {
  padding: 80px 0 64px;
  background:
    radial-gradient(60% 50% at 20% 10%, rgba(30, 58, 138, 0.05), transparent),
    radial-gradient(50% 40% at 80% 20%, rgba(37, 99, 235, 0.06), transparent),
    var(--bg);
}
@media (min-width: 768px) { .hero { padding: 120px 0 96px; } }
.hero .eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.85rem; }
.hero h1 {
  font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em;
  margin: 12px 0 20px; max-width: 720px;
}
@media (min-width: 768px) { .hero h1 { font-size: 3.2rem; } }
.hero .lead {
  font-size: 1.05rem; color: var(--text-muted); max-width: 580px; margin-bottom: 32px;
}
@media (min-width: 768px) { .hero .lead { font-size: 1.15rem; } }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.95rem; transition: all 0.15s;
  border: 1px solid transparent;
}
.btn-primary { background: var(--text); color: #fff; }
.btn-primary:hover { background: var(--accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }

.hero-stats {
  margin-top: 56px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
  max-width: 720px;
}
@media (min-width: 640px) { .hero-stats { grid-template-columns: repeat(4, 1fr); } }
.hero-stats .stat { border-left: 2px solid var(--border-strong); padding-left: 16px; }
.hero-stats .num { font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.hero-stats .label { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

/* ===== Cards ===== */
.cards-grid {
  display: grid; gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (min-width: 1024px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; transition: all 0.18s;
  display: flex; flex-direction: column; height: 100%;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card .badge { align-self: flex-start; margin-bottom: 12px; }
.card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: 0.95rem; flex: 1; }
.card .meta { margin-top: 16px; color: var(--text-subtle); font-size: 0.85rem; display: flex; gap: 12px; }

.cat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px; transition: all 0.18s;
  display: flex; flex-direction: column; gap: 8px; min-height: 160px;
}
.cat-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.cat-card .icon {
  width: 36px; height: 36px; border-radius: 8px; background: var(--accent-soft);
  color: var(--accent); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem; margin-bottom: 8px;
}
.cat-card h3 { font-size: 1.1rem; }
.cat-card .desc { color: var(--text-muted); font-size: 0.92rem; flex: 1; }
.cat-card .stages { color: var(--text-subtle); font-size: 0.82rem; margin-top: 12px; }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; line-height: 1.4;
  background: var(--surface-2); color: var(--text-muted);
}
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.data th, table.data td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { background: var(--surface-2); font-weight: 600; color: var(--text); font-size: 0.88rem; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num { font-variant-numeric: tabular-nums; text-align: right; }

/* ===== Article ===== */
.article-header { padding: 48px 0 32px; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.article-header .breadcrumb { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 16px; }
.article-header .breadcrumb a { color: var(--text-muted); }
.article-header .breadcrumb a:hover { color: var(--text); }
.article-header h1 { font-size: 1.9rem; line-height: 1.3; margin: 16px 0 20px; }
@media (min-width: 768px) { .article-header h1 { font-size: 2.4rem; } }
.article-header .meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--text-muted); font-size: 0.9rem; align-items: center; }
.article-header .meta .dot { color: var(--text-subtle); }

.article-summary {
  background: var(--accent-soft); border-radius: var(--radius);
  padding: 20px 22px; margin: 32px 0; border-left: 3px solid var(--accent);
}
.article-summary .label { font-size: 0.8rem; font-weight: 700; color: var(--accent); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px; }
.article-summary p { color: var(--text); font-weight: 500; }

.prose { font-size: 1rem; color: var(--text); }
@media (min-width: 768px) { .prose { font-size: 1.05rem; } }
.prose h2 { margin: 48px 0 16px; padding-top: 8px; border-top: 1px solid var(--border); padding-top: 24px; }
.prose h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.prose h3 { margin: 32px 0 12px; }
.prose p { margin-bottom: 16px; color: var(--text); }
.prose ul, .prose ol { padding-left: 22px; margin-bottom: 16px; }
.prose ul li { list-style: disc; margin-bottom: 6px; }
.prose ol li { list-style: decimal; margin-bottom: 6px; }
.prose ul.ref-list { padding-left: 0; }
.prose ul.ref-list li { list-style: none; margin-bottom: 0; }
.prose strong { font-weight: 700; color: var(--text); }
.prose blockquote {
  margin: 24px 0; padding: 16px 20px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted); background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.prose code {
  font-family: var(--font-mono); font-size: 0.92em;
  background: var(--surface-2); padding: 2px 6px; border-radius: 4px;
}
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }

/* ===== Callouts ===== */
.callout {
  padding: 18px 20px; border-radius: var(--radius);
  margin: 24px 0; display: flex; gap: 12px;
  border: 1px solid;
}
.callout .icon { flex-shrink: 0; font-weight: 700; }
.callout .body { flex: 1; }
/* 콜아웃의 '머리말' 강조(맨 앞 strong)만 블록으로 띄운다.
   문장 중간 <strong>까지 block 처리하면 줄이 토막나 보이므로 첫 자식에만 적용. */
.callout .body strong { font-weight: 700; }
.callout .body > strong:first-child { display: block; margin-bottom: 4px; }
.callout-info { background: var(--accent-soft); border-color: #c7d2fe; }
.callout-info .icon { color: var(--accent); }
.callout-warn { background: var(--warning-soft); border-color: #fde68a; }
.callout-warn .icon { color: var(--warning); }
.callout-danger { background: var(--danger-soft); border-color: #fecaca; }
.callout-danger .icon { color: var(--danger); }
.callout-success { background: var(--success-soft); border-color: #bbf7d0; }
.callout-success .icon { color: var(--success); }

/* ===== FAQ ===== */
.faq { border-top: 1px solid var(--border); }
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.faq summary {
  cursor: pointer; font-weight: 600; font-size: 1.02rem;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-muted); font-size: 1.4rem; font-weight: 400; transition: transform 0.2s; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: 12px; color: var(--text-muted); }

/* ===== Checklist ===== */
.checklist { margin: 24px 0; }
.checklist-group { margin-bottom: 32px; }
.checklist-group h3 { font-size: 1.1rem; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.checklist-group .progress { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.check-item {
  display: flex; gap: 12px; padding: 12px 14px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background 0.12s; align-items: flex-start;
}
.check-item:hover { background: var(--surface-2); }
.check-item input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: var(--accent);
  margin-top: 2px; cursor: pointer; flex-shrink: 0;
}
.check-item .text { flex: 1; }
.check-item .note { display: block; color: var(--text-muted); font-size: 0.88rem; margin-top: 2px; }
.check-item.done .text { color: var(--text-subtle); text-decoration: line-through; }

/* ===== Calculator ===== */
/* 입력은 왼쪽, 결과는 오른쪽 — 모바일 세로 화면에서도 좁게나마 항상 2단으로 함께 보인다. */
/* 모바일: 입력 → 결과 1단 흐름(구겨 넣지 않는다). 768px+에서 좌 입력 · 우 결과 2단. */
.calc-layout {
  display: grid; align-items: start;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
@media (min-width: 768px) { .calc-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 28px; } }
@media (min-width: 1024px) { .calc-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 40px; } }

.calc-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 28px 28px; box-shadow: var(--shadow-sm); }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 0.92rem; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.field .hint { display: block; font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; }
.field .eok-hint {
  display: block; font-size: 0.85rem; font-weight: 600;
  color: var(--accent); margin-top: 6px; letter-spacing: -0.01em;
}
.field input[type="text"], .field input[type="number"], .field select {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 1rem;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus {
  border-color: var(--accent); outline: 0;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}
.field .input-suffix { position: relative; }
.field .input-suffix::after {
  content: attr(data-suffix); position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.92rem; pointer-events: none;
}
.field .input-suffix input { padding-right: 56px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row .field { margin: 0; }
.result-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: -16px; margin-bottom: 22px; }
.radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-group label {
  flex: 1; min-width: 100px; display: flex; align-items: center; justify-content: center;
  padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.92rem; font-weight: 500; color: var(--text-muted);
  transition: all 0.15s; user-select: none;
  text-align: center; word-break: keep-all; line-height: 1.3;
}
/* 두 줄 라벨: 약어(HF) 크게 + 풀네임 작게 — 긴 기관명이 중간에서 잘리는 문제 방지 */
.radio-group label span small {
  display: block; font-size: 0.72rem; font-weight: 500; opacity: 0.72; margin-top: 1px;
  letter-spacing: -0.01em;
}
.radio-group input[type="radio"] { display: none; }
.radio-group label:hover { border-color: var(--text-muted); color: var(--text); }
.radio-group input[type="radio"]:checked + span,
.radio-group label:has(input[type="radio"]:checked) { background: var(--text); color: #fff; border-color: var(--text); }

/* 결과 패널: 모바일에서는 입력 아래 일반 흐름(고정 X), 2단 레이아웃에서만 우측 sticky */
.calc-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px 28px;
  box-shadow: var(--shadow);
  position: relative;
  /* form 패널과 top padding을 동일하게 맞춰, 좌·우 첫 콘텐츠가 수평 정렬되도록 */
  word-break: keep-all;
}
/* 2단일 때도 sticky를 두지 않는다 — 스크롤 시 좌·우 top이 어긋나 보이는 문제 해결 */
.calc-result h3 { font-size: 0.92rem; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.calc-result .total { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 24px; color: var(--accent); font-variant-numeric: tabular-nums; }
.calc-result .breakdown { border-top: 1px solid var(--border); padding-top: 20px; }
.calc-result .row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 0.95rem; }
.calc-result .row .key { color: var(--text-muted); }
.calc-result .row .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.calc-result .row.sub { padding-left: 16px; font-size: 0.88rem; color: var(--text-muted); }
.calc-result .row.sub .val { font-weight: 500; color: var(--text-muted); }
/* 적용 시나리오 배지 (결과 상단) */
.result-scenario {
  display: inline-block; margin-bottom: 12px; padding: 5px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  font-size: 0.82rem; font-weight: 600; color: var(--accent);
  word-break: keep-all; line-height: 1.35;
}
/* 세율 요약 표에서 현재 적용 구간 하이라이트 */
table.data tr.is-active > td, table.data tr.is-active > th {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-weight: 700;
}
table.data tr.is-active > td:first-child, table.data tr.is-active > th:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

/* ===== 접이식 설명 섹션 (계산기 하단 '어떻게 계산되나'·세율표·출처) =====
   계산기 화면은 입력·결과만 남기고, 설명은 원하는 사람만 펼쳐 본다. */
details.explain {
  border: 1px solid var(--border); border-radius: var(--radius-lg, 14px);
  background: var(--surface); overflow: hidden;
}
details.explain summary {
  cursor: pointer; padding: 15px 18px; font-weight: 700; font-size: 1rem;
  color: var(--text); list-style: none; display: flex; align-items: center;
  justify-content: space-between; gap: 10px; user-select: none;
}
details.explain summary::-webkit-details-marker { display: none; }
details.explain summary::after {
  content: "+"; font-size: 1.2rem; font-weight: 600; color: var(--text-muted);
  line-height: 1; flex-shrink: 0;
}
details.explain[open] summary::after { content: "−"; }
details.explain summary:hover { color: var(--accent); }
details.explain .explain-body { padding: 2px 18px 18px; }
details.explain .explain-body > :first-child { margin-top: 0; }

/* ===== Footer ===== */
.site-footer {
  background: #0f172a; color: #cbd5e1; padding: 48px 0 32px; margin-top: 80px;
}
.site-footer .row { display: grid; gap: 32px; }
@media (min-width: 768px) { .site-footer .row { grid-template-columns: 1.5fr 1fr 1fr; } }
.site-footer h4 { color: #fff; font-size: 0.95rem; margin-bottom: 12px; }
.site-footer p { color: #94a3b8; font-size: 0.9rem; }
.site-footer ul { display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: #cbd5e1; font-size: 0.9rem; }
.site-footer a:hover { color: #fff; }
.site-footer .brand { color: #fff; margin-bottom: 12px; }
.site-footer .disclaimer {
  border-top: 1px solid #1e293b; margin-top: 32px; padding-top: 24px;
  font-size: 0.82rem; color: #64748b; line-height: 1.65;
}

/* ===== Misc ===== */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.divider { height: 1px; background: var(--border); margin: 32px 0; }

.toc {
  background: var(--surface-2); border-radius: var(--radius); padding: 20px 22px;
  margin: 24px 0;
}
.toc .label { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 12px; }
.toc ol { padding-left: 20px; }
.toc ol li { list-style: decimal; margin-bottom: 6px; color: var(--text-muted); }
.toc ol li a { color: var(--text); }
.toc ol li a:hover { color: var(--accent); }

.calc-list {
  display: grid; gap: 16px; grid-template-columns: 1fr;
}
@media (min-width: 640px) { .calc-list { grid-template-columns: repeat(2, 1fr); } }
.calc-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 24px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); transition: all 0.18s;
}
.calc-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.calc-card .icon { font-size: 1.4rem; }
.calc-card h3 { font-size: 1.1rem; }
.calc-card .desc { color: var(--text-muted); font-size: 0.92rem; }
.calc-card.disabled { opacity: 0.55; pointer-events: none; }

.source-list { font-size: 0.9rem; color: var(--text-muted); }
.source-list li { margin-bottom: 6px; padding-left: 12px; position: relative; }
.source-list li::before { content: "—"; position: absolute; left: 0; color: var(--text-subtle); }

.about-grid { display: grid; gap: 24px; grid-template-columns: 1fr; margin-top: 32px; }
@media (min-width: 768px) { .about-grid { grid-template-columns: repeat(3, 1fr); } }
.principle { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.principle .num { color: var(--accent); font-weight: 800; font-size: 1.6rem; letter-spacing: -0.02em; }
.principle h3 { margin: 8px 0; }
.principle p { color: var(--text-muted); font-size: 0.95rem; }

/* ===== Process Flow (흐름도) ===== */
.flow { position: relative; margin: 32px 0; }
.flow-step {
  position: relative; padding: 20px 0 32px 60px;
  border-left: 2px solid var(--border-strong); margin-left: 20px;
}
.flow-step:last-child { border-left-color: transparent; padding-bottom: 0; }
.flow-step::before {
  content: attr(data-step);
  position: absolute; left: -22px; top: 16px;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
  color: var(--accent); font-weight: 800; font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.flow-step.done::before { background: var(--accent); color: #fff; }
.flow-step h3 { font-size: 1.1rem; margin-bottom: 6px; }
.flow-step .when { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.flow-step .body { color: var(--text); font-size: 0.96rem; margin-bottom: 12px; }
.flow-step .actions { display: flex; flex-direction: column; gap: 6px; }
.flow-step .actions span {
  display: flex; gap: 8px; align-items: flex-start; font-size: 0.92rem; color: var(--text-muted);
  padding: 6px 10px; background: var(--surface-2); border-radius: var(--radius-sm);
}
.flow-step .actions span::before { content: "▸"; color: var(--accent); flex-shrink: 0; }

/* ===== Spec Table / Comparison ===== */
.spec-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; height: 100%;
  display: flex; flex-direction: column; gap: 8px;
}
.spec-card .price { font-size: 1.3rem; font-weight: 800; color: var(--text); margin: 4px 0 12px; }
.spec-card .price small { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; margin-left: 4px; }
.spec-card .meta-row { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--border); font-size: 0.9rem; }
.spec-card .meta-row:first-of-type { border-top: 0; }
.spec-card .meta-row .k { color: var(--text-muted); }
.spec-card .meta-row .v { font-weight: 600; }
.spec-card .pros, .spec-card .cons { font-size: 0.88rem; padding: 8px 12px; border-radius: var(--radius-sm); margin-top: 4px; }
.spec-card .pros { background: var(--success-soft); color: var(--success); }
.spec-card .cons { background: var(--danger-soft); color: var(--danger); }

/* ===== TOC sidebar ===== */
.layout-with-toc { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .layout-with-toc { grid-template-columns: minmax(0, 1fr) 240px; gap: 56px; } }
.toc-sidebar { display: none; }
@media (min-width: 1024px) {
  .toc-sidebar {
    display: block; position: sticky; top: 88px; align-self: start;
    font-size: 0.9rem;
  }
  .toc-sidebar .label { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 12px; }
  .toc-sidebar ol { list-style: none; padding: 0; }
  .toc-sidebar ol li { margin-bottom: 6px; }
  .toc-sidebar ol li a {
    display: block; padding: 6px 10px; border-left: 2px solid var(--border);
    color: var(--text-muted); transition: all 0.15s;
  }
  .toc-sidebar ol li a:hover, .toc-sidebar ol li a.active {
    color: var(--text); border-left-color: var(--accent); background: var(--accent-soft);
  }
}

/* ===== Checklist as Service ===== */
.cl-app {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  margin: 24px 0 32px;
}
.cl-app-header {
  display: grid; gap: 16px; padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .cl-app-header { grid-template-columns: 200px 1fr; align-items: center; gap: 32px; } }
.cl-ring {
  position: relative;
  width: 140px; height: 140px; margin: 0 auto;
}
.cl-ring svg { transform: rotate(-90deg); }
.cl-ring .bg { stroke: var(--border); fill: none; stroke-width: 10; }
.cl-ring .fg { stroke: var(--accent); fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.4s; }
.cl-ring .center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.cl-ring .pct { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cl-ring .total { font-size: 0.82rem; color: var(--text-muted); }
.cl-header-info h2 { font-size: 1.3rem; margin-bottom: 6px; }
.cl-header-info .desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 12px; }
.cl-header-info .stats { display: flex; gap: 16px; font-size: 0.85rem; color: var(--text-muted); }
.cl-header-info .stats strong { color: var(--text); font-weight: 700; }

.cl-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 28px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.cl-actions button, .cl-actions a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 500; color: var(--text-muted);
  background: transparent; border: 1px solid transparent; cursor: pointer;
  transition: all 0.12s;
}
.cl-actions button:hover, .cl-actions a:hover { background: var(--surface); color: var(--text); border-color: var(--border); }

.cl-tabs {
  display: flex; gap: 4px; overflow-x: auto;
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--border);
}
.cl-tabs a {
  padding: 10px 14px; font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
  border-bottom: 2px solid transparent; white-space: nowrap; transition: all 0.12s;
}
.cl-tabs a:hover { color: var(--text); }
.cl-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.cl-tabs a .count { color: var(--text-subtle); font-size: 0.82rem; margin-left: 4px; font-variant-numeric: tabular-nums; }

.cl-body { padding: 8px 28px 28px; }
.cl-section-title {
  font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
  letter-spacing: 0.04em; text-transform: uppercase;
  margin: 24px 0 8px;
}
.cl-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px;
  padding: 12px 8px; align-items: flex-start;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.cl-row:last-child { border-bottom: 0; }
.cl-row:hover { background: var(--surface-2); }
.cl-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); margin-top: 2px; }
.cl-row.done .cl-text { color: var(--text-subtle); text-decoration: line-through; }
.cl-row .cl-text { font-size: 0.96rem; }
.cl-row .cl-note { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.cl-row .cl-priority {
  font-size: 0.72rem; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted); font-weight: 600; align-self: center;
}
.cl-row .cl-priority.must { background: var(--danger-soft); color: var(--danger); }
.cl-row .cl-userNote {
  display: block; width: 100%; margin-top: 8px;
  padding: 6px 10px; font-size: 0.85rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text-muted); resize: none;
}
.cl-row .cl-userNote:focus { border-color: var(--accent); outline: 0; color: var(--text); }
.cl-row .cl-userNote.has-value { border-color: var(--accent-soft); background: var(--accent-soft); color: var(--text); }

/* ===== Print ===== */
@media print {
  .site-header, .site-footer, .cl-actions, .cl-tabs, .nav-toggle, .mobile-menu { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .container, .container-narrow { max-width: 100% !important; padding: 0 !important; }
  .cl-app { border: 0 !important; }
  .cl-app-header { padding: 0 0 16px !important; }
  .cl-body { padding: 0 !important; }
  .callout { break-inside: avoid; }
  .card, .cat-card, .calc-card { break-inside: avoid; }
  a { color: var(--text) !important; text-decoration: none !important; }
}

/* ===== Contract Reference Card ===== */
.contract-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  border-radius: var(--radius-lg); padding: 28px; color: #fff;
  margin: 32px 0;
}
.contract-card .label {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.15); font-size: 0.78rem; font-weight: 600;
  margin-bottom: 12px;
}
.contract-card h3 { color: #fff; margin-bottom: 8px; }
.contract-card .issuer { color: rgba(255,255,255,0.75); font-size: 0.92rem; margin-bottom: 16px; }
.contract-card ul { margin-bottom: 16px; }
.contract-card ul li { color: rgba(255,255,255,0.9); padding: 4px 0 4px 18px; position: relative; font-size: 0.92rem; }
.contract-card ul li::before { content: "✓"; position: absolute; left: 0; color: rgba(255,255,255,0.7); }
.contract-card a.dl {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: var(--accent); padding: 8px 14px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.9rem;
}

/* ===== Spec Grid ===== */
.spec-grid {
  display: grid; gap: 16px; grid-template-columns: 1fr;
}
@media (min-width: 640px) { .spec-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .spec-grid { grid-template-columns: repeat(3, 1fr); } }

/* ===== Sub-category nav ===== */
.subnav {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 24px 0;
}
.subnav a {
  padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 999px;
  font-size: 0.9rem; color: var(--text-muted); transition: all 0.12s; font-weight: 500;
}
.subnav a:hover { background: var(--surface); color: var(--text); }
.subnav a.active { background: var(--text); color: #fff; border-color: var(--text); }

/* ===== Checklist Hub Card ===== */
.hub-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
  transition: all 0.18s;
}
.hub-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.hub-card .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hub-card h3 { font-size: 1.05rem; }
.hub-card .desc { color: var(--text-muted); font-size: 0.9rem; flex: 1; }
.hub-card .pct {
  font-size: 1.4rem; font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.hub-card .bar-track {
  height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden;
}
.hub-card .bar {
  height: 100%; background: var(--accent); border-radius: 999px;
  width: 0; transition: width 0.4s ease;
}
.hub-card .stats { font-size: 0.82rem; color: var(--text-muted); }

/* ===== Home: unified blue brand palette =====
   톺다 brand: #1e3a8a (navy) → #2563eb (vivid blue)
   surface variants of accent-soft (#eff6ff) used as tints throughout
*/

/* Hero: compact tagline */
.home-intro {
  padding: 40px 0 24px;
  background:
    radial-gradient(70% 60% at 12% 0%, rgba(30, 58, 138, 0.07), transparent 60%),
    radial-gradient(60% 50% at 96% 8%, rgba(37, 99, 235, 0.06), transparent 60%),
    var(--bg);
}
@media (min-width: 768px) { .home-intro { padding: 72px 0 40px; } }
.home-tagline {
  font-size: 1.9rem; font-weight: 800; letter-spacing: -0.035em;
  line-height: 1.2; color: var(--text); margin: 0;
}
@media (min-width: 768px) {
  .home-tagline { font-size: 2.8rem; max-width: 720px; }
}

/* ===== Strip head (section header + side link) ===== */
.strip-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.strip-head h2 {
  font-size: 1.15rem; letter-spacing: -0.02em; margin: 0;
  font-weight: 700;
}
.strip-link { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.strip-link:hover { color: var(--accent); }
@media (min-width: 768px) { .strip-head h2 { font-size: 1.35rem; } }

/* ===== Primary categories — the main entry ===== */
.home-cats-primary { padding: 8px 0 16px; }
@media (min-width: 768px) { .home-cats-primary { padding: 0 0 24px; } }

.cat-tile-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
}
@media (min-width: 640px) { .cat-tile-grid { gap: 12px; } }

.cat-tile {
  display: flex; flex-direction: column; gap: 8px;
  padding: 13px 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 13px;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  min-height: 0;
  position: relative; overflow: hidden;
}
.cat-tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px -16px rgba(30, 58, 138, 0.25);
}
.cat-tile h3 {
  font-size: 0.92rem; font-weight: 700; color: var(--text);
  letter-spacing: -0.02em; line-height: 1.25; margin: 0;
  word-break: keep-all; overflow-wrap: anywhere;
}
.cat-tile p {
  font-size: 0.82rem; color: var(--text-muted); line-height: 1.55;
  margin: 0;
}
.cat-tile-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
  transition: background 0.18s, color 0.18s;
}
.cat-tile-icon svg { width: 16px; height: 16px; }
.cat-tile:hover .cat-tile-icon {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff;
}
@media (min-width: 1024px) {
  .cat-tile { min-height: 0; padding: 14px 12px; }
  .cat-tile h3 { font-size: 0.95rem; }
}

/* ===== Tools row — secondary ===== */
.home-tools { padding: 24px 0 8px; }
@media (min-width: 768px) { .home-tools { padding: 40px 0 16px; } }
.tool-row {
  display: grid; gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 640px) { .tool-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 900px) { .tool-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .tool-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.home-subtagline {
  margin-top: 14px; color: var(--text-muted); font-size: 0.95rem;
  max-width: 560px; line-height: 1.6;
}
@media (min-width: 768px) {
  .home-subtagline { font-size: 1.05rem; margin-top: 18px; }
}
/* 홈 통합 검색 바 */
.home-search {
  display: flex; align-items: center; gap: 8px;
  margin-top: 20px; max-width: 520px;
  background: var(--surface, #fff); border: 1px solid var(--border-strong, #d1d5db);
  border-radius: 12px; padding: 4px 4px 4px 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.home-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent,#2563eb) 16%, transparent); }
.home-search svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.home-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-size: 0.98rem; font-family: inherit; color: var(--text); padding: 8px 0;
}
.home-search button {
  flex-shrink: 0; border: 0; cursor: pointer;
  background: var(--accent, #2563eb); color: #fff; font-weight: 700; font-size: 0.9rem;
  padding: 9px 16px; border-radius: 9px; font-family: inherit;
}
.home-search button:hover { background: #1e40af; }
.strip-sub { font-weight: 500; color: var(--text-muted); font-size: 0.85em; margin-left: 4px; }
@media (max-width: 639px) { .strip-sub { display: block; margin-left: 0; margin-top: 2px; } }

/* ===== Weekly headlines (홈 '핵심 이슈' — 뉴스 헤드라인 목록) ===== */
.news-headlines {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr; gap: 0 28px;
  border-top: 2px solid var(--text, #111827);
}
@media (min-width: 760px) { .news-headlines { grid-template-columns: 1fr 1fr; } }
.news-headlines li { border-bottom: 1px solid var(--border, #e8e8ec); }
.headline-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 4px; text-decoration: none; color: var(--text);
}
.headline-item:hover .headline-title { color: var(--accent, #1e3a8a); text-decoration: underline; text-underline-offset: 3px; }
.headline-rank {
  flex-shrink: 0; width: 24px; height: 24px; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 800; color: var(--accent, #1e3a8a);
  background: var(--accent-soft, #eff6ff); border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.headline-body { min-width: 0; }
.headline-badge {
  display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--accent, #1e3a8a); margin-bottom: 3px;
}
.headline-title {
  display: block; font-size: 0.96rem; font-weight: 700; line-height: 1.45;
  word-break: keep-all; transition: color .15s;
}
.headline-meta { display: block; font-size: 0.74rem; color: var(--text-muted); margin-top: 4px; }
.news-note { color: var(--text-muted); font-size: 0.8rem; margin-top: 14px; }

/* ===== Sector news (홈 하단, 매일 자동 갱신) — 섹터별 가로형 한 줄 ===== */
.home-news[hidden] { display: none; }
.news-sectors { display: flex; flex-direction: column; gap: 12px; }
.news-row {
  display: grid; grid-template-columns: 1fr; gap: 10px;
  border: 1px solid var(--border, #e5e7eb); border-radius: var(--radius, 14px);
  background: var(--surface, #fff); padding: 14px 16px;
}
@media (min-width: 760px) {
  .news-row { grid-template-columns: 132px 1fr; align-items: stretch; gap: 16px; }
}
.news-row-label {
  font-size: 0.9rem; font-weight: 800; color: var(--accent, #2563eb);
  word-break: keep-all; align-self: center;
}
.news-row-items {
  display: grid; gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .news-row-items { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 760px) { .news-row-items { grid-template-columns: repeat(3, 1fr); } }
.news-card {
  display: block; text-decoration: none; color: var(--text);
  padding: 10px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px;
  background: var(--surface-2, #f8fafc); border-left: 3px solid var(--accent, #2563eb);
  transition: border-color .15s, transform .15s;
}
.news-card:hover { border-left-color: var(--accent, #2563eb); transform: translateY(-1px); box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,.06)); }
.news-card .news-title {
  display: block; font-size: 0.9rem; line-height: 1.4; font-weight: 600;
  word-break: keep-all;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card .news-meta { display: block; font-size: 0.74rem; color: var(--text-muted); margin-top: 5px; }

/* ===== Hub sections (calculator/checklist index) ===== */
.hub-section { padding: 24px 0 16px; }
@media (min-width: 768px) { .hub-section { padding: 32px 0 24px; } }
.hub-section-head { margin-bottom: 18px; }
.hub-section-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  color: var(--accent); background: var(--accent-soft);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 10px;
}
.hub-section-head h2 {
  font-size: 1.35rem; letter-spacing: -0.02em; margin: 0 0 6px;
}
@media (min-width: 768px) { .hub-section-head h2 { font-size: 1.55rem; } }
.hub-section-head p {
  color: var(--text-muted); font-size: 0.95rem; max-width: 640px; line-height: 1.6;
}
.hub-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(1, 1fr);
}
@media (min-width: 640px) { .hub-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
.hub-tool {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 22px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  position: relative;
}
.hub-tool:hover {
  transform: translateY(-2px); border-color: var(--accent);
  box-shadow: 0 12px 28px -16px rgba(30, 58, 138, 0.25);
}
/* 종합 계산기 — 풀폭 강조 배너 CTA (가장 눈에 띄게) */
.hub-tool-hl {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  border-color: transparent; color: #fff;
  padding: 26px; align-items: center;
  box-shadow: 0 16px 40px -22px rgba(30, 58, 138, 0.6);
}
.hub-tool-hl:hover {
  border-color: transparent; transform: translateY(-2px);
  box-shadow: 0 22px 50px -22px rgba(30, 58, 138, 0.7);
}
.hub-tool-hl .hub-tool-icon { background: rgba(255,255,255,0.18); color: #fff; width: 48px; height: 48px; }
.hub-tool-hl .hub-tool-icon svg { width: 26px; height: 26px; }
.hub-tool-hl .hub-tool-body h3 { color: #fff; font-size: 1.3rem; }
.hub-tool-hl .hub-tool-body p { color: rgba(255,255,255,0.9); font-size: 0.95rem; }
.hub-tool-hl .hub-tool-link {
  background: #fff; color: #1e3a8a; padding: 9px 18px;
  border-radius: 999px; font-weight: 700;
}
.hub-tool-hl .badge-accent { background: rgba(255,255,255,0.22); color: #fff; }
.hub-tool-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hub-tool-icon svg { width: 16px; height: 16px; }
.hub-tool-body { flex: 1; min-width: 0; }
.hub-tool-body h3 {
  font-size: 1.05rem; letter-spacing: -0.02em; margin: 0 0 6px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.hub-tool-body p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; margin: 0 0 10px; }
.hub-tool-link {
  display: inline-block; font-size: 0.85rem; font-weight: 600;
  color: var(--accent);
}
.hub-card-tall { padding: 24px 22px; }

/* ===== Home tips ===== */
.home-tips { padding: 24px 0 8px; }
@media (min-width: 768px) { .home-tips { padding: 40px 0 24px; } }
.tip-cards {
  display: grid; gap: 12px;
  grid-template-columns: repeat(1, 1fr);
}
@media (min-width: 640px) { .tip-cards { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (min-width: 1024px) { .tip-cards { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.tip-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  position: relative;
}
.tip-card:hover {
  transform: translateY(-2px); border-color: var(--accent);
  box-shadow: 0 8px 24px -14px rgba(30, 58, 138, 0.25);
}
.tip-card-num {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  color: var(--accent); background: var(--accent-soft);
  align-self: flex-start; padding: 3px 8px; border-radius: 999px;
}
.tip-card h3 {
  font-size: 1.05rem; margin: 4px 0 0; letter-spacing: -0.02em;
}
.tip-card p {
  color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; margin: 0;
}

/* ===== Topic cards (category page card grid) ===== */
.topic-section { margin: 32px 0 16px; }
@media (min-width: 768px) { .topic-section { margin: 40px 0 24px; } }
.topic-grid {
  display: grid; gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .topic-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .topic-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.topic-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 22px 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  min-height: 180px;
}
.topic-card:hover {
  transform: translateY(-2px); border-color: var(--accent);
  box-shadow: 0 12px 28px -16px rgba(30, 58, 138, 0.25);
}
.topic-card-hl {
  background: linear-gradient(180deg, #f8faff 0%, #fff 60%);
  border-color: #c7d2fe;
}
.topic-tag {
  align-self: flex-start;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
  color: var(--accent); background: var(--accent-soft);
  padding: 3px 9px; border-radius: 999px;
}
.topic-card h3 {
  font-size: 1.05rem; letter-spacing: -0.02em; margin: 4px 0 0;
}
.topic-card p {
  color: var(--text-muted); font-size: 0.9rem; line-height: 1.6;
  margin: 0; flex: 1;
}
.topic-link {
  font-size: 0.85rem; font-weight: 600; color: var(--accent);
  margin-top: 8px;
}

/* ===== Timeline (compact schedule list) ===== */
.timeline {
  list-style: none; padding: 0; margin: 0;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--surface);
}
.timeline li {
  display: grid; grid-template-columns: 130px 1fr auto;
  gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--border);
  align-items: center;
}
.timeline li:last-child { border-bottom: 0; }
.timeline .t-when {
  font-size: 0.82rem; font-weight: 700; color: var(--accent);
  letter-spacing: -0.01em;
}
.timeline .t-what {
  font-size: 0.95rem; color: var(--text); font-weight: 500;
}
.timeline .t-tool {
  font-size: 0.85rem; color: var(--text-muted);
}
.timeline .t-tool a { color: var(--accent); font-weight: 600; }
.timeline .t-tool a:hover { text-decoration: underline; }
@media (max-width: 639px) {
  .timeline li { grid-template-columns: 1fr; gap: 4px; padding: 14px 16px; }
}

/* ===== Source / reference card grid ===== */
.source-grid {
  display: grid; gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .source-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
@media (min-width: 1024px) { .source-grid { grid-template-columns: repeat(4, 1fr); } }
.source-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  transition: border-color 0.18s, transform 0.18s;
}
.source-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.source-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.source-card h4 {
  font-size: 0.92rem; margin: 0 0 2px; color: var(--text);
  letter-spacing: -0.01em;
}
.source-card p {
  font-size: 0.78rem; color: var(--text-muted); margin: 0; line-height: 1.4;
}

/* ===== Tip grid (in-article: numbered list with description) ===== */
.tip-grid {
  display: flex; flex-direction: column; gap: 0;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); overflow: hidden;
  margin: 18px 0 24px;
}
.tip-row {
  display: grid; grid-template-columns: 56px 1fr;
  gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.tip-row:last-child { border-bottom: 0; }
.tip-row:hover { background: var(--surface-2); }
.tip-row-num {
  font-size: 1.1rem; font-weight: 800; color: var(--accent);
  letter-spacing: -0.02em;
}
.tip-row-body h3 {
  font-size: 1.02rem; margin: 0 0 6px; letter-spacing: -0.02em;
}
.tip-row-body p {
  font-size: 0.94rem; line-height: 1.65; color: var(--text); margin: 0;
}
.tip-row-body p strong { color: var(--text); font-weight: 700; }
@media (max-width: 639px) {
  .tip-row { grid-template-columns: 1fr; gap: 4px; padding: 16px 18px; }
  .tip-row-num { font-size: 0.95rem; }
}

.tool-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 13px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s, background 0.18s;
  min-height: 58px;
  min-width: 0; overflow: hidden;
}
.tool-card::after {
  content: "›"; margin-left: auto; color: var(--text-subtle);
  font-size: 1.25rem; font-weight: 700; line-height: 1;
  transition: color 0.15s, transform 0.15s; flex-shrink: 0;
}
.tool-card:hover {
  transform: translateY(-2px); border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 10px 24px -12px rgba(30, 58, 138, 0.38);
}
.tool-card:hover::after { color: var(--accent); transform: translateX(3px); }
.tool-card-icon {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.18s, color 0.18s;
}
.tool-card:hover .tool-card-icon { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%); color: #fff; }
.tool-card-icon svg { width: 14px; height: 14px; }
.tool-card-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.tool-card-body strong {
  font-size: 0.92rem; font-weight: 700; color: var(--text);
  letter-spacing: -0.01em; line-height: 1.3;
  word-break: keep-all; overflow-wrap: anywhere;
}
.tool-card-body span {
  /* 부제 회색 설명은 노출하지 않음 — 카드 타이틀만 표시 */
  display: none;
}
/* 카테고리 카드의 부제 회색 설명도 마찬가지로 제거 */
.cat-tile > p {
  display: none;
}
.cat-tile { padding-bottom: 13px; }

/* ===== Banner row ===== */
.banner-row { padding: 0 0 8px; }
@media (min-width: 768px) { .banner-row { padding: 8px 0 16px; } }
.big-banner {
  display: flex; align-items: stretch; justify-content: space-between;
  gap: 16px; padding: 24px 20px; border-radius: 18px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff; overflow: hidden; position: relative;
  transition: transform 0.18s, box-shadow 0.18s;
}
.big-banner:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.big-banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.big-banner-eyebrow {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; opacity: 0.85;
}
.big-banner-title {
  font-size: 1.15rem; font-weight: 800; line-height: 1.35;
  letter-spacing: -0.02em; color: #fff;
}
.big-banner-cta {
  font-size: 0.9rem; font-weight: 600; margin-top: 6px;
  display: inline-flex; align-items: center; gap: 6px; opacity: 0.95;
}
.big-banner-art {
  width: 88px; height: 88px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.big-banner-art svg { width: 100%; height: 100%; }
@media (min-width: 768px) {
  .big-banner { padding: 32px 36px; gap: 24px; }
  .big-banner-title { font-size: 1.45rem; }
  .big-banner-art { width: 140px; height: 110px; }
}

/* ===== Home featured tweak ===== */
.home-featured { padding: 48px 0 64px; }
@media (min-width: 768px) { .home-featured { padding: 64px 0 96px; } }

/* ===== Definition list (info rows) ===== */
.def-list {
  display: grid; grid-template-columns: 1fr; gap: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin: 16px 0;
}
.def-list .row {
  display: grid; grid-template-columns: 140px 1fr; gap: 16px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.def-list .row:last-child { border-bottom: 0; }
.def-list .row .k { color: var(--text-muted); font-weight: 500; }
.def-list .row .v { color: var(--text); }
@media (max-width: 600px) {
  .def-list .row { grid-template-columns: 1fr; gap: 4px; }
  .def-list .row .k { font-size: 0.82rem; }
}


/* ===== Reference numbers section ===== */
.ref-section {
  padding: 48px 0 56px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
@media (min-width: 768px) { .ref-section { padding: 72px 0 80px; } }

.ref-grid {
  display: grid; gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .ref-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .ref-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }

.ref-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 22px 18px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.ref-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 20px -12px rgba(15, 23, 42, 0.15);
}
.ref-head { display: flex; flex-direction: column; gap: 4px; }
.ref-tag {
  font-size: 0.72rem; font-weight: 700; color: var(--accent);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.ref-head h3 {
  font-size: 1.02rem; font-weight: 700; margin: 0;
  letter-spacing: -0.02em;
}

table.ref-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.88rem; font-variant-numeric: tabular-nums;
}
table.ref-table th, table.ref-table td {
  padding: 9px 0; border-bottom: 1px dashed var(--border);
  text-align: left; vertical-align: top;
}
table.ref-table th {
  color: var(--text-muted); font-weight: 500;
  width: 45%;
}
table.ref-table td {
  font-weight: 600; color: var(--text); text-align: right;
}
table.ref-table tr:last-child th, table.ref-table tr:last-child td {
  border-bottom: 0;
}

.ref-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.ref-list li {
  font-size: 0.88rem; color: var(--text-muted); line-height: 1.55;
  padding-left: 14px; position: relative;
}
.ref-list li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
}
.ref-list li strong {
  color: var(--text); font-weight: 700; margin-right: 4px;
}

.ref-foot {
  font-size: 0.78rem; color: var(--text-subtle); line-height: 1.55;
  padding-top: 4px;
}
.ref-link {
  font-size: 0.85rem; font-weight: 600; color: var(--accent);
  margin-top: auto;
}
.ref-link:hover { text-decoration: underline; }

/* ===== Interior material grid (with art) ===== */
.material-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(2, 1fr);
  margin: 16px 0 24px;
}
@media (min-width: 768px) { .material-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }

.material-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.material-card:hover {
  transform: translateY(-2px); border-color: var(--accent);
  box-shadow: 0 12px 32px -16px rgba(30, 58, 138, 0.22);
}
.material-art {
  position: relative; width: 100%; aspect-ratio: 16/10;
  background: var(--accent-soft);
  overflow: hidden;
}
.material-art svg { width: 100%; height: 100%; display: block; }
.material-body { padding: 16px 16px 18px; }
.material-body h3 { font-size: 1rem; margin: 6px 0 4px; }
.material-body p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

/* ===== Calculator: DSR / loan-compare specifics ===== */
.dsr-gauge {
  margin-top: 20px; padding: 18px 16px;
  background: var(--surface-2); border-radius: 12px;
}
.dsr-gauge .label-row {
  display: flex; justify-content: space-between; font-size: 0.82rem;
  color: var(--text-muted); margin-bottom: 8px;
}
.dsr-track {
  position: relative; height: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; overflow: hidden;
}
.dsr-fill {
  position: absolute; top: 0; bottom: 0; left: 0;
  background: linear-gradient(90deg, #2563eb 0%, #1e3a8a 100%);
  border-radius: 999px; transition: width 0.3s;
}
.dsr-fill.warn { background: linear-gradient(90deg, #b45309 0%, #b91c1c 100%); }
.dsr-marks {
  position: relative; height: 18px; margin-top: 4px;
  font-size: 0.72rem; color: var(--text-muted);
}
.dsr-mark {
  position: absolute; top: 0; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
}
.dsr-mark::before {
  content: ""; width: 1px; height: 6px; background: var(--border-strong);
  margin-bottom: 2px;
}

.compare-bars { margin-top: 20px; }
.compare-bar-row {
  display: grid; grid-template-columns: 90px 1fr 100px;
  gap: 10px; align-items: center; padding: 10px 0;
  font-size: 0.88rem;
}
.compare-bar-row .label { color: var(--text-muted); font-weight: 600; }
.compare-bar-row .bar-track {
  height: 22px; background: var(--surface-2); border-radius: 6px;
  position: relative; overflow: hidden;
}
.compare-bar-row .bar-principal {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--accent); border-radius: 6px 0 0 6px;
}
.compare-bar-row .bar-interest {
  position: absolute; top: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(30,58,138,0.55), rgba(30,58,138,0.35));
}
.compare-bar-row .amount {
  text-align: right; font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}
.compare-legend {
  display: flex; gap: 16px; margin-top: 8px; padding-left: 100px;
  font-size: 0.78rem; color: var(--text-muted);
}
.compare-legend span { display: inline-flex; align-items: center; gap: 6px; }
.compare-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.compare-legend .lg-principal { background: var(--accent); }
.compare-legend .lg-interest { background: rgba(30,58,138,0.45); }
@media (max-width: 600px) {
  .compare-bar-row { grid-template-columns: 70px 1fr 80px; gap: 6px; font-size: 0.78rem; }
  .compare-legend { padding-left: 76px; }
}

/* ===== Topic page quick-nav button (e.g., "전체 스케줄 보기") ===== */
.topic-quicknav { margin: 12px 0 28px; }
.topic-quick-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600;
  color: var(--text-muted); background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.topic-quick-btn::after { content: '↓'; font-size: 0.9em; }
.topic-quick-btn:hover {
  color: var(--text); border-color: var(--accent); background: var(--accent-soft);
}

/* ===== Scenario tabs (종합 대시보드) ===== */
.scn-tabs {
  display: flex; flex-wrap: nowrap; gap: 6px;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 4px; background: var(--surface);
  margin: 4px 0 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scn-tabs::-webkit-scrollbar { display: none; }
.scn-tab {
  flex-shrink: 0;
  padding: 8px 16px; border-radius: 999px;
  font-size: 0.88rem; font-weight: 600;
  color: var(--text-muted); white-space: nowrap;
  transition: all 0.15s;
}
.scn-tab:hover { color: var(--text); }
.scn-tab.active { background: var(--accent); color: #fff; }
.scn-section-title {
  font-size: 0.82rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-muted);
  margin: 24px 0 12px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.scn-section-title:first-child { margin-top: 0; }

.scn-note {
  font-size: 0.8rem; color: var(--text-muted);
  background: var(--accent-soft); color: var(--accent-text);
  padding: 10px 12px; border-radius: var(--radius-sm);
  margin-top: 12px; line-height: 1.55;
}

/* 빈 차트 placeholder */
.chart-wrap { position: relative; min-height: 240px; }
.chart-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-subtle); font-size: 0.88rem; text-align: center;
  pointer-events: none;
}

/* 최근 규제·정책 뉴스 카드 */
.news-section { margin-top: 56px; }
.news-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
@media (min-width: 640px) { .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.news-card {
  display: block;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.15s;
}
.news-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.news-tag {
  display: inline-block;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent); background: var(--accent-soft);
  padding: 3px 8px; border-radius: 999px;
  margin-bottom: 10px;
}
.news-card h3 {
  font-size: 1rem; line-height: 1.4; margin-bottom: 8px;
  color: var(--text);
}
.news-card p {
  font-size: 0.85rem; color: var(--text-muted); line-height: 1.55;
  margin-bottom: 10px;
}
.news-link {
  font-size: 0.82rem; font-weight: 600; color: var(--accent);
}

/* 피드백 게시판 — 작성 버튼을 탭 헤더 우측에 */
.fb-tabs-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.fb-tabs-row .fb-tabs {
  border-bottom: 0; margin-bottom: 0;
}
.fb-write-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 0.85rem; font-weight: 700;
  white-space: nowrap;
  margin-bottom: 4px;
  transition: background 0.15s, transform 0.15s;
}
.fb-write-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.fb-write-btn svg { color: #fff; }

/* 기존 FAB는 페이지에서 제거됨 (스타일은 유지하되 사용 안 함) */

/* ===== Board category filter + category badges ===== */
.fb-cat-filter {
  padding: 7px 10px; border: 1px solid var(--border, #d1d5db);
  border-radius: 999px; font-size: 0.82rem; background: #fff;
  font-family: inherit; cursor: pointer; max-width: 150px;
}
@media (max-width: 540px) {
  .fb-tabs-row { flex-wrap: wrap; gap: 8px; }
  .fb-cat-filter { font-size: 0.78rem; padding: 6px 8px; }
}
.badge-cat {
  font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  display: inline-block; margin-right: 4px; letter-spacing: -0.01em;
}
.badge-cat[data-cat="free"]     { background: #eff6ff; color: #1d4ed8; }
.badge-cat[data-cat="question"] { background: #fef3c7; color: #92400e; }
.badge-cat[data-cat="review"]   { background: #ecfdf5; color: #047857; }
.badge-cat[data-cat="tip"]      { background: #f5f3ff; color: #6d28d9; }
.badge-cat[data-cat="fix"]      { background: #fee2e2; color: #b91c1c; }
.badge-cat[data-cat="etc"]      { background: #f1f5f9; color: #475569; }

/* ===== Sector cards (홈 계산기 섹션 — 섹터별 대표) ===== */
.sector-row {
  display: grid; gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}
@media (min-width: 640px) { .sector-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .sector-row { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.sector-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s, background 0.18s;
  text-decoration: none;
}
.sector-card:hover {
  transform: translateY(-2px); border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 10px 20px -10px rgba(30,58,138,0.32);
}
.sector-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--accent); text-transform: uppercase;
}
.sector-name {
  font-size: 1rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em;
}

/* ===== Hero Calc Card (홈 상단 종합 계산기 + 맞춤찾기 나란히) ===== */
.hero-calc-grid {
  display: grid; gap: 12px; margin-bottom: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .hero-calc-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .hero-calc-grid.hero-calc-single { grid-template-columns: 1fr; }
}
.hero-calc-card {
  display: flex; gap: 14px;
  padding: 18px; margin-bottom: 0;
  background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
  color: #fff; border-radius: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 12px 24px -12px rgba(30,58,138,0.45);
  align-items: center;
}
.hero-calc-card-alt {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  box-shadow: 0 12px 24px -12px rgba(30,64,175,0.45);
}
.hero-calc-card-alt:hover { box-shadow: 0 18px 30px -14px rgba(30,64,175,0.55); }
.hero-calc-card:hover { transform: translateY(-2px); box-shadow: 0 18px 30px -14px rgba(30,58,138,0.55); }
.hero-calc-icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.18);
  flex-shrink: 0;
}
.hero-calc-icon svg { width: 32px; height: 32px; color: #fff; }
.hero-calc-body { flex: 1; min-width: 0; color: #fff; }
.hero-calc-tag {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.22);
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  margin-bottom: 6px;
}
.hero-calc-body h3 {
  font-size: 1.25rem; color: #fff; line-height: 1.3;
  margin-bottom: 4px; font-weight: 800; letter-spacing: -0.02em;
}
.hero-calc-body p {
  font-size: 0.88rem; color: rgba(255,255,255,0.92);
  margin-bottom: 6px; line-height: 1.5;
}
.hero-calc-cta {
  font-size: 0.85rem; font-weight: 700; color: #fff;
}
@media (max-width: 480px) {
  .hero-calc-card { padding: 18px; gap: 12px; }
  .hero-calc-icon { width: 44px; height: 44px; }
  .hero-calc-icon svg { width: 24px; height: 24px; }
  .hero-calc-body h3 { font-size: 1.1rem; }
  .hero-calc-body p { font-size: 0.82rem; }
}

/* ===== DSR Result Box ===== */
.dsr-box {
  margin-top: 20px; padding: 16px;
  background: var(--surface-2); border-radius: var(--radius);
}
.dsr-box-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
}
.dsr-box-head strong { font-size: 0.92rem; color: var(--text); word-break: keep-all; }
.dsr-pct { font-size: 1.4rem; font-weight: 800; color: var(--text); white-space: nowrap; }
.dsr-bar {
  height: 8px; background: var(--border); border-radius: 999px; overflow: hidden;
}
.dsr-bar-fill {
  height: 100%; width: 0%; background: var(--success);
  transition: width 0.4s ease-out, background 0.3s;
}
.dsr-meta {
  display: flex; justify-content: space-between;
  font-size: 0.75rem; color: var(--text-subtle);
  margin-top: 6px;
}
.dsr-verdict {
  font-size: 0.85rem; color: var(--text); line-height: 1.6;
  margin-top: 10px; word-break: keep-all;
}

/* ===== Material Gallery (인테리어 자재 사진) ===== */
.material-help {
  font-size: 0.82rem; color: var(--text-muted);
  margin: 4px 0 16px;
}
.material-help a { color: var(--accent); text-decoration: underline; }
.material-gallery {
  display: grid; gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 32px;
}
@media (min-width: 640px) { .material-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .material-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.material-card {
  margin: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--surface);
  transition: border-color 0.15s, transform 0.15s;
}
.material-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.material-card img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block;
  background: var(--surface-2);
}
.material-card figcaption {
  padding: 10px 12px;
  font-size: 0.85rem; line-height: 1.5;
}
.material-card figcaption strong {
  display: block; color: var(--text); font-weight: 700;
  font-size: 0.92rem; margin-bottom: 2px;
}
.material-card figcaption span { color: var(--text-muted); font-size: 0.78rem; }

/* ===== Chart wrapper (Chart.js 컨테이너) ===== */
.chart-wrap {
  position: relative; padding: 8px 0;
  margin: 12px 0;
  min-height: 220px;
}
.chart-wrap canvas { max-width: 100%; }
.breakdown .dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; margin-right: 6px; vertical-align: middle;
}

/* ===== Rating sliders ===== */
.rating-row {
  display: grid; grid-template-columns: 1fr; gap: 8px;
  padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 10px;
}
.rating-row label { font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.rating-row label .rating-val {
  font-size: 0.95rem; color: var(--accent); font-weight: 800;
}
.rating-row input[type="range"] {
  width: 100%; accent-color: var(--accent);
}
.rating-row .rating-sub { font-size: 0.78rem; color: var(--text-subtle); }

/* ===== D-Day Scheduler (체크리스트) ===== */
.dday-app { margin-top: 8px; }
.dday-form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  margin-bottom: 16px;
}
.dday-form-title { font-size: 1.1rem; margin-bottom: 14px; }
.dday-events {
  display: flex; flex-direction: column; gap: 8px;
  margin: 14px 0;
}
.dday-event-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.5fr) 130px 110px 90px 80px 32px;
  gap: 6px; align-items: center;
}
@media (max-width: 720px) {
  .dday-event-row {
    grid-template-columns: 1fr 1fr 32px;
  }
  .dday-event-row .de-title { grid-column: 1 / 3; }
  .dday-event-row .de-del { grid-column: 3 / 4; grid-row: 1; }
  .dday-event-row .de-date { grid-column: 1 / 2; }
  .dday-event-row .de-amount { grid-column: 2 / 3; }
  .dday-event-row .de-dir { grid-column: 1 / 2; }
  .dday-event-row .de-tag { grid-column: 2 / 4; }
}
.dday-event-row input, .dday-event-row select {
  padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.85rem; background: #fff;
}
.dday-event-row input:focus, .dday-event-row select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(30,58,138,0.12);
}
.dday-event-row .de-del {
  width: 32px; height: 32px;
  border-radius: 6px; background: transparent;
  color: var(--text-muted); border: 1px solid var(--border);
}
.dday-event-row .de-del:hover { background: var(--danger-soft); color: var(--danger); }

.dday-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.dday-actions .btn { font-size: 0.85rem; padding: 8px 14px; }

.dday-future {
  margin-top: 18px;
  font-size: 0.8rem; line-height: 1.65;
  color: var(--text-muted);
  background: var(--accent-soft); color: var(--accent-text);
  padding: 12px 14px; border-radius: var(--radius-sm);
}
.dday-future strong { display: block; color: var(--accent); margin-bottom: 4px; font-weight: 700; }

.dday-summary {
  display: grid; grid-template-columns: repeat(1, 1fr); gap: 8px;
  background: var(--surface-2); border-radius: var(--radius);
  padding: 14px; margin: 16px 0 24px;
}
@media (min-width: 640px) { .dday-summary { grid-template-columns: repeat(3, 1fr); } }
.dday-summary-row {
  display: flex; flex-direction: column; gap: 4px;
}
.dday-summary-row span {
  font-size: 0.78rem; color: var(--text-muted);
}
.dday-summary-row strong {
  font-size: 1rem; color: var(--text); font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* 달력 */
.dday-calendar-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  margin-bottom: 24px;
}
.dday-cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.dday-cal-head h2 { font-size: 1.1rem; margin: 0; }
.dday-nav {
  width: 32px; height: 32px; border-radius: 8px;
  font-size: 1.1rem; color: var(--text-muted);
  border: 1px solid var(--border); background: var(--surface);
}
.dday-nav:hover { color: var(--text); background: var(--surface-2); }
.dday-cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  font-size: 0.78rem; font-weight: 700; color: var(--text-subtle);
  text-align: center; padding-bottom: 6px;
}
.dday-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.dc-cell {
  min-height: 76px; padding: 4px 4px 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; font-size: 0.78rem;
  overflow: hidden;
}
.dc-cell.dc-empty { border-style: dashed; opacity: 0.4; min-height: 76px; }
.dc-cell.dc-today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft) inset; }
.dc-num {
  display: flex; align-items: center; gap: 4px;
  font-weight: 700; color: var(--text-muted); margin-bottom: 2px;
}
.dc-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dc-dot-out { background: #ef4444; }
.dc-dot-in { background: #047857; }
.dc-dot-info { background: var(--accent); }
.dc-dot-both { background: linear-gradient(90deg, #ef4444 50%, #047857 50%); }
.dc-ev {
  font-size: 0.7rem; padding: 2px 5px; border-radius: 4px;
  margin-top: 2px; display: flex; align-items: center; gap: 4px;
  overflow: hidden;
}
.dc-ev .dc-ev-title {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dc-ev .dc-ev-amt {
  font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: 0.68rem;
}
.dc-ev-out { background: rgba(239,68,68,0.12); color: #b91c1c; }
.dc-ev-in { background: rgba(4,120,87,0.14); color: #065f46; }
.dc-ev-info { background: var(--accent-soft); color: var(--accent); }

@media (max-width: 600px) {
  .dc-cell { min-height: 64px; font-size: 0.72rem; }
  .dc-ev { display: none; }
  .dc-ev:first-of-type { display: flex; }
}

/* 타임라인 색상 보강 */
.dday-timeline-section { margin-top: 16px; }
.dt-in .dt-dot { border-color: #047857; }
.dt-out .dt-dot { border-color: #ef4444; }
.dt-info .dt-dot { border-color: var(--accent); }
.dt-amt {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-weight: 700; font-size: 0.82rem;
}
.dt-amt-in { background: rgba(4,120,87,0.12); color: #065f46; }
.dt-amt-out { background: rgba(239,68,68,0.12); color: #b91c1c; }
.dt-amt-info { background: var(--accent-soft); color: var(--accent); }

/* ===== D-Day Timeline ===== */
.dday-timeline {
  position: relative; list-style: none; padding: 0; margin: 0;
}
.dday-timeline::before {
  content: ''; position: absolute;
  left: 110px; top: 4px; bottom: 4px;
  width: 2px; background: var(--border);
}
@media (max-width: 600px) {
  .dday-timeline::before { left: 78px; }
}
.dt-item {
  display: grid; grid-template-columns: 110px 1fr; gap: 16px;
  padding: 14px 0; position: relative;
  align-items: flex-start;
}
@media (max-width: 600px) {
  .dt-item { grid-template-columns: 78px 1fr; gap: 12px; }
}
.dt-dot {
  position: absolute; left: 102px; top: 22px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent);
  z-index: 1;
}
@media (max-width: 600px) {
  .dt-dot { left: 70px; }
}
.dt-past .dt-dot { border-color: var(--text-subtle); opacity: 0.5; }
.dt-meta {
  text-align: right; padding-right: 26px;
  display: flex; flex-direction: column; gap: 2px;
}
.dt-dday {
  font-weight: 800; font-size: 0.95rem; color: var(--accent);
  letter-spacing: -0.02em;
}
.dt-past .dt-dday { color: var(--text-subtle); }
.dt-date { font-size: 0.78rem; color: var(--text-muted); }
.dt-body {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.dt-past .dt-body { opacity: 0.55; }
.dt-title {
  font-weight: 700; font-size: 0.95rem; color: var(--text);
  margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.dt-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.dt-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; }
.dt-empty {
  text-align: center; padding: 40px 0;
  color: var(--text-subtle); font-size: 0.9rem;
}

/* ===== Interactive Contract Viewer ===== */
.contract-viewer {
  display: grid; gap: 16px;
  grid-template-columns: 1fr;
  margin-top: 16px;
}
@media (min-width: 900px) {
  .contract-viewer { grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
  .contract-panel { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; }
}
.contract-doc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 24px 28px;
  font-size: 0.92rem; line-height: 1.85; color: var(--text);
  white-space: normal;
}
.contract-doc h2 {
  font-size: 1.1rem; text-align: center;
  margin: 0 0 16px; padding-bottom: 8px;
  border-bottom: 2px solid var(--text);
  letter-spacing: -0.02em;
}
.contract-doc h3 {
  font-size: 0.95rem; margin: 18px 0 8px; color: var(--text);
}
.contract-doc .article {
  margin: 12px 0; padding-left: 6px;
  border-left: 2px solid transparent;
}
.contract-doc .article-title {
  font-weight: 700; color: var(--text);
  display: inline-block; margin-right: 4px;
}
.contract-doc [data-clause] {
  display: inline; padding: 1px 4px; border-radius: 4px;
  cursor: pointer;
  background: linear-gradient(transparent 60%, rgba(30,58,138,0.10) 60%);
  transition: background 0.15s, color 0.15s, outline 0.15s;
  outline: 1px solid transparent;
}
.contract-doc [data-clause]:hover,
.contract-doc [data-clause]:focus-visible {
  background: rgba(30,58,138,0.18);
  outline-color: var(--accent);
}
.contract-doc [data-clause].active {
  background: var(--accent); color: #fff; outline-color: var(--accent);
}
.contract-doc [data-clause]::before {
  content: '⌕'; font-size: 0.75em; opacity: 0.5;
  margin-right: 2px; vertical-align: 1px;
}
.contract-blank {
  display: inline-block; min-width: 60px;
  border-bottom: 1px solid var(--text-subtle);
  color: var(--text-subtle);
}

.contract-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px;
}
.contract-panel-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.contract-panel-header .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}
.contract-panel-header span {
  font-size: 0.78rem; font-weight: 700;
  color: var(--accent); letter-spacing: 0.04em;
  text-transform: uppercase;
}
.contract-panel h3 {
  font-size: 1.15rem; margin-bottom: 12px;
  color: var(--text);
}
.contract-panel .body { color: var(--text); font-size: 0.92rem; line-height: 1.7; }
.contract-panel .body p { margin-bottom: 10px; }
.contract-panel .caution {
  margin-top: 16px; padding: 12px 14px;
  background: var(--warning-soft); border-radius: var(--radius-sm);
  font-size: 0.85rem; color: var(--text);
  border-left: 3px solid var(--warning);
}
.contract-panel .caution::before {
  content: '⚠ 실무 체크포인트';
  display: block; font-weight: 700; color: var(--warning);
  font-size: 0.78rem; margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.contract-panel-reset {
  margin-top: 14px; font-size: 0.82rem;
  color: var(--text-muted); padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 4px;
}

/* ===== Topic Tabs (가이드 / 계산기 분리) ===== */
.topic-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 8px 0 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.topic-tabs::-webkit-scrollbar { display: none; }
.topic-tab {
  appearance: none; -webkit-appearance: none;
  background: transparent; border: 0;
  padding: 12px 18px;
  font-size: 0.95rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.topic-tab:hover { color: var(--text); }
.topic-tab[aria-selected="true"] {
  color: var(--accent); border-bottom-color: var(--accent);
}
.topic-tab .tt-count {
  display: inline-block; margin-left: 6px;
  font-size: 0.72rem; font-weight: 700;
  padding: 1px 7px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted);
  vertical-align: middle;
}
.topic-tab[aria-selected="true"] .tt-count {
  background: var(--accent-soft); color: var(--accent);
}
.topic-tabpanel { display: none; }
.topic-tabpanel.active { display: block; animation: fadeInTab 0.18s ease-out; }
@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 480px) {
  .topic-tab { padding: 10px 12px; font-size: 0.9rem; }
}

/* ===== Calculator subnav (top of calculators index) ===== */
.calc-cat-head {
  font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
  letter-spacing: 0.04em; text-transform: uppercase;
  margin: 32px 0 12px;
}
.calc-cat-head:first-of-type { margin-top: 0; }

/* ===== Interior items (compact grid of checkboxes) ===== */
.ie-items {
  display: grid; gap: 6px;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .ie-items { grid-template-columns: 1fr 1fr; gap: 6px 12px; } }
.ie-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.ie-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ie-item input { margin: 0; }
.ie-item .ie-name { font-size: 0.9rem; font-weight: 600; flex: 1; min-width: 0; }
.ie-item .ie-unit { font-size: 0.75rem; color: var(--text-subtle); white-space: nowrap; }

/* ===== Language switch (top-right, small) ===== */
.lang-switch {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 1px; background: var(--surface);
  flex-shrink: 0;
}
.lang-switch a {
  font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
  padding: 3px 8px; border-radius: 999px;
  letter-spacing: 0.04em;
  transition: all 0.15s;
  line-height: 1;
}
.lang-switch a.active { background: var(--accent); color: #fff; }
.lang-switch a:hover:not(.active) { color: var(--text); }

/* ===== Feedback board ===== */
.fb-app { margin-top: 8px; }
.fb-form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 32px;
}
.fb-form-card h2 { font-size: 1.15rem; margin-bottom: 16px; }
.fb-form-card textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); resize: vertical; min-height: 120px;
}
.fb-form-card textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30,58,138,0.12);
}
.fb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fb-note {
  font-size: 0.8rem; color: var(--text-subtle);
  margin-top: 12px; line-height: 1.6;
}
.fb-note a { color: var(--accent); text-decoration: underline; }

.fb-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.fb-tab {
  padding: 10px 14px; font-size: 0.92rem; font-weight: 600;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.fb-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.fb-tab .count {
  display: inline-block; min-width: 18px; padding: 0 6px;
  font-size: 0.72rem; background: var(--surface-2); border-radius: 999px;
  color: var(--text-muted); margin-left: 4px;
}

.fb-list { display: flex; flex-direction: column; gap: 12px; }
.fb-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.fb-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.fb-item-title { font-size: 1rem; color: var(--text); }
.fb-item-meta { font-size: 0.78rem; color: var(--text-subtle); margin-bottom: 8px; }
.fb-item-meta .fb-page {
  display: inline-block; padding: 0 6px; border-radius: 4px;
  background: var(--surface-2); margin-left: 4px; font-family: var(--font-mono);
  font-size: 0.72rem;
}
.fb-item-body {
  font-size: 0.92rem; color: var(--text); line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}
.fb-item-foot { margin-top: 10px; text-align: right; }
.fb-del {
  font-size: 0.78rem; color: var(--danger);
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px;
}
.fb-del:hover { background: var(--danger-soft); }
.fb-empty {
  text-align: center; color: var(--text-subtle); font-size: 0.9rem;
  padding: 40px 0;
}
.badge-warn { background: var(--warning-soft); color: var(--warning); }

/* ===== 맨 위로 버튼 (전역 — 한 화면 이상 스크롤 시 표시) ===== */
.to-top {
  position: fixed; right: 16px; bottom: 72px; z-index: 70;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface, #fff);
  color: var(--text-muted); cursor: pointer;
  box-shadow: 0 8px 20px -6px rgba(15, 23, 42, 0.25);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Feedback FAB (작성 버튼) ===== */
.fb-fab {
  position: fixed; right: 24px; bottom: 24px;
  z-index: 60;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 18px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 0.92rem; font-weight: 700;
  box-shadow: 0 10px 24px -8px rgba(30, 58, 138, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}
.fb-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(30, 58, 138, 0.55); }
.fb-fab svg { color: #fff; }
.fb-fab-label { letter-spacing: -0.01em; }
@media (max-width: 480px) {
  .fb-fab { right: 16px; bottom: 16px; padding: 12px 16px; font-size: 0.88rem; }
}

/* ===== Feedback Modal ===== */
.fb-modal {
  position: fixed; inset: 0; z-index: 80;
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.fb-modal.open { display: flex; }
.fb-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.fb-modal-panel {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: fbModalIn 0.18s ease-out;
}
@keyframes fbModalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.fb-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.fb-modal-header h2 { font-size: 1.1rem; margin: 0; }
.fb-modal-close {
  width: 32px; height: 32px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.fb-modal-close:hover { background: var(--surface-2); color: var(--text); }
.fb-modal-body { padding: 22px; }
.fb-modal-body textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); resize: vertical; min-height: 120px;
}
.fb-modal-body textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30,58,138,0.12);
}
.fb-modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 12px;
}

/* ===== Tablet responsive tweaks (768-1024px) ===== */
@media (min-width: 768px) and (max-width: 1023px) {
  .container { padding: 0 24px; }
  /* 태블릿에서도 입력(좌)·결과(우) 2단 유지하되 여백만 살짝 축소 */
  .calc-form, .calc-result { padding: 22px; }
}
/* 표·이미지 가로 스크롤 가드 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 480px; }
/* 칼럼이 적은 컴팩트 표는 화면 폭에 맞춤(스크롤 불필요) */
.table-wrap.compact table { min-width: 0; }

/* ===== Accessibility: skip link ===== */
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 200;
  background: var(--accent); color: #fff;
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600;
  transition: top 0.15s;
}
.skip-link:focus { top: 8px; outline: 2px solid #fff; outline-offset: 2px; }

/* ===== Next-action flow (가이드 → 계산기 → 체크리스트 연결) ===== */
.next-actions {
  margin: 36px 0 8px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); padding: 20px 22px;
}
.next-actions-head {
  font-size: 0.78rem; font-weight: 700; color: var(--accent);
  letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 14px;
}
.next-actions-grid {
  display: grid; gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .next-actions-grid { grid-template-columns: repeat(3, 1fr); } }
.next-action {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg); transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.next-action:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 20px -14px rgba(30,58,138,0.3); }
.next-action .na-step {
  font-size: 0.72rem; font-weight: 700; color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}
.next-action .na-title { font-size: 0.96rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.next-action .na-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }
.next-action .na-go { font-size: 0.82rem; font-weight: 600; color: var(--accent); margin-top: 2px; }

/* ===== 광고·제휴 표시(수익화 도입 대비) ===== */
.aff-disclosure {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--text-muted); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 10px;
}
.aff-disclosure::before { content: "AD"; font-size: 0.62rem; color: var(--text-subtle); }
.aff-note { font-size: 0.8rem; color: var(--text-subtle); margin-top: 8px; }


/* ===== 도움말 툴팁 (?) ===== */
.tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 5px; vertical-align: middle;
  border-radius: 50%; background: var(--surface-2); color: var(--text-muted);
  font-size: 0.7rem; font-weight: 800; cursor: help; position: relative;
  border: 1px solid var(--border-strong); user-select: none; flex-shrink: 0;
}
.tip:hover, .tip:focus, .tip.open {
  background: var(--accent); color: #fff; border-color: var(--accent); outline: none;
}
.tip::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 240px;
  background: #0f172a; color: #fff; font-size: 0.78rem; font-weight: 500; line-height: 1.5;
  letter-spacing: -0.01em; text-align: left; white-space: normal;
  padding: 9px 11px; border-radius: 8px;
  box-shadow: 0 8px 24px -8px rgba(15,23,42,0.45);
  opacity: 0; visibility: hidden; transition: opacity 0.12s; z-index: 70; pointer-events: none;
}
.tip::before {
  content: ""; position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #0f172a;
  opacity: 0; visibility: hidden; transition: opacity 0.12s; z-index: 70; pointer-events: none;
}
.tip:hover::after, .tip:focus::after, .tip.open::after,
.tip:hover::before, .tip:focus::before, .tip.open::before { opacity: 1; visibility: visible; }
@media (max-width: 600px) { .tip::after { max-width: 190px; } }

/* ===== 계산기 결과 공유 / 인쇄 툴바 ===== */
.calc-share {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.calc-share-btn {
  flex: 1 1 auto;
  min-width: 120px;
  padding: 9px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
}
.calc-share-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.calc-share-btn:active { transform: translateY(1px); }
.calc-share-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== 토스트 ===== */
.calc-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: #0f172a;
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 99999;
  pointer-events: none;
}
.calc-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ===== 계산기 인쇄 / PDF — 한 장짜리 보고서 ===== */
/* 화면에서는 숨김. 인쇄 시 JS가 body에 .printing-report를 붙이면 보고서만 출력된다. */
#print-report { display: none; }

@media print {
  @page { size: A4; margin: 10mm; }
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  body.printing-report > *:not(#print-report) { display: none !important; }
  body.printing-report #print-report { display: block !important; }
  /* 모바일이 기기 폭(좁게)으로 렌더해 여러 장이 되던 문제 방지: 보고서를 A4 내용 폭으로 고정 */
  #print-report { width: 190mm; max-width: 100%; margin: 0 auto; }
  /* 작은 단위(행·박스·차트)만 페이지 경계에서 안 쪼개지게. 큰 컨테이너엔 적용하지 않아 빈 페이지가 생기지 않게 한다 */
  #print-report .pr-total, #print-report .pr-table tr,
  #print-report .pr-meter, #print-report .pr-chart {
    page-break-inside: avoid; break-inside: avoid;
  }
}

/* 보고서 레이아웃 (인쇄에서만 보이지만 일반 규칙으로 정의) */
#print-report {
  color: #111;
  font-size: 10pt;
  line-height: 1.4;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
#print-report .pr-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid #1e3a8a; padding-bottom: 5px; margin-bottom: 7px;
}
#print-report .pr-brand { font-weight: 800; color: #1e3a8a; font-size: 10.5pt; }
#print-report .pr-date { color: #555; font-size: 9pt; }
#print-report .pr-title { font-size: 14pt; font-weight: 800; margin: 0 0 9px; }
#print-report .pr-cols { display: flex; gap: 16px; align-items: flex-start; }
#print-report .pr-block { flex: 1 1 0; min-width: 0; }
#print-report .pr-block h2 {
  font-size: 10.5pt; font-weight: 700; color: #1e3a8a;
  border-bottom: 1px solid #ddd; padding-bottom: 3px; margin: 0 0 6px;
}
#print-report .pr-total {
  display: flex; justify-content: space-between; align-items: baseline;
  background: #eff6ff; border: 1px solid #c7d6f5; border-radius: 6px;
  padding: 6px 9px; margin-bottom: 8px;
}
#print-report .pr-total span { font-size: 9.5pt; color: #333; }
#print-report .pr-total strong { font-size: 13pt; color: #1e3a8a; }
#print-report .pr-chart { display: block; width: 100%; max-width: 170px; max-height: 120px; margin: 0 auto 8px; object-fit: contain; }
#print-report .pr-table { width: 100%; border-collapse: collapse; }
#print-report .pr-table th, #print-report .pr-table td {
  text-align: left; padding: 3px 4px; border-bottom: 1px solid #eee;
  vertical-align: top; font-weight: 400;
}
#print-report .pr-table th { color: #444; width: 58%; }
#print-report .pr-table td { text-align: right; font-variant-numeric: tabular-nums; color: #111; }
#print-report .pr-table tr.sub th { padding-left: 12px; color: #777; font-size: 9.5pt; }
#print-report .pr-table tr.sub td { color: #555; font-size: 9.5pt; }
#print-report .pr-meter {
  margin-top: 8px; padding: 6px 8px; border: 1px solid #ddd; border-radius: 6px;
}
#print-report .pr-meter strong { color: #1e3a8a; }
#print-report .pr-meter span { float: right; font-weight: 700; }
#print-report .pr-meter-v { font-size: 9pt; color: #555; margin-top: 2px; }
#print-report .pr-foot {
  margin-top: 14px; padding-top: 8px; border-top: 1px solid #ddd;
  font-size: 8pt; color: #777; line-height: 1.4;
}

/* ===== 기타 대출 다중 행 ===== */
.other-loan-row {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; margin-bottom: 10px; background: #fff;
}
.other-loan-head { display: flex; gap: 8px; align-items: center; }
.other-loan-head .ol-type { flex: 1 1 auto; min-width: 0; }
.ol-remove {
  flex-shrink: 0; width: 32px; height: 32px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: #fff; color: var(--text-muted); cursor: pointer; line-height: 1;
}
.ol-remove:hover { border-color: #b91c1c; color: #b91c1c; }
.other-loan-row .field-row { margin-top: 10px; }
.other-loan-row .scn-note { margin-top: 8px; }
.btn-add-loan {
  display: inline-block; margin-top: 2px; padding: 8px 14px;
  font-size: 0.86rem; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border: 1px dashed var(--accent);
  border-radius: 8px; cursor: pointer;
}
.btn-add-loan:hover { background: #e0ebff; }

/* ===== 모바일(<768px): 1단 레이아웃 — 가독성 우선, 데스크톱과 같은 크기 유지 ===== */
@media (max-width: 767px) {
  .calc-form, .calc-result { padding: 18px 16px; border-radius: 12px; }
  .field { margin-bottom: 16px; }
  /* 한 줄 2칸 입력은 세로로 */
  .field-row { grid-template-columns: 1fr; gap: 12px; }
  .radio-group label { min-width: 0; flex: 1 1 calc(50% - 4px); padding: 9px 8px; font-size: 0.88rem; }
  .calc-result .total { font-size: clamp(1.5rem, 7.5vw, 2rem); }
  .chart-wrap { min-height: 160px; max-height: 220px; }
  .container { padding: 0 14px; }
  .dsr-box-head { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* ===== TTS button (auto-attached, 결과 영역 우상단) ===== */
.tts-btn {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.7rem; font-weight: 600; cursor: pointer;
  z-index: 5; line-height: 1;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tts-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.tts-btn[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.tts-btn svg { width: 11px; height: 11px; }
@media print { .tts-btn { display: none !important; } }
