.stk-trade-sim {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  flex-direction: column;
  background: #06080c;
  color: #e8f4ff;
  font-family: Arial, sans-serif;
}

.stk-trade-sim.is-open {
  display: flex;
}

#stkTradeSimChartsPickerModal.password-modal {
  z-index: 12100;
}

.stk-trade-sim__watch-action {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 12150;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.stk-trade-sim__watch-action.is-open {
  display: flex;
}

.stk-trade-sim__watch-action[hidden] {
  display: none !important;
}

.stk-trade-sim__watch-action-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.62);
  cursor: pointer;
}

.stk-trade-sim__watch-action-card {
  position: relative;
  z-index: 1;
  width: min(18rem, 92vw);
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 0.9rem 0.9rem;
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 12px;
  background: rgba(9, 18, 28, 0.98);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55);
  transform: scale(1.06);
  animation: stk-trade-sim-watch-pop 0.18s ease-out;
}

@keyframes stk-trade-sim-watch-pop {
  from {
    opacity: 0.7;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1.06);
  }
}

.stk-trade-sim__watch-action-label {
  font: 700 1.15rem/1.1 Arial, sans-serif;
  color: #f6e8c8;
}

.stk-trade-sim__watch-action-stats {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  font: 700 0.82rem/1.2 Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

.stk-trade-sim__watch-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.stk-trade-sim__watch-action-remove,
.stk-trade-sim__watch-action-cancel {
  min-height: 2.65rem;
  border-radius: 8px;
  font: 700 0.78rem/1 Arial, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}

.stk-trade-sim__watch-action-remove {
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.55);
  color: #fecaca;
}

.stk-trade-sim__watch-action-cancel {
  border: 1px solid rgba(134, 175, 206, 0.35);
  background: rgba(9, 18, 28, 0.88);
  color: rgba(214, 224, 235, 0.92);
}

.stk-trade-sim__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(134, 175, 206, 0.28);
  background: linear-gradient(180deg, rgba(16, 24, 36, 0.98), rgba(8, 12, 18, 0.98));
}

.stk-trade-sim__title {
  margin: 0;
  color: var(--card-gold, #d4af37);
  font: 400 1.05rem/1.2 "Uncial Antiqua", "Times New Roman", serif;
  letter-spacing: 0.02em;
}

.stk-trade-sim__profile {
  margin: 0;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(134, 175, 206, 0.35);
  background: rgba(9, 18, 28, 0.72);
  color: rgba(214, 224, 235, 0.92);
  font: 700 0.68rem/1 Arial, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
}

.stk-trade-sim__profile.is-active-view {
  border-color: rgba(212, 175, 55, 0.65);
  background: rgba(212, 175, 55, 0.14);
  color: #f6e8c8;
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.22);
}

.stk-trade-sim__profile.is-brother {
  border-color: rgba(212, 175, 55, 0.45);
  color: #f6e8c8;
}

.stk-trade-sim__profile.is-buddy {
  border-color: rgba(134, 206, 175, 0.45);
  color: #d8f5e8;
}

.stk-trade-sim__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-left: auto;
  align-items: stretch;
}

.stk-trade-sim__stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  min-width: 9.5rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid rgba(134, 175, 206, 0.28);
  border-radius: 8px;
  background: rgba(9, 18, 28, 0.72);
}

.stk-trade-sim__stat-label {
  color: rgba(177, 195, 210, 0.82);
  font: 600 0.72rem/1.2 Arial, sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stk-trade-sim__stat-value {
  color: #f6e8c8;
  font: 700 1.45rem/1.05 Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.stk-trade-sim__stat--pnl {
  min-width: 10.5rem;
  border-color: rgba(134, 175, 206, 0.38);
}

.stk-trade-sim__stat--pnl .stk-trade-sim__stat-value {
  font-size: 1.65rem;
}

.stk-trade-sim__stat-value.up {
  color: #4ade80;
  text-shadow: 0 0 18px rgba(74, 222, 128, 0.35);
}

.stk-trade-sim__stat-value.down {
  color: #f87171;
  text-shadow: 0 0 18px rgba(248, 113, 113, 0.35);
}

.stk-trade-sim__stat-value.is-flat {
  color: #4ade80;
  text-shadow: 0 0 18px rgba(74, 222, 128, 0.35);
}

.stk-trade-sim__close {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(134, 175, 206, 0.45);
  background: rgba(9, 18, 28, 0.92);
  color: #e8f4ff;
  font: 700 0.72rem/1 Arial, sans-serif;
  cursor: pointer;
}

.stk-trade-sim__body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(168px, 210px) minmax(0, 1fr) minmax(220px, 280px);
  grid-template-rows: minmax(0, 1fr);
}

.stk-trade-sim__watch-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid rgba(134, 175, 206, 0.2);
}

.stk-trade-sim__watch {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.35rem;
}

.stk-trade-sim__watch-foot {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.35rem;
  border-top: 1px solid rgba(134, 175, 206, 0.2);
  background: rgba(9, 18, 28, 0.72);
}

.stk-trade-sim__add-chart {
  width: 100%;
  min-height: 2.15rem;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(134, 175, 206, 0.35);
  background: rgba(9, 18, 28, 0.88);
  color: rgba(177, 195, 210, 0.88);
  font: 700 0.72rem/1 Arial, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}

.stk-trade-sim__remove-chart {
  display: none;
  width: 100%;
  min-height: 2.15rem;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(134, 175, 206, 0.35);
  background: rgba(9, 18, 28, 0.88);
  color: rgba(177, 195, 210, 0.88);
  font: 700 0.72rem/1 Arial, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}

.stk-trade-sim__remove-chart:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stk-trade-sim__add-chart.is-active,
.stk-trade-sim__remove-chart.is-active,
.stk-trade-sim__mobile-add.is-active {
  border-color: rgba(212, 175, 55, 0.55);
  background: rgba(212, 175, 55, 0.12);
  color: #f6e8c8;
}

.stk-trade-sim__account {
  display: none;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid rgba(134, 175, 206, 0.2);
}

.stk-trade-sim__body.is-panel-account .stk-trade-sim__account {
  display: flex;
}

.stk-trade-sim__body.is-panel-account .stk-trade-sim__chart,
.stk-trade-sim__body.is-panel-account .stk-trade-sim__ticket,
.stk-trade-sim__body.is-panel-history .stk-trade-sim__chart,
.stk-trade-sim__body.is-panel-history .stk-trade-sim__ticket,
.stk-trade-sim__body.is-panel-add .stk-trade-sim__chart,
.stk-trade-sim__body.is-panel-add .stk-trade-sim__ticket {
  display: none;
}

.stk-trade-sim__history-panel {
  display: none;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid rgba(134, 175, 206, 0.2);
}

.stk-trade-sim__body.is-panel-history .stk-trade-sim__history-panel {
  display: flex;
}

.stk-trade-sim__history-head {
  flex: 0 0 auto;
  padding: 0.55rem 0.65rem 0.35rem;
  border-bottom: 1px solid rgba(134, 175, 206, 0.14);
}

.stk-trade-sim__history-title {
  margin: 0;
  color: #f6e8c8;
  font: 700 0.92rem/1.2 Arial, sans-serif;
}

.stk-trade-sim__history-note {
  margin: 0.25rem 0 0;
  color: rgba(177, 195, 210, 0.72);
  font: 600 0.66rem/1.3 Arial, sans-serif;
}

.stk-trade-sim__history-total {
  flex: 0 0 auto;
  padding: 0.45rem 0.55rem 0.5rem;
  background: #06080c;
  border-bottom: 1px solid rgba(134, 175, 206, 0.14);
}

.stk-trade-sim__history-total-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.08);
  font: 600 0.72rem/1.25 Arial, sans-serif;
  color: rgba(177, 195, 210, 0.88);
}

.stk-trade-sim__history-total-row strong {
  font: 700 0.88rem/1.1 Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

.stk-trade-sim__history-total-row strong.up {
  color: #6ee7a8;
}

.stk-trade-sim__history-total-row strong.down {
  color: #f87171;
}

.stk-trade-sim__history-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.45rem 0.55rem 0.65rem;
  -webkit-overflow-scrolling: touch;
}

.stk-trade-sim__history-card {
  display: grid;
  gap: 0.28rem;
  padding: 0.55rem 0.6rem;
  margin-bottom: 0.4rem;
  border: 1px solid rgba(134, 175, 206, 0.22);
  border-radius: 8px;
  background: rgba(9, 18, 28, 0.72);
}

.stk-trade-sim__history-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.1rem;
}

.stk-trade-sim__history-side {
  font: 700 0.82rem/1.1 Arial, sans-serif;
}

.stk-trade-sim__history-side.is-buy {
  color: #6ee7a8;
}

.stk-trade-sim__history-side.is-sell {
  color: #f87171;
}

.stk-trade-sim__history-when {
  color: rgba(177, 195, 210, 0.78);
  font: 600 0.64rem/1.2 Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.stk-trade-sim__add-panel {
  display: none;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid rgba(134, 175, 206, 0.2);
}

.stk-trade-sim__body.is-panel-add .stk-trade-sim__add-panel {
  display: flex;
}

.stk-trade-sim__add-head {
  flex: 0 0 auto;
  padding: 0.55rem 0.65rem 0.35rem;
  border-bottom: 1px solid rgba(134, 175, 206, 0.14);
}

.stk-trade-sim__add-title {
  margin: 0;
  color: #f6e8c8;
  font: 700 0.92rem/1.2 Arial, sans-serif;
}

.stk-trade-sim__add-note {
  margin: 0.25rem 0 0;
  color: rgba(177, 195, 210, 0.72);
  font: 600 0.66rem/1.3 Arial, sans-serif;
}

.stk-trade-sim__add-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.65rem 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.stk-trade-sim__add-body .stk-trade-sim__field span {
  display: block;
  margin-bottom: 0.2rem;
  color: rgba(177, 195, 210, 0.82);
  font: 600 0.68rem/1.2 Arial, sans-serif;
}

.stk-trade-sim__add-error {
  min-height: 1rem;
  margin: 0;
  color: #fca5a5;
  font: 600 0.68rem/1.3 Arial, sans-serif;
}

.stk-trade-sim__add-submit {
  margin-top: 0.15rem;
  padding: 0.52rem 0.65rem;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 6px;
  background: rgba(212, 175, 55, 0.14);
  color: #f6e8c8;
  font: 700 0.78rem/1 Arial, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}

.stk-trade-sim__account-head {
  flex: 0 0 auto;
  padding: 0.55rem 0.65rem 0.35rem;
  border-bottom: 1px solid rgba(134, 175, 206, 0.14);
}

.stk-trade-sim__account-title {
  margin: 0;
  color: #f6e8c8;
  font: 700 0.92rem/1.2 Arial, sans-serif;
}

.stk-trade-sim__account-totals {
  flex: 0 0 auto;
  padding: 0.45rem 0.55rem 0.5rem;
  background: #06080c;
  border-bottom: 1px solid rgba(134, 175, 206, 0.14);
}

.stk-trade-sim__account-totals .stk-trade-sim__account-summary {
  margin: 0;
}

.stk-trade-sim__account-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.45rem 0.55rem 0.65rem;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.stk-trade-sim__account-card {
  display: grid;
  gap: 0.28rem;
  padding: 0.55rem 0.6rem;
  margin-bottom: 0.4rem;
  border: 1px solid rgba(134, 175, 206, 0.22);
  border-radius: 8px;
  background: rgba(9, 18, 28, 0.72);
  color: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
  touch-action: manipulation;
}

.stk-trade-sim__account-card-name {
  font: 700 0.88rem/1.1 Arial, sans-serif;
  color: #f6e8c8;
}

.stk-trade-sim__account-card-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font: 600 0.68rem/1.25 Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  color: rgba(177, 195, 210, 0.88);
}

.stk-trade-sim__account-card-row strong {
  color: rgba(214, 224, 235, 0.95);
  font-weight: 700;
}

.stk-trade-sim__account-card-row.is-pnl strong.up {
  color: #6ee7a8;
}

.stk-trade-sim__account-card-row.is-pnl strong.down {
  color: #f87171;
}

.stk-trade-sim__account-summary {
  margin-top: 0.35rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.08);
  display: grid;
  gap: 0.28rem;
}

.stk-trade-sim__account-summary .stk-trade-sim__account-card-row strong {
  color: #f6e8c8;
}

.stk-trade-sim__watch-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 0.2rem;
  padding: 0.45rem 0.5rem;
  margin-bottom: 0.25rem;
  border: 1px solid rgba(134, 175, 206, 0.18);
  border-radius: 6px;
  background: rgba(9, 18, 28, 0.55);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.stk-trade-sim__watch-label {
  font: 700 0.82rem/1.1 Arial, sans-serif;
}

.stk-trade-sim__watch-stats {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  font: 700 0.68rem/1.15 Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

.stk-trade-sim__watch-cash {
  color: #f6e8c8;
}

.stk-trade-sim__watch-equity {
  color: rgba(214, 224, 235, 0.92);
}

.stk-trade-sim__watch-item.is-active {
  border-color: rgba(212, 175, 55, 0.55);
  background: rgba(212, 175, 55, 0.1);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.18);
}

.stk-trade-sim__chart {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(134, 175, 206, 0.2);
}

.stk-trade-sim__chart-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.65rem;
  border-bottom: 1px solid rgba(134, 175, 206, 0.14);
  font-size: 0.78rem;
}

.stk-trade-sim__chart-symbol {
  font: 700 0.92rem/1 Arial, sans-serif;
  color: #f6e8c8;
}

.stk-trade-sim__chart-live {
  font: 700 0.88rem/1 Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

.stk-trade-sim__chart-tv-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  background: transparent;
  touch-action: pan-y;
}

.stk-trade-sim__chart-tv-card.is-crosshair-touch-enabled {
  touch-action: none;
}

.stk-trade-sim__chart-frame-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.5);
}

.stk-trade-sim .stk-tv-crosshair-layer {
  position: absolute;
  top: 40px;
  right: 54px;
  bottom: 66px;
  left: 0;
  overflow: hidden;
  pointer-events: none;
  cursor: crosshair;
  z-index: 2;
}

.stk-trade-sim .stk-tv-wrap.is-crosshair-ready .stk-tv-crosshair-layer {
  pointer-events: auto;
}

.stk-trade-sim .stk-tv-crosshair-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
}

.stk-trade-sim .stk-tv-guide-v {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(212, 175, 55, 0.85);
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.35);
  opacity: 0;
  pointer-events: none;
}

.stk-trade-sim .stk-tv-wrap.is-crosshair-active .stk-tv-guide-v {
  opacity: 1;
}

.stk-trade-sim .stk-tv-price-badge {
  position: absolute;
  right: 0;
  top: 0;
  transform: translateY(-50%);
  padding: 2px 6px;
  border-radius: 2px;
  background: #007aff;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.stk-trade-sim .stk-tv-wrap.is-crosshair-active .stk-tv-price-badge {
  opacity: 1;
}

.stk-trade-sim__chart-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #0a0a0a;
}

.stk-trade-sim__ticket {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.55rem;
  gap: 0.45rem;
  overflow: auto;
}

.stk-trade-sim__side-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.stk-trade-sim__side-tab {
  padding: 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(134, 175, 206, 0.35);
  background: rgba(9, 18, 28, 0.88);
  color: #e8f4ff;
  font: 700 0.78rem/1 Arial, sans-serif;
  cursor: pointer;
}

.stk-trade-sim__side-tab.is-buy.is-active {
  border-color: rgba(110, 231, 168, 0.55);
  background: rgba(16, 80, 48, 0.55);
  color: #b8f5d4;
}

.stk-trade-sim__side-tab.is-sell.is-active {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(96, 24, 24, 0.55);
  color: #fecaca;
}

.stk-trade-sim__field label {
  display: block;
  margin-bottom: 0.2rem;
  color: rgba(177, 195, 210, 0.82);
  font: 600 0.68rem/1.2 Arial, sans-serif;
}

.stk-trade-sim__field input,
.stk-trade-sim__field select {
  width: 100%;
  padding: 0.42rem 0.48rem;
  border-radius: 6px;
  border: 1px solid rgba(134, 175, 206, 0.35);
  background: rgba(2, 6, 12, 0.92);
  color: #e8f4ff;
  font: 600 0.78rem/1.2 Arial, sans-serif;
}

.stk-trade-sim__submit {
  margin-top: 0.15rem;
  padding: 0.52rem;
  border: 0;
  border-radius: 6px;
  font: 700 0.82rem/1 Arial, sans-serif;
  cursor: pointer;
}

.stk-trade-sim__submit.is-buy {
  background: linear-gradient(180deg, #22c55e, #15803d);
  color: #ecfdf5;
}

.stk-trade-sim__submit.is-sell {
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  color: #fef2f2;
}

.stk-trade-sim__msg {
  min-height: 1rem;
  margin: 0;
  font: 600 0.68rem/1.3 Arial, sans-serif;
  color: rgba(177, 195, 210, 0.88);
}

.stk-trade-sim__msg.is-error {
  color: #fca5a5;
}

.stk-trade-sim__msg.is-ok {
  color: #86efac;
}

.stk-trade-sim__top-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  width: 100%;
}

.stk-trade-sim__reset {
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(134, 175, 206, 0.35);
  background: transparent;
  color: rgba(177, 195, 210, 0.88);
  font: 600 0.68rem/1 Arial, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}

.stk-trade-sim__history-btn {
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(134, 175, 206, 0.35);
  background: transparent;
  color: rgba(177, 195, 210, 0.88);
  font: 600 0.68rem/1 Arial, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}

.stk-trade-sim__daily-report-btn {
  display: none;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(134, 175, 206, 0.35);
  background: transparent;
  color: rgba(177, 195, 210, 0.88);
  font: 600 0.68rem/1 Arial, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}

.stk-trade-sim__daily-report-btn-label--short {
  display: none;
}

.stk-trade-sim__history-btn.is-active {
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.12);
  color: #f6e8c8;
}

.stk-trade-sim__bottom {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(134, 175, 206, 0.2);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.stk-trade-sim__tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.35rem 0.55rem 0;
}

.stk-trade-sim__tab {
  padding: 0.35rem 0.65rem;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: rgba(177, 195, 210, 0.82);
  font: 700 0.72rem/1 Arial, sans-serif;
  cursor: pointer;
}

.stk-trade-sim__tab.is-active {
  border-color: rgba(134, 175, 206, 0.28);
  background: rgba(9, 18, 28, 0.88);
  color: #f6e8c8;
}

.stk-trade-sim__table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.35rem 0.55rem 0.55rem;
}

.stk-trade-sim__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.stk-trade-sim__table th,
.stk-trade-sim__table td {
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid rgba(134, 175, 206, 0.12);
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.stk-trade-sim__table th {
  color: rgba(177, 195, 210, 0.78);
  font-weight: 700;
  position: sticky;
  top: 0;
  background: #06080c;
}

.stk-trade-sim__empty {
  margin: 0.35rem 0;
  color: rgba(177, 195, 210, 0.72);
  font-size: 0.74rem;
}

.stk-trade-sim__pnl.up {
  color: #6ee7a8;
}

.stk-trade-sim__pnl.down {
  color: #f87171;
}

.stk-trade-sim__mobile-nav {
  display: none;
}

.stk-trade-sim input,
.stk-trade-sim select,
.stk-trade-sim textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* Phone vertical + desktop PC (not phone landscape — see nested query below) */
@media (max-width: 760px), ((max-width: 960px) and (pointer: coarse)), ((min-width: 761px) and (pointer: fine)) {
  #stkTradeSimPasswordInput {
    font-size: 16px;
  }

  .stk-trade-sim {
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 100dvh;
    max-height: 100dvh;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    overflow: hidden;
    touch-action: manipulation;
  }

  .stk-trade-sim.is-open {
    overflow: hidden;
  }

  .stk-trade-sim__top {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-rows: auto auto auto;
    align-items: center;
    gap: 0.4rem 0.5rem;
    padding: max(0.45rem, env(safe-area-inset-top, 0)) 0.55rem 0.45rem;
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .stk-trade-sim__title {
    grid-column: 1;
    grid-row: 1;
    font-size: 0.92rem;
  }

  .stk-trade-sim__profile {
    grid-column: 2;
    grid-row: 1;
    font-size: 0.62rem;
    position: relative;
    z-index: 2;
  }

  .stk-trade-sim__close {
    grid-column: 3;
    grid-row: 1;
    min-height: 2.5rem;
    min-width: 4.25rem;
    touch-action: manipulation;
  }

  .stk-trade-sim__stats {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.45rem;
    margin-left: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.1rem;
    max-width: 100%;
  }

  .stk-trade-sim__stats::-webkit-scrollbar {
    display: none;
  }

  .stk-trade-sim__stat {
    flex: 0 0 auto;
    min-width: 7.25rem;
    padding: 0.42rem 0.65rem;
  }

  .stk-trade-sim__stat--pnl {
    min-width: 7.75rem;
  }

  .stk-trade-sim__stat-label {
    font-size: 0.62rem;
  }

  .stk-trade-sim__stat-value {
    font-size: 1.05rem;
  }

  .stk-trade-sim__stat--pnl .stk-trade-sim__stat-value {
    font-size: 1.15rem;
  }

  .stk-trade-sim__top-actions {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .stk-trade-sim__reset,
  .stk-trade-sim__history-btn,
  .stk-trade-sim__daily-report-btn {
    width: 100%;
    min-height: 2.5rem;
  }

  .stk-trade-sim__body {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
    grid-template-rows: unset;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .stk-trade-sim__chart,
  .stk-trade-sim__ticket {
    min-height: 0;
  }

  .stk-trade-sim__watch-wrap {
    flex: 0 0 auto;
    border-right: 0;
    border-bottom: 1px solid rgba(134, 175, 206, 0.2);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .stk-trade-sim__watch {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    flex: 0 0 auto;
    padding: 0.35rem 0.45rem;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .stk-trade-sim__watch-foot {
    padding: 0.35rem 0.45rem 0.45rem;
  }

  .stk-trade-sim__watch-item {
    min-width: 132px;
    margin-bottom: 0;
    min-height: 3.5rem;
    touch-action: pan-x;
  }

  .stk-trade-sim__mobile-nav {
    display: flex;
    flex: 0 0 auto;
    gap: 0.3rem;
    padding: 0.28rem 0.45rem 0.38rem;
    border-bottom: 1px solid rgba(134, 175, 206, 0.18);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .stk-trade-sim__mobile-nav button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 1.85rem;
    padding: 0.28rem 0.3rem;
    border: 1px solid rgba(134, 175, 206, 0.28);
    border-radius: 6px;
    background: rgba(9, 18, 28, 0.55);
    color: rgba(177, 195, 210, 0.88);
    font: 700 0.68rem/1.15 Arial, sans-serif;
    cursor: pointer;
    touch-action: manipulation;
  }

  .stk-trade-sim__mobile-nav button.is-active {
    border-color: rgba(212, 175, 55, 0.45);
    background: rgba(212, 175, 55, 0.12);
    color: #f6e8c8;
  }

  .stk-trade-sim__watch-foot .stk-trade-sim__add-chart {
    display: none;
  }

  .stk-trade-sim__body.is-panel-account .stk-trade-sim__watch-wrap,
  .stk-trade-sim__body.is-panel-history .stk-trade-sim__watch-wrap,
  .stk-trade-sim__body.is-panel-add .stk-trade-sim__watch-wrap {
    display: none;
  }

  .stk-trade-sim__body.is-panel-account .stk-trade-sim__account,
  .stk-trade-sim__body.is-panel-history .stk-trade-sim__history-panel,
  .stk-trade-sim__body.is-panel-add .stk-trade-sim__add-panel {
    flex: 1 1 auto;
    min-height: 0;
    border-right: 0;
  }

  .stk-trade-sim__body.is-panel-account .stk-trade-sim__account-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .stk-trade-sim__body.is-panel-chart .stk-trade-sim__ticket {
    display: none;
  }

  .stk-trade-sim__body.is-panel-trade .stk-trade-sim__ticket {
    display: flex;
  }

  .stk-trade-sim__body.is-panel-chart .stk-trade-sim__chart,
  .stk-trade-sim__body.is-panel-trade .stk-trade-sim__chart {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    border-right: 0;
  }

  .stk-trade-sim__body.is-panel-trade .stk-trade-sim__chart {
    flex: 1 1 58%;
    min-height: 28dvh;
  }

  .stk-trade-sim__body.is-panel-trade .stk-trade-sim__ticket {
    flex: 0 0 auto;
    max-height: 40%;
    overflow: auto;
    padding: 0.32rem 0.42rem 0.4rem;
    gap: 0.24rem;
  }

  .stk-trade-sim__chart-frame-wrap {
    min-height: 160px;
  }

  .stk-trade-sim__side-tabs {
    gap: 0.22rem;
  }

  .stk-trade-sim__side-tab,
  .stk-trade-sim__submit {
    min-height: 2rem;
    padding: 0.3rem 0.35rem;
    font-size: 0.7rem;
    touch-action: manipulation;
  }

  .stk-trade-sim__field {
    margin: 0;
  }

  .stk-trade-sim__field label {
    margin-bottom: 0.1rem;
    font-size: 0.6rem;
  }

  .stk-trade-sim__field input,
  .stk-trade-sim__field select {
    min-height: 2.05rem;
    padding: 0.28rem 0.38rem;
    font-size: 16px;
  }

  .stk-trade-sim__submit {
    margin-top: 0;
    padding: 0.34rem;
  }

  .stk-trade-sim__msg {
    min-height: 0.85rem;
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .stk-trade-sim__tab {
    min-height: 2.35rem;
    touch-action: manipulation;
  }

  .stk-trade-sim__table {
    font-size: 0.68rem;
  }

  .stk-trade-sim__table th,
  .stk-trade-sim__table td {
    padding: 0.42rem 0.35rem;
    white-space: nowrap;
  }

  @media (orientation: landscape) and (not ((min-width: 761px) and (pointer: fine))) {
    .stk-trade-sim {
      height: 100dvh;
      overflow: hidden;
    }

    .stk-trade-sim.is-open {
      overflow: hidden;
    }

    .stk-trade-sim__top {
      grid-template-columns: minmax(0, 1fr) auto auto auto;
      grid-template-rows: auto auto;
      gap: 0.22rem 0.35rem;
      padding: max(0.2rem, env(safe-area-inset-top, 0)) 0.45rem 0.22rem;
    }

    .stk-trade-sim__title {
      font-size: 0.78rem;
    }

    .stk-trade-sim__profile {
      font-size: 0.58rem;
      padding: 0.16rem 0.42rem;
    }

    .stk-trade-sim__close {
      grid-column: 4;
      min-height: 1.85rem;
      min-width: 3.35rem;
      padding: 0.2rem 0.45rem;
      font-size: 0.62rem;
    }

    .stk-trade-sim__top-actions {
      grid-column: 1 / -1;
      grid-row: 2;
      gap: 0.22rem;
    }

    .stk-trade-sim__reset,
    .stk-trade-sim__history-btn,
    .stk-trade-sim__daily-report-btn {
      width: auto;
      min-height: 1.85rem;
      padding: 0.18rem 0.32rem;
      font-size: 0.58rem;
    }

    .stk-trade-sim__stats {
      grid-row: 3;
      gap: 0.3rem;
    }

    .stk-trade-sim__stat {
      min-width: 5.75rem;
      padding: 0.22rem 0.42rem;
    }

    .stk-trade-sim__stat-value {
      font-size: 0.82rem;
    }

    .stk-trade-sim__stat--pnl .stk-trade-sim__stat-value {
      font-size: 0.88rem;
    }

    .stk-trade-sim__body {
      flex: 1 1 auto;
      min-height: 0;
      overflow: hidden;
    }

    .stk-trade-sim__watch {
      padding: 0.18rem 0.35rem;
    }

    .stk-trade-sim__watch-item {
      min-width: 102px;
      min-height: 2.35rem;
    }

    .stk-trade-sim__mobile-nav {
      padding: 0.12rem 0.35rem 0.16rem;
    }

    .stk-trade-sim__mobile-nav button {
      min-height: 1.5rem;
      font-size: 0.62rem;
    }

    .stk-trade-sim__body.is-panel-chart,
    .stk-trade-sim__body.is-panel-trade {
      display: grid;
      grid-template-rows: auto auto minmax(0, 1fr);
      grid-template-columns: minmax(0, 1fr);
      min-height: 0;
    }

    .stk-trade-sim__body.is-panel-chart {
      grid-template-areas:
        "watch"
        "nav"
        "chart";
    }

    .stk-trade-sim__body.is-panel-trade {
      grid-template-columns: minmax(0, 1fr) min(11.75rem, 34vw);
      grid-template-areas:
        "watch watch"
        "nav nav"
        "chart ticket";
    }

    .stk-trade-sim__watch-wrap {
      grid-area: watch;
    }

    .stk-trade-sim__mobile-nav {
      grid-area: nav;
    }

    .stk-trade-sim__body.is-panel-chart .stk-trade-sim__chart,
    .stk-trade-sim__body.is-panel-trade .stk-trade-sim__chart {
      grid-area: chart;
      display: flex;
      flex-direction: column;
      flex: unset;
      min-height: 0;
      height: 100%;
      overflow: hidden;
    }

    .stk-trade-sim__body.is-panel-trade .stk-trade-sim__ticket {
      grid-area: ticket;
      display: flex;
      flex: unset;
      max-height: none;
      height: 100%;
      overflow-x: hidden;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      border-left: 1px solid rgba(134, 175, 206, 0.2);
      border-top: 0;
      padding: 0.22rem 0.28rem 0.28rem;
      gap: 0.16rem;
    }

    .stk-trade-sim__chart-frame-wrap {
      flex: 1 1 auto;
      min-height: 0;
    }

    .stk-trade-sim__chart-head {
      flex: 0 0 auto;
      padding: 0.22rem 0.45rem;
    }

    .stk-trade-sim__side-tab,
    .stk-trade-sim__submit {
      min-height: 1.72rem;
      padding: 0.22rem 0.28rem;
      font-size: 0.64rem;
    }

    .stk-trade-sim__field label {
      font-size: 0.56rem;
    }

    .stk-trade-sim__field input,
    .stk-trade-sim__field select {
      min-height: 1.72rem;
      padding: 0.2rem 0.3rem;
      font-size: 14px;
    }

    .stk-trade-sim__body.is-panel-account,
    .stk-trade-sim__body.is-panel-history,
    .stk-trade-sim__body.is-panel-add {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: auto minmax(0, 1fr);
      grid-template-areas:
        "nav"
        "panel";
      min-height: 0;
    }

    .stk-trade-sim__body.is-panel-account .stk-trade-sim__watch-wrap,
    .stk-trade-sim__body.is-panel-history .stk-trade-sim__watch-wrap,
    .stk-trade-sim__body.is-panel-add .stk-trade-sim__watch-wrap {
      display: none;
    }

    .stk-trade-sim__body.is-panel-account .stk-trade-sim__mobile-nav,
    .stk-trade-sim__body.is-panel-history .stk-trade-sim__mobile-nav,
    .stk-trade-sim__body.is-panel-add .stk-trade-sim__mobile-nav {
      grid-area: nav;
      grid-column: 1;
    }

    .stk-trade-sim__body.is-panel-account .stk-trade-sim__account,
    .stk-trade-sim__body.is-panel-history .stk-trade-sim__history-panel,
    .stk-trade-sim__body.is-panel-add .stk-trade-sim__add-panel {
      grid-area: panel;
      grid-column: 1;
      display: flex;
      flex-direction: column;
      min-height: 0;
      overflow: hidden;
    }

    .stk-trade-sim__body.is-panel-history .stk-trade-sim__history-body {
      flex: 1 1 auto;
      min-height: 0;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
    }

    .stk-trade-sim__body.is-panel-account .stk-trade-sim__account-body {
      flex: 1 1 auto;
      min-height: 0;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
      touch-action: pan-y;
    }
  }
}

@media (max-width: 760px), ((max-width: 960px) and (pointer: coarse)), ((min-width: 761px) and (pointer: fine)) {
  .stk-trade-sim .stk-tv-card .stk-tv-frame {
    pointer-events: auto;
  }

  .stk-trade-sim .stk-tv-crosshair-layer {
    top: 46px;
  }

  .stk-trade-sim__body.is-panel-trade .stk-tv-crosshair-layer {
    bottom: 0;
    overflow: hidden;
  }

  .stk-trade-sim .stk-tv-card[data-tv-menu-open="true"] .stk-tv-plot-touch,
  .stk-trade-sim .stk-tv-card[data-tv-menu-open="true"] .stk-tv-yaxis-touch,
  .stk-trade-sim .stk-tv-card[data-tv-menu-open="true"] .stk-tv-crosshair-layer {
    pointer-events: none !important;
    touch-action: auto;
  }

  .stk-trade-sim .stk-tv-card[data-tv-menu-open="true"] .stk-tv-frame {
    pointer-events: auto;
    z-index: 7;
  }
}

/* Touch only — plot-touch captures hold/scrub; layer is display-only */
@media (max-width: 760px), ((max-width: 960px) and (pointer: coarse)) {
  .stk-trade-sim .stk-tv-wrap.is-crosshair-ready .stk-tv-crosshair-layer {
    right: 0;
    pointer-events: none;
  }

  .stk-trade-sim__body.is-panel-trade .stk-tv-plot-touch,
  .stk-trade-sim__body.is-panel-trade .stk-tv-yaxis-touch {
    bottom: 0;
  }

  .stk-trade-sim .stk-tv-plot-touch {
    position: absolute;
    top: 46px;
    right: 54px;
    bottom: 66px;
    left: 0;
    z-index: 4;
    pointer-events: auto;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
  }

  .stk-trade-sim .stk-tv-wrap.is-crosshair-ready .stk-tv-plot-touch {
    touch-action: pan-y;
  }

  .stk-trade-sim .stk-tv-card.is-crosshair-touch-enabled .stk-tv-plot-touch {
    touch-action: none;
  }

  .stk-trade-sim .stk-tv-yaxis-touch {
    position: absolute;
    top: 46px;
    right: 0;
    bottom: 66px;
    width: 54px;
    z-index: 3;
    pointer-events: none;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
  }

  .stk-trade-sim .stk-tv-card.is-yaxis-drag-enabled .stk-tv-frame {
    z-index: 6;
  }

  .stk-trade-sim .stk-tv-card.is-crosshair-touch-enabled .stk-tv-yaxis-touch {
    touch-action: none;
  }
}

/* PC portrait — mouse crosshair on layer; touch overlay must not block clicks */
@media (min-width: 761px) and (pointer: fine) {
  .stk-trade-sim {
    left: 0;
    right: 0;
    width: min(920px, 100%);
    max-width: min(920px, 100%);
    margin-inline: auto;
  }

  .stk-trade-sim .stk-tv-wrap.is-crosshair-ready .stk-tv-crosshair-layer {
    pointer-events: auto;
    right: 54px;
    bottom: 66px;
  }

  .stk-trade-sim__body.is-panel-trade .stk-tv-wrap.is-crosshair-ready .stk-tv-crosshair-layer {
    right: 54px;
    bottom: 0;
  }

  .stk-trade-sim .stk-tv-plot-touch,
  .stk-trade-sim .stk-tv-yaxis-touch {
    pointer-events: none;
  }

  .stk-trade-sim__watch-foot {
    flex-direction: row;
    gap: 0.35rem;
  }

  .stk-trade-sim__watch-foot .stk-trade-sim__add-chart,
  .stk-trade-sim__watch-foot .stk-trade-sim__remove-chart {
    display: block;
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }

  .stk-trade-sim__top-actions {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .stk-trade-sim__daily-report-btn {
    display: block;
  }

  .stk-trade-sim__daily-report-btn-label--long {
    display: inline;
  }

  .stk-trade-sim__daily-report-btn-label--short {
    display: none;
  }
}

/* Phone — D.R. shortcut between Reset and Trade history */
@media (max-width: 760px), ((max-width: 960px) and (pointer: coarse)) {
  .stk-trade-sim__top-actions {
    grid-template-columns: 1fr auto 1fr;
  }

  .stk-trade-sim__daily-report-btn {
    display: block;
    width: 100%;
    min-width: 2.65rem;
    padding-inline: 0.35rem;
    font-weight: 700;
    letter-spacing: 0.04em;
  }

  .stk-trade-sim__daily-report-btn-label--long {
    display: none;
  }

  .stk-trade-sim__daily-report-btn-label--short {
    display: inline;
  }
}

html.stk-mobile-touch-ui .stk-trade-sim input,
html.stk-mobile-touch-ui .stk-trade-sim select,
html.stk-mobile-touch-ui .stk-trade-sim textarea {
  -webkit-user-select: text !important;
  user-select: text !important;
}
