.last-price-line.up { stroke: #089981; }
.last-price-line.down { stroke: #f23645; }
.last-price-label.up { fill: #089981; }
.last-price-label.down { fill: #f23645; }
.financial-candle.latest .candle-body { filter: none; }

/* Velas limpas e compactas no padrão visual do TradingView. */
.candle-wick {
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.candle-wick.up { stroke: #089981; }
.candle-wick.down { stroke: #f23645; }

.candle-body {
  stroke: none;
  shape-rendering: crispEdges;
}

.candle-body.up { fill: #089981; }
.candle-body.down { fill: #f23645; }

.volume-bar { opacity: .16; }
.volume-bar.up { fill: #089981; }
.volume-bar.down { fill: #f23645; }

body:not(.crash-mode) .trader-price-bg { fill: #1e2024; }
body:not(.crash-mode) #traderCandleChart { background: #1e2024; }
body:not(.crash-mode) .trader-chart-panel,
body:not(.crash-mode) .chart-toolbar { background: #1e2024; }
body:not(.crash-mode) .chart-toolbar { border-bottom-color: #383b40; }
body:not(.crash-mode) #traderCandleChart .chart-gridline { stroke: #3a3d42; stroke-width: .8; }
body:not(.crash-mode) #traderCandleChart .chart-gridline.vertical { stroke-opacity: .9; }
body:not(.crash-mode) #traderCandleChart .chart-axis,
body:not(.crash-mode) #traderCandleChart .chart-time { fill: #8b8f96; }
body:not(.crash-mode) .candle-wick { stroke-width: 1.1; }
body:not(.crash-mode) .candle-body.up { fill: #00c087; }
body:not(.crash-mode) .candle-body.down { fill: #ff5260; }
body:not(.crash-mode) .candle-wick.up { stroke: #00c087; }
body:not(.crash-mode) .candle-wick.down { stroke: #ff5260; }
body:not(.crash-mode) .last-price-line {
  stroke-width: .9;
  stroke-dasharray: 2 4;
  opacity: .85;
}
body:not(.crash-mode) .future-zone { fill: rgba(255,255,255,.006); }
body:not(.crash-mode) .future-boundary {
  stroke: #875056;
  stroke-width: .8;
  stroke-dasharray: none;
  opacity: .72;
}

.chart-legend button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 5px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #626b64;
  font: 9px 'DM Mono';
  cursor: pointer;
}
.chart-legend button i { margin-left: 0; }
.chart-legend button:hover { color: #cbd2cc; background: rgba(255,255,255,.04); }
.chart-legend button.active { color: #eef2ee; background: rgba(255,255,255,.08); }
body.crash-mode .chart-legend button { pointer-events: none; color: #747d76; }
body:not(.crash-mode) .chart-legend { display: none; }

.indicator-menu { position: relative; }
.indicator-menu-toggle { height: 38px; padding: 0 11px; border: 1px solid #2a302b; border-radius: 5px; background: #101310; color: #d9dfda; font: 600 10px Manrope; cursor: pointer; }
.indicator-menu-toggle b { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 5px; border-radius: 9px; background: #d5ad43; color: #17140b; font: 700 9px 'DM Mono'; }
.indicator-menu-toggle.active { border-color: #756127; color: #efd168; }
.pine-toggle { height: 38px; padding: 0 14px; border: 1px solid #6c5724; border-radius: 5px; background: #181509; color: #e7c653; font: 700 10px 'DM Mono'; cursor: pointer; }
.pine-toggle:hover, .pine-toggle.active { background: #29220d; border-color: #d5ad43; color: #fff0a5; }
.pine-modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.68); }
.pine-modal.hidden { display: none; }
.pine-dialog { width: min(680px, 95vw); overflow: hidden; border: 1px solid #3c433d; border-radius: 7px; background: #111512; box-shadow: 0 24px 80px rgba(0,0,0,.65); }
.pine-dialog header, .pine-dialog footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
.pine-dialog header { border-bottom: 1px solid #2b312c; }
.pine-dialog header span { color: #7e887f; font: 8px 'DM Mono'; letter-spacing: .1em; }
.pine-dialog h2 { margin: 3px 0 0; color: #e9ce69; font: 700 18px Manrope; }
.pine-dialog header button { border: 0; background: transparent; color: #aab2ac; font-size: 22px; cursor: pointer; }
.pine-dialog p, .pine-dialog small { display: block; margin: 12px 16px; color: #879188; font: 10px/1.5 Manrope; }
.pine-dialog textarea { display: block; width: calc(100% - 32px); height: 230px; margin: 0 16px; padding: 14px; resize: vertical; border: 1px solid #343c36; border-radius: 5px; outline: none; background: #090c0a; color: #dce8df; font: 12px/1.7 'DM Mono'; }
.pine-dialog textarea:focus { border-color: #9a8137; }
.pine-profile-row { display: grid; grid-template-columns: auto 125px minmax(0,1fr); align-items: center; gap: 9px; margin: 10px 16px 0; }
.pine-profile-row label { color: #7e887f; font: 8px 'DM Mono'; text-transform: uppercase; }
.pine-profile-row select { height: 32px; padding: 0 8px; border: 1px solid #3b433c; border-radius: 4px; background: #0b0f0c; color: #e5ca68; font: 700 9px Manrope; outline: none; }
.pine-profile-row span { color: #788279; font: 8px 'DM Mono'; }
.pine-library-controls { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 7px; margin: 10px 16px 0; }
.pine-library-controls input, .pine-library-controls button { min-height: 34px; border: 1px solid #343c36; border-radius: 4px; background: #0b0f0c; color: #d9dfda; font: 10px Manrope; }
.pine-library-controls input { padding: 0 10px; outline: none; }
.pine-library-controls input:focus { border-color: #9a8137; }
.pine-library-controls button { padding: 0 11px; cursor: pointer; }
.pine-library-controls button:hover { border-color: #9a8137; color: #efd168; }
.pine-library { max-height: 170px; margin: 9px 16px 0; overflow-y: auto; border: 1px solid #2f3631; border-radius: 5px; background: #0a0d0b; }
.pine-library.hidden { display: none; }
.pine-library article { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 6px; padding: 8px 9px; border-bottom: 1px solid #252b26; }
.pine-library article:last-child { border-bottom: 0; }
.pine-library article strong { overflow: hidden; color: #dce3dd; font: 10px Manrope; text-overflow: ellipsis; white-space: nowrap; }
.pine-library article strong small { display: block; margin-top: 2px; color: #788279; font: 7px 'DM Mono'; text-transform: uppercase; }
.pine-library article button { padding: 5px 8px; border: 1px solid #343c36; border-radius: 3px; background: #121713; color: #abb4ad; font: 8px 'DM Mono'; cursor: pointer; }
.pine-library article button:hover { color: #efd168; }
.pine-library-empty { padding: 14px; color: #737d75; font: 9px 'DM Mono'; }
.pine-dialog footer { border-top: 1px solid #2b312c; }
.pine-dialog footer span { color: #879188; font: 9px 'DM Mono'; }
.pine-dialog footer span.error { color: #ef6865; }
.pine-dialog footer button { padding: 9px 13px; border: 1px solid #8e742d; border-radius: 4px; background: #d5ad43; color: #151208; font: 700 10px Manrope; cursor: pointer; }
.indicator-menu-panel { position: absolute; z-index: 30; top: 44px; right: 0; width: 270px; max-height: min(620px, 72vh); overflow-y: auto; padding: 7px; border: 1px solid #3a3d42; border-radius: 6px; background: #1e2024; box-shadow: 0 18px 45px rgba(0,0,0,.55); }
.indicator-menu-panel.hidden { display: none; }
.indicator-menu-panel header { display: flex; align-items: center; justify-content: space-between; padding: 8px 9px 10px; border-bottom: 1px solid #34373c; }
.indicator-menu-panel header strong { color: #f0f2f0; font-size: 12px; }
.indicator-menu-panel header button { border: 0; background: transparent; color: #d4b74f; font: 9px 'DM Mono'; cursor: pointer; }
.indicator-menu-panel > button { position: relative; display: block; width: 100%; padding: 10px 36px 10px 12px; border: 0; border-radius: 4px; background: transparent; color: #e1e4e2; text-align: left; font: 500 12px Manrope; cursor: pointer; }
.indicator-menu-panel > button:hover { background: rgba(255,255,255,.055); }
.indicator-menu-panel > button::after { content: ""; position: absolute; right: 12px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); border: 1px solid #656a70; border-radius: 3px; }
.indicator-menu-panel > button.active::after { border-color: #d5ad43; background: #d5ad43; box-shadow: inset 0 0 0 3px #1e2024; }
body.crash-mode .indicator-menu { display: none; }

.trader-mode.has-trader-indicators .trader-indicators { display: grid !important; flex: 0 0 auto; max-height: 190px; overflow-x: auto; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.trader-mode.has-trader-indicators .trader-workspace { min-height: 0; }
.trader-mode.has-trader-indicators .trader-indicators article { min-width: 320px; }
.trader-mode.has-trader-indicators .trader-indicators svg { height: 112px; }
.indicator-dot { vector-effect: non-scaling-stroke; }
.sar-dot { fill: #f2cd58; stroke: #1e2024; stroke-width: .6; }
.fractal-mark { fill: none; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.fractal-mark.high { stroke: #ff6d79; }
.fractal-mark.low { stroke: #18ce91; }
.pine-signal { pointer-events: none; }
.pine-signal path { stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.pine-signal rect { stroke: #07100b; stroke-width: .7; vector-effect: non-scaling-stroke; }
.pine-signal text { fill: #07100b; font: 700 6.5px 'DM Mono'; text-anchor: middle; }
.pine-signal.over path, .pine-signal.over rect { stroke: #08d978; fill: #08d978; }
.pine-signal.under path, .pine-signal.under rect { stroke: #ff555c; fill: #ff555c; }
.pine-signal.loss { opacity: .62; }
.pine-signal.pending { filter: drop-shadow(0 0 3px currentColor); }
.pine-signal.compact rect, .pine-signal.compact text { display: none; }
.pine-signal.compact path { opacity: .9; }
.chart-zoom { display: flex; align-items: center; overflow: hidden; border: 1px solid #2c332d; border-radius: 4px; background: #0a0d0b; }
.chart-zoom button { width: 28px; height: 26px; padding: 0; border: 0; border-right: 1px solid #262c27; background: transparent; color: #aeb7b0; font: 600 11px 'DM Mono'; cursor: pointer; }
.chart-zoom button:last-child { border-right: 0; }
.chart-zoom button:hover { background: #19201a; color: #e8eee9; }
.chart-zoom button:active, .chart-history-nav button:active { background: #2b2513; color: #f0cd61; }
.sidebar-visibility-toggle { height: 28px; padding: 0 9px; border: 1px solid #2c332d; border-radius: 4px; color: #9fa9a1; background: #0a0d0b; font: 700 8px 'DM Mono'; cursor: pointer; }
.sidebar-visibility-toggle:hover, .sidebar-visibility-toggle.active { color: #f0cd61; border-color: #6c5a23; }
.chart-history-nav { display: flex; align-items: center; overflow: hidden; margin-left: 8px; border: 1px solid #2c332d; border-radius: 4px; background: #0a0d0b; }
.chart-history-nav button { height: 27px; min-width: 29px; padding: 0 8px; border: 0; border-right: 1px solid #262c27; background: transparent; color: #aeb7b0; font: 700 11px 'DM Mono'; cursor: pointer; }
.chart-history-nav button:last-child { border-right: 0; }
.chart-history-nav button:hover { background: #19201a; color: #e8eee9; }
#traderPanLatest { color: #d4b74f; font-size: 8px; letter-spacing: .06em; }
#traderZoomReset { width: 38px; color: #d4b74f; font-size: 9px; }
#traderCandleChart { cursor: crosshair; user-select: none; touch-action: none; }
#traderCandleChart:active, #traderCandleChart.dragging { cursor: grabbing; }
#traderCandleChart .axis-x { cursor: ew-resize; }
#traderCandleChart .axis-y { cursor: ns-resize; }
#traderCandleChart.dragging { cursor: grabbing; }
.trader-chart-panel { position: relative; }
#traderCandleChart polyline,
#traderCandleChart .chart-gridline,
#traderCandleChart .chart-axis,
#traderCandleChart .chart-time,
#traderCandleChart .last-price-line,
#traderCandleChart .last-price-label,
#traderCandleChart .last-price-text { pointer-events: none; }
.trader-scroll-layer { transform-box: fill-box; transform-origin: 0 0; }
.drawing-scroll-layer { transform-box: fill-box; transform-origin: 0 0; }
.chart-crosshair { pointer-events: none; }
.chart-crosshair.hidden { display: none; }
.chart-crosshair line { stroke: #6b736d; stroke-width: .75; stroke-dasharray: 3 3; opacity: .75; vector-effect: non-scaling-stroke; }
.financial-candle { cursor: pointer; }
.candle-hover-hit { fill: transparent; pointer-events: all; }
.financial-candle:hover .candle-hover-hit { fill: rgba(213,173,67,.025); }
.axis-hitbox { fill: transparent; pointer-events: all; }
.axis-hitbox.axis-y { cursor: ns-resize; }
.axis-hitbox.axis-x { cursor: ew-resize; }
.candle-tooltip { position: absolute; z-index: 8; width: 224px; padding: 11px 12px; border: 1px solid #343d35; border-radius: 5px; background: rgba(15,19,16,.97); box-shadow: 0 10px 34px rgba(0,0,0,.45); pointer-events: none; }
.candle-tooltip.hidden { display: none; }
.candle-tooltip header { display: flex; align-items: center; justify-content: space-between; color: #788179; font: 9px 'DM Mono'; }
.candle-tooltip header b { font-size: 9px; }
.candle-tooltip header .green { color: #26a69a; }
.candle-tooltip header .red { color: #ef5350; }
.candle-tooltip > strong { display: block; margin-top: 8px; color: #dfe5e0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.candle-tooltip > em { display: block; margin: 5px 0 8px; color: #f1f5f1; font: 700 20px 'DM Mono'; font-style: normal; }
.candle-tooltip > small { display: block; margin: -2px 0 8px; color: #9ca69e; font: 8px 'DM Mono'; }
.candle-tooltip footer { padding-top: 8px; border-top: 1px solid #293029; color: #788179; font: 8px 'DM Mono'; white-space: nowrap; }
.future-zone { fill: rgba(74, 116, 92, .012); pointer-events: none; }
.future-boundary { stroke: #3b473e; stroke-width: 1; stroke-dasharray: 3 7; vector-effect: non-scaling-stroke; pointer-events: none; }
.future-match { cursor: pointer; }
.future-slot-hit { fill: transparent; pointer-events: all; }
.future-match:hover .future-slot-hit { fill: rgba(213, 184, 79, .025); }
.future-time { fill: #5f6b62; pointer-events: none; }
.backtest-card { padding: 14px; border-bottom: 1px solid #242a25; background: #0b0f0c; }
.backtest-card > header { display: flex; align-items: center; justify-content: space-between; }
.backtest-card > header span { color: #737c75; font: 8px 'DM Mono'; letter-spacing: .08em; }
.backtest-card > header b { color: #89928b; font: 700 8px 'DM Mono'; }
.backtest-card > header b.positive { color: #3ecf8e; }
.backtest-card > header b.negative { color: #ef6865; }
.backtest-card > div { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 10px; background: #222923; }
.backtest-card article { padding: 8px; background: #101411; }
.backtest-card article span { display: block; color: #687169; font: 7px 'DM Mono'; }
.backtest-card article b { display: block; margin-top: 4px; color: #dce2dd; font: 600 11px 'DM Mono'; }
.backtest-card > small { display: block; margin-top: 9px; color: #6e7870; font: 8px 'DM Mono'; line-height: 1.45; }
.engine-card { padding: 14px; border-bottom: 1px solid #242a25; background: linear-gradient(145deg,#101712,#0a0e0b); }
.engine-card > header { display:flex;align-items:center;justify-content:space-between }
.engine-card > header span { color:#7d877f;font:8px 'DM Mono';letter-spacing:.1em }
.engine-card > header b { color:#d3b452;font:700 8px 'DM Mono';padding:4px 6px;border:1px solid #5a4d26;border-radius:3px }
.engine-status { display:flex;align-items:center;gap:9px;margin:12px 0 }
.engine-status i { width:8px;height:8px;border-radius:50%;background:#d3b452;box-shadow:0 0 0 4px rgba(211,180,82,.09) }
.engine-status i.ready { background:#3ecf8e;box-shadow:0 0 0 4px rgba(62,207,142,.09) }
.engine-status i.rejected { background:#ef6865;box-shadow:0 0 0 4px rgba(239,104,101,.09) }
.engine-status strong,.engine-status small { display:block }
.engine-status strong { color:#e4e9e5;font:700 11px 'DM Mono' }
.engine-status small { margin-top:3px;color:#737d75;font:8px 'DM Mono' }
.engine-grid { display:grid;grid-template-columns:1fr 1fr;gap:1px;background:#252c26 }
.engine-grid span { padding:7px;background:#0e130f;color:#69736b;font:7px 'DM Mono' }
.engine-grid b { display:block;margin-top:3px;color:#dfe5e0;font-size:10px }
.engine-card button { width:100%;margin-top:10px;padding:8px;border:1px solid #344039;border-radius:4px;background:#141a16;color:#b9c2bb;font:600 8px 'DM Mono';cursor:pointer }
.engine-card button:hover { border-color:#607064;color:#fff }
.engine-card p { margin:8px 0 0;color:#68726a;font:8px 'DM Mono';line-height:1.45 }
.pine-live-card { padding: 13px 14px; border-bottom: 1px solid #242a25; background: #0b100c; }
.pine-live-card > header { display: flex; justify-content: space-between; color: #737d75; font: 8px 'DM Mono'; }
.pine-live-card > header b { color: #d7b74d; }
.pine-live-state { margin: 10px 0; }
.pine-live-state strong { display: block; color: #9da69f; font: 700 15px Manrope; }
.pine-live-state strong.buy { color: #20d681; }
.pine-live-state small { display: block; margin-top: 3px; color: #707a72; font: 8px/1.4 'DM Mono'; }
.pine-live-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #252c26; }
.pine-live-grid span { padding: 7px; background: #0e130f; color: #69736b; font: 7px 'DM Mono'; }
.pine-live-grid b { display: block; margin-top: 3px; color: #dfe5e0; font-size: 10px; }
.pine-live-log { max-height: 76px; margin-top: 8px; overflow-y: auto; }
.pine-live-log div { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #202721; color: #849087; font: 7px 'DM Mono'; }
.pine-live-log b.win { color: #30ce82; }
.pine-live-log b.loss { color: #ef6464; }
.pine-live-log b.pending { color: #d7b74d; }
.pine-profile-compare { border: 1px solid #252c26; }
.pine-profile-compare > div { display: grid; grid-template-columns: 1.45fr .75fr .9fr .8fr .65fr; align-items: center; min-height: 28px; padding: 0 6px; border-bottom: 1px solid #202721; color: #8d988f; font: 7px 'DM Mono'; }
.pine-profile-compare > div:last-child { border-bottom: 0; }
.pine-profile-compare .pine-compare-head { min-height: 22px; color: #5f6a62; background: #0d120e; }
.pine-profile-compare > div.best { background: rgba(32, 214, 129, .08); }
.pine-profile-compare b { color: #dfe5e0; font-size: 8px; }
.pine-profile-compare b.good { color: #20d681; }
.pine-profile-compare b.bad { color: #ef6464; }
.pine-profile-compare small { display: block; color: #626c64; font-size: 6px; }
.strategy-live-matrix { margin-bottom: 9px; border: 1px solid #29302a; background: #0d120e; }
.strategy-live-matrix > div { display: grid; grid-template-columns: 1.35fr repeat(3, 1fr); min-height: 26px; border-bottom: 1px solid #242b25; }
.strategy-live-matrix > div:last-child { border-bottom: 0; }
.strategy-live-matrix span { display: flex; align-items: center; padding: 5px; border-right: 1px solid #242b25; color: #7c877f; font: 6.5px 'DM Mono'; overflow: hidden; }
.strategy-live-matrix span:last-child { border-right: 0; }
.strategy-live-matrix .matrix-head span { color: #5d6860; background: #101511; }
.strategy-live-matrix .matrix-name { color: #d1d8d2; font-weight: 700; }
.strategy-live-matrix .matrix-state.signal { color: #20d681; }
.strategy-live-matrix .matrix-state.gale { color: #e1bc49; }
.strategy-live-matrix .matrix-state.blocked { color: #a26b6b; }
.pine-audit-toggle { width: 100%; margin-top: 9px; padding: 8px; border: 1px solid #354038; border-radius: 4px; color: #c7d0c9; background: #111712; font: 700 8px 'DM Mono'; cursor: pointer; }
.pine-audit-toggle:hover { border-color: #d7b74d; color: #d7b74d; }
.pine-live-actions { display: grid; grid-template-columns: 1.25fr .75fr; gap: 6px; }
.pine-audit-dialog { width: min(900px, calc(100vw - 40px)); max-height: min(760px, calc(100vh - 40px)); overflow: hidden; }
.audit-export-actions { display: flex; justify-content: flex-end; gap: 7px; margin: 0 20px 12px; }
.audit-export-actions button { padding: 8px 11px; border: 1px solid #39423b; border-radius: 4px; color: #d5ddd7; background: #111712; font: 700 8px 'DM Mono'; cursor: pointer; }
.audit-export-actions button:hover { color: #e3c353; border-color: #796528; }
.pine-audit-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 0 20px 12px; background: #2a312b; }
.pine-audit-summary span { padding: 10px; color: #778179; background: #0e130f; font: 8px 'DM Mono'; }
.pine-audit-summary b { display: block; margin-top: 4px; color: #e1e6e2; font-size: 12px; }
.pine-audit-list { margin: 0 20px 20px; max-height: 480px; overflow: auto; border: 1px solid #29302a; }
.pine-audit-entry { padding: 12px; border-bottom: 1px solid #29302a; background: #0d120e; }
.pine-audit-entry:last-child { border-bottom: 0; }
.pine-audit-entry header { display: flex; justify-content: space-between; gap: 12px; color: #dce3dd; font: 700 10px 'DM Mono'; }
.pine-audit-entry header b.win { color: #20d681; }
.pine-audit-entry header b.loss { color: #ef6464; }
.pine-audit-entry header b.pending { color: #d7b74d; }
.pine-audit-entry p { margin: 7px 0; color: #98a29a; font: 9px/1.5 'DM Mono'; }
.pine-audit-attempts { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.pine-audit-attempts span { padding: 6px 8px; border: 1px solid #29302a; border-radius: 3px; color: #8e9991; background: #101511; font: 7px 'DM Mono'; }
.pine-audit-attempts span b { margin-right: 7px; color: #d8dfd9; }
.pine-audit-attempts span.win { border-color: rgba(32,214,129,.45); }
.pine-audit-attempts span.loss { border-color: rgba(239,100,100,.4); }
.pine-audit-attempts span.pending { border-color: rgba(215,183,77,.45); }
.pine-audit-entry dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; }
.pine-audit-entry dl div { padding: 7px; background: #111712; }
.pine-audit-entry dt { color: #657068; font: 7px 'DM Mono'; }
.pine-audit-entry dd { margin: 3px 0 0; color: #d6ddd7; font: 8px 'DM Mono'; }
.strategy-compare-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0 20px 12px; background: #2a312b; }
.strategy-compare-summary span { padding: 10px; color: #778179; background: #0e130f; font: 8px 'DM Mono'; }
.strategy-compare-summary b { display: block; margin-top: 4px; color: #e1e6e2; font-size: 12px; }
.strategy-compare-table { margin: 0 20px 20px; max-height: 500px; overflow: auto; border: 1px solid #303630; }
.strategy-compare-row { display: grid; grid-template-columns: 1.5fr .75fr .65fr .65fr .65fr .65fr .65fr .8fr; align-items: center; min-height: 36px; border-bottom: 1px solid #2b312c; background: #0e130f; color: #c9d0ca; font: 8px 'DM Mono'; }
.strategy-compare-row:last-child { border-bottom: 0; }
.strategy-compare-row > span { padding: 8px; }
.strategy-compare-row.header { position: sticky; top: 0; z-index: 2; min-height: 28px; color: #6f7971; background: #121713; }
.strategy-compare-row.group { background: #171c18; }
.strategy-compare-row.group > span:first-child { color: #e0bd4e; font-weight: 700; }
.strategy-compare-row b.good { color: #20d681; }
.strategy-compare-row b.bad { color: #ef6464; }
.drawing-toggle { height: 38px; padding: 0 13px; border: 1px solid #343c35; border-radius: 5px; background: #111511; color: #b8c0ba; font: 600 10px Manrope; cursor: pointer; white-space: nowrap; }
.drawing-toggle:hover, .drawing-toggle.active { border-color: #8f7835; background: #211c0e; color: #e5c963; }
.chart-mode-toggle { height: 38px; padding: 0 13px; border: 1px solid #343c35; border-radius: 5px; background: #111511; color: #b8c0ba; font: 600 10px Manrope; cursor: pointer; white-space: nowrap; }
.chart-mode-toggle:hover, .chart-mode-toggle.active { border-color: #39664b; background: #102017; color: #59d889; }
.line-mode .chart-legend { visibility: visible; }
.line-mode .chart-legend .ma-fast { background: #34c879; }
.line-mode .chart-legend .ma-slow { background: #d45b62; }
.line-mode .chart-legend .band { border-color: #77736d; }
.flow-segment { stroke-width: 2.2; vector-effect: non-scaling-stroke; pointer-events: none; }
.flow-segment.up { stroke: #21d979; filter: drop-shadow(0 0 3px rgba(33,217,121,.25)); }
.flow-segment.down { stroke: #ff5757; filter: drop-shadow(0 0 3px rgba(255,87,87,.22)); }
.flow-point { stroke: #0a0d0b; stroke-width: 1; vector-effect: non-scaling-stroke; }
.flow-point.up { fill: #21d979; }
.flow-point.down { fill: #ff5757; }
.flow-hit { fill: transparent; pointer-events: all; }
.flow-value { fill: #aaa79d; font: 600 8px 'DM Mono'; text-anchor: middle; pointer-events: none; }
.drawing-layer { position: absolute; z-index: 8; left: 0; top: 58px; width: 100%; height: calc(100% - 58px); background: transparent !important; pointer-events: none; touch-action: none; }
.drawing-layer.active { pointer-events: all; cursor: crosshair; }
.chart-drawing { stroke: #e0ba46; stroke-width: 1.5; fill: rgba(224,186,70,.08); vector-effect: non-scaling-stroke; }
.chart-drawing.draft { stroke: #f0d270; stroke-dasharray: 4 3; opacity: .85; }
.drawing-toolbar { position: absolute; z-index: 9; left: 9px; top: 68px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid #313932; border-radius: 5px; background: rgba(14,18,15,.97); box-shadow: 0 8px 25px rgba(0,0,0,.35); }
.drawing-toolbar.hidden { display: none; }
.drawing-toolbar button { width: 32px; height: 32px; padding: 0; border: 0; border-bottom: 1px solid #262d27; background: transparent; color: #aeb7b0; font: 600 15px 'DM Mono'; cursor: pointer; }
.drawing-toolbar button:hover, .drawing-toolbar button.active { background: #28220f; color: #efd066; }
.drawing-toolbar span { height: 5px; border-bottom: 1px solid #313832; background: #0a0d0b; }
.trader-mode .dashboard-grid,
.trader-mode .controlbar { display: none; }
.trader-mode .trader-workspace { grid-template-columns: minmax(0, 1fr) 292px; }
.trader-mode.trader-sidebar-collapsed .trader-workspace { grid-template-columns: minmax(0, 1fr); }
.trader-mode.trader-sidebar-collapsed .trader-sidebar { display: none !important; }
.trader-mode .trader-chart-panel { border-right: 1px solid #242a25; }
.trader-mode .trader-sidebar { display: flex !important; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #394139 #0d100e; }
.trader-mode .trader-indicators { display: none !important; }
.trader-mode .trader-chart-panel { display: flex; flex-direction: column; overflow: hidden; }
.trader-chart-stage { position: relative; flex: 1 1 auto; min-height: 260px; overflow: hidden; }
.trader-mode .trader-chart-stage > #traderCandleChart { display: block; width: 100%; height: 100%; min-height: 0; }
.trader-chart-stage .drawing-layer { top: 0; width: 100%; height: 100%; }
.trader-chart-stage .drawing-toolbar { top: 10px; }
.trader-mode.has-trader-indicators .trader-indicators {
  display: flex !important;
  flex: 0 0 auto;
  flex-direction: column;
  width: 100%;
  max-height: min(43vh, calc(var(--indicator-count, 1) * 112px));
  overflow-x: hidden;
  overflow-y: auto;
  background: #1e2024;
  scrollbar-width: thin;
  scrollbar-color: #4a4d52 #202226;
}
.trader-mode.has-trader-indicators .trader-indicators article {
  position: relative;
  flex: 0 0 112px;
  min-width: 0;
  height: 112px;
  border: 0;
  border-top: 1px solid #4a4d52;
  border-radius: 0;
  background: #1e2024;
  overflow: hidden;
}
.trader-mode.has-trader-indicators .trader-indicators svg { display: block; width: 100%; height: 112px; }
.indicator-pane-header { position: absolute; z-index: 4; top: 5px; right: 61px; display: flex; align-items: center; gap: 8px; color: #aeb1b7; pointer-events: auto; }
.indicator-pane-header b { font: 600 8px 'DM Mono'; }
.indicator-pane-header span { color: #babdc2; font-size: 10px; cursor: default; }
.indicator-pane-header button { display: grid; place-items: center; width: 14px; height: 14px; padding: 0; border: 0; border-radius: 50%; color: #c9ccd0; background: #65686d; font: 700 10px/1 Manrope; cursor: pointer; }
.indicator-pane-header button:hover { color: #fff; background: #f0525f; }
.indicator-gridline { stroke: #3e4146; stroke-width: .7; pointer-events: none; }
.indicator-reference { stroke: #777b81; stroke-width: .8; opacity: .8; pointer-events: none; }
.indicator-axis-label { fill: #9ba0a7; font: 7px 'DM Mono'; pointer-events: none; }
.indicator-value-tag { fill: #15171a; stroke-width: 1; }
.indicator-value-text { fill: #eef0f2; font: 700 7px 'DM Mono'; text-anchor: end; pointer-events: none; }
.indicator-crosshair { stroke: #aeb2b8; stroke-width: .65; opacity: .5; pointer-events: none; }
.indicator-crosshair.hidden { display: none; }
.indicator-histogram.positive { fill: #12ad52; }
.indicator-histogram.negative { fill: #ff3342; }
.trader-indicators polyline { stroke-width: 1.15; }

/* Terminal desktop em tela cheia: nenhum limite de largura, margem ou scroll
   da página. O espaço é dividido entre gráfico e indicadores. */
@media (min-width: 1051px) {
  body.trader-mode { height: 100vh; overflow: hidden; }
  .trader-mode .shell { width: 100%; max-width: none; height: 100vh; margin: 0; padding: 0; display: flex; flex-direction: column; }
  .trader-mode .topbar { display: none; }
  .trader-mode .leaguebar { flex: 0 0 46px; min-height: 46px; padding: 0 14px; }
  .trader-mode main { flex: 1; min-height: 0; }
  .trader-mode #trader-view { height: 100%; padding: 0; display: flex; flex-direction: column; }
  .trader-mode .trader-topbar { flex: 0 0 auto; min-height: 76px; margin: 0; padding: 8px 18px; flex-wrap: nowrap; align-items: center; }
  .trader-mode .trader-controls { flex-wrap: nowrap; min-width: 0; }
  .trader-mode .trader-terminal { flex: 1; min-height: 0; display: flex; flex-direction: column; border-right: 0; border-left: 0; border-radius: 0; }
  .trader-mode .trader-workspace { flex: 1 1 auto; height: auto; min-height: 0; }
  .trader-mode .trader-sidebar { height: 100%; }
  .trader-mode .trader-chart-panel { height: 100%; min-height: 0; }
  .trader-mode .trader-chart-panel > svg { height: calc(100% - 58px); min-height: 0; }
  .trader-mode .trader-disclaimer { display: none; }
  .trader-mode .bottom-nav { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); margin: 0; }
}
/* Barra do Financeiro NUMA LINHA SÓ, sempre — nunca empilha. Em tela estreita os
   controles ficam menores; se ainda não couberem, a fileira ROLA na horizontal
   (estilo terminal). Os menus (Indicadores / tipo de gráfico) abrem em posição
   FIXA pra a rolagem não cortá-los. No desktop largo (>1400) fica no tamanho cheio. */
.trader-mode .trader-topbar { flex-wrap: nowrap; align-items: center; }
.trader-mode .trader-controls { flex-wrap: nowrap; min-width: 0; }
@media (max-width: 1400px) {
  .trader-mode .trader-controls {
    gap: 6px; min-width: 0;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: thin; scrollbar-color: #3a3730 transparent;
  }
  .trader-mode .trader-controls::-webkit-scrollbar { height: 5px; }
  .trader-mode .trader-controls::-webkit-scrollbar-thumb { background: #3a3730; border-radius: 3px; }
  .trader-mode .indicator-menu-panel,
  .trader-mode .chart-type-panel { position: fixed; top: 96px; right: 14px; left: auto; }
  .trader-mode .trader-controls label { gap: 3px; font-size: 9px; }
  .trader-mode .trader-controls label span { font-size: 8.5px; letter-spacing: .02em; }
  .trader-mode .trader-controls select { max-width: 120px; height: 31px; padding: 0 5px; font-size: 10.5px; }
  .trader-mode .trader-controls .indicator-menu-toggle,
  .trader-mode .trader-controls .chart-mode-toggle,
  .trader-mode .trader-controls .drawing-toggle,
  .trader-mode .trader-topbar .pine-toggle { height: 31px; padding: 0 7px; font-size: 9px; }
  .trader-mode .trader-back-btn { padding: 0 9px; font-size: 11px; }
  .trader-mode #trader-view .trader-topbar .league-select-trigger { padding: 6px 9px; font-size: 11px; }
}
.trader-topbar p { display: flex; align-items: center; gap: 7px; }
.trader-topbar p b { color: #aeb7b0; font-weight: 600; }
.trader-topbar p i { width: 5px; height: 5px; border-radius: 50%; background: #3ecf8e; box-shadow: 0 0 0 3px rgba(62,207,142,.1); }
.trader-topbar p span { color: #68726a; }
@media (min-width: 721px) and (max-width: 1050px) {
  .trader-mode .trader-workspace { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .trader-mode .trader-sidebar { height: auto; }
  .trader-mode .trader-chart-panel > svg { height: 620px; min-height: 620px; }
}
@media (max-width: 720px) {
  .trader-mode .trader-workspace { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .trader-mode .trader-sidebar { height: auto; }
  .trader-mode .trader-chart-panel > svg { height: 68vh; min-height: 430px; }
  .trader-mode .trader-terminal { min-height: 0; }
  .chart-zoom { margin-left: auto; }
}


.chart-type-menu { position: relative; }
.chart-type-panel { position: absolute; z-index: 40; top: 45px; right: 0; width: 330px; padding: 10px; border: 1px solid #3a3d42; border-radius: 12px; background: #1d1f24; box-shadow: 0 22px 55px rgba(0,0,0,.58); }
.chart-type-panel.hidden { display: none; }
.chart-type-panel header { display: flex; align-items: center; justify-content: space-between; padding: 4px 5px 12px; }
.chart-type-panel header strong { color: #f2f3f4; font-size: 14px; }
.chart-type-panel header button { border: 0; background: transparent; color: #8a8f98; font-size: 25px; line-height: 1; cursor: pointer; }
.chart-type-panel > button { position: relative; display: flex; align-items: center; justify-content: space-between; width: 100%; height: 68px; margin: 7px 0; padding: 0 15px; overflow: hidden; border: 1px solid transparent; border-radius: 13px; background: #292b31; color: #f4f5f6; cursor: pointer; }
.chart-type-panel > button:hover { background: #30333a; }
.chart-type-panel > button.active { border-color: #8e939c; background: #34373e; }
.chart-type-panel > button b { position: relative; z-index: 2; font-size: 14px; }
.chart-preview { position: absolute; right: 0; bottom: 0; width: 190px; height: 56px; opacity: .92; }
.preview-line { background: linear-gradient(160deg, transparent 0 42%, #80b6ef 43% 44%, transparent 45% 52%, #80b6ef 53% 54%, transparent 55%); }
.preview-mountain { background: linear-gradient(160deg, transparent 0 42%, #83b8f0 43% 44%, rgba(110,153,202,.3) 45% 100%); }
.preview-candles, .preview-heikin, .preview-bars { background: repeating-linear-gradient(90deg, transparent 0 12px, #12c98d 12px 16px, transparent 16px 24px, #ff5967 24px 28px, transparent 28px 38px); clip-path: polygon(0 72%,10% 52%,20% 65%,30% 22%,40% 48%,50% 14%,60% 56%,70% 38%,80% 73%,90% 44%,100% 63%,100% 100%,0 100%); }
.preview-bars { background: repeating-linear-gradient(90deg, transparent 0 13px, #12c98d 13px 15px, transparent 15px 24px, #ff5967 24px 26px, transparent 26px 38px); }
.preview-heikin { filter: saturate(1.15); }
.mountain-area { fill: url(#mountainGradient); pointer-events: none; }
.ohlc-bar { fill: none; stroke-width: 1.2; vector-effect: non-scaling-stroke; shape-rendering: crispEdges; }
.ohlc-bar.up { stroke: #00c087; }
.ohlc-bar.down { stroke: #ff5260; }
.drawing-toolbar { left: 12px; top: 68px; width: 285px; max-height: min(690px, calc(100vh - 155px)); padding: 8px; overflow-y: auto; border-color: #3a3d42; border-radius: 10px; background: #1d1f24; box-shadow: 0 20px 50px rgba(0,0,0,.58); }
.drawing-toolbar > header { display: flex; align-items: center; justify-content: space-between; height: 42px; padding: 0 5px 8px; border-bottom: 1px solid #34373c; }
.drawing-toolbar > header strong { color: #f2f3f4; font-size: 14px; }
.drawing-toolbar > header button { width: 28px; height: 28px; border: 0; background: transparent; color: #8d929a; font-size: 24px; cursor: pointer; }
.drawing-toolbar > button { display: flex; align-items: center; gap: 12px; width: 100%; height: 43px; padding: 0 11px; border: 0; border-radius: 5px; background: transparent; color: #f0f1f2; text-align: left; font: 500 13px Manrope; }
.drawing-toolbar > button i { display: inline-grid; place-items: center; width: 23px; color: #d9dce0; font: 17px 'DM Mono'; font-style: normal; }
.drawing-toolbar > button:hover, .drawing-toolbar > button.active { background: #3b3e46; color: #fff; }
.drawing-toolbar > footer { position: sticky; bottom: -8px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 9px 0 2px; background: #1d1f24; }
.drawing-toolbar > footer button { height: 34px; border: 1px solid #40444b; border-radius: 5px; background: #292c32; color: #d9dce0; cursor: pointer; }
.drawing-toolbar > footer button:hover { background: #363a42; color: #fff; }
.fibonacci-level { stroke: #e0ba46; stroke-width: .9; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.fibonacci-label { fill: #e7c75c; font: 7px 'DM Mono'; }
.chart-drawing.secondary { opacity: .68; }
.chart-drawing-point { fill: #e0ba46; stroke: #171a1e; stroke-width: .8; vector-effect: non-scaling-stroke; }
.financial-price-line { fill: none; stroke: #edf2f8; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.last-price-line.line { stroke: #edf2f8; stroke-width: 1; stroke-dasharray: none; opacity: .9; }
.last-price-label.line { fill: #edf2f8; }
.last-price-line.line + .last-price-label + .last-price-text { fill: #1b2028; }

/* ===== TQP · cara de terminal no celular (denso, sem espremer) =====
   Só telas pequenas. Gráfico com altura moderada, controles compactos,
   abas rolando na horizontal e sub-painéis justos — pra RSI/MACD/PULSE/RITMO
   aparecerem juntos como um terminal, e o gráfico não ficar espremido. */
@media (max-width: 720px) {
  .inline-trader-chart-wrap,
  .inline-trader-chart-wrap[data-height=s],
  .inline-trader-chart-wrap[data-height=m],
  .inline-trader-chart-wrap[data-height=l],
  .inline-trader-chart-wrap[data-height=xl],
  body.tqp-terminal-mode .inline-trader-chart-wrap {
    height: 300px !important;
    min-height: 300px !important;
  }
  .inline-rsi-chart-wrap { height: 120px !important; }
  .inline-macd-panel .inline-rsi-chart-wrap { height: 120px !important; }
  .inline-alligator-panel .inline-rsi-chart-wrap { height: 130px !important; }

  /* controles do topo bem menores */
  .inline-trader-controls.pill { gap: 6px !important; flex-wrap: wrap; }
  .inline-trader-controls.pill .itc-field { height: 34px !important; padding: 0 10px !important; min-width: 0 !important; }
  .inline-trader-controls.pill .itc-tag { font-size: 8.5px !important; }
  .inline-trader-controls.pill .itc-value,
  .inline-trader-controls.pill .itc-field b { font-size: 12px !important; }

  /* abas de ferramentas rolam na horizontal em vez de cortar */
  .inline-intel-shortcuts { flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 6px; padding-bottom: 5px; scrollbar-width: none; }
  .inline-intel-shortcuts::-webkit-scrollbar { display: none; }
  .inline-intel-shortcuts > * { flex: 0 0 auto !important; white-space: nowrap; }

  .inline-rsi-panel > header { padding: 8px 10px; }

  /* cabeçalho do Trader: título em cima, abas rolando embaixo (sem cortar) */
  .inline-trader-head { flex-wrap: wrap !important; }
  .inline-intel-shortcuts { flex: 1 1 100% !important; justify-content: flex-start !important; margin: 8px 0 0 !important; min-width: 0 !important; max-width: 100% !important; }

  /* barra da MESA (Terminal/Multi/Indicadores...) quebra em linhas em vez de estourar */
  .tqp-template-bar { flex-wrap: wrap !important; gap: 6px !important; row-gap: 6px; }
  .tqp-template-bar > * { margin-left: 0 !important; }
  #tqpIndicatorsToggle { margin-left: auto !important; }

  /* gráficos largos que ROLAM de lado (arrasta pra ver cada detalhe, tipo often) */
  .inline-trader-chart-wrap { overflow-x: auto !important; overflow-y: hidden !important; -webkit-overflow-scrolling: touch; }
  .inline-rsi-chart-wrap { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  #inlineTraderChart, #inlineRsiChart, #inlineMacdChart { height: 100% !important; touch-action: pan-x pan-y !important; }
}

/* ===== FINANCEIRO em LARGURA REAL DE CELULAR =====
   Agora o Financeiro roda na largura verdadeira do aparelho (gráfico nítido + toque
   1:1). Com isso dá pra dar aos controles o tamanho CONFORTÁVEL (como no PC) e deixá-los
   em 2-3 linhas organizadas, lado a lado — em vez de espremidos numa fita que rola e
   some da tela. Nada aqui afeta o computador. */
@media (max-width: 720px) {
  .trader-mode .trader-topbar {
    flex-wrap: wrap !important; align-items: center; gap: 8px;
    padding: 8px 10px; min-height: 0;
  }
  /* linha 1: Voltar + Liga (ocupa a largura) + Pine */
  .trader-mode .trader-back-btn { height: 38px; padding: 0 12px; font-size: 12px; }
  .trader-mode #trader-view .trader-topbar .league-select { flex: 1 1 auto; min-width: 0; }
  .trader-mode #trader-view .trader-topbar .league-select-trigger {
    width: 100%; justify-content: center; height: 38px; padding: 0 12px; font-size: 13px;
  }
  .trader-mode .trader-topbar .pine-toggle { height: 38px; padding: 0 14px; font-size: 11px; }

  /* linhas 2 e 3: os controles do gráfico, em grade — tamanho de toque de verdade */
  .trader-mode .trader-controls {
    flex-wrap: wrap !important; overflow: visible !important;
    width: 100%; gap: 8px; order: 3;
  }
  .trader-mode .trader-controls label {
    flex: 1 1 30%; min-width: 100px; height: 44px;
    padding: 0 10px; gap: 2px;
    flex-direction: column; align-items: flex-start; justify-content: center;
    font-size: 9px !important; letter-spacing: .08em;
  }
  .trader-mode .trader-controls label select {
    width: 100%; min-width: 0; max-width: none !important;
    padding: 0; font-size: 13px !important; font-weight: 700;
  }
  .trader-mode .trader-controls .indicator-menu,
  .trader-mode .trader-controls .chart-type-menu { flex: 1 1 46%; min-width: 0; }
  .trader-mode .trader-controls .indicator-menu-toggle,
  .trader-mode .trader-controls .chart-mode-toggle {
    width: 100%; height: 42px; padding: 0 10px; font-size: 12px !important;
  }
  .trader-mode .trader-controls .drawing-toggle {
    flex: 1 1 46%; height: 42px; padding: 0 10px; font-size: 12px !important;
  }
  /* menus abrem centralizados e caibem na tela */
  .trader-mode .indicator-menu-panel,
  .trader-mode .chart-type-panel {
    position: fixed !important; left: 8px !important; right: 8px !important;
    top: auto !important; bottom: 12px; width: auto !important;
    max-height: 62vh; z-index: 60;
  }
  /* gráfico continua grande */
  .trader-mode .trader-chart-panel > svg { height: 54vh !important; min-height: 300px !important; }
  .trader-mode .trader-chart-stage { min-height: 300px; }
  .trader-mode .trader-workspace { grid-template-columns: 1fr !important; }
}
