*{box-sizing:border-box}
html,body{margin:0;height:100%;background:#131722;color:#d1d4dc;font-family:Inter,-apple-system,"Segoe UI",Roboto,sans-serif;overflow:hidden}
button{font-family:inherit;cursor:pointer}
#app{height:100%;display:flex;flex-direction:column}
svg.i{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;flex:none}
.t{display:flex;align-items:center;gap:6px;height:32px;padding:0 8px;border:0;border-radius:4px;background:transparent;color:#d1d4dc;font:500 14px Inter,sans-serif;white-space:nowrap}
.t:hover,.l:hover,.r:hover,.tf:hover{background:#2a2e39}
.t.on,.l.on,.r.on{background:#2a2e39;color:#2962ff}
.l,.r{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:0;border-radius:4px;background:transparent;color:#b2b5be}
.sep{width:1px;height:20px;background:#2a2e39;margin:0 4px;flex:none}
.hs{height:1px;background:#2a2e39;margin:4px 6px;width:28px}
header{height:48px;flex:none;display:flex;align-items:center;gap:2px;padding:0 8px;border-bottom:1px solid #2a2e39;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
header::-webkit-scrollbar{display:none}
.logo{width:28px;height:28px;border-radius:50%;background:#2962ff;display:flex;align-items:center;justify-content:center;font:700 14px Inter,sans-serif;color:#fff;margin:0 8px 0 4px;flex:none;text-decoration:none}
.save{background:#2962ff;color:#fff;margin:0 8px 0 6px;padding:0 14px}
.save:hover{background:#1e53e5}
#body{flex:1;min-height:0;display:flex}
#tools{width:52px;flex:none;border-right:1px solid #2a2e39;padding:6px 0;display:flex;flex-direction:column;align-items:center;gap:2px;overflow:hidden}
#main{flex:1;min-width:0;display:flex;flex-direction:column;position:relative}
#chartwrap{flex:1;min-height:0;position:relative}
#chart{position:absolute;inset:0}
#legend{position:absolute;left:12px;top:8px;z-index:3;font:400 13px Inter,sans-serif;display:flex;flex-direction:column;gap:3px;pointer-events:none}
#legend .ttl{display:flex;align-items:center;gap:8px;pointer-events:auto}
#legend .ttl b{font-weight:600;font-size:15px;color:#d1d4dc}
#legend .src{color:#787b86}
#legend .live{width:8px;height:8px;border-radius:50%;background:#089981}
#legend .live.off{background:#f23645}
#legend .ohlc{display:flex;gap:10px;flex-wrap:wrap}
#legend .ind{color:#787b86;display:flex;gap:8px;align-items:center}
.up{color:#089981}.dn{color:#f23645}
#ranges{height:34px;flex:none;border-top:1px solid #2a2e39;display:flex;align-items:center;padding:0 8px;gap:2px;overflow-x:auto;scrollbar-width:none}
.tf{height:24px;padding:0 8px;border:0;border-radius:4px;background:transparent;color:#b2b5be;font:500 12px Inter,sans-serif;white-space:nowrap}
.tf.on{color:#2962ff}
#clock{font:400 12px Inter,sans-serif;color:#b2b5be;padding:0 12px;white-space:nowrap}
#side{width:300px;flex:none;border-left:1px solid #2a2e39;display:flex;flex-direction:column;background:#131722;min-height:0}
#side .hd{height:40px;flex:none;display:flex;align-items:center;justify-content:space-between;padding:0 8px 0 12px;border-bottom:1px solid #2a2e39;font:600 14px Inter,sans-serif}
.cols,.row{display:flex;align-items:center;padding:0 12px;font:400 13px Inter,sans-serif}
.cols{height:24px;font-size:11px;color:#787b86}
.row{height:30px;cursor:pointer;position:relative}
.row:hover{background:#2a2e39}.row.sel{background:#2a2e39}
.c1{flex:1;display:flex;align-items:center;gap:8px;min-width:0}
.c2{width:70px;text-align:right}.c3{width:58px;text-align:right}.c4{width:62px;text-align:right}
.dot{width:16px;height:16px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;font:600 8px Inter,sans-serif;color:#fff;background:#363a45}
.row .x{display:none;position:absolute;right:2px;width:18px;height:18px;border:0;border-radius:3px;background:#363a45;color:#d1d4dc;font-size:12px;line-height:1;align-items:center;justify-content:center}
.row:hover .x{display:flex}
#wl{overflow-y:auto;flex:none;max-height:45%}
#info{padding:12px;border-top:1px solid #2a2e39}
#info .nm{display:flex;align-items:center;gap:8px;font:600 15px Inter,sans-serif}
#info .nm small{font:400 12px Inter,sans-serif;color:#787b86}
#info .pr{display:flex;align-items:baseline;gap:8px;margin-top:4px}
#info .pr b{font:600 26px Inter,sans-serif}
#news{padding:12px;border-top:1px solid #2a2e39;flex:1;min-height:0;overflow:auto}
#news h4{margin:0 0 10px;font:600 13px Inter,sans-serif;display:flex;justify-content:space-between}
#news a{display:block;color:#d1d4dc;text-decoration:none;font:500 13px/1.35 Inter,sans-serif;margin-bottom:10px}
#news a small{display:block;color:#787b86;font:400 11px Inter,sans-serif;margin-top:2px}
#news h4 a{color:#2962ff;font-size:12px;margin:0}
#rail{width:48px;flex:none;border-left:1px solid #2a2e39;display:flex;flex-direction:column;align-items:center;padding:6px 0;gap:2px}
footer{height:34px;flex:none;border-top:1px solid #2a2e39;display:flex;align-items:center;padding:0 8px;gap:2px}
footer .note{margin-left:auto;font:400 11px Inter,sans-serif;color:#787b86;padding-right:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* modal */
#modal{position:fixed;inset:0;background:rgba(0,0,0,.55);display:none;align-items:flex-start;justify-content:center;padding-top:8vh;z-index:50}
#modal.open{display:flex}
.box{width:min(560px,94vw);max-height:78vh;background:#1e222d;border:1px solid #2a2e39;border-radius:8px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.6)}
.box .bh{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid #2a2e39;font:600 16px Inter,sans-serif}
.box input{flex:1;background:transparent;border:0;outline:0;color:#d1d4dc;font:500 16px Inter,sans-serif}
.box .list{overflow:auto}
.it{display:flex;align-items:center;gap:10px;padding:9px 14px;font:500 14px Inter,sans-serif;cursor:pointer}
.it:hover,.it.hl{background:#2a2e39}
.it small{margin-left:auto;color:#787b86;font:400 12px Inter,sans-serif}
.it .sw{width:12px;height:12px;border-radius:50%}
.it .tg{margin-left:auto;width:36px;height:20px;border-radius:10px;background:#363a45;position:relative}
.it .tg::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#d1d4dc;transition:.15s}
.it.act .tg{background:#2962ff}.it.act .tg::after{left:18px;background:#fff}
.menu{position:absolute;z-index:40;background:#1e222d;border:1px solid #2a2e39;border-radius:6px;padding:4px;min-width:190px;box-shadow:0 12px 30px rgba(0,0,0,.5);display:none}
.menu.open{display:block}
.menu .it{padding:8px 10px;border-radius:4px}
#toast{position:fixed;left:50%;bottom:60px;transform:translateX(-50%);background:#2a2e39;color:#d1d4dc;padding:10px 16px;border-radius:6px;font:500 13px Inter,sans-serif;display:none;z-index:60}
#dcv{position:absolute;left:0;top:0;pointer-events:none;z-index:4}
#chart{touch-action:none}
#dtb{position:absolute;top:8px;left:50%;transform:translateX(-50%);z-index:9;display:none;gap:6px;align-items:center;background:#1e222d;border:1px solid #2a2e39;border-radius:8px;padding:5px 8px;box-shadow:0 8px 24px rgba(0,0,0,.5)}
#dtb.open{display:flex}
#dtb i{width:20px;height:20px;border-radius:50%;cursor:pointer;border:2px solid transparent}
#dtb i.on{border-color:#fff}
#dtb button{display:flex;align-items:center;justify-content:center;min-width:28px;height:28px;border:0;border-radius:4px;background:transparent;color:#d1d4dc;font:600 13px Inter,sans-serif}
#dtb button:hover{background:#2a2e39}
#b-draw{display:none}
#tools .mo{display:none}
#bnav{display:none}
@media(max-width:820px){
 #tools,#rail,footer,.hide-m{display:none}
 #side{position:fixed;inset:48px 0 56px 0;width:auto;z-index:20;display:none;border:0}
 body.wlopen #side{display:flex}
 #bnav{display:flex;height:56px;flex:none;border-top:1px solid #2a2e39;background:#131722;padding-bottom:env(safe-area-inset-bottom)}
 #bnav button{flex:1;border:0;background:transparent;color:#787b86;font:500 10px Inter,sans-serif;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}
 #bnav button.on{color:#fff}
 #legend{font-size:11px}
 #legend .ttl b{font-size:13px}
 #clock{display:none}
 #b-draw{display:flex;position:absolute;left:10px;bottom:38px;width:44px;height:44px;border-radius:50%;background:#2a2e39;border:1px solid #363a45;color:#d1d4dc;align-items:center;justify-content:center;z-index:9;box-shadow:0 4px 14px rgba(0,0,0,.5)}
 #b-draw.on{background:#2962ff;color:#fff;border-color:#2962ff}
 body.drawopen #tools{display:flex;flex-direction:row;position:fixed;left:0;right:0;bottom:calc(56px + env(safe-area-inset-bottom));height:48px;width:auto;border:0;border-top:1px solid #2a2e39;background:#131722;overflow-x:auto;padding:0 6px;gap:2px;z-index:15;align-items:center;scrollbar-width:none}
 body.drawopen #tools .l{width:42px;height:40px;flex:none}
 body.drawopen #tools .mo{display:flex}
 body.drawopen #tools .hs{width:1px;height:24px;margin:0 4px;flex:none}
 body.drawopen #body{padding-bottom:48px}
 #dtb{top:auto;bottom:40px;left:auto;right:10px;transform:none}
}
body.drawopen #toast{bottom:130px}
