/* SUNDEX p105 — functional paper trading terminal. */

body.sx105-trade-active {
  --sx105-bg: #04070b;
  --sx105-panel: #080d14;
  --sx105-panel-2: #0b111a;
  --sx105-line: rgba(151, 169, 194, .18);
  --sx105-line-strong: rgba(172, 190, 214, .3);
  --sx105-text: #f2f5f8;
  --sx105-muted: #7f8da1;
  --sx105-green: #58c994;
  --sx105-red: #ee7885;
  background: var(--sx105-bg) !important;
}

body.sx105-trade-active #root main,
body.sx105-trade-active .sx92-trade-fallback {
  display: none !important;
}

body.sx105-trade-active #root {
  pointer-events: none !important;
}

body.sx105-trade-active #root header {
  pointer-events: auto !important;
}

body.sx105-trade-active #sx88-route-portal {
  position: relative !important;
  z-index: 2 !important;
  display: block !important;
  visibility: visible !important;
  min-height: calc(100svh - 76px) !important;
  margin-top: 76px !important;
  overflow: visible !important;
  opacity: 1 !important;
}

.sx105-trade,
.sx105-trade *,
.sx105-trade *::before,
.sx105-trade *::after { box-sizing: border-box; }

.sx105-trade {
  min-height: calc(100svh - 76px);
  padding: 18px clamp(16px, 2vw, 32px) 28px;
  color: var(--sx105-text);
  background:
    radial-gradient(circle at 50% -25%, rgba(72, 91, 116, .12), transparent 38%),
    var(--sx105-bg);
  font-family: Geist, Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sx105-trade button,
.sx105-trade input,
.sx105-trade select { font: inherit; }

.sx105-trade button { -webkit-tap-highlight-color: transparent; }

.sx105-trade__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(100%, 1880px);
  margin: 0 auto 14px;
}

.sx105-trade__heading { display: flex; align-items: center; gap: 13px; min-width: 0; }
.sx105-trade__heading h1 { margin: 0; font-size: clamp(25px, 2.1vw, 36px); font-weight: 590; letter-spacing: -.045em; }
.sx105-trade__heading p { margin: 3px 0 0; color: var(--sx105-muted); font-size: 12px; }
.sx105-trade__paper {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(133, 184, 157, .25);
  border-radius: 999px;
  color: #a8ceb9;
  background: rgba(50, 105, 77, .12);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.sx105-trade__paper::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sx105-green); box-shadow: 0 0 12px rgba(88, 201, 148, .55); }

.sx105-trade__account { display: flex; align-items: center; gap: 20px; }
.sx105-trade__account-item { text-align: right; }
.sx105-trade__account-item span { display: block; color: var(--sx105-muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.sx105-trade__account-item strong { display: block; margin-top: 3px; font-size: 14px; font-weight: 590; font-variant-numeric: tabular-nums; }
.sx105-trade__reset {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--sx105-line);
  border-radius: 999px;
  color: #aab4c2;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  transition: border-color 180ms ease-out, color 180ms ease-out, transform 180ms ease-out;
}
.sx105-trade__reset:hover { border-color: rgba(219, 228, 239, .46); color: #fff; }
.sx105-trade__reset:active { transform: scale(.97); }

.sx105-trade__shell {
  display: grid;
  grid-template-columns: 230px minmax(500px, 1fr) 340px;
  grid-template-areas: "markets chart ticket" "positions positions positions";
  width: min(100%, 1880px);
  min-height: min(850px, calc(100svh - 146px));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--sx105-line-strong);
  border-radius: 20px;
  background: var(--sx105-panel);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .025);
}

.sx105-trade__markets { grid-area: markets; min-width: 0; border-right: 1px solid var(--sx105-line); background: #060a10; }
.sx105-trade__chart { grid-area: chart; min-width: 0; border-right: 1px solid var(--sx105-line); }
.sx105-trade__ticket { grid-area: ticket; min-width: 0; background: #080d14; }
.sx105-trade__positions { grid-area: positions; min-width: 0; border-top: 1px solid var(--sx105-line); background: #060a10; }

.sx105-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 54px; padding: 0 16px; border-bottom: 1px solid var(--sx105-line); }
.sx105-section-head strong { font-size: 13px; font-weight: 590; }
.sx105-section-head span { color: var(--sx105-muted); font-size: 10px; }

.sx105-market-search { padding: 11px; border-bottom: 1px solid var(--sx105-line); }
.sx105-market-search input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  outline: none;
  border: 1px solid var(--sx105-line);
  border-radius: 9px;
  color: #dfe5ec;
  background: #0a1018;
  font-size: 12px;
  transition: border-color 180ms ease-out;
}
.sx105-market-search input:focus { border-color: rgba(181, 199, 224, .44); }
.sx105-market-search input::placeholder { color: #566276; }

.sx105-market-list { max-height: 480px; overflow-y: auto; scrollbar-width: thin; }
.sx105-market-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid rgba(151, 169, 194, .08);
  color: #e8edf3;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 170ms ease-out, color 170ms ease-out;
}
.sx105-market-row:hover { background: rgba(129, 151, 180, .065); }
.sx105-market-row.is-active { background: #111925; box-shadow: inset 2px 0 0 #cbd7e6; }
.sx105-market-row__asset { display: flex; align-items: center; gap: 9px; min-width: 0; }
.sx105-market-row img { width: 24px; height: 24px; object-fit: contain; }
.sx105-market-row__asset strong,
.sx105-market-row__quote strong { display: block; font-size: 12px; font-weight: 590; font-variant-numeric: tabular-nums; }
.sx105-market-row__asset span,
.sx105-market-row__quote span { display: block; margin-top: 3px; color: #68768a; font-size: 9px; }
.sx105-market-row__quote { text-align: right; }
.sx105-market-row__quote span.is-up { color: var(--sx105-green); }
.sx105-market-row__quote span.is-down { color: var(--sx105-red); }

.sx105-book { padding: 13px 14px; border-top: 1px solid var(--sx105-line); }
.sx105-book__labels,
.sx105-book__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-variant-numeric: tabular-nums; }
.sx105-book__labels { margin-bottom: 7px; color: #536075; font-size: 9px; }
.sx105-book__labels span:last-child,
.sx105-book__row span:last-child { text-align: right; }
.sx105-book__row { position: relative; min-height: 21px; align-items: center; color: #9ca8b8; font-size: 10px; }
.sx105-book__row::before { content: ""; position: absolute; z-index: 0; top: 2px; right: -14px; bottom: 2px; width: var(--depth, 40%); opacity: .32; }
.sx105-book__row.is-ask::before { background: linear-gradient(90deg, transparent, rgba(181, 64, 79, .42)); }
.sx105-book__row.is-bid::before { background: linear-gradient(90deg, transparent, rgba(52, 159, 115, .4)); }
.sx105-book__row span { position: relative; z-index: 1; }
.sx105-book__row.is-ask span:first-child { color: #d77883; }
.sx105-book__row.is-bid span:first-child { color: #62c796; }
.sx105-book__mid { padding: 7px 0; color: #e7edf4; font-size: 13px; font-weight: 590; font-variant-numeric: tabular-nums; }

.sx105-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 62px; padding: 8px 15px; border-bottom: 1px solid var(--sx105-line); }
.sx105-symbol { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sx105-symbol img { width: 34px; height: 34px; object-fit: contain; }
.sx105-symbol strong { display: block; font-size: 14px; font-weight: 610; }
.sx105-symbol span { display: block; margin-top: 3px; color: var(--sx105-muted); font-size: 10px; }
.sx105-mark { margin-left: 14px; }
.sx105-mark strong { font-size: 20px; font-weight: 520; font-variant-numeric: tabular-nums; }
.sx105-mark span { font-size: 10px; }
.sx105-mark span.is-up { color: var(--sx105-green); }
.sx105-mark span.is-down { color: var(--sx105-red); }
.sx105-chart-live { display: inline-flex; align-items: center; gap: 7px; color: #81928a; font-size: 10px; }
.sx105-chart-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sx105-green); box-shadow: 0 0 11px rgba(88, 201, 148, .55); }
.sx105-chart-frame { position: relative; min-height: 510px; background: #04080d; }
.sx105-chart-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #04080d; }

.sx105-ticket-inner { padding: 14px; }
.sx105-segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 12px; padding: 4px; border: 1px solid var(--sx105-line); border-radius: 11px; background: #050910; }
.sx105-segmented button { min-height: 37px; border: 0; border-radius: 8px; color: #78869a; background: transparent; cursor: pointer; font-size: 12px; font-weight: 570; transition: color 170ms ease-out, background 170ms ease-out, transform 170ms ease-out; }
.sx105-segmented button:hover { color: #dce3ec; }
.sx105-segmented button:active { transform: scale(.98); }
.sx105-segmented button.is-active { color: #f4f7fa; background: #192330; }
.sx105-segmented--side button.is-active[data-value="long"] { color: #b9efd4; background: rgba(48, 133, 94, .23); }
.sx105-segmented--side button.is-active[data-value="short"] { color: #ffc0c7; background: rgba(148, 54, 68, .22); }

.sx105-ticket-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 13px 1px; }
.sx105-ticket-row > span { color: var(--sx105-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.sx105-mode { display: flex; gap: 5px; }
.sx105-mode button { min-height: 30px; padding: 0 10px; border: 1px solid var(--sx105-line); border-radius: 999px; color: #7e8b9e; background: transparent; cursor: pointer; font-size: 10px; transition: border-color 170ms ease-out, color 170ms ease-out; }
.sx105-mode button.is-active { border-color: rgba(202, 214, 229, .4); color: #edf2f7; }

.sx105-field { display: block; margin-top: 12px; }
.sx105-field[hidden], .sx105-risk-fields[hidden] { display: none !important; }
.sx105-field > span { display: flex; justify-content: space-between; margin: 0 2px 7px; color: #7b899d; font-size: 10px; }
.sx105-input {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--sx105-line);
  border-radius: 10px;
  background: #0b121c;
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out;
}
.sx105-input:focus-within { border-color: rgba(185, 202, 225, .48); box-shadow: 0 0 0 3px rgba(116, 144, 179, .08); }
.sx105-input input { min-width: 0; width: 100%; height: 44px; padding: 0; outline: none; border: 0; color: #eef3f8; background: transparent; font-size: 17px; font-variant-numeric: tabular-nums; }
.sx105-input input::placeholder { color: #4d596b; }
.sx105-input strong { color: #9da9b9; font-size: 11px; }
.sx105-input button { min-height: 28px; margin-left: 7px; padding: 0 8px; border: 0; border-radius: 7px; color: #c4ceda; background: rgba(142, 162, 188, .1); cursor: pointer; font-size: 9px; }

.sx105-leverage { margin: 14px 2px 3px; }
.sx105-leverage__head { display: flex; justify-content: space-between; margin-bottom: 8px; color: #7b899d; font-size: 10px; }
.sx105-leverage__head strong { color: #edf2f7; font-size: 12px; font-variant-numeric: tabular-nums; }
.sx105-leverage input { width: 100%; height: 4px; accent-color: #c9d6e6; cursor: pointer; }
.sx105-leverage__ticks { display: flex; justify-content: space-between; margin-top: 6px; color: #586578; font-size: 8px; }

.sx105-risk-toggle { display: flex; align-items: center; justify-content: space-between; min-height: 35px; margin-top: 10px; color: #8b98aa; font-size: 10px; }
.sx105-risk-toggle button { border: 0; color: #c5cfdb; background: transparent; cursor: pointer; font-size: 10px; }
.sx105-risk-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sx105-risk-fields[hidden] { display: none; }

.sx105-summary { display: grid; gap: 7px; margin: 14px 0; padding: 12px; border: 1px solid rgba(151, 169, 194, .12); border-radius: 10px; background: #070c12; }
.sx105-summary div { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #68768a; font-size: 10px; }
.sx105-summary strong { color: #b7c1ce; font-weight: 520; font-variant-numeric: tabular-nums; }

.sx105-submit { width: 100%; min-height: 50px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-size: 13px; font-weight: 650; transition: filter 180ms ease-out, transform 180ms ease-out, opacity 180ms ease-out; }
.sx105-submit:hover { filter: brightness(1.08); }
.sx105-submit:active { transform: scale(.985); }
.sx105-submit.is-long { color: #06110c; background: #60d49f; }
.sx105-submit.is-short { color: #17070a; background: #f0808d; }
.sx105-submit:disabled { cursor: not-allowed; opacity: .42; filter: none; }
.sx105-ticket-note { margin: 10px 3px 0; color: #586578; font-size: 9px; line-height: 1.45; text-align: center; }

.sx105-tabs { display: flex; align-items: center; gap: 6px; min-height: 47px; padding: 0 14px; border-bottom: 1px solid var(--sx105-line); }
.sx105-tabs button { position: relative; min-height: 47px; padding: 0 13px; border: 0; color: #657287; background: transparent; cursor: pointer; font-size: 11px; }
.sx105-tabs button.is-active { color: #eef3f8; }
.sx105-tabs button.is-active::after { content: ""; position: absolute; right: 10px; bottom: 0; left: 10px; height: 2px; border-radius: 99px; background: #cbd7e6; }
.sx105-tabs span { display: inline-grid; min-width: 18px; height: 18px; margin-left: 5px; place-items: center; border-radius: 99px; color: #91a0b4; background: #141c27; font-size: 8px; }
.sx105-table-wrap { width: 100%; overflow-x: auto; }
.sx105-table { width: 100%; min-width: 980px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sx105-table th { height: 37px; padding: 0 13px; color: #566378; font-size: 8px; font-weight: 600; letter-spacing: .08em; text-align: right; text-transform: uppercase; }
.sx105-table th:first-child,
.sx105-table td:first-child { padding-left: 18px; text-align: left; }
.sx105-table td { height: 58px; padding: 8px 13px; border-top: 1px solid rgba(151, 169, 194, .08); color: #a9b4c2; font-size: 10px; text-align: right; }
.sx105-table strong { color: #e8edf3; font-size: 11px; font-weight: 590; }
.sx105-table small { display: block; margin-top: 3px; color: #637084; font-size: 8px; }
.sx105-side-badge { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border-radius: 999px; font-size: 8px; font-weight: 650; text-transform: uppercase; }
.sx105-side-badge.is-long { color: #8be3b7; background: rgba(57, 145, 100, .15); }
.sx105-side-badge.is-short { color: #f6a5ae; background: rgba(164, 61, 76, .15); }
.sx105-pnl.is-up { color: var(--sx105-green); }
.sx105-pnl.is-down { color: var(--sx105-red); }
.sx105-row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.sx105-row-actions button { min-height: 28px; padding: 0 10px; border: 1px solid var(--sx105-line); border-radius: 8px; color: #aab5c3; background: transparent; cursor: pointer; font-size: 9px; transition: border-color 170ms ease-out, color 170ms ease-out; }
.sx105-row-actions button:hover { border-color: rgba(210, 221, 235, .44); color: #fff; }
.sx105-empty { display: grid; min-height: 104px; place-items: center; color: #556276; font-size: 10px; }

.sx105-toast {
  position: fixed;
  z-index: 10020;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 13px 15px;
  border: 1px solid var(--sx105-line-strong);
  border-radius: 11px;
  color: #e9eef4;
  background: rgba(8, 13, 20, .94);
  box-shadow: 0 18px 50px rgba(0,0,0,.38);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  font-size: 11px;
  transition: opacity 190ms ease-out, transform 190ms ease-out;
}
.sx105-toast.is-visible { opacity: 1; transform: translateY(0); }
.sx105-toast.is-error { border-color: rgba(231, 112, 126, .36); }

@media (max-width: 1220px) {
  .sx105-trade__shell { grid-template-columns: 200px minmax(440px, 1fr) 310px; }
  .sx105-chart-frame { min-height: 470px; }
  .sx105-trade__account-item:first-child { display: none; }
}

@media (max-width: 980px) {
  body.sx105-trade-active #sx88-route-portal { margin-top: 68px !important; }
  .sx105-trade { min-height: calc(100svh - 68px); padding: 14px; }
  .sx105-trade__topbar { align-items: flex-start; }
  .sx105-trade__paper { display: none; }
  .sx105-trade__account-item { display: none; }
  .sx105-trade__shell {
    grid-template-columns: minmax(0, 1fr) 310px;
    grid-template-areas: "chart ticket" "positions positions";
    min-height: 0;
  }
  .sx105-trade__markets { display: none; }
  .sx105-chart-frame { min-height: 500px; }
}

@media (max-width: 720px) {
  .sx105-trade__topbar { margin-bottom: 11px; }
  .sx105-trade__heading h1 { font-size: 26px; }
  .sx105-trade__heading p { max-width: 230px; line-height: 1.35; }
  .sx105-trade__shell { display: block; border-radius: 16px; overflow: visible; }
  .sx105-trade__chart,
  .sx105-trade__ticket,
  .sx105-trade__positions { border: 0; }
  .sx105-trade__chart { overflow: hidden; border-bottom: 1px solid var(--sx105-line); border-radius: 16px 16px 0 0; }
  .sx105-chart-head { min-height: 58px; }
  .sx105-chart-frame { min-height: 410px; }
  .sx105-trade__ticket { border-bottom: 1px solid var(--sx105-line); }
  .sx105-ticket-inner { padding: 15px; }
  .sx105-risk-fields { grid-template-columns: 1fr; }
  .sx105-tabs { overflow-x: auto; }
  .sx105-toast { right: 16px; bottom: 16px; }
}

@media (max-width: 480px) {
  .sx105-trade { padding: 10px; }
  .sx105-chart-frame { min-height: 360px; }
  .sx105-symbol img { width: 30px; height: 30px; }
  .sx105-mark { margin-left: 4px; }
  .sx105-mark strong { font-size: 16px; }
  .sx105-chart-live { display: none; }
  .sx105-trade__reset { min-height: 34px; padding: 0 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .sx105-trade *, .sx105-trade *::before, .sx105-trade *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
