/* ============================================================
   STREET QUANTS — desk v2 (Vela by LuxAlgo engine, TradingView
   structure, our dark glass style). Appended: overrides the old
   practice layout only; ticket / rail / card styles stay shared.
   ============================================================ */

/* 3-column desk: chat+logs | chart | paper rail */
.pt-trade { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: 54px minmax(0, 1fr) !important; gap: 10px; padding: 10px 16px 8px !important; }
.pt-trade .d2-main { grid-column: 1; grid-row: 2 !important; display: grid; grid-template-rows: minmax(0, 1fr); gap: 10px; min-height: 0; padding-bottom: 0 !important; }
/* the old layout pinned the rail into an explicit cell — release it into desk col 3 */
.pt-desk .d2-rail { grid-column: 3 !important; grid-row: 1 !important; min-height: 0; }
.pt-desk { display: grid; grid-template-columns: minmax(285px, 22%) minmax(0, 1fr) 330px; grid-template-rows: minmax(0, 1fr); gap: 12px; min-height: 0; min-width: 0; }
/* explicit columns: display:none on a collapsed pane must not reshuffle the grid */
.pt-desk > * { grid-row: 1; }
.pt-desk > .pt-chatpane { grid-column: 1; }
.pt-desk > .pt-center { grid-column: 2; }
.pt-desk > .d2-rail { grid-column: 3; }
@media (max-width: 1500px) { .pt-desk { grid-template-columns: minmax(260px, 20%) minmax(0, 1fr) 300px; } }
@media (max-width: 1180px) { .pt-desk { grid-template-columns: minmax(240px, 26%) minmax(0, 1fr) 0px; } .pt-desk .d2-rail { display: none; } }
/* mobile: single column — chart on top, chat below. All panes must be re-pinned to col 1,
   otherwise .pt-center (grid-column:2) falls into an implicit off-screen column. */
@media (max-width: 920px) {
  .pt-desk { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(300px, 48%) minmax(0, 1fr); }
  .pt-desk > .pt-center { grid-column: 1; grid-row: 1; }
  .pt-desk > .pt-chatpane { grid-column: 1; grid-row: 2; }
}

/* ---------- the single TradingView-style header row ---------- */
.pt-trade .pt-top { display: flex; align-items: center; gap: 7px; min-width: 0; min-height: 46px; padding: 2px 0; flex-wrap: nowrap; }
.pt-top .pt-home { flex: none; background: rgba(10,18,14,.6); border: 1px solid var(--d2-line2); color: var(--d2-ink2); border-radius: 11px; padding: 8px 13px; font: 800 11.5px var(--font); cursor: pointer; white-space: nowrap; }
.pt-top .pt-home:hover { color: var(--g); border-color: var(--g-38); }
/* the asset switcher: dark, on-brand pill */
.pt-sym-open { flex: none; display: inline-flex; align-items: center; gap: 7px; background: linear-gradient(180deg, #12271b, #0a130e); border: 1px solid rgba(124,252,46,.3); border-radius: 11px; color: #fff; font: 800 12.5px var(--font); padding: 8px 12px; cursor: pointer; white-space: nowrap; box-shadow: 0 0 16px rgba(124,252,46,.08), inset 0 1px 0 rgba(255,255,255,.05); }
.pt-sym-open:hover { border-color: var(--g-38); box-shadow: 0 0 18px var(--g-22); }
.pt-sym-open .perp { font: 700 8.5px 'JetBrains Mono', monospace; letter-spacing: .1em; color: var(--g); border: 1px solid rgba(124,252,46,.35); border-radius: 5px; padding: 1px 5px; background: rgba(124,252,46,.1); }
.pt-sym-open .sym-caret { font-size: 8px; color: var(--d2-mut); }
.pt-sym-open:hover .sym-caret { color: var(--g); }
.pt-sym-add { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.1); color: #c3ccc6; cursor: pointer; padding: 0; }
.pt-sym-add svg { width: 15px; height: 15px; }
.pt-sym-add:hover { color: var(--g); border-color: var(--g-38); box-shadow: 0 0 14px var(--g-22); }
.pt-tb-txt { background: none; border-color: transparent; color: var(--d2-mut); }
.pt-tb-txt:hover { color: #fff; border-color: rgba(255,255,255,.16); }
.pt-tb-txt.on { color: var(--g); border-color: var(--g-38); background: rgba(124,252,46,.07); box-shadow: 0 0 14px var(--g-22); }
.pt-top .pt-pills { display: flex; gap: 6px; flex: none; }
.pt-top .pt-pills button { padding: 7px 13px; font-size: 10.5px; white-space: nowrap; }
.pt-top .pt-ticker { flex: 1 1 auto; min-width: 80px; border: 0; background: none; }
.pt-top .pt-gear { width: 32px; height: 32px; }
.pt-top .pt-ava-btn { flex: none; }
.pt-trade .pt-top { position: relative; z-index: 20; }
@media (max-width: 1500px) { .pt-top .pt-pills button { padding: 7px 10px; font-size: 10px; } }
@media (max-width: 1280px) { .pt-top .pt-pills { display: none; } }

/* chart UI state: collapse chevrons (chat / equity rail) */
.pt-trade.is-nochat .pt-desk { grid-template-columns: 0 minmax(0, 1fr) 330px; }
.pt-trade.is-nochat .pt-chatpane { display: none; }
.pt-trade.is-norail .pt-desk { grid-template-columns: minmax(285px, 22%) minmax(0, 1fr) 0; }
.pt-trade.is-norail .d2-rail { display: none; }
.pt-trade.is-nochat.is-norail .pt-desk { grid-template-columns: 0 minmax(0, 1fr) 0; }
@media (max-width: 1500px) {
  .pt-trade.is-nochat .pt-desk { grid-template-columns: 0 minmax(0, 1fr) 300px; }
  .pt-trade.is-norail .pt-desk { grid-template-columns: minmax(260px, 20%) minmax(0, 1fr) 0; }
}
@media (max-width: 1180px) {
  .pt-trade.is-nochat .pt-desk { grid-template-columns: 0 minmax(0, 1fr) 0px; }
  .pt-trade.is-norail .pt-desk { grid-template-columns: minmax(240px, 26%) minmax(0, 1fr) 0px; }
}

/* left: the desk agent (logs + chat merged) */
.pt-chatpane { display: flex; flex-direction: column; min-height: 0; min-width: 0; border: 1px solid var(--glass-line); border-radius: 20px; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); overflow: hidden; position: relative; }
.pt-chat-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.07); flex: none; }
.pt-chat-live i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--g); box-shadow: 0 0 8px var(--g); animation: ptblink 1.6s ease-in-out infinite; }
.pt-chat-h b { font: 900 13px var(--font); color: #fff; }
.pt-chat-sub { color: #8b958e; font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .06em; }
.pt-chat-hbtn { flex: none; background: rgba(255,255,255,.04); border: 1px solid var(--glass-line); border-radius: 999px; color: #c3ccc6; font: 700 10.5px var(--font); padding: 5px 11px; cursor: pointer; margin-left: 0; }
.pt-chat-hbtn:hover { color: var(--g); border-color: var(--g-38); }
.pt-chat-hbtn.sq { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: 999px; padding: 0 8px; }
.pt-chat-hbtn.sq svg { width: 13px; height: 13px; flex: none; }
.pt-chat-hbtn.sq span { font: 700 10px var(--font); }
.pt-chat-hbtn.sq:not([id="pt-chat-search"]) { padding: 0; width: 26px; }
.pt-chat-h .pt-chat-hist-holder { margin-left: auto; }
.pt-chat-h #pt-chat-new { margin-left: auto; }
.pt-chatpane .pt-feed { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.pt-chatbar { display: flex; align-items: center; gap: 8px; padding: 8px; border-top: 1px solid rgba(255,255,255,.07); flex: none; }
.pt-chatbar input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: #fff; font: 500 13px var(--font); }
.pt-chatbar input::placeholder { color: #69707c; }
.pt-chatbar .ci { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--glass-line); color: #c3ccc6; background: none; cursor: pointer; font-size: 16px; }
.pt-chatbar .ci:hover { color: var(--g); border-color: var(--g-38); }
.pt-chatbar .ci.go { background: linear-gradient(180deg, var(--g-hi), var(--g)); color: #0A1A05; border: 0; box-shadow: 0 0 14px var(--g-glow); }
.pt-chatbar .ci.rec { color: #ff5a6e; border-color: #ff5a6e; animation: micPulse 1s ease-in-out infinite; }
.pt-chat-note { flex: none; padding: 6px 12px 8px; color: #5f6a64; font: 600 9.5px var(--font); border-top: 1px solid rgba(255,255,255,.04); }
.pt-trade .pt-disclaimer { display: none; }
.pt-chatpane .pt-attachbar { padding: 6px 10px 0; flex-wrap: wrap; display: flex; gap: 6px; }
.pt-chatpane .pt-attachbar[hidden] { display: none !important; }

/* center: chart card — full-bleed chart with TradingView-style overlays */
.pt-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 10px; position: relative; }
.pt-workspace { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--d2-line); border-radius: 20px; overflow: hidden; background: linear-gradient(145deg, #0e1b14, #080e0b 65%); }
.pt-ws-spacer { flex: 1 1 auto; min-width: 8px; }
/* top-left overlay stack: legend · compare chip · quick trade widget */
.pt-ws-ovl { position: absolute; z-index: 8; left: 46px; top: 9px; display: flex; flex-direction: column; gap: 9px; pointer-events: none; max-width: min(460px, 72%); }
.pt-ws-ovl > * { pointer-events: auto; }
.pt-legend { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-family: 'JetBrains Mono', monospace; text-shadow: 0 1px 4px rgba(0,0,0,.85); background: rgba(5,10,7,.72); border: 1px solid rgba(255,255,255,.06); border-radius: 8px; padding: 4px 9px; width: max-content; max-width: 100%; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pt-leg-name { color: #fff; font: 800 12.5px var(--font); }
.pt-leg-tf { color: #c3ccc6; font: 700 10.5px 'JetBrains Mono', monospace; }
.pt-leg-tf::before { content: '·'; color: var(--d2-mut); margin-right: 7px; }
.pt-leg-venue { color: var(--d2-mut); font: 600 9px 'JetBrains Mono', monospace; letter-spacing: .14em; }
.pt-leg-venue::before { content: '·'; color: var(--d2-mut); margin-right: 5px; letter-spacing: 0; }
.pt-leg-ohlc { display: flex; gap: 9px; font-size: 10.5px; color: var(--d2-mut); }
.pt-leg-ohlc b { font-weight: 700; }
.pt-leg-ohlc em { font-style: normal; font-weight: 700; }
/* compare chip (the + button): relative performance of a second symbol */
.pt-compare { width: 232px; background: rgba(4,7,10,.72); border: 1px solid rgba(255,255,255,.09); border-radius: 12px; padding: 8px 10px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 12px 34px rgba(0,0,0,.45); }
.pt-cmp-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.pt-cmp-head b { color: #fff; font: 800 11px 'JetBrains Mono', monospace; }
.pt-cmp-chg { font: 800 11px 'JetBrains Mono', monospace; margin-left: auto; }
.pt-cmp-head button { border: 0; background: none; color: var(--d2-mut); cursor: pointer; font-size: 11px; padding: 0 2px; line-height: 1; }
.pt-cmp-head button:hover { color: var(--d2-red); }
#pt-cmp-cv { width: 210px; height: 58px; display: block; }
/* quick trade widget: price chip · SELL / size / BUY — mirrors the order ticket */
.pt-qw { position: relative; display: flex; align-items: stretch; gap: 6px; margin-top: 10px; width: max-content; }
.pt-qw .sell, .pt-qw .buy { border-radius: 9px; padding: 9px 15px; font: 800 12px 'JetBrains Mono', monospace; letter-spacing: .06em; cursor: pointer; position: relative; }
.pt-qw .sell { background: rgba(255,59,59,.13); border: 1px solid rgba(255,59,59,.5); color: #ff6b6b; }
.pt-qw .sell:hover { background: rgba(255,59,59,.24); }
.pt-qw .buy { background: rgba(0,230,138,.1); border: 1px solid rgba(0,230,138,.45); color: #7ddba4; }
.pt-qw .buy:hover { background: rgba(0,230,138,.2); }
.pt-qw .sell .px { position: absolute; top: -12px; left: 0; transform: translateY(-50%); background: #ff3b3b; color: #fff; border-radius: 5px; padding: 2px 7px; font: 700 10.5px 'JetBrains Mono', monospace; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.pt-qw-mid { display: flex; align-items: center; gap: 5px; background: rgba(4,7,10,.78); border: 1px solid rgba(255,255,255,.14); border-radius: 9px; padding: 0 9px; }
.pt-qw-mid input { width: 58px; background: none; border: 0; outline: none; color: #fff; font: 700 12.5px 'JetBrains Mono', monospace; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.pt-qw-mid input::-webkit-outer-spin-button, .pt-qw-mid input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pt-qw-mid em { font: 700 9px 'JetBrains Mono', monospace; color: var(--d2-mut); font-style: normal; }
.pt-tb { flex: none; display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 9px; color: #dfe9e2; font: 700 11.5px var(--font); padding: 6px 10px; cursor: pointer; white-space: nowrap; }
.pt-tb:hover { color: #fff; border-color: var(--g-38); }
.pt-tb > svg { width: 15px; height: 15px; flex: none; }
.pt-tb .pt-tb-c { color: #8b958e; font-style: normal; font-size: 10px; }
.pt-tb.on { color: var(--g); border-color: var(--g-38); box-shadow: 0 0 14px var(--g-22); }
.pt-vela { flex: 1 1 auto; min-height: 0; min-width: 0; position: relative; }
.pt-vela canvas { display: block; }
.pt-star-armed { cursor: crosshair !important; }
.pt-star-armed canvas { pointer-events: none !important; }
.pt-capture-box { position: absolute; z-index: 8; border: 1.5px dashed var(--g); background: rgba(124,252,46,.08); border-radius: 8px; pointer-events: none; }
/* bottom strip floats over the chart: « · clock · alert/replay/capture/cfg/fs · » */
.pt-ws-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; gap: 7px; padding: 2px 7px 5px; pointer-events: none; background: linear-gradient(180deg, transparent, rgba(4,7,10,.5)); min-width: 0; }
.pt-ws-bottom > * { pointer-events: auto; }
.pt-ws-chev { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border: 0; background: none; color: var(--d2-mut); font: 700 13px 'JetBrains Mono', monospace; cursor: pointer; border-radius: 7px; padding: 0; line-height: 1; }
.pt-ws-chev:hover { color: var(--g); background: rgba(255,255,255,.06); }
/* chart clock — bottom-right inside the plot, clear of the price axis (JS fine-tunes right) */
.pt-ws-clock { position: absolute; right: 84px; bottom: 38px; z-index: 36; display: inline-flex; align-items: center; gap: 5px; background: rgba(5,10,7,.72); border: 1px solid rgba(255,255,255,.07); border-radius: 8px; padding: 3px 9px; color: #c3ccc6; font: 600 10.5px 'JetBrains Mono', monospace; letter-spacing: .04em; cursor: pointer; white-space: nowrap; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pt-ws-clock:hover { color: var(--g); border-color: var(--g-38); }
.pt-ws-tools { display: inline-flex; gap: 2px; align-items: center; flex: none; }
.pt-ws-tools .pt-chart-tool { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: none; border: 0; color: rgba(255,255,255,.42); cursor: pointer; padding: 0; }
.pt-ws-tools .pt-chart-tool svg { width: 14px; height: 14px; }
.pt-ws-tools .pt-chart-tool:hover { color: var(--g); background: rgba(255,255,255,.06); }
.pt-chart-tool.on { color: var(--g); border-color: var(--g-38); box-shadow: 0 0 12px var(--g-22); }
/* full-screen keeps chart + chat; hides rail + pills (old rule rebased) */
.pt-trade.is-fs { grid-template-rows: minmax(0, 1fr) !important; padding: 10px !important; }
.pt-trade.is-fs .pt-desk { grid-template-columns: minmax(250px, 18%) minmax(0, 1fr) 0 !important; }
.pt-trade.is-fs .pt-desk .d2-rail { display: none; }

/* toolbar dropdown menus */
.pt-desk-menu { position: absolute; z-index: 30; min-width: 170px; max-height: 320px; overflow-y: auto; background: linear-gradient(#0B100B, #050805); border: 1px solid var(--glass-line); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.65); padding: 6px; }
.pt-desk-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: #e8ecf1; font: 700 12px var(--font); padding: 8px 10px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.pt-desk-menu button:hover { background: var(--g-08); color: var(--g); }
.pt-desk-menu button.on { color: var(--g); }
.pt-desk-menu button b { float: right; }
.pt-desk-menu-sep { display: block; height: 1px; background: rgba(255,255,255,.08); margin: 4px 6px; }

/* chart right-click context menu (TradingView style) */
.pt-ctx { position: absolute; z-index: 40; min-width: 254px; max-width: 320px; background: linear-gradient(#0B100B, #050805); border: 1px solid var(--glass-line); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.65); padding: 6px; }
.pt-ctx-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: none; border: 0; color: #e8ecf1; font: 700 12px var(--font); padding: 8px 10px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.pt-ctx-row:hover:not(.dis) { background: var(--g-08); color: var(--g); }
.pt-ctx-row.dis, .pt-ctx-row:disabled { color: #5b665f; cursor: default; }
.pt-ctx-row.dis:hover { background: none; color: #5b665f; }
.pt-ctx-row em { margin-left: auto; color: #69756d; font: 600 9.5px 'JetBrains Mono', monospace; font-style: normal; }
.pt-ctx-row b { color: var(--g); margin-left: 6px; }
.pt-ctx-sep { display: block; height: 1px; background: rgba(255,255,255,.08); margin: 4px 6px; }
.pt-ctx-subwrap { position: relative; }
.pt-ctx-sub { display: none; position: absolute; left: 100%; top: -6px; margin-left: 4px; min-width: 224px; background: linear-gradient(#0B100B, #050805); border: 1px solid var(--glass-line); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.65); padding: 6px; }
.pt-ctx-subwrap:hover .pt-ctx-sub { display: block; }
.pt-ctx-subwrap.flip .pt-ctx-sub { left: auto; right: 100%; margin-left: 0; margin-right: 4px; }

/* reverse position button inside the rail posbox */
.pt-pos-actions { margin-top: 8px; }
.pt-pos-actions:empty { display: none; }
.pt-pos-actions button { width: 100%; padding: 7px 10px; border-radius: 9px; border: 1px solid rgba(111,227,27,.35); background: rgba(111,227,27,.08); color: var(--g); font: 700 10.5px var(--font); letter-spacing: .8px; cursor: pointer; }
.pt-pos-actions button:hover { background: rgba(111,227,27,.16); border-color: rgba(111,227,27,.6); }
.pt-ctx-subwrap .pt-ctx-row .pt-dm-arr { float: none; margin-left: auto; }

/* floating table view overlay */
.pt-tableview { position: absolute; left: 52px; bottom: 46px; z-index: 35; width: 356px; background: linear-gradient(rgba(8,12,8,.94), rgba(4,7,4,.94)); border: 1px solid var(--glass-line); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.6); overflow: hidden; backdrop-filter: blur(6px); }
.pt-tv-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 12px; border-bottom: 1px solid rgba(255,255,255,.07); }
.pt-tv-h b { font: 700 10px 'JetBrains Mono', monospace; letter-spacing: 1.2px; color: #cfd6d1; }
.pt-tv-x { width: 22px; height: 22px; border-radius: 8px; border: 1px solid rgba(255,59,59,.4); background: none; color: #ff8080; font-size: 10px; cursor: pointer; }
.pt-tv-x:hover { background: rgba(255,59,59,.16); border-color: rgba(255,59,59,.8); }
.pt-tv-body { max-height: 300px; overflow-y: auto; }
.pt-tv-row { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr 1fr .85fr; gap: 4px; padding: 4px 12px; font: 600 10px 'JetBrains Mono', monospace; }
.pt-tv-row b { color: #d7ddd8; text-align: right; font-weight: 600; }
.pt-tv-row b:first-child { text-align: left; color: #8b958e; }
.pt-tv-row.hd b { color: #69756d; letter-spacing: .6px; border-bottom: 1px solid rgba(255,255,255,.08); padding-bottom: 4px; }

/* history + composer dialogs */
.pt-hist { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.pt-hist-row { border: 1px solid var(--glass-line); border-radius: 12px; padding: 8px 10px; background: rgba(255,255,255,.03); }
.pt-hist-row b { display: block; font: 800 10px 'JetBrains Mono', monospace; color: #8b958e; margin-bottom: 3px; }
.pt-hist-row.ai b { color: var(--g); }
.pt-hist-row span { color: #dfe9e2; font: 600 12px/1.5 var(--font); }
.pt-hist-sess { font: 800 10px 'JetBrains Mono', monospace; letter-spacing: .12em; color: #8b958e; margin: 10px 2px 2px; text-transform: uppercase; }
.pt-hist-sess:first-child { margin-top: 2px; }
.pt-hist-empty { color: #8b958e; font: 600 12px var(--font); padding: 8px 2px; }
.pt-menu-big { display: block; width: 100%; text-align: left; background: rgba(255,255,255,.03); border: 1px solid var(--glass-line); border-radius: 12px; color: #e8ecf1; font: 700 12.5px var(--font); padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.pt-menu-big:hover { border-color: var(--g-38); color: var(--g); }

/* right rail a touch bigger */
.pt-desk .d2-rail { min-width: 0; }
.pt-desk .pt-acct .big { font-size: 28px; }
.pt-desk .pt-jrow .sy { font-size: 12px; }

/* Vela chart theming hooks (structure from Vela, chrome in our ink) */
.pt-vela .vela-dtb { background: rgba(4,7,10,.92); }
.pt-vela .vela-dtb button:hover { background: rgba(124,252,46,.10) !important; }

/* full-screen keeps chart + chat; hides rail + pills (old rule rebased) */
.pt-trade.is-fs .pt-desk { grid-template-columns: minmax(250px, 18%) minmax(0, 1fr) 0 !important; }
.pt-trade.is-fs .pt-desk .d2-rail { display: none; }
/* ===== 2026-10-15 feedback round: chart chrome, toolbar, chat header, qw, legend ===== */
/* -- Vela drawing toolbar finish: hide flag/eraser/magnet/stay, style extras -- */
.vela-dtb [aria-label="Eraser (click/drag to delete)"],
.vela-dtb [aria-label="Stay in drawing mode"],
.vela-dtb [aria-label="Icons"],
.vela-dtb [aria-label="Magnet snap"],
.vela-dtb .vela-dtb-collapse,
.vela-dtb :has(> .vela-dtb-icon[aria-label="Icons"]),
.vela-dtb :has(> .vela-dtb-icon[aria-label="Magnet snap"]),
.vela-dtb :has(> .vela-dtb-icon[aria-label="Eraser (click/drag to delete)"]),
.vela-dtb :has(> .vela-dtb-icon[aria-label="Stay in drawing mode"]),
.vela-dtb :has(> .vela-dtb-icon[aria-label="Collapse"]) { display: none !important; }
.vela-dtb [aria-label="Measure"] svg { width: 18px; height: 18px; }
/* native rail icons a touch bigger — hit boxes stay 22px, toolbar width unchanged */
.pt-vela .vela-dtb .vela-dtb-hit svg { width: 17px; height: 17px; }
.pt-vela .vela-dtb .vela-dtb-star svg { width: 17px; height: 17px; }
/* notifications bell (top nav, between gear and avatar) */
.pt-notifs-btn { position: relative; }
.pt-notifs-dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--g); box-shadow: 0 0 8px var(--g-glow); pointer-events: none; }
.pt-notifs-dot[hidden] { display: none; }
.pt-dtb-extras { display: flex; flex-direction: column; gap: 2px; padding-top: 5px; margin-top: 5px; border-top: 1px solid rgba(255,255,255,.09); }
.pt-dtb-btn { width: 43px; height: 30px; display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: #b9c4bd; cursor: pointer; padding: 0; }
.pt-dtb-btn svg { width: 18px; height: 18px; }
.pt-dtb-btn#pt-dtb-tree svg { width: 20px; height: 20px; }
.pt-dtb-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.pt-dtb-btn.on { color: var(--g); background: rgba(124,252,46,.12); }
/* -- object-tree popover -- */
.pt-drawlist { position: absolute; z-index: 60; width: 220px; max-height: 300px; overflow-y: auto; background: linear-gradient(#0B100B, #050805); border: 1px solid var(--glass-line); border-radius: 13px; box-shadow: 0 24px 60px rgba(0,0,0,.65); padding: 6px; }
.pt-dl-h { display: flex; justify-content: space-between; padding: 5px 8px; color: var(--d2-mut); font: 700 10px 'JetBrains Mono', monospace; letter-spacing: .12em; }
.pt-dl-row { display: flex; align-items: center; gap: 2px; padding: 2px 6px; border-radius: 8px; }
.pt-dl-row:hover { background: rgba(255,255,255,.05); }
.pt-dl-name { flex: 1; min-width: 0; color: #e8ecf1; font: 600 11.5px var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-dl-eye, .pt-dl-del { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: #8b958e; cursor: pointer; padding: 0; }
.pt-dl-eye svg { width: 13px; height: 13px; }
.pt-dl-eye:hover, .pt-dl-del:hover { color: #fff; background: rgba(255,255,255,.08); }
.pt-dl-eye.off { color: #4d5750; }
.pt-dl-del:hover { color: #ff6b6b; }
.pt-dl-empty { padding: 10px 9px; color: var(--d2-mut); font: 600 11px var(--font); }
.pt-dl-clear { width: 100%; margin-top: 4px; background: rgba(255,59,59,.1); border: 1px solid rgba(255,59,59,.35); color: #ff8f8f; border-radius: 9px; padding: 7px; font: 700 11px var(--font); cursor: pointer; }
.pt-dl-clear:hover { background: rgba(255,59,59,.2); }
/* -- desk menu rows + per-row eye -- */
.pt-desk-row { display: flex; align-items: center; gap: 2px; }
.pt-desk-row > button[data-i] { flex: 1; min-width: 0; }
.pt-dm-eye { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border: 0; background: none; color: #7d8781; border-radius: 8px; cursor: pointer; padding: 0; }
.pt-dm-eye svg { width: 14px; height: 14px; }
.pt-dm-eye:hover { color: #fff; background: rgba(255,255,255,.07); }
.pt-dm-eye.off { color: #47514b; }
/* -- header: expand buttons (visible only when a pane is collapsed) -- */
.pt-expand { display: none; flex: none; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.1); color: #c3ccc6; cursor: pointer; padding: 0; }
.pt-expand svg { width: 15px; height: 15px; }
.pt-expand:hover { color: var(--g); border-color: var(--g-38); }
.is-nochat #pt-expand-chat { display: inline-grid; }
.is-norail #pt-expand-rail { display: inline-grid; }
/* -- header: icon-only toolbar buttons + circular compare add -- */
.pt-tb-icon { padding: 6px 8px; gap: 3px; }
.pt-tb-icon svg { width: 15px; height: 15px; }
.pt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pt-sym-add { border-radius: 50%; width: 30px; height: 30px; }
/* -- chat header: compact icons, no wrap, chevron on top -- */
.pt-chat-h { gap: 7px; overflow: hidden; }
.pt-chat-h .pt-chat-sub { display: none; }
.pt-chat-hbtns { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.pt-chat-h .pt-chat-hbtns #pt-chat-new { margin-left: 0; }
.pt-chat-hbtn { flex: none; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: none; border: 1px solid transparent; color: #aab4ad; padding: 0; cursor: pointer; }
.pt-chat-hbtn:hover { color: var(--g); background: rgba(255,255,255,.05); }
.pt-chat-hbtn svg { width: 16px; height: 16px; flex: none; }
.pt-chat-chev { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border: 0; background: none; color: var(--d2-mut); font: 700 13px 'JetBrains Mono', monospace; cursor: pointer; border-radius: 8px; padding: 0; line-height: 1; }
.pt-chat-chev svg { width: 15px; height: 15px; }
.pt-chat-chev:hover { color: var(--g); background: rgba(255,255,255,.06); }
/* -- rail title chevron: collapse lives INSIDE the PAPER ACCOUNT card -- */
.pt-rail-chev { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border: 0; background: none; color: var(--d2-mut); font: 700 12px 'JetBrains Mono', monospace; cursor: pointer; border-radius: 7px; padding: 0; line-height: 1; }
.pt-rail-chev svg { width: 15px; height: 15px; }
.pt-rail-chev:hover { color: var(--g); background: rgba(255,255,255,.06); }
/* -- legend: one row, OHLC inline beside the name -- */
.pt-ws-ovl { max-width: min(660px, 86%); }
.pt-legend { flex-wrap: nowrap; }
.pt-legend .pt-leg-name, .pt-legend .pt-leg-tf, .pt-legend .pt-leg-venue, .pt-legend .pt-leg-ohlc { white-space: nowrap; }
.pt-legend.no-name .pt-leg-name { display: none; }
.pt-legend.no-live .pt-leg-venue { display: none; }
.pt-legend.no-chg #pt-chg { display: none; }
.pt-legend.vals-none .pt-leg-ohlc { display: none; }
.pt-legend.vals-two { flex-wrap: wrap; }
.pt-legend.vals-two .pt-leg-ohlc { flex-basis: 100%; }
/* -- quick widget: bid/ask inside the buttons -- */
.pt-qw .sell, .pt-qw .buy { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 15px 7px; }
.pt-qw .sell .lbl, .pt-qw .buy .lbl { font-size: 11.5px; line-height: 1; }
.pt-qw .sell .px, .pt-qw .buy .px { position: static; order: -1; transform: none; background: none; box-shadow: none; padding: 0; color: #fff; opacity: .95; font: 700 10.5px 'JetBrains Mono', monospace; white-space: nowrap; line-height: 1.3; }
/* -- chart corner cluster: gear + fullscreen tuck into the bottom-right corner -- */
.pt-ws-bottom { left: auto; right: 6px; bottom: 6px; width: auto; padding: 0; background: none; gap: 3px; align-items: center; }
.pt-ws-bottom .pt-chart-tool { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: rgba(5,10,7,.72); border: 1px solid rgba(255,255,255,.07); color: rgba(255,255,255,.55); cursor: pointer; padding: 0; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pt-ws-bottom .pt-chart-tool svg { width: 14px; height: 14px; }
.pt-ws-bottom .pt-chart-tool:hover { color: var(--g); border-color: var(--g-38); }
/* -- per-indicator plates with eye toggles (top-left inside the chart) -- */
.pt-ind-stack { display: flex; flex-wrap: wrap; gap: 4px 6px; max-width: 100%; }
.pt-ind-stack.empty { display: none; }
.pt-ind-plate { display: inline-flex; align-items: center; gap: 6px; background: rgba(5,10,7,.66); border: 1px solid rgba(255,255,255,.07); border-radius: 8px; padding: 2px 4px 2px 8px; font: 600 10.5px 'JetBrains Mono', monospace; color: #c3ccc6; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pt-ind-plate b { color: #dfe9e2; font-weight: 700; }
.pt-ind-plate i { font-style: normal; color: var(--d2-mut); }
.pt-ind-eye { width: 18px; height: 18px; display: grid; place-items: center; border: 0; background: none; color: #6f7a73; border-radius: 6px; cursor: pointer; padding: 0; opacity: .6; }
.pt-ind-plate:hover .pt-ind-eye { opacity: 1; }
.pt-ind-eye:hover { color: var(--g); background: rgba(255,255,255,.08); }
.pt-ind-eye svg { width: 12px; height: 12px; }
/* -- rail: quick order dispatch button (opens the floating ticket) -- */
.pt-dispatch-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--g-38); border-radius: 14px; background: linear-gradient(180deg, rgba(124,252,46,.14), rgba(124,252,46,.05)); color: var(--g); font: 800 12px var(--font); letter-spacing: .04em; padding: 12px 10px; cursor: pointer; }
.pt-dispatch-btn:hover { background: rgba(124,252,46,.2); }
.pt-dispatch-btn[hidden] { display: none; }
.pt-ticket-x { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: #8b958e; font: 700 13px 'JetBrains Mono', monospace; cursor: pointer; padding: 0; line-height: 1; }
.pt-ticket-x:hover { color: #fff; background: rgba(255,255,255,.08); }
/* -- desk menus: state hints, disabled TradingView-only rows, timezone/scale widths -- */
.pt-desk-menu .pt-dm-hint { float: right; margin-left: 14px; color: #69756d; font: 600 9.5px 'JetBrains Mono', monospace; font-style: normal; text-transform: none; }
.pt-desk-menu .pt-desk-row.dis button { color: #5b665f; cursor: default; }
.pt-desk-menu .pt-desk-row.dis button:hover { background: none; color: #5b665f; }
.pt-desk-menu .pt-dm-arr { float: right; color: #5b665f; margin-left: 8px; font-style: normal; font-weight: 700; }
.pt-desk-menu.pt-dm-tz { max-height: 430px; min-width: 250px; }
.pt-desk-menu.pt-dm-scale { min-width: 242px; }
/* -- dtb extras: caret on the hide-all menu button, star icon sizing -- */
.pt-dtb-btn.pt-has-caret { position: relative; }
.pt-dtb-btn.pt-has-caret::after { content: '▾'; position: absolute; right: 3px; bottom: 1px; font-size: 8px; color: #8b958e; line-height: 1; }
.pt-dtb-btn.pt-has-caret:hover::after { color: var(--g); }
/* -- desk settings/chart config: disabled rows + mini buttons -- */
.pt-set-row.dis { opacity: .55; }
.pt-set-row.dis em { font-style: normal; font: 600 9.5px 'JetBrains Mono', monospace; color: #69756d; }
.pt-mini { border: 1px solid var(--glass-line); background: rgba(255,255,255,.04); color: #dfe9e2; border-radius: 8px; padding: 5px 12px; font: 700 11px var(--font); cursor: pointer; }
.pt-mini:hover { border-color: var(--g-38); color: var(--g); }
@media (max-width: 1100px) {
  .pt-ws-bottom { right: 6px; bottom: 6px; }
}

/* -- mobile: the fab is the ticket entry; tuck the corner cluster -- */
@media (max-width: 800px) {
  .pt-ws-bottom { right: 4px; bottom: 4px; }
}
@media (max-width: 560px) {
  .pt-ws-clock { display: none; }
  /* the legend strip is wider than a phone — let it wrap onto a second row
     (venue tag dropped, OHLC tightened) instead of running off-screen */
  .pt-ws-ovl { max-width: calc(100% - 52px); }
  .pt-legend { flex-wrap: wrap; gap: 3px 7px; padding: 3px 8px; }
  .pt-legend .pt-leg-venue { display: none; }
  .pt-leg-ohlc { gap: 5px; font-size: 9.5px; flex-wrap: wrap; }
}
/* -- small screens: collapsed-pane variants must stay single-column too
   (these rules sit last so they beat the 1180px 3-column re-expansions) -- */
@media (max-width: 920px) {
  .pt-trade.is-nochat .pt-desk, .pt-trade.is-norail .pt-desk { grid-template-columns: minmax(0, 1fr); }
  .pt-trade.is-nochat.is-norail .pt-desk { grid-template-columns: minmax(0, 1fr); }
  .pt-trade.is-nochat .pt-desk { grid-template-rows: minmax(0, 1fr); }
  .pt-trade.is-nochat .pt-center { grid-row: 1; }
}
/* -- small screens: header may wrap instead of clipping inside the fixed row -- */
@media (max-width: 800px) {
  .pt-trade { grid-template-rows: auto minmax(0, 1fr) !important; }
  .pt-trade .pt-top { flex-wrap: wrap; row-gap: 6px; min-height: 0; }
}
