body.terminal-active { overflow: hidden; }
body.terminal-active .chat-bubble,body.terminal-active .chat-popup,body.terminal-active .theme-toggle,body.terminal-active .rv-fab { display: none !important; }
body.terminal-active #landing { display: none !important; }
body.terminal-active .wrap { display: block !important; }
#page-trading.terminal-screen:not(.hidden) { position: fixed; inset: 0; z-index: 900; width: 100%; height: 100dvh; margin: 0; padding: 0; background: #0d1117; color: #d6deeb; display: grid; grid-template-rows: 44px minmax(0,1fr) 25px; font: 13px Inter, sans-serif; }
.term-top { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-bottom: 1px solid #263041; min-width: 0; overflow-x: auto; white-space: nowrap; }
.term-top button,.term-top select,.term-side button,.term-dialog button { background: #171e29; color: #d6deeb; border: 1px solid #303c50; border-radius: 5px; padding: 6px 9px; cursor: pointer; font: inherit; }
.term-top .term-symbol { font-weight: 700; margin-right: auto; }
.term-top > * { flex-shrink: 0; }
.term-top button[aria-pressed=true],.term-tools button[aria-pressed=true] { background: #354578; color: #fff; }
.term-workspace { display: grid; grid-template-columns: 38px minmax(0,1fr); grid-template-rows: minmax(0,1fr) auto; min-width: 0; min-height: 0; }
.term-workspace.term-embedded { grid-template-columns: minmax(0,1fr); }
.term-tools { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 3px; border-right: 1px solid #263041; }
.term-tools[hidden],.term-replay[hidden] { display: none; }
.term-tools button { background: transparent; color: #adbbd1; border: 0; border-radius: 4px; min-height: 32px; cursor: pointer; font-size: 18px; }
.term-replay { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px; background: #172033; border-top: 1px solid #354578; font-size: 11px; }
.term-replay button { background: #25314b; color: white; border: 1px solid #435675; border-radius: 4px; padding: 6px; cursor: pointer; }
.term-replay input { flex: 1; min-width: 100px; }
.term-search-input { width: 100%; background: #0d1117; color: #d6deeb; padding: 12px; box-sizing: border-box; border: 1px solid #35445c; border-radius: 6px; }
.term-search-results { max-height: 45vh; overflow-y: auto; }
.term-search-row { display: flex; gap: 6px; margin: 6px 0; }
.term-search-row button:first-child { flex: 1; text-align: left; }
.term-indicator-option { display: flex; gap: 12px; padding: 12px 0; align-items: center; }
.term-indicator-option input { margin: 0 !important; }
.term-indicator-option[hidden] { display: none; }
.term-indicator-options { max-height: 45dvh; overflow-y: auto; }
.term-tools select { width: 32px; color: #becce3; background: #172033; border: 1px solid #35445c; min-height: 32px; }
.term-tools { overflow-y: auto; }
.term-context { position: fixed; z-index: 1100; min-width: 210px; padding: 6px; border: 1px solid #44536c; border-radius: 8px; background: #162030; box-shadow: 0 8px 30px #0009; }
.term-context[hidden],.term-alert[hidden] { display: none; }
.term-context button { display: block; width: 100%; background: transparent; border: 0; padding: 10px; text-align: left; color: #d6deeb; cursor: pointer; }
.term-context button:hover { background: #2a3b5b; }
.term-alert { position: absolute; top: 52px; right: 16px; z-index: 1101; padding: 15px; max-width: min(440px,80vw); background: #294b42; border: 1px solid #50d4a3; border-radius: 8px; }
.term-alert button { margin-left: 12px; cursor: pointer; }
.term-test-dialog { max-height: 85dvh; overflow-y: auto; }
.term-test-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; }
.term-test-field input { width: 90px; padding: 8px; margin: 0 !important; background: #0d1117; color: #d6deeb; border: 1px solid #35445c; }
.term-test-output { max-height: 40vh; overflow-y: auto; margin-top: 14px; font-size: 12px; }
.term-top button:disabled { opacity: .4; cursor: default; }
.term-body { display: grid; grid-template-columns: minmax(0,1fr) 262px; min-height: 0; }
.term-body.no-side { grid-template-columns: minmax(0,1fr); }
.term-body.no-side .term-side { display: none; }
.term-side { display: flex; flex-direction: column; border-left: 1px solid #263041; min-width: 0; overflow: hidden; }
.term-side-search { margin: 8px 10px; padding: 7px 9px; background: #0d1117; color: #d6deeb; border: 1px solid #303c50; border-radius: 5px; font: inherit; }
.term-entries { overflow-y: auto; min-height: 0; flex: 1; }
.term-side-close { margin-left: auto; padding: 2px 8px !important; }
.term-star[aria-pressed=true] { color: #fbbf24; }
.term-empty { color: #8c9bb1; padding: 12px; font-size: 11px; }
.term-quick { position: fixed; left: 10px; bottom: 32px; z-index: 950; display: flex; flex-direction: column; gap: 6px; }
.term-quick-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid #44536c; background: #162030e6; color: #d6deeb; font-size: 16px; cursor: pointer; box-shadow: 0 4px 14px #0007; }
.term-quick-btn[aria-pressed=true] { color: #fbbf24; border-color: #fbbf24; }
.term-quick-btn:hover { background: #24334d; }
.term-watchlist-dialog { max-height: 85dvh; overflow-y: auto; }
.term-watchlist-list { max-height: 40dvh; overflow-y: auto; border: 1px solid #263041; border-radius: 8px; margin: 10px 0; }
.term-wl-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.term-chart { position: relative; min-width: 0; min-height: 0; }
.term-chart > .tradingview-widget-container { height: 100%; width: 100%; }
.term-chart .tradingview-widget-copyright { display: block !important; }
.term-side-head { padding: 12px; border-bottom: 1px solid #263041; display: flex; flex-wrap: wrap; gap: 6px; position: sticky; top: 0; background: #0d1117; z-index: 2; }
.term-side-head strong { width: 100%; }
.term-row { display: flex; border-bottom: 1px solid #1c2634; align-items: center; }
.term-row.on { background: #202c47; border-left: 2px solid #8d9dff; }
.term-row .term-pair { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; padding: 10px; }
.term-pair b,.term-pair small { display: block; overflow: hidden; text-overflow: ellipsis; }
.term-pair small { color: #8c9bb1; font-size: 10px; margin-top: 3px; }
.term-row .term-action { padding: 5px; border: 0; background: transparent; color: #8c9bb1; }
.term-foot { padding: 4px 10px; border-top: 1px solid #263041; color: #9cacc2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.term-help { position: absolute; left: 12px; top: 12px; z-index: 3; max-width: 75%; background: #171e29; padding: 12px; border-radius: 6px; }
.term-dialog { background: #111823; color: #d6deeb; border: 1px solid #35445c; border-radius: 12px; width: min(540px,90vw); padding: 22px; }
.term-dialog::backdrop { background: #0009; }
.term-dialog textarea { width: 100%; min-height: 170px; background: #0d1117; color: #d6deeb; border: 1px solid #35445c; padding: 10px; box-sizing: border-box; margin: 12px 0; }
.term-dialog p { line-height: 1.6; color: #a5b4ca; }
.term-dialog input { max-width: 100%; margin-bottom: 12px; }
@media(max-width: 680px) {
  .term-body { grid-template-columns: minmax(0,1fr) 190px; }
  .term-body.no-side { grid-template-columns: minmax(0,1fr); }
  .term-top { gap: 4px; padding: 0 4px; font-size: 11px; }
  .term-top button,.term-top select { padding: 5px; }
  .term-row .term-action { padding: 3px; font-size: 10px; }
}
