:root {
  color-scheme: dark;
  --terminal-bg: #080808;
  --terminal-panel: #0d0d0d;
  --terminal-line: #272727;
  --terminal-line-soft: rgba(255, 255, 255, .07);
  --terminal-text: #e6e6e6;
  --terminal-muted: #858585;
  --terminal-faint: #575757;
  --terminal-green: #08b996;
  --terminal-red: #f04a59;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--terminal-bg);
}

body {
  min-width: 320px;
  overflow: hidden;
  color: var(--terminal-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
}

button,
input { font: inherit; }

button {
  color: inherit;
  border: 0;
  background: transparent;
}

.terminal-app {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-rows: 43px minmax(0, 1fr) 39px 24px;
  background: var(--terminal-bg);
}

.terminal-topbar {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
  padding: 0 12px 0 10px;
  border-bottom: 1px solid var(--terminal-line);
  background: #101010;
}

.terminal-symbol-control {
  --terminal-symbol-width: 164px;
  position: relative;
  display: flex;
  width: clamp(148px, var(--terminal-symbol-width), 250px);
  height: 40px;
  flex: 0 1 clamp(148px, var(--terminal-symbol-width), 250px);
  align-items: center;
  gap: 4px;
  padding: 0 8px 0 10px;
  border: 1px solid #343434;
  border-radius: 22px;
  background: #181818;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.terminal-symbol-control:focus-within {
  border-color: #5b5b5b;
  background: #1b1b1b;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .045);
}

.terminal-search-glyph {
  width: 20px;
  flex: 0 0 20px;
  color: #b6b6b6;
  font-size: 18px;
  line-height: 1;
  text-align: center;
  transform: translateY(-1px);
}

.terminal-symbol-control input {
  width: 100%;
  min-width: 0;
  padding: 0 2px;
  color: #f4f4f4;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.terminal-symbol-control input:focus { color: #fff; }

.terminal-symbol-control input::placeholder {
  color: #858585;
  text-transform: none;
}

.terminal-symbol-control input::-webkit-search-cancel-button { display: none; }

.terminal-symbol-submit {
  width: 26px;
  flex: 0 0 26px;
  height: 25px;
  color: #a4a4a4;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.terminal-symbol-submit:hover { color: #fff; }

.terminal-symbol-dropdown {
  position: absolute;
  z-index: 12;
  top: calc(100% + 8px);
  left: 0;
  width: min(380px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 64px));
  overflow-y: auto;
  padding: 7px;
  border: 1px solid #353535;
  border-radius: 10px;
  background: #151515;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .58);
}

.terminal-symbol-dropdown[hidden] { display: none; }

.terminal-search-result {
  display: grid;
  width: 100%;
  min-height: 56px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  color: #d8d8d8;
  cursor: pointer;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}

.terminal-search-result:hover,
.terminal-search-result.is-active {
  background: #242424;
}

.terminal-search-result-icon {
  display: flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #d8d8d8;
  border: 1px solid #353535;
  border-radius: 50%;
  background: #202020;
  font: 700 10px/1 "Roboto Mono", ui-monospace, monospace;
}

.terminal-search-result-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.terminal-search-result-icon.logo img { object-fit: contain; padding: 5px; }

.terminal-search-result-copy,
.terminal-search-result-meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.terminal-search-result-copy strong {
  overflow: hidden;
  color: #f1f1f1;
  font: 700 12px/1.2 "Roboto Mono", ui-monospace, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-search-result-copy small,
.terminal-search-result-meta small {
  overflow: hidden;
  color: #777;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-search-result-meta {
  align-items: flex-end;
  text-align: right;
}

.terminal-search-result-meta strong {
  color: #999;
  font: 600 9px/1.2 "Roboto Mono", ui-monospace, monospace;
  letter-spacing: .06em;
}

.terminal-search-empty {
  padding: 20px 12px;
  color: #777;
  font-size: 11px;
  text-align: center;
}

.terminal-market-tabs {
  position: relative;
  display: flex;
  width: max-content;
  min-width: 0;
  max-width: min(620px, 44vw);
  flex: 0 1 auto;
  align-items: center;
  gap: 5px;
}

.terminal-market-tab-strip {
  display: flex;
  width: max-content;
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.terminal-market-tab-strip::-webkit-scrollbar { display: none; }

.terminal-market-tab {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: stretch;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #151515;
}

.terminal-market-tab.is-active {
  border-color: #353535;
  background: #252525;
}

.terminal-market-tab-main {
  display: inline-flex;
  min-width: 0;
  max-width: 160px;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 4px 0 7px;
  color: #8a8a8a;
  cursor: pointer;
  border-radius: 4px 0 0 4px;
  text-align: left;
}

.terminal-market-tab-main:hover { color: #e8e8e8; }
.terminal-market-tab.is-active .terminal-market-tab-main { color: #f1f1f1; }

.terminal-market-tab-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: #242424;
}

.terminal-market-tab-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.terminal-market-tab-icon.person img { object-fit: cover; }

.terminal-market-tab-symbol {
  min-width: 0;
  overflow: hidden;
  font: 600 12px/1.1 "Roboto Mono", ui-monospace, monospace;
  letter-spacing: .015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-market-tab-close,
.terminal-market-tab-add,
.terminal-market-tab-overflow {
  display: inline-grid;
  width: 26px;
  height: 32px;
  flex: 0 0 26px;
  place-items: center;
  color: #777;
  cursor: pointer;
  border-radius: 4px;
  font-size: 15px;
  line-height: 1;
}

.terminal-market-tab-close {
  width: 20px;
  flex-basis: 20px;
  opacity: 0;
  font-size: 13px;
}

.terminal-market-tab:hover .terminal-market-tab-close,
.terminal-market-tab:focus-within .terminal-market-tab-close,
.terminal-market-tab-close:focus-visible { opacity: 1; }

.terminal-market-tab-close:hover,
.terminal-market-tab-add:hover,
.terminal-market-tab-overflow:hover {
  color: #f0f0f0;
  background: #303030;
}

.terminal-market-tab-close:disabled {
  visibility: hidden;
  cursor: default;
}

.terminal-market-tab-add,
.terminal-market-tab-overflow {
  flex: 0 0 28px;
  width: 28px;
  height: 32px;
  border: 1px solid #343434;
  background: #171717;
}

.terminal-market-tab-add { font-size: 19px; }
.terminal-market-tab-overflow { font-size: 17px; }

.terminal-market-tab-overflow-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  right: 0;
  display: flex;
  width: 190px;
  max-height: min(360px, calc(100vh - 58px));
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #353535;
  border-radius: 7px;
  background: #151515;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .58);
}

.terminal-market-tab-overflow-menu[hidden] { display: none; }

.terminal-market-tab-overflow-item {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 8px;
  color: #a2a2a2;
  cursor: pointer;
  border-radius: 4px;
  text-align: left;
}

.terminal-market-tab-overflow-item:hover,
.terminal-market-tab-overflow-item.is-active { color: #f2f2f2; background: #252525; }

.terminal-market-tab-overflow-item span:last-child {
  min-width: 0;
  overflow: hidden;
  font: 600 10px/1.1 "Roboto Mono", ui-monospace, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-rangebar button {
  min-width: 31px;
  height: 27px;
  padding: 0 7px;
  color: #989898;
  cursor: pointer;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}

.terminal-rangebar button:hover,
.terminal-rangebar button.is-active {
  color: #f2f2f2;
  background: #2d2d2d;
}

.terminal-position-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.terminal-position {
  display: flex;
  min-width: 72px;
  height: 30px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0 8px;
  cursor: pointer;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  line-height: 1;
}

.terminal-position span {
  color: #b9b9b9;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.terminal-position strong {
  color: #e5e5e5;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.terminal-position:hover { filter: brightness(1.2); }

.terminal-position-short {
  border-color: rgba(240, 74, 89, .65);
  background: rgba(240, 48, 70, .11);
}

.terminal-position-short span,
.terminal-position-short strong { color: #f15a69; }

.terminal-position-long {
  border-color: rgba(33, 102, 233, .78);
  background: rgba(33, 102, 233, .16);
}

.terminal-position-long span,
.terminal-position-long strong { color: #5a91ff; }

.terminal-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  margin-left: auto;
}

.terminal-actions button {
  width: 30px;
  height: 28px;
  color: #9a9a9a;
  cursor: pointer;
  border-radius: 3px;
  font-size: 17px;
  line-height: 1;
}

.terminal-actions button:hover {
  color: #fff;
  background: #272727;
}

.terminal-settings-menu {
  position: absolute;
  z-index: 24;
  top: 49px;
  right: 12px;
  width: min(304px, calc(100vw - 24px));
  padding: 12px;
  color: #e8e8e8;
  border: 1px solid #343434;
  border-radius: 7px;
  background: #111;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .58);
}

.terminal-settings-menu[hidden] { display: none; }

.terminal-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid #292929;
}

.terminal-settings-header strong {
  color: #f2f2f2;
  font-size: 12px;
}

.terminal-settings-header button {
  width: 24px;
  height: 24px;
  color: #8a8a8a;
  cursor: pointer;
  border-radius: 4px;
  font-size: 20px;
  line-height: 1;
}

.terminal-settings-header button:hover {
  color: #fff;
  background: #252525;
}

.terminal-setting-row {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  cursor: pointer;
  border-bottom: 1px solid #222;
}

.terminal-setting-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.terminal-setting-copy strong {
  color: #e7e7e7;
  font-size: 11px;
  font-weight: 650;
}

.terminal-setting-copy small {
  color: #777;
  font-size: 10px;
  line-height: 1.35;
}

.terminal-settings-menu .terminal-switch {
  flex: 0 0 34px;
}

.terminal-settings-menu .terminal-switch input:checked + i { background: #777; }

.terminal-settings-note {
  margin: 10px 0 0;
  color: #6f6f6f;
  font-size: 9px;
  line-height: 1.45;
}

.terminal-account-controls {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: 9px;
}

.terminal-balance-toggle {
  display: inline-flex;
  min-width: 154px;
  height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 11px 0 14px;
  color: #f0f2f0;
  cursor: pointer;
  border: 1px solid #343434;
  border-radius: 20px;
  background: #0b0b0b;
}

.terminal-balance-toggle:hover { border-color: #555; background: #111; }

.terminal-balance-toggle [data-account-balance] {
  overflow: hidden;
  font: 700 13px/1 "Roboto Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-balance-toggle svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: #858b87;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.terminal-profile-button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  color: #f2f2f2;
  cursor: pointer;
  border-radius: 50%;
  background: #343434;
  font: 700 11px/1 "Roboto Mono", ui-monospace, monospace;
}

.terminal-profile-button:hover { background: #4a4a4a; }

.terminal-workspace {
  position: relative;
  display: grid;
  min-height: 0;
  grid-template-columns: 86px minmax(0, 1fr);
}

.terminal-toolrail {
  display: flex;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  overflow-y: auto;
  padding: 10px 6px 12px;
  border-right: 1px solid var(--terminal-line);
  background: #080808;
  scrollbar-width: thin;
  scrollbar-color: #343a43 transparent;
}

.terminal-side-nav {
  display: flex;
  width: 100%;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.terminal-side-item {
  position: relative;
  display: flex;
  width: 72px;
  min-height: 46px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 2px;
  color: #aab1b9;
  cursor: pointer;
  border-radius: 7px;
  text-decoration: none;
}

.terminal-side-item:hover {
  color: #f0f4f5;
  background: rgba(255, 255, 255, .045);
}

.terminal-side-item.is-active {
  color: #f2f6f4;
  background: #151515;
}

.terminal-side-item.is-active::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -6px;
  width: 2px;
  border-radius: 2px;
  content: "";
  background: var(--terminal-green);
}

.terminal-side-item svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.terminal-side-item span {
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 9.5px;
  font-weight: 520;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-utility-nav .terminal-side-item {
  min-height: 46px;
}

.terminal-utility-nav .terminal-side-item svg {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
  stroke-width: 1.45;
}

.terminal-side-spacer {
  min-height: 16px;
  flex: 1 1 auto;
}

.terminal-chart-shell {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: var(--terminal-bg);
}

.terminal-chart-toolbar {
  display: flex;
  width: max-content;
  max-width: min(420px, 34vw);
  min-width: 0;
  flex: 0 1 auto;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
  padding: 2px 3px 2px 7px;
  border-left: 1px solid #292929;
  background: transparent;
  scrollbar-width: none;
}

.terminal-chart-toolbar::-webkit-scrollbar { display: none; }

.terminal-chart-tool {
  display: inline-flex;
  min-height: 28px;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  color: #929292;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
}

.terminal-chart-tool:hover {
  color: #f0f0f0;
  background: #1d1d1d;
}

.terminal-chart-tool.is-active {
  color: #f3f3f3;
  background: #242424;
}

.terminal-chart-tool svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.terminal-chart-tool span {
  font-size: 10px;
  font-weight: 560;
}

#terminal-chart {
  position: absolute;
  inset: 0;
}

.terminal-chart-legend {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 16px;
  pointer-events: none;
  line-height: 1.55;
}

.terminal-chart-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9a9a9a;
  font-size: 12px;
}

.terminal-chart-identity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  overflow: hidden;
  vertical-align: middle;
}

.terminal-chart-identity img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.terminal-chart-identity img.is-person {
  width: 40px;
  height: 40px;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 50%;
}

.terminal-chart-identity img.is-openai {
  width: 34px;
  height: 34px;
  padding: 4px;
  border: 1px solid #e1e1e1;
  border-radius: 50%;
  background: #f1f1f1;
}

.terminal-chart-identity img.is-nba {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.terminal-chart-identity.is-pair {
  width: 48px;
  flex-basis: 48px;
}

.terminal-chart-identity img + img {
  width: 28px;
  height: 28px;
  margin-left: -8px;
  border: 1px solid #080808;
}

.terminal-chart-title strong {
  color: #efefef;
  font-size: 13px;
  letter-spacing: .03em;
}

.terminal-ohlc {
  color: #747474;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.terminal-chart-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 14px;
  margin-top: 3px;
  color: #777;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.terminal-chart-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.terminal-chart-metric b {
  color: #5d5d5d;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
}

.terminal-chart-metric strong {
  color: #b0b0b0;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
}

.terminal-chart-band strong {
  display: inline-flex;
  gap: 7px;
}

.terminal-chart-band [data-chart-band-min] { color: #e4878f; }
.terminal-chart-band [data-chart-band-max] { color: #67d6b4; }

.terminal-chart-message {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  max-width: min(420px, calc(100% - 40px));
  padding: 12px 16px;
  color: #b8b8b8;
  border: 1px solid #333;
  background: rgba(17, 17, 17, .94);
  text-align: center;
  transform: translate(-50%, -50%);
}

.terminal-rangebar {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 1px;
  padding: 0 10px 0 96px;
  border-top: 1px solid var(--terminal-line);
  background: #101010;
}

.terminal-range-spacer { flex: 1 1 auto; }

.terminal-feed-status {
  margin-left: 14px;
  color: #737373;
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  white-space: nowrap;
}

.terminal-statusbar {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 18px;
  padding: 0 12px 0 96px;
  color: #696969;
  border-top: 1px solid #1e1e1e;
  background: #0d0d0d;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.terminal-statusbar > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-statusbar time { min-width: 80px; text-align: right; }

.terminal-ticket-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.terminal-ticket {
  position: fixed;
  z-index: 21;
  top: 50%;
  right: 14px;
  bottom: auto;
  width: min(320px, calc(100vw - 24px));
  height: auto;
  max-height: calc(100dvh - 28px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px;
  color: #dedede;
  border: 1px solid #282828;
  border-radius: 7px;
  background: #050505;
  box-shadow: 0 18px 54px rgba(0, 0, 0, .68);
  transform: translateY(-50%);
}

.terminal-ticket-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
}

.terminal-ticket h2 {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #f2f2f2;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.terminal-ticket h2 > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-ticket-identity {
  display: inline-flex;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.terminal-ticket-identity img {
  display: block;
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.terminal-ticket-identity img.is-person {
  width: 27px;
  height: 27px;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 50%;
}

.terminal-ticket-identity img.is-openai {
  padding: 3px;
  border-radius: 50%;
  background: #f1f1f1;
}

.terminal-ticket-identity img.is-nba { width: 25px; height: 25px; }
.terminal-ticket-identity.is-pair { width: 34px; flex-basis: 34px; }
.terminal-ticket-identity img + img {
  width: 19px;
  height: 19px;
  margin-left: -6px;
  border: 1px solid #050505;
  border-radius: 50%;
}

.terminal-ticket-close {
  width: 26px;
  height: 26px;
  color: #b4b4b4;
  cursor: pointer;
  border-radius: 4px;
  font-size: 25px;
  line-height: 1;
}

.terminal-ticket-close:hover { color: #fff; background: #303030; }

.terminal-ticket-direction {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid #303030;
  border-radius: 5px;
  background: #151515;
}

.terminal-ticket-direction-option {
  display: flex;
  min-width: 0;
  min-height: 50px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 7px 10px;
  cursor: pointer;
  background: #1d1d1d;
  text-align: left;
  transition: background .14s ease, filter .14s ease;
}

.terminal-ticket-direction-option + .terminal-ticket-direction-option {
  align-items: flex-end;
  border-left: 1px solid #303030;
  text-align: right;
}

.terminal-ticket-direction-option span {
  color: #a6a6a6;
  font-size: 11px;
  font-weight: 650;
}

.terminal-ticket-direction-option strong {
  overflow: hidden;
  max-width: 100%;
  color: #bdbdbd;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-ticket-direction-long.is-active { background: #15366f; }
.terminal-ticket-direction-long.is-active span,
.terminal-ticket-direction-long.is-active strong { color: #67a0ff; }
.terminal-ticket-direction-short.is-active { background: #4c1b22; }
.terminal-ticket-direction-short.is-active span,
.terminal-ticket-direction-short.is-active strong { color: #ff6d7b; }
.terminal-ticket-direction-option:hover { filter: brightness(1.12); }
.terminal-ticket-direction-option:focus-visible { outline: 1px solid #e8e8e8; outline-offset: -2px; }

.terminal-ticket-spread-badge {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 50%;
  max-width: 58px;
  padding: 2px 5px;
  overflow: hidden;
  color: #d4d4d4;
  border-radius: 3px;
  background: #090909;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  pointer-events: none;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  white-space: nowrap;
}

.terminal-order-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 0;
  margin: 0 0 10px;
  border-bottom: 1px solid #454545;
}

.terminal-order-tabs button {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 0 10px 8px;
  color: #a1a1a1;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

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

.terminal-order-tabs button:hover,
.terminal-order-tabs button.is-active { color: #f0f0f0; }

.terminal-order-tabs button.is-active::after { background: #f0f0f0; }

.terminal-ticket-form { display: grid; gap: 9px; }

.terminal-ticket [hidden] { display: none !important; }

.terminal-ticket-field,
.terminal-ticket-section { display: grid; gap: 6px; }

.terminal-order-sizing {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(96px, .55fr);
  gap: 10px;
}

.terminal-exits-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.terminal-ticket-field label,
.terminal-ticket-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #c2cbc3;
  font-size: 11px;
}

.terminal-ticket-field label span { color: #9aa89d; }

.terminal-input-shell {
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid #323232;
  border-radius: 5px;
  background: #0b0b0b;
}

.terminal-input-shell.terminal-input-focused { border-color: #3b78f3; box-shadow: 0 0 0 1px rgba(59, 120, 243, .42); }

.terminal-input-shell input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: #f3f3f3;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.terminal-input-shell input:disabled { color: #626262; cursor: not-allowed; }
.terminal-input-shell input::placeholder { color: #626262; }

.terminal-input-shell > span {
  flex: 0 0 auto;
  color: #9aa69c;
  font-size: 10px;
  white-space: nowrap;
}

.terminal-input-shell > span.terminal-input-prefix {
  color: #e2e8e2;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
}

.terminal-leverage-select {
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  color: #f0f4ef;
  cursor: pointer;
  border: 1px solid #3b443d;
  border-radius: 5px;
  outline: 0;
  background: #0b0d0b;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.terminal-leverage-select:focus { border-color: var(--terminal-green); box-shadow: 0 0 0 1px rgba(8, 185, 150, .22); }
.terminal-leverage-select option { color: #f0f4ef; background: #111411; }

.terminal-exit-input { opacity: .48; }
.terminal-exit-input.is-enabled { opacity: 1; }

.terminal-switch { position: relative; display: inline-flex; width: 34px; height: 19px; flex: 0 0 34px; align-items: center; cursor: pointer; }
.terminal-switch input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; opacity: 0; }
.terminal-switch i { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border-radius: 12px; background: #4a4a4a; transition: background .16s ease; }
.terminal-switch i::after { position: absolute; top: 3px; left: 3px; display: block; width: 13px; height: 13px; margin: 0; content: ""; border-radius: 50%; background: #0e0e0e; transition: transform .16s ease; }
.terminal-switch input:checked + i { background: #2d70ec; }
.terminal-switch input:checked + i::after { transform: translateX(15px); }

.terminal-order-info {
  display: grid;
  gap: 7px;
  padding-top: 7px;
  border-top: 1px solid #393939;
}

.terminal-order-info h3 {
  margin: 0;
  color: #edf2ed;
  font-size: 12px;
}

.terminal-info-list {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 5px;
  background: #101010;
}

.terminal-info-row {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  color: #8d948f;
  font-size: 11px;
  line-height: 1.25;
}

.terminal-info-row span {
  min-width: 0;
  white-space: nowrap;
}

.terminal-info-row strong {
  overflow: hidden;
  min-width: 0;
  color: #e6ebe7;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-info-outcome {
  padding-top: 7px;
  border-top: 1px solid #262626;
}
.terminal-order-info strong.is-positive { color: var(--terminal-green); }
.terminal-order-info strong.is-negative { color: var(--terminal-red); }

.terminal-ticket-submit {
  display: grid;
  min-height: 50px;
  place-items: center;
  gap: 4px;
  margin-top: 2px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 6px;
  background: #2d67e9;
  font-weight: 700;
}

.terminal-ticket-submit:hover { background: #3a76f5; }
.terminal-ticket-submit:disabled { cursor: default; filter: saturate(.72); opacity: .78; }
.terminal-ticket-submit.is-short { background: #d73549; }
.terminal-ticket-submit.is-short:hover { background: #e84659; }
.terminal-ticket-submit span { font-size: 13px; }
.terminal-ticket-submit small { color: rgba(255, 255, 255, .78); font-size: 10px; font-weight: 500; }
.terminal-ticket-note { min-height: 14px; margin: -5px 0 0; color: #6ed5b3; font-size: 10px; text-align: center; }
.terminal-ticket-note:empty { display: none; }
.terminal-ticket-note.is-error { color: #f15a69; }
.terminal-ticket-note.is-filled { color: #62d7b4; }

.terminal-order-toast {
  position: fixed;
  z-index: 30;
  bottom: 38px;
  left: 14px;
  display: flex;
  width: min(360px, calc(100vw - 28px));
  min-height: 82px;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 38px 12px 12px;
  color: #e7e7e7;
  border: 1px solid #292929;
  border-radius: 7px;
  background: #080808;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .62);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}

.terminal-order-toast[hidden] { display: none; }
.terminal-order-toast.is-visible { opacity: 1; transform: translateY(0); }

.terminal-order-toast-check {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  color: #07130f;
  border-radius: 50%;
  background: var(--terminal-green);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.terminal-order-toast-copy { min-width: 0; }
.terminal-order-toast-copy strong,
.terminal-order-toast-copy > span,
.terminal-order-toast-copy p { display: block; }
.terminal-order-toast-copy strong { color: #f0f0f0; font-size: 12px; font-weight: 700; }
.terminal-order-toast-copy > span { margin-top: 2px; overflow: hidden; color: #999; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.terminal-order-toast-copy p { margin: 8px 0 0; color: #a9a9a9; font-size: 11px; }
.terminal-order-toast-copy p b { color: var(--terminal-green); font-weight: 700; }
.terminal-order-toast-close { position: absolute; top: 5px; right: 7px; width: 24px; height: 24px; color: #929292; cursor: pointer; font-size: 21px; line-height: 1; }
.terminal-order-toast-close:hover { color: #fff; }

@media (max-width: 820px) {
  .terminal-topbar { gap: 7px; padding-right: 6px; }
  .terminal-account-controls { display: none; }
  .terminal-symbol-control { width: min(var(--terminal-symbol-width), 145px); flex-basis: min(var(--terminal-symbol-width), 145px); }
  .terminal-market-tabs { max-width: 22vw; }
  .terminal-market-tab-main { max-width: 120px; }
  .terminal-chart-toolbar { max-width: 22vw; padding-left: 4px; }
  .terminal-chart-tool { width: 28px; justify-content: center; padding: 0; }
  .terminal-chart-tool span { display: none; }
  .terminal-position-actions { margin-left: auto; }
  .terminal-actions button { width: 27px; }
}

@media (max-width: 560px) {
  .terminal-app { grid-template-rows: 43px minmax(0, 1fr) 39px 24px; }
  .terminal-topbar { gap: 4px; padding-right: 4px; padding-left: 5px; }
  .terminal-symbol-control { width: min(var(--terminal-symbol-width), 108px); flex-basis: min(var(--terminal-symbol-width), 108px); }
  .terminal-symbol-control input { width: 59px; }
  .terminal-actions button[data-action="settings"] { display: none; }
  .terminal-market-tabs { max-width: 23vw; }
  .terminal-market-tab-icon { display: none; }
  .terminal-market-tab-main { max-width: 96px; padding-left: 6px; }
  .terminal-position-actions { gap: 2px; }
  .terminal-position { min-width: 51px; height: 28px; padding: 0 4px; }
  .terminal-position strong { font-size: 9px; }
  .terminal-toolrail { width: 82px; }
  .terminal-workspace { grid-template-columns: 82px minmax(0, 1fr); }
  .terminal-rangebar { overflow-x: auto; padding-left: 90px; scrollbar-width: none; }
  .terminal-rangebar::-webkit-scrollbar { display: none; }
  .terminal-range-spacer,
  .terminal-feed-status { display: none; }
  .terminal-statusbar { gap: 8px; padding-left: 90px; }
  .terminal-statusbar time { margin-left: auto; }
  .terminal-chart-toolbar { max-width: 23vw; }
}

@media (max-width: 380px) {
  .terminal-symbol-control { width: 95px; flex-basis: 95px; }
  .terminal-symbol-control input { width: 47px; }
  .terminal-market-tabs { max-width: 18vw; }
  .terminal-chart-toolbar { max-width: 18vw; }
  .terminal-position { min-width: 47px; }
  .terminal-actions button[data-action="screenshot"] { display: none; }
}


/* Production terminal interaction boundaries */
.terminal-position:disabled,
.terminal-side-item:disabled,
.terminal-chart-tool:disabled {
  opacity: .46;
  cursor: not-allowed;
  filter: none;
}

.terminal-position:disabled:hover,
.terminal-side-item:disabled:hover,
.terminal-chart-tool:disabled:hover {
  color: inherit;
  background: inherit;
  filter: none;
}

.terminal-side-item:disabled::before { display: none; }

.terminal-market-data-toggle { display: none; }

.terminal-drawing-layer {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.terminal-drawing-line {
  fill: none;
  stroke: #f0c75e;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  pointer-events: stroke;
  cursor: pointer;
}

.terminal-drawing-line.is-measure {
  stroke: #6bb6ff;
  stroke-dasharray: 5 4;
}

.terminal-drawing-line.is-level {
  stroke: #b08cff;
  stroke-dasharray: 4 4;
}

.terminal-drawing-line.is-selected {
  stroke: #fff;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, .55));
}

.terminal-drawing-line:focus-visible {
  outline: none;
  stroke: #fff;
  stroke-width: 3;
}

.terminal-drawing-label {
  fill: #ececec;
  paint-order: stroke;
  stroke: #080808;
  stroke-width: 4px;
  font: 600 10px/1 "Roboto Mono", ui-monospace, monospace;
  pointer-events: none;
}

.terminal-market-data {
  display: none;
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid var(--terminal-line);
  background: #0b0b0b;
}

.terminal-market-data-header {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px 6px 11px;
  border-bottom: 1px solid var(--terminal-line);
}

.terminal-market-data-header > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.terminal-market-data-header strong {
  color: #ededed;
  font-size: 11px;
}

.terminal-market-data[data-state="ready"] [data-market-data-status] { color: var(--terminal-green); border-color: rgba(8, 185, 150, .45); }
.terminal-market-data[data-state="stale"] [data-market-data-status] { color: #f0c75e; border-color: rgba(240, 199, 94, .45); }
.terminal-market-data[data-state="error"] [data-market-data-status] { color: var(--terminal-red); border-color: rgba(240, 74, 89, .45); }

.terminal-market-data-header button {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: #999;
  cursor: pointer;
  border-radius: 4px;
  font-size: 16px;
}

.terminal-market-data-header button:hover { color: #fff; background: #222; }
.terminal-market-data-header button:disabled { opacity: .45; cursor: wait; }
.terminal-market-data-close { display: none !important; }

.terminal-market-data-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 5px;
  border-bottom: 1px solid var(--terminal-line);
}

.terminal-market-data-tabs button {
  min-height: 30px;
  color: #858585;
  cursor: pointer;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 650;
}

.terminal-market-data-tabs button[aria-selected="true"] {
  color: #f0f0f0;
  background: #242424;
}

.terminal-market-panel {
  height: calc(100% - 79px);
  overflow: auto;
  padding: 8px;
}

.terminal-market-panel[hidden] { display: none; }

.terminal-market-state {
  margin: 0 0 8px;
  padding: 12px 8px;
  color: #777;
  border: 1px dashed #303030;
  border-radius: 5px;
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.terminal-market-state[hidden] { display: none; }

.terminal-book-grid {
  display: grid;
  gap: 10px;
}

.terminal-market-panel table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font: 500 10px/1.35 "Roboto Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.terminal-market-panel caption {
  padding: 3px 4px 5px;
  color: #b9b9b9;
  font-weight: 700;
  text-align: left;
}

.terminal-market-panel th,
.terminal-market-panel td {
  overflow: hidden;
  padding: 5px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .045);
  color: #a7a7a7;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-market-panel th {
  color: #666;
  font-size: 8px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.terminal-market-panel th:first-child,
.terminal-market-panel td:first-child { text-align: left; }
.terminal-market-panel .market-price.bid,
.terminal-market-panel .market-price.buy { color: var(--terminal-green); }
.terminal-market-panel .market-price.ask,
.terminal-market-panel .market-price.sell { color: var(--terminal-red); }

.terminal-market-data-tabs button:focus-visible,
.terminal-market-data-header button:focus-visible,
.terminal-market-data-toggle:focus-visible,
.terminal-position:focus-visible,
.terminal-side-item:focus-visible,
.terminal-chart-tool:focus-visible,
.terminal-rangebar button:focus-visible,
.terminal-actions button:focus-visible,
.terminal-market-tab-main:focus-visible,
.terminal-market-tab-close:focus-visible {
  outline: 2px solid var(--terminal-green);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  .terminal-workspace { grid-template-columns: 86px minmax(0, 1fr); }
  .terminal-market-data-toggle { display: inline-grid; }
  .terminal-market-data {
    position: absolute;
    z-index: 18;
    top: 8px;
    right: 8px;
    bottom: 8px;
    display: none;
    width: min(292px, calc(100% - 100px));
    border: 1px solid #343434;
    border-radius: 7px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .66);
  }
  .terminal-market-data.is-mobile-open { display: block; }
  .terminal-market-data-close { display: grid !important; }
}

@media (min-width: 1101px) {
  .terminal-workspace.is-market-panel-open {
    grid-template-columns: 86px minmax(0, 1fr) 274px;
  }

  .terminal-workspace.is-market-panel-open .terminal-market-data {
    display: block;
  }
}

@media (max-width: 560px) {
  .terminal-workspace { grid-template-columns: 82px minmax(0, 1fr); }
  .terminal-market-data {
    top: 5px;
    right: 5px;
    bottom: 5px;
    width: calc(100% - 92px);
  }
  .terminal-position:disabled strong { display: none; }
  .terminal-position:disabled { min-width: 42px; }
  .terminal-chart-toolbar { max-width: 32vw; }
  .terminal-actions { gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .terminal-drawing-line { filter: none; }
}


/* Account controls share the order book's terminal column. */
.terminal-account[hidden], .terminal-account [hidden] { display: none !important; }
.terminal-account {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--terminal-line);
  background: #0b0b0b;
  font-size: 11px;
  color: #ededed;
}
.terminal-account-view { flex: 1; min-height: 0; overflow-y: auto; padding: 0 11px; }
.terminal-account-row { padding: 13px 0; border-bottom: 1px solid var(--terminal-line); }
.terminal-account-row header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.terminal-account-market { display: flex; align-items: center; gap: 7px; min-width: 0; }
.terminal-account-market strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.terminal-account-icons { display: flex; flex-shrink: 0; }
.terminal-account-icons img { width: 21px; height: 21px; object-fit: contain; }
.terminal-account-icons img.person { object-fit: cover; border-radius: 50%; }
.terminal-account-icons img + img { margin-left: -4px; }
.terminal-account-detail { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.terminal-account-detail > span, .terminal-account-muted { color: #888; }
.terminal-account-detail strong { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.terminal-account .is-positive { color: var(--terminal-green); }
.terminal-account .is-negative { color: var(--terminal-red); }
.terminal-account-button { color: #ddd; border: 1px solid #343434; padding: 6px 9px; margin-top: 8px; cursor: pointer; background: transparent; border-radius: 3px; font-size: 11px; }
.terminal-account-button:hover { background: #222; }
.terminal-account-button:disabled { opacity: .5; cursor: wait; }
.terminal-account-empty { color: #888; padding: 17px 0; line-height: 1.5; }
.terminal-account-notice { flex-shrink: 0; color: #aaa; padding: 0 11px; font-size: 10px; }
.terminal-account-notice:empty { display: none; }
.terminal-account-settings label { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--terminal-line); }
.terminal-account-settings select { color: #ededed; background: #171717; border: 1px solid #343434; border-radius: 3px; padding: 5px; font: inherit; }
.terminal-account-settings input { accent-color: var(--terminal-green); }
.terminal-account button:focus-visible, .terminal-account select:focus-visible, .terminal-account input:focus-visible { outline: 2px solid var(--terminal-green); outline-offset: 2px; }
.terminal-reduce-motion *, .terminal-reduce-motion *::before, .terminal-reduce-motion *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
@media (min-width: 1101px) {
  .terminal-workspace.is-account-panel-open { grid-template-columns: 86px minmax(0, 1fr) 274px; }
}
@media (max-width: 1100px) {
  .terminal-account { position: absolute; z-index: 18; top: 8px; right: 8px; bottom: 8px; width: min(292px, calc(100% - 100px)); border: 1px solid #343434; border-radius: 7px; }
}
@media (max-width: 560px) {
  .terminal-account { top: 5px; right: 5px; bottom: 5px; width: calc(100% - 92px); }
}

/* Docked panels keep the chart, order ticket and account tools in separate columns. */
.terminal-workspace {--terminal-panel-width:360px;display:grid;grid-template-columns:86px minmax(0,1fr);grid-template-areas:"nav chart";min-height:0;}
.terminal-toolrail {grid-area:nav;}
.terminal-chart-shell {grid-area:chart;}
.terminal-workspace.is-account-panel-open,.terminal-workspace.is-market-panel-open {grid-template-columns:86px minmax(0,1fr) 6px var(--terminal-panel-width);grid-template-areas:"nav chart resize panel";}
.terminal-workspace.is-ticket-open {grid-template-columns:86px minmax(0,1fr) 320px;grid-template-areas:"nav chart ticket";}
.terminal-workspace.is-ticket-open.is-account-panel-open,.terminal-workspace.is-ticket-open.is-market-panel-open {grid-template-columns:86px minmax(0,1fr) 320px 6px var(--terminal-panel-width);grid-template-areas:"nav chart ticket resize panel";}
.terminal-workspace .terminal-account,.terminal-workspace .terminal-market-data {grid-area:panel;position:relative;inset:auto;width:auto;min-width:0;height:100%;max-height:none;z-index:1;border-radius:0;}
.terminal-workspace .terminal-market-data {display:none;overflow:auto;}
.terminal-workspace.is-market-panel-open .terminal-market-data {display:block;}
.terminal-workspace .terminal-ticket {grid-area:ticket;position:relative;inset:auto;width:auto;height:100%;max-height:none;transform:none;border-radius:0;border-width:0 0 0 1px;box-shadow:none;z-index:1;}
.terminal-ticket[hidden],.terminal-panel-resizer[hidden] {display:none!important;}
.terminal-panel-resizer {grid-area:resize;cursor:col-resize;touch-action:none;background:var(--terminal-line);z-index:2;}
.terminal-panel-resizer:hover,.terminal-panel-resizer:focus-visible,.terminal-panel-resizer.is-dragging {background:var(--terminal-green);outline:0;}
.terminal-profile-button {display:flex;align-items:center;gap:7px;padding:6px 8px;border:1px solid var(--terminal-line);border-radius:6px;cursor:pointer;white-space:nowrap;}
.terminal-account {font-size:12px;}
.terminal-account-settings h3 {font-size:12px;padding-top:16px;color:var(--terminal-text);}
.terminal-account-settings label {font-size:12px;align-items:center;}
.terminal-account-settings select,.terminal-account-settings input[type=number] {max-width:160px;min-width:60px;color:var(--terminal-text);background:var(--terminal-panel);border:1px solid var(--terminal-line);border-radius:4px;padding:6px;}
.terminal-account-settings input[type=number] {width:100px;}
.terminal-profile-identity {padding:18px 0;display:grid;gap:8px;overflow-wrap:anywhere;}
.terminal-profile-identity span,.terminal-account-muted {color:var(--terminal-muted);line-height:1.6;}
.terminal-profile-actions {display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px 0;}
.terminal-profile-actions button {margin:0;}
.terminal-inline-form {display:grid;gap:10px;padding:14px 0;border-bottom:1px solid var(--terminal-line);}
.terminal-inline-form label {display:grid;gap:8px;}
.terminal-inline-form select,.terminal-inline-form input,.terminal-journal-note textarea {padding:8px;border:1px solid var(--terminal-line);background:var(--terminal-panel);color:var(--terminal-text);border-radius:4px;font:inherit;min-width:0;width:100%;}
.terminal-watch-row {display:flex;align-items:center;gap:10px;padding:16px 0;border-bottom:1px solid var(--terminal-line);}
.terminal-watch-row > strong {margin-left:auto;font-variant-numeric:tabular-nums;}
.terminal-watch-row button {cursor:pointer;padding:2px;}
.terminal-watch-row .terminal-account-market {font-size:12px;}
.terminal-journal-note {display:grid;gap:8px;margin-top:12px;color:var(--terminal-muted);}
.terminal-journal-note textarea {min-height:70px;resize:vertical;}
.terminal-danger {color:var(--terminal-red);}
.terminal-ticket-review {border:1px solid var(--terminal-green);padding:12px;line-height:1.6;margin:12px 0;}
.terminal-notification {position:fixed;bottom:40px;left:100px;z-index:100;background:var(--terminal-panel);border:1px solid var(--terminal-green);border-radius:6px;max-width:min(460px,calc(100vw - 120px));padding:15px;color:var(--terminal-text);line-height:1.5;box-shadow:0 6px 30px #0005;}
[data-theme=light] {color-scheme:light;--terminal-bg:#fff;--terminal-panel:#f7f8fa;--terminal-line:#dcdfe5;--terminal-line-soft:#eee;--terminal-text:#20242c;--terminal-muted:#666;--terminal-faint:#888;}
[data-theme=light] .terminal-app,[data-theme=light] .terminal-topbar,[data-theme=light] .terminal-ticket,[data-theme=light] .terminal-account,[data-theme=light] .terminal-market-data,[data-theme=light] .terminal-rangebar,[data-theme=light] .terminal-statusbar,[data-theme=light] .terminal-toolrail {background:var(--terminal-bg);color:var(--terminal-text);}
[data-theme=light] .terminal-app input,[data-theme=light] .terminal-app select,[data-theme=light] .terminal-symbol-control,[data-theme=light] .terminal-search-dropdown {background:var(--terminal-panel);color:var(--terminal-text);}
[data-theme=light] .terminal-app strong,[data-theme=light] .terminal-app h2,[data-theme=light] .terminal-app label,[data-theme=light] .terminal-market-tab {color:var(--terminal-text);}
[data-theme=light] .terminal-app button {color:inherit;}
@media(max-width:1100px){
 .terminal-workspace.is-ticket-open.is-account-panel-open,.terminal-workspace.is-ticket-open.is-market-panel-open {grid-template-columns:72px minmax(0,1fr) 280px 6px var(--terminal-panel-width);}
 .terminal-workspace.is-ticket-open {grid-template-columns:72px minmax(0,1fr) 280px;}
}
@media(max-width:760px){
 .terminal-workspace {grid-template-columns:66px minmax(0,1fr);grid-template-areas:"nav chart";}
 .terminal-workspace.is-account-panel-open,.terminal-workspace.is-market-panel-open {grid-template-columns:66px minmax(0,1fr);grid-template-rows:minmax(120px,.6fr) minmax(0,1fr);grid-template-areas:"nav chart" "nav panel";}
 .terminal-workspace.is-ticket-open {grid-template-columns:66px minmax(0,1fr);grid-template-rows:minmax(120px,.6fr) minmax(0,1fr);grid-template-areas:"nav chart" "nav ticket";}
 .terminal-workspace.is-ticket-open.is-account-panel-open,.terminal-workspace.is-ticket-open.is-market-panel-open {grid-template-columns:66px minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(120px,.6fr) minmax(0,1fr);grid-template-areas:"nav chart chart" "nav ticket panel";}
 .terminal-panel-resizer {display:none;}
 .terminal-toolrail {width:66px;padding-left:4px;padding-right:4px;overflow-y:auto;}
 .terminal-account-view {padding:0 8px;}
 .terminal-account-settings label {align-items:start;flex-direction:column;}
 .terminal-workspace .terminal-ticket,.terminal-workspace .terminal-account,.terminal-workspace .terminal-market-data {min-width:0;padding-left:8px;padding-right:8px;border-top:1px solid var(--terminal-line);}
 .terminal-profile-actions {grid-template-columns:1fr;}
 .terminal-topbar {gap:6px;padding:0 6px;}
 .terminal-position {min-width:40px!important;}
}

.terminal-app {grid-template-rows:34px 43px minmax(0,1fr) 39px 24px;}
.terminal-platform-nav {display:flex;align-items:center;justify-content:flex-end;gap:24px;padding:0 18px;border-bottom:1px solid var(--terminal-line);font-size:12px;background:var(--terminal-bg);}
.terminal-platform-nav a {color:var(--terminal-muted);text-decoration:none;white-space:nowrap;}
.terminal-platform-nav a[aria-current],.terminal-platform-nav a:hover {color:var(--terminal-text);}
@media(max-width:760px){.terminal-platform-nav{justify-content:space-around;gap:12px;padding:0 10px;}}

.terminal-app {overflow:hidden;}
.terminal-chart-shell {min-width:0;overflow:hidden;}

/* The order ticket is the reference for every terminal panel. */
.terminal-app {grid-template-rows:56px minmax(0,1fr) 39px 24px;}
.terminal-topbar {gap:12px;}
.terminal-account-controls {display:flex;align-items:center;gap:14px;margin-left:auto;flex-shrink:0;}
.terminal-balance-pill {display:flex;align-items:center;gap:10px;padding:8px 12px 8px 16px;border:1px solid #303030;border-radius:24px;white-space:nowrap;font-size:13px;font-weight:600;font-variant-numeric:tabular-nums;}
.terminal-balance-pill button {display:grid;place-items:center;width:24px;height:24px;color:var(--terminal-muted);cursor:pointer;}
.terminal-balance-pill svg {width:20px;height:20px;}
.privacy-slash {display:none;}
.is-private .privacy-slash {display:block;}
.terminal-profile-button {display:flex;flex-direction:column;gap:1px;padding:0;border:0;background:transparent;min-width:44px;}
.terminal-profile-avatar,.terminal-account-avatar {display:grid;place-items:center;background:#252525;color:#bdbdbd;border-radius:50%;width:40px;height:40px;overflow:hidden;}
.terminal-profile-avatar svg {width:25px;height:25px;}
.terminal-profile-button small {font-size:9px;font-weight:400;color:var(--terminal-faint);line-height:1;}
.terminal-profile-button small[hidden] {display:none;}
.terminal-market-tab-main {max-width:none;min-height:40px;gap:10px;padding:3px 9px;}
.terminal-market-tab-symbol,.terminal-search-result-copy strong {overflow:visible;text-overflow:clip;white-space:nowrap;}
.terminal-search-result {gap:14px;min-height:68px;}
.terminal-search-result-copy strong {font:600 14px/1.3 'Mona Sans',sans-serif;}
.terminal-search-result-copy small {font-size:12px;}
.terminal-ticket-identity,.terminal-chart-identity {width:auto;flex:0 0 auto;overflow:visible;}
.terminal-ticket-identity.is-pair,.terminal-chart-identity.is-pair {width:auto;flex-basis:auto;}
.terminal-ticket-header h2 {overflow:visible;text-overflow:clip;font-size:15px;gap:12px;}
.terminal-ticket-header h2 > [data-ticket-symbol] {white-space:nowrap;}
.terminal-account {background:var(--terminal-bg);font-size:13px;}
.terminal-account-view {padding:0 18px 18px;}
.terminal-account .terminal-market-data-header {padding:16px 18px;min-height:58px;}
.terminal-account .terminal-market-data-header > strong {font-size:15px;font-weight:600;}
.terminal-account-row {padding:20px 0;border-bottom:1px solid var(--terminal-line);}
.terminal-account-row header {margin:0 0 16px;align-items:center;gap:12px;}
.terminal-account-market {gap:12px;}
.terminal-account-market-copy {display:flex;min-width:0;flex-direction:column;gap:5px;}
.terminal-account-market-copy strong {font-size:15px;overflow:visible;text-overflow:clip;white-space:nowrap;font-weight:600;}
.terminal-account-market-copy small {font-size:11px;color:var(--terminal-muted);line-height:1.4;}
.terminal-account-detail {padding:7px 0;font-size:12px;line-height:1.5;}
.terminal-account-detail strong {font-weight:500;}
.terminal-direction-tag,.terminal-state-tag {padding:4px 7px;font-size:11px;border-radius:4px;background:var(--terminal-line-soft);white-space:nowrap;}
.terminal-account-button {display:inline-flex;align-items:center;justify-content:center;gap:9px;padding:11px 14px;border:1px solid var(--terminal-line);border-radius:6px;font-size:12px;line-height:1.4;font-weight:500;margin-top:12px;color:var(--terminal-text);}
.terminal-account-button:hover {background:var(--terminal-line-soft);}
.terminal-account-button:disabled {opacity:.4;cursor:not-allowed;}
.terminal-primary-button {width:100%;background:var(--terminal-text);color:var(--terminal-bg);border-color:transparent;font-weight:600;}
.terminal-primary-button:hover {opacity:.9;background:var(--terminal-text);}
.terminal-account-row > [data-account-close],.terminal-account-row > [data-account-cancel],.terminal-alert-row > button {width:100%;}
.terminal-account-muted {font-size:11px;color:var(--terminal-muted);line-height:1.6;margin:16px 0;}
.terminal-account-empty {padding:24px 0;font-size:12px;color:var(--terminal-muted);}
.terminal-account-notice {padding:0 18px;font-size:11px;line-height:1.5;}
.terminal-profile-identity {display:flex;gap:14px;align-items:center;padding:24px 0 16px;}
.terminal-account-avatar {width:52px;height:52px;flex:0 0 52px;}
.terminal-account-avatar svg {width:32px;height:32px;}
.terminal-profile-identity > div {display:flex;min-width:0;flex-direction:column;gap:7px;}
.terminal-profile-identity strong {font-size:16px;font-weight:600;}
.terminal-profile-identity span {font-size:11px;}
.terminal-section-eyebrow {font-size:11px;color:var(--terminal-muted);margin:0 0 10px;}
.terminal-balance-summary {padding:24px 0;}
.terminal-balance-amount {font-size:32px;font-weight:600;letter-spacing:-.04em;line-height:1.3;font-variant-numeric:tabular-nums;}
.terminal-balance-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 16px;margin-top:24px;}
.terminal-balance-grid .terminal-account-detail {display:flex;flex-direction:column;gap:7px;padding:0;align-items:flex-start;}
.terminal-balance-grid .terminal-account-detail > span {font-size:11px;}
.terminal-balance-grid .terminal-account-detail strong {font-size:14px;text-align:left;}
.terminal-funding-actions {display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:8px 0 16px;}
.terminal-funding-actions svg {width:18px;height:18px;}
.terminal-profile-links {display:flex;flex-direction:column;}
.terminal-profile-links button {display:flex;align-items:center;gap:14px;width:100%;padding:16px 0;border-bottom:1px solid var(--terminal-line-soft);text-align:left;font-size:13px;cursor:pointer;}
.terminal-profile-links svg {width:19px;height:19px;color:var(--terminal-muted);}
.terminal-profile-links button > b {margin-left:auto;color:var(--terminal-muted);font-size:20px;font-weight:400;}
.terminal-profile-links button:disabled {opacity:.4;cursor:not-allowed;}
.terminal-profile-links button:hover:not(:disabled) {color:#fff;}
.terminal-portfolio-links {display:grid;gap:10px;padding:12px 0;}
.terminal-portfolio-links button {justify-content:space-between;}
.terminal-account-settings label {padding:16px 0;gap:12px;font-size:12px;}
.terminal-account-settings select,.terminal-alert-fields select {max-width:170px;min-width:0;height:38px;padding:8px 10px;background:var(--terminal-panel);border:1px solid var(--terminal-line);border-radius:6px;font:500 12px 'Mona Sans',sans-serif;color:var(--terminal-text);}
.terminal-settings-tabs {display:flex;gap:2px;overflow:auto;padding:14px 0 0;border-bottom:1px solid var(--terminal-line);scrollbar-width:thin;}
.terminal-settings-tabs button {padding:12px 7px;white-space:nowrap;font-size:11px;font-weight:500;border-bottom:2px solid transparent;color:var(--terminal-muted);cursor:pointer;}
.terminal-settings-tabs button[aria-selected=true] {border-color:var(--terminal-text);color:var(--terminal-text);}
.terminal-account-settings h3 {font-size:15px;font-weight:600;margin:24px 0 6px;padding:0;}
.terminal-setting-row .terminal-input-shell {width:105px;min-width:0;height:38px;}
.terminal-setting-row .terminal-input-shell input[type=number] {border:0;width:100%;max-width:none;background:transparent;padding:8px;font-size:12px;}
.terminal-setting-row .terminal-switch {width:32px;height:18px;flex:0 0 32px;}
.terminal-setting-row .terminal-switch input {margin:0;}
.terminal-danger {color:var(--terminal-red);}
.terminal-picker {position:relative;min-width:0;}
.terminal-picker-trigger {display:flex;align-items:center;gap:12px;width:100%;min-height:66px;padding:10px 12px;border:1px solid var(--terminal-line);border-radius:8px;background:var(--terminal-panel);text-align:left;cursor:pointer;}
.terminal-picker-trigger > b {margin-left:auto;color:var(--terminal-muted);font-weight:400;}
.terminal-picker-copy {display:flex;min-width:0;flex:1;flex-direction:column;gap:5px;}
.terminal-picker-copy strong {font-size:13px;font-weight:600;white-space:nowrap;}
.terminal-picker-copy small {font-size:11px;line-height:1.4;color:var(--terminal-muted);}
.terminal-picker-popup {position:absolute;inset:calc(100% + 6px) 0 auto;z-index:10;border:1px solid var(--terminal-line);border-radius:8px;background:var(--terminal-panel);box-shadow:0 12px 28px #0005;overflow:hidden;}
.terminal-picker-popup > input {width:100%;height:42px;padding:12px;border:0;border-bottom:1px solid var(--terminal-line);background:transparent;color:var(--terminal-text);outline-offset:-2px;font-size:12px;}
.terminal-picker-popup > [data-picker-results] {max-height:260px;overflow:auto;padding:5px;}
.terminal-picker-option {display:flex;align-items:center;gap:12px;width:100%;padding:10px 7px;min-height:62px;text-align:left;cursor:pointer;border-radius:5px;}
.terminal-picker-option:hover,.terminal-picker-option:focus-visible,.terminal-picker-option[aria-selected=true] {background:var(--terminal-line-soft);}
.terminal-watch-add {display:grid;grid-template-columns:minmax(0,1fr) 42px;gap:10px;padding:20px 0;align-items:center;}
.terminal-watch-add-button {display:grid;place-items:center;cursor:pointer;border:1px solid var(--terminal-line);border-radius:7px;width:42px;height:42px;font-size:22px;color:var(--terminal-muted);}
.terminal-watch-head {display:flex;justify-content:space-between;padding:8px 24px 12px 0;color:var(--terminal-faint);font-size:10px;border-bottom:1px solid var(--terminal-line);}
.terminal-watch-row {padding:18px 0;gap:12px;min-height:78px;}
.terminal-watch-row > button:first-child {text-align:left;min-width:0;}
.terminal-watch-row > strong {font-size:13px;font-weight:500;white-space:nowrap;}
.terminal-account-icon-button {font-size:18px;color:var(--terminal-faint);}
.terminal-alert-form {padding:20px 0;display:grid;gap:12px;}
.terminal-field-label,.terminal-alert-fields label > span {color:var(--terminal-muted);font-size:11px;}
.terminal-alert-fields {display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:5px 0;}
.terminal-alert-fields label {display:flex;flex-direction:column;gap:10px;min-width:0;}
.terminal-alert-fields select,.terminal-alert-fields .terminal-input-shell {width:100%;height:40px;max-width:none;}
.terminal-alert-fields input {width:100%;min-width:0;padding:10px;background:transparent;border:0;color:var(--terminal-text);font-size:13px;}
.terminal-list-heading {display:flex;justify-content:space-between;align-items:center;padding:18px 0 12px;border-top:1px solid var(--terminal-line);font-size:12px;font-weight:500;}
.terminal-list-heading small {font-size:10px;color:var(--terminal-faint);}
.terminal-alert-target {display:flex;justify-content:space-between;padding:7px 0;color:var(--terminal-muted);font-size:12px;}
.terminal-alert-target strong {color:var(--terminal-text);font-weight:500;font-variant-numeric:tabular-nums;}
.terminal-journal-note {padding-top:10px;font-size:11px;}
.terminal-journal-note textarea {background:var(--terminal-panel);border-radius:6px;padding:12px;line-height:1.6;font-size:12px;min-height:90px;}
[data-theme=light] .terminal-profile-links button:hover:not(:disabled) {color:var(--terminal-text);}
[data-theme=light] .terminal-side-item.is-active,
[data-theme=light] .terminal-rangebar button.is-active,
[data-theme=light] .terminal-chart-tool.is-active {color:#fff;}
[data-theme=light] .terminal-order-tabs button.is-active {color:var(--terminal-text);}
[data-theme=light] .terminal-order-tabs button.is-active::after {background:var(--terminal-text);}
@media(max-width:1100px){.terminal-topbar{gap:8px;}.terminal-balance-pill{padding:7px 9px;font-size:11px;}.terminal-account-controls{gap:8px;}}
@media(max-width:760px){
 .terminal-app{grid-template-rows:128px minmax(0,1fr) 39px 24px;}
 .terminal-topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:48px 40px 28px;padding:4px 8px;gap:3px 10px;}
 .terminal-symbol-control{grid-column:1;grid-row:1;width:100%;max-width:250px;min-width:0;}
 .terminal-symbol-control input{width:100%;font-size:11px;}
 .terminal-account-controls{grid-column:2;grid-row:1;gap:8px;}
 .terminal-market-tabs{grid-column:1;grid-row:2;width:100%;max-width:100%;}
 .terminal-market-tab-main{max-width:none;padding:3px 7px;}
 .terminal-market-tab-icon{display:inline-flex;}
 .terminal-position-actions{grid-column:2;grid-row:2;margin:0;justify-content:flex-end;}
 .terminal-position{min-width:64px!important;height:34px;}
 .terminal-chart-toolbar{grid-column:1;grid-row:3;max-width:100%;padding:0;height:28px;overflow:auto;border:0;}
 .terminal-actions{grid-column:2;grid-row:3;justify-content:flex-end;}
 .terminal-account-view{padding:0 12px 12px;}
 .terminal-setting-row{flex-direction:row!important;align-items:center!important;}
 .terminal-balance-amount{font-size:28px;}
}
@media(max-width:480px){
 .terminal-workspace.is-ticket-open.is-account-panel-open,.terminal-workspace.is-ticket-open.is-market-panel-open{grid-template-columns:66px minmax(0,1fr);grid-template-rows:140px minmax(280px,1fr) minmax(280px,1fr);grid-template-areas:"nav chart" "nav ticket" "nav panel";overflow-y:auto;}
 .terminal-balance-pill{font-size:11px;gap:6px;padding:7px 9px;}
 .terminal-profile-avatar{width:36px;height:36px;}
 .terminal-profile-button{min-width:36px;}
}
