/* =========================================================
   TC88 — 저널형 디자인
   다크(기본): 초록빛 검정 + 에메랄드, 금색은 라벨에만
   라이트: 따뜻한 아이보리 + 딥 그린
   글꼴: Pretendard (읽기 편한 고딕)
   ========================================================= */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1310;
  --bg-glow: rgba(63, 160, 116, 0.06);
  --surface: #131b17;
  --surface-2: #18221d;
  --surface-hover: #1c2822;
  --border: #233029;
  --border-strong: #31443a;
  --text: #e3ebe6;
  --text-2: #a9b8b0;
  --muted: #7d8c84;
  --accent: #4dba8a;
  --accent-strong: #6fcfa4;
  --accent-soft: rgba(77, 186, 138, 0.12);
  --accent-ink: #0b120e;
  --gold: #c8a96a;
  --gold-soft: rgba(200, 169, 106, 0.13);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f1ea;
  --bg-glow: rgba(31, 111, 79, 0.05);
  --surface: #fbfaf6;
  --surface-2: #f5f3ec;
  --surface-hover: #eeebe2;
  --border: #e0dbcf;
  --border-strong: #cbc3b2;
  --text: #17201b;
  --text-2: #4b5650;
  --muted: #747d77;
  --accent: #1f6f4f;
  --accent-strong: #1f6f4f;
  --accent-soft: rgba(31, 111, 79, 0.09);
  --accent-ink: #ffffff;
  --gold: #8f7130;
  --gold-soft: rgba(143, 113, 48, 0.11);
  --shadow: 0 8px 24px rgba(23, 32, 27, 0.07);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 85% -80px, var(--bg-glow), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* 영문 라벨 (섹션 머리표) */
.kicker {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold);
}

/* ---------------- 헤더 ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 20px; }

.brand { display: flex; align-items: baseline; gap: 12px; }
.brand-word { font-size: 23px; font-weight: 800; letter-spacing: -0.01em; }
.brand-word i { font-style: normal; color: var(--gold); }
.brand-sub { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.header-right { display: flex; align-items: center; gap: 18px; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a {
  position: relative; padding: 22px 0;
  font-size: 15px; font-weight: 600; color: var(--text-2);
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); }
.nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--accent);
}

.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 17px; height: 17px; }
.menu-btn { display: none; }

/* ---------------- 홈 히어로 ---------------- */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; padding: 76px 0 56px; }
.hero h1 {
  margin: 14px 0 18px; font-size: clamp(32px, 4.4vw, 48px); line-height: 1.28; letter-spacing: -0.03em; font-weight: 800;
}
.hero h1 em { font-style: normal; color: var(--accent-strong); }
.hero-lead { margin: 0 0 28px; max-width: 480px; color: var(--text-2); font-size: 17px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; font-size: 15px; font-weight: 700;
  border: 1px solid var(--border-strong); color: var(--text);
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-strong); }

/* 목차 패널 */
.pillars {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 10px 26px; box-shadow: var(--shadow);
}
.pillars-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 4px; }
.pillars-head span:last-child { font-size: 13px; color: var(--muted); }
.pillar {
  display: grid; grid-template-columns: 30px 1fr auto 18px; gap: 12px; align-items: center;
  margin-top: 10px; padding: 14px 14px 14px 16px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface-2); color: inherit; text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}
.pillar:hover { border-color: var(--accent); background: var(--surface-hover); transform: translateX(2px); }
.pillar-go { width: 18px; height: 18px; color: var(--muted); transition: color .15s; }
.pillar:hover .pillar-go { color: var(--accent); }
.pillar-no { font-size: 13px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.pillar-name { font-size: 17px; font-weight: 700; }
.pillar-desc { font-size: 13.5px; color: var(--muted); }
.pillar-count { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.pillar-count b { color: var(--accent); }
a.pillar:hover .pillar-name { color: var(--accent-strong); }

/* ---------------- 섹션 공통 ---------------- */
.section { padding: 44px 0 8px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 4px 0 0; font-size: 25px; font-weight: 800; letter-spacing: -0.02em; }
.more-link { font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.more-link:hover { color: var(--accent); }

.page-head { padding: 56px 0 26px; }
.page-head h1 { margin: 8px 0 8px; font-size: clamp(30px, 4vw, 40px); letter-spacing: -0.03em; font-weight: 800; }
.page-head p { margin: 0; color: var(--text-2); }

/* ---------------- 유용한 툴 ---------------- */
.tool-group + .tool-group { margin-top: 26px; }
.tool-group-name { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--text-2); }
.tool-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tool-tile {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  transition: border-color .15s, background .15s;
}
a.tool-tile:hover { border-color: var(--accent); background: var(--surface-hover); }
.tool-icon {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
}
.tool-icon svg { width: 22px; height: 22px; }
.tool-tile h3 { margin: 0 0 2px; font-size: 17px; font-weight: 700; }
.tool-tile p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.pill {
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--gold-soft); color: var(--gold);
}
.tool-arrow { color: var(--muted); font-size: 18px; }

/* ---------------- 게시판 ---------------- */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 16px; margin-bottom: 22px; border-radius: 12px;
  background: var(--gold-soft); color: var(--text-2); font-size: 14px; line-height: 1.6;
}
.notice svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; color: var(--gold); }

.board-tools { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--border); }
.board-tools.no-tabs { justify-content: flex-end; border-bottom: 0; }
.board-tools.no-tabs .tabs { display: none; }
.tabs { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; padding: 12px 0; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); }

.search {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  width: 240px; height: 36px; padding: 0 12px; margin: 6px 0;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.search:focus-within { border-color: var(--accent); }
.search svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.search input {
  width: 100%; border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 14px; color: var(--text);
}
.search input::placeholder { color: var(--muted); }

.board-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 4px; }
.board-count { font-size: 14px; color: var(--muted); }
.board-count b { color: var(--accent); }
.view-toggle { display: inline-flex; gap: 4px; }
.view-toggle button {
  display: grid; place-items: center; width: 34px; height: 32px; border-radius: 8px;
  border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer;
}
.view-toggle button.active { border-color: var(--border); background: var(--surface); color: var(--accent); }
.view-toggle svg { width: 17px; height: 17px; }

/* 목록형 */
.post-row {
  display: grid; grid-template-columns: 64px 1fr; gap: 22px; align-items: start;
  padding: 20px 4px; border-bottom: 1px solid var(--border);
}
.post-row:hover .post-title { color: var(--accent-strong); }
.date-block { line-height: 1.1; padding-top: 3px; }
.date-block .md { display: block; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.date-block .y { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.post-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; font-size: 13px; }
.post-cat { font-weight: 700; color: var(--accent); }
.post-tags { color: var(--muted); }
.post-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.45; letter-spacing: -0.015em; transition: color .15s; }
.post-summary { margin: 6px 0 0; font-size: 14.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.badge-new { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: var(--gold); }
.badge-new::before { content: "●"; margin-right: 4px; font-size: 8px; vertical-align: 2px; }
.compact .post-row { grid-template-columns: 54px 1fr; gap: 16px; padding: 16px 2px; }
.compact .date-block .md { font-size: 17px; }
.compact .post-title { font-size: 16.5px; }
.compact .post-summary { display: none; }

/* 카드형 */
.post-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding-top: 14px; }
.post-card {
  display: flex; flex-direction: column; gap: 10px; padding: 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.post-card:hover { border-color: var(--accent); }
.post-card h3 { margin: 0; font-size: 18px; line-height: 1.45; }
.post-card p { margin: 0; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .card-date { margin-top: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.empty {
  padding: 44px 20px; text-align: center; color: var(--muted); font-size: 14.5px;
  border: 1px dashed var(--border-strong); border-radius: 14px; margin-top: 14px;
}
.empty strong { display: block; color: var(--text-2); font-size: 16px; margin-bottom: 4px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }

/* ---------------- 글 보기 ---------------- */
.article { max-width: 740px; margin: 0 auto; padding: 48px 0 24px; }
.article-head { padding-bottom: 22px; margin-bottom: 30px; border-bottom: 1px solid var(--border); }
.article-head h1 { margin: 14px 0 12px; font-size: clamp(27px, 3.6vw, 36px); line-height: 1.38; letter-spacing: -0.02em; }
.article-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.article-body { font-size: 17px; line-height: 1.85; }
.article-body h2 { margin: 2em 0 .6em; font-size: 23px; letter-spacing: -0.01em; }
.article-body h3 { margin: 1.6em 0 .5em; font-size: 19px; }
.article-body p { margin: 0 0 1.1em; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body blockquote {
  margin: 1.4em 0; padding: 12px 18px; border-left: 3px solid var(--gold);
  background: var(--surface); border-radius: 0 10px 10px 0; color: var(--text-2);
}
.article-body blockquote > :last-child { margin-bottom: 0; }
.article-body ul, .article-body ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.article-body li { margin: .25em 0; }
.article-body img { display: block; max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); margin: .6em 0; }
.article-body code { padding: 2px 6px; border-radius: 6px; background: var(--surface-2); font-size: .9em; }
.article-body hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.table-wrap { overflow-x: auto; margin: 1.2em 0; border: 1px solid var(--border); border-radius: 12px; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 15px; }
.article-body th, .article-body td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.article-body th { background: var(--surface-2); font-weight: 700; }
.article-body tr:last-child td { border-bottom: 0; }
.back-link { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); font-weight: 600; }
.back-link:hover { color: var(--accent); }

/* ---------------- 푸터 ---------------- */
.site-footer { margin-top: 80px; padding: 34px 0 44px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13.5px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-brand { color: var(--text-2); font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.footer-brand i { font-style: normal; color: var(--gold); }
.footer-note { max-width: 640px; line-height: 1.7; }
.footer-note p { margin: 0 0 6px; }
.footer-note p:last-child { margin-bottom: 0; }
.footer-note b { color: var(--text-2); font-weight: 700; }

/* ---------------- 반응형 ---------------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding: 56px 0 32px; }
  .post-cards { grid-template-columns: repeat(2, 1fr); }
  .brand-sub { display: none; }
}
@media (max-width: 760px) {
  .container { padding: 0 18px; }
  .menu-btn { display: grid; }
  .nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 6px 18px 14px;
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .nav.open { display: flex; }
  .nav a { padding: 13px 0; border-bottom: 1px solid var(--border); }
  .nav a:last-child { border-bottom: 0; }
  .nav a.active::after { display: none; }
  .nav a.active { color: var(--accent); }
  .tool-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .post-cards { grid-template-columns: 1fr; }
  .board-tools { flex-direction: column-reverse; align-items: stretch; gap: 4px; }
  .search { width: 100%; }
  .post-row { grid-template-columns: 52px 1fr; gap: 14px; }
  .date-block .md { font-size: 17px; }
  .post-title { font-size: 17px; }
}

/* ---------------- 툴(계산기) 공통 ---------------- */
.tool-page { max-width: 820px; }
.calc-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 26px; box-shadow: var(--shadow);
}
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 22px; flex-wrap: wrap; }
.seg button {
  border: 0; background: none; cursor: pointer; font-family: inherit;
  padding: 9px 16px; border-radius: 9px; font-size: 14.5px; font-weight: 700; color: var(--muted);
}
.seg button.active { background: var(--accent); color: var(--accent-ink); }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 18px; }
.field label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 700; color: var(--text-2); }
.field .hint { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.input {
  display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 14px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--bg);
}
.input:focus-within { border-color: var(--accent); }
.input input, .input select {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 17px; font-weight: 600; color: var(--text);
}
.input select { cursor: pointer; }
.input select option { background: var(--surface); color: var(--text); }
.input .unit { font-size: 14px; color: var(--muted); white-space: nowrap; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick button {
  border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer;
  padding: 4px 10px; border-radius: 999px; font-family: inherit; font-size: 12.5px; font-weight: 600;
}
.quick button:hover { border-color: var(--accent); color: var(--accent); }

.result { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.result-main { font-size: 15px; color: var(--text-2); }
.result-big { display: block; margin: 6px 0 4px; font-size: clamp(30px, 5vw, 42px); font-weight: 800; letter-spacing: -0.02em; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
[data-theme="light"] .result-big { color: var(--accent); }
.result-sub { font-size: 14.5px; color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.stat { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.stat span { display: block; font-size: 12.5px; color: var(--muted); }
.stat b { display: block; margin-top: 2px; font-size: 18px; font-variant-numeric: tabular-nums; }

.meter { position: relative; height: 12px; margin: 22px 0 8px; border-radius: 999px; background: linear-gradient(90deg, var(--surface-2), var(--accent-soft) 60%, var(--accent)); border: 1px solid var(--border); }
.meter i { position: absolute; top: 50%; width: 18px; height: 18px; margin-left: -9px; transform: translateY(-50%); border-radius: 50%; background: var(--gold); border: 3px solid var(--bg); }
.meter-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: right; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.data-table tr.hl td { color: var(--accent-strong); font-weight: 700; }
[data-theme="light"] .data-table tr.hl td { color: var(--accent); }

.explain { margin-top: 28px; color: var(--text-2); font-size: 15px; line-height: 1.8; }
.explain h2 { font-size: 19px; color: var(--text); margin: 28px 0 8px; }
.explain ul { padding-left: 1.2em; }
.source { margin-top: 18px; font-size: 13px; color: var(--muted); line-height: 1.7; }

@media (max-width: 640px) {
  .topic-seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .topic-seg button { padding: 10px 6px; font-size: 13.5px; }
  .calc-box { padding: 20px 16px; }
  .field-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}

/* ---------------- 그래프 ---------------- */
:root, [data-theme="dark"] { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; }
[data-theme="light"] { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 4px 0 10px; font-size: 13.5px; color: var(--text-2); }
.chart-legend .sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.sw.s1, .line.s1 { background: var(--s1); stroke: var(--s1); }
.sw.s2, .line.s2 { background: var(--s2); stroke: var(--s2); }
.sw.s3, .line.s3 { background: var(--s3); stroke: var(--s3); }
.sw.s4, .line.s4 { background: var(--s4); stroke: var(--s4); }
.dot.s1 { color: var(--s1); fill: var(--s1); } .dot.s2 { color: var(--s2); fill: var(--s2); }
.dot.s3 { color: var(--s3); fill: var(--s3); } .dot.s4 { color: var(--s4); fill: var(--s4); }
.dot.s5 { color: var(--s5); } .dot.s6 { color: var(--s6); } .dot.s7 { color: var(--s7); }
.sw.s5, .seg-fill.s5 { background: var(--s5); } .sw.s6, .seg-fill.s6 { background: var(--s6); } .sw.s7, .seg-fill.s7 { background: var(--s7); }
.seg-fill.s1 { background: var(--s1); } .seg-fill.s2 { background: var(--s2); } .seg-fill.s3 { background: var(--s3); } .seg-fill.s4 { background: var(--s4); }
.stack-chart { display: grid; gap: 8px; }
.stack-row { display: grid; grid-template-columns: 104px 1fr; gap: 12px; align-items: center; }
.stack-label { font-size: 13px; color: var(--text-2); text-align: right; white-space: nowrap; }
.stack-bar { display: flex; gap: 2px; height: 26px; }
.seg-fill { position: relative; min-width: 2px; height: 100%; cursor: pointer; }
.seg-fill:first-child { border-radius: 4px 0 0 4px; } .seg-fill:last-child { border-radius: 0 4px 4px 0; }
.seg-fill em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 11.5px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.holders td, .holders th { text-align: center; white-space: nowrap; }
.holders td:first-child, .holders th:first-child { text-align: left; }
@media (max-width: 640px) { .stack-row { grid-template-columns: 82px 1fr; gap: 8px; } .stack-label { font-size: 12px; } }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11.5px; font-family: inherit; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; background: none; }
.chart .end-label { fill: var(--text-2); font-size: 12.5px; font-weight: 700; font-family: inherit; }
.chart .grid.zero { stroke: var(--border-strong); stroke-width: 1.5; }
.chart .cross { stroke: var(--border-strong); stroke-width: 1; }
.chart .tip {
  position: absolute; min-width: 180px; padding: 10px 12px; border-radius: 10px; pointer-events: none;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  font-size: 13px; line-height: 1.6; color: var(--text-2);
}
.chart .tip b { color: var(--text); }
.chart .tip-sub { margin-top: 4px; color: var(--muted); font-size: 12px; }
.sub-head { margin: 34px 0 6px; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.topic-seg { margin-bottom: 18px; }
.topic-seg button { padding: 11px 20px; font-size: 15px; }

/* ---------------- 설치 · 시작 페이지 · 공유 ---------------- */
.footer-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.foot-btn {
  border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer;
  padding: 6px 12px; border-radius: 999px; font-family: inherit; font-size: 13px; font-weight: 600;
}
.foot-btn:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 760px) { .footer-actions { align-items: flex-start; flex-direction: row; flex-wrap: wrap; } }

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(0, 0, 0, 0.55); }
.modal-card {
  position: relative; width: 100%; max-width: 460px; max-height: 88vh; overflow: auto;
  padding: 24px 22px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  color: var(--text-2); font-size: 15px; line-height: 1.7;
}
.modal-card h3 { margin: 0 0 8px; color: var(--text); font-size: 19px; }
.modal-card ol { padding-left: 1.2em; margin: 12px 0; }
.modal-card li { margin: 4px 0; }
.modal-card b { color: var(--text); }
.modal-lead { margin: 0 0 6px; }
.modal-sub { margin: 14px 0 12px; font-size: 13.5px; color: var(--muted); }
.modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.copy-row { display: flex; gap: 8px; margin: 12px 0 4px; }
.copy-row input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font-family: inherit; font-size: 14px; }
.copy-row .btn { padding: 0 14px; height: 42px; white-space: nowrap; }

/* 새 글 알림 */
[data-notify] .n-on, [data-notify].is-on .n-off { display: none; }
[data-notify].is-on .n-on { display: inline-flex; align-items: center; gap: 6px; }
[data-notify] .n-off { display: inline-flex; align-items: center; gap: 7px; }
[data-notify] .n-on svg { width: 15px; height: 15px; }
/* 구독 중: 눈에 덜 띄는 차분한 모양 */
.btn.primary[data-notify].is-on { background: transparent; color: var(--muted); border-color: var(--border); box-shadow: none; }
.btn.primary[data-notify].is-on:hover { color: var(--text-2); border-color: var(--border-strong); }
.foot-btn[data-notify].is-on, .notify-link[data-notify].is-on { color: var(--muted); border-color: var(--border); }
.notify-link[data-notify].is-on svg { color: var(--muted); }
.notify-cta .cta-on { display: none; }
.notify-cta.is-on { display: block; padding: 12px 16px; border-color: var(--border); background: transparent; }
.notify-cta.is-on .cta-off { display: none; }
.notify-cta.is-on .cta-on { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.notify-cta .cta-on svg { width: 16px; height: 16px; flex: none; }
.notify-cta .cta-on span { flex: 1; }
.cta-set { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cta-set:hover { color: var(--text-2); }
.btn-ic { display: inline-flex; align-items: center; gap: 8px; }
.btn-ic svg { width: 18px; height: 18px; }
.notify-cta {
  margin-top: 18px; padding: 20px 22px; border-radius: 16px;
  border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}
.notify-cta .cta-off { display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; align-items: center; }
.notify-cta-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: var(--bg); }
.notify-cta-ic svg { width: 26px; height: 26px; }
.notify-cta b { display: block; font-size: 17px; color: var(--text); }
.notify-cta p { margin: 4px 0 0; font-size: 14px; color: var(--text-2); line-height: 1.6; }
.notify-cta .btn { height: 46px; padding: 0 22px; font-size: 15px; white-space: nowrap; }
@media (max-width: 620px) {
  .notify-cta { padding: 18px; }
  .notify-cta .cta-off { grid-template-columns: 44px 1fr; }
  .notify-cta-ic { width: 44px; height: 44px; }
  .notify-cta .btn { grid-column: 1 / -1; width: 100%; display: flex; justify-content: center; align-items: center; }
}
.notify-link {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; padding: 8px 14px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: transparent; color: var(--text-2);
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.notify-link svg { width: 16px; height: 16px; color: var(--accent); }
.notify-link:hover { border-color: var(--accent); color: var(--accent); }
.share-box .notify-link { margin-top: 14px; }
.notify-opts { display: grid; gap: 8px; margin: 14px 0; }
.notify-opt {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--border-strong);
  border-radius: 12px; background: var(--bg); color: var(--text); font-weight: 600; cursor: pointer;
}
.notify-opt input { width: 18px; height: 18px; accent-color: var(--accent); }
.notify-actions { display: flex; gap: 8px; }
.notify-actions .btn { padding: 0 18px; height: 42px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 120; transform: translate(-50%, 12px); opacity: 0;
  padding: 11px 18px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.share-box { margin-top: 40px; padding: 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.share-title { margin-bottom: 12px; font-weight: 700; color: var(--text); }
.share-btns { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 6px; }
.share-btn {
  display: flex; flex-direction: column; align-items: center; gap: 7px; width: 70px; padding: 4px 0;
  border: 0; background: none; cursor: pointer; text-decoration: none; font-family: inherit; color: var(--text-2);
}
.share-ic { display: block; width: 44px; height: 44px; border-radius: 12px; transition: transform .15s; }
.share-ic.copy {
  display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-2);
}
.share-ic.copy svg { width: 20px; height: 20px; }
.share-label { font-size: 12px; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.share-btn[aria-label^="Naver"] .share-label { white-space: normal; text-align: center; max-width: 64px; }
.share-btn:hover .share-ic { transform: translateY(-2px); }
.share-btn:hover .share-label { color: var(--text); }
@media (max-width: 520px) { .share-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 4px; } .share-btn { width: auto; } .share-label { font-size: 10.5px; letter-spacing: -0.2px; } }
button.btn { font-family: inherit; background: transparent; cursor: pointer; }
