/* ==========================================================================
   트레이딩 차트 스타일
   - 배치·크기는 널리 쓰이는 차트 터미널 관례를 따름(위 38px, 왼쪽 52px, 패널 간격 4px)
   - 색은 :root 토큰 한 곳에서. 다크/라이트는 html[data-theme]
   ========================================================================== */
@font-face { font-family: "Pretendard"; font-weight: 400; font-display: swap; src: url("/assets/fonts/Pretendard-Regular.subset.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 600; font-display: swap; src: url("/assets/fonts/Pretendard-SemiBold.subset.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 700; font-display: swap; src: url("/assets/fonts/Pretendard-Bold.subset.woff2") format("woff2"); }

:root,
[data-theme="light"] {
  color-scheme: light;
  --gap: #ebebeb;
  --panel: #ffffff;
  --panel-2: #f7f7f8;
  --surface: #ebebeb;
  --hover: #f0f0f0;
  --active: #e3e3e3;
  --line: #e0e3eb;
  --line-2: #d1d4dc;
  --text: #131722;
  --text-2: #42454f;
  --text-3: #787b86;
  --text-4: #b2b5be;
  --accent: #2962ff;
  --accent-text: #2962ff;
  --accent-soft: rgba(41, 98, 255, 0.12);
  --up: #089981;
  --down: #f23645;
  --warn: #ff9800;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.14);
  --overlay: rgba(19, 23, 34, 0.32);
  --tip-bg: #131722;
  --tip-fg: #ffffff;
  --font: -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, Pretendard, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}
[data-theme="dark"] {
  color-scheme: dark;
  --gap: #222222;
  --panel: #0f0f0f;
  --panel-2: #161616;
  --surface: #222222;
  --hover: #252525;
  --active: #303030;
  --line: #2e2e2e;
  --line-2: #3d3d3d;
  --text: #dbdbdb;
  --text-2: #b8b8b8;
  --text-3: #8c8c8c;
  --text-4: #5c5c5c;
  --accent-text: #5d8cff;
  --up: #22ab94;
  --down: #f7525f;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.45), 0 14px 36px rgba(0, 0, 0, 0.55);
  --overlay: rgba(0, 0, 0, 0.55);
  --tip-bg: #e6e6e6;
  --tip-fg: #0f0f0f;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--gap);
  color: var(--text);
  font: 14px/1.35 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.4; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.num { font-variant-numeric: tabular-nums; }
.is-up { color: var(--up); }
.is-down { color: var(--down); }
.t2 { color: var(--text-2); }
.tv-grow { flex: 1 1 auto; }
[hidden] { display: none !important; }
.ic { flex: 0 0 auto; }
.tv-noscript { padding: 24px; }

/* ---------- 큰 틀 ---------- */
.tv {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: calc(52px * var(--uiz, 1)) minmax(0, 1fr) auto;
  grid-template-rows: calc(38px * var(--uiz, 1)) minmax(0, 1fr);
  grid-template-areas: "top top top" "left center right";
  gap: 4px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.has-tabs .tv {
  grid-template-rows: calc(30px * var(--uiz, 1)) calc(38px * var(--uiz, 1)) minmax(0, 1fr);
  grid-template-areas: "tabs tabs tabs" "top top top" "left center right";
}
.no-drawbar .tv { grid-template-columns: 0 minmax(0, 1fr) auto; }
.no-drawbar .tv-left { display: none; }
.tv-top { grid-area: top; display: flex; align-items: stretch; background: var(--panel); min-width: 0; }
.tv-left { grid-area: left; background: var(--panel); border-top-right-radius: var(--r4, 4px); min-height: 0; }
.tv-center { grid-area: center; display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 0; }
.tv-right { grid-area: right; display: flex; gap: 4px; min-height: 0; }
/* 도구 막대 크기 (테마 꾸미기) */
.tv-top > *, .tv-left-inner, .tv-widgetbar, .wp-body, .tv-bottombar, .tv-tabs > * { zoom: var(--uiz, 1); }
.tv-card { background: var(--panel); border-radius: var(--r4, 4px); overflow: hidden; }
.tv-chartcard { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; border-top-left-radius: 4px; }

/* ---------- 위 막대 ---------- */
.tv-menubtn { width: 52px; flex: 0 0 52px; display: grid; place-items: center; color: var(--text); }
.tv-menubtn:hover { background: var(--hover); }
.tv-top-inner { flex: 1 1 auto; display: flex; align-items: center; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding-right: 6px; }
.tv-top-inner::-webkit-scrollbar { display: none; }
.tv-sep { flex: 0 0 1px; width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.tv-tb {
  height: 34px; min-width: 34px; padding: 0 7px; margin: 0 1px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--r4, 4px); color: var(--text); white-space: nowrap; flex: 0 0 auto;
}
.tv-tb:hover:not(:disabled) { background: var(--hover); }
.tv-tb.is-on { color: var(--accent-text); }
.tv-tb.is-label span { font-size: 14px; }
.tv-round { border-radius: 999px; min-width: 32px; height: 32px; padding: 0; }
.tv-caret { min-width: 22px; padding: 0 2px; }
.tv-symbtn {
  height: 28px; margin: 0 6px 0 4px; padding: 0 14px 0 10px; border-radius: var(--r14, 14px);
  display: inline-flex; align-items: center; gap: 6px; background: var(--surface); font-weight: 600; flex: 0 0 auto;
}
.tv-symbtn:hover { background: var(--active); }
.tv-symbtn .ic { color: var(--text-3); }
.tv-ivs { display: flex; align-items: center; }
.tv-iv { padding: 0 6px; min-width: 30px; font-size: 14px; }
.tv-iv.is-on { color: var(--accent-text); font-weight: 600; }
.tv-layoutbtn { display: flex; align-items: center; }
.tv-layoutbtn .tv-tb.is-label span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 왼쪽 도구 막대 ---------- */
.tv-left-inner { height: 100%; display: flex; flex-direction: column; align-items: center; padding: 4px 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.tv-left-inner::-webkit-scrollbar { display: none; }
.tv-tgroup { position: relative; width: 52px; display: flex; justify-content: center; }
.tv-tool { width: 40px; height: 38px; display: grid; place-items: center; border-radius: var(--r4, 4px); color: var(--text); flex: 0 0 auto; }
.tv-tool:hover { background: var(--hover); }
.tv-tool.is-on, .tv-tgroup.is-on > .tv-tool { color: var(--accent-text); }
.tv-tool-more { position: absolute; right: 0; top: 0; width: 12px; height: 38px; display: grid; place-items: center; color: var(--text-3); border-radius: 0 var(--r4, 4px) var(--r4, 4px) 0; opacity: 0; }
.tv-tgroup:hover .tv-tool-more, .tv-tool-more:focus-visible { opacity: 1; }
.tv-tool-more:hover { background: var(--hover); color: var(--text); }
.tv-tsep { flex: 0 0 1px; width: 32px; height: 1px; background: var(--line); margin: 6px 0; }
.tv-emoji { font-size: 20px; line-height: 1; }
@media (hover: none) { .tv-tool-more { opacity: 0.7; } }

/* ---------- 차트 ---------- */
.tv-chart { position: relative; flex: 1 1 auto; min-height: 0; }
.tv-panes { position: absolute; inset: 0; display: flex; flex-direction: column; }
.tv-pane { position: relative; flex: 0 0 auto; min-height: 0; }
.tv-pane.is-main { flex: 1 1 0; min-height: 120px; }
.tv-pane-host { position: absolute; inset: 0; touch-action: none; }
.tv-pane-sep { flex: 0 0 1px; height: 1px; background: var(--line); position: relative; z-index: 5; cursor: row-resize; }
.tv-pane-sep::after { content: ""; position: absolute; left: 0; right: 0; top: -3px; height: 7px; }
.tv-pane-sep:hover { background: var(--accent); }
.draw-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.tv-pane.is-drawing, .tv-pane.is-drawing * { cursor: crosshair !important; }
.tv-pane.is-draw-hover .tv-pane-host, .tv-pane.is-draw-hover .tv-pane-host * { cursor: pointer !important; }
.tv-pane.is-eraser .tv-pane-host, .tv-pane.is-eraser .tv-pane-host * { cursor: cell !important; }
.tv-pane.is-erase-hover .tv-pane-host, .tv-pane.is-erase-hover .tv-pane-host * { cursor: not-allowed !important; }
.tv-pane.cur-arrow .tv-pane-host, .tv-pane.cur-arrow .tv-pane-host * { cursor: default; }
.is-replay-pick .tv-pane.is-main .tv-pane-host, .is-replay-pick .tv-pane.is-main .tv-pane-host * { cursor: col-resize !important; }

/* 범례 */
.tv-legend { position: absolute; left: 8px; top: 6px; right: 90px; z-index: 4; pointer-events: none; font-size: 13px; }
.lg-row { display: flex; align-items: center; gap: 4px; min-height: 22px; max-width: 100%; pointer-events: auto; width: max-content; padding-right: 4px; border-radius: var(--r3, 3px); }
.lg-series { font-size: 13px; flex-wrap: wrap; }
.lg-ic.tv-sym-ic { width: 18px; height: 18px; font-size: 10px; margin-right: 2px; }
.lg-title { color: var(--text); font-size: 14px; padding: 0 1px; border-radius: 2px; }
.lg-title:not(.is-ex):hover { background: var(--hover); }
.lg-title.is-ex { color: var(--text-2); }
.lg-dot { color: var(--text-3); }
.lg-live { width: 8px; height: 8px; border-radius: 50%; background: var(--text-4); margin: 0 4px; flex: 0 0 auto; display: inline-block; }
.lg-live.is-on { background: var(--up); box-shadow: 0 0 0 3px rgba(8, 153, 129, 0.2); }
.lg-vals { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; margin-left: 4px; }
.lg-vals span { color: var(--text-2); margin-left: 4px; }
.lg-vals b { font-weight: 400; }
.lg-vals.is-up b { color: var(--up); }
.lg-vals.is-down b { color: var(--down); }
.lg-ind .lg-name { color: var(--text); white-space: nowrap; }
.lg-args { color: var(--text-3); }
.lg-v { font-variant-numeric: tabular-nums; margin-left: 6px; color: var(--text-2); }
.lg-row.is-off .lg-name, .lg-row.is-off .lg-v, .lg-row.is-off .lg-vals { opacity: 0.45; }
.lg-btns { display: none; align-items: center; gap: 1px; margin-left: 6px; background: var(--panel); border-radius: var(--r3, 3px); }
.lg-row:hover .lg-btns, .lg-row:focus-within .lg-btns { display: inline-flex; }
.lg-row:hover { background: color-mix(in srgb, var(--panel) 80%, transparent); }
.lg-inds.is-closed { display: none; }
.lg-toggle { pointer-events: auto; margin-top: 2px; }
.tv-mini { width: 26px; height: 22px; display: inline-grid; place-items: center; border-radius: var(--r3, 3px); color: var(--text-2); }
.tv-mini:hover { background: var(--hover); color: var(--text); }
.tv-pane:not(.is-main) .tv-legend { top: 4px; }
.tv-pane-ctrl { position: absolute; right: 70px; top: 4px; z-index: 4; display: none; gap: 1px; background: var(--panel); border-radius: var(--r3, 3px); }
.tv-pane:hover .tv-pane-ctrl { display: flex; }

/* 축 단추 · 이동 단추 */
.tv-scalebtns { position: absolute; right: 0; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: center; gap: 4px; background: var(--panel); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tv-scalebtn { width: 20px; height: 20px; border-radius: var(--r3, 3px); font-size: 12px; color: var(--text-3); }
.tv-scalebtn:hover { background: var(--hover); color: var(--text); }
.tv-scalebtn.is-on { color: var(--accent-text); }
.tv-navbtns { position: absolute; z-index: 5; left: 0; display: flex; justify-content: center; gap: 4px; pointer-events: none; opacity: 0; transition: opacity 0.15s; }
.tv-navbtns.is-on { opacity: 1; pointer-events: auto; }
.tv-navbtn { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r4, 4px); background: var(--panel); color: var(--text-2); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); border: 1px solid var(--line); }
.tv-navbtn:hover { color: var(--text); background: var(--hover); }
.tv-rtbtn { position: absolute; z-index: 5; width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r4, 4px); background: var(--panel); border: 1px solid var(--line); color: var(--text-2); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
.tv-rtbtn:hover { color: var(--text); background: var(--hover); }
.is-loading .tv-chart::after, .is-loading-more .tv-chart::after {
  content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 30%; z-index: 9; background: var(--accent);
  animation: tvLoad 1s linear infinite;
}
@keyframes tvLoad { from { transform: translateX(-100%); } to { transform: translateX(400%); } }

/* ---------- 아래 막대 (기간·시계) ---------- */
.tv-bottombar { flex: 0 0 38px; height: 38px; display: flex; align-items: center; border-top: 1px solid var(--line); padding: 0 6px; overflow-x: auto; scrollbar-width: none; }
.tv-bottombar::-webkit-scrollbar { display: none; }
.tv-ranges { display: flex; }
.tv-bb { height: 30px; min-width: 28px; padding: 0 6px; border-radius: var(--r4, 4px); font-size: 13px; color: var(--text); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.tv-bb:hover { background: var(--hover); }
.tv-bb.is-icon { width: 30px; padding: 0; }
.tv-clock { color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- 아래 패널 (큰 체결·청산) ---------- */
.tv-bottom { flex: 0 0 auto; display: flex; flex-direction: column; position: relative; min-height: 38px; }
.tv-bottom:not(.is-open) { height: 38px !important; }
.tv-bottom-resizer { position: absolute; left: 0; right: 0; top: -4px; height: 8px; cursor: row-resize; z-index: 3; }
.tv-bottom:not(.is-open) .tv-bottom-resizer { display: none; }
.tv-bottom-tabs { flex: 0 0 38px; height: 38px; display: flex; align-items: center; gap: 2px; padding: 0 6px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tv-bottom:not(.is-open) .tv-bottom-tabs { border-bottom: 0; }
.tv-btab { height: 30px; padding: 0 10px; border-radius: var(--r4, 4px); font-size: 14px; color: var(--text-2); white-space: nowrap; }
.tv-btab:hover { background: var(--hover); color: var(--text); }
.tv-btab.is-on { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); border-radius: var(--r4, 4px) var(--r4, 4px) 0 0; }
.tp-min { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.tp-sym { font-size: 12px; color: var(--text-3); margin-left: 10px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tv-bottom-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.tp-bars { flex: 0 0 auto; display: flex; align-items: center; gap: 18px; padding: 6px 12px; border-bottom: 1px solid var(--line); font-size: 12px; flex-wrap: wrap; }
.tp-bars-title { color: var(--text-3); }
.tp-p { display: flex; align-items: center; gap: 8px; flex: 1 1 320px; min-width: 260px; }
.tp-p b { font-weight: 600; }
.tp-p > * { white-space: nowrap; }
.tp-meter { flex: 1 1 auto; height: 6px; border-radius: var(--r3, 3px); background: var(--down); overflow: hidden; min-width: 60px; }
.tp-meter i { display: block; height: 100%; background: var(--up); }
.tp-lead { color: var(--text-3); min-width: 64px; text-align: right; }
.tp-cols, .tp-row { display: grid; grid-template-columns: minmax(110px, 1.3fr) 48px 80px minmax(90px, 1fr) 80px 44px; gap: 8px; align-items: center; padding: 0 12px; }
.tp-cols { flex: 0 0 26px; height: 26px; font-size: 11px; color: var(--text-3); border-bottom: 1px solid var(--line); }
.tp-cols span:nth-child(n + 4), .tp-row span:nth-child(n + 4) { text-align: right; }
.tp-list { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.tp-row { height: 26px; font-size: 12.5px; border-left: 3px solid transparent; animation: tpIn 0.3s ease-out; }
@keyframes tpIn { from { opacity: 0; transform: translateY(-3px); } }
.tp-row.is-buy { border-left-color: var(--up); }
.tp-row.is-sell { border-left-color: var(--down); }
.tp-row.is-buy .tp-side { color: var(--up); }
.tp-row.is-sell .tp-side { color: var(--down); }
.tp-row.is-buy.lv1 { background: rgba(8, 153, 129, 0.06); } .tp-row.is-buy.lv2 { background: rgba(8, 153, 129, 0.14); }
.tp-row.is-buy.lv3 { background: rgba(8, 153, 129, 0.26); } .tp-row.is-buy.lv4 { background: rgba(8, 153, 129, 0.4); font-weight: 600; }
.tp-row.is-sell.lv1 { background: rgba(242, 54, 69, 0.06); } .tp-row.is-sell.lv2 { background: rgba(242, 54, 69, 0.14); }
.tp-row.is-sell.lv3 { background: rgba(242, 54, 69, 0.26); } .tp-row.is-sell.lv4 { background: rgba(242, 54, 69, 0.4); font-weight: 600; }
.tp-row.is-liq { font-weight: 600; }
.tp-ex { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; }
.tp-mk { color: var(--text-3); font-size: 11px; }
.tp-age { color: var(--text-3); }
.tp-empty { padding: 16px 12px; color: var(--text-3); font-size: 12px; margin: 0; }
.ex-ico { width: 16px; height: 16px; border-radius: var(--r4, 4px); display: inline-grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 700; flex: 0 0 auto; }
.ex-bn { background: #f0b90b; color: #111; } .ex-okx { background: #e8e8e8; color: #000; } .ex-by { background: #f7a600; color: #111; }
.ex-bg { background: #00e5f0; color: #032; } .ex-hl { background: #97fce4; color: #042; }
.ex-gt { background: #2354e6; color: #fff; } .ex-mx { background: #1f6fff; color: #fff; } .ex-cb { background: #0052ff; color: #fff; } .ex-up { background: #093687; color: #fff; }
.tp-exbtn { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; padding: 2px 6px; border-radius: var(--r4, 4px); font-size: 12px; color: var(--text-3); white-space: nowrap; }
.tp-exbtn:hover { background: var(--hover); color: var(--text); }

/* ---------- 오른쪽 위젯 ---------- */
.tv-widgetbar { width: 45px; display: flex; flex-direction: column; align-items: center; padding: 4px 0; gap: 2px; }
.tv-wb { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r4, 4px); color: var(--text-2); }
.tv-wb:hover { background: var(--hover); color: var(--text); }
.tv-wb.is-on { color: var(--accent-text); background: var(--accent-soft); }
.tv-wb-dot { position: absolute; right: 9px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.tv-wb-sep { width: 28px; height: 1px; background: var(--line); margin: 4px 0; }
.tv-widget { width: 320px; position: relative; display: flex; flex-direction: column; min-height: 0; }
.wp-resizer { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 3; }
.wp-body { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.wp-head { flex: 0 0 44px; height: 44px; display: flex; align-items: center; gap: 2px; padding: 0 6px 0 10px; }
.wp-title { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 15px; padding: 4px 6px; border-radius: var(--r4, 4px); }
.wp-title:not(.is-static):hover { background: var(--hover); }
.wp-empty { padding: 18px 14px; color: var(--text-3); font-size: 13px; margin: 0; }
.tv-icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r4, 4px); color: var(--text-2); flex: 0 0 auto; }
.tv-icon-btn:hover { background: var(--hover); color: var(--text); }
.wl-cols, .wl-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 0.8fr); gap: 6px; align-items: center; padding: 0 10px 0 12px; }
.wl-cols { flex: 0 0 28px; height: 28px; font-size: 12px; color: var(--text-3); border-bottom: 1px solid var(--line); }
.wl-cols > * { text-align: right; font-size: 12px; color: var(--text-3); }
.wl-cols > :first-child { text-align: left; }
.wl-cols button:hover { color: var(--text); }
.wl-body { flex: 1 1 auto; overflow-y: auto; min-height: 60px; }
.wl-row { position: relative; height: 32px; font-size: 13px; cursor: pointer; }
.wl-row:hover { background: var(--hover); }
.wl-row.is-cur { background: var(--accent-soft); }
.wl-row > span:not(:first-child) { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-row .tv-sym-ic { position: absolute; left: 8px; top: 7px; }
.wl-row .wl-sym { padding-left: 24px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.wl-sym small { font-weight: 400; color: var(--text-3); margin-left: 2px; font-size: 11px; }
.wl-x { position: absolute; right: 2px; top: 7px; width: 18px; height: 18px; display: none; place-items: center; border-radius: var(--r3, 3px); background: var(--panel); color: var(--text-3); }
.wl-row:hover .wl-x { display: grid; }
.wl-x:hover { color: var(--down); }
.tv-sym-ic { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; flex: 0 0 auto; }
.tv-sym-ic.is-lg { width: 36px; height: 36px; font-size: 16px; }
.h0 { background: #f7931a; } .h1 { background: #627eea; } .h2 { background: #14b8a6; } .h3 { background: #e84142; } .h4 { background: #8247e5; } .h5 { background: #f3ba2f; color: #111; }
.h6 { background: #23292f; } .h7 { background: #2a5ada; } .h8 { background: #c2a633; } .h9 { background: #00aae4; } .h10 { background: #e6007a; } .h11 { background: #3c3c3d; }
.wl-details { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 12px 14px 14px; max-height: 58%; overflow-y: auto; }
.wd-top { display: flex; gap: 10px; align-items: center; }
.wd-sym { font-size: 15px; }
.wd-desc { font-size: 12px; color: var(--text-3); }
.wd-price { margin-top: 10px; display: flex; align-items: baseline; gap: 6px; }
.wd-price b { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wd-q { font-size: 12px; color: var(--text-3); }
.wd-chg { font-size: 14px; font-variant-numeric: tabular-nums; }
.wd-live { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); margin-top: 4px; }
.wd-range { margin-top: 12px; }
.wd-range-bar { position: relative; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--down), var(--warn), var(--up)); }
.wd-range-bar i { position: absolute; top: -4px; width: 2px; height: 12px; background: var(--text); margin-left: -1px; }
.wd-range-lab { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 4px; font-variant-numeric: tabular-nums; }
.wd-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 12px; font-size: 12px; }
.wd-stats div { display: flex; flex-direction: column; }
.wd-stats span { color: var(--text-3); }
.wd-stats b { font-weight: 600; font-variant-numeric: tabular-nums; }
.wd-head { margin-top: 14px; font-weight: 600; font-size: 13px; }
.wd-perf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; }
.wd-perf div { border-radius: var(--r4, 4px); padding: 6px 4px; text-align: center; background: var(--panel-2); display: flex; flex-direction: column; font-size: 11px; color: var(--text-3); }
.wd-perf b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wd-perf .is-up { background: rgba(8, 153, 129, 0.12); }
.wd-perf .is-down { background: rgba(242, 54, 69, 0.12); }
.wd-perf .is-up b { color: var(--up); }
.wd-perf .is-down b { color: var(--down); }
.hot-tabs { display: flex; gap: 2px; padding: 0 8px 8px; flex-wrap: wrap; }
.hot-tabs.is-head { padding: 0; }
.hot-tabs button { height: 28px; padding: 0 10px; border-radius: var(--r14, 14px); font-size: 13px; color: var(--text-2); }
.hot-tabs button:hover { background: var(--hover); }
.hot-tabs button.is-on { background: var(--surface); color: var(--text); font-weight: 600; }
.tree-body, .al-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding-bottom: 12px; }
.tree-sec { padding: 10px 14px 4px; font-size: 11px; color: var(--text-3); }
.tree-row { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 14px; font-size: 13px; cursor: default; }
.tree-row[data-td] { cursor: pointer; }
.tree-row:hover { background: var(--hover); }
.tree-row.is-sel { background: var(--accent-soft); }
.tree-row.is-off .tree-name { opacity: 0.45; }
.tree-ic { color: var(--text-3); display: grid; }
.tree-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 14px; font-size: 13px; }
.dw-row span { color: var(--text-3); }
.dw-row b { font-weight: 400; font-variant-numeric: tabular-nums; }
.al-row { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); }
.al-row.is-off { opacity: 0.55; }
.al-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.al-main small, .al-log small { color: var(--text-3); font-size: 11px; }
.al-log { display: flex; flex-direction: column; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.al-clear { margin: 10px 14px; }
.al-search { display: flex; align-items: center; gap: 6px; margin: 6px 12px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r6); color: var(--text-3); }
.al-search input { flex: 1 1 auto; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; padding: 6px 0; outline: none; }
.al-dlg .tv-field { align-items: start; }
.al-dlg .tv-field > span:first-child { padding-top: 7px; }
.al-help { color: var(--text-3); font-size: 11px; line-height: 1.5; word-break: break-all; }
.al-unit { color: var(--text-2); font-size: 13px; }
.tv-field-row .tv-input.al-bars { flex: 0 0 72px; }

/* ---------- 메뉴 · 말풍선 · 알림 띠 ---------- */
.tv-menu {
  position: fixed; z-index: 100; min-width: 200px; max-width: min(420px, calc(100vw - 12px)); max-height: calc(100vh - 12px); overflow-y: auto;
  padding: 6px 0; background: var(--panel); color: var(--text); border-radius: var(--r6, 6px); box-shadow: var(--shadow); border: 1px solid var(--line);
}
.tv-menu.is-wide { min-width: 260px; }
.tv-menu.is-iv { min-width: 200px; }
.tv-menu.is-main { min-width: 260px; }
.tv-menu-item { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 12px 0 10px; text-align: left; font-size: 14px; }
.tv-menu-item:hover, .tv-menu-item:focus-visible { background: var(--hover); outline: none; }
.tv-menu-item.is-active { background: var(--accent-soft); color: var(--accent-text); }
.tv-menu-item.is-danger { color: var(--down); }
.tv-menu-ic { width: 28px; display: grid; place-items: center; color: var(--text-2); flex: 0 0 auto; }
.tv-menu-item.is-active .tv-menu-ic { color: var(--accent-text); }
.tv-menu-label { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-menu-hint { color: var(--text-3); font-size: 12px; white-space: nowrap; display: inline-flex; }
.tv-menu-star { width: 24px; height: 24px; display: grid; place-items: center; color: var(--text-4); border-radius: var(--r3, 3px); opacity: 0; }
.tv-menu-item:hover .tv-menu-star, .tv-menu-star.is-on { opacity: 1; }
.tv-menu-star.is-on { color: #f5b800; }
.tv-menu-star.is-on svg { fill: currentColor; }
.tv-menu-star:hover { background: var(--active); }
.tv-menu-sep { height: 1px; background: var(--line); margin: 6px 0; }
.tv-menu-head { padding: 8px 14px 4px; font-size: 11px; color: var(--text-3); text-transform: none; }
.tv-fly .tv-menu-item { min-height: 36px; }
.tv-fly.is-emoji { width: 340px; }
.tv-emoji-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; padding: 0 8px 6px; }
.tv-em { height: 34px; border-radius: var(--r4, 4px); font-size: 20px; }
.tv-em:hover { background: var(--hover); }
.tv-switch { width: 30px; height: 16px; border-radius: var(--r8, 8px); background: var(--line-2); position: relative; display: inline-block; }
.tv-switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.tv-switch.is-on { background: var(--accent); }
.tv-switch.is-on::after { transform: translateX(14px); }
.tv-tip {
  position: fixed; z-index: 120; pointer-events: none; padding: 5px 9px; border-radius: var(--r4, 4px); font-size: 12px; line-height: 1.3;
  background: var(--tip-bg); color: var(--tip-fg); white-space: nowrap; max-width: 320px; opacity: 0; transition: opacity 0.08s;
}
.tv-tip.is-on { opacity: 1; }
.tv-tip-key { margin-left: 8px; opacity: 0.6; }
.tv-toasts { position: fixed; z-index: 130; left: 50%; bottom: 56px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.tv-toast { padding: 9px 16px; border-radius: var(--r6, 6px); background: var(--tip-bg); color: var(--tip-fg); font-size: 13px; box-shadow: var(--shadow); transition: opacity 0.3s, transform 0.3s; max-width: calc(100vw - 32px); }
.tv-toast.is-warn { background: var(--warn); color: #111; }
.tv-toast.is-alert { background: #ff9800; color: #111; font-weight: 600; }
.tv-toast.is-out { opacity: 0; transform: translateY(6px); }

/* ---------- 창(모달) ---------- */
.tv-modal-back { position: fixed; inset: 0; z-index: 90; background: var(--overlay); display: grid; place-items: center; padding: 12px; }
.tv-modal { width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 24px); display: flex; flex-direction: column; background: var(--panel); color: var(--text); border-radius: var(--r6, 6px); box-shadow: var(--shadow); }
.tv-modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 10px 20px; }
.tv-modal-title { flex: 1 1 auto; margin: 0; font-size: 18px; font-weight: 600; }
.tv-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 20px 16px; }
.tv-modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.tv-btn { height: 34px; padding: 0 16px; border-radius: var(--r6, 6px); border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.tv-btn:hover { background: var(--hover); }
.tv-btn.is-primary { background: var(--text); color: var(--panel); border-color: var(--text); }
.tv-btn.is-primary:hover { opacity: 0.88; }
.tv-btn.is-ghost { border-color: transparent; color: var(--text-2); }
.tv-btn.is-sym { font-weight: 400; }
.tv-confirm { margin: 6px 0; }
.tv-input { height: 34px; padding: 0 10px; border-radius: var(--r6, 6px); border: 1px solid var(--line-2); background: var(--panel); color: var(--text); min-width: 0; }
.tv-input:focus { border-color: var(--accent); outline: none; }
.tv-textarea { width: 100%; height: auto; padding: 8px 10px; resize: vertical; line-height: 1.4; }
.tv-prompt { width: 100%; }
.tv-select { height: 34px; padding: 0 8px; border-radius: var(--r6, 6px); border: 1px solid var(--line-2); background: var(--panel); color: var(--text); }
.tv-select.is-sm { height: 26px; font-size: 12px; }
.tv-field { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 0; }
.tv-field > span:first-child { color: var(--text-2); font-size: 13px; }
.tv-field-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tv-field-row .tv-input { flex: 1 1 120px; }
.tv-field-col { display: flex; flex-direction: column; gap: 6px; }
.tv-check, .tv-radio { display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; cursor: pointer; }
.tv-check input, .tv-radio input { width: 16px; height: 16px; accent-color: var(--accent); }
.tv-note { font-size: 12px; color: var(--text-3); margin: 8px 0 0; }
.tv-tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -20px 10px; padding: 0 20px; }
.tv-tabbar button { height: 36px; padding: 0 10px; font-size: 14px; color: var(--text-2); box-shadow: inset 0 -2px 0 transparent; }
.tv-tabbar button.is-on { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--text); }
.tv-style-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.tv-style-row .tv-check { flex: 1 1 auto; }
.tv-colorbtn { width: 34px; height: 34px; border-radius: var(--r6, 6px); border: 1px solid var(--line-2); display: grid; place-items: center; flex: 0 0 auto; }
.tv-colorbtn-sw { width: 20px; height: 20px; border-radius: var(--r3, 3px); display: block; border: 1px solid rgba(128, 128, 128, 0.35); }
.tv-levels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin-bottom: 8px; }
.tv-level { display: flex; align-items: center; gap: 6px; }
.tv-level .tv-input { width: 80px; height: 30px; }
.tv-level input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.tv-keys { width: 100%; border-collapse: collapse; font-size: 13px; }
.tv-keys th { text-align: left; font-weight: 400; color: var(--text-2); padding: 6px 0; border-bottom: 1px solid var(--line); }
.tv-keys td { text-align: right; padding: 6px 0; border-bottom: 1px solid var(--line); }
kbd { display: inline-block; padding: 1px 6px; border-radius: var(--r4, 4px); border: 1px solid var(--line-2); font: 12px var(--font); margin-left: 3px; background: var(--panel-2); }

/* 색 고르기 */
.tv-popup { padding: 10px; min-width: 0; }
.tv-color-grid { display: grid; grid-template-columns: repeat(10, 20px); gap: 3px; }
.tv-sw { width: 20px; height: 20px; border-radius: var(--r3, 3px); border: 1px solid rgba(128, 128, 128, 0.3); }
.tv-sw.is-on { outline: 2px solid var(--accent); outline-offset: 1px; }
.tv-color-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--text-3); }
.tv-color-custom { position: relative; width: 24px; height: 24px; border-radius: var(--r4, 4px); border: 1px dashed var(--line-2); display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; }
.tv-color-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tv-range { flex: 1 1 auto; accent-color: var(--accent); }
.tv-color-val { width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.tv-color-row.no-alpha .tv-range, .tv-color-row.no-alpha .tv-color-val, .tv-color-row.no-alpha .tv-color-label { display: none; }

/* 지표 창 */
.tv-modal.is-ind { height: min(640px, calc(100vh - 24px)); }
.tv-modal.is-ind .tv-modal-body { display: flex; flex-direction: column; padding: 0; }
.ind-dlg { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.ind-search, .sym-search { display: flex; align-items: center; gap: 8px; padding: 0 20px; height: 48px; border-bottom: 1px solid var(--line); color: var(--text-3); flex: 0 0 auto; }
.ind-search input, .sym-search input { flex: 1 1 auto; height: 100%; border: 0; background: none; color: var(--text); font-size: 16px; min-width: 0; }
.ind-search input:focus, .sym-search input:focus { outline: none; }
.ind-main { flex: 1 1 auto; min-height: 0; display: flex; }
.ind-nav { flex: 0 0 190px; border-right: 1px solid var(--line); overflow-y: auto; padding: 8px 0; }
.ind-nav button { width: 100%; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 16px; font-size: 14px; color: var(--text-2); text-align: left; }
.ind-nav button:hover { background: var(--hover); color: var(--text); }
.ind-nav button.is-on { background: var(--accent-soft); color: var(--accent-text); }
.ind-nav-head { padding: 12px 16px 4px; font-size: 11px; color: var(--text-3); }
.ind-list { flex: 1 1 auto; overflow-y: auto; padding: 4px 0 12px; }
.ind-list-head { padding: 10px 20px 6px; font-size: 11px; color: var(--text-3); }
.ind-row { display: flex; align-items: center; }
.ind-row:hover { background: var(--hover); }
.ind-add { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px 0 20px; text-align: left; min-width: 0; }
.ind-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.ind-count { font-size: 11px; color: var(--accent-text); white-space: nowrap; }
.ind-where { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.ind-star { width: 36px; height: 36px; display: grid; place-items: center; color: var(--text-4); opacity: 0; }
.ind-row:hover .ind-star, .ind-star.is-on { opacity: 1; }
.ind-star.is-on { color: #f5b800; }
.ind-star.is-on svg { fill: currentColor; }
.ind-empty { padding: 20px; color: var(--text-3); margin: 0; font-size: 13px; }

/* 종목 찾기 · 빠른 찾기 */
.tv-modal.is-sym { height: min(640px, calc(100vh - 24px)); }
.tv-modal.is-sym .tv-modal-body, .tv-modal.is-quick .tv-modal-body { display: flex; flex-direction: column; padding: 0; }
.sym-dlg, .quick-dlg { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.sym-tabs { display: flex; gap: 4px; padding: 10px 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; flex: 0 0 auto; }
.sym-tabs button { height: 28px; padding: 0 12px; border-radius: var(--r14, 14px); font-size: 13px; color: var(--text-2); white-space: nowrap; }
.sym-tabs button:hover { background: var(--hover); }
.sym-tabs button.is-on { background: var(--surface); color: var(--text); font-weight: 600; }
.sym-list, .quick-list { flex: 1 1 auto; overflow-y: auto; }
.sym-row, .quick-row { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 20px; cursor: pointer; border-bottom: 1px solid var(--line); }
.sym-row:hover, .sym-row.is-sel, .quick-row:hover, .quick-row.is-sel { background: var(--hover); }
.sym-row .tv-sym-ic { width: 24px; height: 24px; font-size: 12px; }
.sym-name { font-weight: 600; min-width: 110px; }
.sym-name mark { background: none; color: var(--accent-text); }
.sym-desc { flex: 1 1 auto; color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sym-chg { font-size: 12px; font-variant-numeric: tabular-nums; width: 64px; text-align: right; }
.sym-type { font-size: 12px; color: var(--text-3); }
.sym-ex { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); }
.sym-empty { padding: 20px; color: var(--text-3); margin: 0; }
.tv-modal.is-quick { margin-top: -20vh; }
.quick-row span:first-of-type { flex: 1 1 auto; }
.quick-kind { font-size: 11px; color: var(--text-3); }
.tv-modal.is-ivbox .tv-modal-body { padding-bottom: 18px; }
.ivbox-in { width: 100%; font-size: 22px; height: 46px; text-align: center; }
.ivbox-hint { font-size: 12px; color: var(--text-3); margin: 8px 0 0; text-align: center; }
.ivbox-prev { font-size: 14px; margin: 6px 0 0; text-align: center; color: var(--accent-text); min-height: 1.3em; }

/* 차트 설정 */
.tv-modal.is-settings { height: min(600px, calc(100vh - 24px)); }
.tv-modal.is-settings .tv-modal-body { padding: 0; display: flex; }
.set-dlg { display: flex; flex: 1 1 auto; min-height: 0; }
.set-nav { flex: 0 0 160px; border-right: 1px solid var(--line); padding: 8px 0; display: flex; flex-direction: column; }
.set-nav button { height: 38px; padding: 0 18px; text-align: left; font-size: 14px; color: var(--text-2); }
.set-nav button:hover { background: var(--hover); }
.set-nav button.is-on { background: var(--accent-soft); color: var(--accent-text); }
.set-pane { flex: 1 1 auto; overflow-y: auto; padding: 6px 20px 16px; }
.set-pane .tv-check { display: flex; }
.set-head { font-size: 12px; color: var(--text-3); margin: 14px 0 4px; text-transform: none; }
.tv-tabs-dlg .tv-tabpane { padding-top: 2px; }

/* ---------- 선택한 드로잉 편집 막대 · 즐겨찾기 막대 · 리플레이 ---------- */
.tv-drawbar, .tv-favbar, .tv-replaybar {
  position: absolute; z-index: 6; display: flex; align-items: center; gap: 1px; padding: 3px; background: var(--panel); border-radius: var(--r6, 6px); box-shadow: var(--shadow); border: 1px solid var(--line);
}
.tv-drawbar { top: 44px; left: 50%; transform: translateX(-50%); }
.tv-favbar { position: fixed; z-index: 40; }
.tv-favbar .tv-tool { width: 34px; height: 34px; }
.tv-favbar .tv-tool svg { width: 24px; height: 24px; }
.tv-drawbar-handle, .tv-favbar-handle { width: 18px; height: 30px; display: grid; place-items: center; color: var(--text-3); cursor: grab; }
.tv-eb { height: 30px; min-width: 30px; padding: 0 5px; border-radius: var(--r4, 4px); display: inline-flex; align-items: center; justify-content: center; gap: 5px; position: relative; color: var(--text); font-size: 13px; }
.tv-eb:hover { background: var(--hover); }
.tv-eb.is-on { color: var(--accent-text); }
.tv-eb-sw { position: absolute; left: 6px; right: 6px; bottom: 2px; height: 3px; border-radius: 1px; }
.tv-eb-t { font-weight: 700; font-size: 15px; }
.tv-eb-line { display: inline-block; width: 18px; background: currentColor; border-radius: 1px; }
.tv-eb-line.w1 { height: 1px; } .tv-eb-line.w2 { height: 2px; } .tv-eb-line.w3 { height: 3px; } .tv-eb-line.w4 { height: 4px; }
.tv-eb-dash { display: inline-block; width: 22px; height: 0; border-top: 2px solid currentColor; }
.tv-eb-dash.is-dashed { border-top-style: dashed; }
.tv-eb-dash.is-dotted { border-top-style: dotted; }
.tv-eb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 3px; }
.tv-replaybar { left: 50%; bottom: 46px; transform: translateX(-50%); }
.tv-rb { height: 32px; min-width: 32px; padding: 0 6px; border-radius: var(--r4, 4px); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); white-space: nowrap; }
.tv-rb:hover { background: var(--hover); }
.tv-rb-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.is-dragging-ui, .is-dragging-ui * { user-select: none; }

/* ---------- 공통 작은 부품 ---------- */
.tv-chip { height: 26px; padding: 0 10px; border-radius: var(--r14, 14px); border: 1px solid var(--line-2); font-size: 12px; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.tv-chip:hover { background: var(--hover); color: var(--text); }
.tv-chip.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.tv-btn.is-sm { height: 28px; padding: 0 10px; font-size: 12px; gap: 4px; }
.mk-note { font-size: 12px; color: var(--text-3); margin: 8px 0 0; line-height: 1.5; padding: 0 2px; }
.mk-check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; cursor: pointer; }
.mk-check input { accent-color: var(--accent); }
.mk-check em { font-style: normal; color: var(--text-3); font-size: 12px; }
.mk-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; margin: 0 0 8px; }

/* ---------- 차트 탭 ---------- */
.tv-tabs { grid-area: tabs; display: flex; align-items: stretch; min-width: 0; overflow: hidden; }
.tv-tabs-in { display: flex; align-items: stretch; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tv-tabs-in::-webkit-scrollbar { display: none; }
.tv-tab { display: flex; align-items: center; gap: 6px; padding: 0 4px 0 10px; height: 30px; max-width: 300px; border-radius: var(--r4, 4px) var(--r4, 4px) 0 0; background: var(--panel-2); color: var(--text-2); font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.tv-tab:hover { background: var(--hover); color: var(--text); }
.tv-tab.is-on { background: var(--panel); color: var(--text); }
.tv-tab-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.tv-tab-iv { color: var(--text-3); }
.tv-tab-ch { font-size: 11.5px; }
.tv-tab-n { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; color: var(--text-3); }
.tv-tab-x { width: 22px; height: 22px; border-radius: var(--r3, 3px); display: grid; place-items: center; color: var(--text-3); }
.tv-tab-x:hover { background: var(--active); color: var(--text); }
.tv-tab-add, .tv-tab-hide { width: 30px; height: 30px; display: grid; place-items: center; color: var(--text-3); border-radius: var(--r4, 4px); }
.tv-tab-add:hover, .tv-tab-hide:hover { background: var(--hover); color: var(--text); }

/* ---------- 멀티 차트 ---------- */
.tv-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); position: relative; }
.tv-grid > .tv-chart, .tv-cell { min-width: 0; min-height: 0; }
.tv-grid.is-multi { gap: 1px; background: var(--gap); }
.tv-grid.is-multi > .tv-chart { background: var(--panel); }
.tv-grid.is-multi > .tv-chart.is-active::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--accent); pointer-events: none; z-index: 30; }
.tv-cell { border: 0; width: 100%; height: 100%; display: block; background: var(--panel); }
.mc-pop { padding: 12px; width: 262px; }
.mc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.mc-lay { height: 34px; border-radius: var(--r4, 4px); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-2); }
.mc-lay:hover { background: var(--hover); }
.mc-lay.is-on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.mc-lay svg rect, .tv-multibtn svg rect { fill: none; stroke: currentColor; stroke-width: 1.3; }
.tv-multibtn svg { width: 22px; height: 18px; }
/* 칸 모드: 차트만 */
.is-cell .tv, .is-cell.has-tabs .tv { grid-template-columns: 0 minmax(0, 1fr) 0; grid-template-rows: 0 minmax(0, 1fr); grid-template-areas: "top top top" "left center right"; gap: 0; padding: 0; }
.is-cell .tv-top, .is-cell .tv-left, .is-cell .tv-right, .is-cell .tv-bottom, .is-cell .tv-bottombar, .is-cell .tv-tabs, .is-cell .tv-replaybar, .is-cell .tv-navbtns, .is-cell .tv-toasts { display: none !important; }
.is-cell .tv-chartcard { border-radius: 0; }

/* ---------- 시장 온도 · 평소 대비 ---------- */
.tv-market { display: flex; align-items: center; }
.tv-tb.tv-heat span, .tv-tb.tv-norm span { font-size: 13px; }
.tv-heat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-4); display: inline-block; flex: 0 0 auto; }
.lv-calm .tv-heat-dot { background: #5d8cff; }
.lv-normal .tv-heat-dot { background: #8c8c8c; }
.lv-active .tv-heat-dot { background: #ff9800; }
.lv-hot .tv-heat-dot { background: #f23645; box-shadow: 0 0 0 3px rgba(242, 54, 69, 0.25); }
.tv-norm.is-warn { color: #ff9800; }
.heat-active .tv-chartcard { outline: 2px solid rgba(255, 152, 0, 0.75); outline-offset: -2px; }
.heat-hot .tv-chartcard { outline: 2px solid rgba(242, 54, 69, 0.85); outline-offset: -2px; }
.mk-pop { padding: 12px; width: 300px; max-width: calc(100vw - 24px); }
.mk-pop.is-wide { width: 640px; }
.mk-heat-big { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 700; margin: 4px 0 8px; }
.mk-heat-big .tv-heat-dot { width: 12px; height: 12px; }
.mk-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 8px; font-size: 13px; }
.mk-dl dt { color: var(--text-3); }
.mk-dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.mk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mk-card { border: 1px solid var(--line); border-radius: var(--r6, 6px); padding: 8px; text-align: center; }
.mk-card.is-off { border-color: rgba(255, 152, 0, 0.6); background: rgba(255, 152, 0, 0.06); }
.mk-card-name { font-size: 12px; color: var(--text-2); }
.mk-card svg { display: block; margin: 2px auto 0; }
.mk-card-val { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mk-card-say { font-size: 12px; color: var(--text-2); }
.mk-card.is-off .mk-card-say { color: #ff9800; }
.mk-card-sub { font-size: 11px; color: var(--text-3); }
.g-track { fill: none; stroke: var(--line-2); stroke-width: 8; stroke-linecap: round; }
.g-usual { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; opacity: 0.55; }
.g-needle { stroke: var(--text); stroke-width: 2.2; stroke-linecap: round; }
.g-needle.is-off { stroke: #ff9800; }
.g-hub { fill: var(--text); }

/* ---------- 자금 흐름 위젯 ---------- */
.fl-share { padding: 6px 12px 10px; border-bottom: 1px solid var(--line); }
.fl-share-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.fl-share-head b { color: var(--text); font-size: 13px; }
.fl-bar { display: flex; height: 8px; border-radius: var(--r4, 4px); overflow: hidden; background: var(--line); }
.fl-bar i { display: block; height: 100%; }
.fl-b { background: #f7931a; }
.fl-e { background: #627eea; }
.fl-a { background: #26a69a; }
.fl-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; }
.fl-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.fl-legend em { font-style: normal; color: var(--text-3); }
.fl-sort { display: flex; align-items: center; gap: 6px; padding: 8px 12px; font-size: 12px; color: var(--text-3); }
.fl-cols, .fl-row { display: grid; grid-template-columns: minmax(0, 1fr) 50px 46px 52px 46px; gap: 4px; align-items: center; padding: 0 12px; }
.fl-cols { flex: 0 0 24px; height: 24px; font-size: 11px; color: var(--text-3); border-bottom: 1px solid var(--line); }
.fl-cols span:nth-child(n + 2), .fl-row > span:nth-child(n + 2) { text-align: right; }
.fl-row { width: 100%; min-height: 34px; font-size: 12px; text-align: left; }
.fl-row:hover { background: var(--hover); }
.fl-sym { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 6px; align-items: center; min-width: 0; padding: 3px 0; }
.fl-sym .tv-sym-ic { grid-row: 1 / 3; }
.fl-sym b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-kind { justify-self: start; font-style: normal; font-size: 10px; padding: 0 4px; border-radius: var(--r3, 3px); background: var(--hover); white-space: nowrap; }
.fl-kind.is-up { color: var(--up); }
.fl-kind.is-down { color: var(--down); }
.fl-kind.is-fade-up { color: var(--up); opacity: 0.7; }
.fl-kind.is-fade-down { color: var(--down); opacity: 0.7; }
.wp-body > .mk-note { padding: 0 12px 12px; }

/* ---------- 스케치 모드 ---------- */
.tv-sketchbar { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 8px; padding: 3px 3px 3px 12px; background: var(--accent); color: #fff; border-radius: var(--r14, 14px); font-size: 13px; box-shadow: var(--shadow); white-space: nowrap; }
.tv-sketchbar .tv-btn { height: 26px; border-color: rgba(255, 255, 255, 0.6); color: #fff; }
.tv-sketchbar .tv-btn:hover { background: rgba(255, 255, 255, 0.15); }

/* ---------- 테마 꾸미기 ---------- */
.th-dlg { display: flex; flex-direction: column; gap: 14px; }
.th-label { font-size: 13px; color: var(--text-2); margin-bottom: 6px; display: flex; gap: 8px; }
.th-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.th-preset { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r6, 6px); font-size: 13px; }
.th-preset:hover { background: var(--hover); }
.th-preset.is-on { border-color: var(--accent); background: var(--accent-soft); }
.th-swatch { display: flex; gap: 3px; }
.th-swatch i { width: 16px; height: 16px; border-radius: var(--r3, 3px); border: 1px solid rgba(128, 128, 128, 0.35); }
.th-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.th-colors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.th-color { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.th-dlg .tv-range { width: 100%; }

/* ---------- 모의 투자 ---------- */
.pt-acct { padding: 2px 12px 10px; border-bottom: 1px solid var(--line); }
.pt-eq { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pt-eq span { font-size: 12px; color: var(--text-3); width: 100%; }
.pt-eq b { font-size: 20px; font-variant-numeric: tabular-nums; }
.pt-eq small { color: var(--text-3); }
.pt-eq em { font-style: normal; font-size: 13px; }
.pt-kv { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 2px 8px; font-size: 12px; margin-top: 6px; }
.pt-kv span { color: var(--text-3); }
.pt-kv b { font-weight: 600; text-align: right; }
.pt-form { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.pt-symrow { display: flex; align-items: center; font-size: 13px; }
.pt-px { font-weight: 600; }
.pt-types, .pt-pcts { display: flex; gap: 6px; }
.pt-types .tv-chip, .pt-pcts .tv-chip { flex: 1 1 0; }
.pt-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-3); }
.pt-field .tv-input, .pt-field .tv-select { height: 32px; width: 100%; color: var(--text); }
.pt-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pt-cost { font-size: 11px; color: var(--text-3); min-height: 14px; }
.pt-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pt-buy, .pt-sell { height: 38px; border-radius: var(--r6, 6px); color: #fff; font-weight: 700; font-size: 14px; }
.pt-buy { background: var(--up); }
.pt-sell { background: var(--down); }
.pt-buy:hover, .pt-sell:hover { filter: brightness(1.08); }
.pt-sec { display: flex; align-items: center; gap: 6px; padding: 10px 12px 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.pt-sec em { font-style: normal; color: var(--text-3); font-weight: 400; }
.pt-empty { padding: 4px 12px 8px; margin: 0; font-size: 12px; color: var(--text-3); }
.pt-pos { margin: 4px 12px 8px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r6, 6px); }
.pt-pos-top { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.pt-pos-top em { font-style: normal; font-size: 12px; font-weight: 600; }
.pt-grid { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; font-size: 12px; margin: 6px 0; }
.pt-grid span { color: var(--text-3); }
.pt-grid b { font-weight: 500; text-align: right; }
.pt-pos-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.pt-pos-btns .tv-btn { flex: 1 1 auto; justify-content: center; }
.pt-ord { display: flex; align-items: center; gap: 6px; justify-content: space-between; padding: 4px 12px; font-size: 12px; }
.pt-ord em { font-style: normal; }
.pt-hist { padding: 0 12px; }
.pt-h { display: grid; grid-template-columns: 70px 1fr auto auto; gap: 6px; font-size: 11.5px; padding: 3px 0; border-bottom: 1px solid var(--line); align-items: center; }
.pt-h em { font-style: normal; }
.pt-h b { font-weight: 600; text-align: right; min-width: 56px; }

/* ---------- 연습 모드 ---------- */
.tr-bar { position: absolute; z-index: 8; left: 50%; bottom: 46px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 3px 3px 3px 10px; background: var(--panel); border: 1px solid var(--accent); border-radius: var(--r6, 6px); box-shadow: var(--shadow); max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; }
.tr-info { font-size: 12.5px; color: var(--text-2); margin-right: 6px; white-space: nowrap; }
.tr-info b { color: var(--text); }
.is-training .tv-symbtn, .is-training .tv-top [data-act="compare"], .is-training .tv-ivs, .is-training .tv-top [data-act="intervals"], .is-training .tv-top [data-act="alert"],
.is-training .tv-top [data-act="replay"], .is-training .tv-market, .is-training .tv-layoutbtn, .is-training .tv-multibtn, .is-training .tv-top [data-act="quick"],
.is-training .tv-bottom, .is-training .tv-tabs, .is-training .tv-ranges, .is-training .tv-bottombar [data-act="goto"] { display: none !important; }
.is-training .tv-wb:not([data-w="paper"]):not([data-w="help"]) { display: none; }
.is-training.has-tabs .tv { grid-template-rows: calc(38px * var(--uiz, 1)) minmax(0, 1fr); grid-template-areas: "top top top" "left center right"; }
.is-training .tv-top [data-act="train"] { color: var(--accent-text); }
.tr-lead { margin: 0 0 4px; color: var(--text-2); font-size: 13px; line-height: 1.6; }
.tr-sec { font-size: 12px; font-weight: 600; color: var(--text-3); margin: 12px 0 6px; }
.tr-scenes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tr-scene { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r6, 6px); text-align: left; }
.tr-scene:hover { border-color: var(--accent); background: var(--accent-soft); }
.tr-scene b { font-size: 13px; }
.tr-scene span { font-size: 12px; color: var(--text-2); }
.tr-scene em { font-style: normal; font-size: 11px; color: var(--text-3); }
.tr-scene.is-rand { border-style: dashed; }
.tr-free { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 8px; align-items: end; }
.tr-free .tv-field { grid-template-columns: 1fr; gap: 4px; padding: 0; }
.tr-res { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pt-sum > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.pt-sum > div > span { color: var(--text-2); }
.pt-sum .is-up { color: var(--up); } .pt-sum .is-down { color: var(--down); }
.tr-card, .tr-reveal { border: 1px solid var(--line); border-radius: var(--r8, 8px); padding: 12px; }
.tr-ret { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tr-bal { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.tr-dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12px; margin: 0; }
.tr-dl dt { color: var(--text-3); }
.tr-dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.tr-reveal { font-size: 13px; line-height: 1.55; }
.tr-reveal .tr-sec { margin-top: 0; }
.tr-reveal p { margin: 6px 0 0; color: var(--text-2); }
.tr-why { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.65; color: var(--text-2); }

/* ---------- 자동 작도 ---------- */
.ad-panel { position: absolute; z-index: 8; top: 64px; left: 8px; width: 340px; max-width: calc(100% - 100px); max-height: calc(100% - 70px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r8, 8px); box-shadow: var(--shadow); padding: 2px 12px 12px; }
.ad-head { display: flex; align-items: center; gap: 2px; height: 38px; }
.ad-head b { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.ad-styles { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ad-sum { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.ad-sum ul { margin: 4px 0 0; padding-left: 16px; }
.ad-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; margin: 8px 0; padding: 4px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ad-btns { display: flex; align-items: center; gap: 8px; }
.ad-set .mk-check { padding: 6px 0; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 1100px) {
  .tv-widget { position: fixed; right: 49px; top: 42px; bottom: 4px; z-index: 60; box-shadow: var(--shadow); }
}
@media (max-width: 760px) {
  .tv { grid-template-columns: 40px minmax(0, 1fr) 40px; }
  .tv-tgroup { width: 40px; }
  .tv-tool { width: 34px; height: 34px; }
  .tv-tool-more { width: 8px; }
  .tv-tool svg { width: 24px; height: 24px; }
  .tv-menubtn { width: 40px; flex-basis: 40px; }
  .tv-widgetbar { width: 40px; }
  .tv-wb { width: 38px; height: 40px; }
  .tv-widget { right: 44px; width: min(320px, calc(100vw - 56px)) !important; }
  .tv-layoutbtn .tv-tb.is-label span, .tv-tb.is-label span { display: none; }
  .tv-legend { right: 78px; font-size: 11.5px; }
  .lg-series { font-size: 11.5px; }
  .lg-title { font-size: 12.5px; }
  .lg-vals { flex-wrap: wrap; }
  /* 시장 칸은 머리줄·행 모두 빼고 5칸으로 (하나만 숨기면 칸이 밀려 글자가 겹친다) */
  .tp-cols, .tp-row { grid-template-columns: minmax(0, 1fr) 46px 72px 50px 28px; gap: 4px; padding: 0 8px; }
  .tp-cols span:nth-child(2), .tp-mk, .tp-sym, .tp-lead { display: none; }
  .tp-p { min-width: 0; }
  .tp-meter { min-width: 36px; }
  .has-tabs .tv { grid-template-rows: 38px minmax(0, 1fr); grid-template-areas: "top top top" "left center right"; }
  .tv-tabs { display: none !important; }
  .mk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-pop.is-wide { width: calc(100vw - 24px); }
  .tr-scenes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-free { grid-template-columns: 1fr 1fr; }
  .tr-res { grid-template-columns: 1fr; }
  .th-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ad-panel { left: 8px; right: 8px; width: auto; max-width: none; }
  .ind-nav { flex-basis: 120px; }
  .set-nav { flex-basis: 110px; }
  .tv-field { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- 루미포켓 홈 로고 (위 막대 왼쪽 끝) ---------- */
.tv-home { padding: 0 4px; margin-left: 4px; }
.tv-logo { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--text); color: var(--panel); }

/* ---------- 설정 파일 불러오기 확인 ---------- */
.tv-confirm.is-sub { font-size: 13px; line-height: 1.55; color: var(--text-2); }

/* ---------- 처음 온 사람 안내 ---------- */
.tv-welcome .tv-modal-body { padding: 32px 28px 22px; text-align: center; word-break: keep-all; }
.wl-mark { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; background: var(--text); color: var(--panel); }
.wl-title { margin: 0 0 8px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.wl-lead { margin: 0 0 22px; color: var(--text-2); font-size: 14px; line-height: 1.6; }
.wl-acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.wl-btn { height: 44px; min-width: 150px; padding: 0 22px; font-size: 15px; justify-content: center; }
a.wl-btn { color: var(--text); text-decoration: none; }
a.wl-btn:hover { background: var(--hover); }
.wl-note { margin: 18px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-3); }
.wl-note a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 가끔 백업 권하기 ---------- */
.tv-nudge { position: fixed; z-index: 80; left: 50%; bottom: 56px; transform: translateX(-50%); width: min(480px, calc(100vw - 24px)); display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r6, 6px); box-shadow: var(--shadow); word-break: keep-all; }
.tv-nudge-txt { flex: 1 1 auto; display: grid; gap: 3px; font-size: 14px; }
.tv-nudge-txt span { font-size: 12px; line-height: 1.5; color: var(--text-2); }
.tv-nudge-acts { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; }

/* ---------- 화면 정리 (Ctrl+0): 막대·패널을 숨기고 차트만 ---------- */
body.is-clean .tv, body.is-clean.has-tabs .tv { grid-template-columns: 0 minmax(0, 1fr) 0; grid-template-rows: 0 minmax(0, 1fr); grid-template-areas: "top top top" "left center right"; }
body.is-clean .tv-top, body.is-clean .tv-left, body.is-clean .tv-right, body.is-clean .tv-bottom, body.is-clean .tv-tabs { display: none !important; }

/* ---------- 그리기 보조 (아래 막대) ---------- */
.tv-modes { display: flex; align-items: center; }
.tv-mode { font-size: 12px; color: var(--text-3); }
.tv-mode.is-on { color: var(--accent-text); font-weight: 600; }
.tv-keys-note { margin: 0 0 10px; font-size: 12px; color: var(--text-2); word-break: keep-all; }

/* ---------- 계산기 (Ctrl+8) ---------- */
.tv-calc { position: fixed; z-index: 85; right: 72px; top: 96px; width: 248px; padding: 10px; background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r6, 6px); box-shadow: var(--shadow); }
.tv-calc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; cursor: move; user-select: none; }
.tv-calc-win { font-size: 12px; color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.tv-calc-in { width: 100%; font-size: 16px; text-align: right; }
.tv-calc-out { margin: 6px 2px 8px; min-height: 28px; text-align: right; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; word-break: break-all; }
.tv-calc-out.is-bad { color: var(--text-3); }
.tv-calc-keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.tv-calc-keys button { height: 34px; border-radius: var(--r4, 4px); background: var(--surface); color: var(--text); font-size: 15px; }
.tv-calc-keys button:hover { background: var(--active); }
.tv-calc-keys [data-k="="] { background: var(--text); color: var(--panel); }

/* ---------- 여러 개 선택 ---------- */
.tv-eb-count { padding: 0 6px; font-size: 12px; font-weight: 600; color: var(--accent-text); white-space: nowrap; }

/* ---------- 명령줄 (오토캐드식) ---------- */
.tv-cli { position: absolute; z-index: 6; left: 8px; bottom: 30px; max-width: min(560px, calc(100% - 90px)); padding: 4px 8px; border-radius: var(--r4, 4px); background: color-mix(in srgb, var(--panel) 82%, transparent); color: var(--text-2); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; pointer-events: auto; opacity: 0.75; }
.tv-cli.is-open { opacity: 1; box-shadow: var(--shadow); }
.tv-cli-hist div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-3); }
.tv-cli-line { display: flex; align-items: center; min-height: 18px; color: var(--text); font-weight: 600; white-space: nowrap; }
.tv-cli-pr { color: var(--text-2); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.tv-cli-caret { width: 7px; height: 14px; margin-left: 1px; background: var(--text-3); animation: tv-blink 1s steps(1) infinite; }
@keyframes tv-blink { 50% { opacity: 0; } }
.tv-cli-sug { margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.tv-cli-sug div { white-space: nowrap; }
.tv-cli-sug b { display: inline-block; min-width: 42px; color: var(--accent-text); }
.tv-cli-sug i { font-style: normal; color: var(--text-3); }
.tv-cli-sug .is-off { opacity: 0.5; }
.tv-dyn { position: fixed; z-index: 95; padding: 3px 8px; border-radius: var(--r4, 4px); background: var(--panel); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 12px; pointer-events: none; white-space: nowrap; }
.tv-cli-log { max-height: 60vh; overflow: auto; font-size: 13px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.is-picking { cursor: crosshair; }
.is-panning { cursor: grab; }

/* ---------- 조작 방식 고르기 ---------- */
.wl-mode { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; font-size: 13px; color: var(--text-2); }
.wl-mode > span { margin-right: 4px; }
.wl-seg { height: 30px; padding: 0 12px; border-radius: var(--r4, 4px); border: 1px solid var(--line-2); color: var(--text-2); font-size: 13px; }
.wl-seg.is-on { background: var(--text); color: var(--panel); border-color: var(--text); }
.cm-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 6px; }
.cm-opt { display: grid; gap: 6px; padding: 14px; text-align: left; border: 1px solid var(--line-2); border-radius: var(--r6, 6px); color: var(--text); word-break: keep-all; }
.cm-opt:hover { background: var(--hover); }
.cm-opt b { font-size: 15px; }
.cm-opt span { font-size: 12px; line-height: 1.5; color: var(--text-2); }
@media (max-width: 520px) { .cm-opts { grid-template-columns: 1fr; } }

/* ---------- 레이어 · 블록 ---------- */
.ly-top { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ly-list { display: grid; gap: 2px; max-height: 50vh; overflow: auto; }
.ly-row { display: grid; grid-template-columns: 34px minmax(90px, 1fr) 30px 30px 40px 66px 74px 40px 30px; align-items: center; gap: 4px; padding: 3px 4px; border-radius: var(--r4, 4px); }
.ly-row.is-head { font-size: 11px; color: var(--text-3); }
.ly-row.is-cur { background: var(--hover); }
.ly-cur { width: 26px; height: 26px; border-radius: 999px; border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--accent-text); }
.ly-name { height: 28px; font-size: 13px; }
.ly-sw { width: 30px; height: 22px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--r4, 4px); }
.ly-sw i { display: block; width: 100%; height: 100%; border-radius: 2px; }
.ly-own { font-size: 11px; color: var(--text-3); text-align: center; }
.ly-n { font-size: 12px; color: var(--text-2); text-align: right; }
.ly-states { display: grid; gap: 4px; margin-top: 10px; }
.ly-state { display: flex; align-items: center; gap: 6px; }
.ly-state span { flex: 1 1 auto; }
.bk-list { display: grid; gap: 4px; max-height: 50vh; overflow: auto; }
.bk-row { display: flex; align-items: center; gap: 6px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.bk-row > div { flex: 1 1 auto; display: grid; }
.bk-row span { font-size: 12px; color: var(--text-3); }
.tv-layerchip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-layer-dot { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.tv-eb-layer { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
@media (max-width: 760px) { .ly-row { grid-template-columns: 30px minmax(70px, 1fr) 28px 28px 36px 58px 64px 30px 28px; } }

/* ---------- 객체 스냅 설정 ---------- */
.os-dlg { display: grid; gap: 6px; }
