/* ============================================================================
   MOBILE LAYOUT MODE — Phones only (<768px)
   Single-panel-at-a-time with bottom tab bar navigation
   All styles scoped under .docking-platform.mobile-mode to avoid conflicts
   ============================================================================ */

/* --- Core Layout Structure ---
   Use position: fixed to fill the actual visible viewport on mobile.
   This avoids the 100vh problem on mobile browsers where 100vh includes
   the browser chrome (address bar + system nav bar), making the tab bar
   invisible below the fold. Fixed positioning fills exactly the visible area. */
.docking-platform.mobile-mode {
	position: fixed !important;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	height: 100dvh; /* Dynamic viewport height — excludes browser chrome on real phones */
	display: flex !important;
	flex-direction: column;
	overflow: hidden;
	overscroll-behavior: none;
	background: var(--bg, #0d0d0d);
	z-index: 100;
}

/* Prevent body scroll behind fixed mobile layout */
body.mobile-scroll-lock,
html.mobile-scroll-lock {
	overflow: hidden !important;
	height: 100% !important;
	overscroll-behavior: none;
}

/* On mobile (<960px), fix layout issues when Odin is active:
   1) .dashboard:has(.sidebar.hidden-for-odin) sets grid-template-columns: 0 1fr
      which has higher specificity than the mobile .dashboard { 1fr } rule.
      Since the sidebar is position:fixed on mobile (out of flow), .content lands
      in the 0-width first column. Override to single-column layout.
   2) Hide the dashboard mobile topbar — Odin has its own top bar with hamburger.
   3) Remove dashboard margin-top since the dashboard topbar is hidden. */
@media (max-width: 960px) {
	.dashboard:has(.sidebar.hidden-for-odin) {
		grid-template-columns: 1fr !important;
	}
	.dashboard:has(.sidebar.hidden-for-odin.show-collapsed) {
		grid-template-columns: 1fr !important;
	}
	body:has(.trading-platform-panel.active) #mobile-topbar {
		display: none !important;
	}
	body:has(.trading-platform-panel.active) .dashboard {
		margin-top: 0 !important;
	}
	/* Sidebar overlay when opened via hamburger in Odin mobile mode */
	.sidebar.hidden-for-odin.mobile-sidebar-open {
		position: fixed !important;
		top: 0 !important;
		left: 0 !important;
		width: 280px !important;
		height: 100% !important;
		height: 100dvh !important;
		z-index: 10000 !important;
		opacity: 1 !important;
		pointer-events: auto !important;
		overflow-y: auto !important;
		padding: 16px !important;
		box-shadow: 4px 0 24px rgba(0,0,0,0.4);
		transform: translateX(0);
		transition: transform 0.25s ease, opacity 0.2s ease;
	}
}

/* Mobile sidebar backdrop (scrim) */
.mobile-sidebar-backdrop {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(0,0,0,0.5);
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}
.mobile-sidebar-backdrop.visible {
	opacity: 1;
	pointer-events: auto;
}

/* --- Mobile Top Bar --- */
.dp-mobile-top-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	background: var(--surface, #1a1a1a);
	border-bottom: 1px solid var(--border, #333);
	flex-shrink: 0;
	min-height: 44px;
	z-index: 100;
}

.dp-mobile-hamburger {
	width: 36px;
	height: 36px;
	border: none;
	background: transparent;
	color: var(--text, #fff);
	font-size: 16px;
	cursor: pointer;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	-webkit-tap-highlight-color: transparent;
}

.dp-mobile-hamburger:active {
	background: rgba(255, 255, 255, 0.1);
}

.dp-mobile-brand {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.dp-mobile-logo {
	width: 24px;
	height: 24px;
	object-fit: contain;
}

.dp-mobile-title {
	font-weight: 700;
	font-size: 15px;
	color: var(--text, #fff);
}

.dp-mobile-account-btn {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	background: var(--bg, #0d0d0d);
	border: 1px solid var(--border, #333);
	border-radius: 6px;
	font-size: 12px;
	color: var(--text, #fff);
	cursor: pointer;
	overflow: hidden;
	min-height: 32px;
	-webkit-tap-highlight-color: transparent;
}

.dp-mobile-account-btn i.fa-chevron-down {
	font-size: 10px;
	color: var(--muted, #888);
	flex-shrink: 0;
}

.dp-mobile-account-text {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: left;
}

.dp-mobile-account-icon {
	width: 14px;
	height: 14px;
	border-radius: 2px;
	flex-shrink: 0;
}

.dp-mobile-status {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.dp-mobile-pnl {
	font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}

.dp-mobile-pnl.positive {
	color: #10b981;
}

.dp-mobile-pnl.negative {
	color: #ef4444;
}

.dp-mobile-pnl.zero {
	color: var(--muted, #888);
}

.dp-mobile-ws-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #ef4444;
	flex-shrink: 0;
	transition: background 0.3s;
}

.dp-mobile-ws-dot.connected {
	background: #10b981;
}

/* --- Module Container (full screen between bars) --- */
.dp-mobile-container {
	flex: 1;
	width: 100%;
	overflow: hidden;
	position: relative;
	min-height: 0;
	background: var(--bg, #0d0d0d);
}

/* Ensure modules fill the mobile container (only when not in flex column mode for chart+action bar) */
.dp-mobile-container > *:only-child {
	height: 100%;
	width: 100%;
}

/* When chart tab is active, container is flex-column — children use flex sizing */
.dp-mobile-container[style*="flex"] > #dp-mobile-chart-wrapper {
	width: 100%;
}

.dp-mobile-container[style*="flex"] > .dp-mobile-action-bar {
	width: 100%;
}

/* --- Bottom Tab Bar --- */
.dp-mobile-tab-bar {
	display: flex;
	align-items: stretch;
	background: var(--surface, #1a1a1a);
	border-top: 1px solid var(--border, #333);
	flex-shrink: 0;
	height: 56px;
	padding-bottom: env(safe-area-inset-bottom, 0);
	z-index: 100;
}

.dp-mobile-tab {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	border: none;
	background: transparent;
	color: var(--muted, #888);
	font-size: 10px;
	font-weight: 500;
	cursor: pointer;
	transition: color 0.15s;
	padding: 6px 0;
	-webkit-tap-highlight-color: transparent;
	min-width: 44px;
	min-height: 44px;
	position: relative;
}

.dp-mobile-tab i {
	font-size: 18px;
	transition: color 0.15s;
}

.dp-mobile-tab.active {
	color: var(--primary, #3b82f6);
}

.dp-mobile-tab.active::before {
	content: '';
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 24px;
	height: 2px;
	background: var(--primary, #3b82f6);
	border-radius: 0 0 2px 2px;
}

/* --- "More" Menu Overlay --- */
.dp-mobile-more-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	z-index: 10000;
	display: flex;
	align-items: flex-end;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.dp-mobile-more-drawer {
	width: 100%;
	background: var(--surface, #1a1a1a);
	border-radius: 16px 16px 0 0;
	padding: 16px;
	padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
	animation: dp-mobile-drawer-up 0.25s ease-out;
}

@keyframes dp-mobile-drawer-up {
	from { transform: translateY(100%); }
	to { transform: translateY(0); }
}

.dp-mobile-drawer-down {
	animation: dp-mobile-drawer-down-anim 0.2s ease-in forwards;
}

@keyframes dp-mobile-drawer-down-anim {
	from { transform: translateY(0); }
	to { transform: translateY(100%); }
}

.dp-mobile-more-handle {
	width: 36px;
	height: 4px;
	background: var(--border, #444);
	border-radius: 2px;
	margin: 0 auto 12px;
}

.dp-mobile-more-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
	font-size: 15px;
	font-weight: 600;
	color: var(--text, #fff);
}

.dp-mobile-more-close {
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	color: var(--muted, #888);
	font-size: 16px;
	cursor: pointer;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	-webkit-tap-highlight-color: transparent;
}

.dp-mobile-more-list {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
}

.dp-mobile-more-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 16px 8px;
	border: 1px solid var(--border, #333);
	border-radius: 10px;
	background: var(--bg, #0d0d0d);
	color: var(--text, #fff);
	font-size: 11px;
	font-weight: 500;
	cursor: pointer;
	min-height: 44px;
	-webkit-tap-highlight-color: transparent;
	transition: border-color 0.15s, background 0.15s;
}

.dp-mobile-more-item:active {
	background: var(--surface, #1a1a1a);
	border-color: var(--primary, #3b82f6);
}

.dp-mobile-more-item i {
	font-size: 20px;
	color: var(--primary, #3b82f6);
}

/* --- Account Selector Drawer --- */
.dp-mobile-account-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	z-index: 10000;
	display: flex;
	align-items: flex-end;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.dp-mobile-account-drawer {
	width: 100%;
	max-height: 60vh;
	background: var(--surface, #1a1a1a);
	border-radius: 16px 16px 0 0;
	padding: 16px;
	padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
	animation: dp-mobile-drawer-up 0.25s ease-out;
	display: flex;
	flex-direction: column;
}

.dp-mobile-account-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
	flex-shrink: 0;
}

.dp-mobile-account-drawer-header span {
	font-size: 15px;
	font-weight: 600;
	color: var(--text, #fff);
}

.dp-mobile-account-drawer-close {
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	color: var(--muted, #888);
	font-size: 16px;
	cursor: pointer;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	-webkit-tap-highlight-color: transparent;
}

.dp-mobile-account-list {
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.dp-mobile-account-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px;
	border: 1px solid var(--border, #333);
	border-radius: 8px;
	background: var(--bg, #0d0d0d);
	color: var(--text, #fff);
	font-size: 13px;
	cursor: pointer;
	min-height: 44px;
	-webkit-tap-highlight-color: transparent;
	transition: border-color 0.15s;
}

.dp-mobile-account-item:active,
.dp-mobile-account-item.active {
	border-color: var(--primary, #3b82f6);
	background: rgba(59, 130, 246, 0.08);
}

.dp-mobile-account-item .account-name {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dp-mobile-account-item .account-check {
	color: var(--primary, #3b82f6);
	font-size: 14px;
}

.dp-mobile-account-item img {
	width: 18px;
	height: 18px;
	border-radius: 3px;
	flex-shrink: 0;
}

/* ============================================================================
   MODULE-SPECIFIC MOBILE OVERRIDES
   ============================================================================ */

/* --- Phoenix Chart on Mobile --- */
.mobile-mode .phoenix-chart-module {
	height: 100% !important;
	width: 100% !important;
	touch-action: none;
}

/* Hide chart top toolbar entirely — action bar replaces it */
.mobile-mode .phoenix-toolbar {
	display: none !important;
}

/* Hide chart left drawing toolbar entirely — drawing modal replaces it */
.mobile-mode .phoenix-drawing-toolbar {
	display: none !important;
}

/* Hide the drawing toolbar CONTAINER (parent wrapper that reserves 44px width) */
.mobile-mode .phoenix-chart-drawing-toolbar {
	display: none !important;
}

/* Multi-chart layout selector: hide on mobile (always single chart) */
.mobile-mode .phoenix-layout-selector {
	display: none !important;
}

/* Chart OHLC overlay: compact */
.mobile-mode .phoenix-chart-ohlc {
	font-size: 10px;
	gap: 6px;
	top: 4px;
	left: 4px;
}

/* --- Order Entry on Mobile --- */
.mobile-mode .orders-module {
	padding: 12px !important;
	gap: 10px !important;
}

/* Symbol selector button */
.mobile-mode .orders-symbol-btn {
	min-height: 44px !important;
	padding: 8px 12px !important;
}

/* Symbol dropdown: full screen on mobile */
.mobile-mode .orders-symbol-dropdown {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	max-height: 100vh !important;
	max-height: 100dvh !important;
	width: 100% !important;
	margin: 0 !important;
	border-radius: 0 !important;
	z-index: 10001 !important;
}

.mobile-mode .orders-symbol-search {
	min-height: 44px !important;
	font-size: 16px !important;
	padding: 10px 14px !important;
}

.mobile-mode .orders-symbol-list {
	max-height: calc(100vh - 120px) !important;
	max-height: calc(100dvh - 120px) !important;
}

/* Quantity controls */
.mobile-mode .orders-qty-minus,
.mobile-mode .orders-qty-plus {
	width: 40px !important;
	height: 40px !important;
	font-size: 18px !important;
}

.mobile-mode .orders-qty-input {
	width: 56px !important;
	height: 40px !important;
	font-size: 18px !important;
}

.mobile-mode .orders-qty-preset {
	padding: 8px 10px !important;
	font-size: 12px !important;
	min-height: 36px !important;
	min-width: 36px !important;
}

/* Order type & price inputs */
.mobile-mode .orders-type-select {
	min-height: 40px !important;
	font-size: 14px !important;
}

.mobile-mode .orders-price-input {
	min-height: 40px !important;
	font-size: 16px !important;
}

/* BUY / SELL buttons: large touch targets */
.mobile-mode .orders-buy-btn {
	padding: 14px 12px !important;
	font-size: 15px !important;
	min-height: 48px !important;
	border-radius: 8px !important;
}

.mobile-mode .orders-sell-btn {
	padding: 14px 12px !important;
	font-size: 15px !important;
	min-height: 48px !important;
	border-radius: 8px !important;
}

/* Flatten button */
.mobile-mode .orders-flatten-btn {
	padding: 12px !important;
	font-size: 13px !important;
	min-height: 44px !important;
	border-radius: 8px !important;
}

/* Bracket inputs */
.mobile-mode .orders-tp-ticks,
.mobile-mode .orders-sl-ticks,
.mobile-mode .orders-tp-price,
.mobile-mode .orders-sl-price,
.mobile-mode .orders-tp-dollars,
.mobile-mode .orders-sl-dollars,
.mobile-mode .orders-sl-ticks-ratio {
	min-height: 36px !important;
	font-size: 14px !important;
}

/* --- Positions on Mobile --- */
.mobile-mode .positions-module {
	background: var(--bg, #0d0d0d);
}

.mobile-mode .positions-toolbar {
	min-height: 40px !important;
	padding: 8px 12px !important;
}

.mobile-mode .positions-content {
	padding: 0 !important;
}

.mobile-mode .positions-module table {
	font-size: 12px;
	width: 100%;
}

.mobile-mode .positions-module th {
	padding: 8px 6px !important;
	font-size: 10px !important;
	white-space: nowrap;
}

.mobile-mode .positions-module td {
	padding: 10px 6px !important;
	white-space: nowrap;
}

.mobile-mode .position-close-btn {
	padding: 8px 12px !important;
	font-size: 12px !important;
	min-height: 36px !important;
	min-width: 44px !important;
}

.mobile-mode .positions-refresh-btn {
	min-width: 36px !important;
	min-height: 36px !important;
}

/* --- Orders Module on Mobile --- */
.mobile-mode .orders-table-module table {
	font-size: 11px;
}

.mobile-mode .orders-table-module th,
.mobile-mode .orders-table-module td {
	padding: 10px 6px !important;
	white-space: nowrap;
}

/* --- Accounts Module on Mobile --- */
.mobile-mode .accounts-module table {
	font-size: 12px;
}

.mobile-mode .accounts-module th,
.mobile-mode .accounts-module td {
	padding: 10px 8px !important;
}

/* --- Trades Module on Mobile --- */
.mobile-mode .trades-module table {
	font-size: 11px;
}

.mobile-mode .trades-module th,
.mobile-mode .trades-module td {
	padding: 10px 6px !important;
	white-space: nowrap;
}

/* --- Quotes Module on Mobile --- */
.mobile-mode .quotes-module table {
	font-size: 11px;
}

.mobile-mode .quotes-module th,
.mobile-mode .quotes-module td {
	padding: 10px 6px !important;
}

/* ============================================================================
   SYMBOL SELECTOR MODAL (full screen)
   ============================================================================ */
.dp-mobile-symbol-overlay {
	position: fixed;
	inset: 0;
	background: var(--bg, #0d0d0d);
	z-index: 10001;
	display: flex;
	flex-direction: column;
}

.dp-mobile-symbol-modal {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.dp-mobile-symbol-header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: var(--surface, #1a1a1a);
	border-bottom: 1px solid var(--border, #333);
	flex-shrink: 0;
}

.dp-mobile-symbol-search {
	flex: 1;
	min-height: 44px;
	padding: 8px 14px;
	background: var(--bg, #0d0d0d);
	border: 1px solid var(--border, #333);
	border-radius: 8px;
	color: var(--text, #fff);
	font-size: 16px;
	outline: none;
}

.dp-mobile-symbol-search::placeholder {
	color: var(--muted, #888);
}

.dp-mobile-symbol-close {
	width: 44px;
	height: 44px;
	border: none;
	background: transparent;
	color: var(--muted, #888);
	font-size: 18px;
	cursor: pointer;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	-webkit-tap-highlight-color: transparent;
}

.dp-mobile-symbol-list {
	flex: 1;
	overflow-y: auto;
	padding: 8px 0;
}

.dp-mobile-symbol-category {
	padding: 8px 16px 6px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	display: flex;
	align-items: center;
	gap: 6px;
	border-left: 3px solid transparent;
	background: var(--bg, #0d0d0d);
}

.dp-mobile-symbol-item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 12px 16px;
	border: none;
	border-left: 3px solid transparent;
	background: transparent;
	color: var(--text, #fff);
	font-size: 14px;
	cursor: pointer;
	text-align: left;
	-webkit-tap-highlight-color: transparent;
}

.dp-mobile-symbol-item:active {
	background: rgba(255, 255, 255, 0.05);
}

.dp-mobile-symbol-item.active {
	background: rgba(59, 130, 246, 0.1);
}

.dp-mobile-symbol-code {
	font-weight: 700;
	min-width: 50px;
}

.dp-mobile-symbol-name {
	flex: 1;
	color: var(--muted, #aaa);
	font-size: 13px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dp-mobile-symbol-exchange {
	font-size: 11px;
	color: var(--muted, #666);
	flex-shrink: 0;
}

/* ============================================================================
   DRAWING TOOLS MODAL (bottom sheet)
   ============================================================================ */
.dp-mobile-drawing-modal {
	width: 100%;
	max-height: 75vh;
	background: var(--surface, #1a1a1a);
	border-radius: 16px 16px 0 0;
	padding: 16px;
	padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
	animation: dp-mobile-drawer-up 0.25s ease-out;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.dp-mobile-drawing-list {
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.dp-mobile-drawing-category {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.dp-mobile-drawing-cat-header {
	font-size: 12px;
	font-weight: 600;
	color: var(--muted, #888);
	padding: 0 4px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.dp-mobile-drawing-cat-header i {
	font-size: 12px;
	width: 16px;
	text-align: center;
	color: var(--primary, #3b82f6);
}

.dp-mobile-drawing-cat-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.dp-mobile-drawing-tool {
	padding: 8px 12px;
	border: 1px solid var(--border, #333);
	border-radius: 8px;
	background: var(--bg, #0d0d0d);
	color: var(--text, #fff);
	font-size: 12px;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.dp-mobile-drawing-tool:active {
	background: rgba(59, 130, 246, 0.15);
	border-color: var(--primary, #3b82f6);
}

.dp-mobile-drawing-tool-icon {
	display: flex;
	flex-shrink: 0;
}

.dp-mobile-drawing-tool-icon svg {
	color: var(--text-secondary, #9ca3af);
}

/* Drawing tools search field (matches dashboard.js dnd-pool-search pattern) */
.dp-mobile-drawing-search {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	margin: 0 16px 12px;
	background: var(--bg, #0d0d0d);
	border: 1px solid var(--border, #333);
	border-radius: 6px;
	flex-shrink: 0;
}

.dp-mobile-drawing-search i.fa-search {
	color: var(--muted, #6b7280);
	font-size: 12px;
	flex-shrink: 0;
}

.dp-mobile-drawing-search input {
	flex: 1;
	border: none;
	background: transparent;
	font-size: 12px;
	color: var(--text, #fff);
	outline: none;
	min-width: 0;
}

.dp-mobile-drawing-search input::placeholder {
	color: var(--muted, #6b7280);
}

.dp-mobile-drawing-search .search-clear {
	background: none;
	border: none;
	padding: 2px 4px;
	cursor: pointer;
	color: var(--muted, #6b7280);
	font-size: 11px;
	opacity: 0.7;
	transition: opacity 0.15s;
}

.dp-mobile-drawing-search .search-clear:hover {
	opacity: 1;
	color: var(--text, #fff);
}

/* ============================================================================
   TOAST / NOTIFICATION MOBILE ADJUSTMENTS
   ============================================================================ */
.mobile-mode .dp-toast {
	left: 12px !important;
	right: 12px !important;
	bottom: calc(68px + env(safe-area-inset-bottom, 0)) !important;
	max-width: none !important;
}

/* ============================================================================
   SCROLLBAR STYLING FOR MOBILE CONTAINERS
   ============================================================================ */
.dp-mobile-container::-webkit-scrollbar,
.dp-mobile-account-list::-webkit-scrollbar {
	width: 4px;
}

.dp-mobile-container::-webkit-scrollbar-track,
.dp-mobile-account-list::-webkit-scrollbar-track {
	background: transparent;
}

.dp-mobile-container::-webkit-scrollbar-thumb,
.dp-mobile-account-list::-webkit-scrollbar-thumb {
	background: var(--border, #333);
	border-radius: 2px;
}

/* ============================================================================
   MOBILE CHART ACTION BAR
   Compact trade bar below chart: symbol | draw | qty | Buy/Sell
   ============================================================================ */
.dp-mobile-action-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 8px;
	background: var(--surface, #1a1a1a);
	border-top: 1px solid var(--border, #333);
	flex-shrink: 0;
	min-height: 48px;
	z-index: 10;
	-webkit-tap-highlight-color: transparent;
}

.dp-action-symbol-btn {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 6px 10px;
	border-radius: 6px;
	background: var(--bg, #0d0d0d);
	border: 1px solid var(--border, #333);
	color: var(--text, #fff);
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
	min-height: 36px;
	-webkit-tap-highlight-color: transparent;
}

.dp-action-symbol-btn:active {
	background: rgba(255, 255, 255, 0.05);
}

.dp-action-tf-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 6px 10px;
	border-radius: 6px;
	background: var(--bg, #0d0d0d);
	border: 1px solid var(--border, #333);
	color: var(--muted, #888);
	font-weight: 600;
	font-size: 12px;
	cursor: pointer;
	white-space: nowrap;
	min-height: 36px;
	-webkit-tap-highlight-color: transparent;
}

.dp-action-tf-btn:active {
	background: rgba(255, 255, 255, 0.05);
}

.dp-action-tf-btn.active {
	color: var(--primary, #3b82f6);
	border-color: var(--primary, #3b82f6);
	background: rgba(59, 130, 246, 0.1);
}

.dp-action-draw-btn {
	width: 36px;
	height: 36px;
	border-radius: 6px;
	border: 1px solid var(--border, #333);
	background: var(--bg, #0d0d0d);
	color: var(--muted, #888);
	font-size: 14px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	-webkit-tap-highlight-color: transparent;
}

.dp-action-draw-btn.active {
	color: var(--primary, #3b82f6);
	border-color: var(--primary, #3b82f6);
	background: rgba(59, 130, 246, 0.1);
}

.dp-action-separator {
	width: 1px;
	height: 24px;
	background: var(--border, #333);
	flex-shrink: 0;
}

/* More options button (3-dots) */
.dp-action-more-btn {
	width: 36px;
	height: 36px;
	border-radius: 6px;
	border: 1px solid var(--border, #333);
	background: var(--bg, #0d0d0d);
	color: var(--muted, #888);
	font-size: 14px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	-webkit-tap-highlight-color: transparent;
}

.dp-action-more-btn:active {
	background: rgba(255, 255, 255, 0.05);
}

/* Compact quantity selector with stacked spinners */
.dp-action-qty-group {
	display: flex;
	align-items: center;
	position: relative;
	height: 32px;
	flex-shrink: 0;
}

.dp-action-qty-input {
	width: 42px;
	height: 32px;
	text-align: left;
	padding: 0 18px 0 6px;
	background: var(--bg, #0d0d0d);
	border: 1px solid var(--border, #333);
	border-radius: 6px;
	color: var(--text, #fff);
	font-size: 14px;
	font-weight: 600;
	-moz-appearance: textfield;
}

.dp-action-qty-input::-webkit-outer-spin-button,
.dp-action-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.dp-action-qty-spinners {
	position: absolute;
	right: 2px;
	top: 2px;
	bottom: 2px;
	display: flex;
	flex-direction: column;
	width: 16px;
}

.dp-action-qty-spin {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	color: var(--muted, #888);
	font-size: 8px;
	cursor: pointer;
	padding: 0;
	-webkit-tap-highlight-color: transparent;
}

.dp-action-qty-spin:active {
	color: var(--text, #fff);
}

.dp-action-buy-btn,
.dp-action-sell-btn {
	flex: 1;
	min-height: 36px;
	border: none;
	border-radius: 6px;
	font-weight: 700;
	font-size: 12px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	transition: opacity 0.15s;
	-webkit-tap-highlight-color: transparent;
}

.dp-action-buy-btn {
	background: #10b981;
	color: #fff;
}

.dp-action-sell-btn {
	background: #ef4444;
	color: #fff;
}

.dp-action-buy-btn:active,
.dp-action-sell-btn:active {
	opacity: 0.7;
}

/* Flash animation on order placement */
.dp-action-buy-btn.flash,
.dp-action-sell-btn.flash {
	animation: dp-action-flash 0.3s ease-out;
}

@keyframes dp-action-flash {
	0% { transform: scale(0.95); }
	50% { transform: scale(1.02); }
	100% { transform: scale(1); }
}

/* ============================================================================
   TIMEFRAME STRIP — Horizontal scrollable TradingView-style selector
   ============================================================================ */
.dp-mobile-timeframe-strip {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	background: var(--surface, #1a1a1a);
	border-top: 1px solid var(--border, #333);
	flex-shrink: 0;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.dp-mobile-timeframe-strip::-webkit-scrollbar {
	display: none;
}

.dp-mobile-timeframe-strip.hidden {
	display: none;
}

.dp-tf-pill {
	flex-shrink: 0;
	padding: 5px 12px;
	border-radius: 20px;
	border: none;
	background: transparent;
	color: var(--muted, #888);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
	-webkit-tap-highlight-color: transparent;
	min-height: 28px;
	white-space: nowrap;
}

.dp-tf-pill:active {
	background: rgba(255, 255, 255, 0.05);
}

.dp-tf-pill.active {
	background: var(--primary, #3b82f6);
	color: #fff;
}

/* ============================================================================
   ULTRA-SMALL SCREENS (<380px)
   ============================================================================ */
@media (max-width: 380px) {
	.dp-mobile-top-bar {
		padding: 4px 8px;
		gap: 6px;
	}

	.dp-mobile-brand {
		display: none;
	}

	.dp-mobile-tab-bar {
		height: 50px;
	}

	.dp-mobile-tab {
		font-size: 9px;
	}

	.dp-mobile-tab i {
		font-size: 16px;
	}

	.dp-mobile-more-list {
		grid-template-columns: repeat(3, 1fr);
	}

	/* Action bar compact */
	.dp-mobile-action-bar {
		gap: 4px;
		padding: 4px 6px;
	}

	.dp-action-symbol-btn {
		font-size: 11px;
		padding: 4px 6px;
	}

	.dp-action-tf-btn {
		font-size: 10px;
		padding: 4px 6px;
	}

	.dp-action-buy-btn,
	.dp-action-sell-btn {
		font-size: 11px;
	}

	.dp-action-qty-btn {
		width: 28px;
		height: 28px;
	}

	.dp-action-qty-input {
		width: 32px;
		height: 28px;
		font-size: 12px;
	}

	.dp-mobile-timeframe-strip {
		gap: 4px;
		padding: 3px 6px;
	}

	.dp-tf-pill {
		padding: 4px 8px;
		font-size: 11px;
		min-height: 24px;
	}
}

/* ============================================================================
   MORE MENU — Chart Options Bottom Sheet
   ============================================================================ */

.dp-mobile-more-menu {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	max-height: 80vh;
	background: var(--surface, #1a1a1a);
	border-radius: 12px 12px 0 0;
	overflow-y: auto;
	animation: dp-mobile-drawer-up 0.25s ease-out;
}

.dp-mobile-more-content {
	padding: 0 16px 20px;
}

.dp-more-section {
	margin-bottom: 16px;
}

.dp-more-section-title {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--muted, #888);
	padding: 8px 0 6px;
}

/* Collapsible section title */
.dp-more-collapsible {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	padding: 10px 0 6px;
	-webkit-tap-highlight-color: transparent;
}

.dp-more-collapse-icon {
	font-size: 10px;
	transition: transform 0.2s;
}

.dp-more-collapsible.expanded .dp-more-collapse-icon {
	transform: rotate(180deg);
}

/* Featured items (Indicators, Alerts) */
.dp-more-featured {
	display: flex;
	gap: 10px;
	margin-bottom: 20px;
}

.dp-more-featured-item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 14px 6px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--border, #333);
	border-radius: 10px;
	color: var(--text, #fff);
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.dp-more-featured-item:active {
	background: rgba(255, 255, 255, 0.08);
}

.dp-more-featured-icon {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(59, 130, 246, 0.15);
	color: var(--primary, #3b82f6);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
}

.dp-more-featured-icon.alert {
	background: rgba(245, 158, 11, 0.15);
	color: #f59e0b;
}

.dp-more-featured-icon.manage {
	background: rgba(139, 92, 246, 0.15);
	color: #8b5cf6;
}

/* Chart type radio list */
.dp-more-charttype-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	overflow: hidden;
	transition: max-height 0.25s ease, opacity 0.2s ease;
	max-height: 300px;
	opacity: 1;
}

.dp-more-charttype-list.collapsed {
	max-height: 0;
	opacity: 0;
}

.dp-more-charttype-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	background: transparent;
	border: none;
	border-radius: 6px;
	color: var(--text-secondary, #9ca3af);
	font-size: 14px;
	cursor: pointer;
	text-align: left;
	-webkit-tap-highlight-color: transparent;
}

.dp-more-charttype-item:active {
	background: rgba(255, 255, 255, 0.05);
}

.dp-more-charttype-item.active {
	color: var(--primary, #3b82f6);
	background: rgba(59, 130, 246, 0.1);
}

.dp-more-charttype-item svg {
	flex-shrink: 0;
	color: inherit;
}

/* Action items (Indicators, Alerts, Settings) */
.dp-more-action-item {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 12px;
	background: transparent;
	border: none;
	border-radius: 6px;
	color: var(--text, #fff);
	font-size: 14px;
	cursor: pointer;
	text-align: left;
	-webkit-tap-highlight-color: transparent;
}

.dp-more-action-item:active {
	background: rgba(255, 255, 255, 0.05);
}

.dp-more-action-item i {
	width: 18px;
	text-align: center;
	color: var(--muted, #888);
	font-size: 14px;
}

/* Toggle items (Trade History, Calendar, Click Trading) */
.dp-more-toggle-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px;
	border-radius: 6px;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.dp-more-toggle-item:active {
	background: rgba(255, 255, 255, 0.05);
}

.dp-more-toggle-label {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--text, #fff);
	font-size: 14px;
}

.dp-more-toggle-label i {
	width: 18px;
	text-align: center;
	color: var(--muted, #888);
	font-size: 14px;
}

/* Toggle switch */
.dp-more-toggle-switch {
	width: 40px;
	height: 22px;
	border-radius: 11px;
	background: var(--border, #333);
	position: relative;
	transition: background 0.2s;
	flex-shrink: 0;
}

.dp-more-toggle-switch.on {
	background: var(--primary, #3b82f6);
}

.dp-more-toggle-knob {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	position: absolute;
	top: 2px;
	left: 2px;
	transition: transform 0.2s;
}

.dp-more-toggle-switch.on .dp-more-toggle-knob {
	transform: translateX(18px);
}
