:root {
	color-scheme: dark;
	--bg: #07090e;
	--bg-card: #0e131f;
	--bg-card-subtle: #141b2d;
	--bg-input: #0b0f19;
	--fg: #f3f4f6;
	--fg-muted: #9ca3af;
	--fg-dim: #6b7280;
	
	--accent: #3b82f6;
	--accent-hover: #2563eb;
	--accent-glow: rgba(59, 130, 246, 0.25);
	
	--green: #10b981;
	--green-glow: rgba(16, 185, 129, 0.2);
	--green-bg: rgba(16, 185, 129, 0.12);
	
	--red: #ef4444;
	--red-bg: rgba(239, 68, 68, 0.12);
	
	--purple: #8b5cf6;
	--purple-bg: rgba(139, 92, 246, 0.15);
	
	--border: #1f293d;
	--border-light: #2d3748;
	--border-focus: #3b82f6;
	
	--radius-sm: 8px;
	--radius: 14px;
	--radius-lg: 20px;
	--radius-full: 9999px;
	
	--space: 1rem;
	--font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
	--font-mono: "JetBrains Mono", monospace;
	
	--shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
	--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
	--shadow-glow: 0 0 35px rgba(59, 130, 246, 0.15);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: radial-gradient(circle at 50% 0%, #151c30 0%, #07090e 65%);
	background-attachment: fixed;
	color: var(--fg);
	font-family: var(--font);
	line-height: 1.5;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}

/* Shell Layout */
.shell {
	max-width: 76rem;
	margin: 0 auto;
	padding: 1rem 1rem 3.5rem;
}

@media (min-width: 48rem) {
	.shell {
		padding: 1.5rem 1.5rem 4rem;
	}
}

/* Header & Navigation */
.header-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 1.25rem;
	background: rgba(14, 19, 31, 0.85);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	margin-bottom: 1.5rem;
}

.brand-wrap {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
}

.brand-icon {
	width: 2.25rem;
	height: 2.25rem;
	background: linear-gradient(135deg, #3b82f6, #8b5cf6);
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 16px rgba(59, 130, 246, 0.5);
	color: white;
	font-weight: 800;
	font-size: 1.15rem;
}

.brand-title {
	font-size: 1.15rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	background: linear-gradient(to right, #ffffff, #93c5fd);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.live-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.2rem 0.6rem;
	border-radius: var(--radius-full);
	background: var(--green-bg);
	color: var(--green);
	border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--green);
	box-shadow: 0 0 8px var(--green);
	animation: pulse 1.8s infinite;
}

@keyframes pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.4; transform: scale(0.85); }
}

.nav-tabs {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	background: var(--bg-input);
	padding: 0.3rem;
	border-radius: var(--radius-full);
	border: 1px solid var(--border);
	overflow-x: auto;
	scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
	display: none;
}

.nav-btn {
	background: transparent;
	border: none;
	color: var(--fg-muted);
	padding: 0.45rem 0.95rem;
	border-radius: var(--radius-full);
	font-weight: 600;
	font-size: 0.875rem;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.15s ease;
	white-space: nowrap;
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.nav-btn:hover {
	color: var(--fg);
}

.nav-btn.active {
	background: var(--accent);
	color: #fff;
	box-shadow: 0 2px 10px var(--accent-glow);
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

/* Market Ticker Bar */
.ticker-strip {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	padding: 0.6rem 1rem;
	background: rgba(14, 19, 31, 0.6);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	margin-bottom: 1.5rem;
	overflow-x: auto;
	scrollbar-width: none;
}

.ticker-strip::-webkit-scrollbar {
	display: none;
}

.ticker-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.8125rem;
	white-space: nowrap;
	cursor: pointer;
	padding: 0.2rem 0.5rem;
	border-radius: var(--radius-sm);
	transition: background 0.15s ease;
}

.ticker-item:hover {
	background: var(--bg-card-subtle);
}

.ticker-symbol {
	font-weight: 700;
	color: var(--fg);
}

.ticker-price {
	font-family: var(--font-mono);
	font-weight: 500;
	color: var(--fg-muted);
}

.ticker-change {
	font-weight: 600;
	font-size: 0.75rem;
}

.up {
	color: var(--green);
}

.down {
	color: var(--red);
}

/* Main Grid Layouts */
.trading-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
}

@media (min-width: 58rem) {
	.trading-layout {
		grid-template-columns: 1.35fr 1fr;
		align-items: start;
	}
}

/* Cards & Panels */
.card {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 1.25rem;
	box-shadow: var(--shadow-md);
	position: relative;
}

@media (min-width: 48rem) {
	.card {
		padding: 1.5rem;
	}
}

.card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.25rem;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.card-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

/* Mode Switcher Tabs (Buy / Sell / Swap) */
.mode-toggle {
	display: flex;
	background: var(--bg-input);
	padding: 0.3rem;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	width: 100%;
	margin-bottom: 1.25rem;
}

.mode-toggle-btn {
	flex: 1;
	padding: 0.6rem 0.75rem;
	border: none;
	background: transparent;
	color: var(--fg-muted);
	font-size: 0.9375rem;
	font-weight: 700;
	font-family: inherit;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all 0.15s ease;
	text-align: center;
}

.mode-toggle-btn.active {
	background: var(--accent);
	color: #fff;
	box-shadow: 0 2px 8px var(--accent-glow);
}

.mode-toggle-btn:hover:not(.active) {
	color: var(--fg);
}

/* Swap / Input Box Components */
.swap-box {
	background: var(--bg-input);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	margin-bottom: 0.6rem;
}

.swap-box:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 1px var(--accent);
}

.swap-box-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 0.8125rem;
	color: var(--fg-muted);
	margin-bottom: 0.5rem;
}

.swap-box-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.swap-input {
	background: transparent;
	border: none;
	color: var(--fg);
	font-size: 1.5rem;
	font-weight: 700;
	font-family: var(--font-mono);
	width: 100%;
	outline: none;
	padding: 0;
}

.swap-input::placeholder {
	color: var(--fg-dim);
}

/* Selector Dropdown Buttons */
.asset-selector-btn {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	background: var(--bg-card-subtle);
	border: 1px solid var(--border-light);
	color: var(--fg);
	padding: 0.5rem 0.85rem;
	border-radius: var(--radius-full);
	font-size: 0.9375rem;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s ease, border-color 0.15s ease;
	flex-shrink: 0;
}

.asset-selector-btn:hover {
	background: #1c253d;
	border-color: var(--accent);
}

.coin-icon {
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.85rem;
	font-weight: 800;
	color: white;
	flex-shrink: 0;
}

/* Quick Amount Chips */
.chip-row {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	flex-wrap: wrap;
	margin-bottom: 1.25rem;
}

.chip-btn {
	background: var(--bg-input);
	border: 1px solid var(--border);
	color: var(--fg-muted);
	font-size: 0.8125rem;
	font-weight: 600;
	font-family: inherit;
	padding: 0.35rem 0.7rem;
	border-radius: var(--radius-full);
	cursor: pointer;
	transition: all 0.15s ease;
}

.chip-btn:hover {
	color: var(--fg);
	border-color: var(--border-light);
	background: var(--bg-card-subtle);
}

.chip-btn.active {
	background: rgba(59, 130, 246, 0.15);
	border-color: var(--accent);
	color: #93c5fd;
}

/* Rate & Fee Breakdown */
.quote-details {
	background: rgba(14, 19, 31, 0.6);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 0.85rem 1rem;
	margin-bottom: 1.25rem;
	display: grid;
	gap: 0.5rem;
	font-size: 0.8125rem;
}

.quote-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	color: var(--fg-muted);
}

.quote-row.highlight {
	color: var(--fg);
	font-weight: 600;
	border-top: 1px dashed var(--border);
	padding-top: 0.4rem;
	margin-top: 0.2rem;
}

.rate-timer {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: var(--fg-muted);
}

/* Action Buttons */
.btn-primary {
	width: 100%;
	padding: 0.9rem 1.25rem;
	background: linear-gradient(135deg, #3b82f6, #2563eb);
	border: none;
	border-radius: var(--radius);
	color: white;
	font-size: 1.05rem;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	box-shadow: 0 4px 16px var(--accent-glow);
	transition: all 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
	filter: brightness(1.1);
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.btn-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.55rem 0.95rem;
	background: var(--bg-card-subtle);
	border: 1px solid var(--border-light);
	color: var(--fg);
	font-size: 0.875rem;
	font-weight: 600;
	font-family: inherit;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all 0.15s ease;
}

.btn-secondary:hover {
	background: #1f2a44;
	border-color: var(--accent);
}

.btn-ghost {
	background: transparent;
	border: none;
	color: var(--fg-muted);
	padding: 0.4rem 0.6rem;
	border-radius: var(--radius-sm);
	cursor: pointer;
	font-family: inherit;
	font-size: 0.875rem;
}

.btn-ghost:hover {
	color: var(--fg);
	background: var(--bg-card-subtle);
}

/* Interactive Chart Area */
.chart-container {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border);
}

.chart-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	flex-wrap: wrap;
	margin-bottom: 0.75rem;
}

.timeframe-selector {
	display: flex;
	background: var(--bg-input);
	border: 1px solid var(--border);
	border-radius: var(--radius-full);
	padding: 0.2rem;
	gap: 0.15rem;
}

.tf-btn {
	background: transparent;
	border: none;
	color: var(--fg-muted);
	padding: 0.2rem 0.55rem;
	font-size: 0.75rem;
	font-weight: 700;
	font-family: inherit;
	border-radius: var(--radius-full);
	cursor: pointer;
}

.tf-btn.active {
	background: var(--accent);
	color: white;
}

.chart-svg-wrap {
	width: 100%;
	height: 180px;
	position: relative;
}

/* Payment Badges & Trust Footer */
.trust-badges {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.25rem;
	margin-top: 1.25rem;
	flex-wrap: wrap;
	color: var(--fg-dim);
	font-size: 0.75rem;
	font-weight: 600;
}

.trust-item {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

/* Modal Windows */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(4, 6, 12, 0.8);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100;
	padding: 1rem;
}

.modal-dialog {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	width: 100%;
	max-width: 32rem;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border);
	position: relative;
	animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
	from {
		opacity: 0;
		transform: scale(0.96) translateY(8px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid var(--border);
}

.modal-body {
	padding: 1.5rem;
}

.modal-footer {
	padding: 1.25rem 1.5rem;
	border-top: 1px solid var(--border);
	display: flex;
	gap: 0.75rem;
}

/* Stepper Indicator */
.stepper-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.5rem;
	position: relative;
}

.stepper-nav::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 10%;
	right: 10%;
	height: 2px;
	background: var(--border);
	z-index: 1;
}

.step-node {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	z-index: 2;
}

.step-circle {
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--bg-card-subtle);
	border: 2px solid var(--border);
	color: var(--fg-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.8125rem;
	transition: all 0.2s ease;
}

.step-node.active .step-circle {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
	box-shadow: 0 0 12px var(--accent-glow);
}

.step-node.done .step-circle {
	background: var(--green);
	border-color: var(--green);
	color: #fff;
}

.step-label {
	font-size: 0.7rem;
	font-weight: 600;
	color: var(--fg-dim);
}

.step-node.active .step-label {
	color: var(--fg);
}

/* Payment Method Cards */
.payment-grid {
	display: grid;
	gap: 0.65rem;
	margin-bottom: 1.25rem;
}

.payment-card-opt {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.85rem 1rem;
	background: var(--bg-input);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	cursor: pointer;
	transition: all 0.15s ease;
}

.payment-card-opt:hover {
	border-color: var(--border-light);
	background: var(--bg-card-subtle);
}

.payment-card-opt.selected {
	border-color: var(--accent);
	background: rgba(59, 130, 246, 0.1);
	box-shadow: 0 0 0 1px var(--accent);
}

.payment-left {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.payment-icon-wrap {
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 8px;
	background: var(--bg-card-subtle);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.1rem;
}

/* Market Explorer Table & List */
.table-responsive {
	width: 100%;
	overflow-x: auto;
	border-radius: var(--radius);
	scrollbar-width: thin;
}

.market-table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
}

.market-table th {
	padding: 0.75rem 1rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--fg-muted);
	border-bottom: 1px solid var(--border);
	white-space: nowrap;
}

.market-table td {
	padding: 0.85rem 1rem;
	border-bottom: 1px solid var(--border);
	white-space: nowrap;
}

.market-table tr:hover td {
	background: rgba(255, 255, 255, 0.02);
}

.coin-cell {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.coin-name {
	font-weight: 700;
	color: var(--fg);
}

.coin-symbol {
	font-size: 0.75rem;
	color: var(--fg-muted);
	text-transform: uppercase;
}

/* Portfolio & DCA Widgets */
.stat-banner {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.stat-box {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1rem 1.25rem;
}

.stat-label {
	font-size: 0.8125rem;
	color: var(--fg-muted);
	margin-bottom: 0.25rem;
}

.stat-value {
	font-size: 1.5rem;
	font-weight: 800;
	font-family: var(--font-mono);
	color: var(--fg);
}

/* Toast Notifications */
.toast-container {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	z-index: 200;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	max-width: 22rem;
	width: calc(100% - 3rem);
}

.toast {
	padding: 0.75rem 1rem;
	background: #111827;
	border: 1px solid var(--border-light);
	border-left: 4px solid var(--accent);
	border-radius: var(--radius-sm);
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
	font-size: 0.875rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	animation: toastSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success {
	border-left-color: var(--green);
}

@keyframes toastSlide {
	from {
		transform: translateY(20px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

/* Form Controls */
.input, .select {
	width: 100%;
	background: var(--bg-input);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	color: var(--fg);
	padding: 0.65rem 0.85rem;
	font-family: inherit;
	font-size: 0.9375rem;
	outline: none;
	transition: border-color 0.15s ease;
}

.input:focus, .select:focus {
	border-color: var(--accent);
}

.field {
	display: grid;
	gap: 0.4rem;
	margin-bottom: 1rem;
}

.field-label {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--fg-muted);
}

/* Search bar */
.search-input-wrap {
	position: relative;
	width: 100%;
	max-width: 18rem;
}

.search-input-wrap input {
	padding-left: 2rem;
}

.search-icon {
	position: absolute;
	left: 0.65rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--fg-muted);
	pointer-events: none;
}

/* Status Badges */
.badge-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.2rem 0.55rem;
	border-radius: var(--radius-full);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: capitalize;
}

.badge-pill.completed {
	background: var(--green-bg);
	color: var(--green);
	border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pill.pending {
	background: rgba(234, 179, 8, 0.15);
	color: #facc15;
	border: 1px solid rgba(234, 179, 8, 0.3);
}

/* Range Sliders */
input[type="range"] {
	width: 100%;
	accent-color: var(--accent);
	cursor: pointer;
}

/* Responsive Overrides */
@media (max-width: 480px) {
	.header-bar {
		flex-direction: column;
		align-items: stretch;
	}
	.header-actions {
		justify-content: space-between;
	}
	.modal-dialog {
		margin: 0.5rem;
		max-height: 95vh;
	}
}
