:root {
  color-scheme: dark;
  --bg: #0b0f12;
  --panel: #151b20;
  --panel-2: #1c2329;
  --line: #2b343c;
  --text: #f5f7f8;
  --muted: #94a0aa;
  --mint: #2ed1aa;
  --green: #53d47f;
  --red: #ff6464;
  --yellow: #f4c542;
}

* {
  box-sizing: border-box;
}

html,
body {
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, #162026, var(--bg) 54%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.auth-gate.hidden {
  display: none;
}

.auth-card {
  width: min(100%, 390px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025));
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 26px;
}

.auth-card p,
.login-message {
  color: var(--muted);
  font-size: 13px;
}

.auth-card label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.auth-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.auth-card .primary-button {
  margin-top: 16px;
}

.login-message {
  min-height: 18px;
  margin-top: 10px;
}

button {
  color: inherit;
  font: inherit;
}

.app-shell {
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 12px 14px 88px;
}

.app-view {
  min-height: calc(100vh - 112px);
}

.topbar {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 8px;
  padding: 8px 0 4px;
  text-align: center;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.topbar p,
.pull-hint,
.eyebrow span,
.section-title span,
.sub-balance,
.sync-note {
  color: var(--muted);
}

.topbar p {
  margin: 2px 0 0;
  font-size: 12px;
}

.icon-button,
.gear {
  border: 0;
  background: transparent;
  font-size: 24px;
}

.pull-hint {
  display: none;
  text-align: center;
  font-size: 12px;
  padding: 8px 0 0;
}

.balance-card,
.panel,
.settings-panel,
.api-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--line);
  border-radius: 8px;
}

.balance-card {
  position: relative;
  padding: 20px 18px 18px;
  box-shadow: inset 0 0 0 1px rgba(46, 209, 170, 0.14);
}

#balanceView {
  overflow-anchor: none;
}

.gear {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.refresh-button {
  position: absolute;
  top: 14px;
  right: 54px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 25px;
  line-height: 1;
}

.refresh-button.refreshing {
  color: var(--mint);
  animation: refresh-spin 0.8s linear infinite;
}

@keyframes refresh-spin {
  to { transform: rotate(360deg); }
}

.eyebrow {
  font-weight: 800;
  font-size: 14px;
}

.eyebrow span {
  display: block;
  margin-top: 4px;
  font-weight: 500;
  font-size: 12px;
}

.balance {
  margin-top: 0;
  padding-right: 38px;
  font-size: 36px;
  font-weight: 850;
}

.sub-balance {
  margin-top: 4px;
  font-size: 15px;
}

.balance-meta {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 8px;
}

.exchange-rate {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.exchange-rate.hidden {
  display: none;
}

.refresh-state {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(46, 209, 170, 0.32);
  border-radius: 999px;
  background: rgba(15, 21, 25, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
  color: var(--mint);
  font-size: 11px;
  font-weight: 800;
  transform: translateX(-50%);
}

.refresh-state.hidden {
  display: none;
}

.refresh-state span {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(46, 209, 170, 0.25);
  border-top-color: var(--mint);
  border-radius: 50%;
  animation: refresh-spin 0.7s linear infinite;
}

.pnl-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-top: 18px;
}

.pnl-row span {
  color: var(--muted);
  font-size: 13px;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.settings-panel {
  margin-top: 10px;
  padding: 14px;
}

.settings-panel.hidden,
.hidden {
  display: none;
}

.settings-panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.settings-panel label {
  display: block;
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.segmented.compact {
  grid-template-columns: repeat(2, 1fr);
  width: 160px;
}

.segmented button,
.tabs button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 9px 6px;
  font-size: 12px;
}

.segmented .active,
.tabs .active {
  border-color: var(--mint);
  background: rgba(46, 209, 170, 0.18);
  color: var(--mint);
}

.api-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.api-card {
  padding: 12px;
}

.api-card strong {
  display: block;
  margin-bottom: 6px;
}

.api-card .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--green);
}

.api-card .dot.error {
  background: var(--red);
}

.api-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.api-card .error-text {
  margin-top: 6px;
  color: var(--red);
}

.panel {
  margin-top: 12px;
  padding: 12px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-title h2 {
  margin: 0;
  font-size: 17px;
}

.section-title span {
  font-size: 12px;
}

.position-list {
  display: grid;
  gap: 10px;
}

.position-group {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.position-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.position-group-head strong {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  font-size: 14px;
  line-height: 1.25;
}

.position-group-head strong .dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
}

.position-group-head strong .dot.error {
  background: var(--red);
}

.position-group-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.available-usdt {
  min-width: 86px;
  text-align: right;
}

.available-usdt em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 10px;
  line-height: 1.2;
}

.available-usdt b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.account-pnl {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 800;
  line-height: 14px;
  white-space: nowrap;
}

.asset-summary-row {
  display: grid;
  grid-template-columns: 1.08fr 1.02fr 1fr;
  gap: 8px;
  align-items: end;
  margin-top: 9px;
}

.asset-strip {
  grid-column: 1 / 3;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
  min-height: 28px;
}

.group-pnl-summary {
  display: grid;
  justify-items: end;
  justify-self: end;
  align-content: center;
  min-height: 30px;
  max-width: 138px;
  text-align: right;
}

.group-pnl-summary strong,
.group-pnl-summary span {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-pnl-summary strong {
  font-size: 14px;
  font-weight: 850;
  line-height: 16px;
}

.group-pnl-summary span {
  font-size: 12px;
  font-weight: 850;
  line-height: 14px;
}

.asset-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 108px;
  min-height: 22px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-chip b {
  color: var(--text);
  font-size: 10px;
}

.asset-chip.muted {
  color: var(--muted);
}

.table-head,
.position-row {
  display: grid;
  grid-template-columns: 1.08fr 1.02fr 1fr;
  gap: 8px;
  align-items: start;
}

.table-head {
  padding: 8px 4px 7px;
  color: var(--muted);
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}

.position-table-head {
  margin-top: 9px;
}

.table-head span:nth-child(2) {
  justify-self: center;
  width: min(100%, 108px);
  text-align: left;
}

.table-head span:nth-child(3) {
  justify-self: end;
  text-align: right;
}

.position-row {
  min-height: 52px;
  padding: 8px 4px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  appearance: none;
  background: transparent;
  color: inherit;
  text-align: left;
  user-select: none;
  -webkit-touch-callout: none;
}

.position-main,
.investment,
.qty-profit {
  display: grid;
  grid-template-rows: 17px 18px;
  align-content: start;
  min-height: 38px;
}

.position-row.pressing {
  border-radius: 8px;
  background: rgba(46, 209, 170, 0.08);
}

.symbol {
  font-weight: 800;
  font-size: 14px;
  line-height: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.position-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 18px;
}

.lev-chip {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 18px;
}

.lev-chip.long {
  background: rgba(83, 212, 127, 0.2);
  color: var(--green);
}

.lev-chip.short {
  background: rgba(255, 100, 100, 0.2);
  color: var(--red);
}

.position-roi {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.investment,
.qty-profit {
  font-size: 13px;
  font-weight: 800;
  line-height: 17px;
}

.investment {
  justify-self: center;
  width: min(100%, 108px);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qty-profit {
  text-align: right;
}

.investment span,
.qty-profit span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qty-profit span {
  font-size: 12px;
  font-weight: 800;
}

.qty-profit span.positive {
  color: var(--green);
}

.qty-profit span.negative {
  color: var(--red);
}

.empty-state {
  padding: 16px 8px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.empty-state.compact {
  padding: 10px 6px 4px;
}

.leverage-drawer {
  position: fixed;
  right: max(14px, calc((100vw - 430px) / 2 + 14px));
  bottom: calc(76px + env(safe-area-inset-bottom));
  left: max(14px, calc((100vw - 430px) / 2 + 14px));
  z-index: 60;
  max-height: calc(100dvh - 110px - env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 27, 32, 0.98);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.drawer-title {
  display: grid;
  grid-template-columns: 1fr auto 32px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.drawer-title b {
  font-size: 15px;
}

.drawer-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--mint);
}

.ticks {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.leverage-limit-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.primary-button {
  width: 100%;
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  padding: 10px;
  background: var(--mint);
  color: #06100e;
  font-weight: 800;
}

.spot-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.spot-item {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.spot-item strong {
  display: block;
  font-size: 13px;
}

.spot-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.tabs,
.chart-metric-tabs {
  display: grid;
  gap: 6px;
}

.tabs {
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: 10px;
}

.chart-metric-tabs {
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 10px;
}

.chart-metric-tabs button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 12px;
}

.chart-metric-tabs .active {
  border-color: var(--mint);
  background: rgba(46, 209, 170, 0.18);
  color: var(--mint);
}

.chart-settings-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.chart-settings-panel {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.chart-settings-panel.hidden {
  display: none;
}

.chart-settings-panel label {
  color: var(--muted);
  font-size: 11px;
}

.chart-settings-panel .tabs,
.chart-settings-panel .chart-metric-tabs {
  margin-bottom: 0;
}

canvas {
  width: 100%;
}

.chart-canvas-wrap {
  position: relative;
  height: 150px;
}

.chart-canvas-wrap canvas {
  display: block;
  height: 150px;
  touch-action: none;
}

.bottom-tabbar {
  position: fixed;
  right: 50%;
  bottom: 0;
  left: 50%;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 430px);
  min-height: calc(68px + env(safe-area-inset-bottom));
  margin: 0;
  padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 19, 22, 0.98);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.bottom-tabbar button {
  display: grid;
  grid-template-rows: 25px 16px;
  place-items: center;
  align-content: center;
  gap: 3px;
  min-height: 52px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bottom-tabbar button.active {
  color: var(--text);
}

.tab-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
}

.tab-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.tab-label {
  line-height: 16px;
  white-space: nowrap;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  width: 126px;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(21, 27, 32, 0.96);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  text-align: center;
}

.chart-tooltip strong {
  display: block;
  font-size: 13px;
  line-height: 16px;
}

.chart-tooltip span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 13px;
}

.chart-tooltip.positive strong {
  color: var(--green);
}

.chart-tooltip.negative strong {
  color: var(--red);
}

.chart-point {
  position: absolute;
  z-index: 4;
  width: 11px;
  height: 11px;
  border: 2px solid #f5f7f8;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(46, 209, 170, 0.2);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.leader-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 4px 0 10px;
}

.address-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 6px;
}

.address-form input,
.address-form button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 12px;
}

.address-form input {
  min-width: 0;
  padding: 0 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.address-form button {
  color: var(--mint);
  font-weight: 800;
}

.connection-state {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
  font-size: 11px;
  white-space: nowrap;
}

.connection-state .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.connection-state.error {
  color: var(--yellow);
}

.leader-panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  background: rgba(11, 15, 18, 0.64);
}

.leader-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.leader-tabs button {
  position: relative;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.leader-tabs button::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
}

.leader-tabs button.active {
  color: var(--text);
}

.leader-tabs button.active::after {
  background: #f05a28;
}

.leader-tabs b {
  margin-left: 3px;
  color: var(--mint);
  font-size: 13px;
}

.hyper-table-head {
  display: grid;
  min-height: 38px;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  color: var(--muted);
  font-size: 10px;
}

.positions-head {
  grid-template-columns: minmax(74px, 1fr) minmax(64px, 0.9fr) minmax(82px, 1.1fr);
  gap: 5px;
  padding-right: 28px;
}

.positions-head span:nth-child(n + 2) {
  text-align: right;
}

.hyper-sort-button {
  justify-self: end;
  padding: 6px 0 6px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
}

.hyper-sort-button.active {
  color: var(--mint);
}

.hyper-list {
  min-width: 0;
}

.hyper-position-row {
  display: grid;
  grid-template-columns: minmax(74px, 1fr) minmax(64px, 0.9fr) minmax(82px, 1.1fr) 10px;
  gap: 5px;
  align-items: center;
  width: 100%;
  min-height: 55px;
  padding: 7px 10px 7px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: transparent;
  text-align: left;
}

.hyper-position-qty,
.hyper-position-pnl {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
}

.hyper-position-pnl {
  font-size: 12.5px;
  font-weight: 850;
}

.hyper-position-row.pressing {
  background: rgba(46, 209, 170, 0.08);
}

.hyper-position-row > i,
.hyper-order-group > i {
  color: #77818a;
  font-size: 22px;
  font-style: normal;
  text-align: right;
}

.hyper-asset {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 3px 5px;
  min-width: 0;
}

.hyper-asset strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hyper-asset small {
  justify-self: start;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 8px;
}

.hyper-asset em {
  grid-column: 1 / 3;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.symbol-order-head {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 7px;
  align-items: center;
  width: 100%;
  min-height: 45px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  background: transparent;
  text-align: left;
}

.symbol-order-head.hidden {
  display: none;
}

.symbol-order-head b {
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 10px;
}

.hyper-order-group {
  display: grid;
  grid-template-columns: 1fr auto 12px;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 50px;
  padding: 7px 10px 7px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: transparent;
  text-align: left;
}

.hyper-order-group > span:first-child {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hyper-order-group small {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 8px;
}

.hyper-order-group > span:nth-child(2) {
  color: var(--muted);
  font-size: 10px;
}

.orders-head {
  grid-template-columns: 0.68fr 1fr 1fr 0.82fr;
}

.orders-head span:nth-child(n + 2) {
  text-align: right;
}

.hyper-order-row {
  display: grid;
  grid-template-columns: 0.68fr 1fr 1fr 0.82fr;
  gap: 6px;
  align-items: center;
  min-height: 48px;
  width: 100%;
  padding: 7px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 11px;
}

.hyper-order-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hyper-order-row > span:nth-child(n + 2) {
  text-align: right;
}

.order-status {
  justify-self: end;
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 9px;
}

.order-status.partial {
  background: rgba(244, 197, 66, 0.14);
  color: var(--yellow);
}

.fill-progress {
  grid-column: 2 / 5;
  overflow: hidden;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.fill-progress i {
  display: block;
  height: 100%;
  background: var(--yellow);
}

.hyper-order-row > small {
  grid-column: 2 / 5;
  color: var(--muted);
  text-align: right;
  font-size: 9px;
}

.hyper-message {
  min-height: 18px;
  padding: 5px 12px;
  color: var(--yellow);
  font-size: 10px;
}

.empty-page {
  margin-top: 4px;
  text-align: center;
}

.empty-page h2 {
  margin: 4px 0;
  font-size: 18px;
}

.empty-page p {
  color: var(--muted);
  font-size: 12px;
}

.copy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 4px 2px 10px;
}

.copy-header h2 {
  margin: 0;
  font-size: 18px;
}

.copy-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.copy-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.copy-status.running {
  background: rgba(83, 212, 127, 0.14);
  color: var(--green);
}

.copy-status.live {
  background: rgba(255, 100, 100, 0.14);
  color: var(--red);
}

.copy-panel {
  margin-bottom: 10px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}

.copy-profile-panel {
  padding: 9px 10px;
}

.copy-profile-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.copy-profile-summary-text {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 2px 7px;
}

.copy-profile-summary-text > span {
  color: var(--muted);
  font-size: 9px;
}

.copy-profile-summary-text strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-profile-summary-text small {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-profile-summary-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
}

.copy-profile-summary-actions button {
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
}

.copy-profile-summary-actions .primary {
  border-color: rgba(46, 209, 170, 0.35);
  background: rgba(46, 209, 170, 0.16);
  color: var(--mint);
}

.copy-profile-summary-actions .danger {
  border-color: rgba(255, 100, 100, 0.35);
  background: rgba(255, 100, 100, 0.12);
  color: var(--red);
}

.copy-profile-settings {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.copy-profile-settings.hidden {
  display: none;
}

.copy-panel > label,
.copy-profile-row label,
.copy-two-columns label {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
}

.copy-panel input,
.copy-panel select,
.copy-small-button,
.copy-actions button,
.copy-rule-row button {
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12px;
}

.copy-panel input,
.copy-panel select {
  width: 100%;
  padding: 0 9px;
}

.mono-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.copy-profile-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  align-items: end;
}

.copy-small-button {
  margin-bottom: 8px;
  padding: 0 10px;
  color: var(--mint);
  font-weight: 800;
}

.copy-two-columns,
.copy-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.copy-actions button {
  font-weight: 800;
}

.copy-actions .primary {
  border-color: rgba(46, 209, 170, 0.35);
  background: rgba(46, 209, 170, 0.16);
  color: var(--mint);
}

.copy-actions .danger {
  border-color: rgba(255, 100, 100, 0.35);
  background: rgba(255, 100, 100, 0.12);
  color: var(--red);
}

.copy-rule-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
}

.copy-rule-row button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 10px;
}

.copy-message {
  min-height: 14px;
  margin-top: 6px;
  color: var(--yellow);
  font-size: 10px;
}

.copy-symbol-panel .section-title {
  margin-bottom: 7px;
}

.copy-symbol-title-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.copy-symbol-title-actions #copyStopSelect {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(255, 91, 112, 0.35);
  border-radius: 6px;
  background: rgba(255, 91, 112, 0.06);
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
}

.copy-symbol-title-actions #copyStopSelect:disabled {
  opacity: 0.35;
}

.copy-symbol-panel .section-title h2,
.copy-panel .section-title h2 {
  font-size: 14px;
}

.copy-symbol-panel .section-title span,
.copy-panel .section-title span {
  font-size: 9px;
}

.copy-symbol-head,
.copy-symbol-row {
  display: grid;
  grid-template-columns: 1.02fr 1.18fr 76px;
  gap: 6px;
  align-items: center;
}

.copy-symbol-head {
  min-height: 30px;
  padding: 0 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  color: var(--muted);
  font-size: 9px;
}

.copy-symbol-head span:nth-child(n + 2) {
  text-align: right;
}

.copy-symbol-row {
  position: relative;
  min-height: 54px;
  padding: 6px 2px 6px 34px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.copy-symbol-row.unsupported {
  opacity: 0.48;
}

.copy-symbol-toggle {
  position: absolute;
  top: 18px;
  left: 2px;
  width: 26px;
  height: 16px;
}

.copy-symbol-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.copy-symbol-toggle span {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: #303940;
}

.copy-symbol-toggle span::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #9aa3aa;
  content: "";
  transition: transform 0.15s ease;
}

.copy-symbol-toggle input:checked + span {
  background: rgba(46, 209, 170, 0.42);
}

.copy-symbol-toggle input:checked + span::after {
  background: var(--mint);
  transform: translateX(10px);
}

.copy-symbol-name,
.copy-symbol-qty {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.copy-symbol-name strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-symbol-name small,
.copy-symbol-qty small {
  color: var(--muted);
  font-size: 8px;
}

.copy-symbol-qty {
  text-align: right;
}

.copy-symbol-qty span {
  overflow: hidden;
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-panel .copy-scale-input {
  min-height: 30px;
  padding: 0 5px;
  text-align: right;
  font-size: 11px;
}

.copy-execution-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  gap: 6px;
  align-items: center;
  min-height: 42px;
  padding: 5px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  font-size: 10px;
}

.copy-execution-row > small {
  grid-column: 2 / 5;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8px;
}

.execution-status {
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.execution-status.executed {
  color: var(--green);
}

.execution-status.failed {
  color: var(--red);
}

.leader-selection-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 6px 10px 5px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.leader-selection-toolbar span {
  flex: 1;
  color: var(--muted);
  font-size: 9px;
}

.leader-selection-toolbar button,
.hyper-chart-tools button {
  min-height: 29px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 10px;
  font-weight: 750;
}

.leader-selection-toolbar button.active {
  border-color: rgba(255, 100, 100, 0.48);
  color: var(--red);
}

.hyper-select-check {
  display: none;
  width: 20px;
  height: 20px;
  border: 1px solid #66737c;
  border-radius: 50%;
  place-items: center;
  color: #07110e;
  font-size: 12px;
  font-weight: 900;
}

.hyper-position-row.selection-mode {
  grid-template-columns: 22px minmax(70px, 1fr) minmax(58px, 0.82fr) minmax(78px, 1.08fr);
  gap: 4px;
}

.hyper-position-row.selection-mode > i {
  display: none;
}

.hyper-position-row.selection-mode .hyper-select-check {
  display: grid;
}

.hyper-position-row.selection-mode.selected {
  background: rgba(46, 209, 170, 0.085);
}

.hyper-position-row.selection-mode.selected .hyper-select-check {
  border-color: var(--mint);
  background: var(--mint);
}

.hyper-position-row.selection-mode.unsupported {
  opacity: 0.42;
}

.hyper-selection-bar {
  position: fixed;
  right: 50%;
  bottom: calc(68px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 45;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  width: min(100%, 430px);
  min-height: 55px;
  padding: 7px 12px;
  border-top: 1px solid var(--line);
  background: rgba(21, 27, 32, 0.98);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.hyper-selection-bar.hidden {
  display: none;
}

.hyper-selection-bar strong {
  text-align: center;
  font-size: 13px;
}

.hyper-selection-bar button,
.copy-batch-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  font-size: 11px;
  font-weight: 800;
}

.hyper-selection-bar button.primary,
.copy-batch-actions button.primary {
  border-color: transparent;
  background: var(--mint);
  color: #06110e;
}

.hyper-selection-bar button:disabled {
  opacity: 0.4;
}

.copy-stop-selection-bar button.danger {
  border-color: rgba(255, 91, 112, 0.42);
  background: rgba(255, 91, 112, 0.13);
  color: var(--red);
}

.copy-batch-sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: end;
  justify-content: center;
}

.copy-batch-sheet.hidden {
  display: none;
}

.copy-batch-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.62);
}

.copy-batch-card {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  max-height: min(82vh, 720px);
  padding: 15px 14px calc(14px + env(safe-area-inset-bottom));
  overflow: auto;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: #151b20;
  box-shadow: 0 -18px 44px rgba(0, 0, 0, 0.35);
}

.copy-batch-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.copy-batch-head h2,
.copy-batch-head p {
  margin: 0;
}

.copy-batch-head h2 {
  font-size: 17px;
}

.copy-batch-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.copy-batch-head > button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 25px;
}

.copy-batch-presets {
  margin-top: 14px;
}

.copy-batch-presets > span {
  color: var(--muted);
  font-size: 10px;
}

.copy-batch-presets > div {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-top: 6px;
}

.copy-batch-presets button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 10px;
}

.copy-batch-presets button.active {
  border-color: var(--mint);
  color: var(--mint);
}

.copy-batch-list {
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.copy-batch-row {
  display: grid;
  grid-template-columns: 1fr auto 88px;
  gap: 8px;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.copy-batch-row strong,
.copy-batch-row small {
  display: block;
}

.copy-batch-row strong {
  font-size: 12px;
}

.copy-batch-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.copy-batch-row > span {
  color: var(--muted);
  text-align: right;
  font-size: 9px;
}

.copy-batch-row input {
  width: 88px;
  min-height: 34px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  text-align: right;
}

.copy-batch-actions {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 8px;
  margin-top: 8px;
}

.hyper-order-chart-panel {
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  background: #101519;
}

.hyper-chart-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px 6px;
}

.hyper-chart-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.hyper-chart-actions .hyper-indicator-toggle,
.hyper-chart-actions .hyper-indicator-settings {
  min-width: 30px;
  padding: 0 6px;
}

.hyper-bollinger-panel {
  display: grid;
  grid-template-columns: 1fr 1fr 48px;
  gap: 6px;
  align-items: end;
  padding: 0 9px 8px;
}

.hyper-bollinger-panel.hidden {
  display: none;
}

.hyper-bollinger-panel label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 8px;
}

.hyper-bollinger-panel input,
.hyper-bollinger-panel button {
  min-height: 30px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 10px;
}

.hyper-bollinger-panel input {
  width: 100%;
}

.hyper-chart-intervals {
  display: flex;
  gap: 3px;
}

.hyper-chart-tools .hyper-chart-intervals button {
  min-width: 34px;
  padding: 0 6px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.hyper-chart-tools button.active {
  border-color: rgba(46, 209, 170, 0.4);
  background: rgba(46, 209, 170, 0.09);
  color: var(--mint);
}

.hyper-chart-wrap {
  position: relative;
  height: 280px;
}

.hyper-order-chart {
  display: block;
  width: 100%;
  height: 280px;
  touch-action: none;
}

#leverageSlider {
  touch-action: none;
}

.position-group,
.position-row,
.hyper-position-row,
.hyper-order-group,
.hyper-order-row,
.copy-symbol-row,
.copy-execution-row,
.spot-item {
  content-visibility: auto;
  contain-intrinsic-size: auto 56px;
}

.hyper-chart-message {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 21, 25, 0.75);
  color: var(--muted);
  text-align: center;
  font-size: 10px;
  pointer-events: none;
}

.hyper-chart-message:empty {
  display: none;
}

.hyper-chart-legend {
  display: flex;
  gap: 10px;
  padding: 3px 10px 8px;
  color: var(--muted);
  font-size: 8px;
}

.hyper-chart-legend span::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 3px;
  border-radius: 50%;
  content: "";
}

.hyper-chart-legend .buy::before { background: var(--green); }
.hyper-chart-legend .sell::before { background: var(--red); }
.hyper-chart-legend .entry::before { background: #5da8ff; }
.hyper-chart-legend .fill::before { background: var(--yellow); }

.hyper-order-row.chart-selected {
  background: rgba(244, 197, 66, 0.08);
  box-shadow: inset 3px 0 var(--yellow);
}

@media (max-width: 380px) {
  .balance {
    font-size: 31px;
  }

  .table-head,
  .position-row,
  .asset-summary-row {
    grid-template-columns: 1.04fr 1fr 0.95fr;
    gap: 6px;
  }

  .leader-header {
    grid-template-columns: 1fr;
  }

  .connection-state {
    justify-self: end;
    margin-top: -2px;
  }
}

/* 2026-07 flat mobile dashboard */
body {
  background: #0b0f12;
}

.app-shell {
  width: min(100%, 430px);
  padding: 0 12px 88px;
}

.balance-card,
.panel,
.api-card,
.leader-panel,
.copy-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.balance-card {
  margin: 0 -12px;
  padding: 18px 18px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.balance-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.balance {
  padding-right: 78px;
  font-size: 32px;
  line-height: 1.12;
}

.balance-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
}

.sub-balance,
.exchange-rate {
  margin: 0;
  font-size: 11px;
}

.api-cards {
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
}

.api-card {
  padding: 11px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.panel {
  margin-top: 0;
  padding: 0;
}

.section-title {
  min-height: 45px;
  margin: 0;
  padding: 12px 4px 8px;
}

.section-title h2 {
  font-size: 15px;
}

.position-list {
  gap: 0;
}

.position-group {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.position-group + .position-group {
  margin-top: 14px;
}

.position-group-head {
  align-items: center;
  padding: 10px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.group-pnl-summary {
  min-height: 0;
  max-width: 150px;
}

.group-pnl-summary strong {
  font-size: 13px;
}

.group-pnl-summary span {
  margin-top: 1px;
  color: inherit;
  font-size: 11px;
}

.table-head,
.position-row {
  grid-template-columns: minmax(82px, 1.15fr) minmax(86px, 1.05fr) minmax(52px, 0.7fr) minmax(76px, 1fr);
  gap: 5px;
}

.position-table-head {
  margin-top: 0;
  padding: 8px 8px 7px 12px;
}

.table-head span:nth-child(2),
.table-head span:nth-child(3),
.table-head span:nth-child(4) {
  justify-self: stretch;
  width: auto;
  text-align: right;
}

.position-row {
  position: relative;
  min-height: 64px;
  padding: 10px 8px 9px 12px;
  align-items: center;
}

.position-row.pnl-positive,
.hyper-position-row.pnl-positive {
  box-shadow: inset 3px 0 var(--green);
}

.position-row.pnl-negative,
.hyper-position-row.pnl-negative {
  box-shadow: inset 3px 0 var(--red);
}

.position-row.pnl-neutral,
.hyper-position-row.pnl-neutral {
  box-shadow: inset 3px 0 #66737c;
}

.position-row.pnl-positive,
.position-row.pnl-negative,
.position-row.pnl-neutral,
.hyper-position-row.pnl-positive,
.hyper-position-row.pnl-negative,
.hyper-position-row.pnl-neutral {
  box-shadow: none;
}

.position-main,
.investment,
.position-pnl {
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  min-height: 38px;
}

.position-meta {
  gap: 3px;
}

.lev-chip,
.direction-chip {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 9px;
  line-height: 17px;
}

.lev-chip.leverage {
  background: rgba(255, 255, 255, 0.08);
  color: #c9d0d5;
}

.direction-chip.long {
  background: rgba(83, 212, 127, 0.14);
  color: var(--green);
}

.direction-chip.short {
  background: rgba(255, 100, 100, 0.14);
  color: var(--red);
}

.investment {
  justify-items: end;
  text-align: right;
  font-size: 12px;
  font-weight: 750;
}

.investment span {
  font-size: 9px;
  font-weight: 500;
}

.position-quantity {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
}

.position-pnl {
  justify-items: end;
  text-align: right;
}

.position-pnl strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.position-pnl span {
  color: inherit;
  font-size: 10px;
  font-weight: 800;
}

.leader-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin: 0 -12px;
  padding: 14px 12px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.leader-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.leader-title-row h2 {
  margin: 0;
  font-size: 18px;
}

.connection-state {
  justify-self: auto;
}

.leader-panel {
  overflow: visible;
  margin: 0 -12px;
}

.leader-tabs button {
  min-height: 44px;
}

.leader-tabs button.active::after {
  background: var(--mint);
}

.leader-selection-toolbar,
.hyper-table-head {
  padding-right: 12px;
  padding-left: 12px;
}

.hyper-position-row {
  min-height: 60px;
}

.copy-header {
  margin: 0 -12px;
  padding: 15px 12px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.copy-panel {
  margin: 0;
  padding: 0;
}

.copy-profile-panel {
  padding: 9px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.copy-profile-settings {
  padding: 10px 4px 2px;
}

.copy-symbol-head,
.copy-symbol-row {
  grid-template-columns: minmax(68px, 0.9fr) minmax(76px, 1fr) minmax(82px, 1.1fr) 64px;
  gap: 5px;
}

.copy-symbol-head {
  min-height: 34px;
  padding: 0 4px;
}

.copy-symbol-head span:nth-child(n + 2) {
  text-align: right;
}

.copy-symbol-head span:first-child {
  text-align: left;
}

.copy-symbol-row {
  min-height: 58px;
  padding: 7px 4px;
}

.copy-symbol-row.stop-selection-mode {
  padding-left: 32px;
}

.copy-stop-check {
  position: absolute;
  top: 50%;
  left: 4px;
  display: grid;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid #66737c;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.22);
  color: #07110e;
  font-size: 12px;
  font-weight: 900;
  place-items: center;
  transform: translateY(-50%);
}

.copy-symbol-row.stop-selected .copy-stop-check {
  border-color: var(--red);
  background: var(--red);
}

.copy-symbol-toggle {
  position: relative;
  top: auto;
  left: auto;
  display: grid;
  width: 38px;
  height: 42px;
  place-items: center;
}

.copy-symbol-toggle span {
  position: relative;
  inset: auto;
  width: 20px;
  height: 20px;
  border: 1px solid #66737c;
  border-radius: 5px;
  background: transparent;
}

.copy-symbol-toggle span::after {
  display: none;
}

.copy-symbol-toggle input:checked + span {
  border-color: var(--mint);
  background: var(--mint);
}

.copy-symbol-toggle input:checked + span::after {
  position: absolute;
  top: 1px;
  left: 5px;
  display: block;
  width: 6px;
  height: 11px;
  border: solid #07110e;
  border-width: 0 2px 2px 0;
  border-radius: 0;
  background: transparent;
  content: "";
  transform: rotate(45deg);
}

.copy-symbol-qty {
  text-align: right;
}

.copy-symbol-source {
  display: grid;
  gap: 2px;
  min-width: 0;
  justify-items: end;
  text-align: right;
}

.copy-symbol-source strong,
.copy-symbol-source small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-symbol-source strong {
  font-size: 10px;
}

.copy-symbol-source small {
  color: var(--muted);
  font-size: 8px;
}

.copy-panel .copy-scale-input {
  min-height: 32px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
}

@media (max-width: 380px) {
  .table-head,
  .position-row {
    grid-template-columns: minmax(76px, 1.1fr) minmax(76px, 1fr) minmax(48px, 0.65fr) minmax(70px, 0.95fr);
    gap: 4px;
  }

  .copy-symbol-head,
  .copy-symbol-row {
    grid-template-columns: minmax(60px, 0.85fr) minmax(68px, 0.95fr) minmax(74px, 1.05fr) 58px;
    gap: 4px;
  }
}

.bottom-tabbar {
  grid-template-columns: repeat(3, 1fr);
}

.bottom-tabbar button {
  font-size: 10px;
}

.dashboard-tab-icon {
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -12px;
  padding: 15px 12px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dashboard-header h2,
.dashboard-header p {
  margin: 0;
}

.dashboard-header-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.dashboard-header-actions #dashboardCollapseAll {
  border-color: var(--line);
  color: var(--muted);
}

.dashboard-header h2 {
  font-size: 18px;
}

.dashboard-header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-header button,
.dashboard-add-form button,
.dashboard-leader-actions button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.dashboard-header button,
.dashboard-add-form .primary {
  border-color: rgba(46, 209, 170, 0.38);
  color: var(--mint);
}

.dashboard-add-form {
  display: grid;
  gap: 9px;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dashboard-add-form.hidden {
  display: none;
}

.dashboard-add-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-add-form input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.dashboard-add-form > div {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.dashboard-message {
  min-height: 28px;
  padding: 8px 4px 5px;
  color: var(--yellow);
  font-size: 10px;
  line-height: 1.4;
}

.dashboard-list {
  display: grid;
  gap: 14px;
}

.dashboard-leader-card {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.dashboard-leader-card > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 11px 4px 8px;
}

.dashboard-leader-card > header > div:first-child {
  min-width: 0;
}

.dashboard-leader-card header strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.dashboard-leader-name-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.dashboard-leader-card header .dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
}

.dashboard-leader-card header .dot.error {
  background: var(--yellow);
}

.dashboard-leader-card header small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-leader-pnl {
  display: grid;
  justify-items: end;
}

.dashboard-leader-pnl b {
  font-size: 13px;
}

.dashboard-leader-pnl span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.dashboard-leader-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 0 4px 8px;
}

.dashboard-leader-card.collapsed .dashboard-position-head,
.dashboard-leader-card.collapsed .dashboard-positions {
  display: none;
}

.dashboard-leader-actions > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 9px;
}

.dashboard-leader-actions button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 9px;
}

.dashboard-leader-actions button.danger {
  color: var(--red);
}

.dashboard-leader-actions button:disabled {
  opacity: 0.35;
}

.dashboard-position-head,
.dashboard-position-row {
  display: grid;
  grid-template-columns: 35px minmax(78px, 1fr) minmax(65px, 0.85fr) minmax(78px, 1fr);
  gap: 5px;
  align-items: center;
}

.dashboard-position-head {
  min-height: 32px;
  padding: 0 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 9px;
}

.dashboard-position-head span:nth-child(n + 3) {
  text-align: right;
}

.dashboard-position-head button {
  justify-self: end;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-position-row {
  position: relative;
  width: 100%;
  min-height: 58px;
  padding: 7px 5px 15px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.dashboard-position-row.selected {
  background: rgba(46, 209, 170, 0.055);
}

.dashboard-check {
  display: grid;
  width: 20px;
  height: 20px;
  border: 1px solid #66737c;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.22);
  place-items: center;
  color: #07110e;
  font-size: 12px;
  font-weight: 900;
}

.dashboard-check:disabled {
  border-color: rgba(170, 180, 188, 0.28);
  background: rgba(170, 180, 188, 0.14);
  color: var(--muted);
  opacity: 1;
}

.dashboard-check:disabled::after {
  content: "–";
}

.dashboard-position-row.selected .dashboard-check {
  border-color: var(--mint);
  background: var(--mint);
}

.dashboard-symbol {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.leader-detail-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.leader-detail-title button {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  place-items: center;
  font-size: 23px;
}

.dashboard-symbol strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-symbol small {
  color: var(--muted);
  font-size: 8px;
}

.dashboard-qty,
.dashboard-pnl {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
}

.dashboard-copy-owner {
  position: absolute;
  right: 5px;
  bottom: 4px;
  color: var(--muted);
  font-size: 8px;
}

.dashboard-empty {
  display: grid;
  gap: 5px;
  justify-items: center;
  padding: 56px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.dashboard-empty strong {
  color: var(--text);
  font-size: 14px;
}
