/* Nexus Markets + Positions — Nexus layout parity */

:root {
  --nexus-sell: #ef5350;
  --nexus-buy: #00c853;
  --nexus-sell-bg: transparent;
  --nexus-buy-bg: transparent;
  --nexus-line: #e4e9ef;
  --nexus-muted: #8b93a7;
  --nexus-surface: #ffffff;
  --nexus-surface-2: #f3f5f6;
  --nexus-page: #f3f5f6;
  --nexus-text: #1d1e37;
  --nexus-good: #00c853;
  --nexus-bad: #ef5350;
  --nexus-blue: #2f80ed;
}

body.dark-mode {
  /* Match dashboard dark tokens (--dm-bg-page / --dm-bg-card) */
  --nexus-line: rgba(255, 255, 255, 0.16);
  --nexus-muted: #9a9a9a;
  --nexus-surface: #000000;
  --nexus-surface-2: #1a1a1a;
  /* Interactive chrome — lighter than card so toggles/sliders read clearly */
  --nexus-control: #2a2a2a;
  --nexus-page: #0c0c0c;
  --nexus-text: #f5f5f5;
}

#section-market.active,
#section-positions.active {
  background: transparent;
  /* .content-section uses overflow-x:hidden which breaks position:sticky */
  overflow: visible;
}

/*
 * Sticky spacing must equal resting layout offsets (no jump on scroll).
 * Shell owns sticky + spacing; the white card stays a separate visual box.
 *   top gap     → content-wrapper padding-top + shell sticky top offset
 *   stack gap   → shell padding-bottom (included in measured --nexus-acct-bar-h)
 */
.content-wrapper:has(#section-market.active),
.content-wrapper:has(#section-positions.active) {
  --nexus-sticky-top-gap: 12px;
  --nexus-sticky-stack-gap: 16px;
  --nexus-sticky-chrome-bg: #f3f5f6;
  --nexus-markets-view-gap: 28px; /* must match .nexus-markets-tabs margin-bottom */
  --nexus-ot-view-gap: 20px; /* must match .nexus-ot-chrome padding-top + .nexus-ticket margin-top (Nexus) */
  overflow: visible;
  background: #f3f5f6;
  /* Nexus-like gutters with 16px left inset for Nexus shell alignment */
  padding: var(--nexus-sticky-top-gap) 16px 16px 16px;
}
.main-content:has(#section-market.active),
.main-content:has(#section-positions.active) {
  background: #f3f5f6;
}
body.dark-mode .content-wrapper:has(#section-market.active),
body.dark-mode .content-wrapper:has(#section-positions.active) {
  --nexus-sticky-chrome-bg: #0c0c0c;
  background: #0c0c0c;
}
body.dark-mode .main-content:has(#section-market.active),
body.dark-mode .main-content:has(#section-positions.active) {
  background: #0c0c0c;
}

/* Sticky shell: keeps spacing + masks scroll peek without merging into tabs */
.nexus-acct-shell {
  position: sticky;
  top: calc(var(--nexus-acct-sticky-top, 90px) + var(--nexus-sticky-top-gap, 12px));
  z-index: 40;
  margin: 0;
  padding: 0 0 var(--nexus-sticky-stack-gap, 16px);
  background: var(--nexus-sticky-chrome-bg, #f8f9fa);
  box-sizing: border-box;
  isolation: isolate;
}
.nexus-acct-shell::before {
  content: "";
  position: absolute;
  left: -32px;
  right: -32px;
  top: calc(-1 * var(--nexus-sticky-top-gap, 12px));
  height: var(--nexus-sticky-top-gap, 12px);
  background: var(--nexus-sticky-chrome-bg, #f8f9fa);
  pointer-events: none;
  z-index: -1;
}
.nexus-acct-shell::after {
  content: "";
  position: absolute;
  left: -32px;
  right: -32px;
  top: 0;
  bottom: 0;
  background: var(--nexus-sticky-chrome-bg, #f8f9fa);
  pointer-events: none;
  z-index: -1;
}

/* Account strip — Nexus account-data-bar: flat white strip, label+value inline */
.nexus-acct-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 6px 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  box-sizing: border-box;
}
.nexus-acct-metrics {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nexus-acct-metrics::-webkit-scrollbar {
  display: none;
}
.nexus-acct-item {
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 0;
  min-width: max-content;
  padding: 0 15px;
  box-sizing: border-box;
  height: 17px;
}
.nexus-acct-item:first-child {
  padding-left: 8px;
}
.nexus-acct-item:last-child {
  padding-right: 8px;
}
.nexus-acct-item + .nexus-acct-item {
  border-left: 0;
}
.nexus-acct-item span {
  display: inline;
  font-size: 12px;
  line-height: 17px;
  color: rgba(7, 15, 27, 0.7);
  font-weight: 400;
  white-space: nowrap;
}
.nexus-acct-item strong {
  display: inline;
  font-size: 12px;
  line-height: 17px;
  font-weight: 400;
  color: var(--nexus-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: 5px;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}
.nexus-acct-item strong.is-available { color: #21ad36; }
.nexus-acct-item strong.is-pos { color: #21ad36; }
.nexus-acct-item strong.is-neg { color: #ee3142; }
.nexus-acct-item strong.is-blurred { filter: blur(5px); user-select: none; }
.nexus-acct-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  padding-left: 8px;
  padding-right: 8px;
  border-left: 0;
  margin-left: 0;
  align-self: center;
}
.nexus-icon-tool {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex-shrink: 0;
}
.nexus-icon-tool svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  pointer-events: none;
}
.nexus-icon-tool svg[hidden] {
  display: none !important;
}
/* Balance blur: drive eye/eye-slash from aria-pressed (JS always updates this).
   Do not rely only on SVG [hidden] — SVGElement.hidden does not reliably sync the attribute. */
#nexusAcctBlur .nexus-eye-off,
[data-nexus-acct-blur] .nexus-eye-off {
  display: none !important;
}
#nexusAcctBlur[aria-pressed="true"] .nexus-eye-on,
[data-nexus-acct-blur][aria-pressed="true"] .nexus-eye-on {
  display: none !important;
}
#nexusAcctBlur[aria-pressed="true"] .nexus-eye-off,
[data-nexus-acct-blur][aria-pressed="true"] .nexus-eye-off {
  display: block !important;
}
.nexus-icon-tool:hover {
  color: var(--nexus-text);
  border-color: #cbd5e1;
  background: #f8fafc;
}
/* Generic pressed chrome — NOT used for balance blur (eye/eye-slash only). */
.nexus-icon-tool[aria-pressed="true"]:not(#nexusAcctBlur):not([data-nexus-acct-blur]) {
  color: var(--nexus-blue);
  border-color: rgba(47, 128, 237, 0.35);
  background: rgba(47, 128, 237, 0.08);
}
#nexusAcctBlur[aria-pressed="true"],
[data-nexus-acct-blur][aria-pressed="true"] {
  color: #64748b;
  background: transparent;
  border-color: transparent;
}
#nexusAcctBlur[aria-pressed="true"]:hover,
[data-nexus-acct-blur][aria-pressed="true"]:hover {
  color: var(--nexus-text);
  background: #f8fafc;
  border-color: #cbd5e1;
}
body.dark-mode .nexus-acct-bar {
  background: var(--nexus-surface);
  border-color: var(--nexus-line);
  box-shadow: none;
}
body.dark-mode .nexus-acct-shell {
  background: var(--nexus-sticky-chrome-bg, #0c0c0c);
}
body.dark-mode .nexus-acct-shell::before,
body.dark-mode .nexus-acct-shell::after {
  background: var(--nexus-sticky-chrome-bg, #0c0c0c);
}
body.dark-mode .nexus-icon-tool {
  background: var(--nexus-surface);
  border-color: var(--nexus-line);
  color: var(--nexus-muted);
}
body.dark-mode .nexus-icon-tool:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--nexus-text);
}
body.dark-mode #nexusAcctBlur[aria-pressed="true"],
body.dark-mode [data-nexus-acct-blur][aria-pressed="true"] {
  color: var(--nexus-muted);
  background: transparent;
  border-color: transparent;
}
body.dark-mode #nexusAcctBlur[aria-pressed="true"]:hover,
body.dark-mode [data-nexus-acct-blur][aria-pressed="true"]:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--nexus-text);
}

/* Expand control — desktop hidden; shown ≤1100 when compact row is used */
.nexus-acct-expand {
  display: none;
  appearance: none;
  border: 0;
  background: transparent;
  color: #3179ff;
  width: 33px;
  height: 33px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 0;
}
.nexus-acct-expand svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  transition: transform 0.2s ease;
}
.nexus-acct-expand[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/*
 * ≤1100: Nexus-like compact single row + expand overlay.
 * Do not wrap metrics — overflow clips; expand shows the full grid.
 */
@media (max-width: 1100px) {
  .nexus-acct-shell {
    /* Anchor for absolute expanded panel without breaking sticky */
    isolation: isolate;
  }

  .nexus-acct-bar {
    align-items: center;
    flex-wrap: nowrap;
    min-height: 56px;
    padding: 8px 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
  }

  /*
   * Compact row: tools tuck into expand; metrics stretch across
   * all remaining width (no empty gap where icons were).
   */
  .nexus-acct-bar:not(.is-expanded) {
    justify-content: flex-start;
    gap: 4px;
  }

  .nexus-acct-bar:not(.is-expanded) .nexus-acct-metrics {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    overflow: hidden;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .nexus-acct-bar:not(.is-expanded) .nexus-acct-item {
    flex: 1 1 0;
    min-width: 0;
    padding: 2px 8px;
  }

  .nexus-acct-bar:not(.is-expanded) .nexus-acct-item + .nexus-acct-item {
    border-left: 1px solid var(--nexus-line);
  }

  .nexus-acct-bar:not(.is-expanded) .nexus-acct-item span,
  .nexus-acct-bar:not(.is-expanded) .nexus-acct-item strong {
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nexus-acct-tools {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    border-left: 0;
    margin-left: 0;
    padding-left: 2px;
    gap: 6px;
    background: transparent;
  }

  .nexus-acct-bar:not(.is-expanded) .nexus-acct-tools {
    display: none;
  }

  .nexus-acct-expand {
    display: inline-flex;
    flex: 0 0 auto;
    margin-left: 0;
  }

  /* Expanded overlay — Nexus account-data-bar--open pattern */
  .nexus-acct-bar.is-expanded {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    overflow: visible;
    min-height: 0;
    padding: 10px 12px 0;
    background: #fff;
    border: 1px solid var(--nexus-line);
    border-radius: 12px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
  }

  body.dark-mode .nexus-acct-bar.is-expanded {
    background: var(--nexus-surface);
    border-color: var(--nexus-line);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  }

  .nexus-acct-bar.is-expanded .nexus-acct-tools {
    display: flex;
    order: 1;
    width: 100%;
    justify-content: flex-end;
    margin: 0 0 4px;
    padding: 0;
    background: none;
  }

  .nexus-acct-bar.is-expanded .nexus-acct-expand {
    /* Full-width blue strip below metrics */
    order: 3;
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: calc(100% + 24px);
    margin: 0 -12px;
    height: 24px;
    border-radius: 0 0 11px 11px;
    background: #3179ff !important;
    color: #fff;
  }

  .nexus-acct-bar.is-expanded .nexus-acct-expand svg {
    stroke: #fff;
    transform: rotate(180deg);
  }

  .nexus-acct-bar.is-expanded .nexus-acct-metrics {
    order: 2;
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    overflow: visible;
    min-width: 0;
    padding: 0;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .nexus-acct-bar.is-expanded .nexus-acct-item {
    flex: 1 1 calc(33.333% - 4px);
    min-width: 0;
    max-width: calc(33.333% - 4px);
    box-sizing: border-box;
    padding: 14px 8px;
    position: relative;
    align-items: center;
    text-align: center;
    border-left: 0 !important;
    border-top: 1px solid var(--nexus-line);
  }

  .nexus-acct-bar.is-expanded .nexus-acct-item:nth-child(-n + 3) {
    border-top: 0;
  }

  .nexus-acct-bar.is-expanded .nexus-acct-item::after {
    content: "";
    position: absolute;
    right: 0;
    top: 30%;
    height: 40%;
    border-right: 1px solid var(--nexus-line);
  }

  .nexus-acct-bar.is-expanded .nexus-acct-item:nth-child(3n)::after,
  .nexus-acct-bar.is-expanded .nexus-acct-item:last-child::after {
    display: none;
  }

  .nexus-acct-bar.is-expanded .nexus-acct-item span,
  .nexus-acct-bar.is-expanded .nexus-acct-item strong {
    text-align: center;
    width: 100%;
  }
}

@media (min-width: 1101px) {
  .nexus-acct-expand {
    display: none !important;
  }
  .nexus-acct-bar.is-expanded {
    position: static;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }
}

/* Markets tabs */
.nexus-markets-tabs,
.nexus-pos-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--nexus-line);
  margin-bottom: 18px;
}
.nexus-markets-tabs {
  /* --nexus-acct-bar-h is the full shell height (card + stack gap padding) */
  position: sticky;
  top: calc(
    var(--nexus-acct-sticky-top, 90px) + var(--nexus-sticky-top-gap, 12px) +
      var(--nexus-acct-bar-h, 72px)
  );
  z-index: 39;
  background: var(--nexus-sticky-chrome-bg, #f8f9fa);
  margin: 0 -4px var(--nexus-markets-view-gap, 28px);
  padding: 0 4px;
  border-bottom: 1px solid var(--nexus-line);
  box-shadow: none;
}
body.dark-mode .nexus-markets-tabs {
  background: var(--nexus-sticky-chrome-bg, #0c0c0c);
  border-bottom-color: var(--nexus-line);
}
.nexus-markets-tab,
.nexus-pos-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--nexus-muted);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.nexus-markets-tab.is-active,
.nexus-pos-tab.is-active {
  color: var(--nexus-text);
  border-bottom-color: var(--primary-blue, #3b82f6);
}

.nexus-markets-view[hidden],
.nexus-ot-panel[hidden],
.nexus-pos-panel[hidden],
.nexus-open-trade[hidden],
.nexus-trade-detail[hidden],
.nexus-modal[hidden] { display: none !important; }

/* Popular rows */
.nexus-pop-row { margin-bottom: 40px; }
.nexus-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}
.nexus-section-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--nexus-text);
}
.nexus-section-head-left {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.nexus-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  color: var(--nexus-text);
}
.nexus-see-all {
  border: 0;
  background: transparent;
  color: #1585d8;
  font-weight: 400;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.6;
  padding: 1px 0 0;
}
.nexus-see-all:hover {
  opacity: 0.85;
}
.nexus-section-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nexus-carousel-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--nexus-text);
  cursor: pointer;
  opacity: 1;
}
.nexus-carousel-arrow svg {
  display: block;
  width: 16px;
  height: 16px;
}
.nexus-carousel-arrow.is-disabled,
.nexus-carousel-arrow:disabled {
  cursor: not-allowed;
  opacity: 0.2;
  pointer-events: none;
}
.nexus-carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
}
.nexus-carousel::-webkit-scrollbar { height: 6px; }
.nexus-carousel::-webkit-scrollbar-thumb {
  background: var(--nexus-line);
  border-radius: 99px;
}

/* Instrument card */
.nexus-inst-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
  border: 0;
  border-radius: 15px;
  background: var(--nexus-surface);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: none;
  cursor: pointer;
  justify-content: center;
  box-sizing: border-box;
  min-width: 0;
}
.nexus-card-grid .nexus-inst-card {
  flex: none;
  width: auto;
  max-width: none;
}
.nexus-inst-card:focus-visible {
  outline: 2px solid var(--nexus-blue);
  outline-offset: 2px;
}
.nexus-inst-card .nexus-px-pill {
  cursor: pointer;
}
.nexus-inst-card-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 0 6px;
  margin-bottom: 15px;
}
.nexus-inst-card-left {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  justify-content: flex-start;
  width: 100%;
}
.nexus-inst-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #dfe5ee;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
  overflow: hidden;
}
.nexus-inst-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.nexus-fx-flags {
  position: relative;
  background: transparent !important;
  overflow: visible;
}
.nexus-fx-flag {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50%;
  object-fit: cover !important;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
  position: absolute;
}
.nexus-fx-flag.base {
  left: 0;
  top: 6px;
  z-index: 1;
}
.nexus-fx-flag.quote {
  right: 0;
  top: 6px;
  z-index: 2;
}
.nexus-inst-icon.nexus-fx-flags {
  width: 40px;
  height: 40px;
}
.nexus-inst-icon[data-fallback="1"] {
  background: #334155;
}
.nexus-inst-icon.small { width: 28px; height: 28px; }
.nexus-ot-icon-wrap .nexus-inst-icon { width: 50px; height: 50px; }
.nexus-close-identity .nexus-inst-icon { width: 48px; height: 48px; }
.nexus-inst-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 0;
  min-width: 0;
  flex: 1 1 0%;
  overflow: hidden;
  padding-left: 10px;
  width: 0;
}
.nexus-inst-meta strong {
  grid-column: 1;
  grid-row: 1;
  display: block;
  width: 100%;
  font-size: 14px;
  font-weight: 500;
  color: var(--nexus-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-bottom: 4px;
}
.nexus-inst-sym {
  grid-column: 1;
  grid-row: 2;
  display: block;
  font-size: 12px;
  color: var(--nexus-muted);
}
.nexus-inst-card .nexus-chg {
  grid-column: 2;
  grid-row: 1 / span 2;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: normal;
  line-height: 1.2;
}
.nexus-inst-card .nexus-chg-abs,
.nexus-inst-card .nexus-chg-pct {
  display: block;
  white-space: nowrap;
}
.nexus-see-all--footer {
  display: none;
}
.nexus-chg {
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.nexus-chg.is-pos { color: var(--nexus-good); }
.nexus-chg.is-neg { color: var(--nexus-bad); }
.nexus-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.nexus-px-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1px solid var(--nexus-line);
  border-radius: 8px;
  padding: 3px;
  min-height: 34px;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  background: transparent;
  color: var(--nexus-text);
  box-sizing: border-box;
  width: 100%;
}
.nexus-px-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 24px;
  padding: 5px;
  border-radius: 4px;
  background: #e0e4e9;
  color: #000;
  font-size: 14px;
  font-weight: 400;
  line-height: 14px;
  box-sizing: border-box;
}
body.dark-mode .nexus-px-chip {
  background: var(--nexus-surface-2);
  color: var(--nexus-text);
}
.nexus-px-pill.sell,
.nexus-px-pill.buy {
  background: transparent;
  border-color: var(--nexus-line);
  color: var(--nexus-text);
}
.nexus-px-pill:hover { filter: none; background: transparent; }
.nexus-px-pill.sell:hover,
.nexus-px-pill.buy:hover {
  background: transparent;
  border-color: var(--nexus-line);
}
.nexus-px-pill:hover .nexus-px-chip {
  filter: brightness(0.97);
}
.nexus-spark-cell {
  width: 88px;
}
.nexus-spark {
  display: block;
  opacity: 0.9;
}
.nexus-arrow { font-size: 11px; opacity: 0.85; }
.nexus-arrow-img {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.nexus-arrow-img.down { filter: invert(42%) sepia(72%) saturate(1800%) hue-rotate(330deg); }
.nexus-arrow-img.up { filter: invert(52%) sepia(86%) saturate(1800%) hue-rotate(95deg); }

.nexus-all-mobile-list,
.nexus-all-mobile-back {
  display: none;
}
.nexus-all-mobile-list[hidden],
.nexus-all-mobile-back[hidden] {
  display: none !important;
}

/* All markets layout */
.nexus-all-layout {
  display: grid;
  grid-template-columns: 225px minmax(0, 1fr);
  gap: 15px;
  min-height: 420px;
  align-items: start; /* required so the rail can stick while main grows */
}
.nexus-cat-rail {
  /*
   * Sticky top must include the tabs bottom gap (--nexus-markets-view-gap),
   * otherwise the rail rests below its stick point and jumps up on first scroll.
   */
  position: sticky;
  top: calc(
    var(--nexus-acct-sticky-top, 90px) + var(--nexus-sticky-top-gap, 12px) +
      var(--nexus-acct-bar-h, 72px) + var(--nexus-markets-tabs-h, 48px) +
      var(--nexus-markets-view-gap, 28px)
  );
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-right: 0;
  padding: 15px 15px 10px;
  border-radius: 15px;
  background: var(--nexus-surface, #fff);
  max-height: calc(
    100vh -
      (
        var(--nexus-acct-sticky-top, 90px) + var(--nexus-sticky-top-gap, 12px) +
          var(--nexus-acct-bar-h, 72px) + var(--nexus-markets-tabs-h, 48px) +
          var(--nexus-markets-view-gap, 28px) + 16px
      )
  );
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  box-sizing: border-box;
}
.nexus-all-main {
  min-width: 0;
  padding-right: 0;
  box-sizing: border-box;
}
.nexus-search {
  width: 100%;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--nexus-line);
  border-radius: 8px;
  background: var(--nexus-surface-2);
  color: var(--nexus-text);
  font-size: 13px;
  box-sizing: border-box;
}
.nexus-cat-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: rgba(7, 15, 27, 0.7);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.6;
  box-sizing: border-box;
}
body.dark-mode .nexus-cat-item {
  color: var(--nexus-muted);
}
.nexus-cat-item.is-active,
.nexus-cat-item:hover {
  background: var(--nexus-surface-2);
  color: #3179ff;
}
.nexus-cat-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  line-height: 0;
}
.nexus-cat-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  overflow: visible;
}
.nexus-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 18px;
  margin-bottom: 26px;
}
#nexusAllView .nexus-section-head {
  margin-bottom: 0;
}
#nexusAllView .nexus-section-head:has(#nexusAllTableTitle) {
  margin-bottom: 26px;
}
.nexus-table-scroll { overflow-x: auto; }
.nexus-mkt-table,
.nexus-pos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.nexus-mkt-table {
  background: #f3f7fa;
}
.nexus-mkt-table th,
.nexus-pos-table th {
  text-align: left;
  padding: 16px;
  color: var(--nexus-text);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.6;
  border-bottom: 0;
  white-space: nowrap;
}
.nexus-mkt-table td,
.nexus-pos-table td {
  padding: 16px;
  border-bottom: 1px solid #e0e4e9;
  color: var(--nexus-text);
  vertical-align: middle;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}
.nexus-mkt-table tr:hover,
.nexus-pos-table tbody tr:hover {
  background: var(--nexus-surface-2);
  cursor: pointer;
}
.nexus-mkt-table td.nexus-chg,
.nexus-mkt-table .nexus-mkt-change {
  font-size: 14px;
  font-weight: 400;
}
.nexus-mkt-table .nexus-mkt-change .nexus-chg-abs,
.nexus-mkt-table .nexus-mkt-change .nexus-chg-pct {
  display: inline;
  white-space: nowrap;
}
.nexus-mkt-table .nexus-mkt-px {
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  color: var(--nexus-text);
}
.nexus-sym-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nexus-sym-info {
  min-width: 0;
}
.nexus-sym-title-row {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}
.nexus-sym-ticker,
button.nexus-sym-link {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--nexus-text, #070f1b);
}
button.nexus-sym-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
button.nexus-sym-link:hover {
  color: #3179ff;
}
.nexus-sym-sep {
  display: inline-block;
  width: 1px;
  height: 12px;
  margin: 0 8px;
  background: rgba(7, 15, 27, 0.18);
  flex: 0 0 auto;
}
body.dark-mode .nexus-sym-sep {
  background: rgba(255, 255, 255, 0.2);
}
.nexus-sym-name,
.nexus-sym-cell strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--nexus-text);
}
.nexus-sym-cell .sub {
  display: block;
  font-size: 12px;
  color: rgba(7, 15, 27, 0.5);
  font-weight: 400;
  line-height: 1.6;
}
body.dark-mode .nexus-sym-cell .sub {
  color: var(--nexus-muted);
}
.nexus-badge-cfd {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  border-radius: 3px;
  font-size: 12px;
  line-height: 12px;
  font-weight: 400;
  background: transparent;
  color: #3179ff;
  letter-spacing: 0.01em;
}
.nexus-not-set {
  color: rgb(7, 15, 27);
  font-size: 12px;
  font-weight: 500;
  opacity: 0.5;
  line-height: normal;
}
body.dark-mode .nexus-not-set {
  color: var(--nexus-text);
  opacity: 0.5;
}
.nexus-pos-limits-col {
  vertical-align: middle;
}
.nexus-pos-limits {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  line-height: 1.2;
}
.nexus-pos-limit-price {
  line-height: 1.4;
}
.nexus-pos-limit-px {
  color: #1585d8;
  font-size: 12px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.nexus-pos-limit-pnl {
  color: rgb(7, 15, 27);
  font-size: 10px;
  font-weight: 500;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
}
body.dark-mode .nexus-pos-limit-pnl {
  color: var(--nexus-text);
}
body.dark-mode .nexus-pos-limit-px {
  color: #4da3e8;
}
.nexus-pos-check-col {
  width: 40px;
  padding-left: 12px !important;
  padding-right: 4px !important;
}
.nexus-pos-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}
.nexus-pos-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #3179ff;
  cursor: pointer;
  border-radius: 5px;
}
.nexus-pos-actions-col {
  width: 72px;
}
.nexus-source {
  color: rgb(7, 15, 27);
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
}
.nexus-source-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.nexus-source-cell--plain {
  display: inline;
}
.nexus-source-cell--plain .nexus-source-avatar {
  display: none;
}
.nexus-side-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.nexus-side-badge.buy { background: rgba(61, 199, 82, 0.1); color: #21ad36; }
.nexus-side-badge.sell { background: rgba(238, 49, 66, 0.1); color: #ee3142; }
.nexus-empty {
  padding: 32px;
  text-align: center;
  color: var(--nexus-muted);
}
.nexus-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.nexus-icon-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--nexus-line);
  border-radius: 7px;
  background: transparent;
  color: var(--nexus-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.nexus-icon-btn--ghost {
  border-color: transparent;
  background: transparent;
  color: rgba(7, 15, 27, 0.45);
}
.nexus-icon-btn--ghost:hover {
  color: rgb(7, 15, 27);
  background: transparent;
}
.nexus-icon-btn--ghost.danger {
  color: #ee3142;
}
.nexus-icon-btn--ghost.danger:hover {
  color: #ee3142;
  border-color: transparent;
  background: transparent;
}
.nexus-pos-action-ico {
  display: block;
}
.nexus-icon-btn--ghost:hover {
  background: rgba(7, 15, 27, 0.05);
}
.nexus-icon-btn.danger {
  color: #e53935;
}
.nexus-pos-action-ico {
  display: block;
}
.nexus-pos-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 72px 24px 96px;
  color: var(--nexus-text);
}
.nexus-pos-empty[hidden] {
  display: none !important;
}
.nexus-pos-empty-illu {
  width: 88px;
  height: 88px;
  margin-bottom: 20px;
  border-radius: 16px;
  border: 1px solid var(--nexus-line);
  display: grid;
  place-items: center;
  color: #3179ff;
  background: #fff;
}
.nexus-pos-empty-title {
  font-size: 20px;
  font-weight: 600;
  color: #3179ff;
  margin-bottom: 8px;
}
.nexus-pos-empty-desc,
.nexus-pos-empty-msg {
  font-size: 14px;
  color: rgba(7, 15, 27, 0.55);
  max-width: 360px;
  line-height: 1.45;
}
.nexus-pos-empty-msg {
  margin-bottom: 20px;
}
.nexus-pos-refine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 12px 2px 4px;
  background: #f3f5f6;
  color: rgba(7, 15, 27, 0.55);
  font-size: 14px;
}
.nexus-pos-refine[hidden] {
  display: none !important;
}
.nexus-pos-refine-label {
  font-weight: 500;
  color: rgba(7, 15, 27, 0.7);
}
.nexus-pos-refine-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--nexus-line);
}
.nexus-pos-refine-field input[type="date"] {
  border: 0;
  background: transparent;
  color: var(--nexus-text);
  font-size: 13px;
}
.nexus-pos-refine-dash {
  opacity: 0.5;
}
.nexus-pos-refine-reset {
  border: 0;
  background: transparent;
  color: rgba(7, 15, 27, 0.35);
  font-size: 14px;
  cursor: not-allowed;
}
.nexus-pos-refine-reset:not(:disabled) {
  color: #3179ff;
  cursor: pointer;
}
.nexus-icon-btn:hover { color: var(--nexus-text); }
.nexus-icon-btn.danger:hover { color: var(--nexus-bad); border-color: var(--nexus-bad); }

/* Open trade — Nexus: left column (header + tabs + content) | right ticket column */
.nexus-open-trade {
  min-width: 0;
  /* Vertical gap lives inside .nexus-ot-chrome padding-top (opaque while stuck). */
  margin-top: 0;
  overflow: visible;
}
.nexus-ot-grid {
  display: flex;
  align-items: stretch;
  gap: 18px;
  min-width: 0;
  overflow: visible;
}
.nexus-ot-left {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: visible;
  align-items: stretch;
  /* Keep sticky paint inside this column — never over the ticket. */
  position: relative;
  z-index: 0;
  isolation: isolate;
  background-color: var(--nexus-sticky-chrome-bg, #f8f9fa);
}
body.dark-mode .nexus-ot-left {
  background-color: var(--nexus-sticky-chrome-bg, #0c0c0c);
}
/*
 * Single sticky Open Trade chrome (header + tabs).
 * Sticks flush under the account shell. The former open-trade margin gap is
 * padding-top on this box so it stays opaque — no transparent strip where
 * scrolling chart/content can show through above the header.
 */
.nexus-ot-chrome {
  position: sticky;
  top: calc(
    var(--nexus-acct-sticky-top, 90px) + var(--nexus-sticky-top-gap, 12px) +
      var(--nexus-acct-bar-h, 72px)
  );
  z-index: 3;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: var(--nexus-ot-view-gap, 20px) 0 18px;
  box-sizing: border-box;
  background-color: var(--nexus-sticky-chrome-bg, #f8f9fa);
  /* Own compositing layer above iframe/chart content scrolling underneath */
  transform: translateZ(0);
  isolation: isolate;
}
body.dark-mode .nexus-ot-chrome {
  background-color: var(--nexus-sticky-chrome-bg, #0c0c0c);
}
/* Seal sub-pixel seam under the account shell while stuck */
.nexus-ot-chrome::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -3px;
  height: 3px;
  background-color: var(--nexus-sticky-chrome-bg, #f8f9fa);
  pointer-events: none;
  z-index: 0;
}
body.dark-mode .nexus-ot-chrome::before {
  background-color: var(--nexus-sticky-chrome-bg, #0c0c0c);
}
.nexus-ot-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  border-bottom: 0;
  min-height: 50px;
  background: transparent;
  box-sizing: border-box;
}
.nexus-ot-info {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  flex: 1 1 auto;
}
.nexus-back {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  margin: 0 16px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #070f1b;
  cursor: pointer;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.nexus-back svg {
  display: block;
}
.nexus-back:hover {
  background: transparent;
  color: #3179ff;
}
.nexus-ot-icon-wrap {
  flex: 0 0 auto;
  margin-right: 12px;
}
.nexus-ot-icon-wrap .nexus-inst-icon {
  width: 50px;
  height: 50px;
}
.nexus-ot-title {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 0 1 auto;
  min-width: 0;
}
.nexus-ot-title h2,
.nexus-ot-title-row h2 {
  margin: 0 10px 0 0;
  font-size: 18px;
  line-height: 18px;
  font-weight: 500;
  color: var(--nexus-text, #1d1e37);
}
.nexus-ot-title-row {
  display: flex;
  align-items: center;
  gap: 0;
}
.nexus-ot-sym-dd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--nexus-muted, #6b7280);
  cursor: pointer;
  line-height: 0;
  flex: 0 0 auto;
}
.nexus-ot-sym-dd:hover,
.nexus-ot-sym-dd[aria-expanded="true"] {
  color: var(--nexus-text, #1d1e37);
  background: color-mix(in srgb, var(--nexus-text) 6%, transparent);
}
body.dark-mode .nexus-ot-sym-dd:hover,
body.dark-mode .nexus-ot-sym-dd[aria-expanded="true"] {
  color: #d1d4dc;
  background: rgba(255, 255, 255, 0.08);
}
.nexus-ot-sym-dd svg {
  display: block;
}
.nexus-ot-name {
  color: var(--nexus-muted);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 400;
}
.nexus-ot-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.nexus-ot-sub .nexus-chg {
  font-size: 13px;
  font-weight: 500;
}
.nexus-ot-trailing {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  flex: 0 0 auto;
}
.nexus-ot-quotes {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
}
.nexus-ot-quote {
  appearance: none;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--nexus-text, #1d1e37);
  line-height: 22px;
}
.nexus-ot-quote .nexus-px-val {
  min-width: 0;
}
.nexus-ot-quote.is-up { color: var(--nexus-good, #00c853); }
.nexus-ot-quote.is-down { color: var(--nexus-bad, #ef5350); }
.nexus-trend-arrow {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  display: block;
}
.nexus-trend-arrow.up { fill: var(--nexus-good, #00c853); }
.nexus-trend-arrow.down { fill: var(--nexus-bad, #ef5350); }
.nexus-ot-quote.is-up .nexus-trend-arrow { fill: currentColor; }
.nexus-ot-quote.is-down .nexus-trend-arrow { fill: currentColor; }
.nexus-ot-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 0 20px;
  flex: 0 0 auto;
}
.nexus-ot-actions-sep {
  width: 1px;
  height: 10px;
  background: rgba(7, 15, 27, 0.1);
  flex: 0 0 1px;
}
.nexus-ot-action-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--nexus-text, #1d1e37);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
  white-space: nowrap;
}
.nexus-ot-action-btn:hover {
  color: #3179ff;
}
.nexus-ot-action-ico {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: block;
  color: #8b93a7;
}
.nexus-ot-action-ico[hidden] {
  display: none !important;
}
.nexus-ot-action-btn:hover .nexus-ot-action-ico,
.nexus-ot-action-btn.is-on .nexus-star-filled {
  color: #f5a623;
}
.nexus-ot-action-btn.is-on {
  color: var(--nexus-text, #1d1e37);
}
.nexus-watch-wrap {
  position: relative;
}
.nexus-watch-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  width: 220px;
  padding: 5px 16px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e4e9ef;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.176);
}
.nexus-watch-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #070f1b;
  font-size: 12px;
  font-weight: 600;
  padding: 12px 0;
  cursor: pointer;
  border-bottom: 1px solid #e4e9ef;
  margin-bottom: 8px;
}
.nexus-watch-menu-item:hover { color: #3179ff; }
.nexus-watch-create-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 5px;
  background: #3179ff;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 13px 7px 10px;
  cursor: pointer;
  margin: 4px 0 6px;
}
.nexus-watch-create-btn:hover { filter: brightness(1.05); }
.nexus-watch-list-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #8b93a7;
  font-size: 12px;
  padding: 8px 0;
  cursor: pointer;
}
.nexus-watch-list-btn.is-on { color: #3179ff; font-weight: 600; }
.nexus-ot-action-btn.is-on .nexus-star-filled {
  color: #f5a623;
}

/* Price alert modal — Nexus create-price-alert-modal parity */
.nexus-alert-modal {
  width: min(536px, calc(100vw - 32px));
  max-width: 536px;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}
.nexus-alert-modal__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 15px;
  border-bottom: none;
  background: #fff;
}
.nexus-alert-modal__close {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  border: 0;
  background: transparent;
  color: rgb(29, 30, 55);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.nexus-alert-modal__bell {
  display: inline-block;
  width: 15px;
  height: 15px;
  color: #7f93bc;
  font-size: 15px;
  line-height: 1;
  background: currentColor;
  /* bell+plus silhouette via mask */
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M12 22a2.1 2.1 0 0 0 2.1-2.1h-4.2A2.1 2.1 0 0 0 12 22Z'/><path d='M18.5 16.2V11a6.5 6.5 0 1 0-13 0v5.2L4 18.2V19.5h16v-1.3l-1.5-2Z'/><path d='M18.2 5.2v3.2M16.6 6.8h3.2'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M12 22a2.1 2.1 0 0 0 2.1-2.1h-4.2A2.1 2.1 0 0 0 12 22Z'/><path d='M18.5 16.2V11a6.5 6.5 0 1 0-13 0v5.2L4 18.2V19.5h16v-1.3l-1.5-2Z'/><path d='M18.2 5.2v3.2M16.6 6.8h3.2'/></svg>") center / contain no-repeat;
}
.nexus-alert-modal__title {
  margin: 0 0 0 10px;
  font-size: 16px;
  font-weight: 500;
  line-height: 26px;
  color: rgb(29, 30, 55);
}
.nexus-alert-modal__body {
  padding: 0;
  display: block;
}
.nexus-alert-box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 30px 32px;
  border-bottom: 1px solid #e4e9ef;
  box-sizing: border-box;
}
.nexus-alert-box--top {
  align-items: center;
}
.nexus-alert-box--inputs {
  flex-direction: column;
  align-items: flex-start;
}
.nexus-alert-box--notify {
  display: block;
  border-bottom: 0;
  padding: 30px 32px;
}
.nexus-alert-symbol {
  display: flex;
  align-items: center;
  width: 40%;
  min-width: 0;
}
.nexus-alert-symbol__icon {
  flex: 0 0 auto;
  min-width: 50px;
}
.nexus-alert-symbol__icon .nexus-inst-icon,
.nexus-alert-symbol__icon .nexus-sym-icon,
.nexus-alert-symbol__icon img {
  width: 50px !important;
  height: 50px !important;
}
.nexus-alert-symbol__meta {
  min-width: 0;
}
.nexus-alert-symbol__name {
  margin: 0 0 0 10px;
  font-size: 16px;
  font-weight: 500;
  line-height: 26px;
  color: rgb(29, 30, 55);
}
.nexus-alert-symbol__price {
  margin: 0 0 0 10px;
  font-size: 14px;
  font-weight: 400;
  color: #7f93bc;
}
.nexus-alert-symbol__price span {
  color: #7f93bc;
}
.nexus-alert-dir {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 60%;
  gap: 0;
}
.nexus-alert-dir-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1px solid #e4e9ef;
  border-radius: 3px;
  background: transparent;
  padding: 5px 15px;
  min-height: 36px;
  font-size: 14px;
  font-weight: 400;
  color: rgb(29, 30, 55);
  cursor: pointer;
  white-space: nowrap;
}
.nexus-alert-dir-btn:first-of-type {
  margin-right: 10px;
}
.nexus-alert-dir-btn svg {
  width: 12px;
  height: 12px;
  margin-right: 5px;
}
.nexus-alert-dir-btn.is-below svg { color: #ee3142; }
.nexus-alert-dir-btn.is-above svg { color: #3dc752; }
.nexus-alert-dir-btn.is-below.is-active {
  background: #d44333;
  border-color: #d44333;
  color: #fff;
}
.nexus-alert-dir-btn.is-below.is-active svg { color: #fff; }
.nexus-alert-dir-btn.is-above.is-active {
  background: #21a453;
  border-color: #21a453;
  color: #fff;
}
.nexus-alert-dir-btn.is-above.is-active svg { color: #fff; }
.nexus-alert-tabs-wrap {
  width: 100%;
  margin-bottom: 30px;
}
.nexus-alert-tabs {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
}
.nexus-alert-tabs button {
  flex: 1 1 0%;
  border: 0;
  border-bottom: 1px solid rgba(7, 15, 27, 0.08);
  background: #f3f5f6;
  border-radius: 0;
  padding: 6px 10px;
  min-height: 37px;
  font-size: 14px;
  font-weight: 400;
  color: rgb(29, 30, 55);
  cursor: pointer;
}
.nexus-alert-tabs button:first-child { border-radius: 10px 0 0 0; }
.nexus-alert-tabs button:last-child { border-radius: 0 10px 0 0; }
.nexus-alert-tabs button.is-active {
  background: #3179ff !important;
  color: #fff;
  font-weight: 500;
  border-bottom: 1px solid #2c6ce5 !important;
}
.nexus-alert-fields {
  display: flex;
  width: 100%;
  gap: 0;
}
.nexus-alert-field {
  display: block;
  min-width: 0;
}
.nexus-alert-field--value {
  width: 40%;
}
.nexus-alert-fields:not(.is-split) .nexus-alert-field--value {
  width: 40%;
}
.nexus-alert-field--period {
  width: 60%;
}
.nexus-alert-field--period[hidden] {
  display: none !important;
}
.nexus-alert-field p {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: #7f93bc;
}
.nexus-alert-amount {
  display: block;
  width: 100%;
  max-width: 95%;
  height: 40px;
  margin: 0;
  border: none;
  border-radius: 3px;
  background: #fff;
  padding: 0 0 0 10px;
  font-size: 20px;
  font-weight: 400;
  color: rgb(29, 30, 55);
  font-variant-numeric: tabular-nums;
  outline: none;
  box-sizing: border-box;
}
.nexus-alert-field--period .nexus-alert-amount {
  max-width: 100%;
  width: 100%;
}
.nexus-alert-error {
  width: 100%;
  margin-top: 16px;
  border-top: 2px solid #ee3142;
  height: 40px;
  text-align: center;
  box-sizing: border-box;
}
.nexus-alert-error[hidden] {
  display: none !important;
}
.nexus-alert-error > div {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 10px;
  background: rgba(238, 49, 66, 0.2);
  box-sizing: border-box;
}
.nexus-alert-error svg {
  width: 14px;
  height: 14px;
  margin-right: 8px;
  color: #ee3142;
  flex: 0 0 auto;
}
.nexus-alert-error p {
  margin: 0;
  font-size: 14px;
  color: rgb(147, 21, 32);
  line-height: normal;
}
.nexus-alert-notify {
  position: relative;
  margin-bottom: 15px;
}
.nexus-alert-notify input[type="checkbox"] {
  display: none;
}
.nexus-alert-notify label {
  position: relative;
  display: block;
  cursor: pointer;
  margin: 0;
  padding-left: 28px;
  font-size: 16px;
  font-weight: 400;
  color: rgb(29, 30, 55);
  user-select: none;
}
.nexus-alert-notify label::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  border: 1px solid #7f93bc;
  border-radius: 3px;
  opacity: 0.6;
  box-sizing: border-box;
}
.nexus-alert-notify label::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 2px;
  width: 5px;
  height: 12px;
  border: 1px solid transparent;
  border-radius: 0;
  opacity: 0;
  transform: rotate(45deg);
  box-sizing: border-box;
  z-index: 1;
}
.nexus-alert-notify input[type="checkbox"]:checked + label::after {
  background: #3179ff;
  border: none;
  opacity: 1;
}
.nexus-alert-notify input[type="checkbox"]:checked + label::before {
  opacity: 1;
  border-color: transparent #fff #fff transparent;
  top: 2px;
}
.nexus-alert-modal__foot {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.nexus-alert-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  width: auto;
  max-width: 100%;
  border: 1px solid #3179ff;
  border-radius: 3px;
  background: #3179ff;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  padding: 7px 23px;
  min-height: 40px;
  height: 40px;
  cursor: pointer;
  box-sizing: border-box;
}
.nexus-alert-submit:hover { filter: brightness(1.04); }
.nexus-alert-submit.is-loading {
  pointer-events: none;
  color: transparent;
  position: relative;
}
.nexus-alert-submit.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: nexus-alert-spin 0.7s linear infinite;
}
@keyframes nexus-alert-spin {
  to { transform: rotate(360deg); }
}
@media (max-width: 560px) {
  .nexus-alert-box--top {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
  .nexus-alert-symbol,
  .nexus-alert-dir {
    width: 100%;
    justify-content: flex-start;
  }
  .nexus-alert-fields {
    flex-direction: column;
    gap: 16px;
  }
  .nexus-alert-field--value,
  .nexus-alert-field--period,
  .nexus-alert-fields:not(.is-split) .nexus-alert-field--value {
    width: 100%;
  }
  .nexus-alert-amount {
    max-width: 100%;
  }
}
.nexus-alert-symbol-pick {
  width: 100%;
  position: relative;
}
.nexus-alert-symbol-pick[hidden],
.nexus-alert-symbol-selected[hidden],
.nexus-alert-symbol-results[hidden] {
  display: none !important;
}
.nexus-alert-symbol-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid #e4e9ef;
  border-radius: 3px;
  background: #fff;
  min-height: 42px;
  padding: 0 12px;
  box-sizing: border-box;
}
.nexus-alert-symbol-search input {
  flex: 1 1 auto;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: rgb(29, 30, 55);
  min-width: 0;
  padding: 8px 0;
}
.nexus-alert-symbol-search input::placeholder {
  color: #7f93bc;
}
.nexus-alert-symbol-chevron {
  width: 18px;
  height: 18px;
  color: #7f93bc;
  flex: 0 0 auto;
  margin-left: 8px;
}
.nexus-alert-symbol-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid #e4e9ef;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.nexus-alert-symbol-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  color: rgb(29, 30, 55);
  font-size: 14px;
}
.nexus-alert-symbol-result:hover {
  background: #f3f5f6;
}
.nexus-alert-symbol-result .nexus-inst-icon {
  width: 28px !important;
  height: 28px !important;
}
.nexus-alert-symbol-result strong {
  font-weight: 500;
}
.nexus-alert-symbol-result span {
  color: #7f93bc;
  font-size: 12px;
  margin-left: 6px;
}
.nexus-alert-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}
.nexus-alert-box--top.is-pick {
  display: block;
}

/* Price Alerts list — Nexus discovery-tools/price-alerts */
.nexus-price-alerts {
  padding: 0;
  color: rgb(29, 30, 55);
  font-size: 14px;
}
.nexus-price-alerts__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 38px;
  margin: 0 0 12px;
  padding: 0 4px;
}
.nexus-price-alerts__title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nexus-price-alerts__title {
  margin: 0;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.2;
  color: rgb(29, 30, 55);
}
.nexus-price-alerts__info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #7f93bc;
  color: #7f93bc;
  font-size: 11px;
  line-height: 1;
  cursor: help;
}
.nexus-price-alerts__filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 14px;
  padding-right: 4px;
}
.nexus-price-alerts__view-label {
  color: rgb(29, 30, 55);
  font-size: 14px;
}
.nexus-price-alerts__filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  color: rgb(29, 30, 55);
  user-select: none;
}
.nexus-price-alerts__filter input {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1.5px solid rgba(7, 15, 27, 0.2);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.nexus-price-alerts__filter input:checked {
  background: #3179ff;
  border-color: #3179ff;
}
.nexus-price-alerts__filter input:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.nexus-price-alerts__set-btn {
  border: 1px solid #3179ff;
  border-radius: 3px;
  background: #3179ff;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 5px 15px;
  min-height: 36px;
  cursor: pointer;
}
.nexus-price-alerts__set-btn:hover {
  filter: brightness(1.04);
}
.nexus-price-alerts__table-header,
.nexus-price-alerts__row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 32px;
  box-sizing: border-box;
}
.nexus-price-alerts__table-header {
  min-height: 32px;
  color: #7f93bc;
  font-size: 14px;
}
.nexus-price-alerts__table-header p {
  margin: 0;
  font-weight: 400;
}
.nexus-price-alerts__col--symbol,
.nexus-price-alerts__col--chart,
.nexus-price-alerts__col--type,
.nexus-pa-symbol,
.nexus-pa-chart,
.nexus-pa-type {
  flex: 0 0 24%;
  max-width: 279px;
  width: 24%;
}
.nexus-price-alerts__col--price,
.nexus-pa-price {
  flex: 0 0 10%;
  max-width: 112px;
  width: 10%;
}
.nexus-price-alerts__col--notif,
.nexus-pa-notif {
  flex: 0 0 14%;
  max-width: 167px;
  width: 14%;
}
.nexus-price-alerts__row {
  min-height: 64px;
  border-radius: 8px;
}
.nexus-price-alerts__row:hover {
  background: rgba(49, 121, 255, 0.04);
}
.nexus-pa-symbol {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.nexus-pa-symbol .nexus-inst-icon,
.nexus-pa-symbol img {
  width: 32px !important;
  height: 32px !important;
  flex: 0 0 auto;
}
.nexus-pa-symbol p {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: rgb(29, 30, 55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nexus-pa-price {
  font-variant-numeric: tabular-nums;
  color: rgb(29, 30, 55);
}
.nexus-pa-chart {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 32px;
}
.nexus-pa-spark {
  width: 230px;
  max-width: 100%;
  height: 32px;
  display: block;
}
.nexus-pa-type {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: rgb(29, 30, 55);
}
.nexus-pa-type__bell {
  width: 14px;
  height: 14px;
  color: #7f93bc;
  flex: 0 0 auto;
}
.nexus-pa-type__arrow {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}
.nexus-pa-type__arrow.is-down { color: #ee3142; }
.nexus-pa-type__arrow.is-up { color: #3dc752; }
.nexus-pa-type__text {
  margin: 0;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nexus-pa-notif {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nexus-pa-notif__ico {
  width: 16px;
  height: 16px;
  color: #7f93bc;
  display: inline-flex;
}
.nexus-pa-notif__ico.is-active {
  color: #1585d8;
}
.nexus-pa-trash {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 16px;
  height: 16px;
  color: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nexus-price-alerts__row:hover .nexus-pa-trash {
  color: #7f93bc;
}
.nexus-pa-trash:hover {
  color: #ee3142 !important;
}
.nexus-price-alerts__empty {
  padding: 48px 32px;
  text-align: center;
  color: #7f93bc;
}
.nexus-price-alerts__empty p {
  margin: 0 0 6px;
  font-size: 16px;
  color: rgb(29, 30, 55);
}
.nexus-price-alerts__empty span {
  font-size: 14px;
}
@media (max-width: 900px) {
  .nexus-price-alerts__table-header {
    display: none;
  }
  .nexus-price-alerts__row {
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 14px 16px;
    border: 1px solid #e4e9ef;
    border-radius: 10px;
    margin: 0 8px 10px;
    justify-content: flex-start;
  }
  .nexus-pa-symbol,
  .nexus-pa-price,
  .nexus-pa-chart,
  .nexus-pa-type,
  .nexus-pa-notif {
    flex: 1 1 auto;
    max-width: none;
    width: auto;
  }
  .nexus-pa-chart { order: 5; width: 100%; }
  .nexus-pa-trash { color: #7f93bc; }
}

/* Create watchlist modal */
.nexus-watchlist-modal {
  width: min(420px, calc(100vw - 32px));
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
}
.nexus-watchlist-modal__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 56px;
  padding: 15px 48px 15px 24px;
  border-bottom: 1px solid #e4e9ef;
}
.nexus-watchlist-modal__head .nexus-x {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 22px;
  cursor: pointer;
}
.nexus-watchlist-modal__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #070f1b;
}
.nexus-watchlist-modal__body {
  padding: 28px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.nexus-watchlist-modal__body input {
  width: 100%;
  border: 1px solid #e4e9ef;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 14px;
  color: #070f1b;
  box-sizing: border-box;
}
.nexus-watchlist-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.nexus-watchlist-modal__actions .nexus-btn-primary {
  background: #3179ff;
  border: 1px solid #3179ff;
  border-radius: 5px;
  font-weight: 500;
}

.nexus-ot-tabs {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 4px;
  /* Breathing room above/below tabs; painted by .nexus-ot-chrome (padding, not margin) */
  margin: 0;
  padding: 16px 0 0;
  border-bottom: 1px solid var(--nexus-line);
  background: transparent;
  box-sizing: border-box;
}
.nexus-ot-tab {
  border: 0;
  background: transparent;
  color: var(--nexus-muted);
  padding: 12px 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.nexus-ot-tab.is-active {
  color: var(--nexus-text);
  border-bottom-color: var(--primary-blue, #3b82f6);
}
.nexus-ot-panel {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  z-index: 0;
  background-color: var(--nexus-sticky-chrome-bg, #f8f9fa);
}
.nexus-ot-panel[data-nexus-opanel="chart"] {
  display: flex;
  flex-direction: column;
}
.nexus-ot-panel[data-nexus-opanel="chart"] .nexus-tv-wrap {
  flex: 1 1 auto;
  height: 100%;
  min-height: 360px;
}
body.dark-mode .nexus-ot-panel {
  background-color: var(--nexus-sticky-chrome-bg, #0c0c0c);
}
.nexus-chart-bar { margin-bottom: 8px; }
.nexus-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--nexus-line);
  background: var(--nexus-surface);
  color: var(--nexus-text);
}
.nexus-tv-wrap {
  position: relative;
  height: 520px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}
.nexus-tv {
  flex: 1 1 auto;
  height: 100%;
  min-height: 420px;
  border: 1px solid var(--nexus-line);
  border-radius: 10px;
  overflow: hidden;
  background: #0b1220;
  display: flex;
  flex-direction: column;
}
.nexus-tv #tradingview_chart,
.nexus-tv #tradingview_chart.TVChartContainer {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.nexus-tv #tradingview_chart iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0;
}
/* Symbol search opens from open-trade chrome (not over the chart) */
.nexus-tv-symbol-picker {
  position: absolute;
  top: calc(var(--nexus-ot-view-gap, 20px) + 64px);
  left: 52px;
  z-index: 20;
  width: min(560px, calc(100% - 64px));
  max-height: min(480px, 70vh);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--nexus-line);
  border-radius: 8px;
  background: var(--nexus-surface);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}
.nexus-tv-symbol-picker[hidden] {
  display: none !important;
}
.nexus-tv-symbol-picker-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 4px;
  color: var(--nexus-text);
  font-size: 15px;
}
.nexus-tv-symbol-close {
  border: 0;
  background: transparent;
  color: var(--nexus-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.nexus-tv-symbol-picker-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--nexus-line);
}
.nexus-tv-search-ico {
  color: var(--nexus-muted);
  flex: 0 0 auto;
}
.nexus-tv-symbol-search {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--nexus-text);
  font-size: 14px;
}
.nexus-tv-symbol-search:focus {
  outline: none;
}
.nexus-tv-symbol-filters {
  display: flex;
  gap: 6px;
  padding: 8px 12px 4px;
}
.nexus-tv-filter {
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  background: color-mix(in srgb, var(--nexus-text) 6%, transparent);
  color: var(--nexus-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.nexus-tv-filter.is-active {
  background: color-mix(in srgb, #2563eb 16%, transparent);
  color: #2563eb;
}
.nexus-tv-symbol-cols {
  display: grid;
  grid-template-columns: minmax(120px, 0.34fr) 1fr minmax(72px, 0.2fr);
  gap: 10px;
  padding: 6px 14px 4px;
  color: var(--nexus-muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nexus-tv-symbol-results {
  overflow: auto;
  padding: 0 6px 8px;
  max-height: 320px;
}
.nexus-tv-symbol-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(120px, 0.34fr) 1fr minmax(72px, 0.2fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--nexus-text);
  text-align: left;
  cursor: pointer;
}
.nexus-tv-symbol-item:hover,
.nexus-tv-symbol-item.is-active {
  background: color-mix(in srgb, var(--nexus-text) 6%, transparent);
}
.nexus-tv-symbol-item-sym {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.nexus-tv-symbol-item-sym .nexus-inst-icon {
  width: 22px;
  height: 22px;
}
.nexus-tv-symbol-item-sym strong {
  font-size: 13px;
}
.nexus-tv-symbol-item-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--nexus-muted);
  font-size: 13px;
}
.nexus-tv-symbol-item-exchange {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--nexus-text);
}
.nexus-tv-symbol-empty {
  padding: 18px 12px;
  color: var(--nexus-muted);
  font-size: 13px;
  text-align: center;
}
body.dark-mode .nexus-tv-symbol-picker {
  background: var(--nexus-surface);
  border-color: var(--nexus-line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}
.nexus-conditions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin: 0;
}
.nexus-conditions dt {
  color: var(--nexus-muted);
  font-size: 12px;
}
.nexus-conditions dd {
  margin: 0 0 8px;
  font-weight: 650;
  color: var(--nexus-text);
}

/* Ticket — Nexus buy-sell-wrapper / Loader__content parity */
.nexus-ticket {
  flex: 0 0 400px;
  width: 400px;
  max-width: 100%;
  box-sizing: border-box;
  border: 0;
  border-radius: 20px;
  background: #fff;
  /* Nexus Loader__content: height auto, padding-bottom 1px — content-sized, not stretched */
  padding: 0 0 1px;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-self: flex-start;
  min-height: 0;
  height: auto;
  position: relative;
  /* Above left-column sticky chrome so sticky paint never covers the ticket. */
  z-index: 1;
  overflow-x: hidden;
  overflow-y: visible;
  margin-top: var(--nexus-ot-view-gap, 20px);
}
.nexus-ticket-inner {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  height: auto;
  padding-bottom: 0;
}
/* Mobile-only ticket chrome (shown in ≤768 sheet) */
.nexus-ticket-mobile-head,
.nexus-ticket-mobile-symbol,
.nexus-ot-mobile-footer {
  display: none;
}
.nexus-side-toggle {
  padding: 16px;
  margin: 0 0 0 -5px;
  box-sizing: border-box;
}
.nexus-side-group {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 368px;
  margin-left: 5px;
  height: 45px;
  border-radius: 10px;
  background: #f3f5f6;
  border: 1px solid rgba(7, 15, 27, 0.1);
  overflow: hidden;
}
.nexus-side-btn {
  appearance: none;
  flex: 1 1 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 15px 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1d1e37;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  position: relative;
  z-index: 1;
}
.nexus-side-btn.buy {
  margin-left: -1px;
}
.nexus-side-btn span {
  color: inherit;
}
.nexus-side-btn.sell.is-active {
  background: #ee3142;
  color: #fff;
  font-weight: 500;
}
.nexus-side-btn.buy.is-active {
  background: #02b526;
  color: #fff;
  font-weight: 500;
}
.nexus-spread-pill {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  min-width: 52px;
  text-align: center;
  font-size: 12px;
  font-weight: 400;
  color: #1d1e37;
  background: #fff;
  border-radius: 100px;
  padding: 4px 8px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 1px rgba(7, 15, 27, 0.06);
}
.nexus-ticket-body {
  /* Nexus .open-trade__right__container is block so vertical margins collapse */
  display: block;
  /* Nexus .open-trade__right__container */
  margin: 10px 16px 16px;
  min-width: 0;
}
.nexus-ticket-panel {
  border: 1px solid rgba(7, 15, 27, 0.1);
  border-radius: 10px;
  overflow: hidden;
  padding: 0 0 16px;
  margin: 0;
}
.nexus-blue-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  width: 100%;
}
.nexus-blue-toggle button {
  appearance: none;
  border: 0;
  background: #f3f5f6;
  color: #1d1e37;
  font-size: 14px;
  font-weight: 400;
  min-height: 37px;
  padding: 6px 10px;
  cursor: pointer;
}
.nexus-blue-toggle button:first-child {
  border-radius: 10px 0 0 0;
}
.nexus-blue-toggle button:last-child {
  border-radius: 0 10px 0 0;
}
.nexus-blue-toggle button.is-active {
  background: #3179ff;
  color: #fff;
  font-weight: 500;
}
.nexus-ticket-panel > .nexus-blue-toggle {
  margin-bottom: 0;
}
/* Nexus `.open-trade .pending-toggle .btn { margin-bottom: 19px }` — space above Lotsize */
.nexus-ticket-panel > .nexus-blue-toggle button {
  margin-bottom: 19px;
}
.nexus-enter-value {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  margin: 16px;
  padding: 12px;
  border: 1px solid rgba(7, 15, 27, 0.1);
  border-radius: 10px;
  background: transparent;
  box-sizing: border-box;
}
.nexus-enter-value[hidden] {
  display: none !important;
}
#nexusPriceWrap:not([hidden]) {
  margin-bottom: 19px;
}
.nexus-enter-value label {
  position: absolute;
  top: -12px;
  left: 14px;
  margin: 0;
  padding: 4px;
  font-size: 12px;
  font-weight: 400;
  color: rgba(7, 15, 27, 0.5);
  background: #fff;
  line-height: 1.2;
}
.nexus-enter-value input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 16px;
  font-weight: 400;
  color: #1d1e37;
  font-variant-numeric: tabular-nums;
  outline: none;
  padding: 0 10px;
}
.nexus-round-btn {
  appearance: none;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 0;
  border-radius: 24px;
  background: #fff;
  color: #1d1e37;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.nexus-round-btn:hover {
  color: #3179ff;
}
.nexus-pct {
  margin: 16px;
  padding: 0;
}
.nexus-pct-labels {
  display: flex;
  justify-content: space-between;
  margin: 0 0 8px;
  padding: 0 8px;
  color: rgba(7, 15, 27, 0.5);
}
.nexus-pct-labels button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  width: 35px;
  padding: 0;
  text-align: center;
  cursor: pointer;
}
.nexus-pct-labels button.is-active {
  color: #3179ff;
}
.nexus-pct-track {
  position: relative;
  border: 1px solid #e0e4e9;
  border-radius: 64px;
  overflow: hidden;
}
.nexus-pct-dots {
  position: absolute;
  inset: 0 26px 2px 22px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  color: rgba(7, 15, 27, 0.1);
  font-size: 8px;
  line-height: 1;
}
.nexus-pct input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 64px;
  background: #f3f5f6;
  outline: none;
  cursor: pointer;
}
.nexus-pct input[type="range"]::-webkit-slider-runnable-track {
  height: 32px;
  background: transparent;
  border: none;
}
.nexus-pct input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 56px;
  height: 32px;
  border: none;
  border-radius: 64px;
  background-color: transparent;
  background-image: url("market-icons/buy-sell-slider.svg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  /* Wide fill behind thumb; clipped by .nexus-pct-track overflow (fixed -220px broke on ≤768 full-width sheet) */
  box-shadow: -100vmax 0 0 100vmax rgba(49, 121, 255, 0.4);
  cursor: pointer;
}
.nexus-pct input[type="range"]::-moz-range-track {
  height: 32px;
  background: transparent;
  border: none;
}
.nexus-pct input[type="range"]::-moz-range-thumb {
  width: 56px;
  height: 32px;
  border: none;
  border-radius: 64px;
  background-color: transparent;
  background-image: url("market-icons/buy-sell-slider.svg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: -100vmax 0 0 100vmax rgba(49, 121, 255, 0.4);
  cursor: pointer;
}
.nexus-protector {
  /* Thin full-width divider under the order panel, then compact stack to CTA */
  margin: 20px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(7, 15, 27, 0.1);
}
.nexus-protector-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #1d1e37;
}
.nexus-protector-panel {
  border: 1px solid rgba(7, 15, 27, 0.1);
  border-radius: 10px;
  overflow: hidden;
}
.nexus-protector-panel > .nexus-blue-toggle {
  margin-bottom: 0;
}
/* Nexus `.limit-value` — inset rows with typed/input chrome + 16px surround */
.nexus-limit-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 16px;
  min-height: 44px;
  padding: 0;
  border: 0;
  box-sizing: border-box;
}
.nexus-limit-title {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 100px;
  height: 44px;
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  text-align: center;
  color: #1d1e37;
  border: 1px solid rgba(7, 15, 27, 0.1);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  box-sizing: border-box;
}
.nexus-limit-title::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 20px;
  background: rgba(7, 15, 27, 0.1);
}
.nexus-limit-input {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(7, 15, 27, 0.1);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  box-sizing: border-box;
}
.nexus-limit-prefix {
  color: #8b93a7;
  font-size: 14px;
  flex: 0 0 auto;
  min-width: 12px;
}
.nexus-limit-prefix:empty {
  display: none;
}
.nexus-limit-input input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  color: #1d1e37;
  font-variant-numeric: tabular-nums;
  outline: none;
  padding: 0;
  margin-left: auto;
  text-align: right;
  width: 90px;
}
.nexus-limit-notset {
  color: rgba(7, 15, 27, 0.5);
  font-size: 16px;
  line-height: 19px;
  margin-left: auto;
  display: flex;
  justify-content: flex-end;
}
.nexus-limit-row .nexus-switch {
  margin-left: 20px;
}
/* Nexus `.limit-value.is-disabled .limit-value__input/__type` */
.nexus-limit-row.is-off .nexus-limit-title,
.nexus-limit-row.is-off .nexus-limit-input {
  background: #f3f5f6;
  border-color: #f3f5f6;
  color: rgba(7, 15, 27, 0.5);
}
.nexus-limit-row.is-off .nexus-limit-title::after {
  background: rgba(7, 15, 27, 0.1);
}
.nexus-limit-row.is-off .nexus-limit-input input {
  display: none;
}
.nexus-limit-row:not(.is-off) .nexus-limit-notset {
  display: none;
}
.nexus-switch {
  position: relative;
  width: 42px;
  height: 24px;
  display: inline-block;
  flex-shrink: 0;
}
.nexus-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.nexus-switch span {
  position: absolute;
  inset: 0;
  background: #f3f5f6;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.15s ease;
}
.nexus-switch span::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #3179ff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: 0.15s ease;
}
.nexus-switch input:checked + span {
  background: #3179ff;
}
.nexus-switch input:checked + span::after {
  transform: translateX(18px);
  background: #fff;
}
.nexus-cta {
  border: 0;
  border-radius: 10px;
  padding: 7px 23px;
  min-height: 45px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  margin-top: 24px;
  margin-bottom: 0;
  width: 100%;
}
.nexus-cta.sell { background: #ee3142; }
.nexus-cta.buy { background: #3dc752; }
.nexus-cta:disabled { opacity: 0.55; cursor: not-allowed; }

/* Nexus order-placed toast — fixed viewport overlay (all breakpoints) */
.nexus-order-toast-host {
  position: fixed;
  top: 16px;
  right: 16px;
  left: auto;
  bottom: auto;
  z-index: 20050; /* above .top-header (200), bottom-nav (1200), nexus modals (12000) */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  width: auto;
  max-width: min(440px, calc(100vw - 32px));
  margin: 0;
  padding: 0;
  pointer-events: none;
  overflow: visible;
  transform: none;
  isolation: isolate;
}
.nexus-order-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
  padding: 14px 40px 16px 16px;
  border-radius: 4px;
  background: #00c853;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
  will-change: transform, opacity;
}
.nexus-order-toast.is-visible {
  transform: translateX(0);
  opacity: 1;
}
.nexus-order-toast.is-leaving {
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition: transform 0.34s cubic-bezier(0.4, 0, 1, 1), opacity 0.26s ease;
}
.nexus-order-toast__icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.nexus-order-toast__icon svg {
  display: block;
  width: 24px;
  height: 24px;
}
.nexus-order-toast__msg {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 2px;
  white-space: nowrap;
}
.nexus-order-toast__x {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
}
.nexus-order-toast__x:hover {
  opacity: 1;
}
.nexus-order-toast__x svg {
  display: block;
  width: 12px;
  height: 12px;
}
.nexus-order-toast__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.55);
  transform-origin: left center;
  transform: scaleX(1);
  animation: nexus-toast-progress 3s linear forwards;
}
@keyframes nexus-toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
@media (max-width: 768px) {
  .nexus-order-toast-host {
    top: max(12px, env(safe-area-inset-top, 0px));
    right: 12px;
    left: auto;
    max-width: calc(100vw - 24px);
  }
  .nexus-order-toast {
    width: max-content;
    max-width: 100%;
    padding: 12px 36px 14px 14px;
    font-size: 13px;
  }
  .nexus-order-toast__msg {
    white-space: normal;
  }
}
.nexus-err {
  margin: 0 0 8px;
  color: var(--nexus-bad);
  font-size: 12px;
}

/* Positions toolbar — Nexus `.additional-info-box` / trades-filter */
.nexus-pos-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  margin: 0 0 0;
  padding: 16px 2px;
  background: #f3f5f6;
  border: 0;
  border-radius: 0;
  box-sizing: border-box;
}
.nexus-pos-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  font-size: 14px;
  color: var(--nexus-muted);
}
.nexus-pill-group {
  display: flex;
  align-items: center;
  margin-right: 24px;
}
.nexus-pill-group:last-child {
  margin-right: 0;
}
.nexus-pill-label {
  color: rgba(7, 15, 27, 0.5);
  font-size: 14px;
  margin-right: 8px;
  white-space: nowrap;
}
.nexus-pos-filters .nexus-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #fff;
  border-radius: 8px;
  flex: 0 0 auto;
  grid-template-columns: none;
}
.nexus-seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(7, 15, 27, 0.5);
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nexus-seg-btn:hover {
  color: #1d1e37;
}
.nexus-pos-filters .nexus-seg-btn.is-active {
  background: #3179ff;
  color: #fff;
  border-color: transparent;
}
.nexus-pos-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: rgb(7, 15, 27);
  font-weight: 500;
}
.nexus-pos-summary strong { color: var(--nexus-text); }
.nexus-pos-summary strong.is-neg {
  color: #ee3142;
  font-weight: 600;
}
.nexus-pos-summary strong.is-pos {
  color: #21ad36;
  font-weight: 600;
}
#nexusPosCount {
  color: rgba(7, 15, 27, 0.55);
  font-weight: 400;
}

/* Trade detail — Nexus `.content-box.trade-details` */
.nexus-trade-detail {
  padding: 0 0 24px;
}
.nexus-trade-detail[hidden] {
  display: none !important;
}
.nexus-trade-detail__card {
  background: #fff;
  border: 1px solid #e4e9ef;
  border-radius: 3px;
  padding: 5px 25px 30px;
  box-sizing: border-box;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}
.nexus-trade-detail h2,
.nexus-td-nav-title {
  margin: 0;
  color: rgb(29, 30, 55);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}
.nexus-td-nav {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 50px;
  font-size: 16px;
}
.nexus-td-nav-back {
  display: flex;
  flex: 1 1 0;
}
.nexus-td-nav-title {
  display: flex;
  flex: 2 1 0;
  justify-content: center;
}
.nexus-td-nav-actions {
  display: flex;
  flex: 1 1 0;
  justify-content: flex-end;
  align-items: center;
}
.nexus-td-nav .nexus-back,
.nexus-td-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: #3179ff;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  padding: 12px 0;
  line-height: 1;
}
.nexus-td-back-chevron {
  display: block;
  flex: 0 0 auto;
}
.nexus-td-price-alert {
  border: 0;
  background: transparent;
  color: #7f93bc;
  padding: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.nexus-td-price-alert:hover {
  color: #3179ff;
}
.nexus-td-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 8px;
  margin: 0 0 60px;
  font-size: 14px;
}
.nexus-td-stats--closed {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.nexus-td-stats--pending {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.nexus-td-cell {
  min-width: 0;
  margin: 0 0 25px;
  padding: 0 8px 0 0;
  display: flex;
  flex-direction: column;
}
/* Right-side columns get Nexus vertical separators (Lots→Open Time) */
.nexus-td-stats > .nexus-td-cell:nth-child(3),
.nexus-td-stats > .nexus-td-cell:nth-child(4),
.nexus-td-stats > .nexus-td-cell:nth-child(8),
.nexus-td-stats > .nexus-td-cell:nth-child(9),
.nexus-td-stats--closed > .nexus-td-cell:nth-child(3),
.nexus-td-stats--closed > .nexus-td-cell:nth-child(4),
.nexus-td-stats--closed > .nexus-td-cell:nth-child(5),
.nexus-td-stats--closed > .nexus-td-cell:nth-child(9),
.nexus-td-stats--closed > .nexus-td-cell:nth-child(10),
.nexus-td-stats--closed > .nexus-td-cell:nth-child(11) {
  border-right: 1px solid #e4e9ef;
  padding-right: 25px;
  padding-left: 17px;
}
.nexus-td-stats > .nexus-td-cell:nth-child(5),
.nexus-td-stats > .nexus-td-cell:nth-child(10),
.nexus-td-stats--closed > .nexus-td-cell:nth-child(6),
.nexus-td-stats--closed > .nexus-td-cell:nth-child(12) {
  padding-left: 17px;
}
.nexus-td-cell-label {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: #7f95b8;
  margin-bottom: 4px;
  line-height: 1.3;
}
.nexus-td-cell-value {
  font-size: 14px;
  font-weight: 400;
  color: rgb(29, 30, 55);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  margin-top: 2px;
}
.nexus-td-cell--lg .nexus-td-cell-value,
.nexus-td-cell--lg .nexus-td-cell-value strong {
  font-size: 20px;
  font-weight: 400;
  line-height: 24px;
}
.nexus-td-cell-value strong {
  font-weight: 400;
  color: inherit;
}
.nexus-td-cell-roi {
  color: #7f95b8;
  font-size: 18px;
}
.nexus-td-cell-value.is-neg,
.nexus-td-cell-value .is-neg {
  color: #ee3142;
}
.nexus-td-cell-value.is-pos,
.nexus-td-cell-value .is-pos {
  color: #21ad36;
}
.nexus-td-copiers,
.nexus-td-premium-link {
  border: 0;
  background: transparent;
  color: rgba(49, 121, 255, 0.8);
  font-size: inherit;
  font-weight: 400;
  padding: 0;
  cursor: default;
}
.nexus-td-premium-link {
  font-size: 14px;
  color: #3179ff;
}
.nexus-td-premium-up {
  color: var(--nexus-text);
}
.nexus-td-q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border-radius: 50%;
  border: 1px solid #7f95b8;
  color: #7f95b8;
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
  cursor: help;
}
.nexus-td-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.nexus-trade-detail.is-closed .nexus-td-actions {
  display: none;
}
.nexus-td-link {
  border: 0;
  background: transparent;
  color: #3179ff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.nexus-btn-success {
  border: 0;
  border-radius: 3px;
  padding: 7px 23px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  background: #3dc752;
  color: #fff;
  min-height: 40px;
}
.nexus-btn-success:hover {
  background: #34b848;
}
.nexus-td-hero {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(260px, 1.5fr) minmax(120px, 0.8fr);
  gap: 18px;
  align-items: center;
  padding: 0;
  margin: 40px 0 50px;
  border: 0;
  background: transparent;
}
.nexus-td-hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nexus-td-hero-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
}
.nexus-td-dot {
  opacity: 0.45;
  margin: 0 4px;
}
.nexus-td-hero-sub {
  font-size: 13px;
  color: rgba(7, 15, 27, 0.55);
  margin-top: 2px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.nexus-td-hero-px {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.nexus-td-hero-px.is-neg { color: #ee3142; }
.nexus-td-hero-px.is-pos { color: #21ad36; }
.nexus-td-hero-owner {
  justify-self: end;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  text-align: right;
  color: rgb(29, 30, 55);
  font-size: 14px;
}
.nexus-td-owner-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
  margin-right: 10px;
}
.nexus-td-owner-title {
  font-size: 14px;
  font-weight: 400;
  color: #7f95b8;
  line-height: 1.3;
}
.nexus-td-owner-name {
  font-size: 16px;
  font-weight: 400;
  color: #3179ff;
  line-height: 1.3;
}
.nexus-td-owner-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: #e8eef6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nexus-td-owner-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.nexus-td-owner-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #3179ff;
  background: #e8eef6;
  letter-spacing: 0.02em;
}
.nexus-td-owner-fallback[hidden] {
  display: none !important;
}
.nexus-td-progress {
  width: 100%;
  max-width: 300px;
  justify-self: center;
  margin: 0 auto;
}
.nexus-td-progress-indicator {
  position: relative;
  box-sizing: border-box;
  height: 14px;
  padding: 5px 0;
  width: 100%;
  border-radius: 6px;
}
.nexus-td-progress-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: #e4e9ef;
  border-radius: 6px;
}
.nexus-td-progress-track {
  position: absolute;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  border-radius: 6px;
  background: #c4cad3;
}
.nexus-td-progress-indicator--neg .nexus-td-progress-track { background: #ee3142; }
.nexus-td-progress-indicator--pos .nexus-td-progress-track { background: #3dc752; }
.nexus-td-progress-mark {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e4e9ef;
  border: 3px solid #e4e9ef;
  box-sizing: border-box;
  margin-left: -4px;
  margin-top: -4px;
  z-index: 1;
}
.nexus-td-progress-mark.start { left: 0; }
.nexus-td-progress-mark.end { left: 100%; }
.nexus-td-progress-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 14px;
  margin-left: -1px;
  margin-top: -7px;
  background: #e4e9ef;
  z-index: 1;
}
.nexus-td-progress-handle {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  margin-top: -3px;
  border-radius: 50%;
  background: #c4cad3;
  border: 2px solid #c4cad3;
  box-shadow: 0 0 0 4px #e1ebf3;
  box-sizing: border-box;
  z-index: 3;
}
.nexus-td-progress-indicator--neg .nexus-td-progress-handle {
  background: #ee3142;
  border-color: #ee3142;
  box-shadow: 0 0 0 4px #f9bbc2;
}
.nexus-td-progress-indicator--pos .nexus-td-progress-handle {
  background: #3dc752;
  border-color: #3dc752;
  box-shadow: 0 0 0 4px #c3e6cd;
}
.nexus-td-progress-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  white-space: nowrap;
  background: #c4cad3;
  color: #fff;
  border-radius: 3px;
  padding: 4px 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  min-width: 68px;
  text-align: center;
  z-index: 10;
}
.nexus-td-progress-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: #c4cad3;
}
.nexus-td-progress-indicator--neg .nexus-td-progress-bubble {
  background: #ee3142;
}
.nexus-td-progress-indicator--neg .nexus-td-progress-bubble::after {
  border-top-color: #ee3142;
}
.nexus-td-progress-indicator--pos .nexus-td-progress-bubble {
  background: #3dc752;
}
.nexus-td-progress-indicator--pos .nexus-td-progress-bubble::after {
  border-top-color: #3dc752;
}
.nexus-td-progress-labels {
  display: flex;
  justify-content: space-between;
  margin: 6px -5px 0;
}
.nexus-td-progress-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.nexus-td-progress-col--sl { align-items: flex-start; }
.nexus-td-progress-col--tp { align-items: flex-end; }
.nexus-td-progress-amount {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: rgb(29, 30, 55);
  font-variant-numeric: tabular-nums;
}
.nexus-td-progress-amount.is-neg { color: #ee3142; }
.nexus-td-progress-amount.is-pos { color: #21ad36; }
.nexus-td-progress-amount.is-not-set {
  margin-top: 2px;
}
.nexus-td-progress-caption {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  color: rgb(29, 30, 55);
}
.nexus-td-progress-caption.is-neg { color: #ee3142; }
.nexus-td-progress-caption.is-pos { color: #21ad36; }
.nexus-td-ext {
  font-size: 11px;
  margin-left: 4px;
  color: #3179ff;
}

.nexus-btn-primary,
.nexus-btn-secondary,
.nexus-btn-danger {
  border-radius: 9px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  font-size: 13px;
}
.nexus-btn-primary {
  background: var(--primary-blue, #3b82f6);
  color: #fff;
}
.nexus-btn-primary.block { width: 100%; }
.nexus-btn-secondary {
  background: transparent;
  border-color: var(--nexus-line);
  color: var(--nexus-text);
}
.nexus-btn-danger {
  background: var(--nexus-sell);
  color: #fff;
}

/* Modals */
.nexus-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 16px;
}
.nexus-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
}
.nexus-modal-card {
  position: relative;
  width: min(440px, 100%);
  background: var(--nexus-surface);
  border: 1px solid var(--nexus-line);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.nexus-modal-card.nexus-alert-modal {
  width: min(536px, calc(100vw - 32px));
}
.nexus-modal-card.nexus-watchlist-modal {
  width: min(420px, calc(100vw - 32px));
}
.nexus-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--nexus-line);
}
.nexus-modal-head h3 {
  margin: 0;
  font-size: 16px;
  color: var(--nexus-text);
}
.nexus-x {
  border: 0;
  background: transparent;
  color: var(--nexus-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.nexus-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--nexus-text);
}
.nexus-modal-sym {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.nexus-modal-price {
  margin-left: auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.nexus-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 16px 16px;
}
.nexus-confirm-rows {
  display: grid;
  gap: 8px;
  font-size: 13px;
}
.nexus-confirm-rows div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.nexus-confirm-rows span { color: var(--nexus-muted); }

.nexus-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.nexus-pill.is-pos {
  background: rgba(33, 173, 54, 0.1);
  color: #21ad36;
}
.nexus-pill.is-neg {
  background: rgba(238, 49, 66, 0.1);
  color: #ee3142;
}
.nexus-dot { opacity: 0.45; margin: 0 2px; }
.nexus-pipe { opacity: 0.45; margin: 0 4px; }
.nexus-dont-show {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 8px;
  font-size: 13px;
  color: var(--nexus-muted);
  cursor: pointer;
}
.nexus-btn-outline {
  border-radius: 9px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--nexus-blue);
  background: #fff;
  color: var(--nexus-blue);
  font-size: 13px;
}
.nexus-confirm-rows div {
  padding: 8px 0;
  border-bottom: 1px solid var(--nexus-line);
}
.nexus-confirm-rows div:last-child { border-bottom: 0; }
.nexus-markets-tab.is-active,
.nexus-ot-tab.is-active {
  border-bottom-color: var(--nexus-blue);
  color: var(--nexus-blue);
}
.nexus-pos-tab.is-active {
  border-bottom-color: #3179ff;
  color: #3179ff;
}
.nexus-side-btn.sell.is-active {
  background: #ee3142;
  color: #fff;
}
.nexus-side-btn.buy.is-active {
  background: #02b526;
  color: #fff;
}
.nexus-mkt-table thead th {
  background: #e0e4e9;
  color: var(--nexus-text);
  font-size: 12px;
  font-weight: 400;
  padding: 16px;
}
.nexus-pos-table thead th {
  background: #e0e4e9;
  color: rgba(7, 15, 27, 0.7);
}
.nexus-pos-table thead th:first-child {
  border-radius: 10px 0 0 0;
}
.nexus-pos-table thead th:last-child {
  border-radius: 0 10px 0 0;
}
.nexus-pos-table tbody tr {
  background: #fff;
}
.nexus-pos-table tbody td {
  border-bottom: 1px solid #e0e4e9;
}
body.dark-mode .nexus-mkt-table thead th,
body.dark-mode .nexus-pos-table thead th {
  background: #000000;
  color: var(--nexus-muted);
  border-bottom-color: var(--nexus-line);
}
.nexus-ot-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
}
.nexus-pos-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.nexus-view-toggle {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}
.nexus-view-btn {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: rgba(7, 15, 27, 0.45);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.nexus-view-btn.is-active {
  border-color: transparent;
  color: #3179ff;
  background: transparent;
}
.nexus-view-btn svg {
  display: block;
}
.nexus-source {
  color: rgb(7, 15, 27);
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
}
.nexus-price-chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 200, 83, 0.1);
  color: var(--nexus-text);
  font-variant-numeric: tabular-nums;
}
.nexus-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.nexus-pill.is-pos {
  background: rgba(33, 173, 54, 0.1);
  color: #21ad36;
}
.nexus-pill.is-neg {
  background: rgba(238, 49, 66, 0.1);
  color: #ee3142;
}
#nexusPosList.is-grid-view .nexus-pos-table thead {
  display: none;
}
#nexusPosList.is-grid-view .nexus-pos-table,
#nexusPosList.is-grid-view .nexus-pos-table tbody,
#nexusPosList.is-grid-view .nexus-pos-table tr,
#nexusPosList.is-grid-view .nexus-pos-table td {
  display: block;
  width: 100%;
}
#nexusPosList.is-grid-view .nexus-pos-table tbody {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
#nexusPosList.is-grid-view .nexus-pos-table tr {
  background: #fff;
  border: 1px solid var(--nexus-line);
  border-radius: 12px;
  padding: 12px 14px;
}
#nexusPosList.is-grid-view .nexus-pos-table td {
  border: 0;
  padding: 4px 0;
}

/* ===== Nexus parity pass (open-trade + positions + protector) ===== */
.nexus-pos-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  margin: 0;
  padding: 0;
  background: transparent;
  border-bottom: 0;
  box-sizing: border-box;
}
#nexusPosList {
  padding-right: 0;
  box-sizing: border-box;
  min-width: 0;
}
.nexus-pos-tabs-row .nexus-pos-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 50px;
  border-bottom: 1px solid #e0e4e9;
  margin: 0;
  padding-left: 0;
  flex: 1 1 auto;
}
.nexus-pos-tabs-row .nexus-pos-tab {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: rgba(7, 15, 27, 0.5);
  border-bottom: 2px solid transparent;
  background: transparent;
}
.nexus-pos-tabs-row .nexus-pos-tab.is-active {
  color: #3179ff;
  border-bottom-color: #3179ff;
  font-weight: 400;
}
.nexus-pos-tabs-row .nexus-view-toggle {
  margin-left: auto;
  margin-right: 12px;
}
.nexus-pos-panel .nexus-table-scroll {
  background: transparent;
}
.nexus-pos-panel .nexus-pos-table {
  background: transparent;
}
.nexus-pos-panel .nexus-pos-table thead th {
  padding: 16px 12px;
  font-size: 12px;
  font-weight: 400;
  color: rgba(7, 15, 27, 0.7);
  background: #e0e4e9;
  border-bottom: 0;
}
.nexus-pos-panel .nexus-pos-table thead th:first-child {
  border-top-left-radius: 10px;
}
.nexus-pos-panel .nexus-pos-table thead th:last-child {
  border-top-right-radius: 10px;
}
.nexus-pos-panel .nexus-pos-table tbody tr {
  background: #fff;
}
.nexus-pos-panel .nexus-pos-table td {
  padding: 16px 12px;
  border-bottom: 1px solid #e0e4e9;
}
.nexus-pos-panel .nexus-pos-table tbody tr:hover {
  background: #f3f5f6;
}
.nexus-ot-title {
  /* title styles defined with open-trade header */
}
.nexus-ot-title-row {
  display: flex;
  align-items: center;
  gap: 0;
}
.nexus-ot-title-row h2,
.nexus-ot-title-row strong {
  margin: 0 10px 0 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--nexus-text);
}
.nexus-ot-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.nexus-ot-quotes {
  /* open-trade header quotes */
}
.nexus-ot-quote {
  /* open-trade header quote buttons */
}
.nexus-ot-quote.bid,
.nexus-ot-quote.ask {
  /* tick color via .is-up / .is-down */
}
.nexus-tri { display: none; }
.nexus-back {
  /* open-trade back control */
}
.nexus-back:hover { color: #3179ff; background: transparent; }
/* Legacy type/seg styles kept for limits modal / other surfaces */
.nexus-seg--fill {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: #eef2f6;
  border-radius: 8px;
  padding: 3px;
  flex: 1;
}
.nexus-seg--fill button {
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 650;
  font-size: 13px;
  cursor: pointer;
  color: var(--nexus-text);
}
.nexus-seg--fill button.is-active {
  background: var(--nexus-blue);
  color: #fff;
  border-color: var(--nexus-blue);
}
.nexus-tv-wrap {
  height: 560px;
  min-height: 560px;
  display: flex;
  flex-direction: column;
}
.nexus-tv {
  flex: 1 1 auto;
  height: 100%;
  min-height: 100%;
  border-radius: 0;
  border: 1px solid var(--nexus-line);
  background: #fff;
  display: flex;
  flex-direction: column;
}
.nexus-about {
  margin-bottom: 22px;
}
.nexus-about h3,
.nexus-ot-panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--nexus-text);
}
.nexus-about p,
.nexus-community-empty p {
  margin: 0;
  color: var(--nexus-muted);
  line-height: 1.55;
  font-size: 14px;
}
.nexus-lim-asset {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.nexus-lim-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nexus-lim-price-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}
.nexus-lim-price-box span {
  font-size: 12px;
  line-height: 15px;
  padding: 2px 4px;
  color: #7f95b8;
}
.nexus-lim-price-box strong {
  font-size: 16px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  padding: 2px 4px;
  border-radius: 5px;
  background: rgba(238, 49, 66, 0.12);
  color: rgb(29, 30, 55);
  line-height: 1.3;
}
.nexus-lim-price-box strong.is-pos {
  background: rgba(61, 199, 82, 0.12);
}
.nexus-modal-card--limits {
  width: min(500px, 94vw);
  min-width: min(500px, 94vw);
  max-width: 500px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.2);
}
.nexus-modal-card--limits .nexus-modal-head {
  padding: 20px 26px;
  border-bottom: 0;
}
.nexus-modal-card--limits .nexus-modal-head h3 {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: rgb(29, 30, 55);
}
.nexus-modal-card--limits .nexus-x {
  font-size: 24px;
  font-weight: 300;
  line-height: 24px;
  color: rgb(29, 30, 55);
  opacity: 1;
}
.nexus-modal-card--limits .nexus-modal-body {
  padding: 26px;
  gap: 0;
}
.nexus-protector--limits {
  margin: 26px 0;
  padding-top: 0;
  border-top: 0;
}
.nexus-protector--limits .nexus-protector-panel {
  border-radius: 10px;
  overflow: hidden;
}
/* Nexus `.change-trade-limits__actions .limits-update` */
.nexus-lim-actions {
  display: flex;
  justify-content: center;
  width: 100%;
}
.nexus-lim-update,
.nexus-modal-card--limits .nexus-lim-update {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 5px 15px;
  border: 1px solid #3179ff;
  border-radius: 10px;
  background: #3179ff;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 24px;
  cursor: pointer;
  box-sizing: border-box;
}
.nexus-lim-update:hover,
.nexus-modal-card--limits .nexus-lim-update:hover {
  background: #4a8aff;
  border-color: #4a8aff;
}
.nexus-lim-update:active,
.nexus-modal-card--limits .nexus-lim-update:active {
  background: #2c6ce5;
  border-color: #2c6ce5;
}
.nexus-lim-asset .nexus-ot-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}
.nexus-lim-asset .nexus-td-dot {
  margin: 0 4px;
  opacity: 0.45;
}
.nexus-side-badge.buy {
  background: rgba(61, 199, 82, 0.1);
  color: #21ad36;
  border: 0;
  border-radius: 8px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
}
.nexus-side-badge.sell {
  background: rgba(239, 83, 80, 0.12);
  color: #e53935;
  border: 0;
  border-radius: 8px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
}
.nexus-pos-table td.is-pos,
.nexus-pos-table td.is-neg {
  font-weight: 650;
}
.nexus-pos-table td.is-pos { color: var(--nexus-good); }
.nexus-pos-table td.is-neg { color: var(--nexus-bad); }
/* Current price: Nexus keeps this neutral; tick direction flashes briefly. */
.nexus-pos-table td[data-live="current"] {
  color: rgb(7, 15, 27);
  font-weight: 400;
}
.nexus-pos-table td[data-live="current"].nexus-px-up-1 {
  animation: nexusPxUpFlash 0.5s ease;
}
.nexus-pos-table td[data-live="current"].nexus-px-up-2 {
  animation: nexusPxUpFlash 0.5s ease;
}
.nexus-pos-table td[data-live="current"].nexus-px-down-1 {
  animation: nexusPxDownFlash 0.5s ease;
}
.nexus-pos-table td[data-live="current"].nexus-px-down-2 {
  animation: nexusPxDownFlash 0.5s ease;
}
@keyframes nexusPxUpFlash {
  0% { color: #3dc752; }
  25% { color: #3dc752; }
  100% { color: rgb(7, 15, 27); }
}
@keyframes nexusPxDownFlash {
  0% { color: #ee3142; }
  25% { color: #ee3142; }
  100% { color: rgb(7, 15, 27); }
}
body.dark-mode .nexus-pos-table td[data-live="current"] {
  color: var(--nexus-text);
}
body.dark-mode .nexus-pos-table td[data-live="current"].nexus-px-up-1,
body.dark-mode .nexus-pos-table td[data-live="current"].nexus-px-up-2 {
  animation-name: nexusPxUpFlashDark;
}
body.dark-mode .nexus-pos-table td[data-live="current"].nexus-px-down-1,
body.dark-mode .nexus-pos-table td[data-live="current"].nexus-px-down-2 {
  animation-name: nexusPxDownFlashDark;
}
@keyframes nexusPxUpFlashDark {
  0% { color: #3dc752; }
  25% { color: #3dc752; }
  100% { color: var(--nexus-text); }
}
@keyframes nexusPxDownFlashDark {
  0% { color: #ee3142; }
  25% { color: #ee3142; }
  100% { color: var(--nexus-text); }
}
.nexus-pill.is-neg {
  background: rgba(238, 49, 66, 0.1);
  color: #ee3142;
}
.nexus-pill.is-pos {
  background: rgba(61, 199, 82, 0.1);
  color: #21ad36;
}
.nexus-px-pill.sell,
.nexus-px-pill.buy {
  background: transparent;
  border-color: var(--nexus-line);
  color: var(--nexus-text);
}
.nexus-ot-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
}
.nexus-watch-toggle.is-on .nexus-tab-star,
.nexus-watch-toggle.is-on {
  color: #f5a623;
}
.nexus-btn-primary.block {
  width: 100%;
  margin-top: 16px;
  background: var(--nexus-blue);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}

/* ========== Markets / Positions dark mode surfaces ========== */
body.dark-mode .nexus-ticket,
body.dark-mode .nexus-watch-menu,
body.dark-mode .nexus-modal-card,
body.dark-mode .nexus-watchlist-modal,
body.dark-mode .nexus-alert-modal,
body.dark-mode .nexus-tv,
body.dark-mode #nexusPosList.is-grid-view .nexus-pos-table tr,
body.dark-mode .nexus-seg--fill {
  background: var(--nexus-surface);
  border-color: var(--nexus-line);
  color: var(--nexus-text);
}
body.dark-mode .nexus-pos-tabs-row {
  background: var(--nexus-surface);
  border-bottom-color: var(--nexus-line);
}
body.dark-mode .nexus-pos-tabs-row .nexus-pos-tab {
  color: var(--nexus-muted);
}
body.dark-mode .nexus-pos-tabs-row .nexus-pos-tab.is-active {
  color: #3179ff;
  border-bottom-color: #3179ff;
}
body.dark-mode .nexus-pos-toolbar {
  background: var(--nexus-page);
  color: var(--nexus-text);
}
body.dark-mode .nexus-pill-label {
  color: var(--nexus-muted);
}
body.dark-mode .nexus-pos-filters .nexus-seg {
  background: var(--nexus-control);
}
body.dark-mode .nexus-pos-filters .nexus-seg-btn {
  color: var(--nexus-muted);
}
body.dark-mode .nexus-pos-filters .nexus-seg-btn:hover {
  color: var(--nexus-text);
}
body.dark-mode .nexus-pos-filters .nexus-seg-btn.is-active {
  background: #3179ff;
  color: #fff;
}
body.dark-mode .nexus-pos-panel .nexus-pos-table tbody tr {
  background: var(--nexus-surface);
}
body.dark-mode .nexus-pos-panel .nexus-pos-table td {
  border-bottom-color: var(--nexus-line);
}
body.dark-mode .nexus-pos-panel .nexus-pos-table thead th {
  background: #111;
  color: var(--nexus-muted);
}
body.dark-mode .nexus-side-group {
  background: var(--nexus-control);
  border-color: var(--nexus-line);
}
body.dark-mode .nexus-side-btn {
  color: var(--nexus-text);
}
body.dark-mode .nexus-spread-pill {
  background: var(--nexus-surface-2);
  color: var(--nexus-text);
  box-shadow: 0 0 0 1px var(--nexus-line);
}
body.dark-mode .nexus-blue-toggle {
  background: var(--nexus-surface);
  border-color: var(--nexus-line);
}
body.dark-mode .nexus-blue-toggle button {
  background: var(--nexus-control);
  color: var(--nexus-text);
}
body.dark-mode .nexus-blue-toggle button.is-active {
  background: #3179ff;
  color: #fff;
}
body.dark-mode .nexus-switch span {
  background: var(--nexus-control);
}
body.dark-mode .nexus-switch span::after {
  background: #3179ff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
body.dark-mode .nexus-switch input:checked + span {
  background: #3179ff;
}
body.dark-mode .nexus-switch input:checked + span::after {
  background: #f5f5f5;
}
body.dark-mode .nexus-ticket-panel,
body.dark-mode .nexus-protector-panel {
  border-color: var(--nexus-line);
}
body.dark-mode .nexus-protector {
  border-top-color: var(--nexus-line);
}
body.dark-mode .nexus-protector-title {
  color: var(--nexus-text);
}
body.dark-mode .nexus-limit-title,
body.dark-mode .nexus-limit-input {
  border-color: var(--nexus-line);
  color: var(--nexus-text);
}
body.dark-mode .nexus-limit-title::after {
  background: var(--nexus-line);
}
body.dark-mode .nexus-limit-input input {
  color: var(--nexus-text);
}
body.dark-mode .nexus-limit-notset,
body.dark-mode .nexus-limit-prefix {
  color: var(--nexus-muted);
}
body.dark-mode .nexus-limit-row.is-off .nexus-limit-title,
body.dark-mode .nexus-limit-row.is-off .nexus-limit-input {
  background: var(--nexus-control);
  border-color: var(--nexus-control);
  color: var(--nexus-muted);
}
body.dark-mode .nexus-enter-value {
  border-color: var(--nexus-line);
}
body.dark-mode .nexus-enter-value label {
  color: var(--nexus-muted);
  background: var(--nexus-surface);
}
body.dark-mode .nexus-enter-value input {
  color: var(--nexus-text);
  background: transparent;
}
body.dark-mode .nexus-round-btn {
  background: var(--nexus-control);
  color: var(--nexus-text);
}
body.dark-mode .nexus-round-btn:hover {
  color: var(--nexus-blue);
}
body.dark-mode .nexus-pct-labels,
body.dark-mode .nexus-pct-labels button {
  color: var(--nexus-muted);
}
body.dark-mode .nexus-pct-labels button.is-active {
  color: var(--nexus-blue);
}
body.dark-mode .nexus-pct-track {
  border-color: var(--nexus-line);
}
body.dark-mode .nexus-pct-dots {
  color: rgba(255, 255, 255, 0.28);
}
body.dark-mode .nexus-pct input[type="range"] {
  background: var(--nexus-control);
}
body.dark-mode .nexus-pos-table thead th,
body.dark-mode .nexus-mkt-table thead th {
  color: var(--nexus-muted);
  border-bottom-color: var(--nexus-line);
}
body.dark-mode .nexus-pos-table td,
body.dark-mode .nexus-mkt-table td {
  border-bottom-color: var(--nexus-line);
  color: var(--nexus-text);
}
body.dark-mode .nexus-pos-table tbody tr:hover,
body.dark-mode .nexus-mkt-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}
body.dark-mode .nexus-inst-card {
  background: var(--nexus-surface);
  border-color: var(--nexus-line);
}
body.dark-mode .nexus-inst-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}
body.dark-mode .nexus-cat-item.is-active {
  background: var(--nexus-surface-2);
  color: #3179ff;
}
body.dark-mode .nexus-mkt-table {
  background: transparent;
}
body.dark-mode .nexus-search,
body.dark-mode .nexus-select,
body.dark-mode .nexus-watchlist-modal__body input {
  background: var(--nexus-surface-2);
  border-color: var(--nexus-line);
  color: var(--nexus-text);
}
body.dark-mode .nexus-pos-tabs,
body.dark-mode .nexus-markets-tabs {
  border-bottom-color: var(--nexus-line);
}
body.dark-mode .nexus-see-all {
  color: #1585d8;
}
body.dark-mode .nexus-section-title,
body.dark-mode .nexus-about h3,
body.dark-mode .nexus-ot-panel h3 {
  color: var(--nexus-text);
}
body.dark-mode .nexus-empty,
body.dark-mode .nexus-community-empty,
body.dark-mode .nexus-about p {
  color: var(--nexus-muted);
}
body.dark-mode .nexus-fx-flag {
  border-color: #0c0c0c;
}


/* ========== Responsive — Nexus breakpoints (after base rules so MQ wins) ========== */

/* Tablet — Nexus ≤1024 (769–1024): sidebar off; keep desktop-like Markets/Positions chrome */
@media (max-width: 1024px) {
  #section-market.active,
  #section-positions.active {
    /* Do NOT set overflow-x:hidden here — it breaks position:sticky on
       .nexus-acct-shell and turns sticky `top` into a relative offset (huge gap). */
    max-width: 100%;
  }

  .content-wrapper:has(#section-market.active),
  .content-wrapper:has(#section-positions.active) {
    --nexus-sticky-top-gap: 0px;
    --nexus-sticky-stack-gap: 16px;
    padding-top: 0;
    padding-left: 16px;
    padding-right: 16px;
  }

  /*
   * Tablet account strip — match Nexus .header-tablet__bottom-nav /
   * .account-data-bar: full-bleed, ~35px, label+value inline.
   * 16px stack gap under the strip (Nexus markets tabs sit ~16px below).
   */
  .nexus-acct-shell {
    top: var(--nexus-acct-sticky-top, 60px);
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
    max-width: none;
    padding-bottom: var(--nexus-sticky-stack-gap, 16px);
    background: var(--nexus-sticky-chrome-bg, #f8f9fa);
    border-bottom: 0;
  }

  body.dark-mode .nexus-acct-shell {
    background: var(--nexus-sticky-chrome-bg, #0c0c0c);
    border-bottom-color: transparent;
  }

  .nexus-acct-shell::before,
  .nexus-acct-shell::after {
    display: none;
  }

  .nexus-acct-bar:not(.is-expanded) {
    min-height: 35px;
    height: 35px;
    padding: 0;
    margin: 0;
    gap: 0;
    border: 0;
    border-bottom: 1px solid rgba(7, 15, 27, 0.1);
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    overflow: hidden;
    justify-content: flex-start;
    align-items: center;
  }

  body.dark-mode .nexus-acct-bar:not(.is-expanded) {
    background: var(--nexus-surface, #0c0c0c);
    border-bottom-color: rgba(255, 255, 255, 0.12);
  }

  .nexus-acct-bar:not(.is-expanded) .nexus-acct-metrics {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    width: auto;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    padding: 0 33px 0 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .nexus-acct-bar:not(.is-expanded) .nexus-acct-metrics::-webkit-scrollbar {
    display: none;
  }

  .nexus-acct-bar:not(.is-expanded) .nexus-acct-item {
    flex: 1 1 auto;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-width: max-content;
    max-width: none;
    height: 17px;
    padding: 0 15px;
    border-left: 0 !important;
  }

  .nexus-acct-bar:not(.is-expanded) .nexus-acct-item span {
    display: inline;
    font-size: 12px;
    font-weight: 400;
    line-height: 17px;
    color: rgba(7, 15, 27, 0.7);
    max-width: none;
    overflow: visible;
    text-overflow: clip;
  }

  body.dark-mode .nexus-acct-bar:not(.is-expanded) .nexus-acct-item span {
    color: rgba(255, 255, 255, 0.65);
  }

  .nexus-acct-bar:not(.is-expanded) .nexus-acct-item strong {
    display: inline;
    font-size: 14px;
    font-weight: 400;
    line-height: 17px;
    margin-left: 5px;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
  }

  /* Expand chevron — Nexus absolute right-edge toggle */
  .nexus-acct-bar:not(.is-expanded) .nexus-acct-expand {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 33px;
    height: 100%;
    margin: 0;
    border-radius: 0;
    background: #fff;
    color: #3179ff;
    z-index: 3;
    box-shadow: -12px 0 10px -4px #fff;
  }

  body.dark-mode .nexus-acct-bar:not(.is-expanded) .nexus-acct-expand {
    background: var(--nexus-surface, #0c0c0c);
    box-shadow: -12px 0 10px -4px var(--nexus-surface, #0c0c0c);
  }

  .nexus-acct-bar:not(.is-expanded) .nexus-acct-expand svg {
    width: 16px;
    height: 16px;
  }

  .nexus-acct-bar.is-expanded {
    left: 16px;
    right: 16px;
    width: auto;
  }

  /* All Markets: keep category rail + main (Nexus tablet), not a collapsed strip */
  .nexus-all-layout {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 15px;
  }
  .nexus-all-main {
    padding-right: 0;
    min-width: 0;
  }
  .nexus-cat-rail {
    /* retain vertical sticky rail; slightly tighter */
    padding: 12px;
  }
  .nexus-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  /* Popular: ~3–3.5 cards visible like Nexus */
  .nexus-carousel {
    margin: 0;
    padding: 0 2px 6px;
  }
  .nexus-inst-card {
    flex: 0 0 240px;
  }

  /* Open trade: keep chart | ticket side-by-side (Nexus tablet) */
  .nexus-ot-grid {
    flex-direction: row;
    align-items: stretch;
    gap: 14px;
  }
  .nexus-ticket {
    flex: 0 0 auto;
    width: min(340px, 36vw);
    max-width: 360px;
    align-self: stretch;
    min-height: 0;
  }
  .nexus-tv-wrap {
    height: min(400px, 52vh);
    min-height: 260px;
  }
  /* Open-trade chart panel: fill ticket height; ignore vh cap above */
  .nexus-ot-panel[data-nexus-opanel="chart"] .nexus-tv-wrap {
    height: 100%;
    min-height: 360px;
  }
  .nexus-ot-trailing {
    flex-wrap: wrap;
    gap: 8px;
  }

  .nexus-markets-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nexus-markets-tabs::-webkit-scrollbar {
    display: none;
  }
  .nexus-markets-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Positions: keep toolbar on one row when possible (Nexus tablet) */
  .nexus-pos-tabs-row {
    flex-wrap: nowrap;
    min-height: 0;
    padding: 4px 0;
    gap: 8px;
    align-items: center;
  }
  .nexus-pos-tabs-row .nexus-pos-tabs {
    height: auto;
    min-height: 44px;
    padding-left: 4px;
    overflow-x: auto;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
  }
  .nexus-pos-tabs-row .nexus-view-toggle {
    margin-right: 4px;
    flex: 0 0 auto;
  }
  .nexus-pos-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 12px 4px;
  }
  .nexus-pos-filters {
    flex: 1 1 auto;
    min-width: 0;
  }
  .nexus-pill-group {
    margin-right: 16px;
    margin-bottom: 0;
  }
  .nexus-pos-summary {
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
  }

  #nexusPosList {
    padding-right: 0;
  }
  .nexus-table-scroll {
    margin: 0;
  }
}

/* Phone — Nexus ≤768: bottom-nav chrome + list markets (not shrunk desktop) */
@media (max-width: 768px) {
  /* Phone-only: collapse layouts that tablet keeps side-by-side */
  .nexus-all-layout {
    grid-template-columns: 1fr;
  }
  .nexus-all-main {
    padding-right: 0;
    min-width: 0;
  }

  /* Default phone strip (before JS phase) — horizontal cats */
  .nexus-cat-rail {
    position: relative;
    top: auto;
    max-height: none;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--nexus-line);
    padding-right: 0;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
  }
  .nexus-cat-rail .nexus-search {
    width: auto;
    min-width: 140px;
    margin-bottom: 0;
    flex: 0 0 auto;
  }
  .nexus-cat-item {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Mobile All Markets — category picker (Nexus market-all-sidebar) */
  .nexus-all-mobile-back {
    display: none;
    padding: 0 0 10px;
  }
  .nexus-all-mobile-back:not([hidden]) {
    display: block;
  }
  .nexus-all-mobile-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: var(--nexus-muted);
    font-size: 14px;
    font-weight: 400;
    padding: 0;
    cursor: pointer;
  }
  .nexus-all-mobile-back-btn svg {
    width: 16px;
    height: 16px;
    opacity: 0.5;
  }
  .nexus-markets-tabs.is-all-mobile-hidden {
    display: none !important;
  }

  .nexus-all-layout.is-mobile-picker .nexus-all-main {
    display: none !important;
  }
  .nexus-all-layout.is-mobile-picker .nexus-cat-rail {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow: visible;
    border: 0;
    padding: 0;
    gap: 0;
    background: transparent;
    max-height: none;
  }
  .nexus-all-layout.is-mobile-picker .nexus-cat-rail .nexus-search {
    width: 100%;
    min-width: 0;
    margin: 0 0 12px;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    background: var(--nexus-surface, #fff);
    border: 1px solid var(--nexus-line);
    box-sizing: border-box;
  }
  .nexus-all-layout.is-mobile-picker .nexus-cat-item {
    width: 100%;
    flex: none;
    border-radius: 0;
    border-bottom: 1px solid var(--nexus-line);
    background: transparent;
    color: var(--nexus-text);
    font-size: 14px;
    font-weight: 400;
    padding: 12px 4px;
    gap: 12px;
  }
  .nexus-all-layout.is-mobile-picker .nexus-cat-item:first-of-type {
    margin-top: 5px;
  }
  .nexus-all-layout.is-mobile-picker .nexus-cat-item:last-child {
    border-bottom: 0;
  }
  .nexus-all-layout.is-mobile-picker .nexus-cat-item.is-active,
  .nexus-all-layout.is-mobile-picker .nexus-cat-item:hover {
    background: transparent;
    color: var(--nexus-text);
  }
  .nexus-all-layout.is-mobile-picker .nexus-cat-icon {
    width: 24px;
    height: 24px;
  }

  /* Mobile All Markets — drilled category list */
  .nexus-all-layout.is-mobile-list .nexus-cat-rail {
    display: none !important;
  }
  .nexus-all-layout.is-mobile-list .nexus-table-scroll {
    display: none !important;
  }
  .nexus-all-layout.is-mobile-list .nexus-all-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0 -12px;
    width: calc(100% + 24px);
    padding: 15px;
    background: var(--nexus-surface, #fff);
    box-sizing: border-box;
  }
  .nexus-all-layout.is-mobile-list .nexus-card-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0 -12px 26px;
    width: calc(100% + 24px);
    padding: 15px;
    background: var(--nexus-surface, #fff);
    box-sizing: border-box;
  }
  .nexus-all-layout.is-mobile-list .nexus-section-head {
    margin-bottom: 0;
    background: var(--nexus-page, #f3f5f6);
  }
  .nexus-all-layout.is-mobile-list .nexus-section-head h3 {
    margin: 0 0 18px;
    padding-left: 15px;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    color: var(--nexus-text);
  }
  .nexus-all-layout.is-mobile-list .nexus-card-grid .nexus-inst-card,
  .nexus-all-layout.is-mobile-list .nexus-all-mobile-list .nexus-inst-card {
    flex: none;
    width: 100%;
    max-width: none;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 0 15px;
    margin: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border-bottom: 1px solid var(--nexus-line);
  }
  .nexus-all-layout.is-mobile-list .nexus-card-grid .nexus-inst-card:last-child,
  .nexus-all-layout.is-mobile-list .nexus-all-mobile-list .nexus-inst-card:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }
  .nexus-all-layout.is-mobile-list .nexus-inst-card-top {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    margin-bottom: 0;
  }
  .nexus-all-layout.is-mobile-list .nexus-inst-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 5px 0 0;
    width: auto;
  }
  .nexus-all-layout.is-mobile-list .nexus-inst-card .nexus-chg {
    flex-direction: row;
    align-items: center;
    gap: 4px;
    width: fit-content;
    font-size: 14px;
    font-weight: 400;
  }
  .nexus-all-layout.is-mobile-list .nexus-card-actions {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 118px;
    max-width: 118px;
  }
  .nexus-all-layout.is-mobile-list .nexus-card-actions .nexus-px-pill {
    min-height: 34px;
    height: 34px;
    font-size: 14px;
    font-weight: 400;
  }

  .nexus-card-grid {
    grid-template-columns: 1fr;
  }
  .nexus-ot-grid {
    flex-direction: column;
    gap: 14px;
  }
  .nexus-ticket {
    flex: 1 1 auto;
    width: 100% !important;
    max-width: 100%;
    align-self: stretch;
    min-height: 0;
    max-height: none;
  }
  .nexus-side-group {
    max-width: 100%;
  }
  .nexus-pos-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .nexus-pos-summary {
    width: 100%;
    justify-content: space-between;
  }

  .content-wrapper:has(#section-market.active),
  .content-wrapper:has(#section-positions.active) {
    --nexus-sticky-chrome-bg: var(--nexus-page, #f3f5f6);
    padding-left: 12px;
    padding-right: 12px;
    background: var(--nexus-page, #f3f5f6);
  }

  body.dark-mode .content-wrapper:has(#section-market.active),
  body.dark-mode .content-wrapper:has(#section-positions.active) {
    background: var(--nexus-page, #0c0c0c);
  }

  /* Phone gutters are 12px — retune full-bleed shell from tablet's 16px */
  .nexus-acct-shell {
    margin-left: -12px;
    margin-right: -12px;
    width: calc(100% + 24px);
  }

  .nexus-acct-bar.is-expanded {
    left: 12px;
    right: 12px;
  }

  /* Unstick browse tabs — Nexus mobile scrolls them with content */
  .nexus-markets-tabs,
  .nexus-pos-tabs,
  .nexus-ot-chrome,
  .nexus-cat-rail {
    position: relative !important;
    top: auto !important;
  }

  /* Popular: Nexus market-grid-item-container / mobile-wrapper */
  .nexus-pop-row {
    margin: 40px -12px 0;
    width: calc(100% + 24px);
  }
  .nexus-pop-row:first-child {
    margin-top: 20px;
  }
  .nexus-section-head {
    margin-bottom: 0;
    padding: 0;
    background: var(--nexus-page, #f3f5f6);
  }
  .nexus-section-head-left {
    justify-content: flex-start;
  }
  .nexus-section-title {
    padding-left: 15px;
  }
  .nexus-see-all--inline,
  .nexus-section-head-right {
    display: none;
  }
  .nexus-see-all--footer {
    display: block;
    width: 100%;
    padding: 15px 0 0;
    text-align: center;
    color: #1585d8;
    font-size: 14px;
    font-weight: 400;
    background: var(--nexus-page, #f3f5f6);
    border: 0;
    cursor: pointer;
  }
  body.dark-mode .nexus-section-head,
  body.dark-mode .nexus-see-all--footer {
    background: var(--nexus-page, #0c0c0c);
  }
  .nexus-carousel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: hidden;
    scroll-snap-type: none;
    margin: 25px 0 0;
    padding: 15px;
    background: var(--nexus-surface, #fff);
    box-sizing: border-box;
  }
  .nexus-inst-card {
    flex: none;
    width: 100%;
    max-width: none;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 0 15px;
    margin: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border-bottom: 1px solid var(--nexus-line);
  }
  .nexus-inst-card:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }
  .nexus-inst-card-top {
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    margin-bottom: 0;
    gap: 0;
  }
  .nexus-inst-card-left {
    flex: 1 1 auto;
    max-width: 100%;
    gap: 10px;
    align-items: center;
  }
  .nexus-inst-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    width: auto;
    padding: 5px 0 0;
    overflow: hidden;
  }
  .nexus-inst-meta strong {
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    padding-bottom: 0;
  }
  .nexus-inst-sym {
    font-size: 12px;
    line-height: 1;
  }
  /* Nexus mobile: amount + (pct) inline under symbol */
  .nexus-inst-card .nexus-chg {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    width: fit-content;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
  }
  .nexus-card-actions {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 0 0 auto;
    width: 118px;
    max-width: 118px;
    margin-right: 0;
  }
  .nexus-card-actions .nexus-px-pill {
    min-height: 34px;
    height: 34px;
    width: 100%;
    max-width: 100%;
    padding: 3px;
    font-size: 14px;
    font-weight: 400;
    box-sizing: border-box;
  }
  .nexus-card-actions .nexus-px-val {
    font-size: 14px;
  }

  .nexus-ticket {
    max-width: 100%;
    border-radius: 14px;
  }
  /* Mobile open-trade: chart first; ticket hidden until SELL/BUY sheet */
  #nexusTicket[data-mobile-collapsed="1"] {
    display: none !important;
  }
  .nexus-ticket-mobile-head,
  .nexus-ticket-mobile-symbol {
    display: none;
  }
  .nexus-ot-mobile-footer {
    display: none;
  }

  /*
   * Nexus open-trade--chart (≤768):
   * - App brand header replaced by slim back + alert/star bar
   * - Symbol row + ask/bid
   * - Chart fills remaining viewport
   * - Fixed SELL/BUY footer
   */
  body.nexus-ot-mobile-active .top-header {
    display: none !important;
  }
  body.nexus-ot-mobile-active #section-market > .nexus-acct-shell {
    display: none !important;
  }
  body.nexus-ot-mobile-active .mobile-bottom-nav {
    display: none !important;
  }
  body.nexus-ot-mobile-active .main-content {
    padding-bottom: 0;
  }
  body.nexus-ot-mobile-active .content-wrapper {
    padding: 0 !important;
  }
  body.nexus-ot-mobile-active #section-market {
    margin: 0;
    padding: 0;
    min-height: 100dvh;
    background: var(--nexus-page, #f3f5f6);
  }
  body.nexus-ot-mobile-active .nexus-open-trade {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 0 0 calc(78px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    background: var(--nexus-page, #f3f5f6);
  }
  body.nexus-ot-mobile-active .nexus-ot-grid {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 0;
  }
  body.nexus-ot-mobile-active .nexus-ot-left {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    border: 0;
    background: transparent;
  }
  body.nexus-ot-mobile-active .nexus-ot-chrome {
    position: relative;
    top: auto;
    padding: 0;
    margin: 0;
    background: #fff;
  }
  body.dark-mode.nexus-ot-mobile-active .nexus-ot-chrome {
    background: #121417;
  }
  body.nexus-ot-mobile-active .nexus-ot-chrome::before {
    display: none;
  }

  /* Row 1 = Nexus header-mobile (back | alert+star). Row 2 = symbol + quotes. */
  body.nexus-ot-mobile-active .nexus-ot-top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "back spacer actions"
      "info info quotes";
    align-items: center;
    column-gap: 8px;
    row-gap: 0;
    min-height: 0;
    padding: 0;
    background: transparent;
    /* Paint Nexus header-mobile strip behind back + actions */
    background-image: linear-gradient(
      to bottom,
      var(--nexus-page, #f3f5f6) 0,
      var(--nexus-page, #f3f5f6) 56px,
      #fff 56px,
      #fff 100%
    );
  }
  body.dark-mode.nexus-ot-mobile-active .nexus-ot-top {
    background-image: linear-gradient(
      to bottom,
      #121417 0,
      #121417 56px,
      #1a1d21 56px,
      #1a1d21 100%
    );
  }
  body.nexus-ot-mobile-active .nexus-back {
    grid-area: back;
    width: 44px;
    height: 56px;
    margin: 0;
    color: var(--nexus-text, #1d1e37);
  }
  body.nexus-ot-mobile-active .nexus-ot-actions {
    grid-area: actions;
    margin: 0;
    padding-right: 8px;
    gap: 4px;
    height: 56px;
  }
  body.nexus-ot-mobile-active .nexus-ot-actions-sep {
    display: none;
  }
  body.nexus-ot-mobile-active .nexus-ot-action-btn {
    width: 44px;
    height: 44px;
    justify-content: center;
    gap: 0;
    padding: 0;
  }
  body.nexus-ot-mobile-active .nexus-ot-action-btn > span {
    display: none;
  }
  body.nexus-ot-mobile-active .nexus-ot-action-ico {
    width: 22px;
    height: 22px;
    color: #8b93a7;
  }
  body.nexus-ot-mobile-active .nexus-ot-info {
    grid-area: info;
    padding: 8px 16px 12px;
    align-self: start;
  }
  body.nexus-ot-mobile-active .nexus-tv-symbol-picker {
    left: 16px;
    top: calc(var(--nexus-ot-view-gap, 20px) + 112px);
    width: calc(100% - 32px);
  }
  body.nexus-ot-mobile-active .nexus-ot-trailing {
    display: contents;
  }
  body.nexus-ot-mobile-active .nexus-ot-quotes {
    grid-area: quotes;
    padding: 8px 16px 12px 0;
    align-self: start;
    justify-self: end;
  }
  body.nexus-ot-mobile-active .nexus-ot-icon-wrap .nexus-inst-icon {
    width: 40px;
    height: 40px;
  }
  body.nexus-ot-mobile-active .nexus-ot-title h2,
  body.nexus-ot-mobile-active .nexus-ot-title-row h2 {
    font-size: 16px;
    line-height: 18px;
  }
  body.nexus-ot-mobile-active .nexus-ot-tabs {
    margin: 0;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid var(--nexus-line, #e6eaee);
  }
  body.dark-mode.nexus-ot-mobile-active .nexus-ot-tabs {
    background: #121417;
    border-bottom-color: #2a2f36;
  }
  body.nexus-ot-mobile-active .nexus-ot-panel[data-nexus-opanel="chart"] {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #fff;
  }
  body.dark-mode.nexus-ot-mobile-active .nexus-ot-panel[data-nexus-opanel="chart"] {
    background: #0c0c0c;
  }
  body.nexus-ot-mobile-active .nexus-ot-panel[data-nexus-opanel="overview"],
  body.nexus-ot-mobile-active .nexus-ot-panel[data-nexus-opanel="community"] {
    padding: 16px;
    background: #fff;
  }
  /* Fill remaining viewport — iOS needs explicit px height (see resizeTvChart) */
  body.nexus-ot-mobile-active .nexus-tv-wrap {
    position: relative;
    display: block;
    flex: 1 1 auto;
    min-height: 220px;
    height: auto;
    border-radius: 0;
    overflow: hidden;
    /* Fallback until JS measures visualViewport */
    height: calc(100dvh - 220px - env(safe-area-inset-bottom, 0px));
    min-height: calc(100dvh - 280px);
  }
  body.nexus-ot-mobile-active .nexus-tv {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  body.nexus-ot-mobile-active .nexus-tv #tradingview_chart,
  body.nexus-ot-mobile-active #tradingview_chart {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border-radius: 0;
  }
  body.nexus-ot-mobile-active .nexus-tv #tradingview_chart > div,
  body.nexus-ot-mobile-active .nexus-tv #tradingview_chart iframe {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
  }
  body.nexus-ot-mobile-active .nexus-ot-mobile-footer:not([hidden]) {
    display: grid;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    background: var(--nexus-page, #f3f5f6);
    border-top: 1px solid var(--nexus-line, #e6eaee);
  }
  .nexus-ot-mobile-sell,
  .nexus-ot-mobile-buy {
    min-height: 50px;
    border: 0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    color: #fff;
  }
  .nexus-ot-mobile-sell {
    background: #ee3142;
  }
  .nexus-ot-mobile-buy {
    background: #40c757;
  }
  body.dark-mode .nexus-ot-mobile-footer:not([hidden]) {
    background: #121417;
    border-top-color: #2a2f36;
  }

  #nexusTicket.is-mobile-sheet {
    position: fixed !important;
    inset: 0;
    z-index: 70;
    width: 100% !important;
    max-width: none;
    margin: 0;
    border-radius: 14px 14px 0 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    color: #1d1e37;
    font-size: 14px;
    font-weight: 400;
    line-height: 22.4px;
    /* Space after CTA — padding (not margin) so it doesn’t collapse on scroll end */
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  }
  body.dark-mode #nexusTicket.is-mobile-sheet {
    background: #1a1d21;
    color: #e8eaed;
  }
  #nexusTicket.is-mobile-sheet .nexus-ticket-inner {
    display: block;
    padding: 0;
    margin: 0;
    height: auto;
  }

  /* Nexus .buy-sell-mobile-header — pad 20px 26px, 16/400, no sticky, no border */
  #nexusTicket.is-mobile-sheet .nexus-ticket-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: static;
    top: auto;
    z-index: auto;
    padding: 20px 26px;
    background: transparent;
    border-bottom: 0;
    color: #070f1b;
    box-sizing: border-box;
    min-height: 66px;
  }
  body.dark-mode #nexusTicket.is-mobile-sheet .nexus-ticket-mobile-head {
    color: #e8eaed;
    border-bottom: 0;
  }
  #nexusTicket.is-mobile-sheet .nexus-ticket-mobile-title {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: inherit;
  }
  #nexusTicket.is-mobile-sheet .nexus-ticket-mobile-close {
    width: auto;
    height: auto;
    min-width: 21px;
    min-height: 21px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #1d1e37;
    font-size: 21px;
    font-weight: 700;
    line-height: 21px;
    padding: 0;
    cursor: pointer;
  }
  body.dark-mode #nexusTicket.is-mobile-sheet .nexus-ticket-mobile-close {
    color: #e8eaed;
  }

  /* Nexus .buy-sell-toggle — pad 16px, margin 0 0 0 -5px */
  #nexusTicket.is-mobile-sheet .nexus-side-toggle {
    padding: 16px !important;
    margin: 0 0 0 -5px !important;
    box-sizing: border-box;
  }
  #nexusTicket.is-mobile-sheet .nexus-side-group {
    max-width: none;
    width: 100%;
    margin-left: 5px;
    height: 45px;
    border-radius: 10px;
    background: #f3f5f6;
    border: 1px solid rgba(7, 15, 27, 0.1);
  }
  body.dark-mode #nexusTicket.is-mobile-sheet .nexus-side-group {
    background: #2a2f36;
    border-color: rgba(255, 255, 255, 0.08);
  }

  /* Nexus .open-trade__right__symbol-header-container — pad 11px 16px 7px, icon 50 */
  #nexusTicket.is-mobile-sheet .nexus-ticket-mobile-symbol {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px 7px;
    box-sizing: border-box;
  }
  #nexusTicket.is-mobile-sheet .nexus-ticket-mobile-symbol .nexus-ot-icon-wrap {
    flex: 0 0 auto;
    margin: 0;
  }
  #nexusTicket.is-mobile-sheet .nexus-ticket-mobile-symbol .nexus-ot-icon-wrap .nexus-inst-icon {
    width: 50px;
    height: 50px;
  }
  .nexus-ticket-mobile-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .nexus-ticket-mobile-sym-row {
    display: flex;
    align-items: center;
    gap: 0;
  }
  #nexusTicket.is-mobile-sheet .nexus-ticket-mobile-sym-row strong {
    font-size: 18px;
    font-weight: 500;
    line-height: 18px;
    color: #1d1e37;
    margin-right: 10px;
  }
  body.dark-mode #nexusTicket.is-mobile-sheet .nexus-ticket-mobile-sym-row strong {
    color: #e8eaed;
  }
  #nexusTicket.is-mobile-sheet .nexus-ticket-mobile-sub {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    line-height: 12px;
    color: rgba(7, 15, 27, 0.698);
  }
  body.dark-mode #nexusTicket.is-mobile-sheet .nexus-ticket-mobile-sub {
    color: rgba(232, 234, 237, 0.7);
  }
  #nexusTicket.is-mobile-sheet #nexusTicketMobileName {
    font-size: 12px;
    font-weight: 400;
    line-height: 12px;
    color: inherit;
  }
  #nexusTicket.is-mobile-sheet #nexusTicketMobileChg {
    font-size: 12px;
    font-weight: 400;
    line-height: 19.2px;
  }

  /* Nexus .open-trade__right__container — margin 10px 16px 16px */
  #nexusTicket.is-mobile-sheet .nexus-ticket-body {
    display: block;
    margin: 10px 16px 16px !important;
    min-width: 0;
  }
  /* Nexus .open-trade__value-container — pad/margin-bottom 26px + bottom rule */
  #nexusTicket.is-mobile-sheet .nexus-ticket-panel {
    padding: 0 0 26px;
    margin: 0 0 26px;
    border: 1px solid rgba(7, 15, 27, 0.1);
    border-radius: 10px;
    overflow: hidden;
  }
  body.dark-mode #nexusTicket.is-mobile-sheet .nexus-ticket-panel {
    border-color: rgba(255, 255, 255, 0.08);
  }
  #nexusTicket.is-mobile-sheet .nexus-ticket-panel > .nexus-enter-value,
  #nexusTicket.is-mobile-sheet .nexus-ticket-panel > .nexus-pct {
    margin-left: 16px;
    margin-right: 16px;
  }
  #nexusTicket.is-mobile-sheet .nexus-enter-value {
    margin-top: 16px;
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 10px;
  }
  #nexusTicket.is-mobile-sheet .nexus-pct {
    margin: 16px;
  }

  /* Nexus .nexus-protector — margin 26px 0 (no top rule; panel already divides) */
  #nexusTicket.is-mobile-sheet .nexus-protector {
    margin: 26px 0;
    padding: 0;
    border-top: 0;
  }
  #nexusTicket.is-mobile-sheet .nexus-protector-title {
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: #1d1e37;
  }
  body.dark-mode #nexusTicket.is-mobile-sheet .nexus-protector-title {
    color: #e8eaed;
  }
  #nexusTicket.is-mobile-sheet .nexus-protector-panel {
    margin-top: 26px;
    border-radius: 10px;
  }
  #nexusTicket.is-mobile-sheet .nexus-limit-row {
    margin: 16px;
  }
  /* Nexus .buy-sell-button — margin-top 26px; extra margin-bottom for mobile scroll room */
  #nexusTicket.is-mobile-sheet .nexus-cta {
    margin: 26px 0 32px !important;
    padding: 7px 23px;
    min-height: 45px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
  }

  .nexus-side-toggle {
    padding: 12px;
  }
  .nexus-ticket-body {
    margin: 8px 12px 12px;
  }
  .nexus-tv-wrap {
    height: min(320px, 48vh);
    min-height: 240px;
  }

  .nexus-ot-chrome {
    position: relative;
    top: auto;
  }
  .nexus-markets-tabs {
    position: relative;
    top: auto;
    margin-bottom: 16px;
  }
  .nexus-cat-rail {
    position: relative;
    top: auto;
  }

  .nexus-enter-value,
  .nexus-pct {
    margin-left: 12px;
    margin-right: 12px;
  }
  .nexus-ticket-panel > .nexus-enter-value,
  .nexus-ticket-panel > .nexus-pct {
    margin-left: 0;
    margin-right: 0;
  }
  .nexus-limit-row {
    margin: 12px;
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .nexus-limit-row .nexus-switch {
    margin-left: auto;
  }

  .nexus-pos-filters .nexus-seg-btn {
    padding: 5px 10px;
    font-size: 13px;
  }
  .nexus-pill-group {
    margin-right: 0;
    width: 100%;
  }
  .nexus-pos-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .nexus-pill-group .nexus-seg {
    flex: 1 1 auto;
  }

  .nexus-table-scroll {
    margin: 0 -4px;
    padding: 0 4px;
  }

  #nexusPosList.is-grid-view .nexus-pos-table tbody {
    grid-template-columns: 1fr;
  }

  .nexus-modal-card {
    width: min(440px, calc(100vw - 24px));
  }
  .nexus-modal-card.nexus-alert-modal,
  .nexus-modal-card.nexus-watchlist-modal {
    width: min(536px, calc(100vw - 24px));
  }

  /* Clear fixed bottom primary nav */
  .nexus-open-trade,
  .nexus-pos-panel,
  #section-market,
  #section-positions {
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
}

/* Small phones */
@media (max-width: 480px) {
  .nexus-acct-item strong {
    font-size: 13px;
  }
  .nexus-markets-tab,
  .nexus-pos-tabs-row .nexus-pos-tab {
    padding-left: 12px;
    padding-right: 12px;
    font-size: 13px;
  }
  .nexus-tv-wrap {
    height: 240px;
    min-height: 220px;
  }
  /* Open-trade chart must ignore the compact browse height on phones */
  body.nexus-ot-mobile-active .nexus-tv-wrap {
    height: calc(100dvh - 220px - env(safe-area-inset-bottom, 0px)) !important;
    min-height: 240px !important;
  }
  .nexus-cta {
    min-height: 48px;
    font-size: 15px;
  }
  .nexus-side-btn {
    font-size: 13px;
    padding: 12px 0;
  }
}

/* ===== Positions parity 4.94 ===== */
.nexus-pos-expand-col {
  width: 28px;
  padding-left: 8px !important;
  padding-right: 0 !important;
}
.nexus-pos-expand-col[hidden],
.nexus-pos-sym-col[hidden] {
  display: none !important;
}
.nexus-pos-expand-btn {
  border: 0;
  background: transparent;
  color: #3179ff;
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.nexus-pos-expand-glyph {
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  color: #3179ff;
}
.nexus-pos-fake-expand {
  display: inline-block;
  width: 14px;
}
.nexus-pos-group-head td {
  background: #fff;
  border-bottom: 1px solid var(--nexus-line);
  vertical-align: middle;
  padding-top: 14px;
  padding-bottom: 14px;
}
.nexus-pos-group-sym {
  min-width: 220px;
}
.nexus-sym-cell--group .nexus-sym-second {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: rgba(7, 15, 27, 0.55);
  font-size: 12px;
}
.nexus-sym-cell--group .nexus-sym-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nexus-group-pnl {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.nexus-pos-child-row td {
  background: #fafbfc;
}
.nexus-source-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.nexus-source-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b8cff, #3179ff);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.nexus-pos-refine-field select {
  border: 0;
  background: transparent;
  color: rgba(7, 15, 27, 0.7);
  font-size: 13px;
  min-width: 108px;
  cursor: pointer;
}
.nexus-pos-refine-field--dates .nexus-pos-refine-date-label {
  color: rgba(7, 15, 27, 0.7);
  font-size: 13px;
}
.nexus-pos-grid-view {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 16px;
  min-height: 480px;
  padding: 12px 4px 8px;
  box-sizing: border-box;
}
.nexus-pos-grid-view[hidden] {
  display: none !important;
}
.nexus-pos-grid-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding-right: 4px;
}
.nexus-pos-grid-side {
  border: 1px solid var(--nexus-line);
  border-radius: 12px;
  background: #fff;
  min-height: 360px;
  padding: 20px;
  box-sizing: border-box;
}
.nexus-pos-grid-side-empty {
  color: rgba(7, 15, 27, 0.45);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}
.nexus-grid-card {
  border: 1px solid var(--nexus-line);
  border-radius: 12px;
  background: #fff;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.nexus-grid-card.is-selected,
.nexus-grid-card:hover {
  border-color: #3179ff;
  box-shadow: 0 0 0 1px rgba(49, 121, 255, 0.15);
}
.nexus-grid-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.nexus-grid-card-sym {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.nexus-grid-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nexus-grid-card-time {
  font-size: 12px;
  color: rgba(7, 15, 27, 0.5);
  margin-top: 2px;
}
.nexus-grid-card-pnl {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.nexus-grid-card-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 8px;
}
.nexus-grid-card-metrics > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.nexus-grid-card-metrics strong {
  font-size: 13px;
  color: var(--nexus-text);
  font-variant-numeric: tabular-nums;
}
.nexus-grid-card-metrics span {
  font-size: 11px;
  color: rgba(7, 15, 27, 0.45);
}
.nexus-grid-card-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--nexus-line);
  font-size: 12px;
  color: rgba(7, 15, 27, 0.55);
}
.nexus-grid-side-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.nexus-grid-side-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.nexus-grid-side-stats > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--nexus-line);
  border-radius: 10px;
}
.nexus-grid-side-stats span {
  font-size: 12px;
  color: rgba(7, 15, 27, 0.5);
}
.nexus-modal-card--close {
  width: min(500px, calc(100vw - 32px));
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}
.nexus-modal-head--close {
  display: block;
  padding: 20px 26px;
  border-bottom: 0;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}
.nexus-modal-head--close h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: rgb(29, 30, 55);
}
.nexus-modal-head--close .nexus-x {
  position: absolute;
  top: 20px;
  right: 26px;
  font-size: 24px;
  font-weight: 300;
  line-height: 24px;
  color: rgb(29, 30, 55);
  opacity: 1;
}
.nexus-close-body {
  padding: 26px !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 250px;
  gap: 0;
}
.nexus-close-body > * {
  width: 100%;
}
.nexus-close-q {
  text-align: center;
  margin: 0 0 26px;
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  color: rgb(29, 30, 55);
}
.nexus-close-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 26px;
  gap: 0;
}
.nexus-close-identity .nexus-inst-icon,
.nexus-close-identity .nexus-sym-icon {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px;
  margin: 0 0 10px;
}
.nexus-close-identity .nexus-inst-icon img,
.nexus-close-identity img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
}
.nexus-close-identity-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.nexus-close-identity-top {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 400;
  color: rgb(29, 30, 55);
}
.nexus-close-identity-top .nexus-close-sym {
  position: relative;
  font-weight: 500;
  color: rgb(29, 30, 55);
  margin-right: 6px;
  padding-right: 6px;
}
.nexus-close-identity-top .nexus-close-sym::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 12px;
  background: rgba(7, 15, 27, 0.1);
}
.nexus-close-identity-top .nexus-badge-cfd {
  border: 0;
  padding: 0;
  line-height: 15px;
  color: #3179ff;
  background: transparent;
  font-size: 12px;
  font-weight: 400;
}
.nexus-close-identity-bottom {
  text-align: center;
  color: rgba(7, 15, 27, 0.7);
  font-size: 12px;
  line-height: 15px;
  font-weight: 400;
}
.nexus-close-stats {
  display: flex;
  flex-wrap: wrap;
  background: #f3f5f6;
  border-radius: 14px;
  padding: 0 14px;
  margin: 0 0 26px;
}
.nexus-close-stats-label,
.nexus-close-stats-value {
  flex: 0 1 50%;
  padding: 16px 0;
  border-bottom: 1px solid rgba(7, 15, 27, 0.1);
  box-sizing: border-box;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
}
.nexus-close-stats-label:nth-last-child(2),
.nexus-close-stats-value:last-child {
  border-bottom: 0;
}
.nexus-close-stats-label {
  display: flex;
  align-items: center;
  color: rgba(7, 15, 27, 0.7);
  font-size: 12px;
  line-height: 15px;
}
.nexus-close-stats-value {
  text-align: right;
  color: rgb(29, 30, 55);
  font-variant-numeric: tabular-nums;
}
.nexus-close-stats-value.is-neg { color: #ee3142; }
.nexus-close-stats-value.is-pos { color: #21ad36; }
.nexus-close-dont {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 26px;
}
.nexus-close-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid rgba(7, 15, 27, 0.15);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
}
.nexus-close-checkbox:checked {
  background: #3179ff;
  border: none;
}
.nexus-close-checkbox:checked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: center / 10px 8px no-repeat
    url("data:image/svg+xml;charset=utf-8,%3Csvg width='6' height='5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m.521 2.5 1.651 1.651L5.48.85' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.nexus-close-dont label {
  cursor: pointer;
  flex: 1 1 0;
  user-select: none;
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: rgb(29, 30, 55);
}
.nexus-close-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
}
.nexus-close-action-cancel,
.nexus-close-action-ok {
  width: 50%;
}
.nexus-btn-close-cancel,
.nexus-btn-close-ok {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 7px 23px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 17px;
  cursor: pointer;
  box-sizing: border-box;
  white-space: normal;
}
.nexus-btn-close-cancel {
  background: transparent;
  border: 1px solid #3179ff;
  color: #3179ff;
  font-weight: 400;
}
.nexus-btn-close-cancel:hover {
  background: rgba(49, 121, 255, 0.06);
}
.nexus-btn-close-ok {
  background: #ee3142;
  border: 1px solid #ee3142;
  color: #fff;
  font-weight: 500;
}
.nexus-btn-close-ok:hover {
  background: #d92b3b;
  border-color: #d92b3b;
}
.nexus-btn-danger--block {
  width: 100%;
}
.nexus-pos-empty--inline {
  padding: 40px 16px;
}
#nexusActiveTableWrap {
  position: relative;
  border-radius: 10px;
}
#nexusActiveTableWrap.selection-mode {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.nexus-pos-panel .nexus-pos-table tbody tr.is-selected {
  background: rgba(49, 121, 255, 0.06);
  cursor: pointer;
}
.nexus-pos-panel .nexus-pos-table tbody tr.is-selected:hover {
  background: rgba(49, 121, 255, 0.1);
}
.nexus-pos-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 16px;
  min-height: 48px;
  box-sizing: border-box;
  background: #3179ff;
  color: #fff;
  border-radius: 12px;
  position: sticky;
  bottom: 16px;
  z-index: 80;
  margin-top: 8px;
  width: 100%;
}
.nexus-pos-selection-bar[hidden] {
  display: none !important;
}
.nexus-pos-selection-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.nexus-pos-selection-count {
  font-size: 14px;
  font-weight: 400;
  color: #fff;
}
.nexus-pos-selection-clear {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: #fff;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}
.nexus-pos-selection-clear:hover {
  opacity: 0.9;
}
.nexus-pos-selection-close {
  appearance: none;
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.nexus-pos-selection-close:hover {
  background: rgba(255, 255, 255, 0.12);
}
.nexus-modal-card--close-bulk {
  width: min(440px, calc(100vw - 32px));
}
.nexus-close-bulk-body {
  padding: 8px 26px 18px !important;
}
.nexus-close-bulk-q {
  text-align: center;
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--nexus-text);
}
.nexus-close-bulk-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin: 0 0 18px;
  background: #f3f5f6;
  border-radius: 10px;
  font-size: 14px;
  color: rgba(7, 15, 27, 0.7);
}
.nexus-close-bulk-total strong {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.nexus-close-bulk-carousel {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: start;
  gap: 4px;
  margin-bottom: 8px;
}
.nexus-close-bulk-arrow {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(7, 15, 27, 0.45);
  font-size: 36px;
  line-height: 1;
  padding: 24px 0 0;
  cursor: pointer;
}
.nexus-close-bulk-arrow:disabled {
  opacity: 0.25;
  cursor: default;
}
.nexus-close-bulk-symbol {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.nexus-close-bulk-symbol .nexus-inst-icon,
.nexus-close-bulk-symbol .nexus-sym-icon,
.nexus-close-bulk-symbol img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
body.dark-mode .nexus-close-bulk-total {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
}
body.dark-mode .nexus-close-bulk-arrow {
  color: rgba(255, 255, 255, 0.55);
}
body.dark-mode .nexus-pos-panel .nexus-pos-table tbody tr.is-selected {
  background: rgba(49, 121, 255, 0.16);
}
#nexusPosList.is-grid-view .nexus-pos-panel[data-positions-panel="active"] .nexus-table-scroll,
#nexusPosList.is-grid-view .nexus-pos-panel[data-positions-panel="closed"] .nexus-table-scroll {
  display: none;
}
#nexusPosList.is-grid-view .nexus-pos-table thead {
  display: none;
}
@media (max-width: 1100px) {
  .nexus-pos-grid-view {
    grid-template-columns: 1fr;
  }
  .nexus-pos-grid-side {
    min-height: 220px;
  }
  .nexus-td-hero {
    grid-template-columns: 1fr;
  }
  .nexus-td-progress {
    justify-self: start;
    max-width: 100%;
  }
  .nexus-td-hero-owner {
    justify-self: start;
    justify-content: flex-start;
    text-align: left;
  }
  .nexus-td-owner-text {
    align-items: flex-start;
  }
  .nexus-td-stats,
  .nexus-td-stats--closed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nexus-td-stats > .nexus-td-cell,
  .nexus-td-stats--closed > .nexus-td-cell {
    border-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 8px !important;
  }
  .nexus-td-cell--lg .nexus-td-cell-value,
  .nexus-td-cell--lg .nexus-td-cell-value strong {
    font-size: 18px;
  }
  .nexus-td-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .nexus-btn-success {
    width: 100%;
  }
}
body.dark-mode .nexus-pos-group-head td,
body.dark-mode .nexus-grid-card,
body.dark-mode .nexus-pos-grid-side,
body.dark-mode .nexus-trade-detail__card {
  background: var(--nexus-surface);
}
body.dark-mode .nexus-pos-child-row td {
  background: rgba(255, 255, 255, 0.03);
}
body.dark-mode .nexus-td-progress-rail,
body.dark-mode .nexus-td-progress-mark,
body.dark-mode .nexus-td-progress-center {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.12);
}
body.dark-mode .nexus-td-progress-indicator:not(.nexus-td-progress-indicator--neg):not(.nexus-td-progress-indicator--pos) .nexus-td-progress-bubble {
  background: rgba(255, 255, 255, 0.25);
}
body.dark-mode .nexus-td-progress-indicator:not(.nexus-td-progress-indicator--neg):not(.nexus-td-progress-indicator--pos) .nexus-td-progress-bubble::after {
  border-top-color: rgba(255, 255, 255, 0.25);
}
body.dark-mode .nexus-td-cell-label {
  color: rgba(255, 255, 255, 0.55);
}
body.dark-mode .nexus-td-stats > .nexus-td-cell,
body.dark-mode .nexus-td-stats--closed > .nexus-td-cell {
  border-right-color: rgba(255, 255, 255, 0.1);
}
