/* z2o-floor checked 2026-11-24 · 레버리지 레이더 v2 */
:root {
  --bg: #05080d;
  --panel: #0a0f17;
  --line: #1a2230;
  --tx: #e6ebf2;
  --mu: #7d8799;
  --dim: #4a5466;
  --up: #34d399;
  --dn: #f2545b;
  --gold: #e9b949;
  --flow: #6aa8ff;
  /* 파생값: 위 토큰의 투명도 변형만 */
  --panel-a: color-mix(in srgb, var(--panel) 84%, transparent);
  --line-a: color-mix(in srgb, var(--line) 70%, transparent);
  --grid: color-mix(in srgb, var(--tx) 4%, transparent);
  --glow: color-mix(in srgb, var(--flow) 7%, transparent);
  --hover: color-mix(in srgb, var(--tx) 5%, transparent);
  --sel: color-mix(in srgb, var(--flow) 12%, transparent);
  --up-a: color-mix(in srgb, var(--up) 14%, transparent);
  --dn-a: color-mix(in srgb, var(--dn) 14%, transparent);
  --gold-a: color-mix(in srgb, var(--gold) 14%, transparent);
  --flow-a: color-mix(in srgb, var(--flow) 14%, transparent);
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --band-h: 48px;
  --notice-h: 24px;
  --dw: 300px;
  --detail-w: 380px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sheet-peek: 52px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--tx);
  font: 13px/1.5 var(--sans);
}
a { color: var(--tx); text-decoration-color: var(--dim); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--mu); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--flow); outline-offset: 2px; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pos { color: var(--up); }
.neg { color: var(--dn); }
.zero { color: var(--mu); }
.gold { color: var(--gold); }
.mu { color: var(--mu); }
.dim { color: var(--dim); }
.skip { position: absolute; left: 8px; top: -40px; background: var(--panel); padding: 4px 8px; border: 1px solid var(--line); z-index: 50; }
.skip:focus { top: 8px; }
.noscript { padding: 16px; color: var(--mu); }

/* ---------- 버튼·세그먼트 ---------- */
.btn {
  background: var(--panel-a); border: 1px solid var(--line); border-radius: 4px;
  padding: 3px 9px; font-size: 12px; cursor: pointer; color: var(--tx);
  transition: border-color .2s, background-color .2s;
}
.btn:hover { border-color: var(--dim); }
.btn.ghost { background: transparent; color: var(--mu); }
.btn.ghost:hover { color: var(--tx); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 3px 10px; cursor: pointer; color: var(--mu); font-size: 12px; transition: color .2s, background-color .2s; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { color: var(--tx); background: var(--hover); }
.seg-s button { padding: 2px 8px; font-size: 11px; }
.tg { display: inline-flex; align-items: center; gap: 5px; background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 2px 6px; color: var(--dim); font-size: 11px; cursor: pointer; transition: color .2s, border-color .2s; }
.tg[aria-pressed="true"] { color: var(--mu); border-color: var(--line); }
.tg i { display: inline-block; width: 16px; height: 0; border-top: 1px dashed currentColor; }
.tg .ln-s { border-top-color: var(--flow); }
.tg .ln-c { border-top: 1px dotted var(--dn); }
.tag { display: inline-block; border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; font-size: 10.5px; color: var(--mu); line-height: 16px; vertical-align: 1px; }
.tag.warn { color: var(--gold); border-color: var(--gold-a); }
.tag.bad { color: var(--dn); border-color: var(--dn-a); }
.tag.ok { color: var(--up); border-color: var(--up-a); }

/* ---------- 상단 띠 ---------- */
#band {
  position: sticky; top: 0; z-index: 30;
  height: var(--band-h); display: flex; align-items: center; gap: 14px;
  padding: 0 16px; background: var(--panel-a); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.b-brand { white-space: nowrap; color: var(--mu); font-size: 13px; }
.b-seg, .b-stats { flex-shrink: 0; }
.b-brand b { color: var(--tx); font-weight: 600; }
.b-scroll {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 0;
  overflow-x: auto; scrollbar-width: none; height: 100%;
}
.b-scroll::-webkit-scrollbar { display: none; }
.b-item { display: flex; align-items: center; gap: 6px; padding: 0 12px; white-space: nowrap; height: 22px; border-left: 1px solid var(--line); font-size: 12px; color: var(--mu); }
.b-item:first-child { border-left: 0; padding-left: 0; }
.b-item b { color: var(--tx); font-weight: 600; }
.b-item .big { font-size: 15px; font-weight: 600; }
.b-item small { font-size: 10.5px; }
.b-stats { display: flex; gap: 6px; white-space: nowrap; }
.b-stat { font-size: 11.5px; color: var(--mu); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; background: transparent; }
.b-stat b { color: var(--tx); font-weight: 500; }
.b-like { cursor: pointer; transition: border-color .2s; }
.b-like:hover { border-color: var(--dim); }
.b-like[aria-pressed="true"] { border-color: var(--gold-a); }
.b-like[aria-pressed="true"] b { color: var(--gold); }

/* 파동 진행 표시 */
.wp { display: flex; align-items: center; gap: 0; list-style: none; margin: 0; padding: 0; }
.wp li { display: flex; align-items: center; gap: 5px; color: var(--dim); font-size: 13px; white-space: nowrap; }
.wp li + li::before { content: ""; display: block; width: 16px; height: 0; border-top: 1px solid var(--line); margin: 0 6px; }
.wp .d { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--dim); }
.wp li.past .d { background: var(--dim); }
.wp li.now { color: var(--tx); font-weight: 600; padding: 1px 9px 1px 7px; border: 1px solid var(--line); border-radius: 10px; }
.wp li.now.k-up { background: var(--up-a); border-color: var(--up); }
.wp li.now.k-dn { background: var(--dn-a); border-color: var(--dn); }
.wp li.now .d { width: 8px; height: 8px; border: 0; }
.wp li.now.k-up .d { background: var(--up); }
.wp li.now.k-dn .d { background: var(--dn); }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 3px; padding: 0 8px; font-size: 13px; line-height: 22px; color: var(--tx); white-space: nowrap; }
.chip.k-dn { border-color: var(--dn-a); color: var(--dn); }
.chip.k-up { border-color: var(--up-a); color: var(--up); }
.chip.k-gold { border-color: var(--gold-a); color: var(--gold); }
/* 10년물: 띠 안에서 가장 큰 숫자 중 하나 */
.b-y10 .y10v { font-size: 17px; font-weight: 600; cursor: help; }
.b-y10 .y10v.neg { color: var(--dn); }
.b-y10 .y10v.gold { color: var(--gold); }
.b-y10 .y10s { color: var(--mu); }
.under { color: var(--gold); font-size: 10.5px; border-bottom: 1px dotted var(--gold-a); cursor: help; }

.notice { margin: 0; height: var(--notice-h); line-height: var(--notice-h); padding: 0 16px; font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice span { margin-left: 8px; }

/* ---------- 메인: 트리 서랍 + 무대 + 상세 ---------- */
#main {
  position: relative;
  display: grid; grid-template-columns: var(--dw) minmax(0, 1fr);
  height: calc(100svh - var(--band-h) - var(--notice-h) - 8px); min-height: 600px;
  margin: 0 12px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
}
#main, #waves, #rates { scroll-margin-top: calc(var(--band-h) + 6px); }
#main.dr-closed { grid-template-columns: 0 minmax(0, 1fr); }
#main.dr-closed #drawer { visibility: hidden; }
#sheet { display: contents; }
.sh-head { display: none; }

#drawer { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--panel-a); }
.dr-head { display: flex; align-items: center; gap: 4px; padding: 8px 10px 6px; border-bottom: 1px solid var(--line); }
.dr-t { flex: 1; min-width: 0; font-size: 12px; color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-head .btn { padding: 1px 6px; font-size: 11px; }
.dr-cols { display: grid; grid-template-columns: minmax(0, 1fr) 58px 50px 42px; gap: 6px; padding: 4px 10px; font-size: 10.5px; color: var(--dim); border-bottom: 1px solid var(--line); }
.dr-cols span:not(:first-child) { text-align: right; }
#tree { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.dr-foot { margin: 0; padding: 6px 10px; font-size: 10.5px; color: var(--dim); border-top: 1px solid var(--line); }
.dr-open { position: absolute; left: 8px; top: 8px; z-index: 6; }

.trow { display: grid; grid-template-columns: minmax(0, 1fr) 58px 50px 42px; gap: 6px; align-items: center; padding: 3px 10px; font-size: 12px; cursor: pointer; border-left: 2px solid transparent; transition: background-color .15s; }
.trow:hover { background: var(--hover); }
.trow.sel { background: var(--sel); border-left-color: var(--flow); }
.trow[hidden] { display: none; }
.trow > span:not(.nm) { text-align: right; }
.trow .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow.etf { padding-top: 7px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.trow.etf .nm b { font-family: var(--mono); }
.trow.hub { color: var(--tx); border-top: 1px solid var(--line-a); }
.trow.hub .chev { display: inline-block; width: 12px; color: var(--dim); transition: transform .2s var(--ease); }
.trow.hub[aria-expanded="true"] .chev { transform: rotate(90deg); }
.trow.stock { color: var(--mu); font-size: 11.5px; padding-left: 24px; }
.trow.stock .tk { font-family: var(--mono); color: var(--tx); margin-right: 6px; }
.trow .ch, .trow .ed { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 11px; }
.trow .ed { color: var(--dim); }
.trow .ed.soon { color: var(--gold); }
.wv { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.wbar { width: 26px; height: 3px; background: var(--line); position: relative; overflow: hidden; }
.wbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: var(--mu); transform-origin: left; }
.sigdot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: var(--mu); }
.sigdot.up { background: var(--up); }
.sigdot.dn { background: var(--dn); }
.cn { font-size: 10px; color: var(--gold); margin-left: 4px; }

/* 무대 */
#stage {
  grid-column: 2; grid-row: 1; position: relative; min-width: 0; min-height: 0; overflow: hidden;
  background: radial-gradient(ellipse 55% 60% at 50% 50%, var(--glow), transparent 70%);
}
#netbox { position: absolute; inset: 0; }
#netbox svg { display: block; width: 100%; height: 100%; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ov { position: absolute; z-index: 4; font-size: 11.5px; color: var(--mu); }
.ov-tl { left: 14px; top: 12px; pointer-events: none; }
.ov-tr { right: 14px; top: 12px; font-size: 10.5px; color: var(--dim); text-align: right; pointer-events: none; }
.ov-bl { left: 14px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; max-width: calc(100% - 200px); }
.ov-br { right: 14px; bottom: 12px; display: flex; align-items: center; gap: 10px; }
.ov-br .hint { font-size: 10.5px; color: var(--dim); }
.lg-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lg-k { color: var(--dim); font-size: 10.5px; }
.lg-keys { gap: 12px; font-size: 10.5px; color: var(--dim); }
.lg-keys span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.lg-keys .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mu); }
.lg-keys .dot.up { background: var(--up); }
.lg-keys .dot.dn { background: var(--dn); }
.lg-keys .ring { width: 9px; height: 9px; border-radius: 50%; border: 1.2px solid var(--gold); }
.lg-keys .ring.dash { border-style: dashed; border-color: var(--mu); }
.lg-keys .ramp { width: 44px; height: 3px; background: linear-gradient(90deg, var(--dn), var(--mu), var(--up)); }

.sg-etf { display: flex; align-items: baseline; gap: 8px; }
.sg-etf b { font-family: var(--mono); font-size: 20px; color: var(--tx); font-weight: 600; }
.sg-etf span { color: var(--dim); font-size: 11px; }
.sg-score { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.sg-score .num { font-size: 20px; color: var(--tx); }
.sg-score .k-up { color: var(--up); }
.sg-score .k-dn { color: var(--dn); }
.sg-score .k-fl { color: var(--mu); }
.stk { display: flex; width: 280px; height: 6px; margin: 7px 0 4px; gap: 1px; }
.stk i { display: block; height: 100%; }
.stk .up { background: var(--up); }
.stk .fl { background: var(--dim); }
.stk .dn { background: var(--dn); }
.stk-l { display: flex; gap: 10px; font-size: 10.5px; color: var(--dim); }
.stk-l .num { color: var(--mu); }

/* 네트워크 SVG */
.lk-t { stroke: var(--line); stroke-width: .75; fill: none; }
.lk-t.root { stroke: var(--dim); stroke-opacity: .55; }
.lk-r { fill: none; stroke-width: 1; }
.lk-r.s { stroke: var(--flow); stroke-opacity: .14; stroke-dasharray: 4 3; }
.lk-r.c { stroke: var(--dn); stroke-opacity: .18; stroke-dasharray: 1.2 3; stroke-linecap: round; }
.lk-t, .lk-r, .nd-i, .ptg { transition: opacity .2s; }
.lk-r.hl { stroke-opacity: .9; stroke-width: 1.25; }
.dm { opacity: .15; }
.fade { opacity: 0; transition: opacity .35s; }
.nd { cursor: pointer; }
.nd .c { stroke: var(--bg); stroke-width: 1; }
.nd .c.k-up { fill: var(--up); }
.nd .c.k-dn { fill: var(--dn); }
.nd .c.k-fl { fill: var(--mu); }
.nd .c.cat-soon { stroke: var(--gold); stroke-width: 1.5; }
.nd .c.cat-far { stroke: var(--mu); stroke-opacity: .55; stroke-width: 1; stroke-dasharray: 2.5 2; }
.nd .halo { fill: none; stroke: var(--gold); stroke-width: 1.2; filter: url(#glow); }
.nd .selring { fill: none; stroke: var(--tx); stroke-width: 1; opacity: 0; transition: opacity .2s; }
.nd.sel .selring { opacity: .9; }
.nd text { pointer-events: none; font-family: var(--mono); fill: var(--tx); stroke: var(--bg); stroke-width: 2.4px; paint-order: stroke; text-anchor: middle; transition: opacity .2s; }
.nd text.lo { opacity: 0; }
.nd:hover text.lo, .nd.sel text.lo, .nd.hv text.lo, svg.zoomed .nd text.lo { opacity: 1; }
.nd.root .c { fill: var(--panel); stroke: var(--tx); stroke-opacity: .7; stroke-width: 1; }
.nd.root .ring2 { fill: none; stroke: var(--dim); stroke-width: .75; stroke-dasharray: 1 3; }
.nd.root text { font-size: 13px; font-weight: 600; }
.nd.hub .c { fill: var(--bg); stroke: var(--mu); stroke-width: 1; }
.nd.hub text { font-family: var(--sans); fill: var(--mu); font-size: 11.5px; stroke: var(--bg); stroke-width: 5px; stroke-linejoin: round; paint-order: stroke; }
.ptc { fill: var(--flow); }
.arw { fill: var(--flow); fill-opacity: .7; }

/* 상세 패널 (오른쪽에서 밀려 들어옴) */
#detail {
  position: absolute; z-index: 8; top: 0; right: 0; bottom: 0; width: var(--detail-w); max-width: 92%;
  background: var(--panel); border-left: 1px solid var(--line);
  transform: translateX(102%); transition: transform .32s var(--ease);
  display: flex; flex-direction: column;
}
#detail.open { transform: translateX(0); }
.dt-x { position: absolute; right: 10px; top: 10px; z-index: 2; }
#panel { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 24px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
#panel h2 { margin: 0 56px 2px 0; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#panel h2 .mono { font-size: 18px; }
#panel h3 { margin: 16px 0 6px; font-size: 12px; color: var(--mu); font-weight: 500; padding-top: 10px; border-top: 1px solid var(--line); }
#panel .sub { color: var(--mu); font-size: 12px; }
#panel .px { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 4px; }
#panel .px .big { font-family: var(--mono); font-size: 22px; font-variant-numeric: tabular-nums; }
.small { font-size: 11px; color: var(--mu); }
.empty { color: var(--dim); font-size: 12px; padding: 4px 0; }
.verdict-l { border-left: 2px solid var(--line); padding: 2px 0 2px 8px; margin: 8px 0; font-size: 12px; }

/* 표 */
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--dim); font-weight: 500; font-size: 11px; white-space: nowrap; }
td.r, th.r { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.wrapc { white-space: normal; }
tr.click { cursor: pointer; transition: background-color .15s; }
tr.click:hover { background: var(--hover); }
tr.cur td { background: var(--sel); }
.scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 8px 0 0; font-size: 12px; }
.kv dt { color: var(--mu); }
.kv dd { margin: 0; }
ul.news, ul.rels { list-style: none; margin: 0; padding: 0; }
ul.news li, ul.rels li { padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
ul.news a { text-decoration: none; }
ul.news a:hover { text-decoration: underline; }
.sent { display: inline-block; width: 14px; font-family: var(--mono); }
ul.rels .s { color: var(--flow); }
ul.rels .c { color: var(--dn); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; color: var(--mu); font-size: 12px; }
.sbarw { position: relative; display: inline-block; width: 60px; height: 3px; background: var(--line); }
.sbarw i { position: absolute; top: 0; bottom: 0; }
.minibars { display: flex; gap: 10px; align-items: flex-end; height: 72px; margin-top: 6px; }
.minibars div { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--dim); font-family: var(--mono); }
.minibars i { display: block; width: 18px; background: var(--dim); }

/* 차트 공통 */
.chartbox { position: relative; }
.chartbox svg { display: block; width: 100%; height: auto; }
svg text { fill: var(--dim); font-size: 10px; font-family: var(--mono); }
.gridl { stroke: var(--line); stroke-width: .75; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 10.5px; color: var(--dim); margin-top: 4px; }
.legend .sw { display: inline-block; width: 12px; height: 2px; vertical-align: 3px; margin-right: 4px; }
.readout { position: absolute; top: 2px; font-size: 10.5px; font-family: var(--mono); color: var(--tx); background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; pointer-events: none; opacity: 0; white-space: nowrap; transition: opacity .12s; }

/* ---------- 촉매 파동 패널 ---------- */
#waves { margin: 12px 12px 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-a); padding: 12px 16px 12px; }
.wv-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.wv-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.wv-now { font-size: 12.5px; color: var(--mu); }
.wv-now b { color: var(--tx); font-weight: 600; }
.wv-now .num { color: var(--tx); }
.wv-head details { font-size: 12px; color: var(--mu); }
.wv-head summary { cursor: pointer; color: var(--dim); list-style: none; }
.wv-head summary::-webkit-details-marker { display: none; }
.wv-head summary::after { content: " 펼치기"; }
.wv-head details[open] summary::after { content: " 접기"; }
.wv-head details p { margin: 4px 0 0; max-width: 760px; }
.wv-ctrl { display: flex; align-items: center; gap: 6px; margin: 10px 0 4px; flex-wrap: wrap; }
.wv-ctrl .lab { font-size: 10.5px; color: var(--dim); margin-right: 2px; }
.achip { background: transparent; border: 1px solid var(--line); border-radius: 3px; padding: 1px 7px; font-size: 11px; color: var(--dim); cursor: pointer; white-space: nowrap; transition: color .2s, border-color .2s; }
.achip .num { font-size: 10.5px; margin-left: 4px; }
.achip[aria-pressed="true"] { color: var(--tx); border-color: var(--dim); }
.achip.hl { border-color: var(--tx); }
.wv-chips { display: flex; gap: 4px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.wv-right { display: flex; gap: 6px; align-items: center; margin-left: auto; }
#wchart { position: relative; height: 440px; }
#wchart svg { display: block; width: 100%; height: 100%; }
.w-price { fill: none; stroke: var(--tx); stroke-width: 1.5; stroke-linejoin: round; }
.w-price.draw { transition: stroke-dashoffset 1.4s var(--ease); }
.w-sox { fill: none; stroke: var(--mu); stroke-width: .9; stroke-opacity: .4; }
.w-band { stroke-width: .75; }
.w-band.k-dn { fill: var(--dn); stroke: var(--dn); }
.w-band.k-up { fill: var(--up); stroke: var(--up); }
.w-bandl { stroke-width: 1; }
.w-bandl.k-dn { stroke: var(--dn); }
.w-bandl.k-up { stroke: var(--up); }
.w-blab { font-family: var(--sans); font-size: 11px; }
.w-blab .st { font-weight: 600; }
.w-blab.k-dn .st { fill: var(--dn); }
.w-blab.k-up .st { fill: var(--up); }
.w-blab .lb { fill: var(--mu); }
.w-lead { stroke: var(--dim); stroke-width: .75; stroke-dasharray: 1 2; }
.w-ev { stroke: var(--bg); stroke-width: 1.2; cursor: help; }
.w-ev.k-dn { fill: var(--dn); }
.w-ev.k-up { fill: var(--up); }
.w-ev.auto { fill: var(--bg); stroke: var(--mu); stroke-dasharray: 1.5 1.5; }
.w-future { fill: var(--tx); fill-opacity: .022; }
.w-now { stroke: var(--dim); stroke-width: .75; stroke-dasharray: 2 3; }
.w-mk { stroke-width: .75; stroke-dasharray: 3 3; }
.w-mk.macro { stroke: var(--flow); }
.w-mk.earn { stroke: var(--gold); }
.w-mkl { font-family: var(--sans); font-size: 10.5px; }
.w-mkl.macro { fill: var(--flow); }
.w-mkl.earn { fill: var(--gold); }
.w-an { fill: none; stroke: var(--mu); stroke-width: 1; stroke-opacity: .55; transition: opacity .2s; }
.w-an.hl { stroke: var(--tx); stroke-opacity: 1; stroke-width: 1.25; }
.w-an.dimmed { opacity: .2; }
.w-anl { font-family: var(--sans); font-size: 10.5px; fill: var(--mu); transition: opacity .2s; }
.w-anl.hl { fill: var(--tx); }
.w-anl.dimmed { opacity: .25; }
.w-hit { fill: none; stroke: transparent; stroke-width: 10; cursor: pointer; pointer-events: stroke; }
.w-dist line { stroke: var(--flow); stroke-opacity: .55; }
.w-dist rect { fill: var(--flow); fill-opacity: .16; stroke: var(--flow); stroke-opacity: .5; stroke-width: .75; }
.w-dist .md { stroke: var(--tx); stroke-opacity: .8; }
.w-dot { fill: var(--tx); }
.w-low { fill: var(--bg); stroke: var(--dn); stroke-width: 1.2; }
.w-cross { stroke: var(--mu); stroke-width: .75; opacity: 0; }
.w-axr text { fill: var(--dim); }
.w-tag { font-family: var(--sans); font-size: 10.5px; fill: var(--dim); }
#wchart svg * { pointer-events: none; }
#wchart svg .w-ov { pointer-events: all; }
#wchart svg .w-ev, #wchart svg .w-blab, #wchart svg .w-mkl, #wchart svg .w-rm, #wchart svg .w-rml { pointer-events: auto; }
#wchart svg .w-hit { pointer-events: stroke; }
.w-rate { font-size: 10.5px; color: var(--mu); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; white-space: nowrap; }
.w-rate .num { color: var(--tx); }
.w-rate.over .num { color: var(--dn); }
.wv-foot { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 10.5px; color: var(--dim); margin-top: 6px; }
.wv-foot b { color: var(--mu); font-weight: 500; }

/* ---------- 금리 vs 위험자산 ---------- */
#rates { margin: 12px 12px 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-a); padding: 12px 16px 12px; }
.rt-now .chip { font-size: 11.5px; line-height: 18px; padding: 0 6px; }
.rt-now .gold { color: var(--gold); }
.rt-now .neg { color: var(--dn); }
.rchip { display: inline-flex; align-items: center; gap: 5px; }
.rchip[aria-pressed="false"] .rt-sw { opacity: .35; }
.rchip-fix { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--tx); padding: 1px 7px; white-space: nowrap; }
.rt-sw { display: inline-block; width: 12px; height: 2px; }
.rt-sw.r-y10 { height: 3px; background: var(--tx); }
.rt-sw.r-y2 { height: 0; border-top: 1px dashed var(--mu); }
.rt-sw.r-real { height: 0; border-top: 1px dotted var(--tx); }
.rt-axes { display: flex; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; font-size: 10.5px; color: var(--dim); margin: 2px 0 0; }
#rchart { position: relative; height: 360px; overflow: hidden; }
#rchart svg { display: block; width: 100%; height: 100%; }
#rchart svg * { pointer-events: none; }
#rchart svg .w-ov { pointer-events: all; }
#rchart svg .r-wbl { pointer-events: auto; }
.rt-read { max-width: calc(100% - 8px); white-space: normal; }
.r-wb.k-dn { fill: var(--dn); }
.r-wb.k-up { fill: var(--up); }
.r-wbl { font-family: var(--sans); font-size: 10.5px; font-weight: 600; }
.r-wbl.k-dn { fill: var(--dn); }
.r-wbl.k-up { fill: var(--up); }
.r-y10 { fill: none; stroke: var(--tx); stroke-width: 2.2; stroke-linejoin: round; }
.r-ln { fill: none; stroke-width: 1; }
.r-ln.r-y2 { stroke: var(--mu); stroke-dasharray: 4 3; }
.r-ln.r-real { stroke: var(--tx); stroke-opacity: .55; stroke-dasharray: 1.5 2.5; }
.r-as { fill: none; stroke-width: 1.3; stroke-opacity: .9; stroke-linejoin: round; }
.r-chk { stroke: var(--tx); stroke-opacity: .5; stroke-width: 1; stroke-dasharray: 1.5 3; }
.r-chkl { font-family: var(--sans); font-size: 10.5px; fill: var(--tx); fill-opacity: .8; stroke: var(--bg); stroke-width: 3px; paint-order: stroke; }
.r-chkd { fill: var(--bg); stroke: var(--tx); stroke-width: 1.2; }
.r-5 { stroke: var(--dn); stroke-opacity: .45; stroke-width: 1; stroke-dasharray: 4 4; }
.r-5l, .r-5bl { font-family: var(--sans); font-size: 10.5px; fill: var(--dn); stroke: var(--bg); stroke-width: 3px; paint-order: stroke; }
.r-5band { fill: var(--dn); fill-opacity: .4; }
.r-100 { stroke: var(--dim); stroke-width: .75; stroke-dasharray: 1 3; }
.r-endl { font-size: 10.5px; fill: var(--tx); }
.rt-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 8px 24px; margin-top: 8px; }
.rt-grid h3 { margin: 6px 0 6px; font-size: 12px; font-weight: 500; color: var(--mu); }
.rt-grid p { margin: 0 0 6px; max-width: 560px; }
.rs { font-weight: 500; color: var(--mu); white-space: nowrap; }
.rt-grid td:first-child { white-space: nowrap; }
.rs.k-dn { color: var(--dn); }
.rs.k-gold { color: var(--gold); }
.rs.k-up { color: var(--up); }
/* 촉매 파동: 10년물 5% 표시 */
.w-r5 rect { fill: var(--dn); fill-opacity: .4; }
.w-r5l { font-family: var(--sans); font-size: 10.5px; fill: var(--dn); fill-opacity: .85; }
.w-rm { stroke: var(--bg); stroke-width: 1; cursor: help; }
.w-rm.k-up { fill: var(--dn); }
.w-rm.k-dn { fill: var(--mu); }
.w-rml { font-family: var(--sans); font-size: 10.5px; font-weight: 600; fill: var(--dn); stroke: var(--bg); stroke-width: 3px; paint-order: stroke; cursor: help; }

/* ---------- 조용한 표 ---------- */
#quiet { margin: 0 12px; }
.q { border-top: 1px solid var(--line); padding: 22px 4px 18px; max-width: 1600px; }
.q:first-child { border-top: 0; }
.q h2 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.q .sec-sub { font-size: 11.5px; color: var(--mu); margin-bottom: 10px; max-width: 980px; }
.q h3 { margin: 14px 0 6px; font-size: 12px; font-weight: 500; color: var(--mu); }
.q p, .q li { font-size: 12.5px; color: var(--mu); max-width: 980px; }
.q p b, .q li b { color: var(--tx); font-weight: 500; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.concl { border-left: 2px solid var(--gold); padding-left: 10px; color: var(--tx) !important; }
.levhead { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.levhead .big { font-family: var(--mono); font-size: 20px; }
.catc .ctitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 520px; color: var(--mu); }
.catc .ctitle a { text-decoration: none; color: var(--mu); }
.catc .ctitle a:hover { color: var(--tx); }
#foot { margin: 8px 12px 0; padding: 18px 4px 40px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--dim); }

/* 툴팁 */
#tip {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; opacity: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 6px 9px;
  font-size: 11.5px; max-width: 300px; transition: opacity .12s;
}
#tip.on { opacity: 1; }
#tip .tr { display: flex; justify-content: space-between; gap: 14px; color: var(--mu); }
#tip .tr span:last-child { font-family: var(--mono); color: var(--tx); font-variant-numeric: tabular-nums; }
#tip b { font-family: var(--mono); }

/* ---------- 탭별 해설 (본문 글) ---------- */
#brief { margin: 18px 12px 0; padding: 0 4px; }
.brief { max-width: 720px; }
.brief:empty { display: none; }
.brief h2 { margin: 0 0 2px; font-size: 14px; font-weight: 600; }
.brief .b-sub { font-size: 11.5px; color: var(--dim); margin-bottom: 10px; }
.brief p { margin: 0 0 10px; font-size: 15.5px; line-height: 1.75; color: var(--tx); word-break: keep-all; overflow-wrap: anywhere; }
.brief h3 { margin: 18px 0 6px; font-size: 12.5px; font-weight: 500; color: var(--mu); }
.brief .wk p { font-size: 15px; color: var(--mu); }
#brief, #ark { scroll-margin-top: calc(var(--band-h) + 6px); }

/* 광고 자리: 지금은 높이 0·숨김. 광고 코드를 넣을 때 이 규칙을 display: block; min-height: (광고 높이)px; margin: 16px 0; 으로 바꾼다. */
.ad-slot { display: none; height: 0; overflow: hidden; }

/* ---------- ARK 탭 ---------- */
.b-ark { display: none; }
body.mode-ark .b-ark { display: flex; order: -1; }
body.mode-ark #bArkD { border-left: 0; padding-left: 0; }
body.mode-ark #bWave, body.mode-ark #bRegime, body.mode-ark #bProb, body.mode-ark #bLev, body.mode-ark #bVix, body.mode-ark #bFg { display: none; }
body.mode-ark #bArkV span[data-tip] { border-bottom: 1px dotted var(--dim); cursor: help; }
body.mode-ark #waves, body.mode-ark #rates, body.mode-ark #quiet, body.mode-ark #brief { display: none; }
body:not(.mode-ark) #ark { display: none; }
body.mode-ark #tgS, body.mode-ark #tgC { display: none; }
#tgX { display: none; }
body.mode-ark #tgX { display: inline-flex; }
.tg .ln-x { border-top: 1px solid var(--mu); opacity: .7; }
.ark-ov { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 11.5px; color: var(--mu); }
.ark-ov b { font-weight: 600; }
.nd .c.k-gold { fill: var(--gold); }
.nd .halo.h-buy { stroke: var(--up); }
.nd .halo.h-sell { stroke: var(--dn); }
.nd .halo.h-mixed { stroke: var(--gold); }
.nd.hub.stale .c { stroke-dasharray: 1.5 2; stroke-opacity: .6; }
.nd.hub.stale text { fill: var(--dim); }
.lk-t.xf { stroke: var(--mu); stroke-opacity: .13; stroke-width: .6; }
.lk-t.xf.stale { stroke-dasharray: 2 3; stroke-opacity: .08; }
.lk-t.xf.hl { stroke-opacity: .55; }
.lg-keys .dot.gold { background: var(--gold); }
.lg-keys .ring.act { border-color: var(--mu); }
.lg-keys .xl { display: inline-block; width: 16px; height: 0; border-top: 1px solid var(--mu); opacity: .6; }
.sigdot.gold { background: var(--gold); }
.trow.stale { opacity: .55; }
.trow .ed.act-buy { color: var(--up); }
.trow .ed.act-sell { color: var(--dn); }
.trow .ed.act-mixed { color: var(--gold); }
.dir-buy { color: var(--up); }
.dir-sell { color: var(--dn); }
.dir-mixed { color: var(--gold); }
#tip .tp-h { margin-top: 5px; color: var(--mu); font-size: 11px; }
#tip .tp-h.gold { color: var(--gold); }
#tip .tp-t { color: var(--mu); font-size: 11px; white-space: normal; }
#tip .tp-t b { color: var(--tx); }
#panel .stale-note { margin: 8px 0; padding-left: 8px; border-left: 2px solid var(--gold); font-size: 12px; color: var(--gold); }
#panel tr.tot td { color: var(--mu); border-top: 1px solid var(--dim); }
#panel table.tt td { white-space: nowrap; }
#ark { margin: 18px 12px 0; padding: 0 4px; }
.ark-sec { border-top: 1px solid var(--line); padding: 20px 0 16px; max-width: 1600px; }
#arkTl { margin-top: 18px; }
.ark-sec h2 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.ark-sec h3 { margin: 12px 0 6px; font-size: 12px; font-weight: 500; color: var(--mu); }
.ark-sec .sec-sub { font-size: 11.5px; color: var(--mu); margin-bottom: 10px; max-width: 980px; }
#arkTlc { position: relative; }
#arkTlc svg { display: block; width: 100%; height: auto; }
.tl-zero { stroke: var(--dim); stroke-width: .75; }
.tl-bg { fill: var(--tx); opacity: 0; transition: opacity .15s; }
.tl-d.on .tl-bg { opacity: .05; }
.tl-b.buy { fill: var(--up); fill-opacity: .8; }
.tl-b.sell { fill: var(--dn); fill-opacity: .8; }
.tl-n { font-size: 9.5px; fill: var(--mu); }
.tl-hit { fill: transparent; cursor: help; }
.rk-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rk-head h2 { margin: 0; }
.rk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 28px; }
.rk-grid h3 { margin-top: 4px; }
td.rk-nm { white-space: normal; }
.vf { margin: 4px 0 6px; font-size: 13px; color: var(--mu); max-width: 980px; }
.vf b { color: var(--tx); }
.vf-d { font-size: 12px; color: var(--mu); }
.vf-d summary { cursor: pointer; color: var(--dim); }
.vf-g { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 24px; }
.vf-g ul { list-style: none; margin: 0; padding: 0; }
.vf-g li { padding: 2px 0; border-bottom: 1px solid var(--line); }
table.fl { max-width: 900px; }
ul.src { margin: 0; padding-left: 18px; }
ul.src li { font-size: 12.5px; color: var(--mu); margin: 2px 0; overflow-wrap: anywhere; }
ul.src li b { color: var(--tx); font-weight: 500; }
.disc { font-size: 12.5px; color: var(--mu); max-width: 980px; }

/* ---------- 중간 폭 ---------- */
@media (max-width: 1199px) {
  :root { --dw: 240px; --detail-w: 340px; }
  .ov-br .hint { display: none; }
  .grid3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---------- 휴대폰 ---------- */
@media (max-width: 819px) {
  :root { --band-h: 76px; }
  #band { flex-wrap: wrap; height: auto; min-height: var(--band-h); gap: 6px 10px; padding: 6px 10px; align-content: center; }
  .b-full { display: none; }
  .b-brand { order: 1; font-size: 12.5px; }
  .b-seg { order: 2; }
  .b-stats { order: 3; margin-left: auto; }
  .b-scroll { order: 4; flex: 1 1 100%; height: 26px; }
  .b-stat { padding: 2px 6px; font-size: 11px; }
  .b-seg button { padding: 3px 8px; }
  .b-item { padding: 0 9px; }
  #bVix, #bFg { display: none; }
  .b-scroll > .b-item { order: 5; }
  #bWave { order: 1; }
  #bY10 { order: 2; }
  #bY10 .y10s { display: none; }
  #bRegime { order: 3; }
  #bY10 { border-left: 1px solid var(--line); padding-left: 9px; }
  .b-y10 .y10v { font-size: 16px; }
  .b-y10 .y10s { font-size: 10px; }
  .wp li { font-size: 12px; }
  .wp li + li::before { width: 8px; margin: 0 4px; }
  .stk { width: 200px; }
  .b-scroll { min-width: 0; }
  .notice { white-space: normal; height: auto; line-height: 1.4; padding: 4px 10px; }
  .notice span { display: none; }
  #main { display: block; height: 62vh; height: 62svh; min-height: 360px; margin: 0 8px; }
  #stage { position: absolute; inset: 0; }
  #netbox { top: 62px; bottom: 44px; }
  .nd.hub text { display: none; }
  .ov-tl { pointer-events: none; }
  .ov-tl { left: 10px; top: 8px; }
  .sg-etf b { font-size: 16px; }
  .stk { width: 140px; }
  .ov-tr { display: none; }
  .ov-bl { left: 8px; bottom: 8px; max-width: calc(100% - 96px); }
  .lg-keys { display: none; }
  .ov-br { right: 8px; bottom: 8px; }
  .ov-br .hint { display: none; }
  .dr-open { display: none; }
  #sheet {
    display: flex; flex-direction: column;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: 78vh; height: 78svh;
    background: var(--panel); border-top: 1px solid var(--line); border-radius: 10px 10px 0 0;
    transform: translateY(calc(100% - var(--sheet-peek))); transition: transform .32s var(--ease);
    will-change: transform;
  }
  #sheet.half { transform: translateY(40%); }
  #sheet.open { transform: translateY(0); }
  #sheet.drag { transition: none; }
  .sh-head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 7px 12px 6px; border-bottom: 1px solid var(--line); touch-action: none; cursor: grab; }
  .sh-grip { width: 36px; height: 3px; border-radius: 2px; background: var(--dim); }
  .sh-tabs { display: flex; gap: 4px; }
  .sh-tabs button { background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 3px 16px; color: var(--mu); font-size: 12.5px; cursor: pointer; }
  .sh-tabs button[aria-selected="true"] { color: var(--tx); border-color: var(--line); }
  #drawer, #detail { position: static; flex: 1; min-height: 0; width: auto; max-width: none; border: 0; transform: none; transition: none; background: transparent; }
  #sheet[data-tab="tree"] #detail, #sheet[data-tab="detail"] #drawer { display: none; }
  #drawer .dr-x { display: none; }
  .dt-x { display: none; }
  #panel { padding: 10px 14px 24px; }
  #waves { margin: 10px 8px 0; padding: 10px 10px; }
  #wchart { height: 360px; }
  #rates { margin: 10px 8px 0; padding: 10px 10px; }
  #rchart { height: 300px; }
  .rt-grid { grid-template-columns: minmax(0, 1fr); }
  .rt-now { font-size: 12px; }
  .wv-right { margin-left: 0; }
  #quiet { margin: 0 8px; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  body { padding-bottom: calc(var(--sheet-peek) + 8px); }
  .catc .ctitle { max-width: 260px; }
  .dr-cols, .trow { grid-template-columns: minmax(0, 1fr) 64px 50px 40px; }
}

/* ---------- 휴대폰: 해설·ARK ---------- */
@media (max-width: 819px) {
  /* 상단 띠 첫 줄은 격자(로고가 줄어들고 탭·조회는 그대로) */
  #band { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "brand seg stats" "scroll scroll scroll"; }
  .b-brand { grid-area: brand; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .b-seg { grid-area: seg; }
  .b-stats { grid-area: stats; margin-left: 0; }
  .b-scroll { grid-area: scroll; }
  body.mode-ark .b-scroll > .b-ark { order: 0; }
  body.mode-ark #bY10 { order: -1; padding-left: 0; border-left: 0; }
  #brief, #ark { margin: 14px 8px 0; padding: 0 2px; }
  .brief p { font-size: 15px; line-height: 1.7; }
  .rk-grid, .vf-g { grid-template-columns: minmax(0, 1fr); }
  .ark-ov { font-size: 11px; gap: 2px 8px; }
}
@media (max-width: 419px) {
  .t-full { display: none; }
  .b-stat { padding: 2px 5px; font-size: 10.5px; }
  #band { column-gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; scroll-behavior: auto !important; }
}
