.invest-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) minmax(0, 1.5fr);
  gap: 24px;
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-header h3 {
  font-size: 18px;
}

.muted-small {
  font-size: 12px;
  color: #9fb6c7;
}

.watchlist-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.market-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.market-tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 198, 0.4);
  background: rgba(0, 0, 0, 0.35);
  color: #e6f7ff;
  font-size: 12px;
  cursor: pointer;
  transition: 0.2s;
}

.market-tab.active {
  background: radial-gradient(
    circle at top left,
    rgba(0, 255, 198, 0.25),
    rgba(0, 0, 0, 0.7)
  );
  box-shadow: 0 0 14px rgba(0, 255, 198, 0.4);
  border-color: rgba(0, 255, 198, 0.9);
}

.market-tab:hover {
  border-color: rgba(0, 255, 198, 0.9);
}

.search-wrapper {
  margin-bottom: 8px;
}

.search-wrapper input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: 0.2s;
}

.search-wrapper input::placeholder {
  color: #9fb6c7;
}

.search-wrapper input:focus {
  border-color: #00ffc6;
  box-shadow: 0 0 0 2px rgba(0, 255, 198, 0.18);
}

.watchlist-section,
.all-markets-section {
  margin-top: 8px;
}

.watchlist-groups {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.watchlist-header-sub {
  font-size: 11px;
  color: #9fb6c7;
  margin: 2px 0;
}


.watchlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 12px;
  color: #dde6f2;
}

.instrument-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

.instrument-list::-webkit-scrollbar {
  width: 6px;
}
.instrument-list::-webkit-scrollbar-track {
  background: rgba(7, 26, 40, 0.7);
  border-radius: 999px;
}
.instrument-list::-webkit-scrollbar-thumb {
  background: linear-gradient(#00ffc6, #00b3ff);
  border-radius: 999px;
}

.instrument-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.2s;
}

.instrument-item:hover {
  border-color: rgba(0, 255, 198, 0.6);
  box-shadow: 0 0 14px rgba(0, 255, 198, 0.4);
}

.instrument-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.instrument-symbol {
  font-size: 13px;
  font-weight: 600;
}

.instrument-name {
  font-size: 11px;
  color: #9fb6c7;
}

.instrument-right {
  text-align: right;
  font-size: 11px;
}

.instrument-price {
  font-weight: 600;
}

.instrument-change {
  font-size: 11px;
}

.instrument-change.positive {
  color: #00ffc6;
}

.instrument-change.negative {
  color: #ff5757;
}

.star-btn {
  background: transparent;
  border: none;
  color: #ffd54f;
  font-size: 15px;
  cursor: pointer;
  padding: 0 2px 0 0;
  opacity: 0.5;
  transition: 0.2s;
}

.star-btn.active,
.star-btn:hover {
  opacity: 1;
}
.chart-card {
  display: flex;
  flex-direction: column;
}

.timeframe-controls {
  display: flex;
  flex-wrap: wrap;  
  gap: 6px;
  align-items: center;
}

.tf-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 198, 0.4);
  background: rgba(0, 0, 0, 0.35);
  color: #e6f7ff;
  font-size: 11px;
  cursor: pointer;
  transition: 0.2s;
}

.tf-btn.active {
  background: radial-gradient(
    circle at top left,
    rgba(0, 255, 198, 0.25),
    rgba(0, 0, 0, 0.7)
  );
  box-shadow: 0 0 14px rgba(0, 255, 198, 0.4);
  border-color: rgba(0, 255, 198, 0.9);
}

.chart-container {
  margin-top: 10px;
  min-height: 320px;
}

.trade-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ticket-instrument {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}

#ticketInstrumentSymbol {
  font-weight: 600;
  font-size: 15px;
}

.order-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.side-toggle {
  display: flex;
  gap: 8px;
}

.side-btn {
  flex: 1;
  padding: 8px 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.35);
  color: #e6f7ff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
}

.side-btn.active {
  background: linear-gradient(90deg, #00ffc6, #00b3ff);
  color: #000;
  border-color: transparent;
  box-shadow: 0 0 16px rgba(0, 255, 198, 0.6);
}

.order-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #d0e3ff;
}

.order-field input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: 0.2s;
}

.order-field input:focus {
  border-color: #00ffc6;
  box-shadow: 0 0 0 2px rgba(0, 255, 198, 0.18);
}

.pl-buy {
  color: #00ffc6;
  font-weight: 600;
}

.pl-sell {
  color: #ffb347;
  font-weight: 600;
}

.pl-positive {
  color: #00ffc6;
}

.pl-negative {
  color: #ff5757;
}

.link-btn {
  border: none;
  background: transparent;
  color: #00b3ff;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

@media (max-width: 1050px) {
  .invest-layout {
    grid-template-columns: 1fr;
  }

  .chart-container {
    min-height: 260px;
  }
}

@media (max-width: 600px) {
  .positions-table th,
  .positions-table td {
    font-size: 10px;
  }
}

.instrument-empty {
  padding: 8px 4px;
  font-size: 12px;
  color: #9ca3af; 
}

.wishlist-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 50;
  display: none;
}

.wishlist-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(8, 26, 40, 0.96);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(0, 255, 198, 0.4);
  z-index: 51;
  width: 280px;
  max-width: 90vw;
  display: none;
}

.wishlist-overlay.visible,
.wishlist-panel.visible {
  display: block;
}

.wishlist-panel-inner h4 {
  margin: 0 0 6px;
  font-size: 16px;
}

.wishlist-category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 6px;
}

.wishlist-cat-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 198, 0.4);
  background: rgba(0, 0, 0, 0.4);
  color: #e6f7ff;
  font-size: 12px;
  cursor: pointer;
  transition: 0.2s;
}

.wishlist-cat-btn.active,
.wishlist-cat-btn:hover {
  background: radial-gradient(
    circle at top left,
    rgba(0, 255, 198, 0.25),
    rgba(0, 0, 0, 0.8)
  );
  box-shadow: 0 0 12px rgba(0, 255, 198, 0.6);
  border-color: rgba(0, 255, 198, 0.9);
}

.wishlist-panel-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

#wishlistCancelBtn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: #e6f7ff;
  font-size: 12px;
  cursor: pointer;
}

.positions-section-wide {
  margin-top: 16px;
}

.positions-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: #9fb6c7;
}

.positions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.position-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
  transition: 0.2s;
}

.position-row:hover {
  border-color: rgba(0, 255, 198, 0.6);
  box-shadow: 0 0 14px rgba(0, 255, 198, 0.4);
}

.position-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.position-topline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.position-symbol {
  font-size: 13px;
  font-weight: 600;
}

.position-side {
  font-size: 11px;
  font-weight: 600;
}

.position-subline {
  font-size: 11px;
  color: #9fb6c7;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.position-subline span {
  display: inline-flex;
  align-items: center;
}

.position-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.position-opened {
  font-size: 11px;
  color: #9fb6c7;
}

.pl-buy {
  color: #00ffc6;
  font-weight: 600;
}

.pl-sell {
  color: #ffb347;
  font-weight: 600;
}

.pl-positive {
  color: #00ffc6;
}

.pl-negative {
  color: #ff5757;
}

.link-btn {
  border: none;
  background: transparent;
  color: #00b3ff;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

.order-form .primary-btn#placeOrderBtn {
  width: 100%;
  margin-top: 4px;
  padding: 10px 0;

  border-radius: 999px;
  border: none;

  background: linear-gradient(90deg, #00ffc6, #00b3ff);
  color: #000;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;

  cursor: pointer;
  box-shadow: 0 0 16px rgba(0, 255, 198, 0.5);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.order-form .primary-btn#placeOrderBtn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(0, 255, 198, 0.8);
}

.order-form .primary-btn#placeOrderBtn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 0 10px rgba(0, 255, 198, 0.5);
}

.order-form .primary-btn#placeOrderBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.chart-msg-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  animation: fadeIn 0.35s ease;
}

.chart-msg-success {
  background-color: rgba(40, 167, 69, 0.18);
  border: 1px solid #28a745;
  color: #d4edda;
}

.chart-msg-error {
  background-color: rgba(255, 0, 0, 0.15);
  border: 1px solid #ff4b4b;
  color: #ff6b6b;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
