/* 트레이드캠프 실시간 코인 데이터 스타일 — chapeul-renewal style.css 데이터 블록 이식(2026-10-02)
   토큰: --fg --muted --faint --line --pill-line --bg --soft --warm --accent(활성 세그·현재 메뉴에만). 그림자 없음, 카드 12px / 필 9999px. */

/* ---- 레이아웃: 왼쪽 메뉴 + 뷰 카드 ---- */
.data-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; width: 100%; }
.data-nav { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 116px); overflow-y: auto; scrollbar-width: thin; padding: 4px 8px 24px 0; }
.dn-group { margin-top: 22px; }
.dn-group:first-child { margin-top: 0; }
.dn-title { font-size: 13px; font-weight: 600; color: var(--faint); padding: 0 0 8px 14px; }
.dn-link { display: block; padding: 7px 0 7px 14px; font-size: 15px; line-height: 22px; color: var(--muted); border-left: 2px solid var(--line); }
.dn-link:hover { color: var(--fg); }
.dn-link[aria-current="page"], .dn-link.active { color: var(--fg); font-weight: 700; border-left-color: var(--accent); }
.dn-all { display: inline-block; margin-top: 26px; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); width: 100%; font-weight: 600; color: var(--fg); }
.dn-all:hover { color: var(--accent); }

/* ---- 뷰 카드 ---- */
.view { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.view-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.view-head h2 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -.4px; }
.view-head .st { font-size: 12px; line-height: 18px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.view-head .fs-btn { margin-left: auto; height: 32px; padding: 0 14px; border: 1px solid var(--pill-line); border-radius: 9999px; background: var(--bg); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.view-head .fs-btn:hover { color: var(--fg); border-color: var(--fg); }
.view-scroll { display: block; }
.view-body { display: block; padding: 20px 24px; min-width: 0; }
.view-body > .chart { height: min(600px, 68vh); }
.view-body > .chart[style*="height"] { height: auto; }
.view .muted { color: var(--muted); }
.view .muted2 { color: var(--faint); }
.view .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.view .up { color: #0e8a5c; }
.view .down { color: #d0344a; }
.view .live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #0e8a5c; margin-right: 6px; vertical-align: 1px; }
.view-body .note { margin: 14px 0 0; padding: 0; border: 0; border-radius: 0; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.view-body .btn.sm { height: 34px; padding: 0 14px; border: 1px solid var(--pill-line); border-radius: 9999px; background: var(--bg); color: var(--fg); font-size: 13px; font-weight: 600; }
.view-body .btn.sm:hover { border-color: var(--fg); }

/* 전체화면: 브라우저 전체화면 또는 .fsx(대체) 모두 화면을 꽉 채우는 앱형 배치 */
.view:fullscreen, .view.fsx { display: flex; flex-direction: column; height: 100vh; overflow: hidden; border: 0; border-radius: 0; background: var(--bg); }
.view.fsx { position: fixed; inset: 0; z-index: 100; }
.view:fullscreen .view-scroll, .view.fsx .view-scroll { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.view:fullscreen .view-body, .view.fsx .view-body { display: flex; flex-direction: column; flex: 1 0 auto; min-height: 100%; }
.view:fullscreen .view-body > *, .view.fsx .view-body > * { flex-shrink: 0; }
.view:fullscreen .view-body > .chart, .view.fsx .view-body > .chart, .view:fullscreen canvas.heat, .view.fsx canvas.heat { flex: 1 1 auto; height: auto; min-height: 360px; }

/* ---- 툴바: 필 모양 셀렉트·입력, 세그먼트 버튼 ---- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar select, .toolbar input { background: var(--bg); border: 1px solid var(--pill-line); color: var(--fg); padding: 8px 14px; border-radius: 9999px; font-size: 13px; line-height: 18px; }
.toolbar input { min-width: 140px; }
.toolbar select:focus-visible, .toolbar input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 9999px; }
.toolbar .seg { display: flex; border: 1px solid var(--pill-line); border-radius: 9999px; overflow: hidden; }
.toolbar .seg button { background: var(--bg); border: 0; color: var(--muted); padding: 7px 12px; cursor: pointer; font-size: 12px; line-height: 18px; font-weight: 600; white-space: nowrap; }
.toolbar .seg button + button { border-left: 1px solid var(--line); }
.toolbar .seg button:hover { color: var(--fg); background: var(--soft); }
.toolbar .seg button.active { background: var(--accent); color: #fff; }
.toolbar .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 0; }

/* ---- 차트 · 히트맵 캔버스 · 범례 ---- */
.chart { width: 100%; min-height: 360px; }
.chart.short { height: 380px; }
canvas.heat { display: block; width: 100%; height: min(620px, 70vh); min-height: 360px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); cursor: crosshair; touch-action: pan-y; }
.legend { display: flex; gap: 14px; font-size: 12px; line-height: 18px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---- 표 ---- */
.dtable { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 18px; }
.dtable th { text-align: right; color: var(--muted); font-weight: 700; font-size: 12px; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dtable th:first-child, .dtable td:first-child { text-align: left; }
.dtable td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtable td:first-child { font-family: inherit; font-weight: 700; }
.dtable tr:hover td { background: var(--soft); }
.dtable .coin { display: flex; align-items: center; gap: 8px; }
.dtable .coin i.cl { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; overflow: hidden; font-style: normal; font-size: 9px; font-weight: 900; color: var(--muted); }
.dtable .coin i.cl img { width: 22px; height: 22px; border-radius: 50%; display: block; object-fit: contain; }

/* ---- 김프 ---- */
.kimp-wrap { overflow: auto; }
@keyframes flUp { from { color: #0e8a5c; } }
@keyframes flDn { from { color: #d0344a; } }
.kimp-t .fl-up { animation: flUp .6s ease-out; }
.kimp-t .fl-dn { animation: flDn .6s ease-out; }
.kimp-t .cn { display: flex; align-items: center; gap: 6px; min-width: 0; }
.kimp-t .cn b { font-weight: 700; }
.kimp-t .cn .muted { font-weight: 400; font-size: 11px; }
.kimp-t td.kp { font-weight: 800; }
.kimp-t .m-only { display: none; }
.kp-flag { font-style: normal; font-size: 10px; line-height: 14px; font-weight: 700; padding: 2px 6px; border-radius: 9999px; background: var(--warm); color: #b4530a; white-space: nowrap; }
.kp-flag.warn { background: #fdecee; color: #d0344a; }

/* ---- KPI 카드 ---- */
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi > div { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.kpi .l { font-size: 12px; line-height: 18px; color: var(--muted); }
.kpi .v { font-size: 20px; line-height: 28px; font-weight: 800; margin-top: 2px; }
.kpi .s { font-size: 11.5px; line-height: 16px; color: var(--muted); margin-top: 3px; }

/* ---- 옵션 ---- */
.opt-h { font-size: 15px; line-height: 22px; font-weight: 800; margin: 18px 0 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.opt-h small { font-size: 12px; font-weight: 400; color: var(--muted); }
.opt-h select { background: var(--bg); border: 1px solid var(--pill-line); color: var(--fg); padding: 7px 12px; border-radius: 9999px; font-size: 12.5px; font-weight: 700; }
.opt-info { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; line-height: 1.7; }
.opt-info b { color: var(--fg); }
.opt-t tbody tr { cursor: pointer; }
.opt-t tbody tr.sel td { background: var(--warm); }
.opt-t td:first-child { font-weight: 700; }

/* ---- ETF ---- */
.etf-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; }
.etf-h h3 { margin: 0; font-size: 16px; line-height: 24px; letter-spacing: -.3px; }
.etf-h span { font-size: 12px; }
.etf-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.etf-grid { margin: 0; font-size: 12.5px; min-width: max-content; width: 100%; }
.etf-grid th, .etf-grid td { padding: 9px 12px; text-align: right; white-space: nowrap; }
.etf-grid th { position: sticky; top: 0; background: var(--soft); z-index: 2; }
.etf-grid .stick { position: sticky; left: 0; text-align: left; background: var(--bg); z-index: 1; font-weight: 700; }
.etf-grid thead .stick { background: var(--soft); z-index: 3; }
.etf-grid .tot { font-weight: 800; border-left: 1px solid var(--line); }
.etf-grid tr.latest td { background: #eaf6f0; }
.etf-grid tr.latest .stick { background: #e3f4ea; }
.etf-grid tr.sumrow td { border-top: 2px solid var(--line); font-weight: 800; background: var(--soft); }
.etf-grid tbody tr:hover td { background: var(--soft); }

/* ---- 상태 표시: 안내 · 로딩 · 오류 · 툴팁 ---- */
.placeholder { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14px; line-height: 22px; }
.placeholder h3 { margin: 0 0 8px; font-size: 17px; line-height: 26px; color: var(--fg); }
.placeholder p { margin: 0 0 6px; }
.placeholder code { display: inline-block; background: var(--soft); border: 1px solid var(--line); padding: 2px 8px; border-radius: 9999px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.loading { padding: 60px 20px; text-align: center; color: var(--muted); }
.spin { display: inline-block; width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: sp 1s linear infinite; vertical-align: middle; margin-right: 10px; }
@keyframes sp { to { transform: rotate(360deg); } }
.error-box { background: #fdecee; border: 1px solid #f5c2c8; color: #a8232f; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 20px; }
.tooltip { position: fixed; pointer-events: none; z-index: 99; display: none; padding: 8px 10px; background: var(--bg); color: var(--fg); border: 1px solid var(--pill-line); border-radius: 8px; font-size: 12px; line-height: 1.5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.tooltip[hidden] { display: none; }

/* ---- 롱/숏 비율 ---- */
.ls-bar { position: relative; display: flex; height: 20px; min-width: 150px; border-radius: 9999px; overflow: hidden; background: #e0485e; }
.ls-bar i { display: block; height: 100%; background: #119a66; flex: none; }
.ls-bar span { position: absolute; top: 0; line-height: 20px; font-size: 11px; font-weight: 800; color: #fff; padding: 0 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.ls-bar .lp { left: 0; }
.ls-bar .sp { right: 0; }
.ls-kpi .v { display: flex; gap: 8px; align-items: baseline; }
.ls-kpi .ls-bar { margin-top: 8px; min-width: 0; }
.ls-mood { display: inline-block; padding: 2px 9px; border-radius: 9999px; font-size: 11.5px; font-weight: 700; line-height: 18px; white-space: nowrap; }
.ls-mood.m-up { background: #e4f4ec; color: #0e8a5c; }
.ls-mood.m-up2 { background: #0e8a5c; color: #fff; }
.ls-mood.m-dn { background: #fbe9ec; color: #d0344a; }
.ls-mood.m-dn2 { background: #d0344a; color: #fff; }
.ls-mood.m-mid { background: var(--soft); color: var(--muted); }
.ls-sec { margin-top: 24px; }
.ls-sec h3 { margin: 0 0 8px; font-size: 16px; line-height: 24px; letter-spacing: -.3px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ls-sec h3 small { font-size: 12px; font-weight: 400; color: var(--muted); }
.ls-sec .toolbar { margin-bottom: 10px; }
.ls-t td { vertical-align: middle; }
.ls-t td:first-child { font-family: inherit; }
.ls-t .ls-bar { min-width: 130px; }
.ls-t tr.avg td { background: var(--soft); font-weight: 700; border-top: 2px solid var(--line); }
.ls-board tbody tr { cursor: pointer; }
.ls-board tbody tr.sel td { background: var(--warm); }

/* ---- 반응형 ---- */
@media (max-width: 1000px) {
  .data-layout { grid-template-columns: 1fr; gap: 12px; }
  .data-nav { position: static; top: auto; z-index: auto; max-height: none; background: var(--bg); border-bottom: 1px solid var(--line); margin: 0 -16px; padding: 10px 16px; }
  .data-nav, .dn-group { display: flex; align-items: center; gap: 6px; }
  .data-nav > a, .dn-link { flex: none; white-space: nowrap; }
  .data-nav { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .data-nav::-webkit-scrollbar { display: none; }
  .dn-group { margin: 0; flex: none; }
  .dn-title { display: none; }
  .dn-link { flex: none; padding: 7px 14px; border: 1px solid var(--pill-line); border-radius: 9999px; font-size: 13px; line-height: 18px; color: var(--muted); background: var(--bg); }
  .dn-link[aria-current="page"], .dn-link.active { color: #fff; background: var(--accent); border-color: var(--accent); font-weight: 600; }
  .dn-all { flex: none; width: auto; margin-top: 0; white-space: nowrap; padding: 7px 14px; border: 1px solid var(--pill-line); border-radius: 9999px; font-size: 13px; line-height: 18px; }
}
@media (max-width: 860px) {
  .view-head, .view-body { padding: 14px; }
  .view-head h2 { font-size: 19px; line-height: 26px; }
  .view-body > .chart { height: 420px; }
  canvas.heat { height: 440px; }
  .kpi { grid-template-columns: repeat(2, 1fr); }
  .kpi .v { font-size: 17px; line-height: 24px; }
}
@media (max-width: 720px) {
  .kpi5 > div:last-child { grid-column: 1 / -1; }
  .ls-t .m-hide { display: none; }
  .ls-sec .toolbar .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .ls-sec .toolbar .seg::-webkit-scrollbar { display: none; }
  .ls-t .ls-bar { min-width: 104px; }
  .ls-t td { padding: 9px 5px; }
  .ls-kpi .v { font-size: 16px; }
  .opt-t .m-hide, .kimp-t .m-hide { display: none; }
  .opt-t th, .opt-t td { padding: 9px 4px; font-size: 12px; }
  .opt-t td:first-child { white-space: normal; }
  .kimp-t { table-layout: fixed; }
  .kimp-t th, .kimp-t td { padding: 9px 4px; }
  .kimp-t th:nth-child(1) { width: 46%; }
  .kimp-t th:nth-child(2) { width: 22%; }
  .kimp-t th:nth-child(3) { width: 32%; }
  .kimp-t .cn { flex-wrap: wrap; gap: 0 5px; line-height: 1.3; }
  .kimp-t .cn b { flex: 0 0 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .kimp-t td.kp { font-size: 14px; }
  .kimp-t td { font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
  .kimp-t .m-only { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .spin, .kimp-t .fl-up, .kimp-t .fl-dn { animation: none; }
}
