:root {
  --trade-bg: #080b12;
  --trade-panel: #101722;
  --trade-panel-soft: #141d2a;
  --trade-line: rgba(148, 163, 184, 0.2);
  --trade-text: #dbe7f3;
  --trade-muted: #7f8ea3;
  --trade-blue: #2f6df6;
  --trade-green: #13b981;
  --trade-red: #ef476f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  color: var(--trade-text);
  font-family: "PT Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.trading-app {
  min-height: 100vh;
}

.trading-brand {
  text-decoration: none;
  flex: 0 0 auto;
}

.trading-tabs .tab-chip.active {
  background: transparent;
}

.trading-tabs .tab-chip-main {
  text-transform: uppercase;
}

.trading-topbar {
  z-index: 120;
  isolation: isolate;
  background: transparent;
  border-bottom: 1px solid rgba(214, 221, 235, 0.72);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.055);
  transition:
    transform 0.24s cubic-bezier(.2, .8, .2, 1),
    box-shadow 0.38s ease,
    border-color 0.42s ease,
    backdrop-filter 0.46s cubic-bezier(.16, 1, .3, 1);
}

.trading-topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(245, 247, 251, 0.78));
  opacity: 1;
  transition: opacity 0.52s cubic-bezier(.16, 1, .3, 1);
}

.trading-topbar.trading-topbar--overlap {
  border-bottom-color: rgba(214, 221, 235, 0.28);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.025);
  backdrop-filter: blur(12px) saturate(1.08);
}

.trading-topbar.trading-topbar--overlap::before {
  opacity: 0.34;
}

.trading-topbar.topbar--hidden {
  transform: translateY(calc(-100% - 8px));
}

.trading-screener-link {
  text-decoration: none;
}

.trading-main {
  position: relative;
  z-index: 1;
  padding: 18px 24px 0;
  background: var(--bg);
}

.trading-workspace-page {
  position: relative;
  z-index: 0;
  inset: auto;
  width: 100%;
  height: 100vh;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.trading-workspace-header {
  height: 54px;
  gap: 8px;
  border-bottom: 1px solid rgba(214, 221, 235, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 247, 251, 0.92));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.055);
}

.trading-workspace-header .chart-workspace__layouts {
  position: relative;
}

.trading-workspace-header .chart-workspace__layout-popover {
  width: 266px;
}

.trading-workspace-header .chart-workspace__layout-options {
  grid-template-columns: repeat(5, 44px);
}

.trading-active-pane-controls {
  max-width: none;
  flex: 0 0 auto;
  gap: 6px;
}

.trading-workspace-header .chart-workspace-pane__gear,
.trading-workspace-header .chart-workspace__layout-button,
.trading-workspace-header .chart-workspace__chip--tool {
  width: 32px;
  min-width: 32px;
  height: 32px;
}

.trading-workspace-header .chart-workspace__layouts,
.trading-workspace-header .trading-control-wrap,
.trading-workspace-header .chart-workspace-pane__tf,
.trading-workspace-header .trading-drawing-tools {
  flex: 0 0 auto;
}

.trading-workspace-symbol-input,
.trading-workspace-select,
.trading-workspace-tf-select {
  height: 32px;
  border: 1px solid rgba(47, 109, 246, 0.42);
  border-radius: 8px;
  background: rgba(47, 109, 246, 0.12);
  color: #f8fafc;
  outline: none;
}

.trading-workspace-symbol-input {
  width: 118px;
  padding: 0 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.trading-workspace-tf-select {
  width: 66px;
  appearance: none;
  text-align: center;
  text-align-last: center;
  padding: 0 8px;
  cursor: pointer;
}

.trading-control-wrap {
  position: relative;
  flex: 0 0 auto;
}

.trading-control-menu {
  width: 260px;
  max-height: min(520px, calc(100vh - 120px));
  overflow: auto;
}

.trading-control-menu .chart-workspace__setting-title:first-child {
  margin-top: 0;
}

.trading-indicator-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.trading-techdata-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.trading-techdata-control .chart-workspace__setting-check {
  min-width: 0;
}

.trading-indicator-control .trading-indicator-check {
  min-width: 0;
}

.trading-indicator-numbers {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trading-indicator-number {
  width: 42px;
  height: 24px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  color: #182235;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(15, 23, 42, 0.06);
}

.trading-techdata-period {
  width: 58px;
  height: 24px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  color: #182235;
  text-align: center;
  text-align-last: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  outline: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(15, 23, 42, 0.06);
}

.trading-techdata-period option {
  background: #ffffff;
  color: #182235;
  font-weight: 700;
}

.chart-workspace__setting-check.is-disabled,
.trading-techdata-control:has(.chart-workspace__setting-check.is-disabled) {
  opacity: 0.46;
}

.chart-workspace__setting-check.is-disabled,
.chart-workspace__setting-check.is-disabled input,
.trading-techdata-control:has(.chart-workspace__setting-check.is-disabled) .trading-techdata-period {
  cursor: not-allowed;
}

.trading-indicator-number:hover,
.trading-techdata-period:hover {
  border-color: #9fb0ca;
  background: #ffffff;
}

.trading-indicator-number:focus {
  border-color: rgba(47, 109, 246, 0.78);
  box-shadow: 0 0 0 2px rgba(47, 109, 246, 0.18), 0 1px 2px rgba(15, 23, 42, 0.08);
}

.trading-techdata-period:focus {
  border-color: rgba(47, 109, 246, 0.78);
  box-shadow: 0 0 0 2px rgba(47, 109, 246, 0.18), 0 1px 2px rgba(15, 23, 42, 0.08);
}

.trading-drawing-tools {
  flex: 0 0 auto;
  gap: 4px;
  margin-left: 0;
  overflow: visible;
  scrollbar-width: none;
}

.trading-drawing-tools::-webkit-scrollbar {
  display: none;
}

.trading-workspace-body {
  display: block;
  background: var(--bg);
}

.trading-workspace-left {
  width: 100%;
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 8px;
  background: var(--panel);
}

.trading-workspace-left.has-orderbook {
  grid-template-columns: minmax(180px, var(--trading-orderbook-width, 388px)) 9px minmax(0, 1fr);
}

.trading-charts-column {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr);
  gap: 8px;
}

.trading-charts-top-row {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.045);
}

.trading-ticket {
  position: relative;
  z-index: 6500;
  isolation: isolate;
  display: grid;
  grid-template-columns:
    66px
    38px
    82px
    minmax(394px, 0.96fr)
    minmax(240px, 0.62fr)
    minmax(286px, 0.78fr);
  grid-template-rows: 13px 21px 16px;
  align-items: stretch;
  column-gap: 6px;
  row-gap: 0;
  padding: 4px 8px 6px;
  overflow: visible;
}

.trading-ticket.is-disabled {
  background: linear-gradient(0deg, rgba(248, 250, 252, 0.72), rgba(248, 250, 252, 0.72)), var(--panel);
}

.trading-ticket__field,
.trading-ticket__metric {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.trading-ticket__field > span:first-child,
.trading-ticket__metric > span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  line-height: 11px;
  white-space: nowrap;
}

.trading-ticket__field--key {
  grid-column: 1;
  max-width: 66px;
}

.trading-ticket__key-caption,
.trading-ticket__direct-key-caption {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: visible;
}

.trading-ticket__cache-clear,
.trading-ticket__direct-cache-clear {
  height: 12px !important;
  min-width: 0 !important;
  width: max-content;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #dc315a !important;
  font-size: 8.5px !important;
  font-weight: 900 !important;
  line-height: 10px !important;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.trading-ticket__cache-clear:hover,
.trading-ticket__direct-cache-clear:hover {
  color: #b91c1c !important;
  text-decoration: underline;
}

.trading-ticket__cache-clear.hidden,
.trading-ticket__direct-cache-clear.hidden {
  display: none;
}

.trading-ticket__field--key select {
  background: #fff;
  background-color: #fff;
  max-width: 66px;
}

.trading-ticket__metric--balance {
  grid-column: 3;
}

.trading-ticket__field--amount,
.trading-ticket__field--price {
  grid-row: 1 / span 2;
  grid-template-rows: 12px 22px 11px;
  align-self: stretch;
}

.trading-ticket__field--amount > span:first-child,
.trading-ticket__field--price > span:first-child {
  text-align: center;
}

.trading-ticket__field--amount {
  grid-column: 4;
}

.trading-ticket__field--tp {
  grid-column: 5;
}

.trading-ticket__field--tp > span:first-child {
  color: #2563eb;
}

.trading-ticket__field--sl {
  grid-column: 6;
}

.trading-ticket__field--sl > span:first-child {
  color: #ef476f;
}

.trading-ticket__field--key,
.trading-ticket__metric {
  align-self: stretch;
  grid-row: 1 / span 2;
}

.trading-ticket__field--key {
  grid-template-rows: 12px 22px;
}

.trading-ticket__metric--balance {
  grid-template-rows: 12px 15px 10px;
}

.trading-ticket__config {
  position: relative;
  z-index: 2;
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  grid-template-rows: 1fr 1fr;
  align-content: stretch;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
}

.trading-ticket__config-badge {
  height: 17px;
  min-width: 0;
  padding: 0 3px;
  border: 1px solid rgba(180, 198, 228, 0.95);
  border-radius: 7px;
  background: linear-gradient(180deg, #ffffff, #f5f8fc);
  color: #172033;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.trading-ticket__config-badge.is-isolated {
  color: #7c3aed;
}

.trading-ticket__config-badge.is-crossed {
  color: #0f766e;
}

.trading-ticket__leverage-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 7px);
  z-index: 7600;
  width: 176px;
  padding: 8px;
  display: grid;
  gap: 7px;
  border: 1px solid rgba(180, 198, 228, 0.96);
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.17);
}

.trading-ticket__leverage-popover.hidden {
  display: none;
}

.trading-ticket__leverage-popover label {
  display: grid;
  gap: 4px;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
}

.trading-ticket__leverage-popover input {
  padding: 0 6px;
}

.trading-ticket__leverage-popover button {
  height: 22px;
  border: 0;
  border-radius: 7px;
  background: #2f6df6;
  color: #fff;
  font-size: 10.5px;
  font-weight: 900;
  cursor: pointer;
}

.trading-ticket__metric strong {
  min-width: 0;
  color: #172033;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trading-ticket__metric small {
  min-width: 0;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trading-ticket__metric strong.is-up,
.trading-ticket__metric small.is-up {
  color: #079669;
}

.trading-ticket__metric strong.is-down,
.trading-ticket__metric small.is-down {
  color: #dc315a;
}

.trading-ticket select,
.trading-ticket input {
  width: 100%;
  min-width: 0;
  height: 22px;
  min-height: 22px;
  max-height: 22px;
  border: 1px solid rgba(180, 198, 228, 0.95);
  border-radius: 6px;
  background: #fff;
  color: #172033;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  outline: none;
}

.trading-ticket select {
  padding: 0 4px;
}

.trading-ticket input {
  padding: 0 17px 0 6px;
  align-self: start;
}

.trading-ticket select:disabled,
.trading-ticket input:disabled,
.trading-ticket button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.trading-ticket__price-wrap {
  position: relative;
  min-width: 0;
  display: block;
}

.trading-ticket__clear {
  position: absolute;
  top: 50%;
  right: 2px;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 900;
  line-height: 15px;
  cursor: pointer;
}

.trading-ticket__clear:hover {
  color: #dc315a;
  background: rgba(220, 49, 90, 0.08);
}

.trading-ticket__link {
  justify-self: start;
  height: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2f6df6;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.trading-ticket__field--price .trading-ticket__link {
  justify-self: center;
  text-align: center;
}

.trading-ticket__field--sl .trading-ticket__link {
  color: #ef476f;
}

.trading-ticket__link.is-sent {
  color: #079669;
}

.trading-ticket__field--sl .trading-ticket__link.is-sent {
  color: #ef476f;
}

.trading-ticket.is-order-mode-limit .trading-ticket__field--price .trading-ticket__link,
.trading-ticket.is-order-mode-average .trading-ticket__field--price .trading-ticket__link {
  display: none;
}

.trading-ticket__order-panel {
  grid-column: 4;
  grid-row: 1 / span 2;
  min-width: 0;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-self: stretch;
  gap: 6px;
}

.trading-ticket__mode-tabs {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 1px;
}

.trading-ticket__mode-tabs button {
  height: 12px;
  min-width: 0;
  padding: 0 3px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #64748b;
  font-size: 8.5px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trading-ticket__mode-tabs button.is-active {
  border-color: rgba(47, 109, 246, 0.22);
  background: rgba(47, 109, 246, 0.09);
  color: #1d4ed8;
}

.trading-ticket__order-form {
  min-width: 0;
  display: grid;
  grid-template-columns: 67px 64px 56px 56px 126px;
  align-items: start;
  column-gap: 4px;
}

.trading-ticket__order-form .trading-ticket__field,
.trading-ticket__order-form .trading-ticket__actions {
  grid-column: auto;
  grid-row: auto;
}

.trading-ticket__order-form .trading-ticket__field {
  align-self: stretch;
}

.trading-ticket__order-form .trading-ticket__field--entry.hidden {
  display: none;
}

.trading-ticket__order-form .trading-ticket__field--entry > span:first-child {
  color: #0f766e;
  text-align: center;
}

.trading-ticket__order-form .trading-ticket__field--amount,
.trading-ticket__order-form .trading-ticket__field--price,
.trading-ticket__order-form .trading-ticket__field--entry {
  grid-template-rows: 12px 22px 11px;
}

.trading-ticket__actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  justify-content: flex-start;
  align-self: start;
  margin-left: 12px;
  padding-right: 14px;
}

.trading-ticket.is-order-mode-market .trading-ticket__actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: stretch;
  margin-left: 4px;
  padding-right: 14px;
  justify-content: flex-start;
}

.trading-ticket.is-order-mode-market .trading-ticket__side--long {
  order: 1;
  width: 50px;
  height: 17px;
  min-width: 50px;
  margin-left: 0;
  font-size: 11px;
  border-radius: 6px;
}

.trading-ticket.is-order-mode-market .trading-ticket__side--short {
  order: 2;
  width: 50px;
  height: 17px;
  min-width: 50px;
  font-size: 11px;
  border-radius: 6px;
}

.trading-ticket.is-order-mode-limit .trading-ticket__actions,
.trading-ticket.is-order-mode-average .trading-ticket__actions {
  flex-direction: column;
  gap: 5px;
  align-items: stretch;
  margin-left: 4px;
  padding-right: 4px;
}

.trading-ticket.is-order-mode-limit .trading-ticket__side--long,
.trading-ticket.is-order-mode-average .trading-ticket__side--long {
  order: 1;
  margin-left: 0;
}

.trading-ticket.is-order-mode-limit .trading-ticket__side--short,
.trading-ticket.is-order-mode-average .trading-ticket__side--short {
  order: 2;
}

.trading-ticket__side,
.trading-ticket__exit {
  height: 22px;
  min-width: 50px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.trading-ticket.is-order-mode-limit .trading-ticket__side,
.trading-ticket.is-order-mode-average .trading-ticket__side {
  width: 50px;
  height: 17px;
  min-width: 50px;
  font-size: 11px;
  border-radius: 6px;
}

.trading-ticket__side--long {
  margin-left: 2px;
}

.trading-ticket__side--short {
  background: #ef476f;
}

.trading-ticket__side--long {
  background: #13b981;
}

.trading-ticket__exit {
  min-width: 50px;
  background: #1f2a3d;
}

.trading-ticket__direct {
  position: absolute;
  inset: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: 144px 82px 96px 74px 88px minmax(0, 1fr);
  align-items: end;
  gap: 6px;
  padding: 5px 9px 7px;
  border-bottom: 1px solid rgba(180, 198, 228, 0.95);
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  z-index: 7300;
}

.trading-ticket.needs-direct-unlock {
  overflow: visible;
}

.trading-ticket__direct.hidden {
  display: none;
}

.trading-ticket.needs-direct-unlock .trading-ticket__actions,
.trading-ticket.needs-direct-unlock .trading-ticket__position {
  display: none;
}

.trading-ticket__direct input,
.trading-ticket__direct select {
  height: 22px;
  min-height: 22px;
  max-height: 22px;
}

.trading-ticket__direct-intro {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  align-self: center;
}

.trading-ticket__direct-intro strong {
  min-width: 0;
  color: #172033;
  font-size: 11px;
  font-weight: 900;
  line-height: 10px;
  white-space: normal;
}

.trading-ticket__direct-help {
  width: 18px;
  height: 18px;
  min-width: 18px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #2f6df6 !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 16px;
  cursor: help;
}

.trading-ticket__direct-help-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 60;
  width: min(420px, calc(100vw - 32px));
  display: none;
  padding: 10px 12px;
  border: 1px solid rgba(180, 198, 228, 0.98);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
  color: #172033;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.trading-ticket__direct-help:hover + .trading-ticket__direct-help-popover,
.trading-ticket__direct-help:focus + .trading-ticket__direct-help-popover,
.trading-ticket__direct-help-popover:hover {
  display: block;
}

.trading-ticket__direct-help-popover p {
  margin: 0 0 7px;
}

.trading-ticket__direct-help-popover ol {
  margin: 0;
  padding-left: 17px;
}

.trading-ticket__direct-help-popover ul {
  margin: 3px 0 0;
  padding-left: 14px;
}

.trading-ticket__direct-help-popover li {
  margin: 4px 0 0;
}

.trading-ticket__direct-help-popover span {
  color: #2f6df6;
}

.trading-ticket__direct label {
  min-width: 0;
  display: grid;
  grid-template-rows: 18px 22px;
  gap: 1px;
}

.trading-ticket__direct label > span {
  min-width: 0;
  color: #475569;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 9px;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.trading-ticket__direct label > .trading-ticket__direct-key-caption {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: visible;
  text-overflow: clip;
}

.trading-ticket__direct input {
  padding: 0 6px;
}

.trading-ticket__direct button {
  height: 22px;
  min-width: 0;
  padding: 0 7px;
  border: 0;
  border-radius: 7px;
  background: #2f6df6;
  color: #fff;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 22px;
  cursor: pointer;
  white-space: nowrap;
}

.trading-ticket__direct > button {
  width: 88px;
  align-self: end;
  text-align: center;
}

.trading-ticket__direct .trading-ticket__direct-help {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #2f6df6;
  color: #ffffff;
  line-height: 16px;
}

.trading-ticket__direct-reset {
  background: #e2e8f0 !important;
  color: #475569 !important;
}

.trading-ticket__direct-reset.hidden {
  display: none;
}

.trading-ticket__direct .hidden {
  display: none;
}

.trading-ticket__direct-status {
  min-width: 0;
  align-self: center;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trading-ticket__direct-status.is-ok {
  color: #079669;
}

.trading-ticket__direct-status.is-bad {
  color: #dc315a;
}

.trading-ticket__direct-status.is-pending {
  color: #2f6df6;
}

.trading-ticket__position {
  grid-column: 5 / 7;
  grid-row: 1 / span 2;
  min-width: 0;
  display: grid;
  grid-template-rows: 17px 16px;
  align-content: center;
  align-self: stretch;
  gap: 0;
  padding-left: 12px;
  border-left: 1px solid rgba(203, 213, 225, 0.72);
  overflow: hidden;
  white-space: nowrap;
}

.trading-ticket__position-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.trading-ticket__position-row--risk {
  gap: 11px;
}

.trading-ticket__position span {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  overflow: hidden;
}

.trading-ticket__position b {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.trading-ticket__position strong {
  min-width: 0;
  color: #172033;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trading-ticket__position strong.is-long,
.trading-ticket__position strong.is-up {
  color: #079669;
}

.trading-ticket__position strong.is-short,
.trading-ticket__position strong.is-down {
  color: #dc315a;
}

.trading-ticket__position strong.is-liq {
  color: #b45309;
}

.trading-ticket .trading-ticket__position .trading-ticket__position-exit {
  width: 46px;
  min-width: 46px;
  height: 17px;
  margin: 0 2px 0 0;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1;
}

.trading-ticket__pending {
  grid-column: 5 / 7;
  grid-row: 3;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 0 0 8px;
  border-left: 1px solid rgba(203, 213, 225, 0.72);
  color: #172033;
  font-size: 9.5px;
  font-weight: 900;
  overflow: hidden;
}

.trading-ticket__pending.hidden {
  display: none;
}

.trading-ticket__pending-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  overflow: hidden;
}

.trading-ticket__pending-row span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
}

.trading-ticket__pending-row--main span:last-child {
  color: #b7791f;
}

.trading-ticket__pending-row--risk {
  display: flex;
  gap: 8px;
}

.trading-ticket__pending-cancel {
  flex: 0 0 auto;
  align-self: center;
  width: 13px;
  min-width: 13px;
  height: 13px;
  min-height: 13px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(220, 49, 90, 0.1);
  color: #dc315a;
  font-size: 11px;
  font-weight: 900;
  line-height: 13px;
  text-align: center;
  cursor: pointer;
}

.trading-ticket__pending-cancel:hover {
  background: rgba(220, 49, 90, 0.18);
  color: #b91c1c;
}

.trading-ticket__status {
  grid-column: 4;
  grid-row: 3;
  align-self: center;
}

.trading-ticket__status {
  min-width: 0;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  display: none;
}

.trading-ticket__status.has-message {
  display: block;
}

.trading-ticket__status.is-ok {
  color: #079669;
}

.trading-ticket__status.is-bad {
  color: #dc315a;
}

.trading-ticket__status.is-pending {
  color: #b7791f;
}

.trading-ticket__latency-popover {
  position: absolute;
  right: 8px;
  top: 5px;
  z-index: 35;
  max-width: min(360px, calc(100% - 16px));
  display: grid;
  gap: 2px;
  padding: 7px 28px 7px 10px;
  border: 1px solid rgba(180, 198, 228, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  color: #172033;
  pointer-events: auto;
}

.trading-ticket__latency-popover.is-error {
  border-color: rgba(220, 49, 90, 0.55);
  background: rgba(255, 246, 248, 0.98);
  box-shadow: 0 12px 28px rgba(127, 29, 29, 0.18);
}

.trading-ticket__latency-popover.hidden {
  display: none;
}

.trading-ticket__latency-popover strong {
  color: #172033;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.05;
}

.trading-ticket__latency-popover.is-error strong {
  color: #be123c;
}

.trading-ticket__latency-popover span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.05;
  white-space: normal;
}

.trading-ticket__latency-popover.is-error span {
  color: #7f1d1d;
}

.trading-ticket__latency-close {
  position: absolute;
  right: 6px;
  top: 5px;
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.trading-ticket__latency-popover.is-error .trading-ticket__latency-close {
  background: rgba(220, 49, 90, 0.12);
  color: #be123c;
}

.trading-orderbook {
  --orderbook-cluster-col: 30px;
  --orderbook-print-col: 38px;
  --orderbook-price-col: 52px;
  position: relative;
  z-index: 90;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: visible;
  border: 1px solid rgba(214, 221, 235, 0.92);
  border-radius: 14px 0 0 14px;
  background: #f3f6fb;
  color: #111827;
}

[data-trading-market-theme="dark"] .trading-orderbook {
  border-color: rgba(24, 33, 52, 0.78);
  background: #0f1724;
  color: #dbe7f3;
}

.trading-orderbook__toolbar {
  position: relative;
  z-index: 2200;
  display: grid;
  grid-template-columns: 28px 28px 28px 28px minmax(44px, 1fr);
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.86);
  background: #f6f8fc;
}

.trading-orderbook__group-toggle,
.trading-orderbook__trades-toggle,
.trading-orderbook__clusters-toggle,
.trading-orderbook__center {
  height: 28px;
  border: 1px solid rgba(187, 199, 219, 0.92);
  border-radius: 8px;
  background: #f8fafc;
  color: #111827;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  outline: none;
}

.trading-orderbook__group {
  position: relative;
  display: block;
  min-width: 0;
}

.trading-orderbook__group-toggle {
  width: 28px;
  padding: 0;
  cursor: pointer;
  font-size: 11px;
}

.trading-orderbook__latency {
  justify-self: end;
  min-width: 0;
  max-width: 54px;
  overflow: hidden;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
  text-overflow: clip;
}

.trading-orderbook__latency.is-fast {
  color: #08916d;
}

.trading-orderbook__latency.is-slow {
  color: #dc315a;
}

.trading-orderbook__group-toggle:hover,
.trading-orderbook__group-toggle.is-active,
.trading-orderbook__center.is-active {
  border-color: rgba(47, 109, 246, 0.72);
  color: #2f6df6;
  box-shadow: 0 0 0 2px rgba(47, 109, 246, 0.12);
}

.trading-orderbook__center {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  padding: 0;
  cursor: pointer;
}

.trading-orderbook__tool {
  position: relative;
  display: inline-flex;
}

.trading-orderbook__center svg {
  width: 14px;
  height: 14px;
}

.trading-orderbook__trades-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  padding: 0;
  color: #64748b;
  cursor: pointer;
}

.trading-orderbook__clusters-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  padding: 0;
  color: #64748b;
  font-size: 11px;
  cursor: pointer;
}

.trading-orderbook__clusters-toggle.is-active {
  border-color: rgba(47, 109, 246, 0.72);
  color: #2f6df6;
  box-shadow: 0 0 0 2px rgba(47, 109, 246, 0.12);
}

.trading-orderbook__clusters-toggle:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.trading-orderbook__trades-toggle svg,
.trading-orderbook__clusters-toggle svg {
  width: 15px;
  height: 15px;
}

.trading-orderbook__trades-toggle[data-trade-count]:not([data-trade-count=""])::after {
  content: attr(data-trade-count);
  position: absolute;
  right: -4px;
  top: -5px;
  min-width: 10px;
  height: 10px;
  padding: 0 2px;
  border-radius: 999px;
  background: #2f6df6;
  color: #ffffff;
  font-size: 8px;
  font-weight: 900;
  line-height: 10px;
  box-shadow: 0 0 0 1px #f6f8fc;
}

.trading-orderbook__trades-toggle.is-active {
  border-color: rgba(47, 109, 246, 0.72);
  color: #2f6df6;
  box-shadow: 0 0 0 2px rgba(47, 109, 246, 0.12);
}

.trading-orderbook__trades-min,
.trading-orderbook__cluster-tf {
  width: 100%;
  height: 28px;
  border: 1px solid rgba(187, 199, 219, 0.92);
  border-radius: 8px;
  background: #f8fafc;
  color: #111827;
  padding: 0 5px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  outline: none;
}

.trading-orderbook__cluster-tf {
  padding: 0 4px;
  color: #1f2937;
  appearance: none;
  cursor: pointer;
}

.trading-orderbook__group-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 1300;
  display: grid;
  grid-template-columns: repeat(2, 34px);
  overflow: hidden;
  width: 68px;
  border: 1px solid rgba(172, 184, 205, 0.92);
  border-radius: 10px;
  background: #d7dee9;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.trading-orderbook__group-menu.hidden {
  display: none;
}

.trading-orderbook__tool-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 6000;
  display: grid;
  width: 132px;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(172, 184, 205, 0.92);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.trading-orderbook__tool-menu.hidden {
  display: none;
}

.trading-orderbook__tool-menu label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  font-size: 11px;
  font-weight: 850;
}

.trading-orderbook__tool-menu input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #2f6df6;
}

.trading-orderbook__group-input {
  grid-column: 1 / -1;
  width: 100%;
  height: 30px;
  border: 1px solid #2f8cff;
  border-radius: 9px 9px 0 0;
  background: #c8d1e1;
  color: #111827;
  text-align: center;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  outline: none;
}

.trading-orderbook__group-input[readonly] {
  cursor: default;
  border-color: rgba(148, 163, 184, 0.75);
}

.trading-orderbook__group-preset {
  width: 100%;
  height: 30px;
  border: 0;
  border-top: 1px solid rgba(172, 184, 205, 0.72);
  border-right: 1px solid rgba(172, 184, 205, 0.72);
  background: #d3dae6;
  color: #1f2937;
  text-align: center;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  outline: none;
}

.trading-orderbook__group-preset[readonly] {
  cursor: pointer;
}

.trading-orderbook__group-menu.is-editing .trading-orderbook__group-preset {
  background: #ffffff;
  border-color: rgba(47, 140, 255, 0.45);
  cursor: text;
}

.trading-orderbook__group-preset.is-selected {
  background: #bfc9d9;
  color: #111827;
}

.trading-orderbook__group-menu.is-editing .trading-orderbook__group-preset.is-selected {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(47, 140, 255, 0.7);
}

.trading-orderbook__group-preset.is-invalid {
  box-shadow: inset 0 0 0 1px rgba(239, 71, 111, 0.8);
}

.trading-orderbook__group-menu button {
  height: 30px;
  border: 0;
  border-top: 1px solid rgba(172, 184, 205, 0.72);
  border-right: 1px solid rgba(172, 184, 205, 0.72);
  background: #d3dae6;
  color: #1f2937;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.trading-orderbook__group-menu button:nth-child(2n + 1) {
  border-right: 0;
}

.trading-orderbook__group-menu button:hover,
.trading-orderbook__group-menu button.is-selected {
  background: #bfc9d9;
  color: #111827;
}

.trading-orderbook__group-menu button svg {
  width: 16px;
  height: 16px;
}

.trading-orderbook__head,
.trading-orderbook__row {
  display: grid;
  grid-template-columns:
    0
    0
    minmax(0, 1fr)
    var(--orderbook-price-col, 52px);
  align-items: center;
}

.trading-orderbook.has-prints .trading-orderbook__head,
.trading-orderbook.has-prints .trading-orderbook__row {
  grid-template-columns:
    0
    var(--orderbook-print-col, 38px)
    minmax(0, 1fr)
    var(--orderbook-price-col, 52px);
}

.trading-orderbook.has-prints.has-clusters .trading-orderbook__head,
.trading-orderbook.has-prints.has-clusters .trading-orderbook__row {
  grid-template-columns:
    var(--orderbook-cluster-col, 30px)
    var(--orderbook-print-col, 38px)
    minmax(0, 1fr)
    var(--orderbook-price-col, 52px);
  align-items: center;
}

.trading-orderbook__head {
  position: relative;
  z-index: 8;
  height: 20px;
  padding: 0 7px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.9);
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
}

.trading-orderbook__head span:nth-child(4),
.trading-orderbook__row-price {
  text-align: right;
}

.trading-orderbook__head span:nth-child(1) {
  display: grid;
  grid-column: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  min-width: 0;
  overflow: hidden;
  font-size: 8px;
  text-align: center;
}

.trading-orderbook__head span:nth-child(1) > span {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 7px;
  line-height: 20px;
  text-overflow: clip;
  white-space: nowrap;
}

.trading-orderbook:not(.has-clusters) .trading-orderbook__head span:nth-child(1),
.trading-orderbook:not(.has-clusters) .trading-orderbook__cluster-print,
.trading-orderbook:not(.has-clusters) .trading-orderbook__col-resizer--cluster {
  display: none;
}

.trading-orderbook:not(.has-prints) .trading-orderbook__head span:nth-child(2),
.trading-orderbook:not(.has-prints) .trading-orderbook__trade-print,
.trading-orderbook:not(.has-prints) .trading-orderbook__col-resizer--print {
  display: none;
}

.trading-orderbook__head span:nth-child(2) {
  grid-column: 2;
  text-align: center;
}

.trading-orderbook__head span:nth-child(3),
.trading-orderbook__row-volume {
  grid-column: 3;
}

.trading-orderbook__head span:nth-child(3) {
  padding-left: 6px;
}

.trading-orderbook__head span:nth-child(4),
.trading-orderbook__row-price {
  grid-column: 4;
}

.trading-orderbook__head span:nth-child(4) {
  text-align: left;
  padding-left: 6px;
}

.trading-orderbook__col-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 12;
  width: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
}

.trading-orderbook__col-resizer::after {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.66);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.trading-orderbook__col-resizer--print::before {
  content: none;
}

.trading-orderbook__col-resizer:hover::after {
  background: rgba(71, 85, 105, 0.88);
}

.trading-orderbook__col-resizer--print::after {
  background: rgba(100, 116, 139, 0.72);
}

.trading-orderbook__col-resizer--cluster {
  left: calc(7px + var(--orderbook-cluster-col, 30px) - 5px);
}

.trading-orderbook__col-resizer--print {
  left: calc(7px + var(--orderbook-cluster-col, 30px) + var(--orderbook-print-col, 38px) - 5px);
}

.trading-orderbook.has-prints:not(.has-clusters) .trading-orderbook__col-resizer--print {
  left: calc(7px + var(--orderbook-cluster-col, 30px) + var(--orderbook-print-col, 38px) - 5px);
}

.trading-orderbook__col-resizer--price {
  right: calc(var(--orderbook-price-col, 52px) + 2px);
}

.trading-orderbook__rows {
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.85) transparent;
}

.trading-orderbook__row {
  position: relative;
  height: 18px;
  padding: 0 7px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
}

.trading-orderbook__row--ask {
  color: #1f2937;
  background: rgba(239, 71, 111, 0.055);
}

.trading-orderbook__row--bid {
  color: #1f2937;
  background: rgba(19, 185, 129, 0.07);
}

.trading-orderbook__row--neutral {
  color: #1f2937;
  background: rgba(148, 163, 184, 0.06);
}

.trading-orderbook__row--ask .trading-orderbook__row-price {
  color: #dc315a;
}

.trading-orderbook__row--bid .trading-orderbook__row-price {
  color: #08916d;
}

.trading-orderbook__row--neutral .trading-orderbook__row-price {
  color: #334155;
}

.trading-orderbook__row--best-ask,
.trading-orderbook__row--best-bid {
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.12);
}

.trading-orderbook__row--best-ask {
  background: rgba(239, 71, 111, 0.12);
}

.trading-orderbook__row--best-bid {
  background: rgba(19, 185, 129, 0.12);
}

.trading-orderbook__row--round .trading-orderbook__row-price {
  font-weight: 950;
}

.trading-orderbook__cluster-print,
.trading-orderbook__trade-print {
  display: inline-flex;
  position: relative;
  z-index: 4;
  min-width: 0;
  height: 14px;
  align-items: center;
  justify-content: center;
  justify-self: stretch;
  align-self: center;
  overflow: hidden;
  border-radius: 5px;
  font-size: 8px;
  font-weight: 900;
  line-height: 14px;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
  pointer-events: none;
}

.trading-orderbook__cluster-print {
  grid-column: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  border: 1px solid transparent;
  color: #111827;
  font-weight: 850;
  pointer-events: auto;
}

.trading-orderbook__cluster-print i {
  display: inline-flex;
  min-width: 0;
  height: 12px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 4px;
  font-style: normal;
  font-size: 8px;
  line-height: 10px;
  text-overflow: clip;
  white-space: nowrap;
}

.trading-orderbook__cluster-print i.is-buy {
  border-color: rgba(8, 145, 109, 0.36);
  background: rgba(19, 185, 129, 0.12);
  color: #047857;
}

.trading-orderbook__cluster-print i.is-sell {
  border-color: rgba(220, 49, 90, 0.34);
  background: rgba(239, 71, 111, 0.11);
  color: #be123c;
}

.trading-orderbook__cluster-print i.is-max {
  border-width: 2px;
  color: #ffffff;
  font-weight: 950;
  box-shadow: 0 0 10px rgba(15, 23, 42, 0.16);
}

.trading-orderbook__cluster-print i.is-max.is-buy {
  border-color: rgba(8, 145, 109, 0.92);
  background: rgba(8, 145, 109, 0.88);
}

.trading-orderbook__cluster-print i.is-max.is-sell {
  border-color: rgba(220, 49, 90, 0.92);
  background: rgba(220, 49, 90, 0.88);
}

.trading-orderbook__trade-print {
  grid-column: 2;
  width: min(var(--trade-print-width, 0px), calc(100% - 4px));
  color: #ffffff;
  opacity: var(--trade-print-opacity, 0);
  transform: scaleY(var(--trade-print-strength, 1));
  transform-origin: center;
  justify-self: start;
}

.trading-orderbook__row--trade-buy .trading-orderbook__trade-print {
  background: #13b981;
  box-shadow: 0 0 8px rgba(19, 185, 129, 0.62);
}

.trading-orderbook__row--trade-sell .trading-orderbook__trade-print {
  background: #ef476f;
  box-shadow: 0 0 8px rgba(239, 71, 111, 0.62);
}

.trading-orderbook__row--mid {
  height: 20px;
  background: linear-gradient(90deg, rgba(239, 71, 111, 0.9) 0 50%, rgba(19, 185, 129, 0.94) 50% 100%);
  color: #ffffff;
  font-size: 10px;
}

.trading-orderbook__row--mid span:first-child {
  grid-column: 1 / 4;
  padding-left: 4px;
}

.trading-orderbook__row span:not(.trading-orderbook__trade-print):not(.trading-orderbook__cluster-print) {
  position: relative;
  z-index: 1;
}

.trading-orderbook__row-price {
  display: inline-flex;
  height: 100%;
  align-items: center;
  justify-content: flex-end;
  font-weight: 800;
  line-height: 18px;
}

.trading-orderbook__row-volume {
  position: relative;
  display: flex;
  min-width: 0;
  height: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  overflow: hidden;
  padding: 0 1px 0 0;
}

.trading-orderbook__row-volume::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--book-depth-pct, 0%);
  pointer-events: none;
}

.trading-orderbook__row--ask .trading-orderbook__row-volume::before {
  background: rgba(239, 71, 111, 0.18);
}

.trading-orderbook__row--bid .trading-orderbook__row-volume::before {
  background: rgba(19, 185, 129, 0.2);
}

.trading-orderbook__row-volume-text {
  display: inline-flex;
  height: 100%;
  align-items: center;
  position: relative;
  z-index: 1;
  line-height: 18px;
}

.trading-orderbook__row:hover {
  background: rgba(47, 109, 246, 0.08);
}

.trading-orderbook__status {
  min-height: 20px;
  padding: 4px 8px;
  border-top: 1px solid rgba(203, 213, 225, 0.86);
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
}

.trading-orderbook__distance-tooltip {
  position: fixed;
  z-index: 5000;
  display: none;
  min-width: 0;
  transform: translate(-50%, calc(-100% - 6px));
  padding: 2px 6px;
  border: 1px solid rgba(71, 85, 105, 0.28);
  border-radius: 6px;
  background: rgba(248, 250, 252, 0.96);
  color: #1e293b;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
  font-size: 11px;
  font-weight: 950;
  line-height: 1.05;
  pointer-events: none;
  white-space: nowrap;
}

.trading-orderbook__distance-tooltip.is-visible {
  display: block;
}

[data-trading-market-theme="dark"] .trading-orderbook__toolbar {
  border-bottom-color: rgba(51, 65, 85, 0.82);
  background: #111827;
}

[data-trading-market-theme="dark"] .trading-orderbook__group-toggle,
[data-trading-market-theme="dark"] .trading-orderbook__trades-toggle,
[data-trading-market-theme="dark"] .trading-orderbook__clusters-toggle,
[data-trading-market-theme="dark"] .trading-orderbook__center {
  border-color: rgba(71, 85, 105, 0.92);
  background: #182235;
  color: #dbe7f3;
}

[data-trading-market-theme="dark"] .trading-orderbook__latency,
[data-trading-market-theme="dark"] .trading-orderbook__head,
[data-trading-market-theme="dark"] .trading-orderbook__status {
  color: #94a3b8;
}

[data-trading-market-theme="dark"] .trading-orderbook__group-menu,
[data-trading-market-theme="dark"] .trading-orderbook__tool-menu {
  border-color: rgba(71, 85, 105, 0.86);
  background: #182235;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

[data-trading-market-theme="dark"] .trading-orderbook__tool-menu label {
  color: #dbe7f3;
}

[data-trading-market-theme="dark"] .trading-orderbook__trades-min,
[data-trading-market-theme="dark"] .trading-orderbook__cluster-tf,
[data-trading-market-theme="dark"] .trading-orderbook__group-preset,
[data-trading-market-theme="dark"] .trading-orderbook__group-menu button {
  border-color: rgba(71, 85, 105, 0.72);
  background: #1e293b;
  color: #e5e7eb;
}

[data-trading-market-theme="dark"] .trading-orderbook__group-preset.is-selected,
[data-trading-market-theme="dark"] .trading-orderbook__group-menu button:hover,
[data-trading-market-theme="dark"] .trading-orderbook__group-menu button.is-selected {
  background: #2b3a52;
  color: #ffffff;
}

[data-trading-market-theme="dark"] .trading-orderbook__head {
  border-bottom-color: rgba(51, 65, 85, 0.82);
}

[data-trading-market-theme="dark"] .trading-orderbook__row {
  border-bottom-color: rgba(30, 41, 59, 0.92);
}

[data-trading-market-theme="dark"] .trading-orderbook__row--ask {
  color: #e5e7eb;
  background: rgba(239, 71, 111, 0.09);
}

[data-trading-market-theme="dark"] .trading-orderbook__row--bid {
  color: #e5e7eb;
  background: rgba(19, 185, 129, 0.105);
}

[data-trading-market-theme="dark"] .trading-orderbook__row--neutral {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.07);
}

[data-trading-market-theme="dark"] .trading-orderbook__row--ask .trading-orderbook__row-price {
  color: #fb7185;
}

[data-trading-market-theme="dark"] .trading-orderbook__row--bid .trading-orderbook__row-price {
  color: #34d399;
}

[data-trading-market-theme="dark"] .trading-orderbook__row--neutral .trading-orderbook__row-price {
  color: #cbd5e1;
}

[data-trading-market-theme="dark"] .trading-orderbook__row--best-ask,
[data-trading-market-theme="dark"] .trading-orderbook__row--best-bid {
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.12);
}

[data-trading-market-theme="dark"] .trading-orderbook__row:hover {
  background: rgba(47, 109, 246, 0.18);
}

[data-trading-market-theme="dark"] .trading-orderbook__status {
  border-top-color: rgba(51, 65, 85, 0.82);
}

[data-trading-market-theme="dark"] .trading-orderbook__distance-tooltip {
  border-color: rgba(148, 163, 184, 0.38);
  background: rgba(15, 23, 36, 0.96);
  color: #e5e7eb;
}

.trading-orderbook-splitter {
  position: relative;
  z-index: 2600;
  min-width: 9px;
  margin-left: -1px;
  margin-right: -1px;
  background: rgba(203, 213, 225, 0.92);
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.7),
    inset -1px 0 0 rgba(100, 116, 139, 0.28);
  cursor: col-resize;
}

.trading-orderbook-splitter::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.42);
  pointer-events: none;
}

.trading-orderbook-splitter:hover {
  background: rgba(47, 109, 246, 0.2);
}

.trading-orderbook-splitter:hover::after {
  background: rgba(47, 109, 246, 0.8);
}

.trading-workspace-charts {
  position: relative;
  z-index: 1;
  min-height: 0;
  height: 100%;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
  overflow: hidden;
}

.trading-workspace-pane {
  position: relative;
  min-height: 0;
  border: 1px solid rgba(24, 33, 52, 0.78);
  border-radius: 14px;
  cursor: default;
  overflow: hidden;
}

.trading-workspace-pane .chart-workspace-pane__surface {
  flex: 1 1 0;
  min-height: 120px;
  isolation: isolate;
}

.trading-workspace-pane .chart-workspace-pane__chart {
  z-index: 1;
}

.trading-workspace-pane .chart-workspace-pane__volume {
  z-index: 2;
}

.trading-workspace-pane .chart-workspace-pane__thirty-dots {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.trading-workspace-pane .chart-workspace-pane__profile {
  z-index: 4;
  pointer-events: none;
}

.trading-ticket-lines {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: 11;
  overflow: visible;
  pointer-events: none;
}

.trading-ticket-lines.hidden {
  display: none;
}

.trading-ticket-line {
  vector-effect: non-scaling-stroke;
  stroke-width: 1;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.16));
}

.trading-ticket-line--tp {
  stroke: #2563eb;
}

.trading-ticket-line--sl {
  stroke: #ef476f;
}

.trading-ticket-line--entry {
  stroke: #0f766e;
}

.trading-ticket-line--breakeven {
  stroke: #8b5e34;
  stroke-dasharray: 7 4;
}

.trading-ticket-line--planned-entry {
  stroke: rgba(15, 118, 110, 0.86);
  stroke-width: 1.75;
  stroke-dasharray: 7 4;
}

.trading-ticket-line--planned-breakeven {
  stroke: #14b8a6;
  stroke-dasharray: 3 3;
}

.trading-ticket-line--planned-liquidation {
  stroke: #f59e0b;
  stroke-dasharray: 4 4;
}

.trading-ticket-line--orderbook {
  stroke: rgba(100, 116, 139, 0.76);
  stroke-dasharray: 5 4;
}

.trading-ticket-line-hit {
  vector-effect: non-scaling-stroke;
  stroke: transparent;
  stroke-width: 15;
  cursor: ns-resize;
  pointer-events: stroke;
}

.trading-ticket-line-label {
  font-size: 10px;
  font-weight: 900;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}

.trading-ticket-line-label--tp {
  fill: #2563eb;
}

.trading-ticket-line-label--sl {
  fill: #ef476f;
}

.trading-ticket-line-label--entry {
  fill: #0f766e;
}

.trading-ticket-line-label--breakeven {
  fill: #8b5e34;
}

.trading-ticket-line-label--planned-breakeven {
  fill: #14b8a6;
}

.trading-ticket-line-label--planned-liquidation {
  fill: #d97706;
}

.trading-ticket-line-distance {
  pointer-events: none;
}

.trading-ticket-line-distance__box {
  fill: rgba(248, 250, 252, 0.95);
  stroke: rgba(148, 163, 184, 0.38);
  stroke-width: 1;
}

.trading-ticket-line-distance__text {
  fill: #172033;
  font-size: 9px;
  font-weight: 950;
  text-anchor: middle;
  dominant-baseline: central;
  alignment-baseline: central;
  paint-order: stroke;
  stroke: rgba(248, 250, 252, 0.95);
  stroke-width: 2px;
  stroke-linejoin: round;
}

.trading-ticket-line-distance__prefix {
  font-size: 7.5px;
  font-weight: 950;
  dominant-baseline: central;
  alignment-baseline: central;
  opacity: 0.82;
}

.trading-ticket-line-distance__prefix-text {
  fill: #64748b;
  font-size: 7.5px;
  font-weight: 950;
  text-anchor: start;
  dominant-baseline: central;
  alignment-baseline: central;
  paint-order: stroke;
  stroke: rgba(248, 250, 252, 0.95);
  stroke-width: 2px;
  stroke-linejoin: round;
  pointer-events: none;
}

.trading-ticket-line-inline-label {
  fill: #172033;
  font-size: 9.5px;
  font-weight: 950;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}

.trading-ticket-line-inline-label--entry,
.trading-ticket-line-inline-label--planned-entry {
  fill: #0f766e;
}

.trading-ticket-line-inline-label--planned-entry {
  opacity: 0.95;
}

.trading-ticket-line-inline-label--planned-breakeven {
  fill: #0f766e;
}

.trading-ticket-line-inline-label--planned-liquidation {
  fill: #d97706;
}

.trading-ticket-line-distance--tp .trading-ticket-line-distance__box {
  stroke: rgba(37, 99, 235, 0.48);
}

.trading-ticket-line-distance--sl .trading-ticket-line-distance__box {
  stroke: rgba(239, 71, 111, 0.58);
}

.trading-ticket-line-distance--entry .trading-ticket-line-distance__box {
  stroke: rgba(15, 118, 110, 0.56);
}

.trading-ticket-line-distance--breakeven .trading-ticket-line-distance__box {
  stroke: rgba(139, 94, 52, 0.62);
}

.trading-ticket-line-distance--planned-entry .trading-ticket-line-distance__box {
  stroke: rgba(15, 118, 110, 0.42);
}

.trading-ticket-line-distance--planned-breakeven .trading-ticket-line-distance__box {
  stroke: rgba(20, 184, 166, 0.6);
}

.trading-ticket-line-distance--planned-liquidation .trading-ticket-line-distance__box {
  stroke: rgba(245, 158, 11, 0.62);
}

.trading-ticket-line-distance--orderbook .trading-ticket-line-distance__box {
  fill: rgba(248, 250, 252, 0.88);
  stroke: rgba(100, 116, 139, 0.48);
}

[data-trading-market-theme="dark"] .trading-ticket-line-label {
  stroke: rgba(10, 16, 28, 0.86);
}

[data-trading-market-theme="dark"] .trading-ticket-line-inline-label {
  stroke: rgba(10, 16, 28, 0.86);
}

[data-trading-market-theme="dark"] .trading-ticket-line-distance__box {
  fill: rgba(15, 23, 36, 0.92);
  stroke: rgba(148, 163, 184, 0.46);
}

[data-trading-market-theme="dark"] .trading-ticket-line-distance__text {
  fill: rgba(248, 250, 252, 0.96);
  stroke: rgba(15, 23, 36, 0.92);
}

[data-trading-market-theme="dark"] .trading-ticket-line-distance__prefix-text {
  fill: rgba(203, 213, 225, 0.92);
  stroke: rgba(15, 23, 36, 0.92);
}

[data-trading-density-row] {
  pointer-events: auto;
  cursor: pointer;
}

.trading-density-menu {
  width: 286px;
}

.trading-density-field {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
}

.trading-density-field input {
  min-width: 0;
  height: 26px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: #e5edf7;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
  outline: none;
}

[data-chart-theme="light"] .trading-density-field {
  color: #64748b;
}

[data-chart-theme="light"] .trading-density-field input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #182235;
}

.trading-density-exchanges {
  margin-top: 10px;
}

.trading-density-save-status {
  min-height: 15px;
  margin-top: 6px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.trading-density-save-status.is-ok {
  color: #34d399;
}

.trading-density-save-status.is-bad {
  color: #fb7185;
}

.trading-density-save-status.is-pending {
  color: #fbbf24;
}

[data-chart-theme="light"] .trading-density-save-status {
  color: #64748b;
}

[data-chart-theme="light"] .trading-density-save-status.is-ok {
  color: #059669;
}

[data-chart-theme="light"] .trading-density-save-status.is-bad {
  color: #dc315a;
}

.chart-workspace__density-exchange.is-current::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 3px;
  height: 2px;
  border-radius: 999px;
  background: rgba(47, 109, 246, 0.78);
}

.trading-workspace-pane .chart-workspace-pane__drawings {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: 12;
  overflow: visible;
  pointer-events: auto;
  touch-action: none;
}

.trading-workspace-page[data-drawing-tool="cursor"] .trading-workspace-pane .chart-workspace-pane__drawings {
  pointer-events: none;
}

.trading-workspace-page:not([data-drawing-tool="cursor"]) .trading-workspace-pane .chart-workspace-pane__drawings {
  cursor: crosshair;
  pointer-events: all;
}

.trading-workspace-page:not([data-drawing-tool="cursor"]) .trading-workspace-pane,
.trading-workspace-page:not([data-drawing-tool="cursor"]) .trading-workspace-pane .chart-workspace-pane__surface,
.trading-workspace-page:not([data-drawing-tool="cursor"]) .trading-workspace-pane .chart-workspace-pane__indicator-panes {
  cursor: crosshair;
}

.trading-workspace-pane .chart-workspace-pane__indicator-panes {
  flex: 0 1 auto;
  height: var(--trading-indicator-stack-height, auto);
  max-height: none;
  overflow: hidden;
  overscroll-behavior: contain;
  padding-bottom: 0;
  background: inherit;
  position: relative;
  z-index: 6;
}

.trading-workspace-pane .chart-workspace-pane__indicator-pane {
  min-height: var(--trading-indicator-pane-height, 46px);
  height: var(--trading-indicator-pane-height, 46px);
  flex: 0 0 var(--trading-indicator-pane-height, 46px);
}

.trading-workspace-pane .chart-workspace-pane__indicator-svg {
  height: var(--trading-indicator-pane-height, 46px);
}

[data-chart-theme="light"] .trading-workspace-pane {
  border-color: rgba(180, 198, 228, 0.92);
}

.trading-workspace-pane.is-active {
  outline: 0;
}

.trading-workspace-pane.is-active::before {
  inset: 1px;
  border-radius: 12px;
}

.trading-workspace-pane:not(.is-active) {
  opacity: 0.94;
}

[data-trading-market-theme="dark"] .trading-workspace-pane .chart-workspace-pane__tf-watermark {
  color: rgba(226, 232, 240, 0.22);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.38);
}

.trading-workspace-pane .chart-workspace-pane__price {
  right: 8px;
  min-width: 48px;
  max-width: 56px;
  align-items: center;
  padding-inline: 4px;
}

.trading-workspace-charts .chart-workspace__pane-splitter {
  background: var(--line);
}

.trading-workspace-charts .chart-workspace__pane-splitter:hover {
  background: rgba(47, 109, 246, 0.48);
}

.trading-workspace-techdata {
  top: 9px;
  left: 10px;
  right: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: auto;
  max-width: min(720px, calc(100% - 110px));
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: none;
}

.trading-techdata-lines {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 170px;
  margin-top: 2px;
}

[data-trading-market-theme="dark"] .trading-workspace-techdata {
  color: rgba(226, 232, 240, 0.96);
}

[data-trading-market-theme="dark"] .trading-workspace-techdata .chart-workspace-pane__techdata-line {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72);
}

[data-trading-market-theme="dark"] .trading-workspace-techdata .chart-workspace-pane__techdata-label,
[data-trading-market-theme="dark"] .trading-workspace-techdata .chart-workspace-pane__techdata-meta {
  color: rgba(203, 213, 225, 0.9);
}

[data-trading-market-theme="dark"] .trading-workspace-techdata .chart-workspace-pane__techdata-value {
  color: rgba(248, 250, 252, 0.98);
}

[data-trading-market-theme="dark"] .trading-workspace-techdata .chart-workspace-pane__techdata-value.is-positive,
[data-trading-market-theme="dark"] .trading-workspace-techdata .chart-workspace-pane__techdata-meta.is-positive {
  color: #34d399;
}

[data-trading-market-theme="dark"] .trading-workspace-techdata .chart-workspace-pane__techdata-value.is-negative,
[data-trading-market-theme="dark"] .trading-workspace-techdata .chart-workspace-pane__techdata-meta.is-negative {
  color: #fb7185;
}

.trading-status {
  height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  color: var(--trade-muted);
  background: rgba(15, 23, 42, 0.72);
  font-size: 11px;
  line-height: 1;
}

.trading-status.is-ok {
  color: #a7f3d0;
  border-color: rgba(19, 185, 129, 0.35);
}

.trading-status.is-warn {
  color: #f9d48b;
  border-color: rgba(245, 184, 75, 0.38);
}

.trading-status.is-bad {
  color: #fecdd3;
  border-color: rgba(239, 71, 111, 0.42);
}

.trading-chart {
  position: absolute;
  inset: 0;
}

.trading-pane-empty {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 8;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .trading-main {
    height: auto;
    min-height: 0;
  }

  .trading-workspace-page {
    height: 100vh;
    min-height: 0;
  }

  .trading-workspace-header {
    flex-wrap: wrap;
    height: auto;
    min-height: 96px;
    padding: 8px;
  }

  .trading-workspace-left {
    min-height: 620px;
  }
}
