/* Futures trade UI */
:root {
	--fx-bg: #0b0e11;
	--fx-card: #0b0e11;
	--fx-panel: #121519;
	--fx-secondary: #1e2329;
	--fx-fg: #eaecef;
	--fx-muted: #848e9c;
	--fx-primary: #a855f7;
	--fx-border: #2b3139;
	--fx-long: #0ecb81;
	--fx-long-btn: #20b26c;
	--fx-short: #f6465d;
	--fx-short-btn: #ef454a;
	--fx-mark: #f0b90b;
	--fx-header: 64px;
}

body:not(.dark) {
	--fx-bg: #f8fafc;
	--fx-card: #ffffff;
	--fx-panel: #ffffff;
	--fx-secondary: #e2e8f0;
	--fx-fg: #0f172a;
	--fx-muted: #64748b;
	--fx-border: #e2e8f0;
}

body.futures-page {
	background: var(--fx-bg) !important;
	color: var(--fx-fg) !important;
	padding-top: var(--fx-header) !important;
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Noto Sans KR", sans-serif;
	font-size: 13px;
	line-height: 1.45;
}

body.futures-page .ety-main,
body.futures-page .ft_content,
body.futures-page .container.ft_content,
body.futures-page footer,
body.futures-page #check {
	display: none !important;
	height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
}

.fx-section {
	padding: 8px;
	background: var(--fx-bg);
	min-height: calc(100vh - var(--fx-header));
}
@media (max-width: 767px) {
	body.futures-page .fx-section {
		padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
	}
	body.futures-page.fx-trade-sheet-open { overflow: hidden; }
}

.fx-grid {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 4px;
}

.fx-card {
	background: var(--fx-card);
	border: 1px solid var(--fx-border);
	border-radius: 4px;
	color: var(--fx-fg);
	overflow: hidden;
}

/* ticker — TradingView Ticker Tape */
.fx-ticker-bar {
	grid-column: 1 / -1;
	display: none;
	min-height: 46px;
	height: 46px;
	padding: 0;
	border: none;
	border-radius: 4px;
	background: #0b0e11;
	overflow: hidden;
}
body:not(.dark) .fx-ticker-bar {
	background: #ffffff;
}
@media (min-width: 768px) { .fx-ticker-bar { display: block; grid-column: 1 / 10; } }
@media (min-width: 1536px) { .fx-ticker-bar { grid-column: 1 / -1; } }

.fx-tv-ticker {
	width: 100%;
	height: 46px;
	overflow: hidden;
	background: inherit;
}

.fx-tv-ticker .tradingview-widget-container__widget,
.fx-tv-ticker iframe {
	width: 100% !important;
	height: 46px !important;
	background: inherit !important;
}

.fx-tv-ticker .tradingview-widget-copyright {
	display: none !important;
}

.fx-card.fx-pair-bar {
	overflow: visible;
}
.fx-pair-bar {
	grid-column: 1 / -1;
	position: relative;
	z-index: 500;
}
@media (min-width: 768px) { .fx-pair-bar { grid-column: 1 / 10; } }
@media (min-width: 1536px) { .fx-pair-bar { grid-column: 1 / -1; } }

.fx-pair-content {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	padding: 10px 12px;
	overflow: visible;
}

.fx-pair-left { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }

.fx-coin-picker { position: relative; z-index: 501; }
.fx-coin-btn {
	display: flex; align-items: center; gap: 8px;
	width: 200px; padding: 6px 10px;
	background: transparent; border: 1px solid var(--fx-border); border-radius: 4px;
	color: var(--fx-fg); font-size: 14px; font-weight: 600; cursor: pointer;
}
.fx-coin-btn img { width: 22px; height: 22px; border-radius: 50%; }
.fx-coin-btn svg { margin-left: auto; }

.fx-coin-menu {
	display: none; position: absolute; top: calc(100% + 4px); left: 0;
	width: 200px; background: var(--fx-secondary); border: 1px solid var(--fx-border);
	border-radius: 4px; z-index: 10050; box-shadow: 0 4px 20px rgba(0,0,0,.5);
	overflow-x: hidden;
}
.fx-coin-menu.open { display: block; }
.fx-coin-menu > input {
	width: 100%; box-sizing: border-box; background: transparent;
	border: 0; border-bottom: 1px solid var(--fx-border);
	color: var(--fx-fg); padding: 10px 12px; font-size: 12px; outline: none;
}
.fx-coin-menu-list { max-height: 240px; overflow-y: auto; overflow-x: hidden; }
.fx-coin-opt {
	display: flex; align-items: center; gap: 8px;
	padding: 8px 12px; cursor: pointer; font-size: 12px;
	min-width: 0;
}
.fx-coin-opt:hover, .fx-coin-opt.active { background: rgba(255,255,255,.05); }
.fx-coin-opt img { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }
.fx-coin-opt > span:not(.pr) {
	min-width: 0;
	flex: 1 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.fx-coin-opt .pr { margin-left: auto; color: var(--fx-muted); flex-shrink: 0; white-space: nowrap; }

.fx-live-price { font-size: 20px; font-weight: 700; margin: 0; }
.fx-live-price.up { color: var(--fx-long); }
.fx-live-price.dn { color: var(--fx-short); }

.fx-pair-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; flex: 1; }
.fx-stat { min-width: 72px; }
.fx-stat-wide { min-width: 120px; }
.fx-stat-k { display: block; font-size: 11px; color: var(--fx-muted); }
.fx-stat-v { display: block; font-size: 12px; font-weight: 600; color: var(--fx-fg); }
.fx-stat-v.up { color: var(--fx-long); }
.fx-stat-v.dn { color: var(--fx-short); }

.fx-guide-btn {
	display: inline-flex; align-items: center; gap: 4px;
	margin-left: auto; padding: 6px 10px;
	background: var(--fx-secondary); border: 1px solid var(--fx-border); border-radius: 4px;
	color: var(--fx-muted); font-size: 12px; text-decoration: none; white-space: nowrap;
}
.fx-guide-btn:hover { color: var(--fx-fg); }

/* mobile main */
.fx-mobile-main { grid-column: 1 / -1; }
@media (min-width: 768px) { .fx-mobile-main { grid-column: 1 / 9; } }
@media (min-width: 1280px) { .fx-mobile-main { display: none; } }

.fx-mtabs {
	display: flex; height: 28px; margin-bottom: 4px;
	background: var(--fx-secondary); border-radius: 4px; padding: 2px;
}
.fx-mtab {
	flex: 1; border: 0; background: transparent; color: var(--fx-muted);
	font-size: 12px; border-radius: 3px; cursor: pointer;
}
.fx-mtab.active { background: var(--fx-secondary); color: var(--fx-fg); font-weight: 600; }
.fx-mpane { display: none; }
.fx-mpane.active { display: block; }

/* chart ??keep below pair-bar coin dropdown */
.fx-chart-box {
	display: flex; flex-direction: column;
	min-height: 50vh; border: 1px solid var(--fx-border);
	position: relative;
	z-index: 1;
}
@media (min-width: 768px) { .fx-chart-box { min-height: 580px; } }

.fx-desk-chart { display: none; }
@media (min-width: 1280px) {
	.fx-desk-chart { display: flex; grid-column: 1 / 8; min-height: 580px; }
}
@media (min-width: 1536px) { .fx-desk-chart { grid-column: 1 / 9; } }

.fx-chart-frame { flex: 1; position: relative; min-height: 400px; }
.fx-chart-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* order book */
.fx-ob-box {
	display: flex; flex-direction: column;
	min-height: 50vh; border: 1px solid var(--fx-border);
	background: var(--fx-card); overflow: hidden;
}
@media (min-width: 768px) { .fx-ob-box { min-height: 580px; } }

.fx-desk-ob { display: none; }
@media (min-width: 1280px) {
	.fx-desk-ob { display: flex; grid-column: 8 / 10; min-height: 580px; }
}
@media (min-width: 1536px) { .fx-desk-ob { grid-column: 9 / 11; } }

.fx-ob-head {
	display: grid; grid-template-columns: 1fr 1fr 1fr;
	padding: 12px 16px; font-size: 12px; font-weight: 500;
	text-transform: uppercase; letter-spacing: 0.05em;
	color: var(--fx-fg); opacity: 0.7;
	border-bottom: 1px solid rgba(30, 41, 59, 0.5);
	flex-shrink: 0;
}
.fx-ob-head span:nth-child(2) { text-align: center; }
.fx-ob-head span:nth-child(3) { text-align: right; }

.fx-orderbook {
	flex: 1; display: flex; flex-direction: column;
	min-height: 0; overflow: hidden;
}
.fx-ob-scroll {
	flex: 1; display: flex; flex-direction: column;
	min-height: 0; overflow-y: auto;
	-ms-overflow-style: none; scrollbar-width: none;
}
.fx-ob-scroll::-webkit-scrollbar { display: none; }

.fx-ob-side { position: relative; min-height: 225px; }
.fx-ob-asks { display: flex; flex-direction: column; justify-content: flex-end; }
.fx-ob-bids { display: flex; flex-direction: column; justify-content: flex-start; }

.fx-ob-row {
	position: relative; display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	padding: 4px 16px; cursor: pointer; line-height: 16px;
	font-size: 12px; font-variant-numeric: tabular-nums;
	transition: background-color 0.15s ease;
}
.fx-ob-row.ask:hover { background: rgba(239, 68, 68, 0.2); }
.fx-ob-row.bid:hover { background: rgba(16, 185, 129, 0.2); }
.fx-ob-row .bar {
	position: absolute; right: 0; top: 0; bottom: 0;
	height: 90%; margin: auto 0;
	pointer-events: none; transition: width 0.3s ease;
}
.fx-ob-row.ask .bar { background: rgba(239, 68, 68, 0.1); }
.fx-ob-row.bid .bar { background: rgba(16, 185, 129, 0.1); }
.fx-ob-row span { position: relative; z-index: 1; }
.fx-ob-row .a,
.fx-ob-row .t { color: var(--fx-fg); opacity: 0.7; font-weight: 400; }
.fx-ob-row .a { text-align: center; }
.fx-ob-row .t { text-align: right; }
.fx-ob-row.ask .p { color: #f87171; font-weight: 400; text-align: left; }
.fx-ob-row.bid .p { color: #34d399; font-weight: 400; text-align: left; }

.fx-ob-mid {
	display: flex; align-items: center; justify-content: space-between;
	padding: 4px 16px; background: var(--fx-card); flex-shrink: 0;
}
.fx-ob-mid-last {
	display: flex; align-items: center; gap: 4px;
	margin: 0; font-size: 12px; font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.fx-ob-mid-last.up { color: #10b981; }
.fx-ob-mid-last.dn { color: #ef4444; }
.fx-ob-mid-arrow { flex-shrink: 0; }
.fx-ob-mid-mark {
	display: flex; align-items: center; gap: 4px;
	margin: 0; font-size: 12px; font-weight: 400; color: #f59e0b;
	font-variant-numeric: tabular-nums;
}
.fx-ob-mid-flag { fill: #f59e0b; flex-shrink: 0; }

.fx-ob-ratio {
	display: flex; align-items: stretch; height: 24px;
	margin: 4px 8px 8px; flex-shrink: 0;
}
.fx-ob-ratio-tag {
	display: flex; align-items: center; justify-content: center;
	padding: 0 8px; font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.fx-ob-ratio-tag-b {
	color: #34d399; background: rgba(16, 185, 129, 0.1);
	border: 1px solid rgba(16, 185, 129, 0.4); border-radius: 4px 0 0 4px;
}
.fx-ob-ratio-tag-s {
	color: #f87171; background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.4); border-radius: 0 4px 4px 0;
}
.fx-ob-ratio-pct {
	display: flex; align-items: center; width: 48px; flex-shrink: 0;
	font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.fx-ob-ratio-pct-b {
	justify-content: flex-start; padding-left: 4px;
	color: #34d399; background: rgba(16, 185, 129, 0.2);
}
.fx-ob-ratio-pct-s {
	justify-content: flex-end; padding-right: 4px;
	color: #f87171; background: rgba(239, 68, 68, 0.2);
}
.fx-ob-ratio-fill { height: 100%; transition: flex-grow 0.5s ease; min-width: 0; }
.fx-ob-ratio-fill-b { background: rgba(16, 185, 129, 0.2); margin-right: 1px; }
.fx-ob-ratio-fill-s { background: rgba(239, 68, 68, 0.2); margin-left: 1px; }
.fx-ob-ratio-track {
	flex: 1; display: flex; align-items: stretch;
	height: 100%; min-width: 0;
}

/* order panel */
.fx-order-anchor {
	grid-column: 1 / -1;
}
@media (min-width: 768px) {
	.fx-order-anchor { grid-column: 9 / -1; grid-row: 3; }
}
@media (min-width: 1280px) {
	.fx-order-anchor { grid-column: 10 / -1; grid-row: 1 / 4; }
}
@media (min-width: 1536px) {
	.fx-order-anchor { grid-column: 11 / -1; grid-row: 3; }
}

.fx-order-panel {
	display: none; flex-direction: column;
	padding: 12px; border: 1px solid var(--fx-border); background: var(--fx-bg);
}
@media (min-width: 768px) {
	.fx-order-panel { display: flex; }
}
@media (min-width: 1280px) {
	.fx-order-anchor .fx-order-panel {
		max-height: calc(100vh - var(--fx-header) - 16px); overflow-y: auto;
	}
}
@media (max-width: 767px) {
	.fx-order-anchor .fx-order-panel { display: none !important; }
	#fxOrderDrawerContent .fx-order-panel {
		display: flex !important;
		flex-direction: column;
		border: 0;
		background: transparent;
		padding: 0 0 8px;
	}
}

.fx-op-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fx-op-mode, .fx-op-lev {
	display: inline-flex; align-items: center; gap: 4px;
	background: none; border: 0; font-size: 13px; font-weight: 600;
	cursor: pointer; padding: 0; color: var(--fx-fg);
}
.fx-op-lev { color: var(--fx-primary); }
.fx-op-lev strong { font-weight: 700; }

.fx-op-tabs { display: flex; gap: 16px; border-bottom: 1px solid var(--fx-border); margin-bottom: 12px; }
.fx-op-tab {
	position: relative; background: none; border: 0;
	color: var(--fx-muted); font-size: 13px; padding: 0 0 8px; cursor: pointer;
}
.fx-op-tab.active { color: var(--fx-fg); font-weight: 600; }
.fx-op-tab.active::after {
	content: ''; position: absolute; bottom: 0; left: 0;
	width: 100%; height: 2px; background: var(--fx-fg);
}

.fx-op-form { display: flex; flex-direction: column; gap: 10px; }

.fx-op-type-select {
	display: flex; align-items: center; justify-content: space-between;
	width: 100%; box-sizing: border-box;
	background: var(--fx-secondary); border: 1px solid var(--fx-border);
	border-radius: 6px; color: var(--fx-fg); padding: 10px 12px;
	font-size: 12px; cursor: pointer; text-align: left;
}
.fx-op-type-select svg { opacity: .6; flex-shrink: 0; }

.fx-op-input-wrap { position: relative; }
.fx-op-input-wrap input {
	width: 100%; box-sizing: border-box;
	background: var(--fx-secondary); border: 1px solid var(--fx-border);
	border-radius: 6px; color: var(--fx-fg); padding: 10px 12px; font-size: 13px; outline: none;
}
.fx-op-cost-wrap {
	position: relative;
}
.fx-op-cost-wrap input {
	width: 100%; box-sizing: border-box;
	background: var(--fx-secondary); border: 1px solid var(--fx-border);
	border-radius: 6px; color: var(--fx-fg); padding: 10px 72px 10px 12px; font-size: 13px; outline: none;
}
.fx-op-cost-wrap input::placeholder { color: var(--fx-muted); }
.fx-op-cost-suffix {
	position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
	color: var(--fx-muted); font-size: 13px; pointer-events: none;
}
.fx-op-last {
	position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
	background: none; border: 0; color: #f0b90b; font-size: 12px; cursor: pointer;
}

.fx-op-slider { margin-top: 2px; }
.fx-op-slider input[type=range] {
	width: 100%; accent-color: var(--fx-fg); height: 2px;
	-webkit-appearance: none; appearance: none; background: var(--fx-border);
	border-radius: 2px; outline: none;
}
.fx-op-slider input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none; width: 14px; height: 14px;
	border-radius: 50%; background: var(--fx-fg); border: 2px solid var(--fx-panel); cursor: pointer;
}
.fx-op-slider-labels {
	display: flex; justify-content: space-between;
	font-size: 10px; color: var(--fx-muted); margin-top: 4px;
}

.fx-op-summary {
	font-size: 12px; padding: 0;
}
.fx-op-sum-row { display: flex; justify-content: space-between; padding: 4px 0; color: var(--fx-muted); }
.fx-op-sum-row .fx-sum-val { font-weight: 500; }
.fx-op-sum-row .fx-sum-val .up { color: var(--fx-long) !important; }
.fx-op-sum-row .fx-sum-val .dn { color: var(--fx-short) !important; }
.fx-op-sum-row .fx-sum-val em { font-style: normal; color: inherit; }
.fx-op-cost-suffix { color: var(--fx-muted); font-size: 13px; }

.fx-op-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.fx-btn-long, .fx-btn-short {
	border: 0; border-radius: 999px; padding: 12px 8px;
	font-size: 13px; font-weight: 600; color: #fff; cursor: pointer;
}
.fx-btn-long { background: var(--fx-long-btn); }
.fx-btn-long:hover { filter: brightness(1.08); }
.fx-btn-short { background: var(--fx-short-btn); }
.fx-btn-short:hover { filter: brightness(1.08); }

.fx-op-assets { font-size: 11px; color: var(--fx-muted); border-top: 1px solid var(--fx-border); padding-top: 10px; margin-top: 4px; }
.fx-op-assets-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; gap: 8px; }
.fx-op-assets-row span:first-child { flex-shrink: 0; }
.fx-op-assets-row span:last-child { color: var(--fx-fg); font-weight: 500; text-align: right; white-space: nowrap; }
.fx-op-assets-head span:first-child { font-size: 12px; font-weight: 600; color: var(--fx-fg); }
.fx-op-assets .fx-pnl-val.up { color: var(--fx-long) !important; }
.fx-op-assets .fx-pnl-val.dn { color: var(--fx-short) !important; }

.fx-op-wallet-btns { display: flex; flex-direction: column; gap: 8px; }
.fx-wallet-btn {
	display: block; text-align: center; padding: 11px;
	background: var(--fx-secondary); border: 1px solid var(--fx-border);
	border-radius: 999px; color: var(--fx-fg); font-size: 13px; font-weight: 500; text-decoration: none;
}
.fx-wallet-btn:hover { background: #252930; color: var(--fx-fg); }

.fx-mobile-trade {
	display: none;
}
@media (max-width: 767px) {
	.fx-mobile-trade {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 8px;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 1100;
		padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
		background: var(--fx-bg);
		border-top: 1px solid var(--fx-border);
		box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
	}
	.fx-mobile-trade .fx-btn-long,
	.fx-mobile-trade .fx-btn-short {
		min-height: 48px;
		padding: 14px 10px;
		font-size: 14px;
		font-weight: 600;
	}
}

/* bottom panel — tabs + data table */
.fx-table-panel {
	grid-column: 1 / -1;
	border: 1px solid var(--fx-border);
	border-radius: 8px;
	background: var(--fx-panel);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	overflow: hidden;
}
.fx-table-inner { padding: 12px; overflow: visible; }

body.futures-page .fx-table-panel button {
	-webkit-appearance: none;
	appearance: none;
	font-family: inherit;
}
body.futures-page .fx-ttab,
body.futures-page .fx-sub-tabs .fx-stab {
	-webkit-appearance: none;
	appearance: none;
}

.fx-table-tabs {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px;
	padding: 0;
	border: none;
	background: transparent;
	overflow-x: auto;
	overflow-y: hidden;
}
.fx-ttab {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--fx-panel);
	border: none;
	border-radius: 4px;
	color: var(--fx-muted);
	padding: 6px 12px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	cursor: pointer;
	white-space: nowrap;
	transition: background .15s, color .15s;
}
.fx-ttab:hover { color: var(--fx-fg); }
.fx-ttab:focus,
.fx-ttab:focus-visible,
.fx-ttab:active {
	outline: none !important;
	box-shadow: none !important;
}
.fx-ttab.active {
	color: var(--fx-fg);
	background: var(--fx-bg);
}
.fx-ttab-ic {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	opacity: .65;
	filter: brightness(0) invert(1);
}
.fx-ttab:hover .fx-ttab-ic,
.fx-ttab.active .fx-ttab-ic { opacity: 1; }

/* mobile bottom panel — card tabs + card list */
.fx-mtab-title {
	display: none;
	margin: 0;
	padding: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--fx-primary);
}
.fx-mcard-list { display: none; margin-top: 16px; min-width: 0; max-width: 100%; }
.fx-mcard {
	margin-bottom: 16px;
	padding: 16px;
	border: 1px solid var(--fx-border);
	border-radius: 8px;
	background: var(--fx-bg);
	overflow: hidden;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}
.fx-mcard-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 8px;
	align-items: start;
	padding: 8px 0;
	border-bottom: 1px solid var(--fx-border);
	min-width: 0;
}
.fx-mcard-row:last-child { border-bottom: 0; padding-bottom: 0; }
.fx-mcard-row:first-child { padding-top: 0; }
.fx-mcard-l {
	min-width: 0;
	font-size: 12px;
	line-height: 1.45;
	color: var(--fx-muted);
}
.fx-mcard-v {
	min-width: 0;
	font-size: 12px;
	line-height: 1.45;
	color: var(--fx-fg);
	word-break: break-word;
	overflow-wrap: anywhere;
}
.fx-mcard-v .fx-pos-contract { min-width: 0; max-width: 100%; flex-wrap: wrap; }
.fx-mcard-v .fx-pos-pnl-wrap,
.fx-mcard-v .fx-pos-tpsl {
	min-width: 0;
	max-width: 100%;
	flex-wrap: wrap;
}
.fx-mcard-v .fx-pos-stack,
.fx-mcard-v .fx-pos-pnl-stack,
.fx-mcard-v .fx-pos-tpsl-stack,
.fx-mcard-v .fx-pos-name,
.fx-mcard-v .fx-pos-name-row {
	white-space: normal;
	word-break: break-word;
}
.fx-mcard-v .fx-pos-close-btns { flex-wrap: wrap; }
.fx-mempty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 40px 16px;
	text-align: center;
}
.fx-mempty img { opacity: .45; }
.fx-mempty p { margin: 0; font-size: 13px; color: var(--fx-muted); }

@media (max-width: 767px) {
	.fx-section {
		overflow-x: hidden;
		max-width: 100%;
	}
	.fx-grid,
	.fx-table-panel,
	.fx-table-inner,
	.fx-tpane,
	.fx-mcard-list {
		min-width: 0;
		max-width: 100%;
	}
	.fx-table-inner { padding: 12px; overflow-x: hidden; }
	.fx-table-tabs {
		display: flex;
		align-items: stretch;
		justify-content: space-evenly;
		gap: 0;
		width: 100%;
		padding: 0;
		overflow-x: hidden;
	}
	.fx-ttab {
		flex: 1 1 0;
		justify-content: center;
		gap: 0;
		min-width: 0;
		padding: 10px 4px;
		border-radius: 4px;
		background: var(--fx-panel);
	}
	.fx-ttab.active {
		background: var(--fx-bg);
		color: var(--fx-fg);
	}
	.fx-ttab-label { display: none !important; }
	.fx-ttab-ic {
		width: 18px;
		height: 18px;
		opacity: .7;
	}
	.fx-ttab.active .fx-ttab-ic { opacity: 1; }
	.fx-mtab-title {
		display: block;
		margin-top: 12px;
	}
	.fx-desk-tbl { display: none !important; }
	.fx-mcard-list { display: block; }
	.fx-tbl-frame { margin-top: 0; border: 0; background: transparent; }
	.fx-sub-tabs {
		padding: 12px 0 0;
		gap: 16px;
	}
	body.futures-page .fx-sub-tabs .fx-stab {
		font-size: 14px;
	}
	.fx-tbl-foot { padding-top: 8px; }
	body.futures-page .fx-table-panel,
	body.futures-page .fx-tpane.active,
	body.futures-page .fx-spane.fx-spane-on:not([hidden]) {
		overflow-x: hidden;
	}
}

@media (min-width: 768px) {
	.fx-mtab-title { display: none !important; }
	.fx-mcard-list { display: none !important; }
}

.fx-sub-tabs {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 0 0;
	margin-top: 0;
	border: none;
	background: transparent;
}
body.futures-page .fx-sub-tabs .fx-stab {
	display: inline;
	background: none !important;
	background-color: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	color: var(--fx-muted) !important;
	font-size: 14px;
	font-weight: 500;
	padding: 0;
	cursor: pointer;
	line-height: 1.4;
	transition: none;
}
body.futures-page .fx-sub-tabs .fx-stab:hover,
body.futures-page .fx-sub-tabs .fx-stab:focus {
	color: var(--fx-muted) !important;
	background: none !important;
	outline: none;
}
body.futures-page .fx-sub-tabs .fx-stab.active[data-ostab="active"],
body.futures-page .fx-sub-tabs .fx-stab.active[data-ostab="tpsl"] {
	color: var(--fx-fg) !important;
	font-weight: 500;
}

body.futures-page .fx-tpane { display: none !important; }
body.futures-page .fx-tpane.active { display: block !important; }
body.futures-page .fx-spane { display: none !important; visibility: hidden !important; height: 0 !important; overflow: hidden !important; margin: 0 !important; padding: 0 !important; border: none !important; }
body.futures-page .fx-spane.fx-spane-on:not([hidden]) { display: block !important; visibility: visible !important; height: auto !important; overflow: visible !important; margin: initial !important; padding: initial !important; }
body.futures-page .fx-spane[hidden] { display: none !important; visibility: hidden !important; height: 0 !important; overflow: hidden !important; }

.fx-tbl-frame {
	margin-top: 16px;
	border: 1px solid var(--fx-border);
	border-radius: 6px;
	overflow: hidden;
	background: var(--fx-bg);
}
.fx-tbl-scroll {
	overflow-x: auto;
	overflow-y: hidden;
	-ms-overflow-style: none;
	scrollbar-width: none;
}
.fx-tbl-scroll::-webkit-scrollbar:vertical { display: none; width: 0; }
body.futures-page .fx-table-panel { overflow: visible; }
body.futures-page .fx-tpane { overflow: visible; }

.fx-tbl-foot {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	padding: 12px 0 0;
	border: none;
}
.fx-pager { display: flex; gap: 8px; }
.fx-page-btn {
	background: transparent;
	border: 1px solid var(--fx-border);
	color: var(--fx-fg);
	border-radius: 4px;
	padding: 0 12px;
	height: 32px;
	font-size: 12px;
	font-weight: 500;
	line-height: 30px;
	cursor: pointer;
}
.fx-page-btn:hover:not(:disabled) { background: var(--fx-secondary); }
.fx-page-btn:disabled { opacity: .4; cursor: not-allowed; }

.fx-th-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 0;
	background: none;
	border: none;
	color: inherit;
	font: inherit;
	font-weight: 500;
	cursor: pointer;
	user-select: none;
	transition: color .15s ease;
}
body.futures-page .fx-tbl th:hover .fx-th-btn,
.fx-th-btn:hover,
.fx-th-btn.is-sorted {
	color: var(--fx-primary);
}
.fx-sort-ic {
	display: inline-block;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	background-color: currentColor;
	-webkit-mask: url('/img/futures/ic_sort_r6.svg') no-repeat center / contain;
	mask: url('/img/futures/ic_sort_r6.svg') no-repeat center / contain;
	transition: background-color .15s ease, transform .15s ease, opacity .15s ease;
	opacity: 0.55;
}
.fx-th-btn.is-sorted .fx-sort-ic {
	opacity: 1;
}
.fx-th-btn.is-asc .fx-sort-ic,
.fx-sort-ic.is-asc {
	transform: scaleY(-1);
}

.fx-contract-cell { display: flex; align-items: center; gap: 8px; }
.fx-coin-sm { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; }
.fx-contract-name { display: block; font-weight: 600; color: var(--fx-fg); line-height: 1.3; font-size: 12px; }
.fx-contract-sub { display: block; font-size: 11px; color: #60a5fa; line-height: 1.2; }

body.futures-page .fx-tbl .fx-dir-long { color: var(--fx-long) !important; }
body.futures-page .fx-tbl .fx-dir-short { color: var(--fx-short) !important; }
body.futures-page .fx-tbl .fx-type-close { color: #e879a9 !important; }

.fx-pnl-cell { display: inline-flex; align-items: center; gap: 4px; }
.fx-pnl-cell img { opacity: .6; }

/* position table — multi-line cells */
.fx-pos-contract { display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 140px; }
.fx-pos-contract .fx-coin-sm { width: 24px; height: 24px; flex-shrink: 0; }
.fx-pos-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; line-height: 1.25; }
.fx-pos-name { font-weight: 600; color: var(--fx-fg); font-size: 12px; white-space: nowrap; line-height: 1.25; }
.fx-pos-side-tag { font-size: 11px; font-weight: 600; line-height: 1.25; }
.fx-pos-side-tag.long { color: #10b981; }
.fx-pos-side-tag.short { color: #ef4444; }
.fx-pos-mode { display: block; font-size: 11px; line-height: 1.25; margin-top: 0; }
.fx-pos-mode.cross { color: #93c5fd; }
.fx-pos-mode.isolated { color: #fca5a5; }
.fx-pos-stack { display: flex; flex-direction: column; gap: 0; font-size: 12px; line-height: 1.25; white-space: nowrap; }
.fx-pos-stack .fx-lbl { color: var(--fx-muted); }
.fx-pos-stack .fx-liq { color: #f0b90b; font-weight: 500; }
.fx-pos-pnl-wrap { display: flex; align-items: flex-start; gap: 8px; min-width: 260px; }
.fx-pos-pnl-stack { display: flex; flex-direction: column; gap: 0; font-size: 12px; line-height: 1.25; white-space: nowrap; }
.fx-pos-pnl-stack .up { color: var(--fx-long); }
.fx-pos-pnl-stack .dn { color: var(--fx-short); }
.fx-pos-detail-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 28px; height: 28px; padding: 0;
	border: 0; border-radius: 0;
	background: transparent;
	color: #ffffff;
	cursor: pointer; flex-shrink: 0;
	outline: none;
	box-shadow: none;
}
.fx-pos-detail-btn:hover,
.fx-pos-detail-btn:focus,
.fx-pos-detail-btn:focus-visible {
	color: #ffffff;
	background: transparent;
	outline: none;
	box-shadow: none;
}
.fx-pos-detail-btn svg {
	display: block;
	width: 14px;
	height: 14px;
	stroke: currentColor;
}
body:not(.dark) .fx-pos-detail-btn,
body:not(.dark) .fx-pos-detail-btn:hover,
body:not(.dark) .fx-pos-detail-btn:focus {
	color: #0f172a;
}
.fx-pnl-cell .fx-ext-ic {
	display: inline-block;
	vertical-align: -2px;
	width: 12px;
	height: 12px;
	color: #ffffff;
}
body:not(.dark) .fx-pnl-cell .fx-ext-ic {
	color: #0f172a;
}
.fx-pos-tpsl { display: flex; align-items: flex-start; gap: 8px; min-width: 120px; }
.fx-pos-tpsl-stack { display: flex; flex-direction: column; gap: 0; font-size: 11px; line-height: 1.25; white-space: nowrap; }
.fx-pos-tpsl-stack .fx-tp { color: var(--fx-primary); }
.fx-pos-tpsl-stack .fx-sl { color: var(--fx-short); }
.fx-pos-tpsl-edit {
	width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--fx-border);
	background: var(--fx-secondary); color: var(--fx-muted); cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
	outline: none;
	box-shadow: none;
	-webkit-tap-highlight-color: transparent;
}
.fx-pos-tpsl-edit:hover { color: var(--fx-fg); }
.fx-pos-tpsl-edit:focus,
.fx-pos-tpsl-edit:focus-visible,
.fx-pos-tpsl-edit:active {
	outline: none !important;
	box-shadow: none !important;
	border-color: var(--fx-border);
}
.fx-pos-close-btns { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.fx-pos-close-btn {
	background: var(--fx-secondary); border: 1px solid var(--fx-border);
	color: var(--fx-fg); border-radius: 999px; padding: 6px 14px;
	font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap;
	outline: none;
	box-shadow: none;
	-webkit-tap-highlight-color: transparent;
}
.fx-pos-close-btn:hover { background: #252930; }
.fx-pos-close-btn:focus,
.fx-pos-close-btn:focus-visible,
.fx-pos-close-btn:active {
	outline: none !important;
	box-shadow: none !important;
	border-color: var(--fx-border);
}

.fx-close-dialog { max-width: 420px; }
.fx-close-desc { padding: 0 20px 12px; font-size: 13px; color: var(--fx-muted); line-height: 1.5; }
.fx-close-desc em { color: var(--fx-primary); font-style: normal; font-weight: 600; }
.fx-close-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 0 20px 12px; font-size: 13px; }
.fx-close-prices span:first-child { color: var(--fx-muted); }
.fx-close-prices span:last-child { text-align: right; color: var(--fx-fg); }
.fx-close-field { padding: 0 20px 12px; position: relative; }
.fx-close-label { display: block; font-size: 12px; color: var(--fx-muted); margin-bottom: 6px; }
.fx-close-field input {
	width: 100%; box-sizing: border-box; background: var(--fx-bg);
	border: 1px solid var(--fx-border); border-radius: 6px;
	color: var(--fx-fg); padding: 10px 12px; font-size: 13px;
}
.fx-close-qty-hint {
	position: absolute; right: 32px; top: 50%; transform: translateY(-50%);
	font-size: 12px; color: var(--fx-muted); pointer-events: none;
}
.fx-close-field:has(.fx-close-label) .fx-close-qty-hint { top: auto; bottom: 10px; transform: none; }
.fx-close-slider-wrap { padding: 4px 20px 16px; }

/* limit / market close modal */
#fxLimitCloseModal.fx-lim-close-overlay.open,
#fxMarketCloseModal.fx-mkt-close-overlay.open {
	align-items: center;
	justify-content: center;
	padding: 16px;
}
#fxLimitCloseModal .fx-lim-close-dialog,
#fxMarketCloseModal .fx-mkt-close-dialog {
	width: 100%;
	max-width: 440px;
	margin: 0;
	background: var(--fx-card);
	border: 1px solid hsl(215, 27.9%, 16.9%);
	border-radius: 20px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
	color: #fff;
}
#fxLimitCloseModal .fx-lim-close-h,
#fxMarketCloseModal .fx-mkt-close-h {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 24px 24px 10px;
}
#fxLimitCloseModal .fx-lim-close-h h3,
#fxMarketCloseModal .fx-mkt-close-h h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
}
#fxLimitCloseModal .fx-lim-close-x,
#fxMarketCloseModal .fx-mkt-close-x {
	background: none;
	border: 0;
	color: #fff;
	opacity: 0.65;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}
#fxLimitCloseModal .fx-lim-close-desc,
#fxMarketCloseModal .fx-mkt-close-desc {
	margin: 0;
	padding: 0 24px 18px;
	font-size: 14px;
	line-height: 1.55;
	color: hsl(217.9, 10.6%, 64.9%);
}
#fxLimitCloseModal .fx-lim-close-desc em,
#fxMarketCloseModal .fx-mkt-close-desc em {
	color: #a855f7;
	font-style: normal;
	font-weight: 600;
}
#fxLimitCloseModal .fx-lim-close-prices {
	padding: 0 24px 18px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
#fxLimitCloseModal .fx-lim-close-price-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	font-size: 14px;
	line-height: 1.4;
}
#fxLimitCloseModal .fx-lim-close-k,
#fxLimitCloseModal .fx-lim-close-v {
	color: #fff;
	font-weight: 400;
}
#fxLimitCloseModal .fx-lim-close-field {
	padding: 0 24px 16px;
}
#fxLimitCloseModal .fx-lim-close-label {
	display: block;
	margin-bottom: 8px;
	font-size: 14px;
	color: #fff;
	font-weight: 400;
	line-height: 1.4;
}
#fxLimitCloseModal .fx-lim-close-input {
	width: 100%;
	box-sizing: border-box;
	height: 40px;
	background: var(--fx-card);
	border: 1px solid hsl(215, 27.9%, 16.9%);
	border-radius: 999px;
	color: #fff;
	font-size: 14px;
	padding: 0 16px;
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
	-webkit-appearance: none;
	appearance: none;
}
#fxLimitCloseModal .fx-lim-close-input:focus {
	border-color: #a855f7;
	box-shadow: 0 0 0 2px var(--fx-card), 0 0 0 4px #a855f7;
}
#fxLimitCloseModal .fx-lim-close-qty-box,
#fxMarketCloseModal .fx-mkt-close-qty-box {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	height: 40px;
	padding: 0 16px;
	border-radius: 999px;
	background: var(--fx-card);
	border: 1px solid hsl(215, 27.9%, 16.9%);
}
#fxMarketCloseModal .fx-mkt-close-field {
	padding: 0 24px 16px;
}
#fxLimitCloseModal .fx-lim-close-qty-usdt,
#fxMarketCloseModal .fx-mkt-close-qty-usdt {
	font-size: 14px;
	color: #fff;
	white-space: nowrap;
}
#fxLimitCloseModal .fx-lim-close-qty-hint,
#fxMarketCloseModal .fx-mkt-close-qty-hint {
	font-size: 13px;
	color: hsl(217.9, 10.6%, 64.9%);
	white-space: nowrap;
}
#fxLimitCloseModal .fx-lim-close-slider-wrap,
#fxMarketCloseModal .fx-mkt-close-slider-wrap {
	padding: 2px 24px 22px;
}
#fxLimitCloseModal .fx-lim-close-slider-inner,
#fxMarketCloseModal .fx-mkt-close-slider-inner {
	position: relative;
	height: 32px;
	display: flex;
	align-items: center;
}
#fxLimitCloseModal .fx-lim-close-slider-inner input[type=range],
#fxMarketCloseModal .fx-mkt-close-slider-inner input[type=range] {
	width: 100%;
	height: 4px;
	margin: 0;
	-webkit-appearance: none;
	appearance: none;
	border-radius: 999px;
	outline: none;
	background: linear-gradient(to right, #fff 0%, #fff 100%, hsl(215, 27.9%, 16.9%) 100%, hsl(215, 27.9%, 16.9%) 100%);
}
#fxLimitCloseModal .fx-lim-close-slider-inner input[type=range]::-webkit-slider-runnable-track,
#fxMarketCloseModal .fx-mkt-close-slider-inner input[type=range]::-webkit-slider-runnable-track {
	height: 4px;
	border-radius: 999px;
	background: transparent;
}
#fxLimitCloseModal .fx-lim-close-slider-inner input[type=range]::-webkit-slider-thumb,
#fxMarketCloseModal .fx-mkt-close-slider-inner input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	margin-top: -5px;
	border-radius: 50%;
	background: var(--fx-card);
	border: 2px solid #fff;
	cursor: pointer;
}
#fxLimitCloseModal .fx-lim-close-slider-inner input[type=range]::-moz-range-track,
#fxMarketCloseModal .fx-mkt-close-slider-inner input[type=range]::-moz-range-track {
	height: 4px;
	border-radius: 999px;
	background: hsl(215, 27.9%, 16.9%);
}
#fxLimitCloseModal .fx-lim-close-slider-inner input[type=range]::-moz-range-progress,
#fxMarketCloseModal .fx-mkt-close-slider-inner input[type=range]::-moz-range-progress {
	height: 4px;
	border-radius: 999px;
	background: #fff;
}
#fxLimitCloseModal .fx-lim-close-slider-inner input[type=range]::-moz-range-thumb,
#fxMarketCloseModal .fx-mkt-close-slider-inner input[type=range]::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--fx-card);
	border: 2px solid #fff;
	cursor: pointer;
}
#fxLimitCloseModal .fx-lim-close-slider-labels,
#fxMarketCloseModal .fx-mkt-close-slider-labels {
	display: flex;
	justify-content: space-between;
	margin-top: 8px;
	font-size: 12px;
	color: hsl(217.9, 10.6%, 64.9%);
}
#fxLimitCloseModal .fx-lim-close-foot,
#fxMarketCloseModal .fx-mkt-close-foot {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	padding: 0 24px 24px;
}
#fxLimitCloseModal .fx-lim-close-btn,
#fxMarketCloseModal .fx-mkt-close-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	border-radius: 999px;
	border: 0;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	padding: 0 16px;
	font-family: inherit;
}
#fxLimitCloseModal .fx-lim-close-btn-cancel,
#fxMarketCloseModal .fx-mkt-close-btn-cancel {
	background: #2b3139;
	color: #fff;
}
#fxLimitCloseModal .fx-lim-close-btn-ok,
#fxMarketCloseModal .fx-mkt-close-btn-ok {
	background: #a855f7;
	color: #0b0e11;
}

/* TP/SL modal */
#fxTpslModal.fx-tpsl-overlay.open {
	align-items: center;
	justify-content: center;
	padding: 16px;
}
#fxTpslModal .fx-tpsl-dialog {
	width: 100%;
	max-width: 440px;
	margin: 0;
	background: var(--fx-card);
	border: 1px solid hsl(215, 27.9%, 16.9%);
	border-radius: 16px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
	color: #fff;
	max-height: 90vh;
	overflow-y: auto;
}
#fxTpslModal .fx-tpsl-h {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 24px 24px 16px;
}
#fxTpslModal .fx-tpsl-h h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
}
#fxTpslModal .fx-tpsl-x {
	background: none;
	border: 0;
	color: #fff;
	opacity: 0.65;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}
#fxTpslModal .fx-tpsl-summary {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin: 0 24px 20px;
	padding: 16px;
	background: var(--fx-bg);
	border: 1px solid hsl(215, 27.9%, 16.9%);
	border-radius: 8px;
}
#fxTpslModal .fx-tpsl-sum-item { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
#fxTpslModal .fx-tpsl-sum-label {
	font-size: 12px;
	font-weight: 600;
	color: #8a81f8;
	line-height: 1.2;
}
#fxTpslModal .fx-tpsl-sum-val {
	font-size: 13px;
	font-weight: 500;
	color: #fff;
	line-height: 1.3;
	word-break: break-all;
}
#fxTpslModal .fx-tpsl-section { padding: 0 24px 18px; }
#fxTpslModal .fx-tpsl-label {
	display: block;
	margin-bottom: 8px;
	font-size: 14px;
	color: #fff;
	font-weight: 400;
}
#fxTpslModal .fx-tpsl-block-label {
	margin: 0 0 10px;
	font-size: 13px;
	line-height: 1.4;
	color: #fff;
	font-weight: 400;
}
#fxTpslModal .fx-tpsl-qty-box {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	height: 40px;
	padding: 0 16px;
	border-radius: 8px;
	background: var(--fx-card);
	border: 1px solid hsl(215, 27.9%, 16.9%);
}
#fxTpslModal .fx-tpsl-qty-box input {
	flex: 1;
	min-width: 0;
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 14px;
	outline: none;
	padding: 0;
}
#fxTpslModal .fx-tpsl-qty-unit {
	font-size: 13px;
	color: hsl(217.9, 10.6%, 64.9%);
	white-space: nowrap;
}
#fxTpslModal .fx-tpsl-dual-input {
	display: grid;
	grid-template-columns: 1fr auto 80px;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}
#fxTpslModal .fx-tpsl-price-input,
#fxTpslModal .fx-tpsl-roi-input {
	width: 100%;
	box-sizing: border-box;
	height: 40px;
	background: var(--fx-card);
	border: 1px solid hsl(215, 27.9%, 16.9%);
	border-radius: 8px;
	color: #fff;
	font-size: 14px;
	outline: none;
	padding: 0 12px;
}
#fxTpslModal .fx-tpsl-roi-input { text-align: center; padding: 0 8px; }
#fxTpslModal .fx-tpsl-mid-label {
	font-size: 12px;
	color: hsl(217.9, 10.6%, 64.9%);
	white-space: nowrap;
	padding: 0 2px;
}
#fxTpslModal .fx-tpsl-preview {
	margin-top: 12px;
	padding: 12px 14px;
	border-radius: 8px;
	background: rgba(112, 48, 245, 0.12);
	border: 1px solid rgba(112, 48, 245, 0.25);
	font-size: 12px;
	line-height: 1.55;
	color: hsl(217.9, 10.6%, 75%);
}
#fxTpslModal .fx-tpsl-preview strong { color: #fff; font-weight: 600; }
#fxTpslModal .fx-tpsl-preview .up { color: var(--fx-long); }
#fxTpslModal .fx-tpsl-preview .dn { color: var(--fx-short); }
#fxTpslModal .fx-tpsl-slider-wrap { padding-top: 2px; }
#fxTpslModal .fx-tpsl-slider-inner {
	position: relative;
	height: 32px;
	display: flex;
	align-items: center;
}
#fxTpslModal .fx-tpsl-slider-inner input[type=range] {
	width: 100%;
	height: 4px;
	margin: 0;
	-webkit-appearance: none;
	appearance: none;
	border-radius: 999px;
	outline: none;
	background: linear-gradient(to right, #fff 0%, #fff var(--fx-tpsl-pct, 100%), hsl(215, 27.9%, 16.9%) var(--fx-tpsl-pct, 100%), hsl(215, 27.9%, 16.9%) 100%);
}
#fxTpslModal .fx-tpsl-slider-inner input[type=range]::-webkit-slider-runnable-track {
	height: 4px;
	border-radius: 999px;
	background: transparent;
}
#fxTpslModal .fx-tpsl-slider-inner input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	margin-top: -5px;
	border-radius: 50%;
	background: var(--fx-card);
	border: 2px solid #fff;
	cursor: pointer;
}
#fxTpslModal .fx-tpsl-slider-inner input[type=range]::-moz-range-track {
	height: 4px;
	border-radius: 999px;
	background: hsl(215, 27.9%, 16.9%);
}
#fxTpslModal .fx-tpsl-slider-inner input[type=range]::-moz-range-progress {
	height: 4px;
	border-radius: 999px;
	background: #fff;
}
#fxTpslModal .fx-tpsl-slider-inner input[type=range]::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--fx-card);
	border: 2px solid #fff;
	cursor: pointer;
}
#fxTpslModal .fx-tpsl-slider-labels {
	display: flex;
	justify-content: space-between;
	margin-top: 8px;
	font-size: 11px;
	color: hsl(217.9, 10.6%, 64.9%);
}
#fxTpslModal .fx-tpsl-foot {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	padding: 4px 24px 24px;
}
#fxTpslModal .fx-tpsl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	border-radius: 999px;
	border: 0;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	padding: 0 16px;
	font-family: inherit;
}
#fxTpslModal .fx-tpsl-btn-cancel {
	background: #2b3139;
	color: #fff;
}
#fxTpslModal .fx-tpsl-btn-ok {
	background: #7030f5;
	color: #0b0e11;
}

.fx-btn-close {
	background: transparent; border: 1px solid var(--fx-border);
	color: var(--fx-fg); border-radius: 4px; padding: 4px 10px;
	font-size: 12px; cursor: pointer;
}
.fx-btn-close:hover { border-color: var(--fx-muted); }
.fx-btn-cancel {
	background: transparent; border: 1px solid var(--fx-border);
	color: var(--fx-short); border-radius: 4px; padding: 4px 10px;
	font-size: 12px; cursor: pointer;
}

body.futures-page .fx-tbl {
	width: 100%; border-collapse: collapse; font-size: 12px;
}
body.futures-page .fx-tbl th {
	text-align: left;
	color: var(--fx-muted) !important;
	font-weight: 500;
	padding: 0 12px;
	height: 32px;
	border-bottom: 1px solid var(--fx-border) !important;
	white-space: nowrap;
	font-size: 12px !important;
	vertical-align: middle;
}
body.futures-page .fx-tbl td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--fx-border) !important;
	color: var(--fx-fg) !important;
	white-space: nowrap;
	font-size: 12px !important;
	vertical-align: middle;
}
body.futures-page .fx-tbl tbody tr:last-child td { border-bottom: none !important; }
body.futures-page #fxPosBody td {
	vertical-align: middle;
	padding: 6px 12px !important;
}
body.futures-page #fxPosBody p {
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1.25 !important;
}
body.futures-page #fxPosBody tr { height: auto; }
body.futures-page .fx-tbl .long, body.futures-page .fx-tbl .up { color: var(--fx-long) !important; }
body.futures-page .fx-tbl .short, body.futures-page .fx-tbl .dn { color: var(--fx-short) !important; }

.fx-empty-cell {
	padding: 0 !important;
	border-bottom: none !important;
	background: transparent !important;
	vertical-align: middle !important;
}
.fx-empty-box {
	display: grid;
	place-items: center;
	padding: 64px 16px;
	margin: 12px 0;
	text-align: center;
	min-height: 180px;
	box-sizing: border-box;
}
.fx-empty-box img {
	width: 64px !important;
	height: 64px !important;
	max-width: 64px;
	display: block;
	margin: 0 auto;
	opacity: 1;
}
body.futures-page .fx-empty-box p {
	margin: 4px 0 0 !important;
	padding: 0 !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	line-height: 1.5 !important;
	color: #eaecef !important;
	text-align: center !important;
}

/* CRITICAL: override theme white table header */
body.futures-page .fx-tbl,
body.futures-page .fx-tbl thead,
body.futures-page .fx-tbl tbody,
body.futures-page .fx-tbl tr,
body.futures-page .fx-tbl th,
body.futures-page .fx-tbl td {
	background: transparent !important;
	background-color: transparent !important;
	border-color: var(--fx-border) !important;
	font-family: inherit !important;
}

.fx-btn-xs {
	background: var(--fx-secondary); border: 1px solid var(--fx-border);
	color: var(--fx-fg); border-radius: 3px; padding: 3px 8px; font-size: 10px; cursor: pointer;
}

/* overlays */
.fx-overlay {
	display: none; position: fixed; inset: 0;
	background: rgba(0,0,0,.65); z-index: 3000;
	align-items: flex-end; justify-content: center;
}
.fx-overlay.open { display: flex; }
@media (min-width: 1024px) { .fx-overlay.open { align-items: center; } }

#fxOrderDrawer {
	z-index: 3100;
	background: rgba(0, 0, 0, 0.55);
	align-items: flex-end;
}
#fxOrderDrawer.open { display: flex; }
#fxConfirmModal,
#fxMarginSheet,
#fxLevSheet,
.fx-tpsl-overlay,
.fx-mkt-close-overlay,
.fx-lim-close-overlay {
	z-index: 3200;
}

.fx-sheet {
	background: var(--fx-panel); border: 1px solid var(--fx-border);
	border-radius: 8px 8px 0 0; width: 100%; max-width: 400px;
	max-height: 90vh; overflow-y: auto;
}
@media (min-width: 1024px) { .fx-sheet { border-radius: 8px; } }

.fx-sheet-h {
	display: flex; justify-content: space-between; align-items: center;
	padding: 14px 16px; border-bottom: 1px solid var(--fx-border);
}
.fx-sheet-h h3 { margin: 0; font-size: 15px; color: var(--fx-fg); }
.fx-sheet-x { background: none; border: 0; color: var(--fx-muted); font-size: 22px; cursor: pointer; }
.fx-sheet-b { padding: 16px; }

/* margin mode dialog */
#fxMarginSheet.fx-overlay.open {
	align-items: center;
	justify-content: center;
	padding: 16px;
}
#fxMarginSheet .fx-mm-dialog {
	width: 100%;
	max-width: 512px;
	margin: 0;
	background: var(--fx-panel);
	border: 1px solid hsl(215, 27.9%, 16.9%);
	border-radius: 12px;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.35), 0 4px 6px -4px rgba(0, 0, 0, 0.35);
	max-height: 90vh;
	overflow-y: auto;
}
#fxMarginSheet .fx-mm-dialog .fx-sheet-h {
	padding: 24px 24px 0;
	border-bottom: none;
}
#fxMarginSheet .fx-mm-dialog .fx-sheet-h h3 {
	font-size: 18px;
	font-weight: 600;
	line-height: 1.2;
	color: hsl(210, 20%, 98%);
}
#fxMarginSheet .fx-mm-dialog .fx-sheet-x {
	color: hsl(210, 20%, 98%);
	opacity: 0.7;
	font-size: 18px;
	line-height: 1;
}
.fx-mm-body { padding: 16px 24px 24px; }

.fx-mm-card {
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 12px;
	text-align: left;
}
.fx-mm-card:last-child { margin-bottom: 0; }
.fx-mm-card.isolated {
	border: 1px solid rgba(246, 70, 93, 0.45);
	background: rgba(246, 70, 93, 0.04);
}
.fx-mm-card.cross {
	border: 1px solid rgba(59, 130, 246, 0.45);
	background: rgba(59, 130, 246, 0.04);
}
.fx-mm-title {
	margin: 0 0 14px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: hsl(210, 20%, 98%);
}
.fx-mm-card.isolated .fx-mm-title { color: #fca5a5; }
.fx-mm-card.cross .fx-mm-title { color: #93c5fd; }
.fx-mm-section { margin-bottom: 12px; }
.fx-mm-section:last-of-type { margin-bottom: 16px; }
.fx-mm-sec-label {
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 600;
	color: hsl(215, 20.2%, 65.1%);
}
.fx-mm-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.fx-mm-list li {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 6px;
	font-size: 12px;
	line-height: 1.45;
	color: hsl(215, 20.2%, 75%);
}
.fx-mm-list li:last-child { margin-bottom: 0; }
.fx-mm-check {
	flex-shrink: 0;
	width: 14px;
	height: 14px;
	margin-top: 2px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 14px 14px;
}
.fx-mm-card.isolated .fx-mm-check {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23f87171' stroke-width='3'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.fx-mm-card.cross .fx-mm-check {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2360a5fa' stroke-width='3'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.fx-mm-btn {
	display: none;
	width: 100%;
	padding: 10px 16px;
	border: 0;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	cursor: pointer;
}
.fx-mm-card.isolated .fx-mm-btn { background: #ef4444; }
.fx-mm-card.cross .fx-mm-btn { background: #3b82f6; }
.fx-mm-card:not(.active) .fx-mm-btn { display: block; }
.fx-mm-current {
	display: none;
	margin: 4px 0 0;
	padding: 8px 0 0;
	font-size: 13px;
	font-weight: 500;
	text-align: center;
	color: hsl(215, 20.2%, 55%);
}
.fx-mm-card.active .fx-mm-current { display: block; }

/* leverage dialog */
#fxLevSheet.fx-overlay.open {
	align-items: center;
	justify-content: center;
	padding: 16px;
}
#fxLevSheet .fx-lev-dialog {
	width: 100%;
	max-width: 512px;
	margin: 0;
	background: var(--fx-panel);
	border: 1px solid hsl(215, 27.9%, 16.9%);
	border-radius: 12px;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.35), 0 4px 6px -4px rgba(0, 0, 0, 0.35);
}
#fxLevSheet .fx-lev-dialog .fx-sheet-b.fx-lev-body {
	padding: 0 24px 24px;
}
#fxLevSheet .fx-lev-dialog .fx-sheet-h {
	padding: 24px 24px 0;
	border-bottom: none;
}
#fxLevSheet .fx-lev-dialog .fx-sheet-h h3 {
	font-size: 18px;
	font-weight: 600;
	line-height: 1.2;
	color: hsl(210, 20%, 98%);
}
#fxLevSheet .fx-lev-dialog .fx-sheet-x {
	color: hsl(210, 20%, 98%);
	opacity: 0.7;
	font-size: 18px;
	line-height: 1;
}
.fx-lev-body { padding: 0 24px 24px; }

.fx-lev-input {
	width: 100%; box-sizing: border-box;
	height: 44px;
	background: var(--fx-bg);
	border: 1px solid hsl(215, 27.9%, 16.9%);
	border-radius: 999px;
	color: hsl(210, 20%, 98%);
	font-size: 14px;
	line-height: 1.4;
	padding: 8px 20px;
	margin: 0 0 8px;
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.fx-lev-input:focus {
	border-color: hsl(263.4, 70%, 50.4%);
	box-shadow: 0 0 0 1px hsl(263.4, 70%, 50.4%), 0 0 0 3px hsla(263.4, 70%, 50.4%, 0.35);
}

.fx-lev-slider-wrap {
	position: relative;
	width: 100%;
	max-width: 440px;
	margin: 0 auto 28px;
}
.fx-lev-slider-inner {
	position: relative;
	width: 100%;
	height: 44px;
}
.fx-lev-slider-inner input[type=range] {
	position: absolute;
	left: 0; right: 0; top: 10px;
	width: 100%; height: 4px; margin: 0;
	-webkit-appearance: none; appearance: none;
	background: hsl(215, 27.9%, 16.9%);
	border-radius: 999px; outline: none;
}
.fx-lev-slider-inner input[type=range]::-webkit-slider-runnable-track {
	height: 4px;
	background: hsl(215, 27.9%, 16.9%);
	border-radius: 999px;
}
.fx-lev-slider-inner input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 16px; height: 16px; margin-top: -6px;
	border-radius: 50%;
	background: hsl(210, 20%, 98%);
	border: 2px solid hsl(224, 71.4%, 6%);
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.fx-lev-slider-inner input[type=range]::-moz-range-track {
	height: 4px;
	background: hsl(215, 27.9%, 16.9%);
	border-radius: 999px;
}
.fx-lev-slider-inner input[type=range]::-moz-range-thumb {
	width: 16px; height: 16px;
	border-radius: 50%;
	background: hsl(210, 20%, 98%);
	border: 2px solid hsl(224, 71.4%, 6%);
	cursor: pointer;
}

.fx-lev-steps {
	position: absolute;
	left: 0; right: 0; top: 0;
	height: 44px;
	pointer-events: none;
}
.fx-lev-step {
	position: absolute;
	top: 4px;
	transform: translateX(-50%);
	background: none; border: 0; padding: 0;
	cursor: pointer; pointer-events: auto;
	display: flex; flex-direction: column; align-items: center;
	width: 24px;
}
.fx-lev-step-dot {
	display: block; width: 16px; height: 16px; border-radius: 50%;
	background: hsl(215, 27.9%, 16.9%);
	border: 2px solid #94a3b8;
	transition: transform 0.15s ease, opacity 0.15s ease;
	flex-shrink: 0;
}
.fx-lev-step.active .fx-lev-step-dot {
	transform: scale(0); opacity: 0;
}
.fx-lev-step-lbl {
	display: block;
	margin-top: 6px;
	font-size: 10px; line-height: 1;
	color: hsl(217.9, 10.6%, 64.9%);
	white-space: nowrap;
	text-align: center;
}

.fx-lev-notice {
	margin: 0 0 16px; padding: 12px;
	background: var(--fx-bg);
	border: 1px solid hsl(215, 27.9%, 16.9%);
	border-radius: 8px;
	color: hsl(217.9, 10.6%, 64.9%);
	font-size: 14px; line-height: 1.5;
}

.fx-lev-footer {
	display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.fx-lev-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 40px; border-radius: 999px;
	font-size: 14px; font-weight: 600; cursor: pointer; border: 0;
	padding: 0 16px;
}
.fx-lev-btn-close {
	background: hsl(215, 27.9%, 16.9%);
	color: hsl(210, 20%, 98%);
}
.fx-lev-btn-ok {
	background: hsl(263.4, 70%, 50.4%);
	color: hsl(224, 71.4%, 4.1%);
}
.fx-lev-btn-ok svg { stroke: hsl(224, 71.4%, 4.1%); }

.fx-drawer-wrap .fx-drawer {
	background: var(--fx-panel);
	border-radius: 16px 16px 0 0;
	border: 1px solid var(--fx-border);
	border-bottom: 0;
	width: 100%;
	max-height: min(88vh, 720px);
	overflow: hidden;
	position: relative;
	transform: translateY(100%);
	transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
	box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
}
#fxOrderDrawer.open .fx-drawer {
	transform: translateY(0);
}
.fx-drawer-handle {
	width: 40px;
	height: 4px;
	border-radius: 999px;
	background: hsl(217.9, 10.6%, 35%);
	margin: 10px auto 6px;
	flex-shrink: 0;
}
.fx-drawer-scroll {
	overflow-y: auto;
	max-height: calc(min(88vh, 720px) - 20px);
	padding: 0 16px 16px;
	-webkit-overflow-scrolling: touch;
}
#fxOrderDrawerContent .fx-op-head { margin-top: 4px; }
#fxOrderDrawerContent .fx-op-wallet-btns { margin-top: 8px; }

/* order confirm modal */
.fx-confirm-dialog {
	background: var(--fx-panel);
	border: 1px solid var(--fx-border);
	border-radius: 8px;
	width: 100%;
	max-width: 448px;
	margin: 16px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.fx-confirm-h {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 20px 0;
}
.fx-confirm-h h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--fx-fg);
	line-height: 1.3;
}
.fx-confirm-x {
	font-size: 20px;
	line-height: 1;
	padding: 4px;
	opacity: .7;
}
.fx-confirm-x:hover { opacity: 1; color: var(--fx-fg); }
.fx-confirm-body {
	padding: 16px 20px 8px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.fx-confirm-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.fx-confirm-l {
	font-size: 14px;
	color: var(--fx-muted);
	flex-shrink: 0;
}
.fx-confirm-v {
	font-size: 14px;
	color: var(--fx-fg);
	text-align: right;
}
.fx-confirm-v.fx-pos-long { color: #10b981; }
.fx-confirm-v.fx-pos-short { color: #ef4444; }
.fx-confirm-v.fx-mm-cross { color: #93c5fd; }
.fx-confirm-v.fx-mm-isolated { color: #fca5a5; }
.fx-confirm-foot {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	padding: 12px 20px 20px;
}
body.futures-page .fx-confirm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 40px;
	border-radius: 6px;
	border: none;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: filter .15s, opacity .15s;
	-webkit-appearance: none;
	appearance: none;
	font-family: inherit;
}
.fx-confirm-btn-close {
	background: var(--fx-secondary);
	color: var(--fx-fg);
	border: 1px solid var(--fx-border);
}
.fx-confirm-btn-close:hover { background: #252930; }
.fx-confirm-btn-ok {
	background: var(--fx-primary);
	color: #0b0e11;
}
.fx-confirm-btn-ok:hover { filter: brightness(1.08); }
.fx-confirm-btn-ok.fx-ok-short {
	background: #dc2626;
	color: #fff;
}
.fx-confirm-btn-ok.fx-ok-short:hover { filter: brightness(1.1); }
.fx-confirm-btn-ok:disabled {
	opacity: .6;
	cursor: not-allowed;
}

/* ========== Light mode: trading modals (TP/SL, close, sheets) ========== */
body:not(.dark) #fxTpslModal .fx-tpsl-dialog,
body:not(.dark) #fxLimitCloseModal .fx-lim-close-dialog,
body:not(.dark) #fxMarketCloseModal .fx-mkt-close-dialog,
body:not(.dark) #fxMarginSheet .fx-mm-dialog,
body:not(.dark) #fxLevSheet .fx-lev-dialog,
body:not(.dark) .fx-confirm-dialog {
	background: #ffffff !important;
	border-color: #e2e8f0 !important;
	color: #0f172a !important;
	box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18) !important;
}

body:not(.dark) #fxTpslModal .fx-tpsl-h h3,
body:not(.dark) #fxTpslModal .fx-tpsl-x,
body:not(.dark) #fxTpslModal .fx-tpsl-label,
body:not(.dark) #fxTpslModal .fx-tpsl-block-label,
body:not(.dark) #fxTpslModal .fx-tpsl-sum-val,
body:not(.dark) #fxTpslModal .fx-tpsl-qty-box input,
body:not(.dark) #fxTpslModal .fx-tpsl-price-input,
body:not(.dark) #fxTpslModal .fx-tpsl-roi-input,
body:not(.dark) #fxTpslModal .fx-tpsl-preview strong,
body:not(.dark) #fxLimitCloseModal .fx-lim-close-h h3,
body:not(.dark) #fxLimitCloseModal .fx-lim-close-x,
body:not(.dark) #fxLimitCloseModal .fx-lim-close-k,
body:not(.dark) #fxLimitCloseModal .fx-lim-close-v,
body:not(.dark) #fxLimitCloseModal .fx-lim-close-label,
body:not(.dark) #fxLimitCloseModal .fx-lim-close-input,
body:not(.dark) #fxLimitCloseModal .fx-lim-close-qty-usdt,
body:not(.dark) #fxMarketCloseModal .fx-mkt-close-h h3,
body:not(.dark) #fxMarketCloseModal .fx-mkt-close-x,
body:not(.dark) #fxMarketCloseModal .fx-mkt-close-qty-usdt,
body:not(.dark) #fxMarginSheet .fx-mm-dialog .fx-sheet-h h3,
body:not(.dark) #fxMarginSheet .fx-mm-dialog .fx-sheet-x,
body:not(.dark) #fxLevSheet .fx-lev-dialog .fx-sheet-h h3,
body:not(.dark) #fxLevSheet .fx-lev-dialog .fx-sheet-x,
body:not(.dark) .fx-confirm-dialog h3,
body:not(.dark) .fx-confirm-dialog .fx-confirm-x {
	color: #0f172a !important;
}

body:not(.dark) #fxTpslModal .fx-tpsl-sum-label {
	color: #7c3aed !important;
}

body:not(.dark) #fxTpslModal .fx-tpsl-summary {
	background: #f1f5f9 !important;
	border-color: #e2e8f0 !important;
}

body:not(.dark) #fxTpslModal .fx-tpsl-qty-box,
body:not(.dark) #fxTpslModal .fx-tpsl-price-input,
body:not(.dark) #fxTpslModal .fx-tpsl-roi-input,
body:not(.dark) #fxLimitCloseModal .fx-lim-close-input,
body:not(.dark) #fxLimitCloseModal .fx-lim-close-qty-box,
body:not(.dark) #fxMarketCloseModal .fx-mkt-close-qty-box {
	background: #f8fafc !important;
	border-color: #e2e8f0 !important;
	color: #0f172a !important;
}

body:not(.dark) #fxTpslModal .fx-tpsl-qty-unit,
body:not(.dark) #fxTpslModal .fx-tpsl-mid-label,
body:not(.dark) #fxTpslModal .fx-tpsl-slider-labels,
body:not(.dark) #fxTpslModal .fx-tpsl-preview,
body:not(.dark) #fxLimitCloseModal .fx-lim-close-desc,
body:not(.dark) #fxMarketCloseModal .fx-mkt-close-desc,
body:not(.dark) #fxLimitCloseModal .fx-lim-close-qty-hint,
body:not(.dark) #fxMarketCloseModal .fx-mkt-close-qty-hint,
body:not(.dark) #fxLimitCloseModal .fx-lim-close-slider-labels,
body:not(.dark) #fxMarketCloseModal .fx-mkt-close-slider-labels {
	color: #64748b !important;
}

body:not(.dark) #fxTpslModal .fx-tpsl-preview {
	background: rgba(168, 85, 247, 0.08) !important;
	border-color: rgba(168, 85, 247, 0.25) !important;
}

body:not(.dark) #fxTpslModal .fx-tpsl-slider-inner input[type=range] {
	background: linear-gradient(to right, #0f172a 0%, #0f172a var(--fx-tpsl-pct, 100%), #e2e8f0 var(--fx-tpsl-pct, 100%), #e2e8f0 100%) !important;
}
body:not(.dark) #fxTpslModal .fx-tpsl-slider-inner input[type=range]::-webkit-slider-thumb,
body:not(.dark) #fxTpslModal .fx-tpsl-slider-inner input[type=range]::-moz-range-thumb {
	background: #ffffff !important;
	border-color: #0f172a !important;
}
body:not(.dark) #fxTpslModal .fx-tpsl-slider-inner input[type=range]::-moz-range-track {
	background: #e2e8f0 !important;
}
body:not(.dark) #fxTpslModal .fx-tpsl-slider-inner input[type=range]::-moz-range-progress {
	background: #0f172a !important;
}

body:not(.dark) #fxLimitCloseModal .fx-lim-close-slider-inner input[type=range],
body:not(.dark) #fxMarketCloseModal .fx-mkt-close-slider-inner input[type=range] {
	background: linear-gradient(to right, #0f172a 0%, #0f172a 100%, #e2e8f0 100%, #e2e8f0 100%) !important;
}
body:not(.dark) #fxLimitCloseModal .fx-lim-close-slider-inner input[type=range]::-moz-range-track,
body:not(.dark) #fxMarketCloseModal .fx-mkt-close-slider-inner input[type=range]::-moz-range-track {
	background: #e2e8f0 !important;
}
body:not(.dark) #fxLimitCloseModal .fx-lim-close-slider-inner input[type=range]::-webkit-slider-thumb,
body:not(.dark) #fxMarketCloseModal .fx-mkt-close-slider-inner input[type=range]::-webkit-slider-thumb,
body:not(.dark) #fxLimitCloseModal .fx-lim-close-slider-inner input[type=range]::-moz-range-thumb,
body:not(.dark) #fxMarketCloseModal .fx-mkt-close-slider-inner input[type=range]::-moz-range-thumb {
	background: #ffffff !important;
	border-color: #0f172a !important;
}

body:not(.dark) #fxTpslModal .fx-tpsl-btn-cancel,
body:not(.dark) #fxLimitCloseModal .fx-lim-close-btn-cancel,
body:not(.dark) #fxMarketCloseModal .fx-mkt-close-btn-cancel,
body:not(.dark) .fx-confirm-btn-close {
	background: #e2e8f0 !important;
	color: #0f172a !important;
	border-color: #e2e8f0 !important;
}

body:not(.dark) #fxTpslModal .fx-tpsl-btn-ok,
body:not(.dark) #fxLimitCloseModal .fx-lim-close-btn-ok,
body:not(.dark) #fxMarketCloseModal .fx-mkt-close-btn-ok,
body:not(.dark) .fx-confirm-btn-ok {
	background: #a855f7 !important;
	color: #ffffff !important;
}

body:not(.dark) #fxMarginSheet .fx-mm-card {
	background: #f8fafc !important;
	border-color: #e2e8f0 !important;
	color: #0f172a !important;
}
body:not(.dark) #fxMarginSheet .fx-mm-sec-label,
body:not(.dark) #fxMarginSheet .fx-mm-list li {
	color: #475569 !important;
}
body:not(.dark) #fxLevSheet .fx-lev-input,
body:not(.dark) #fxLevSheet .fx-sheet-b {
	background: #f8fafc !important;
	border-color: #e2e8f0 !important;
	color: #0f172a !important;
}

/* ===== P&L Share Card Modal ===== */
#fxShareModal.fx-overlay {
	z-index: 12050;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.72);
}
#fxShareModal .fx-share-wrap {
	position: relative;
	width: min(100%, 384px);
}
#fxShareModal .fx-share-x {
	position: absolute;
	top: -14px;
	right: -14px;
	z-index: 3;
	width: 36px;
	height: 36px;
	border-radius: 999px;
	border: 0;
	background: hsla(263.4, 70%, 50.4%, 0.18);
	color: hsl(263.4, 70%, 72%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 0 0 1px hsla(263.4, 70%, 50.4%, 0.35);
}
#fxShareModal .fx-share-x:hover {
	background: hsla(263.4, 70%, 50.4%, 0.28);
	color: #fff;
}
#fxShareModal .fx-share-stage {
	position: relative;
}
#fxShareModal .fx-share-card {
	position: relative;
	height: 450px;
	padding: 24px;
	border-radius: 12px;
	overflow: hidden;
	box-sizing: border-box;
	background: linear-gradient(135deg, #0b0f1e 0%, #050c24 48%, #000 100%);
	color: #fff;
	font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
}
#fxShareModal .fx-share-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
	color: hsl(263.4, 70%, 62%);
	font-size: 28px;
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.1;
}
#fxShareModal .fx-share-brand img {
	width: auto;
	max-width: 140px;
	height: 48px;
	object-fit: contain;
	flex-shrink: 0;
}
#fxShareModal #fxShareAppName {
	display: none !important;
}
#fxShareModal .fx-share-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 18px;
	font-size: 18px;
	font-weight: 600;
	color: #fff;
	line-height: 1.35;
}
#fxShareModal .fx-share-pipe { color: #6b7280; }
#fxShareModal .fx-share-meta .is-long { color: #22c55e; text-transform: uppercase; }
#fxShareModal .fx-share-meta .is-short { color: #ef4444; text-transform: uppercase; }
#fxShareModal .fx-share-meta .is-cross { color: #93c5fd; }
#fxShareModal .fx-share-meta .is-iso { color: #fca5a5; }
#fxShareModal .fx-share-pct {
	margin: 8px 0 22px;
	font-size: 52px;
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.05;
}
#fxShareModal .fx-share-pct.is-up { color: #22c55e; }
#fxShareModal .fx-share-pct.is-dn { color: #f6465d; }
#fxShareModal .fx-share-grid {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: auto 1fr;
	column-gap: 28px;
	row-gap: 10px;
	width: 78%;
	font-size: 14px;
	line-height: 1.35;
}
#fxShareModal .fx-share-l { color: #6b7280; }
#fxShareModal .fx-share-v { color: #fff; font-weight: 600; }
#fxShareModal .fx-share-v.is-up { color: #10b981; }
#fxShareModal .fx-share-v.is-dn { color: #f6465d; }
#fxShareModal .fx-share-deco {
	position: absolute;
	right: -80px;
	bottom: -96px;
	width: min(320px, 90%);
	height: auto;
	opacity: 0.22;
	transform: rotate(12deg);
	pointer-events: none;
	user-select: none;
	z-index: 0;
}
#fxShareModal .fx-share-deco.is-hidden,
#fxShareModal .fx-share-deco[hidden] {
	display: none !important;
}
#fxShareModal .fx-share-dl {
	position: absolute;
	right: 18px;
	bottom: 18px;
	z-index: 2;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
#fxShareModal .fx-share-dl:hover { color: hsl(263.4, 70%, 72%); }
#fxShareModal .fx-share-dl:disabled { opacity: 0.5; cursor: wait; }

@media (max-width: 420px) {
	#fxShareModal .fx-share-wrap { width: 100%; }
	#fxShareModal .fx-share-x { top: 6px; right: 6px; }
	#fxShareModal .fx-share-pct { font-size: 42px; }
	#fxShareModal .fx-share-brand { font-size: 24px; }
}
