:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e3e6eb;
  --text: #141a24;
  --text-2: #4a5263;
  --muted: #7a8394;
  --brand: #2f5bea;
  --brand-soft: #e8eefe;
  --up: #d93a3a;      /* 국내 관례: 상승=빨강 */
  --down: #2f6fdc;    /* 하락=파랑 */
  --warn-bg: #fff7e6;
  --warn-border: #f3d79a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --surface: #121a2b;
    --surface-2: #182236;
    --border: #233049;
    --text: #e8ecf3;
    --text-2: #b4bdcc;
    --muted: #8691a5;
    --brand: #6b8cff;
    --brand-soft: #1c2950;
    --up: #ff6b6b;
    --down: #5b9bff;
    --warn-bg: #2a2313;
    --warn-border: #5c4a1f;
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #121a2b;
  --surface-2: #182236;
  --border: #233049;
  --text: #e8ecf3;
  --text-2: #b4bdcc;
  --muted: #8691a5;
  --brand: #6b8cff;
  --brand-soft: #1c2950;
  --up: #ff6b6b;
  --down: #5b9bff;
  --warn-bg: #2a2313;
  --warn-border: #5c4a1f;
  --shadow: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); margin: 0 0 .5rem; }
h2 { font-size: 1.35rem; margin: 2.2rem 0 .8rem; }
h3 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
p { margin: 0 0 1rem; }
table { border-collapse: collapse; width: 100%; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }

/* ---------- 헤더 ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.logo:hover { text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav a { color: var(--text-2); padding: 8px 10px; border-radius: 8px; font-size: .95rem; font-weight: 500; }
.site-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.site-nav a.active { color: var(--brand); font-weight: 700; }
.theme-toggle, .nav-toggle {
  background: none; border: 0; color: var(--text-2); cursor: pointer;
  padding: 8px; border-radius: 8px; display: inline-flex;
}
.theme-toggle:hover, .nav-toggle:hover { background: var(--surface-2); }
.nav-toggle { display: none; margin-left: auto; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 16px 16px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 8px; }
  .theme-toggle { align-self: flex-start; }
}

/* ---------- 공통 블록 ---------- */
.page-head { padding: 32px 0 8px; }
.page-head .lead { color: var(--text-2); font-size: 1.05rem; max-width: 760px; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--muted); }
section { margin-bottom: 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; } }

.stat .label { color: var(--muted); font-size: .85rem; margin-bottom: 4px; }
.stat .value { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.stat .sub { font-size: .85rem; color: var(--text-2); margin-top: 2px; }
@media (max-width: 600px) { .stat { padding: 14px; } .stat .value { font-size: 1.3rem; } }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 36px 0 12px; }
.section-title h2 { margin: 0; }
.section-title a { font-size: .9rem; white-space: nowrap; }

.btn {
  display: inline-block; background: var(--brand); color: #fff; border: 0; cursor: pointer;
  padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: .95rem; font-family: inherit;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn-ghost { background: var(--surface-2); color: var(--text); }

.notice {
  background: var(--warn-bg); border: 1px solid var(--warn-border);
  border-radius: var(--radius); padding: 14px 16px; font-size: .9rem; color: var(--text-2); margin: 16px 0;
}
.updated { font-size: .85rem; color: var(--muted); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-right: 6px; vertical-align: middle; }

/* ---------- 표 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.data-table th, .data-table td { padding: 10px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); font-size: .92rem; }
.data-table th { background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: .82rem; position: sticky; top: 0; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table th[data-sort] { cursor: pointer; user-select: none; }
.data-table th[data-sort]::after { content: " ↕"; color: var(--muted); }
.coin-cell { display: inline-flex; align-items: center; gap: 10px; }
.coin-icon { flex: none; border-radius: 50%; object-fit: contain; }
.coin-icon-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-2); font-size: .72rem; font-weight: 700;
  border: 1px solid var(--border);
}
.coin-name { display: flex; flex-direction: column; line-height: 1.3; }
.coin-name strong { font-weight: 700; }
.coin-name span { font-size: .78rem; color: var(--muted); }
.table-tools { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; }
.search {
  flex: 1; max-width: 280px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
}

/* ---------- 바 / 게이지 ---------- */
.ratio-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-2); margin: 8px 0; }
.ratio-bar .long { background: var(--up); }
.ratio-bar .short { background: var(--down); }
.gauge { position: relative; height: 14px; border-radius: 7px; margin: 18px 0 6px;
  background: linear-gradient(90deg, #d93a3a 0%, #f08c3a 25%, #e2c544 50%, #7fc36b 75%, #2f9e5b 100%); }
.gauge .marker { position: absolute; top: -6px; width: 4px; height: 26px; background: var(--text); border-radius: 2px; transform: translateX(-2px); }
.gauge-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.spark { width: 100%; height: 120px; display: block; }

/* ---------- 본문(가이드) ---------- */
.prose { font-size: 1.04rem; line-height: 1.85; }
.prose h2 { padding-top: 8px; border-top: 1px solid var(--border); padding-top: 24px; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1rem; }
.prose li { margin-bottom: .35rem; }
.prose table { margin: 1rem 0 1.4rem; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--surface-2); }
.prose blockquote { margin: 1rem 0; padding: 12px 16px; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 8px 8px 0; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.prose strong { color: var(--text); }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; align-items: start; }
.toc { position: sticky; top: 80px; font-size: .9rem; }
.toc p { font-weight: 700; margin-bottom: 8px; }
.toc a { display: block; color: var(--text-2); padding: 4px 0; }
@media (max-width: 960px) { .article-layout { grid-template-columns: 1fr; } .toc { position: static; } }
.article-meta { color: var(--muted); font-size: .88rem; display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.tag { display: inline-block; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 600; }

.guide-card { display: block; color: var(--text); height: 100%; overflow: hidden; }
.guide-card .thumb {
  display: block; width: calc(100% + 40px); max-width: none; height: auto; aspect-ratio: 3 / 2;
  object-fit: cover; margin: -20px -20px 14px; background: var(--surface-2);
}
.cover { margin: 0 0 28px; }
.cover img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); background: var(--surface-2); }
.guide-card:hover { text-decoration: none; border-color: var(--brand); }
.guide-card h3 { margin: 8px 0 6px; font-size: 1.05rem; }
.guide-card p { color: var(--text-2); font-size: .92rem; margin: 0; }

.tool-card { display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.tool-card:hover { text-decoration: none; border-color: var(--brand); }
.tool-card strong { font-size: 1.05rem; }
.tool-card span { color: var(--text-2); font-size: .92rem; }

/* ---------- 계산기 ---------- */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 800px) { .calc { grid-template-columns: 1fr; } }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; color: var(--text-2); }
.field input, .field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; font-variant-numeric: tabular-nums;
}
.field input:focus, .field select:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: flex; gap: 6px; }
.seg label { flex: 1; text-align: center; padding: 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 600; margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { color: var(--brand); }
.seg label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.buy-rows .buy-row { display: grid; grid-template-columns: 1fr 1fr 36px; gap: 8px; margin-bottom: 8px; }
.icon-btn { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 10px; cursor: pointer; font-size: 1.1rem; }
.result { background: var(--surface-2); border-radius: var(--radius); padding: 18px; }
.result dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; }
.result dt { color: var(--text-2); font-size: .92rem; }
.result dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.result .big { font-size: 1.5rem; }

/* ---------- 용어사전 ---------- */
.term { padding: 16px 0; border-bottom: 1px solid var(--border); }
.term:last-child { border-bottom: 0; }
.term h3 { margin: 0 0 6px; font-size: 1.05rem; }
.term p { margin: 0; color: var(--text-2); }

/* ---------- 푸터 ---------- */
.site-footer { margin-top: 64px; background: var(--surface); border-top: 1px solid var(--border); padding: 40px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.footer-grid a { display: block; color: var(--text-2); font-size: .9rem; padding: 3px 0; }
.footer-brand { font-weight: 800; font-size: 1.1rem; margin-bottom: 6px; }
.footer-title { font-weight: 700; font-size: .9rem; margin-bottom: 8px; }
.footer-note { border-top: 1px solid var(--border); padding-top: 16px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin: 10px 0 0; color: var(--text-2); }

/* 다크 모드에서 어두운 코인 로고가 묻히지 않도록 밝은 배경 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) img.coin-icon { background: #f1f3f6; padding: 1px; }
}
:root[data-theme="dark"] img.coin-icon { background: #f1f3f6; padding: 1px; }

/* ================= 홈 대시보드 ================= */
:root {
  --dom-btc: #eb6834; --dom-eth: #2a78d6; --dom-usdt: #1baf7a; --dom-other: #c9ced8;
  /* 공포탐욕: 공포(빨강) ↔ 중립(회색) ↔ 탐욕(파랑) */
  --fg-1: #d93a3a; --fg-2: #ef9d9c; --fg-3: #c9ced8; --fg-4: #86b6ef; --fg-5: #2a78d6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --dom-btc: #d95926; --dom-eth: #3987e5; --dom-usdt: #199e70; --dom-other: #3a4560;
    --fg-1: #e66767; --fg-2: #8f4a52; --fg-3: #3a4560; --fg-4: #2f5f9e; --fg-5: #3987e5;
  }
}
:root[data-theme="dark"] {
  --dom-btc: #d95926; --dom-eth: #3987e5; --dom-usdt: #199e70; --dom-other: #3a4560;
  --fg-1: #e66767; --fg-2: #8f4a52; --fg-3: #3a4560; --fg-4: #2f5f9e; --fg-5: #3987e5;
}

.home-head { padding-bottom: 20px; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .hero-grid { grid-template-columns: 1fr 1fr; } .hero-grid > :first-child { grid-column: 1 / -1; } }
@media (max-width: 640px) { .hero-grid { grid-template-columns: 1fr; } }

.tile { display: flex; flex-direction: column; gap: 12px; }
.tile-head { display: flex; align-items: center; gap: 10px; }
.tile-title { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.tile-title strong { font-size: 1rem; }
.tile-title span { font-size: .8rem; color: var(--muted); }
.tile-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.chip { margin-left: auto; font-size: .85rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); }
.hero-num { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin: 0; }
.hero-num small { font-size: 1rem; font-weight: 600; color: var(--text-2); margin-left: 3px; }
.tile-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: auto 0 0; padding-top: 12px; border-top: 1px solid var(--border); }
.tile-foot dt { font-size: .75rem; color: var(--muted); }
.tile-foot dd { margin: 0; font-weight: 700; font-size: .95rem; }
.tile-foot dd small { font-size: .75rem; font-weight: 600; }

/* 스파크라인 */
.spark-wrap { position: relative; margin: 0; }
.spark-svg { display: block; width: 100%; height: 96px; overflow: visible; }
.spark-svg.up { color: var(--up); }
.spark-svg.down { color: var(--down); }
.spark-svg.flat { color: var(--text-2); }
.spark-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.spark-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: currentColor; border: 2px solid var(--surface); transform: translate(-50%, -50%); opacity: 0; pointer-events: none; }
.spark-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--text); color: var(--surface); font-size: .78rem; padding: 4px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; font-variant-numeric: tabular-nums; }
.spark-wrap.hover .spark-cross, .spark-wrap.hover .spark-dot, .spark-wrap.hover .spark-tip { opacity: 1; }
.spark-cap { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 4px; }

/* 반원 미터 */
.meter { position: relative; max-width: 260px; margin: 0 auto; width: 100%; }
.meter svg { display: block; width: 100%; height: auto; }
.meter .fg-1 { stroke: var(--fg-1); } .meter .fg-2 { stroke: var(--fg-2); } .meter .fg-3 { stroke: var(--fg-3); }
.meter .fg-4 { stroke: var(--fg-4); } .meter .fg-5 { stroke: var(--fg-5); }
.meter-marker { fill: var(--surface); stroke: var(--text); stroke-width: 3; }
.meter-marker-core { fill: var(--text); }
.meter-value { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
.meter-value .hero-num { font-size: 2.2rem; }
.meter-label { font-size: .9rem; }
.meter-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); padding: 0 6px; }

/* 누적 막대 + 범례 */
.stack-bar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; }
.stack-bar span { display: block; flex-grow: 0; flex-shrink: 1; min-width: 2px; }
.dom-btc { background: var(--dom-btc); } .dom-eth { background: var(--dom-eth); }
.dom-usdt { background: var(--dom-usdt); } .dom-other { background: var(--dom-other); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: .85rem; }
.legend li { display: flex; align-items: center; gap: 6px; color: var(--text-2); white-space: nowrap; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend strong { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }

/* 보조 지표 */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 16px; }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .kpi-grid { gap: 10px; } }
.kpi { display: flex; flex-direction: column; gap: 4px; color: var(--text); padding: 16px 18px; }
.kpi:hover { text-decoration: none; border-color: var(--brand); }
.kpi-label { font-size: .82rem; color: var(--muted); }
.kpi-label small { font-size: .72rem; }
.kpi-value { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.kpi-sub { font-size: .8rem; color: var(--text-2); }
.kpi .ratio-bar { gap: 2px; margin: 10px 0 4px; }
.kpi-split { display: flex; justify-content: space-between; font-size: .85rem; }

/* 상승·하락 */
.movers-title { margin: 0 0 10px; font-size: 1.02rem; }
.movers-title small { font-weight: 400; font-size: .75rem; margin-left: 4px; }
.mover-list { list-style: none; margin: 0; padding: 0; }
.mover-list li { display: grid; grid-template-columns: minmax(0, 1fr) 80px 74px; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.mover-list li:last-child { border-bottom: 0; }
.mover-list b { text-align: right; }
.mover-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.mover-bar i { display: block; height: 100%; border-radius: 3px; }
.mover-bar i.up { background: var(--up); } .mover-bar i.down { background: var(--down); }
.coin-link { color: var(--text); }
.coin-link:hover { text-decoration: none; }

/* 도구(계산기) 카드 아이콘 */
.tool-card-icon { flex-direction: row; align-items: center; gap: 14px; }
.tool-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tool-icon {
  flex: none; width: 48px; height: 48px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand);
}
.tool-icon.sm { width: 30px; height: 30px; border-radius: 8px; }
.tool-icon svg { display: block; }
.tool-liquidation { background: color-mix(in srgb, var(--up) 12%, transparent); color: var(--up); }
.tool-compound { background: color-mix(in srgb, #1baf7a 14%, transparent); color: #14966a; }
.tool-profit { background: color-mix(in srgb, #eb6834 13%, transparent); color: #d1561f; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tool-compound { color: #3cc996; }
  :root:not([data-theme="light"]) .tool-profit { color: #f08a5d; }
}
:root[data-theme="dark"] .tool-compound { color: #3cc996; }
:root[data-theme="dark"] .tool-profit { color: #f08a5d; }
.tool-card-icon:hover .tool-icon { transform: translateY(-1px); }
.tool-icon { transition: transform .15s ease; }
.calc-nav-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }

/* ================= 코인 페이지 ================= */
.coin-page-head { padding-bottom: 12px; }
.coin-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.coin-hero-title { flex: 1; min-width: 200px; }
.coin-hero-title h1 { margin: 0; }
.coin-hero-title p { margin: 2px 0 0; font-size: .9rem; }
.coin-hero-price { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.coin-hero-price strong { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.coin-hero-price strong small { font-size: .95rem; color: var(--text-2); margin-left: 3px; }
.coin-hero-price .chip { margin-left: 0; }
@media (max-width: 600px) { .coin-hero-price { align-items: flex-start; width: 100%; } }
.coin-tabs { display: flex; gap: 4px; margin: 20px 0 12px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.coin-tabs a { padding: 10px 16px; color: var(--text-2); font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.coin-tabs a:hover { text-decoration: none; color: var(--text); }
.coin-tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

.coin-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .coin-grid { grid-template-columns: 1fr; } }
.card-title { font-size: 1.02rem; margin: 0 0 12px; }
.card-title small { font-weight: 400; font-size: .78rem; margin-left: 4px; }

.kv { margin: 0; display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--text-2); font-size: .9rem; }
.kv dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* 차트 */
.chart-wrap { padding-left: 0; }
.chart-svg { height: var(--chart-h, 160px); }
.chart-yaxis { font-size: .75rem; color: var(--muted); margin-bottom: 6px; }
.chart-yaxis b { color: var(--text-2); font-weight: 600; }
.chart-zero { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.spark-cap b { font-weight: 700; }

/* 52주 범위 */
.range52-track { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--down), var(--fg-3), var(--up)); margin: 14px 0 8px; }
.range52-marker { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--text); transform: translate(-50%, -50%); }
.range52-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-2); }
.range52-labels span { display: flex; flex-direction: column; }
.range52-labels span:last-child { text-align: right; }
.range52-labels small { color: var(--muted); font-size: .72rem; }

/* 정보 */
.coin-intro { margin: 0 0 12px; padding: 14px 16px; background: var(--surface-2); border-radius: 10px; border-left: 3px solid var(--brand); }
.coin-intro strong { display: block; margin-bottom: 6px; font-size: .9rem; }
.coin-intro p { margin: 0; line-height: 1.8; color: var(--text-2); }
.link-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.link-chips a { padding: 7px 14px; border-radius: 999px; background: var(--brand-soft); font-size: .88rem; font-weight: 600; }
.link-chips a:hover { text-decoration: none; filter: brightness(.97); }
.meter-bar { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.meter-bar span { display: block; height: 100%; background: var(--brand); border-radius: 5px; }
.ex-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ex-chips span { padding: 7px 14px; border-radius: 999px; font-size: .88rem; font-weight: 600; border: 1px solid var(--border); }
.ex-chips .on { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.ex-chips .off { color: var(--muted); }

/* 뉴스 */
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.news-list li { padding: 16px 20px; }
.news-title { font-size: 1.05rem; margin: 0 0 4px; line-height: 1.45; }
.news-title a { color: var(--text); }
.news-title a:hover { color: var(--brand); }
.news-meta { font-size: .8rem; color: var(--muted); margin: 0 0 6px; }
.news-snippet { margin: 0; color: var(--text-2); font-size: .92rem; }

/* 다른 코인 */
.coin-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.coin-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .9rem; font-weight: 500; }
.coin-chip:hover { text-decoration: none; border-color: var(--brand); }

/* 코인 핵심 지표 */
.coin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px; }
@media (max-width: 860px) { .coin-stats { grid-template-columns: 1fr 1fr; } }
.coin-stat {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
}
a.coin-stat:hover { text-decoration: none; border-color: var(--brand); }
.cs-label { font-size: .78rem; color: var(--muted); }
.cs-value { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.cs-value small { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.cs-sub { font-size: .78rem; color: var(--text-2); }
.cs-ex { display: flex; gap: 3px; margin-top: 6px; }
.cs-ex i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); }
.cs-ex i.on { background: var(--brand); }

/* 김치율 */
.coin-stats { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1000px) { .coin-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .coin-stats { grid-template-columns: 1fr 1fr; } }
.cs-label small { font-size: .7rem; }
.judge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.judge-super { background: color-mix(in srgb, var(--up) 16%, transparent); color: var(--up); }
.judge-kimchi { background: color-mix(in srgb, #eb6834 16%, transparent); color: #d1561f; }
.judge-partial { background: color-mix(in srgb, #eda100 18%, transparent); color: #a16d00; }
.judge-global { background: var(--brand-soft); color: var(--brand); }
:root[data-theme="dark"] .judge-partial { color: #f2c14e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .judge-partial { color: #f2c14e; } }

.kr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.kr-big { display: flex; align-items: center; gap: 10px; }
.kr-big strong { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.kr-bar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; margin: 16px 0 8px; }
.kr-bar span { display: block; flex-grow: 0; flex-shrink: 1; }
.kr-korea { background: var(--up); }
.kr-global { background: var(--dom-other); }
.kr-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .85rem; color: var(--text-2); }
.kr-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.kr-scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
.kr-scale span { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: .8rem; color: var(--muted); }
.kr-scale span b { color: var(--text-2); }
.kr-scale span.on { background: var(--brand-soft); outline: 2px solid var(--brand); }
.kr-scale span.on b { color: var(--brand); }

.ex-list { list-style: none; margin: 0; padding: 0; }
.ex-list li { display: grid; grid-template-columns: minmax(0, 1.1fr) 1fr auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ex-list li:last-child { border-bottom: 0; }
.ex-name { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-name small { font-weight: 400; color: var(--muted); margin-left: 6px; font-size: .72rem; }
.ex-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.ex-bar i { display: block; height: 100%; background: var(--up); border-radius: 3px; }
.ex-bar.global i { background: var(--brand); }
.ex-val { text-align: right; display: flex; flex-direction: column; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ex-val small { font-size: .72rem; color: var(--muted); }

/* 두 줄 셀 (김프 + 현재가) */
.data-table th small { display: block; font-weight: 400; font-size: .7rem; color: var(--muted); margin-top: 1px; }
.data-table td.stack { line-height: 1.35; }
.data-table td.stack strong { display: block; font-weight: 700; }
.data-table td.stack span { display: block; font-size: .78rem; color: var(--muted); }
@media (max-width: 600px) {
  .data-table th, .data-table td { padding: 9px 8px; font-size: .86rem; }
  .data-table .coin-cell { gap: 7px; }
  .data-table .coin-name span { display: none; }
}
@media (max-width: 600px) {
  .hide-sm { display: none; }
  .compact-sm th, .compact-sm td { padding: 8px 5px; font-size: .8rem; }
  .compact-sm th:first-child, .compact-sm td:first-child { padding-left: 10px; }
  .compact-sm th:last-child, .compact-sm td:last-child { padding-right: 10px; }
  .compact-sm td.stack span { font-size: .7rem; }
  .compact-sm .coin-icon { width: 20px; height: 20px; }
  .compact-sm .coin-cell { gap: 6px; }
  .mover-list li { grid-template-columns: minmax(0, 1fr) 44px auto; gap: 8px; }
  .mover-list .coin-name strong, .mover-list .coin-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mover-list .coin-cell { min-width: 0; }
  .movers-title small { display: block; margin: 2px 0 0; }
}
@media (max-width: 400px) { .compact-sm .coin-icon { display: none; } }

/* 홈 시장 브리핑 */
.briefing { max-width: 860px; margin-top: 4px; }
.briefing-label { font-size: .82rem; font-weight: 700; color: var(--brand); margin: 0 0 6px; }
.briefing-label .muted { font-weight: 400; }
.briefing-head { font-size: 1.12rem; font-weight: 700; margin: 0 0 6px; color: var(--text); }
.briefing-text { margin: 0; line-height: 1.8; }

/* 코인 검색 */
.coin-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 2px solid var(--brand); border-radius: 14px; padding: 6px 6px 6px 16px; box-shadow: var(--shadow); max-width: 760px; }
.coin-search-icon { color: var(--muted); flex: none; }
.coin-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 1.1rem; padding: 10px 4px; }
.coin-search .btn { padding: 11px 22px; }
.coin-search-help { margin: 8px 0 14px; }
.coin-table tbody tr { cursor: pointer; }
.coin-empty { padding: 24px; text-align: center; margin: 0; }

/* 코인 목록: 자세히 보기 버튼 */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.data-table td.col-more, .data-table th.col-more { text-align: right; width: 1%; }
.more-btn {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 6px 12px; border-radius: 8px; font-size: .82rem; font-weight: 600;
  background: var(--brand-soft); color: var(--brand);
}
.more-btn:hover { text-decoration: none; background: var(--brand); color: #fff; }
.coin-table tbody tr:hover .more-btn { background: var(--brand); color: #fff; }
@media (max-width: 600px) {
  .more-btn { padding: 6px 8px; }
  .more-btn .more-text { display: none; }
}
@media (max-width: 600px) {
  .coin-table .coin-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw; display: block; }
  .coin-table td.col-more { padding-left: 2px; }
}
@media (max-width: 600px) {
  .more-btn { width: 28px; height: 28px; padding: 0; justify-content: center; }
  .coin-table .coin-name strong { max-width: 30vw; }
  .coin-table td.col-more, .coin-table th.col-more { padding-right: 8px; }
}

/* 홈 시장 브리핑 카드 */
.briefing.card { display: flex; gap: 16px; align-items: flex-start; max-width: none; margin-top: 8px; padding: 20px 22px; }
.briefing-icon {
  flex: none; width: 48px; height: 48px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand);
}
.briefing-body { min-width: 0; flex: 1; }
.briefing.card .briefing-text { font-size: 1rem; color: var(--text-2); }
@media (max-width: 600px) {
  .briefing.card { flex-direction: column; gap: 10px; padding: 16px; }
  .briefing-icon { width: 40px; height: 40px; border-radius: 10px; }
}
.briefing.card .briefing-text { max-width: none; }

/* 인사이트 */
.pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 28px 0 0; }
.sources ol { margin: 10px 0 0; padding-left: 1.2rem; font-size: .9rem; }
.sources li { margin-bottom: 4px; }

/* 이전·다음 글 */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.post-nav a { display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.post-nav a:hover { text-decoration: none; border-color: var(--brand); }
.post-nav a.next { text-align: right; }
@media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } .post-nav a.next { text-align: left; } }
