
:root{--bg:#131722;--panel:#1e222d;--panel2:#171b26;--line:#2a2e39;--text:#d7d9df;--muted:#8b93a7;--blue:#2962ff;--purple:#8b6be8;--green:#26a69a;--red:#ef5350}

*{box-sizing:border-box}

html,body{margin:0;background:var(--bg);color:var(--text);font-family:"Trebuchet MS",Arial,sans-serif;font-size:13px;letter-spacing:0;overflow:hidden}

body{direction:ltr}

.tv-shell{height:100vh;min-height:100vh;overflow:hidden;display:flex;flex-direction:column;background:var(--bg)}

button,select,textarea{font-family:inherit}

.tv-topbar{height:58px;display:flex;align-items:center;gap:18px;padding:0 14px;border-bottom:1px solid var(--line);background:#131722}

.tv-logo{display:flex;align-items:center;gap:7px;min-width:132px}

.tv-logo span{display:grid;place-items:center;width:27px;height:27px;border-radius:7px;background:#2a2349;color:#b9a7ff}

.tv-logo span .ic{width:18px;height:18px;color:#b9a7ff}

.tv-logo strong{font-size:15px;color:#f1f3f7}

.tv-logo small{color:var(--muted);font-size:9px;margin-right:3px}

.tv-symbol{display:flex;align-items:center;gap:8px;min-width:145px}

.star-btn,.top-icon,.watch-head button{border:0;background:none;color:#8c95a8;cursor:pointer;font-size:22px;display:inline-grid;place-items:center}

/* ---- icon system ---------------------------------------------------
   Every icon in the app is a 24x24 grid SVG drawn with strokes, so the
   whole set shares one optical weight. --ic-sw is the single stroke
   width; non-scaling-stroke keeps that weight visually constant at
   every rendered size, which is what stops a 13px icon from looking
   hairline-thin next to a 27px one. Sizes are limited to the steps
   below so the UI never drifts into arbitrary one-off values.       */
.ic,.tic{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:var(--ic-sw,1.8);stroke-linecap:round;stroke-linejoin:round;display:inline-block;vertical-align:middle;flex:0 0 auto;overflow:visible}
.ic path,.ic circle,.ic rect,.ic line,.ic polyline,.ic polygon,.ic ellipse,
.tic path,.tic circle,.tic rect,.tic line,.tic polyline,.tic polygon,.tic ellipse{vector-effect:non-scaling-stroke}
.ic{width:20px;height:20px}
.ic.sz-xs{width:13px;height:13px;--ic-sw:2}
.ic.sz-sm{width:15px;height:15px;--ic-sw:1.95}
.ic.sz-md{width:18px;height:18px;--ic-sw:1.9}
.ic.sz-lg{width:22px;height:22px;--ic-sw:1.8}
.ic.sz-xl{width:27px;height:27px;--ic-sw:1.7}
/* filled glyphs: solid shapes must not inherit the stroke-only look */
.ic.fill,.tic.fill{fill:currentColor;stroke:none}
.ic.fill path,.ic.fill circle,.ic.fill rect,.ic.fill polygon,.ic.fill path{stroke:none}
/* semantic accents - colour carries meaning here, used sparingly */
.ic.acc-buy{color:#26a69a}
.ic.acc-sell{color:#ef5350}
.ic.acc-warn{color:#f0b90b}
.ic.acc-live{color:#26a69a}
.ic.dim{color:#8c95a8}
.ic.bright{color:#fff}

.top-icon .ic{width:18px;height:18px}

.star-btn .ic{width:18px;height:18px}

.star-btn:hover .ic{color:#ffd166}

.tool-btn .ic{width:15px;height:15px;margin:-2px 3px 0 0;vertical-align:middle}

.tool-btn:has(> .ic:only-child){display:inline-grid;place-items:center;padding:0 7px}

.tool-btn:has(> .ic:only-child) .ic{margin:0}

.tool-btn .ic.play{width:13px;height:13px;fill:currentColor;stroke:none}

.watch-head button .ic{width:18px;height:18px;color:#8c95a8}

.tv-symbol b{display:block;font-size:14px}

.tv-symbol small{display:block;color:var(--muted);font-size:10px;margin-top:2px}

.tv-quote{display:flex;align-items:baseline;gap:12px;direction:ltr}

.tv-quote strong{font-size:18px;color:#e8ebf2}

.tv-quote b{font-size:12px;color:var(--green)}

.tv-quote span{font-size:10px;color:var(--muted);direction:ltr}

.tv-top-actions{display:flex;align-items:center;gap:15px;margin-left:auto}

.connection i{display:block;width:8px;height:8px;border-radius:50%;background:#e5a737;box-shadow:0 0 8px #e5a737}

.connection.ok i{background:var(--green);box-shadow:0 0 8px var(--green)}

.connection.error i{background:var(--red);box-shadow:0 0 8px var(--red)}

.tv-marketbar{height:44px;display:flex;align-items:center;gap:9px;padding:0 10px;border-bottom:1px solid var(--line);background:#191d27;overflow-x:auto}

.market-select{display:flex;align-items:center;gap:6px}

.market-select label{color:var(--muted);font-size:10px}

.market-select select{height:28px;border:1px solid var(--line);border-radius:4px;background:#202532;color:var(--text);font-size:11px;padding:0 8px}

.intervals{display:flex;gap:1px}

.intervals button,.bar-link{height:28px;border:0;border-radius:3px;background:transparent;color:#9ba3b5;padding:0 9px;font-size:10px;cursor:pointer}

.intervals button:hover,.intervals button.active{background:#2d3350;color:#e0d8ff}

.bar-link{display:grid;place-items:center;border-right:1px solid var(--line);border-radius:0}

.bar-spacer{flex:1}

.market-status{font-size:10px;color:#7f899d}

.market-status:first-letter{color:var(--green)}

.tv-workspace{display:grid;grid-template-columns:52px minmax(0,1fr) 238px;grid-template-rows:minmax(0,1fr);direction:ltr;flex:1 1 0%;min-height:0}

.tv-main{direction:ltr;min-width:0;min-height:0;padding:8px 8px 0;background:#131722;display:flex;flex-direction:column}

.chart-toolbar{height:38px;display:flex;align-items:center;gap:3px;border-bottom:1px solid var(--line);overflow:auto}
.tv-marketbar .chart-kind{display:inline-flex;align-items:center}

.tool-btn{height:27px;border:1px solid transparent;border-radius:4px;background:transparent;color:#9199ab;padding:0 9px;cursor:pointer;font-size:10px;white-space:nowrap}

.tool-btn:hover,.tool-btn.active{background:#30265a;border-color:#6750ae;color:#eee8ff}

.toolbar-sep{width:1px;height:20px;background:var(--line);margin:0 7px}

.chart-kind{display:flex;gap:2px;margin-left:4px}

.chart-title{display:flex;justify-content:space-between;align-items:center;padding:8px 4px 5px}

.chart-title b{font-size:12px}

.chart-title span{display:block;color:var(--muted);font-size:9px;margin-top:3px}

.legend{color:#a99bdb!important;margin:0!important}

.indicator-strip{min-height:14px;color:#aab3c7;font-size:9px;padding:0 4px}
.indicator-strip,#legend{display:none!important}
.indicator-hover-readout{position:absolute;left:auto;right:0;z-index:18;display:flex;align-items:center;justify-content:flex-start;gap:4px;max-width:76px;min-width:52px;box-sizing:border-box;padding:2px 5px;border-radius:2px 0 0 2px;background:#111;color:#fff;font:10px/17px Arial,sans-serif;font-variant-numeric:tabular-nums;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none;transform:translateY(-50%);box-shadow:0 1px 3px #0004}
.indicator-hover-readout::before{content:"+";display:inline-flex;flex:0 0 14px;width:14px;height:14px;box-sizing:border-box;align-items:center;justify-content:center;border:1px solid currentColor;border-radius:50%;font:12px/12px Arial,sans-serif}

.chart-wrap{position:relative;flex:1 1 0%;min-height:0;background:#131722;overflow:hidden;cursor:crosshair}

.chart-wrap canvas{display:block;width:100%;height:100%}
.candle-countdown{position:absolute;right:0;z-index:4;min-width:76px;height:17px;box-sizing:border-box;padding:1px 4px;color:#fff;background:#2962ff;font:10px/15px Arial,sans-serif;text-align:center;font-variant-numeric:tabular-nums;pointer-events:none;display:none}

.chart-wrap canvas.drawing{cursor:crosshair}

.chart-empty{position:absolute;inset:0;display:grid;place-items:center;color:var(--muted);font-size:11px;background:#131722dd}

.chart-empty.hidden{display:none}

.watchlist{direction:ltr;border-right:1px solid var(--line);background:#171a23}

.watch-head{height:43px;display:flex;align-items:center;justify-content:space-between;padding:0 13px;border-bottom:1px solid var(--line)}

.watch-head b{font-size:13px}

.watch-head button{font-size:18px}

.watch-tabs{display:flex;gap:17px;padding:11px 13px 7px;color:var(--muted);font-size:10px;border-bottom:1px solid var(--line)}

.watch-tabs .active{color:#c7b8ff;border-bottom:2px solid var(--purple);padding-bottom:7px}

.watch-row{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid #242936;cursor:pointer}

.watch-row:hover,.watch-row.selected{background:#252a38}

.watch-row>div{flex:1}

.watch-row b{display:block;font-size:11px;direction:ltr;text-align:left}

.watch-row small{display:block;color:var(--muted);font-size:9px;margin-top:3px}

.watch-row strong{font-size:11px;direction:ltr}

.coin-dot{width:25px;height:25px;border-radius:50%;display:grid;place-items:center;color:white;font-size:12px;font-weight:bold}

.btc{background:#f7931a}

.eth{background:#627eea}

.sol{background:#7b61ff}

.bnb{background:#f3ba2f}

.watch-empty{padding:24px 15px;color:#687186;font-size:10px;text-align:center}

.bottom-dock{border-top:1px solid var(--line);background:#171a23;min-height:190px}

.dock-tabs{height:37px;display:flex;align-items:end;gap:2px;padding:0 14px;border-bottom:1px solid var(--line)}

.dock-tabs button{height:31px;border:0;border-bottom:2px solid transparent;background:transparent;color:#8d95a8;padding:0 14px;font-size:10px;cursor:pointer}

.dock-tabs button.active{color:#ddd2ff;border-bottom-color:var(--purple)}

.script-card{padding:10px 14px}

.script-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:7px}

.script-head b{font-size:12px}

.script-head span{display:block;color:var(--muted);font-size:9px;margin-top:3px}

.script-actions{display:flex;gap:5px}

.script-card textarea{width:100%;height:75px;resize:vertical;direction:ltr;text-align:left;font:11px/1.65 Consolas,"Courier New",monospace;color:#dbe5ff;background:#10131b;border:1px solid #333949;border-radius:4px;padding:8px;outline:none}

.script-card textarea:focus{border-color:#7960c8}

.script-status{color:var(--muted);font-size:9px;margin-top:5px;min-height:13px}

.script-status.ok{color:var(--green)}

.script-status.error{color:var(--red)}

.tv-footer{height:28px;display:flex;align-items:center;justify-content:space-between;padding:0 14px;color:#687186;font-size:9px;border-top:1px solid var(--line);background:#131722}

@media(max-width:900px){

.tv-workspace{grid-template-columns:40px minmax(0,1fr)}

.watchlist{display:none}

.tv-symbol{min-width:120px}

.tv-quote{gap:7px}

.chart-wrap{height:auto;min-height:0}

}

@media(max-width:620px){

.tv-topbar{gap:8px;padding:0 8px}

.tv-logo{min-width:auto}

.tv-logo small,.tv-quote span{display:none}

.tv-symbol{min-width:100px}

.tv-quote strong{font-size:14px}

.tv-marketbar{overflow:auto;white-space:nowrap}

.bar-link,.market-status{display:none}

.tv-workspace{grid-template-columns:40px minmax(0,1fr)}

.chart-toolbar{overflow:auto}

.chart-wrap{height:auto;min-height:0}

.tv-footer{font-size:8px}

.tv-footer span:nth-child(2){display:none}

}

:root{--bg:#131722;--panel:#1e222d;--line:#2a2e39;--text:#d7d9df;--muted:#8b93a7;--green:#26a69a;--red:#ef5350}

.tv-main{position:relative}

.tool-popover{position:absolute;z-index:20;top:8px;left:8px;right:auto;display:none;width:205px;padding:6px;background:#202532;border:1px solid #3a4151;border-radius:6px;box-shadow:0 14px 30px #0008}

.tool-popover.open{display:block}

.tool-panel{display:none;gap:2px}

.tool-panel.active{display:grid}

.tool-panel b{color:#d9dce5;font-size:11px;padding:7px 8px;border-bottom:1px solid var(--line)}

.tool-panel button{height:30px;border:0;border-radius:4px;background:transparent;color:#aeb6c8;text-align:left;padding:0 9px;font-size:10px;cursor:pointer}

.tool-panel button:hover{background:#30374a;color:#fff}

.tool-panel button.active{background:#3a2f5e;color:#fff}

.tool-panel button:before{content:none}

@media(max-width:620px){

.tool-popover{left:4px;width:190px}

}

:root{--bg:#10131d;--panel:#191e2b;--panel2:#151a25;--line:#2b3242;--soft-line:#242b3a;--text:#edf0f7;--muted:#929caf;--accent:#8d6bea;--accent2:#5c8dff;--green:#23c59a;--red:#f06476}

html{background:#10131d}

body{background:radial-gradient(900px 500px at 8% -15%,#35285e88 0%,transparent 60%),radial-gradient(850px 480px at 98% 15%,#123d5380 0%,transparent 55%),#10131d}

.tv-shell{background:transparent}

.tv-topbar{height:64px;padding:0 18px;background:linear-gradient(180deg,#171b28f2,#131720f5);border-bottom:1px solid #343b4c;box-shadow:0 5px 22px #0005;backdrop-filter:blur(16px)}

.tv-logo{min-width:150px}

.tv-logo span{width:34px;height:34px;border:1px solid #8068dc;background:linear-gradient(145deg,#3c2a70,#1d2440);box-shadow:0 0 22px #7958e055;color:#dfd5ff}

.tv-logo strong{font-size:16px;letter-spacing:.2px}

.tv-logo small{font-size:9px;color:#a5aec1}

.tv-symbol{min-width:180px;padding-right:11px;border-right:1px solid #343b4c}

.tv-symbol b{font-size:15px}

.star-btn{transition:.2s;color:#aeb6ca}

.star-btn:hover{color:#ffd166;transform:scale(1.12)}

.tv-quote{padding:0 16px;min-height:34px;border-right:1px solid #343b4c}

.tv-quote strong{font-size:20px}

.tv-quote b{padding:4px 8px;border-radius:5px;background:#173c35;color:#43d6ad}

.top-icon{width:36px;height:36px;border:1px solid #3b4355;border-radius:8px;background:#202636;color:#b8c1d4;font-size:20px;transition:.2s;display:grid;place-items:center}

.top-icon:hover{border-color:#8d6bea;color:#eee7ff;background:#302752}

.tv-marketbar{height:48px;padding:0 18px;background:#171c27dd;border-bottom:1px solid #313849;box-shadow:0 4px 16px #0003}

.market-select select{background:#202737;border-color:#3b4559;color:#e5e9f2;transition:.2s}

.market-select select:hover,.market-select select:focus{border-color:#8068dc;box-shadow:0 0 0 2px #8068dc22}

.intervals button{height:30px;border-radius:6px}

.intervals button.active{background:linear-gradient(135deg,#453477,#2c3b6e);border:1px solid #8068dc;box-shadow:0 0 14px #8068dc33}

.bar-link{color:#aab2c2;transition:.2s}

.bar-link:hover{color:#e6eaff;background:#252c3c}

.tv-workspace{background:#10131d}

.tv-main{padding:9px 10px 0;background:linear-gradient(180deg,#131722,#11151e)}

.chart-toolbar{height:42px;padding:0 5px;border:1px solid #2d3546;border-radius:9px 9px 0 0;background:linear-gradient(180deg,#1d2330,#181d28);box-shadow:0 5px 18px #0002}

.tool-btn{border-radius:6px;transition:.2s}

.tool-btn:hover{background:#2a3040;border-color:#59647c;color:#f3f5fb}

.tool-btn.active{background:linear-gradient(135deg,#49356f,#2b416f);border-color:#8d6bea;color:#fff;box-shadow:0 0 12px #8068dc33}

.toolbar-sep{background:#3a4253}

.chart-title{padding:12px 8px 8px}

.chart-title b{font-size:13px;color:#f1f3f8}

.chart-title span{color:#9ca7bb}

.legend{color:#baa8f2!important}

.indicator-strip{padding:2px 8px;color:#aeb8cc}

.chart-wrap{height:auto;min-height:0;border:1px solid #2f3748;border-radius:0 0 10px 10px;background:linear-gradient(180deg,#141a26,#11151f);box-shadow:0 12px 28px #0004}

.chart-empty{background:#11151fe8}

.watchlist{background:linear-gradient(180deg,#191e2b,#151a24);border-color:#30384a;box-shadow:-5px 0 20px #0003}

.watch-head{height:48px;padding:0 15px;border-bottom-color:#30384a}

.watch-head b{font-size:14px}

.watch-tabs{padding:12px 15px 8px}

.watch-tabs .active{color:#ddd3ff;border-bottom-color:#9c7cff}

.watch-row{margin:3px 7px;padding:10px 9px;border:1px solid transparent;border-radius:8px;transition:.2s}

.watch-row:hover{background:#252c3b;border-color:#343e53}

.watch-row.selected{background:linear-gradient(90deg,#2d2750,#26364b);border-color:#6455a2;box-shadow:inset 3px 0 #9c7cff}

.watch-row strong{color:#dfe6f3}

.watch-empty{color:#788399}

.bottom-dock{background:linear-gradient(180deg,#191e2a,#151a24);border-top-color:#343c4e;box-shadow:0 -7px 24px #0003}

.dock-tabs{height:41px;padding:0 17px}

.dock-tabs button{height:34px;transition:.2s}

.dock-tabs button:hover{color:#e8e9f7}

.dock-tabs button.active{color:#e1d7ff;border-bottom-color:#9c7cff}

.script-card{padding:12px 17px}

.script-card textarea{background:#111620;border-color:#374154;box-shadow:inset 0 1px 8px #0005}

.script-card textarea:focus{border-color:#8d6bea;box-shadow:0 0 0 2px #8068dc22,inset 0 1px 8px #0005}

.script-status.ok{color:#39d2a8}

.tv-footer{background:#11151e;border-top-color:#2c3445;color:#78849a}

.tool-popover{background:linear-gradient(145deg,#272d3b,#1c2230);border-color:#4a556d;box-shadow:0 18px 45px #000b,0 0 0 1px #ffffff08 inset}

.tool-panel b{color:#f1f3f8}

.tool-panel button{transition:.15s}

.tool-panel button:hover{background:#343c50;color:#fff;transform:translateX(-2px)}

@media(max-width:900px){

.chart-wrap{height:auto;min-height:0}

}

@media(max-width:620px){

.tv-topbar{height:58px;padding:0 9px}

.tv-logo{min-width:34px}

.tv-logo strong,.tv-logo small{display:none}

.tv-symbol{min-width:106px;padding-right:5px}

.tv-marketbar{height:45px;padding:0 9px}

.tv-main{padding:7px 5px 0}

.chart-wrap{height:auto;min-height:0}

.script-card{padding:10px}

.tv-footer{padding:0 8px}

}

:root{--bg:#10131d;--panel:#191e2b;--line:#2b3242;--soft-line:#242b3a;--text:#edf0f7;--muted:#929caf;--accent:#8d6bea;--accent2:#5c8dff;--green:#23c59a;--red:#f06476}

.light-theme{--bg:#f4f6fb;--panel:#ffffff;--panel2:#eef1f7;--line:#d6dce8;--soft-line:#e4e8f0;--text:#1b2333;--muted:#000;--accent:#ff9100;--accent2:#ffb340}

.light-theme body,.light-theme .tv-shell{background:radial-gradient(900px 500px at 8% -15%,#ffd9a8 0%,transparent 60%),#f4f6fb;color:var(--text)}

.light-theme .tv-main{background:#f4f6fb}

.light-theme .chart-toolbar{background:linear-gradient(180deg,#fff,#f0f3f8);border-color:var(--line)}

.light-theme .chart-wrap{background:#fbfcff;border-color:var(--line)}

.light-theme .watch-row:hover{background:#eef1f8}

.light-theme .watch-row.selected{background:linear-gradient(90deg,#fff1dc,#ffe7c4);border-color:#ffb35c}

.light-theme .script-card textarea{background:#f8faff;border-color:#c9d1e0;color:#1e2b42}

.light-theme .tool-popover{background:#fff;border-color:#c5ccdc;box-shadow:0 18px 40px #66708535}

.light-theme .tool-panel b{color:#253149}

.light-theme .tool-panel button{color:#000}

.light-theme .tool-panel button:hover{background:#edf0f7;color:#202b43}

.chart-wrap canvas{touch-action:none;user-select:none}

.chart-wrap canvas.price-axis-hover{cursor:ns-resize}

.chart-wrap canvas.time-axis-hover{cursor:ew-resize}

.chart-wrap canvas.axis-dragging{cursor:grabbing!important}

.script-select{height:27px;border:1px solid #3b4559;border-radius:5px;background:#202737;color:#dfe5f2;padding:0 7px;font-size:10px}

.script-editor-shell{position:relative;display:flex;direction:ltr;height:150px;border:1px solid #374154;border-radius:6px;background:#111620;overflow:visible}

.script-lines{width:38px;flex:0 0 38px;padding:8px 7px;color:#65718a;background:#171d29;border-right:1px solid #2e3748;text-align:right;font:11px/1.65 Consolas,"Courier New",monospace;white-space:pre;overflow:hidden;user-select:none}

.script-editor-shell textarea{height:100%!important;border:0!important;border-radius:0!important;box-shadow:none!important;resize:vertical;white-space:pre;overflow:auto}

.script-completion{position:absolute;z-index:50;left:42px;bottom:8px;display:none;width:250px;max-height:180px;overflow:auto;padding:4px;border:1px solid #4c5a73;border-radius:6px;background:#1b2230;box-shadow:0 12px 30px #000b;direction:ltr}

.script-completion.open{display:block}

.script-completion button{display:flex;align-items:center;justify-content:space-between;width:100%;height:27px;border:0;border-radius:4px;background:transparent;color:#dce3f1;padding:0 8px;text-align:left;font:11px Consolas,"Courier New",monospace;cursor:pointer}

.script-completion button:hover,.script-completion button.selected{background:#3b3265;color:#fff}

.script-completion small{color:#8e9ab0;font:9px "Trebuchet MS",Arial,sans-serif}

.script-inputs{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px;direction:ltr}

.script-inputs label{display:flex;align-items:center;gap:5px;color:#9ca8bd;font-size:9px}

.script-inputs input{width:62px;height:23px;border:1px solid #39455b;border-radius:4px;background:#1a2130;color:#e9edf5;text-align:center;font-size:10px}

.script-inputs input:focus{outline:0;border-color:#8d6bea}

.script-status{display:flex;align-items:center;gap:7px}

.script-status::before{content:"●";color:#e0a943}

.script-status.ok::before{color:#39d2a8}

.script-status.error::before{color:#f06476}

@media(max-width:620px){

.script-actions{flex-wrap:wrap}

.script-select{max-width:125px}

.script-editor-shell{height:170px}

.script-completion{left:42px;width:calc(100% - 48px)}

}

.script-panel{display:none;direction:ltr;flex-direction:column;min-width:0;background:#171c29;border-left:1px solid var(--line);overflow:hidden}

.tv-workspace.script-open .script-panel{display:flex}

.tv-workspace.script-open{grid-template-columns:40px minmax(0,1fr) minmax(320px,380px)}
@media(min-width:901px){
.tv-workspace.watch-collapsed.script-open{grid-template-columns:40px minmax(0,1fr) minmax(320px,380px)}
}
.tv-workspace > .tv-main{grid-column:2;grid-row:1}
.tv-workspace > .watchlist{grid-column:3;grid-row:1}
.tv-workspace > .script-panel{grid-column:3;grid-row:1;min-width:0}

.tv-workspace.script-open .watchlist{display:none}

.script-panel .script-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px 9px;border-bottom:1px solid var(--line)}

.script-panel .script-title b{display:flex;align-items:center;gap:7px;font-size:13px;color:#edeff7}

.script-panel .script-title b:before{content:"⟨/⟩";color:#8d6bea}

.script-panel .script-title span{display:block;color:#7d879c;font-size:9px;margin-top:3px}

.script-panel .script-head-actions{display:flex;gap:5px}

.script-panel .script-toolbar{display:flex;align-items:center;gap:5px;padding:9px 12px;flex-wrap:wrap;border-bottom:1px solid var(--line)}

.script-panel .script-toolbar .script-select{flex:1;min-width:116px}

.script-panel .script-editor-shell{flex:1;height:auto;min-height:180px;margin:10px 12px}

.script-panel .script-editor-shell textarea{width:100%;height:100%!important;resize:none}

.script-panel .script-inputs{margin:0 12px 4px}

.script-panel .script-status{margin:6px 12px 12px}

.light-theme .script-panel{background:#ffffff;border-color:var(--line)}

.light-theme .script-panel .script-editor-shell{background:#f8faff;border-color:#c9d1e0}

.light-theme .script-panel .script-lines{background:#eef1f8;border-color:var(--line);color:#000}

.light-theme .script-panel textarea{color:#1e2b42}

.light-theme .script-panel .script-title b{color:#1b2333}

.light-theme .script-panel .script-title span{color:#000}

.light-theme .script-panel .script-completion{background:#ffffff;border-color:#c5ccdc;box-shadow:0 18px 40px #66708535}

.light-theme .script-panel .script-completion small{color:#000}

@media(max-width:900px){

.tv-workspace.script-open{grid-template-columns:40px minmax(0,1fr)}
.tv-workspace.script-open .script-panel{position:fixed;right:0;top:0;bottom:0;width:min(420px,94vw);z-index:70;box-shadow:-18px 0 45px #000a}
.tv-workspace.watch-collapsed.script-open{grid-template-columns:40px minmax(0,1fr)}

}

.script-panel .script-editor-shell .script-highlight{position:absolute;left:38px;right:0;top:0;bottom:0;z-index:1;margin:0;padding:8px;overflow:hidden;pointer-events:none;border:0;box-sizing:border-box;font:12px/1.65 Consolas,"Courier New",monospace;white-space:pre;color:#dfe5f2}

.script-panel .script-editor-shell textarea{position:relative;z-index:2;padding:8px;font:12px/1.65 Consolas,"Courier New",monospace;color:transparent!important;background:transparent!important;caret-color:#dbe5ff;outline:0}

.script-panel .script-editor-shell .script-highlight code{font:inherit;color:inherit}

.tok-comment{color:#6e7d96;font-style:italic}

.tok-string{color:#ffd98a}

.tok-color{color:#ff9fc0}

.tok-number{color:#c3e88d}

.tok-keyword{color:#c792ea}

.tok-type{color:#4ec9b0}

.tok-namespace{color:#82aaff}

.tok-builtin{color:#82aaff}

.script-tip{position:absolute;z-index:60;display:none;min-width:180px;max-width:300px;padding:7px 9px;border:1px solid #8d6bea;border-radius:6px;background:#1c2333;box-shadow:0 10px 26px #000c;pointer-events:none;font-family:"Trebuchet MS",Arial,sans-serif;text-align:left}

.script-tip.open{display:block}

.script-tip b{display:block;color:#a78bfa;font:600 11px Consolas,"Courier New",monospace;margin-bottom:3px}

.script-tip span{display:block;color:#cbd5e6;font-size:10px;line-height:1.55;direction:ltr;text-align:left}

.light-theme .script-panel .script-editor-shell .script-highlight{color:#1e2b42}

.light-theme .script-panel .script-editor-shell textarea{color:transparent!important;caret-color:#1e2b42}

.light-theme .tok-comment{color:#000}

.light-theme .tok-string{color:#b06a00}

.light-theme .tok-color{color:#e07f00}

.light-theme .tok-number{color:#5f8a1f}

.light-theme .tok-keyword{color:#e07f00}

.light-theme .tok-type{color:#00897b}

.light-theme .tok-namespace{color:#e07f00}

.light-theme .tok-builtin{color:#e07f00}

.light-theme .script-tip{background:#ffffff;border-color:#ff9100;box-shadow:0 10px 26px #66708540}

.light-theme .script-tip b{color:#e07f00}

.light-theme .script-tip span{color:#000}

.light-theme .script-panel .script-completion button{color:#253149}

.light-theme .script-panel .script-completion button:hover,.light-theme .script-panel .script-completion button.selected{background:#fff1dc;color:#c96f00}

.light-theme .script-panel .script-inputs label{color:#000}

.script-error{display:none;margin:0 12px 4px;padding:8px 10px;border:1px solid #e05c5c;border-left:4px solid #ef5350;border-radius:6px;background:#2a1520;color:#ffb3ba;font:11px/1.65 Consolas,"Courier New",monospace;white-space:pre-wrap;direction:ltr;text-align:left;max-height:120px;overflow:auto}

.script-error.open{display:block}

.script-error b{color:#ff8594}

.light-theme .script-error{background:#fff1f2;border-color:#e05c5c;color:#a02434}

.light-theme .script-error b{color:#c62828}

.pine-modal{display:none;position:fixed;inset:0;z-index:1100;background:rgba(10,14,24,.55);align-items:center;justify-content:center}

.pine-modal.open{display:flex}

.pine-modal-box{width:min(360px,92vw);padding:18px;border:1px solid #3b4559;border-radius:12px;background:#1a2030;box-shadow:0 24px 60px rgba(0,0,0,.5);direction:ltr}

.pine-modal-title{display:block;color:#edeff7;font-size:14px}

.pine-modal-sub{color:#8e9ab0;font-size:11px;line-height:1.8;margin:8px 0 12px;direction:ltr}

.pine-modal-input{width:100%;box-sizing:border-box;height:38px;padding:0 11px;border:1px solid #47536b;border-radius:8px;background:#111620;color:#e9edf5;font-size:13px;outline:none;direction:ltr}

.pine-modal-input:focus{border-color:#8d6bea}

.pine-modal-hint{display:block;color:#ef5350;font-size:11px;margin:6px 0 0;min-height:14px}

.pine-modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}

.light-theme .pine-modal-box{background:#ffffff;border-color:#cdd5e4;box-shadow:0 24px 60px rgba(60,70,100,.25)}

.light-theme .pine-modal-title{color:#1b2333}

.light-theme .pine-modal-sub{color:#000}

.light-theme .pine-modal-input{background:#f8faff;border-color:#c9d1e0;color:#1e2b42}

.pine-lib-box{width:min(440px,94vw)}

.pine-lib-list{max-height:320px;overflow:auto;display:flex;flex-direction:column;gap:8px;margin-top:4px}

.pine-lib-empty{color:#8e9ab0;font-size:11px;line-height:1.8;text-align:center;padding:16px 4px}

.pine-lib-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;border:1px solid #39455b;border-radius:8px;background:#141a28;direction:ltr;cursor:pointer;transition:.15s}

.pine-lib-item:hover{border-color:#8d6bea;background:#1a2135}

.pine-lib-meta{min-width:0}

.pine-lib-name{display:block;color:#e9edf5;font-size:12px}

.pine-lib-src{display:block;color:#8e9ab0;font:10px/1.6 Consolas,"Courier New",monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;direction:ltr;text-align:left;margin-top:2px}

.pine-lib-actions{display:flex;gap:6px;flex:0 0 auto}

.pine-lib-actions .tool-btn{padding:3px 9px;font-size:10px;height:auto}

.tool-btn.danger{color:#f06476}

.tool-btn.danger:hover{background:#3a1622;border-color:#ef5350}

.light-theme .pine-lib-empty{color:#000}

.light-theme .pine-lib-item{background:#fbfcff;border-color:#cdd5e4}

.light-theme .pine-lib-item:hover{border-color:#ffb35c;background:#fff4e8}

.light-theme .pine-lib-name{color:#1b2333}

.light-theme .pine-lib-src{color:#000}

.light-theme .tool-btn.danger:hover{background:#fdecef;border-color:#ef5350}

/* ============

/* ============ UI polish layer (v47) : enhanced visual design ============ */
html{ text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased }

::selection{ background:#7c5cd6a8;color:#fff }

.tv-shell ::-webkit-scrollbar{ width:9px;height:9px }

.tv-shell ::-webkit-scrollbar-track{ background:transparent }

.tv-shell ::-webkit-scrollbar-thumb{ background:#363e52;border-radius:8px;border:2px solid transparent;background-clip:padding-box }

.tv-shell ::-webkit-scrollbar-thumb:hover{ background:#474f66;border:2px solid transparent;background-clip:padding-box }

.tv-shell{ scrollbar-width:thin;scrollbar-color:#3a4358 transparent }

button:focus-visible,select:focus-visible,textarea:focus-visible,input:focus-visible{ outline:2px solid #8d6bea;outline-offset:2px }

/* ------- topbar ------- */
.tv-logo span{ background:linear-gradient(145deg,#4b2f9c,#221d45);box-shadow:0 0 18px #8360e066,inset 0 0 0 1px #ffffff1a }

.tv-logo strong{ background:linear-gradient(90deg,#ffffff,#cbb8ff);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent }

.tv-symbol b{ letter-spacing:.2px }

.tv-quote strong{ font-variant-numeric:tabular-nums;letter-spacing:.3px;text-shadow:0 1px 0 #0006 }

.tv-quote b{ font-weight:700;letter-spacing:.2px }

.top-icon{ font-size:19px }

.top-icon:hover{ transform:translateY(-1px) }

.top-icon:active{ transform:scale(.94) }

#theme-toggle{ position:relative }

.connection.ok i{ animation:connPulse 2.4s ease-in-out infinite }

@keyframes connPulse{ 0%,100%{box-shadow:0 0 8px var(--green)} 50%{box-shadow:0 0 15px var(--green),0 0 5px #ffffff2a} }

/* ------- marketbar ------- */
.market-select select{ border-radius:6px;padding:0 9px }

.market-select select:focus{ outline:0;border-color:#8068dc;box-shadow:0 0 0 2px #8068dc22 }

.intervals{ background:#1b2130;border:1px solid #2f3849;border-radius:8px;padding:2px;gap:2px }

.intervals button{ height:26px;border-radius:6px }

.intervals button.active{ background:linear-gradient(135deg,#5b3fae,#33408f);border:0;color:#fff;box-shadow:0 0 12px #8068dc55,inset 0 0 0 1px #ffffff16 }

.intervals button:hover:not(.active){ background:#2a3145;color:#d8d0ff }

.bar-link{ border-radius:6px;border:1px solid transparent;padding:0 10px }

.bar-link:hover{ border-color:#383f52 }

/* ------- toolbar ------- */
.chart-toolbar{ position:relative }

.chart-toolbar:before{ content:"";position:absolute;top:-1px;left:0;right:0;height:2px;background:linear-gradient(90deg,#8d6bea40,#8d6bea 30%,#5c8dff 60%,#23c59a55);opacity:.85;z-index:1;pointer-events:none }

.tool-btn{ border-radius:7px }

.tool-btn:active{ transform:translateY(1px) }

.tool-btn.active{ box-shadow:0 0 12px #8068dc44,inset 0 0 0 1px #ffffff16 }

#run-script{ font-weight:700;letter-spacing:.2px }

#run-script.active{ background:linear-gradient(135deg,#5b3fae,#2f6a8f);box-shadow:0 0 14px #8068dc66 }

/* ------- chart ------- */
.chart-wrap{ border-color:#343c50;box-shadow:0 18px 40px -18px #0007,inset 0 0 0 1px #ffffff0a }

.chart-title b{ letter-spacing:.2px }

.legend{ font-size:10px;padding:3px 9px;background:#241f3d80;border:1px solid #8068dc44;border-radius:6px }

/* ------- watchlist ------- */
.coin-dot.btc{ background:radial-gradient(circle at 30% 25%,#ffc266,#e8880c 58%,#a35b00);box-shadow:0 2px 8px #f7931a55 }

.coin-dot.eth{ background:radial-gradient(circle at 30% 25%,#a7b8ff,#4c67d8 58%,#33439a);box-shadow:0 2px 8px #627eea55 }

.coin-dot.sol{ background:radial-gradient(circle at 30% 25%,#c4b0ff,#7b3ff0 58%,#4c1f9e);box-shadow:0 2px 8px #7b61ff55 }

.coin-dot.bnb{ background:radial-gradient(circle at 30% 25%,#ffe08a,#e8a80c 58%,#9c6d00);box-shadow:0 2px 8px #f3ba2f66 }

.watch-head button:hover{ color:#ffd166;transform:rotate(90deg) scale(1.1) }

.watch-head-actions{display:inline-flex;align-items:center;gap:2px}
.watch-collapse-btn{width:26px;height:26px}
.watch-collapse-btn .ic{width:15px;height:15px}
.watch-collapse-btn:hover{transform:rotate(0)!important}
.tv-workspace.watch-collapsed{grid-template-columns:52px minmax(0,1fr)}
.tv-workspace.watch-collapsed .watchlist{display:none}
.watch-reopen{display:none;position:absolute;right:10px;top:52%;transform:translateY(-50%);z-index:16;width:30px;height:64px;border:0;border-radius:9px;background:linear-gradient(180deg,#1d2330,#181d28);color:#aeb6c8;font-size:20px;line-height:1;cursor:pointer;box-shadow:0 6px 16px #0004;align-items:center;justify-content:center;transition:.2s}
.tv-workspace.watch-collapsed .watch-reopen{display:flex}
.tv-workspace.script-open .watch-reopen{display:none}
.watch-reopen:hover{background:#292e3d;color:#fff}
.light-theme .watch-reopen{background:linear-gradient(180deg,#fff,#f0f3f8);border:1px solid #d5daea;color:#48506a}
.light-theme .watch-reopen:hover{background:#e7e9f7;color:#b2630a}
@media(max-width:900px){.tv-workspace.watch-collapsed{grid-template-columns:40px minmax(0,1fr)}.watch-reopen{display:none!important}}

.watch-row.selected{ box-shadow:0 6px 16px -8px #0009 }

.watch-row strong{ font-variant-numeric:tabular-nums }

/* ------- editor panel ------- */
.script-panel{ background:linear-gradient(180deg,#1a2030,#161c29) }

.script-panel .script-head{ position:relative }

.script-panel .script-head:after{ content:"";position:absolute;left:12px;right:12px;bottom:-1px;height:1px;background:linear-gradient(90deg,transparent,#8d6bea66,transparent) }

.script-panel .script-editor-shell{ border-radius:8px;transition:border-color .2s ease,box-shadow .2s ease }

.script-panel .script-editor-shell:focus-within{ border-color:#8d6bea;box-shadow:0 0 0 3px #8068dc2e }

.script-panel .script-status{ font-size:10px;color:#93a0b6 }

.script-panel .script-status.ok{ color:#3fd9af }

.script-panel .script-status.error{ color:#ff8594 }

/* ------- modal ------- */
.pine-modal{ backdrop-filter:blur(3px);background:rgba(10,14,24,.6) }

.pine-modal-box{ position:relative;border-radius:16px;background:linear-gradient(160deg,#1e2536,#161c2b);border-color:#4a566f;box-shadow:0 30px 70px #000c,inset 0 0 0 1px #ffffff0d }

.pine-modal-box:before{ content:"";position:absolute;top:0;left:18px;right:18px;height:2px;border-radius:0 0 6px 6px;background:linear-gradient(90deg,transparent,#8d6bea,#5c8dff,transparent) }

.pine-modal-title{ letter-spacing:.3px }

.pine-modal-sub{ color:#96a1b8 }

/* ------- light theme parity ------- */
body.light-theme,.light-theme body{ background:radial-gradient(900px 500px at 8% -15%,#ffd9a8 0%,transparent 60%),#f4f6fb }

.light-theme ::selection{ background:#ffdfb0;color:#1b2333 }

.light-theme .tv-shell ::-webkit-scrollbar-thumb{ background:#c3cbde;border:2px solid transparent;background-clip:padding-box }

.light-theme .tv-shell ::-webkit-scrollbar-thumb:hover{ background:#aab4cc;border:2px solid transparent;background-clip:padding-box }

.light-theme .tv-shell{ scrollbar-color:#b7c0d6 transparent }

.light-theme .tv-logo span{ background:linear-gradient(145deg,#ff9e00,#d97400);border-color:#ffb35c;box-shadow:0 0 18px #ff910044,inset 0 0 0 1px #ffffff22 }

.light-theme .tv-logo span .ic{ color:#fff }

.light-theme .tv-logo strong{ background:linear-gradient(90deg,#c96f00,#ffb340);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent }

.light-theme .tv-quote strong{ text-shadow:0 1px 0 #ffffff }

.light-theme .intervals{ background:#eef1f8;border-color:#d6dce8 }

.light-theme .intervals button.active{ background:linear-gradient(135deg,#ff9100,#e07f00);color:#fff }

.light-theme .intervals button:hover:not(.active){ background:#e4e6f2;color:#c96f00 }

.light-theme .chart-wrap{ box-shadow:0 16px 34px -22px #1b233355,inset 0 0 0 1px #ffffff }

.light-theme .chart-toolbar:before{ opacity:.55 }

.light-theme .legend{ background:#fff1dc;border-color:#ffc98a }

.light-theme .script-panel{ background:linear-gradient(180deg,#ffffff,#f4f6fb) }

.light-theme .script-panel .script-head:after{ background:linear-gradient(90deg,transparent,#ffb35c 50%,transparent) }

.light-theme .pine-modal{ background:rgba(35,42,60,.35) }

.light-theme .pine-modal-box{ background:linear-gradient(160deg,#ffffff,#f2f5fa);border-color:#cdd5e4;box-shadow:0 30px 70px #66708540,inset 0 0 0 1px #ffffff }

.light-theme .pine-modal-box:before{ background:linear-gradient(90deg,transparent,#ff9100,#ffb340,transparent);opacity:.7 }

/* ============ chart settings modal (v48) ============ */
.settings-group{ display:flex;flex-direction:column;gap:10px;margin:12px 0 4px }

.settings-row{ display:flex;align-items:center;justify-content:space-between;gap:10px;color:#dfe5f2;font-size:11px;cursor:pointer }

.settings-row>span:first-child{ color:#aeb9d0 }

.settings-inline{ display:inline-flex;align-items:center;gap:6px }

#price-type-settings{margin-top:12px;padding-top:10px;border-top:1px solid #343b4c}
#price-type-settings>.settings-row:first-child{justify-content:flex-start;color:#dfe5f2}
#price-type-settings .settings-inline{gap:4px}
#price-type-settings select,#price-type-settings input[type="number"]{box-sizing:border-box;width:76px;min-width:0;height:25px;padding:2px 4px;border:1px solid #3b4559;border-radius:5px;background:#202737;color:#dfe5f2;font:11px "Trebuchet MS",Arial,sans-serif;text-align:center}
#price-type-settings select{width:145px;text-align:left}
#price-type-settings input[type="number"]{width:62px}
#price-type-settings input:disabled{opacity:.38;cursor:not-allowed}
#price-type-settings .settings-hint{color:#929db2;font-size:10px;line-height:1.45}
.light-theme #price-type-settings{border-color:#d9deea}
.light-theme #price-type-settings>.settings-row:first-child{color:#20283a}
.light-theme #price-type-settings select,.light-theme #price-type-settings input[type="number"]{border-color:#c9d1e0;background:#f8faff;color:#1e2b42}
.light-theme #price-type-settings .settings-hint{color:#626c7e}

.settings-inline input[type="color"]{ width:30px;height:24px;padding:0;border:1px solid #4c5a73;border-radius:5px;background:#202737;cursor:pointer }

.settings-inline input[type="text"]{ width:74px;height:24px;border:1px solid #3b4559;border-radius:5px;background:#202737;color:#dfe5f2;padding:0 7px;font:11px Consolas,monospace;direction:ltr;text-align:center }

.settings-inline input[type="text"]:focus{ outline:0;border-color:#8d6bea }

.settings-row input[type="checkbox"].settings-check{ width:16px;height:16px;accent-color:#8d6bea;cursor:pointer }

.settings-inline input[type="color"]:disabled,.settings-inline input[type="text"]:disabled{ opacity:.35;cursor:not-allowed }

.light-theme .settings-row{ color:#1b2333 }

.light-theme .settings-row>span:first-child{ color:#000 }

.light-theme .settings-inline input[type="color"]{ border-color:#c9d1e0;background:#fff }

.light-theme .settings-inline input[type="text"]{ border-color:#c9d1e0;background:#f8faff;color:#1e2b42 }

/* ============ indicator dropdown (v49) ============ */
.indicator-popover{ position:absolute;z-index:24;top:46px;left:8px;right:auto;display:none;width:250px;max-height:min(440px,calc(100vh - 110px));overflow:auto;padding:6px;background:#202532;border:1px solid #3a4151;border-radius:8px;box-shadow:0 14px 30px #0008 }

.indicator-popover.open{ display:block }

.indicator-popover .ind-section{ display:flex;flex-direction:column;gap:2px;padding:4px 0 5px;border-bottom:1px solid #2b3448 }

.indicator-popover .ind-section:last-child{ border-bottom:0 }

.indicator-popover .ind-section b{ color:#c5b3ff;font-size:10px;padding:3px 8px 3px;font-weight:600;letter-spacing:.3px }

.indicator-popover .ind-item{ height:28px;border:0;border-radius:5px;background:transparent;color:#aeb6c8;text-align:left;padding:0 8px;font-size:10px;cursor:pointer;display:flex;align-items:center;gap:6px;white-space:nowrap;transition:.15s }

.indicator-popover .ind-item:before{ content:'▫';color:#8670ce;font-size:10px }

.indicator-popover .ind-item:hover{ background:#2e3649;color:#fff }

.indicator-popover .ind-item.active{ background:linear-gradient(135deg,#322a55,#2c3b6e);color:#e4dcff;box-shadow:inset 0 0 0 1px #8068dc66 }

.indicator-popover .ind-item.active:before{ content:'✓';color:#31d39a;font-weight:700 }

#indicator-btn.active{ background:#2a2445;color:#dfd5ff;box-shadow:0 0 12px #8068dc44,inset 0 0 0 1px #8068dc88 }

.light-theme .indicator-popover{ background:#fff;border-color:#c5ccdc;box-shadow:0 18px 40px #66708535 }

.light-theme .indicator-popover .ind-section{ border-bottom-color:#e7eaf3 }

.light-theme .indicator-popover .ind-section b{ color:#ff9100 }

.light-theme .indicator-popover .ind-item{ color:#000 }

.light-theme .indicator-popover .ind-item:before{ color:#ffb35c }

.light-theme .indicator-popover .ind-item:hover{ background:#edf0f7;color:#202b43 }

.light-theme .indicator-popover .ind-item.active{ background:#ffe3bf;color:#c96f00;box-shadow:inset 0 0 0 1px #ffa64d80 }

.light-theme .indicator-popover .ind-item.active:before{ color:#1d9b5f }

.chart-kind{ position:relative }
.chart-type-pop{ width:172px;top:40px;left:0;right:auto;max-height:min(480px,calc(100vh - 110px)) }
#chart-type-btn.active{ background:#1e2740;color:#fff;box-shadow:inset 0 0 0 1px #5a6b9c;border-color:#5a6b9c }
.light-theme #chart-type-btn.active{ background:#ffe3bf;color:#c96f00;box-shadow:0 0 12px #ff910033,inset 0 0 0 1px #ffa64d }

.light-theme #indicator-btn.active{ background:#ffe3bf;color:#c96f00;box-shadow:0 0 12px #ff910033,inset 0 0 0 1px #ffa64d }

/* ============ indicator legend chips + per-indicator settings (v50) ============ */
.indicator-legend{ position:absolute;z-index:120;inset:0;display:none;pointer-events:none }

.indicator-legend .ind-chip{ position:absolute;display:inline-flex;align-items:center;gap:5px;pointer-events:auto;max-width:220px;height:22px;padding:0 8px 0 4px;background:linear-gradient(135deg,#1d2440f2,#232c47f0);border:1px solid #4a5370;border-radius:6px;box-shadow:0 6px 16px #0007,inset 0 0 0 1px #ffffff0d;backdrop-filter:blur(4px);font-size:10px;direction:ltr;transition:.15s;white-space:nowrap }

.indicator-legend .ind-chip:hover{ border-color:#8068dc;box-shadow:0 8px 20px #2a1f4e88,inset 0 0 0 1px #8068dc55 }

.indicator-legend .ind-chip.collapsed{ opacity:.55;border-style:dashed }

.indicator-legend .ind-chip .ind-chip-dot{ width:8px;height:8px;border-radius:50%;flex:0 0 8px;box-shadow:0 0 6px #0006 }

.indicator-legend .ind-chip b{ color:#e6eaf5;font-weight:600;letter-spacing:.2px;font-size:10px }

.indicator-legend .ind-chip .ind-chip-val{ color:#9fb0cf;font-size:9px;font-weight:600;letter-spacing:.2px;max-width:90px;overflow:hidden;text-overflow:ellipsis;direction:ltr }

.indicator-legend .ind-chip-btns{ display:inline-flex;gap:2px;margin-right:3px }

.indicator-legend .ind-chip-btns button{ width:17px;height:17px;border:0;border-radius:4px;background:#2a3350;color:#9fb0cf;font-size:9px;cursor:pointer;display:grid;place-items:center;line-height:1;transition:.15s }

.indicator-legend .ind-chip-btns button .ic{width:13px;height:13px;--ic-sw:2}

.indicator-legend .ind-chip-btns button:hover{ background:#3b3265;color:#fff }

.indicator-legend .ind-chip-btns .ind-chip-x:hover{ background:#4a2138;color:#ff8594 }

.light-theme .indicator-legend .ind-chip{ background:linear-gradient(135deg,#ffffff,#f4f7ff);border-color:#cad2e4;box-shadow:0 6px 16px #66708526,inset 0 0 0 1px #ffffff }

.light-theme .indicator-legend .ind-chip:hover{ border-color:#ffb35c }

.light-theme .indicator-legend .ind-chip b{ color:#253149 }

.light-theme .indicator-legend .ind-chip .ind-chip-val{ color:#000 }

.light-theme .indicator-legend .ind-chip-btns button{ background:#eaedf6;color:#000 }

.light-theme .indicator-legend .ind-chip-btns button:hover{ background:#ffe3bf;color:#c96f00 }

.light-theme .indicator-legend .ind-chip-btns .ind-chip-x:hover{ background:#fde3ea;color:#c93a55 }

.ind-settings-modal .ind-set-row input[type="number"]{ width:74px }

.ind-settings-modal .ind-set-note{ color:#96a1b8;font-size:10px }

/* ============ marketbar quick actions (v08) ============ */
.bar-btn{height:28px;border:0;border-radius:3px;background:transparent;color:#9ba3b5;padding:0 9px;font-size:10px;cursor:pointer;white-space:nowrap;display:inline-flex;align-items:center;gap:4px}
.bar-btn:hover,.bar-btn.active{background:#2d3350;color:#e0d8ff}
.bar-btn .ic{width:15px;height:15px}
.bar-sep{width:1px;height:20px;background:var(--line)}
.bar-drop{position:relative;display:inline-flex;align-items:center}
#indicator-popover{position:fixed;top:0;left:0;right:auto;transform:none}
#chart-type-select{width:112px;cursor:pointer}
#zoom-reset{min-width:46px;justify-content:center}
@media(max-width:900px){#indicator-btn,#pine-toggle,#zoom-out,#zoom-reset,#zoom-in,#chart-settings-btn{flex-shrink:0}.tv-marketbar{gap:7px}}
.light-theme #indicator-popover{background:#fff;border-color:#d5daea}
.light-theme .bar-btn{color:#000}
.light-theme .bar-btn:hover,.light-theme .bar-btn.active{background:#e7e9f7;color:#b2630a}

/* ============ drawing settings popover (v10) ============ */
.draw-settings-pop{position:fixed;z-index:40;top:60px;left:14px;width:170px;padding:9px 10px;background:linear-gradient(145deg,#272d3b,#1c2230);border:1px solid #4a556d;border-radius:10px;box-shadow:0 18px 45px #000b;display:none}
.draw-settings-pop.open{display:block}
.ds-hint{display:none;font-size:11px;color:#ffb35c;text-align:center;margin:2px 0 4px}
.ds-levels{margin:6px 0 2px;padding-top:6px;border-top:1px solid #ffffff14}
.ds-lv-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}
.ds-lv-head span{font-size:11px;color:#c5cbda}
.ds-lv-head button{width:20px;height:20px;border-radius:6px;border:1px solid #4a556d;background:#2b3348;color:#fff;font-size:13px;line-height:1;cursor:pointer}
.ds-lv-row{display:flex;align-items:center;gap:5px;margin-bottom:4px}
.ds-lv-row input[type=number]{flex:1;min-width:0;background:#141927;border:1px solid #3a4358;color:#fff;border-radius:6px;padding:3px 5px;font-size:11px}
.ds-lv-row input[type=color]{width:26px;height:20px;padding:0;border:1px solid #3a4358;border-radius:5px;background:#141927;cursor:pointer}
.ds-lv-row button{width:20px;height:20px;border-radius:6px;border:1px solid #4a556d;background:transparent;color:#ff8f8f;font-size:11px;line-height:1;cursor:pointer}
.light-theme .ds-lv-head span{color:#3c4356}
.light-theme .ds-lv-head button{background:#eef1f7;border-color:#c5ccdc;color:#111}
.light-theme .ds-lv-row input[type=number]{background:#fff;border-color:#c5ccdc;color:#111}
.light-theme .ds-lv-row input[type=color]{background:#fff;border-color:#c5ccdc}
.ds-row input[type=text]{flex:1;min-width:0;background:#141927;border:1px solid #3a4358;color:#fff;border-radius:6px;padding:3px 6px;font-size:11px}
.ds-inline{display:inline-flex;align-items:center;gap:6px}
.ds-row input[type=range]{width:96px;height:18px;accent-color:var(--blue);cursor:pointer}
.ds-row input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:2px;background:#3b4559}
.ds-row input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:12px;height:12px;margin-top:-4px;border-radius:50%;background:var(--blue);border:1px solid #6f9bff}
.ds-row b{min-width:34px;text-align:right;font-size:10px;font-weight:400;color:#cfd7e8;font-variant-numeric:tabular-nums}
.light-theme .ds-row input[type=text]{background:#fff;border-color:#c5ccdc;color:#111}
.tv-shell{position:relative}
.top-reopen{display:none;position:absolute;top:0;left:50%;transform:translateX(-50%);z-index:30;width:64px;height:22px;border:0;border-radius:0 0 9px 9px;background:linear-gradient(180deg,#1d2330,#181d28);color:#aeb6c8;cursor:pointer;box-shadow:0 6px 16px #0004;align-items:center;justify-content:center}
.top-reopen .ic{width:15px;height:15px}
.tv-shell.top-collapsed .tv-topbar{display:none}
.tv-shell.top-collapsed .top-reopen{display:flex}
.light-theme .top-reopen{background:linear-gradient(180deg,#fff,#f0f3f8);border:1px solid #d5daea;color:#48506a}
.ctx-menu{position:fixed;z-index:60;display:none;min-width:130px;padding:4px;background:linear-gradient(145deg,#272d3b,#1c2230);border:1px solid #4a556d;border-radius:8px;box-shadow:0 14px 30px #000a}
.ctx-menu.open{display:block}
.ctx-menu button{display:block;width:100%;text-align:left;border:0;background:transparent;color:#c5cbda;font-size:11px;padding:6px 9px;border-radius:5px;cursor:pointer}
.ctx-menu button:hover{background:#2e3649;color:#fff}
.light-theme .ctx-menu{background:#fff;border-color:#d5daea}
.light-theme .ctx-menu button{color:#111}
.light-theme .ctx-menu button:hover{background:#edf0f7}
.layout-popover,.alert-popover{position:fixed;z-index:40;top:0;left:0;right:auto;transform:none;display:none;width:230px;max-height:min(440px,calc(100vh - 110px));overflow:auto;padding:6px;background:#202532;border:1px solid #3a4151;border-radius:8px;box-shadow:0 14px 30px #0008}
.layout-popover.open,.alert-popover.open{display:block}
.layout-popover .layout-item{height:28px;width:100%;border:0;border-radius:5px;background:transparent;color:#aeb6c8;text-align:left;padding:0 8px;font-size:10px;cursor:pointer;display:flex;align-items:center;white-space:nowrap}
.layout-popover .layout-item:hover{background:#2e3649;color:#fff}
.layout-popover .layout-item.active{background:linear-gradient(135deg,#322a55,#2c3b6e);color:#e4dcff}
.alert-row{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:4px 8px;font-size:10px;color:#aeb6c8}
.alert-row button{width:20px;height:20px;border-radius:6px;border:1px solid #4a556d;background:transparent;color:#ff8f8f;font-size:11px;cursor:pointer}
.layout-view{display:none}
.layout-view.open{display:grid;flex:1 1 auto;min-height:calc(100vh - 220px);gap:6px;padding:6px}
.layout-view.lv-v2{grid-template-columns:1fr 1fr}
.layout-view.lv-h2{grid-template-rows:1fr 1fr}
.layout-view.lv-grid4{grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr}
.layout-view iframe{width:100%;height:100%;min-height:280px;border:1px solid #2b3348;border-radius:8px;background:#131722}
.tv-shell.layout-multi .tv-workspace{display:none}
.embed .tv-topbar,.embed .tv-footer{display:none}
.replay-bar{position:fixed;z-index:55;bottom:14px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:6px;padding:6px 10px;background:linear-gradient(145deg,#272d3b,#1c2230);border:1px solid #4a556d;border-radius:10px;box-shadow:0 14px 30px #000a;color:#c5cbda;font-size:11px}
.replay-bar button{height:26px;min-width:30px;padding:0 9px;border-radius:6px;border:1px solid #4a556d;background:#2b3348;color:#fff;font-size:11px;cursor:pointer}
.replay-bar button:hover{background:#39415a}
.bottom-dock{border-top:1px solid var(--line);background:#171a23;min-height:190px;max-height:300px;overflow:auto}
.dock-tabs{display:flex;align-items:center;gap:4px;padding:6px 14px 0}
.dock-tab{height:28px;padding:0 12px;border:1px solid transparent;border-bottom:0;border-radius:6px 6px 0 0;background:transparent;color:#9ba3b5;font-size:11px;cursor:pointer}
.dock-tab.active{background:#20263a;color:#fff;border-color:#343c4e}
.dock-tab-close{margin-left:auto;background:transparent;border:0;color:#9ba3b5;font-size:14px;cursor:pointer}
.dock-pane{padding:8px 14px 14px;border-top:1px solid #343c4e}
.dock-row{display:flex;align-items:center;gap:10px;margin:6px 0;color:#aeb6c8;font-size:11px;flex-wrap:wrap}
.dock-row input[type=number]{width:90px;background:#141927;border:1px solid #3a4358;color:#fff;border-radius:6px;padding:3px 6px;font-size:11px}
.dock-status{color:#788399}
.dock-table-wrap{overflow:auto;max-height:150px}
.dock-table{width:100%;border-collapse:collapse;font-size:11px;color:#c5cbda}
.dock-table th{position:sticky;top:0;background:#20263a;color:#8f9bb3;text-align:left;padding:5px 8px;cursor:pointer;white-space:nowrap}
.dock-table td{padding:4px 8px;border-top:1px solid #ffffff10;white-space:nowrap}
.dock-table tbody tr:hover{background:#ffffff08}
.dock-table tbody tr{cursor:pointer}
.dock-table .pos{color:#31d39a}
.dock-table .neg{color:#ff8f8f}
.dock-table button{border:1px solid #4a556d;background:transparent;color:#ff8f8f;border-radius:5px;font-size:10px;padding:1px 7px;cursor:pointer}
.toast{position:fixed;z-index:99;bottom:18px;right:18px;max-width:320px;padding:10px 14px;background:linear-gradient(145deg,#2b3348,#1c2230);border:1px solid #4a556d;border-left:3px solid #f0b35b;border-radius:8px;color:#e8ecf5;font-size:12px;box-shadow:0 14px 30px #000b;opacity:0;transform:translateY(8px);transition:.25s;pointer-events:none}
.toast.show{opacity:1;transform:none}
.light-theme .layout-popover,.light-theme .alert-popover{background:#fff;border-color:#c5ccdc}
.light-theme .layout-popover .layout-item{color:#000}
.light-theme .replay-bar{background:#fff;border-color:#d5daea;color:#111}
.light-theme .replay-bar button{background:#eef1f7;border-color:#c5ccdc;color:#111}
.light-theme .bottom-dock{background:#fff}
.light-theme .dock-tab{color:#3c4356}
.light-theme .dock-tab.active{background:#eef1f7;color:#111;border-color:#c5ccdc}
.light-theme .dock-table{color:#111}
.light-theme .dock-table th{background:#eef1f7;color:#3c4356}
.light-theme .dock-row input[type=number]{background:#fff;border-color:#c5ccdc;color:#111}
.compare-popover,.template-popover{position:fixed;z-index:40;top:0;left:0;right:auto;transform:none;display:none;width:230px;max-height:min(440px,calc(100vh - 110px));overflow:auto;padding:6px;background:#202532;border:1px solid #3a4151;border-radius:8px;box-shadow:0 14px 30px #0008}
.compare-popover.open,.template-popover.open{display:block}
.compare-row{display:flex;align-items:center;gap:6px;padding:4px 8px;font-size:10px;color:#aeb6c8}
.compare-row i{width:8px;height:8px;border-radius:50%;flex:0 0 auto}
.compare-row button{margin-left:auto;width:20px;height:20px;border-radius:6px;border:1px solid #4a556d;background:transparent;color:#ff8f8f;font-size:11px;cursor:pointer}
.compare-legend{position:absolute;left:10px;top:66px;z-index:15;display:flex;gap:6px;flex-wrap:wrap}
.chart-title.chart-legend{position:absolute;left:10px;top:8px;z-index:14;display:flex;flex-direction:column;align-items:flex-start;gap:3px;padding:0;background:transparent;pointer-events:none}
.sym-legend{display:flex;flex-direction:column;gap:1px}
#legend-symbol{font-size:13px;color:#5b9cf6;letter-spacing:.2px}
#legend-ohlc{font-size:11px;color:#c5cbda;display:flex;flex-wrap:wrap}
#legend-ohlc .lg-lb{color:#788399}
#legend-ohlc .pos{color:#31d39a}
#legend-ohlc .neg{color:#ff8f8f}
.chart-title.chart-legend .legend{align-self:flex-start}
.light-theme #legend-symbol{color:#2962ff}
.light-theme #legend-ohlc{color:#3c4356}
.light-theme #legend-ohlc .lg-lb{color:#687186}
.compare-chip{display:inline-flex;align-items:center;gap:5px;padding:2px 4px 2px 8px;background:#20263add;border:1px solid #3a4358;border-radius:6px;color:#dfe5f2;font-size:10px}
.compare-chip i{width:8px;height:8px;border-radius:50%}
.compare-chip button{border:0;background:transparent;color:#ff8f8f;font-size:11px;cursor:pointer;padding:0 3px}
.market-select input[type=text]{height:28px;width:110px;border:1px solid var(--line);border-radius:4px;background:#202532;color:var(--text);font-size:11px;padding:0 8px}
.market-select:has(.symbol-results){position:relative}
.market-select input[type=text]{width:150px}
.symbol-results{display:none;position:absolute;top:32px;left:0;z-index:260;width:260px;max-height:340px;overflow:auto;background:#1b2130;border:1px solid #3b4559;border-radius:8px;box-shadow:0 14px 34px #0009;padding:4px}
.symbol-results.open{display:block}
.sym-result{display:flex;align-items:baseline;gap:5px;width:100%;padding:5px 8px;border:0;border-radius:5px;background:transparent;color:var(--text);font-size:11px;text-align:left;cursor:pointer}
.sym-result:hover{background:#2e3649}
.sym-result b{font-weight:600}
.sym-result span{color:var(--muted);font-size:10px}
.sym-result-empty{padding:6px 8px;color:var(--muted);font-size:10px}
.light-theme .symbol-results{background:#fff;border-color:#c5ccdc;box-shadow:0 14px 34px #1e2b4222}
.light-theme .sym-result:hover{background:#eef2fa}
.bt-controls{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px;padding:8px 10px;border-bottom:1px solid var(--line);background:#181d29}
.bt-field{display:flex;flex-direction:column;gap:3px}
.bt-field>label{color:var(--muted);font-size:10px;line-height:1}
.bt-field input[type=number],.bt-field input[type=date],.bt-field select{height:26px;min-width:96px;padding:0 7px;border:1px solid #3b4559;border-radius:5px;background:#202737;color:#e5e9f2;font:11px "Trebuchet MS",Arial,sans-serif}
.bt-field input:focus,.bt-field select:focus{outline:0;border-color:#8068dc;box-shadow:0 0 0 2px #8068dc22}
.bt-dates{flex-direction:row;align-items:flex-end;gap:5px}
.bt-dates>label{padding-bottom:6px}
.bt-actions{flex-direction:row;align-items:center;gap:6px;margin-left:auto}
.bt-metrics{display:grid;grid-template-columns:repeat(auto-fill,minmax(148px,1fr));gap:1px;background:var(--line);border-bottom:1px solid var(--line)}
.bt-metric{display:flex;flex-direction:column;gap:2px;padding:7px 9px;background:#1e222d}
.bt-metric>span{color:var(--muted);font-size:10px}
.bt-metric>b{color:var(--text);font-size:12px;font-weight:600;font-variant-numeric:tabular-nums}
.bt-metric>b i{color:var(--muted);font-size:10px;font-style:normal;font-weight:400}
.bt-metric.pos>b{color:#26a69a}
.bt-metric.neg>b{color:#ef5350}
.bt-empty{grid-column:1/-1;padding:12px;text-align:center;color:var(--muted);font-size:11px;background:#1e222d}
.bt-charts{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--line);border-bottom:1px solid var(--line)}
.bt-chart-cell{display:flex;flex-direction:column;gap:3px;padding:7px 9px;background:#1e222d}
.bt-chart-title{color:var(--muted);font-size:10px}
.bt-chart-cell canvas{width:100%;display:block}
.bt-trades-head{display:flex;align-items:center;gap:8px;padding:6px 10px}
.bt-table-wrap{max-height:300px}
.bt-table th{cursor:pointer;white-space:nowrap}
.bt-table th[data-bt-sort]:hover{color:var(--text)}
.bt-table td{white-space:nowrap}
.bt-table tbody tr{cursor:pointer}
.bt-table tbody tr:hover{background:#232a3a}
.bt-table .bt-empty{text-align:center;color:var(--muted);padding:10px}
.light-theme .bt-controls{background:#f2f5fb}
.light-theme .bt-field input[type=number],.light-theme .bt-field input[type=date],.light-theme .bt-field select{background:#fff;border-color:#c9d1e0;color:#1e2b42}
.light-theme .bt-metric,.light-theme .bt-chart-cell,.light-theme .bt-empty{background:#fff}
.light-theme .bt-metric.pos>b{color:#089981}
.light-theme .bt-metric.neg>b{color:#e04040}
.light-theme .bt-table tbody tr:hover{background:#eef2fa}
.pp-top{display:flex;flex-direction:column;gap:8px;padding:8px 10px;border-bottom:1px solid var(--line);background:#181d29}
.pp-stats{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:1px;background:var(--line)}
.pp-stat{display:flex;flex-direction:column;gap:2px;padding:6px 9px;background:#1e222d}
.pp-stat>span{color:var(--muted);font-size:10px}
.pp-stat>b{color:var(--text);font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}
.pp-stat>b.pos{color:#26a69a}
.pp-stat>b.neg{color:#ef5350}
.pp-controls{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px}
.pp-buy{color:#26a69a!important;border-color:#26a69a!important}
.pp-sell{color:#ef5350!important;border-color:#ef5350!important}
.pp-charts{grid-template-columns:1fr}
.pp-table-wrap{max-height:230px}
.light-theme .pp-top{background:#f2f5fb}
.light-theme .pp-stat{background:#fff}
.light-theme .pp-stat>b.pos{color:#089981}
.light-theme .pp-stat>b.neg{color:#e04040}
.cp-bar{display:flex;flex-wrap:wrap;align-items:center;gap:7px;padding:8px 10px;border-bottom:1px solid var(--line);background:#181d29}
.cp-search{flex:1 1 220px;min-width:160px;height:26px;padding:0 9px;border:1px solid #3b4559;border-radius:5px;background:#202737;color:#e5e9f2;font:11px "Trebuchet MS",Arial,sans-serif}
.cp-search:focus{outline:0;border-color:#8068dc;box-shadow:0 0 0 2px #8068dc22}
.cp-select{height:26px;padding:0 7px;border:1px solid #3b4559;border-radius:5px;background:#202737;color:#e5e9f2;font:11px "Trebuchet MS",Arial,sans-serif}
.cp-stats{display:flex;flex-wrap:wrap;gap:6px;padding:7px 10px;border-bottom:1px solid var(--line)}
.cp-stat-chip{display:inline-flex;align-items:baseline;gap:4px;padding:3px 8px;border:1px solid #3a4358;border-radius:12px;background:#20263a}
.cp-stat-chip b{color:#cbd5ea;font-size:12px}
.cp-stat-chip span{color:var(--muted);font-size:10px}
.cp-split{display:grid;grid-template-columns:minmax(220px,320px) 1fr;min-height:260px}
.cp-list{overflow:auto;border-right:1px solid var(--line);max-height:420px}
.cp-card{display:flex;flex-direction:column;gap:4px;padding:8px 10px;border-bottom:1px solid #232a38;cursor:pointer}
.cp-card:hover{background:#202636}
.cp-card.active{background:#26304a;box-shadow:inset 3px 0 0 #8068dc}
.cp-card-top{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.cp-kind{padding:1px 6px;border-radius:9px;font-size:9px;font-weight:600;letter-spacing:.2px}
.cp-kind.k-indicator{background:#1e3a5f;color:#7fc4ff}
.cp-kind.k-strategy{background:#123a32;color:#4fd1a5}
.cp-kind.k-analysis{background:#3b2c55;color:#c4a7ff}
.cp-vis{padding:1px 6px;border-radius:9px;font-size:9px;border:1px solid #3a4358;color:var(--muted)}
.cp-vis.v-private{border-color:#5a4a2c;color:#f0b35b}
.cp-sym{color:var(--muted);font-size:9px}
.cp-when{margin-left:auto;color:var(--muted);font-size:9px}
.cp-title{color:var(--text);font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cp-desc{color:var(--muted);font-size:10px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.cp-foot{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:10px}
.cp-by{color:#9aa6bd}
.cp-stat.liked{color:#ef5350}
.cp-detail{overflow:auto;padding:12px 14px;max-height:420px}
.cp-d-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.cp-d-title{margin:0;color:var(--text);font-size:15px}
.cp-d-meta{width:100%;color:var(--muted);font-size:10px}
.cp-d-desc{color:#c3cadd;font-size:12px;line-height:1.55;white-space:pre-wrap}
.cp-d-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:10px 0}
.cp-d-actions .liked{color:#ef5350;border-color:#ef5350}
.cp-d-actions .danger{color:#ef5350;border-color:#6a3038}
.cp-code{max-height:200px;overflow:auto;margin:0;padding:9px 10px;border:1px solid #2e3748;border-radius:6px;background:#171d29;color:#cfd6e6;font:10px/1.6 Consolas,"Courier New",monospace;white-space:pre;direction:ltr;text-align:left}
.cp-c-head{margin:14px 0 6px;padding-top:8px;border-top:1px solid var(--line);color:var(--text);font-size:11px}
.cp-comments{display:flex;flex-direction:column;gap:7px}
.cp-comment{padding:7px 9px;border:1px solid #29313f;border-radius:6px;background:#1b2130}
.cp-comment-h{display:flex;align-items:baseline;gap:7px;margin-bottom:3px}
.cp-comment-h b{color:#cbd5ea;font-size:11px}
.cp-comment-t{color:#b7c0d2;font-size:11px;line-height:1.5;white-space:pre-wrap;word-break:break-word}
.cp-comment-form{display:flex;flex-direction:column;gap:6px;align-items:flex-end;margin-top:10px}
.cp-comment-input{width:100%;min-height:38px;padding:7px 9px;border:1px solid #3b4559;border-radius:6px;background:#202737;color:#e5e9f2;font:11px/1.5 "Trebuchet MS",Arial,sans-serif;resize:vertical}
.cp-empty{padding:16px;text-align:center;color:var(--muted);font-size:11px}
.publish-modal-box{width:min(520px,92vw)}
.pub-desc-row{align-items:flex-start}
.pub-desc-row>span:first-child{padding-top:7px;white-space:nowrap}
.pub-desc-row textarea{width:100%;font:11px/1.5 "Trebuchet MS",Arial,sans-serif;resize:vertical}
.publish-modal-box select{height:26px;padding:0 7px;border:1px solid #3b4559;border-radius:5px;background:#202737;color:#e5e9f2;font:11px "Trebuchet MS",Arial,sans-serif}
.pine-modal-hint.error{color:#ff8f8f}
.cp-toast-wrap{position:fixed;top:14px;right:14px;z-index:9000;display:flex;flex-direction:column;gap:8px;max-width:min(380px,90vw);pointer-events:none}
.cp-toast{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border:1px solid #3b4559;border-left:3px solid #8068dc;border-radius:7px;background:#202737;color:#e5e9f2;font:12px/1.45 "Trebuchet MS",Arial,sans-serif;box-shadow:0 10px 28px #000a;pointer-events:auto}
.cp-toast span{flex:1;word-break:break-word}
.cp-toast.ok{border-left-color:#26a69a}
.cp-toast.err{border-left-color:#ef5350}
.cp-toast-x{flex:0 0 auto;width:18px;height:18px;border:0;border-radius:4px;background:transparent;color:#8b93a7;font-size:14px;line-height:1;cursor:pointer}
.cp-toast-x:hover{background:#2e3649;color:#fff}
.bottom-dock.cp-open{max-height:min(64vh,620px)}
.reference-ui .bottom-dock.cp-open{flex:0 0 auto;max-height:min(64vh,620px)}
.bottom-dock.cp-open .cp-split{height:min(52vh,470px);min-height:240px}
.bottom-dock.cp-open .cp-list,.bottom-dock.cp-open .cp-detail{max-height:none}
.cp-card.just-published{animation:cp-flash 2.4s ease-out}
@keyframes cp-flash{0%{background:#2f4a2f;box-shadow:inset 0 0 0 2px #26a69a}35%{background:#2f4a2f;box-shadow:inset 0 0 0 2px #26a69a}100%{background:transparent;box-shadow:inset 3px 0 0 #8068dc}}
/* The dock is far too short for a code browser, so Community opens as a full-screen overlay. */
.dock-pane.cp-overlay-host{position:fixed;inset:0;z-index:9500;margin:0;padding:0;background:#131722;display:none;flex-direction:column;box-shadow:0 0 0 100vmax #000000b0}
.dock-pane.cp-overlay-host .cp-head{display:flex;align-items:center;gap:10px;flex:0 0 auto;padding:10px 16px;border-bottom:1px solid var(--line);background:#181d29}
.dock-pane.cp-overlay-host .cp-head>b{color:#e8eaf2;font-size:14px}
.dock-pane.cp-overlay-host .cp-head>span{color:var(--muted);font-size:11px}
.dock-pane.cp-overlay-host .cp-close{margin-left:auto;height:26px;padding:0 12px;border:1px solid #3b4559;border-radius:5px;background:#202737;color:#e5e9f2;font:11px "Trebuchet MS",Arial,sans-serif;cursor:pointer}
.dock-pane.cp-overlay-host .cp-close:hover{background:#2e3649;color:#fff}
.dock-pane.cp-overlay-host .cp-bar{flex:0 0 auto}
.dock-pane.cp-overlay-host .cp-stats{flex:0 0 auto}
.dock-pane.cp-overlay-host .cp-split{flex:1 1 auto;height:auto;min-height:0;grid-template-columns:minmax(280px,380px) 1fr}
.dock-pane.cp-overlay-host .cp-list,.dock-pane.cp-overlay-host .cp-detail{max-height:none;height:100%}
.dock-pane.cp-overlay-host .cp-list{border-right:1px solid var(--line)}
.dock-pane.cp-overlay-host .cp-detail{padding:16px 20px}
.dock-pane.cp-overlay-host .cp-code{max-height:none}
body.cp-overlay-on{overflow:hidden}
.light-theme .dock-pane.cp-overlay-host{background:#f4f6fb}
.light-theme .dock-pane.cp-overlay-host .cp-head{background:#f2f5fb;border-color:#d5dbe8}
@media (max-width:860px){.dock-pane.cp-overlay-host .cp-split{grid-template-columns:1fr;grid-template-rows:minmax(140px,38%) 1fr}}
.light-theme .cp-bar{background:#f2f5fb}
.light-theme .cp-search,.light-theme .cp-select{background:#fff;border-color:#c9d1e0;color:#1e2b42}
.light-theme .cp-stat-chip{background:#eef2fa;border-color:#c5ccdc}
.light-theme .cp-stat-chip b{color:#1e2b42}
.light-theme .cp-card:hover{background:#eef2fa}
.cp-thumb{display:block;width:100%;max-height:150px;object-fit:cover;border:1px solid var(--line);border-radius:6px;background:#0e1118;cursor:pointer}
.cp-shot-frame{display:block;margin:0 0 12px;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:#0e1118;line-height:0}
.cp-shot{display:block;width:100%;max-height:420px;object-fit:contain;cursor:zoom-in}
.pub-img-row{align-items:flex-start}
.pub-img-input{flex:1 1 auto;min-width:0;padding:5px 8px;font:11px "Trebuchet MS",Arial,sans-serif;color:#cfd6e6;background:#161b26;border:1px solid #333c4f;border-radius:6px;cursor:pointer}
.pub-img-input::file-selector-button{margin-right:8px;padding:4px 10px;border:1px solid #3b4559;border-radius:5px;background:#202737;color:#e5e9f2;font:11px "Trebuchet MS",Arial,sans-serif;cursor:pointer}
.pub-img-input::file-selector-button:hover{background:#2e3649}
.pub-img-name{display:block;margin:2px 0 0;font-size:10px;color:var(--muted)}
.pub-img-preview{display:block;width:100%;max-height:150px;object-fit:contain;margin-top:6px;padding:4px;border:1px solid var(--line);border-radius:6px;background:#0e1118}
.light-theme .pub-img-input{background:#fff;border-color:#c9d1e0;color:#1e2b42}
.light-theme .pub-img-input::file-selector-button{background:#eef2fa;border-color:#c5ccdc;color:#1e2b42}
.broker-modal-box{width:min(720px,92vw);max-width:720px}
.broker-head{display:flex;align-items:flex-start;gap:10px;flex-wrap:wrap}
.broker-head .pine-modal-title{flex:0 0 auto}
.broker-head .pine-modal-sub{flex:1 1 200px;min-width:0}
.broker-head #broker-close{margin-left:auto;flex:0 0 auto}
.broker-mode-row{display:flex;align-items:center;gap:8px;margin:6px 0 10px}
.broker-venue{font-size:11px;color:var(--muted)}
.broker-mode-pill{margin-left:auto;padding:2px 9px;border-radius:20px;border:1px solid #3b4559;background:#202737;color:#cfd6e6;font:10px "Trebuchet MS",Arial,sans-serif}
.broker-mode-pill.live{border-color:#7a3a3a;background:#3a1f22;color:#ff9a9a}
.broker-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px;max-height:270px;overflow:auto;padding:2px}
.broker-card{display:flex;flex-direction:column;align-items:flex-start;gap:3px;padding:9px 10px;border:1px solid #333c4f;border-radius:9px;background:#161b26;color:#e5e9f2;cursor:pointer;text-align:left;font:12px "Trebuchet MS",Arial,sans-serif}
.broker-card:hover{border-color:#4a5570;background:#1d2432}
.broker-card b{font-size:12.5px;color:#f0f3fa}
.broker-card small{font-size:10px;color:#8b95ab;line-height:1.35}
.broker-card .bk-sandbox{display:inline-block;margin-top:2px;padding:1px 6px;border-radius:9px;border:1px solid #2f4a3f;background:#16241f;color:#6fd6a8;font-size:9px}
.broker-card .bk-nosandbox{display:inline-block;margin-top:2px;padding:1px 6px;border-radius:9px;border:1px solid #4a4130;background:#241f16;color:#e0b872;font-size:9px}
.broker-links{display:flex;flex-direction:column;gap:7px;margin-bottom:10px}
.broker-link{display:flex;align-items:center;gap:9px;padding:9px 11px;border:1px solid #333c4f;border-radius:9px;background:#141924}
.broker-link .bl-name{font:12.5px "Trebuchet MS",Arial,sans-serif;color:#eef1f8}
.broker-link .bl-key{font:10px Consolas,monospace;color:#8b95ab}
.broker-link .bl-spacer{flex:1 1 auto}
.broker-link .bl-pill{padding:2px 8px;border-radius:9px;border:1px solid #3b4559;background:#202737;color:#cfd6e6;font:9.5px "Trebuchet MS",Arial,sans-serif}
.broker-link .bl-pill.ok{border-color:#2f4a3f;background:#16241f;color:#6fd6a8}
.broker-link .bl-pill.error{border-color:#5a3232;background:#2a1a1c;color:#ff9a9a}
.broker-link .bl-pill.armed{border-color:#7a3a3a;background:#3a1f22;color:#ff9a9a}
.broker-link .bl-note{flex-basis:100%;font-size:10px;color:#9aa4b8;line-height:1.4}
.broker-form .settings-row{display:grid;grid-template-columns:104px 1fr;align-items:center;gap:10px}
.broker-form .settings-row>span:first-child{font-size:11px;line-height:1.3;padding:0}
.broker-form .settings-row .settings-inline{display:flex;gap:7px;align-items:center;min-width:0}
.broker-form textarea{resize:vertical;min-height:64px}
.broker-form-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:12px}
.broker-detail{margin-top:4px}
.broker-detail h4{margin:0 0 8px;font-size:12.5px;color:#eef1f8}
.broker-balances{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:6px;max-height:190px;overflow:auto}
.broker-bal-row{display:flex;justify-content:space-between;gap:8px;padding:5px 8px;border:1px solid #2b3346;border-radius:6px;background:#141924;font:11px "Trebuchet MS",Arial,sans-serif;color:#dfe4ef}
.broker-bal-row b{font-family:Consolas,monospace;color:#fff}
.broker-arm{display:flex;flex-direction:column;gap:7px;margin-top:11px;padding:10px;border:1px solid #4a4130;border-radius:8px;background:#241f16}
.broker-arm.warn-live{border-color:#7a3a3a;background:#2a1719}
.broker-arm p{margin:0;font-size:10.5px;color:#d8c49a;line-height:1.45}
.broker-arm.warn-live p{color:#f0b0b0}
.broker-arm .broker-arm-row{display:flex;gap:7px;align-items:center}
.broker-arm input{flex:1 1 auto;min-width:0;height:28px;padding:0 8px;border:1px solid #4a4130;border-radius:6px;background:#14100c;color:#f0e6d2;font:12px Consolas,monospace}
.order-modal-box{width:min(460px,92vw)}
.order-grid{display:grid;grid-template-columns:auto 1fr;gap:5px 12px;margin:10px 0;font:12px "Trebuchet MS",Arial,sans-serif}
.order-grid dt{color:var(--muted)}
.order-grid dd{margin:0;color:#f0f3fa;font-family:Consolas,monospace;text-align:right}
.order-grid dd.buy{color:#26a69a;font-weight:bold}
.order-grid dd.sell{color:#ef5350;font-weight:bold}
.order-warn{margin:8px 0 0;padding:8px 10px;border:1px solid #7a3a3a;border-radius:7px;background:#2a1719;color:#f0b0b0;font-size:10.5px;line-height:1.45}
.light-theme .broker-card,.light-theme .broker-link,.light-theme .broker-bal-row{background:#fff;border-color:#c9d1e0;color:#1e2b42}
.light-theme .broker-card b,.light-theme .broker-link .bl-name{color:#10192b}
.light-theme .broker-head #broker-close{background:#eef2fa;border-color:#c5ccdc;color:#1e2b42}
.light-theme .broker-mode-pill{background:#eef2fa;border-color:#c5ccdc;color:#1e2b42}
.light-theme .broker-link .bl-key{color:#5a6a85}
.cp-stat{display:inline-flex;align-items:center;gap:4px}
.cp-stat .ic{margin:0}
button[data-pine-action="settings"] svg.ic,button[data-pine-action="edit"] svg.ic{margin:0 5px 0 0}
[data-pine-visibility] svg.ic{margin:0 4px 0 0}
.light-theme .cp-card.active{background:#e4eafa}
.light-theme .cp-comment{background:#f5f7fc;border-color:#d5dbe8}
.light-theme .cp-comment-t{color:#33405a}
.light-theme .cp-code{background:#f7f9fd;border-color:#d5dbe8;color:#26314a}
@media (max-width:860px){.cp-split{grid-template-columns:1fr}.cp-list{border-right:0;border-bottom:1px solid var(--line);max-height:200px}}
.template-row{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:4px 8px;font-size:10px;color:#aeb6c8;cursor:pointer;border-radius:5px}
.template-row:hover{background:#2e3649;color:#fff}
.template-row button{width:20px;height:20px;border-radius:6px;border:1px solid #4a556d;background:transparent;color:#ff8f8f;font-size:11px;cursor:pointer}
.template-popover{width:300px;padding:14px;max-height:min(520px,calc(100vh - 96px));border-radius:12px}
.template-popover .ind-section{display:flex;flex-direction:column;gap:9px;padding:4px 0 13px;border-bottom:1px solid #343c4d}
.template-popover .ind-section:last-child{padding:12px 0 2px;border-bottom:0}
.template-popover .ind-section>b{font-size:13px;font-weight:650;letter-spacing:.1px;color:#eef2fa}
.template-popover .ds-row{display:grid;grid-template-columns:48px minmax(0,1fr);gap:10px;margin:0;font-size:12px}
.template-popover .ds-row input[type=text]{width:100%;height:34px;padding:0 10px;border-radius:8px;font:12px inherit;text-align:left}
#template-save{align-self:flex-start;min-height:34px;padding:0 14px;border-radius:8px;font-size:12px}
.template-row{display:grid;grid-template-columns:minmax(0,1fr) 66px 30px;align-items:center;gap:8px;min-height:40px;padding:4px 6px 4px 10px;font-size:12px;cursor:default}
.template-row>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.template-row button{width:auto;height:28px;border-radius:7px;font-size:12px}
.template-row .template-load{border-color:#2962ff;background:#2962ff;color:#fff;font-weight:600}
.template-row .template-load:hover{background:#1e53e5;border-color:#1e53e5}
.template-row button[title="Delete template"]{width:28px;color:#788397;font-size:16px}
.template-row button[title="Delete template"]:hover{border-color:#e5484d;background:#fff1f1;color:#d83940}
.light-theme .template-popover .ind-section{border-bottom-color:#e6e9ef}
.light-theme .template-popover .ind-section>b{color:#131722}
.light-theme .template-row{color:#202633}
.light-theme .template-row:hover{background:#f1f4f8;color:#131722}
.light-theme .template-row .template-load{color:#fff}
.light-theme .template-row button[title="Delete template"]{color:#687386}
@media(max-width:420px){.template-popover{width:min(300px,calc(100vw - 16px))}}
.light-theme .compare-popover,.light-theme .template-popover{background:#fff;border-color:#c5ccdc}
.light-theme .compare-row{color:#000}
.light-theme .compare-chip{background:#ffffffdd;border-color:#c5ccdc;color:#111}
.light-theme .market-select input[type=text]{background:#fff;color:#111}
.light-theme .template-row{color:#000}
#magnet-btn{margin-top:auto}
#magnet-btn span{font-size:9px}
.chart-zoom{position:absolute;left:10px;bottom:58px;z-index:16;display:flex;gap:2px;padding:3px;border-radius:8px;background:#1c223add;border:1px solid #ffffff14;box-shadow:0 8px 20px #0008}
#chart-settings-btn{position:absolute;right:88px;bottom:58px;z-index:16;width:30px;height:30px;padding:0;justify-content:center;border-radius:50%;background:#1c223add;border:1px solid #ffffff14;box-shadow:0 8px 20px #0008}
.light-theme .chart-zoom{background:#ffffffe6}
.light-theme #chart-settings-btn{background:#ffffffe6}
#draw-style-btn{position:relative;z-index:30}
.draw-settings-pop b{display:block;color:#f1f3f8;font-size:10.5px;margin-bottom:7px}
.ds-row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:5px 0;color:#aeb9d0;font-size:10px}
.ds-inline{display:inline-flex;align-items:center;gap:5px}
.ds-row input[type="number"],.ds-row select{width:64px;height:24px;border:1px solid #3b4559;border-radius:5px;background:#202737;color:#dfe5f2;padding:0 5px;font-size:10px}
.ds-row input[type="color"]{width:30px;height:24px;padding:0;border:1px solid #4c5a73;border-radius:5px;background:#202737;cursor:pointer}
.ds-row input[type="text"]{width:54px;height:24px;border:1px solid #3b4559;border-radius:5px;background:#202737;color:#dfe5f2;padding:0 5px;font:10px Consolas,monospace;direction:ltr;text-align:center}
.ds-actions{display:flex;gap:6px;margin-top:9px}
.ds-actions button{flex:1;height:25px;border:1px solid #3b4559;border-radius:5px;background:#232a3a;color:#c6cede;font-size:10px;cursor:pointer}
.ds-actions #ds-delete:hover{background:#4a2130;color:#ff8fa0;border-color:#7a3f52}
.ds-actions #ds-close:hover{background:#2a3a5c;color:#fff}
.light-theme .draw-settings-pop{background:#fff;border-color:#d5daea}
.light-theme .draw-settings-pop b{color:#1b2333}
.light-theme .ds-row{color:#000}
.light-theme .ds-row input[type="number"],.light-theme .ds-row select,.light-theme .ds-row input[type="text"]{border-color:#c9d1e0;background:#f8faff;color:#1e2b42}
.light-theme .ds-row input[type="color"]{border-color:#c9d1e0;background:#fff}
.light-theme .ds-actions button{background:#eef1f7;color:#1b2333;border-color:#d5daea}
.light-theme .ds-actions #ds-delete:hover{background:#fde3ea;color:#c93a55}
.light-theme .ds-actions #ds-close:hover{background:#e7e9f7;color:#b2630a}

/* Compact contextual toolbar for the selected drawing */
.draw-settings-pop{width:max-content;max-width:calc(100vw - 16px);padding:6px 8px;background:#fff;border:1px solid #dfe3eb;border-radius:9px;box-shadow:0 5px 22px #17203326;color:#202633}
.draw-settings-pop > b{display:none}
.draw-settings-pop .ds-toolbar{display:flex;align-items:center;gap:3px;white-space:nowrap}
.draw-settings-pop .ds-tool-button{position:relative;display:grid;place-items:center;width:34px;height:34px;padding:0;border:0;border-radius:6px;background:transparent;color:#303846;cursor:pointer}
.draw-settings-pop .ds-tool-button:hover,.draw-settings-pop .ds-tool-button.active{background:#eef1f6;color:#111827}
.draw-settings-pop .ds-tool-button svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
.draw-settings-pop .ds-tool-button input[type=color]{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;opacity:0;cursor:pointer}
.draw-settings-pop .ds-tool-button.ds-color-button::after{content:"";position:absolute;bottom:3px;left:8px;right:8px;height:3px;border-radius:2px;background:var(--drawing-color,#2962ff)}
.draw-settings-pop .ds-advanced{display:none}
.draw-settings-pop.details-open{width:min(340px,calc(100vw - 16px));max-height:calc(100vh - 24px);overflow:auto}
.draw-settings-pop.details-open .ds-advanced{display:flex}
.draw-settings-pop.details-open .ds-levels{display:block}
.draw-settings-pop .ds-hint{display:none!important}
.draw-settings-pop .ds-row{color:#515b6b}
.draw-settings-pop .ds-row input[type=number],.draw-settings-pop .ds-row select,.draw-settings-pop .ds-row input[type=text]{background:#f8f9fb;border-color:#d7dce5;color:#202633}
.draw-settings-pop .ds-actions button{background:#f5f6f8;border-color:#d7dce5;color:#303846}
.draw-settings-pop .ds-actions #ds-delete:hover{background:#fff0f1;color:#c6283d}
.draw-settings-pop .ds-actions #ds-close{display:none}
.reference-ui .draw-settings-pop{background:var(--panel);border-color:var(--line);color:var(--text)}
.reference-ui .draw-settings-pop .ds-tool-button{color:var(--text)}
.reference-ui .draw-settings-pop .ds-tool-button:hover,.reference-ui .draw-settings-pop .ds-tool-button.active{background:var(--ref-hover)}
@media(max-width:520px){.draw-settings-pop .ds-tool-button{width:30px;height:32px}.draw-settings-pop .ds-tool-button svg{width:19px;height:19px}}

.tool-panel button.tool-choice,#hide-tools{display:flex;align-items:center;gap:7px}
.tool-choice .tic,#hide-tools .tic{width:18px;height:18px;--ic-sw:1.9}
/* ============ timeframe favorites + dropdown (v48) ============ */
.tf-bar{display:flex;align-items:center;gap:2px;background:#1b2130;border:1px solid #2f3849;border-radius:8px;padding:2px}
.tf-favs{display:flex;gap:2px;align-items:center;max-width:250px;overflow:hidden}
.tf-favs button{height:26px;border:0;border-radius:6px;background:transparent;color:#9ba3b5;padding:0 9px;font-size:10px;cursor:pointer;white-space:nowrap}
.tf-favs button:hover{background:#2a3145;color:#d8d0ff}
.tf-favs button.active{background:linear-gradient(135deg,#5b3fae,#33408f);color:#fff;box-shadow:0 0 12px #8068dc55,inset 0 0 0 1px #ffffff16}
.tf-btn{height:26px;display:inline-flex;align-items:center;gap:4px;color:#e4dcff}
.tf-btn .tfs-a{width:11px;height:11px;color:#9ba3b5}
.tf-drop{position:relative}
.tf-popover{position:fixed;z-index:48;top:0;left:0;right:auto;transform:none;display:none;width:150px;max-height:min(390px,calc(100vh - 120px));overflow:auto;padding:4px;background:#202532;border:1px solid #3a4151;border-radius:8px;box-shadow:0 14px 30px #0008}
.tf-popover.open{display:block}
.tf-head{padding:4px 8px 5px;color:#c5b3ff;font-size:10px;font-weight:600;letter-spacing:.3px;border-bottom:1px solid #2b3448;margin-bottom:2px}
.tf-row{height:27px;width:100%;border:0;border-radius:5px;background:transparent;color:#aeb6c8;text-align:left;padding:0 6px 0 8px;font-size:10px;cursor:pointer;display:flex;align-items:center;gap:4px;white-space:nowrap}
.tf-row:hover{background:#2e3649;color:#fff}
.tf-row .tf-name{flex:1}
.tf-row .tf-star{width:20px;height:20px;border:0;border-radius:4px;background:transparent;color:#4a5468;font-size:12px;cursor:pointer;line-height:1;display:inline-flex;align-items:center;justify-content:center}
.tf-row .tf-star:hover{background:#3a4151;color:#c5b3ff}
.tf-row .tf-star.on{color:#ffc53d}
.tf-row.active{background:linear-gradient(135deg,#322a55,#2c3b6e);color:#e4dcff}
.light-theme .tf-bar{background:#eef1f8;border-color:#d6dce8}
.light-theme .tf-favs button{color:#454a55}
.light-theme .tf-favs button:hover{background:#e4e6f2;color:#c96f00}
.light-theme .tf-favs button.active{background:linear-gradient(135deg,#ff9100,#e07f00);color:#fff}
.light-theme .tf-btn{color:#c96f00}
.light-theme .tf-popover{background:#fff;border-color:#c5ccdc}
.light-theme .tf-head{color:#ff9100;border-bottom-color:#e7eaf3}
.light-theme .tf-row{color:#000}
.light-theme .tf-row:hover{background:#edf0f7}
.light-theme .tf-row.active{background:#ffe3bf;color:#c96f00}

.al-pop{width:336px;max-height:min(600px,calc(100vh - 110px));padding:8px}
.al-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:2px 2px 8px;color:#e6eaf3;font-size:12px;border-bottom:1px solid #2f3748}
.al-head span{color:var(--muted);font-size:10px;letter-spacing:.3px}
.al-tabs{display:flex;gap:5px;padding:9px 0 7px}
.al-tab{flex:1;height:27px;border:1px solid #343d52;border-radius:7px;background:#171d2a;color:#9aa4bb;font-size:10.5px;cursor:pointer;transition:.15s}
.al-tab:hover{color:#dfe5f2;border-color:#46536e}
.al-tab.active{background:linear-gradient(180deg,#2d374d,#243049);border-color:#4d5b7c;color:#fff}
.al-tab.active[data-al=price]{background:linear-gradient(180deg,#2962ff,#204ecb);border-color:#3f74ff}
.al-tab.active[data-al=ind]{background:linear-gradient(180deg,#8b6be8,#6f52c4);border-color:#9d80ef}
.al-tab.active[data-al=pine]{background:linear-gradient(180deg,#12a594,#0c8477);border-color:#2fc0ad}
.al-pane{padding:1px 0 2px}
.al-cond{display:flex;align-items:center;gap:7px;margin:3px 0 8px}
.al-cond select,.al-cond input{flex:1;min-width:0;height:28px;border:1px solid #39435a;border-radius:7px;background:#141a27;color:#e4e9f4;padding:0 8px;font-size:11px;outline:none}
.al-cond select:focus,.al-cond input:focus{border-color:#4f6ea8;box-shadow:0 0 0 2px #2962ff22}
.al-pane .ds-row select{width:150px}
.al-pane .ds-row input[type=text]{width:170px;text-align:left}
.al-chk{display:inline-flex;align-items:center;gap:6px;margin:4px 12px 6px 0;color:#aeb9d0;font-size:10.5px;cursor:pointer}
.al-chk input{accent-color:var(--blue);width:13px;height:13px;cursor:pointer}
.al-hint{margin:4px 0 8px;padding:7px 9px;border:1px dashed #3b465e;border-radius:7px;color:#8d97ad;font-size:10px;line-height:1.5;background:#161c28}
.al-freq{display:flex;align-items:center;gap:6px;margin:8px 0;color:#aeb9d0;font-size:10.5px}
.al-seg{height:24px;padding:0 11px;border:1px solid #39435a;border-radius:6px;background:#171d2a;color:#9aa4bb;font-size:10px;cursor:pointer}
.al-seg.active{background:#2a3550;border-color:#4f5f83;color:#fff}
.al-create{width:100%;height:31px;margin:9px 0 4px;border-radius:7px;font-size:11.5px}
.al-list-sec{border-top:1px solid #2f3748;margin-top:6px;padding-top:4px}
.al-list-sec b{display:flex;align-items:center;gap:6px}
.al-count{min-width:16px;height:15px;padding:0 4px;border-radius:8px;background:#2a3550;color:#cfd7e8;font-size:9.5px;font-weight:400;display:inline-grid;place-items:center}
.alert-row{display:flex;align-items:center;gap:7px;padding:5px 6px;border-radius:6px;font-size:10.5px;color:#c3cadd}
.alert-row:hover{background:#ffffff0a}
.alert-dot{width:7px;height:7px;border-radius:50%;flex:0 0 auto}
.alert-dot.price{background:#2962ff;box-shadow:0 0 6px #2962ff}
.alert-dot.ind{background:#9b7cf0;box-shadow:0 0 6px #9b7cf0}
.alert-dot.pine{background:#14b8a6;box-shadow:0 0 6px #14b8a6}
.alert-txt{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.alert-tf{font-style:normal;font-size:9px;color:#7d879e;background:#1c2331;border-radius:4px;padding:1px 4px}
.alert-row button{width:20px;height:20px;flex:0 0 auto;border-radius:6px;border:1px solid #4a556d;background:transparent;color:#ff8f8f;font-size:11px;cursor:pointer}
.alert-row button:hover{background:#ff8f8f1f;border-color:#ff8f8f}
.al-dock .dock-table td{vertical-align:middle}
.al-table .al-tog{width:44px;height:20px;border-radius:11px;border:1px solid #46516a;background:#1b2230;color:#8791a8;font-size:9.5px;cursor:pointer}
.al-table .al-tog.on{background:#1d6b45;border-color:#2ea36a;color:#dffbea}
.al-table .al-kind{display:inline-flex;align-items:center;gap:5px}
.al-table .al-kind i{width:6px;height:6px;border-radius:50%}
.al-table td{font-size:10.5px}
.al-table .al-note{max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#98a2b8}
.al-log-head{margin-top:10px}
.al-log-wrap{max-height:104px}
.al-log-wrap td{font-size:10px;color:#9aa4bb}
.al-log-wrap td.al-log-t{width:66px;color:#6f7a91;font-variant-numeric:tabular-nums}
.al-log-wrap td.al-log-k{width:96px;color:#b9c2d6}
.al-log-wrap td.al-log-m{color:#d3dae8}
.light-theme .al-head{border-bottom-color:#dfe4ef}
.light-theme .al-tab{background:#f3f5fa;border-color:#d7ddea;color:#5a6379}
.light-theme .al-tab.active{background:#2962ff;border-color:#2962ff;color:#fff}
.light-theme .al-tab.active[data-al=ind]{background:#7d5bd6;border-color:#7d5bd6}
.light-theme .al-tab.active[data-al=pine]{background:#0f9488;border-color:#0f9488}
.light-theme .al-cond select,.light-theme .al-cond input{background:#fff;border-color:#c5ccdc;color:#1b2230}
.light-theme .al-seg{background:#f3f5fa;border-color:#d7ddea;color:#5a6379}
.light-theme .al-seg.active{background:#e7ecf7;color:#111}
.light-theme .al-hint{background:#f7f9fd;border-color:#cbd3e2;color:#6b7488}
.light-theme .al-count{background:#e7ecf7;color:#39415a}
.light-theme .alert-row:hover{background:#0000000a}
.light-theme .alert-tf{background:#eef1f7;color:#5a6379}
.light-theme .al-table .al-tog{background:#eef1f7;border-color:#c5ccdc;color:#5a6379}
.light-theme .al-table .al-tog.on{background:#1d8a55;border-color:#1d8a55;color:#fff}
.light-theme .al-log-wrap td{color:#5a6379}
.light-theme .al-log-wrap td.al-log-m{color:#222a3a}
.al-toast-wrap{position:fixed;z-index:120;top:70px;right:16px;display:flex;flex-direction:column;gap:8px;pointer-events:none}
.al-toast{min-width:250px;max-width:330px;padding:10px 12px;border-radius:9px;border:1px solid #46516a;border-left:3px solid #2962ff;background:linear-gradient(150deg,#242c3d,#181e2b);box-shadow:0 12px 30px #000a;color:#e8ecf5;font-size:11.5px;line-height:1.45;opacity:0;transform:translateX(14px);transition:.22s}
.al-toast.ind{border-left-color:#9b7cf0}
.al-toast.pine{border-left-color:#14b8a6}
.al-toast.show{opacity:1;transform:none}
.al-toast b{display:block;margin-bottom:2px;font-size:10px;letter-spacing:.4px;text-transform:uppercase;color:#8fa0c0}
.light-theme .al-toast{background:linear-gradient(150deg,#fff,#f2f5fb);border-color:#c5ccdc;box-shadow:0 12px 26px #26314a2e;color:#222a3a}

/* Centered, TradingView-inspired alert composer. */
body.reference-ui .al-pop{
  position:fixed!important;left:50%;top:50%;right:auto!important;bottom:auto!important;
  transform:translate(-50%,-50%);width:min(540px,calc(100vw - 28px));max-width:none;
  max-height:min(680px,calc(100dvh - 28px));overflow:auto;padding:0;border-radius:11px;
  background:var(--panel);border:1px solid var(--line);color:var(--text);
  box-shadow:0 18px 60px #10152232;z-index:120;
}
body.reference-ui .al-head{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:flex-start;gap:14px;
  min-height:76px;padding:15px 22px;background:var(--panel);border-bottom:1px solid var(--line);}
body.reference-ui .al-head b{color:var(--text);font-size:21px;font-weight:600;letter-spacing:-.35px;}
body.reference-ui .al-head #alert-sym{display:inline-flex;align-items:center;gap:8px;color:var(--text);font-size:15px;font-weight:600;letter-spacing:0;}
body.reference-ui .al-head #alert-sym:before{content:"◆";display:grid;place-items:center;width:21px;height:21px;border-radius:50%;background:#5268a8;color:#fff;font-size:10px;}
body.reference-ui .al-close{display:grid;place-items:center;margin-left:auto;width:34px;height:34px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--text);font:300 28px/1 Arial,sans-serif;cursor:pointer;}
body.reference-ui .al-close:hover{background:var(--panel2);}
body.reference-ui .al-head.al-drag-handle{cursor:grab;touch-action:none;user-select:none;}
body.reference-ui .al-head.al-drag-handle.dragging{cursor:grabbing;}
body.reference-ui .al-tabs{gap:0;padding:18px 22px 0;border-bottom:1px solid var(--line);}
body.reference-ui .al-tab{height:38px;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--muted);font-size:13px;}
body.reference-ui .al-tab:hover{color:var(--text);border-color:transparent;}
body.reference-ui .al-tab.active,body.reference-ui .al-tab.active[data-al=price],body.reference-ui .al-tab.active[data-al=ind],body.reference-ui .al-tab.active[data-al=pine]{background:transparent;border-color:#2962ff;color:#2962ff;}
body.reference-ui .al-pane{padding:16px 22px 10px;}
body.reference-ui .al-condition-grid{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);align-items:end;gap:14px;margin:8px 0 12px;}
body.reference-ui .al-control-field{display:grid;min-width:0;gap:6px;color:var(--muted);font-size:12px;font-weight:500;}
body.reference-ui .al-control-field select,body.reference-ui .al-control-field input{width:100%;min-width:0;height:42px;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--text);font:inherit;font-size:14px;}
body.reference-ui .al-control-field select{cursor:pointer;}
body.reference-ui .al-control-field select:focus,body.reference-ui .al-control-field input:focus{outline:0;border-color:#2962ff;box-shadow:0 0 0 2px #2962ff22;}
body.reference-ui .al-pane .ds-row{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:10px 0;color:var(--muted);font-size:14px;}
body.reference-ui .al-pane .ds-row select,body.reference-ui .al-pane .ds-row input[type=text]{flex:1;width:auto;min-width:0;height:38px;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--text);font-size:14px;}
body.reference-ui .al-cond{gap:10px;margin:8px 0 12px;}
body.reference-ui .al-cond select,body.reference-ui .al-cond input{height:40px;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--text);font-size:14px;}
body.reference-ui .al-cond select:focus,body.reference-ui .al-cond input:focus{border-color:#2962ff;box-shadow:0 0 0 2px #2962ff22;}
body.reference-ui .al-chk{margin:5px 22px 14px;font-size:13px;color:var(--muted);}
body.reference-ui .al-hint{margin:4px 0 10px;padding:10px 12px;border-radius:7px;font-size:12px;}
body.reference-ui .al-freq{gap:10px;margin:10px 22px;color:var(--muted);font-size:14px;}
body.reference-ui .al-seg{height:32px;padding:0 13px;border-radius:7px;font-size:13px;}
body.reference-ui .al-create{display:block;width:auto;min-width:82px;height:40px;margin:12px 22px 18px auto;padding:0 18px;border-radius:8px;background:#303030;border-color:#303030;color:white;font-size:14px;}
body.reference-ui .al-form-footer{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;padding:13px 22px 16px;border-top:1px solid var(--line);background:var(--panel2);}
body.reference-ui .al-form-options{flex:1;min-width:0;}
body.reference-ui .al-options-title{display:block;margin:0 0 4px;color:var(--muted);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;}
body.reference-ui .al-form-options>.ds-row{display:grid;grid-template-columns:72px minmax(0,1fr);align-items:center;gap:8px;margin:6px 0;color:var(--muted);font-size:12px;}
body.reference-ui .al-form-options>.ds-row input{height:32px;min-width:0;padding:0 9px;border:1px solid var(--line);border-radius:7px;background:var(--panel);color:var(--text);font-size:13px;}
body.reference-ui .al-form-options .al-freq{flex-wrap:wrap;margin:7px 0 0;font-size:12px;}
body.reference-ui .al-form-footer .al-create{flex:0 0 auto;margin:0 0 1px;}
body.reference-ui .al-list-sec{margin:0;padding:12px 22px 16px;border-top:1px solid var(--line);}
body.reference-ui .alert-row{padding:8px 6px;font-size:13px;}
body.reference-ui.light-theme .al-pop{background:#fff;border-color:#e0e3eb;box-shadow:0 18px 60px #20283b2e;}
body.reference-ui.light-theme .al-head{background:#fff;}
body.reference-ui.light-theme .al-cond select,body.reference-ui.light-theme .al-cond input,body.reference-ui.light-theme .al-control-field select,body.reference-ui.light-theme .al-control-field input,
body.reference-ui.light-theme .al-pane .ds-row select,body.reference-ui.light-theme .al-pane .ds-row input[type=text]{background:#fff;border-color:#d9dce4;color:#131722;}
@media(max-width:600px){body.reference-ui .al-pop{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);}body.reference-ui .al-head{min-height:62px;padding:12px 15px;}body.reference-ui .al-tabs{padding:12px 15px 0;}body.reference-ui .al-pane{padding:12px 15px 8px;}body.reference-ui .al-form-footer{align-items:stretch;flex-direction:column;padding:12px 15px;}body.reference-ui .al-form-footer .al-create{align-self:flex-end;margin:0;}body.reference-ui .al-list-sec{padding-right:15px;padding-left:15px;}}
@media(max-width:420px){body.reference-ui .al-condition-grid{grid-template-columns:1fr;gap:9px;}body.reference-ui .al-control-field select,body.reference-ui .al-control-field input{height:38px;}}
body.reference-ui .al-field-caption{margin:2px 0 7px;color:var(--muted);font-size:13px;font-weight:600;}
body.reference-ui .al-trigger-hint{margin:9px 0 5px;padding:10px 12px;border:1px solid #2962ff35;border-left:3px solid #2962ff;border-radius:6px;background:#2962ff0b;color:var(--text);font-size:12px;line-height:1.5;}
body.reference-ui:not(.light-theme) .al-trigger-hint{background:#2962ff18;border-color:#2962ff55;border-left-color:#6e96ff;color:#dce5ff;}
body.reference-ui .al-cond input[type=number]{font-variant-numeric:tabular-nums;font-weight:600;}

/* Pine Editor usability layer */
.script-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 12px 10px;color:#8390a7;font:10px/1.4 "Trebuchet MS",Arial,sans-serif;direction:ltr}
.script-meta span{white-space:nowrap}.script-meta label{display:inline-flex;align-items:center;gap:4px;cursor:pointer;color:#aab5c8}.script-meta input{accent-color:#8d6bea}.script-shortcuts{margin-left:auto;color:#68758d;font-size:9px}
.script-toolbar .tool-btn:disabled{opacity:.55;cursor:wait}.script-toolbar .tool-btn#script-format,.script-toolbar .tool-btn#script-copy,.script-toolbar .tool-btn#script-clear{padding-left:7px;padding-right:7px}
.light-theme .script-meta{color:#6e7b91}.light-theme .script-meta label{color:#4c5a70}.light-theme .script-shortcuts{color:#7c8798}
@media(max-width:720px){.script-shortcuts{display:none}.script-meta{gap:7px}.script-toolbar .tool-btn#script-format,.script-toolbar .tool-btn#script-copy,.script-toolbar .tool-btn#script-clear{display:none}}
.pine-indicator-legend{position:absolute;z-index:19;top:120px;left:14px;display:none;flex-direction:column;align-items:flex-start;gap:4px;max-width:min(420px,calc(100% - 110px));pointer-events:none}
.pine-ind-chip{display:inline-flex;align-items:center;gap:6px;max-width:100%;height:24px;padding:0 5px;background:linear-gradient(135deg,#1d2440f2,#232c47f0);border:1px solid #4a5370;border-radius:6px;box-shadow:0 5px 14px #0006;backdrop-filter:blur(4px);color:#e6eaf5;font:10px/1 "Trebuchet MS",Arial,sans-serif;direction:ltr;pointer-events:auto}
.pine-ind-chip.is-hidden{opacity:.55;border-style:dashed}
.pine-ind-dot{width:8px;height:8px;flex:0 0 8px;border-radius:50%;box-shadow:0 0 6px #0006}
.pine-ind-chip>b{max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.pine-ind-actions{display:inline-flex;align-items:center;gap:2px;margin-left:3px}
.pine-ind-actions button{display:grid;place-items:center;width:19px;height:19px;padding:0;border:0;border-radius:4px;background:#2a3350;color:#b7c3da;font:13px/1 "Trebuchet MS",Arial,sans-serif;cursor:pointer}
.pine-ind-actions button:hover{background:#3b3265;color:#fff}
.pine-ind-actions button[data-pine-action=remove]:hover{background:#4a2138;color:#ff8594}
.light-theme .pine-ind-chip{background:linear-gradient(135deg,#fff,#f4f7ff);border-color:#cad2e4;color:#253149;box-shadow:0 5px 14px #66708526}
.light-theme .pine-ind-actions button{background:#eaedf6;color:#40506a}
.light-theme .pine-ind-actions button:hover{background:#ffe3bf;color:#c96f00}
.pine-indicator-legend{max-height:calc(100% - 150px);overflow:auto}
.pine-indicator-legend{z-index:120;pointer-events:auto}
.pine-ind-chip{pointer-events:auto}
/* Pine indicator panes: label/values at each pane's top-left; pane controls at top-right. */
body.reference-ui .pine-indicator-legend{inset:0!important;top:0!important;left:0!important;right:0!important;bottom:0!important;width:100%;max-width:none;max-height:none;overflow:visible;display:block;pointer-events:none}
body.reference-ui .pine-ind-chip.pane-status-line{position:absolute;left:5px;right:5px;display:flex;align-items:center;gap:8px;width:auto;max-width:none;height:26px;padding:1px 4px 0;background:transparent;border:0;border-radius:0;box-shadow:none;backdrop-filter:none;color:#434651;font:12px/1.2 Arial,sans-serif;pointer-events:none}
body.reference-ui .pine-ind-chip.pane-status-line.is-hidden{opacity:.55}
body.reference-ui .pine-ind-chip.pane-status-line .pine-ind-dot{display:none}
body.reference-ui .pine-ind-chip.pane-status-line>b{max-width:260px;color:#434651;font-size:12px;font-weight:400}
body.reference-ui .pine-ind-values{display:inline-flex;align-items:center;gap:7px;min-width:0;overflow:hidden}
body.reference-ui .pine-ind-value{font:12px/1 Arial,sans-serif;font-variant-numeric:tabular-nums}
body.reference-ui .pine-ind-chip.pane-status-line .pine-panel-actions{position:absolute;top:0;right:100px;display:flex;gap:2px;margin:0;pointer-events:auto}
body.reference-ui .pine-ind-chip.pane-status-line .pine-panel-actions button{width:22px;height:22px;border:1px solid #e1e3e8;border-radius:4px;background:#fff;color:#434651}
body.reference-ui .pine-ind-chip.pane-status-line .pine-panel-actions button:hover{background:#f3f4f6;border-color:#c9cdd4;color:#131722}
body.reference-ui .pine-ind-chip.pane-status-line .pine-panel-actions button svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
body.reference-ui .pine-ind-chip.pane-status-line .pine-panel-actions button[data-pine-action=remove]:hover{background:#fff0f0;border-color:#e3b5b5;color:#d33}
body.reference-ui .pine-ind-chip.pane-status-line .pine-indicator-actions{position:relative;display:inline-flex;align-items:center;gap:3px;margin-left:2px;pointer-events:auto}
body.reference-ui .pine-ind-chip.pane-status-line.main-overlay-indicator .pine-indicator-actions{position:absolute;top:0;left:var(--pine-ind-actions-left,267px);margin:0}
body.reference-ui .pine-indicator-actions button{width:20px;height:22px;border:0;background:transparent;color:#434651;font:13px/1 Arial,sans-serif}
body.reference-ui .pine-indicator-actions button:hover{background:#f0f2f5;color:#131722}
body.reference-ui .pine-indicator-actions svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
body.reference-ui .pine-indicator-actions .pine-indicator-more-menu{position:absolute;top:24px;right:0;z-index:125;display:none;min-width:120px;padding:4px;background:#fff;border:1px solid #d5d8de;border-radius:5px;box-shadow:0 4px 14px #0002}
body.reference-ui .pine-ind-chip.pine-more-open .pine-indicator-more-menu{display:grid}
body.reference-ui .pine-ind-chip.pane-status-line .pine-indicator-actions .pine-indicator-more-menu button{display:flex;width:100%;height:28px;justify-content:flex-start;padding:0 8px;text-align:left;font:12px Arial,sans-serif;white-space:nowrap}
body.reference-ui #pine-indicator-legend .pine-ind-chip.pane-status-line .ind-chip-menu.ind-more-menu{position:absolute;top:25px;left:0;right:auto;z-index:140;display:none;width:min(340px,calc(100vw - 20px));max-height:min(360px,calc(100vh - 32px));overflow:auto;padding:3px 0;background:#fff;border:1px solid #d9d9d9;border-radius:6px;box-shadow:0 6px 18px #0002;color:#171717;white-space:normal;direction:ltr;pointer-events:auto}
body.reference-ui #pine-indicator-legend .pine-ind-chip.menu-open .ind-chip-menu.ind-more-menu{display:block}
body.reference-ui #pine-indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-item{position:relative;display:flex;align-items:center;gap:8px;width:100%;height:30px;padding:0 9px;border:0;border-radius:0;background:#fff;color:#171717;text-align:left;font:12px/1.2 Arial,sans-serif;cursor:pointer}
body.reference-ui #pine-indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-item:hover:not(:disabled){background:#f0f1f3;color:#111}
body.reference-ui #pine-indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-icon{display:grid;place-items:center;width:17px;height:18px;flex:0 0 17px;color:#24272b}
body.reference-ui #pine-indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.45;stroke-linecap:round;stroke-linejoin:round}
body.reference-ui #pine-indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.reference-ui #pine-indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-shortcut,body.reference-ui #pine-indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-chevron{margin-left:auto;color:#85888d;font-size:12px}
body.reference-ui #pine-indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-separator{display:block;height:1px;margin:3px 0;background:#e7e7e7}
body.reference-ui #pine-indicator-legend .ind-menu-submenu{display:none;padding:3px 0 3px 20px;background:#fafafa;border-top:1px solid #eee;border-bottom:1px solid #eee}
body.reference-ui #pine-indicator-legend .ind-menu-subgroup.submenu-open>.ind-menu-submenu{display:block}
/* TradingView-style indicator status line: plain label/inputs and compact actions. */
body.reference-ui .indicator-legend .ind-chip{position:absolute;display:inline-flex;align-items:center;gap:8px;left:4px;right:4px;width:auto;max-width:none;height:32px;padding:0 8px 0 10px;background:transparent;border:0;border-radius:0;box-shadow:none;backdrop-filter:none;color:#131722;font:13px/1.2 Arial,sans-serif;white-space:nowrap;overflow:visible;pointer-events:none}
body.reference-ui .indicator-legend .ind-chip:hover{border-color:#aeb4bf;box-shadow:none}
body.reference-ui .indicator-legend .ind-chip.collapsed{opacity:.72;border-style:solid}
body.reference-ui .indicator-legend .ind-chip .ind-chip-dot{display:none}
body.reference-ui .indicator-legend .ind-chip b{max-width:240px;overflow:hidden;text-overflow:ellipsis;color:#434651;font-size:13px;font-weight:400;letter-spacing:0}
body.reference-ui .indicator-legend .ind-chip .ind-chip-val{max-width:270px;overflow:hidden;color:#434651;font-size:13px;font-weight:400;letter-spacing:0}
body.reference-ui .indicator-legend .ind-chip-btns{position:static;display:inline-flex;align-items:center;gap:4px;margin:0;opacity:1;pointer-events:auto}
body.reference-ui .indicator-legend .ind-chip.main-overlay-indicator .ind-chip-btns{position:absolute;top:0;left:var(--ind-actions-left,190px);margin:0}
body.reference-ui .indicator-legend .ind-chip-name,body.reference-ui .indicator-legend .ind-chip-val{pointer-events:auto}
body.reference-ui .indicator-legend .ind-chip-btns button{display:grid;place-items:center;width:20px;height:24px;padding:0;border:0;border-radius:3px;background:transparent;color:#434651;font:14px/1 Arial,sans-serif;cursor:pointer}
body.reference-ui .indicator-legend .ind-chip-btns button:hover{background:#f0f2f5;color:#131722}
body.reference-ui .indicator-legend .ind-chip-btns button .ic{width:16px;height:16px;--ic-sw:1.7}
body.reference-ui .indicator-legend .ind-chip-btns .ind-chip-code{width:24px;font:600 13px/1 ui-monospace,Consolas,monospace;letter-spacing:-2px}
body.reference-ui .indicator-legend .ind-chip-btns .ind-chip-more{width:23px;font-size:16px;letter-spacing:1px}
body.reference-ui .indicator-legend .ind-panel-actions{position:absolute;top:0;right:100px;display:inline-flex;align-items:center;gap:2px;pointer-events:auto}
body.reference-ui .indicator-legend .ind-panel-actions button{display:grid;place-items:center;width:22px;height:22px;padding:0;border:1px solid #e1e3e8;border-radius:4px;background:#fff;color:#434651;cursor:pointer}
body.reference-ui .indicator-legend .ind-panel-actions button:hover{background:#f3f4f6;border-color:#c9cdd4;color:#131722}
body.reference-ui .indicator-legend .ind-panel-actions button svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
body.reference-ui .indicator-legend .ind-panel-actions button[data-ind-panel-action=remove]:hover{background:#fff0f0;border-color:#e3b5b5;color:#d33}
body.reference-ui .indicator-legend .ind-chip-menu{position:absolute;top:27px;right:0;z-index:130;display:none;min-width:112px;padding:4px;background:#fff;border:1px solid #d5d8de;border-radius:5px;box-shadow:0 4px 14px #0002}
body.reference-ui .indicator-legend .ind-chip.menu-open .ind-chip-menu{display:grid}
body.reference-ui .indicator-legend .ind-chip-btns .ind-chip-menu button{display:flex;width:100%;height:30px;padding:0 9px;justify-content:flex-start;font:12px Arial,sans-serif;white-space:nowrap}
body.reference-ui .indicator-legend .ind-chip-menu.ind-more-menu{position:absolute;top:25px;left:0;right:auto;z-index:140;display:none;width:min(340px,calc(100vw - 20px));max-height:min(360px,calc(100vh - 32px));overflow:auto;padding:3px 0;background:#fff;border:1px solid #d9d9d9;border-radius:6px;box-shadow:0 6px 18px #0002;color:#171717;white-space:normal;direction:ltr}
body.reference-ui .indicator-legend .ind-chip.menu-open .ind-chip-menu.ind-more-menu{display:block}
body.reference-ui .indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-item{position:relative;display:flex;align-items:center;gap:8px;width:100%;height:30px;padding:0 9px;border:0;border-radius:0;background:#fff;color:#171717;text-align:left;font:12px/1.2 Arial,sans-serif;cursor:pointer}
body.reference-ui .indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-item:hover:not(:disabled){background:#f0f1f3;color:#111}
body.reference-ui .indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-icon{display:grid;place-items:center;width:17px;height:18px;flex:0 0 17px;color:#24272b}
body.reference-ui .indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.45;stroke-linecap:round;stroke-linejoin:round}
body.reference-ui .indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.reference-ui .indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-shortcut,body.reference-ui .indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-chevron{margin-left:auto;color:#85888d;font-size:12px}
body.reference-ui .indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-ellipsis{color:#85888d}
body.reference-ui .indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-separator{display:block;height:1px;margin:3px 0;background:#e7e7e7}
body.reference-ui .indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-disabled{color:#999;cursor:default}
body.reference-ui .indicator-legend .ind-chip-menu.ind-more-menu .ind-menu-disabled .ind-menu-icon{color:#999}
body.reference-ui .indicator-legend .ind-menu-submenu{display:none;padding:3px 0 3px 20px;background:#fafafa;border-top:1px solid #eee;border-bottom:1px solid #eee}
body.reference-ui .indicator-legend .ind-menu-subgroup.submenu-open>.ind-menu-submenu{display:block}
body.reference-ui .indicator-legend .ind-menu-submenu .ind-menu-item{height:27px;font-size:11px}
.light-theme .indicator-legend .ind-chip{background:#fff;border-color:#c9cdd4;color:#131722;box-shadow:none}
.pine-ind-actions button[data-pine-action=remove]{width:22px;height:22px;background:#4a2138;color:#ff8594;font-size:16px;font-weight:700;opacity:1;visibility:visible}
.pine-ind-actions button[data-pine-action=remove]:hover{background:#6a2944;color:#fff}
.pine-chart-settings-row input[type=number]{width:64px;height:24px;padding:0 5px;border:1px solid #47536b;border-radius:5px;background:#111620;color:#e9edf5;font:11px Consolas,monospace}
.light-theme .pine-chart-settings-row input[type=number]{border-color:#c9d1e0;background:#f8faff;color:#1e2b42}

.build-stamp{margin-left:8px;padding:1px 6px;border-radius:9px;border:1px solid #3a4152;background:#1b212d;color:#7d8798;font:9px Consolas,monospace;cursor:default;user-select:none;vertical-align:middle}
.light-theme .build-stamp{background:#eef2fa;border-color:#ccd4e2;color:#6a768c}
/* the user's own 3D artwork: sized by height so a wide icon like the
   horizontal line keeps its proportions instead of being squashed */
.t3d{height:22px;width:auto;max-width:26px;object-fit:contain;flex:0 0 auto;vertical-align:middle;-webkit-user-drag:none}
.tool-choice:has(> .t3d){padding:0 2px}
.tool-choice:has(> .t3d):hover{background:#eef2fa}
.light-theme .tool-choice:has(> .t3d):hover{background:#e3e9f4}

/* ---------- indicator dialog (searchable, TradingView style) ---------- */
.ind-modal{position:fixed;inset:0;z-index:9400;display:none;align-items:flex-start;justify-content:center;padding:8vh 16px 16px;background:#0a0d1499;backdrop-filter:blur(2px)}
.ind-modal.open{display:flex}
body.ind-modal-on{overflow:hidden}
.ind-modal-box{width:min(560px,100%);max-height:84vh;display:flex;flex-direction:column;background:#1b2130;border:1px solid #333c52;border-radius:12px;box-shadow:0 24px 60px #000a;overflow:hidden}
.ind-modal-head{display:flex;align-items:center;gap:10px;padding:12px 14px 8px}
.ind-modal-head h3{margin:0;font-size:14px;font-weight:600;color:#e8ecf6;letter-spacing:.2px}
.ind-modal-x{margin-left:auto;width:26px;height:26px;border:0;border-radius:6px;background:transparent;color:#8b95ab;font-size:17px;line-height:1;cursor:pointer}
.ind-modal-x:hover{background:#2a3244;color:#fff}
.ind-modal-search{padding:0 14px 10px}
.ind-modal-search input{width:100%;height:34px;border:1px solid #333c52;border-radius:8px;background:#141926;color:#e8ecf6;padding:0 11px;font-size:12px;outline:none}
.ind-modal-search input:focus{border-color:#6f7bd0;box-shadow:0 0 0 3px #6f7bd026}
.ind-modal-tabs{display:flex;gap:4px;padding:0 14px 8px;border-bottom:1px solid #262e40}
.ind-tab{height:26px;border:0;border-radius:6px;background:transparent;color:#8b95ab;font-size:11px;font-weight:600;padding:0 11px;cursor:pointer}
.ind-tab:hover{background:#242c3e;color:#dfe4f0}
.ind-tab.active{background:#2f3a5c;color:#fff}
.ind-modal-list{flex:1 1 auto;overflow:auto;padding:6px 8px 8px;min-height:120px}
.ind-modal-group{padding:9px 8px 4px;font-size:10px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:#7d88a3}
.ind-row{display:flex;align-items:center;gap:9px;width:100%;height:32px;border:0;border-radius:7px;background:transparent;color:#c3cbdb;text-align:left;padding:0 9px;font-size:12px;cursor:pointer}
.ind-row:hover{background:#242c3e;color:#fff}
.ind-row.cursor{background:#2b3550;color:#fff;box-shadow:inset 0 0 0 1px #4d5a86}
.ind-row-tick{width:14px;flex:0 0 14px;text-align:center;color:#31d39a;font-weight:700;font-size:11px}
.ind-row-star{display:flex;align-items:center;justify-content:center;flex:0 0 22px;width:22px;height:24px;padding:0;border:0;border-radius:5px;background:transparent;color:#8790a4;font:20px/1 Arial,sans-serif;cursor:pointer}
.ind-row-star:hover{background:#3a4360;color:#fff}
.ind-row-star.favorite{color:#f0b90b}
.ind-row-star:focus-visible{outline:2px solid #2962ff;outline-offset:1px}
.ind-row-label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ind-row.active .ind-row-label{color:#8fe6c4}
.ind-community-category{flex:0 0 auto;color:#7d88a3;font-size:10px;text-transform:capitalize}
.ind-row-gear{flex:0 0 auto;width:22px;height:22px;border-radius:5px;color:#7d88a3;display:flex;align-items:center;justify-content:center;cursor:pointer}
.ind-row-gear .ind-gear-ic{width:13px;height:13px;--ic-sw:2}
.ind-row-gear:hover{background:#3a4360;color:#fff}
.ind-modal-empty{padding:22px 10px;text-align:center;color:#7d88a3;font-size:12px}
.ind-modal-foot{display:flex;align-items:center;gap:10px;padding:8px 14px;border-top:1px solid #262e40;color:#6f7a92;font-size:10px}
.ind-modal-hint{margin-left:auto}
.light-theme .ind-modal{background:#0a0d1440}
.light-theme .ind-modal-box{background:#fff;border-color:#d7dcea;box-shadow:0 24px 60px #66708540}
.light-theme .ind-modal-head h3{color:#1d2537}
.light-theme .ind-modal-x{color:#6b7488}
.light-theme .ind-modal-x:hover{background:#eef1f8;color:#1d2537}
.light-theme .ind-modal-search input{background:#f6f8fd;border-color:#d7dcea;color:#1d2537}
.light-theme .ind-modal-search input:focus{border-color:#ff9100;box-shadow:0 0 0 3px #ff910026}
.light-theme .ind-modal-tabs{border-bottom-color:#e7eaf3}
.light-theme .ind-tab{color:#5b6478}
.light-theme .ind-tab:hover{background:#f1f4fa;color:#1d2537}
.light-theme .ind-tab.active{background:#ffe3bf;color:#a35b00}
.light-theme .ind-modal-group{color:#8790a4}
.light-theme .ind-row{color:#2a3247}
.light-theme .ind-row:hover{background:#f1f4fa;color:#0f1626}
.light-theme .ind-row.cursor{background:#ffe9cd;color:#8a4d00;box-shadow:inset 0 0 0 1px #ffb35c66}
.light-theme .ind-row.active .ind-row-label{color:#0d7a4f}
.light-theme .ind-row-star{color:#787b86}
.light-theme .ind-row-star:hover{background:#e6ebf5;color:#131722}
.light-theme .ind-row-star.favorite{color:#d99b00}
.light-theme .ind-community-category{color:#8790a4}
.light-theme .ind-row-gear{color:#8790a4}
.light-theme .ind-row-gear .ind-gear-ic{--ic-sw:2}
.light-theme .ind-row-gear:hover{background:#e6ebf5;color:#1d2537}
.light-theme .ind-modal-empty{color:#8790a4}
.light-theme .ind-modal-foot{border-top-color:#e7eaf3;color:#8790a4}


/* ---------------------------------------------------------------- themes --
   Two looks, chosen in the toolbar. "Fantasy" is the original: warm gradients
   and an orange accent. "TradingView" is the standard terminal palette - flat
   #131722 surfaces, a #2962ff accent and the familiar #26a69a / #ef5350 candle
   colours. The sun/moon button still picks light or dark inside whichever look
   is active, so all four combinations work. */
.tv-standard{
  --bg:#131722;
  --panel:#1e222d;
  --panel2:#171b26;
  --line:#2a2e39;
  --soft-line:#242832;
  --text:#d1d4dc;
  --muted:#787b86;
  --accent:#2962ff;
  --accent2:#1e53e5;
  --green:#26a69a;
  --red:#ef5350;
}
.tv-standard.light-theme{
  --bg:#ffffff;
  --panel:#ffffff;
  --panel2:#f0f3fa;
  --line:#e0e3eb;
  --soft-line:#f0f3fa;
  --text:#131722;
  --muted:#787b86;
  --accent:#2962ff;
  --accent2:#1e53e5;
  --green:#26a69a;
  --red:#ef5350;
}
.tv-standard body,.tv-standard .tv-shell{background:#131722;color:var(--text)}
.tv-standard.light-theme body,.tv-standard.light-theme .tv-shell{background:#fff;color:var(--text)}
.tv-standard .accent-text,.tv-standard .tv-logo strong{color:var(--accent)}
.theme-picker{display:inline-flex;align-items:center}
.top-select{
  background:var(--panel2);color:var(--text);border:1px solid var(--line);
  border-radius:8px;padding:5px 8px;font:inherit;font-size:12px;cursor:pointer;
  max-width:132px
}
.top-select:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Compact TradingView-style trend drawing menu. */
.tool-panel[data-panel="trend"]{display:none;grid-template-columns:1fr;gap:0;max-height:min(78vh,720px);overflow-y:auto;overscroll-behavior:contain}
.tool-panel[data-panel="trend"].active{display:grid}
.trend-tool-section{display:grid;grid-template-columns:1fr;gap:1px;padding:0 0 7px;margin:0 0 5px;border-bottom:1px solid var(--line)}
.trend-tool-section:last-child{padding-bottom:0;margin-bottom:0;border-bottom:0}
.trend-tool-section>b{padding:8px 10px 5px;color:var(--muted,#858b99);font-size:10px;font-weight:500;letter-spacing:.04em}
.tool-panel .trend-tool-section button.tool-choice{height:34px;min-height:34px;display:flex;align-items:center;gap:10px;padding:0 10px;color:var(--text,#d1d4dc);font-size:12px;white-space:nowrap}
.tool-panel .trend-tool-section button.tool-choice img,.tool-panel .trend-tool-section button.tool-choice svg{flex:0 0 22px;width:22px;height:22px;object-fit:contain}
.tool-shortcut{margin-left:auto;color:var(--muted,#858b99);font-size:11px;font-variant-numeric:tabular-nums}
.tool-panel .trend-tool-section button.tool-choice:disabled{opacity:.48;cursor:not-allowed;transform:none}
.light-theme .tool-shortcut{color:#777d89}
.tool-panel[data-panel="fib"]{grid-template-columns:1fr;gap:0;max-height:min(78vh,720px);overflow-y:auto;overscroll-behavior:contain}
.tool-panel[data-panel="fib"].active{display:grid}
.fib-tool-section{display:grid;grid-template-columns:1fr;gap:1px;padding:0 0 7px;margin:0 0 5px;border-bottom:1px solid var(--line)}
.fib-tool-section:last-child{padding-bottom:0;margin-bottom:0;border-bottom:0}
.fib-tool-section>b{padding:8px 10px 5px;color:var(--muted,#858b99);font-size:10px;font-weight:500;letter-spacing:.04em}
.tool-panel .fib-tool-section button.tool-choice{height:34px;min-height:34px;display:flex;align-items:center;gap:10px;padding:0 10px;color:var(--text,#d1d4dc);font-size:12px;white-space:nowrap}
.tool-panel .fib-tool-section button.tool-choice img.fib-vector-icon,.tool-panel .fib-tool-section button.tool-choice svg.fib-vector-icon{flex:0 0 20px;width:20px;height:20px;object-fit:contain}
.tool-panel .fib-tool-section button.tool-choice:disabled{opacity:.48;cursor:not-allowed;transform:none}
.light-theme .fib-tool-section>b{color:#777d89}
.tool-popover:has(.tool-panel[data-panel="fib"].active){width:min(310px,calc(100vw - 80px))}
.tool-panel[data-panel="patterns"]{grid-template-columns:1fr;gap:0;max-height:min(78vh,720px);overflow-y:auto;overscroll-behavior:contain}
.tool-panel[data-panel="patterns"].active{display:grid}
.pattern-tool-section{display:grid;grid-template-columns:1fr;gap:1px;padding:0 0 7px;margin:0 0 5px;border-bottom:1px solid var(--line)}
.pattern-tool-section:last-child{padding-bottom:0;margin-bottom:0;border-bottom:0}
.pattern-tool-section>b{padding:8px 10px 5px;color:var(--muted,#858b99);font-size:10px;font-weight:500;letter-spacing:.04em}
.tool-panel .pattern-tool-section button.tool-choice{height:auto;min-height:38px;display:flex;align-items:center;gap:10px;padding:4px 10px;color:var(--text,#d1d4dc);font-size:12px;white-space:normal;text-align:left}
.tool-panel .pattern-tool-section button.tool-choice svg.pattern-vector-icon{flex:0 0 24px;width:24px;height:24px;color:currentColor}
/* The pattern artwork is the reference's own, lifted from its capture as black
   line art on transparency, so it is sized like the fib set and inverted for TV
   mode's dark flyout. */
.tool-panel .pattern-tool-section button.tool-choice img.pattern-vector-icon{flex:0 0 20px;width:20px;height:20px;object-fit:contain}
.tv-standard:not(.light-theme) .tool-panel .pattern-tool-section button.tool-choice img.pattern-vector-icon{filter:invert(1)}
.tool-popover:has(.tool-panel[data-panel="patterns"].active){width:min(390px,calc(100vw - 80px))}
.light-theme .pattern-tool-section>b{color:#777d89}
.tool-panel[data-panel="predict"],.tool-panel[data-panel="measure"]{grid-template-columns:1fr;gap:0;max-height:min(78vh,720px);overflow-y:auto;overscroll-behavior:contain}
.tool-panel[data-panel="predict"].active,.tool-panel[data-panel="measure"].active{display:grid}
.forecast-tool-section{display:grid;grid-template-columns:1fr;gap:1px;padding:0 0 7px;margin:0 0 5px;border-bottom:1px solid var(--line)}
.forecast-tool-section:last-child{padding-bottom:0;margin-bottom:0;border-bottom:0}
.forecast-tool-section>b{padding:8px 10px 5px;color:var(--muted,#858b99);font-size:10px;font-weight:500;letter-spacing:.04em}
.tool-panel .forecast-tool-section button.tool-choice{height:auto;min-height:38px;display:flex;align-items:center;gap:10px;padding:4px 10px;color:var(--text,#d1d4dc);font-size:12px;white-space:normal;text-align:left}
.tool-panel .forecast-tool-section button.tool-choice svg.forecast-vector-icon{flex:0 0 24px;width:24px;height:24px;color:currentColor}
/* The forecasting and measuring artwork is the reference's own, lifted from its
   capture as black line art on transparency, so it is sized like the other
   reference sets and inverted for TV mode's dark flyout. */
.tool-panel .forecast-tool-section button.tool-choice img.forecast-vector-icon{flex:0 0 20px;width:20px;height:20px;object-fit:contain}
.tv-standard:not(.light-theme) .tool-panel .forecast-tool-section button.tool-choice img.forecast-vector-icon{filter:invert(1)}
.tool-panel .forecast-tool-section button.tool-choice:disabled{opacity:.48;cursor:not-allowed;transform:none}
.tool-popover:has(.tool-panel[data-panel="predict"].active),.tool-popover:has(.tool-panel[data-panel="measure"].active){width:min(360px,calc(100vw - 80px))}
.light-theme .forecast-tool-section>b{color:#777d89}
.tool-panel[data-panel="shapes"]{grid-template-columns:1fr;gap:0;max-height:min(78vh,720px);overflow-y:auto;overscroll-behavior:contain}
.tool-panel[data-panel="shapes"].active{display:grid}
.geometric-tool-section{display:grid;grid-template-columns:1fr;gap:1px;padding:0 0 7px;margin:0 0 5px;border-bottom:1px solid var(--line)}
.geometric-tool-section:last-child{padding-bottom:0;margin-bottom:0;border-bottom:0}
.geometric-tool-section>b{padding:8px 10px 5px;color:var(--muted,#858b99);font-size:10px;font-weight:500;letter-spacing:.04em}
.tool-panel .geometric-tool-section button.tool-choice{height:auto;min-height:38px;display:flex;align-items:center;gap:10px;padding:4px 10px;color:var(--text,#d1d4dc);font-size:12px;white-space:normal;text-align:left}
.tool-panel .geometric-tool-section button.tool-choice svg.shape-vector-icon{flex:0 0 24px;width:24px;height:24px;color:currentColor}
/* The shape artwork is the reference's own, lifted from its capture as black
   line art on transparency, so it is sized like the other reference sets and
   inverted for TV mode's dark flyout. */
.tool-panel .geometric-tool-section button.tool-choice img.shape-vector-icon{flex:0 0 20px;width:20px;height:20px;object-fit:contain}
.tv-standard:not(.light-theme) .tool-panel .geometric-tool-section button.tool-choice img.shape-vector-icon{filter:invert(1)}
.tool-popover:has(.tool-panel[data-panel="shapes"].active){width:min(310px,calc(100vw - 80px))}

.remove-tool-section{display:grid;grid-template-columns:1fr;gap:2px;padding:4px 5px 10px;margin:0 0 5px;border-bottom:1px solid var(--line)}
.tool-panel .remove-tool-section button.remove-action{height:42px;min-height:42px;display:flex;align-items:center;padding:0 10px;border-radius:7px;color:var(--text,#d1d4dc);font-size:13px;text-align:left;white-space:nowrap}
.tool-panel .remove-tool-section button.remove-action:hover{background:var(--hover,rgba(120,123,134,.12))}
.remove-locked-row{min-height:43px;display:flex;align-items:center;gap:12px;padding:7px 10px 0;border-top:1px solid var(--line);color:var(--text,#d1d4dc);font-size:12px;cursor:pointer}
.remove-locked-row>span:first-child{flex:1}
.remove-locked-row input{position:absolute;width:1px;height:1px;opacity:0}
.remove-locked-switch{position:relative;flex:0 0 40px;width:40px;height:22px;border-radius:99px;background:#434651;transition:background .16s}
.remove-locked-switch:after{content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;transition:transform .16s}
.remove-locked-row input:checked+.remove-locked-switch{background:#2962ff}
.remove-locked-row input:checked+.remove-locked-switch:after{transform:translateX(18px)}
.remove-locked-row input:focus-visible+.remove-locked-switch{outline:2px solid #2962ff;outline-offset:2px}

/* Kelko chart assistant */
.trade-ai-launch{position:static;display:none;align-items:center;gap:7px;padding:8px 12px;border:1px solid var(--line);border-radius:9px;background:var(--panel,#fff);color:var(--text,#1e222d);font-size:12px;font-weight:600;box-shadow:0 2px 10px #0002;cursor:pointer}
.trade-ai-launch span{font-size:19px;line-height:14px;color:#7c5cff}
.trade-ai-backdrop{position:fixed;z-index:6590;inset:0;background:#11131a30}
.trade-ai-panel{--trade-ai-width:min(430px,42vw);position:fixed;z-index:6600;top:0;right:0;bottom:0;width:var(--trade-ai-width);min-width:330px;display:flex;flex-direction:column;direction:ltr;background:var(--bg,#fff);color:var(--text,#1e222d);border-left:1px solid var(--line);box-shadow:-8px 0 28px #0002;font-family:inherit}
.trade-ai-panel[hidden],.trade-ai-backdrop[hidden],.trade-ai-error[hidden]{display:none!important}
.trade-ai-open .tv-shell{width:calc(100vw - min(430px,42vw));transition:width .18s ease}
.trade-ai-open .trade-ai-launch{display:none}
.trade-ai-head{min-height:78px;flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 14px;border-bottom:1px solid var(--line)}
.trade-ai-head{min-height:82px;gap:14px;padding:10px 16px;}
.trade-ai-head-main{min-width:0;flex:1 1 auto;display:grid;grid-template-columns:minmax(90px,auto) minmax(0,1fr);align-items:center;gap:14px}
.trade-ai-market-status{min-width:0;display:flex;align-items:center;gap:8px;padding:7px 9px;border:1px solid var(--line);border-radius:9px;background:var(--hover,#f4f5f8)}
.trade-ai-market-status{max-width:100%;overflow:hidden}
.trade-ai-status-dot{width:8px;height:8px;flex:0 0 8px;border-radius:50%;background:#089981;box-shadow:0 0 0 3px #08998120}
.trade-ai-market-copy{min-width:0;display:flex;flex-direction:column;gap:2px;line-height:1.15}
.trade-ai-market-label{color:#089981;font-size:8px;font-weight:800;letter-spacing:.09em}
.trade-ai-market-copy strong{overflow:hidden;color:var(--text,#1e222d);font-size:11px;font-weight:700;text-overflow:ellipsis;white-space:nowrap}
.trade-ai-market-copy small{overflow:hidden;color:var(--muted,#787b86);font-size:9px;text-overflow:ellipsis;white-space:nowrap}
.trade-ai-kicker{display:block;color:var(--muted,#787b86);font-size:9px;font-weight:700;letter-spacing:.12em}
.trade-ai-head h2{margin:3px 0 0;font-size:17px;line-height:1.15}
.trade-ai-head-actions{flex:0 0 auto;display:flex;align-items:center;gap:8px}
.trade-ai-head-actions button{border:0;background:transparent;color:var(--text,#1e222d);font:inherit;cursor:pointer}
.trade-ai-head-actions #trade-assistant-new{min-height:34px;padding:0 10px;border:1px solid var(--line);border-radius:8px;color:#2962ff;font-size:12px;white-space:nowrap}
.trade-ai-head-actions .trade-ai-icon{width:32px;height:32px;border-radius:7px;font-size:24px;line-height:1}
.trade-ai-head-actions .trade-ai-icon:hover{background:var(--hover,#f0f3fa)}
.trade-ai-scroll{flex:1;min-height:0;overflow:auto;padding:22px 20px;overscroll-behavior:contain}
.trade-ai-welcome{max-width:520px;margin:10px auto 24px}
.trade-ai-spark{display:grid;place-items:center;width:36px;height:36px;border:1px solid #24b8a61f;border-radius:11px;background:#24b8a60d;color:#078c80;font-size:12px;font-weight:800;letter-spacing:.08em}
.trade-ai-welcome h3{margin:12px 0 8px;font-size:21px;line-height:1.3;color:var(--text,#1e222d)}
.trade-ai-welcome p{margin:0 0 20px;color:var(--muted,#6a6d78);font-size:13px;line-height:1.65}
.trade-ai-suggestions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;gap:9px}
.trade-ai-suggestions button{min-width:0;min-height:42px;padding:9px 12px;border:1px solid var(--line);border-radius:9px;background:var(--panel,#fff);color:var(--text,#1e222d);font-size:12px;line-height:1.4;text-align:left;cursor:pointer}
.trade-ai-suggestions button:hover{border-color:#24b8a6;background:color-mix(in srgb,#24b8a6 8%,var(--panel,#fff))}
.trade-ai-suggestions button:nth-child(n+8){display:none}
.trade-ai-messages{display:flex;flex-direction:column;gap:14px;padding-bottom:8px}
.trade-ai-message{max-width:94%;padding:10px 12px;border:1px solid var(--line);border-radius:12px;font-size:12px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
.trade-ai-message.user{align-self:flex-end;background:#eeeaff;border-color:#d9d0ff}
.trade-ai-message.assistant{align-self:flex-start;background:var(--bg,#fff)}
.trade-ai-action-preview{display:block;margin-top:8px;color:var(--muted,#787b86);font-size:11px}
.trade-ai-action-confirm{display:block;margin-top:10px;padding:8px 11px;border:1px solid #d38b32;border-radius:8px;background:#fff7e8;color:#704500;font:inherit;font-size:12px;font-weight:600;cursor:pointer}
.trade-ai-action-confirm:disabled{cursor:default;opacity:.82}
.trade-ai-pine-draft{max-height:300px;overflow:auto;margin:10px 0 0;padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--hover,#f4f5f8);font:11px/1.5 ui-monospace,Consolas,monospace;white-space:pre}
.trade-ai-quiz{margin-top:10px;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--hover,#f4f5f8)}
.trade-ai-quiz>strong{display:block;margin-bottom:9px}
.trade-ai-quiz-choices{display:grid;gap:6px}
.trade-ai-quiz-choices button{padding:8px 10px;border:1px solid var(--line);border-radius:7px;background:var(--panel,#fff);color:var(--text,#1e222d);font:inherit;text-align:left;cursor:pointer}
.trade-ai-quiz-choices button:disabled{cursor:default;opacity:.75}
.trade-ai-quiz-choices button.correct{border-color:#089981;background:#08998118}
.trade-ai-quiz-choices button.incorrect{border-color:#f23645;background:#f2364518}
.trade-ai-quiz-result{margin:9px 0 0;color:var(--text,#1e222d);font-size:11px}
.trade-ai-practice-card{margin-top:10px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--hover,#f4f5f8)}
.trade-ai-practice-card>strong{display:block;margin-bottom:7px;font-size:13px}
.trade-ai-practice-card>p{margin:6px 0 10px;color:var(--muted,#6a6d78);font-size:11px;line-height:1.55}
.trade-ai-practice-choices{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.trade-ai-practice-choice,.trade-ai-practice-exit{padding:9px 10px;border:1px solid var(--line);border-radius:8px;background:var(--panel,#fff);color:var(--text,#1e222d);font:inherit;font-size:12px;font-weight:700;cursor:pointer}
.trade-ai-practice-choice.up{border-color:#089981;color:#087c69}
.trade-ai-practice-choice.down{border-color:#f23645;color:#cf2d3a}
.trade-ai-practice-choice:disabled,.trade-ai-practice-exit:disabled{opacity:.6;cursor:default}
.trade-ai-practice-progress{height:6px;margin-top:12px;overflow:hidden;border-radius:5px;background:var(--line,#e0e3eb)}
.trade-ai-practice-progress i{display:block;width:0;height:100%;border-radius:inherit;background:#2962ff;transition:width .16s linear}
.trade-ai-practice-card>small{display:block;margin-top:9px;color:var(--muted,#6a6d78);font-size:10px;line-height:1.55}
.trade-ai-practice-card>small.correct,.trade-ai-practice-card .correct{color:#087c69}
.trade-ai-practice-card>small.incorrect,.trade-ai-practice-card .incorrect{color:#cf2d3a}
.trade-ai-practice-exit{width:100%;margin-top:10px;font-size:10px;font-weight:500}
.trade-ai-practice-history{display:grid;gap:5px;margin-top:8px}
.trade-ai-practice-history-row{padding:6px 7px;border-radius:6px;background:var(--panel,#fff);font-size:10px;line-height:1.4}
.trade-ai-practice-score{font-size:10px!important}
.kelko-watchlists{padding:10px 12px;border-bottom:1px solid var(--line,#2a2e39);font-size:10px}
.kelko-watchlists-head,.kelko-watchlists-actions,.kelko-watchlists-row{display:flex;align-items:center;justify-content:space-between;gap:6px}
.kelko-watchlists-head{margin-bottom:7px;color:var(--muted,#858b99);letter-spacing:.06em}
.kelko-watchlists button,.kelko-watchlists select{min-width:0;padding:5px 7px;border:1px solid var(--line,#2a2e39);border-radius:6px;background:var(--panel,#fff);color:var(--text,#1e222d);font:inherit;cursor:pointer}
.kelko-watchlists select{width:100%;margin-bottom:6px}
.kelko-watchlists-actions{margin-bottom:5px}
.kelko-watchlists-actions button:first-child{flex:1;color:#2962ff}
.kelko-watchlists-row{padding:4px 0}
.kelko-watchlists-row button:first-child{flex:1;text-align:left;font-weight:700}
.kelko-watchlists>small{display:block;color:var(--muted,#858b99);line-height:1.5}
.trade-ai-message.pending{color:var(--muted,#787b86);font-style:italic}
.trade-ai-error{flex:0 0 auto;margin:0 16px 8px;padding:9px 11px;border:1px solid #e8a0a0;border-radius:8px;color:#a52727;background:#fff3f3;font-size:11px;line-height:1.45}
.trade-ai-compose{position:relative;flex:0 0 auto;display:grid;grid-template-columns:1fr 38px;gap:5px;margin:0 15px 10px;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--panel,#fff)}
.trade-ai-compose:focus-within{border-color:#9b8af3;box-shadow:0 0 0 2px #9b8af322}
.trade-ai-compose textarea{grid-column:1;grid-row:1;min-height:50px;max-height:130px;resize:vertical;border:0;outline:0;background:transparent;color:var(--text,#1e222d);font-family:inherit;font-size:12px;line-height:1.5}
.trade-ai-compose textarea::placeholder{color:var(--muted,#858b99)}
.trade-ai-compose>button{grid-column:2;grid-row:1;align-self:end;width:34px;height:34px;border:0;border-radius:8px;background:#262831;color:white;cursor:pointer}
.trade-ai-compose>button:disabled{opacity:.5;cursor:wait}
.trade-ai-compose>button svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.trade-ai-compose small{grid-column:1/-1;color:var(--muted,#858b99);font-size:10px;padding:1px 2px 0}
.dark-theme .trade-ai-panel,.tv-standard .trade-ai-panel{--panel:#1e222d;--text:#d1d4dc;--muted:#787b86;--line:#2a2e39;--hover:#1e222d}
.trade-ai-panel .trade-ai-head,.trade-ai-panel .trade-ai-scroll{background:var(--bg,#fff)}
.trade-ai-panel .trade-ai-market-status{color:var(--text,#1e222d)}
.trade-ai-panel .trade-ai-suggestions button{color:var(--text,#1e222d);background:var(--panel,#fff)}
.dark-theme .trade-ai-panel .trade-ai-suggestions button,.tv-standard .trade-ai-panel .trade-ai-suggestions button{background:#1e222d;color:#d1d4dc;border-color:#3a4151}
.dark-theme .trade-ai-panel .trade-ai-suggestions button:hover,.tv-standard .trade-ai-panel .trade-ai-suggestions button:hover{background:#262d3b;border-color:#24b8a6}
.trade-ai-head-actions .trade-ai-icon{font-size:0!important;position:relative}
.trade-ai-head-actions .trade-ai-icon::before,.trade-ai-head-actions .trade-ai-icon::after{content:"";position:absolute;left:50%;top:50%;width:17px;height:1.7px;border-radius:2px;background:var(--text,#1e222d)}
.trade-ai-head-actions .trade-ai-icon::before{transform:translate(-50%,-50%) rotate(45deg)}
.trade-ai-head-actions .trade-ai-icon::after{transform:translate(-50%,-50%) rotate(-45deg)}
.trade-ai-panel{--bg:#fff;--panel:#fff;--panel2:#f7f7f7;--text:#171717;--muted:#747474;--line:#dedede;--hover:#f1f1f1;background:#fff;color:#171717}
.trade-ai-head{background:#fff;border-bottom-color:#ededed}
.trade-ai-head h2,.trade-ai-welcome h3{color:#171717}
.trade-ai-kicker,.trade-ai-market-label{color:#737373}
.trade-ai-market-status{background:#fff;border-color:#e6e6e6;border-radius:8px}
.trade-ai-market-copy strong{color:#252525}
.trade-ai-market-copy small,.trade-ai-welcome p{color:#707070}
.trade-ai-spark{display:none}
.trade-ai-suggestions button{background:#f1f1f1!important;border:0!important;border-radius:9px;color:#202020!important;font-size:13px;font-weight:500}
.trade-ai-suggestions button:hover{background:#e9e9e9!important;border-color:transparent!important}
.trade-ai-message.assistant{background:#f5f5f5;border-color:#ededed;color:#202020}
.trade-ai-message.user{background:#f1f1f1;border-color:#e6e6e6;color:#202020}
.trade-ai-compose{background:#fff;border:1px solid #d9d9d9;border-radius:10px;box-shadow:none}
.trade-ai-compose:focus-within{border-color:#aeb8c7;box-shadow:0 0 0 2px #2962ff12}
.trade-ai-compose textarea{color:#202020}
.trade-ai-compose textarea::placeholder{color:#777}
.trade-ai-compose small{color:#777}
.trade-ai-compose>button{background:#ededed;color:#454545}
.trade-ai-head-actions #trade-assistant-new{color:#2962ff;border:0;border-radius:6px}
.trade-ai-head-actions .trade-ai-icon::before,.trade-ai-head-actions .trade-ai-icon::after{background:#202020}
.tv-standard .trade-ai-panel,.dark-theme .trade-ai-panel{--bg:#fff;--panel:#fff;--panel2:#f7f7f7;--text:#171717;--muted:#747474;--line:#dedede;--hover:#f1f1f1;background:#fff;color:#171717}
.tv-standard .trade-ai-panel .trade-ai-suggestions button,.dark-theme .trade-ai-panel .trade-ai-suggestions button{background:#f1f1f1!important;border:0!important;color:#202020!important}
.tv-standard .trade-ai-panel .trade-ai-compose,.dark-theme .trade-ai-panel .trade-ai-compose{background:#fff;border-color:#d9d9d9}
.tv-standard .trade-ai-panel .trade-ai-compose textarea,.dark-theme .trade-ai-panel .trade-ai-compose textarea{color:#202020}
.tv-standard .trade-ai-panel .trade-ai-message.user,.dark-theme .trade-ai-panel .trade-ai-message.user{background:#f1f1f1;border-color:#e6e6e6;color:#202020}
.trade-ai-panel .trade-ai-head-actions #trade-assistant-new{background:transparent}
.light-theme .trade-ai-panel{--text:#131722;--muted:#5d606b;--line:#e0e3eb;--hover:#f0f0f0}
@media(max-width:900px){.trade-ai-head{align-items:flex-start;flex-wrap:wrap}.trade-ai-head-main{grid-template-columns:minmax(75px,auto) minmax(0,1fr);gap:8px}.trade-ai-head-actions{margin-left:auto}.trade-ai-market-copy small{display:none}}
@media(max-width:520px){.trade-ai-head-main{grid-template-columns:1fr}.trade-ai-market-status{max-width:none}.trade-ai-suggestions{grid-template-columns:1fr}.trade-ai-scroll{padding:16px 14px}}
.dark-theme .trade-ai-launch,.tv-standard .trade-ai-launch{--panel:#1e222d;--text:#d1d4dc}
.dark-theme .trade-ai-message.user,.tv-standard .trade-ai-message.user{background:#28233c;border-color:#423b5f}
.dark-theme .trade-ai-error,.tv-standard .trade-ai-error{background:#321d22;color:#ffb4b4;border-color:#704044}
@media(max-width:760px){.trade-ai-panel{--trade-ai-width:100vw;min-width:0;width:100vw}.trade-ai-open .tv-shell{width:100vw}}

.tv-logo span .kelko-header-mark{display:block;width:100%;height:100%;object-fit:contain}

/* Keep the original colorful tool artwork for Fantasy; use the clean line set only in TV mode. */
.tool-panel .tool-choice > .tv-line-tool-icon{display:none}
.tv-standard .tool-panel .tool-choice > .fantasy-tool-icon{display:none!important}
.tv-standard .tool-panel .tool-choice > .tv-line-tool-icon{display:inline-block!important}
.tool-panel .tool-choice > .fantasy-tool-icon{flex:0 0 24px;width:24px;height:24px;object-fit:contain}
.tool-panel .tool-choice > svg.tv-line-tool-icon{color:currentColor}
body.tv-standard .tool-panel[data-panel="fib"] button.tool-choice > img.tv-line-tool-icon{display:inline-block!important;visibility:visible;opacity:1;flex:0 0 20px;width:20px;height:20px;object-fit:contain}
/* The fib artwork is the reference's own, lifted from its capture as black line
   art on transparency. TV mode's flyout is dark by default, where black would be
   invisible, so it is inverted there and left alone in the light skin. */
.tv-standard:not(.light-theme) .tool-panel .fib-tool-section button.tool-choice img.fib-vector-icon{filter:invert(1)}
/* The trend artwork is likewise the reference's own, lifted from its capture as
   black line art on transparency, so it is sized like the fib set and inverted
   for TV mode's dark flyout. The two tools below the capture's last row - the
   forecast and VWAP entries - are still inline svg and keep the rule above. */
body.tv-standard .tool-panel[data-panel="trend"] .trend-tool-section button.tool-choice > img.tv-line-tool-icon{display:inline-block!important;visibility:visible;opacity:1;flex:0 0 20px;width:20px;height:20px;object-fit:contain}
.tv-standard:not(.light-theme) .tool-panel .trend-tool-section button.tool-choice img.trend-vector-icon{filter:invert(1)}
body.tv-standard .tool-panel[data-panel="trend"] .trend-tool-section button.tool-choice > svg.tv-line-tool-icon{display:inline-block!important;width:20px!important;height:20px!important;flex:0 0 20px!important;color:#434651}
body.tv-standard .tool-panel[data-panel="trend"] .trend-tool-section button.tool-choice > svg.tv-line-tool-icon g{stroke-width:1.2!important}
.tool-panel[data-panel="annotate"]{grid-template-columns:1fr;gap:0;max-height:min(78vh,720px);overflow-y:auto;overscroll-behavior:contain}
.tool-panel[data-panel="annotate"].active{display:grid}
.annotation-tool-section{display:grid;grid-template-columns:1fr;gap:1px;padding:0 0 7px;margin:0 0 5px;border-bottom:1px solid var(--line)}
.annotation-tool-section:last-child{padding-bottom:0;margin-bottom:0;border-bottom:0}
.annotation-tool-section>b{padding:8px 10px 5px;color:var(--muted,#858b99);font-size:10px;font-weight:500;letter-spacing:.04em}
.tool-panel .annotation-tool-section button.tool-choice{height:34px;min-height:34px;display:flex;align-items:center;gap:10px;padding:0 10px;color:var(--text,#d1d4dc);font-size:12px;white-space:nowrap}
.tool-panel .annotation-tool-section button.tool-choice svg.annotation-vector-icon,.tool-panel .annotation-tool-section button.tool-choice svg.fantasy-tool-icon{flex:0 0 22px;width:22px;height:22px;object-fit:contain}
.tool-panel .cursor-tool-section button.tool-choice svg.cursor-vector-icon{flex:0 0 24px;width:24px;height:24px;color:currentColor}
/* chart-style.css hides .tv-line-tool-icon outside TV mode, so this panel's
   flat set needs its own un-hide or it renders blank in the Fantasy theme. */
.tv-standard .tool-panel .cursor-tool-section button.tool-choice > .cursor-vector-icon{display:inline-block!important}
.tv-standard .tool-panel .cursor-tool-section button.tool-choice > .fantasy-tool-icon{display:none!important}
.tool-panel .annotation-tool-section button.tool-choice:disabled{opacity:.48;cursor:not-allowed;transform:none}
.light-theme .geometric-tool-section>b{color:#777d89}
.history-source-note{display:none;align-items:center;flex:0 0 auto;margin-left:2px;padding:2px 7px;border:1px solid #f2c078;border-radius:10px;background:#fff7e8;color:#8a4b00;font:600 10px/1.3 Arial,sans-serif;white-space:nowrap}
.history-source-note.is-visible{display:inline-flex}
body:not(.light-theme) .history-source-note{border-color:#805b2e;background:#382a19;color:#ffd89e}
