 :root{--bg:#0f131a;--top:#131722;--border:#2a2e39;--text:#d1d4dc;--muted:#787b86;--blue:#2962ff;--white:#fff;--gray:#b8bec9;--yellow:#f0b90b;--cyan:#38bdf8;--orange:#ff9800;--red:#ff3b30;--baseline-fast:#ffd54f;--baseline-slow:#9c27b0}*{box-sizing:border-box}body{margin:0;height:100vh;overflow:hidden;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text)}.app{height:100vh;display:grid;grid-template-rows:48px 42px 28px 1fr}.topbar{background:var(--top);border-bottom:1px solid var(--border);display:flex;align-items:center;gap:14px;padding:0 14px;white-space:nowrap}.logo{font-weight:900;color:white;letter-spacing:.3px;padding-right:8px;border-right:1px solid var(--border)}.symbol-box{display:flex;align-items:center;gap:8px}.symbol-input{width:118px;height:30px;background:#0b0f16;color:var(--text);border:1px solid var(--border);border-radius:6px;padding:0 9px;font-weight:800;outline:none;text-transform:uppercase}.btn{height:30px;border:1px solid var(--border);background:#0b0f16;color:var(--text);border-radius:6px;padding:0 10px;cursor:pointer;font-weight:800}.btn:hover,.btn.primary{border-color:var(--blue);color:white;background:#1e222d}.symbol-title{font-weight:900;color:white;font-size:15px;min-width:80px}.price{font-size:18px;font-weight:900;color:white}.change{font-size:13px;font-weight:800}.green{color:white}.red{color:var(--gray)}.status{margin-left:auto;display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}.dot{width:8px;height:8px;border-radius:50%;background:var(--red)}.dot.online{background:#00c853}.toolbar{background:var(--top);border-bottom:1px solid var(--border);display:flex;align-items:center;gap:10px;padding:0 14px;overflow-x:auto}.timeframes{display:flex;align-items:center;gap:4px}.tf{min-width:42px;height:28px;background:transparent;border:0;color:var(--muted);border-radius:5px;cursor:pointer;font-weight:800}.tf:hover{color:white;background:#1e222d}.tf.active{color:var(--blue);background:#1e222d}.divider{width:1px;height:24px;background:var(--border);margin:0 4px}.legend{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px;font-weight:700;flex-wrap:nowrap}.toggle{height:28px;display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);background:#0b0f16;color:var(--muted);border-radius:6px;padding:0 9px;cursor:pointer;font-size:12px;font-weight:800;user-select:none}.toggle:hover{color:white;border-color:var(--blue)}.toggle.active{color:white;background:#1e222d;border-color:var(--blue)}.toggle i{width:10px;height:3px;display:inline-block;border-radius:2px}.ema{background:var(--yellow)}.wma{background:var(--cyan)}.rsi{background:white}.rsi-ema{background:var(--orange)}.rsi-wma{background:var(--red)}.vol{background:var(--muted)}.vwap{background:var(--blue)}.baseline-fast{background:var(--baseline-fast)}.baseline-slow{background:var(--baseline-slow)}.vwap-select{height:28px;background:#0b0f16;color:var(--text);border:1px solid var(--border);border-radius:6px;padding:0 8px;font-weight:800;outline:none}.value-strip{min-height:28px;background:var(--top);border-bottom:1px solid var(--border);display:flex;align-items:center;gap:14px;padding:0 14px;color:var(--muted);font-size:12px;font-weight:800;overflow-x:auto;white-space:nowrap}.value-strip b{font-weight:900}.ema-text{color:var(--yellow)}.wma-text{color:var(--cyan)}.rsi-text{color:white}.rsi-ema-text{color:var(--orange)}.rsi-wma-text{color:var(--red)}.vol-text{color:var(--muted)}.vwap-text{color:var(--blue)}.baseline-fast-text{color:var(--baseline-fast)}.baseline-slow-text{color:var(--baseline-slow)}.chart-layout{min-height:0;display:grid;grid-template-rows:minmax(360px,1fr) 210px;background:var(--bg)}.chart-panel{position:relative;min-height:0;border-bottom:1px solid var(--border)}#priceChart,#rsiChart{width:100%;height:100%}.error{padding:24px;color:var(--red);font-weight:800;line-height:1.6}.backtest-panel{position:fixed;right:14px;top:62px;bottom:14px;width:520px;max-width:calc(100vw - 28px);background:#10151f;border:1px solid var(--border);border-radius:12px;z-index:20;display:none;grid-template-rows:42px auto 116px 1fr;box-shadow:0 16px 50px rgba(0,0,0,.45);overflow:hidden}.backtest-panel.active{display:grid}.bt-head{display:flex;align-items:center;justify-content:space-between;padding:0 12px;border-bottom:1px solid var(--border);background:var(--top)}.bt-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px;border-bottom:1px solid var(--border)}.bt-grid label{color:var(--muted);font-size:12px;font-weight:800}.bt-grid input,.bt-grid select{width:100%;height:32px;margin-top:5px;background:#0b0f16;color:var(--text);border:1px solid var(--border);border-radius:6px;padding:0 8px;font-weight:800}.bt-grid .full{grid-column:1/-1}.bt-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:10px;border-bottom:1px solid var(--border);font-size:12px}.metric{background:#0b0f16;border:1px solid var(--border);border-radius:8px;padding:8px;color:var(--muted)}.metric b{display:block;margin-top:4px;color:white;font-size:14px}.bt-table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;font-size:12px}th,td{padding:8px;border-bottom:1px solid var(--border);white-space:nowrap}th{color:var(--muted);text-align:left;background:#111722;position:sticky;top:0}.pnl-win{color:white}.pnl-loss{color:var(--red)}@media(max-width:760px){body{overflow:auto}.app{height:100vh;grid-template-rows:auto auto auto 1fr}.topbar,.toolbar{flex-wrap:wrap;height:auto;padding:8px}.chart-layout{grid-template-rows:minmax(320px,1fr) 190px}.backtest-panel{left:8px;right:8px;top:80px;width:auto}.bt-grid{grid-template-columns:1fr}}
.bt-chart-actions{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px}.bt-status{color:var(--muted);font-size:12px;background:#0b0f16;border:1px solid var(--border);border-radius:8px;padding:8px}#btTrades tr{cursor:pointer}#btTrades tr:hover,#btTrades tr.selected{background:#1e222d}.bt-table-wrap{overflow:auto}.bt-table-wrap table{user-select:none}

.bt-range-actions{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
.backtest-panel input[type="date"]{color-scheme:dark}
@media(max-width:760px){.bt-range-actions{grid-template-columns:repeat(3,1fr)}}


/* Drawing tools overlay */
#priceChart{position:relative;overflow:hidden}.draw-canvas{position:absolute;inset:0;z-index:12;pointer-events:none}.drawing-toolbar{position:absolute;left:8px;top:8px;z-index:16;display:flex;align-items:center;gap:4px;max-width:calc(100% - 16px);padding:5px;border:1px solid rgba(42,46,57,.95);border-radius:10px;background:rgba(15,19,26,.86);box-shadow:0 8px 28px rgba(0,0,0,.28);backdrop-filter:blur(8px);overflow-x:auto}.draw-tool{height:28px;min-width:32px;border:1px solid var(--border);border-radius:7px;background:#0b0f16;color:var(--muted);font-size:12px;font-weight:900;cursor:pointer;white-space:nowrap;padding:0 8px}.draw-tool:hover{color:#fff;border-color:var(--blue)}.draw-tool.active{color:#fff;background:#1e222d;border-color:var(--blue)}.draw-tool.danger:hover{border-color:var(--red);color:#fff}.drawing-hint{position:absolute;left:8px;bottom:8px;z-index:16;display:none;max-width:min(620px,calc(100% - 16px));padding:7px 10px;border:1px solid rgba(42,46,57,.95);border-radius:9px;background:rgba(15,19,26,.86);color:#d1d4dc;font-size:12px;font-weight:800;box-shadow:0 8px 28px rgba(0,0,0,.28);pointer-events:none}.drawing-hint.active{display:block}#priceChart.drawing-mode{cursor:crosshair}#priceChart.eraser-mode{cursor:not-allowed}@media(max-width:900px){.drawing-toolbar{top:42px}.draw-tool{height:27px;min-width:30px;padding:0 7px;font-size:11px}.drawing-hint{font-size:11px}}

/* Baseline settings panel */
.bl-settings-panel{position:fixed;right:14px;top:62px;width:360px;max-width:calc(100vw - 28px);background:#10151f;border:1px solid var(--border);border-radius:12px;z-index:24;display:none;grid-template-rows:42px auto;box-shadow:0 16px 50px rgba(0,0,0,.45);overflow:hidden}.bl-settings-panel.active{display:grid}.bl-settings-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;padding:12px}.bl-settings-title{grid-column:1/-1;font-size:13px;font-weight:900;border-top:1px solid var(--border);padding-top:10px}.bl-settings-title:first-child{border-top:0;padding-top:0}.bl-settings-grid label{color:var(--muted);font-size:12px;font-weight:800}.bl-settings-grid input{width:100%;height:32px;margin-top:5px;background:#0b0f16;color:var(--text);border:1px solid var(--border);border-radius:6px;padding:0 8px;font-weight:800}.bl-settings-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:8px}.bl-settings-note{grid-column:1/-1;margin:0;color:var(--muted);font-size:12px;line-height:1.45}@media(max-width:760px){.bl-settings-panel{left:8px;right:8px;top:80px;width:auto}.bl-settings-grid{grid-template-columns:1fr 1fr}.bl-settings-actions{grid-template-columns:1fr}}

/* Turtle-style usability additions */
.quick-symbols{display:flex;align-items:center;gap:4px;border-left:1px solid var(--border);padding-left:8px}.quick-symbol{height:28px;min-width:42px;border:1px solid var(--border);background:#0b0f16;color:var(--muted);border-radius:6px;cursor:pointer;font-size:12px;font-weight:900}.quick-symbol:hover{color:white;border-color:var(--blue)}.quick-symbol.active{color:#fff;background:#1e222d;border-color:var(--blue)}.ohlc-text{color:#d1d4dc}.status-text{color:#00c853}.btn:disabled{opacity:.55;cursor:not-allowed}.toolbar .btn{white-space:nowrap}@media(max-width:900px){.quick-symbols{width:100%;border-left:0;padding-left:0;overflow-x:auto}.quick-symbol{min-width:48px}.legend{gap:6px}}


/* Compact professional top toolbar */
.topbar{gap:10px;padding:0 10px}.logo{font-size:13px;letter-spacing:.2px}.symbol-input{width:120px;height:28px;font-size:12px;padding:0 8px}.topbar .btn{height:28px;padding:0 9px;font-size:12px;border-radius:5px}.quick-symbols{gap:3px;padding-left:7px}.quick-symbol{height:26px;min-width:40px;font-size:11px;border-radius:5px}.symbol-title{font-size:13px;min-width:76px}.price{font-size:16px}.change{font-size:12px}.status{gap:6px;font-size:11px}.toolbar{gap:8px;padding:0 10px}.timeframes{gap:2px}.tf{min-width:38px;height:24px;font-size:11px;border-radius:4px}.divider{height:20px;margin:0 2px}.legend{gap:6px;font-size:11px}.toggle{height:26px;padding:0 8px;font-size:11px;border-radius:5px;gap:5px}.toggle i{width:8px;height:2px}.toolbar .btn{height:26px;padding:0 8px;font-size:11px;border-radius:5px}.vwap-select{height:26px;padding:0 7px;font-size:11px;border-radius:5px}.value-strip{min-height:26px;gap:12px;padding:0 10px;font-size:11px}.drawing-toolbar{top:6px;left:6px;padding:4px;gap:3px;border-radius:9px}.draw-tool{height:26px;min-width:28px;padding:0 7px;font-size:11px;border-radius:6px}.drawing-hint{left:6px;bottom:6px;font-size:11px;padding:6px 9px}.bl-settings-panel .btn,.backtest-panel .btn{height:30px;font-size:12px}@media(max-width:900px){.toolbar{padding:0 8px}.legend{gap:5px}.toggle,.toolbar .btn,.vwap-select{height:25px;font-size:10.5px;padding:0 7px}.tf{min-width:36px;height:23px;font-size:10.5px}.draw-tool{height:25px;font-size:10.5px;padding:0 6px}}


/* Better capture menu */
.capture-group{position:relative;display:inline-flex;align-items:center;gap:0}.capture-group>.btn{border-radius:5px 0 0 5px}.capture-group>.capture-caret{min-width:28px;padding:0 6px;border-left:0;border-radius:0 5px 5px 0}.capture-group.open>.btn{border-color:var(--blue);color:#fff;background:#1e222d}.capture-menu{position:absolute;top:calc(100% + 6px);left:0;min-width:220px;padding:6px;background:#10151f;border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 36px rgba(0,0,0,.45);display:none;z-index:50}.capture-menu.open{display:block}.capture-menu-item{width:100%;height:34px;display:flex;align-items:center;gap:8px;padding:0 10px;border:0;background:transparent;color:var(--text);font-size:12px;font-weight:800;border-radius:7px;cursor:pointer;text-align:left}.capture-menu-item:hover{background:#1e222d;color:#fff}.capture-selection-overlay{position:fixed;display:none;z-index:70;background:rgba(0,0,0,.08);outline:9999px solid rgba(0,0,0,.22);cursor:crosshair;touch-action:none}.capture-selection-overlay.active{display:block}.capture-selection-box{position:absolute;border:1px solid #7aa2ff;background:rgba(41,98,255,.16);box-shadow:0 0 0 1px rgba(255,255,255,.08) inset}.capture-selection-tip{position:absolute;left:10px;top:10px;padding:6px 10px;border-radius:8px;background:rgba(15,19,26,.92);border:1px solid rgba(42,46,57,.95);color:#d1d4dc;font-size:12px;font-weight:800;pointer-events:none;white-space:nowrap}@media(max-width:900px){.capture-menu{min-width:205px}.capture-menu-item{height:32px;font-size:11px}}


/* Single camera capture button */
#captureChart{min-width:34px;padding:0 8px;font-size:13px;line-height:1}.capture-group,.capture-menu,.capture-selection-overlay{display:none !important}


/* Hide indicator status strip */
.app{grid-template-rows:48px 42px 0 1fr}
.value-strip{display:none !important}

/* Vertical drawing toolbar */
.drawing-toolbar{left:6px !important;top:8px !important;display:flex;flex-direction:column;align-items:center;max-width:none !important;overflow:visible !important;padding:4px !important;gap:4px !important;border-radius:10px;min-width:42px}
.draw-tool{width:34px;min-width:34px;height:30px;padding:0 !important;display:flex;align-items:center;justify-content:center;font-size:13px !important;line-height:1}
.draw-color-group{display:flex;flex-direction:column;gap:4px;width:100%;align-items:center;padding:3px 0;border-top:1px solid rgba(42,46,57,.65);border-bottom:1px solid rgba(42,46,57,.65)}
.draw-color{width:18px;height:18px;border-radius:50%;border:1px solid rgba(255,255,255,.22);cursor:pointer;opacity:.88;padding:0;background:#333}
.draw-color[data-color="#ff3b30"]{background:#ff3b30}
.draw-color[data-color="#00c853"]{background:#00c853}
.draw-color.active{outline:2px solid #ffffff;outline-offset:1px;opacity:1}
.draw-tool.danger{color:#ff8a80}
.drawing-hint{left:52px !important;bottom:8px;max-width:min(420px,calc(100% - 64px))}
@media(max-width:900px){.app{grid-template-rows:auto auto 0 1fr}.drawing-toolbar{left:4px !important;top:6px !important;gap:3px !important}.draw-tool{width:32px;min-width:32px;height:28px;font-size:12px !important}.draw-color{width:16px;height:16px}.drawing-hint{left:46px !important;max-width:calc(100% - 54px)}}


/* Layout fix: larger main chart, RSI anchored at bottom */
.chart-layout{min-height:0;height:100%;display:flex !important;flex-direction:column;background:var(--bg)}
.chart-panel{position:relative;min-height:0}
.chart-panel:first-child{flex:1 1 auto;min-height:420px;border-bottom:1px solid var(--border)}
.chart-panel:last-child{flex:0 0 170px;min-height:170px;border-bottom:0;margin-top:auto}
#priceChart,#rsiChart{width:100%;height:100%}

/* Drawing toolbar usability fix */
.drawing-toolbar{max-height:calc(100% - 12px) !important;overflow-y:auto !important;overflow-x:hidden !important;padding-right:4px !important;scrollbar-width:thin}
.drawing-toolbar::-webkit-scrollbar{width:4px}.drawing-toolbar::-webkit-scrollbar-thumb{background:#2a2e39;border-radius:99px}
.draw-tool{width:32px !important;min-width:32px !important;height:28px !important;font-size:12px !important}
.draw-color-group{gap:3px !important;padding:2px 0 !important}
.drawing-hint{left:48px !important;bottom:8px;max-width:min(400px,calc(100% - 58px))}

@media(max-width:900px){
  .chart-panel:first-child{min-height:300px}
  .chart-panel:last-child{flex-basis:150px;min-height:150px}
  .drawing-toolbar{max-height:calc(100% - 8px) !important}
  .draw-tool{width:30px !important;min-width:30px !important;height:26px !important;font-size:11px !important}
  .drawing-hint{left:44px !important;max-width:calc(100% - 50px)}
}


/* HARD layout fix v2: RSI fixed to true screen bottom */
html,body{height:100%;overflow:hidden}
.app{height:100vh !important;display:flex !important;flex-direction:column !important;grid-template-rows:none !important;min-height:0}
.topbar{flex:0 0 48px}.toolbar{flex:0 0 42px}.value-strip{display:none !important;flex:0 0 0 !important;height:0 !important;min-height:0 !important;padding:0 !important;border:0 !important;overflow:hidden !important}
.chart-layout{position:relative !important;flex:1 1 auto !important;min-height:0 !important;height:auto !important;display:block !important;overflow:hidden !important;background:var(--bg)}
.chart-layout .chart-panel{position:absolute !important;left:0;right:0;min-height:0 !important;margin:0 !important;background:var(--bg)}
.chart-layout .chart-panel:first-child{top:0 !important;bottom:148px !important;height:auto !important;border-bottom:1px solid var(--border)}
.chart-layout .chart-panel:last-child{top:auto !important;bottom:0 !important;height:148px !important;min-height:148px !important;flex:none !important;border-top:1px solid var(--border);border-bottom:0 !important}
#priceChart,#rsiChart{position:absolute;inset:0;width:100% !important;height:100% !important}

/* HARD drawing toolbar fix v2: all buttons accessible */
#priceChart{position:absolute !important;inset:0 !important;overflow:hidden !important}
.drawing-toolbar{left:6px !important;top:8px !important;bottom:8px !important;height:auto !important;max-height:none !important;overflow-y:auto !important;overflow-x:hidden !important;display:flex !important;flex-direction:column !important;align-items:center !important;gap:3px !important;min-width:38px !important;width:38px !important;padding:4px 3px !important;border-radius:10px !important;scrollbar-width:thin !important;z-index:30 !important}
.drawing-toolbar::-webkit-scrollbar{width:4px}.drawing-toolbar::-webkit-scrollbar-thumb{background:#3a3f4b;border-radius:99px}
.draw-tool{width:30px !important;min-width:30px !important;height:25px !important;min-height:25px !important;padding:0 !important;display:flex !important;align-items:center !important;justify-content:center !important;font-size:11px !important;line-height:1 !important;border-radius:6px !important;flex:0 0 auto !important}
.draw-color-group{width:30px !important;display:flex !important;flex-direction:column !important;gap:3px !important;align-items:center !important;padding:2px 0 !important;flex:0 0 auto !important}
.draw-color{width:15px !important;height:15px !important;min-width:15px !important;min-height:15px !important;flex:0 0 auto !important}
.drawing-hint{left:50px !important;bottom:8px !important;max-width:min(420px,calc(100% - 58px)) !important}

@media(max-width:900px){
  .topbar{flex-basis:auto}.toolbar{flex-basis:auto}
  .chart-layout .chart-panel:first-child{bottom:132px !important}
  .chart-layout .chart-panel:last-child{height:132px !important;min-height:132px !important}
  .drawing-toolbar{left:4px !important;top:6px !important;bottom:6px !important;width:36px !important;min-width:36px !important;gap:2px !important;padding:3px !important}
  .draw-tool{width:28px !important;min-width:28px !important;height:23px !important;min-height:23px !important;font-size:10.5px !important}
  .draw-color-group{width:28px !important}.draw-color{width:14px !important;height:14px !important}
  .drawing-hint{left:44px !important;max-width:calc(100% - 52px) !important}
}


/* Final RSI resizable layout */
:root{--rsi-height:148px;--resize-handle:6px}
.chart-layout{position:relative !important;flex:1 1 auto !important;min-height:0 !important;height:auto !important;display:block !important;overflow:hidden !important;background:var(--bg)}
.chart-layout .chart-panel{position:absolute !important;left:0;right:0;min-height:0 !important;margin:0 !important;background:var(--bg)}
.chart-layout .chart-panel:first-child{top:0 !important;bottom:calc(var(--rsi-height) + var(--resize-handle)) !important;height:auto !important;border-bottom:0 !important}
.chart-layout .chart-panel:last-child{top:auto !important;bottom:0 !important;height:var(--rsi-height) !important;min-height:var(--rsi-height) !important;flex:none !important;border-top:0 !important;border-bottom:0 !important}
.rsi-resize-handle{position:absolute;left:0;right:0;bottom:var(--rsi-height);height:var(--resize-handle);z-index:28;cursor:row-resize;background:rgba(19,23,34,.96);border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
.rsi-resize-handle::after{content:"";position:absolute;left:50%;top:50%;width:64px;height:2px;transform:translate(-50%,-50%);border-radius:99px;background:#3a3f4b}
.rsi-resize-handle:hover::after,body.resizing-rsi .rsi-resize-handle::after{background:#2962ff}
body.resizing-rsi{user-select:none;cursor:row-resize}
#priceChart,#rsiChart{position:absolute !important;inset:0 !important;width:100% !important;height:100% !important}
.draw-color[data-color="#ff9800"]{background:#ff9800}
.draw-color{width:17px;height:17px}
@media(max-width:900px){:root{--rsi-height:136px}.chart-layout .chart-panel:first-child{bottom:calc(var(--rsi-height) + var(--resize-handle)) !important}.chart-layout .chart-panel:last-child{height:var(--rsi-height) !important;min-height:var(--rsi-height) !important}.rsi-resize-handle::after{width:48px}.draw-color{width:15px;height:15px}}


/* XTB compact checked topbar + inline drawing toolbar */
.app{height:100vh !important;display:flex !important;flex-direction:column !important;grid-template-rows:none !important;min-height:0 !important}
.topbar{flex:0 0 42px !important;min-height:42px !important;height:42px !important;gap:7px !important;padding:0 8px !important;overflow:hidden !important}
.logo{font-size:12px !important;letter-spacing:.15px !important;padding-right:6px !important;white-space:nowrap !important}
.topbar-timeframes{display:flex !important;align-items:center !important;gap:1px !important;flex:0 0 auto !important;border-right:1px solid var(--border);padding-right:6px;margin-right:2px;overflow:visible !important}
.topbar-timeframes .tf{height:22px !important;min-width:28px !important;padding:0 5px !important;font-size:10px !important;border-radius:4px !important}
.symbol-box{gap:5px !important}
.symbol-input{width:102px !important;height:26px !important;font-size:11px !important;padding:0 7px !important}
.topbar .btn{height:26px !important;padding:0 7px !important;font-size:10.5px !important;border-radius:5px !important}
.quick-symbols{gap:2px !important;padding-left:5px !important}
.quick-symbol{height:24px !important;min-width:34px !important;font-size:10px !important;border-radius:5px !important}
.symbol-title{font-size:12px !important;min-width:62px !important}
.price{font-size:14px !important}
.change{font-size:11px !important}
.status{font-size:10px !important;gap:5px !important}
.toolbar{flex:0 0 38px !important;height:38px !important;min-height:38px !important;padding:0 8px !important;gap:6px !important;overflow-x:auto !important;overflow-y:hidden !important}

.toolbar>.divider:first-of-type{display:none !important}
.legend{display:flex !important;align-items:center !important;gap:4px !important;min-width:max-content !important;overflow:visible !important}
.drawing-tools-inline{display:flex !important;align-items:center !important;flex:0 0 auto !important}
.drawing-divider{height:20px !important;margin:0 3px !important}
#drawingToolsMount .drawing-toolbar{position:static !important;inset:auto !important;left:auto !important;right:auto !important;top:auto !important;bottom:auto !important;width:auto !important;min-width:0 !important;max-width:none !important;height:26px !important;min-height:26px !important;max-height:26px !important;display:flex !important;flex-direction:row !important;align-items:center !important;gap:2px !important;padding:2px 3px !important;overflow:visible !important;border-radius:7px !important;box-shadow:none !important;background:rgba(15,19,26,.72) !important;backdrop-filter:none !important;z-index:10 !important;scrollbar-width:none !important}
#drawingToolsMount .drawing-toolbar::-webkit-scrollbar{display:none !important}
#drawingToolsMount .draw-tool{width:24px !important;min-width:24px !important;height:22px !important;min-height:22px !important;padding:0 !important;font-size:10.5px !important;border-radius:5px !important;line-height:1 !important;flex:0 0 auto !important}
#drawingToolsMount .draw-color-group{display:flex !important;flex-direction:row !important;width:auto !important;height:22px !important;gap:2px !important;padding:0 2px !important;border-top:0 !important;border-bottom:0 !important;border-left:1px solid rgba(42,46,57,.65) !important;border-right:1px solid rgba(42,46,57,.65) !important;align-items:center !important;flex:0 0 auto !important}
#drawingToolsMount .draw-color{width:12px !important;height:12px !important;min-width:12px !important;min-height:12px !important}
#drawingToolsMount .draw-color.active{outline:1.5px solid #fff !important;outline-offset:1px !important}
.toggle{height:24px !important;padding:0 6px !important;font-size:10px !important;border-radius:5px !important;gap:4px !important}
.toggle i{width:7px !important;height:2px !important}
.vwap-select{height:24px !important;padding:0 6px !important;font-size:10px !important;border-radius:5px !important}
.toolbar .btn{height:24px !important;padding:0 6px !important;font-size:10px !important;border-radius:5px !important}
.icon-btn{min-width:28px !important;padding:0 7px !important;font-size:14px !important;line-height:1 !important}
#copyShareLink{display:none !important}
.chart-layout{flex:1 1 auto !important;min-height:0 !important}
.drawing-hint{left:8px !important;bottom:8px !important;font-size:11px !important;z-index:28 !important}
@media(max-width:1100px){.status{display:none !important}.quick-symbol{min-width:30px !important}.topbar-timeframes .tf{min-width:26px !important;padding:0 4px !important}.price{font-size:13px !important}.change{display:none !important}}
@media(max-width:900px){.topbar{height:auto !important;min-height:42px !important;flex-wrap:wrap !important;padding:5px 6px !important}.toolbar{height:auto !important;min-height:36px !important;padding:4px 6px !important}.topbar-timeframes{order:10;width:100%;overflow-x:auto !important;border-right:0;padding-right:0}.legend{gap:3px !important}#drawingToolsMount .draw-tool{width:23px !important;min-width:23px !important;height:21px !important}.toggle,.toolbar .btn,.vwap-select{height:23px !important;font-size:9.5px !important;padding:0 5px !important}}


/* Bollinger Bands indicator */
.bb{background:linear-gradient(90deg,#00c853 0 30%,#ff9800 30% 70%,#00c853 70% 100%) !important}
.bb-upper-text,.bb-lower-text{color:#00c853 !important}.bb-middle-text{color:#ff9800 !important}


/* Price EMA/WMA custom length controls */
.ma-param{height:24px;display:inline-flex;align-items:center;gap:3px;padding:0 5px;border:1px solid var(--border);border-radius:5px;background:#0b0f16;color:var(--muted);font-size:10px;font-weight:900;white-space:nowrap;user-select:none}
.ma-param input{width:38px;height:18px;background:#111722;color:#fff;border:1px solid rgba(42,46,57,.9);border-radius:4px;padding:0 3px;font-size:10px;font-weight:900;text-align:center;outline:none}
.ma-param input:focus{border-color:var(--blue)}
.ma-apply{min-width:28px !important;padding:0 6px !important;font-size:10px !important}
@media(max-width:900px){.ma-param{height:23px;padding:0 4px;font-size:9.5px}.ma-param input{width:34px;height:17px;font-size:9.5px}.ma-apply{min-width:26px !important;padding:0 5px !important}}


/* Compact combined EMA/WMA controls */
.ma-combo{display:inline-flex !important;align-items:center !important;gap:3px !important;padding:0 5px !important;height:24px !important;min-height:24px !important;white-space:nowrap !important;cursor:pointer !important}
.ma-combo span{font-size:10px !important;font-weight:900 !important;line-height:1 !important}
.ma-combo input{width:32px !important;height:17px !important;margin:0 !important;padding:0 2px !important;border:1px solid rgba(42,46,57,.9) !important;border-radius:4px !important;background:#0b0f16 !important;color:#fff !important;text-align:center !important;font-size:10px !important;font-weight:900 !important;outline:none !important;appearance:textfield !important;-moz-appearance:textfield !important}
.ma-combo input::-webkit-outer-spin-button,.ma-combo input::-webkit-inner-spin-button{-webkit-appearance:none !important;margin:0 !important}
.ma-combo input:focus{border-color:var(--blue) !important;background:#111722 !important}
.ma-combo em{font-style:normal !important;font-size:9px !important;font-weight:800 !important;color:var(--muted) !important;line-height:1 !important}
.ma-param,.ma-apply{display:none !important}
@media(max-width:900px){.ma-combo{height:23px !important;min-height:23px !important;padding:0 4px !important;gap:2px !important}.ma-combo span{font-size:9.5px !important}.ma-combo input{width:29px !important;height:16px !important;font-size:9.5px !important}.ma-combo em{display:none !important}}


/* RSI drawing restore */
#rsiChart{position:relative;overflow:hidden}
#rsiChart.rsi-drawing-mode{cursor:crosshair}
#rsiChart.rsi-eraser-mode{cursor:not-allowed}


/* Mobile optimization for phone screens */
@media (max-width: 768px) {
  html, body, .app { height: 100dvh !important; }
  body { overflow: hidden !important; }
  .app { min-height: 100dvh !important; }

  .topbar {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 6px !important;
    gap: 4px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    overflow: visible !important;
    white-space: normal !important;
  }
  .logo { order: 1; font-size: 11px !important; padding-right: 4px !important; }
  .symbol-box { order: 2; gap: 4px !important; }
  .symbol-input { width: 86px !important; height: 24px !important; font-size: 10px !important; }
  .topbar .btn { height: 24px !important; padding: 0 6px !important; font-size: 10px !important; }
  .symbol-title { order: 3; min-width: 0 !important; font-size: 11px !important; }
  .price { order: 4; font-size: 13px !important; }
  .change { order: 5; font-size: 10px !important; }
  .status {
    order: 6;
    margin-left: auto !important;
    gap: 4px !important;
    font-size: 9px !important;
  }
  #wsStatus, #clock { display: none !important; }
  .topbar-timeframes {
    order: 10;
    width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border-right: 0 !important;
    padding-right: 0 !important;
    margin-right: 0 !important;
    padding-bottom: 2px !important;
    -webkit-overflow-scrolling: touch;
  }
  .topbar-timeframes .tf {
    flex: 0 0 auto;
    min-width: 26px !important;
    height: 22px !important;
    padding: 0 4px !important;
    font-size: 9px !important;
  }
  .quick-symbols {
    order: 11;
    width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border-left: 0 !important;
    padding-left: 0 !important;
    gap: 4px !important;
    -webkit-overflow-scrolling: touch;
  }
  .quick-symbol { flex: 0 0 auto; min-width: 38px !important; height: 24px !important; font-size: 10px !important; }

  .toolbar {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 34px !important;
    padding: 4px 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
  }
  .legend {
    min-width: max-content !important;
    gap: 3px !important;
    padding-bottom: 1px;
  }
  .toggle, .toolbar .btn, .vwap-select {
    height: 23px !important;
    font-size: 9px !important;
    padding: 0 5px !important;
    gap: 3px !important;
  }
  .toggle i { width: 6px !important; }
  .ma-combo { height: 23px !important; padding: 0 4px !important; gap: 2px !important; }
  .ma-combo span { font-size: 9px !important; }
  .ma-combo input { width: 28px !important; height: 16px !important; font-size: 9px !important; }
  .ma-combo em { display: none !important; }
  #drawingToolsMount .drawing-toolbar {
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    padding: 1px 2px !important;
    gap: 2px !important;
  }
  #drawingToolsMount .draw-tool {
    width: 22px !important;
    min-width: 22px !important;
    height: 20px !important;
    min-height: 20px !important;
    font-size: 9px !important;
  }
  #drawingToolsMount .draw-color-group {
    height: 20px !important;
    gap: 2px !important;
    padding: 0 2px !important;
  }
  #drawingToolsMount .draw-color {
    width: 11px !important;
    height: 11px !important;
    min-width: 11px !important;
    min-height: 11px !important;
  }

  .value-strip { display: none !important; }
  :root { --rsi-height: 118px; --resize-handle: 5px; }
  .rsi-resize-handle::after { width: 40px !important; }

  .backtest-panel,
  .bl-settings-panel {
    left: 6px !important;
    right: 6px !important;
    top: 6px !important;
    bottom: 6px !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 10px !important;
  }
  .backtest-panel { grid-template-rows: 40px auto 132px 1fr !important; }
  .bt-head { padding: 0 10px !important; }
  .bt-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 10px !important;
  }
  .bt-grid input, .bt-grid select, .bl-settings-grid input { height: 30px !important; font-size: 12px !important; }
  .bt-summary { grid-template-columns: 1fr 1fr !important; gap: 6px !important; padding: 8px !important; }
  .bt-table-wrap table { font-size: 11px !important; }
  .bl-settings-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 10px !important;
  }
  .bl-settings-actions { grid-template-columns: 1fr !important; }

  .drawing-hint {
    left: 6px !important;
    right: 6px !important;
    bottom: 6px !important;
    max-width: none !important;
    font-size: 10px !important;
    padding: 6px 8px !important;
  }
}

@media (max-width: 430px) {
  .logo { font-size: 10.5px !important; }
  .symbol-input { width: 78px !important; }
  .symbol-title { font-size: 10px !important; }
  .price { font-size: 12px !important; }
  .change { font-size: 9px !important; }
  .topbar-timeframes .tf { min-width: 24px !important; font-size: 8.5px !important; }
  .quick-symbol { min-width: 34px !important; font-size: 9px !important; }
  .toggle, .toolbar .btn, .vwap-select { font-size: 8.5px !important; }
  .ma-combo span, .ma-combo input { font-size: 8.5px !important; }
  :root { --rsi-height: 108px; }
}


/* ================================================================
   THANH KHUNG THOI GIAN KIEU TRADINGVIEW  (32 khung)
   Dat cuoi file de de len cac !important cu.
   ================================================================ */
.tv-tfbar{
  order:10 !important; width:100% !important;
  display:flex !important; align-items:center !important;
  gap:0 !important; flex-wrap:nowrap !important;
  overflow-x:auto !important; overflow-y:hidden !important;
  scrollbar-width:none; padding:2px 0 !important; margin:0 !important;
  border:0 !important;
}
.tv-tfbar::-webkit-scrollbar{height:0;display:none}
.tv-tfbar .tf{
  flex:0 0 auto !important;
  height:26px !important; min-width:0 !important;
  padding:0 8px !important;
  font-size:12px !important; font-weight:500 !important;
  line-height:26px !important;
  color:#b2b5be !important; background:transparent !important;
  border:0 !important; border-radius:4px !important;
  cursor:pointer; letter-spacing:.1px;
  transition:background .12s ease,color .12s ease;
}
.tv-tfbar .tf:hover{ background:#2a2e39 !important; color:#d1d4dc !important; }
.tv-tfbar .tf.active{ background:#2a2e39 !important; color:#fff !important; font-weight:600 !important; }
.tv-tfbar .tf-sep{
  flex:0 0 auto; width:1px; height:16px; margin:0 6px;
  background:#2a2e39; display:inline-block;
}
@media (max-width:900px){
  .tv-tfbar .tf{ padding:0 6px !important; font-size:11px !important; }
  .tv-tfbar .tf-sep{ margin:0 3px; }
}

/* ================================================================
   THEME SANG XAM cho vo giao dien (toolbar, legend, bang backtest...)
   Dat cuoi file de de len bang mau toi ban dau.
   ================================================================ */
:root{
  --bg:#d6d6d6; --top:#cdcdcd; --border:#a9a9a9;
  --text:#1e222d; --muted:#5d6270;
  --white:#131722; --gray:#4a4f5c;
}
body,.app{ background:var(--bg) !important; color:var(--text) !important; }
.topbar,.toolbar,.value-strip{
  background:var(--top) !important; color:var(--text) !important;
  border-color:var(--border) !important;
}
.logo{ color:#1e222d !important; }
.btn,.toggle,.symbol-input,.vwap-select,select,input[type=number],input[type=date]{
  background:#e3e3e3 !important; color:#1e222d !important;
  border:1px solid var(--border) !important;
}
.btn:hover,.toggle:hover{ background:#eee !important; }
.btn.primary{ background:#2962ff !important; color:#fff !important; border-color:#2962ff !important; }
.toggle.active,.quick-symbol.active{ background:#c2c2c2 !important; color:#131722 !important; }
.value-strip{ border-top:1px solid var(--border) !important; }
.backtest-panel,.bl-settings-panel{
  background:#e0e0e0 !important; color:var(--text) !important;
  border-color:var(--border) !important;
}
.backtest-panel table th,.backtest-panel table td{ border-color:var(--border) !important; color:var(--text) !important; }
.status,.change,.price,.symbol-title{ color:var(--text) !important; }
.change.green{ color:#0b8f5a !important; } .change.red{ color:#c62828 !important; }
.rsi-resize-handle{ background:var(--border) !important; }

/* thanh khung thoi gian - ban sang */
.tv-tfbar .tf{ color:#4a4f5c !important; }
.tv-tfbar .tf:hover{ background:#bdbdbd !important; color:#131722 !important; }
.tv-tfbar .tf.active{ background:#b0b0b0 !important; color:#131722 !important; }
.tv-tfbar .tf-sep{ background:#b0b0b0 !important; }

/* not not phan con sot mau toi: nut coin nhanh + thanh cong cu ve */
.quick-symbol{
  background:#e3e3e3 !important; color:#4a4f5c !important;
  border:1px solid var(--border) !important;
}
.quick-symbol:hover{ background:#eee !important; color:#131722 !important; }
.quick-symbol.active{ background:#b0b0b0 !important; color:#131722 !important; }
.draw-tool{
  background:#e3e3e3 !important; color:#4a4f5c !important;
  border:1px solid var(--border) !important;
}
.draw-tool:hover{ background:#eee !important; color:#131722 !important; }
.draw-tool.active{ background:#b0b0b0 !important; color:#131722 !important; }
.drawing-tools-inline{ background:transparent !important; }
.divider,.drawing-divider{ background:var(--border) !important; }

/* --- Menu chuot phai tren chart --- */
.chart-ctx-menu{
  position:fixed; z-index:9999; min-width:210px; width:max-content; max-width:min(340px,90vw); padding:4px;
  background:#f2f2f2; color:#1e222d;
  border:1px solid #a9a9a9; border-radius:8px;
  box-shadow:0 8px 24px rgba(0,0,0,.22);
  font-size:13px; user-select:none;
}
.chart-ctx-menu .ctx-item{
  display:flex; align-items:center; gap:9px; width:100%;
  padding:7px 9px; background:transparent; border:0; border-radius:5px;
  color:inherit; font-size:13px; text-align:left; cursor:pointer;
}
.chart-ctx-menu .ctx-item:hover{ background:#dcdcdc; }
.chart-ctx-menu .ctx-ico{ width:14px; text-align:center; opacity:.75; }
.chart-ctx-menu .ctx-txt{ flex:1; white-space:nowrap; }
.chart-ctx-menu .ctx-key{ opacity:.55; font-size:11.5px; }
.chart-ctx-menu .ctx-sep{ height:1px; margin:4px 2px; background:#c8c8c8; }

/* --- Thanh cong cu ve noi tren chart (kieu TradingView) --- */
.float-draw{
  position:fixed; z-index:900;
  display:flex; align-items:center; gap:2px;
  padding:5px 6px 5px 3px;
  background:#20232b; border:1px solid #33373f; border-radius:10px;
  box-shadow:0 6px 20px rgba(0,0,0,.30);
}
.float-draw.dang-keo{ opacity:.9; box-shadow:0 10px 26px rgba(0,0,0,.4); }
.float-draw .fd-grip{
  display:flex; align-items:center; padding:0 4px;
  color:#6b7280; cursor:grab;
}
.float-draw .fd-grip:active{ cursor:grabbing; }
.float-draw .drawing-toolbar{
  /* thanh goc duoc dat position:absolute + overflow:hidden voi kich thuoc
     co dinh -> phai pha het, neu khong cac nut bi cat mat. */
  position:static !important;
  display:flex !important; flex-direction:row !important; align-items:center;
  gap:1px; flex-wrap:nowrap !important;
  width:auto !important; height:auto !important;
  min-width:0 !important; min-height:0 !important;
  max-width:none !important; max-height:none !important;
  inset:auto !important; overflow:visible !important;
  background:transparent !important; border:0 !important; box-shadow:none !important;
  padding:0 !important; margin:0 !important;
}
.float-draw .draw-tool{
  display:inline-flex !important; align-items:center; justify-content:center;
  width:30px !important; height:30px !important; padding:0 !important;
  background:transparent !important; border:0 !important; border-radius:6px !important;
  color:#c8ccd4 !important; cursor:pointer;
}
.float-draw .draw-tool:hover{ background:#2f333c !important; color:#fff !important; }
.float-draw .draw-tool.active{ background:#2962ff !important; color:#fff !important; }
.float-draw .draw-tool.danger:hover{ background:#a02724 !important; color:#fff !important; }
.float-draw .draw-color{
  width:14px !important; height:14px !important; margin:0 2px !important;
  border-radius:50% !important; border:1.5px solid rgba(255,255,255,.35) !important;
}
.float-draw .draw-color.active{ border-color:#fff !important; transform:scale(1.15); }
/* an cho cam cu tren thanh ngang */
.toolbar #drawingToolsMount, .toolbar .drawing-divider,
.topbar #drawingToolsMount, .topbar .drawing-divider{ display:none !important; }

/* nhom 3 o mau: goc la cot doc -> doi thanh hang ngang */
.float-draw .draw-color-group{
  display:flex !important; flex-direction:row !important; align-items:center;
  gap:3px !important; width:auto !important; height:auto !important;
  padding:0 5px !important; margin:0 2px !important;
  border-left:1px solid #33373f; border-right:1px solid #33373f;
}

/* --- Thanh cong cu doi tuong (hien khi chon mot net ve) --- */
.obj-bar{
  position:fixed; z-index:950;
  display:flex; align-items:center; gap:3px;
  padding:5px 7px;
  background:#20232b; border:1px solid #33373f; border-radius:9px;
  box-shadow:0 6px 20px rgba(0,0,0,.32);
}
.obj-bar .ob-grip{ display:flex; color:#6b7280; padding-right:3px; }
.obj-bar .ob-colors{
  display:flex; align-items:center; gap:4px;
  padding:0 6px; border-left:1px solid #33373f; border-right:1px solid #33373f;
}
.obj-bar .ob-color{
  width:15px; height:15px; border-radius:50%; cursor:pointer;
  border:1.5px solid rgba(255,255,255,.35); padding:0;
}
.obj-bar .ob-color:hover{ border-color:#fff; transform:scale(1.12); }
.obj-bar .ob-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:28px; height:28px; padding:0;
  background:transparent; border:0; border-radius:6px;
  color:#c8ccd4; cursor:pointer;
}
.obj-bar .ob-btn:hover{ background:#2f333c; color:#fff; }
.obj-bar .ob-btn[data-lam="xoa"]:hover{ background:#a02724; color:#fff; }

/* --- Bo cam giac chia cat man hinh giua chart gia va khung RSI ---
   Thanh keo chinh chieu cao truoc day to mau --border (#a9a9a9) nen thanh
   mot vach xam dai vat ngang. Cho no dong mau nen, bo vien, chi giu lai
   chau keo nho o giua va lam mo di - dam len khi ro chuot vao. */
.rsi-resize-handle{
  background:var(--bg) !important;
  border-top:0 !important;
  border-bottom:0 !important;
}
.rsi-resize-handle::after{
  background:rgba(0,0,0,.16) !important;
  width:36px !important; height:2px !important;
  transition:background .15s ease, width .15s ease;
}
.rsi-resize-handle:hover::after,
body.resizing-rsi .rsi-resize-handle::after{
  background:#2962ff !important;
  width:48px !important;
}
/* hai khung khong co vien ngan */
.chart-layout .chart-panel:first-child{ border-bottom:0 !important; }
.chart-layout .chart-panel:last-child { border-top:0 !important; }

/* Chau keo: an han khi khong dung toi, chi hien khi ro chuot vao
   -> khong con vet mau nao lam lo duong chia giua hai khung. */
.rsi-resize-handle::after{
  opacity:0 !important;
  background:rgba(0,0,0,.28) !important;
  transition:opacity .15s ease, background .15s ease, width .15s ease;
}
.rsi-resize-handle:hover::after,
body.resizing-rsi .rsi-resize-handle::after{
  opacity:1 !important;
  background:#2962ff !important;
}

/* --- Bang cai dat RSI --- */
.rsi-settings-panel{
  position:fixed; right:14px; top:96px; z-index:940; width:340px; max-height:78vh;
  display:none; flex-direction:column;
  background:#e6e6e6; color:#1e222d;
  border:1px solid #a9a9a9; border-radius:10px;
  box-shadow:0 10px 30px rgba(0,0,0,.25); font-size:12.5px;
}
.rsi-settings-panel.active{ display:flex; }
.rsi-settings-panel .rs-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:9px 11px; border-bottom:1px solid #c4c4c4; font-size:13.5px;
}
.rsi-settings-panel .rs-body{ padding:9px 11px 12px; overflow:auto; }
.rsi-settings-panel .rs-title{ margin:11px 0 5px; font-weight:600; color:#3c4043; }
.rsi-settings-panel .rs-title:first-child{ margin-top:2px; }
.rsi-settings-panel .rs-row{
  display:flex; align-items:center; gap:7px; margin:5px 0; flex-wrap:wrap;
}
.rsi-settings-panel .rs-row>span{ min-width:104px; }
.rsi-settings-panel label{ display:flex; align-items:center; gap:5px; }
.rsi-settings-panel label.ck{ gap:6px; font-weight:400; }
.rsi-settings-panel input[type=number]{
  width:62px; padding:3px 5px; background:#fff; color:#1e222d;
  border:1px solid #b4b4b4; border-radius:5px;
}
.rsi-settings-panel input[type=number].mo{ width:52px; }
.rsi-settings-panel input[type=color]{
  width:30px; height:24px; padding:0; border:1px solid #b4b4b4;
  border-radius:5px; background:#fff; cursor:pointer;
}
.rsi-settings-panel select{
  padding:3px 5px; background:#fff; color:#1e222d;
  border:1px solid #b4b4b4; border-radius:5px;
}
.rsi-settings-panel .rs-lv{ gap:8px; }
.rsi-settings-panel .rs-actions{
  display:flex; gap:8px; margin-top:14px; padding-top:11px; border-top:1px solid #c4c4c4;
}


/* muc tang/giam cua tung cay nen tren dai OHLC */
.ohlc-chg{ margin-left:4px; font-weight:600; }
.ohlc-chg.tang{ color:#0b8f5a !important; }
.ohlc-chg.giam{ color:#c62828 !important; }


/* --- Legend noi tren chart, kieu TradingView --- */
.tv-legend{
  /* can giua theo chieu ngang; --tvl-shift bu lai be rong truc gia ben phai
     de legend nam giua VUNG VE chu khong giua ca the chart */
  position:absolute; left:50%; transform:translateX(calc(-50% - (var(--tvl-shift,0px)/2)));
  top:4px; z-index:20; text-align:center;
  pointer-events:none; user-select:none;
  font-size:12px; line-height:1.45; color:#1e222d;
  
}


.tv-legend .tvl-per.tang{ color:#0b8f5a; } .tv-legend .tvl-per.giam{ color:#c62828; }



.tv-legend .tvl-chg{ font-weight:600; opacity:1 !important; }
.tv-legend .tvl-chg.tang{ color:#0b8f5a; }
.tv-legend .tvl-chg.giam{ color:#c62828; }


/* legend mot dong */
.tv-legend .tvl-line{
  display:flex; align-items:center; justify-content:center;
  gap:8px; white-space:nowrap;
}
.tv-legend .tvl-line>span{ opacity:.72; }
.tv-legend .tvl-sym{ font-weight:600; opacity:1; }
.tv-legend .tvl-v{ opacity:.72; }
.tv-legend .tvl-v b{ margin-left:3px; font-weight:600; color:#1e222d; }

/* --- Lop ve chau keo cua net dang chon --- */
.handle-layer{
  position:absolute; inset:0; z-index:19; pointer-events:none;
}
/* --- Bang cai dat cua net dang chon: them do day + kieu net --- */
.obj-bar .ob-group{
  display:flex; align-items:center;
  padding:0 5px; border-left:1px solid #33373f;
}
.obj-bar .ob-sel{
  background:#2a2e39; color:#d8dbe2; border:1px solid #3a3f4b;
  border-radius:5px; padding:3px 5px; font-size:11.5px; cursor:pointer;
}
.obj-bar .ob-color.chon{ border-color:#fff; transform:scale(1.15); }


/* nut dong/xoa cua bang cai dat net ve: to hon cho de bam */
.obj-bar .ob-btn{ width:30px; height:30px; }
.obj-bar .ob-btn[data-lam="dong"]{ margin-left:2px; }
.obj-bar .ob-btn[data-lam="dong"]:hover{ background:#3a3f4b; color:#fff; }

/* bo vien focus dinh lai tren nut cua bang cai dat net ve */
.obj-bar .ob-btn:focus, .obj-bar .ob-color:focus{ outline:none; }
.obj-bar .ob-btn:focus-visible{ outline:2px solid #2962ff; outline-offset:1px; }


/* nut an thanh cong cu ve */
.float-draw .fd-hide{
  display:inline-flex; align-items:center; justify-content:center;
  width:26px; height:26px; margin-left:4px; padding:0;
  background:transparent; border:0; border-radius:6px;
  color:#8b909a; cursor:pointer;
}
.float-draw .fd-hide:hover{ background:#3a3f4b; color:#fff; }
/* dau phien ban */
.build-stamp{ margin-left:8px; opacity:.45; font-size:10px; letter-spacing:.3px; }


/* ===== LOI: .obj-bar dat display:flex theo class, de len [hidden]{display:none}
   cua trinh duyet, nen dat bar.hidden=true KHONG an duoc bang.
   Phai khai bao ro rang o day. Ap dung cho moi lop noi tuong tu. ===== */
.obj-bar[hidden], .chart-ctx-menu[hidden], .float-draw[hidden]{
  display:none !important;
}

/* lop noi duong ke doc xuong khung RSI */
.vline-layer{
  /* neo o day .chart-layout, cao bang khung RSI + thanh keo -> khong con
     vet dut ngang o cho noi giua hai khung */
  position:absolute; left:0; right:0; bottom:0; top:auto;
  z-index:29; pointer-events:none;
}

/* --- Bang cai dat mau + do day chi bao --- */
.style-panel{ width:380px; }
.style-panel .st-head{
  display:grid; grid-template-columns:1fr 34px 58px 66px; gap:8px;
  align-items:center; padding:4px 0 6px; font-weight:600; color:#3c4043;
  border-bottom:1px solid #c4c4c4; margin-bottom:4px;
}
.style-panel .st-head span:not(:first-child){ text-align:center; font-size:11px; }
.style-panel .st-row{
  display:grid; grid-template-columns:1fr 34px 58px 66px; gap:8px;
  align-items:center; padding:3px 0;
}
.style-panel .st-row:hover{ background:rgba(0,0,0,.04); border-radius:5px; }
.style-panel .st-ten{ font-size:12.5px; }
.style-panel .st-row input[type=number]{ width:100%; }
.style-panel .st-row select{ width:100%; }
.style-panel .st-trong{ text-align:center; opacity:.4; }


/* --- O chon mau tu do + do duc tren thanh cai dat net ve --- */
.obj-bar .ob-pick{
  width:26px; height:24px; padding:0; margin-left:3px;
  background:#2a2e39; border:1px solid #3a3f4b; border-radius:5px; cursor:pointer;
}
.obj-bar .ob-mo{
  width:48px; margin-left:3px; padding:3px 4px; font-size:11.5px;
  background:#2a2e39; color:#d8dbe2; border:1px solid #3a3f4b; border-radius:5px;
}
/* --- Bang cai dat vung ngang --- */
.zone-panel{
  position:fixed; z-index:960; width:300px;
  background:#20232b; color:#d8dbe2;
  border:1px solid #33373f; border-radius:9px;
  box-shadow:0 8px 26px rgba(0,0,0,.35); font-size:12.5px;
}
.zone-panel[hidden]{ display:none !important; }
.zone-panel .zp-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 10px; border-bottom:1px solid #33373f;
}
.zone-panel .zp-head .btn{ background:#2a2e39 !important; color:#d8dbe2 !important; border-color:#3a3f4b !important; }
.zone-panel .zp-body{ padding:8px 10px 12px; }
.zone-panel .zp-row{ display:flex; align-items:center; gap:7px; margin:7px 0; }
.zone-panel .zp-row>label{ flex:1; display:flex; align-items:center; gap:6px; }
.zone-panel input[type=color]{ width:28px; height:22px; padding:0; background:#2a2e39; border:1px solid #3a3f4b; border-radius:5px; cursor:pointer; }
.zone-panel input[type=number]{ width:54px; padding:3px 4px; background:#2a2e39; color:#d8dbe2; border:1px solid #3a3f4b; border-radius:5px; }
.zone-panel select{ padding:3px 5px; background:#2a2e39; color:#d8dbe2; border:1px solid #3a3f4b; border-radius:5px; }
.zone-panel em{ opacity:.6; font-style:normal; }

/* tay cam keo thanh cai dat net ve */
.obj-bar .ob-grip{ cursor:grab; padding:0 4px; }
.obj-bar .ob-grip:active{ cursor:grabbing; }
.obj-bar.dang-keo{ opacity:.92; box-shadow:0 10px 28px rgba(0,0,0,.42); }

/* --- Bang mau rieng (thay bo chon mau cua trinh duyet) --- */
.mau-panel{
  position:fixed; z-index:980;
  background:#20232b; color:#d8dbe2;
  border:1px solid #33373f; border-radius:9px;
  box-shadow:0 10px 28px rgba(0,0,0,.4); font-size:12px;
  user-select:none;
}
.mau-panel[hidden]{ display:none !important; }
.mau-panel .mp-head{
  display:flex; align-items:center; gap:8px;
  padding:6px 9px; border-bottom:1px solid #33373f;
}
.mau-panel .mp-grip{ cursor:grab; color:#6b7280; letter-spacing:-2px; }
.mau-panel .mp-grip:active{ cursor:grabbing; }
.mau-panel .mp-head b{ flex:1; font-weight:600; }
.mau-panel .mp-x{
  background:transparent; border:0; color:#8b909a; cursor:pointer;
  width:22px; height:22px; border-radius:5px; font-size:12px;
}
.mau-panel .mp-x:hover{ background:#3a3f4b; color:#fff; }
.mau-panel .mp-body{ padding:8px 9px 10px; }
.mau-panel .mp-row{ display:flex; gap:3px; margin-bottom:3px; }
.mau-panel .mp-o{
  width:18px; height:18px; padding:0; cursor:pointer;
  border:1px solid rgba(255,255,255,.18); border-radius:3px;
}
.mau-panel .mp-o:hover{ transform:scale(1.18); border-color:#fff; }
.mau-panel .mp-o.chon{ border:2px solid #fff; }
.mau-panel .mp-tuy{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  margin-top:9px; padding-top:9px; border-top:1px solid #33373f;
}
.mau-panel .mp-tuy label{ display:flex; align-items:center; gap:6px; }
.mau-panel .mp-tuy input[type=color]{
  width:26px; height:22px; padding:0; background:#2a2e39;
  border:1px solid #3a3f4b; border-radius:5px; cursor:pointer;
}
.mau-panel .mp-tuy input[type=range]{ width:96px; }
.mau-panel .mp-pct{ min-width:34px; text-align:right; opacity:.8; }
/* nut swatch tren thanh cai dat */
.obj-bar .ob-pick{
  width:26px; height:24px; padding:0; margin-left:3px;
  border:1px solid #3a3f4b; border-radius:5px; cursor:pointer;
}
.obj-bar .ob-pick:hover{ border-color:#fff; }

/* Bo 3 o mau tren thanh cong cu ve - mau da chinh duoc cho tung net
   qua bang mau rieng nen chung khong con can thiet. */
.float-draw .draw-color-group{ display:none !important; }


/* Bo cong cu thuoc khoi thanh cong cu ve - cong cu "Do khoang gia va thoi gian"
   da lam viec do day du hon (co khung, so nen, so ngay). */
.float-draw .draw-tool[data-tool="ruler"]{ display:none !important; }

/* bang mau co dinh: bo tay cam keo */
.mau-panel .mp-grip{ display:none !important; }

/* ================================================================
   BANG MAU + THANH CAI DAT - trinh bay theo TradingView
   ================================================================ */
.mau-panel{
  background:#1e222d !important; border:1px solid #2a2e39 !important;
  border-radius:8px !important; box-shadow:0 8px 24px rgba(0,0,0,.5) !important;
  font-size:11.5px !important;
}
.mau-panel .mp-head{
  padding:7px 10px 6px !important; border-bottom:1px solid #2a2e39 !important;
}
.mau-panel .mp-head b{ font-size:11.5px; font-weight:500; color:#b2b5be; }
.mau-panel .mp-x{ width:20px; height:20px; font-size:11px; color:#787b86; }
.mau-panel .mp-x:hover{ background:#2a2e39; color:#d1d4dc; }
.mau-panel .mp-body{ padding:9px 10px 10px !important; }
.mau-panel .mp-row{ display:flex; gap:4px; margin-bottom:4px; }
.mau-panel .mp-row:last-of-type{ margin-bottom:0; }
.mau-panel .mp-o{
  width:20px !important; height:20px !important; padding:0;
  border:0 !important; border-radius:2px !important; cursor:pointer;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.07);
  transition:transform .08s ease;
}
.mau-panel .mp-o:hover{ transform:scale(1.15); box-shadow:inset 0 0 0 1px rgba(255,255,255,.5); }
.mau-panel .mp-o.chon{
  box-shadow:0 0 0 2px #1e222d, 0 0 0 3.5px #2962ff !important;
}
.mau-panel .mp-ngan{ height:1px; background:#2a2e39; margin:10px 0 9px; }
.mau-panel .mp-nhan{ display:block; color:#787b86; font-size:11px; margin-bottom:6px; }
.mau-panel .mp-tuy{ display:block; }
.mau-panel .mp-them{
  position:relative; display:inline-flex; align-items:center; justify-content:center;
  width:20px; height:20px; border-radius:2px; cursor:pointer;
  border:1px dashed #434651; color:#787b86; font-size:13px; line-height:1;
}
.mau-panel .mp-them:hover{ border-color:#787b86; color:#d1d4dc; }
.mau-panel .mp-them input[type=color]{
  position:absolute; inset:0; opacity:0; width:100%; height:100%;
  padding:0; border:0; cursor:pointer;
}
.mau-panel .mp-opa{ margin-top:11px; }
.mau-panel .mp-opa input[type=range]{
  -webkit-appearance:none; appearance:none;
  width:calc(100% - 46px); height:8px; border-radius:4px; vertical-align:middle;
  background:linear-gradient(90deg,transparent,var(--mp-mau,#2962ff)),
             repeating-conic-gradient(#3a3f4b 0 25%,#2a2e39 0 50%) 0 0/8px 8px;
  cursor:pointer;
}
.mau-panel .mp-opa input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none; width:12px; height:12px; border-radius:50%;
  background:#fff; box-shadow:0 0 0 1px rgba(0,0,0,.4); cursor:pointer;
}
.mau-panel .mp-pct{
  display:inline-block; width:40px; margin-left:6px; text-align:center;
  padding:2px 0; background:#2a2e39; border-radius:3px;
  color:#d1d4dc; font-size:11px; vertical-align:middle;
}

/* --- Thanh cai dat net ve: manh gon kieu TradingView --- */
.obj-bar{
  gap:1px !important; padding:3px 5px !important;
  background:#1e222d !important; border:1px solid #2a2e39 !important;
  border-radius:7px !important; box-shadow:0 6px 20px rgba(0,0,0,.45) !important;
}
.obj-bar .ob-grip{ padding:0 5px 0 2px !important; color:#5d606b !important; }
.obj-bar .ob-colors{
  gap:3px !important; padding:0 5px !important;
  border-left:1px solid #2a2e39 !important; border-right:1px solid #2a2e39 !important;
}
.obj-bar .ob-color{ width:13px !important; height:13px !important; border-width:1px !important; }
.obj-bar .ob-pick{ width:22px !important; height:20px !important; border-radius:3px !important; }
.obj-bar .ob-mo{
  width:42px !important; height:20px !important; padding:0 4px !important;
  font-size:11px !important; background:#2a2e39 !important;
  border:1px solid #363a45 !important; border-radius:3px !important;
}
.obj-bar .ob-group{ padding:0 4px !important; border-left:1px solid #2a2e39 !important; }
.obj-bar .ob-sel{
  height:22px; padding:0 4px !important; font-size:11px !important;
  background:#2a2e39 !important; border:1px solid #363a45 !important; border-radius:3px !important;
}
.obj-bar .ob-btn{ width:26px !important; height:26px !important; border-radius:4px !important; color:#b2b5be !important; }
.obj-bar .ob-btn:hover{ background:#2a2e39 !important; color:#d1d4dc !important; }


/* --- Sua bo cuc phan duoi bang mau --- */
.mau-panel .mp-tuy{
  display:flex !important; align-items:center; gap:8px; flex-wrap:wrap;
}
.mau-panel .mp-tuy .mp-nhan{ margin:0 !important; }
.mau-panel .mp-opa .mp-nhan{ margin-bottom:7px !important; }
.mau-panel .mp-opa-row{ display:flex; align-items:center; gap:8px; }
.mau-panel .mp-opa-row input[type=range]{ flex:1; width:auto !important; }
.mau-panel .mp-pct{ margin-left:0 !important; flex:0 0 40px; }

/* ================================================================
   MAU CHU TRONG CAC BANG NEN TOI
   Theme sang co luat chung "select, input[type=number] { color:#1e222d
   !important }" nen chu trong thanh cai dat toi bi den tren nen den,
   gan nhu khong doc duoc. Ep lai mau sang o day.
   ================================================================ */
.obj-bar .ob-sel,
.obj-bar .ob-mo,
.obj-bar select,
.obj-bar input[type=number]{
  color:#d1d4dc !important;
  background:#2a2e39 !important;
  border-color:#363a45 !important;
}
.obj-bar .ob-sel option{ color:#d1d4dc !important; background:#2a2e39 !important; }
.obj-bar .ob-mo::placeholder{ color:#787b86 !important; }

.zone-panel select,
.zone-panel input[type=number]{
  color:#d8dbe2 !important;
  background:#2a2e39 !important;
  border-color:#3a3f4b !important;
}
.zone-panel select option{ color:#d8dbe2 !important; background:#2a2e39 !important; }

.mau-panel input[type=number],
.mau-panel select{ color:#d1d4dc !important; background:#2a2e39 !important; }


/* O chon mau trong bang cai dat vung - bam vao mo bang mau co thanh Opacity */
.zone-panel .zp-sw{
  width:34px; height:22px; padding:0; cursor:pointer;
  border:1px solid #3a3f4b; border-radius:4px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.06);
  background-image:repeating-conic-gradient(#3a3f4b 0 25%,#2a2e39 0 50%);
  background-size:8px 8px;
}
.zone-panel .zp-sw:hover{ border-color:#787b86; }
.zone-panel .zp-row>label{ flex:0 0 auto; min-width:96px; }


/* O mau tren thanh cai dat: Nen / Vien hien thang ra ngoai */
.obj-bar .ob-nhan{ color:#787b86; font-size:11px; margin:0 1px 0 3px; }
.obj-bar .ob-sw{
  width:26px; height:20px; padding:0; cursor:pointer;
  border:1px solid #3a3f4b; border-radius:3px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.06);
  background-image:repeating-conic-gradient(#3a3f4b 0 25%,#2a2e39 0 50%);
  background-size:8px 8px;
}
.obj-bar .ob-sw:hover{ border-color:#787b86; }


/* Nut mau kieu TradingView: icon o tren, vach mau o duoi */
.obj-bar .ob-sw{
  position:relative; display:inline-flex; flex-direction:column;
  align-items:center; justify-content:flex-start;
  width:26px !important; height:26px !important; padding:2px 0 0 !important;
  background:transparent !important; background-image:none !important;
  border:0 !important; border-radius:4px !important;
  color:#b2b5be; cursor:pointer;
}
.obj-bar .ob-sw:hover{ background:#2a2e39 !important; color:#d1d4dc; }
.obj-bar .ob-sw i{
  display:block; width:16px; height:3px; margin-top:2px; border-radius:1px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.12);
}
.obj-bar .ob-nhan{ display:none; }


/* Cac dieu khien phu trong bang mau (do day, kieu net, keo dai, duong giua) */
.mau-panel .mp-hang{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; margin-top:8px;
}
.mau-panel .mp-nhan2{ color:#787b86; font-size:11px; }
.mau-panel .mp-hang select{
  flex:0 0 96px; padding:3px 5px; font-size:11px;
  background:#2a2e39 !important; color:#d1d4dc !important;
  border:1px solid #363a45; border-radius:3px; cursor:pointer;
}
.mau-panel .mp-ck{ display:flex; align-items:center; gap:7px; color:#d1d4dc; font-size:11.5px; }


/* Dropdown kieu net co hinh net that (giong TradingView) */
.mau-panel .mp-net-chon{ position:relative; flex:0 0 96px; }
.mau-panel .mp-net-nut{
  display:flex; align-items:center; justify-content:space-between; gap:6px;
  width:100%; padding:4px 6px; cursor:pointer;
  background:#2a2e39; color:#d1d4dc;
  border:1px solid #363a45; border-radius:3px;
}
.mau-panel .mp-net-nut:hover{ border-color:#4a4f5c; }
.mau-panel .mp-mui{ font-size:9px; opacity:.7; }
.mau-panel .mp-net-menu{
  position:absolute; right:0; top:calc(100% + 4px); z-index:5; min-width:140px;
  background:#1e222d; border:1px solid #363a45; border-radius:5px;
  box-shadow:0 6px 18px rgba(0,0,0,.5); padding:3px;
}
.mau-panel .mp-net-menu[hidden]{ display:none !important; }
.mau-panel .mp-net-muc{
  display:flex; align-items:center; gap:10px; width:100%;
  padding:6px 8px; cursor:pointer; text-align:left;
  background:transparent; border:0; border-radius:3px;
  color:#d1d4dc; font-size:11.5px;
}
.mau-panel .mp-net-muc:hover{ background:#2a2e39; }
.mau-panel .mp-net-muc.chon{ background:#2a2e39; }
.mau-panel .mp-net{ flex:0 0 40px; }

.mau-panel .mp-nhan-net{ display:inline-flex; align-items:center; color:#b2b5be; }

.mau-panel .mp-net-nut{ gap:4px; }
.mau-panel .mp-net-nut b{ font-weight:400; font-size:11px; }


/* Nut "+ Add text" cho vung ngang */
.add-text-btn{
  position:fixed; z-index:945;
  display:inline-flex; align-items:center; gap:5px;
  padding:3px 8px; cursor:pointer;
  background:transparent; border:0;
  color:#e05a7a; font-size:12.5px; font-weight:600;
  
}
.add-text-btn[hidden]{ display:none !important; }
.add-text-btn:hover{ color:#c2185b; }
.add-text-btn span{ font-size:14px; line-height:1; }


/* O nhap chu ngay tren chart (khong dung hop thoai) */
.add-text-input{
  position:fixed; z-index:946;
  min-width:120px; padding:2px 4px;
  background:transparent; border:0; border-bottom:1px solid currentColor;
  font-size:12.5px; font-weight:600; outline:none;
  
}
.add-text-input[hidden]{ display:none !important; }
.add-text-btn{ opacity:.75; }
.add-text-btn:hover{ opacity:1; }

/* Dem nguoc dong nen tren truc gia phai - dinh ngay duoi nhan gia,
   nhin nhu mot nhan hai dong giong TradingView. */
.tv-dem-nen{
  position:absolute; right:0; z-index:4; pointer-events:none;
  box-sizing:border-box; text-align:center;
  padding:2px 0 3px;
  font:600 11px/1.1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  letter-spacing:.2px; color:#131722;
  border-radius:0 0 2px 2px;
}
.tv-dem-nen[hidden]{display:none!important}

/* Mot muc "Chỉ báo" gom het nut bat/tat + cai dat chi bao */
.ind-menu-btn{display:inline-flex;align-items:center;gap:5px}
.ind-menu-btn.dang-mo{border-color:var(--blue)!important}
.ind-menu{
  position:fixed;z-index:60;min-width:228px;
  background:var(--top);border:1px solid var(--border);border-radius:8px;
  padding:6px;display:flex;flex-direction:column;gap:4px;
  box-shadow:0 12px 34px rgba(0,0,0,.28);
}
.ind-menu[hidden]{display:none!important}
.ind-menu .ind-row{display:flex;align-items:center;gap:6px}
.ind-menu .ind-row>.toggle,.ind-menu .ind-row>.btn{
  flex:1;width:100%;justify-content:flex-start;text-align:left;
  height:26px!important;font-size:11px!important;
}
.ind-menu .ind-row>select{flex:0 0 auto;width:92px;height:26px!important;font-size:11px!important}
.ind-menu .ind-sep{height:1px;background:var(--border);margin:3px 2px}

/* An cum "BTC/USD $78,343.4 -0.65%" tren thanh tren.
   Giu lai the DOM (an bang CSS) vi app.js van ghi gia vao do de cap nhat
   tieu de tab - xoa han se lam vo cac ham cap nhat gia. */
#symbolTitle,#mainPrice,#mainChange{display:none!important}

/* Cum "Chỉ báo / Backtest / Công cụ vẽ / Reset chart / ⛶" day sang phai man hinh,
   dung truoc dai trang thai. margin-left:auto an het khoang trong ben trai. */
.topbar .legend{ order:8 !important; margin-left:28px !important; }
.topbar .status{ order:9 !important; margin-left:auto !important; }

/* ---------------- Canh bao gia kieu TradingView ---------------- */
.alert-layer{position:absolute;inset:0;pointer-events:none;z-index:3}
.alert-add,.alert-del{
  position:absolute;z-index:22;width:20px;height:20px;padding:0;
  display:flex;align-items:center;justify-content:center;
  border-radius:50%;cursor:pointer;
  background:#2962ff!important;color:#fff!important;border:0!important;
  box-shadow:0 1px 4px rgba(0,0,0,.35);
}
.alert-add:hover,.alert-del:hover{background:#1e4fd8!important}
.alert-del{background:#ff3b30!important;width:18px;height:18px}
.alert-del:hover{background:#d92c22!important;transform:scale(1.08)}
.alert-add[hidden],.alert-del[hidden]{display:none!important}
.alert-tip{
  position:fixed;z-index:80;display:flex;align-items:center;gap:8px;
  background:#1e222d;color:#d1d4dc;border:1px solid #2a2e39;border-radius:6px;
  padding:7px 10px;font-size:12px;font-weight:600;white-space:nowrap;
  box-shadow:0 8px 24px rgba(0,0,0,.4);pointer-events:none;
}
.alert-tip b{color:#787b86;font-weight:600}
.alert-tip[hidden]{display:none!important}
.alert-toast-wrap{
  position:fixed;left:16px;bottom:16px;z-index:200;
  display:flex;flex-direction:column-reverse;gap:8px;pointer-events:none;
}
.alert-toast{
  pointer-events:auto;position:relative;
  display:flex;align-items:flex-start;gap:10px;min-width:236px;max-width:330px;
  background:#1e222d;color:#d1d4dc;border:1px solid #2a2e39;border-radius:8px;
  padding:11px 30px 11px 12px;font-size:12px;
  box-shadow:0 12px 34px rgba(0,0,0,.5);
}
.alert-toast .at-icon{
  flex:0 0 auto;width:26px;height:26px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:rgba(41,98,255,.16);color:#2962ff;
}
.alert-toast .at-noi{display:flex;flex-direction:column;gap:3px;min-width:0}
.alert-toast .at-tieu{color:#fff;font-weight:800;font-size:12px}
.alert-toast .at-tin{color:#d1d4dc;font-weight:700;word-break:break-word}
.alert-toast .at-duoi{display:flex;align-items:center;gap:10px;margin-top:2px}
.alert-toast .at-sua{
  background:transparent!important;border:0!important;padding:0;cursor:pointer;
  color:#2962ff!important;font-size:11.5px;font-weight:800;
}
.alert-toast .at-sua:hover{text-decoration:underline}
.alert-toast .at-gio{color:#787b86;font-size:11px;margin-left:auto}
.alert-toast .at-x{
  position:absolute;top:5px;right:6px;
  background:transparent!important;border:0!important;color:#787b86!important;
  cursor:pointer;font-size:16px;line-height:1;padding:0 3px;
}
.alert-toast .at-x:hover{color:#fff!important}

/* Hop cai dat canh bao + menu chuot phai */
.alert-dlg{
  position:fixed;z-index:95;width:268px;background:#1e222d;color:#d1d4dc;
  border:1px solid #2a2e39;border-radius:8px;box-shadow:0 16px 44px rgba(0,0,0,.5);
  font-size:12px;
}
.alert-dlg[hidden],.alert-menu[hidden]{display:none!important}
.alert-dlg .ad-head{display:flex;align-items:center;justify-content:space-between;
  padding:9px 11px;border-bottom:1px solid #2a2e39;color:#fff}
.alert-dlg .ad-x{background:transparent!important;border:0!important;color:#787b86!important;
  cursor:pointer;font-size:17px;line-height:1;padding:0 2px}
.alert-dlg .ad-x:hover{color:#fff!important}
.alert-dlg .ad-body{padding:10px 11px;display:flex;flex-direction:column;gap:9px}
.alert-dlg label{display:flex;flex-direction:column;gap:4px;color:#787b86;font-weight:700}
.alert-dlg label.ad-tick{flex-direction:row;align-items:center;gap:7px;color:#d1d4dc}
.alert-dlg input[type=text],.alert-dlg input[type=number],.alert-dlg select{
  height:28px;background:#0b0f16!important;color:#d1d4dc!important;
  border:1px solid #2a2e39!important;border-radius:5px;padding:0 8px;font-weight:700;outline:none;
}
.alert-dlg input:focus,.alert-dlg select:focus{border-color:#2962ff!important}
.alert-dlg .ad-chan{display:flex;align-items:center;gap:7px;padding:9px 11px;
  border-top:1px solid #2a2e39}
.alert-dlg .ad-day{flex:1}
.alert-dlg .ad-chan button{height:28px;padding:0 11px;border-radius:5px;cursor:pointer;
  font-weight:800;font-size:11.5px;border:1px solid #2a2e39!important;
  background:#0b0f16!important;color:#d1d4dc!important}
.alert-dlg .ad-xoa{border-color:#ff3b30!important;color:#ff3b30!important}
.alert-dlg .ad-xoa:hover{background:#ff3b30!important;color:#fff!important}
.alert-dlg .ad-luu{background:#2962ff!important;border-color:#2962ff!important;color:#fff!important}
.alert-menu{
  position:fixed;z-index:96;min-width:172px;background:#1e222d;border:1px solid #2a2e39;
  border-radius:7px;padding:4px;display:flex;flex-direction:column;
  box-shadow:0 12px 34px rgba(0,0,0,.5);
}
.alert-menu button{
  height:28px;text-align:left;padding:0 9px;border:0!important;border-radius:5px;cursor:pointer;
  background:transparent!important;color:#d1d4dc!important;font-size:12px;font-weight:700;
}
.alert-menu button:hover{background:#2a2e39!important}
.alert-menu button.do{color:#ff3b30!important}
.alert-dlg .ad-keo-hang{display:flex;gap:6px}
.alert-dlg .ad-keo-hang select{flex:1;min-width:0}
.alert-dlg .ad-keo-hang input{width:76px;flex:0 0 auto}
.alert-dlg .ad-keo-hang input[hidden]{display:none!important}
.alert-dlg .ad-vach{height:1px;background:#2a2e39;margin:2px 0}
.alert-dlg textarea{
  background:#0b0f16!important;color:#d1d4dc!important;border:1px solid #2a2e39!important;
  border-radius:5px;padding:6px 8px;font:700 12px/1.45 inherit;resize:vertical;outline:none;
}
.alert-dlg textarea:focus{border-color:#2962ff!important}
.alert-dlg .ad-nghe{
  flex:0 0 auto;width:28px;height:28px;border-radius:5px;cursor:pointer;
  background:#0b0f16!important;color:#2962ff!important;border:1px solid #2a2e39!important;
  font-size:11px;line-height:1;
}
.alert-dlg .ad-nghe:hover{border-color:#2962ff!important}



/* Mot lop duy nhat cho duong chi chuot, phu ca hai khung */
.cross-mot{position:fixed;left:0;top:0;pointer-events:none;z-index:29}

/* Legend goc tren trai khung RSI */
.rsi-legend{
  position:absolute; left:8px; top:4px; z-index:20;
  pointer-events:none; user-select:none;
  display:flex; align-items:center; gap:8px; white-space:nowrap;
  font-size:12px; line-height:1.45;
  
}
.rsi-legend .rl-ten{ color:#1e222d; opacity:.72 }
.rsi-legend .rl-v{ font-weight:600 }

/* ================================================================
   CHU VA NET SAC, KHONG MO VIEN
   - Da bo bong chu (text-shadow) o cac legend: bong do tao quang mo
     quanh chu nen nhin nhu bi nhoe.
   - Bat lam min chu theo muc xam -> chu mong va sac tren nen sang.
   ================================================================ */
body, .tv-legend, .rsi-legend, .obj-bar, .alert-dlg, .alert-toast,
.ind-menu, .alert-tip, .float-draw, .style-panel, .rsi-settings-panel{
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
}

/* O go chu cua chu thich (Callout), nam ngay tren chart */
.note-input{
  position:fixed; z-index:70; width:226px; min-height:34px; max-height:120px;
  background:#fff; color:#1e222d;
  border:1px solid #2962ff; border-radius:5px; padding:6px 8px;
  font:12px/1.45 Arial,Helvetica,sans-serif; resize:none; outline:none;
  box-shadow:0 6px 18px rgba(0,0,0,.18);
}
.note-input[hidden]{display:none!important}

/* ---------------- Bang RSI 4 khung xep doc ben phai ---------------- */
.rsi4{
  position:fixed; z-index:18; width:225px;
  display:flex; flex-direction:column; gap:4px;
  pointer-events:none; user-select:none;
}
.rsi4[hidden]{display:none!important}
.rsi4-o{
  background:rgba(255,255,255,.95);
  border:1px solid rgba(42,46,57,.28); border-radius:4px;
  padding:2px 4px 3px;
}
.rsi4-dau{
  display:flex; align-items:center; justify-content:space-between;
  font-size:11.5px; font-weight:700; line-height:1.35; padding:0 2px 1px;
}
.rsi4-ten{ color:#8a6d00 }
.rsi4-so{ font-variant-numeric:tabular-nums }
.rsi4-o canvas{ display:block; width:100%; height:76px }

/* ---------------- Chon nhieu net ve bang khung keo (Cmd + keo chuot) ---------------- */
.chon-vung{
  position:absolute; left:0; top:0; pointer-events:none; z-index:7;
}

/* ---------------- Phat lai nen (Bar Replay) ---------------- */
.replay-lop{ position:absolute; left:0; top:0; pointer-events:none; z-index:8 }
.replay-bar{
  position:fixed; z-index:901;
  display:flex; align-items:center; gap:2px;
  padding:5px 6px 5px 3px;
  background:#20232b; border:1px solid #33373f; border-radius:10px;
  box-shadow:0 6px 20px rgba(0,0,0,.30);
  user-select:none;
}
.replay-bar[hidden]{ display:none!important }
.replay-bar .rp-grip{ display:flex; align-items:center; padding:0 4px; color:#6b7280; cursor:grab }
.replay-bar .rp-grip:active{ cursor:grabbing }
.replay-bar button{
  display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; padding:0;
  background:transparent!important; border:0!important; border-radius:6px!important;
  color:#d1d4dc!important; cursor:pointer;
}
.replay-bar button:hover{ background:#2f333d!important; color:#fff!important }
.replay-bar button.active{ background:#2962ff!important; color:#fff!important }
.replay-bar button[disabled]{ opacity:.35; cursor:default }
.replay-bar button[disabled]:hover{ background:transparent!important; color:#d1d4dc!important }
.replay-bar .rp-vach{ width:1px; height:20px; background:#33373f; margin:0 3px }
.replay-bar select{
  height:26px; background:#171a21!important; color:#d1d4dc!important;
  border:1px solid #33373f!important; border-radius:6px; padding:0 4px;
  font-size:12px; font-weight:700; outline:none; cursor:pointer;
}
.replay-mach{
  position:fixed; z-index:902; pointer-events:none;
  background:#1e222d; color:#d1d4dc; border:1px solid #2a2e39; border-radius:6px;
  padding:5px 9px; font-size:12px; font-weight:600; white-space:nowrap;
  box-shadow:0 8px 24px rgba(0,0,0,.4);
}
.replay-mach[hidden]{ display:none!important }
