/**
 * VPM — Institutional terminal layout (top nav, chart-first trade desk)
 */

/* Top navigation */
.vpm-app--terminal {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--vpm-bg);
}

.vpm-topnav {
  position: sticky;
  top: 0;
  z-index: var(--vpm-z-header);
  height: var(--vpm-topnav-h);
  background: var(--vpm-surface);
  border-bottom: 1px solid var(--vpm-border);
  box-shadow: var(--vpm-shadow-sm);
}

.vpm-topnav__inner {
  display: flex;
  align-items: center;
  gap: var(--vpm-space-2);
  height: 100%;
  max-width: 100%;
  padding: 0 var(--vpm-space-2);
}

@media (min-width: 1024px) {
  .vpm-topnav__inner {
    padding: 0 var(--vpm-space-3);
  }
}

.vpm-topnav__logo {
  flex-shrink: 0;
  font-size: 1rem;
}

.vpm-topnav__nav {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: var(--vpm-space-2);
}

@media (min-width: 768px) {
  .vpm-topnav__nav {
    display: flex;
  }
}

.vpm-topnav__link {
  padding: 8px 14px;
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-medium);
  color: var(--vpm-text-muted);
  text-decoration: none;
  border-radius: var(--vpm-radius-sm);
  cursor: pointer;
  transition: color var(--vpm-duration) var(--vpm-ease-out),
    background var(--vpm-duration) var(--vpm-ease-out);
}

.vpm-topnav__link:hover {
  color: var(--vpm-text);
  background: var(--vpm-surface-elevated);
}

.vpm-topnav__link--active {
  color: var(--vpm-text);
  background: var(--vpm-cta-muted);
  box-shadow: inset 0 0 0 1px rgba(41, 98, 255, 0.35);
}

.vpm-topnav__actions {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

@media (min-width: 900px) {
  .vpm-topnav__actions {
    display: flex;
  }
}

.vpm-topnav__menu-btn {
  margin-left: auto;
}

@media (min-width: 900px) {
  .vpm-topnav__menu-btn {
    display: none;
  }
}

.vpm-balance-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 6px 12px;
  background: var(--vpm-surface-elevated);
  border: 1px solid var(--vpm-border);
  border-radius: var(--vpm-radius-md);
}

.vpm-balance-pill__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--vpm-text-muted);
}

.vpm-balance-pill__value {
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-semibold);
  color: var(--vpm-text);
}

.vpm-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--vpm-radius-md);
  background: transparent;
  color: var(--vpm-text-muted);
  cursor: pointer;
  transition: background var(--vpm-duration) var(--vpm-ease-out),
    color var(--vpm-duration) var(--vpm-ease-out);
}

.vpm-icon-btn:hover {
  background: var(--vpm-surface-elevated);
  color: var(--vpm-text);
}

.vpm-avatar--sm {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.vpm-app__content--terminal {
  flex: 1;
  padding: 0;
  min-height: 0;
}

/* Shared panel */
.vpm-panel {
  background: var(--vpm-surface);
  border: 1px solid var(--vpm-border);
  border-radius: var(--vpm-radius-lg);
  overflow: hidden;
}

.vpm-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--vpm-space-2);
  padding: 12px var(--vpm-space-2);
  border-bottom: 1px solid var(--vpm-border);
}

@media (min-width: 768px) {
  .vpm-panel__head {
    padding: 12px var(--vpm-space-3);
  }
}

.vpm-panel__title {
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-semibold);
  color: var(--vpm-text);
}

.vpm-panel__meta {
  font-size: var(--vpm-text-xs);
  color: var(--vpm-text-muted);
}

/* Segmented control */
.vpm-segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--vpm-surface-muted);
  border: 1px solid var(--vpm-border);
  border-radius: var(--vpm-radius-md);
  gap: 2px;
}

.vpm-segmented--full {
  display: flex;
  width: 100%;
}

.vpm-segmented__btn {
  padding: 6px 12px;
  font-size: var(--vpm-text-xs);
  font-weight: var(--vpm-weight-medium);
  font-family: inherit;
  color: var(--vpm-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--vpm-radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--vpm-duration) var(--vpm-ease-out),
    color var(--vpm-duration) var(--vpm-ease-out);
}

.vpm-segmented--full .vpm-segmented__btn {
  flex: 1;
}

.vpm-segmented__btn:hover {
  color: var(--vpm-text);
}

.vpm-segmented__btn--active {
  color: var(--vpm-text);
  background: var(--vpm-surface-elevated);
  box-shadow: var(--vpm-shadow-sm);
}

/* Trade terminal */
.vpm-terminal {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-height: 100dvh;
  overflow: hidden;
}

.vpm-terminal--pro {
  max-height: none;
  min-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
}

.vpm-terminal--pro .vpm-terminal__workspace {
  flex: 1 0 auto;
  min-height: clamp(520px, 62dvh, 880px);
}

.vpm-terminal--pro .vpm-terminal__chart {
  flex: 1 1 auto;
  min-height: clamp(480px, 56dvh, 800px);
}

.vpm-terminal--pro .vpm-chart-widget__body {
  flex: 1;
  min-height: clamp(440px, 52dvh, 760px);
}

.vpm-terminal--pro .vpm-terminal__chart .vpm-market-chart__canvas {
  min-height: clamp(440px, 52dvh, 760px);
}

@media (min-width: 1100px) {
  .vpm-terminal--pro .vpm-terminal__workspace {
    min-height: clamp(560px, 68dvh, 920px);
  }

  .vpm-terminal--pro .vpm-terminal__chart {
    min-height: clamp(520px, 64dvh, 860px);
  }

  .vpm-terminal--pro .vpm-chart-widget__body,
  .vpm-terminal--pro .vpm-terminal__chart .vpm-market-chart__canvas {
    min-height: clamp(480px, 60dvh, 820px);
  }
}

.vpm-instrument-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--vpm-space-2) var(--vpm-space-3);
  padding: 12px var(--vpm-space-2);
  background: var(--vpm-surface);
  border-bottom: 1px solid var(--vpm-border);
}

@media (min-width: 768px) {
  .vpm-instrument-bar {
    padding: 12px var(--vpm-space-3);
  }
}

.vpm-instrument-bar__symbol {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vpm-instrument-bar__pair {
  font-size: var(--vpm-text-lg);
  font-weight: var(--vpm-weight-semibold);
  letter-spacing: -0.02em;
}

.vpm-instrument-bar__pair-select {
  display: block;
  margin: 0;
}

.vpm-instrument-bar__pair-input {
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: var(--vpm-text-lg);
  font-weight: var(--vpm-weight-semibold);
  letter-spacing: -0.02em;
  color: var(--vpm-text);
  padding: 4px 28px 4px 0;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%235a6270' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  min-width: 7rem;
}

.vpm-instrument-bar__pair-input:hover,
.vpm-instrument-bar__pair-input:focus {
  color: var(--vpm-primary);
  outline: none;
}

.vpm-instrument-bar__pair-input:focus-visible {
  outline: 2px solid var(--vpm-primary);
  outline-offset: 2px;
  border-radius: var(--vpm-radius-sm);
}

.vpm-instrument-bar__star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--vpm-border);
  border-radius: var(--vpm-radius-md);
  background: var(--vpm-surface);
  color: var(--vpm-text-muted);
  cursor: pointer;
  transition:
    color var(--vpm-duration) var(--vpm-ease-out),
    border-color var(--vpm-duration) var(--vpm-ease-out),
    background var(--vpm-duration) var(--vpm-ease-out);
}

.vpm-instrument-bar__star:hover {
  color: var(--vpm-t-gold, #f59e0b);
  border-color: color-mix(in srgb, var(--vpm-t-gold, #f59e0b) 45%, var(--vpm-border));
}

.vpm-instrument-bar__star[aria-pressed='true'] {
  color: var(--vpm-t-gold, #f59e0b);
  background: rgba(245, 158, 11, 0.12);
  border-color: color-mix(in srgb, var(--vpm-t-gold, #f59e0b) 50%, var(--vpm-border));
}

.vpm-instrument-bar__star .material-icons {
  font-size: 22px;
}

.vpm-market-strip__empty {
  margin: 0;
  padding: 10px 14px;
  font-size: var(--vpm-text-sm);
  color: var(--vpm-text-muted);
  white-space: nowrap;
}

.vpm-market-strip__empty a {
  color: var(--vpm-primary);
  text-decoration: none;
}

.vpm-market-strip__empty a:hover {
  text-decoration: underline;
}

.vpm-tag {
  font-size: 10px;
  font-weight: var(--vpm-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--vpm-radius-sm);
  border: 1px solid var(--vpm-border);
  color: var(--vpm-text-muted);
}

.vpm-tag--live {
  color: var(--vpm-accent);
  border-color: rgba(0, 188, 212, 0.35);
  background: var(--vpm-accent-muted);
}

.vpm-instrument-bar__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin: 0;
  flex: 1;
}

.vpm-instrument-bar__stats dt {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--vpm-text-muted);
  margin-bottom: 2px;
}

.vpm-instrument-bar__stats dd {
  margin: 0;
  font-size: var(--vpm-text-sm);
}

.vpm-instrument-bar__tf {
  width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

@media (min-width: 1100px) {
  .vpm-instrument-bar__tf {
    width: auto;
    margin-left: auto;
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

/* Market strip */
.vpm-market-strip {
  display: flex;
  gap: 8px;
  padding: 10px var(--vpm-space-2);
  overflow-x: auto;
  border-bottom: 1px solid var(--vpm-border);
  background: var(--vpm-surface-muted);
  scrollbar-width: thin;
}

.vpm-market-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 108px;
  padding: 8px 12px;
  background: var(--vpm-surface);
  border: 1px solid var(--vpm-border);
  border-radius: var(--vpm-radius-md);
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  flex-shrink: 0;
  transition: border-color var(--vpm-duration) var(--vpm-ease-out),
    box-shadow var(--vpm-duration) var(--vpm-ease-out);
}

.vpm-market-chip:hover {
  border-color: var(--vpm-secondary);
}

.vpm-market-chip--active {
  border-color: var(--vpm-primary);
  box-shadow: 0 0 0 1px rgba(41, 98, 255, 0.4);
}

.vpm-market-chip__pair {
  font-size: var(--vpm-text-xs);
  font-weight: var(--vpm-weight-semibold);
}

.vpm-market-chip__price {
  font-size: var(--vpm-text-sm);
}

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

@media (min-width: 1100px) {
  .vpm-terminal__workspace {
    flex-direction: row;
  }
}

.vpm-terminal__chart {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

.vpm-panel--chart {
  padding: 0;
  overflow: hidden;
}

.vpm-panel--chart > * {
  padding: 0 !important;
}

@media (min-width: 1100px) {
  .vpm-terminal__chart {
    border-right: 1px solid var(--vpm-border);
    min-height: 0;
  }
}

.vpm-terminal__chart .vpm-tv-chart {
  min-height: 360px;
  border-radius: 0;
}

@media (min-width: 1100px) {
  .vpm-terminal__chart .vpm-tv-chart {
    min-height: 100%;
  }
}

.vpm-terminal__rail {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-height: none;
}

@media (min-width: 1100px) {
  .vpm-terminal__rail {
    width: 320px;
    flex-shrink: 0;
    border-left: none;
    overflow-y: auto;
    max-height: 100%;
  }
}

.vpm-order-card {
  padding: var(--vpm-space-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--vpm-border);
}

.vpm-order-card__modes {
  margin-bottom: 4px;
}

.vpm-buy-sell--pro button {
  height: 40px;
  font-size: var(--vpm-text-sm);
}

.vpm-depth-panel {
  flex: 1;
  border-radius: 0;
  border: none;
  min-height: 200px;
}

.vpm-depth {
  padding: 0 var(--vpm-space-2) var(--vpm-space-2);
}

.vpm-depth__row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: var(--vpm-text-xs);
  position: relative;
}

.vpm-depth__row--ask::before,
.vpm-depth__row--bid::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.12;
  pointer-events: none;
}

.vpm-depth__row--ask::before {
  background: var(--vpm-danger);
  width: 55%;
  right: 0;
  left: auto;
}

.vpm-depth__row--bid::before {
  background: var(--vpm-success);
  width: 40%;
}

.vpm-depth__spread {
  text-align: center;
  padding: 8px 0;
  font-size: var(--vpm-text-xs);
  color: var(--vpm-text-muted);
  border-top: 1px solid var(--vpm-border);
  border-bottom: 1px solid var(--vpm-border);
  margin: 6px 0;
}

.vpm-terminal__ledger {
  flex-shrink: 0;
  overflow-y: auto;
  max-height: min(40dvh, 360px);
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
}

.vpm-tabs--line {
  padding: 0 var(--vpm-space-2);
  border-bottom: 1px solid var(--vpm-border);
  margin-bottom: 0;
}

.vpm-tabs--line .vpm-tab {
  padding: 12px 16px;
  font-size: var(--vpm-text-xs);
}

.vpm-table--terminal thead th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--vpm-text-muted);
  font-weight: var(--vpm-weight-medium);
  background: var(--vpm-surface-muted);
}

.vpm-table--terminal tbody tr:hover {
  background: var(--vpm-surface-elevated);
}

.vpm-side {
  display: inline-block;
  font-size: 10px;
  font-weight: var(--vpm-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 6px;
}

.vpm-side--buy {
  color: var(--vpm-success);
}

.vpm-side--sell {
  color: var(--vpm-danger);
}

.vpm-legal-line {
  padding: 10px var(--vpm-space-2);
  font-size: 11px;
  color: var(--vpm-text-muted);
  border-top: 1px solid var(--vpm-border);
  margin: 0;
}

/* Portfolio */
.vpm-portfolio {
  display: flex;
  flex-direction: column;
  gap: var(--vpm-space-2);
  padding: var(--vpm-space-2);
  max-width: 1400px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .vpm-portfolio {
    padding: var(--vpm-space-3);
    gap: var(--vpm-space-3);
  }
}

.vpm-portfolio-hero {
  display: grid;
  gap: var(--vpm-space-3);
  padding: var(--vpm-space-3);
  background: linear-gradient(135deg, var(--vpm-surface) 0%, var(--vpm-surface-muted) 100%);
}

@media (min-width: 900px) {
  .vpm-portfolio-hero {
    grid-template-columns: 1.2fr 1.5fr auto;
    align-items: center;
  }
}

.vpm-portfolio-hero__label {
  font-size: var(--vpm-text-sm);
  color: var(--vpm-text-muted);
}

.vpm-portfolio-hero__balance {
  font-size: var(--vpm-text-3xl);
  font-weight: var(--vpm-weight-bold);
  letter-spacing: -0.03em;
  margin-top: 4px;
}

.vpm-portfolio-hero__balance span {
  font-size: var(--vpm-text-lg);
  font-weight: var(--vpm-weight-medium);
  color: var(--vpm-text-muted);
}

.vpm-portfolio-hero__delta {
  font-size: var(--vpm-text-sm);
  margin-top: 6px;
}

.vpm-portfolio-hero__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
}

@media (min-width: 600px) {
  .vpm-portfolio-hero__stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.vpm-stat-inline__label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--vpm-text-muted);
}

.vpm-stat-inline__value {
  display: block;
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-semibold);
  margin-top: 4px;
}

.vpm-portfolio-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vpm-portfolio-chart .vpm-tv-mini {
  border-radius: 0;
}

.vpm-portfolio__grid {
  display: grid;
  gap: var(--vpm-space-2);
}

@media (min-width: 1024px) {
  .vpm-portfolio__grid {
    grid-template-columns: 1.4fr 1fr;
    gap: var(--vpm-space-3);
  }
}

/* Activity feed */
.vpm-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vpm-feed__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px var(--vpm-space-3);
  border-bottom: 1px solid var(--vpm-border);
}

.vpm-feed__item:last-child {
  border-bottom: none;
}

.vpm-feed__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--vpm-radius-md);
  flex-shrink: 0;
  background: var(--vpm-surface-elevated);
  border: 1px solid var(--vpm-border);
}

.vpm-feed__icon--copy {
  border-color: rgba(41, 98, 255, 0.4);
  background: var(--vpm-cta-muted);
}

.vpm-feed__icon--mining {
  border-color: rgba(0, 188, 212, 0.35);
  background: var(--vpm-accent-muted);
}

.vpm-feed__icon--deposit {
  border-color: rgba(38, 166, 154, 0.35);
  background: var(--vpm-success-bg);
}

.vpm-feed__icon--trade {
  border-color: var(--vpm-border);
}

.vpm-feed__icon--withdraw {
  border-color: rgba(255, 183, 77, 0.4);
  background: var(--vpm-warning-bg);
}

.vpm-feed__icon--card {
  border-color: rgba(91, 156, 246, 0.4);
  background: var(--vpm-info-bg);
}

.vpm-feed__label--link {
  color: inherit;
  text-decoration: none;
}

.vpm-feed__label--link:hover {
  color: var(--vpm-primary);
  text-decoration: underline;
}

.vpm-feed__body {
  flex: 1;
  min-width: 0;
}

.vpm-feed__label {
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-medium);
}

.vpm-feed__detail {
  font-size: var(--vpm-text-xs);
  color: var(--vpm-text-muted);
  margin-top: 2px;
}

.vpm-feed__amount {
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-semibold);
}

.vpm-order-summary--compact {
  margin: 0;
}

/* Secondary app pages (copy, mining) */
.vpm-page-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

.vpm-page-shell__head {
  margin-bottom: var(--vpm-space-3);
}

.vpm-page-shell__title {
  font-size: var(--vpm-text-xl);
  font-weight: var(--vpm-weight-semibold);
  letter-spacing: -0.02em;
}

.vpm-page-shell__sub {
  margin-top: 6px;
  font-size: var(--vpm-text-sm);
  color: var(--vpm-text-muted);
  max-width: 42rem;
}

/* Chart widget (live trading panel) */
.vpm-chart-widget {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  background: var(--vpm-surface);
  border: 1px solid var(--vpm-border);
}

.vpm-chart-widget__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-height: 44px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--vpm-border);
  background: var(--vpm-surface-muted);
  font-size: var(--vpm-text-sm);
}

.vpm-chart-widget__head--editor {
  border-top: 1px solid var(--vpm-border);
}

.vpm-chart-widget__live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--vpm-text-muted);
  opacity: 0.5;
}

.vpm-chart-widget__live--active {
  background: var(--vpm-accent);
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(0, 188, 212, 0.25);
  animation: vpm-chart-live-pulse 1.8s ease-in-out infinite;
}

.vpm-chart-widget__live--sim {
  background: var(--vpm-warning);
  opacity: 0.85;
  animation: none;
  box-shadow: none;
}

@keyframes vpm-chart-live-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.vpm-chart-widget__pair {
  font-weight: var(--vpm-weight-semibold);
  white-space: nowrap;
}

.vpm-chart-widget__last {
  font-weight: var(--vpm-weight-semibold);
  margin-left: auto;
}

.vpm-chart-widget__change {
  font-size: var(--vpm-text-xs);
}

.vpm-chart-widget__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.vpm-chart-widget__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--vpm-border);
  border-radius: var(--vpm-radius-sm);
  background: var(--vpm-surface);
  color: var(--vpm-text-muted);
  cursor: pointer;
  transition: color var(--vpm-duration) var(--vpm-ease-out),
    border-color var(--vpm-duration) var(--vpm-ease-out),
    background var(--vpm-duration) var(--vpm-ease-out);
}

.vpm-chart-widget__btn:hover {
  color: var(--vpm-text);
  border-color: var(--vpm-secondary);
  background: var(--vpm-surface-elevated);
}

.vpm-chart-widget__btn[aria-pressed='true'] {
  color: var(--vpm-primary);
  border-color: rgba(41, 98, 255, 0.45);
  background: rgba(41, 98, 255, 0.08);
}

.vpm-chart-widget__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.vpm-chart-widget--editor {
  border: none;
  border-top: none;
}

/* Market chart (Lightweight Charts) */
.vpm-market-chart__canvas {
  width: 100%;
  flex: 1;
  min-height: 0;
  height: 100%;
  position: relative;
}

.vpm-terminal__chart .vpm-market-chart__canvas {
  min-height: 0;
}

.vpm-market-chart__canvas--editor {
  min-height: 0;
  height: 100%;
}

.vpm-keyframe-list li:last-child {
  border-bottom: none;
}

/* Price control wizard (simplified admin) */
.vpm-price-wizard {
  margin-bottom: 16px;
  border-color: rgba(41, 98, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(41, 98, 255, 0.08);
}

.vpm-price-wizard__lead {
  margin: 4px 0 0;
  font-size: var(--vpm-text-sm);
  color: var(--vpm-text-muted);
  font-weight: var(--vpm-weight-normal);
}

.vpm-price-wizard__mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--vpm-border);
}

.vpm-price-wizard__mode-label {
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-semibold);
  color: var(--vpm-text);
}

.vpm-price-wizard__mode-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.vpm-price-wizard__note {
  margin: 0 0 16px;
  font-size: var(--vpm-text-sm);
  color: var(--vpm-text-muted);
}

.vpm-price-wizard__note--active {
  color: var(--vpm-primary);
  font-weight: var(--vpm-weight-medium);
}

.vpm-price-wizard__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 767px) {
  .vpm-price-wizard__grid {
    grid-template-columns: 1fr;
  }
}

.vpm-price-wizard__presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.vpm-price-wizard__presets-label {
  font-size: var(--vpm-text-xs);
  color: var(--vpm-text-muted);
  margin-right: 4px;
}

.vpm-price-wizard__trade {
  margin-top: 16px;
  border: 1px solid var(--vpm-border);
  border-radius: var(--vpm-radius-md);
  background: var(--vpm-surface-muted);
}

.vpm-price-wizard__trade-summary {
  padding: 12px 14px;
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-medium);
  cursor: pointer;
  list-style: none;
}

.vpm-price-wizard__trade-summary::-webkit-details-marker {
  display: none;
}

.vpm-price-wizard__trade-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--vpm-border);
}

.vpm-price-wizard__submit {
  margin-top: 16px;
}

.vpm-price-wizard__hint {
  margin: 10px 0 0;
  font-size: var(--vpm-text-xs);
  color: var(--vpm-text-muted);
  line-height: 1.45;
}

.vpm-market-advanced {
  border: 1px solid var(--vpm-border);
  border-radius: var(--vpm-radius-md);
  background: var(--vpm-surface);
}

.vpm-market-advanced__summary {
  padding: 14px 16px;
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-semibold);
  cursor: pointer;
  list-style: none;
}

.vpm-market-advanced__summary::-webkit-details-marker {
  display: none;
}

.vpm-market-advanced__body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--vpm-border);
}

.vpm-market-advanced__section {
  margin-top: 16px;
}

.vpm-market-advanced__intro {
  margin: 0 0 12px;
}

.vpm-tag--sim {
  background: var(--vpm-warning-bg);
  color: var(--vpm-warning);
}

.vpm-order-card__note {
  margin: 0 0 12px;
  font-size: var(--vpm-text-sm);
  color: var(--vpm-text-muted);
  line-height: 1.5;
}

.vpm-order-card__balance {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--vpm-border);
}

.vpm-order-card__balance-meta {
  font-size: var(--vpm-text-xs);
  color: var(--vpm-text-muted);
  text-align: right;
}

.vpm-order-card__balance-label {
  font-size: var(--vpm-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--vpm-text-muted);
}

.vpm-order-card__balance-value {
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-semibold);
}

.vpm-order-card__heading {
  margin: 0 0 10px;
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-semibold);
}

.vpm-order-card--positions {
  border-top: 1px solid var(--vpm-border);
}

.vpm-position-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.vpm-position-list__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--vpm-text-xs);
}

.vpm-position-list__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.vpm-position-list__pair {
  font-weight: var(--vpm-weight-semibold);
}

.vpm-position-list__levels {
  color: var(--vpm-text-muted);
}

.vpm-position-list__edit {
  margin-top: 4px;
}

.vpm-position-list__edit summary {
  cursor: pointer;
  color: var(--vpm-primary);
  font-weight: var(--vpm-weight-medium);
  list-style: none;
}

.vpm-position-list__edit summary::-webkit-details-marker {
  display: none;
}

.vpm-position-list__levels-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--vpm-border);
}

.vpm-trade-form__exits {
  display: grid;
  gap: 8px;
}

.vpm-trade-form__exits-fields[hidden] {
  display: none;
}

.vpm-trade-exits {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--vpm-text-xs);
}

.vpm-trade-exits__sl {
  color: var(--vpm-negative, #e5484d);
}

.vpm-trade-exits__tp {
  color: var(--vpm-positive, #30a46c);
}

.vpm-trade-close-reason {
  display: block;
  margin-top: 4px;
  font-size: var(--vpm-text-xs);
  color: var(--vpm-text-muted);
}

.vpm-trade-form__fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vpm-kyc-alert {
  border-color: color-mix(in srgb, var(--vpm-primary) 35%, var(--vpm-border));
}

.vpm-kyc-alert__title {
  margin: 0 0 6px;
  font-weight: var(--vpm-weight-semibold);
  font-size: var(--vpm-text-sm);
}

.vpm-kyc-alert__text {
  margin: 0 0 12px;
  font-size: var(--vpm-text-sm);
  color: var(--vpm-text-muted);
}

.vpm-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.vpm-identity-reject summary {
  list-style: none;
  cursor: pointer;
}

.vpm-identity-reject summary::-webkit-details-marker {
  display: none;
}

.vpm-identity-reject__form {
  margin-top: 8px;
  min-width: 220px;
}

.vpm-trade-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vpm-terminal__rail .vpm-btn--buy,
.vpm-terminal__rail .vpm-btn--sell {
  min-height: 44px;
  font-weight: var(--vpm-weight-semibold);
}

.vpm-market-editor__layout {
  display: grid;
  gap: 16px;
}

@media (min-width: 1100px) {
  .vpm-market-editor__layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    align-items: start;
  }
}

.vpm-market-editor__toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
}

.vpm-market-editor__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.vpm-market-editor__mode {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vpm-market-editor__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  width: 100%;
}

.vpm-market-editor__anchor-note {
  margin: 0;
  font-size: var(--vpm-text-xs);
  color: var(--vpm-text-muted);
  flex: 1 1 100%;
}

.vpm-market-editor__anchor-note--active {
  color: var(--vpm-primary);
  font-weight: var(--vpm-weight-medium);
}

.vpm-field--checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--vpm-text-sm);
  color: var(--vpm-text-muted);
}

.vpm-field--checkbox input {
  margin-top: 3px;
}

.vpm-instrument-bar--compact {
  padding: 12px 16px;
  border-bottom: 1px solid var(--vpm-border);
}

.vpm-keyframe-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.vpm-keyframe-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--vpm-border);
  font-size: var(--vpm-text-sm);
}

.vpm-input--sm {
  padding: 6px 10px;
  font-size: var(--vpm-text-sm);
  min-height: 36px;
}

/* Scrollable timeframe strip */
.vpm-segmented--scroll {
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.vpm-segmented--scroll::-webkit-scrollbar {
  display: none;
}

.vpm-trade-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.vpm-trade-form__hint {
  margin: -4px 0 0;
}

/* ——— Mobile & tablet: trade terminal + charts ——— */
@media (max-width: 1099px) {
  .vpm-dashboard__content--terminal .vpm-context-bar {
    padding: 8px 12px;
    font-size: var(--vpm-text-xs);
  }

  .vpm-dashboard__content--terminal .vpm-breadcrumb {
    font-size: var(--vpm-text-xs);
  }

  .vpm-instrument-bar {
    gap: 10px;
    padding: 10px 12px;
  }

  .vpm-instrument-bar__symbol {
    width: 100%;
  }

  .vpm-instrument-bar__pair-input {
    width: 100%;
    max-width: 100%;
    font-size: var(--vpm-text-base);
  }

  .vpm-instrument-bar__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 10px;
    width: 100%;
  }

  .vpm-instrument-bar__stats dt {
    font-size: 9px;
  }

  .vpm-instrument-bar__stats dd {
    font-size: var(--vpm-text-xs);
  }

  .vpm-instrument-bar__tf {
    width: 100%;
    margin-left: 0;
  }

  .vpm-market-strip {
    padding: 8px 12px;
    gap: 6px;
  }

  .vpm-market-chip {
    min-width: 96px;
    padding: 8px 10px;
  }

  .vpm-terminal__workspace {
    min-height: 0;
    flex: 1;
  }

  .vpm-terminal__chart {
    flex: 1;
    min-height: 0;
  }

  .vpm-terminal__chart .vpm-market-chart__canvas,
  .vpm-chart-widget__body {
    min-height: 0;
    height: auto;
  }

  .vpm-terminal--pro .vpm-terminal__chart .vpm-market-chart__canvas,
  .vpm-terminal--pro .vpm-chart-widget__body {
    min-height: clamp(440px, 52dvh, 760px);
    height: auto;
  }

  .vpm-terminal__rail {
    width: 100%;
    flex-shrink: 0;
  }

  .vpm-order-card {
    padding: 14px 12px;
  }

  .vpm-trade-form .vpm-input,
  .vpm-trade-form select.vpm-input {
    min-height: 44px;
    font-size: 16px;
  }

  .vpm-buy-sell--pro button {
    min-height: 44px;
  }

  .vpm-terminal__ledger .vpm-panel__head {
    padding: 10px 12px;
  }

  .vpm-terminal__ledger .vpm-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
  }

  .vpm-terminal__ledger .vpm-table--terminal {
    min-width: 680px;
  }

  .vpm-terminal__ledger .vpm-table th,
  .vpm-terminal__ledger .vpm-table td {
    padding: 10px 12px;
    font-size: var(--vpm-text-xs);
  }

  .vpm-legal-line {
    padding: 10px 12px;
    font-size: 10px;
    line-height: 1.45;
  }

  /* Admin market editor */
  .vpm-market-editor {
    padding: 0 0 16px;
  }

  .vpm-market-editor__toolbar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .vpm-market-editor__filters {
    flex-direction: column;
    width: 100%;
  }

  .vpm-market-editor__filters .vpm-field {
    width: 100%;
  }

  .vpm-market-editor__mode {
    justify-content: space-between;
    width: 100%;
  }

  .vpm-market-editor__chart-panel .vpm-instrument-bar--compact {
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .vpm-market-chart__canvas--editor,
  .vpm-market-editor__chart-panel .vpm-chart-widget__body {
    min-height: clamp(260px, 40dvh, 400px);
  }

  .vpm-market-editor__controls .vpm-panel {
    border-left: none;
    border-right: none;
    border-radius: 0;
  }

  .vpm-market-editor__controls .vpm-wallet-form__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 479px) {
  .vpm-instrument-bar__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vpm-trade-form__row {
    grid-template-columns: 1fr;
  }

  .vpm-segmented__btn {
    padding: 8px 10px;
    min-width: 40px;
  }

  .vpm-order-card__balance {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .vpm-order-card__balance-meta {
    text-align: left;
  }
}

@media (min-width: 1100px) {
  .vpm-terminal__chart .vpm-market-chart__canvas {
    min-height: 0;
    height: 100%;
  }
}

/* ——— Pro trading terminal (visual upgrade) ——— */
.vpm-terminal--pro {
  --vpm-t-gold: #f59e0b;
  --vpm-t-gold-muted: rgba(245, 158, 11, 0.14);
  --vpm-t-purple-glow: rgba(139, 92, 246, 0.22);
  --vpm-t-buy-glow: rgba(38, 166, 154, 0.2);
  --vpm-t-sell-glow: rgba(239, 83, 80, 0.2);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(41, 98, 255, 0.08), transparent 60%),
    var(--vpm-bg);
}

.vpm-instrument-bar--pro {
  align-items: stretch;
  gap: 12px 20px;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--vpm-surface) 0%, var(--vpm-surface-muted) 100%);
  border-bottom: 1px solid var(--vpm-border);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}

.vpm-instrument-bar__lead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 20px;
  min-width: 0;
}

.vpm-instrument-bar__hero {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.vpm-instrument-bar__hero-label {
  font-size: 10px;
  font-weight: var(--vpm-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--vpm-text-muted);
}

.vpm-instrument-bar__hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
}

.vpm-instrument-bar__hero-price {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: var(--vpm-weight-bold);
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--vpm-text);
  font-variant-numeric: tabular-nums;
}

.vpm-instrument-bar__hero-change {
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-semibold);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--vpm-surface-muted);
  border: 1px solid var(--vpm-border);
}

.vpm-instrument-bar__hero-change.vpm-positive {
  color: var(--vpm-success);
  background: var(--vpm-success-bg);
  border-color: color-mix(in srgb, var(--vpm-success) 35%, var(--vpm-border));
}

.vpm-instrument-bar__hero-change.vpm-negative {
  color: var(--vpm-danger);
  background: var(--vpm-danger-bg);
  border-color: color-mix(in srgb, var(--vpm-danger) 35%, var(--vpm-border));
}

.vpm-instrument-bar__stats--cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  flex: 1;
  min-width: min(100%, 360px);
}

.vpm-stat-card {
  padding: 10px 12px;
  background: var(--vpm-surface);
  border: 1px solid var(--vpm-border);
  border-radius: var(--vpm-radius-md);
  transition: border-color var(--vpm-duration) var(--vpm-ease-out),
    box-shadow var(--vpm-duration) var(--vpm-ease-out);
}

.vpm-stat-card:hover {
  border-color: color-mix(in srgb, var(--vpm-primary) 40%, var(--vpm-border));
  box-shadow: var(--vpm-shadow-sm);
}

.vpm-stat-card dt {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--vpm-text-muted);
  margin-bottom: 4px;
}

.vpm-stat-card dd {
  margin: 0;
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-semibold);
  font-variant-numeric: tabular-nums;
}

.vpm-segmented--terminal {
  background: var(--vpm-surface);
  border-color: var(--vpm-border);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.vpm-segmented--terminal .vpm-segmented__btn--active {
  background: linear-gradient(180deg, var(--vpm-surface-elevated) 0%, var(--vpm-surface-muted) 100%);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.12),
    inset 0 0 0 1px color-mix(in srgb, var(--vpm-t-gold) 45%, var(--vpm-border));
  color: var(--vpm-text);
}

.vpm-market-strip--pro {
  padding: 10px 16px;
  gap: 10px;
  background: var(--vpm-surface-muted);
  border-bottom: 1px solid var(--vpm-border);
}

.vpm-terminal--pro .vpm-market-chip {
  position: relative;
  overflow: hidden;
  min-width: 112px;
  padding: 10px 14px;
  background: var(--vpm-surface);
  border-radius: var(--vpm-radius-md);
  transition:
    border-color var(--vpm-duration) var(--vpm-ease-out),
    transform var(--vpm-duration) var(--vpm-ease-out),
    box-shadow var(--vpm-duration) var(--vpm-ease-out);
}

.vpm-terminal--pro .vpm-market-chip::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  border-radius: 3px 0 0 3px;
  transition: background var(--vpm-duration) var(--vpm-ease-out);
}

.vpm-terminal--pro .vpm-market-chip:hover {
  border-color: color-mix(in srgb, var(--vpm-primary) 50%, var(--vpm-border));
  transform: translateY(-1px);
  box-shadow: var(--vpm-shadow-sm);
}

.vpm-terminal--pro .vpm-market-chip--active {
  border-color: color-mix(in srgb, var(--vpm-t-gold) 55%, var(--vpm-primary));
  box-shadow: 0 0 0 1px var(--vpm-t-gold-muted), var(--vpm-shadow-sm);
}

.vpm-terminal--pro .vpm-market-chip--active::before {
  background: linear-gradient(180deg, var(--vpm-t-gold), #d97706);
}

.vpm-chart-widget--pro .vpm-chart-widget__head {
  background: linear-gradient(90deg, var(--vpm-surface-muted) 0%, var(--vpm-surface) 100%);
  border-bottom: 1px solid var(--vpm-border);
}

.vpm-terminal__rail--pro {
  gap: 0;
  background: var(--vpm-surface-muted);
}

@media (min-width: 1100px) {
  .vpm-terminal__rail--pro {
    width: 352px;
  }
}

.vpm-order-card--pro {
  padding: 16px;
  gap: 14px;
  background: var(--vpm-surface);
  border: none;
  border-bottom: 1px solid var(--vpm-border);
}

.vpm-order-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vpm-order-card__title {
  margin: 0;
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-semibold);
  letter-spacing: -0.01em;
}

.vpm-order-card__badge,
.vpm-order-card__count {
  font-size: 10px;
  font-weight: var(--vpm-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--vpm-surface-muted);
  border: 1px solid var(--vpm-border);
  color: var(--vpm-text-muted);
}

.vpm-order-card__count {
  background: var(--vpm-cta-muted);
  border-color: color-mix(in srgb, var(--vpm-primary) 35%, var(--vpm-border));
  color: var(--vpm-primary);
}

.vpm-wallet-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  padding: 14px;
  border-radius: var(--vpm-radius-md);
  background:
    linear-gradient(135deg, var(--vpm-t-gold-muted) 0%, transparent 55%),
    var(--vpm-surface-muted);
  border: 1px solid color-mix(in srgb, var(--vpm-t-gold) 28%, var(--vpm-border));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.vpm-wallet-card__cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.vpm-wallet-card__divider {
  width: 1px;
  margin: 0 12px;
  background: var(--vpm-border);
  align-self: stretch;
}

.vpm-wallet-card__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--vpm-text-muted);
}

.vpm-wallet-card__value {
  font-size: var(--vpm-text-base);
  font-weight: var(--vpm-weight-semibold);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.vpm-wallet-card__value--accent {
  color: var(--vpm-t-gold);
  text-shadow: 0 0 24px var(--vpm-t-gold-muted);
}

.vpm-wallet-card__meta {
  font-size: 11px;
  color: var(--vpm-text-muted);
}

.vpm-buy-sell--terminal {
  padding: 4px;
  border-radius: var(--vpm-radius-md);
  background: var(--vpm-surface-muted);
  border: 1px solid var(--vpm-border);
  gap: 4px;
}

.vpm-buy-sell--terminal button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  font-weight: var(--vpm-weight-semibold);
  border-radius: calc(var(--vpm-radius-md) - 2px);
  transition:
    background var(--vpm-duration) var(--vpm-ease-out),
    color var(--vpm-duration) var(--vpm-ease-out),
    box-shadow var(--vpm-duration) var(--vpm-ease-out);
}

.vpm-buy-sell--terminal button.active-buy {
  background: var(--vpm-success);
  color: #fff;
  box-shadow: 0 4px 14px var(--vpm-t-buy-glow);
}

.vpm-buy-sell--terminal button.active-sell {
  background: var(--vpm-danger);
  color: #fff;
  box-shadow: 0 4px 14px var(--vpm-t-sell-glow);
}

.vpm-field--terminal .vpm-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--vpm-text-muted);
}

.vpm-input--terminal {
  background: var(--vpm-surface-muted);
  border-color: var(--vpm-border-input);
  transition:
    border-color var(--vpm-duration) var(--vpm-ease-out),
    box-shadow var(--vpm-duration) var(--vpm-ease-out);
}

.vpm-input--terminal:focus {
  border-color: color-mix(in srgb, var(--vpm-primary) 55%, var(--vpm-border-input));
  box-shadow: 0 0 0 3px var(--vpm-cta-muted);
}

.vpm-order-summary--terminal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
}

.vpm-order-summary__tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--vpm-surface-muted);
  border: 1px solid var(--vpm-border);
  border-radius: var(--vpm-radius-sm);
}

.vpm-order-summary__tile--wide {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, var(--vpm-cta-muted), transparent);
  border-color: color-mix(in srgb, var(--vpm-primary) 30%, var(--vpm-border));
}

.vpm-order-summary__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--vpm-text-muted);
}

.vpm-order-summary__value {
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-semibold);
  font-variant-numeric: tabular-nums;
}

.vpm-terminal__rail .vpm-btn--terminal {
  min-height: 46px;
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-semibold);
  letter-spacing: 0.02em;
  border-radius: var(--vpm-radius-md);
  transition:
    transform var(--vpm-duration) var(--vpm-ease-out),
    box-shadow var(--vpm-duration) var(--vpm-ease-out);
}

.vpm-terminal__rail .vpm-btn--terminal.vpm-btn--buy {
  box-shadow: 0 6px 20px var(--vpm-t-buy-glow);
}

.vpm-terminal__rail .vpm-btn--terminal.vpm-btn--sell {
  box-shadow: 0 6px 20px var(--vpm-t-sell-glow);
}

.vpm-terminal__rail .vpm-btn--terminal:hover:not(:disabled) {
  transform: translateY(-1px);
}

.vpm-position-list--cards {
  gap: 10px;
}

.vpm-position-card {
  padding: 12px 14px;
  background: var(--vpm-surface-muted);
  border: 1px solid var(--vpm-border);
  border-radius: var(--vpm-radius-md);
  border-left-width: 3px;
  list-style: none;
  transition:
    border-color var(--vpm-duration) var(--vpm-ease-out),
    box-shadow var(--vpm-duration) var(--vpm-ease-out);
}

.vpm-position-card--buy {
  border-left-color: var(--vpm-success);
}

.vpm-position-card--sell {
  border-left-color: var(--vpm-danger);
}

.vpm-position-card:hover {
  box-shadow: var(--vpm-shadow-sm);
  border-color: color-mix(in srgb, var(--vpm-primary) 25%, var(--vpm-border));
}

.vpm-position-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 6px;
}

.vpm-position-card__pair {
  font-size: var(--vpm-text-sm);
  font-weight: var(--vpm-weight-semibold);
}

.vpm-position-card__lev {
  font-size: 10px;
  font-weight: var(--vpm-weight-semibold);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--vpm-surface);
  border: 1px solid var(--vpm-border);
  color: var(--vpm-text-muted);
}

.vpm-position-card__size {
  font-size: var(--vpm-text-xs);
  color: var(--vpm-text);
}

.vpm-position-card__levels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
}

.vpm-position-card__sl {
  color: var(--vpm-danger);
}

.vpm-position-card__tp {
  color: var(--vpm-success);
}

.vpm-position-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--vpm-border);
}

.vpm-position-card__edit summary {
  cursor: pointer;
  font-size: var(--vpm-text-xs);
  font-weight: var(--vpm-weight-medium);
  color: var(--vpm-primary);
  list-style: none;
}

.vpm-position-card__edit summary::-webkit-details-marker {
  display: none;
}

.vpm-btn--close-position {
  color: var(--vpm-danger);
  border-color: color-mix(in srgb, var(--vpm-danger) 35%, var(--vpm-border));
}

.vpm-terminal__ledger--pro {
  background: var(--vpm-surface);
  border-top: 1px solid var(--vpm-border);
}

.vpm-panel__head--pro {
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--vpm-surface-muted) 0%, var(--vpm-surface) 100%);
}

.vpm-panel__head--pro .vpm-panel__meta {
  margin-top: 2px;
}

.vpm-table--pro tbody tr {
  transition: background var(--vpm-duration) var(--vpm-ease-out);
}

.vpm-table--pro tbody tr:hover {
  background: color-mix(in srgb, var(--vpm-primary) 6%, var(--vpm-surface-elevated));
}

.vpm-table__pair {
  font-weight: var(--vpm-weight-medium);
}

.vpm-side--pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  margin-right: 0;
  border: 1px solid transparent;
}

.vpm-side--pill.vpm-side--buy {
  background: var(--vpm-success-bg);
  border-color: color-mix(in srgb, var(--vpm-success) 35%, transparent);
}

.vpm-side--pill.vpm-side--sell {
  background: var(--vpm-danger-bg);
  border-color: color-mix(in srgb, var(--vpm-danger) 35%, transparent);
}

@media (max-width: 1099px) {
  .vpm-instrument-bar--pro {
    padding: 12px;
  }

  .vpm-instrument-bar__lead {
    width: 100%;
  }

  .vpm-instrument-bar__stats--cards {
    width: 100%;
    min-width: 0;
  }

  .vpm-wallet-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .vpm-wallet-card__divider {
    width: 100%;
    height: 1px;
    margin: 0;
  }

  .vpm-order-card--pro {
    padding: 14px 12px;
  }
}

@media (max-width: 479px) {
  .vpm-instrument-bar__stats--cards {
    grid-template-columns: 1fr 1fr;
  }

  .vpm-instrument-bar__stats--cards .vpm-stat-card:last-child {
    grid-column: 1 / -1;
  }

  .vpm-instrument-bar__hero-price {
    font-size: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vpm-terminal--pro .vpm-market-chip:hover,
  .vpm-terminal__rail .vpm-btn--terminal:hover:not(:disabled) {
    transform: none;
  }
}
