body.trade-fx-page {
	background: var(--fx-bg) !important;
	color: var(--fx-fg) !important;
	padding-top: var(--fx-header) !important;
}

body.trade-fx-page .ety-main,
body.trade-fx-page .ft_content,
body.trade-fx-page #wrapper {
	background: var(--fx-bg) !important;
}

/* 차트·호가·주문패널 같은 줄에 배치 (futures.css 1536px row:3 덮어쓰기) */
@media (min-width: 768px) {
	body.trade-fx-page .fx-desk-chart,
	body.trade-fx-page .fx-desk-ob {
		grid-row: 3;
	}
	body.trade-fx-page .fx-order-anchor {
		grid-row: 3 !important;
		align-self: stretch;
	}
}

@media (min-width: 768px) and (max-width: 1279px) {
	body.trade-fx-page .fx-order-anchor {
		grid-column: 9 / -1 !important;
	}
}

@media (min-width: 1280px) {
	body.trade-fx-page .fx-order-anchor {
		grid-column: 10 / -1 !important;
	}
	body.trade-fx-page .fx-order-anchor .trade-order-panel {
		height: 100%;
		max-height: 580px;
		overflow-y: auto;
	}
}

@media (min-width: 1536px) {
	body.trade-fx-page .fx-order-anchor {
		grid-column: 11 / -1 !important;
	}
}

@media (max-width: 767px) {
	body.trade-fx-page .fx-order-anchor {
		grid-column: 1 / -1 !important;
		grid-row: auto !important;
	}
	body.trade-fx-page .fx-order-anchor .trade-order-panel {
		display: flex !important;
	}
}

body.trade-fx-page .fx-table-panel {
	grid-row: 4;
	grid-column: 1 / -1;
}

body.trade-fx-page .trade-row-bet {
	display: flex;
	flex-direction: column;
	min-height: 0;
	height: 100%;
}

.trade-echarts-host {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
	left: -9999px;
	top: 0;
}

.trade-echarts-host #chartFrame {
	width: 400px;
	height: 300px;
}

.trade-order-panel {
	padding: 12px;
}

.trade-op-head {
	margin-bottom: 10px;
	flex-shrink: 0;
}

.trade-op-title {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
}

.trade-round-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	margin-bottom: 12px;
	padding: 10px;
	background: var(--fx-panel);
	border: 1px solid var(--fx-border);
	border-radius: 6px;
	flex-shrink: 0;
}

.trade-round-item {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.trade-round-count {
	text-align: center;
}

.trade-round-k {
	font-size: 11px;
	color: var(--fx-muted);
}

.trade-round-v {
	font-size: 13px;
	font-weight: 600;
	color: var(--fx-fg);
}

.trade-round-v.countdown {
	font-size: 20px;
	color: var(--fx-mark);
}

.trade-round-sub {
	font-size: 11px;
	color: var(--fx-muted);
}

.trade-money-block {
	margin-bottom: 12px;
	flex-shrink: 0;
}

.trade-balance-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 10px;
	padding: 8px 10px;
	border: 1px solid var(--fx-border);
	border-radius: 6px;
	background: var(--fx-secondary, rgba(255, 255, 255, 0.04));
}

.trade-balance-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--fx-muted);
}

.trade-balance-value {
	font-size: 14px;
	font-weight: 700;
	color: var(--fx-fg);
	letter-spacing: -0.02em;
}

.trade-balance-unit {
	margin-left: 2px;
	font-size: 12px;
	font-weight: 600;
	color: var(--fx-muted);
}

.trade-money-label {
	display: block;
	margin-bottom: 6px;
	font-size: 12px;
	color: var(--fx-muted);
}

.trade-money-input {
	width: 100%;
	box-sizing: border-box;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--fx-border);
	border-radius: 6px;
	background: var(--fx-panel);
	color: var(--fx-fg);
}

.trade-money-quick {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 6px;
	margin-top: 8px;
}

.trade-money-btn {
	height: 32px;
	border: 1px solid var(--fx-border);
	border-radius: 6px;
	background: var(--fx-secondary);
	color: var(--fx-fg);
	font-size: 11px;
	cursor: pointer;
}

.trade-order-actions {
	flex-shrink: 0;
}

.trade-max-row,
.trade-side-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.trade-max-row {
	margin-bottom: 8px;
}

.trade-max-btn {
	height: 34px;
	border-radius: 6px;
	border: 1px solid var(--fx-border);
	background: var(--fx-secondary);
	color: var(--fx-fg);
	cursor: pointer;
}

.trade-side-row .fx-btn-long,
.trade-side-row .fx-btn-short {
	height: 42px;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

/* 주문패널 하단 — 실시간 거래 결과대기 (기존 UI 복원) */
.trade-pending-box {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--fx-border);
	flex: 1;
	min-height: 120px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.trade-pending-head h2 {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--fx-fg);
}

.trade-pending-body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}

.trade-pending-inline-tbl {
	width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
	font-size: 11px;
}

.trade-pending-inline-tbl col:nth-child(1) { width: 35%; }
.trade-pending-inline-tbl col:nth-child(2) { width: 25%; }
.trade-pending-inline-tbl col:nth-child(3) { width: 20%; }
.trade-pending-inline-tbl col:nth-child(4) { width: 20%; }

.trade-pending-inline-tbl th,
.trade-pending-inline-tbl td {
	padding: 6px 4px;
	border-bottom: 1px solid var(--fx-border);
	text-align: center !important;
	color: var(--fx-fg);
	vertical-align: middle;
	box-sizing: border-box;
	background: transparent !important;
	background-color: transparent !important;
}

.trade-pending-inline-tbl thead th {
	color: var(--fx-muted);
	font-weight: 500;
	font-size: 10px;
	background: rgba(255, 255, 255, 0.02);
	position: sticky;
	top: 0;
	z-index: 1;
}

.trade-char-menu {
	max-height: 420px;
	overflow: auto;
}

.trade-char-menu tr.trade-menu-group {
	cursor: default;
}

.trade-char-menu tr.trade-menu-group td {
	padding: 10px 10px 6px;
	border-bottom: 1px solid var(--fx-border);
	background: rgba(255, 255, 255, 0.03);
	color: var(--fx-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: default;
}

.trade-closed-note {
	margin: 0 0 12px;
	color: #e74c3c;
	font-weight: 700;
}

.trade-period-tabs {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: 8px;
	padding: 2px;
	border: 1px solid var(--fx-border);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.03);
}

.trade-period-tab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 28px;
	padding: 0 10px;
	border-radius: 6px;
	color: var(--fx-muted);
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
}

.trade-period-tab.active {
	background: rgba(168, 85, 247, 0.18);
	color: #c084fc;
}

@media (max-width: 1279px) {
	body.trade-fx-page .fx-pair-content {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		grid-template-areas:
			"picker price"
			"stats stats"
			"tabs tabs";
		align-items: center;
		column-gap: 12px;
		row-gap: 8px;
	}
	body.trade-fx-page .fx-pair-left {
		display: contents;
	}
	body.trade-fx-page .fx-coin-picker { grid-area: picker; }
	body.trade-fx-page .fx-live-price { grid-area: price; }
	body.trade-fx-page .fx-pair-stats {
		grid-area: stats;
		width: 100%;
		flex-wrap: nowrap;
		justify-content: space-between;
		gap: 8px;
	}
	body.trade-fx-page .fx-stat { min-width: 0; }
	body.trade-fx-page .trade-period-tabs {
		grid-area: tabs;
		display: flex;
		width: 100%;
		margin: 0;
	}
	body.trade-fx-page .trade-period-tab {
		flex: 1;
	}
}

.trade-char-menu table {
	width: 100%;
	border-collapse: collapse;
}

.trade-char-menu th,
.trade-char-menu td {
	padding: 8px 10px;
	border-bottom: 1px solid var(--fx-border);
	font-size: 12px;
}

.trade-char-menu tr {
	cursor: pointer;
}

.trade-char-menu tr.on td {
	background: rgba(168, 85, 247, 0.12);
}

.trade-result-tbl .fx-tbl {
	width: 100%;
	table-layout: fixed;
}

body.trade-fx-page .trade-result-tbl .fx-tbl thead th,
body.trade-fx-page .trade-result-tbl .fx-tbl tbody th,
body.trade-fx-page .trade-result-tbl .fx-tbl tbody td {
	text-align: center !important;
	padding: 10px 8px !important;
	vertical-align: middle;
	box-sizing: border-box;
}

body.trade-fx-page .trade-result-tbl .fx-tbl thead th {
	height: 36px;
	color: var(--fx-muted) !important;
	font-weight: 500;
}

body.trade-fx-page .trade-result-tbl .fx-tbl tbody th {
	color: var(--fx-fg) !important;
	font-weight: 400;
}

.trade-result-tbl .fx-tbl th,
.trade-result-tbl .fx-tbl td {
	font-size: 12px;
}

.trade-result-tbl .fx-tbl-scroll {
	overflow-y: auto;
	max-height: 320px;
}

body.trade-fx-page .fx-tpane.active {
	min-height: 0;
}

body.trade-fx-page .fx-tbl-frame {
	margin-top: 12px;
}

.trade-legacy-hidden {
	display: none !important;
}

#backpower {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 90;
	background: rgba(0, 0, 0, 0.45);
}

body.trade-fx-page .char_menu.show,
body.trade-fx-page .fx-coin-menu.show,
body.trade-fx-page .fx-coin-menu.open {
	display: block;
}

body.trade-fx-page .fx-coin-menu {
	min-width: 320px;
	max-width: min(92vw, 420px);
}

body.trade-fx-page .trade-mobile-chart-slot {
	min-height: 45vh;
}

body.trade-fx-page .trade-mobile-chart-slot .fx-chart-frame {
	min-height: 45vh;
}

/* 모바일: futures.css가 fx-desk-tbl 숨김 → trade는 테이블 목록 사용 */
@media (max-width: 767px) {
	body.trade-fx-page .trade-result-tbl.fx-desk-tbl {
		display: block !important;
	}

	body.trade-fx-page .trade-result-tbl .fx-tbl-frame {
		margin-top: 0;
		border: 1px solid var(--fx-border);
		border-radius: 6px;
		background: var(--fx-bg);
	}

	body.trade-fx-page .trade-result-tbl .fx-tbl-scroll {
		overflow-x: auto;
		overflow-y: auto;
		max-height: min(50vh, 420px);
		-webkit-overflow-scrolling: touch;
	}

	body.trade-fx-page .trade-result-tbl .fx-tbl {
		min-width: 320px;
	}

	body.trade-fx-page .fx-table-tabs .fx-ttab-label {
		display: inline !important;
		font-size: 10px;
		line-height: 1.2;
		white-space: nowrap;
	}

	body.trade-fx-page .fx-table-tabs .fx-ttab {
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 4px;
		padding: 8px 2px;
		min-height: 52px;
	}

	body.trade-fx-page .fx-table-tabs .fx-ttab:focus,
	body.trade-fx-page .fx-table-tabs .fx-ttab:focus-visible,
	body.trade-fx-page .fx-table-tabs .fx-ttab:active {
		outline: none !important;
		box-shadow: none !important;
	}

	body.trade-fx-page .fx-table-tabs .fx-ttab-ic {
		width: 16px;
		height: 16px;
	}
}

.bet-complete-toast {
	position: fixed;
	inset: 0;
	z-index: 10050;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}
.bet-complete-toast.is-on {
	visibility: visible;
	opacity: 1;
	transition: opacity 0.4s ease, visibility 0s;
	pointer-events: auto;
}
.bet-complete-toast.is-leave {
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}
.bet-complete-toast__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 14, 28, 0.62);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}
.bet-complete-toast__card {
	position: relative;
	min-width: 280px;
	max-width: 90vw;
	padding: 28px 32px 26px;
	text-align: center;
	background: linear-gradient(155deg, rgba(32, 38, 58, 0.98) 0%, rgba(22, 26, 42, 0.99) 100%);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	box-shadow: 0 0 0 1px rgba(13, 196, 137, 0.12), 0 24px 48px rgba(0, 0, 0, 0.45), 0 0 80px rgba(13, 196, 137, 0.08);
	transform: scale(0.94) translateY(16px);
	opacity: 0;
	transition: transform 0.5s cubic-bezier(0.34, 1.35, 0.64, 1), opacity 0.45s ease;
}
.bet-complete-toast.is-on .bet-complete-toast__card {
	transform: scale(1) translateY(0);
	opacity: 1;
}
.bet-complete-toast.is-leave .bet-complete-toast__card {
	transform: scale(0.96) translateY(-12px);
	opacity: 0;
	transition: transform 0.45s ease, opacity 0.4s ease;
}
.bet-complete-toast__ring {
	position: absolute;
	left: 50%;
	top: 38px;
	width: 56px;
	height: 56px;
	margin: -28px 0 0 -28px;
	border-radius: 50%;
	border: 2px solid rgba(13, 196, 137, 0.35);
	opacity: 0;
	animation: betToastRing 2.2s ease-out infinite;
}
.bet-complete-toast.is-on .bet-complete-toast__ring { opacity: 1; }
@keyframes betToastRing {
	0% { transform: scale(0.85); opacity: 0.6; }
	70% { transform: scale(1.15); opacity: 0; }
	100% { transform: scale(1.15); opacity: 0; }
}
.bet-complete-toast__icon {
	position: relative;
	width: 56px;
	height: 56px;
	margin: 0 auto 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: linear-gradient(145deg, rgba(13, 196, 137, 0.25), rgba(13, 196, 137, 0.08));
	color: #0dc489;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.bet-complete-toast__title {
	margin: 0;
	color: #f8fafc;
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.02em;
}
.bet-complete-toast__sub {
	margin: 8px 0 0;
	color: #94a3b8;
	font-size: 13px;
}
body:not(.dark) .bet-complete-toast__backdrop { background: rgba(15, 23, 42, 0.35); }
body:not(.dark) .bet-complete-toast__card {
	background: #fff;
	border-color: rgba(15, 23, 42, 0.08);
	box-shadow: 0 0 0 1px rgba(13, 196, 137, 0.16), 0 24px 48px rgba(15, 23, 42, 0.14);
}
body:not(.dark) .bet-complete-toast__title { color: #0f172a; }
body:not(.dark) .bet-complete-toast__sub { color: #64748b; }

.round-result-toast {
	position: fixed;
	inset: 0;
	z-index: 10060;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}
.round-result-toast.is-on {
	visibility: visible;
	opacity: 1;
	transition: opacity 0.3s ease, visibility 0s;
	pointer-events: auto;
}
.round-result-toast.is-leave {
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}
.round-result-toast__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(8, 12, 24, 0.58);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}
.round-result-toast__card {
	position: relative;
	min-width: 260px;
	max-width: 90vw;
	padding: 32px 36px 28px;
	text-align: center;
	border-radius: 18px;
	background: linear-gradient(160deg, rgba(28, 34, 52, 0.98), rgba(16, 20, 34, 0.99));
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
	transform: scale(0.9) translateY(18px);
	opacity: 0;
	transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.35s ease;
}
.round-result-toast.is-on .round-result-toast__card {
	transform: scale(1) translateY(0);
	opacity: 1;
}
.round-result-toast.is-leave .round-result-toast__card {
	transform: scale(0.96) translateY(-10px);
	opacity: 0;
}
.round-result-toast__mark {
	width: 72px;
	height: 72px;
	margin: 0 auto 14px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.round-result-toast__up,
.round-result-toast__down { display: none; }
.round-result-toast.is-long .round-result-toast__up,
.round-result-toast.is-short .round-result-toast__down { display: block; }
.round-result-toast.is-long .round-result-toast__mark {
	color: #0dc489;
	background: rgba(13, 196, 137, 0.16);
	box-shadow: 0 0 0 8px rgba(13, 196, 137, 0.08);
}
.round-result-toast.is-short .round-result-toast__mark {
	color: #ff5b6e;
	background: rgba(212, 63, 58, 0.16);
	box-shadow: 0 0 0 8px rgba(212, 63, 58, 0.08);
}
.round-result-toast__title {
	margin: 0;
	font-size: 32px;
	font-weight: 800;
	letter-spacing: -0.03em;
	color: #f8fafc;
}
.round-result-toast.is-long .round-result-toast__title { color: #0dc489; }
.round-result-toast.is-short .round-result-toast__title { color: #ff6b78; }
.round-result-toast__sub {
	margin: 8px 0 0;
	color: #cbd5e1;
	font-size: 15px;
	font-weight: 600;
}
body:not(.dark) .round-result-toast__backdrop { background: rgba(15, 23, 42, 0.35); }
body:not(.dark) .round-result-toast__card {
	background: #fff;
	border-color: rgba(15, 23, 42, 0.08);
}
body:not(.dark) .round-result-toast__sub { color: #475569; }
