:root,
[data-theme="dark"] {
  /* TradingView 다크(2026-11-25 임베드 위젯 theme=dark 실측 + TradingView CSS 색 토큰).
     차트·툴바 바탕 #000(--color-pane-bg), 창·메뉴 #131313(--color-popup-background),
     글 #b8b8b8(--color-text-primary), 흐린 글 #8c8c8c, 구분선·격자 #303030, 호버 #222. */
  --bg: #000000;
  --panel: #131313;
  --panel-2: #222222;
  --border: #303030;
  --text: #b8b8b8;
  --muted: #8c8c8c;
  --accent: #2962ff;
  --accent-soft: rgba(41, 98, 255, 0.18);
  --up: #089981;
  --down: #f23645;
  --hover: #222222;
  --grid: #303030;
  --input: #131313;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  --gold: #d4a514;
  --gold-soft: rgba(212, 165, 20, 0.16);
  --scroll: #464646;
  --crosshair: #9c9c9c;
  --crosshair-label: #303030;
  /* 로딩 뼈대·관심 목록 줄: TradingView 다크 회색 계열(#222 / #131313)로 */
  --skel: #222222;
  --skel-glint: rgba(255, 255, 255, 0.045);
  --wl-line: #222222;
  /* 영역 사이 4px 틈(body 바탕)과 작은 구분선 — TradingView 본 사이트(임베드 dark) #222, 구분선 #303030 */
  --gap: #222222;
  --sep-line: #303030;
  --btn-hover: #2e2e2e;
  --btn-on: #303030;
  color-scheme: dark;
}
[data-theme="light"] {
  /* TradingView 라이트(본 사이트 현재 팔레트, 2026-11-26 임베드 theme=light·사용자 차트 실측 + 색 토큰):
     패널·창 #fff, 틈 #ebebeb, 글 #000, 흐린 글 #707070, 호버 #f2f2f2, 켜짐 #ebebeb, 격자 #d3d3d3 점선.
     (전에는 2022 이전 팔레트 #131722 / #f8f9fd / #e0e3eb 이었다) */
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f2f2f2;
  --border: #ebebeb;
  --text: #000000;
  --muted: #707070;
  --accent: #2962ff;
  --accent-soft: rgba(41, 98, 255, 0.12);
  --up: #089981;
  --down: #f23645;
  --hover: #f2f2f2;
  --grid: #d3d3d3;
  --input: #ffffff;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  --gold: #b8860b;
  --gold-soft: rgba(184, 134, 11, 0.14);
  --scroll: #c9c9c9;
  --crosshair: #9c9c9c;
  --crosshair-label: #000000;
  --skel: #f2f2f2;
  --skel-glint: rgba(255, 255, 255, 0.75);
  --wl-line: #f2f2f2;
  --gap: #ebebeb;
  --sep-line: #ebebeb;
  --btn-hover: #f2f2f2;
  --btn-on: #ebebeb;
  color-scheme: light;
}
* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
*:hover {
  scrollbar-color: var(--scroll) transparent;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
}
:hover::-webkit-scrollbar-thumb {
  background: var(--scroll);
}
html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  /* TradingView 와 같은 글꼴 순서(데모 body 실측) */
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif;
  overflow: hidden;
}
button,
select,
input,
textarea {
  font: inherit;
  color: inherit;
}
svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.hidden {
  display: none !important;
}
.spacer {
  flex: 1;
}
.up {
  color: var(--up);
}
.down {
  color: var(--down);
}
.muted {
  color: var(--muted);
}

/* top bar — TradingView's header, measured on kr.tradingview.com (2026-11-26, light theme):
   38px tall; 38×38 icon buttons with 28px icons; hover = a #f2f2f2 rounded square (radius 6, inset 2),
   the interval / chart type in use = #ebebeb; ▾ buttons 24 wide; separators 1×22; symbol = a
   28px pill (#ebebeb, radius 14, hover #dbdbdb); text 14px. Dark values: TradingView's dark widget
   (separator / selected #303030) and our dark tokens. topbar.js builds it. */
.topbar {
  --tbx-ink: var(--text);
  --tbx-hov: var(--tv-hover);
  --tbx-on: #303030;
  --tbx-sep: #303030;
  --tbx-pill: #2e2e2e;
  --tbx-pill-hov: #3d3d3d;
  height: 38px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
  font: 14px/1 -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif;
  color: var(--tbx-ink);
  white-space: nowrap;
}
[data-theme="light"] .topbar {
  --tbx-ink: #000;
  --tbx-hov: #f2f2f2;
  --tbx-on: #ebebeb;
  --tbx-sep: #ebebeb;
  --tbx-pill: #ebebeb;
  --tbx-pill-hov: #dbdbdb;
}
.tb-left, .tb-right { display: flex; align-items: center; height: 38px; flex: none; }
.tb-right { margin-left: auto; padding-right: 4px; }
.tb-corner { position: relative; width: 52px; height: 38px; flex: none; display: grid; place-items: center; border: 0; padding: 0; background: transparent; cursor: default; }
.tb-corner .tb-logo svg { width: 28px; height: 28px; display: block; }
.tb-corner .status { position: absolute; top: 5px; right: 9px; width: 9px; height: 9px; margin: 0; box-shadow: 0 0 0 2px var(--bg); }
/* 심볼 검색 알약: 본 사이트 실측(BRIEF 2-3) 128×28 둥근 14, 왼쪽 돋보기 18×18 */
.tb-sym-mag { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.2; }
.tb-sym { display: inline-flex; align-items: center; justify-content: flex-start; gap: 4px; min-width: 128px; height: 28px; margin-left: 4px; padding: 0 12px 0 8px; border: 0; border-radius: 14px; background: var(--tbx-pill); color: var(--tbx-ink); font: inherit; font-weight: 600; cursor: default; flex: none; }
.tb-sym:hover { background: var(--tbx-pill-hov); }
.tbx { position: relative; height: 38px; min-width: 38px; padding: 0 5px; border: 0; background: transparent; color: var(--tbx-ink); font: inherit; display: inline-flex; align-items: center; justify-content: center; cursor: default; flex: none; }
.tbx { isolation: isolate; }
.tbx::before { content: ""; position: absolute; inset: 2px; border-radius: 6px; z-index: -1; }
.tbx:hover::before, .tbx.open::before { background: var(--tbx-hov); }
.tbx.on::before { background: var(--tbx-on); }
.tbx > * { position: relative; }
.tbx:disabled { cursor: default; opacity: 0.5; }
.tbx:disabled:hover::before { background: transparent; }
.tbx[aria-disabled="true"] { opacity: 0.35; cursor: default; }
.tbx[aria-disabled="true"]:hover::before { background: transparent; }
.tbx-tf { min-width: 0; padding: 0 6px; }
.tbx-menu { min-width: 24px; width: 24px; padding: 0; }
.tbx-text { padding: 0 10px 0 5px; }
.tbx-lbl { margin-left: 4px; }
.tbi-svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; }
.tbi-chev { width: 8px; height: 4px; fill: none; stroke: currentColor; stroke-width: 1.2; overflow: visible; }
.tbx-sep { width: 1px; height: 22px; margin: 0 4px; background: var(--tbx-sep); flex: none; }
.tb-favs { display: flex; height: 38px; flex: none; }
.tb-lname { height: 38px; max-width: 160px; padding: 0 6px 0 5px; border: 0; background: transparent; color: var(--tbx-ink); font: inherit; cursor: default; display: inline-flex; flex-direction: column; justify-content: center; align-items: flex-start; position: relative; flex: none; }
.tb-lname { isolation: isolate; }
.tb-lname::before { content: ""; position: absolute; inset: 2px; border-radius: 6px; z-index: -1; }
.tb-lname:hover::before { background: var(--tbx-hov); }
.tb-lname > span { position: relative; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tb-lname-s { font-size: 10px; color: var(--accent); }
.tb-lname-s:empty { display: none; }
/* Narrow: words beside Indicators / Alert / Replay go first, then the right-hand buttons. */
.topbar.compact .tbx-lbl { display: none; }
.topbar.compact .tb-sym { min-width: 0; }
.topbar.compact .tbx-text { padding: 0 5px; }
/* 그래도 넘치면 버튼을 숨기지 않고(TradingView 는 좁은 폭에서도 버튼을 없애지 않음 — 데모 390 폭 실측: 뒤 버튼이 화면 밖으로 이어짐)
   툴바를 옆으로 밀어 본다(휠·터치). */
.topbar.narrow { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
.topbar.narrow::-webkit-scrollbar { display: none; }
.topbar.narrow .tb-right { padding-left: 8px; }
.status {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
  display: inline-block;
}
.status.ok {
  background: var(--up);
}
.status.warn {
  background: #f7a600;
}
.status.bad {
  background: var(--down);
}

/* TradingView menus (topbar.js): rows 32px with a 6px gutter, the one in use black, section titles
   small and grey, switches black / grey, separators 1px. */
.tvm { position: fixed; z-index: 65; min-width: 172px; padding: 6px 0; overflow-y: auto; background: var(--tv-bg); color: var(--tv-text); border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--tv-border); font: 14px/18px -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif; user-select: none; }
.tvm-row { display: flex; align-items: center; gap: 8px; min-height: 32px; margin: 0 6px; padding: 0 8px; border-radius: 6px; cursor: default; white-space: nowrap; }
.tvm-row:hover { background: var(--tv-hover); }
.tvm-row.sel { background: var(--tv-strong); color: var(--tv-strong-text); }
.tvm-row.off { opacity: 0.4; cursor: default; }
.tvm-row.off:hover { background: transparent; }
.tvm-row.dim { color: var(--tv-muted); }
.tvm-row.tvm-tall { min-height: 40px; }
.tvm-row.tvm-tall2 { min-height: 48px; }
.tvm-lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.tvm-ico { width: 28px; height: 28px; flex: none; display: grid; place-items: center; }
.tvm-key { font-size: 12px; color: var(--tv-muted); margin-left: 12px; }
.tvm-row.sel .tvm-key, .tvm-row.sel .tvm-sub { color: inherit; }
/* 메뉴 묶음 제목: TradingView 실측 11px/16px · 대문자 · 자간 0.4px (예: MINUTES, CHART SNAPSHOT, SYNC IN LAYOUT) */
.tvm-sec { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px 4px; font-size: 11px; line-height: 16px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--tv-muted); }
.tvm-sec-fold { cursor: default; }
.tvm-sec-gap { margin-top: 8px; }
.tvm-sep { height: 1px; margin: 6px; background: var(--tv-border); }
.tvm > .tvm-sep:first-child { display: none; }
.tvm-star, .tvm-act { width: 24px; height: 24px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; background: transparent; color: inherit; cursor: default; opacity: 0; }
.tvm-star .tbi-star, .tvm-act .tbi-star { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.tvm-row:hover .tvm-star, .tvm-row:hover .tvm-act, .tvm-star.fav { opacity: 1; }
.tvm-row:not(.sel) .tvm-star:not(.fav) { color: var(--tv-muted); }
.tvm-two { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tvm-sub { font-size: 12px; line-height: 16px; color: var(--tv-muted); }
.tvm-empty { padding: 10px 14px; max-width: 280px; white-space: normal; font-size: 13px; color: var(--tv-muted); }
.tvm-head { padding: 8px 14px 2px; font-weight: 600; }
.tvm-status { display: flex; align-items: center; gap: 8px; padding: 2px 14px 6px; max-width: 280px; white-space: normal; font-size: 12px; color: var(--tv-muted); }
.tvm-i { display: inline-grid; margin-right: auto; color: #b8b8b8; }
:root:not([data-theme="light"]) .tvm-i { color: #707070; }
.tbi-info { width: 18px; height: 18px; }
.tvm-switch { position: relative; width: 38px; height: 20px; flex: none; border-radius: 10px; background: #9c9c9c; margin-left: 12px; }
:root:not([data-theme="light"]) .tvm-switch { background: #555555; }
.tvm-switch i { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left 0.12s; }
.tvm-switch.on { background: var(--tv-strong); }
.tvm-switch.on i { left: 21px; background: var(--tv-strong-text); }
.tvm-tabs { display: flex; gap: 4px; margin: 0 6px 4px; padding: 3px; }
.tvm-tab { flex: 1; height: 28px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; cursor: default; }
.tvm-tab.on { background: var(--tv-hover); font-weight: 600; }
.tvm-ind { width: 310px; }
/* r4a-misc-A (TV 터미널 데모 실측): 스냅샷 메뉴 266×104 · Manage layouts 메뉴 231×89 — 줄은 메뉴 폭 전체(둥근 0),
   아이콘 x 8 · 글 x 42(아이콘 없는 줄 12), 단축키는 글에서 70 이상 떨어져 오른쪽 여백 10, 제목 줄 28(첫 줄 y 34). 폭은 내용이 정한다. */
.tvm-lmm { min-width: 190px; }
.tvm-snap .tvm-row, .tvm-lmm .tvm-row { margin: 0; padding: 0 10px 0 8px; border-radius: 0; gap: 6px; }
.tvm-snap .tvm-row:not(:has(.tvm-ico)), .tvm-lmm .tvm-row:not(:has(.tvm-ico)) { padding-left: 12px; }
.tvm-snap .tvm-key, .tvm-lmm .tvm-key { margin-left: 64px; padding-top: 1px; color: var(--tv-muted); }
.tvm-snap .tvm-sec { padding: 6px 12px; color: #808080; }
.tvm-type { width: 228px; }
.tvm-layout { width: 428px; }
/* 레이아웃 메뉴: TradingView 데모 실측 — 줄 35px + 틈 6(줄 간격 41), 숫자 13px(x+12, 폭 18), 그림 버튼 29×27 둥근 4·간격 10, 줄 아래 선은 양옆 12 안쪽 */
.tvm.tvm-layout { padding-top: 13px; }
.tvm-grid-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 35px; padding-bottom: 3px !important; box-sizing: border-box; margin: 0 12px 6px; padding: 0; border-bottom: 1px solid var(--tv-border); }
.tvm-grid-n { width: 18px; margin-right: -10px; font-size: 13px; color: var(--tv-muted); }
.tvm-grid svg { width: 23px; height: 23px; }
.tvm-layout .tvm-sec { height: 36px; box-sizing: border-box; padding: 12px 14px 8px; }
.tvm-grid { width: 29px; height: 27px; border: 0; border-radius: 4px; background: transparent; color: inherit; display: grid; place-items: center; padding: 0; cursor: default; }
.tvm-grid:hover { background: var(--tv-hover); }
.tvm-grid.sel { background: var(--tv-strong); color: var(--tv-strong-text); }
.tvm-sync .tvm-lbl { flex: none; }

/* TradingView dialogs (topbar.js: layouts, names, custom interval) */
.tvdlg-back { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(0, 0, 0, 0.25); }
.tvdlg { max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--tv-bg); color: var(--tv-text); border-radius: 20px; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2); font: 14px/18px -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif; overflow: hidden; }
.tvdlg-head { display: flex; align-items: center; padding: 20px 17px 8px 20px; }
.tvdlg-title { flex: 1; font-size: 20px; line-height: 28px; font-weight: 600; }
.tvdlg-x { width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: inherit; display: grid; place-items: center; cursor: default; padding: 0; }
.tvdlg-x:hover { background: var(--tv-hover); }
.tvdlg-body { padding: 8px 20px 20px; overflow-y: auto; }
.tvdlg-search { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px 0 8px; border: 1px solid var(--tv-pop-border); border-radius: 8px; }
.tvdlg-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: inherit; font-family: inherit; font-size: 16px; line-height: 24px; }
.tvdlg-search .tbi-svg { color: var(--tv-muted); }
.tvdlg-colhead { display: flex; align-items: center; justify-content: space-between; height: 28px; margin: 18px 8px 4px 34px; }
.tvdlg-sorthead { color: var(--tv-muted); font-size: 11px; line-height: 16px; text-transform: uppercase; letter-spacing: 0.4px; }
.tvdlg-sortbtn { width: 28px; height: 28px; border: 0; padding: 0; border-radius: 6px; background: transparent; color: inherit; cursor: default; display: grid; place-items: center; }
.tvdlg-sortbtn:hover { background: var(--tv-hover); }
.tvdlg-list { min-height: 0; flex: 1 1 auto; overflow-y: auto; }
.tvdlg-item { position: relative; display: flex; align-items: center; gap: 8px; height: 48px; box-sizing: border-box; padding: 6px 38px 6px 34px; cursor: default; }
.tvdlg-item:hover, .tvdlg-item.kb { background: var(--tv-hover); }
.tvdlg-item.sel { background: var(--tv-strong); color: var(--tv-strong-text); }
.tvdlg-name { font-size: 14px; line-height: 18px; }
.tvdlg-sub { font-size: 12px; line-height: 16px; color: var(--tv-muted); }
.tvdlg-item.sel .tvdlg-sub { color: inherit; }
/* 별(왼쪽 8px)·지우기(오른쪽 8px) 22×22: 줄에 마우스를 올릴 때만, 켠 별은 늘(TradingView 데모) */
.tvdlg-del, .tvdlg-fav { position: absolute; top: 13px; width: 22px; height: 22px; border: 0; padding: 0; border-radius: 4px; background: transparent; color: inherit; display: grid; place-items: center; opacity: 0; cursor: default; }
.tvdlg-fav { left: 8px; }
.tvdlg-del { right: 8px; }
.tvdlg-del .tbi-star, .tvdlg-fav .tbi-star { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.tvdlg-fav.on { opacity: 1; color: #f9a825; }
.tvdlg-fav.on .tbi-star { fill: currentColor; }
.tvdlg-item:hover .tvdlg-del, .tvdlg-item:hover .tvdlg-fav, .tvdlg-item.kb .tvdlg-del, .tvdlg-item.kb .tvdlg-fav { opacity: 1; }
/* Layouts 창: TradingView 480×540(창이 낮으면 줄어듦), 목록만 스크롤 */
.tvdlg-layouts { height: min(540px, calc(100vh - 40px)); }
.tvdlg-layouts .tvdlg-body { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; overflow: hidden; padding: 0 20px 0; }
.tvdlg-layouts .tvdlg-head { padding: 17px 17px 17px 20px; }
.tvdlg-layouts .tvdlg-search { flex: none; }
.tvdlg-layouts .tvdlg-more { flex: none; margin: 0; padding: 4px 0 8px; max-height: 40%; overflow-y: auto; }
.tvm.tvdlg-pop { z-index: 1001; width: 236px; }
/* 이름 묻기·확인 창: TradingView 480×233 / 480×226, 안쪽 40px, 닫기 버튼은 오른쪽 위 8px */
.tvdlg-ask { position: relative; }
.tvdlg-ask .tvdlg-head { padding: 40px 40px 0; }
.tvdlg-ask .tvdlg-title { line-height: 24px; padding-right: 20px; }
.tvdlg-ask .tvdlg-x { position: absolute; top: 8px; right: 8px; }
.tvdlg-ask .tvdlg-body { padding: 16px 40px 40px; overflow: visible; }
.tvdlg-ask .tvdlg-label { margin: 0; line-height: 21px; }
.tvdlg-ask .tvdlg-input { font-size: 16px; }
.tvdlg-ask .tvdlg-foot { margin-top: 24px; gap: 12px; }
.tvdlg-ask .tvdlg-btn { padding: 0 11px; font-size: 16px; border-radius: 8px; }
.tvdlg-msg { padding: 4px 0 12px; line-height: 20px; }
.tvdlg-msg + .tvdlg-foot { margin-top: 16px; }
.tvdlg-msg.wl-ask-msg { padding: 0; line-height: 21px; }
.wl-ask-msg + .tvdlg-foot { margin-top: 27px; } /* "Clear all symbols?" 창 480×202(TV 3회차 실측: 글 아래 27px 에 버튼) */
.tvdlg-more { margin-top: 12px; font-size: 13px; color: var(--tv-muted); }
.tvdlg-more summary { cursor: default; padding: 4px 0; }
.tvdlg-ver .tvdlg-item { padding-left: 14px; min-height: 36px; color: var(--tv-text); }
.tvdlg-input, .tvdlg-sel { width: 100%; height: 34px; padding: 0 12px; border: 1px solid var(--tv-pop-border); border-radius: 6px; background: transparent; color: inherit; font: inherit; outline: 0; }
.tvdlg-input:focus, .tvdlg-sel:focus { border-color: var(--tv-focus); }
.tvdlg-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tvdlg-lbl { width: 70px; flex: none; }
.tvdlg-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.tvdlg-btn { height: 34px; padding: 0 16px; border: 1px solid var(--tv-cancel); border-radius: 6px; background: transparent; color: var(--tv-cancel-text); font: inherit; cursor: default; }
.tvdlg-btn.primary { border-color: var(--tv-strong); background: var(--tv-strong); color: var(--tv-strong-text); }

/* "Compare or Add Symbol" (symsearch.js mode "compare"): no title or category chips, and each row
   offers TradingView's three ways to add it (13px pills, 24px tall, rgba(0,0,0,.05)). */
.modal-card:has(.ss-list.cmp) .ss-chips { display: none; }
.modal-card:has(.ss-list.cmp) .ss-list { margin-top: 12px; }
.ss-sec { padding: 10px 20px 6px; font-size: 11px; color: var(--tv-muted); }
.ss-cmp { display: none; gap: 8px; margin-left: auto; }
.ss-cmp button { height: 24px; padding: 0 8px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, 0.05); color: inherit; font-size: 13px; cursor: default; }
:root:not([data-theme="light"]) .ss-cmp button { background: rgba(255, 255, 255, 0.08); }
.ss-cmp button:hover { background: rgba(0, 0, 0, 0.1); }
:root:not([data-theme="light"]) .ss-cmp button:hover { background: rgba(255, 255, 255, 0.16); }
.ss-list.cmp .ss-row:hover .ss-cmp, .ss-list.cmp .ss-row.sel .ss-cmp { display: inline-flex; }
.ss-list.cmp .ss-row:hover .ss-exname, .ss-list.cmp .ss-row:hover .ss-exico, .ss-list.cmp .ss-row.sel .ss-exname, .ss-list.cmp .ss-row.sel .ss-exico { display: none; }
.goto-btn svg { width: 22px; height: 22px; stroke-width: 1.2; }

/* main layout */
.main {
  display: flex;
  height: calc(100% - 39px);
}
/* The left drawing toolbar, sized like TradingView's: 52px wide, 52×38 buttons whose hover and
   selected backgrounds are 34px rounded squares, 28px icons, 13px between sections. */
.drawbar {
  --tb-ink: var(--text);
  --tb-hov: var(--hover);
  --tb-sel: #303030;
  --tb-on: #f2f2f2;
  --tb-on-ink: #000000;
  width: 52px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 6px 0 20px;
  gap: 0;
  flex: none;
}
[data-theme="light"] .drawbar {
  --tb-ink: #000;
  --tb-hov: #f2f2f2;
  --tb-sel: #ebebeb;
  --tb-on: #222;
  --tb-on-ink: #fff;
}
.drawbar button {
  border: 0;
  background: transparent;
  cursor: default;
  display: grid;
  place-items: center;
  padding: 0;
}
.drawbar hr {
  width: 36px;
  border: 0;
  border-top: 1px solid var(--border);
  margin: 6px 8px;
}
.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.grid {
  position: relative;
  flex: 1;
  display: grid;
  gap: 1px;
  background: var(--border);
  min-height: 0;
}
.side {
  width: 300px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex: none;
  background: var(--bg);
}

/* chart panes */
.pane {
  position: relative;
  background: var(--bg);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.pane.active::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #2962ff; /* TradingView 데모: 고른 차트 ::after 2px rgb(41,98,255) */
  pointer-events: none;
  z-index: 5;
}
.grid[data-count="1"] .pane.active::after {
  display: none;
}
.pane .chart {
  position: absolute;
  inset: 0;
}
/* Legend (TradingView status line, legend.js): one per pane. Rows 24px, title 16px/400, values 13px,
   buttons 28×24 with an 18px icon (charting library demo, 2026-11-26). */
.legend {
  position: absolute;
  left: 4px;
  top: 4px;
  z-index: 4;
  pointer-events: none;
  font-size: 13px;
  line-height: 24px;
  max-width: calc(100% - 90px);
}
.pane-legends { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.legend.sub { max-width: calc(100% - 150px); }
.legend .row {
  display: flex;
  gap: 0;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  min-height: 24px;
  width: fit-content;
  max-width: 100%;
}
.legend .row.series { pointer-events: auto; }
.legend .lg-logo { width: 18px; height: 18px; margin: 0 4px 0 5px; }
.legend .lg-title {
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  pointer-events: auto;
  cursor: default;
  display: inline-flex;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
}
.legend .lg-title > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 0; }
.legend.narrow .lg-title .lg-ex { min-width: calc(1.6em + 12px); }
.legend.narrow .lg-title .lg-sym { min-width: 3.2em; }
.legend .lg-title .lg-sym { flex-shrink: 2; }
/* 가운데 점은 뒤 조각에 붙은 12px(TradingView withDot): 점을 누르면 그 조각(간격 → Change interval). 줄이 좁아도 점은 남는다. */
.legend .lg-title .lg-tf::before,
.legend .lg-title .lg-ex::before { content: "·"; display: inline-block; width: 12px; text-align: center; }
.legend .lg-title .lg-tf, .legend .lg-title .lg-ex { min-width: 12px; }
.legend .lg-status { display: inline-flex; align-items: center; gap: 0; height: 18px; margin-left: 8px; border-radius: 9px; overflow: hidden; flex: none; pointer-events: auto; }
.legend .lg-dot { width: 18px; height: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--up) 18%, transparent); }
.legend .lg-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--up); }
.legend .lg-dot.pre, .legend .lg-dot.post { background: color-mix(in srgb, #ff9800 18%, transparent); }
.legend .lg-dot.pre::after, .legend .lg-dot.post::after { background: #ff9800; }
.legend .lg-dot.closed { background: color-mix(in srgb, var(--muted) 18%, transparent); }
.legend .lg-dot.closed::after { background: var(--muted); }
.legend .lg-d { width: 18px; height: 18px; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 600; color: #ff9800; background: color-mix(in srgb, #ff9800 14%, transparent); }
.legend .ohlc { display: inline-flex; margin-left: 8px; min-width: 0; }
.legend .ohlc > span { margin-right: 8px; flex: none; }
.legend .ohlc b {
  font-weight: 400;
  color: var(--text);
  margin-right: 2px;
}
.legend.narrow .ohlc .lg-o { display: none; }
.legend.tiny { max-width: calc(100% - 64px); }
/* TradingView 390 폭 실측: 이름 줄(이름 · 인터벌 · 거래소 + 장 상태)은 그대로 한 줄, C·변화는 자리가 모자라면 아래 줄로 내려간다
   (이름 y49 → 값 y72 → 거래량 y93). 전에는 거래소·장 상태·절대 변화를 빼서 한 줄에 욱여넣었다. */
.legend.narrow .row.series { flex-wrap: wrap; }
.legend.narrow .row.series .lg-title { flex: 0 1 auto; max-width: calc(100% - 60px); }
.legend.narrow .row.series .ohlc { flex: 0 0 calc(100% - 8px); }
.legend.tiny .ohlc .lg-chg { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* 두 줄로 접힌 심볼 줄은 범례 폭 전체를 차지한다(값 줄이 폭을 100% 로 잡아 줄을 바꾸므로). 줄과 값 묶음이 누름을 받으면
   글자 오른쪽의 빈 곳 밑에 놓인 그림·조절점을 잡을 수 없다(5회차 실측: 2×2 창에서 381×48 전체가 막힘). TradingView 는 줄(item)이
   누름을 통과시키고 제목 묶음·상태·값만 받는다 — 글자와 단추만 받게 한다. 사이 틈은 안쪽 여백으로 옮겨 hover 가 끊기지 않게. */
.legend.narrow .row.series, .legend.narrow .row.series .ohlc { pointer-events: none; }
.legend.narrow .row.series > *, .legend.narrow .row.series .ohlc > * { pointer-events: auto; }
.legend.narrow .row.series > .ohlc { pointer-events: none; }
.legend.narrow .row.series .lg-title { padding-right: 8px; }
.legend.narrow .row.series .lg-status { margin-left: 0; }
.legend.narrow .row.series .lg-btns { margin-left: 0; padding-left: 4px; }
.legend .ind {
  pointer-events: auto;
  border-radius: 4px;
  padding: 0 4px;
  border: 1px solid transparent;
  height: 24px;
  box-sizing: border-box;
}
/* TradingView (demo, 2026-11-27): the row itself lets the pointer through; only the title + inputs
   (.lg-tw) and the buttons answer it. Over the values nothing shows and a click does nothing. Text
   there is not selectable and keeps the arrow cursor. */
.legend .row { cursor: default; user-select: none; -webkit-user-select: none; }
.legend .ind { pointer-events: none; }
.legend .ind .lg-tw, .legend .ind .lg-btns { pointer-events: auto; }
.legend .lg-tw { display: inline-flex; align-items: center; flex: none; height: 100%; }
.legend .ind:hover, .legend .ind.sel { border-color: var(--border); }
.legend .ind.sel { border-color: var(--accent, #2962ff); }
.legend .lg-name { color: var(--text); margin-right: 4px; }
.legend .lg-in { color: var(--muted); margin-right: 4px; }
.legend .vals { display: inline-block; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .vals > span { margin-left: 4px; }
.legend .ind.off .lg-name, .legend .ind.off .lg-in, .legend .ind.off .vals { opacity: 0.45; }
.legend .lg-btns { display: none; align-items: center; flex: none; }
.legend .row:hover .lg-btns, .legend .row.sel .lg-btns { display: inline-flex; }
.legend .ind:hover .vals, .legend .ind.sel .vals { display: none; }
/* a hidden one keeps its eye (Show) out without the pointer (TradingView) */
.legend .ind.off .lg-btns { display: inline-flex; }
/* 숨긴 주 심볼의 범례 제목(TradingView 터미널 데모 4회차: 밝은 테마 rgb(184,184,184); 어두운 테마는 객체 트리의 숨긴 행 색 rgb(87,87,87)) */
.legend .row.series.off .lg-title { color: #575757; }
[data-theme="light"] .legend .row.series.off .lg-title { color: #b8b8b8; }
.legend .ind.off:not(:hover):not(.sel) .lg-btn:not([data-act="hide"]):not([data-act="vhide"]):not([data-act="cmphide"]) { display: none; }
.legend .row.series .lg-btns { margin-left: 4px; }
.legend .lg-btn {
  width: 28px;
  height: 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  cursor: default;
  display: grid;
  place-items: center;
  padding: 0;
}
.legend .lg-btn:hover { background: var(--hover, rgba(128, 128, 128, 0.18)); }
.legend .lg-btn svg { width: 18px; height: 18px; }
/* 줄 전체가 아니라 단추만 누름을 받는다: 줄이 범례 폭만큼 넓어 그 밑의 그림 조절점을 가로챘다. */
.legend .lg-toggle { padding: 3px 0 0 5px; }
.legend .lg-toggle .lg-tog { pointer-events: auto; }
.legend .lg-tog {
  width: 29px;
  height: 21px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: default;
}
.legend .lg-tog:hover { background: var(--panel); }
.legend .lg-tog svg { width: 18px; height: 18px; }
/* Pane buttons (panes.js): top right of the pane under the pointer, 24×24, 4px apart. */
.pane-btns { position: absolute; z-index: 5; display: flex; gap: 4px; }
.pane-btns[hidden] { display: none; }
.pane-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: default;
}
.pane-btn:hover { background: var(--hover, rgba(128, 128, 128, 0.22)); }
.legend .note {
  color: #f7a600;
  font-size: 11px;
  pointer-events: auto;
  white-space: normal;
  max-width: 420px;
}
.pane-msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  z-index: 3;
  pointer-events: none;
  text-align: center;
  padding: 20px;
}
.replay-bar {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  gap: 4px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  box-shadow: var(--shadow);
}
.replay-bar .rp-grip { display: grid; place-items: center; width: 14px; height: 28px; color: var(--muted); cursor: grab; touch-action: none; }
.replay-bar .rp-grip:active { cursor: grabbing; }
.replay-pick-line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid #2962ff; pointer-events: none; z-index: 4; }
.replay-bar button,
.replay-bar select {
  height: 28px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  cursor: default;
  padding: 0 8px;
}
.replay-bar button:hover {
  background: var(--hover);
}
.replay-bar .hint {
  color: var(--muted);
  padding: 0 6px;
}

/* tabs and panels */
.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  padding: 0 6px;
  height: 38px;
  flex: none;
}
.tabs button {
  border: 0;
  background: transparent;
  height: 30px;
  padding: 0 10px;
  cursor: default;
  border-radius: 4px;
  color: var(--muted);
  white-space: nowrap;
}
.tabs button:hover {
  background: var(--hover);
  color: var(--text);
}
.tabs button.active {
  color: var(--text);
  background: var(--hover);
}
.tabs .icon {
  padding: 0 6px;
}
.tab-body {
  flex: 1;
  overflow: auto;
  min-height: 0;
}
.bottom {
  height: 358px;
  margin-top: 4px;
  border-radius: 4px 4px 0 0;
  overflow: visible; /* 높이 손잡이가 위 틈(4px)까지 나와야 한다 — 안쪽은 탭 줄·내용이 각자 자른다 */
  display: flex;
  flex-direction: column;
  flex: none;
  background: var(--bg);
}
.bottom.collapsed {
  display: none;
}
.bottom, .side { position: relative; }
.resize-handle { position: absolute; z-index: 5; }
.resize-y { top: -5px; left: 0; right: 0; height: 7px; cursor: ns-resize; } /* TradingView: 7px, ns-resize, 패널 위 끝에서 5px 위부터 */
.resize-x { left: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; }
.resize-handle:hover, .resizing-x .resize-x, .resizing-y .resize-y { background: rgba(41, 98, 255, 0.45); }
.bottom.collapsed .resize-y, .bottom.max .resize-y { display: none; }
/* 최대화: 창 맨 위부터 맨 아래까지(차트 칸의 폭), TradingView 데모 */
.bottom.max { position: fixed; top: 0; bottom: 0; height: auto !important; margin: 0; z-index: 40; border-radius: 0; }
.bottom .tabs { border-radius: 4px 4px 0 0; }
.bottom .tab-body { overflow: auto; }
.bottom .bt-btn { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; flex: none; margin-left: -4px; }
.bottom .bt-btn:last-child { margin-right: -6px; }
.bottom .bt-btn svg { width: 28px; height: 28px; }
.bottom .bt-btn .bt-restore, .bottom .bt-btn.on .bt-max { display: none; }
.bottom .bt-btn.on .bt-restore { display: inline; }
body.resizing-y, body.resizing-y * { cursor: ns-resize !important; user-select: none; }
body.resizing-x, body.resizing-x * { cursor: col-resize !important; user-select: none; }
.bottom.collapsed .tab-body {
  display: none;
}
.pad {
  padding: 10px 12px;
}
.row-flex {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.field {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
}
.field > input,
.field > select {
  min-width: 70px;
}
input.in,
select.in,
textarea.in,
.field input,
.field select {
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--input);
  padding: 0 7px;
  color: var(--text);
}
textarea.in {
  height: auto;
  padding: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  width: 100%;
  resize: vertical;
  tab-size: 2;
}
.btn {
  height: 28px;
  padding: 0 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: default;
  white-space: nowrap;
}
.btn:hover {
  background: var(--hover);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover {
  filter: brightness(1.1);
}
.btn.small {
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
}
.btn.danger {
  color: var(--down);
}
.link {
  color: var(--accent);
  cursor: default;
  text-decoration: none;
}
.hint-text {
  color: var(--muted);
  font-size: 12px;
}

/* tables */
table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.t th {
  position: sticky;
  top: 0;
  background: var(--bg);
  text-align: right;
  font-weight: 500;
  color: var(--muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  cursor: default;
  white-space: nowrap;
  z-index: 1;
}
table.t td {
  text-align: right;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.t th:first-child,
table.t td:first-child,
table.t .l {
  text-align: left;
}
table.t tbody tr {
  cursor: default;
}
table.t tbody tr:hover {
  background: var(--hover);
}

/* cards in side panel */
.card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 8px;
  background: var(--panel);
}
.card .top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: start;
}
.card .sub {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
.impact-High {
  color: var(--down);
}
.impact-Medium {
  color: #f7a600;
}
.impact-Low {
  color: var(--muted);
}
.impact-Holiday {
  color: var(--muted);
}

/* stats grid */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}
.stat .k {
  color: var(--muted);
  font-size: 11px;
}
.stat .v {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.tester {
  display: grid;
  grid-template-columns: minmax(330px, 420px) 1fr;
  height: 100%;
}
.tester .left {
  border-right: 1px solid var(--border);
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 12px;
}
.tester .right {
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rules {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 10px;
}
.rule {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px;
}
.rule select,
.rule input {
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--input);
  padding: 0 5px;
  max-width: 150px;
}
.rule input.num {
  width: 70px;
}
.rule .x {
  margin-left: auto;
  border: 0;
  background: transparent;
  cursor: default;
  color: var(--muted);
}
h4 {
  margin: 10px 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.equity {
  height: 150px;
  border: 1px solid var(--border);
  border-radius: 6px;
  position: relative;
}
.next-step {
  font-size: 12px;
  color: var(--muted);
  border-left: 2px solid var(--accent);
  padding: 4px 10px;
}

/* heatmap */
.heatmap-wrap {
  position: relative;
  height: 100%;
}
.heatmap-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.tip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 9px;
  box-shadow: var(--shadow);
  font-size: 12px;
}

/* modal — TradingView 대화창 틀(데모 실측: 심볼 검색 840×680·Go to 302, 화면 가운데, 바탕 팝업색·둥근 6·테두리 없음,
   제목 20px/600/28px 가 x+20 y+20, 닫기 34×34 둥근 8 이 오른쪽 17·위 17, 머리 높이 68) */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 40;
  display: grid;
  place-items: center;
}
.modal-card {
  width: min(560px, calc(100vw - 16px));
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--tv-bg);
  color: var(--tv-text);
  border: 0;
  border-radius: 6px;
  box-shadow: var(--tv-shadow);
  overflow: hidden;
  font: 14px/18px -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif;
  outline: none; /* 창 자체가 초점을 받는다(Esc 는 창 안의 키만 닫는다) — 고리는 없음, .tvd 와 같게 */
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  height: 68px;
  box-sizing: border-box;
  padding: 0 17px 0 20px;
  font-weight: 600;
  font-size: 20px;
  line-height: 28px;
}
.modal-head > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-head button {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: default;
  color: var(--tv-text);
}
.modal-head button:hover { background: var(--tv-hover); }
.modal-head button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.modal-body {
  padding: 0 20px 16px;
  overflow: auto;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--tv-border);
}
/* 아래 버튼: TradingView Cancel(테두리) · Ok(채움), 높이 34·둥근 8·16px */
.modal-foot .btn { min-width: 44px; height: 34px; padding: 0 11px; border: 1px solid var(--tv-cancel); border-radius: 8px; background: transparent; color: var(--tv-cancel-text); font-size: 16px; }
.modal-foot .btn:hover { border-color: var(--tv-strong); background: var(--tv-strong); color: var(--tv-strong-text); }
.modal-foot .btn.primary { border-color: var(--tv-strong); background: var(--tv-strong); color: var(--tv-strong-text); }
.modal-foot .btn.primary:hover { border-color: var(--tv-ok-hover); background: var(--tv-ok-hover); }
.search-in {
  width: 100%;
  height: 38px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input);
  padding: 0 12px;
  color: var(--text);
}
.list {
  margin-top: 8px;
}
.list .item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: default;
}
.list .item:hover,
.list .item.sel {
  background: var(--hover);
}
.list .item .meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.list .group {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 10px 4px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-grid .field input,
.form-grid .field select {
  width: 100%;
}
/* Levels tab of a fib / Gann drawing's settings: one row per level (visible, coefficients, colour). */
.lv-title { margin: 8px 0 4px; color: var(--muted); font-size: 12px; }
.lv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin-bottom: 12px; max-height: 300px; overflow-y: auto; }
.lv-row { display: flex; align-items: center; gap: 6px; }
.lv-row .lv-num { width: 64px; }
.lv-row input[type="color"] { width: 28px; height: 22px; padding: 0; border: 0; background: none; }

/* toasts — 아래 가운데, 한 번에 하나(toast.js). 바탕은 화면과 반대 색(어두운 화면엔 밝게, 밝은 화면엔 어둡게):
   왼쪽 색 띠 카드 대신 짧은 알약 모양(사용자 요청 2026-11-27 "토스트 스타일을 좀 세련되게, 너무 AI 같은"). */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.toast {
  --toast-bg: #ececec;
  --toast-fg: #131313;
  --toast-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--toast-bg);
  color: var(--toast-fg);
  font-size: 13px;
  line-height: 18px;
  letter-spacing: -0.01em;
  box-shadow: var(--toast-shadow);
  pointer-events: auto;
  animation: toast-in 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-theme="light"] .toast {
  --toast-bg: #1c1c1c;
  --toast-fg: #f4f4f4;
  --toast-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 6px 18px rgba(0, 0, 0, 0.18);
}
/* 누를 것이 없는 토스트(글만)는 누름을 밑으로 보낸다 — 막대만 숨긴 모드에서 리플레이 막대 X 를 덮어 눌러도 끝나지 않았다
   (전체화면모드 갇힘 4b). 누르면 닫히는 것(sticky)과 단추가 있는 것은 그대로 받는다. */
.toast:not(.sticky):not(:has(.toast-act)) { pointer-events: none; }
.toast-msg { min-width: 0; overflow-wrap: anywhere; }
.toast-act { margin-left: 10px; padding: 2px 9px; border: 1px solid currentColor; border-radius: 4px; background: transparent; color: inherit; font: inherit; white-space: nowrap; }
.toast-act:hover { background: rgba(127, 127, 127, 0.18); }
.toast-msg b { font-weight: 600; }
/* 오류·얼러트는 글 앞의 작은 점 하나로만 구분 */
.toast.err::before,
.toast.alert::before {
  content: "";
  flex: none;
  align-self: flex-start;
  width: 6px;
  height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--down);
}
.toast.alert::before { background: #f7a600; }
.toast.bump { animation: toast-bump 0.16s ease-out; }
.toast.out { animation: toast-out 0.16s ease-in forwards; pointer-events: none; }
@keyframes toast-in {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
}
@keyframes toast-bump {
  50% { transform: scale(1.03); }
}
@keyframes toast-out {
  to {
    transform: translateY(4px);
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .bottom {
    height: 45% !important;
  }
}

/* PTQ connector */
.ptq-box { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--panel); }
.ptq-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.ptq-box p { margin: 6px 0; }
.ptq-verdict { display: inline-block; margin: 8px 0; padding: 4px 10px; border-radius: 4px; font-weight: 600; background: var(--hover); }
.ptq-verdict.up { color: var(--up); } .ptq-verdict.down { color: var(--down); } .ptq-verdict.warn { color: #f7a600; }
.ptq-arm { margin-top: 10px; border-left: 2px solid var(--accent); padding: 4px 10px; }
.ptq-arm ol { margin: 6px 0; padding-left: 18px; } .ptq-arm li { margin: 4px 0; }
.ptq-box code, .ptq-arm code, .tester code { background: var(--hover); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.ptq-box table.t td { white-space: normal; }
.ptq-box .stats { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }

/* news */
a.card.news { display: block; color: inherit; text-decoration: none; }
a.card.news:hover { border-color: var(--accent); }
.news-title { font-weight: 600; line-height: 1.35; }
.news-sum { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
/* seasonals */
.seas { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); height: 100%; }
.seas-left { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }
.seas-chart { flex: 1; min-height: 160px; position: relative; }
.seas-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 6px 12px; font-size: 12px; }
.seas-legend i { display: inline-block; width: 10px; height: 3px; margin-right: 5px; vertical-align: middle; }
.seas-right { overflow: auto; }
.seas-table td, .seas-table th { padding: 4px 5px; font-size: 11px; text-align: center; }
.seas-table td.l, .seas-table th:first-child { text-align: left; }
.seas-sum td { font-weight: 600; border-top: 1px solid var(--border); }
/* financials */
.fin-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 12px; }
.fin-stats div { display: flex; flex-direction: column; }
.fin-bars { display: flex; gap: 10px; align-items: flex-end; height: 150px; margin: 12px 0 4px; }
.fin-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.fin-stack { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.fin-bar { width: 38%; border-radius: 3px 3px 0 0; min-height: 1px; }
.fin-bar.rev { background: var(--accent); } .fin-bar.ni { background: var(--up); } .fin-bar.ni.neg { background: var(--down); }
.fin-col .sub { font-size: 10px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.replay-bar.follower { pointer-events: none; opacity: .8; }

/* gold: bonus quant features and the PTQ / Academy links */
.gold-box { border: 1.5px solid var(--gold); border-radius: 8px; padding: 10px 12px; background: var(--panel); box-shadow: 0 0 0 3px var(--gold-soft); }
.gold-box { min-width: 0; overflow-x: auto; }
.gold-box table.t td, .gold-box table.t th, .tester .right table.t td, .tester .right table.t th { white-space: normal; }
.gold-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.gold-badge { background: var(--gold); color: #1a1405; font-weight: 700; font-size: 11px; padding: 1px 7px; border-radius: 3px; letter-spacing: .03em; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1a1405; font-weight: 600; }
.btn.gold:hover { filter: brightness(1.08); }
.gold-text { color: var(--gold) !important; }
#tQuant, #tPtq { margin-top: 4px; }
table.t.heat td { text-align: center; } table.t.heat td.base { outline: 2px solid var(--gold); outline-offset: -2px; font-weight: 700; }
.ptq-verdict.warn { color: #f7a600; }

/* PTQ: its own brand, from part-timequant.com's dark appearance (globals.css, 29 Sep 2026):
   near-black ground with rose/cyan/peach glows, glass panels, Instrument Sans with an
   Instrument Serif italic accent, Fragment Mono eyebrows, blue pill buttons. */
.ptq-brand {
  --bg: #0d0e12;
  --panel: rgba(23, 24, 29, 0.72);
  --panel-2: #1c1d23;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f4f5f7;
  --muted: #a4a9b4;
  --accent: #3aa1ff;
  --accent-soft: rgba(58, 161, 255, 0.14);
  --up: #4cc38a;
  --down: #ff7a7a;
  --hover: rgba(255, 255, 255, 0.06);
  --input: #17181d;
  --scroll: rgba(255, 255, 255, 0.18);
  color-scheme: dark;
  color: #c9ccd3;
  font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
}
.ptq-ground, .ptq-box.ptq-brand, .tester.ptq-brand {
  background:
    radial-gradient(520px 320px at -6% -20%, rgba(255, 122, 217, 0.26), transparent 70%),
    radial-gradient(620px 380px at 108% 20%, rgba(94, 231, 255, 0.2), transparent 70%),
    radial-gradient(520px 300px at 46% 130%, rgba(255, 179, 107, 0.2), transparent 70%),
    #0d0e12;
}
.ptq-box.ptq-brand { position: relative; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 22px; padding: 18px 24px 16px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06); overflow: hidden; }
.ptq-tab { min-height: 100%; background: #0d0e12; }
.pad.ptq-tab { padding: 12px 18px; display: flex; justify-content: center; align-items: flex-start; }
.pad.ptq-tab > .ptq-box { width: 100%; max-width: 1040px; }
.ptq-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ptq-logo { display: inline-flex; align-items: center; gap: 8px; color: #f4f5f7; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.ptq-logo-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #1c1d24; color: #f4f5f7; border: 1px solid rgba(255, 255, 255, 0.1); }
.ptq-eyebrow { font-family: "Fragment Mono", ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #a4a9b4; }
.ptq-status { display: inline-flex; align-items: center; gap: 7px; font-family: "Fragment Mono", ui-monospace, monospace; font-size: 11px; color: #a4a9b4; }
.ptq-status i { width: 7px; height: 7px; border-radius: 50%; background: #4cc38a; box-shadow: 0 0 8px rgba(76, 195, 138, 0.7); }
.ptq-title { margin: 0 0 8px; color: #f4f5f7; font-size: 28px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.ptq-title em { font-family: "Instrument Serif", Georgia, "Times New Roman", serif; font-style: italic; font-weight: 400; letter-spacing: -0.01em; color: #9ccfff; }
.ptq-lead { margin: 0 0 16px; max-width: 640px; font-size: 14px; line-height: 1.55; color: #c9ccd3; }
.ptq-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; align-content: center; }
#tPtq, .pad.ptq-tab { container: ptqhost / inline-size; }
.ptq-box.ptq-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px 28px; }
@container ptqhost (min-width: 760px) { .ptq-box.ptq-split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; } }
.ptq-steps li { display: flex; gap: 12px; align-items: baseline; padding: 9px 14px; border-radius: 16px; background: rgba(23, 24, 29, 0.72); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); backdrop-filter: blur(12px); }
.ptq-steps span { flex: none; font-family: "Fragment Mono", ui-monospace, monospace; font-size: 11px; color: #6cb8ff; letter-spacing: 0.1em; }
.ptq-steps b { display: block; color: #f4f5f7; font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.ptq-steps p { margin: 0; font-size: 12.5px; line-height: 1.45; color: #a4a9b4; }
.ptq-actions { display: flex; gap: 12px 22px; flex-wrap: wrap; align-items: flex-start; margin: 0 0 12px; }
.ptq-action { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.ptq-action > span { font-family: "Fragment Mono", ui-monospace, monospace; font-size: 10.5px; letter-spacing: 0.04em; color: #a4a9b4; padding-left: 4px; }
.btn.ptq-outline, .ptq-brand .btn.ptq-outline { display: inline-flex; align-items: center; gap: 6px; background: rgba(58, 161, 255, 0.12); border: 1px solid rgba(58, 161, 255, 0.55); color: #9ccfff; font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif; font-size: 14px; font-weight: 600; border-radius: 999px; padding: 9px 20px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.btn.ptq-outline:hover, .ptq-brand .btn.ptq-outline:hover { background: rgba(58, 161, 255, 0.2); color: #fff; }
.ptq-foot { margin: 0; font-size: 12px; color: #8d929e; }
.ptq-brand p { color: #c9ccd3; }
.ptq-brand .hint-text, .ptq-brand .muted { color: #a4a9b4; }
.ptq-brand .ptq-foot { color: #8d929e; }
.ptq-brand .link, .ptq-brand a:not(.btn) { color: #6cb8ff; }
.ptq-brand .btn { text-decoration: none; border-radius: 999px; }
.btn.ptq, .ptq-brand .btn.ptq { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; background: #0467cc; border: 1px solid #0467cc; color: #fff; font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif; font-size: 14px; font-weight: 600; border-radius: 999px; padding: 9px 20px; }
.btn.ptq:hover, .ptq-brand .btn.ptq:hover { background: #0a78e6; border-color: #0a78e6; color: #fff; }
.btn.ptq-ghost, .ptq-brand .btn.ptq-ghost { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14); color: #f4f5f7; font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif; font-size: 14px; font-weight: 500; border-radius: 999px; padding: 9px 20px; }
.btn.ptq-ghost:hover, .ptq-brand .btn.ptq-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.ptq-brand .btn.small { font-size: 12px; padding: 4px 14px; }
.ptq-brand .btn.danger { background: rgba(255, 122, 122, 0.12); border: 1px solid rgba(255, 122, 122, 0.4); color: #ff7a7a; }
.ptq-brand .btn.danger:hover { background: rgba(255, 122, 122, 0.2); }
.ptq-brand .stat { background: rgba(23, 24, 29, 0.72); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 14px; }
.ptq-brand .ptq-verdict { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 999px; padding: 4px 14px; font-family: "Fragment Mono", ui-monospace, monospace; font-size: 12px; font-weight: 400; }
.ptq-brand .ptq-verdict.up { color: #4cc38a; background: rgba(76, 195, 138, 0.14); border-color: rgba(76, 195, 138, 0.35); }
.ptq-brand .ptq-verdict.down { color: #ff7a7a; background: rgba(255, 122, 122, 0.12); border-color: rgba(255, 122, 122, 0.4); }
.ptq-brand .ptq-verdict.warn { color: #e8b949; background: rgba(232, 185, 73, 0.14); border-color: rgba(232, 185, 73, 0.4); }
.ptq-brand .ptq-arm { margin-top: 14px; padding: 14px 16px; border: 1px solid rgba(58, 161, 255, 0.45); border-radius: 16px; background: rgba(58, 161, 255, 0.08); }
.ptq-brand code { background: rgba(255, 255, 255, 0.08); color: #f4f5f7; font-family: "Fragment Mono", ui-monospace, monospace; border-radius: 6px; padding: 1px 6px; }
.ptq-brand table.t th { background: transparent; font-family: "Fragment Mono", ui-monospace, monospace; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #8d929e; font-weight: 400; }
.ptq-brand table.t td { border-bottom-color: rgba(255, 255, 255, 0.08); }
.ptq-brand h4 { font-family: "Fragment Mono", ui-monospace, monospace; font-weight: 400; text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; color: #a4a9b4; margin: 16px 0 8px; }
.tester.ptq-brand .left { border-right-color: rgba(255, 255, 255, 0.1); }
.tabs button[data-tab="ptq"] { color: #6cb8ff; font-weight: 600; }

/* lines between charts: drag to resize (app.js buildGutters) */
.gutter { position: absolute; z-index: 20; }
.gutter-x { width: 9px; margin-left: -4px; cursor: col-resize; }
.gutter-y { height: 9px; margin-top: -4px; cursor: row-resize; }
.gutter:hover, body.resizing-x .gutter-x, body.resizing-y .gutter-y { background: color-mix(in srgb, var(--accent) 35%, transparent); }

/* custom drop-down lists (dropdown.js) */
.dd-btn { display: inline-flex; align-items: center; gap: 4px; }
.dd-chev { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; opacity: 0.7; }
.dd-menu { position: fixed; z-index: 1000; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 5px 0; max-height: 72vh; overflow: auto; font-size: 13px; outline: none; }
.dd-item { display: flex; align-items: center; gap: 6px; padding: 6px 16px 6px 8px; cursor: default; white-space: nowrap; }
.dd-item.hl { background: var(--hover); }
.dd-item.sel { color: var(--accent); }
.dd-check { width: 16px; text-align: center; color: var(--accent); }
/* 목록 메뉴(시간대·관심 목록 메뉴): TradingView 메뉴 실측(데모 시간대 메뉴: 팝업 바탕·둥근 6·테두리 없음, 행 32px·14px, 체크 칸 28 뒤 글자 x+40).
   그리기 툴바 펼친 목록·아이콘 고르기·떠 있는 툴바 목록은 각자 맞춘 모양이라 건드리지 않는다. */
.dd-menu:not(.tb-flyout):not(.icon-picker):not(.fb-pop) { background: var(--tv-bg); color: var(--tv-text); border: 0; border-radius: 6px; box-shadow: var(--tv-shadow); padding: 6px 0; font: 14px/18px -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif; }
.dd-menu:not(.tb-flyout):not(.icon-picker):not(.fb-pop) .dd-item { gap: 4px; min-height: 32px; box-sizing: border-box; padding: 0 12px 0 8px; }
.dd-menu:not(.tb-flyout):not(.icon-picker):not(.fb-pop) .dd-item.hl { background: var(--tv-hover); }
.dd-menu:not(.tb-flyout):not(.icon-picker):not(.fb-pop) .dd-item.sel { color: inherit; }
.dd-menu:not(.tb-flyout):not(.icon-picker):not(.fb-pop) .dd-check { width: 28px; flex: none; color: inherit; }

/* symbol search (symsearch.js), TradingView style */
/* 심볼 검색 — TradingView 데모 실측(1440×900): 창 840×680, 입력 상자 800×40(테두리 1px·둥근 8, 돋보기 28, 지우기 24),
   행 40px 한 줄: 로고 24(x+20) · 티커 16px(친 부분 700 파랑) · 설명 14px(x+264) · 종류 12px 흐림 · 거래소 14px · 거래소 로고 20, 행 아래 1px 선 */
.ss-card .modal-body { padding: 0; display: flex; flex-direction: column; min-height: 0; }
.ss-card { height: min(680px, calc(100vh - 40px)); max-height: calc(100vh - 40px); }
.ss-top { display: flex; align-items: center; gap: 0; flex: none; height: 40px; box-sizing: border-box; margin: 0 20px; padding: 0 8px; border: 1px solid var(--tv-border); border-radius: 8px; }
.ss-top:hover { border-color: var(--tv-border-hover); }
.ss-top:focus-within { border-color: #2962ff; box-shadow: inset 0 0 0 1px #2962ff; }
.ss-mag { width: 28px; height: 28px; fill: none; stroke: var(--tv-text); stroke-width: 1.3; flex: none; }
.ss-in { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--tv-text); font-size: 16px; line-height: 24px; height: 24px; padding: 0; text-transform: none; }
.ss-clear { width: 24px; height: 24px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--tv-muted); cursor: default; }
.ss-clear:hover { color: var(--tv-text); background: var(--tv-hover); }
.ss-clear svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.ss-chips { display: flex; flex-wrap: wrap; gap: 6px; row-gap: 2px; flex: none; padding: 10px 20px 8px; }
.ss-chip, .ss-ex { height: 28px; border: 1px solid transparent; border-radius: 14px; padding: 0 11px; font-size: 13px; line-height: 18px; cursor: default; background: var(--tv-hover); color: var(--tv-text); }
.ss-chip.on { background: var(--tv-strong); color: var(--tv-strong-text); }
/* 자료원 고르기는 분류 줄 아래 따로 한 줄(왼쪽 정렬) */
.ss-chips::before { content: ""; flex-basis: 100%; order: 1; height: 0; }
.ss-ex { order: 2; margin-left: 0; display: inline-flex; align-items: center; gap: 2px; background: transparent; border-color: var(--tv-border); }
.ss-ex svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.ss-list { overflow: auto; flex: 1; padding: 0; border-top: 1px solid var(--tv-sep); }
.ss-row { display: flex; align-items: center; gap: 8px; height: 40px; box-sizing: border-box; padding: 0 20px; border-bottom: 1px solid var(--tv-sep); cursor: default; }
.ss-row.sel { background: var(--tv-hover); }
.ss-tk { flex: 0 0 204px; min-width: 0; font-size: 16px; line-height: 24px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-hit { color: #2962ff; font-weight: 700; }
.ss-desc { flex: 1 1 0; min-width: 0; font-size: 14px; color: var(--tv-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-type { flex: none; font-size: 12px; color: var(--tv-muted); white-space: nowrap; }
.ss-star { border: 0; background: transparent; color: var(--tv-muted); font-size: 17px; cursor: default; visibility: hidden; padding: 0 4px; }
.ss-row.sel .ss-star, .ss-star.on { visibility: visible; }
.ss-star.on { color: #f7a600; }
.ss-exname { flex: none; font-size: 14px; color: var(--tv-text); white-space: nowrap; }
.ss-raw .ss-tk { flex: none; }
.ss-empty { color: var(--tv-muted); padding: 18px 20px; font-size: 14px; }
@media (max-width: 640px) {
  .ss-tk { flex-basis: 96px; }
  .ss-type { display: none; }
}

.feed-box { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-top: 10px; }
.feed-st { font-size: 12px; color: var(--muted); }

/* 공개 주소 로그인 화면 (gate.js). 앱 대화창(.tvd)과 같은 규칙: 창 바탕 --tv-bg, 모서리 6px, 그림자 --tv-shadow,
   글 14px · 제목 20px/600 · 단추 16px, 입력 칸·단추 모서리 8px, 포커스 테두리 --tv-focus. 바탕은 첫 칠과 같은 틈 색(--gap). */
.gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; box-sizing: border-box; overflow: auto; background: var(--gap, var(--bg)); font: 14px/20px -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif; color: var(--tv-text, var(--text)); }
.gate-card { width: min(380px, 100%); box-sizing: border-box; display: flex; flex-direction: column; gap: 16px; padding: 28px 24px 24px; border: 1px solid var(--tv-border, var(--border)); border-radius: 6px; background: var(--tv-bg, var(--panel)); box-shadow: var(--tv-shadow, var(--shadow)); }
.gate-brand { display: flex; align-items: center; gap: 12px; }
.gate-logo { flex: none; width: 40px; height: 40px; }
.gate-logo svg { display: block; width: 40px; height: 40px; }
.gate-logo svg * { stroke: none; } /* 아이콘은 채움만(공통 svg 규칙의 테두리 색이 다크에서 회색 윤곽으로 보였다) */
.gate-title { font-size: 20px; font-weight: 600; line-height: 28px; color: var(--tv-tab-on, var(--text)); }
.gate-sub { color: var(--tv-muted, var(--muted)); font-size: 14px; line-height: 20px; }
.gate-field { position: relative; display: flex; }
.gate-in { flex: 1; min-width: 0; height: 40px; box-sizing: border-box; padding: 0 44px 0 12px; border: 1px solid var(--tv-pop-border, var(--border)); border-radius: 8px; background: transparent; color: var(--tv-input-text, var(--text)); font: inherit; font-size: 16px; outline: 0; }
.gate-in.gate-user { padding-right: 12px; }
.gate-in::placeholder { color: var(--tv-muted, var(--muted)); }
.gate-in:hover { border-color: var(--tv-border-hover, var(--muted)); }
.gate-in:focus { border-color: var(--tv-focus, var(--accent)); box-shadow: 0 0 0 1px var(--tv-focus, var(--accent)); }
.gate-in.err { border-color: var(--down); }
.gate-in.err:focus { box-shadow: 0 0 0 1px var(--down); }
.gate-in:disabled { opacity: 0.5; }
.gate-eye { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--tv-muted, var(--muted)); cursor: default; }
.gate-eye:hover:not(:disabled) { background: var(--tv-hover, var(--hover)); color: var(--tv-text, var(--text)); }
.gate-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.gate-eye:disabled { opacity: 0.5; cursor: default; }
.gate-msg { min-height: 20px; margin: -6px 0; color: var(--tv-muted, var(--muted)); font-size: 13px; line-height: 20px; }
.gate-msg.err { color: var(--down); }
.gate-btn { height: 40px; padding: 0 16px; border: 1px solid var(--tv-strong); border-radius: 8px; background: var(--tv-strong); color: var(--tv-strong-text); font: inherit; font-size: 16px; font-weight: 600; cursor: default; }
.gate-btn:hover:not(:disabled) { border-color: var(--tv-ok-hover); background: var(--tv-ok-hover); }
.gate-btn:disabled { opacity: 0.5; cursor: default; }
.gate-btn:focus-visible, .gate-eye:focus-visible { outline: 2px solid var(--tv-focus, var(--accent)); outline-offset: 2px; }
/* 작업 공간을 못 불러왔을 때(state-load.js): 자리표시 위에 덮는 오류 칸 */
.state-fail { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; box-sizing: border-box; background: rgba(0, 0, 0, 0.45); font: 14px/20px -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif; color: var(--tv-text, var(--text)); }
.state-fail-card { width: min(420px, 100%); box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; padding: 20px 24px; border: 1px solid var(--tv-border, var(--border)); border-radius: 6px; background: var(--tv-bg, var(--panel)); box-shadow: var(--tv-shadow, var(--shadow)); }
.state-fail-card b { font-size: 16px; }
.state-fail-card p { margin: 0; }
.state-fail-why { color: var(--down); word-break: break-word; }
.state-fail-note { color: var(--tv-muted, var(--muted)); }
.state-fail-card .btn { align-self: flex-end; }
/* 설정 창 공개 접속 칸: 로그인된 기기 · 로그인 기록 표 */
.acc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.acc-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.acc-scroll { margin-top: 8px; overflow-x: auto; }
.acc-scroll.acc-log { max-height: 260px; overflow-y: auto; }
.acc-t { width: 100%; border-collapse: collapse; font-size: 12px; }
.acc-t th { position: sticky; top: 0; padding: 6px 8px; border-bottom: 1px solid var(--border); background: var(--tv-bg, var(--panel)); color: var(--muted); font-weight: 500; text-align: left; white-space: nowrap; }
.acc-t td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; vertical-align: middle; }
.acc-t tbody tr:last-child td { border-bottom: 0; }
.acc-t .acc-act { text-align: right; width: 1%; }
.acc-mono { font-variant-numeric: tabular-nums; }
.acc-badge { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 4px; background: var(--accent-soft, rgba(41, 98, 255, 0.18)); color: var(--accent); font-size: 11px; line-height: 18px; }
.acc-ev.bad { color: var(--down); }
.acc-sub { color: var(--muted); }
.acc-empty { margin: 8px 0 0; }
.acc-who { margin-top: 6px; font-size: 13px; }
.acc-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.acc-row .in { flex: 1 1 150px; min-width: 0; }
.acc-row select.in { flex: 0 0 auto; }
.acc-all { font-size: 12px; }
.acc-t tr.off td:first-child { color: var(--muted); }
.acc-act .acc-btns { justify-content: flex-end; flex-wrap: nowrap; }

/* ---------- drawing toolbar (TradingView layout) ---------- */
.drawbar { overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.drawbar .tb-group { position: relative; width: 52px; height: 38px; flex: none; }
.drawbar .tb-main { position: relative; width: 52px; height: 38px; color: var(--tb-ink); }
.drawbar .tb-main::before { content: ""; position: absolute; inset: 2px 9px; border-radius: 6px; }
.drawbar .tb-main:hover::before { background: var(--tb-hov); }
.drawbar .tb-main.active::before { background: var(--tb-sel); }
.drawbar .tb-main svg { position: relative; }
/* Tools we haven't built yet look the same as TradingView's (their tooltip says so); only the
   lists dim them. */
.drawbar .tb-main.off { cursor: default; }
.drawbar .tb-main.off:hover::before { background: transparent; }
/* An option that is on (magnet, keep drawing, lock, hide, favourites bar): dark square, light icon. */
.drawbar .tb-main.on { color: var(--tb-on-ink); }
.drawbar .tb-main.on::before { background: var(--tb-on); }
.drawbar .tb-arrow { position: absolute; right: 0; top: 2px; width: 11px; height: 34px; border-radius: 4px 0 0 4px; opacity: 0; color: var(--tb-ink); }
.drawbar .tb-arrow svg.ti { width: 10px; height: 16px; stroke-width: 1; }
.drawbar .tb-group:hover .tb-arrow { opacity: 1; }
.drawbar .tb-arrow:hover { background: var(--tb-hov); }
.drawbar .tb-fill { flex: 1 0 8px; }
/* TradingView's own icons (floating toolbar): sizes and fills as given. */
svg.tvi { fill: none; stroke: none; flex: none; }
svg.ti { width: 28px; height: 28px; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; }
svg.ti.small { width: 18px; height: 18px; }
svg.ti.tiny { width: 12px; height: 16px; stroke-width: 1.4; }
.tb-flyout { padding: 4px 0; min-width: 260px; }
.tb-flyout .tb-sec { padding: 8px 14px 4px; font-size: 11px; line-height: 16px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.tb-flyout .tb-sep { border-top: 1px solid var(--border); margin: 4px 0; }
.tb-flyout .tb-row { gap: 10px; padding: 0 10px 0 8px; min-height: 40px; font-size: 14px; }
.tb-flyout .tb-row.off { opacity: .4; cursor: default; }
.tb-flyout .tb-row.off:hover { background: transparent; }
.tb-flyout .tb-label { flex: 1; }
.tb-flyout .tb-key { color: var(--muted); font-size: 12px; min-width: 34px; text-align: right; }
.tb-flyout .tb-check { width: 16px; text-align: center; color: var(--accent); }
/* Star (TradingView: 24px button, 18px star; outline #707070 on row hover, starred = filled #222 always shown). */
.tb-flyout .tb-star { width: 24px; height: 24px; flex: none; border: 0; background: transparent; color: var(--tv-muted); opacity: 0; display: grid; place-items: center; padding: 0; cursor: default; }
.tb-flyout .tb-row:hover .tb-star, .tb-flyout .tb-star.fav { opacity: 1; }
.tb-flyout .tb-star.fav { color: var(--text); }
[data-theme="light"] .tb-flyout .tb-star.fav { color: #222; }
/* Icons picker (TradingView: 354×583, Emoji / Stickers / Icons tabs, 28px cells). */
.icon-picker { width: 354px; max-height: none; height: min(583px, calc(100vh - 16px)); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.icon-picker .ip-tabs { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--border); flex: none; }
.icon-picker .ip-tabs button { border: 0; background: transparent; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid transparent; cursor: default; font-size: 14px; }
.icon-picker .ip-tabs button.active { color: var(--text); border-bottom-color: var(--text); }
.icon-picker .ip-tabs button.off { opacity: 0.5; }
.icon-picker .ip-body { overflow-y: auto; padding: 4px 12px 12px; flex: 1; }
.icon-picker .ip-sec { padding: 12px 0 6px; font-size: 12px; color: var(--muted); }
.icon-picker .ip-grid { display: grid; grid-template-columns: repeat(10, 28px); gap: 5px; }
.icon-picker .ip-cell { width: 28px; height: 28px; border: 0; border-radius: 4px; background: transparent; font-size: 22px; line-height: 28px; padding: 0; cursor: default; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.icon-picker .ip-cell:hover, .icon-picker .ip-cell.sel { background: var(--hover); }
/* Favorite Drawing Tools Toolbar, measured from TradingView (light theme, getComputedStyle 2026-11-25):
   38px tall, white, radius 6, two soft shadows, 24px grip of 2px dots (#b8b8b8), 38×38 buttons with
   28px black icons, hover = 34px #f2f2f2 square (radius 2), tool in use = blue icon. Dark values are ours. */
.fav-bar { --fb-bg: var(--tv-bg); --fb-ink: #dbdbdb; --fb-hov: var(--tv-hover); --fb-grip: #707070; --fb-shadow: 0 0 2px rgba(0, 0, 0, 0.6), 0 3px 9px rgba(0, 0, 0, 0.45);
  position: fixed; z-index: 30; display: flex; height: 38px; background: var(--fb-bg); border-radius: 6px; box-shadow: var(--fb-shadow); user-select: none; }
[data-theme="light"] .fav-bar { --fb-ink: #000; --fb-grip: #b8b8b8; --fb-shadow: 0 0 2px #dbdbdb, 0 3px 9px #ebebeb; }
.fav-bar button { position: relative; width: 38px; height: 38px; flex: none; border: 0; background: transparent; color: var(--fb-ink); display: grid; place-items: center; cursor: default; padding: 0; }
.fav-bar button::before { content: ""; position: absolute; inset: 2px; border-radius: 2px; }
.fav-bar button:hover::before { background: var(--fb-hov); }
.fav-bar button svg { position: relative; }
.fav-bar button.active { color: var(--accent); }
.fav-grip { width: 24px; height: 38px; flex: none; display: grid; place-items: center; color: var(--fb-grip); cursor: grab; touch-action: none; }
.fav-grip svg { width: 8px; height: 12px; fill: currentColor; stroke: none; }
.fav-bar.dragging, .fav-bar.dragging .fav-grip { cursor: grabbing; }
.fav-tip { position: fixed; z-index: 70; pointer-events: none; padding: 3px 8px; border-radius: 2px; background: var(--tv-strong); color: var(--tv-strong-text); font: 13px/18px -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif; white-space: nowrap; }
[data-theme="light"] .fav-tip { color: #f2f2f2; }
.fav-tip::after { content: ""; position: absolute; top: 100%; left: calc(var(--ear, 50%) - 6px); border: 6px solid transparent; border-top: 4px solid var(--tv-strong); border-bottom: 0; }
.fav-tip.below::after { top: auto; bottom: 100%; border-top: 0; border-bottom: 4px solid var(--tv-strong); }
/* 점 커서(TradingView dot.cur 를 보고 우리가 그린 것 — 7회차): 진한 점(#353535, 지름 4) 둘레에 흰 테(80%, 지름 9), 핫스팟 = 가운데. 십자선 선은 보인다. */
.chart[data-cursor="dot"] { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9'%3E%3Ccircle cx='4.5' cy='4.5' r='4.5' fill='%23fff' fill-opacity='.8'/%3E%3Ccircle cx='4.5' cy='4.5' r='2' fill='%23353535'/%3E%3C/svg%3E") 4 4, default; }
/* 지우개 커서(TradingView eraser.cur 를 보고 우리가 그린 것 — 32×32, 핫스팟 5,5 = 왼쪽 위 작은 과녁): 차트 안 어디서나(그림 위에서도 손 모양이 아님). */
body.eraser-tool .chart, body.eraser-tool .chart[data-over] { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cg transform='translate(-1.5 -2.5)' stroke-linejoin='round'%3E%3Cpath d='M6.5 20.95L4.95 18.35L17.95 5.3L24.3 11.55L15.1 21Z' fill='%23fff' stroke='%23fff' stroke-width='3'/%3E%3Cpath d='M17.95 5.3L24.3 11.55L20.1 16.3L13.8 10Z' fill='%23363636'/%3E%3Cpath d='M6.5 20.95L4.95 18.35L17.95 5.3L24.3 11.55L15.1 21ZM13.8 10L20.1 16.3' fill='none' stroke='%23363636'/%3E%3C/g%3E%3Crect x='3' y='3' width='5' height='5' fill='%23fff'/%3E%3Cpath d='M4 5.5h3M5.5 4v3' stroke='%23363636'/%3E%3C/svg%3E") 5 5, default; }
.chart[data-cursor="arrowcursor"], .chart[data-cursor="demonstration"] { cursor: default; } /* TV: 화살표 · 시연 모두 default */
/* TradingView desktop: a cross over the chart, a hand over a drawing (its handles keep the arrow). */
.chart[data-cursor="cross"] { cursor: crosshair; }
.chart[data-over="drawing"], .chart[data-over="indicator"] { cursor: pointer; }
.chart[data-over="handle"] { cursor: default; }
/* 그리기 도구를 쥔 동안: 커서 모양 설정(점·화살표)과 상관없이 차트 안은 십자(TradingView). 축은 끌기 커서 그대로. */
body.drawing-tool .chart { cursor: crosshair; }
.chart[data-over="text"] { cursor: text; }
/* A handle that only goes one way (a channel's width, a rectangle's side or corner). */
.chart[data-over="handle"][data-hcur="ns-resize"] { cursor: ns-resize; }
.chart[data-over="handle"][data-hcur="ew-resize"] { cursor: ew-resize; }
.chart[data-over="handle"][data-hcur="nwse-resize"] { cursor: nwse-resize; }
.chart[data-over="handle"][data-hcur="nesw-resize"] { cursor: nesw-resize; }
.chart[data-over="handle"][data-hcur="pointer"] { cursor: pointer; }

/* ---------- floating toolbar over a selected drawing ---------- */
/* TradingView's floating toolbar: 38px buttons, no border, 6px corners, a soft drop shadow. */
.float-bar { position: fixed; z-index: 35; display: flex; align-items: center; gap: 0; padding: 0; background: var(--bg); border: 0; border-radius: 6px; overflow: hidden; box-shadow: 0 0 2px 0 rgba(0,0,0,.35), 0 3px 9px 0 rgba(0,0,0,.35); }
.float-bar.hidden { display: none; }
.float-bar .fb-grip { width: 24px; height: 38px; display: flex; align-items: center; justify-content: center; cursor: grab; color: var(--muted); opacity: .6; }
.float-bar .fb-btn { height: 38px; min-width: 38px; padding: 0 5px; border: 0; border-radius: 0; background: transparent; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 4px; cursor: default; position: relative; }
.float-bar .fb-btn:hover { background: var(--hover); }
.float-bar .fb-btn.on { color: var(--accent); }
.float-bar .fb-btn:disabled { opacity: 0.4; }
.float-bar .fb-btn:disabled:hover { background: transparent; }
.float-bar .fb-color { flex-direction: column; gap: 0; }
.fb-swatch { display: block; width: 22px; height: 4px; margin-top: 3px; border-radius: 2px; background: var(--sw); }
.fb-t { font-weight: 600; font-size: 14px; line-height: 16px; }
.fb-w { display: inline-block; width: 18px; height: var(--w); background: currentColor; border-radius: 1px; }
.fb-n { font-size: 14px; color: inherit; }
/* TradingView: 숫자가 붙은 굵기 버튼은 70px, 숫자 없는 것(평행채널·여러 개 선택)은 38px */
.float-bar .fb-btn.fb-width { width: 70px; }
.fb-dash { display: inline-block; width: 22px; border-top: 2px solid currentColor; }
.fb-dash.dash { border-top-style: dashed; }
.fb-dash.dot { border-top-style: dotted; }
.fb-pop .dd-item { gap: 8px; }
/* The More menu: icon column, label, a submenu arrow or the shortcut on the right (TradingView). */
.fb-pop .fb-mi { padding: 6px 16px 6px 8px; min-height: 32px; font-size: 14px; }
.fb-mi-ic { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.fb-mi-t { flex: 1; }
.fb-mi-arrow { margin-left: 24px; display: inline-flex; color: var(--muted); }
.fb-mi-arrow svg { width: 7px !important; height: 11px !important; }
.fb-mi-key { margin-left: 24px; color: var(--muted); font-size: 13px; }
.fb-sub .fb-mi-ic { display: none; }
.fb-x { border: 0; background: transparent; color: var(--muted); cursor: default; font-size: 15px; }
.cp { padding: 8px; }
.cp-row { display: flex; gap: 3px; margin-bottom: 3px; }
.cp-c { width: 20px; height: 20px; border-radius: 3px; border: 1px solid rgba(128,128,128,.35); padding: 0; cursor: default; }
.cp-c.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.cp-sep { border-top: 1px solid var(--border); margin: 8px 0; }
.cp-op { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.cp-op input[type=range] { flex: 1; }
.seg-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.seg-tabs button { border: 0; background: transparent; padding: 8px 10px; cursor: default; color: var(--muted); border-bottom: 2px solid transparent; }
.seg-tabs button.active { color: var(--text); border-bottom-color: var(--text); }

/* 가격 축 메뉴 (scalemenu.js) — TradingView 메뉴 실측(2026-11-25, getComputedStyle): 글꼴 14px, 줄 32px,
   왼쪽 아이콘 칸 36px(아이콘 28px, 왼쪽 8px), 단축키 12px 회색, 구분선 1px·위아래 6px, 모서리 6px, 위아래 6px 여백.
   바탕·글자·구분선·그림자·마우스 올림 색은 아래 --tv-* (TradingView 다크/라이트 값). */
:root, [data-theme="dark"] { --tvm-key: #636363; }
[data-theme="light"] { --tvm-key: #9c9c9c; }
.tvm { position: fixed; z-index: 1000; box-sizing: border-box; padding: 6px 0; min-width: 0; background: var(--tv-bg); color: var(--tv-text); border-radius: 6px; box-shadow: var(--tv-shadow); font-family: -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif; font-size: 14px; line-height: normal; user-select: none; outline: none; }
/* A long list (time zones) scrolls inside the window, as on TradingView. */
.tvm { max-height: 100vh; overflow-y: auto; }
.tvm-item { display: flex; align-items: center; height: 32px; padding: 0 20px 0 0; white-space: nowrap; cursor: default; }
.tvm-item.hl { background: var(--tv-hover); }
.tvm-item.off { cursor: default; }
.tvm-item.off .tvm-icon, .tvm-item.off .tvm-label { opacity: 0.5; }
.tvm-icon { flex: none; display: flex; align-items: center; width: 36px; height: 28px; box-sizing: border-box; padding-left: 8px; color: var(--tv-text); }
.tvm-icon svg { width: 28px; height: 28px; display: block; }
/* 전역 svg { stroke-width: 1.6 } 이 채움 아이콘을 굵게 만들지 않게(TradingView 아이콘은 1px) */
.tvm svg, .scale-gear svg, .plus-btn svg { stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; }
.tvm-label { flex: 1; padding-left: 6px; }
.tvm-key { flex: none; margin-left: 10px; padding-top: 2px; font-size: 12px; color: var(--tvm-key); }
.tvm-arrow { flex: none; display: flex; margin-left: 10px; color: var(--tv-text); }
/* 하위 메뉴 화살표: TradingView 10×10 칸(오른쪽 끝 −30 ~ −20) */
.tvm-arrow svg { width: 10px; height: 10px; stroke-width: 2; }
/* 구분선은 아이콘 칸(36px) 다음부터 오른쪽 끝까지(TradingView 데모 실측: x +36, 폭 = 메뉴 폭 − 36) */
.tvm-sep { height: 1px; margin: 6px 0 6px 36px; background: var(--tv-border); }

/* 가격 축 아래 모서리 ⚙ (누르면 가격 축 메뉴) — TradingView 처럼 시간 축 줄과 가격 축이 만나는 칸 */
.scale-gear { position: absolute; z-index: 4; bottom: 0; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--text); cursor: default; }
.scale-gear svg { width: 25px; height: 25px; } /* TradingView: 육각형 폭 약 15px */
.scale-gear:hover { background: var(--hover); }
/* 십자선 가격 옆 + 버튼(플러스 버튼) */
.plus-btn { position: absolute; z-index: 4; display: none; place-items: center; width: 21px; height: 21px; padding: 0; border: 0; border-radius: 3px; background: var(--tv-strong); color: var(--tv-strong-text); cursor: default; }
.plus-btn.on { display: grid; }
.plus-btn svg { width: 12px; height: 12px; }

/* 설정 창·양식 안의 직접 만든 목록: 입력칸과 같은 모양 */
.field .dd-btn, button.dd-btn.in { height: 28px; border: 1px solid var(--border); border-radius: 4px; background: var(--input); padding: 0 6px 0 8px; color: var(--text); justify-content: space-between; min-width: 70px; cursor: default; font: inherit; font-size: 13px; }
.form-grid .field .dd-btn, .set-body .field .dd-btn { width: 100%; }
.dd-btn > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn:disabled { opacity: .5; cursor: default; }

/* 설정 창: 왼쪽 카테고리 목록 + 오른쪽 내용 (settings.js) */
.set-card { width: min(860px, 96vw) !important; }
.set-card .modal-body { padding: 0; }
.set-wrap { display: flex; min-height: 440px; max-height: 66vh; }
.set-nav { flex: none; width: 190px; display: flex; flex-direction: column; padding: 8px 0; border-right: 1px solid var(--border); overflow-y: auto; }
.set-nav button { border: 0; background: transparent; color: var(--text); text-align: left; padding: 10px 18px; font-size: 14px; cursor: default; }
.set-nav button:hover { background: var(--hover); }
.set-nav button.on { background: var(--hover); font-weight: 600; }
.set-body { flex: 1; min-width: 0; padding: 16px 20px; overflow-y: auto; }
.set-body h4 { margin: 16px 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.set-group { display: flex; flex-direction: column; gap: 9px; margin: 12px 0 4px; }
.set-chk { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: default; }
.set-chk input { width: 15px; height: 15px; accent-color: var(--accent); }
@media (max-width: 640px) {
  .set-wrap { flex-direction: column; max-height: 74vh; }
  .set-nav { width: auto; flex-direction: row; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; padding: 0; }
  .set-nav button { white-space: nowrap; padding: 10px 14px; }
}

/* --tv-tab-on(8회차): 설정 창 왼쪽 탭에서 고른 탭의 글자·그림(데모 다크 255 · 라이트는 보통 글자와 같음).
   입력 칸·목록 버튼 테두리는 --tv-border 그대로 둔다: 데모는 색 칸 버튼 테두리와 같은 색(다크 87 · 라이트 219)이지만
   우리 값(#303030 · #ebebeb)은 본 사이트 실측값(GAPS.md "라이트 테마" 줄)이라 데모 팔레트로 바꾸지 않았다. */
/* ===== TradingView drawing settings dialog and its shared controls (tv-dialog.js, tv-controls.js).
   Sizes and colours measured from TradingView's own dialog (getComputedStyle, 2026-11-25). ===== */
:root,
[data-theme="dark"] {
  --tv-bg: #131313; --tv-text: #b8b8b8; --tv-muted: #8c8c8c; --tv-border: #303030; --tv-border-hover: #8c8c8c;
  --tv-strong: #f2f2f2; --tv-strong-text: #000000; --tv-toggle-on: #8c8c8c; --tv-track: #464646; --tv-pop-border: #555555; --tv-sep: #464646;
  --tv-cancel: #ffffff; --tv-cancel-text: #ffffff; --tv-range-bg: #303030; --tv-range-mid: #dbdbdb; --tv-ptr-bg: #000000;
  --tv-ptr-border: #ffffff; --tv-focus: #2962ff; --tv-hover: #2e2e2e; --tv-white-sw: transparent; --tv-ring: #dbdbdb;
  --tv-tab-on: #ffffff;
  --tv-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); --tv-check-a: #333333; --tv-check-b: #000000; --tv-input-text: #dbdbdb; --tv-ok-hover: #dbdbdb;
}
[data-theme="light"] {
  --tv-bg: #ffffff; --tv-text: #000000; --tv-muted: #707070; --tv-border: #ebebeb; --tv-border-hover: #b8b8b8;
  --tv-strong: #222222; --tv-strong-text: #ffffff; --tv-toggle-on: #9c9c9c; --tv-track: #f2f2f2; --tv-pop-border: #dbdbdb; --tv-sep: #dbdbdb;
  --tv-cancel: #000000; --tv-cancel-text: #000000; --tv-range-bg: #ebebeb; --tv-range-mid: #464646; --tv-ptr-bg: #ffffff;
  --tv-ptr-border: #000000; --tv-focus: #2962ff; --tv-hover: #f2f2f2; --tv-white-sw: #dbdbdb; --tv-ring: #000000;
  --tv-tab-on: #000000;
  --tv-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); --tv-check-a: #c8c8c8; --tv-check-b: #ffffff; --tv-input-text: #000000; --tv-ok-hover: #464646;
}
.tvd, .tvc-pop, .tvd-menu { font-family: -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif; font-size: 14px; line-height: normal; color: var(--tv-text); }
.tvd { position: fixed; z-index: 60; min-width: 380px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); display: flex; flex-direction: column; background: var(--tv-bg); border-radius: 6px; box-shadow: var(--tv-shadow); outline: none; }
.tvd-head { display: flex; align-items: center; flex: none; height: 68px; padding: 0 17px 0 20px; user-select: none; cursor: grab; }
.tvd-title { flex: 1; width: 0; min-width: 0; padding-right: 9px; font-size: 20px; font-weight: 600; line-height: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvd-close { width: 34px; height: 34px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--tv-text); cursor: default; }
.tvd-close:hover { background: var(--tv-hover); }
.tvd-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.tvd-tabs { flex: none; padding: 0 20px; }
.tvd-tabrow { position: relative; display: flex; gap: 24px; height: 32px; }
.tvd-tabrow::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 2px; background: var(--tv-track); }
.tvd-tab { position: relative; padding: 0 0 8px; border: 0; background: none; color: var(--tv-text); font: inherit; font-size: 16px; font-weight: 600; line-height: 24px; white-space: nowrap; cursor: default; }
.tvd-tab:not(.on):hover { color: var(--tv-muted); }
.tvd-ul { position: absolute; bottom: 0; height: 4px; border-radius: 2px; background: var(--tv-strong); transition: left 0.2s, width 0.2s; }
.tvd-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px 20px; }
.tvd-foot { display: flex; align-items: center; justify-content: space-between; flex: none; padding: 16px 20px; }
.tvd-tpl { display: inline-flex; align-items: center; justify-content: space-between; min-width: 100px; height: 34px; padding: 0 3px; border: 1px solid var(--tv-border); border-radius: 8px; background: none; color: var(--tv-text); font: inherit; cursor: default; }
/* TradingView 데모 실측: 글자는 버튼 x+6 ~ x+78 사이 가운데(Defaults x+14.2 · Template x+11.4), 화살표 18×18 이 x+78 */
.tvd-tpl > span { flex: 1; padding: 0 0 0 2px; text-align: center; }
.tvd-tpl > .tvc-caret { flex: none; width: 18px; }
.tvd-tpl:hover, .tvc-colorbtn:hover, .tvc-input:hover, .tvd .tvc-select.dd-btn:hover { border-color: var(--tv-border-hover); }
.tvc-caret { width: 20px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.tvd-btns { display: flex; gap: 12px; }
.tvd-btn { min-width: 44px; height: 34px; padding: 0 11px; border: 1px solid var(--tv-cancel); border-radius: 8px; background: transparent; color: var(--tv-cancel-text); font: inherit; font-size: 16px; cursor: default; }
.tvd-btn.primary { border-color: var(--tv-strong); background: var(--tv-strong); color: var(--tv-strong-text); }
.tvd-btn:not(.primary):hover { border-color: var(--tv-strong); background: var(--tv-strong); color: var(--tv-strong-text); }
.tvd-btn.primary:hover { border-color: var(--tv-ok-hover); background: var(--tv-ok-hover); }
.tvc-empty { margin: 8px 0; color: var(--tv-muted); }
/* rows: a title column as wide as its longest title, then the controls */
.tvc-grid { display: grid; grid-template-columns: max-content 1fr; align-items: center; }
.tvc-cell { display: flex; align-items: center; min-height: 50px; }
.tvc-first { padding-right: 20px; }
.tvc-fill { grid-column: 1 / -1; }
.tvc-section { min-height: 32px; color: var(--tv-muted); font-size: 11px; text-transform: uppercase; }
.tvc-title { line-height: 17px; }
/* checkbox */
.tvc-check { position: relative; display: inline-flex; align-items: center; gap: 8px; line-height: 17px; cursor: default; user-select: none; }
.tvc-check input { position: absolute; left: 0; top: 50%; width: 18px; height: 18px; margin: -9px 0 0; opacity: 0; cursor: default; }
.tvc-box { display: grid; place-items: center; flex: none; width: 18px; height: 18px; box-sizing: border-box; border: 1px solid var(--tv-strong); border-radius: 3px; }
.tvc-mark { width: 11px; height: 9px; visibility: hidden; fill: none; stroke: var(--tv-strong-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tvc-check input:checked + .tvc-box { background: var(--tv-strong); }
.tvc-check input:checked + .tvc-box .tvc-mark { visibility: visible; }
.tvc-check input:focus-visible + .tvc-box { outline: 2px solid var(--tv-focus); outline-offset: 1px; }
/* text / number box with spin arrows (shown on hover or focus) */
.tvc-input { position: relative; display: inline-flex; align-items: center; flex: none; width: 100px; height: 34px; box-sizing: border-box; border: 1px solid var(--tv-border); border-radius: 8px; background: var(--tv-bg); }
.tvc-input:focus-within { border-color: var(--tv-focus); box-shadow: inset 0 0 0 1px var(--tv-focus); }
.tvc-input input { flex: 1; min-width: 0; height: 28px; padding: 0 2px 0 7px; border: 0; outline: none; background: transparent; color: var(--tv-text); font: inherit; }
.tvc-spin-btns { display: flex; flex-direction: column; flex: none; width: 22px; height: 28px; margin-right: 2px; visibility: hidden; }
.tvc-spin:hover .tvc-spin-btns, .tvc-spin:focus-within .tvc-spin-btns { visibility: visible; }
.tvc-spin-btns button { display: grid; place-items: center; flex: 1; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--tv-muted); cursor: default; overflow: hidden; }
.tvc-spin-btns button:hover { background: var(--tv-hover); color: var(--tv-text); }
.tvc-spin-btns svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.tvc-pair, .tvc-visrow { display: inline-flex; align-items: center; gap: 8px; }
/* min..max slider */
.tvc-range { display: inline-flex; align-items: center; width: 100px; height: 10px; margin-left: 1px; --lo: 0; --hi: 1; }
.tvc-range-track { position: relative; width: 100%; height: 10px; border-radius: 5px; background: var(--tv-range-bg); }
.tvc-range-mid { position: absolute; top: 0; bottom: 0; left: calc(6px + (100% - 12px) * var(--lo)); right: calc(6px + (100% - 12px) * (1 - var(--hi))); background: var(--tv-range-mid); }
.tvc-range-ptr, .tvc-op-ptr { position: absolute; top: -1px; width: 12px; height: 12px; box-sizing: border-box; border: 2px solid var(--tv-ptr-border); border-radius: 50%; background: var(--tv-ptr-bg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); cursor: default; }
.tvc-range-ptr[data-end="lo"] { left: calc((100% - 12px) * var(--lo)); }
.tvc-range-ptr[data-end="hi"] { left: calc((100% - 12px) * var(--hi)); }
/* select (dropdown.js turns it into a button) */
.tvd .tvc-select.dd-btn { width: 180px; height: 34px; padding: 0 3px 0 7px; border: 1px solid var(--tv-border); border-radius: 8px; background: var(--tv-bg); color: var(--tv-text); font: inherit; justify-content: space-between; cursor: default; }
.tvd .tvc-select.dd-btn .dd-chev { width: 20px; height: 18px; stroke-width: 1.5; opacity: 1; color: var(--tv-muted); }
/* colour (+ width + style) button */
.tvc-colorbtn { display: inline-flex; align-items: center; flex: none; height: 34px; min-width: 34px; padding: 4px; box-sizing: border-box; border: 1px solid var(--tv-pop-border); border-radius: 6px; background: var(--tv-bg); color: var(--tv-text); cursor: default; }
.tvc-colorbtn.open { border-color: var(--tv-focus); box-shadow: inset 0 0 0 1px var(--tv-focus); }
.tvc-colorbtn.with-line { width: 75px; }
.tvc-sw, .tvc-cv-sw { display: block; flex: none; width: 24px; height: 24px; overflow: hidden; border-radius: 3px; background: repeating-conic-gradient(var(--tv-check-a) 0 25%, var(--tv-check-b) 0 50%) 0 0 / 12px 12px; }
.tvc-sw i { display: block; width: 100%; height: 100%; }
.tvc-lb-seg { display: flex; align-items: center; padding: 0 3px 0 8px; }
.tvc-colorbtn.no-color .tvc-lb-seg { padding: 0 8px; }
.tvc-colorbtn.no-color.with-line { width: auto; }
.tvc-line { display: inline-flex; align-items: center; justify-content: space-between; height: 24px; }
.tvc-line i { display: block; flex: none; }
.tvc-levels { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 48px; margin: 8px 0; }
/* TradingView leaves 28px after the 2-column level grid (its Style tab is 452px wide). */
.tvc-levels:not(.pairs) { margin-right: 28px; }
.tvc-level { display: inline-flex; align-items: center; gap: 8px; }
.tvc-spin.lv { width: 84px; }
/* TradingView's dialog is never shorter than 311px (body 145px); the coordinates grid has no gap of its own. */
.tvd-body { min-height: 145px; }
.tvc-fill .tvc-textarea { margin: 8px 0; }
.tvc-textarea { display: block; width: 100%; min-width: 340px; height: 100px; box-sizing: border-box; padding: 5px 8px; border: 1px solid var(--tv-border); border-radius: 8px; background: var(--tv-bg); color: var(--tv-text); font: inherit; line-height: 18px; resize: none; outline: none; }
.tvc-textarea:focus { border-color: var(--tv-focus); box-shadow: inset 0 0 0 1px var(--tv-focus); }
/* spec-driven rows (tool-dialog.js): controls side by side, hidden placeholders, the gap that ends a group */
.tvc-ctls { display: inline-flex; align-items: center; gap: 8px; }
.tvc-hidden { visibility: hidden; }
.tvc-gap { min-height: 16px; }
/* FRVP / AVP: Values … Value Area Down sit indented under Volume profile */
.tvc-cell.tvc-first.indent { padding-left: 26px; }
/* a candle plot's Color 0 · 1 under Body / Wick / Border (indicator Style tab) */
.tvc-cell.tvc-first.indent.indent2 { padding-left: 52px; }
.tvc-ctext { line-height: 17px; }
/* drop-down button (combobox / check menu) */
.tvc-dd { display: inline-flex; align-items: center; justify-content: space-between; flex: none; width: 180px; height: 34px; box-sizing: border-box; padding: 0 3px 0 7px; border: 1px solid var(--tv-border); border-radius: 8px; background: var(--tv-bg); color: var(--tv-text); font: inherit; text-align: left; cursor: default; }
.tvc-dd.w100 { width: 100px; }
.tvc-dd.w150 { width: 150px; } /* Elliott Degree (TradingView 148–150) */
.tvc-dd-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvc-dd .tvc-caret { flex: none; width: 18px; height: 18px; margin-right: 2px; color: var(--tv-muted); transition: transform 0.15s; }
.tvc-dd.open .tvc-caret, .tvc-dd:focus-visible .tvc-caret { color: var(--tv-text); }
.tvc-dd:hover, .tvc-iconsel:hover, .tvc-toggle:hover { border-color: var(--tv-border-hover); }
.tvc-dd.open { border-color: var(--tv-ring); }
.tvc-dd.open .tvc-caret { transform: rotate(180deg); }
.tvc-dd:disabled, .tvc-toggle:disabled, .tvc-input.disabled, .tvc-colorbtn.disabled { background: var(--tv-hover); border-color: var(--tv-border); color: var(--tv-muted); cursor: default; }
.tvc-toggle:disabled { color: var(--tv-border-hover); }
/* TradingView's Inputs tab (indicator style): checkbox lines are shorter than titled rows */
.tvc-grid.tvc-inputs .tvc-fill:not(.tvc-gap):not(.tvc-section) { min-height: 34px; }
.tvc-input.disabled input { color: var(--tv-muted); }
.tvc-colorbtn.disabled .tvc-sw, .tvc-colorbtn.disabled .tvc-lb-seg { opacity: 0.5; }
.tvc-emoji { width: 36px; justify-content: center; padding: 0; }
.tvc-emoji-in { font-size: 26px; line-height: 1; }
.tvc-emoji.disabled .tvc-emoji-in { opacity: 0.5; }
/* line-end picker and bold / italic toggles */
.tvc-iconsel { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; box-sizing: border-box; border: 1px solid var(--tv-border); border-radius: 8px; background: var(--tv-bg); color: var(--tv-text); cursor: default; }
.tvc-iconsel svg, .tvc-opt-icon svg { width: 28px; height: 28px; }
.tvc-iconsel.open { border-color: var(--tv-ring); }
.tvc-toggle { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; box-sizing: border-box; border: 1px solid var(--tv-pop-border); border-radius: 6px; background: var(--tv-bg); color: var(--tv-text); cursor: default; }
.tvc-toggle svg { width: 28px; height: 28px; }
/* Bold / italic on: TradingView fills it grey with a white glyph (#9c9c9c light, #8c8c8c dark; measured 2026-11-25). */
.tvc-toggle.on { border-color: var(--tv-toggle-on); background: var(--tv-toggle-on); color: #ffffff; }
/* opacity slider inside a row */
.tvc-row-op { display: inline-flex; align-items: center; width: 148px; height: 34px; }
.tvc-row-op .tvc-op-slider { flex: none; width: 148px; }
.tvc-row-op.disabled { opacity: 0.4; pointer-events: none; }
/* drop-down list and check menu */
.tvc-list { position: fixed; z-index: 1002; box-sizing: border-box; padding: 6px 0; border-radius: 10px; background: var(--tv-bg); box-shadow: var(--tv-shadow); user-select: none; font-family: -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif; font-size: 14px; color: var(--tv-text); max-height: calc(100vh - 16px); overflow: auto; }
.tvc-opt, .tvc-mi { display: flex; align-items: center; gap: 8px; height: 32px; margin: 0 6px; padding: 0 8px; border-radius: 6px; line-height: 18px; white-space: nowrap; cursor: default; }
.tvc-opt:hover, .tvc-mi:hover { background: var(--tv-hover); }
.tvc-opt.sel { background: var(--tv-strong); color: var(--tv-strong-text); }
.tvc-opt-icon { display: grid; place-items: center; margin-left: -6px; }
.tvc-mi { gap: 10px; padding: 0 8px 0 10px; }
.tvc-box.on { background: var(--tv-strong); }
.tvc-iconsel.wide { width: 75px; }
/* "checkbox with its ratio · line button" pairs (Gann square): the button sits at a fixed place */
.tvc-levels.pairs .tvc-level { display: grid; grid-template-columns: 78px 75px; column-gap: 8px; }
.tvc-levels.pairs .tvc-check-label { width: 30px; word-break: break-all; }
.tvc-width-icon { display: flex; align-items: center; justify-content: center; width: 75px; height: 28px; }
.tvc-width-icon i { display: block; width: 50px; background: currentColor; }
.tvc-opt .tvc-width-icon { width: 60px; }
/* a checkbox greyed out (e.g. log-scale fib levels on a normal chart) */
/* Disabled checkbox label: TradingView dark #666 (measured), light #b8b8b8. */
.tvc-check:has(input:disabled) { color: var(--tv-border-hover); cursor: default; }
:root:not([data-theme="light"]) .tvc-check:has(input:disabled) { color: #666666; }
.tvc-check input:disabled + .tvc-box { border-color: var(--tv-border-hover); }
.tvc-dash-icon { display: grid; place-items: center; width: 28px; height: 28px; }
.tvc-box.on .tvc-mark { visibility: visible; }
/* colour pop-up */
.tvc-pop { position: fixed; z-index: 1001; width: 250px; box-sizing: border-box; padding: 6px 0; border-radius: 6px; background: var(--tv-bg); box-shadow: var(--tv-shadow); user-select: none; }
.tvc-pop-main { padding: 6px 12px; }
.tvc-swatches { margin: 0 -3px; }
.tvc-swatches + .tvc-swatches { margin-top: 6px; }
.tvc-sw-row { display: flex; flex-wrap: wrap; }
.tvc-swatch { position: relative; flex: none; width: 17px; height: 17px; margin: 3px; padding: 0; box-sizing: border-box; border: 1px solid var(--c); border-radius: 2px; background: var(--c); cursor: default; }
.tvc-swatch.white { border-color: var(--tv-white-sw); }
.tvc-swatch.sel::after { content: ""; position: absolute; inset: -5px; border: 2px solid var(--tv-ring); border-radius: 6px; }
.tvc-pop-sep { height: 1px; margin: 12px 0; background: var(--tv-sep); }
.tvc-add { position: relative; flex: none; width: 17px; height: 17px; margin: 3px; padding: 0; border: 0; background: none; color: var(--tv-text); cursor: default; }
.tvc-add::before, .tvc-add::after { content: ""; position: absolute; left: 50%; top: 50%; background: currentColor; transform: translate(-50%, -50%); }
.tvc-add::before { width: 15px; height: 1px; }
.tvc-add::after { width: 1px; height: 15px; }
.tvc-pop-title { margin: 12px 0 4px; color: var(--tv-muted); font-size: 12px; line-height: 14px; }
.tvc-opacity { display: flex; align-items: center; gap: 8px; height: 26px; }
.tvc-op-slider { position: relative; flex: 1; height: 10px; border-radius: 5px; background: repeating-conic-gradient(var(--tv-check-a) 0 25%, var(--tv-check-b) 0 50%) 0 0 / 8px 8px; cursor: default; }
.tvc-op-grad { position: absolute; inset: 0; border: 1px solid var(--c); border-radius: 4px; background: linear-gradient(90deg, transparent, var(--c)); }
.tvc-op-ptr { left: calc((100% - 12px) * var(--p)); }
.tvc-op-input { position: relative; flex: none; width: 47px; height: 26px; }
.tvc-op-input input { width: 100%; height: 100%; box-sizing: border-box; padding: 0 14px 0 5px; border: 1px solid var(--tv-pop-border); border-radius: 4px; outline: none; background: var(--tv-bg); color: var(--tv-input-text); font: inherit; text-align: right; }
.tvc-op-input input:focus { border-color: var(--tv-focus); }
.tvc-op-input span { position: absolute; right: 2px; top: 4px; color: var(--tv-input-text); pointer-events: none; }
.tvc-pop-block { margin-top: 6px; padding: 0 12px; }
.tvc-pop-block + .tvc-pop-block { margin-top: 12px; }
.tvc-pop.no-color .tvc-pop-block:first-child { margin-top: 6px; }
.tvc-pop-block .tvc-pop-title { margin-top: 0; }
.tvc-seg { display: flex; height: 32px; }
.tvc-seg button { position: relative; display: grid; place-items: center; flex: 1; height: 32px; margin-left: -1px; padding: 0; border: 1px solid var(--tv-pop-border); background: none; color: var(--tv-strong); cursor: default; }
.tvc-seg button:first-child { margin-left: 0; border-radius: 3px 0 0 3px; }
.tvc-seg button:last-child { border-radius: 0 3px 3px 0; }
.tvc-seg button.on { z-index: 1; border-color: var(--tv-strong); background: var(--tv-strong); color: var(--tv-strong-text); }
.tvc-seg.w i { display: block; width: 31px; background: currentColor; }
/* custom colour ("+") */
.tvc-cv-form { display: flex; align-items: center; height: 26px; }
.tvc-cv-sw { width: 26px; height: 26px; border-radius: 4px; }
.tvc-cv-hex { position: relative; margin-left: 8px; }
.tvc-cv-hex span { position: absolute; left: 4px; top: 4px; pointer-events: none; }
.tvc-cv-hex input { width: 68px; height: 26px; box-sizing: border-box; padding: 0 5px 0 14px; border: 1px solid var(--tv-focus); border-radius: 4px; outline: none; background: var(--tv-bg); color: var(--tv-text); font: inherit; }
.tvc-cv-add { height: 28px; margin-left: auto; padding: 0 7px; border: 1px solid var(--tv-strong); border-radius: 8px; background: var(--tv-strong); color: var(--tv-strong-text); font: inherit; cursor: default; }
.tvc-cv-pick { display: flex; gap: 7px; height: 184px; margin-top: 12px; }
.tvc-cv-sat { position: relative; width: 200px; border-radius: 2px; background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, var(--hue)); cursor: crosshair; }
.tvc-cv-sat-ptr { position: absolute; left: var(--x); top: var(--y); width: 14px; height: 14px; margin: -7px 0 0 -7px; box-sizing: border-box; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); pointer-events: none; }
.tvc-cv-hue { position: relative; width: 17px; border-radius: 2px; background: linear-gradient(to bottom, #f00, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00); cursor: default; }
.tvc-cv-hue-ptr { position: absolute; left: -2px; right: -2px; top: calc(var(--y) - 4.5px); height: 9px; box-sizing: border-box; border: 2px solid #fff; border-radius: 2px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); pointer-events: none; }
/* Template menu */
.tvd-menu { position: fixed; z-index: 1002; min-width: 122px; padding: 6px; border-radius: 10px; background: var(--tv-bg); box-shadow: var(--tv-shadow); }
.tvd-menu-item { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: 6px; white-space: nowrap; cursor: default; }
.tvd-menu-item:hover { background: var(--tv-hover); }
.tvd-menu-label { flex: 1; }
.tvd-menu-del { padding: 0 2px; border: 0; background: none; color: var(--tv-muted); font-size: 16px; cursor: default; }
.tvd-menu-sep { height: 1px; margin: 6px 0; background: var(--tv-sep); }

/* A retracement level's text typed in place (chart.js editLevelText), TradingView's look: no box,
   the level's colour, centred on the line. */
.level-text-input { position: fixed; z-index: 60; transform: translate(-50%, -50%); height: 16px; padding: 0; margin: 0; border: 0; outline: 0; resize: none; overflow: hidden; background: transparent; text-align: center; white-space: nowrap; font: 300 12px -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif; letter-spacing: 0.5px; line-height: 16px; }
.level-text-input::placeholder { color: var(--ph); opacity: 0.6; }
/* 선 위 글 입력칸(선택된 추세선·수평선을 다시 클릭) — TradingView: 선 가운데, 가운데 정렬, Enter 는 줄바꿈 */
.line-text-input { position: fixed; z-index: 60; min-width: 40px; padding: 0 2px; margin: 0; border: 0; outline: 0; resize: none; overflow: hidden; background: transparent; text-align: center; white-space: pre; box-sizing: content-box; }
.line-text-input::placeholder { color: var(--ph); opacity: 0.6; }
/* ⌘(Ctrl)+끌기 영역 선택 상자 */
.draw-select-box { position: fixed; z-index: 30; box-sizing: border-box; border: 1px solid rgba(41, 98, 255, 0.8); background: rgba(41, 98, 255, 0.15); pointer-events: none; }

/* Floating toolbar icon colour, TradingView's (dark #b8b8b8, light #000). */
.float-bar .fb-btn { color: #b8b8b8; }
[data-theme="light"] .float-bar .fb-btn { color: #000000; }
/* Its surface and shadow, TradingView's per theme (dark #131313 / light #fff). */
.float-bar { background: var(--tv-bg, var(--bg)); box-shadow: 0 0 2px 0 #000, 0 3px 9px 0 #000; }
[data-theme="light"] .float-bar { box-shadow: 0 0 2px 0 #dbdbdb, 0 3px 9px 0 #ebebeb; }
.float-bar .fb-btn.on { color: var(--accent); }
/* The floating toolbar's menus (More and its submenus, width): TradingView's surface, 6px corners. */
.fb-pop { background: var(--tv-bg, var(--bg)); border: 0; border-radius: 6px; box-shadow: 0 2px 4px 0 rgba(0,0,0,.4); }
[data-theme="light"] .fb-pop { box-shadow: 0 2px 4px 0 rgba(0,0,0,.2); }
.fb-pop { color: var(--tv-text, var(--text)); }
.fb-pop .tb-sep { border-top: 1px solid var(--tv-border, var(--border)); margin: 4px 0; }

/* ---------- 로딩 스켈레톤 (skeleton.js, index.html 첫 화면) ---------- */
@keyframes skel-sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes skel-pulse { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.boot-skel { position: absolute; inset: 0; background: var(--bg); z-index: 1; }
.pane-skel { position: absolute; inset: 0; z-index: 6; background: var(--bg); pointer-events: none; opacity: 1; transition: opacity 0.22s ease-out, visibility 0s 0s; }
.pane-skel.off { opacity: 0; visibility: hidden; transition: opacity 0.22s ease-out, visibility 0s 0.22s; }
/* 가려진 스켈레톤의 무한 애니메이션 97개(sweep 1 + 봉 96)가 차트를 보는 내내 프레임마다 돌았다(실측 2026-11-27,
   document.getAnimations()) — 평상시에도 프레임이 두 번에 한 번꼴로 늦던 까닭. 가리면 멈춘다. */
.pane-skel.off .skel::after, .pane-skel.off .skel-candles g, .pane-skel.off .skel-pill, .pane-skel.off .skel-ico, .pane-skel.off .skel-bar, .pane-skel.off .skel-row i { animation: none; }
.skel { position: absolute; inset: 0; overflow: hidden; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, var(--skel-glint) 50%, transparent 80%); animation: skel-sweep 1.6s ease-in-out infinite; }
.skel svg.skel-candles { position: absolute; left: 3%; right: calc(72px + 3%); top: 18%; bottom: calc(30px + 8%); width: calc(94% - 72px); height: calc(74% - 30px); fill: var(--skel); stroke: none; }
/* 봉이 왼쪽에서 오른쪽으로 차례로 밝아지며 살짝 솟는 물결 */
@keyframes skel-wave { 0%, 100% { opacity: 0.5; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
.skel-candles g { animation: skel-wave 1.5s ease-in-out infinite; animation-delay: calc(var(--i) * 16ms - 1.6s); }
.skel-candles rect.v { opacity: 0.6; }
/* 첫 화면: 오른쪽 아이콘 막대도 그림 대신 자리표시(차트 자리 스켈레톤이 있는 동안) */
/* (<html class="booting"> — 첫 배치를 만들 때 app.js 가 뗀다. 예전에 :has() 로 스켈레톤이 있는지 보던 규칙은 시작 뒤에도 DOM 이 바뀔 때마다
   (말풍선 · 메뉴 · 범례) 페이지 전체 스타일을 다시 계산하게 해 한 번에 3~56ms 가 들었다 — 6회차: 위 막대 위 60번 이동 3.4초.) */
.booting .side-bar button { pointer-events: none; }
.booting .side-bar button svg { visibility: hidden; }
.booting .side-bar button::before { content: ""; position: absolute; inset: 0; margin: auto; width: 26px; height: 26px; border-radius: 6px; opacity: 1; background: linear-gradient(90deg, var(--skel) 0%, var(--skel) 35%, var(--skel-glint) 50%, var(--skel) 65%, var(--skel) 100%) var(--skel); background-size: 200% 100%; background-attachment: fixed; animation: skel-pulse 1.6s ease-in-out infinite; }
.skel-legend { position: absolute; left: 10px; top: 10px; display: flex; gap: 8px; }
.skel-legend i, .skel-axis i, .skel-time i { display: block; background: var(--skel); border-radius: 3px; }
.skel-legend i { width: 160px; height: 12px; }
.skel-legend i + i { width: 90px; }
.skel-axis { position: absolute; right: 0; top: 0; bottom: 30px; width: 64px; border-left: 1px solid var(--border); }
.skel-axis i { position: absolute; right: 10px; width: 40px; height: 9px; }
.skel-time { position: absolute; left: 0; right: 64px; bottom: 0; height: 30px; border-top: 1px solid var(--border); }
.skel-time i { position: absolute; top: 11px; width: 34px; height: 9px; }
/* 툴바·그리기 막대·관심 목록의 작은 자리표시: 화면 전체가 같은 박자로 반짝이게 background-attachment: fixed */
.skel-pill, .skel-ico, .skel-bar, .skel-row i {
  display: inline-block; border-radius: 4px;
  background: linear-gradient(90deg, var(--skel) 0%, var(--skel) 35%, var(--skel-glint) 50%, var(--skel) 65%, var(--skel) 100%) var(--skel);
  background-size: 200% 100%; background-attachment: fixed; animation: skel-pulse 1.6s ease-in-out infinite;
}
.skel-pill { width: 30px; height: 18px; margin: 0 3px; vertical-align: middle; }
.skel-ico { display: block; width: 26px; height: 26px; margin: 6px auto; border-radius: 6px; }
.skel-bar { width: 46px; height: 10px; vertical-align: middle; }
.skel-bar.wide { width: 120px; height: 22px; }
.skel-row { display: grid; grid-template-columns: 18px 1fr 56px 44px 48px; gap: 8px; align-items: center; height: 31px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--wl-line); }
.skel-row i { height: 10px; justify-self: end; width: 100%; }
.skel-row i:first-child { width: 18px; height: 18px; border-radius: 50%; }
.skel-row i:nth-child(2) { justify-self: start; }
.skel-row i.s { width: 70%; }
.topbar select:empty { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .skel::after { display: none; }
  .skel-candles g { animation: none; }
  .booting .side-bar button::before { animation: none; background: var(--skel); }
  .skel-pill, .skel-ico, .skel-bar, .skel-row i { animation: none; background: var(--skel); }
  .pane-skel, .pane-skel.off { transition: none; }
}

.side.collapsed { display: none; }

/* ---------- 관심 목록 (watchlist.js), TradingView 크기: 머리 줄 38px 버튼, 열 머리 27px, 행 31px, 글자 14px ---------- */
.wl { display: flex; flex-direction: column; height: 100%; min-height: 0; container-type: inline-size; }
.wl-top { display: flex; align-items: center; gap: 0; padding: 5px 8px 5px 8px; flex: none; min-height: 48px; }
.wl-name { display: inline-flex; align-items: center; gap: 2px; height: 34px; max-width: 60%; padding: 0 4px 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font-size: 14px; font-weight: 600; line-height: 28px; font-family: inherit; cursor: default; }
.wl-name:hover, .wl-ibtn:hover { background: var(--hover); }
.wl-name-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-name-in { flex: 1; min-width: 0; height: 34px; margin-right: 4px; padding: 0 8px; border: 1px solid var(--tv-focus, var(--accent)); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; outline: 0; }
.wl-name[hidden] { display: none; }
.wl-chev { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; }
.wl-gap { flex: 1; }
.wl-ibtn { width: 38px; height: 38px; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: default; display: grid; place-items: center; padding: 0; }
.wl-ibtn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.wl-ibtn [r] { fill: currentColor; stroke: none; }
/* 열(TradingView 터미널 데모 실측 2026-11-27): 깃발 16 · 심볼 80 · 현재가 75 · 체인지 70 · 변동% 60(최소 60) 을 바탕 폭으로,
   패널이 넓어지면 모든 열이 같은 만큼 늘고(폭 500 → 130·125·120·110), 좁아지면 바탕 폭에 비례해 줄어든다(폭 200 → 44·41·39·60).
   값 글자는 칸 끝에서 8px 안쪽, 열 머리 글자는 16px 안쪽(값보다 8px 왼쪽: 1249 · 1318 · 1378). */
.wl-cols, .wl-row { display: flex; align-items: center; }
.wl-cols > *, .wl-row > * { min-width: 0; box-sizing: border-box; }
.wl-cols > .wl-flag, .wl-row > .wl-flag { flex: 0 0 16px; }
.wl-cols > .wl-sym, .wl-row > .wl-sym { flex: 1 1 80px; }
.wl-cols > .wl-last, .wl-row > .wl-last { flex: 1 1 75px; }
.wl-cols > .wl-chg, .wl-row > .wl-chg { flex: 1 1 70px; }
.wl-cols > .wl-chgp, .wl-row > .wl-chgp { flex: 1 1 60px; min-width: 60px; }
.wl-cols > .wl-vol, .wl-row > .wl-vol { flex: 1 1 70px; }
.wl-row > .wl-last, .wl-row > .wl-chg, .wl-row > .wl-chgp, .wl-row > .wl-vol { padding-right: 8px; }
/* 줄어들 때 TV 처럼 바탕 폭에 비례(폭 200 → 44·41·39·60)하도록: 안쪽 여백만큼 작아진 바탕을 줄어드는 정도로 되돌린다(75/67 · 70/62 · 75/59 · 70/54). */
.wl-row > .wl-last { flex-shrink: 1.1194; }
.wl-row > .wl-chg, .wl-row > .wl-vol { flex-shrink: 1.129; }
.wl-cols > .wl-last { flex-shrink: 1.2712; }
.wl-cols > .wl-chg, .wl-cols > .wl-vol { flex-shrink: 1.2963; }
.wl.no-last .wl-last, .wl.no-chg .wl-chg, .wl.no-chgp .wl-chgp, .wl.no-vol .wl-vol { display: none; }
.wl-cols, .wl-row { font-size: 14px; }
@container (max-width: 330px) {
  .wl-row { font-size: 13px; } /* 열 머리는 늘 14px(TV: Symbol 48px · Last 27px 폭) */
  .wl-row .wl-ex { display: none; }
}
.wl-cols { position: relative; height: 28px; flex: 0 1 28px; min-height: 0; overflow: hidden; /* 상세를 끝까지 올리면 머리(48px)만 남는다(TV) */ line-height: 18px; color: var(--muted); border-bottom: 1px solid var(--wl-line); user-select: none; }
.wl-cols [data-sort] { display: flex; align-items: center; justify-content: flex-end; cursor: default; padding-right: 16px; white-space: nowrap; overflow: hidden; }
.wl-cols [data-sort] b { font-weight: inherit; }
.wl-cols [data-sort="symbol"] { justify-content: flex-start; padding-right: 0; }
.wl-cols [data-sort]:hover, .wl-cols .on { color: var(--text); }
/* 정렬 화살표 18×18: 심볼 열은 글자 뒤, 값 열은 글자 앞(3px 겹침). 정렬 중인 열에서만 보인다. */
.wl-arr { flex: none; width: 18px; height: 18px; margin: 0 -3px; visibility: hidden; display: grid; place-items: center; }
.wl-arr svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.wl-cols .on .wl-arr { visibility: visible; }
.wl-cols .on[data-dir="desc"] .wl-arr svg { transform: rotate(180deg); }
/* 열 메뉴 단추(머리줄 왼쪽 15×27, TV: 늘 보임) */
.wl-cols > .wl-flag { position: relative; height: 100%; padding: 0; }
.wl-colbtn { position: absolute; left: 0; top: 0; width: 15px; height: 27px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: default; display: grid; place-items: center; }
.wl-colbtn svg { width: 11px; height: 20px; fill: currentColor; }
.wl-colbtn:hover { color: var(--text); }
.wl.is-hot .wl-colbtn { display: none; }
.wl-list { flex: 1; overflow: auto; min-height: 0; outline: none; }
.wl-list > :first-child { margin-top: 6px; } /* TV: 목록 위 6px 빈 칸(목록이 0 까지 줄어들 수 있게 안쪽 여백이 아니라 첫 줄 바깥 여백) */
.wl-row { position: relative; height: 30px; /* TV 행 간격 30(160·190·220) */ border-bottom: 1px solid var(--wl-line); cursor: default; font-variant-numeric: tabular-nums; }
.wl-row:hover { background: var(--hover); }
/* 선택 행: TradingView 처럼 글자색 1px 테두리의 둥근 사각형(바탕은 그대로) */
.wl-row.current { background: transparent; border-bottom-color: transparent; }
/* 고른 행(클릭·Shift·⌘): TradingView 밝은 테마 #bbd9fb, 어두운 테마 #142e61 */
.wl-row.selected, .wl-sec.selected { background: #142e61; }
:root[data-theme="light"] .wl-row.selected, :root[data-theme="light"] .wl-sec.selected { background: #bbd9fb; }
.wl-row.current::after { content: ""; position: absolute; inset: 0 2px; border: 1px solid var(--text); border-radius: 6px; pointer-events: none; }
.wl-row.dragging, .wl-sec.dragging { opacity: 0.4; }
.wl-row.drop-before, .wl-sec.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.wl-row.drop-after, .wl-sec.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.wl-flag { height: 100%; display: grid; place-items: center start; color: transparent; padding-left: 2px; }
.wl-flag svg { width: 9px; height: 9px; fill: currentColor; }
.wl-row:hover .wl-flag { color: var(--border); }
.wl-row:hover .wl-flag:hover { color: var(--muted); }
.wl-flag.on, .wl-row:hover .wl-flag.on { color: var(--flag); }
.wl-sym { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
/* 원형 로고: 이미지(코인·국기), 국기 둘 겹침(외환), 글자(지수 "500"), 그림(원자재), 첫 글자 */
.wl-logo { position: relative; flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; line-height: 16px; color: #fff; background: hsl(var(--h) 52% 46%); overflow: hidden; }
.wl-logo.big { width: 24px; height: 24px; font-size: 12px; } /* TV 상세 칸 24px(trading-terminal 데모 실측) */
.wl-logo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.wl-logo.is-img { background: transparent; }
.wl-logo.is-glyph svg { width: 80%; height: 80%; }
.wl-logo.is-badge { font-size: 8px; letter-spacing: -0.03em; }
.wl-logo.is-badge.long { font-size: 6.5px; }
.wl-logo.big.is-badge { font-size: 11px; }
.wl-logo.big.is-badge.long { font-size: 9px; }
.wl-logo.is-pair { background: transparent; overflow: visible; }
.wl-logo.is-pair > span { position: absolute; width: 72%; height: 72%; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1px var(--bg); }
.wl-logo.is-pair .lg-a { left: 0; top: 0; z-index: 1; }
.wl-logo.is-pair .lg-b { right: 0; bottom: 0; }
/* 회사·거래소 로고(TradingView 모양): 브랜드 색 원 + 흰 그림. 그림은 Simple Icons SVG 를 mask 로 칠한다(symlogo.js brand). */
.wl-logo.is-brand i { width: 56%; height: 56%; background: var(--ink, #fff); -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.wl-logo.is-brand.fit-mid i { width: 66%; height: 66%; }
.wl-logo.is-brand.fit-wide i { width: 80%; height: 80%; }
/* 다크 테마 바탕이 #000 이라 검정 브랜드 원(Apple·Nike·Uber …)은 회색 원으로 보이게 한다. */
:root:not([data-theme="light"]) .wl-logo.is-brand.dim { background: #2e2e2e !important; }
/* 심볼 검색: 심볼 로고 30px, 거래소 로고 20px(전에 쓰던 글자 원과 같은 크기) */
.wl-logo.ss-ico { width: 24px; height: 24px; font-size: 11px; line-height: 24px; }
.wl-logo.ss-exico { width: 20px; height: 20px; font-size: 11px; line-height: 20px; }
.wl-logo.ss-ico.is-badge { font-size: 11px; }
.wl-logo.ss-ico.is-badge.long { font-size: 9px; }
.wl-tk { flex: 0 1 auto; min-width: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 위첨자 D(지연 시세, 한국어판 "지")와 장 상태 점 */
.wl-sup { flex: none; align-self: flex-start; margin: 5px 0 0 -4px; font-size: 9px; font-weight: 600; line-height: 1; color: #ff9800; }
.wl-mkt { flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
.wl-mkt.pre { background: #ff9800; }
.wl-mkt.post { background: #2962ff; }
.wl-ex { flex: 0 100 auto; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 10px; color: var(--muted); letter-spacing: 0.02em; text-transform: uppercase; }
.wl-last, .wl-chg, .wl-chgp, .wl-vol { text-align: right; white-space: nowrap; overflow: hidden; }
.wl-chg.up, .wl-chgp.up, .wl-d-chg.up { color: var(--up); }
.wl-chg.down, .wl-chgp.down, .wl-d-chg.down { color: var(--down); }
/* 바뀐 끝자리: 잠깐 초록/빨강으로 칠했다가 원래 색으로 */
.wl-tick.up { --tick: var(--up); }
.wl-tick.down { --tick: var(--down); }
.wl-tick { animation: wl-tick 1.2s ease-out forwards; }
@keyframes wl-tick { 0%, 55% { color: var(--tick); } 100% { color: inherit; } }
.wl-err { color: var(--muted); }
.wl-x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border: 0; border-radius: 4px; padding: 0; display: none; place-items: center; cursor: default; color: var(--text); background: var(--hover); z-index: 1; }
.wl-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.wl-row:hover .wl-x, .wl-sec:hover .wl-x { display: grid; }
.wl-x:hover { color: var(--down); }
/* 섹션 줄(TV 실측): 높이 36(안쪽 줄 30 은 아래쪽), 화살표 22×22 x+14 · y+11, 이름 11px/400 대문자 x+42, × x−28 */
.wl-sec { position: relative; height: 36px; display: flex; align-items: center; gap: 6px; padding: 6px 6px 0 14px; font-size: 11px; font-weight: 400; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); cursor: default; user-select: none; }
.wl-sec:hover { background: var(--hover); }
.wl-sec-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 16px; }
.wl-sec-h { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 4px; cursor: default; }
.wl-sec-h:hover { background: var(--panel-2); color: var(--text); }
.wl-sec .wl-chev { width: 18px; height: 18px; flex: none; transition: transform 0.12s; }
.wl-sec.folded .wl-chev { transform: rotate(-90deg); }
.wl-sec .wl-x { top: 22px; }
.wl-sec-in { flex: 1; min-width: 0; height: 24px; margin-right: 2px; padding: 0 3px; border: 1px solid var(--tv-focus, var(--accent)); border-radius: 4px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; text-transform: none; letter-spacing: 0; outline: 0; }
.wl-empty { padding: 24px 16px; color: var(--muted); text-align: center; display: grid; gap: 10px; justify-items: center; }
/* ---------- 아래 상세 칸(TradingView 상세): 목록 아래, 길면 그 안에서 스크롤 ---------- */
.wl-detail { flex: none; max-height: 50%; overflow: auto; border-top: 4px solid var(--gap); padding: 12px 16px 14px; }
.wl-detail:empty { display: none; }
/* the line between the list and the details (TradingView's 5px widget handle): drag to resize, no highlight */
/* the same as the app's other resize lines (the chart gutters): a 9px band over the gap that turns
   blue on hover and while dragging, row-resize, double-click resets */
.wl-split { position: relative; z-index: 2; flex: none; height: 4px; background: var(--gap); cursor: row-resize; touch-action: none; }
.wl-split::after { content: ""; position: absolute; left: 0; right: 0; top: -2.5px; height: 9px; }
.wl-split:hover::after, body.resizing-split .wl-split::after { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.wl-split:hover, body.resizing-split .wl-split { background: transparent; } /* one even band, no gap stripe inside */
.wl-split + .wl-detail { border-top: 0; }
.wl-split:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.wl-split:has(+ .wl-detail:empty) { display: none; }
body.resizing-split, body.resizing-split * { cursor: row-resize !important; user-select: none; }
.wl-d-top { display: flex; align-items: center; gap: 8px; }
.wl-d-top .wl-sup { margin: 0 0 0 -4px; }
.wl-ibtn.sm { width: 28px; height: 28px; }
.wl-ibtn.sm svg { width: 22px; height: 22px; }
.wl-d-tk { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-d-name { margin-top: 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; font-size: 14px; }
.wl-d-ext { display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--muted); border-radius: 4px; }
.wl-d-ext:hover { color: var(--text); background: var(--hover); }
.wl-d-ext svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.wl-d-dot { color: var(--muted); margin: 0 2px; }
.wl-d-type { margin-top: 4px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 2px; }
.wl-d-px { margin-top: 12px; display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.wl-d-last { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; }
.wl-d-cur { font-size: 12px; color: var(--muted); margin-left: -6px; }
.wl-d-chg { font-size: 16px; font-weight: 500; }
.wl-d-mkt { margin-top: 4px; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.wl-d-mkt i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.wl-d-mkt.open { color: var(--up); }
.wl-d-mkt.open i { background: var(--up); }
.wl-d-mkt.pre i { background: #ff9800; }
.wl-d-mkt.post i { background: #2962ff; }
.wl-d-sec { margin-top: 16px; }
.wl-d-h { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.wl-d-cap { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; display: flex; gap: 2px; }
.wl-d-kv { display: flex; gap: 4px; font-size: 12px; color: var(--muted); }
.wl-d-kv.num { margin-top: 2px; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.wl-d-kv b { font-weight: 500; }
.wl-d-sl { color: var(--muted); }
/* 거래량 비율 막대: 가운데 눈금 = 30일 평균, 채움 = 오늘 거래량(평균의 2배에서 끝) */
.wl-d-vbar { position: relative; margin-top: 6px; height: 4px; border-radius: 2px; background: var(--panel-2); }
.wl-d-vbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--accent); }
.wl-d-vbar b { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--muted); }
.wl-d-range + .wl-d-range { margin-top: 10px; }
.wl-d-range-t { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-variant-numeric: tabular-nums; }
.wl-d-rbar { position: relative; margin-top: 6px; height: 4px; border-radius: 2px; background: var(--panel-2); }
.wl-d-rbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--muted); opacity: 0.6; }
.wl-d-rbar i.up { background: var(--up); opacity: 1; }
.wl-d-rbar i.down { background: var(--down); opacity: 1; }
.wl-d-rbar b { position: absolute; top: 6px; margin-left: -4px; border: 4px solid transparent; border-top: 0; border-bottom: 6px solid var(--text); }
.wl-d-news { display: block; margin-top: 16px; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); color: var(--text); text-decoration: none; }
.wl-d-news:hover { background: var(--hover); filter: brightness(1.1); }
.wl-d-news-t { margin-top: 4px; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wl-d-perf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.wl-d-pf { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 6px; background: var(--panel-2); font-variant-numeric: tabular-nums; }
.wl-d-pf b { font-size: 14px; font-weight: 600; }
.wl-d-pf span { font-size: 12px; color: var(--muted); }
.wl-d-pf.up { background: color-mix(in srgb, var(--up) 14%, transparent); }
.wl-d-pf.up b { color: var(--up); }
.wl-d-pf.down { background: color-mix(in srgb, var(--down) 14%, transparent); }
.wl-d-pf.down b { color: var(--down); }
.wl-d-tech { display: grid; justify-items: center; }
.wl-d-tech .wl-d-h { justify-self: start; }
.wl-gauge { width: 160px; height: 86px; }
.wl-gauge path { fill: none; stroke-width: 7; stroke-linecap: round; }
.wl-gauge .needle { stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; }
.wl-gauge .hub { fill: var(--text); }
.wl-d-rate { font-size: 16px; font-weight: 600; }
.wl-d-rate.up { color: var(--up); }
.wl-d-rate.down { color: var(--down); }
.wl-d-note textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 60px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--input); color: var(--text); font: inherit; font-size: 13px; }
.wl-boot .wl-head { padding: 14px 10px 10px 16px; }
/* 메뉴(목록 ▾·…·오른쪽 클릭) */
.wl-menu { min-width: 200px; }
.wl-menu .dd-item.danger { color: var(--down); }
.wl-menu-sep { height: 1px; margin: 5px 0; background: var(--border); }
.wl-menu-head { padding: 6px 16px 4px 12px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.wl-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }

/* 검색 창: ☆ 는 늘 보이게(전에는 마우스를 올린 행에만 나와 찾기 어려웠다), 추가 모드는 행 끝 + / ✓ */
/* 별(관심 목록 추가)은 TradingView 에 없는 것이라 가리킨 행·이미 담은 행에서만 보인다 */
.ss-star { visibility: hidden; }
.ss-row.sel .ss-star, .ss-row:hover .ss-star, .ss-star.on { visibility: visible; }
.ss-add { flex: none; width: 32px; height: 32px; border: 0; border-radius: 6px; padding: 0; display: grid; place-items: center; cursor: default; background: transparent; color: var(--text); }
.ss-add svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ss-add:hover { background: var(--panel-2); }
.ss-add.on { color: var(--accent); }

/* ===== Chart settings (chart-settings.js): TradingView's layout with the tabs as a list on the left.
   Measured on TradingView's charting library demo (2026-11-26): 750 wide, list 206 wide, items 40 tall
   (padding 0 16 0 12, icon 28, 14px; selected = #f2f2f2, radius 8, 600), content from x 246. ===== */
/* TV 실측(데모 1440×900): 폭 750, 높이는 탭 내용만큼(Symbol 613 · Status line 678 · Scales/Canvas 860 최대), 탭마다 화면 가운데 */
/* 6회차 실측: 최대 높이는 화면 − 40(위아래 20) — 900 → 860, 700 → 660, 1100 → 내용만큼(Canvas 1057). 860 고정이 아니다. */
.tvd.tvd-side { width: min(750px, calc(100vw - 16px)); max-height: calc(100vh - 40px); }
.tvd-side .tvd-sidewrap { display: flex; flex: 1 1 auto; min-height: 0; }
/* 첫 탭은 창 위 +76(TradingView 데모: 탭 버튼 20,76 206×40 — 전에는 +68) */
.tvd-side .tvd-nav { width: 226px; flex: none; display: flex; flex-direction: column; gap: 0; padding: 8px 0 16px 20px; }
.tvd-side .tvd-nav .tvd-tab { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 16px 0 12px; border-radius: 8px; font-size: 14px; font-weight: 400; line-height: 20px; text-align: left; color: var(--tv-text); }
.tvd-side .tvd-nav .tvd-tab .tbi-svg { width: 28px; height: 28px; flex: none; }
.tvd-side .tvd-nav .tvd-tab:hover { background: var(--tv-hover); color: var(--tv-text); }
.tvd-side .tvd-nav .tvd-tab.on, .tvd-side .tvd-nav .tvd-tab.on:hover { background: var(--tv-hover); font-weight: 600; color: var(--tv-tab-on); }
.tvd-side .tvd-body { flex: 1 1 auto; min-width: 0; min-height: 0; overflow: auto; padding: 0 20px 16px 20px; }
.tvd-side .tvd-foot { border-top: 1px solid var(--tv-border); }
.tvd-side .tvc-grid { grid-template-columns: max-content 1fr; }
.tvc-indent { padding-left: 26px; }
.tvc-unit { margin-left: 8px; color: var(--tv-text); }
.tvc-hint { color: var(--tv-muted); }

/* Status line (chart settings): logo, market status, volume line, indicator background. */
/* TradingView 데모 실측(다크·라이트): 심볼 줄·지표 줄 모두 차트 바탕색 50% */
.legend .row.bg { background: color-mix(in srgb, var(--bg) 50%, transparent); }
/* indicator settings (ind-settings.js, IUI-01~05): 180px boxes in Inputs, the plot-type list's
   "Price line" switch row, the Pick-on-chart button */
.tvc-dd.w180, .tvc-input.w180 { width: 180px; }
.tvc-pick { height: 34px; margin-left: 8px; font-size: 14px; }
.tvc-list-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 32px; margin: 0 6px; padding: 0 8px; }
.tvc-list-sep { height: 1px; margin: 6px 0; background: var(--tv-sep); }
.tvc-switch { position: relative; flex: none; width: 34px; height: 20px; padding: 0; border: 0; border-radius: 10px; background: var(--tv-range-bg); cursor: default; }
.tvc-switch i { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--tv-ptr-bg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: left 0.15s; }
.tvc-switch.on { background: var(--tv-strong); }
.tvc-switch.on i { left: 17px; background: var(--tv-strong-text); }
.tvc-grid.tvc-style .tvc-ctls { gap: 8px; }
/* TradingView's indicator Style tab: lone checkbox lines are 34px, Color 0..n lines 42px */
.tvc-grid.tvc-style .tvc-fill:not(.tvc-gap):not(.tvc-section) { min-height: 34px; }
.tvc-grid.tvc-style .tvc-cell.indent, .tvc-grid.tvc-style .tvc-cell.indent + .tvc-ctl { min-height: 42px; }

/* ===================== TradingView 화면 틀 (2026-11-26, docs/research/tradingview/BRIEF.md 2-1·2-7·2-8) =====================
   데모(trading-terminal·charting-library)를 1440×900 에서 실측: 위 툴바 아래·영역 사이 4px 틈(틈 색 = body 바탕,
   본 사이트 다크 #222 / 라이트 #ebebeb), 왼쪽 툴바 x0 y42 폭 52(오른쪽 위 radius 4), 차트 영역 x56 y42(네 모서리 4 —
   위는 차트, 아래는 날짜 범위 막대), 오른쪽 패널(왼쪽 위 4)과 오른쪽 막대 사이는 1px 틈, 막대 폭 45·버튼 44×44·간격 46. */
html,
body {
  background: var(--gap);
}
body {
  display: flex;
  flex-direction: column;
}
body > .topbar {
  flex: none;
  border-bottom: 0; /* 위 툴바 아래는 선이 아니라 4px 틈(TradingView) */
}
.main {
  flex: 1 1 0;
  min-height: 0;
  margin-top: 4px;
  gap: 4px;
}
.drawbar {
  border-right: 0;
  border-top-right-radius: 4px;
  background: var(--bg);
  overflow: hidden;
}
.grid {
  border-radius: 4px 4px 0 0;
  overflow: hidden;
}
.side {
  border-left: 0;
  border-top-left-radius: 4px;
  /* 폭 손잡이(왼쪽 가장자리 −3 ~ +3px, TV 실측 1091~1096)가 잘리지 않게: 3px 밖까지는 보이게 자른다. 둥근 모서리는 몸통이 맡는다. */
  overflow: clip;
  overflow-clip-margin: 3px;
}
.side > .tab-body { border-top-left-radius: 4px; }
.side:not(.collapsed) + .side-bar {
  margin-left: -3px; /* 패널과 막대 사이는 4px 이 아니라 1px 틈 */
}
.side.collapsed {
  display: none;
}

/* 오른쪽 위젯 막대: 버튼 44×44(첫 버튼 y+2, 간격 2), 켜짐·호버 = 안쪽 3px 38×38 radius 8 배경, 아이콘 색은 그대로 */
.side-bar {
  width: 45px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 2px 0 0;
  background: var(--bg);
}
.side-bar button {
  position: relative;
  isolation: isolate;
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  cursor: default;
  display: grid;
  place-items: center;
}
.side-bar button::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 8px;
  z-index: -1;
}
.side-bar button:hover::before {
  background: var(--btn-hover);
}
.side-bar button.active::before {
  background: var(--btn-on);
}
.side-bar button svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}
/* 알림(종) 위 안 본 개수 배지, 제품 버튼은 TradingView 처럼 검은 원 안 점 9개 */
.side-bar .sb-badge { position: absolute; top: 6px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: var(--down); color: #fff; font: 600 10px/16px -apple-system, BlinkMacSystemFont, sans-serif; text-align: center; font-style: normal; }
.side-bar .sb-badge[hidden] { display: none; }
.side-bar svg .sb-fill { fill: var(--text); stroke: none; }
.side-bar svg .sb-dot { fill: var(--bg); stroke: none; }
/* 막대 말풍선: 버튼 왼쪽, 귀는 오른쪽 */
.fav-tip.left::after { top: 50%; left: 100%; margin-top: -6px; border: 6px solid transparent; border-left: 4px solid var(--tv-strong); border-right: 0; }
.sb-sep {
  width: 32px;
  height: 1px;
  margin: 4px 6px 4px 7px;
  background: var(--sep-line);
  flex: none;
}

/* 차트 아래 날짜 범위 막대: 차트 영역 안 맨 아래 38px + 위 1px 틈 색 선, 아래 모서리 4px.
   탭 14px·padding 0 6px(폭 28~33), 왼쪽 8px 에서 시작, 구분선 1×22, 날짜 이동 38, 오른쪽 끝 4px 여백. */
.date-bar {
  flex: none;
  height: 39px;
  border-top: 1px solid var(--gap);
  border-radius: 0 0 4px 4px;
  background: var(--bg);
  container-type: inline-size;
  overflow: hidden;
}
.dr-in {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 4px 0 8px;
  font-size: 14px;
  white-space: nowrap;
}
.dr-tabs {
  display: flex;
  height: 38px;
  flex: none;
}
.dr-btn {
  position: relative;
  isolation: isolate;
  height: 38px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 18px;
  cursor: default;
  display: inline-flex;
  align-items: center;
  flex: none;
}
.dr-btn::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 6px;
  z-index: -1;
}
.dr-btn:hover::before {
  background: var(--btn-hover);
}
.dr-btn.on::before {
  background: var(--btn-on);
}
.dr-goto {
  width: 38px;
  padding: 0 5px;
  justify-content: center;
}
.dr-goto svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.2;
}
.dr-clock {
  font-variant-numeric: tabular-nums;
}
.dr-menu {
  display: none;
  gap: 6px;
}
.dr-chev {
  width: 8px;
  height: 4px;
  stroke-width: 1.2;
}
.dr-sep {
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: var(--sep-line);
  flex: none;
}
/* TV 실측(데모 1440): 탭 끝 276 → 선 281 → 이동 286, 시계 끝 1288 → 세션 1289(선 없음) → 선 1333 → % 1338 */
.dr-sep-goto { margin-left: 5px; }
.dr-sep-session { display: none; }
.dr-clock + .dr-sep-session + .dr-btn { margin-left: 1px; }
/* 좁으면(데모 390 폭) 탭이 "Date Range ▾" 하나로 접히고 날짜 이동은 빠진다. 더 좁으면 시계도 뺀다. */
@container (max-width: 560px) {
  .dr-tabs,
  .dr-goto,
  .dr-sep-goto {
    display: none;
  }
  .dr-menu {
    display: inline-flex;
  }
}
@container (max-width: 330px) {
  .dr-clock,
  .dr-clock + .dr-sep {
    display: none;
  }
}

/* 아래 패널 탭 줄: 패널을 열었을 때만 보인다. 좁으면 가로로 밀어 본다. */
.bottom .tabs {
  overflow-x: auto;
  scrollbar-width: none;
}
.bottom .tabs::-webkit-scrollbar {
  display: none;
}

/* ≤900px(TradingView 본 사이트 좁은 폭은 미확인 ❓): 오른쪽 막대는 남기고, 패널은 막대 왼쪽에 차트 위로 겹쳐 연다.
   (전에는 .side 만 숨고 .side-bar 는 남아 아이콘을 눌러도 아무것도 안 나왔다) */
@media (max-width: 600px) {
  .main {
    position: relative;
  }
  .side {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 49px;
    z-index: 30;
    width: min(340px, calc(100vw - 110px)) !important;
    border-radius: 4px 0 0 0;
    box-shadow: var(--shadow);
  }
  .side .resize-x {
    display: none;
  }
  .side:not(.collapsed) + .side-bar {
    margin-left: 0;
  }
}
/* TradingView's indicator Inputs tab: the controls sit 213px in, leaving room on the right for its ⓘ icons */
.tvc-grid.tvc-inputs { grid-template-columns: minmax(max-content, 1fr) auto; }
.tvc-grid.tvc-inputs .tvc-ctl { padding-right: 26px; }

/* ===== Object tree and data window (objtree.js, CH-04). TradingView trading-terminal demo, 2026-11-26:
   title row 48, tool buttons 38×38 from x 8, rows 38 (icon 28, label 58px in, a group's drawings 36px
   further), row buttons 22×22 at the right 8px in (lock, hide, remove; on hover, or kept when on),
   selected row #c1d8f8, panes split by a 1px line; data window rows 26 (label 16px in, value right). */
.ot { display: flex; flex-direction: column; height: 100%; min-height: 0; color: var(--text); font-size: 14px; }
.ot-head { display: flex; align-items: center; gap: 16px; height: 48px; flex: none; padding: 0 16px; }
.ot-tab { height: 48px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 16px; font-weight: 600; cursor: default; }
.ot-tab.on { color: var(--text); }
.ot-page { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.ot-page[hidden] { display: none; }
.ot-tools { display: flex; gap: 0; height: 38px; flex: none; padding: 0 8px; border-bottom: 1px solid var(--border); padding-bottom: 1px; box-sizing: content-box; }
.ot-tool { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text); cursor: default; }
.ot-tool svg { width: 28px; height: 28px; stroke-width: 1; }
.ot-tool:hover:not(:disabled) { background: var(--hover); }
.ot-tool:disabled { color: var(--muted); opacity: 0.5; cursor: default; }
.ot-list { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 5px 0 6px; outline: none; } /* 첫 줄 y135(TV 데모: 도구 줄 아래 6px), 7회차 */
.ot-row { position: relative; display: flex; align-items: center; height: 38px; padding: 0 8px 0 calc(22px + var(--depth, 0) * 36px); gap: 8px; cursor: default; user-select: none; }
.ot-row:hover { background: var(--hover); }
/* 고른 행: TradingView 터미널 데모 3회차 실측 — 밝은 테마 rgb(187,217,251), 어두운 테마 rgb(20,46,97)(관심 목록과 같은 색) */
.ot-row.sel { background: #142e61; }
[data-theme="light"] .ot-row.sel { background: #bbd9fb; }
.ot-ic { width: 28px; height: 28px; flex: none; display: grid; place-items: center; color: var(--text); }
.ot-ic svg { width: 28px; height: 28px; stroke-width: 1; }
.ot-ic .ot-ti { width: 28px; height: 28px; }
.ot-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ot-row.k-symbol .ot-name { font-weight: 600; }
/* 숨긴 행: 글자만 흐린 색(TradingView 터미널 데모 4회차 실측 — 밝은 테마 rgb(184,184,184), 어두운 테마 rgb(87,87,87); 아이콘은 그대로) */
.ot-row.hid .ot-name { color: #575757; }
[data-theme="light"] .ot-row.hid .ot-name { color: #b8b8b8; }
.ot-acts { display: flex; gap: 8px; flex: none; }
.ot-acts button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--text); cursor: default; display: grid; place-items: center; visibility: hidden; }
.ot-acts button svg { width: 22px; height: 22px; stroke-width: 1.2; }
.ot-row:hover .ot-acts button, .ot-acts button.keep { visibility: visible; }
.ot-acts button:hover { background: var(--btn-hover); }
.ot-sep { height: 1px; margin: 6px 0; background: var(--border); }
.ot-row.dragging { opacity: 0.5; }
.ot-row.drop-above::before, .ot-row.drop-below::after { content: ""; position: absolute; left: 8px; right: 8px; height: 2px; background: var(--accent); }
.ot-row.drop-above::before { top: -1px; }
.ot-row.drop-below::after { bottom: -1px; }
.ot-rename { width: 100%; height: 26px; box-sizing: border-box; padding: 0 6px; border: 1px solid var(--accent); border-radius: 4px; background: var(--input); color: var(--text); font: inherit; }
/* data window */
.dw { flex: 1 1 auto; min-height: 0; overflow: auto; border-top: 1px solid var(--border); }
.dw-sec { padding: 8px 0; border-bottom: 1px solid var(--border); }
.dw-head { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px 0 10px; }
.dw-title { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-fold { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--text); cursor: default; display: grid; place-items: center; visibility: hidden; }
.dw-fold svg { width: 22px; height: 22px; stroke-width: 1.2; }
.dw-sec:hover .dw-fold, .dw-sec.folded .dw-fold { visibility: visible; }
.dw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 26px; padding: 0 16px; }
/* 고른 자료의 머리 줄(TradingView 터미널 데모 3회차 실측: 밝은 rgb(187,217,251), 어두운 rgb(20,46,97)) */
.dw-sec.active .dw-head { background: #142e61; }
[data-theme="light"] .dw-sec.active .dw-head { background: #bbd9fb; }
.dw-k { white-space: nowrap; }
.dw-v { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dw-v.up { color: var(--up); }
.dw-v.down { color: var(--down); }
/* Indicator templates (topbar.js, IUI-11): row buttons on hover, the Save indicator template dialog. */
.tvm-tpl-acts { display: none; gap: 2px; margin-left: 8px; }
.tvm-tpl:hover .tvm-tpl-acts { display: inline-flex; }
.tvm-tpl-btn { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--tv-muted); display: grid; place-items: center; cursor: default; }
.tvm-tpl-btn:hover { color: var(--tv-text); background: var(--hover); }
.tvm-tpl-btn.on { color: #f9a825; display: grid; }
.tvm-tpl:not(:hover) .tvm-tpl-acts:has(.on) { display: inline-flex; }
.tvm-tpl:not(:hover) .tvm-tpl-acts:has(.on) .tvm-tpl-btn:not(.on) { visibility: hidden; }
.tvdlg-sec { margin: 12px 0 8px; font-size: 12px; letter-spacing: 0.04em; color: var(--tv-muted); }
.tvdlg-check { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; cursor: default; }
.tvdlg-check input { width: 18px; height: 18px; margin: 0; }
.tvdlg-info { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1px solid var(--tv-muted); border-radius: 50%; font-size: 10px; font-style: normal; color: var(--tv-muted); cursor: help; }
.tvdlg-list { font-size: 14px; line-height: 20px; }
.tvdlg-btn[disabled] { opacity: 0.45; cursor: default; }
/* 확인 창(TradingView "Delete this template?"): 글 한 단락 + 빨간 Delete */
.tvdlg-text { padding: 4px 20px 20px; line-height: 1.5; color: var(--text); }
.tvdlg-btn.primary.danger { border-color: var(--down, #f23645); background: var(--down, #f23645); color: #fff; }
.legend[hidden] { display: none; }

/* ===== Alerts (alerts-ui.js, CH-12): the Create alert window (TradingView's dialog frame) and the
   alert manager / log in the right panel. ===== */
.tvd.al-dlg { width: min(560px, calc(100vw - 16px)); }
.al-dlg .tvc-grid { grid-template-columns: 110px 1fr; }
.al-col { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; min-width: 0; }
.al-conds { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.al-dlg .tvc-input:has(input[type="datetime-local"]) { width: auto; }
.al-dlg input[type="datetime-local"] { width: 210px; }
.al-dlg .tvc-ctl { flex-wrap: wrap; row-gap: 6px; }
.al-cond { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.al-cond .tvc-select { max-width: 190px; }
.al-rhs { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.al-rhs .tvc-input input { width: 96px; }
.al-rhs .al-bars input { width: 44px; }
.al-pair { display: inline-flex; gap: 6px; }
.al-x { width: 24px; height: 24px; border: 0; border-radius: 4px; background: none; color: var(--tv-muted); cursor: default; font-size: 16px; }
.al-x:hover { background: var(--tv-hover); color: var(--tv-text); }
.al-add { margin-top: 6px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; cursor: default; }
.al-trig { display: flex; flex-wrap: wrap; gap: 6px; }
.al-pill { height: 30px; padding: 0 12px; border: 1px solid var(--tv-border); border-radius: 6px; background: none; color: var(--tv-text); font: inherit; font-size: 13px; cursor: default; }
.al-pill.on { border-color: var(--tv-strong); background: var(--tv-strong); color: var(--tv-strong-text); }
.al-wide { width: 100%; }
.al-wide input { width: 100%; }
.al-msg { width: 100%; box-sizing: border-box; min-height: 64px; padding: 6px 8px; border: 1px solid var(--tv-border); border-radius: 6px; background: var(--tv-input-bg, transparent); color: var(--tv-text); font: inherit; font-size: 13px; resize: vertical; }
.al-ph { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.al-chip { height: 22px; padding: 0 6px; border: 0; border-radius: 4px; background: var(--tv-hover); color: var(--tv-text); font: 12px ui-monospace, Menlo, monospace; cursor: default; }
.al-test { margin-left: 8px; }
/* panel */
.al { display: flex; flex-direction: column; height: 100%; min-height: 0; font-size: 14px; color: var(--text); }
.al-head { display: flex; align-items: center; height: 48px; padding: 0 8px 0 16px; flex: none; }
.al-tabs { display: flex; gap: 16px; }
.al-tab { height: 48px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 16px; font-weight: 600; cursor: default; }
.al-tab.on { color: var(--text); }
.al-sp { flex: 1; }
.al-ic { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text); display: grid; place-items: center; cursor: default; }
.al-ic:hover { background: var(--hover); }
.al-ic svg { stroke-width: 1.2; }
.al-search { padding: 0 12px 8px; flex: none; }
.al-search .tvc-input, .al-search input { width: 100%; box-sizing: border-box; }
.al-perm { margin: 0 12px 8px; padding: 6px 8px; border: 1px dashed var(--border); border-radius: 6px; background: none; color: var(--muted); font: inherit; font-size: 12px; cursor: default; }
.al-list { flex: 1 1 auto; min-height: 0; overflow: auto; border-top: 1px solid var(--border); }
.al-row, .al-log { position: relative; display: flex; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--border); cursor: default; }
.al-log { flex-direction: column; gap: 2px; }
.al-row:hover { background: var(--hover); }
.al-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; flex: none; background: var(--muted); }
.st-active .al-dot { background: #22ab94; }
.st-triggered .al-dot { background: #ff9800; }
.st-expired .al-dot { background: var(--down); }
.al-main { flex: 1 1 auto; min-width: 0; }
.al-l1 { display: flex; align-items: baseline; gap: 6px; }
.al-tf, .al-when, .al-l3 { color: var(--muted); font-size: 12px; }
.al-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-l2 { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-l3 { margin-top: 2px; }
.st-active .al-st { color: #22ab94; }
.st-triggered .al-st { color: #ff9800; }
.st-expired .al-st { color: var(--down); }
.al-acts { display: flex; gap: 2px; align-self: center; visibility: hidden; }
.al-row:hover .al-acts { visibility: visible; }
.al-acts button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--text); display: grid; place-items: center; cursor: default; }
.al-acts button:hover { background: var(--btn-hover); }
.al-empty { padding: 16px; color: var(--muted); font-size: 13px; }
.al-clear { margin: 10px 16px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; cursor: default; }

/* 모의 거래 선의 × 단추(paper-lines.js): 포지션은 닫기, 주문은 취소. 가격 축 바로 왼쪽, 선 높이. */
.pl-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 4; }
.pl-x { position: absolute; left: 0; top: 0; width: 16px; height: 16px; padding: 0; display: grid; place-items: center; border-radius: 3px; border: 1px solid var(--c); background: var(--bg); color: var(--c); cursor: default; }
.pl-x:hover { background: var(--c); color: #fff; }

/* Lock vertical cursor line by time (chart-extras.js): 십자선 모양 점선 + 시간 축 라벨에 자물쇠(TradingView 데모). */
.vlock { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 3; pointer-events: none; }
.vlock-line { position: absolute; top: 0; width: 0; border-left: 1px dashed var(--vl); }
.vlock-label { position: absolute; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 0 6px; white-space: nowrap; font-size: 12px; line-height: 1; color: #fff; background: var(--crosshair-label, #131722); border-radius: 2px; }
/* Table view: 차트 자리를 덮는 표(최근 봉이 위). */
.tview { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; background: var(--bg); color: var(--text); outline: none; }
.tview-top { flex: none; display: flex; align-items: center; height: 56px; padding: 0 20px; }
.tview-title { font-size: 16px; color: var(--muted); }
.tview-back { margin-left: auto; height: 34px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font-size: 16px; cursor: default; }
.tview-back:hover { background: var(--panel-2); }
.tview-scroll { flex: 1; overflow: auto; }
.tview-t { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tview-t th { position: sticky; background: var(--bg); font-weight: 400; color: var(--text); height: 41px; padding: 0 12px; border-bottom: 1px solid var(--border); }
.tview-t thead tr:first-child th { top: 0; }
.tview-t thead tr:nth-child(2) th { top: 41px; color: var(--muted); text-align: right; }
.tview-t th.tv-date { text-align: left; border-right: 1px solid var(--border); }
.tview-t th.tv-g { border-right: 1px solid var(--border); }
.tview-t td { height: 43px; padding: 0 12px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tview-t td.tv-date { text-align: left; border-right: 1px solid var(--border); }
.tview-t td.up { color: var(--up, #089981); }
.tview-t td.down { color: var(--down, #f23645); }
.tview-t tbody tr:hover td { background: var(--panel-2); }

/* Open list…(Shift+W): 내 목록 | 핫리스트(거래소 고르기). watchlist.js openListDialog */
.ol-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ol-col { display: flex; flex-direction: column; min-width: 0; }
.ol-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 32px; font-weight: 600; }
.ol-sub { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.ol-ex { height: 28px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.ol-row { height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); text-align: left; cursor: default; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-row:hover { background: var(--panel-2); }
.ol-row.on { background: color-mix(in srgb, var(--accent) 16%, transparent); }

/* Marks on bars(bar-marks.js): 봉 아래 E·D·S 원(TradingView 데모의 원 모양). */
.bm-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 3; }
.bm { position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; line-height: 1; color: var(--c); background: var(--bg); border: 1.5px solid var(--c); cursor: default; }
.bm:hover { background: var(--c); color: #fff; }

/* ===== Go to 창(goto-dialog.js) — TradingView 데모 실측(1440×900): 창 302×566, 입력 150×34 + 100×34(y+117),
   달 이동 줄 y+168(버튼 34), 요일 줄 y+214 높이 22 둥근 6, 날짜 칸 34×34·간격 4(y+248), 아래 버튼 줄 위 1px 선 ===== */
.gt-dlg .tvd-body { padding: 17px 20px 0; min-height: 0; overflow: visible; }
.gt-row { display: flex; gap: 12px; margin-bottom: 17px; }
.gt-row + .gt-row { margin-top: -5px; }
.gt-in.gt-date { width: 150px; }
.gt-in.gt-time { width: 100px; }
.gt-in input { width: 0; font-size: 14px; }
.gt-in svg { width: 28px; height: 28px; flex: none; margin-right: 2px; fill: none; stroke: var(--tv-muted); stroke-width: 1; pointer-events: none; }
.tvc-input.bad { border-color: #f23645; box-shadow: inset 0 0 0 1px #f23645; }
.gt-cal { padding-bottom: 27px; }
.gt-calhead { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 3px; }
.gt-nav { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--tv-text); cursor: default; }
.gt-nav:hover { background: var(--tv-hover); }
.gt-nav svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.gt-next svg { transform: scaleX(-1); }
.gt-month { font-size: 16px; line-height: 24px; }
.gt-dow, .gt-week { display: grid; grid-template-columns: repeat(7, 34px); column-gap: 4px; }
.gt-dow { height: 22px; align-items: center; margin-top: 12px; border-radius: 6px; background: var(--tv-hover); color: var(--tv-muted); text-align: center; line-height: 18px; }
.gt-weeks { display: grid; row-gap: 4px; align-content: start; min-height: 224px; margin-top: 12px; }
.gt-day { width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--tv-text); font: inherit; font-size: 16px; line-height: 24px; cursor: default; }
.gt-day:hover:not(:disabled):not(.on) { background: var(--tv-hover); }
.gt-day.on { border-color: var(--tv-strong); background: var(--tv-strong); color: var(--tv-strong-text); }
.gt-day:disabled { color: color-mix(in srgb, var(--tv-text) 38%, transparent); cursor: default; }
.gt-dlg .tvd-foot { border-top: 1px solid var(--tv-sep); }

/* 그리기 툴바 접기 손잡이(TradingView 데모 실측 9×27, x46 y815 = 화면 아래에서 58px 위) */
.main { position: relative; }
.draw-toggle { position: absolute; left: 46px; bottom: 58px; z-index: 6; width: 9px; height: 27px; padding: 0; border: 0; border-radius: 0 3px 3px 0; background: var(--gap); color: var(--text); cursor: default; opacity: 0; transition: opacity 0.1s; }
.draw-toggle svg { display: block; width: 9px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.drawbar:hover ~ .draw-toggle, .draw-toggle:hover, .draw-toggle:focus-visible { opacity: 1; }
.draw-toggle.shut { left: 0; opacity: 0.6; }
.draw-toggle.shut:hover { opacity: 1; }
.draw-toggle.shut svg { transform: scaleX(-1); }

/* 범례 장 상태 알약 — TradingView 데모 실측: 버튼 40×18 둥근 9(바탕 없음), 칸마다 20×18(왼쪽 장 상태 · 오른쪽 지연 D #ffb74d) */
.legend .lg-status { margin-left: 4px; padding: 0; border-radius: 9px; }
.legend .lg-status:hover { background: var(--hover); }
.legend .lg-dot, .legend .lg-dot.pre, .legend .lg-dot.post, .legend .lg-dot.closed { width: 20px; background: transparent; }
.legend .lg-d { width: 20px; background: transparent; color: #ffb74d; }

/* 위 툴바: 글자를 접고도 조금 넘치면 구분선 여백부터 줄인다 */
.topbar.tight .tbx-sep { margin: 0 1px; }
.topbar.tight .tb-right { padding-right: 0; }
/* 휴대폰 폭: TradingView 데모(390)처럼 오른쪽 아이콘 막대 없이 차트가 폭 전체(모서리 메뉴 "Right toolbar" 로 다시 켬) */
@media (max-width: 480px) {
  body:not(.sb-show) .side-bar { display: none; }
  body:not(.sb-show) .side { right: 0; }
}

/* 그림 설정 창 제목 옆 이름 바꾸기 연필 — TradingView 실측: 제목 뒤 5px 에 34×34, 누르면 제목 자리에 입력 340×34(x+20 y+17) */
.tvd-title.tvd-title-fit { flex: 0 1 auto; width: auto; padding-right: 5px; }
.tvd-headgap { flex: 1; }
.tvd-edit { width: 34px; height: 34px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--tv-muted); cursor: default; }
.tvd-edit:hover { background: var(--tv-hover); color: var(--tv-text); }
.tvd-edit svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.1; }
.tvd-head.renaming > :not(.tvd-rename) { display: none; }
.tvd-rename { flex: 1; width: auto; margin-right: 3px; }
.tvd-rename input { width: 0; padding: 0 5px; font-size: 14px; }
/* 차트 설정 창 항목 아래 설명 글 — TradingView 실측 13px/18px 흐린 색, 항목 글자 26px 아래, 다음 항목까지 68px */
.tvc-desc { min-height: 25px; margin-top: -7px; align-items: flex-start; font-size: 13px; line-height: 18px; color: var(--tv-muted); }
.gt-row + .gt-row { margin-top: -1px; }

/* 비교 창 아래 줄 — TradingView 실측: 높이 40, 바탕 한 단 밝게, 가운데 체크 18 + 글 13px 흐림 */
.ss-foot { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; flex: none; height: 40px; background: var(--tv-hover); color: var(--tv-muted); font-size: 13px; line-height: 17px; cursor: default; user-select: none; }
.ss-foot input { position: absolute; opacity: 0; pointer-events: none; }
.ss-foot input:checked + .tvc-box { background: var(--tv-strong); }
.ss-foot input:checked + .tvc-box .tvc-mark { visibility: visible; }

/* Go to 월·연 고르기 — TradingView 실측: 제목 버튼 34 높이 둥근 8(켜지면 바탕), 소제목 줄 22, 월 3×4(줄 간격 64)·연 4×5(줄 간격 48), 칸 34 높이 */
.gt-month { height: 34px; padding: 0 11px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--tv-text); font: inherit; font-size: 16px; line-height: 24px; cursor: default; }
.gt-month:hover, .gt-month.on { background: var(--tv-hover); }
.gt-sub { display: grid; grid-template-columns: 1fr; }
.gt-grid { display: grid; column-gap: 3px; align-content: start; min-height: 224px; margin-top: 12px; }
.gt-months { grid-template-columns: repeat(3, 1fr); row-gap: 30px; }
.gt-years { grid-template-columns: repeat(4, 1fr); row-gap: 14px; }
.gt-pick { height: 34px; padding: 0 11px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--tv-text); font: inherit; font-size: 16px; line-height: 24px; cursor: default; }
.gt-pick:hover:not(:disabled), .gt-pick.on { background: var(--tv-hover); }
.gt-pick:disabled { color: color-mix(in srgb, var(--tv-text) 38%, transparent); cursor: default; }

/* 날짜 막대 % 버튼: TradingView 는 글자가 아니라 14×14 그림(버튼 26×38) */
.dr-pct { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.2; }

.ss-card .modal-body { flex: 1 1 auto; }
/* 휴대폰 폭: 레이아웃 메뉴(428)가 화면보다 넓어지지 않게 — 넘치는 줄은 옆으로 민다 */
.tvm.tvm-layout { max-width: calc(100vw - 8px); overflow-x: auto; }
.gt-grid { margin-bottom: -2px; }

/* ===== full-compare 5회차 ===== */
/* 범례 장 상태 그림 — TradingView 데모 실측(18×18 칸 안): 열림 = 지름 8 원(#42bda8), 닫힘 = 10×4 둥근 막대(글자색 회색) */
.legend .lg-dot::after { background: #42bda8; }
.legend .lg-dot.closed::after { width: 10px; height: 4px; border-radius: 2px; background: var(--text); }
/* 차트 설정 창: 묶음 제목 줄 — TV 실측: 앞 행 끝에서 26px 아래 11px 글자, 그 9px 아래 다음 행(줄 48px). 첫 제목 글자 y+94 */
.tvd-side .tvc-section { min-height: 48px; box-sizing: border-box; align-items: flex-end; padding-bottom: 9px; line-height: 13px; }
/* r4a-misc-A (TV 터미널 데모 실측, 1440×900): 첫 줄은 창 위 + 116(제목 줄 48 — 위 여백 16 + 제목 32), 마지막 줄 아래 16 + 16,
   들여쓴 줄은 앞줄에 8px 겹침(Titles 482 → Inputs 524 → Values 574), 들여쓴 설명 글은 칸 폭 366(글 340)에서 줄바꿈. */
.tvd-side .tvd-body { padding-bottom: 32px; }
.tvd-side .tvc-indent:not(.tvc-desc), .tvd-side .tvc-first.tvc-indent + .tvc-ctl { margin-top: -8px; }
.tvd-side .tvc-desc.tvc-indent { max-width: 366px; box-sizing: border-box; padding-bottom: 7px; }
/* 이름 칸 폭 — TradingView 의 규칙 그대로(데모 CSS 실측): 격자 `auto 1fr`, 이름 칸 min-width 0 · overflow-wrap.
   이름 칸은 가장 긴 이름만큼(Canvas: "Horizontal grid lines" 154.7 + 20 → 값 열 x+420.7), 값 칸이 자리를 더 달라고 할 때만 이름이 줄바꿈된다.
   (5회차의 "최대 153px / 127px" 고정은 Canvas 탭 이름을 두 줄로 꺾어 값 열이 2px 왼쪽이었다.) */
.tvd-side .tvc-grid { grid-template-columns: auto 1fr; }
.tvd-side .tvc-grid > .tvc-first { min-width: 0; }
/* 차트 설정 창의 값 칸(TradingView 데모 실측, 7회차): 컨트롤 사이 8px, 색 없는 선 버튼도 75폭, 비율 칸 150,
   "Value according to scale" 줄은 윗줄에 8px 붙음, Background 앞 묶음 간격 16, 스크롤 막대 5px(내용 폭 484 → 479). */
.tvd-side .tvc-ctl { gap: 8px; }
.tvd-side .tvc-ctl .tvc-unit { margin-left: 0; }
.tvd-side .tvc-colorbtn.no-color.with-line { width: 75px; justify-content: center; }
.tvc-input.w150 { width: 150px; }
/* 이름이 두 줄로 꺾이는 체크 줄("Lock price to bar ratio"): 상자는 첫 줄 높이에(TV: 상자 y = 글자 y) */
.tvd-side .tvc-first .tvc-check { align-items: flex-start; }
.tvd-side .tvc-first .tvc-check input { top: 9px; }
.tvd-side .tvc-up8 { margin-top: -8px; }
.tvd-side .tvc-gap16 { min-height: 16px; }
.tvd-side .tvd-body { scrollbar-width: auto; scrollbar-color: auto; }
.tvd-side .tvd-body::-webkit-scrollbar { width: 5px; }
.tvd-side .tvd-body::-webkit-scrollbar-thumb { border-radius: 3px; background: var(--tv-border-hover); }
.tvd-side .tvd-body::-webkit-scrollbar-track { background: transparent; }
.tvd-side .tvc-grid > .tvc-first .tvc-title, .tvd-side .tvc-grid > .tvc-first .tvc-check-label { min-width: 0; white-space: normal; overflow-wrap: break-word; }
/* 데이터 창 — TV 실측(패널 위에서): Date 글자 y+62, 구분선 뒤 17px 에 제목, 제목 36px 아래 첫 값, 값 줄 26px */
/* 8회차(TradingView 데모, 글자 자리로 다시 잼): 머리 아래 선은 y+89~90(우리 선은 한 칸 아래였다 → -1px),
   날짜 묶음은 위아래 10 · 줄이 하나(일봉)여도 선까지 50px(Date 가 가운데), 다음 묶음 제목은 선 아래 +17.5(위 여백 7 · 아래 10). */
.dw { margin-top: -1px; }
.dw-sec { padding: 7px 0 10px; }
.dw-sec:first-child { padding-top: 10px; }
.dw-sec.dw-time { display: flex; flex-direction: column; justify-content: center; box-sizing: border-box; min-height: 51px; }
.dw-sec.folded { padding-bottom: 7px; } /* 숨긴 자료: 머리 줄만(TV 3회차 실측 — 다음 묶음까지 51px) */
.dw-sec.folded .dw-head { margin-bottom: 0; }
.dw-head { margin-bottom: 5px; padding-left: 16px; } /* 그림 x+16 · 제목 x+52(TV 데모 실측, 7회차 — 전에는 +10 · +46) */
/* 2회차(도형 툴바): Degree 하위 메뉴의 체크 자리, 여러 개 선택 설정 창의 Displacement 안내 글 */
.fb-sub.fb-sub-check .fb-mi-ic { display: inline-flex; }
.tvc-disp-hint { display: block; line-height: 18px; white-space: normal; }

/* 도형 툴바 말풍선: 0.5초 뒤 0.18초에 걸쳐 나타난다(TradingView 실측 2026-11-27) */
.fb-tip.fade { animation: fb-tip-in 0.15s linear; }
/* r4a-misc-A: 다른 말풍선도 TV 박자로 — 0.5초 뒤 0.15초(linear) 에 나타남(tip-fade.js 가 새로 뜰 때만 .tip-in 을 붙임) */
.fav-tip.tip-in { animation: fb-tip-in 0.15s linear 0.5s both; }
@keyframes fb-tip-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fb-tip.fade { animation: none; } }

/* 4회차 실측(TV 터미널 데모): 단추·메뉴 줄·체크 칸·탭·관심 목록 줄 위의 커서는 화살표(default)다 — 위 규칙들의 pointer 를 모두 default 로 바꿨다.
   손가락 커서는 바깥으로 나가는 링크와 차트 위의 그림·지표 선(.chart[data-over])에만 남긴다. */
a[href] {
  cursor: pointer;
}

/* 포커스 고리(4회차 실측): TradingView 는 키보드로 옮겨 간 단추·탭에 2px rgb(41,98,255) 테두리를 그린다(브라우저 기본 1px 고리 아님). */
button:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
[role="menuitem"]:focus-visible,
[role="option"]:focus-visible,
a:focus-visible,
select:focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible,
[tabindex]:not(input):not(textarea):not([tabindex="-1"]):focus-visible {
  outline: 2px solid #2962ff;
  outline-offset: -2px;
}

/* QT-scale — extra price scales (Pin to new right / left scale, extra-scales.js). The pane gets margins the
   width of the extra columns; the chart, legends and buttons inside it follow. TradingView (charting
   library demo, 2026-11-27): column 60px for "350.00", badge = 19px circle rgb(245,245,245), letter 11px #575757. */
.pane.xs-on {
  margin-right: var(--xs-r, 0px);
  margin-left: var(--xs-l, 0px);
  overflow: visible;
  clip-path: inset(0 calc(-1 * var(--xs-r, 0px)) 0 calc(-1 * var(--xs-l, 0px)));
}
.pane.xs-on.active::after { inset: 0 calc(-1 * var(--xs-r, 0px)) 0 calc(-1 * var(--xs-l, 0px)); }
.xs-col { position: absolute; top: 0; bottom: 0; z-index: 4; background: var(--bg); overflow: hidden; user-select: none; touch-action: none; }
.xs-col canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.xs-badge { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: grid; place-items: center; padding: 0; border: 0; background: transparent; cursor: default; }
.xs-badge[hidden] { display: none; }
.xs-badge i, .scale-gear[data-letter]::before { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: rgb(245, 245, 245); color: #575757; font-size: 11px; font-style: normal; font-weight: 400; line-height: 1; }
.scale-gear[data-letter]::before { content: attr(data-letter); }
.scale-gear[data-letter] svg { display: none; }
.scale-gear[data-letter]:hover { background: transparent; }
.xs-badge:hover i, .scale-gear[data-letter]:hover::before { background: rgb(235, 235, 235); }
:root:not([data-theme="light"]) .xs-badge i, :root:not([data-theme="light"]) .scale-gear[data-letter]::before { background: rgba(255, 255, 255, 0.1); color: #b8b8b8; }
/* 회원 관리: 새 회원 복사 선택, 삭제 확인 칸(자료 삭제 / 보관) */
.acc-copy { margin-top: 8px; }
.acc-del { margin-top: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
/* hidden 속성으로 숨긴다(회원 삭제 확인 칸, 새 API 토큰 칸): 위의 display 가 브라우저 기본 [hidden] 을 덮지 않게 */
.acc-del[hidden] { display: none; }
.acc-del .acc-warn { color: #f23645; }
.res-share { margin-top: 6px; }
/* 시연 커서 안내 띠(TradingView 7회차 실측): 차트 아래 가운데, 바탕 #2962FF · 둥근 4 · 안 여백 8, 글 흰색 14px/21px(여백 4 8) 다음 × 18×21. */
.demo-hint { position: absolute; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; align-items: flex-start; padding: 8px; border-radius: 4px; background: #2962ff; color: #fff; font: 14px/21px -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif; white-space: nowrap; user-select: none; cursor: default; }
.demo-hint .dh-text { padding: 4px 8px; }
.demo-hint .dh-close { display: grid; place-items: center; width: 18px; height: 21px; }
.demo-hint .dh-close svg { fill: none; stroke: currentColor; stroke-width: 1.5; }
