/* =========================================
   article.css
   아이와 함께하는 돈 공부 - 게시글 공용 스타일
   ========================================= */

/* ── 기본 ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ── 웹 접근성: 본문 바로가기 스킵 내비게이션 ── */
.skip-nav {
  position: absolute;
  top: -9999px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a2332;
  color: #fff;
  padding: 12px 24px;
  font-weight: 700;
  border-radius: 0 0 8px 8px;
  z-index: 99999;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: top 0.2s ease;
}

.skip-nav:focus {
  top: 0;
  outline: 2px solid #3b82f6;
}

html,
body {
  overflow-x: clip;
  width: 100%;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  background: #f4f6f9;
  color: #222;
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ── 헤더 (category.html과 완벽 일치: 화이트 헤더, 네이비 로고, 알약형 메뉴) ── */
header[role="banner"] {
  background: #1a2332;
  border-bottom: 1px solid #1a2332;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
  padding: 0;
}

.nav-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 24px 41px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}

.nav-logo-img {
  height: 48px;
  width: auto;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
  image-rendering: -webkit-optimize-contrast;
  transition: transform .2s ease, opacity .2s ease;
}

.logo:hover .nav-logo-img {
  transform: scale(1.03);
  opacity: 0.95;
}

.menu {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center
}

.menu-list {
  display: flex;
  gap: 4px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu a {
  color: #c8d8ea;
  text-decoration: none;
  font-size: 18px;
  padding: 9px 19px;
  border-radius: 20px;
  transition: background .2s, color .2s
}

.menu a:hover,
.menu a.on {
  background: #173b63;
  color: #fff
}

/* ── 헤더 금융 키워드 검색창 ── */
.nav-search-form {
  display: inline-flex;
  align-items: center;
  position: relative;
  margin-left: 10px;
}

.nav-search-input {
  width: 175px;
  height: 36px;
  padding: 0 34px 0 14px;
  font-size: 13.5px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  outline: none;
  transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.nav-search-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
}

.nav-search-input:focus {
  width: 220px;
  background: rgba(255, 255, 255, 0.16);
  border-color: #38a169;
  box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.25);
}

.nav-search-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s ease, transform .2s ease;
}

.nav-search-btn:hover {
  color: #4ade80;
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .nav-search-form {
    margin-left: 4px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
  }

  /* 모바일 환경: 평소에는 돋보기 아이콘 버튼 형태 유지 */
  .nav-search-input {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    border: 1px solid transparent;
    color: transparent;
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-search-input::placeholder {
    color: transparent;
  }

  /* 돋보기 클릭 / 포커스 / active 시: PC 환경처럼 그 자리에서 알약형으로 확장 */
  .nav-search-form:focus-within .nav-search-input,
  .nav-search-form.active .nav-search-input,
  .nav-search-input:focus {
    width: clamp(130px, 38vw, 175px);
    height: 32px;
    padding: 0 30px 0 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid #38a169;
    color: #ffffff;
    cursor: text;
    box-shadow: 0 0 0 2px rgba(56, 161, 105, 0.25);
    z-index: 1;
  }

  .nav-search-form:focus-within .nav-search-input::placeholder,
  .nav-search-form.active .nav-search-input::placeholder,
  .nav-search-input:focus::placeholder {
    color: rgba(255, 255, 255, 0.6);
  }

  .nav-search-btn {
    position: absolute;
    right: 7px;
    width: 24px;
    height: 24px;
    z-index: 3;
    pointer-events: auto;
  }
}



/* ── 최상단 히어로 박스 (index.html과 동일한 중앙 정렬) ── */
/* ── 최상단 히어로 박스 (index.html과 동일한 중앙 정렬 및 PC 슬림화) ── */
.article-hero {
  background: none;
  color: #173b63;
  padding: 32px 24px 20px;
  text-align: center;
  max-width: 1060px;
  margin: 0 auto;
  position: static;
  box-shadow: none;
  border: none;
}

.article-hero .cat-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  background: #ebf3fb;
  color: #173b63;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.article-hero h1.article-title {
  font-size: 27px;
  font-weight: 800;
  line-height: 1.32;
  color: #173b63;
  letter-spacing: -.5px;
  margin-bottom: 8px;
  word-break: keep-all;
}

.article-hero .article-meta {
  font-size: 13px;
  color: #7a8fa6;
  font-weight: 500;
  margin-bottom: 0;
}

.article-hero .article-meta a,
.article-meta a,
.article-hero .article-meta .author-link,
.article-meta .author-link,
.article-hero .article-meta .author,
.article-meta .author {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.article-hero .article-meta a:hover,
.article-meta a:hover,
.article-hero .article-meta .author-link:hover,
.article-meta .author-link:hover,
.article-hero .article-meta .author:hover,
.article-meta .author:hover {
  color: #173b63;
}

/* ── 레이아웃 (메인 본문 카드 PC 슬림 최적화) ── */
main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px 50px;
}

article {
  max-width: 1060px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #e2e7f0;
  border-radius: 14px;
  padding: 30px 42px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .03);
}

/* ── 카테고리 배지 & 제목 기본값 ── */
.cat-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background: #ebf3fb;
  color: #173b63;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

h1.article-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.35;
  color: #173b63;
  margin-bottom: 8px;
}

.article-meta {
  font-size: 13px;
  color: #7a8fa6;
  margin-bottom: 16px;
}

/* ── 광고 슬롯 카드 (애드센스 호환 및 반응형 최적화 - 심사 기간 동안 비활성화) ── */
.ad-slot {
  display: none !important;
  /* 구글 애드센스 심사 통과 전 미완성 더미 노출 방지 */
  background: #eef1f7;
  border: 1px dashed #c8d4e8;
  border-radius: 8px;
  padding: 12px 0;
  text-align: center;
  color: #aaa;
  font-size: 12.5px;
  margin: 22px auto;
  min-height: 100px;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.ad-slot span {
  display: inline-block;
  font-size: 12.5px;
  color: #aaa;
  letter-spacing: .5px;
  line-height: 76px;
}

.ad-slot ins.adsbygoogle {
  display: block !important;
  margin: 0 auto;
}

/* ── 글 도입부 (대제목 바로 아래 인트로 글: 인용문 서식 없이 순수 본문 글 & 줄 맞춤) ── */
.article-intro,
.article-intro-box,
.article-intro-lead {
  margin: 16px 0 22px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.article-intro p,
.article-intro-box p,
.article-intro-lead {
  font-size: 16px;
  line-height: 1.85;
  color: #334155;
  margin-bottom: 12px;
  text-align: justify;
  text-justify: inter-word;
  word-break: break-all;
}

.article-intro p:last-child,
.article-intro-box p:last-child {
  margin-bottom: 0;
}

/* ── 핵심 요약 카드 (Key Takeaways) ── */
.summary-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 22px 0;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.summary-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
  letter-spacing: -.2px;
}

.summary-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.summary-box li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.68;
  color: #334155;
}

.summary-box li:last-child {
  margin-bottom: 0;
}

.summary-box li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #64748b;
}

.summary-box strong {
  color: #0f172a;
  font-weight: 700;
}

.summary-box p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.68;
  color: #475569;
}

/* ── 목차 카드 (초슬림 접기/펼치기 아코디언 & SEO 100% 보존) ── */
details.toc {
  background: #f8f9fb;
  border: 1px solid #e2e7f0;
  border-radius: 9px;
  margin: 16px 0;
  font-size: 13.5px;
  overflow: hidden;
  transition: all .2s ease;
}

details.toc summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  font-size: 13px;
  font-weight: 700;
  color: #556980;
  transition: background .15s ease, color .15s ease;
}

details.toc summary::-webkit-details-marker {
  display: none;
}

details.toc summary:hover {
  background: #f1f4f8;
  color: #173b63;
}

/* 세련된 회전 화살표(chevron) 아이콘 */
details.toc summary::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 2px solid #7a8fa6;
  border-bottom: 2px solid #7a8fa6;
  transform: rotate(45deg);
  transition: transform .2s ease;
  margin-left: 8px;
}

details.toc[open] summary::after {
  transform: rotate(-135deg);
}

details.toc[open] summary {
  border-bottom: 1px solid #eef2f7;
  color: #173b63;
}

details.toc ul,
details.toc ol {
  list-style: none;
  margin: 0;
  padding: 10px 16px 12px;
}

details.toc li {
  margin: 5px 0;
  font-size: 13.5px;
}

details.toc a {
  color: #2e7d52;
  text-decoration: none;
}

details.toc a:hover {
  text-decoration: underline;
}

/* 기존 div.toc 레거시 호환성 */
div.toc {
  background: #f8f9fb;
  border: 1px solid #e2e7f0;
  border-radius: 10px;
  padding: 13px 18px;
  margin: 16px 0;
  font-size: 13.5px;
}

div.toc strong {
  display: block;
  font-size: 12px;
  color: #7a8fa6;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

div.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

div.toc li {
  margin: .25em 0;
}

div.toc a {
  color: #2e7d52;
  text-decoration: none;
}

div.toc a:hover {
  text-decoration: underline;
}

/* ── 본문 스타일 ── */
.article-body {
  font-size: 16px;
  line-height: 1.9;
  color: #333
}

.article-body h2 {
  font-size: 1.35em;
  font-weight: 700;
  color: #173b63;
  margin: 1.6em 0 .6em;
  padding-bottom: .3em;
  border-bottom: 2px solid #e8f0fe;
  scroll-margin-top: 85px;
}

.article-body h3 {
  font-size: 1.1em;
  font-weight: 700;
  color: #1e5a9c;
  margin: 1.3em 0 .5em;
  scroll-margin-top: 85px;
}

.article-body p {
  margin: .7em 0;
  text-align: justify;
  text-justify: inter-word;
  word-break: break-all;
}

.article-body ul,
.article-body ol {
  margin: .7em 0 .7em 1.6em
}

.article-body li {
  margin: .3em 0
}

.article-body blockquote {
  margin: 1em 0;
  padding: 11px 16px;
  font-size: 14.5px;
  line-height: 1.75;
  border-radius: 6px;
  position: relative;
}

.article-body blockquote.quote-line,
.article-body blockquote:not([class]) {
  border-left: 4px solid #2e7d52;
  background: #f8faf9;
  color: #333;
  padding-left: 16px;
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

.article-body blockquote.quote-quote {
  margin: 1em 0;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  padding: 11px 16px;
  text-align: left;
  font-weight: 500;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.article-body blockquote.quote-quote::before {
  content: "“";
  font-family: Georgia, serif;
  font-size: 1.4em;
  line-height: 0;
  vertical-align: -0.2em;
  color: #2e7d52;
  margin-right: 4px;
  font-weight: bold;
  opacity: 0.85;
}

.article-body blockquote.quote-quote::after {
  content: "”";
  font-family: Georgia, serif;
  font-size: 1.4em;
  line-height: 0;
  vertical-align: -0.2em;
  color: #2e7d52;
  margin-left: 4px;
  font-weight: bold;
  opacity: 0.85;
}

.article-body blockquote.quote-quote p {
  display: inline;
  margin: 0;
}

.article-body blockquote.quote-box {
  border: 1px solid #e2e8f0;
  border-left: 4px solid #1e88e5;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  color: #334155;
  padding: 12px 16px;
  border-radius: 8px;
}

.article-body blockquote.quote-note {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  color: #78350f;
  padding: 12px 16px;
  border-radius: 6px;
}

/* 표(Table) 스타일 */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 14.5px;
  line-height: 1.6;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.article-body table th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  padding: 10px 14px;
  text-align: center;
}

.article-body table td {
  border: 1px solid #cbd5e1;
  padding: 10px 14px;
  color: #334155;
  text-align: left;
}

.article-body table tr:nth-child(even) {
  background-color: #f8fafc;
}

.article-body table tr:hover {
  background-color: #f1f5f9;
}

/* 표 데이터 출처 및 산출 기준 */
.table-source {
  font-size: 13px;
  color: #64748b;
  margin-top: -6px;
  margin-bottom: 22px;
  line-height: 1.6;
}

.article-body a {
  color: #2e7d52;
  text-decoration: underline
}

.article-body hr {
  border: none;
  border-top: 2px solid #e4e8f0;
  margin: 1.5em 0
}

.article-body figure {
  margin: 1.2em 0;
  text-align: center
}

.article-body figure img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08)
}

.article-body figcaption {
  font-size: 13px;
  color: #888;
  margin-top: 6px
}

/* ── 대표 이미지 (PC에서 720px 최적 균형, 모바일에서 100% 꽉 참) ── */
.featured-image {
  margin: 12px 0 20px;
  text-align: center;
}

.featured-image img {
  display: inline-block;
  width: 100%;
  max-width: 720px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, .08);
}

.featured-image figcaption {
  font-size: 12.5px;
  color: #888;
  margin-top: 6px;
  text-align: inherit;
}

/* ── 관련 글 카드 (스크린샷 231 일치 가로형 피드 레이아웃) ── */
.related-posts {
  margin: 32px 0 24px;
}

.related-title {
  font-size: 18px;
  font-weight: 800;
  color: #173b63;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.related-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.related-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .03);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(23, 59, 99, .08);
  border-color: #aac1e0;
}

.related-card:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* 왼쪽 텍스트 정보 */
.related-card .r-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.related-card h3,
.related-card h4 {
  font-size: 15.5px;
  font-weight: 700;
  color: #173b63;
  line-height: 1.45;
  margin: 0 0 8px;
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .18s;
}

.related-card:hover h3,
.related-card:hover h4 {
  color: #2563eb;
}

.related-card .r-arrow {
  font-size: 12.5px;
  font-weight: 600;
  color: #2563eb;
  transition: color .18s, transform .18s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.related-card:hover .r-arrow {
  transform: translateX(3px);
}

/* 오른쪽 대표 이미지(썸네일) */
.related-card .r-thumb {
  flex-shrink: 0;
  width: 130px;
  height: 88px;
  border-radius: 9px;
  overflow: hidden;
  background: #edf2f7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

.related-card .r-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.related-card:hover .r-thumb img {
  transform: scale(1.05);
}

.related-card:hover .r-arrow {
  color: #173b63;
  transform: translateX(2px);
}

/* ── 금융 면책 카드 (PC 슬림 최적화, 내용 100% 보존) ── */
.disclaimer {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3.5px solid #64748b;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
  margin: 20px 0;
}

.disclaimer strong {
  color: #4a5568;
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ── 푸터 (category.html과 완벽 일치) ── */
footer {
  background: #1a2332;
  color: #7a8fa6;
  text-align: center;
  padding: 36px 20px;
  padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px));
  font-size: 13px;
  line-height: 1.8;
}

footer b {
  color: #c8d8ea;
  font-size: 14.5px;
}

.footer-links {
  margin: 10px 0 6px;
}

.footer-links a {
  color: #9cb2cb;
  font-size: 13px;
  text-decoration: none;
  margin: 0 7px;
  transition: color .2s;
}

.footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

footer .copyright {
  color: #8fa2ba;
  font-size: 12.5px;
  margin: 10px 0 0;
  letter-spacing: .2px;
}

/* ── 금융 공식 / 분수 수식 (PC 슬림 클린 스타일, 내용 100% 보존) ── */
.formula-box {
  margin: 18px auto;
  max-width: 480px;
  padding: 10px 18px;
  background: #f8fafc;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.formula-box sup {
  font-size: 0.65em;
  vertical-align: super;
  line-height: 0;
}

/* 수식 정렬 (왼쪽, 가운데, 오른쪽) */
.formula-box.align-left {
  justify-content: flex-start;
  margin-left: 0;
  margin-right: auto;
}

.formula-box.align-center {
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}

.formula-box.align-right {
  justify-content: flex-end;
  margin-left: auto;
  margin-right: 0;
}

/* 박스 형태를 원할 경우 사용할 수 있는 다크 카드 옵션 */
.formula-box.dark {
  background: #1e293b;
  color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 20px 28px;
}

.formula-box.dark .formula-label {
  color: #f1f5f9;
}

.formula-box.dark .numerator {
  border-bottom-color: rgba(255, 255, 255, 0.85);
  color: #38bdf8;
}

.formula-box.dark .denominator {
  color: #e2e8f0;
}

.formula-label {
  display: inline-flex;
  align-items: center;
  color: #1e293b;
  font-weight: 600;
}

.fraction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  text-align: center;
  line-height: 1.15;
}

.numerator {
  padding-bottom: 4px;
  border-bottom: 2px solid #334155;
  width: 100%;
  text-align: center;
  color: #2e7d52;
  /* 바톤 웰스 시그니처 딥 그린 */
  font-weight: 700;
  font-size: 23px;
}

.denominator {
  padding-top: 5px;
  width: 100%;
  text-align: center;
  font-size: 17px;
  color: #334155;
  font-weight: 600;
}

/* ── 반응형 (category.html과 동일한 650px 브레이크포인트 및 래핑) ── */
@media(max-width:900px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(max-width:650px) {
  .nav-inner {
    padding: calc(9px + env(safe-area-inset-top, 0px)) 14px 8px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 5px;
  }

  .logo {
    font-size: 19px;
  }

  .menu {
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .menu a {
    font-size: 13px;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
  }

  .menu a:active {
    background: #173b63;
    color: #fff;
  }

  /* 모바일 헤더: 돋보기 아이콘 전용 & 터치 시 확장 UX */
  .nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav-search-form {
    margin-left: 4px;
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-end;
  }

  /* 초소형 모바일: 평소 돋보기 아이콘 ➡️ 클릭 시 확장 */
  .nav-search-input {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    color: transparent !important;
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .nav-search-input::placeholder {
    color: transparent !important;
  }

  .nav-search-form:focus-within .nav-search-input,
  .nav-search-form.active .nav-search-input,
  .nav-search-input:focus {
    width: clamp(125px, 36vw, 160px) !important;
    height: 32px !important;
    padding: 0 30px 0 12px !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, 0.16) !important;
    border: 1px solid #38a169 !important;
    color: #ffffff !important;
    cursor: text;
    box-shadow: 0 0 0 2px rgba(56, 161, 105, 0.25) !important;
    z-index: 1;
  }

  .nav-search-form:focus-within .nav-search-input::placeholder,
  .nav-search-form.active .nav-search-input::placeholder,
  .nav-search-input:focus::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 11.5px;
  }

  .nav-search-btn {
    position: absolute;
    right: 7px !important;
    width: 24px;
    height: 24px;
    z-index: 3;
    pointer-events: auto !important;
  }

  .nav-search-input:focus::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
  }

  /* ── 1. 모바일 히어로 영역 초슬림화 ── */
  .article-hero {
    padding: 22px 14px 16px;
  }

  .article-hero .cat-badge {
    font-size: 10px;
    padding: 2px 8px;
    margin-bottom: 5px;
  }

  .article-hero h1.article-title {
    font-size: 21px;
    line-height: 1.3;
    margin-bottom: 6px;
  }

  .article-hero .article-meta {
    font-size: 11.5px;
  }

  main {
    padding: 0 12px 36px;
  }

  /* ── 2. 메인 아티클 본문 카드 초슬림화 (내용 100% 보존) ── */
  article {
    padding: 16px 14px 22px;
    border-radius: 12px;
  }

  .featured-image {
    margin: 8px 0 14px;
  }

  .featured-image img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  .featured-image figcaption {
    font-size: 11.5px;
    line-height: 1.45;
    color: #8a99ad;
    word-break: keep-all;
  }

  /* ── 2-1. 핵심 요약 카드 모바일 최적화 ── */
  .summary-box {
    padding: 13px 15px;
    margin: 14px 0 16px;
    border-radius: 9px;
  }

  .summary-title {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .summary-box li {
    font-size: 13px;
    line-height: 1.55;
    padding-left: 15px;
    margin-bottom: 6px;
  }

  .summary-box li::before {
    left: 2px;
    top: 7px;
    width: 4px;
    height: 4px;
  }

  /* ── 3. 목차 카드 아코디언 모바일 최적화 ── */
  details.toc {
    margin: 12px 0 16px;
    border-radius: 8px;
    font-size: 12.5px;
  }

  details.toc summary {
    padding: 9px 13px;
    font-size: 12px;
  }

  details.toc ul {
    padding: 8px 13px 10px;
  }

  details.toc a {
    display: block;
    padding: 3.5px 1px;
    border-radius: 4px;
    word-break: keep-all;
  }

  details.toc a:active {
    color: #1e5a9c;
    text-decoration: underline;
  }

  div.toc {
    padding: 11px 14px;
    margin: 12px 0 16px;
    border-radius: 9px;
    font-size: 12.5px;
  }

  /* ── 4. 본문 타이포 & 인포 박스 카드 초슬림화 ── */
  .article-body {
    font-size: 15px;
    line-height: 1.82;
  }

  .article-body h2 {
    font-size: 1.18em;
    margin: 1.2em 0 .4em;
    padding-bottom: .2em;
  }

  .article-body h3 {
    font-size: 1.05em;
    margin: 1em 0 .3em;
  }

  .article-body p {
    margin: .55em 0;
    text-align: justify;
    text-justify: inter-word;
    word-break: break-all;
  }

  .article-body ul,
  .article-body ol {
    margin: .6em 0 .6em 1.25em;
  }

  .article-body li {
    margin: .25em 0;
  }

  .article-body blockquote {
    padding: 9px 12px;
    margin: .8em 0;
    font-size: 13.5px;
    line-height: 1.65;
  }

  .article-body blockquote.quote-quote {
    padding: 10px 13px;
    margin: .8em 0;
    word-break: keep-all;
  }

  .article-body blockquote.quote-box,
  .article-body blockquote.quote-note {
    padding: 10px 13px;
    margin: .8em 0;
    word-break: keep-all;
  }

  /* ── 5. 표(Table) 모바일 엑셀(스프레드시트) 한 화면 최적화 (가로 스크롤 완전 제거) ── */
  .article-body table,
  .article-body table.data-table,
  .article-body table.account-compare-table {
    display: table !important;
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    margin: 14px 0 !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
    background: #ffffff !important;
    white-space: normal !important;
    overflow-x: hidden !important;
  }

  .article-body table caption {
    display: table-caption !important;
    caption-side: top !important;
    width: 100% !important;
    white-space: normal !important;
    text-align: left !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-bottom: 8px !important;
    line-height: 1.4 !important;
    padding: 0 0 6px 2px !important;
  }

  .article-body table thead {
    display: table-header-group !important;
  }

  .article-body table tbody {
    display: table-row-group !important;
  }

  .article-body table tr {
    display: table-row !important;
    background: #ffffff !important;
  }

  .article-body table tr:nth-child(even) td {
    background-color: #f8fafc !important;
  }

  /* 엑셀 헤더 셀 스타일 */
  .article-body table th {
    background: #eef2f6 !important;
    color: #0f172a !important;
    font-size: clamp(11.5px, 2.9vw, 12.5px) !important;
    font-weight: 700 !important;
    border: 1px solid #cbd5e1 !important;
    border-bottom: 2px solid #94a3b8 !important;
    padding: 7px 2px !important;
    text-align: center !important;
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
    line-height: 1.3 !important;
    letter-spacing: -0.2px !important;
    min-width: 0 !important;
  }

  /* 엑셀 행 제목 (1열: 구분/비교항목) */
  .article-body table th[scope="row"] {
    display: table-cell !important;
    background: #f8fafc !important;
    color: #1e293b !important;
    font-size: clamp(11px, 2.8vw, 12px) !important;
    font-weight: 700 !important;
    border: 1px solid #cbd5e1 !important;
    padding: 6px 2px !important;
    text-align: center !important;
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
    line-height: 1.35 !important;
    letter-spacing: -0.2px !important;
    min-width: 0 !important;
  }

  /* 엑셀 데이터 셀 공통 */
  .article-body table td {
    display: table-cell !important;
    border: 1px solid #cbd5e1 !important;
    padding: 6px 3px !important;
    font-size: clamp(11px, 2.8vw, 12px) !important;
    line-height: 1.36 !important;
    color: #334155 !important;
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
    letter-spacing: -0.2px !important;
    min-width: 0 !important;
    vertical-align: middle !important;
    text-align: left !important;
  }

  /* 4열 테이블 열 비율 자동 배분 */
  .article-body table tr > *:nth-last-child(4):first-child,
  .article-body table tr > *:nth-last-child(4):first-child ~ * {
    width: 24% !important;
  }
  .article-body table tr > *:nth-last-child(4):first-child {
    width: 21% !important;
  }
  .article-body table tr > *:nth-last-child(4):first-child ~ *:last-child {
    width: 31% !important;
  }

  /* 3열 테이블 열 비율 자동 배분 */
  .article-body table tr > *:nth-last-child(3):first-child,
  .article-body table tr > *:nth-last-child(3):first-child ~ * {
    width: 36% !important;
  }
  .article-body table tr > *:nth-last-child(3):first-child {
    width: 28% !important;
  }

  /* 5열 테이블 열 비율 자동 배분 */
  .article-body table tr > *:nth-last-child(5):first-child,
  .article-body table tr > *:nth-last-child(5):first-child ~ * {
    width: 20% !important;
  }

  .table-source {
    font-size: 11.5px;
    margin-top: 4px;
    margin-bottom: 16px;
    line-height: 1.55;
    white-space: normal;
    word-break: keep-all;
  }

  /* ── 6. 광고 슬롯 카드 슬림화 (모바일 300px 너비 완전 보장) ── */
  .ad-slot {
    margin: 16px auto;
    padding: 8px 0;
    min-height: 90px;
    max-width: 100%;
    overflow: hidden;
  }

  /* ── 7. 수식 카드 초슬림화 & 모바일 넘침 완전 방어 (내용 100% 보존) ── */
  .formula-box {
    padding: 9px 14px;
    font-size: 15px;
    gap: 9px;
    margin: 13px auto;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    scrollbar-width: thin;
  }

  .formula-box::-webkit-scrollbar {
    height: 3px;
  }

  .formula-box::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
  }

  .numerator {
    font-size: 17px;
    padding-bottom: 2px;
  }

  .denominator {
    font-size: 13px;
    padding-top: 3px;
  }

  /* ── 8. 금융 면책 안내 카드 초슬림화 (내용 100% 보존) ── */
  .disclaimer {
    padding: 10px 13px;
    margin: 15px 0;
    font-size: 11.5px;
    line-height: 1.55;
    border-radius: 7px;
    word-break: keep-all;
  }

  .disclaimer strong {
    font-size: 11px;
    margin-bottom: 3px;
  }

  /* ── 9. 관련 글 카드 모바일 최적화 (스크린샷 231 일치 가로형 피드) ── */
  .related-posts {
    margin: 20px 0 16px;
    padding: 0;
    background: transparent;
    border: none;
  }

  .related-title {
    font-size: 15.5px;
    font-weight: 700;
    gap: 5px;
    margin-bottom: 10px;
  }

  .related-grid {
    gap: 10px;
  }

  .related-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    gap: 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
  }

  .related-card:active {
    background: #f8fafc;
    transform: scale(0.99);
  }

  .related-card .r-info {
    flex: 1;
    min-width: 0;
  }

  .related-card h3,
  .related-card h4 {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.38;
    margin-top: 0;
    margin-bottom: 6px;
    color: #173b63;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: keep-all;
  }

  .related-card .r-arrow {
    font-size: 11.5px;
    color: #2563eb;
    line-height: 1.2;
  }

  .related-card .r-thumb {
    width: 92px;
    height: 68px;
    border-radius: 7px;
    flex-shrink: 0;
  }
}

/* ── 표 캡션 및 시맨틱 스타일 ── */
table caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  color: #334155;
}

table th[scope="row"] {
  font-weight: 700;
  text-align: left;
}

.table-source {
  font-size: 12.5px;
  color: #64748b;
  margin-top: 6px;
  text-align: left;
}

/* ── 학술 참고문헌 박스 ── */
.reference-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 26px 0 10px;
  font-size: 13px;
  color: #475569;
  line-height: 1.65;
}

.reference-box .ref-title {
  display: block;
  font-size: 13.5px;
  color: #1e293b;
  margin-bottom: 8px;
  font-weight: 700;
}

.reference-box ul {
  margin: 0;
  padding-left: 18px;
  list-style-type: disc;
}

.reference-box li {
  margin-bottom: 10px;
  line-height: 1.75;
  word-break: keep-all;
}

.reference-box li:last-child {
  margin-bottom: 0;
}

.reference-box a,
.table-source a {
  color: #1d4ed8;
  text-decoration: underline;
  font-weight: 600;
  transition: color .2s ease;
}

.reference-box a:hover,
.table-source a:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* ── FAQ 아이템 ── */
.faq-item {
  margin-bottom: 20px;
}

.faq-item h3 {
  font-size: 17px;
  margin-bottom: 8px;
  color: #1e293b;
  font-weight: 700;
}

/* ── 절세 한도 안내 박스 (인라인 CSS 제거 및 컴포넌트화) ── */
.tax-limit-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #173b63;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 0;
}

.tax-limit-box .tax-title {
  display: block;
  margin: 0 0 10px;
  color: #173b63;
  font-size: 16px;
  font-weight: 700;
}

.tax-limit-box ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
  color: #334155;
}