:root {
	--bg-main: #090b10;
	--bg-surface: #0f131c;
	--bg-surface-elevated: #161c28;
	--bg-surface-hover: #1c2333;
	--border-subtle: rgba(255, 255, 255, 0.07);
	--border-focus: rgba(247, 147, 26, 0.5);
	
	--text-primary: #f1f5f9;
	--text-secondary: #94a3b8;
	--text-muted: #64748b;
	
	/* Thematic brand colors */
	--btc-gold: #f7931a;
	--btc-gold-glow: rgba(247, 147, 26, 0.2);
	--low-green: #10b981;
	--low-green-bg: rgba(16, 185, 129, 0.12);
	--low-green-border: rgba(16, 185, 129, 0.35);
	--high-rose: #f43f5e;
	--high-rose-bg: rgba(244, 63, 94, 0.12);
	--high-rose-border: rgba(244, 63, 94, 0.35);
	--cyan-accent: #06b6d4;
	--cyan-glow: rgba(6, 182, 212, 0.15);

	--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	--radius-sm: 6px;
	--radius-md: 10px;
	--radius-lg: 14px;
	--radius-full: 9999px;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	background-color: var(--bg-main);
	color: var(--text-primary);
	font-family: var(--font-sans);
	min-height: 100vh;
	line-height: 1.5;
	overflow-x: hidden;
	background-image: 
		radial-gradient(ellipse 60% 40% at 50% -10%, rgba(247, 147, 26, 0.08), transparent 70%),
		radial-gradient(circle at 90% 20%, rgba(6, 182, 212, 0.05), transparent 40%),
		radial-gradient(circle at 10% 80%, rgba(16, 185, 129, 0.04), transparent 50%);
	background-attachment: fixed;
}

/* App layout */
.app-container {
	max-width: 1440px;
	margin: 0 auto;
	padding: 1.25rem 1.5rem 3rem;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

/* Header */
.top-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--border-subtle);
}

.brand-section {
	display: flex;
	align-items: center;
	gap: 0.85rem;
}

.brand-logo-badge {
	width: 42px;
	height: 42px;
	border-radius: var(--radius-md);
	background: linear-gradient(135deg, #f7931a, #c86800);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 16px rgba(247, 147, 26, 0.4);
	color: #ffffff;
	font-weight: 800;
	font-size: 1.35rem;
}

.brand-title {
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: #fff;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.brand-sub {
	font-size: 0.8rem;
	color: var(--text-secondary);
	font-weight: 400;
}

.header-status-group {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.session-indicator {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.4rem 0.85rem;
	background: var(--bg-surface);
	border: 1px solid var(--border-subtle);
	border-radius: var(--radius-full);
	font-size: 0.78rem;
	color: var(--text-secondary);
}

.session-indicator strong {
	color: var(--cyan-accent);
}

.live-pulse {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--low-green);
	box-shadow: 0 0 8px var(--low-green);
	animation: pulse-live 2s infinite ease-in-out;
}

@keyframes pulse-live {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.4); opacity: 0.5; }
}

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

.icon-btn {
	background: var(--bg-surface);
	border: 1px solid var(--border-subtle);
	color: var(--text-primary);
	border-radius: var(--radius-md);
	padding: 0.5rem 0.85rem;
	font-size: 0.85rem;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
	transition: all 0.15s ease;
	position: relative;
	font-family: inherit;
}

.icon-btn:hover {
	background: var(--bg-surface-elevated);
	border-color: rgba(255, 255, 255, 0.15);
}

.icon-btn.active {
	background: rgba(247, 147, 26, 0.15);
	border-color: var(--btc-gold);
	color: #fff;
}

.badge-count {
	position: absolute;
	top: -6px;
	right: -6px;
	background: var(--high-rose);
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: var(--radius-full);
	border: 2px solid var(--bg-main);
	animation: pop 0.2s ease-out;
}

/* Watchlist Selector Bar */
.watchlist-bar {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	overflow-x: auto;
	padding-bottom: 0.5rem;
	scrollbar-width: thin;
}

.watchlist-pill {
	background: var(--bg-surface);
	border: 1px solid var(--border-subtle);
	border-radius: var(--radius-full);
	padding: 0.45rem 1rem;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--text-secondary);
	display: flex;
	align-items: center;
	gap: 0.6rem;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.watchlist-pill:hover {
	background: var(--bg-surface-elevated);
	color: #fff;
	border-color: rgba(255, 255, 255, 0.2);
}

.watchlist-pill.selected {
	background: var(--bg-surface-elevated);
	color: #fff;
	border-color: var(--btc-gold);
	box-shadow: 0 0 12px var(--btc-gold-glow);
}

.pill-change {
	font-size: 0.75rem;
	font-family: var(--font-mono);
}

.pill-change.positive { color: var(--low-green); }
.pill-change.negative { color: var(--high-rose); }

/* Hero Extreme Highlight Cards */
.hero-extremes-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1.25rem;
}

.stat-card {
	background: var(--bg-surface);
	border: 1px solid var(--border-subtle);
	border-radius: var(--radius-lg);
	padding: 1.25rem;
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 1rem;
	transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
	transform: translateY(-2px);
	border-color: rgba(255, 255, 255, 0.15);
}

.stat-card.card-low {
	border-left: 4px solid var(--low-green);
	background: linear-gradient(145deg, rgba(16, 185, 129, 0.05) 0%, var(--bg-surface) 60%);
}

.stat-card.card-high {
	border-left: 4px solid var(--high-rose);
	background: linear-gradient(145deg, rgba(244, 63, 94, 0.05) 0%, var(--bg-surface) 60%);
}

.stat-card.card-current {
	border-left: 4px solid var(--btc-gold);
	background: linear-gradient(145deg, rgba(247, 147, 26, 0.06) 0%, var(--bg-surface) 60%);
}

.stat-card.card-strategy {
	border-left: 4px solid var(--cyan-accent);
	background: linear-gradient(145deg, rgba(6, 182, 212, 0.06) 0%, var(--bg-surface) 60%);
}

.card-header-flex {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.card-label {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-weight: 700;
	color: var(--text-muted);
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.card-tag {
	font-size: 0.72rem;
	font-weight: 700;
	padding: 0.2rem 0.55rem;
	border-radius: var(--radius-full);
}

.card-tag.tag-low {
	background: var(--low-green-bg);
	color: var(--low-green);
	border: 1px solid var(--low-green-border);
}

.card-tag.tag-high {
	background: var(--high-rose-bg);
	color: var(--high-rose);
	border: 1px solid var(--high-rose-border);
}

.card-tag.tag-gold {
	background: var(--btc-gold-glow);
	color: var(--btc-gold);
	border: 1px solid rgba(247, 147, 26, 0.3);
}

.card-tag.tag-cyan {
	background: var(--cyan-glow);
	color: var(--cyan-accent);
	border: 1px solid rgba(6, 182, 212, 0.3);
}

.price-main {
	font-family: var(--font-mono);
	font-size: 1.85rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	color: #ffffff;
}

.price-main.text-low { color: var(--low-green); }
.price-main.text-high { color: var(--high-rose); }
.price-main.text-gold { color: var(--btc-gold); }

.time-row {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.85rem;
	color: var(--text-secondary);
}

.time-badge {
	font-family: var(--font-mono);
	font-weight: 700;
	background: var(--bg-surface-elevated);
	padding: 0.25rem 0.6rem;
	border-radius: var(--radius-sm);
	color: #fff;
	border: 1px solid var(--border-subtle);
	font-size: 0.8rem;
}

.diff-badge {
	font-family: var(--font-mono);
	font-size: 0.8rem;
	font-weight: 600;
}

/* Range meter bar */
.range-meter-container {
	margin-top: 0.4rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.meter-track {
	width: 100%;
	height: 8px;
	background: #1e2533;
	border-radius: var(--radius-full);
	position: relative;
	overflow: hidden;
}

.meter-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--low-green), var(--btc-gold), var(--high-rose));
	border-radius: var(--radius-full);
}

.meter-marker {
	position: absolute;
	top: -3px;
	width: 14px;
	height: 14px;
	background: #ffffff;
	border: 2px solid var(--btc-gold);
	border-radius: 50%;
	transform: translateX(-50%);
	box-shadow: 0 0 8px #ffffff;
}

.meter-labels {
	display: flex;
	justify-content: space-between;
	font-size: 0.72rem;
	font-family: var(--font-mono);
	color: var(--text-muted);
}

/* Section Grid */
.dashboard-grid-2col {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 1.5rem;
}

@media (max-width: 1024px) {
	.dashboard-grid-2col {
		grid-template-columns: 1fr;
	}
}

.panel {
	background: var(--bg-surface);
	border: 1px solid var(--border-subtle);
	border-radius: var(--radius-lg);
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding-bottom: 0.85rem;
	border-bottom: 1px solid var(--border-subtle);
}

.panel-title-group {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.panel-title {
	font-size: 1.05rem;
	font-weight: 700;
	color: #fff;
}

.panel-desc {
	font-size: 0.78rem;
	color: var(--text-secondary);
}

/* Interactive SVG Chart */
.chart-container {
	width: 100%;
	position: relative;
	background: var(--bg-main);
	border-radius: var(--radius-md);
	border: 1px solid var(--border-subtle);
	padding: 0.85rem;
}

.svg-chart {
	width: 100%;
	height: 240px;
	display: block;
}

.chart-tooltip {
	position: absolute;
	top: 10px;
	left: 14px;
	background: rgba(15, 19, 28, 0.92);
	backdrop-filter: blur(8px);
	border: 1px solid var(--border-subtle);
	border-radius: var(--radius-sm);
	padding: 0.4rem 0.75rem;
	font-size: 0.75rem;
	font-family: var(--font-mono);
	display: flex;
	align-items: center;
	gap: 0.85rem;
	color: var(--text-primary);
	pointer-events: none;
}

/* Hourly distribution heat bar */
.hourly-container {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.hourly-legend {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	font-size: 0.75rem;
	color: var(--text-secondary);
}

.legend-item {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.legend-box {
	width: 12px;
	height: 12px;
	border-radius: 3px;
}

.legend-box.low { background: var(--low-green); }
.legend-box.high { background: var(--high-rose); }

.hourly-bars-grid {
	display: grid;
	grid-template-columns: repeat(24, 1fr);
	gap: 3px;
	height: 120px;
	align-items: flex-end;
	background: var(--bg-main);
	padding: 0.75rem 0.5rem 0.25rem;
	border-radius: var(--radius-md);
	border: 1px solid var(--border-subtle);
}

.hourly-bar-col {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	height: 100%;
	gap: 2px;
	cursor: pointer;
	position: relative;
	transition: opacity 0.15s;
}

.hourly-bar-col:hover {
	opacity: 0.8;
}

.bar-segment {
	width: 100%;
	border-radius: 2px 2px 0 0;
	transition: height 0.3s ease;
	min-height: 2px;
}

.bar-segment.segment-high {
	background: var(--high-rose);
}

.bar-segment.segment-low {
	background: var(--low-green);
}

.hourly-x-labels {
	display: grid;
	grid-template-columns: repeat(24, 1fr);
	gap: 3px;
	padding: 0 0.5rem;
	font-size: 0.65rem;
	font-family: var(--font-mono);
	color: var(--text-muted);
	text-align: center;
}

.hourly-focus-box {
	background: var(--bg-main);
	border: 1px solid var(--border-subtle);
	border-radius: var(--radius-md);
	padding: 0.75rem 1rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 0.8rem;
}

/* Alerts and Notifier Config Section */
.alerts-list {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	max-height: 280px;
	overflow-y: auto;
	padding-right: 0.25rem;
}

.alert-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--bg-main);
	border: 1px solid var(--border-subtle);
	border-radius: var(--radius-md);
	padding: 0.65rem 0.85rem;
	gap: 0.75rem;
	transition: all 0.15s ease;
}

.alert-row:hover {
	border-color: rgba(255, 255, 255, 0.15);
}

.alert-info {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.alert-title {
	font-size: 0.84rem;
	font-weight: 600;
	color: #fff;
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.alert-desc {
	font-size: 0.74rem;
	color: var(--text-secondary);
}

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

/* Simulator and Testing Bar */
.simulator-box {
	background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(247, 147, 26, 0.08));
	border: 1px dashed rgba(6, 182, 212, 0.3);
	border-radius: var(--radius-md);
	padding: 0.85rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

.simulator-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 0.78rem;
	color: var(--cyan-accent);
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.sim-buttons-row {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.btn-sim {
	background: var(--bg-surface-elevated);
	border: 1px solid var(--border-subtle);
	color: var(--text-primary);
	border-radius: var(--radius-sm);
	padding: 0.4rem 0.75rem;
	font-size: 0.76rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.btn-sim:hover {
	background: #252e42;
	border-color: rgba(255, 255, 255, 0.25);
}

.btn-sim.sim-low {
	border-color: var(--low-green-border);
	color: var(--low-green);
}
.btn-sim.sim-low:hover {
	background: var(--low-green-bg);
}

.btn-sim.sim-high {
	border-color: var(--high-rose-border);
	color: var(--high-rose);
}
.btn-sim.sim-high:hover {
	background: var(--high-rose-bg);
}

/* History Table */
.table-wrapper {
	overflow-x: auto;
	border-radius: var(--radius-md);
	border: 1px solid var(--border-subtle);
	background: var(--bg-main);
}

.history-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.82rem;
	text-align: left;
}

.history-table th {
	background: var(--bg-surface-elevated);
	padding: 0.65rem 0.85rem;
	color: var(--text-secondary);
	font-weight: 600;
	font-size: 0.74rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border-bottom: 1px solid var(--border-subtle);
}

.history-table td {
	padding: 0.65rem 0.85rem;
	border-bottom: 1px solid var(--border-subtle);
	font-family: var(--font-mono);
	color: var(--text-primary);
}

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

/* Notification Drawer / Modal */
.drawer-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.75);
	backdrop-filter: blur(4px);
	z-index: 100;
	display: flex;
	justify-content: flex-end;
}

.drawer-panel {
	width: 100%;
	max-width: 440px;
	height: 100%;
	background: var(--bg-surface);
	border-left: 1px solid var(--border-subtle);
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	box-shadow: -8px 0 24px rgba(0, 0, 0, 0.5);
	animation: slide-in 0.2s ease-out;
}

@keyframes slide-in {
	from { transform: translateX(100%); }
	to { transform: translateX(0); }
}

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

.drawer-title {
	font-size: 1.15rem;
	font-weight: 700;
	color: #fff;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.notif-feed {
	flex: 1;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding-right: 0.25rem;
}

.notif-card {
	background: var(--bg-main);
	border: 1px solid var(--border-subtle);
	border-radius: var(--radius-md);
	padding: 0.85rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	position: relative;
	transition: all 0.2s ease;
}

.notif-card.unread {
	border-left: 3px solid var(--btc-gold);
	background: rgba(247, 147, 26, 0.03);
}

.notif-card.notif-low {
	border-left: 3px solid var(--low-green);
}

.notif-card.notif-high {
	border-left: 3px solid var(--high-rose);
}

.notif-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.notif-title {
	font-size: 0.85rem;
	font-weight: 700;
	color: #fff;
}

.notif-time {
	font-size: 0.7rem;
	font-family: var(--font-mono);
	color: var(--text-muted);
}

.notif-desc {
	font-size: 0.78rem;
	color: var(--text-secondary);
	line-height: 1.4;
}

.notif-price-pill {
	display: inline-block;
	font-family: var(--font-mono);
	font-weight: 700;
	font-size: 0.75rem;
	padding: 0.15rem 0.5rem;
	border-radius: var(--radius-sm);
	margin-top: 0.2rem;
	width: fit-content;
}

.notif-price-pill.pill-low {
	background: var(--low-green-bg);
	color: var(--low-green);
}

.notif-price-pill.pill-high {
	background: var(--high-rose-bg);
	color: var(--high-rose);
}

/* Toast Popups */
.toast-container {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	pointer-events: none;
}

.toast {
	pointer-events: auto;
	background: #121722;
	border: 1px solid var(--border-subtle);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
	border-radius: var(--radius-md);
	padding: 0.85rem 1.15rem;
	display: flex;
	align-items: center;
	gap: 0.85rem;
	min-width: 320px;
	max-width: 400px;
	animation: toast-slide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast.toast-low {
	border-left: 4px solid var(--low-green);
}

.toast.toast-high {
	border-left: 4px solid var(--high-rose);
}

.toast-icon {
	font-size: 1.4rem;
}

.toast-content {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	flex: 1;
}

.toast-title {
	font-size: 0.85rem;
	font-weight: 700;
	color: #fff;
}

.toast-msg {
	font-size: 0.76rem;
	color: var(--text-secondary);
}

/* Toggle Switch */
.switch {
	position: relative;
	display: inline-block;
	width: 36px;
	height: 20px;
}

.switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #242d3d;
	transition: 0.2s;
	border-radius: 20px;
}

.slider:before {
	position: absolute;
	content: "";
	height: 14px;
	width: 14px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: 0.2s;
	border-radius: 50%;
}

input:checked + .slider {
	background-color: var(--btc-gold);
}

input:checked + .slider:before {
	transform: translateX(16px);
}

/* Form Styles */
.form-inline {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	margin-top: 0.5rem;
}

.input-dark, .select-dark {
	background: var(--bg-main);
	border: 1px solid var(--border-subtle);
	border-radius: var(--radius-sm);
	color: #fff;
	padding: 0.45rem 0.65rem;
	font-size: 0.8rem;
	font-family: inherit;
}

.input-dark:focus, .select-dark:focus {
	outline: none;
	border-color: var(--btc-gold);
}

.btn-primary {
	background: var(--btc-gold);
	color: #000;
	font-weight: 700;
	border: none;
	border-radius: var(--radius-sm);
	padding: 0.45rem 0.9rem;
	font-size: 0.8rem;
	cursor: pointer;
	transition: filter 0.15s;
}

.btn-primary:hover {
	filter: brightness(1.1);
}

.btn-ghost {
	background: transparent;
	border: 1px solid var(--border-subtle);
	color: var(--text-secondary);
	border-radius: var(--radius-sm);
	padding: 0.35rem 0.65rem;
	font-size: 0.75rem;
	cursor: pointer;
}

.btn-ghost:hover {
	background: var(--bg-surface-elevated);
	color: #fff;
}

.btn-danger {
	background: rgba(244, 63, 94, 0.15);
	border: 1px solid rgba(244, 63, 94, 0.3);
	color: var(--high-rose);
	border-radius: var(--radius-sm);
	padding: 0.3rem 0.6rem;
	font-size: 0.72rem;
	cursor: pointer;
}

.btn-danger:hover {
	background: rgba(244, 63, 94, 0.25);
}
