/* ── CSS VARIABLES ── */
:root {
  /* 기본 = 라이트(화이트 + 골드). 다크는 body.dark(밝은 네이비) — common.js의 테마 버튼이 토글 */
  --bg: #f6f7f9; --surface: #ffffff; --surface2: #f5f6f8; --surface3: #eceef1;
  --border: #eceef1; --border2: #dfe2e6;
  --gold: #e8a600; --gold2: #f5b800; --blue: #1f6fe5; --blue2: #1559c4;
  --green: #08a66c; --red: #e5334f; --yellow: #e8a600;
  --text: #16181d; --text2: #525866; --text3: #8d94a1;
  /* 글꼴은 Pretendard 하나로 통일. 숫자는 body의 tabular-nums로 자릿수 정렬(고정폭 글꼴 안 씀) */
  --mono: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --sans: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 6px; --radius-lg: 8px; --shadow: 0 8px 32px rgba(0,0,0,0.12);
  --header-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.05);
  --up-bg: rgba(229,51,79,0.09); --down-bg: rgba(31,111,229,0.09); --gold-bg: rgba(232,166,0,0.12);
}
body.dark {
  --bg: #121a2e; --surface: #1a2440; --surface2: #212d4d; --surface3: #2a385c;
  --border: #26324f; --border2: #33416a;
  --gold: #ffc83d; --gold2: #ffd76a; --blue: #4c9dff; --blue2: #7ab6ff;
  --green: #24e09a; --red: #ff5470; --yellow: #ffc83d;
  --text: #f2f5fc; --text2: #a8b3cf; --text3: #7280a3;
  --shadow: 0 12px 40px rgba(0,0,0,0.5); --header-bg: #18213b;
  --card-shadow: none;
  --up-bg: rgba(255,84,112,0.16); --down-bg: rgba(76,157,255,0.16); --gold-bg: rgba(255,200,61,0.14);
}
body:not(.dark) .badge-overbought { background: rgba(229,51,79,0.1); color: var(--red); border-color: rgba(229,51,79,0.25); }
body:not(.dark) .badge-oversold   { background: rgba(8,166,108,0.1); color: var(--green); border-color: rgba(8,166,108,0.25); }
body:not(.dark) .badge-golden     { background: rgba(232,166,0,0.12); color: #b98200; border-color: rgba(232,166,0,0.3); }
body:not(.dark) .badge-dead       { background: var(--surface3); color: var(--text2); border-color: var(--border2); }
body:not(.dark) .badge-normal     { background: rgba(31,111,229,0.08); color: var(--blue); border-color: rgba(31,111,229,0.2); }
body:not(.dark) .badge-whale      { color: #8b3fe0; }
body:not(.dark) select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23525866' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); }
body:not(.dark) select option { background: #fff; color: #16181d; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 14px; line-height: 1.6; font-variant-numeric: tabular-nums; letter-spacing: -0.005em;
  min-height: 100vh; transition: background 0.25s, color 0.25s;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}

/* ── HEADER ── */
#header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg); backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border2);
  padding: 0 20px; display: flex; align-items: center; gap: 0; height: 56px;
}
.logo {
  display: flex; align-items: center; margin-right: 32px;
  white-space: nowrap; user-select: none; flex-shrink: 0;
  font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--text);
  text-decoration: none;
}
.logo .up { color: #4d9eff; }
.logo .ssum { color: #FF8C00; }
.logo .dot { color: #ffffff; font-size: 14px; font-weight: 400; }
nav#main-nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  color: var(--text2); padding: 7px 13px; border-radius: var(--radius);
  transition: all 0.15s; white-space: nowrap; letter-spacing: 0.01em;
  position: relative; text-decoration: none; display: inline-flex; align-items: center;
}
.nav-btn:hover { color: var(--text); background: var(--surface2); }
.nav-btn.active { color: var(--gold); background: rgba(232,184,75,0.1); }
.nav-btn.active::after {
  content: ''; position: absolute; bottom: -1px; left: 13px; right: 13px;
  height: 2px; background: var(--gold); border-radius: 1px;
}
.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.settings-btn, .tg-btn {
  background: none; border: 1px solid var(--border2); cursor: pointer;
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  color: var(--text2); padding: 6px 12px; border-radius: var(--radius);
  transition: all 0.15s; white-space: nowrap;
}
.settings-btn:hover { color: var(--text); background: var(--surface2); }
.tg-btn { color: var(--blue); border-color: rgba(90,180,242,0.35); }
.tg-btn:hover { background: rgba(90,180,242,0.08); color: var(--blue2); }
.theme-btn {
  background: none; border: 1px solid var(--border2); cursor: pointer;
  color: var(--text2); width: 34px; height: 34px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; transition: all 0.15s; flex-shrink: 0;
}
.theme-btn:hover { background: var(--surface2); color: var(--text); }
.hamburger {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--text); padding: 6px; border-radius: var(--radius);
  flex-direction: column; gap: 5px; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0; margin-left: 8px;
}
.hamburger span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.25s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
#mobile-drawer {
  display: none; position: fixed; top: 56px; left: 0; right: 0;
  background: var(--header-bg); backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border2);
  padding: 10px 16px 16px; z-index: 99;
  flex-direction: column; gap: 4px; animation: drawerIn 0.2s ease;
}
#mobile-drawer.open { display: flex; }
@keyframes drawerIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }
#mobile-drawer .nav-btn { text-align: left; padding: 12px 14px; font-size: 15px; border-radius: var(--radius); width: 100%; }
#mobile-drawer .nav-btn.active::after { display: none; }
.drawer-divider { height: 1px; background: var(--border); margin: 6px 0; }
.drawer-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ── AD SLOTS ── */
.ad-slot {
  background: var(--surface); border: 1px dashed var(--border);
  text-align: center; color: var(--text3); font-size: 11px;
  font-family: var(--mono); letter-spacing: 0.05em; padding: 6px;
}
.ad-top { height: 60px; display: flex; align-items: center; justify-content: center; }
.ad-mid {
  height: 80px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 0;
}
.ad-sidebar {
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius); min-height: 300px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; color: var(--text3);
  text-align: center; padding: 20px;
}

/* ── LAYOUT ── */
#app { max-width: 1440px; margin: 0 auto; padding: 24px 24px 0; }
.two-col { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
.notice-box {
  background: rgba(232,184,75,0.06); border: 1px solid rgba(232,184,75,0.2);
  border-radius: var(--radius); padding: 12px 16px;
  font-size: 13px; color: var(--text2); margin-bottom: 20px; line-height: 1.6;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 24px; }
.page-title { font-family: var(--sans); font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.page-subtitle { color: var(--text2); font-size: 13px; margin-top: 4px; }

/* ── CARDS ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card-title { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--text3); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 16px; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── FORM CONTROLS ── */
select, .input {
  background: var(--surface3); border: 1px solid var(--border2);
  color: var(--text); font-family: var(--sans); font-size: 13px; font-weight: 500;
  padding: 8px 14px; border-radius: var(--radius); outline: none;
  transition: border-color 0.15s; appearance: none; -webkit-appearance: none;
}
select { padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a8a8c0' fill='none' stroke-width='1.8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
select:focus, .input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(232,184,75,0.15); }
select option { background: #1a1b24; color: #f0f0f8; }
.btn {
  background: var(--gold); color: #0a0a0e; border: none; cursor: pointer;
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  padding: 9px 22px; border-radius: var(--radius); transition: all 0.15s;
  letter-spacing: 0.02em; white-space: nowrap;
}
.btn:hover { background: var(--gold2); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-outline {
  background: var(--surface3); color: var(--text); border: 1px solid var(--border2);
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  padding: 8px 18px; border-radius: var(--radius); cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
}
.btn-outline:hover { background: var(--surface2); border-color: var(--text3); }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 4px; letter-spacing: 0.01em; white-space: nowrap;
}
.badge-overbought { background: rgba(240,96,96,0.18); color: #ff7070; border: 1px solid rgba(240,96,96,0.35); }
.badge-oversold   { background: rgba(61,217,138,0.15); color: #4de89a; border: 1px solid rgba(61,217,138,0.35); }
.badge-golden     { background: rgba(232,184,75,0.18); color: #f5cf7a; border: 1px solid rgba(232,184,75,0.4); }
.badge-dead       { background: rgba(160,160,190,0.12); color: #c0c0d8; border: 1px solid rgba(160,160,190,0.25); }
.badge-normal     { background: rgba(90,180,242,0.12); color: #88cfff; border: 1px solid rgba(90,180,242,0.25); }
.badge-whale      { background: rgba(168,85,247,0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }
.risk-badge { display: inline-block; padding: 2px 8px; border-radius: 2px; font-size: 11px; font-family: var(--mono); margin: 3px; }
.risk-high { background: rgba(232,93,93,0.15); color: var(--red); border: 1px solid rgba(232,93,93,0.2); }
.risk-med  { background: rgba(240,192,80,0.12); color: var(--yellow); border: 1px solid rgba(240,192,80,0.2); }
.risk-low  { background: rgba(56,212,122,0.1); color: var(--green); border: 1px solid rgba(56,212,122,0.2); }

/* ── SCANNER ── */
.scanner-controls {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 16px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.control-group { display: flex; align-items: center; gap: 8px; }
.control-label { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--text2); letter-spacing: 0.02em; white-space: nowrap; }
.scan-status { display: flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--text2); white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text3); }
.status-dot.active   { background: var(--green); animation: pulse 1.5s infinite; }
.status-dot.scanning { background: var(--gold);  animation: pulse 0.8s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.scan-progress { height: 2px; background: var(--surface3); border-radius: 1px; margin-bottom: 12px; overflow: hidden; }
.scan-progress-bar { height: 100%; background: var(--gold); border-radius: 1px; transition: width 0.3s ease; width: 0%; }
.signal-count {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
}
.signal-count-item {
  flex: 1; min-width: 70px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 8px;
  font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--text2);
  cursor: pointer; transition: all 0.15s; user-select: none; text-align: center;
}
.signal-count-item:hover { background: var(--surface2); border-color: var(--border2); }
.signal-count-item.active-filter { border-color: var(--gold); background: rgba(232,184,75,0.08); color: var(--text); }
.signal-count-num { font-size: 22px; font-weight: 700; display: block; margin-bottom: 2px; line-height: 1; }
.scan-filter-help { margin: 0 0 12px; font-size: 12px; color: var(--text2); }
.scan-filter-group { margin-bottom: 12px; }
.scan-filter-heading { margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--text2); }
.scan-filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.scan-filter-grid .signal-count-item { min-width: 0; min-height: 68px; overflow-wrap: anywhere; scroll-margin-block: 100px; }
.signal-count-item:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 480px) {
  .scan-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .scan-filter-grid .signal-count-item { padding: 8px 4px; font-size: 11px; }
}

/* ── KIMCHI PREMIUM WIDGET ── */
.kimchi-widget {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 16px;
}
.kimchi-widget:empty { display: none; }
.kimchi-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.kimchi-title { font-family: var(--sans); font-size: 13px; font-weight: 700; color: var(--text); }
.kimchi-rate { display: none; } /* 위젯 보조 설명 캡션 숨김(환율·범례·출처 등). 되살리려면: font-family: var(--mono); font-size: 11px; color: var(--text3); */
.kimchi-edit-btn {
  margin-left: auto; font-family: var(--sans); font-size: 11px; color: var(--blue);
  background: none; border: 1px solid rgba(90,180,242,0.3); border-radius: var(--radius);
  padding: 3px 10px; cursor: pointer; transition: all 0.15s;
}
.kimchi-edit-btn:hover { background: rgba(90,180,242,0.08); }
.kimchi-edit { display: flex; gap: 6px; margin-bottom: 10px; }
.kimchi-edit input {
  flex: 1; max-width: 260px; padding: 6px 10px; background: var(--surface2);
  border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text);
  font-family: var(--sans); font-size: 13px;
}
.kimchi-add-btn {
  padding: 6px 14px; background: var(--gold); border: none; border-radius: var(--radius);
  color: #0a0a0e; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.kimchi-add-btn:hover { background: var(--gold2); }
.kimchi-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 4px 6px; }
.kimchi-chip {
  position: relative; flex: 0 0 auto; display: flex; flex-direction: column; gap: 3px; align-items: center;
  min-width: 72px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 10px;
}
.kimchi-chip .kc-name { font-family: var(--sans); font-size: 11px; color: var(--text2); }
.kimchi-chip .kc-val { font-family: var(--mono); font-size: 14px; font-weight: 700; }
.kc-rm {
  position: absolute; top: -7px; right: -7px; width: 17px; height: 17px; line-height: 15px;
  border-radius: 50%; background: var(--red); color: #fff; border: none; font-size: 12px;
  cursor: pointer; padding: 0; text-align: center;
}
.funding-table-wrap { overflow-x: auto; }
.funding-table { width: 100%; border-collapse: collapse; }
.funding-table th, .funding-table td {
  padding: 7px 12px; font-family: var(--mono); font-size: 12px; text-align: right;
  white-space: nowrap; border-bottom: 1px solid var(--border);
}
.funding-table thead th {
  font-family: var(--sans); font-size: 11px; font-weight: 600; color: var(--text2);
  text-transform: none; letter-spacing: 0; background: transparent;
  border-bottom: 1px solid var(--border2);
}
.funding-table tbody tr { cursor: default; }
.funding-table tbody tr:hover { background: var(--surface2); }
.funding-table tbody tr:last-child td { border-bottom: none; }
.funding-table .fd-coin, .funding-table .fd-coin-h { text-align: left; }
.funding-table .fd-coin strong { font-family: var(--sans); font-weight: 700; color: var(--text); margin-right: 6px; }
.funding-table .fd-coin span { font-family: var(--sans); font-size: 11px; color: var(--text3); }
.funding-table .fd-cell { font-weight: 600; }
.funding-table .fd-rm {
  width: 16px; height: 16px; line-height: 14px; padding: 0; margin-right: 6px;
  border-radius: 50%; background: var(--red); color: #fff; border: none; font-size: 11px;
  cursor: pointer; vertical-align: middle;
}
.liq-cards { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.liq-card {
  flex: 1; min-width: 150px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
}
.liq-card-t { font-family: var(--sans); font-size: 12px; font-weight: 700; color: var(--text2); margin-bottom: 8px; }
.liq-row { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; margin-bottom: 4px; }
.liq-row span:first-child { color: var(--text3); font-family: var(--sans); }
.liq-row.liq-total { border-top: 1px solid var(--border); padding-top: 5px; margin-top: 5px; font-weight: 700; color: var(--text); }
.liq-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.liq-tab {
  font-family: var(--sans); font-size: 12px; color: var(--text2); background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 12px; cursor: pointer;
}
.liq-tab.active { border-color: var(--gold); color: var(--text); background: rgba(232,184,75,0.08); }
.fng-body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.fng-ring { width: 100%; max-width: 260px; height: auto; display: block; }
.fng-ring-num { font-family: var(--mono); font-size: 30px; font-weight: 700; }
.fng-end { font-family: var(--sans); font-size: 10px; font-weight: 600; }
.fng-state { font-family: var(--sans); font-size: 13px; font-weight: 700; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--surface2); }
thead th {
  font-family: var(--sans); font-size: 11px; font-weight: 600; color: var(--text2);
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--border2); white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.12s; cursor: pointer; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
td { padding: 12px 16px; font-size: 14px; vertical-align: middle; }
.coin-name-cell { display: flex; flex-direction: column; gap: 2px; }
.coin-kor { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.coin-ticker { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--text3); letter-spacing: 0.06em; margin-top: 1px; }
.price-cell { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--text); }
.rsi-cell { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.rsi-high { color: var(--red); } .rsi-low { color: var(--green); } .rsi-normal { color: var(--text2); font-weight: 400; }
.chart-link {
  font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--blue);
  text-decoration: none; border: 1px solid rgba(90,180,242,0.3); padding: 5px 12px;
  border-radius: var(--radius); transition: all 0.15s; white-space: nowrap; display: inline-block;
}
.chart-link:hover { background: rgba(90,180,242,0.1); border-color: var(--blue); }
.empty-state { padding: 48px; text-align: center; color: var(--text3); font-size: 14px; }

/* ── SEARCH PAGE ── */
.search-bar { display: flex; gap: 10px; margin-bottom: 24px; }
.search-input {
  flex: 1; background: var(--surface); border: 1px solid var(--border2);
  color: var(--text); font-family: var(--sans); font-size: 14px;
  padding: 12px 16px; border-radius: var(--radius); outline: none; transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--gold); }
.search-input::placeholder { color: var(--text3); }
.analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.info-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-key { font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--text3); letter-spacing: 0.08em; text-transform: uppercase; min-width: 110px; }
.info-val { font-size: 13px; color: var(--text); text-align: right; flex: 1; }
.ai-output { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.ai-section-title { font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--gold); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.ai-section-title::after { content: ''; flex: 1; height: 1px; background: rgba(212,168,67,0.2); }
.ai-text { font-size: 13px; color: var(--text); line-height: 1.8; white-space: pre-wrap; }
.lockup-table { width: 100%; border-collapse: collapse; }
.lockup-table th { font-family: var(--mono); font-size: 10px; color: var(--text3); letter-spacing: 0.08em; text-transform: uppercase; padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.lockup-table td { padding: 8px 12px; font-size: 12px; border-bottom: 1px solid var(--border); }
.lockup-table tr:last-child td { border-bottom: none; }

/* ── AUTOCOMPLETE ── */
.autocomplete-wrap { position: relative; flex: 1; }
.autocomplete-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius); z-index: 200; max-height: 320px;
  overflow-y: auto; box-shadow: var(--shadow);
}
.autocomplete-list:empty { display: none; }
.ac-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; transition: background 0.1s; border-bottom: 1px solid var(--border); }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.selected { background: var(--surface3); }
.ac-kor { font-size: 14px; font-weight: 600; color: var(--text); }
.ac-ticker { font-family: var(--mono); font-size: 11px; color: var(--text3); }
.ac-exchange { margin-left: auto; font-family: var(--mono); font-size: 10px; padding: 2px 6px; border-radius: 2px; white-space: nowrap; }
.ac-ex-upbit  { background: rgba(232,184,75,0.12); color: var(--gold); border: 1px solid rgba(232,184,75,0.2); }
.ac-ex-bithumb { background: rgba(90,180,242,0.1); color: var(--blue); border: 1px solid rgba(90,180,242,0.2); }
.ac-ex-both   { background: rgba(61,217,138,0.1); color: var(--green); border: 1px solid rgba(61,217,138,0.2); }
.ac-highlight { color: var(--gold); }

/* ── LOADING ── */
.loading-indicator { display: flex; align-items: center; gap: 12px; padding: 40px; justify-content: center; color: var(--text2); font-size: 13px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border2); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── WALLET PAGE ── */
.wallet-add-row { display: flex; gap: 10px; margin-bottom: 24px; align-items: center; }
.wallet-cards { display: grid; gap: 16px; }
.wallet-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.wallet-card-header { padding: 14px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); background: var(--surface2); }
.chain-badge { font-family: var(--mono); font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 2px; letter-spacing: 0.08em; }
.chain-sol { background: rgba(153,69,255,0.2); color: #9945FF; border: 1px solid rgba(153,69,255,0.3); }
.chain-eth { background: rgba(98,126,234,0.2); color: #627EEA; border: 1px solid rgba(98,126,234,0.3); }
.wallet-addr { font-family: var(--mono); font-size: 12px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.wallet-summary { padding: 16px 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.wallet-stat { padding: 0 24px 0 0; border-right: 1px solid var(--border); }
.wallet-stat:last-child { border-right: none; padding-right: 0; padding-left: 24px; }
.wallet-stat-label { font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 6px; }
.wallet-stat-value { font-family: var(--mono); font-size: 20px; font-weight: 700; }
.in-value { color: var(--green); } .out-value { color: var(--red); }
.net-positive { color: var(--gold); } .net-negative { color: var(--red); }
.tx-table { width: 100%; border-collapse: collapse; }
.tx-table th { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--text2); padding: 10px 16px; text-align: left; background: var(--surface2); border-bottom: 1px solid var(--border2); }
.tx-table td { padding: 11px 16px; font-size: 13px; border-bottom: 1px solid var(--border); color: var(--text); }
.tx-table tr:last-child td { border-bottom: none; }
.tx-table tbody tr:hover { background: var(--surface2); }
.tx-in  { color: var(--green); font-family: var(--mono); font-weight: 700; font-size: 13px; }
.tx-out { color: var(--red);   font-family: var(--mono); font-weight: 700; font-size: 13px; }
.interpretation-box { padding: 16px 20px; border-top: 1px solid var(--border); background: rgba(232,184,75,0.04); }
.interpretation-title { font-family: var(--sans); font-size: 12px; font-weight: 700; color: var(--gold); letter-spacing: 0.02em; text-transform: uppercase; margin-bottom: 8px; }
.interpretation-text { font-size: 14px; color: var(--text); line-height: 1.75; }

/* ── BOARDS ── */
.board-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.post-count { font-family: var(--mono); font-size: 12px; color: var(--text2); }
.post-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.post-item { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; cursor: pointer; transition: background 0.1s; }
.post-item:last-child { border-bottom: none; }
.post-item:hover { background: var(--surface2); }
.post-num { font-family: var(--mono); font-size: 11px; color: var(--text3); min-width: 32px; }
.post-title-text { font-size: 14px; color: var(--text); flex: 1; }
.post-meta { font-family: var(--mono); font-size: 11px; color: var(--text3); white-space: nowrap; }
.post-category { font-family: var(--mono); font-size: 10px; padding: 2px 7px; border-radius: 2px; background: rgba(77,166,232,0.1); color: var(--blue); border: 1px solid rgba(77,166,232,0.2); }
.write-form { max-width: 800px; }
.form-group { margin-bottom: 16px; }
.form-label { font-family: var(--mono); font-size: 10px; color: var(--text3); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px; display: block; }
textarea { width: 100%; background: var(--surface); border: 1px solid var(--border2); color: var(--text); font-family: var(--sans); font-size: 14px; padding: 12px 16px; border-radius: var(--radius); outline: none; resize: vertical; min-height: 200px; transition: border-color 0.15s; line-height: 1.7; }
textarea:focus { border-color: var(--gold); }
.form-actions { display: flex; gap: 10px; }
.post-detail { max-width: 800px; }
.post-detail-header { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.post-detail-title { font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 8px; line-height: 1.4; }
.post-detail-meta { font-family: var(--mono); font-size: 11px; color: var(--text3); }
.post-detail-body { font-size: 14px; color: var(--text); line-height: 1.9; white-space: pre-wrap; }

/* ── MODALS ── */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); justify-content: center; align-items: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius); padding: 28px; max-width: 860px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; box-shadow: var(--shadow); animation: modalIn 0.2s ease; }
@keyframes modalIn { from { opacity:0; transform: scale(0.97) translateY(8px); } to { opacity:1; transform: none; } }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; cursor: pointer; color: var(--text3); font-size: 18px; line-height: 1; transition: color 0.15s; padding: 4px 8px; }
.modal-close:hover { color: var(--text); }
.modal-title { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 20px; letter-spacing: 0.05em; }
.modal-wide { max-width: 1100px; }
#chart-iframe { width: 100%; height: 520px; border: none; border-radius: 2px; }
.settings-section { margin-bottom: 24px; }
.settings-section-title { font-family: var(--mono); font-size: 10px; color: var(--gold); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.settings-note { font-size: 12px; color: var(--text3); margin-top: 6px; line-height: 1.5; }
.text-page h2 { font-size: 16px; font-weight: 600; color: var(--text); margin: 20px 0 10px; }
.text-page p, .text-page ul { font-size: 13px; color: var(--text2); line-height: 1.8; padding-left: 0; margin-bottom: 10px; }
.text-page ul { padding-left: 20px; }

/* ── FOOTER ── */
footer { margin-top: 60px; padding: 32px 24px; border-top: 1px solid var(--border); max-width: 1440px; margin-left: auto; margin-right: auto; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 20px; }
.footer-link { font-family: var(--mono); font-size: 11px; color: var(--text3); background: none; border: none; cursor: pointer; text-decoration: none; transition: color 0.15s; letter-spacing: 0.05em; }
.footer-link:hover { color: var(--text); }
.footer-copy { font-family: var(--mono); font-size: 11px; color: var(--text3); }

/* ── SCROLL TOP ── */
.scroll-top { position: fixed; bottom: 24px; right: 24px; background: var(--surface2); border: 1px solid var(--border2); color: var(--text2); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; opacity: 0; pointer-events: none; }
.scroll-top.visible { opacity: 1; pointer-events: auto; }
.scroll-top:hover { background: var(--surface3); color: var(--text); }

/* ── SERVER STATUS ── */
.server-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text2); padding: 10px 0; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  #header { padding: 0 16px; }
  .logo { font-size: 14px; margin-right: 0; }
  nav#main-nav { display: none; }
  .header-right .tg-btn, .header-right .settings-btn { display: none; }
  .hamburger { display: flex; }
  #app { padding: 16px 14px 0; }
  .page-title { font-size: 18px; }
  .page-subtitle { font-size: 12px; }
  .ad-top { height: 50px; font-size: 10px; }
  .scanner-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
  .scanner-controls .control-group { flex-direction: column; align-items: flex-start; gap: 5px; }
  .scanner-controls .control-group select { width: 100%; }
  .scanner-controls .btn, .scanner-controls .btn-outline { width: 100%; padding: 11px; font-size: 14px; }
  .scanner-controls .scan-status { grid-column: 1 / -1; justify-content: center; }
  .scan-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .scan-filter-grid .signal-count-item { padding: 8px 4px; font-size: 11px; }
  .signal-count-num { font-size: 18px; }
  .table-wrap { border: none; background: transparent; }
  /* 카드형 레이아웃은 '스캐너 결과표'에만 적용 (시세·펀딩비 표가 거대하게 쌓이던 버그 수정) */
  #scanner-table-wrap thead { display: none; }
  #scanner-table-wrap table, #scanner-table-wrap tbody, #scanner-table-wrap tr, #scanner-table-wrap td { display: block; width: 100%; }
  #scanner-table-wrap tbody tr { background: var(--surface); border: 1px solid var(--border2); border-radius: 12px; margin-bottom: 10px; padding: 16px; position: relative; }
  #scanner-table-wrap td { padding: 0; border: none; }
  #scanner-table-wrap .td-num { display: none !important; }
  #scanner-table-wrap .td-coin { margin-bottom: 10px; }
  #scanner-table-wrap .td-price { font-size: 16px !important; font-weight: 600; margin-bottom: 6px; }
  #scanner-table-wrap .td-signal { margin-bottom: 8px; }
  .chart-link { width: 100%; text-align: center; padding: 9px; font-size: 13px; display: block; }
  /* 시세·펀딩비 표: 컴팩트 + 촘촘(행 높이·여백 축소, 꽉차게) */
  .page-header { margin-bottom: 12px; }
  .px-table { font-size: 12px; width: 100%; }
  .px-table th { font-size: 11px; padding: 7px 6px; }
  .px-table td { padding: 5px 6px; white-space: nowrap; line-height: 1.25; }
  .px-rank-h, .px-rank { width: 20px; }
  .px-coin { gap: 7px; }
  .px-ico, .px-ico img { width: 18px; height: 18px; }
  .px-coin-txt strong { font-size: 12px; }
  .px-coin-txt span { max-width: 64px; font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
  .px-bar { gap: 6px; margin-bottom: 8px; }
  .px-search { font-size: 12px; padding: 7px 10px; min-width: 120px; }
  .px-tab { padding: 6px 11px; font-size: 12px; }
  .funding-table-wrap table th, .funding-table-wrap table td { white-space: nowrap; }
  /* 김프 밀집 테이블 모바일 — 5열 한 화면에 (레퍼런스급, 작은 글씨) */
  body.kp-page #app { padding: 6px 3px 0; }
  body.kp-page .page-header { margin-bottom: 8px; }
  body.kp-page .page-title { font-size: 16px; }
  body.kp-page .page-subtitle { display: none; }
  #kp-search { font-size: 12px; padding: 7px 10px; margin-bottom: 8px; max-width: none; }
  .kp-table { font-size: 10px; }
  .kp-table th { font-size: 9.5px; padding: 4px 3px; }
  .kp-table td { padding: 3px 3px; }
  .kp-a { font-size: 10.5px; }
  .kp-b { font-size: 9px; margin-top: 1px; }
  .kp-name { min-width: 78px; }
  .kp-n1 { gap: 4px; }
  .kp-n1 .px-ico, .kp-n1 .px-ico img { width: 15px; height: 15px; }
  .kp-ko { max-width: 66px; font-size: 10.5px; }
  .kp-n2 { margin-top: 1px; font-size: 9px; }
  .two-col { grid-template-columns: 1fr; }
  .search-bar { flex-direction: column; }
  .search-bar .btn { width: 100%; padding: 12px; }
  .analysis-grid { grid-template-columns: 1fr; }
  .wallet-add-row { flex-wrap: wrap; }
  .wallet-add-row .btn { width: 100%; }
  .post-item { flex-wrap: wrap; gap: 6px; padding: 12px 14px; }
  .post-title-text { width: 100%; }
  .modal { padding: 20px 16px; margin: 10px; max-height: 92vh; }
  footer { padding: 24px 16px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .autocomplete-list { max-height: 240px; }
  /* 차트 페이지 모바일: 고정 100vh 대신 세로 스크롤(바이낸스 앱처럼) — 메인 차트 크게 + 보조지표는 아래로 */
  body.chart-body { height: auto; min-height: 100vh; min-height: 100dvh; overflow-y: auto; display: block; }
  .chart-page { height: auto; display: block; padding: 8px; }
  .chart-stage { display: block; }
  #chart-main { height: 58vh; margin-bottom: 8px; }
  .chart-toolbar { gap: 6px; margin-bottom: 8px; }
  .osc-pane { height: 120px; min-height: 80px; }
  .osc-label { font-size: 10px; }
  /* 가격 헤더 모바일 */
  .ch-head { gap: 6px; padding-bottom: 6px; }
  .ch-head-ticker { font-size: 16px; }
  .ch-head-price { font-size: 20px; }
  .ch-head-chg { font-size: 13px; }
  .ch-head-body { gap: 10px; }
  .ch-head-stats { gap: 14px; margin-left: 0; width: 100%; }
  .ch-head-stat { text-align: left; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  #app { padding: 20px 20px 0; }
  nav#main-nav .nav-btn { font-size: 12px; padding: 6px 10px; }
  .logo { margin-right: 20px; }
  .two-col { grid-template-columns: 1fr; }
}

/* ── BACKTEST PAGE ── */
.bt-controls {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px;
}
.bt-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.bt-field { display: flex; flex-direction: column; gap: 6px; }
.bt-label { font-size: 11px; font-weight: 600; color: var(--text2); letter-spacing: 0.04em; }
.bt-controls select { background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.bt-exit-help { margin: 4px 0; font-size: 12px; line-height: 1.7; color: var(--text2); }
.bt-result-summary { margin-bottom: 14px; font-size: 12px; line-height: 1.8; color: var(--text2); }
.bt-time-note { display: block; margin-top: 4px; font-family: var(--sans); font-size: 10px; font-weight: 400; color: var(--text3); }

.bt-signal-grid {
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.bt-sig-group { display: flex; align-items: flex-start; gap: 10px; }
.bt-sig-group + .bt-sig-group { border-top: 1px solid var(--border); padding-top: 8px; }
.bt-sig-cat {
  width: 52px; flex-shrink: 0; padding-top: 6px;
  font-size: 11px; font-weight: 700; color: var(--text3); text-align: right;
}
.bt-sig-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.bt-sig-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border: 1px solid var(--border2);
  border-radius: 14px; background: var(--surface2);
  cursor: pointer; font-size: 12px; font-weight: 500; color: var(--text2);
  transition: all 0.12s; user-select: none;
}
.bt-sig-chip:hover { background: var(--surface3); color: var(--text); }
.bt-sig-chip.checked { background: rgba(232,184,75,0.12); border-color: var(--gold); color: var(--text); }
.bt-sig-chip input { display: none; }
.bt-sig-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.bt-sig-dir { font-size: 11px; color: var(--text3); font-weight: 700; }

.bt-progress-wrap { padding: 8px 0 0; }
.bt-progress { height: 4px; background: var(--surface3); border-radius: 2px; overflow: hidden; }
.bt-progress-bar { height: 100%; background: var(--gold); transition: width 0.25s ease; width: 0%; }
.bt-progress-text { font-size: 12px; color: var(--text2); margin-top: 6px; }

.bt-stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin-bottom: 18px;
}
.bt-stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.bt-stat-label { font-size: 11px; color: var(--text3); letter-spacing: 0.05em; margin-bottom: 4px; }
.bt-stat-val { font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }

.bt-chart-section { display: grid; grid-template-columns: 1fr 280px; gap: 16px; }
.bt-chart-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.bt-side { display: flex; flex-direction: column; }

.bt-playback {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-top: 1px solid var(--border); background: var(--surface2);
}
.bt-pb-btn {
  background: var(--surface3); border: 1px solid var(--border2); cursor: pointer;
  color: var(--text); width: 34px; height: 32px; border-radius: var(--radius);
  font-size: 14px; transition: all 0.12s; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.bt-pb-btn:hover { background: var(--surface); border-color: var(--text3); }
.bt-pb-play { background: var(--gold); color: #0a0a0e; border-color: var(--gold); font-weight: 700; }
.bt-pb-play:hover { background: var(--gold2); }
.bt-pb-speed { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.bt-pb-speed-label { font-size: 11px; color: var(--text3); }
.bt-pb-speed select { padding: 5px 24px 5px 10px; font-size: 12px; }
.bt-pb-status {
  font-size: 11px; color: var(--text2); padding: 5px 10px;
  background: var(--surface3); border-radius: 12px; min-width: 70px; text-align: center;
}

.bt-live-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.bt-live-row:last-child { border-bottom: none; }
.bt-live-label { font-size: 12px; color: var(--text3); }
.bt-live-val { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text); }

.bt-trade-table { font-size: 13px; }
.bt-trade-table th, .bt-trade-table td { padding: 8px 12px; }
.bt-num { font-family: var(--mono); }
.bt-dir-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
}
.bt-dir-long  { background: rgba(61,217,138,0.15); color: #4de89a; border: 1px solid rgba(61,217,138,0.3); }
.bt-dir-short { background: rgba(240,96,96,0.15); color: #ff7070; border: 1px solid rgba(240,96,96,0.3); }
.bt-reason {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
}
.bt-reason-TP, .bt-reason-TP_GAP { background: rgba(61,217,138,0.15); color: #4de89a; }
.bt-reason-SL, .bt-reason-SL_GAP { background: rgba(240,96,96,0.15); color: #ff7070; }
.bt-reason-TIME { background: rgba(168,168,192,0.15); color: var(--text2); }
.bt-reason-END  { background: rgba(90,180,242,0.12); color: var(--blue); }

/* autocomplete (backtest 페이지 호환) */
.autocomplete-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  cursor: pointer; transition: background 0.1s; border-bottom: 1px solid var(--border);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.highlighted { background: var(--surface3); }

@media (max-width: 768px) {
  .bt-chart-section { grid-template-columns: 1fr; }
  .bt-side { order: 2; }
  .bt-row { gap: 10px; }
  .bt-field { flex: 1; min-width: 140px; }
  .bt-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .bt-stat-val { font-size: 15px; }
  .bt-playback { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .bt-pb-speed { margin-left: 0; }
  .bt-trade-table th:nth-child(2),
  .bt-trade-table td:nth-child(2),
  .bt-trade-table th:nth-child(6),
  .bt-trade-table td:nth-child(6) { display: none; }
}

/* ── CHART PAGE (Lightweight Charts) ──
   768px 이하는 위쪽 모바일 미디어쿼리(스크롤형, #chart-main: 58vh)가 담당 —
   아래 min-width 쪽에만 걸어서 나중에 선언돼도 모바일 규칙을 덮어쓰지 않게 함. */
@media (min-width: 769px) {
  body.chart-body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  .chart-page { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 10px 16px 14px; gap: 10px; }
}
/* 바이낸스식 가격 헤더 */
.ch-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.ch-head-id { display: flex; align-items: baseline; gap: 8px; }
.ch-head-ticker { font-family: var(--sans); font-size: 20px; font-weight: 700; color: var(--text); }
.ch-head-ex { font-size: 11px; color: var(--text3); }
.ch-head-body { display: flex; align-items: center; gap: 20px; flex: 1; flex-wrap: wrap; }
.ch-head-price-wrap { display: flex; align-items: baseline; gap: 10px; }
.ch-head-price { font-family: var(--mono); font-size: 24px; font-weight: 700; color: var(--text); }
.ch-head-chg { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.ch-head-stats { display: flex; gap: 18px; margin-left: auto; }
.ch-head-stat { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.ch-head-stat span { font-size: 10px; color: var(--text3); }
.ch-head-stat b { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--text2); }
.chart-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.chart-toolbar .ch-select {
  padding: 6px 10px; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius); color: var(--text); font-family: var(--sans); font-size: 13px;
}
.ch-tf, .ch-ind { display: flex; gap: 4px; flex-wrap: wrap; }
.ch-tf button, .ch-ind button {
  font-family: var(--sans); font-size: 12px; color: var(--text2);
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 11px; cursor: pointer; white-space: nowrap;
}
.ch-tf button:hover, .ch-ind button:hover { color: var(--text); }
.ch-tf button.active { background: rgba(232,184,75,0.12); border-color: var(--gold); color: var(--text); }
.ch-ind button.active { background: rgba(90,180,242,0.12); border-color: var(--blue); color: var(--text); }
.ch-ind-btn {
  font-family: var(--sans); font-size: 12px; color: var(--blue);
  background: rgba(90,180,242,0.08); border: 1px solid rgba(90,180,242,0.3);
  border-radius: var(--radius); padding: 6px 12px; cursor: pointer; white-space: nowrap;
}
.ch-ind-btn:hover { background: rgba(90,180,242,0.16); }
.ch-ai-btn {
  font-family: var(--sans); font-size: 12px; color: var(--gold);
  background: rgba(232,184,75,0.1); border: 1px solid rgba(232,184,75,0.35);
  border-radius: var(--radius); padding: 6px 12px; cursor: pointer; white-space: nowrap;
}
.ch-ai-btn:hover { background: rgba(232,184,75,0.18); }

/* AI 작도 좌측 패널 */
.ai-panel {
  position: fixed; top: 0; left: 0; height: 100vh; width: 320px; max-width: 88vw; z-index: 1200;
  background: var(--surface); border-right: 1px solid var(--border2); box-shadow: 8px 0 24px rgba(0,0,0,0.35);
  transform: translateX(-100%); transition: transform 0.2s ease; display: flex; flex-direction: column;
}
.ai-panel.open { transform: translateX(0); }
.ai-panel-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.ai-panel-body textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 48px;
  padding: 9px 11px; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius); color: var(--text); font-family: var(--sans); font-size: 13px;
}
.ai-actions { display: flex; gap: 8px; }
#ai-send { flex: 1; padding: 8px; background: var(--gold); border: none; border-radius: var(--radius); color: #0a0a0e; font-weight: 700; font-size: 13px; cursor: pointer; }
#ai-clear { padding: 8px 12px; background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text2); font-size: 13px; cursor: pointer; }
.ai-resp { font-family: var(--sans); font-size: 13px; line-height: 1.7; color: var(--text); white-space: pre-wrap; min-height: 20px; }
.ai-disc { font-family: var(--sans); font-size: 11px; color: var(--text3); line-height: 1.5; border-top: 1px solid var(--border); padding-top: 10px; }
.ch-status { font-family: var(--mono); font-size: 12px; color: var(--text3); margin-left: auto; }
@media (min-width: 769px) {
  .chart-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
  #chart-main { flex: 1; min-height: 0; }
}
.chart-pane { width: 100%; }
#osc-panels { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; }
.osc-pane { position: relative; height: 140px; min-height: 70px; border-top: 1px solid var(--border); }
.osc-label { position: absolute; top: 4px; left: 8px; z-index: 3; font-family: var(--mono); font-size: 11px; color: var(--text3); pointer-events: none; }
.osc-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; z-index: 4; }
.osc-resize::after { content: ''; position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); width: 36px; height: 3px; border-radius: 2px; background: var(--border2); transition: background .15s; }
.osc-resize:hover::after { background: var(--gold); }

/* 지표 설정 사이드 패널 */
.ind-panel {
  position: fixed; top: 0; right: 0; height: 100vh; width: 300px; max-width: 86vw; z-index: 1200;
  background: var(--surface); border-left: 1px solid var(--border2); box-shadow: -8px 0 24px rgba(0,0,0,0.35);
  transform: translateX(100%); transition: transform 0.2s ease; display: flex; flex-direction: column;
}
.ind-panel.open { transform: translateX(0); }
.ind-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); font-family: var(--sans); font-weight: 700; color: var(--text); }
.ind-panel-head button { background: none; border: none; color: var(--text3); font-size: 16px; cursor: pointer; }
.ind-list { flex: 1; overflow-y: auto; padding: 10px 12px 24px; }
.ind-group-title { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin: 14px 4px 6px; }
.ind-row { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 6px; overflow: hidden; }
.ind-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; }
.ind-toggle { display: flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 13px; color: var(--text); cursor: pointer; }
.ind-gear { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 13px; }
.ind-gear:hover { color: var(--text); }
.ind-body { padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface2); }
.ind-body[hidden] { display: none; }
.ind-param { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-family: var(--sans); font-size: 12px; color: var(--text2); }
.ind-param input[type=number] { width: 76px; padding: 4px 8px; background: var(--surface); border: 1px solid var(--border2); border-radius: 4px; color: var(--text); font-family: var(--mono); }
.ind-param input[type=color] { width: 34px; height: 22px; padding: 0; border: 1px solid var(--border2); border-radius: 4px; background: none; cursor: pointer; }
.ind-param select { padding: 4px 8px; background: var(--surface); border: 1px solid var(--border2); border-radius: 4px; color: var(--text); font-family: var(--sans); font-size: 12px; }
.ind-reset { font-family: var(--sans); font-size: 11px; color: var(--text2); background: var(--surface); border: 1px solid var(--border2); border-radius: 4px; padding: 4px 10px; cursor: pointer; }
.ma-line { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ma-line select, .ma-line input[type=number] { padding: 4px 6px; background: var(--surface); border: 1px solid var(--border2); border-radius: 4px; color: var(--text); font-family: var(--mono); font-size: 12px; }
.ma-line input[type=number] { width: 64px; }
.ma-line input[type=color] { width: 30px; height: 22px; padding: 0; border: 1px solid var(--border2); border-radius: 4px; background: none; cursor: pointer; }
.ma-rm { background: none; border: none; color: var(--red); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.ma-add { font-family: var(--sans); font-size: 12px; color: var(--blue); background: rgba(90,180,242,0.08); border: 1px solid rgba(90,180,242,0.3); border-radius: 4px; padding: 5px 10px; cursor: pointer; width: 100%; margin-top: 4px; }

/* ── HOME (거래소형 대시보드, js/home.js) ── */
.home {
  max-width: 1600px; margin: 0 auto; padding: 16px 20px 8px;
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; align-items: start;
}
.hm-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--card-shadow); }
.hm-kpis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.hm-kpi { padding: 14px 16px; min-width: 0; }
.hm-kpi-l { display: flex; justify-content: space-between; gap: 8px; color: var(--text2); font-size: 12px; }
.hm-kpi-l span { color: var(--text3); }
.hm-kpi-l span.up { color: var(--red); } .hm-kpi-l span.down { color: var(--blue); }
.hm-kpi-v { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-kpi-s { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-fng-bar { position: relative; height: 6px; margin: 12px 0 4px; border-radius: 3px; background: linear-gradient(90deg, var(--blue), var(--gold), var(--red)); }
.hm-fng-bar i { position: absolute; top: -3px; width: 3px; height: 12px; margin-left: -1.5px; border-radius: 2px; background: var(--text); }
.home .up { color: var(--red); } .home .down { color: var(--blue); }

.hm-ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.hm-ph h2 { font-size: 15px; font-weight: 700; }
.hm-ph h2 small { font-size: 12px; font-weight: 400; color: var(--text3); margin-left: 6px; }
.hm-ph-sub { font-size: 12px; color: var(--text3); }
.hm-tabs { display: flex; gap: 2px; padding: 3px; background: var(--surface2); border-radius: var(--radius); }
.hm-tabs button { font-family: var(--sans); font-size: 12px; color: var(--text2); background: none; border: none; padding: 4px 10px; border-radius: 4px; cursor: pointer; }
.hm-tabs button:hover { color: var(--text); }
.hm-tabs button.on { background: var(--surface3); color: var(--text); font-weight: 600; }
.hm-more { display: block; padding: 11px 16px; border-top: 1px solid var(--border); text-align: center; font-size: 13px; color: var(--text2); text-decoration: none; }
.hm-more:hover { color: var(--gold); }
.hm-empty { padding: 28px 16px; text-align: center; color: var(--text3); font-size: 13px; line-height: 1.7; }
.hm-foot { padding: 0 16px 10px; font-size: 11px; color: var(--text3); text-align: right; }

.hm-table-wrap { overflow-x: auto; }
.hm-table { width: 100%; border-collapse: collapse; }
.hm-table th { padding: 9px 16px; font-size: 12px; font-weight: 500; color: var(--text3); text-align: left; background: none; border-bottom: none; text-transform: none; letter-spacing: 0; }
.hm-table td { padding: 9px 16px; border-top: 1px solid var(--border); font-size: 13px; white-space: nowrap; }
.hm-table tbody tr { cursor: pointer; }
.hm-table tbody tr:hover td { background: var(--surface2); }
.hm-table .r { text-align: right; }
.hm-coin { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hm-coin b { font-weight: 600; }
.hm-coin small { color: var(--text3); font-size: 12px; }
.hm-price { font-weight: 600; border-radius: 3px; }
.hm-chg { display: inline-block; min-width: 72px; padding: 3px 0; border-radius: 4px; text-align: center; font-weight: 600; color: var(--text2); background: var(--surface2); }
.hm-chg.up { color: var(--red); background: var(--up-bg); }
.hm-chg.down { color: var(--blue); background: var(--down-bg); }
.hm-sub { color: var(--text2); }
.hm-spark svg { display: inline-block; vertical-align: middle; }

.hm-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hm-sig { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.hm-sig:first-child { border-top: none; }
.hm-sig:hover { background: var(--surface2); }
.hm-sig > b { width: 52px; font-weight: 600; flex-shrink: 0; }
.hm-tags { display: flex; gap: 4px; flex-wrap: wrap; min-width: 0; }
.hm-tag { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 4px; white-space: nowrap; }
.t-hot { background: var(--up-bg); color: var(--red); }
.t-cold { background: var(--down-bg); color: var(--blue); }
.t-gold { background: var(--gold-bg); color: var(--gold); }
body:not(.dark) .t-gold { color: #b98200; }
.t-mute { background: var(--surface3); color: var(--text2); }
.hm-sig-rsi { margin-left: auto; font-size: 12px; color: var(--text3); white-space: nowrap; }

.hm-fd-row { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-top: 1px solid var(--border); }
.hm-fd-row:first-child { border-top: none; }
.hm-fd-row .hm-coin { width: 76px; flex-shrink: 0; }
.hm-fd-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--surface2); overflow: hidden; }
.hm-fd-bar i { display: block; height: 100%; background: var(--text3); }
.hm-fd-bar i.up { background: var(--red); } .hm-fd-bar i.down { background: var(--blue); }
.hm-fd-v { width: 84px; text-align: right; font-size: 13px; font-weight: 600; }
.hm-fd-v.up { color: var(--red); } .hm-fd-v.down { color: var(--blue); }
.hm-fd-row .px-ico, .hm-fd-row .px-ico img { width: 20px; height: 20px; }

.hm-lq { padding: 10px 16px 4px; }
.hm-lq-h { display: flex; justify-content: space-between; font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.hm-lq-h b { color: var(--text); }
.hm-lq-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.hm-lq-bar i.up { background: var(--red); } .hm-lq-bar i.down { flex: 1; background: var(--blue); }

@media (max-width: 1200px) {
  .home { grid-template-columns: 1fr; }
  .hm-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}
@media (max-width: 900px) {
  .hm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-kpis .hm-kpi:last-child { grid-column: 1 / -1; }
  .hm-hide-m { display: none; }
}
@media (max-width: 600px) {
  .home { padding: 12px 12px 8px; gap: 10px; }
  .hm-kpis { gap: 10px; }
  .hm-kpi { padding: 12px; }
  .hm-kpi-v { font-size: 19px; }
  .hm-hide-s { display: none; }
  .hm-table td, .hm-table th { padding: 9px 12px; }
  .hm-chg { min-width: 62px; }
}

/* ── ALERTS PAGE ── */
.alert-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; }
.alert-form { display: flex; gap: 8px; flex-wrap: wrap; }
.alert-input { flex: 1; min-width: 220px; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text); font-family: var(--sans); font-size: 14px; }
.alert-input:focus { border-color: var(--gold); outline: none; }
.alert-status { font-family: var(--sans); font-size: 13px; color: var(--text2); min-height: 18px; margin-top: 10px; }
.alert-hint { font-family: var(--sans); font-size: 11px; color: var(--text3); line-height: 1.6; margin-top: 8px; border-top: 1px solid var(--border); padding-top: 10px; }
.alert-list-wrap { margin-bottom: 16px; }
.alert-list-title { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.alert-item.alert-off { opacity: 0.5; }
.alert-item-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.alert-coin { font-family: var(--sans); font-weight: 700; color: var(--text); }
.alert-cond { font-family: var(--sans); font-size: 13px; color: var(--text2); }
.alert-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.alert-toggle, .alert-del { font-family: var(--sans); font-size: 12px; padding: 5px 11px; border-radius: var(--radius); cursor: pointer; border: 1px solid var(--border2); background: var(--surface2); color: var(--text2); }
.alert-toggle:hover { color: var(--text); }
.alert-del:hover { color: var(--red); border-color: var(--red); }
.alert-disc { font-family: var(--sans); font-size: 11px; color: var(--text3); line-height: 1.6; }

/* ── 좌측 고정 사이드바 네비게이션 (common.js가 주입) ──────────────────
   메뉴는 js/common.js의 MENU 배열에서 관리. 코인분석/핫월렛은 메뉴에서 제외(페이지·API는 보관). */
#header, #mobile-drawer { display: none !important; } /* 레거시 상단 헤더 숨김 — 사이드바로 대체 */

#topnav {
  position: sticky; top: 0; z-index: 1000; height: 52px;
  display: flex; align-items: center; gap: 28px; padding: 0 20px;
  background: var(--header-bg); border-bottom: 1px solid var(--border);
}
.tn-logo { font-size: 20px; font-weight: 800; letter-spacing: -0.04em; color: var(--text); text-decoration: none; flex-shrink: 0; }
.tn-logo b { color: var(--gold); font-weight: 800; }
body.dark #tickerbar { background: #141d33; }
.tn-menu { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tn-link {
  display: inline-flex; align-items: center; gap: 4px; padding: 7px 11px; border-radius: var(--radius);
  font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--text2);
  text-decoration: none; white-space: nowrap; background: none; border: none; cursor: pointer;
  transition: color .15s, background .15s;
}
.tn-link:hover { color: var(--text); }
.tn-link.on { color: var(--text); background: var(--surface2); font-weight: 600; }
.tn-dd { position: relative; }
.tn-dd-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 150px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  flex-direction: column; gap: 2px;
}
.tn-dd-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; } /* 호버가 끊기지 않게 */
.tn-dd:hover .tn-dd-menu, .tn-dd.open .tn-dd-menu { display: flex; }
.tn-dd-menu .tn-link { width: 100%; }
.tn-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; font-size: 12px; color: var(--text3); }
.tn-live { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 500; }
.tn-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite; }
.tn-right .theme-btn { width: 32px; height: 32px; }
.theme-btn span { display: inline-flex; }
.tn-burger { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 4px; padding: 8px; }
.tn-burger span { width: 20px; height: 2px; background: var(--text); display: block; border-radius: 2px; }
.tn-drawer { display: none; }

#tickerbar {
  display: flex; height: 34px; align-items: center;
  background: var(--bg); border-bottom: 1px solid var(--border);
  overflow: hidden; white-space: nowrap; font-size: 12px;
}
/* 두 벌(.tk-set)을 이어 붙인 트랙을 -50%까지 흘려 무한 반복. 속도는 common.js가 너비로 계산 */
.tk-track { display: flex; width: max-content; animation: tkScroll 60s linear infinite; }
.tk-set { display: flex; gap: 24px; padding-right: 24px; }
#tickerbar:hover .tk-track { animation-play-state: paused; }
@keyframes tkScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  #tickerbar { overflow-x: auto; scrollbar-width: none; }
  .tk-track { animation: none; }
  .tk-set[aria-hidden] { display: none; }
}
.tk-item { display: inline-flex; gap: 6px; color: var(--text2); text-decoration: none; }
.tk-item b { color: var(--text); font-weight: 600; }
.tk-item:hover b { color: var(--gold); }
.tk-c.up { color: var(--red); } .tk-c.down { color: var(--blue); }
body.chart-body #topnav, body.chart-body #tickerbar { flex-shrink: 0; }

@media (max-width: 1180px) {
  .tn-menu, .tn-fx { display: none; }
  .tn-burger { display: flex; }
  #topnav.drawer-open .tn-drawer {
    display: flex; flex-direction: column; gap: 2px; position: absolute; top: 52px; left: 0; right: 0;
    padding: 10px 12px 16px; background: var(--header-bg); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow); max-height: calc(100vh - 52px); overflow-y: auto;
  }
  .tn-drawer .tn-link { padding: 11px 12px; font-size: 15px; }
  .tn-drawer-group { font-size: 12px; color: var(--text3); padding: 12px 12px 4px; }
}
@media (max-width: 600px) { #topnav { padding: 0 12px; } .tn-live { display: none; } }

/* ── 실시간 시세 페이지 (/prices) ──────────────────────── */
.px-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.px-tabs { display: flex; gap: 6px; }
.px-tab { font-family: var(--sans); font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: var(--radius); border: 1px solid var(--border2); background: var(--surface); color: var(--text2); cursor: pointer; transition: background .15s, color .15s; }
.px-tab:hover { color: var(--text); }
.px-tab.active { background: var(--gold); border-color: var(--gold); color: #1a1500; }
.px-search { flex: 1; min-width: 160px; max-width: 320px; font-family: var(--sans); font-size: 13px; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--border2); background: var(--surface2); color: var(--text); }
.px-status { font-family: var(--mono); font-size: 11px; color: var(--text3); margin-left: auto; }
.px-status[data-ready] { color: var(--green); }

.px-table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 13px; }
.px-table th { position: sticky; top: 0; background: var(--surface2); color: var(--text2); font-weight: 600; font-size: 12px; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border2); z-index: 1; }
.px-table th.px-num { text-align: right; }   /* 숫자 헤더는 데이터(우측 정렬)와 맞춤 */
.px-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.px-table tr:hover td { background: var(--surface2); }
.px-num { text-align: right; font-family: var(--mono); }
.px-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.px-sort:hover { color: var(--text); }
.px-sorted-asc::after { content: ' ▲'; font-size: 9px; color: var(--gold); }
.px-sorted-desc::after { content: ' ▼'; font-size: 9px; color: var(--gold); }
.px-rank-h { text-align: center; width: 40px; }
.px-rank { text-align: center; color: var(--text3); font-family: var(--mono); font-size: 12px; }
.px-coin { display: flex; align-items: center; gap: 10px; }
.px-ico { position: relative; width: 22px; height: 22px; flex-shrink: 0; display: inline-block; }
.px-ico-fb { position: absolute; inset: 0; border-radius: 50%; background: var(--surface3); color: var(--text2); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.px-ico img { position: absolute; inset: 0; width: 22px; height: 22px; border-radius: 50%; }
.px-coin-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.px-coin-txt strong { font-family: var(--mono); font-weight: 600; }
.px-coin-txt span { font-size: 11px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 한국식: 상승=빨강 / 하락=파랑. (.px-table td 보다 우선해야 색이 먹음) */
.px-up { color: var(--red); }
.px-down { color: var(--blue); }
.px-table td.px-up { color: var(--red); }
.px-table td.px-down { color: var(--blue); }
.px-coin.px-up .px-coin-txt span, .px-coin.px-down .px-coin-txt span { color: inherit; opacity: .7; }
.px-price { transition: background .15s; border-radius: 3px; font-weight: 600; }
.px-flash-up { animation: pxFlashUp .6s ease-out; }
.px-flash-down { animation: pxFlashDown .6s ease-out; }
@keyframes pxFlashUp { 0% { background: rgba(240,96,96,0.4); } 100% { background: transparent; } }
@keyframes pxFlashDown { 0% { background: rgba(90,180,242,0.4); } 100% { background: transparent; } }
.px-table tbody tr { cursor: pointer; }

/* 행 클릭 시 바로 아래로 펼쳐지는 "차트 바로가기" 줄 */
.px-table tr.px-open td { background: var(--surface2); }
.px-detail td { padding: 10px 12px; background: var(--surface2); border-bottom: 1px solid var(--border2); }
.px-go-link { display: inline-flex; align-items: center; gap: 6px; background: var(--gold); color: #1a1500; font-family: var(--sans); font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: var(--radius); text-decoration: none; white-space: nowrap; }
.px-go-link:hover { background: var(--gold2); }

/* ── 김치프리미엄 밀집 테이블 (/kimchi) — 코인당 2줄 ── */
#kp-search { width: 100%; max-width: 360px; margin-bottom: 12px; font-family: var(--sans); font-size: 13px; padding: 9px 12px; border-radius: var(--radius); border: 1px solid var(--border2); background: var(--surface2); color: var(--text); }
.kp-table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 13px; }
.kp-table th { position: sticky; top: 0; z-index: 1; background: var(--surface2); color: var(--text2); font-weight: 600; font-size: 12px; padding: 9px 10px; border-bottom: 1px solid var(--border2); text-align: left; white-space: nowrap; }
.kp-table th.kp-num { text-align: right; }
.kp-sort { cursor: pointer; user-select: none; }
.kp-sorted-asc::after { content: ' ▲'; font-size: 9px; color: var(--gold); }
.kp-sorted-desc::after { content: ' ▼'; font-size: 9px; color: var(--gold); }
.kp-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.kp-table tbody tr:hover td { background: var(--surface2); }
.kp-num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.kp-a { font-weight: 600; color: var(--text); }
.kp-b { font-size: 11px; color: var(--text3); margin-top: 2px; }
.kp-a.px-up, .kp-b.px-up { color: var(--red); }
.kp-a.px-down, .kp-b.px-down { color: var(--blue); }
.kp-name { min-width: 130px; }
.kp-n1 { display: flex; align-items: center; gap: 8px; }
.kp-n1 .px-ico, .kp-n1 .px-ico img { width: 20px; height: 20px; }
.kp-ko { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.kp-n2 { display: flex; align-items: center; gap: 4px; margin-top: 3px; color: var(--text3); font-size: 11px; }
.kp-n2 strong { font-family: var(--mono); color: var(--text2); font-weight: 600; }

/* embed 모드(팝업 iframe): 사이드바/푸터 없이 콘텐츠만 */
body.embed #topnav, body.embed #tickerbar { display: none !important; }
body.embed footer, body.embed #scroll-top, body.embed .ad-slot { display: none !important; }

/* ── 복리 계획 (/plan) — 독립 페이지, 다른 기능 클래스에 의존하지 않음 ──
   수익 = var(--red), 손실 = var(--blue) (한국식) */
.pl-up { color: var(--red); }
.pl-down { color: var(--blue); }

.pl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pl-head-act { display: flex; gap: 8px; flex-wrap: wrap; }

.pl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.pl-card-t { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.pl-card-sub { font-family: var(--sans); font-size: 10px; letter-spacing: 0; text-transform: none; color: var(--text3); font-weight: 400; }

/* 설정 */
.pl-fields { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.pl-f { display: flex; flex-direction: column; gap: 4px; }
.pl-f > span { font-size: 11px; color: var(--text3); }
.pl-f .input, .pl-f select { width: 100%; }
.pl-suffix { display: flex; align-items: center; gap: 6px; }
.pl-suffix .input { flex: 1; min-width: 0; }
.pl-suffix b { font-family: var(--mono); font-size: 13px; color: var(--text2); }
.pl-note { font-size: 11px; color: var(--text3); margin-top: 10px; }

/* 요약 타일 */
.pl-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 12px; }
.pl-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.pl-kpi-t { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); }
.pl-kpi-v { margin-top: 4px; }
.pl-kpi-v b { display: block; font-family: var(--mono); font-size: 19px; font-weight: 600; color: var(--text); line-height: 1.25; }
.pl-kpi-v i { display: block; font-style: normal; font-size: 11px; color: var(--text3); margin-top: 2px; }

/* 곡선 */
.pl-chart-box { min-height: 170px; }
.pl-svg { display: block; width: 100%; height: 170px; }
.pl-chart-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-family: var(--mono); font-size: 11px; color: var(--text3); }
.pl-legend { display: inline-flex; align-items: center; gap: 5px; font-family: var(--sans); }
.pl-legend i { display: inline-block; width: 14px; height: 2px; margin-left: 6px; }
.pl-lg-plan { background: var(--gold); }
.pl-lg-act { background: var(--blue); }

/* 목표 역산 */
.pl-goal-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.pl-goal-row .pl-f { min-width: 180px; }
.pl-goal-out { flex: 1; min-width: 240px; font-size: 13px; color: var(--text2); line-height: 1.7; padding-bottom: 6px; }
.pl-goal-out b { color: var(--text); font-family: var(--mono); }
.pl-goal-out b.pl-hl { color: var(--gold); font-size: 15px; }
.pl-goal-note { display: block; font-size: 11px; color: var(--text3); }

/* 섹션 + 표 */
.pl-sec { margin-bottom: 20px; }
.pl-sec-t { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.pl-sec-sub { font-family: var(--sans); font-size: 10px; letter-spacing: 0; text-transform: none; color: var(--text3); font-weight: 400; }
.pl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pl-table thead th { font-family: var(--sans); font-size: 10px; font-weight: 600; color: var(--text2); letter-spacing: .06em; text-transform: uppercase; padding: 9px 10px; text-align: left; background: var(--surface2); border-bottom: 1px solid var(--border2); white-space: nowrap; }
.pl-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pl-table tbody tr:last-child td { border-bottom: none; }
.pl-table tbody tr:hover { background: var(--surface2); }
.pl-table .pl-num, .pl-table th.pl-num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.pl-rd { font-family: var(--mono); color: var(--text3); width: 64px; }
.pl-date { white-space: nowrap; color: var(--text2); }
.pl-goal-cell b { color: var(--text); font-weight: 600; }
.pl-today { background: rgba(232,184,75,.07); }
.pl-today-tag { font-size: 9px; font-weight: 700; color: #0a0a0e; background: var(--gold); border-radius: 3px; padding: 1px 4px; margin-left: 5px; }

/* 실제 잔액 입력칸 */
.pl-act-cell { padding: 4px 6px !important; }
.pl-act {
  width: 110px; text-align: right; background: var(--surface3); color: var(--text);
  border: 1px solid var(--border2); border-radius: 4px; padding: 5px 8px;
  font-family: var(--mono); font-size: 12px; outline: none;
}
.pl-act:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(232,184,75,.15); }
.pl-act::placeholder { color: var(--text3); }

.pl-disc { font-size: 11px; color: var(--text3); line-height: 1.6; margin: 18px 0 8px; }

@media (max-width: 1100px) {
  .pl-fields { grid-template-columns: repeat(3, 1fr); }
  .pl-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .pl-head-act { width: 100%; }
  .pl-head-act .btn-outline { flex: 1; padding: 9px 10px; font-size: 12px; }
  .pl-fields { grid-template-columns: repeat(2, 1fr); }
  .pl-kpis { grid-template-columns: repeat(2, 1fr); }
  .pl-kpi-v b { font-size: 16px; }
  .pl-table { font-size: 12px; }
  .pl-table td, .pl-table thead th { padding: 6px 7px; }
  .pl-act { width: 84px; font-size: 11px; }
  /* 좁은 화면에선 '시작 잔액'·'누적 수익률' 열을 숨겨 핵심만 남긴다 */
  .pl-table th:nth-child(3), .pl-table td:nth-child(3),
  .pl-table th:nth-child(8), .pl-table td:nth-child(8) { display: none; }
}


/* ── 디자인 정돈 (전 페이지 공통 오버라이드) ─────────────────────────────
   1) 한글 라벨에 모노폰트·자간·대문자 변환을 쓰지 않는다(띄엄띄엄 보이는 문제) — 숫자만 모노.
   2) 카드/표면은 radius-lg + 은은한 그림자로 깊이감.
   3) 광고 자리는 콘텐츠를 가리지 않게 톤다운(인라인 color:#fff를 덮어야 해서 !important). */
.card-title, .pl-card-t, .pl-sec-t, .pl-kpi-t, .alert-list-title, .ind-group-title,
.ai-section-title, .info-key, .form-label, .lockup-table th, .interpretation-title {
  font-family: var(--sans); letter-spacing: 0; text-transform: none;
}
.card-title, .pl-kpi-t, .info-key, .form-label, .lockup-table th { font-size: 12px; font-weight: 500; color: var(--text3); }
.pl-card-t, .pl-sec-t, .alert-list-title, .ind-group-title, .ai-section-title { font-size: 13px; font-weight: 700; color: var(--text); }
.pl-card-sub, .pl-sec-sub { font-size: 11px; margin-left: 6px; }
thead th, .pl-table thead th, .pl-table th.pl-num { font-family: var(--sans); letter-spacing: 0; text-transform: none; font-size: 12px; }
.footer-link, .footer-copy { font-family: var(--sans); font-size: 12px; letter-spacing: 0; }
.pl-kpi-v b { font-size: 20px; letter-spacing: -0.01em; }

/* 숫자는 자릿수 정렬 */
.price-cell, .rsi-cell, .px-num, .kp-num, .pl-num, .funding-table td, .liq-row, .kimchi-chip .kc-val,
.pl-kpi-v b, .wallet-stat-value { font-variant-numeric: tabular-nums; }

/* 표면 */
.card, .pl-card, .pl-kpi, .kimchi-widget, .alert-box, .alert-item, .ai-output,
.wallet-card, .scanner-controls, .table-wrap, .post-list {
  border-radius: var(--radius-lg);
}
.scanner-controls { background: var(--surface); border-color: var(--border); }
.notice-box { border-radius: var(--radius-lg); }

.page-header { margin-bottom: 20px; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.page-subtitle { color: var(--text3); }

.btn { border-radius: var(--radius); letter-spacing: 0; }
.btn:hover { transform: none; }
.btn-outline { background: var(--surface); border-color: var(--border2); color: var(--text2); }
.btn-outline:hover { color: var(--text); }

/* 광고 자리: 얇고 조용하게 */
.ad-slot, .ad-sidebar {
  background: transparent !important; border: 1px dashed var(--border) !important;
  color: var(--text3) !important; font-family: var(--sans) !important; font-weight: 500 !important;
  letter-spacing: 0 !important; font-size: 12px !important; transition: color .15s, border-color .15s;
}
.ad-slot *, .ad-sidebar * { color: inherit !important; font-weight: inherit !important; font-size: inherit !important; letter-spacing: 0 !important; }
.ad-slot:hover, .ad-sidebar:hover { color: var(--text2) !important; border-color: var(--border2) !important; }
.ad-top { height: 36px; margin: 12px 24px 0; border-radius: var(--radius); }
.ad-mid { height: 56px; border-radius: var(--radius-lg); }
body > .ad-mid { margin: 24px auto 0 !important; width: calc(100% - 48px); max-width: 1440px; } /* 인라인 margin:0 auto 덮어써 좌우 여백 확보 */
.ad-sidebar { border-radius: var(--radius-lg); }

/* 스크롤바 */
* { scrollbar-width: thin; scrollbar-color: var(--surface3) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

::selection { background: rgba(232,184,75,0.3); }

@media (max-width: 900px) {
  .ad-top { margin: 10px 16px 0; }
}

/* ── 새 기능 공용 패널 (브리핑·공지·온체인·차익거래·지갑) ─────────────── */
.oc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--card-shadow); }
.oc-ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.oc-ph h2 { font-size: 15px; font-weight: 700; }
.oc-sub { font-size: 12px; color: var(--text3); margin-bottom: 6px; }
.oc-empty { padding: 28px 16px; text-align: center; color: var(--text3); font-size: 13px; line-height: 1.7; }
.oc-note { font-size: 12px; color: var(--text3); line-height: 1.7; margin-top: 14px; }
.oc-grid { display: grid; gap: 12px; }
.oc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.oc-kpi { padding: 14px 16px; }
.oc-kpi .l { font-size: 12px; color: var(--text2); display: flex; justify-content: space-between; gap: 6px; }
.oc-kpi .l span { color: var(--text3); }
.oc-kpi .v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 2px; white-space: nowrap; }
.oc-kpi .s { font-size: 12px; color: var(--text3); }
.oc-table-wrap { overflow-x: auto; }
.oc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.oc-table th { padding: 9px 12px; font-size: 12px; font-weight: 500; color: var(--text3); text-align: left; background: none; border-bottom: 1px solid var(--border); text-transform: none; letter-spacing: 0; white-space: nowrap; }
.oc-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.oc-table tbody tr:last-child td { border-bottom: none; }
.oc-table tbody tr { cursor: default; }
.oc-table tbody tr:hover td { background: var(--surface2); }
.oc-table .r { text-align: right; }
.oc-table td small { color: var(--text3); font-size: 11px; margin-left: 6px; }
.oc-card .up, .oc-table .up, .wl-tx .up { color: var(--red); }
.oc-card .down, .oc-table .down, .wl-tx .down { color: var(--blue); }
.oc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.oc-chip { font-family: var(--sans); font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border2); background: var(--surface); color: var(--text2); cursor: pointer; }
.oc-chip:hover { color: var(--text); }
.oc-chip.on { background: var(--text); border-color: var(--text); color: var(--surface); }
.oc-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.oc-tab { font-family: var(--sans); font-size: 14px; font-weight: 600; padding: 10px 14px; background: none; border: none; border-bottom: 2px solid transparent; color: var(--text3); cursor: pointer; white-space: nowrap; }
.oc-tab:hover { color: var(--text); }
.oc-tab.on { color: var(--text); border-bottom-color: var(--gold); }
.oc-chart { display: block; width: 100%; height: 160px; }
.oc-legend { display: flex; gap: 12px; font-size: 12px; color: var(--text3); padding: 0 16px 12px; flex-wrap: wrap; }
.oc-legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.oc-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.oc-b-listing { background: var(--up-bg); color: var(--red); }
.oc-b-delisting { background: var(--surface3); color: var(--text2); }
.oc-b-warning { background: var(--gold-bg); color: var(--gold); }
.oc-b-warning_off { background: var(--down-bg); color: var(--blue); }
body:not(.dark) .oc-b-warning { color: #b98200; }
.oc-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; margin-top: 12px; font-size: 13px; color: var(--text2); }
.oc-cta a { font-weight: 700; color: var(--gold); text-decoration: none; white-space: nowrap; }
body:not(.dark) .oc-cta a { color: #b98200; }
@media (max-width: 700px) { .oc-kpi .v { font-size: 18px; } .oc-table td, .oc-table th { padding: 8px 10px; } }

/* 브리핑 (/briefing) */
.bf-hero { padding: 22px 24px; margin-bottom: 12px; }
.bf-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text3); margin-bottom: 10px; }
.bf-mood { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.bf-mood.m-강세 { background: var(--up-bg); color: var(--red); }
.bf-mood.m-약세 { background: var(--down-bg); color: var(--blue); }
.bf-mood.m-중립, .bf-mood.m-혼조 { background: var(--surface3); color: var(--text2); }
.bf-hero h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.35; }
.bf-hero p { font-size: 15px; color: var(--text2); margin-top: 10px; line-height: 1.75; }
.bf-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.bf-sec { padding: 16px 18px; }
.bf-sec h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.bf-sec ul, .bf-watch ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.bf-sec li, .bf-watch li { font-size: 14px; color: var(--text2); line-height: 1.6; padding-left: 14px; position: relative; }
.bf-sec li::before { content: ''; position: absolute; left: 2px; top: 0.7em; width: 4px; height: 4px; border-radius: 50%; background: var(--text3); }
.bf-watch { padding: 16px 18px; margin-bottom: 12px; border-left: 3px solid var(--gold); }
.bf-watch h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.bf-watch li::before { content: '☑'; position: absolute; left: -2px; color: var(--gold); font-size: 12px; }
.bf-archive { min-width: 180px; }
.bf-head-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bf-run-note { font-size: 13px; color: var(--text2); margin-bottom: 10px; min-height: 18px; }
.bf-run-note:empty { margin-bottom: 0; min-height: 0; }
.bf-run-note.bad { color: var(--gold); }
@media (max-width: 800px) { .bf-sections { grid-template-columns: 1fr; } .bf-hero h2 { font-size: 21px; } .bf-hero { padding: 18px; } }

/* 공지 (/notices) */
.nt-filters { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.nt-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.nt-row:last-child { border-bottom: none; }
.nt-row:hover { background: var(--surface2); }
.nt-ex { font-size: 12px; color: var(--text3); width: 40px; flex-shrink: 0; }
.nt-title { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-time { font-size: 12px; color: var(--text3); white-space: nowrap; }
@media (max-width: 600px) { .nt-row { flex-wrap: wrap; gap: 6px 10px; } .nt-title { flex-basis: 100%; order: 3; white-space: normal; } }

/* 온체인 (/onchain) */
.oc-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.oc-exbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 10px 0 6px; background: var(--surface2); }
.oc-exbar i:nth-child(1) { background: var(--gold); } .oc-exbar i:nth-child(2) { background: var(--blue); } .oc-exbar i:nth-child(3) { background: var(--text3); }
.oc-wallet-form { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 12px; }
.oc-wallet-form .input { flex: 1; min-width: 180px; }
.wl-card { margin-bottom: 12px; }
.wl-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.wl-name { display: flex; flex-direction: column; min-width: 0; }
.wl-name a { font-size: 12px; color: var(--text3); text-decoration: none; }
.wl-act { margin-left: auto; display: flex; gap: 6px; }
.wl-act button { font-family: var(--sans); font-size: 12px; padding: 5px 10px; border-radius: var(--radius); border: 1px solid var(--border2); background: var(--surface); color: var(--text2); cursor: pointer; }
.wl-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; padding: 14px 16px; }
.wl-txs { display: flex; flex-direction: column; }
.wl-tx { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); text-decoration: none; }
.wl-tx time { margin-left: auto; font-size: 12px; color: var(--text3); }
.chain-eth { background: rgba(98,126,234,0.15); color: #627EEA; border: 1px solid rgba(98,126,234,0.3); }
.chain-sol { background: rgba(153,69,255,0.12); color: #9945FF; border: 1px solid rgba(153,69,255,0.3); }
@media (max-width: 900px) { .oc-two, .wl-body { grid-template-columns: 1fr; } }

/* 차익거래 (/arbitrage) */
.ar-controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 14px 16px; margin-bottom: 12px; font-size: 13px; color: var(--text2); }
.ar-controls label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.ar-controls .input, .ar-controls select { padding: 7px 10px; }
.ar-pair { display: flex; flex-direction: column; line-height: 1.35; }
.ar-pair small { font-size: 11px; color: var(--text3); margin: 0 !important; }
.ar-spread { font-weight: 700; }
.ar-sus { font-size: 11px; color: var(--gold); margin-left: 6px; }
.ar-detail td { background: var(--surface2); white-space: normal; }
.ar-venues { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 12px; color: var(--text2); }
.ar-venues b { color: var(--text); font-weight: 600; margin-right: 4px; }
.oc-table tbody tr.ar-row { cursor: pointer; }

/* 알림 페이지 텔레그램 연결 */
.tgc { padding: 16px; margin-bottom: 18px; }
.tgc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tgc-top b { font-size: 15px; }
.tgc-top p { font-size: 13px; color: var(--text2); margin-top: 4px; }
.tgc-btn { display: inline-flex; align-items: center; gap: 6px; font-family: var(--sans); font-size: 14px; font-weight: 700; padding: 9px 16px; border-radius: var(--radius); border: none; background: #229ED9; color: #fff; text-decoration: none; cursor: pointer; white-space: nowrap; }
.tgc-subs { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text2); }
.tgc-subs label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tgc-off { background: none; border: none; color: var(--text3); font-size: 12px; cursor: pointer; text-decoration: underline; margin-left: auto; }

/* 홈 브리핑 한 줄 */
.hm-brief { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 12px 16px; text-decoration: none; color: var(--text); font-size: 14px; }
.hm-brief b { white-space: nowrap; }
.hm-brief span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); }
.hm-brief em { font-style: normal; font-size: 13px; color: var(--text3); white-space: nowrap; }
.hm-brief[hidden] { display: none; }
.ar-tx { font-size: 12px; color: var(--text3); white-space: nowrap; }
.ar-tx-ok { color: var(--green); font-weight: 600; }
.ar-tx-no { color: var(--red); font-weight: 700; }
.ar-venues i { font-style: normal; color: var(--text3); }
.ar-venues i.ar-ok { color: var(--green); } .ar-venues i.ar-no { color: var(--red); font-weight: 700; }
.ar-tx-detail { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border2); font-size: 12px; color: var(--text2); }
.ar-nets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ar-nets b { color: var(--text); margin-right: 2px; }
.ar-net { background: var(--surface2); border-radius: 4px; padding: 2px 7px; white-space: nowrap; }
.ar-tx-note { font-size: 11px; color: var(--text3); line-height: 1.6; margin-top: 8px; }

/* 뉴스·언급량 페이지(/news) — 긴 출처명·서브레딧명이 .nt-ex(40px 고정, notices 전용)와 겹치지 않도록 전용 클래스 */
.nw-title { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nw-src { flex: 0 0 auto; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text3); }
.nw-sub { flex: 0 0 auto; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text3); }
.nw-stats { flex: 0 0 auto; white-space: nowrap; font-size: 12px; color: var(--text3); }
@media (max-width: 640px) {
  .nt-row:has(.nw-title) { flex-wrap: wrap; gap: 4px 10px; }
  .nw-title { flex-basis: 100%; order: 3; white-space: normal; }
}
.nw-err { font-size: 11px; color: var(--text3); margin-top: 6px; font-family: var(--mono); }
.bt-mode-hint { font-size: 12px; color: var(--text3); margin-top: 8px; }

/* 상태형 신호 배지 — 늘 켜져 있는 추세·배열·과열 영역은 흐리게 (이벤트 배지와 구분) */
.badge.badge-state { opacity: .55; font-weight: 500; }

/* ── AI 작도: 바로 그리기 버튼 ── */
.ai-picks { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.ai-picks-label { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); }
.ai-picks-label.ai-or { margin: 4px 0 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.ai-pick-group { display: flex; flex-wrap: wrap; gap: 5px; }
.ai-pick-group button {
  background: var(--surface3); border: 1px solid var(--border2); color: var(--text2);
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  padding: 6px 10px; border-radius: 4px; cursor: pointer; transition: all .12s; white-space: nowrap;
}
.ai-pick-group button:hover { color: var(--text); border-color: var(--text3); }
.ai-pick-group button.on { background: var(--gold); border-color: var(--gold); color: #0a0a0e; }

/* Snapshot evidence and data availability in the scanner. */
.scan-sub { display:block; margin-top:5px; font-size:11px; color:var(--text2); white-space:normal; }
.scan-muted { color:var(--text3); font-size:12px; }
.scan-muted-row { background:var(--surface2); }
.scan-frame { display:block; font-size:11px; margin-bottom:5px; white-space:nowrap; }
.scan-metrics { margin-top:8px; font-size:11px; max-width:320px; white-space:normal; }
.scan-metrics summary { cursor:pointer; color:var(--text2); }
.scan-metrics div { margin:6px 0; }
.scan-metrics small { display:block; color:var(--text3); line-height:1.6; }
.scan-analysis { white-space:pre-wrap; line-height:1.8; }
#scanner-table-wrap td { vertical-align:top; }
#scanner-table-wrap .td-signal { min-width:240px; }
#scanner-table-wrap .badge { display:inline-block; margin:2px; }
.ai-analyze-btn { display:block; width:100%; margin-top:8px; padding:7px; border:1px solid var(--border); background:var(--surface2); color:var(--text); border-radius:4px; cursor:pointer; }
.ai-analyze-btn:disabled { opacity:.45; cursor:not-allowed; }
