/* === TRADING PAGE LAYOUT === */

.trading-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  background-color: #F5F5F5;
  padding: 5px;
  gap: 5px;
}

/* === LEFT PANEL (Order Entry) === */
.order-panel {
  width: var(--left-panel-width);
  min-width: var(--left-panel-width);
  background-color: #FFFFFF;
  border-radius: 10px;
  
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: var(--space-12) var(--space-16);
}

.order-panel__margin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px;
  margin-bottom: var(--space-12);
}

.order-panel__margin-badges {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.order-panel__margin-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #848E9C;
  cursor: default;
  flex-shrink: 0;
  line-height: 0;
}

.order-panel__icon {
  width: 16px;
  height: 16px;
  color: #9c9c9c;
  display: block;
}

.order-panel__margin-badge {
  background-color: #ededed;
  border-radius: 4px;
  padding: 4px 15px;
  font-size: 12px;
  font-weight: 600;
  color: #474D57;
  cursor: pointer;
  line-height: 1.4;
}

.order-panel__margin-badge--active {
  color: #1E2329;
  border-color: #474D57;
}

.order-panel__type-tabs {
  display: flex;
  align-items: center;
  font-weight: 500;
  gap: var(--space-16);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-12);
}

.order-panel__type-tab {
  display: flex;
  align-items: center;
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  padding: var(--space-8) 0;
  cursor: default;
  position: relative;
  white-space: nowrap;
}

.order-panel__type-tab--active {
  color: var(--color-text-primary);
  font-weight: 500;
}

.order-panel__type-tab--active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 30%;
  margin-inline:auto ;
  right: 0;
  height: 2px;
  background: var(--color-primary);
}

.order-panel__type-info {
  margin-left: auto;
  display: flex;
  align-items: center;
  color: #848E9C;
  cursor: default;
  line-height: 0;
  flex-shrink: 0;
}

.order-panel__avbl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  
  margin-bottom: var(--space-12);
}

.order-panel__avbl-left {
  display: flex;
  color: #9c9c9c;
  align-items: center;
  gap: 3px;
}
#order-avbl{
  color: black;
}
.order-panel__avbl-value {
  color: var(--color-text-primary);
}
.order-avbl{color: black;}
.order-panel__avbl-icon {
  cursor: default;
  display: inline-flex;
  align-items: center;
  line-height: 0;
  flex-shrink: 0;
}

.order-panel__avbl-icon--transfer {
  margin-left: 4px;
  color: #F0B90B;
}

.order-panel__avbl-icon--calc {
  color: #848E9C;
}

/* Input groups */
.order-panel__input-group {
  margin-bottom: var(--space-12);
  position: relative;
}

.order-panel__input-label {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-4);
}

.order-panel__input-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid #EAECEF;
  border-radius: var(--radius-md);
  background-color: #FFFFFF;
  overflow: hidden;
  transition: border-color 0.15s;
}

.order-panel__input-wrapper:focus-within {
  border-color: var(--color-primary);
}

.order-panel__input {
  flex: 1;
  border: none;
  background-color: transparent;
  padding: 8px 12px;
  font-size: var(--font-size-md);
  color: #1E2329;
  min-width: 0;
}

.order-panel__input::placeholder {
  color: var(--color-text-tertiary);
}

.order-panel__input-suffix {
  padding: 0 12px;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.order-panel__input-suffix :not(span){
  color: black Im !important;
}
.positions-table__action-input::-webkit-outer-spin-button,
.positions-table__action-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
.positions-table__action-input {
  -moz-appearance: textfield;
}

.order-panel__input-suffix-arrow {
  font-size: 10px;
  display: flex;
  align-items: center;
  color: var(--color-text-tertiary);
}

/* Slider (visual only) */
.order-panel__slider {
  margin-bottom: var(--space-16);
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
}

.order-panel__slider-track {
  width: 100%;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  position: relative;
}

.order-panel__slider-dots {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  pointer-events: none;
}

.order-panel__slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 0;
  background: #FFFFFF;
  border: 1.5px solid #EAECEF;
  transform: rotate(45deg);
  flex-shrink: 0;
}

.order-panel__slider-dot--active {
  width: 11px;
  height: 11px;
  border: 2px solid #1E2329;
  background: #FFFFFF;
  z-index: 1;
}

/* Checkboxes */
.order-panel__checkboxes {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  margin-bottom: var(--space-16);
}

.order-panel__checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.order-panel__checkbox input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin: 0;
  accent-color: black;
  cursor: pointer;
}

.order-panel__tpsl-fields {
  
  overflow: hidden;
  display: none;
  max-height: 0;
  transition: max-height 0.25s ease, opacity 0.25s ease;
  opacity: 0;
}

.order-panel__input-group--tpsl {
  margin-top: var(--space-8);
}

.order-panel__input-group--tpsl + .order-panel__input-group {
  margin-top: var(--space-8);
}

.order-panel__tpsl-fields--visible {
  max-height: 200px;
  opacity: 1;
  display: block;
}

/* Buttons */
.order-panel__buttons {
  display: flex;
  gap: var(--space-8);
  margin-bottom: var(--space-16);
}

.order-panel__btn {
  flex: 1;
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-panel__btn:hover {
  opacity: 1;
}

.order-panel__btn:active {
  opacity: 0.75;
}

.order-panel__btn--long {
  background: var(--color-long);
}

.order-panel__btn--long:hover {
  background: #0BB574;
}

.order-panel__btn--short {
  background: var(--color-short);
}

.order-panel__btn--short:hover {
  background: #E03B52;
}

.order-panel__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Calculated fields */
.order-panel__calcs {
  display: flex;
  gap: 0;
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid #EAECEF;
}

.order-panel__calcs-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.order-panel__calcs-col:first-child {
  padding-right: var(--space-4);
  margin-right: var(--space-4);
}
.order-panel__calcs-col:nth-child(2) .order-panel__calc-row{
  justify-content: flex-end
}
.order-panel__calc-row {
  display: flex;
  gap: 3px;
  align-items: center;
}

.order-panel__calc-label {
  color: var(--color-text-tertiary);
}

.order-panel__calc-value {
  text-align: right;
  color: black;
  font-weight: 400;
}

.order-panel__fee-level {
  font-size: 12px;
  color: black;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: auto;
  padding-top: 12px;
}
.order-panel__fee-level svg {
  color: #9c9c9c;
}


.order-panel__error {
  font-size: var(--font-size-sm);
  color: var(--color-short);
  margin-top: -8px;
  margin-bottom: var(--space-8);
}

/* === MAIN CONTENT AREA === */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background-color: #F5F5F5;
}

/* Trading pair + Account row */
.trading-info {
  display: flex;
  gap: 2px;
  align-items: flex-start;
  
  border-bottom: 1px solid #EAECEF;
}

.account-block {
  padding: var(--space-12) var(--space-16);
  background-color: white;
  border-right: 1px solid #EAECEF;
  min-width: 260px;
  flex-shrink: 0;
  border-radius: 8px;
}

.account-block__header {
  display: flex;
  border-bottom: 1px solid #EAECEF;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.account-block__title {
  font-size: var(--font-size-md);
  color: var(--color-text-primary);
}

.account-block__switch {
  font-size: 12px;
  color: #C99400;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.account-block__currency {
  font-size: 13px;
  color: #1E2329;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.account-block__row {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
}

.account-block__label {
  color: var(--color-text-tertiary);
}

.account-block__value {
  color: var(--color-text-primary);
  font-weight: 500;
}

/* Trading pair block */
.pair-block {
  flex: 1;
  padding: var(--space-8) var(--space-16);
  display: flex;
  align-items: center;
  gap: var(--space-20);
  background-color: white;
  height: 50% ;
  margin-bottom: 2px;
  border-radius: 8px;
}

.pair-block__selector {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
#pair-coin-icon{display: flex;align-items: center;}

.pair-block__star {
  display: flex;
  align-items: center;
  color: #F0B90B;
  font-size: 16px;
  border: 1px solid #ededed;
  border-radius: var(--radius-md);
  padding: 2px;
}

.pair-block__coin-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #F7931A;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
  overflow: hidden;
}

.pair-block__coin-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pair-block__symbol {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text-primary);
}

.pair-block__perp {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  border: 1px solid #EAECEF;
  border-radius: 4px;
  padding: 0 4px;
  background-color: #ededed;
  line-height: 18px;
  margin-left: var(--space-4);
}

.pair-block__chevron {
  display: flex;
  align-items: center;
  font-size: 10px;
  color: var(--color-text-tertiary);
  margin-left: var(--space-4);
}

/* Coin dropdown */
.pair-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: var(--space-8);
  background-color: #FFFFFF;
  border: 1px solid #EAECEF;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 500;
  min-width: 220px;
  max-height: 300px;
  overflow-y: auto;
}

.pair-dropdown[hidden] {
  display: none;
}

.pair-dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-12);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: background 0.1s;
}

.pair-dropdown__item:hover {
  background-color: #F5F5F5;
}

.pair-dropdown__item--active {
  background-color: #FEF6D8;
}

.pair-dropdown__item-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.pair-dropdown__item-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.pair-dropdown__item-icon .pair-block__coin-icon {
  width: 100%;
  height: 100%;
  font-size: 9px;
}

/* Price display */
.pair-block__price {
  font-size: 22px;
  font-weight: 500;
  flex-shrink: 0;
}

.pair-block__change {
  font-size: 12px;
  display: flex;
  flex-direction: row;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

/* Metric bar (chevron | scroll | chevron) */
.metric-bar {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.metric-bar__chevron {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: #474D57;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.metric-bar__chevron--left {
  left: 0;
  background: linear-gradient(to right, #FFFFFF 42.24%, transparent 95.69%);
}

.metric-bar__chevron--right {
  right: 0;
  background: linear-gradient(to left, #FFFFFF 42.24%, transparent 95.69%);
}

.metric-bar__chevron--hidden {
  display: none;
}

/* Metrics */
.pair-block__metrics {
  display: flex;
  gap: 24px;
  max-width: 480px;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  font-size: 12px;
  flex-shrink: 0;
}

.pair-block__metric {
  display: flex;
  flex-direction: column;
}

.pair-block__metrics::-webkit-scrollbar { display: none; }

.pair-block__metric-label {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-xs);
  white-space: nowrap;
}

.pair-block__metric-value {
  color: var(--color-text-primary);
  white-space: nowrap;
  font-size: var(--font-size-sm);
}

/* === USER PANEL (positions / history) === */
.user-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background-color: #FFFFFF;
  border-radius: 10px;
  overflow: hidden;
  
}

.user-panel__head {
  position: relative;
  border-bottom: 1px solid #EAECEF;
}

.user-panel__tabs {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.user-panel__tabs::-webkit-scrollbar {
  display: none;
}

.user-panel__tab {
  font-size: 14px;
  font-weight: 500;
  color: #848E9C;
  padding: 12px 0;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color 0.15s;
  background: transparent;
  border: none;
  font-family: inherit;
  line-height: 22px;
}

.user-panel__tab:hover:not(:disabled) {
  color: #1E2329;
}

.user-panel__tab--active {
  color: #1E2329;
}

.user-panel__tab--active::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 20px ;
  margin-inline: auto;
  left: 0;
  right: 0;
  height: 2px;
  background: #F0B90B;
}

.user-panel__tab--disabled {
  cursor: default;
  color: #848E9C;
}

.user-panel__pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.positions-toolbar {
  position: absolute;
  top: 2px;
  right: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  height: 40px;
  gap: 16px;
}

.positions-toolbar__checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #1E2329;
  cursor: default;
  user-select: none;
}

.positions-toolbar__checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.positions-toolbar__checkbox-box {
  width: 16px;
  height: 16px;
  border: 1px solid #EAECEF;
  border-radius: 2px;
  background: #FFFFFF;
  flex-shrink: 0;
}

.positions-toolbar__menu {
  display: flex;
  align-items: center;
  color: #848E9C;
  cursor: default;
  line-height: 0;
}

.positions-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
  position: relative;
}

.positions-header,
.positions-row {
  display: flex;
  align-items: center;
  
  padding: 0 16px;
}

.positions-header {
  height: 32px;
  margin-top: 4px;
  position: sticky;
  top: 0;
  background: #FFFFFF;
  z-index: 5;
}

.positions-header__col,
.positions-row__col {
  flex-shrink: 0;
  padding: 0 8px;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.positions-header__col:first-child,
.positions-row__col:first-child {
  padding-left: 0;
}

.positions-header__col {
  color: #848E9C;
  font-weight: 400;
}

.positions-header__col--symbol,
.positions-row__col--symbol { width: 140px; flex: 1 0 140px; }

.positions-header__col--size,
.positions-row__col--size { width: 110px; flex: 1 0 110px; }

.positions-header__col--entry,
.positions-row__col--entry { width: 110px; flex: 1 0 110px; }

.positions-header__col--mark,
.positions-row__col--mark { width: 110px; flex: 1 0 110px; }

.positions-header__col--pnl,
.positions-row__col--pnl { width: 160px; flex: 1 0 160px; position: relative; }

.positions-header__col--liq,
.positions-row__col--liq { width: 110px; flex: 1 0 110px; }

.positions-table__liq {
  color: var(--color-short);
}

.positions-header__col--tpsl,
.positions-row__col--tpsl { width: 130px; flex: 1 0 130px; }

.positions-header__col--close,
.positions-row__col--close { width: 360px; flex: 1 0 360px; }

.positions-header__col--close {
  display: flex;
  align-items: center;
  gap: 8px;
}

.positions-header__col--close span:not(.positions-header__sep) {
  color: #C99400;
  cursor: pointer;
}

.positions-header__sep {
  width: 1px;
  height: 16px;
  background: #EAECEF;
  flex-shrink: 0;
}



.positions-row {
  min-height: 52px;
  border-bottom: 1px solid #EAECEF;
  font-weight: 400;
  color: #1E2329;
}

.positions-row__symbol {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  padding-left: 6px;
}

.positions-row__direction-bar {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 32px;
  border-radius: 1px;
  flex-shrink: 0;
}

.positions-row__direction-bar--long {
  background: #0ECB81;
}

.positions-row__direction-bar--short {
  background: #F6465D;
}

.positions-row__symbol-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.positions-row__symbol-name {
  font-weight: 600;
  font-size: 12px;
}

.positions-row__symbol-meta {
  display: flex;
  align-items: center;
  gap: 4px;
}

.positions-row__tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 400;
  color: #474D57;
  background: #EDEDED;
  border-radius: 2px;
  padding: 0 4px;
  line-height: 16px;
}

/* === POSITIONS TABLE (legacy + row helpers) === */
.positions-area {
  flex: 1;
  overflow: auto;
  background-color: #FFFFFF;
}

.positions-table {
  width: 100%;
  font-size: var(--font-size-sm);
}

.positions-table th {
  text-align: left;
  font-weight: 400;
  color: var(--color-text-tertiary);
  padding: var(--space-8) var(--space-12);
  border-bottom: 1px solid #EAECEF;
  white-space: nowrap;
  position: sticky;
  top: 0;
  background-color: #FFFFFF;
  z-index: 5;
}

.positions-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #EAECEF;
  white-space: nowrap;
  font-weight: 600;
  vertical-align: middle;
}

.positions-table__symbol {
  font-weight: 600;
  color: var(--color-text-primary);
}

.positions-table__size {
  display: flex;
  flex-direction: column;
  font-weight: 500;
  line-height: 1.3;
}

.positions-table__size.text-long,
.positions-table__size.text-long .positions-table__size-value,
.positions-table__size.text-long .positions-table__size-unit,
.positions-table__size-value.text-long,
.positions-table__size-unit.text-long {
  color: var(--color-long);
}

.positions-table__size.text-short,
.positions-table__size.text-short .positions-table__size-value,
.positions-table__size.text-short .positions-table__size-unit,
.positions-table__size-value.text-short,
.positions-table__size-unit.text-short {
  color: var(--color-short);
}

.positions-table__size-value {
  font-weight: 400;
}

.positions-table__size-unit {
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.positions-table__pnl-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.positions-table__pnl {
  display: flex;
  flex-direction: column;
}

.positions-table__pnl-value {
  font-weight: 400;
}

.positions-table__pnl-roi {
  font-size: var(--font-size-xs);
}

.positions-table__tpsl {
  display: flex;
  align-items: center;
  
  width: 100%;
  gap: 8px;
}

.positions-table__tpsl-values {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  line-height: 1.3;
}

.positions-table__tpsl-edit {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  opacity: 0.6;
  cursor: pointer;
}

.positions-table__share {
  cursor: pointer;
  color: #848E9C;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
  border: none;
  background: none;
  padding: 0;
}

.positions-table__action {
  display: flex;
  align-items: center;
  gap: 6px;
}

.positions-table__action-btn {
  font-size: var(--font-size-sm);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.positions-table__action-btn--market,
.positions-table__action-btn--limit {
  color: #C99400;
}
.positions-table__action-input {
  width: 68px;
  border: 1px solid #dcdee1;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 12px;
  text-align: right;
  color: #1E2329;
  background: #fff;
}

.positions-table__close-btn {
  font-size: var(--font-size-xs);
  color: var(--color-text-inverse);
  background: var(--color-text-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.positions-table__close-btn:hover {
  background: var(--color-text-secondary);
}

/* Empty state */
.positions-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 108px 24px 48px;
  color: #848E9C;
  font-size: 14px;
  line-height: 22px;
  min-width: 100%;
}

.positions-empty__svg {
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  color: #848E9C;
}

.positions-empty__text {
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  color: #848E9C;
}

.positions-empty__icon {
  font-size: 40px;
  margin-bottom: var(--space-12);
  opacity: 0.4;
}

/* === HISTORY PANEL === */
.history-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 0 16px;
}

.history-panel__note {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  font-size: 12px;
  color: #707A8A;
  line-height: 1.4;
}

.history-panel__note-star {
  flex-shrink: 0;
}

.history-panel__note-text {
  flex: 1;
  max-width: fit-content;
}

.history-panel__refresh {
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  color: #C99400;
  cursor: default;
  font-family: inherit;
  white-space: nowrap;
}

.history-panel__filters {
  display: flex;
  align-items: center;
  height: 40px;
  gap: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.history-panel__period-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.history-panel__period {
  border: none;
  background: transparent;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  color: #707A8A;
  cursor: pointer;
  font-family: inherit;
  line-height: 18px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.history-panel__period:hover {
  color: #1E2329;
}

.history-panel__period--active {
  background: #F5F5F5;
  color: #1E2329;
}

.history-panel__divider {
  width: 1px;
  height: 16px;
  background: #EAECEF;
  margin: 0 6px;
  flex-shrink: 0;
}

.history-panel__time-label {
  font-size: 12px;
  font-weight: 500;
  color: #707A8A;
  margin-right: 4px;
  flex-shrink: 0;
}

.history-panel__date-range {
  display: flex;
  align-items: center;
  height: 24px;
  border-radius: 6px;
  padding: 0 4px;
  flex-shrink: 0;
}

.history-panel__date-range:hover {
  background: #F5F5F5;
}

.history-panel__date-input {
  width: 70px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  color: #1E2329;
  padding: 0;
  cursor: default;
  font-family: inherit;
}

.history-panel__date-input::placeholder {
  color: #707A8A;
}

.history-panel__date-arrow {
  width: 16px;
  height: 16px;
  color: #848E9C;
  flex-shrink: 0;
}

.history-panel__date-icon {
  width: 16px;
  height: 16px;
  color: #848E9C;
  margin-left: 8px;
  flex-shrink: 0;
}

.history-panel__select {
  display: inline-flex;
  align-items: center;
  height: 24px;
  max-width: 120px;
  padding: 0 0 0 4px;
  margin-left: 4px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: #1E2329;
  cursor: default;
  font-family: inherit;
  flex-shrink: 0;
}

.history-panel__select span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-panel__chevron {
  width: 16px;
  height: 16px;
  color: #848E9C;
  flex-shrink: 0;
}

.history-panel__actions {
  display: flex;
  align-items: center;
  height: 24px;
  margin-left: 4px;
  flex-shrink: 0;
}

.history-panel__btn {
  border: none;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: default;
  font-family: inherit;
  line-height: 18px;
}

.history-panel__btn--search {
  background: #EAECEF;
  border: 1px solid #EAECEF;
  color: #1E2329;
  margin-right: 4px;
}

.history-panel__btn--reset {
  background: transparent;
  color: #1E2329;
}

.history-panel__content {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.history-panel__content .history-table {
  width: 100%;
}

.history-panel__content .positions-empty {
  min-width: auto;
}

.positions-toolbar--history {
  gap: 0;
}

.positions-toolbar--history .positions-toolbar__menu {
  display: none;
}

/* History table */
.history-table {
  width: 100%;
  font-size: var(--font-size-sm);
}

.history-table th {
  text-align: left;
  font-weight: 400;
  color: var(--color-text-tertiary);
  padding: var(--space-8) var(--space-12);
  border-bottom: 1px solid #EAECEF;
  white-space: nowrap;
  font-size: var(--font-size-xs);
  position: sticky;
  top: 0;
  background-color: #FFFFFF;
  z-index: 5;
}

.history-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #EAECEF;
  white-space: nowrap;
  vertical-align: top;
}

.history-table__row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-table__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.history-table__header-left {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.history-table__coin {
  display: inline-flex;
  align-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.history-table__symbol {
  font-size: 14px;
  font-weight: 600;
  color: #1E2329;
}

.history-table__tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 400;
  color: #474D57;
  background: #EDEDED;
  border-radius: 2px;
  padding: 0 4px;
  line-height: 16px;
}

.history-table__coin-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
}

.history-table__direction {
  font-size: 11px;
  font-weight: 400;
  padding: 0 4px;
  line-height: 16px;
  border-radius: 2px;
}

.history-table__direction--long {
  color: var(--color-long);
  background: var(--color-long-bg);
}

.history-table__direction--short {
  color: var(--color-short);
  background: var(--color-short-bg);
}

.history-table__status {
  font-size: 14px;
  font-weight: 500;
  color: black;
}

.history-table__share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #848E9C;
  padding: 0;
  line-height: 0;
}

.history-table__share:hover {
  color: #474D57;
}

.history-table__times {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #848E9C;
  flex-shrink: 0;
}

.history-table__times-sep {
  color: #EAECEF;
}

.history-table__details {
  display: flex;
  align-items: flex-start;
  gap: 123px;
  padding-top: 2px;
}

.history-table__detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.history-table__detail-label {
  font-size: 12px;
  color: #848E9C;
  line-height: 18px;
}

.history-table__detail-label--pnl {
  border-bottom: 1px dotted #848E9C;
  
}

.history-table__detail-value {
  font-size: 14px;
  font-weight: 400;
  color: #1E2329;
  line-height: 22px;
}

.history-table__detail-value.text-long {
  color: var(--color-long);
}

.history-table__detail-value.text-short {
  color: var(--color-short);
}

/* === SHARE MODAL === */
.share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade-in 0.2s ease;
}

.share-overlay[hidden] {
  display: none;
}

.share-dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: #FFFFFF;
  border-radius: 8px;
  padding: 40px 32px 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.share-dialog__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: #1E2329;
  cursor: pointer;
  padding: 0;
}

.share-dialog__close:hover {
  opacity: 0.7;
}

.share-dialog__carousel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 28px;
}

.share-dialog__chevron {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #F5F5F5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  color: #474D57;
  padding: 0;
}

.share-dialog__chevron:hover {
  background: #EAECEF;
}

.share-dialog__options {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}

.share-dialog__options-label {
  font-size: 14px;
  color: #848E9C;
  width: 100%;
  
  margin-bottom: -4px;
}

.share-dialog__radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #1E2329;
  cursor: pointer;
  user-select: none;
}

.share-dialog__radio input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.share-dialog__radio-mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #B7BDC6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.share-dialog__radio input:checked + .share-dialog__radio-mark {
  border-color: #1E2329;
}

.share-dialog__radio input:checked + .share-dialog__radio-mark::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1E2329;
}

.share-dialog__actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 32px;
}

.share-dialog__action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  
  background: none;
  cursor: pointer;
  
  font-size: 12px;
  color: #474D57;
}

.share-dialog__action:hover {
  opacity: 0.75;
}

.share-dialog__action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dedcdc;
  border-radius: 15px;
  padding: 8px;
  width: 50px;
  height: 50px;
  box-sizing: border-box;
}

.share-dialog__action-icon img {
  display: block;
}

.share-dialog__action-icon--copy img {
  transform: rotate(-45deg);
}

.share-card {
  position: relative;
  width: 300px;
  min-height: 400px;
  padding: 24px 24px 20px;
  background: #181A20;
  border-radius: 0;
  overflow: hidden;
  flex-shrink: 0;
  font-family: var(--font-family);
}

.share-card__watermark {
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 180px;
  height: 180px;
  opacity: 0.08;
  pointer-events: none;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.share-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.share-card__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.share-card__user {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.share-card__username {
  font-size: 14px;
  font-weight: 600;
  color: #EAECEF;
  line-height: 20px;
}

.share-card__date {
  font-size: 12px;
  color: #e2e5e9;
  line-height: 16px;
}

.share-card__pair {
  font-size: 22px;
  font-weight: 600;
  color: #EAECEF;
  line-height: 28px;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.share-card__meta {
  font-size: 14px;
  line-height: 20px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.share-card__direction {
  font-weight: 500;
}

.share-card__direction--long {
  color: #0ECB81;
}

.share-card__direction--short {
  color: #F6465D;
}

.share-card__leverage {
  color: #848E9C;
}

.share-card__pnl {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.share-card__pnl-value {
  font-size: 32px;
  font-weight: 600;
  line-height: 40px;
}

.share-card__pnl-unit {
  font-size: 14px;
  font-weight: 500;
  color: #FFFFFF;
  line-height: 20px;
}

.share-card__roi {
  font-size: 22px;
  font-weight: 600;
  line-height: 28px;
  margin-top: -16px;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.share-card__prices {
  display: flex;
  gap: 40px;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.share-card__price-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.share-card__price-label {
  font-size: 12px;
  color: #848E9C;
  line-height: 16px;
}

.share-card__price-value {
  font-size: 16px;
  font-weight: 500;
  color: #EAECEF;
  line-height: 22px;
}

.share-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.share-card__brand {
  display: flex;
  transform: translateX(15px);
  flex-direction: column;
 
}

.share-card__logo-img {
  display: block;
  width: auto;
  height: 60px;
  transform: translateX(-38px);
  max-width: 140px;
  object-fit: contain;
}

.share-card__referral {
  font-size: 11px;
  color: #e2e5e9;
  line-height: 14px;
}

.share-card__qr {
  width: 72px;
  height: 72px;
  border-radius: 4px;
  background: #FFFFFF;
  padding: 4px;
  flex-shrink: 0;
}

.share-card__qr img {
  width: 100%;
  height: 100%;
  display: block;
}

/* === NAV ARROWS (Pair Block) === */
.pair-block__nav-arrows {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.pair-block__nav-arrow {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #474D57;
  cursor: pointer;
}

.pair-block__nav-arrow:hover {
  background: #F5F5F5;
}

/* === HISTORY COIN ICON COLORS === */
.history-table__coin-icon--BTC { background: #F7931A; color: #FFFFFF; }
.history-table__coin-icon--BNB { background: #F0B90B; color: #1E2329; }
.history-table__coin-icon--ETH { background: #627EEA; color: #FFFFFF; }
.history-table__coin-icon--SOL { background: #9945FF; color: #FFFFFF; }
.history-table__coin-icon--XRP { background: #23292F; color: #FFFFFF; }
.history-table__coin-icon--DOGE { background: #C2A633; color: #FFFFFF; }
.history-table__coin-icon--ADA { background: #0033AD; color: #FFFFFF; }
.history-table__coin-icon--AVAX { background: #E84142; color: #FFFFFF; }
.history-table__coin-icon--DOT { background: #E6007A; color: #FFFFFF; }

/* === BODY FLEX LAYOUT (for auto banner height) === */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
