/* live chart */
.ch-panel {
  --ch-ma1: var(--amber-deep); --ch-ma2: #8a6fb0; --ch-ma3: var(--text-2);
  --ch-ema: #1f93ad; --ch-bb: var(--text-3); --ch-rsi: #8a6fb0; --ch-macd: var(--amber-deep); --ch-sig: #1f93ad;
}
html[data-theme="dark"] .ch-panel { --ch-ma2: #a790d8; --ch-ema: #48bcd4; --ch-rsi: #a790d8; --ch-sig: #48bcd4; }

/* toolbar */
.ch-bar { gap: 10px 12px; }
.ch-pick { position: relative; }
.ch-cur { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); font-size: 15px; max-width: 100%; }
.ch-cur:hover { border-color: var(--text-3); }
.ch-cur b { font-weight: 680; letter-spacing: -.01em; white-space: nowrap; }
.ch-cur small { color: var(--text-3); font-size: 12.5px; font-weight: 560; white-space: nowrap; }
.ch-cur > .i { width: 14px; height: 14px; color: var(--text-3); }
.ch-cb { display: inline-grid; }
.ch-cb img { width: 22px; height: 22px; border-radius: 50%; }
.ch-dd { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: min(460px, calc(100vw - 2 * var(--gut))); padding: 10px; display: grid; gap: 8px; background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 24px 60px -20px rgba(10, 6, 16, .38); }
.ch-dd[hidden] { display: none; }
.ch-dd .search-in { min-width: 0; }
.ch-vf { width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ch-res { max-height: min(56vh, 420px); overflow-y: auto; display: grid; gap: 2px; align-content: start; }
.ch-it { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; text-align: left; width: 100%; }
.ch-it[aria-selected="true"] { background: var(--bg-soft); }
.ch-it img, .ch-it .cbadge { width: 22px; height: 22px; border-radius: 50%; }
.ch-in { display: grid; min-width: 0; line-height: 1.3; }
.ch-in b { font-size: 14px; font-weight: 650; }
.ch-in small { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-ip { display: grid; justify-items: end; font-size: 13px; line-height: 1.3; }
.ch-ip em { font-style: normal; font-size: 12px; font-weight: 600; }
.ch-empty { padding: 18px; text-align: center; color: var(--text-3); font-size: 14px; }
.ch-iv { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ch-iv button { padding: 0 10px; white-space: nowrap; }
.ch-inds { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-set { position: relative; }
.ch-set summary { list-style: none; cursor: pointer; }
.ch-set summary::-webkit-details-marker { display: none; }
.ch-set summary .i { width: 15px; height: 15px; }
.ch-set[open] summary { background: var(--text); color: var(--bg); border-color: var(--text); }
.ch-pop { position: absolute; z-index: 40; right: 0; top: calc(100% + 6px); width: 310px; padding: 14px; display: grid; gap: 14px; background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 24px 60px -20px rgba(10, 6, 16, .38); }
.ch-pg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 8px; align-items: end; }
.ch-pg > b { grid-column: 1 / -1; font-size: 13px; font-weight: 650; color: var(--text-2); }
.ch-f { display: grid; gap: 3px; font-size: 12px; color: var(--text-3); }
.ch-f input { height: 32px; width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); padding: 0 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.ch-f input:focus { outline: none; border-color: var(--amber-deep); }
.ch-pf { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }

/* chart area */
.ch-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.ch-left { position: relative; min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); padding: 6px 6px 8px 8px; }
.ch-box { position: relative; z-index: 0; flex: 1 1 auto; min-height: 540px; }
.ch-box > div { position: absolute; inset: 0; }
.ch-legend { position: absolute; z-index: 3; left: 16px; top: 12px; max-width: calc(100% - 110px); padding: 6px 10px; border-radius: 10px; background: color-mix(in oklab, var(--bg) 80%, transparent); pointer-events: none; font-size: 12.5px; line-height: 1.6; color: var(--text-2); display: grid; gap: 1px; }
.ch-legend:empty { display: none; }
.lg-a { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.lg-a b { font-size: 14px; font-weight: 680; color: var(--text); }
.lg-t { color: var(--text-3); }
.lg-b, .lg-c { display: flex; flex-wrap: wrap; gap: 0 10px; }
.lg-k { color: var(--text-3); margin-right: 3px; }
.lg-b b, .lg-c b { font-weight: 620; color: var(--text); }
.lg-b b.up { color: var(--up); }
.lg-b b.down { color: var(--down); }
.lg-i { display: inline-flex; align-items: center; gap: 5px; }
.sw { display: inline-block; width: 11px; height: 3px; border-radius: 2px; }
.sw-ma1 { background: var(--ch-ma1); }
.sw-ma2 { background: var(--ch-ma2); }
.sw-ma3 { background: var(--ch-ma3); }
.sw-ema { background: var(--ch-ema); }
.sw-bb { background: var(--ch-bb); }
.sw-rsi { background: var(--ch-rsi); }
.sw-macd { background: var(--ch-macd); }
.sw-sig { background: var(--ch-sig); }
.ch-msg { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 24px; font-size: 14px; color: var(--text-3); text-align: center; pointer-events: none; }
.ch-msg[hidden] { display: none; }

/* side summary */
.ch-side { padding: 18px; display: grid; gap: 18px; align-content: start; }
.ch-s1, .ch-s2 { display: grid; gap: 16px; align-content: start; }
.ch-hd { display: flex; align-items: center; gap: 12px; }
.ch-hb { display: inline-grid; }
.ch-hb img, .ch-hb .cbadge { width: 34px; height: 34px; border-radius: 50%; }
.ch-hd b { display: block; font-size: 16px; font-weight: 680; line-height: 1.3; }
.ch-hd small { font-size: 12.5px; color: var(--text-3); }
.ch-px { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.ch-p { font-size: 28px; font-weight: 680; letter-spacing: -.02em; line-height: 1.15; }
.ch-p small { font-size: 13px; color: var(--text-3); margin-left: 5px; font-weight: 600; letter-spacing: 0; }
.ch-c { font-size: 14px; font-weight: 620; }
.ch-conv { font-size: 13px; color: var(--text-3); margin-top: -10px; }
.ch-conv:empty { display: none; }
.ch-rg { display: grid; gap: 6px; }
.ch-rgl { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-3); }
.ch-rgl.num { color: var(--text-2); font-weight: 600; }
.ch-rgb { position: relative; height: 6px; border-radius: 3px; background: var(--bg-sunk); border: 1px solid var(--line); }
.ch-rgb i { position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--text); border: 2px solid var(--bg); }
html[data-motion="on"] .ch-rgb i { transition: left .5s var(--ease); }
.ch-dl { margin: 0; display: grid; }
.ch-dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ch-dl > div[hidden] { display: none; }
.ch-dl dt { color: var(--text-3); }
.ch-dl dd { margin: 0; font-weight: 620; text-align: right; }
.ch-dl dd small { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.ch-kp { padding: 12px 14px 4px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line); }
.ch-kh { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 6px; }
.ch-kh b { font-size: 14px; font-weight: 650; }
.ch-kp .ch-dl > div:last-child { border-bottom: 0; }
.ch-oth { display: grid; gap: 8px; }
.ch-ochips { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-mc { justify-self: start; }

@media (max-width: 1100px) {
  .ch-main { grid-template-columns: minmax(0, 1fr); }
  .ch-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .ch-side { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
@media (max-width: 640px) {
  .ch-side { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .ch-pick { flex: 1 1 100%; }
  .ch-cur { width: 100%; }
  .ch-cur > .i { margin-left: auto; }
  .ch-legend { left: 10px; top: 8px; max-width: calc(100% - 104px); font-size: 11.5px; padding: 4px 8px; }
  .ch-iv { width: 100%; }
  .ch-iv button { flex: 1 1 auto; padding: 0 4px; font-size: 13px; }
  .ch-legend .lg-c { display: none; }
  .ch-pop { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: 70vh; overflow-y: auto; }
  .ch-left { padding: 4px 2px 6px 4px; }
}
