/* TRADER2ALGO - TradingView-style drawing tools */
#chart .toolbar.dt-toolbar{gap:3px;padding:8px 5px;scrollbar-width:none}
#chart .toolbar.dt-toolbar::-webkit-scrollbar{display:none}
#chart .dt-toolbar .dt-group{position:relative;flex:none}
#chart .dt-toolbar .tool{display:flex;align-items:center;justify-content:center;flex:none;position:relative;cursor:pointer}
#chart .dt-toolbar .tool svg{width:21px;height:21px;pointer-events:none}
#chart .dt-toolbar .dt-corner{position:absolute;right:0;bottom:0;width:12px;height:12px;cursor:pointer;z-index:1}
#chart .dt-toolbar .dt-corner::after{content:"";position:absolute;right:3px;bottom:3px;border-left:4px solid transparent;border-bottom:4px solid var(--a-muted,#64748b);opacity:.7}
#chart .dt-toolbar .dt-group:hover .dt-corner::after{opacity:1;border-bottom-color:var(--a-text,#e2e8f0)}
#chart .dt-toolbar .dt-sep{display:block;flex:none;width:24px;height:1px;margin:5px 0;background:var(--a-line2,#273449)}

.dt-flyout{position:fixed;z-index:100060;display:none;min-width:250px;padding:6px;background:var(--a-solid2,#121a28);border:1px solid var(--a-line2,#2a3850);border-radius:12px;box-shadow:0 18px 44px rgba(0,0,0,.45)}
.dt-flyout.show{display:block}
.dt-flyout .dt-title{padding:6px 10px 5px;font:700 10.5px Inter,'Segoe UI',Arial,sans-serif;letter-spacing:.06em;text-transform:uppercase;color:var(--a-dim,#64748b)}
.dt-flyout button{display:flex;align-items:center;gap:11px;width:100%;height:34px;padding:0 10px;border:0;border-radius:8px;background:transparent;color:var(--a-text,#cbd5e1);font:500 13px Inter,'Segoe UI',Arial,sans-serif;text-align:left;cursor:pointer}
.dt-flyout button:hover{background:var(--a-surface2,#1c2940)}
.dt-flyout button.active{background:var(--a-blue-bg,#18263b);color:var(--a-link,#42a5ff)}
.dt-flyout svg{width:20px;height:20px;flex:none}
.dt-flyout kbd{margin-left:auto;padding-left:12px;font:500 11px Inter,'Segoe UI',Arial,sans-serif;color:var(--a-dim,#64748b);background:none;border:0}

.dt-props{position:absolute;top:60px;left:50%;transform:translateX(-50%);z-index:6;display:flex;align-items:center;gap:2px;max-width:calc(100% - 16px);padding:4px;background:var(--a-solid2,#121a28);border:1px solid var(--a-line2,#2a3850);border-radius:10px;box-shadow:0 10px 28px rgba(0,0,0,.4)}
.dt-props[hidden]{display:none}
.dt-props button,.dt-props select{height:30px;min-width:30px;padding:0 6px;border:0;border-radius:7px;background:transparent;color:var(--a-text,#cbd5e1);font:500 12px Inter,'Segoe UI',Arial,sans-serif;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.dt-props select{padding:0 4px;outline:none}
.dt-props select option{background:var(--a-solid2,#121a28);color:var(--a-text,#e2e8f0)}
.dt-props button:hover,.dt-props select:hover{background:var(--a-surface2,#1c2940)}
.dt-props button.on{background:var(--a-blue-bg,#18263b);color:var(--a-link,#42a5ff)}
.dt-props button[data-act="delete"]:hover{color:#f43f5e}
.dt-props svg{width:18px;height:18px;pointer-events:none}
.dt-props .dt-color span{display:block;width:18px;height:18px;border-radius:5px;border:2px solid rgba(255,255,255,.25)}
.dt-props .dt-psep{width:1px;height:20px;margin:0 3px;background:var(--a-line2,#2a3850)}

.dt-palette{position:absolute;z-index:7;display:grid;grid-template-columns:repeat(5,24px);gap:6px;padding:8px;background:var(--a-solid2,#121a28);border:1px solid var(--a-line2,#2a3850);border-radius:10px;box-shadow:0 12px 30px rgba(0,0,0,.45)}
.dt-palette[hidden]{display:none}
.dt-palette button{width:24px;height:24px;padding:0;border:2px solid rgba(255,255,255,.15);border-radius:6px;cursor:pointer}
.dt-palette button:hover{transform:scale(1.1);border-color:#fff}
.dt-palette .dt-custom{position:relative;width:24px;height:24px;border-radius:6px;border:1px dashed var(--a-muted,#64748b);display:flex;align-items:center;justify-content:center;color:var(--a-muted,#94a3b8);cursor:pointer;font:600 15px Arial;overflow:hidden}
.dt-palette .dt-custom input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%}

.dt-text-editor{position:absolute;z-index:8;width:220px;height:30px;padding:0 9px;border:1px solid var(--a-link,#42a5ff);border-radius:7px;background:var(--a-solid2,#121a28);color:var(--a-text,#e2e8f0);font:13px Inter,'Segoe UI',Arial,sans-serif;outline:none;box-shadow:0 8px 20px rgba(0,0,0,.4)}

@media (max-width:768px){
#chart .dt-toolbar .tool svg{width:18px;height:18px}
.dt-props{top:auto;bottom:10px}
.dt-props select[data-act="dash"]{max-width:70px}
}
/* follower: master (shared) drawings visibility toggle */
.dt-shared-toggle{position:relative}
.dt-shared-toggle[hidden]{display:none!important}
.dt-shared-toggle b{position:absolute;right:3px;bottom:2px;font:700 8px/1 Arial,sans-serif;color:currentColor;opacity:.9;pointer-events:none}
/* chart navigation (bottom-right of the plot, TradingView style) */
.cn-nav{position:absolute;right:68px;bottom:36px;z-index:5;display:flex;align-items:center;gap:6px;opacity:.55;transition:opacity .15s}
#chart .chart-wrap:hover .cn-nav,.cn-nav:focus-within{opacity:1}
.cn-btn{height:28px;min-width:28px;padding:0 8px;display:inline-flex;align-items:center;justify-content:center;gap:5px;border:1px solid var(--a-line2,#2a3850);border-radius:7px;background:var(--a-solid2,#121a28);color:var(--a-text,#cbd5e1);font:600 12px Inter,'Segoe UI',Arial,sans-serif;cursor:pointer;box-shadow:0 4px 14px rgba(0,0,0,.35);user-select:none}
.cn-btn svg{width:15px;height:15px;flex:none}
.cn-btn b{font-size:12px;font-weight:700}
.cn-btn:hover{border-color:#38bdf8;color:#fff}
.cn-btn.active{border-color:#2962ff;color:#fff}
.cn-btn[hidden]{display:none}
.cn-latest{padding:0 6px}
@media (max-width:640px){.cn-nav{opacity:1}.cn-reset span{display:none}.cn-btn{height:32px;min-width:32px}}
