/**
 * Monthly Returns Heatmap & Ring Charts - Bloomberg Terminal Grade
 * Finance-centric color scale: Green (gain) → White (0%) → Red (loss)
 * 21-level granular scale for crypto volatility
 */

/* ==========================================================================
   TRADING BAR - Real-time metrics strip (Bloomberg style)
   ========================================================================== */

/* ==========================================================================
   UNIFIED METRICS STRIP - Card style (like trading bar)
   ========================================================================== */

.metrics-strip {
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 0.75rem;
	margin-top: 0.75rem;
}

.ms-cell {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 0.875rem 0.75rem;
	background: var(--bg-secondary);
	border: 1px solid var(--border-primary);
	border-radius: 10px;
	gap: 0.25rem;
	cursor: default;
	transition: all 0.2s ease;
	min-width: 0;
}

.ms-cell:hover {
	background: var(--bg-hover);
	border-color: var(--accent-primary);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ms-label {
	font-size: 0.625rem;
	font-weight: 600;
	color: var(--text-quaternary);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.ms-value {
	font-family: var(--font-mono, 'SF Mono', monospace);
	font-size: 1rem;
	font-weight: 700;
	color: var(--text-primary);
	line-height: 1.2;
	display: flex;
	align-items: baseline;
}

.ms-max {
	font-size: 0.6875rem;
	font-weight: 500;
	color: var(--text-quaternary);
	margin-left: 2px;
}

/* Signal cell - hero badge */
.ms-signal {
	padding: 0.75rem;
}

.ms-signal-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem 0.875rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	border-radius: 6px;
	text-transform: uppercase;
}

.ms-signal-badge.signal-buy {
	background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
	color: var(--gain);
	border: 1px solid rgba(16, 185, 129, 0.3);
	box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.ms-signal-badge.signal-sell {
	background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
	color: var(--loss);
	border: 1px solid rgba(239, 68, 68, 0.3);
	box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
}

.ms-signal-badge.signal-long {
	background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08));
	color: var(--gain);
	border: 1px solid rgba(16, 185, 129, 0.25);
}

.ms-signal-badge.signal-flat,
.ms-signal-badge.signal-neutral {
	background: var(--bg-tertiary);
	color: var(--text-tertiary);
	border: 1px solid var(--border-secondary);
}

/* Responsive */
@media (max-width: 1024px) {
	.metrics-strip {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 640px) {
	.metrics-strip {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.5rem;
	}
	.ms-cell {
		padding: 0.75rem 0.5rem;
	}
}

/* Light mode */
[data-theme="light"] .ms-cell {
	background: #fff;
	border-color: var(--border-secondary);
}

[data-theme="light"] .ms-cell:hover {
	background: var(--bg-hover);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   MARKET CYCLE - Clear 12-Phase Visualization
   ========================================================================== */

/* Info badge on chart titles */
.chart-info-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.25rem;
	border-radius: 50%;
	cursor: default;
	transition: all 0.2s ease;
}

.chart-info-badge:hover {
	background: var(--bg-tertiary);
}

/* Hero section - Current position */
.cycle-hero {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 0;
	margin-bottom: 1rem;
	border-bottom: 1px solid var(--border-primary);
}

.cycle-position {
	display: flex;
	align-items: baseline;
	gap: 0.375rem;
}

.cycle-hour {
	font-size: 3rem;
	font-weight: 800;
	color: var(--text-primary);
	font-family: var(--font-mono, monospace);
	line-height: 1;
}

.cycle-label {
	font-size: 1rem;
	color: var(--text-tertiary);
	font-weight: 500;
}

/* Phase badge */
.cycle-phase-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	border-radius: 6px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

/* Clock icon in phase badge */
.cycle-clock-icon {
	width: 20px;
	height: 20px;
}

.cycle-clock-bezel {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	opacity: 0.5;
}

.cycle-clock-face {
	fill: currentColor;
	opacity: 0.1;
}

.cycle-clock-tick {
	stroke: currentColor;
	opacity: 0.6;
}

.cycle-clock-hand line {
	stroke: currentColor;
}

.phase-peak {
	background: rgba(16, 185, 129, 0.15);
	color: var(--gain);
	border: 1px solid rgba(16, 185, 129, 0.3);
}

.phase-sell {
	background: rgba(239, 68, 68, 0.15);
	color: var(--loss);
	border: 1px solid rgba(239, 68, 68, 0.3);
}

.phase-bottom {
	background: rgba(59, 130, 246, 0.15);
	color: var(--accent-primary);
	border: 1px solid rgba(59, 130, 246, 0.3);
}

.phase-recovery {
	background: rgba(245, 158, 11, 0.15);
	color: #f59e0b;
	border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Forecast display */
.cycle-forecast {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	font-family: var(--font-mono, monospace);
	font-size: 1.25rem;
	font-weight: 600;
}

.cycle-forecast-label {
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--text-tertiary);
	margin-left: 0.25rem;
}

/* Timeline - 12 hour blocks */
.cycle-timeline {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 2px;
	margin-bottom: 1rem;
}

.cycle-hour-block {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0.5rem 0.25rem;
	border-radius: 4px;
	background: var(--bg-tertiary);
	position: relative;
	overflow: hidden;
	cursor: default;
	transition: all 0.2s ease;
}

.cycle-hour-block:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cycle-hour-num {
	font-size: 0.625rem;
	font-weight: 600;
	color: var(--text-tertiary);
	z-index: 1;
	margin-bottom: 0.25rem;
}

.cycle-hour-bar {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: currentColor;
	opacity: 0.3;
	transition: height 0.3s ease;
}

.cycle-hour-active {
	background: var(--accent-primary);
	box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.cycle-hour-active .cycle-hour-num {
	color: white;
	font-weight: 700;
}

.cycle-hour-bullish {
	color: var(--gain);
}

.cycle-hour-bearish {
	color: var(--loss);
}

/* Zone legend */
.cycle-zones {
	display: flex;
	justify-content: center;
	gap: 1.5rem;
	flex-wrap: wrap;
}

.cycle-zone {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.6875rem;
	color: var(--text-quaternary);
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.cycle-zone-active {
	background: var(--bg-tertiary);
	color: var(--text-primary);
}

.cycle-zone-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.cycle-zone-peak { background: var(--gain); }
.cycle-zone-sell { background: var(--loss); }
.cycle-zone-bottom { background: var(--accent-primary); }
.cycle-zone-recovery { background: #f59e0b; }

/* Responsive */
@media (max-width: 640px) {
	.cycle-hero {
		flex-direction: column;
		gap: 0.75rem;
		text-align: center;
	}
	
	.cycle-hour {
		font-size: 2.5rem;
	}
	
	.cycle-timeline {
		grid-template-columns: repeat(6, 1fr);
	}
}

/* Light mode */
[data-theme="light"] .cycle-hour-active {
	box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

/* Legacy trading-bar (keep for compatibility) */
.trading-bar {
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 1px;
	background: var(--border-primary);
	border-radius: 12px;
	overflow: hidden;
	margin-top: 1rem;
}

.tb-cell {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 0.875rem 1rem;
	background: var(--bg-secondary);
	gap: 0.25rem;
	cursor: help;
	transition: background 0.15s ease;
	position: relative;
}

.tb-cell:hover {
	background: var(--bg-hover);
}

.tb-label {
	font-size: 0.625rem;
	font-weight: 600;
	color: var(--text-quaternary);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.tb-value {
	font-family: var(--font-mono, 'SF Mono', 'Fira Code', monospace);
	font-size: 1rem;
	font-weight: 700;
	color: var(--text-primary);
	line-height: 1;
}

.tb-sub {
	font-size: 0.6875rem;
	color: var(--text-quaternary);
	font-family: var(--font-mono, monospace);
}

/* Signal cell - hero badge */
.tb-signal {
	align-items: center;
}

.tb-signal-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.375rem 0.75rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	border-radius: 6px;
	text-transform: uppercase;
}

.tb-signal-badge.signal-buy {
	background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
	color: var(--gain);
	border: 1px solid rgba(16, 185, 129, 0.3);
	box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.tb-signal-badge.signal-sell {
	background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
	color: var(--loss);
	border: 1px solid rgba(239, 68, 68, 0.3);
	box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
}

.tb-signal-badge.signal-long {
	background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08));
	color: var(--gain);
	border: 1px solid rgba(16, 185, 129, 0.25);
}

.tb-signal-badge.signal-flat {
	background: var(--bg-tertiary);
	color: var(--text-tertiary);
	border: 1px solid var(--border-secondary);
}

/* Trading Stats Inline (compact under AI vs B&H chart) */
.trading-stats-inline {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.75rem 1rem;
	background: var(--bg-secondary);
	border: 1px solid var(--border-primary);
	border-radius: 8px;
}

.ts-item {
	display: flex;
	align-items: baseline;
	gap: 0.375rem;
}

.ts-num {
	font-family: var(--font-mono, monospace);
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--text-primary);
}

.ts-label {
	font-size: 0.6875rem;
	color: var(--text-quaternary);
	text-transform: lowercase;
}

.ts-divider {
	width: 1px;
	height: 16px;
	background: var(--border-primary);
}

.ts-last-trade {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.ts-trade-badge {
	font-size: 0.625rem;
	font-weight: 700;
	padding: 0.125rem 0.375rem;
	border-radius: 3px;
	letter-spacing: 0.05em;
}

.ts-buy {
	background: rgba(16, 185, 129, 0.15);
	color: var(--gain);
}

.ts-sell {
	background: rgba(239, 68, 68, 0.15);
	color: var(--loss);
}

.ts-trade-date {
	font-size: 0.75rem;
	color: var(--text-quaternary);
}

.ts-trade-pnl {
	font-family: var(--font-mono, monospace);
	font-size: 0.75rem;
	font-weight: 600;
}

/* Responsive - stack on mobile */
@media (max-width: 1024px) {
	.trading-bar {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 640px) {
	.trading-bar {
		grid-template-columns: repeat(2, 1fr);
	}
	
	.trading-stats-inline {
		flex-wrap: wrap;
		gap: 0.75rem;
	}
	
	.ts-last-trade {
		width: 100%;
		margin-left: 0;
		padding-top: 0.5rem;
		border-top: 1px solid var(--border-primary);
	}
}

/* Light mode adjustments */
[data-theme="light"] .trading-bar {
	background: var(--border-secondary);
}

[data-theme="light"] .tb-cell {
	background: #fff;
}

[data-theme="light"] .tb-cell:hover {
	background: var(--bg-hover);
}

/* ==========================================================================
   ASSET HEADER GRID - Bloomberg Terminal Layout
   ========================================================================== */

.asset-header-grid {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 1rem;
	position: relative;
	overflow: visible;
}

/* CRITICAL: Force overflow visible on ALL parent containers for tooltips */
.table-container:has(.asset-header-grid),
.table-container:has(.bbg-gauges-grid),
.table-container:has(.bbg-gauge) {
	overflow: visible !important;
	overflow-x: visible !important;
	overflow-y: visible !important;
}

/* Also target parent with p-6 class */
.p-6:has(.asset-header-grid) {
	overflow: visible !important;
}

.asset-header-left {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.asset-header-info {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.asset-header-title {
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--text-primary);
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.asset-header-badges {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.asset-header-right {
	display: flex;
	justify-content: flex-end;
}

/* =====================================================
   DATE BADGES (Market Date + Trade Date) - Stacked
   ===================================================== */
.asset-date-badges {
	display: inline-flex;
	flex-direction: column;
	gap: 0.375rem;
}

.asset-date-box {
	display: flex;
	align-items: stretch;
	gap: 0.5rem;
	padding: 0.375rem 0.625rem;
	background: var(--bg-secondary);
	border: 1px solid var(--border-primary);
	border-radius: 6px;
	transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
	position: relative;
	width: 100%; /* Same width as container */
}

.asset-date-box:hover {
	background: var(--bg-elevated);
	border-color: var(--info);
	box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.1);
}

.asset-date-box.trade-date:hover {
	border-color: var(--gain);
	box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.asset-date-box .date-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	min-height: 100%;
	background: rgba(6, 182, 212, 0.1);
	border-radius: 4px;
	color: var(--info);
	flex-shrink: 0;
	transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.asset-date-box .date-icon svg {
	width: 16px;
	height: 16px;
}

.asset-date-box:hover .date-icon {
	background: rgba(6, 182, 212, 0.15);
	transform: scale(1.05);
}

.asset-date-box.trade-date .date-icon {
	background: rgba(16, 185, 129, 0.1);
	color: var(--gain);
}

.asset-date-box.trade-date:hover .date-icon {
	background: rgba(16, 185, 129, 0.15);
}

.asset-date-box .date-content {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	justify-content: center;
	flex: 1;
}

.asset-date-box .date-label {
	font-size: 0.6875rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--text-tertiary);
	font-weight: 600;
	line-height: 1.2;
}

.asset-date-box .date-value {
	font-size: 0.8125rem;
	font-family: var(--font-mono);
	color: var(--text-primary);
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1.2;
}

/* Unified Tooltip Style for both badges */
.asset-date-box.tooltip-trigger {
	position: relative;
	z-index: 1;
}

.asset-date-box.tooltip-trigger:hover {
	z-index: 999999;
}

.asset-date-box .tooltip {
	position: absolute;
	top: 100%;
	bottom: auto;
	right: 0;
	left: auto;
	transform: translateY(8px);
	background: rgba(31, 41, 55, 0.95);
	backdrop-filter: blur(12px) saturate(150%);
	-webkit-backdrop-filter: blur(12px) saturate(150%);
	border: 1px solid rgba(75, 85, 99, 0.6);
	border-radius: 8px;
	padding: 0.875rem 1.125rem;
	min-width: 240px;
	max-width: 400px;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: #e5e7eb;
	box-shadow: 
		0 20px 25px -5px rgba(0, 0, 0, 0.5),
		0 10px 10px -5px rgba(0, 0, 0, 0.3),
		0 0 0 1px rgba(255, 255, 255, 0.1);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 200ms ease-out, visibility 200ms ease-out, transform 200ms ease-out;
	z-index: 1000000000 !important;
}

.asset-date-box:hover .tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateY(12px);
}

.asset-date-box .tooltip::before {
	content: '';
	position: absolute;
	bottom: 100%;
	right: 1rem;
	border: 8px solid transparent;
	border-bottom-color: rgba(31, 41, 55, 0.95);
}

/* Light mode - force dark tooltip */
html:not(.dark) .asset-date-box .tooltip {
	background: rgba(31, 41, 55, 0.95) !important;
	border-color: rgba(75, 85, 99, 0.6) !important;
	color: #f3f4f6 !important;
}

html:not(.dark) .asset-date-box .tooltip::before {
	border-bottom-color: rgba(31, 41, 55, 0.95) !important;
}

/* =====================================================
   LEGACY: Last Trade Box (kept for backwards compat)
   ===================================================== */

/* Last Trade Box (Asset Detail Page) - 2 rows, tall calendar icon */
.asset-last-trade-box {
	display: inline-flex;
	align-items: stretch;
	gap: 0.5rem;
	padding: 0.375rem 0.625rem;
	background: var(--bg-secondary);
	border: 1px solid var(--border-primary);
	border-radius: 6px;
	transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
	position: relative;
}

.asset-last-trade-box:hover {
	background: var(--bg-elevated);
	border-color: var(--info);
	box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.1);
}

.asset-last-trade-box .trade-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	min-height: 100%;
	background: rgba(6, 182, 212, 0.1);
	border-radius: 4px;
	color: var(--info);
	flex-shrink: 0;
	transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.asset-last-trade-box .trade-icon svg {
	width: 16px;
	height: 16px;
}

.asset-last-trade-box:hover .trade-icon {
	background: rgba(6, 182, 212, 0.15);
	transform: scale(1.05);
}

.asset-last-trade-box .trade-content {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	justify-content: center;
}

.asset-last-trade-box .trade-label {
	font-size: 0.6875rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--text-tertiary);
	font-weight: 600;
	line-height: 1.2;
}

.asset-last-trade-box .trade-date {
	font-size: 0.8125rem;
	font-family: var(--font-mono);
	color: var(--text-primary);
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1.2;
}

/* Last Trade - Tooltip towards BOTTOM (like ring tooltips) with clock-style */
.asset-last-trade-box.tooltip-trigger {
	position: relative;
	z-index: 1;
}

.asset-last-trade-box.tooltip-trigger:hover {
	z-index: 999999;
}

.asset-last-trade-box .tooltip {
	/* Position BELOW the box (towards bottom) */
	top: 100%;
	bottom: auto;
	right: 0;
	left: auto;
	transform: translateX(0) translateY(8px);
	
	/* Clock-style tooltip (same as ring tooltips) */
	background: rgba(31, 41, 55, 0.95);
	backdrop-filter: blur(12px) saturate(150%);
	-webkit-backdrop-filter: blur(12px) saturate(150%);
	border: 1px solid rgba(75, 85, 99, 0.6);
	border-radius: 8px;
	padding: 0.875rem 1.125rem;
	min-width: 240px;
	max-width: 400px;
	
	/* Typography */
	font-size: 0.8125rem;
	line-height: 1.5;
	color: #e5e7eb;
	
	/* Shadow (clock-style) */
	box-shadow: 
		0 20px 25px -5px rgba(0, 0, 0, 0.5),
		0 10px 10px -5px rgba(0, 0, 0, 0.3),
		0 0 0 1px rgba(255, 255, 255, 0.1),
		0 0 50px rgba(6, 182, 212, 0.2),
		inset 0 1px 0 rgba(255, 255, 255, 0.05);
	
	/* Visibility */
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	
	/* Transition */
	transition: opacity 200ms ease-out, visibility 200ms ease-out, transform 200ms ease-out;
	
	/* Ultra high z-index */
	z-index: 1000000000 !important;
}

.asset-last-trade-box:hover .tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateX(0) translateY(12px);
}

/* Arrow pointing UP (tooltip is below) */
.asset-last-trade-box .tooltip::before {
	content: '';
	position: absolute;
	bottom: 100%;
	right: 1rem;
	left: auto;
	transform: translateY(0);
	
	border: 8px solid transparent;
	border-bottom-color: rgba(31, 41, 55, 0.95);
	
	filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.3));
}

/* Light mode support (force dark tooltip like clock) */
html:not(.dark) .asset-last-trade-box .tooltip {
	background: rgba(31, 41, 55, 0.95) !important;
	border-color: rgba(75, 85, 99, 0.6) !important;
	color: #f3f4f6 !important;
}

html:not(.dark) .asset-last-trade-box .tooltip::before {
	border-bottom-color: rgba(31, 41, 55, 0.95) !important;
}

/* Asset Last Trade - BBG minimal style (icon + date only) */
.asset-last-trade {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.8125rem;
	color: var(--text-secondary);
	padding: 0.25rem 0.5rem;
	background: var(--bg-secondary);
	border: 1px solid var(--border-primary);
	border-radius: 4px;
	cursor: default;
	transition: all 150ms ease;
}

.asset-last-trade:hover {
	background: var(--bg-elevated);
	border-color: var(--border-secondary);
}

.asset-last-trade svg {
	flex-shrink: 0;
	color: var(--text-tertiary);
}

.last-trade-date {
	font-family: var(--font-mono);
	font-weight: 500;
	color: var(--text-secondary);
	letter-spacing: -0.01em;
	font-size: 0.75rem;
}

/* ==========================================================================
   RING GAUGES - Professional Finance Terminal
   Clean design, smooth animations, proper stacking
   ========================================================================== */

.bbg-gauges-grid {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	flex: 1;
	justify-content: center;
	position: relative;
	z-index: 1;
}

/* Individual Gauge Container */
.bbg-gauge {
	position: relative;
	width: 80px;
	height: 100px;
	display: flex;
	flex-direction: column;
	align-items: center;
	cursor: default;
	transition: transform 200ms ease;
}

/* Hover animation - subtle scale + lift */
.bbg-gauge:hover {
	transform: translateY(-2px);
	z-index: 9999999; /* Bring gauge + tooltip above everything */
}

/* SVG Ring Container - with ring glow wrapper */
.bbg-gauge svg {
	width: 72px;
	height: 72px;
	transform: rotate(-90deg);
	border-radius: 50%;
	transition: box-shadow 300ms ease;
}

/* Background ring track */
.bbg-gauge-bg {
	fill: none;
	stroke: rgba(255, 255, 255, 0.08);
	stroke-width: 4;
}

/* Fill ring */
.bbg-gauge-fill {
	fill: none;
	stroke-width: 4;
	stroke-linecap: round;
	transition: stroke-dasharray 800ms cubic-bezier(0.4, 0, 0.2, 1),
	            stroke 300ms ease;
}

/* Hide fill when 0% */
.bbg-gauge-fill.bbg-hidden {
	stroke: transparent !important;
}

/* Colors */
.bbg-green { stroke: var(--gain); }
.bbg-blue { stroke: var(--accent-primary); }
.bbg-red { stroke: var(--loss); }
.bbg-amber { stroke: var(--loss); } /* OUT = not in market = same as SELL */

/* Value PERFECTLY centered in ring */
.bbg-gauge-value {
	position: absolute;
	top: 36px;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 0.9375rem;
	font-weight: 600;
	font-family: var(--font-mono);
	color: var(--text-secondary);
	letter-spacing: -0.02em;
	line-height: 1;
	transition: color 200ms ease, transform 200ms ease;
}

/* Label below ring - CENTERED */
.bbg-gauge-label {
	position: absolute;
	top: 78px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 0.625rem;
	font-weight: 600;
	color: var(--text-quaternary);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	white-space: nowrap;
	transition: color 200ms ease;
}

/* ========== HOVER EFFECTS - Make it alive ========== */
.bbg-gauge:hover .bbg-gauge-value {
	color: var(--text-primary);
	transform: translate(-50%, -50%) scale(1.05);
}

.bbg-gauge:hover .bbg-gauge-label {
	color: var(--text-secondary);
}

/* ========== RING TOOLTIPS - Portal to body ========== */
/* Tooltip is moved to <body> via JS, styled here */
.ring-tooltip-portal {
	position: fixed;
	background: rgba(15, 20, 30, 0.98);
	border: 1px solid rgba(75, 85, 99, 0.8);
	border-radius: 8px;
	padding: 0.75rem 1rem;
	min-width: 200px;
	max-width: 280px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 150ms ease;
	z-index: 2147483647; /* Max z-index */
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
	text-align: left;
}

.ring-tooltip-portal.visible {
	opacity: 1;
	visibility: visible;
}

/* Tooltip Header */
.ring-tooltip-portal .tooltip-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.5rem;
}

.ring-tooltip-portal .tooltip-title {
	font-size: 0.875rem;
	font-weight: 700;
	color: #f9fafb;
}

/* Active Badge */
.ring-tooltip-portal .tooltip-badge {
	font-size: 0.625rem;
	font-weight: 600;
	padding: 0.125rem 0.5rem;
	border-radius: 4px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.ring-tooltip-portal .tooltip-badge-green {
	background: rgba(16, 185, 129, 0.2);
	color: #10b981;
}

.ring-tooltip-portal .tooltip-badge-blue {
	background: rgba(59, 130, 246, 0.2);
	color: #3b82f6;
}

.ring-tooltip-portal .tooltip-badge-red {
	background: rgba(239, 68, 68, 0.2);
	color: #ef4444;
}

.ring-tooltip-portal .tooltip-description {
	font-size: 0.75rem;
	color: #9ca3af;
	line-height: 1.5;
	margin-bottom: 0.75rem;
}

/* Uniform Status Line for all 4 rings (Buy/Long/Sell/Out) */
.ring-tooltip-portal .tooltip-status {
	font-size: 0.75rem;
	font-weight: 600;
	font-family: var(--font-mono, monospace);
	padding: 0.375rem 0.625rem;
	margin-top: 0.625rem;
	border-radius: 4px;
	text-align: center;
}

.ring-tooltip-portal .tooltip-status-buy {
	background: rgba(16, 185, 129, 0.15);
	border: 1px solid rgba(16, 185, 129, 0.4);
	color: #10b981;
}

.ring-tooltip-portal .tooltip-status-sell {
	background: rgba(239, 68, 68, 0.15);
	border: 1px solid rgba(239, 68, 68, 0.4);
	color: #ef4444;
}

.ring-tooltip-portal .tooltip-status-inactive {
	background: rgba(107, 114, 128, 0.1);
	border: 1px solid rgba(107, 114, 128, 0.3);
	color: #6b7280;
}

/* Price + Forecast chart */
.price-forecast-wrapper {
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: linear-gradient(180deg, rgba(15,20,25,0.4) 0%, rgba(15,20,25,0.25) 100%);
	border-radius: 14px;
	padding: 10px 10px 6px 10px;
	border: 1px solid rgba(255, 255, 255, 0.04);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
}

.price-forecast-canvas {
	width: 100%;
	height: 320px;
	display: block;
}

.price-volume-canvas {
	width: 100%;
	height: 90px;
	display: block;
}

/* ==========================================================================
   CHART HERO CONTAINER - Full Width Bloomberg Style
   Supports light/dark mode
   ========================================================================== */

.chart-hero-container {
	background: var(--bg-secondary, #111827);
	border: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.06));
	border-radius: 12px;
	padding: 1.25rem;
	margin-bottom: 1.5rem;
}

/* Light mode - Full support */
[data-theme="light"] .chart-hero-container,
.light-mode .chart-hero-container {
	background: #ffffff;
	border-color: rgba(0, 0, 0, 0.1);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .chart-hero-header,
.light-mode .chart-hero-header {
	border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .chart-symbol,
.light-mode .chart-symbol {
	color: #111827;
}

[data-theme="light"] .chart-separator,
.light-mode .chart-separator {
	color: #9ca3af;
}

[data-theme="light"] .chart-type-badge,
.light-mode .chart-type-badge {
	background: rgba(59, 130, 246, 0.12);
	color: #2563eb;
}

[data-theme="light"] .legend-item,
.light-mode .legend-item {
	color: #4b5563;
}

[data-theme="light"] .tf-pill,
.light-mode .tf-pill {
	color: #6b7280;
}

[data-theme="light"] .tf-pill:hover,
.light-mode .tf-pill:hover {
	background: rgba(0, 0, 0, 0.05);
	color: #374151;
}

[data-theme="light"] .tf-pill.active,
.light-mode .tf-pill.active {
	background: #2563eb;
	color: #ffffff;
}

/* Header: Symbol + Pills + Legend */
.chart-hero-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chart-hero-left {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.chart-symbol {
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--text-primary);
	letter-spacing: -0.02em;
}

.chart-separator {
	color: var(--text-quaternary);
	font-size: 1rem;
}

/* Chart Type Badge with Info Tooltip - Aligned with page tooltip style */
.chart-type-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--accent-primary);
	background: rgba(59, 130, 246, 0.12);
	padding: 0.3rem 0.6rem;
	border-radius: 4px;
	letter-spacing: 0.02em;
	position: relative;
	cursor: help;
}

.chart-info-icon {
	display: inline-flex;
	align-items: center;
	opacity: 0.6;
	transition: opacity 150ms ease;
}

.chart-type-badge:hover .chart-info-icon {
	opacity: 1;
}

.chart-type-badge .chart-info-content {
	position: absolute;
	bottom: calc(100% + 12px);
	left: 50%;
	transform: translateX(-50%);
	width: 300px;
	background: var(--bg-tertiary, rgba(13, 17, 23, 0.98));
	border: 1px solid var(--border-primary, rgba(59, 130, 246, 0.25));
	border-radius: 8px;
	padding: 1rem;
	opacity: 0;
	visibility: hidden;
	transition: all 150ms ease;
	z-index: 100;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
	text-align: left;
}

.chart-type-badge:hover .chart-info-content {
	opacity: 1;
	visibility: visible;
}

.chart-type-badge .chart-info-content::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: var(--border-primary, rgba(59, 130, 246, 0.25));
}

/* Tooltip inner styles - same as page tooltips */
.chart-type-badge .tooltip-title,
.legend-tooltip .tooltip-title {
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--text-primary);
	margin-bottom: 0.5rem;
}

.chart-type-badge .tooltip-description,
.legend-tooltip .tooltip-description {
	font-size: 0.75rem;
	color: var(--text-secondary);
	line-height: 1.5;
	margin-bottom: 0.5rem;
}

.chart-type-badge .tooltip-formula,
.legend-tooltip .tooltip-formula {
	font-size: 0.6875rem;
	font-family: var(--font-mono);
	color: var(--accent-primary);
	background: rgba(59, 130, 246, 0.1);
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	display: inline-block;
}

.chart-type-badge .tooltip-note,
.legend-tooltip .tooltip-note {
	margin-top: 0.5rem;
	padding-top: 0.5rem;
	border-top: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.08));
	font-size: 0.6875rem;
	color: var(--text-quaternary);
	font-style: italic;
}

/* Light mode support */
[data-theme="light"] .chart-type-badge .chart-info-content,
[data-theme="light"] .legend-tooltip {
	background: rgba(255, 255, 255, 0.98);
	border-color: rgba(59, 130, 246, 0.3);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* Timeframe Pills - Terminal Style */
.chart-tf-pills {
	display: flex;
	gap: 0.25rem;
	background: rgba(0, 0, 0, 0.2);
	padding: 0.25rem;
	border-radius: 6px;
}

.tf-pill {
	padding: 0.375rem 0.75rem;
	font-size: 0.6875rem;
	font-weight: 600;
	color: var(--text-tertiary);
	background: transparent;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: all 150ms ease;
	letter-spacing: 0.03em;
}

.tf-pill:hover {
	color: var(--text-secondary);
	background: rgba(255, 255, 255, 0.05);
}

.tf-pill.active {
	color: var(--text-primary);
	background: var(--accent-primary);
	box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.tf-pill.disabled {
	opacity: 0.3;
	cursor: not-allowed;
	pointer-events: none;
}

/* Legend Inline */
.chart-legend-inline {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.legend-item {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.6875rem;
	color: var(--text-tertiary);
	font-weight: 500;
}

.legend-line {
	width: 16px;
	height: 3px;
	border-radius: 1px;
}

.legend-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

/* Legend dot for AIndex (close-only) - Bloomberg elegant dot */
.legend-dot-rising {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(59, 130, 246, 0.9); /* Blue accent */
	border: 2px solid rgba(59, 130, 246, 0.3);
	box-shadow: 
		0 0 0 2px rgba(59, 130, 246, 0.1),
		0 0 12px rgba(59, 130, 246, 0.5),
		inset 0 1px 2px rgba(255, 255, 255, 0.3);
	position: relative;
	animation: legendDotPulse 2s ease-in-out infinite;
}

@keyframes legendDotPulse {
	0%, 100% { 
		box-shadow: 
			0 0 0 2px rgba(59, 130, 246, 0.1),
			0 0 12px rgba(59, 130, 246, 0.5),
			inset 0 1px 2px rgba(255, 255, 255, 0.3);
	}
	50% { 
		box-shadow: 
			0 0 0 3px rgba(59, 130, 246, 0.15),
			0 0 16px rgba(59, 130, 246, 0.7),
			inset 0 1px 2px rgba(255, 255, 255, 0.3);
	}
}

/* Legend visual elements */
.legend-candle {
	display: inline-block;
	width: 6px;
	height: 14px;
	background: linear-gradient(180deg, var(--gain) 0%, var(--gain) 40%, var(--loss) 60%, var(--loss) 100%);
	border-radius: 1px;
	position: relative;
}

.legend-candle::before,
.legend-candle::after {
	content: '';
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	width: 1px;
	height: 3px;
	background: currentColor;
}

.legend-candle::before { top: -2px; background: var(--gain); }
.legend-candle::after { bottom: -2px; background: var(--loss); }

.legend-cone {
	display: inline-block;
	width: 20px;
	height: 10px;
	background: linear-gradient(90deg, transparent 0%, rgba(59, 130, 246, 0.4) 50%, transparent 100%);
	border-radius: 0 8px 8px 0;
	position: relative;
}

.legend-cone::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 1px;
	background: var(--accent-primary);
	transform: translateY(-50%);
}

.legend-stop {
	background: var(--loss);
	height: 2px;
	width: 16px;
	position: relative;
}

.legend-stop::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 1px;
	background: var(--loss);
	border-style: dashed;
}

/* Legend item with tooltip - Same style as page tooltips */
.legend-item.has-tooltip {
	position: relative;
	cursor: help;
	transition: opacity 150ms ease;
}

.legend-item.has-tooltip:hover {
	opacity: 0.9;
}

.legend-tooltip {
	position: absolute;
	bottom: calc(100% + 12px);
	left: 50%;
	transform: translateX(-50%);
	width: 240px;
	background: var(--bg-tertiary, rgba(13, 17, 23, 0.98));
	border: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.12));
	border-radius: 8px;
	padding: 0.875rem 1rem;
	opacity: 0;
	visibility: hidden;
	transition: all 150ms ease;
	z-index: 100;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
	text-align: left;
}

.legend-item.has-tooltip:hover .legend-tooltip {
	opacity: 1;
	visibility: visible;
}

.legend-tooltip::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: var(--border-secondary, rgba(255, 255, 255, 0.12));
}

/* Chart Body - Dark mode (default) */
.chart-hero-body {
	position: relative;
	background: linear-gradient(180deg, rgba(15, 20, 30, 0.5) 0%, rgba(15, 20, 30, 0.3) 100%);
	border-radius: 8px;
	padding: 0.75rem;
	border: 1px solid rgba(255, 255, 255, 0.04);
}

/* Light mode override for chart body - Correct selector: html:not(.dark) */
html:not(.dark) .chart-hero-body {
	background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.7) 100%) !important;
	border-color: rgba(0, 0, 0, 0.06) !important;
}

.price-forecast-canvas {
	width: 100%;
	height: 360px !important;
	display: block;
	cursor: crosshair;
}

.price-volume-canvas {
	width: 100%;
	height: 100px !important;
	display: block;
	cursor: crosshair;
}

/* ==========================================================================
   CROSSHAIR TOOLTIP - Premium Finance Style
   ========================================================================== */

/* ==========================================================================
   CHART CROSSHAIR TOOLTIP - Bloomberg/TradingView Style
   Supports light/dark mode via CSS variables
   ========================================================================== */

.chart-crosshair-tooltip {
	position: fixed;
	z-index: 100000;
	display: none;
	min-width: 160px;
	background: var(--tooltip-bg, rgba(0, 0, 0, 0.94));
	border: 1px solid var(--tooltip-border, rgba(255, 255, 255, 0.12));
	border-radius: 6px;
	padding: 0.625rem 0.75rem;
	box-shadow: 0 8px 24px var(--tooltip-shadow, rgba(0, 0, 0, 0.5));
	font-family: var(--font-mono);
	pointer-events: none;
}

/* Light mode overrides */
[data-theme="light"] .chart-crosshair-tooltip,
.light-mode .chart-crosshair-tooltip {
	--tooltip-bg: rgba(255, 255, 255, 0.98);
	--tooltip-border: rgba(0, 0, 0, 0.1);
	--tooltip-shadow: rgba(0, 0, 0, 0.15);
}

/* Date row */
.chart-crosshair-tooltip .ctt-date-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.6875rem;
	color: var(--text-secondary);
	margin-bottom: 0.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.08));
}

.chart-crosshair-tooltip .ctt-signal-badge {
	font-size: 0.5625rem;
	font-weight: 700;
	padding: 0.15rem 0.35rem;
	border-radius: 3px;
	text-transform: uppercase;
}

.chart-crosshair-tooltip .ctt-signal-buy {
	background: var(--gain);
	color: #000;
}

.chart-crosshair-tooltip .ctt-signal-sell {
	background: var(--loss);
	color: #fff;
}

/* OHLC Grid - 2x2 layout */
.chart-crosshair-tooltip .ctt-ohlc-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.375rem;
	margin-bottom: 0.5rem;
}

.chart-crosshair-tooltip .ctt-ohlc-cell {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.chart-crosshair-tooltip .ctt-ohlc-label {
	font-size: 0.5625rem;
	font-weight: 600;
	color: var(--text-quaternary);
	letter-spacing: 0.04em;
}

.chart-crosshair-tooltip .ctt-ohlc-val {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--text-primary);
}

.chart-crosshair-tooltip .ctt-ohlc-val.up { color: var(--gain); }
.chart-crosshair-tooltip .ctt-ohlc-val.down { color: var(--loss); }

.chart-crosshair-tooltip .ctt-close {
	background: var(--bg-hover, rgba(255, 255, 255, 0.04));
	padding: 0.25rem;
	border-radius: 4px;
	margin: -0.25rem;
}

/* Volume row */
.chart-crosshair-tooltip .ctt-vol-row {
	font-size: 0.625rem;
	color: var(--text-tertiary);
	padding-top: 0.375rem;
	border-top: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.06));
}

.chart-crosshair-tooltip .ctt-vol-row b {
	color: var(--text-secondary);
	font-weight: 600;
}

/* Forecast row */
.chart-crosshair-tooltip .ctt-forecast-row {
	padding-top: 0.5rem;
	border-top: 1px solid rgba(59, 130, 246, 0.2);
	margin-top: 0.375rem;
}

.chart-crosshair-tooltip .ctt-forecast-title {
	display: block;
	font-size: 0.5625rem;
	font-weight: 600;
	color: var(--accent-primary);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 0.375rem;
}

.chart-crosshair-tooltip .ctt-forecast-values {
	display: flex;
	justify-content: space-between;
	font-size: 0.6875rem;
	font-weight: 600;
}

.chart-crosshair-tooltip .ctt-forecast-values .lo { color: var(--loss); }
.chart-crosshair-tooltip .ctt-forecast-values .mid { color: var(--accent-primary); }
.chart-crosshair-tooltip .ctt-forecast-values .hi { color: var(--gain); }

/* Signal Tooltip (when hovering on buy/sell marker) */
.chart-crosshair-tooltip .ctt-signal-tooltip {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.25rem 0;
}

.chart-crosshair-tooltip .ctt-signal-tooltip.buy { color: var(--gain); }
.chart-crosshair-tooltip .ctt-signal-tooltip.sell { color: var(--loss); }

.chart-crosshair-tooltip .ctt-signal-icon {
	font-size: 1rem;
	font-weight: 700;
}

.chart-crosshair-tooltip .ctt-signal-text {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.03em;
}

.chart-crosshair-tooltip .ctt-signal-date {
	font-size: 0.625rem;
	color: var(--text-tertiary);
	margin-left: auto;
}

/* Volume Tooltip */
.chart-crosshair-tooltip .ctt-vol-tooltip {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	text-align: center;
}

.chart-crosshair-tooltip .ctt-vol-date {
	font-size: 0.625rem;
	color: var(--text-tertiary);
}

.chart-crosshair-tooltip .ctt-vol-value {
	font-size: 1rem;
	font-weight: 700;
	font-family: var(--font-mono);
}

.chart-crosshair-tooltip .ctt-vol-value.up { color: var(--gain); }
.chart-crosshair-tooltip .ctt-vol-value.down { color: var(--loss); }

.chart-crosshair-tooltip .ctt-vol-label {
	font-size: 0.5625rem;
	font-weight: 600;
	color: var(--text-quaternary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* ==========================================================================
   FORECAST-ONLY TOOLTIP - Premium Finance Style
   ========================================================================== */

.chart-crosshair-tooltip .ctt-forecast-only {
	min-width: 180px;
}

.chart-crosshair-tooltip .ctt-forecast-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.75rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.08));
}

.chart-crosshair-tooltip .ctt-forecast-badge {
	font-size: 0.5625rem;
	font-weight: 700;
	color: var(--accent-primary);
	background: rgba(59, 130, 246, 0.15);
	padding: 0.2rem 0.5rem;
	border-radius: 3px;
	letter-spacing: 0.06em;
}

.chart-crosshair-tooltip .ctt-forecast-date {
	font-size: 0.6875rem;
	color: var(--text-tertiary);
}

.chart-crosshair-tooltip .ctt-forecast-main {
	text-align: center;
	margin-bottom: 0.875rem;
	padding: 0.625rem;
	background: var(--bg-hover, rgba(255, 255, 255, 0.02));
	border-radius: 6px;
}

.chart-crosshair-tooltip .ctt-forecast-expected {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 0.625rem;
}

.chart-crosshair-tooltip .ctt-forecast-dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	flex-shrink: 0;
	display: inline-block;
	/* Border, shadow, and background now inline for vivid color matching */
}

.chart-crosshair-tooltip .ctt-forecast-dot-small {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
	margin-right: 0.375rem;
	display: inline-block;
	/* Border now inline for vivid color matching */
}

.chart-crosshair-tooltip .ctt-forecast-expected .ctt-forecast-label {
	font-size: 0.625rem;
	font-weight: 600;
	color: var(--text-tertiary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.chart-crosshair-tooltip .ctt-forecast-expected .ctt-forecast-value {
	font-size: 1.625rem;
	font-weight: 700;
	font-family: var(--font-mono);
	letter-spacing: -0.02em;
}

.chart-crosshair-tooltip .ctt-forecast-expected .ctt-forecast-value.up { color: var(--gain); }
.chart-crosshair-tooltip .ctt-forecast-expected .ctt-forecast-value.down { color: var(--loss); }

.chart-crosshair-tooltip .ctt-forecast-range {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.625rem;
	background: var(--bg-hover, rgba(255, 255, 255, 0.03));
	border-radius: 6px;
	margin-bottom: 0.5rem;
}

.chart-crosshair-tooltip .ctt-range-item {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.375rem;
	flex: 1;
}

.chart-crosshair-tooltip .ctt-range-item:last-child {
	text-align: right;
}

.chart-crosshair-tooltip .ctt-range-label {
	font-size: 0.5rem;
	font-weight: 600;
	color: var(--text-quaternary);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	flex: 1;
}

.chart-crosshair-tooltip .ctt-range-value {
	font-size: 0.8125rem;
	font-weight: 700;
	font-family: var(--font-mono);
}

.chart-crosshair-tooltip .ctt-range-value.up { color: var(--gain); }
.chart-crosshair-tooltip .ctt-range-value.down { color: var(--loss); }

.chart-crosshair-tooltip .ctt-range-divider {
	width: 1px;
	height: 28px;
	background: var(--border-secondary, rgba(255, 255, 255, 0.1));
}

.chart-crosshair-tooltip .ctt-forecast-stop {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.625rem;
	padding: 0.625rem 0.75rem;
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.25);
	border-radius: 6px;
	margin-bottom: 0.625rem;
	transition: all 0.2s ease;
}

.chart-crosshair-tooltip .ctt-forecast-stop:hover {
	background: rgba(239, 68, 68, 0.15);
	border-color: rgba(239, 68, 68, 0.35);
}

.chart-crosshair-tooltip .ctt-stop-label {
	font-size: 0.5625rem;
	font-weight: 600;
	color: var(--text-quaternary);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.chart-crosshair-tooltip .ctt-stop-value {
	font-size: 0.875rem;
	font-weight: 700;
	font-family: var(--font-mono);
	color: var(--loss);
}

.chart-crosshair-tooltip .ctt-forecast-note {
	font-size: 0.5625rem;
	color: var(--text-quaternary);
	text-align: center;
	font-style: italic;
}

/* ==========================================================================
   CANDLE TOOLTIP - Compact Finance Style
   ========================================================================== */

.chart-crosshair-tooltip .ctt-candle {
	min-width: 150px;
}

.chart-crosshair-tooltip .ctt-candle-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.5rem;
	padding-bottom: 0.375rem;
	border-bottom: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.08));
}

.chart-crosshair-tooltip .ctt-candle-date {
	font-size: 0.6875rem;
	color: var(--text-secondary);
	font-weight: 500;
}

.chart-crosshair-tooltip .ctt-candle-price {
	display: flex;
	align-items: baseline;
	gap: 0.375rem;
	margin-bottom: 0.375rem;
}

.chart-crosshair-tooltip .ctt-price-close {
	font-size: 1.125rem;
	font-weight: 700;
	font-family: var(--font-mono);
}

.chart-crosshair-tooltip .ctt-price-close.up { color: var(--gain); }
.chart-crosshair-tooltip .ctt-price-close.down { color: var(--loss); }

.chart-crosshair-tooltip .ctt-price-arrow {
	font-size: 0.75rem;
}

.chart-crosshair-tooltip .ctt-price-arrow.up { color: var(--gain); }
.chart-crosshair-tooltip .ctt-price-arrow.down { color: var(--loss); }

.chart-crosshair-tooltip .ctt-candle-ohlc {
	display: flex;
	gap: 0.625rem;
	font-size: 0.625rem;
	color: var(--text-tertiary);
	font-family: var(--font-mono);
	margin-bottom: 0.25rem;
}

.chart-crosshair-tooltip .ctt-candle-vol {
	font-size: 0.625rem;
	color: var(--text-quaternary);
	font-family: var(--font-mono);
	padding-top: 0.25rem;
	border-top: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.06));
	margin-top: 0.25rem;
}

.chart-crosshair-tooltip .ctt-candle-forecast {
	display: flex;
	justify-content: space-between;
	font-size: 0.625rem;
	font-weight: 600;
	font-family: var(--font-mono);
	padding-top: 0.375rem;
	border-top: 1px solid rgba(59, 130, 246, 0.2);
	margin-top: 0.375rem;
}

.chart-crosshair-tooltip .ctt-candle-forecast .down { color: var(--loss); }
.chart-crosshair-tooltip .ctt-candle-forecast .mid { color: var(--accent-primary); }
.chart-crosshair-tooltip .ctt-candle-forecast .up { color: var(--gain); }

/* ==========================================================================
   SIGNAL SUMMARY PANEL
   ========================================================================== */

.signal-stat-block {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.75rem;
	background: rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.04);
}

.signal-stat-label {
	font-size: 0.625rem;
	font-weight: 600;
	color: var(--text-quaternary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.signal-stat-value {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--text-primary);
	font-family: var(--font-mono);
}

.signal-badge-compact {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.25rem 0.5rem;
	font-size: 0.625rem;
	font-weight: 700;
	border-radius: 4px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.signal-badge-compact.signal-long,
.signal-badge-compact.signal-buy {
	background: rgba(16, 185, 129, 0.15);
	color: var(--gain);
	border: 1px solid rgba(16, 185, 129, 0.3);
}

.signal-badge-compact.signal-sell,
.signal-badge-compact.signal-flat,
.signal-badge-compact.signal-out {
	background: rgba(239, 68, 68, 0.15);
	color: var(--loss);
	border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
	.chart-hero-header {
		flex-wrap: wrap;
		gap: 0.75rem;
	}
	
	.chart-legend-inline {
		display: none;
	}
	
	.chart-tf-pills {
		order: 3;
		width: 100%;
		justify-content: center;
	}
}

/* Phase Indicator for Current tooltip (original style) */
.ring-tooltip-portal .tooltip-phase-indicator {
	display: flex;
	gap: 0.75rem;
	margin-top: 0.5rem;
	padding-top: 0.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ring-tooltip-portal .tooltip-phase {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.05);
	opacity: 0.5;
	transition: opacity 150ms ease;
}

.ring-tooltip-portal .tooltip-phase-active {
	opacity: 1;
	background: rgba(255, 255, 255, 0.1);
}

.ring-tooltip-portal .tooltip-phase-letter {
	font-size: 0.875rem;
	font-weight: 700;
}

.ring-tooltip-portal .tooltip-phase-name {
	font-size: 0.625rem;
	color: #9ca3af;
	text-transform: uppercase;
}

/* Phase Indicator */
.ring-tooltip-portal .tooltip-phase-indicator {
	display: flex;
	gap: 0.75rem;
	padding-top: 0.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ring-tooltip-portal .tooltip-phase {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.05);
	opacity: 0.5;
	transition: opacity 150ms ease;
}

.ring-tooltip-portal .tooltip-phase-active {
	opacity: 1;
	background: rgba(255, 255, 255, 0.1);
}

.ring-tooltip-portal .tooltip-phase-letter {
	font-size: 0.875rem;
	font-weight: 700;
}

.ring-tooltip-portal .tooltip-phase-name {
	font-size: 0.625rem;
	color: #9ca3af;
	text-transform: uppercase;
}

/* Signal Status */
.ring-tooltip-portal .tooltip-signal-status {
	margin-top: 0.5rem;
	padding-top: 0.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ring-tooltip-portal .tooltip-signal-active {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.375rem 0.625rem;
	background: rgba(16, 185, 129, 0.15);
	border: 1px solid rgba(16, 185, 129, 0.3);
	border-radius: 4px;
	color: #10b981;
	font-size: 0.75rem;
	font-weight: 600;
}

.ring-tooltip-portal .tooltip-signal-sell {
	background: rgba(239, 68, 68, 0.15);
	border-color: rgba(239, 68, 68, 0.3);
	color: #ef4444;
}

.ring-tooltip-portal .tooltip-signal-icon {
	font-size: 0.625rem;
}

.ring-tooltip-portal .tooltip-signal-inactive {
	font-size: 0.6875rem;
	color: #6b7280;
	font-style: italic;
}

/* Hide original tooltip (content moved to portal) */
.bbg-gauge .tooltip {
	display: none;
}

.bbg-gauge .tooltip-title {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 0.25rem;
}

.bbg-gauge .tooltip-description {
	font-size: 0.75rem;
	color: var(--text-secondary);
	line-height: 1.4;
}

.bbg-gauge .tooltip-formula {
	font-family: var(--font-mono);
	font-size: 0.6875rem;
	color: var(--text-tertiary);
	background: var(--bg-primary);
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	margin-top: 0.5rem;
	border: 1px solid var(--border-secondary);
}

/* ========== HIGHLIGHT STATE (current phase match) ========== */
.bbg-gauge-highlight svg {
	box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.bbg-gauge-highlight .bbg-gauge-value {
	color: var(--text-primary);
}

.bbg-gauge-highlight .bbg-gauge-label {
	color: var(--text-secondary);
}

/* ========== ACTIVE STATE (signal active) ========== */
.bbg-gauge-active svg {
	box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.bbg-gauge-active .bbg-gauge-value {
	color: var(--text-primary);
}

/* ========== CURRENT PHASE RING ========== */
.bbg-current-label {
	font-size: 1.125rem !important;
	font-weight: 700;
}

.bbg-current-growth svg { box-shadow: 0 0 14px rgba(16, 185, 129, 0.5); }
.bbg-current-growth .bbg-current-label { color: var(--gain); }

.bbg-current-value svg { box-shadow: 0 0 14px rgba(59, 130, 246, 0.5); }
.bbg-current-value .bbg-current-label { color: var(--accent-primary); }

.bbg-current-lack svg { box-shadow: 0 0 14px rgba(239, 68, 68, 0.5); }
.bbg-current-lack .bbg-current-label { color: var(--loss); }

/* ========== OUT STATE (same as SELL - not in market) ========== */
.bbg-gauge-out svg { box-shadow: 0 0 12px rgba(239, 68, 68, 0.5); }
.bbg-gauge-out .bbg-gauge-value { color: var(--loss); }
.bbg-gauge-out .bbg-gauge-label { color: var(--loss); }

/* ========== SELL STATE ========== */
.bbg-gauge-sell svg { box-shadow: 0 0 12px rgba(239, 68, 68, 0.5); }
.bbg-gauge-sell .bbg-gauge-value { color: var(--loss); }
.bbg-gauge-sell .bbg-gauge-label { color: var(--loss); }

/* ========== HOVER - Clear visual feedback ========== */
.bbg-gauge:hover svg {
	box-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
	transform: rotate(-90deg) scale(1.02);
}

.bbg-gauge:has(.bbg-green):hover svg { 
	box-shadow: 0 0 24px rgba(16, 185, 129, 0.6); 
}
.bbg-gauge:has(.bbg-blue):hover svg { 
	box-shadow: 0 0 24px rgba(59, 130, 246, 0.6); 
}
.bbg-gauge:has(.bbg-red):hover svg,
.bbg-gauge:has(.bbg-amber):hover svg { 
	box-shadow: 0 0 24px rgba(239, 68, 68, 0.6); 
}

/* ========== LIGHT MODE ========== */
:root:not(.dark) .bbg-gauge-bg {
	stroke: rgba(0, 0, 0, 0.1);
}

:root:not(.dark) .bbg-gauge .tooltip {
	background: #ffffff;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

:root:not(.dark) .bbg-gauge .tooltip::after {
	background: #ffffff;
}

/* ==========================================================================
   RESPONSIVE RING GAUGES
   ========================================================================== */

@media (max-width: 1200px) {
	.bbg-gauge { width: 72px; height: 92px; }
	.bbg-gauge svg { width: 64px; height: 64px; }
	.bbg-gauge-value { top: 32px; font-size: 0.875rem; }
	.bbg-gauge-label { top: 70px; }
}

@media (max-width: 1024px) {
	.bbg-gauges-grid { flex-wrap: wrap; gap: 0.75rem; }
	.bbg-gauge { width: 64px; height: 84px; }
	.bbg-gauge svg { width: 56px; height: 56px; }
	.bbg-gauge-value { top: 28px; font-size: 0.8125rem; }
	.bbg-gauge-label { top: 62px; font-size: 0.5625rem; }
}

@media (max-width: 768px) {
	.bbg-gauges-grid { gap: 0.5rem; }
	.bbg-gauge { width: 56px; height: 76px; }
	.bbg-gauge svg { width: 48px; height: 48px; }
	.bbg-gauge-value { top: 24px; font-size: 0.75rem; }
	.bbg-gauge-label { top: 54px; font-size: 0.5rem; }
	.bbg-gauge .tooltip { display: none; }
}

/* ==========================================================================
   AI COMMENTARY SECTION - Elite Terminal Style
   ========================================================================== */

/* AI Commentary - Tech Blue Theme (AI = Artificial Intelligence) */
.ai-commentary-section {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	padding: 1.25rem 1.5rem;
	background: var(--bg-secondary);
	border: 1px solid var(--border-primary);
	border-left: 3px solid var(--accent-primary);
	border-radius: 0 8px 8px 0;
	position: relative;
}

.ai-commentary-icon {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--accent-primary) 0%, #2563eb 100%);
	border-radius: 10px;
	color: white;
	box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.ai-commentary-icon svg {
	width: 20px;
	height: 20px;
}

.ai-commentary-content {
	flex: 1;
	font-size: 0.875rem;
	line-height: 1.75;
	color: var(--text-secondary);
}

.ai-commentary-content b,
.ai-commentary-content strong {
	color: var(--text-primary);
	font-weight: 600;
}

/* Asset links in notes (parsed from {LINK-text<>web_id<>I}) */
.ai-commentary-content .note-asset-link {
	color: var(--accent-primary);
	text-decoration: none;
	font-weight: 600;
	border-bottom: 1px solid transparent;
	transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-commentary-content .note-asset-link:hover {
	color: var(--accent-primary);
	border-bottom-color: var(--accent-primary);
	transform: translateY(-1px);
}

/* Highlight specific words */
.ai-commentary-content .highlight-buy,
.ai-commentary-content a[href*="bought"] {
	color: var(--gain);
	font-weight: 600;
}

.ai-commentary-content .highlight-sell {
	color: var(--loss);
	font-weight: 600;
}

/* Value highlight from screen */
.ai-commentary-content:has(value) {
	color: var(--accent-primary);
}

/* ==========================================================================
   RESPONSIVE AI COMMENTARY
   ========================================================================== */

@media (max-width: 900px) {
	.ai-commentary-section {
		padding: 1rem;
	}
	
	.ai-commentary-content {
		font-size: 0.8125rem;
	}
}

@media (max-width: 768px) {
	.asset-header-title {
		font-size: 1.375rem;
	}
	
	.ai-commentary-section {
		flex-direction: column;
		gap: 0.75rem;
	}
	
	.ai-commentary-icon {
		width: 28px;
		height: 28px;
	}
}

/* ==========================================================================
   AI COMMENTARY (Note field from JSON)
   ========================================================================== */

.ai-commentary {
	display: flex;
	gap: 1rem;
	padding: 1.25rem;
	background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(16, 185, 129, 0.08) 100%);
	border-left: 3px solid var(--accent-primary);
	border-radius: 8px;
	margin-bottom: 2rem;
	animation: fadeIn 400ms ease;
}

.commentary-icon {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--accent-primary);
	border-radius: 8px;
	color: white;
}

.commentary-content {
	flex: 1;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--text-primary);
}

.commentary-content b {
	font-weight: 700;
	color: var(--accent-primary);
}

.commentary-content br {
	display: block;
	content: "";
	margin-top: 0.5rem;
}

/* Light mode */
:root:not(.dark) .ai-commentary {
	background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
	border-left-color: var(--accent-primary);
}

/* ==========================================================================
   HEATMAP CONTAINER
   ========================================================================== */

.heatmap-wrapper {
	margin: 2rem 0;
	animation: fadeIn 400ms ease;
}

.heatmap-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
	gap: 1rem;
}

.heatmap-title {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--text-primary);
	margin: 0;
	letter-spacing: -0.02em;
}

.heatmap-subtitle {
	font-size: 0.875rem;
	color: var(--text-secondary);
	margin-top: 0.25rem;
}

/* ==========================================================================
   TABS (3-way toggle: AI, B&H, Diff+)
   ========================================================================== */

.heatmap-tabs {
	display: inline-flex;
	background: var(--bg-secondary);
	padding: 4px;
	border-radius: 10px;
	border: 1px solid var(--border-primary);
	gap: 4px;
}

.heatmap-tab {
	padding: 8px 20px;
	border: none;
	background: transparent;
	color: var(--text-secondary);
	font-size: 13px;
	font-weight: 600;
	border-radius: 7px;
	cursor: pointer;
	transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
	white-space: nowrap;
	letter-spacing: 0.015em;
}

.heatmap-tab:hover {
	color: var(--text-primary);
	background: rgba(255, 255, 255, 0.05);
}

.heatmap-tab.active {
	background: var(--bg-elevated);
	color: var(--text-primary);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Light mode */
:root:not(.dark) .heatmap-tab {
	color: var(--text-secondary);
}

:root:not(.dark) .heatmap-tab.active {
	background: var(--accent-primary);
	color: white;
}

/* ==========================================================================
   HEATMAP TABLE
   ========================================================================== */

.heatmap-container {
	overflow-x: auto;
	background: var(--bg-secondary);
	border-radius: 12px;
	padding: 1rem;
	border: 1px solid var(--border-primary);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.heatmap-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 2px;
	font-family: var(--font-mono);
}

.heatmap-table thead th {
	padding: 0.5rem 0.75rem;
	text-align: center;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--text-tertiary);
	background: transparent;
	white-space: nowrap;
}

.heatmap-table tbody th {
	padding: 0.5rem 0.75rem;
	text-align: right;
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--text-primary);
	background: var(--bg-tertiary);
	border-radius: 4px;
	white-space: nowrap;
}

.heatmap-table tbody td {
	padding: 0.5rem 0.75rem;
	text-align: center;
	font-size: 0.75rem;
	font-weight: 600;
	border-radius: 4px;
	transition: all 150ms ease;
	cursor: default;
	min-width: 60px;
	position: relative;
}

.heatmap-table tbody td:hover {
	transform: scale(1.05);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	z-index: 10;
}

.heatmap-table tbody td:empty {
	background: var(--bg-tertiary);
	opacity: 0.3;
}

/* ==========================================================================
   COLOR SCALE: GREEN-WHITE-RED (21 levels, -25% to +25%)
   Finance best practice for P&L visualization
   ========================================================================== */

/* GREEN SCALE (Positive returns) */
/* Empty cell (no operations) - Bloomberg Standard: WHITE bg + gray dash */
.heatmap-cell-empty { 
	background-color: #FFFFFF !important; /* White background like zero cells */
	color: #9CA3AF; /* Gray dash "—" */
	font-size: 0.9em; /* Slightly smaller */
}

/* Dark mode: STILL WHITE BACKGROUND (consistent with zero cells) */
.dark-mode .heatmap-cell-empty,
[data-theme="dark"] .heatmap-cell-empty {
	background-color: #FFFFFF !important; /* Force white */
	color: #9CA3AF; /* Gray dash */
	font-size: 0.9em;
}

.heatmap-cell-25 { background-color: #00B050; color: white; } /* +25.0% */
.heatmap-cell-22 { background-color: #1AB862; color: white; } /* +22.5% */
.heatmap-cell-20 { background-color: #33C073; color: white; } /* +20.0% */
.heatmap-cell-17 { background-color: #4DC885; color: #111; }  /* +17.5% */
.heatmap-cell-15 { background-color: #66D096; color: #111; }  /* +15.0% */
.heatmap-cell-12 { background-color: #80D8A8; color: #111; }  /* +12.5% */
.heatmap-cell-10 { background-color: #99E0B9; color: #111; }  /* +10.0% */
.heatmap-cell-7  { background-color: #B3E8CB; color: #111; }  /* +7.5% */
.heatmap-cell-5  { background-color: #CCF0DC; color: #111; }  /* +5.0% */
.heatmap-cell-2  { background-color: #E6F8EE; color: #111; }  /* +2.5% */

/* NEUTRAL (Zero) - FORCE WHITE BACKGROUND ALWAYS (light and dark mode) */
.heatmap-cell-0  { 
	background-color: #FFFFFF !important; 
	color: #111 !important; 
}

/* Dark mode: STILL FORCE WHITE BACKGROUND (no transparency bullshit) */
.dark-mode .heatmap-cell-0,
[data-theme="dark"] .heatmap-cell-0,
:root.dark-mode .heatmap-cell-0 {
	background-color: #FFFFFF !important; /* FORCE WHITE */
	color: #111 !important; /* Black text on white */
}

/* RED SCALE (Negative returns) */
.heatmap-cell--2  { background-color: #FFE5E5; color: #111; } /* -2.5% */
.heatmap-cell--5  { background-color: #FFCCCC; color: #111; } /* -5.0% */
.heatmap-cell--7  { background-color: #FFB2B2; color: #111; } /* -7.5% */
.heatmap-cell--10 { background-color: #FF9999; color: #111; } /* -10.0% */
.heatmap-cell--12 { background-color: #FF7F7F; color: white; } /* -12.5% */
.heatmap-cell--15 { background-color: #FF6666; color: white; } /* -15.0% */
.heatmap-cell--17 { background-color: #FF4C4C; color: white; } /* -17.5% */
.heatmap-cell--20 { background-color: #FF3333; color: white; } /* -20.0% */
.heatmap-cell--22 { background-color: #FF1919; color: white; } /* -22.5% */
.heatmap-cell--25 { background-color: #FF0000; color: white; } /* -25.0% */

/* ==========================================================================
   LOADING & EMPTY STATES
   ========================================================================== */

.heatmap-loading,
.heatmap-error,
.heatmap-empty {
	text-align: center;
	padding: 3rem 1rem;
	color: var(--text-secondary);
}

.heatmap-loading .loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid var(--border-primary);
	border-top-color: var(--accent-primary);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	margin: 0 auto 1rem;
}

.heatmap-error {
	color: var(--loss);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
	.heatmap-table tbody td {
		min-width: 50px;
		padding: 0.4rem 0.5rem;
		font-size: 0.7rem;
	}

	.heatmap-table thead th {
		font-size: 0.7rem;
		padding: 0.4rem 0.5rem;
	}

	.heatmap-table tbody th {
		font-size: 0.8rem;
		padding: 0.4rem 0.5rem;
	}
}

@media (max-width: 768px) {
	.heatmap-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.heatmap-tabs {
		width: 100%;
		justify-content: space-between;
	}

	.heatmap-tab {
		flex: 1;
		padding: 8px 12px;
		font-size: 12px;
	}

	.heatmap-table tbody td {
		min-width: 45px;
		padding: 0.3rem 0.4rem;
		font-size: 0.65rem;
	}

	.heatmap-table thead th {
		font-size: 0.65rem;
		padding: 0.3rem 0.4rem;
	}
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

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

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* Light mode overrides */
:root:not(.dark) .heatmap-container {
	background: var(--bg-primary);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

:root:not(.dark) .heatmap-table tbody th {
	background: var(--bg-secondary);
}

/* ==========================================================================
   ASSET REPORT (Collapsible)
   ========================================================================== */

.asset-report-wrapper {
	margin: 3rem 0;
}

.report-toggle-btn {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.5rem;
	background: var(--bg-secondary);
	border: 1px solid var(--border-primary);
	border-radius: 12px;
	cursor: pointer;
	transition: all 200ms ease;
}

.report-toggle-btn:hover {
	background: var(--bg-tertiary);
	border-color: var(--accent-primary);
	box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.report-toggle-btn.expanded {
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	border-bottom-color: transparent;
}

.report-toggle-content {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.report-toggle-icon {
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--accent-primary) 0%, #2563eb 100%);
	border-radius: 10px;
	color: white;
	flex-shrink: 0;
}

.report-toggle-title {
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--text-primary);
	margin: 0;
	text-align: left;
}

.report-toggle-subtitle {
	font-size: 0.875rem;
	color: var(--text-secondary);
	margin: 0.25rem 0 0 0;
	text-align: left;
}

.report-toggle-arrow {
	transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
	color: var(--text-tertiary);
}

.report-toggle-arrow.rotated {
	transform: rotate(180deg);
}

.report-content {
	background: var(--bg-secondary);
	border: 1px solid var(--border-primary);
	border-top: none;
	border-bottom-left-radius: 12px;
	border-bottom-right-radius: 12px;
	overflow: hidden;
}

.report-inner {
	padding: 2rem;
}

.report-text {
	font-size: 0.9375rem;
	line-height: 1.7;
	color: var(--text-secondary);
}

/* REMOVED - Conflicts with general-info-premium.css dark/light mode handling */
/* .report-text h6.report-section-title {
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-primary);
	margin: 1.5rem 0 0.75rem 0;
} */

.report-text p {
	margin: 0.75rem 0;
	color: var(--text-secondary);
}

.report-text ul.report-list {
	margin: 0.75rem 0;
	padding-left: 1.5rem;
	list-style: none; /* Remove native bullets - custom bullets via ::before */
	color: var(--text-secondary);
}

.report-text ul.report-sublist {
	margin: 0.5rem 0;
	padding-left: 1.5rem;
	list-style: none; /* Remove native bullets - custom bullets via ::before */
}

.report-text li {
	margin: 0.5rem 0;
}

.report-text strong,
.report-text b {
	font-weight: 600;
	color: var(--text-primary);
}

.report-text small {
	font-size: 0.875rem;
	color: var(--text-tertiary);
}

.report-text br {
	display: block;
	content: "";
	margin-top: 0.75rem;
}

.report-loading,
.report-empty {
	text-align: center;
	padding: 2rem;
	color: var(--text-secondary);
}

.report-loading .loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid var(--border-primary);
	border-top-color: var(--accent-primary);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	margin: 0 auto 1rem;
}

/* Light mode */
:root:not(.dark) .report-toggle-btn {
	background: var(--bg-primary);
}

:root:not(.dark) .report-toggle-btn:hover {
	background: var(--bg-secondary);
}

:root:not(.dark) .report-content {
	background: var(--bg-primary);
}

/* ==========================================================================
   SIGNAL INLINE - Minimal Status Bar
   ========================================================================== */

.signal-inline {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	padding: 0.875rem 1.25rem;
	background: var(--bg-secondary);
	border: 1px solid var(--border-primary);
	border-radius: 10px;
}

.signal-inline-status {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.375rem 0.75rem;
	border-radius: 6px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.05em;
}

.status-indicator {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.status-long {
	background: rgba(16, 185, 129, 0.12);
	color: var(--gain);
}

.status-long .status-indicator {
	background: var(--gain);
	box-shadow: 0 0 8px var(--gain);
	animation: pulse 2s ease-in-out infinite;
}

.status-flat {
	background: var(--bg-tertiary);
	color: var(--text-tertiary);
}

.status-flat .status-indicator {
	background: var(--text-quaternary);
}

.signal-inline-stats {
	display: flex;
	gap: 1rem;
}

.inline-stat {
	font-size: 0.75rem;
	color: var(--text-tertiary);
	cursor: help;
}

.inline-stat .stat-num {
	font-family: var(--font-mono, monospace);
	font-weight: 600;
	color: var(--text-primary);
}

.signal-inline-last {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-left: auto;
}

.last-badge {
	padding: 0.1875rem 0.5rem;
	border-radius: 4px;
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.05em;
}

.badge-buy {
	background: rgba(16, 185, 129, 0.15);
	color: var(--gain);
}

.badge-sell {
	background: rgba(239, 68, 68, 0.15);
	color: var(--loss);
}

.last-date {
	font-size: 0.75rem;
	color: var(--text-quaternary);
}

.last-pnl {
	font-family: var(--font-mono, monospace);
	font-size: 0.75rem;
	font-weight: 600;
}

/* ==========================================================================
   KEY METRICS ROW - Compact Finance Style
   ========================================================================== */

.key-metrics-row {
	display: flex;
	gap: 1px;
	background: var(--border-primary);
	border: 1px solid var(--border-primary);
	border-radius: 10px;
	overflow: hidden;
}

.km-block {
	flex: 1;
	background: var(--bg-secondary);
	padding: 0.875rem 1rem;
	cursor: help;
	transition: background-color 150ms ease;
}

.km-block:hover {
	background: var(--bg-tertiary);
}

.km-block:first-child {
	flex: 1.5;
}

.km-header {
	margin-bottom: 0.5rem;
}

.km-label {
	font-size: 0.625rem;
	font-weight: 500;
	color: var(--text-quaternary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.km-content {
	display: flex;
	align-items: center;
}

/* Performance Compare */
.km-perf-compare {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.km-perf-item {
	display: flex;
	flex-direction: column;
}

.km-perf-value {
	font-family: var(--font-mono, monospace);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
}

.km-perf-bh {
	color: var(--text-tertiary);
}

.km-perf-label {
	font-size: 0.5625rem;
	color: var(--text-quaternary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.km-perf-vs {
	font-size: 0.625rem;
	color: var(--text-quaternary);
	margin: 0 0.25rem;
}

/* Hero Value */
.km-value-hero {
	font-family: var(--font-mono, monospace);
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--text-primary);
}

/* Mini Gauge */
.km-gauge-mini {
	display: flex;
	align-items: baseline;
}

.km-gauge-value {
	font-family: var(--font-mono, monospace);
	font-size: 1.25rem;
	font-weight: 800;
}

.km-gauge-max {
	font-size: 0.75rem;
	color: var(--text-quaternary);
	margin-left: 2px;
}

@media (max-width: 900px) {
	.key-metrics-row {
		flex-wrap: wrap;
	}
	
	.km-block {
		flex: 1 1 30%;
	}
	
	.km-block:first-child {
		flex: 1 1 100%;
	}
}

/* ==========================================================================
   METRICS TOOLTIP PORTAL
   ========================================================================== */

.metrics-tooltip-portal {
	position: fixed;
	z-index: 99999;
	width: 260px;
	padding: 0.875rem 1rem;
	background: var(--bg-secondary);
	border: 1px solid var(--border-secondary);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
	pointer-events: none;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 150ms ease, transform 150ms ease;
}

.metrics-tooltip-portal.visible {
	opacity: 1;
	transform: translateY(0);
}

.metrics-tooltip-title {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 0.375rem;
}

.metrics-tooltip-desc {
	font-size: 0.75rem;
	line-height: 1.5;
	color: var(--text-secondary);
}

/* Metric Card Info Icon */
.metric-card-info {
	margin-left: auto;
	color: var(--text-quaternary);
	cursor: help;
	transition: color 150ms ease;
}

.metric-card-info:hover {
	color: var(--accent-primary);
}

.metric-card-info svg {
	width: 1rem;
	height: 1rem;
}

/* Hoverable metrics */
[data-tooltip] {
	cursor: help;
}

[data-tooltip]:hover {
	opacity: 0.9;
}

/* Light mode */
[data-theme="light"] .metrics-tooltip-portal {
	background: white;
	border-color: var(--border-primary);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   METRICS CARDS - Premium Performance/Risk/Rating
   ========================================================================== */

/* Metrics grid - deprecated, using key-metrics-row instead */

.metric-card {
	background: var(--bg-secondary);
	border: 1px solid var(--border-primary);
	border-radius: 12px;
	overflow: hidden;
	transition: border-color 200ms ease, box-shadow 200ms ease;
}

.metric-card:hover {
	border-color: var(--border-secondary);
}

.metric-card-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--border-primary);
	background: var(--bg-tertiary);
}

.metric-card-icon {
	width: 2rem;
	height: 2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
}

.metric-card-icon svg {
	width: 1.125rem;
	height: 1.125rem;
}

.metric-card-icon-gain {
	background: rgba(16, 185, 129, 0.15);
	color: var(--gain);
}

.metric-card-icon-warning {
	background: rgba(245, 158, 11, 0.15);
	color: var(--warning);
}

.metric-card-icon-accent {
	background: rgba(59, 130, 246, 0.15);
	color: var(--accent-primary);
}

.metric-card-title {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--text-primary);
}

.metric-card-body {
	padding: 1.25rem;
}

/* Performance Card - Compare */
.metric-compare {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.metric-compare-item {
	flex: 1;
	text-align: center;
	padding: 0.75rem;
	border-radius: 8px;
	background: var(--bg-tertiary);
}

.metric-compare-ai {
	border: 1px solid rgba(16, 185, 129, 0.3);
}

.metric-compare-bh {
	border: 1px solid var(--border-secondary);
}

.metric-compare-label {
	display: block;
	font-size: 0.6875rem;
	color: var(--text-quaternary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 0.25rem;
}

.metric-compare-value {
	display: block;
	font-family: var(--font-mono, monospace);
	font-size: 1.125rem;
	font-weight: 700;
}

.metric-compare-vs {
	font-size: 0.75rem;
	color: var(--text-quaternary);
	font-weight: 500;
}

.metric-alpha {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.625rem 0.75rem;
	background: var(--bg-tertiary);
	border-radius: 6px;
	border-left: 3px solid var(--gain);
}

.metric-alpha-label {
	font-size: 0.75rem;
	color: var(--text-tertiary);
	font-weight: 500;
}

.metric-alpha-value {
	font-family: var(--font-mono, monospace);
	font-size: 0.9375rem;
	font-weight: 700;
}

/* Risk Card */
.risk-metrics {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.risk-metric {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.risk-metric-label {
	font-size: 0.75rem;
	color: var(--text-tertiary);
	font-weight: 500;
}

.risk-metric-values {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.risk-metric-ai {
	font-family: var(--font-mono, monospace);
	font-size: 1rem;
	font-weight: 700;
	color: var(--gain);
	background: rgba(16, 185, 129, 0.1);
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
}

.risk-metric-bh {
	font-family: var(--font-mono, monospace);
	font-size: 0.875rem;
	color: var(--text-tertiary);
}

.risk-metric-vs {
	font-size: 0.625rem;
	color: var(--text-quaternary);
	text-transform: uppercase;
}

/* Rating Card */
.rating-hero {
	text-align: center;
	margin-bottom: 1.25rem;
}

.rating-hero-score {
	display: inline-flex;
	align-items: baseline;
	gap: 0.125rem;
	padding: 0.5rem 1rem;
	border-radius: 8px;
	background: var(--bg-tertiary);
}

.rating-hero-score.rating-badge-high {
	background: rgba(16, 185, 129, 0.15);
	box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.rating-hero-score.rating-badge-mid {
	background: rgba(245, 158, 11, 0.15);
}

.rating-hero-score.rating-badge-low {
	background: rgba(239, 68, 68, 0.15);
}

.rating-hero-value {
	font-family: var(--font-mono, monospace);
	font-size: 2rem;
	font-weight: 700;
	color: inherit;
}

.rating-hero-max {
	font-size: 1rem;
	color: var(--text-quaternary);
}

.rating-hero-label {
	font-size: 0.75rem;
	color: var(--text-quaternary);
	margin-top: 0.375rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* SRRI Gauge */
.srri-gauge {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem;
	background: var(--bg-tertiary);
	border-radius: 8px;
}

.srri-gauge-label {
	font-size: 0.6875rem;
	color: var(--text-quaternary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	white-space: nowrap;
}

.srri-gauge-bar {
	flex: 1;
	height: 8px;
	background: var(--bg-primary);
	border-radius: 4px;
	position: relative;
	overflow: hidden;
}

.srri-gauge-fill {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	border-radius: 4px;
	transition: width 500ms ease;
}

.srri-gauge-fill.srri-low {
	background: linear-gradient(90deg, var(--gain), #34d399);
}

.srri-gauge-fill.srri-mid {
	background: linear-gradient(90deg, var(--warning), #fbbf24);
}

.srri-gauge-fill.srri-high {
	background: linear-gradient(90deg, var(--loss), #f87171);
}

.srri-gauge-markers {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	justify-content: space-between;
	padding: 0 2px;
}

.srri-marker {
	width: 2px;
	height: 100%;
	background: var(--bg-secondary);
	opacity: 0.5;
}

.srri-marker-active {
	opacity: 0;
}

.srri-gauge-value {
	font-family: var(--font-mono, monospace);
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--text-secondary);
	min-width: 2.5rem;
	text-align: right;
}

/* ==========================================================================
   TRADE HISTORY - Premium Table with Pagination
   ========================================================================== */

/* General Info Sections (used in asset-report partial) */
.general-info-section {
	margin-bottom: 2rem;
}

.general-info-section:last-child {
	margin-bottom: 0;
}

.general-info-section-title {
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid var(--border-primary);
}

/* Holdings Premium Section - Bloomberg-grade */
.holdings-premium-container {
	padding: 0;
}

/* Holdings Tabs */
.holdings-tabs {
	display: flex;
	gap: 0.5rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--border-primary);
	background: var(--bg-tertiary);
}

.holdings-tab {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	padding: 0.625rem 1rem;
	background: transparent;
	border: 1px solid var(--border-primary);
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
	font-size: 0.875rem;
	color: var(--text-secondary);
}

.holdings-tab:hover {
	background: var(--bg-hover);
	border-color: var(--accent-primary);
}

.holdings-tab-active {
	background: var(--accent-primary);
	border-color: var(--accent-primary);
	color: #ffffff;
	box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.holdings-tab-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.1875rem 0.5rem;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	border-radius: 3px;
}

.holdings-badge-in {
	background: rgba(16, 185, 129, 0.2);
	color: rgb(16, 185, 129);
	border: 1px solid rgba(16, 185, 129, 0.4);
}

.holdings-tab-active .holdings-badge-in {
	background: rgba(255, 255, 255, 0.25);
	color: #ffffff;
	border-color: rgba(255, 255, 255, 0.3);
}

.holdings-badge-out {
	background: rgba(239, 68, 68, 0.2);
	color: rgb(239, 68, 68);
	border: 1px solid rgba(239, 68, 68, 0.4);
}

.holdings-tab-active .holdings-badge-out {
	background: rgba(255, 255, 255, 0.25);
	color: #ffffff;
	border-color: rgba(255, 255, 255, 0.3);
}

.holdings-tab-label {
	font-weight: 600;
}

.holdings-tab-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.5rem;
	padding: 0.125rem 0.375rem;
	background: var(--bg-secondary);
	border-radius: 3px;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--text-tertiary);
}

.holdings-tab-active .holdings-tab-count {
	background: rgba(255, 255, 255, 0.2);
	color: #ffffff;
}

/* Holdings Content */
.holdings-content {
	padding: 1.5rem;
}

/* Holdings Table Premium */
.holdings-table-wrapper {
	overflow-x: auto;
	border-radius: 8px;
	border: 1px solid var(--border-primary);
	background: var(--bg-secondary);
}

.holdings-table-premium {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
	font-variant-numeric: tabular-nums;
}

.holdings-table-premium thead {
	background: var(--bg-tertiary);
}

.holdings-table-premium th {
	padding: 0.875rem 1rem;
	text-align: left;
	font-weight: 600;
	font-size: 0.75rem;
	color: var(--text-tertiary);
	text-transform: uppercase;
	letter-spacing: 0.075em;
	border-bottom: 2px solid var(--border-primary);
}

.holdings-table-premium th.text-right {
	text-align: right;
}

.holdings-row-premium {
	border-bottom: 1px solid var(--border-primary);
	transition: all 0.15s ease;
}

.holdings-row-premium:last-child {
	border-bottom: none;
}

.holdings-row-premium:hover {
	background: var(--bg-hover);
	box-shadow: inset 0 0 0 1px var(--accent-primary);
}

.holdings-row-premium td {
	padding: 1rem;
	color: var(--text-primary);
}

.holdings-row-premium td.text-right {
	text-align: right;
}

/* Holdings Cell Types */
.holdings-asset-name {
	font-weight: 600;
	color: var(--text-primary);
	font-size: 0.9375rem;
}

.holdings-category {
	color: var(--text-tertiary);
	font-size: 0.8125rem;
}

.holdings-weight {
	font-weight: 600;
	color: var(--accent-primary);
}

.holdings-price,
.holdings-entry,
.holdings-stop {
	font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
	font-size: 0.875rem;
}

.holdings-pnl {
	font-weight: 700;
	font-size: 0.9375rem;
}

.holdings-pnl .text-gain {
	color: rgb(16, 185, 129);
}

.holdings-pnl .text-loss {
	color: rgb(239, 68, 68);
}

.holdings-var .text-gain {
	color: rgb(16, 185, 129);
	font-weight: 600;
}

.holdings-var .text-loss {
	color: rgb(239, 68, 68);
	font-weight: 600;
}

/* Clock Badge Mini */
.clock-badge-mini {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	padding: 0.25rem 0.5rem;
	background: var(--accent-primary);
	color: #ffffff;
	border-radius: 4px;
	font-size: 0.75rem;
	font-weight: 700;
	box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

/* Holdings Pagination */
.holdings-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 1.25rem;
	border-top: 1px solid var(--border-primary);
	background: var(--bg-tertiary);
}

.holdings-pagination-btn {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	background: var(--bg-secondary);
	border: 1px solid var(--border-primary);
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--text-primary);
}

.holdings-pagination-btn:hover:not(:disabled) {
	background: var(--accent-primary);
	border-color: var(--accent-primary);
	color: #ffffff;
	box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.holdings-pagination-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.holdings-pagination-info {
	font-size: 0.875rem;
	color: var(--text-secondary);
	font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
	.holdings-tabs {
		flex-wrap: wrap;
	}
	
	.holdings-table-premium {
		font-size: 0.8125rem;
	}
	
	.holdings-row-premium td {
		padding: 0.75rem 0.625rem;
	}
	
	.holdings-pagination {
		flex-direction: column;
		gap: 0.75rem;
	}
	
	.holdings-pagination-btn {
		width: 100%;
		justify-content: center;
	}
}

/* Trade History */
.trade-history-container {
	background: var(--bg-secondary);
	border: 1px solid var(--border-primary);
	border-radius: 12px;
	overflow: hidden;
}

.trade-history-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--border-primary);
	background: var(--bg-tertiary);
}

.trade-history-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--text-primary);
}

.trade-history-title svg {
	color: var(--accent-primary);
}

.trade-history-stats {
	display: flex;
	gap: 1rem;
}

.trade-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.125rem;
}

.trade-stat-value {
	font-family: var(--font-mono, monospace);
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--text-primary);
}

.trade-stat-label {
	font-size: 0.625rem;
	color: var(--text-quaternary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.trade-stat-total .trade-stat-value {
	color: var(--accent-primary);
}

.trade-history-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 3rem;
}

.trade-history-table-wrapper {
	overflow-x: auto;
}

.trade-history-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed; /* Bloomberg standard: colonne fisse */
}

/* Larghezze colonne (Bloomberg-grade alignment) */
.trade-history-table th:nth-child(1), 
.trade-history-table td:nth-child(1) { 
	width: 15%; /* DATE */
}

.trade-history-table th:nth-child(2), 
.trade-history-table td:nth-child(2) { 
	width: 15%; /* SIGNAL */
}

.trade-history-table th:nth-child(3), 
.trade-history-table td:nth-child(3) { 
	width: 25%; /* PRICE */
}

.trade-history-table th:nth-child(4), 
.trade-history-table td:nth-child(4) { 
	width: 25%; /* RETURN */
}

.trade-history-table th:nth-child(5), 
.trade-history-table td:nth-child(5) { 
	width: 20%; /* HOLD */
}

.trade-history-table th {
	padding: 0.75rem 1rem;
	font-size: 0.6875rem;
	font-weight: 600;
	color: var(--text-quaternary);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	text-align: left;
	border-bottom: 1px solid var(--border-primary);
	background: var(--bg-secondary);
}

/* Headers numerici right-aligned (Bloomberg standard) */
.trade-history-table th.text-right {
	text-align: right;
}

.trade-history-table td {
	padding: 0.875rem 1rem;
	border-bottom: 1px solid var(--border-secondary);
}

/* Celle numeriche right-aligned (forza allineamento) */
.trade-history-table td.text-right {
	text-align: right !important;
}

.trade-history-table tr:last-child td {
	border-bottom: none;
}

.trade-history-table tr:hover {
	background: var(--bg-hover);
}

.trade-row-highlight {
	background: rgba(59, 130, 246, 0.05);
}

.trade-row-highlight:hover {
	background: rgba(59, 130, 246, 0.08);
}

.trade-date {
	font-family: var(--font-mono, monospace);
	font-size: 0.8125rem;
	color: var(--text-tertiary);
}

.trade-signal {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.25rem 0.625rem;
	border-radius: 4px;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.05em;
}

.trade-signal-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
}

.trade-signal-buy {
	background: rgba(16, 185, 129, 0.12);
	color: var(--gain);
}

.trade-signal-buy .trade-signal-dot {
	background: var(--gain);
	box-shadow: 0 0 6px var(--gain);
}

.trade-signal-sell {
	background: rgba(239, 68, 68, 0.12);
	color: var(--loss);
}

.trade-signal-sell .trade-signal-dot {
	background: var(--loss);
	box-shadow: 0 0 6px var(--loss);
}

/* "NEXT" badge for upcoming signals (e.g., "Buy @ Next") - Bloomberg-grade */
.trade-signal-badge {
	display: inline-block;
	margin-left: 0.375rem;
	padding: 0.125rem 0.375rem;
	background: rgba(59, 130, 246, 0.15);
	color: var(--accent-primary, #3b82f6);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border-radius: 3px;
	border: 1px solid rgba(59, 130, 246, 0.3);
	opacity: 0.9;
}

/* Light mode */
.light-mode .trade-signal-badge {
	background: rgba(59, 130, 246, 0.1);
	border-color: rgba(59, 130, 246, 0.25);
}

.trade-price {
	font-family: var(--font-mono, monospace);
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--text-primary);
	text-align: right;
}

.trade-pnl {
	font-family: var(--font-mono, monospace);
	font-size: 0.875rem;
	font-weight: 600;
	text-align: right;
	color: var(--text-quaternary);
}

.trade-pnl-positive {
	color: var(--gain);
}

.trade-pnl-negative {
	color: var(--loss);
}

.trade-days {
	font-family: var(--font-mono, monospace);
	font-size: 0.8125rem;
	color: var(--text-tertiary);
	text-align: right;
}

/* ==========================================================================
   PAGINATION - Bloomberg Professional Style
   ========================================================================== */

.trade-history-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 1.25rem 1rem;
	border-top: 1px solid rgba(148, 163, 184, 0.15);
	background: transparent;
}

/* Pagination Buttons - Atomic Design */
.trade-history-pagination .pagination-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	min-width: 2rem;
	padding: 0;
	border-radius: 6px;
	cursor: pointer;
	transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
}

/* Dark Mode - Button Base */
html.dark .trade-history-pagination .pagination-btn {
	background: rgba(51, 65, 85, 0.4);
	border: 1px solid rgba(71, 85, 105, 0.6);
}

html.dark .trade-history-pagination .pagination-btn:hover:not(:disabled) {
	background: rgba(71, 85, 105, 0.8);
	border-color: rgba(59, 130, 246, 0.8);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

html.dark .trade-history-pagination .pagination-btn:active:not(:disabled) {
	transform: translateY(0);
}

html.dark .trade-history-pagination .pagination-btn:disabled {
	opacity: 0.25;
	cursor: not-allowed;
	background: rgba(51, 65, 85, 0.2);
}

/* Light Mode - Button Base */
html:not(.dark) .trade-history-pagination .pagination-btn {
	background: #ffffff;
	border: 1px solid #cbd5e1;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

html:not(.dark) .trade-history-pagination .pagination-btn:hover:not(:disabled) {
	background: #f8fafc;
	border-color: #3b82f6;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

html:not(.dark) .trade-history-pagination .pagination-btn:active:not(:disabled) {
	transform: translateY(0);
}

html:not(.dark) .trade-history-pagination .pagination-btn:disabled {
	opacity: 0.25;
	cursor: not-allowed;
	background: #f9fafb;
	border-color: #e2e8f0;
}

/* SVG Arrows - Bloomberg Elegant */
.trade-history-pagination .pagination-btn svg {
	width: 1rem;
	height: 1rem;
	display: block;
	margin: auto;
	pointer-events: none;
	transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.trade-history-pagination .pagination-btn svg path {
	fill: none;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: stroke 200ms ease;
}

/* Dark Mode - Arrows */
html.dark .trade-history-pagination .pagination-btn svg path {
	stroke: #cbd5e1; /* Gray-300 */
}

html.dark .trade-history-pagination .pagination-btn:hover:not(:disabled) svg {
	transform: scale(1.1);
}

html.dark .trade-history-pagination .pagination-btn:hover:not(:disabled) svg path {
	stroke: #60a5fa; /* Blue-400 */
}

html.dark .trade-history-pagination .pagination-btn:disabled svg path {
	stroke: #475569; /* Slate-600 */
}

/* Light Mode - Arrows */
html:not(.dark) .trade-history-pagination .pagination-btn svg path {
	stroke: #334155; /* Slate-700 */
}

html:not(.dark) .trade-history-pagination .pagination-btn:hover:not(:disabled) svg {
	transform: scale(1.1);
}

html:not(.dark) .trade-history-pagination .pagination-btn:hover:not(:disabled) svg path {
	stroke: #2563eb; /* Blue-600 */
}

html:not(.dark) .trade-history-pagination .pagination-btn:disabled svg path {
	stroke: #94a3b8; /* Slate-400 */
}

/* Pagination Numbers - Atomic */
.pagination-numbers {
	display: flex;
	gap: 0.25rem;
	align-items: center;
}

.pagination-num {
	min-width: 2rem;
	height: 2rem;
	padding: 0 0.5rem;
	border-radius: 6px;
	background: transparent;
	border: 1px solid transparent;
	font-family: 'JetBrains Mono', monospace;
	font-size: 0.8125rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode - Numbers */
html.dark .pagination-num {
	color: #94a3b8; /* Slate-400 */
}

html.dark .pagination-num:hover:not(:disabled):not(.pagination-num-active) {
	background: rgba(71, 85, 105, 0.4);
	color: #cbd5e1;
}

html.dark .pagination-num-active {
	background: rgba(59, 130, 246, 0.2);
	border-color: rgba(59, 130, 246, 0.5);
	color: #60a5fa;
	font-weight: 600;
}

html.dark .pagination-ellipsis {
	cursor: default;
	color: #64748b;
}

/* Light Mode - Numbers */
html:not(.dark) .pagination-num {
	color: #64748b; /* Slate-500 */
}

html:not(.dark) .pagination-num:hover:not(:disabled):not(.pagination-num-active) {
	background: #f1f5f9;
	color: #334155;
}

html:not(.dark) .pagination-num-active {
	background: rgba(59, 130, 246, 0.1);
	border-color: rgba(59, 130, 246, 0.3);
	color: #2563eb;
	font-weight: 600;
}

html:not(.dark) .pagination-ellipsis {
	cursor: default;
	color: #94a3b8;
}

/* Pagination Info - Bloomberg Mono */
.pagination-info {
	margin-left: 1rem;
	font-family: 'JetBrains Mono', monospace;
	font-size: 0.6875rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.025em;
}

html.dark .pagination-info {
	color: #64748b;
}

html:not(.dark) .pagination-info {
	color: #94a3b8;
}

.trade-history-empty {
	text-align: center;
	padding: 3rem;
	color: var(--text-quaternary);
}

.trade-history-empty svg {
	width: 3rem;
	height: 3rem;
	margin: 0 auto 1rem;
	opacity: 0.3;
}

.trade-history-empty p {
	font-size: 0.875rem;
}

/* ==========================================================================
   METRIC ROWS - Compact Performance/Risk/Rating
   ========================================================================== */

.metric-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--border-secondary);
}

.metric-row:last-child {
	border-bottom: none;
}

.metric-row-label {
	font-size: 0.8125rem;
	color: var(--text-tertiary);
}

.metric-row-value {
	font-size: 0.875rem;
	font-weight: 600;
	font-family: var(--font-mono, 'JetBrains Mono', monospace);
	color: var(--text-primary);
}

/* Rating Badges */
.rating-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 3rem;
	padding: 0.25rem 0.5rem;
	font-size: 0.75rem;
	font-weight: 700;
	border-radius: 6px;
	background: var(--bg-tertiary);
	color: var(--text-secondary);
}

.rating-badge-high {
	background: rgba(16, 185, 129, 0.2);
	color: var(--gain);
	box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.rating-badge-mid {
	background: rgba(245, 158, 11, 0.2);
	color: var(--warning);
}

.rating-badge-low {
	background: rgba(239, 68, 68, 0.15);
	color: var(--loss);
}

.rating-badge-neutral {
	background: var(--bg-tertiary);
	color: var(--text-tertiary);
}

/* SRRI Badges */
.srri-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 3rem;
	padding: 0.25rem 0.5rem;
	font-size: 0.75rem;
	font-weight: 700;
	border-radius: 6px;
}

.srri-low {
	background: rgba(16, 185, 129, 0.2);
	color: var(--gain);
}

.srri-mid {
	background: rgba(245, 158, 11, 0.2);
	color: var(--warning);
}

.srri-high {
	background: rgba(239, 68, 68, 0.2);
	color: var(--loss);
	box-shadow: 0 0 6px rgba(239, 68, 68, 0.15);
}

/* ==========================================================================
   LIGHT MODE ADJUSTMENTS
   ========================================================================== */

[data-theme="light"] .trade-badge-buy {
	background: rgba(16, 185, 129, 0.1);
}

[data-theme="light"] .trade-badge-sell {
	background: rgba(239, 68, 68, 0.1);
}

[data-theme="light"] .rating-badge {
	background: var(--bg-tertiary);
}

[data-theme="light"] .rating-badge-high {
	background: rgba(16, 185, 129, 0.12);
}

[data-theme="light"] .rating-badge-mid {
	background: rgba(245, 158, 11, 0.12);
}

[data-theme="light"] .rating-badge-low {
	background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   GLOBAL LIGHT MODE OVERRIDES - Body, Header, Trade History
   ========================================================================== */

/* Body background - Light mode (when .dark class is ABSENT) */
html:not(.dark) body {
	background-color: #f8fafc !important; /* Slate-50 */
}

/* Header background - Light mode */
html:not(.dark) header {
	background-color: #ffffff !important; /* White */
	border-bottom: 1px solid #e5e7eb; /* Light gray border */
}

/* Navigation links - Light mode (higher contrast) */
html:not(.dark) header nav a {
	color: #4b5563 !important; /* Gray-600 */
}

html:not(.dark) header nav a:hover {
	color: #111827 !important; /* Gray-900 */
}

html:not(.dark) header nav a.active {
	color: #3b82f6 !important; /* Blue-500 */
	font-weight: 600;
}

/* Logo text - Light mode */
html:not(.dark) .site-brand {
	color: #1e40af !important; /* Blue-800 */
}

/* ============================================
   ADAPTIVE LOGO SYSTEM (Dark/Light Mode)
   ============================================ */

/* Default: Show all logos (fallback for single logo) */
.site-logo {
	display: block;
}

/* When themed logos exist, hide based on mode */
.site-logo-dark {
	display: block;
	margin-top: -19px;
}

.site-logo-light {
	display: none;
	margin-top: -14px;
}

/* Light mode: swap visibility */
:root:not(.dark) .site-logo-dark {
	display: none;
}

:root:not(.dark) .site-logo-light {
	display: block;
}

/* Smooth transition for logo swap */
.site-logo {
	transition: opacity 200ms ease;
}

/* Trade History - Stats Header (BUYS, SELLS, TOTAL) - Light mode */
html:not(.dark) .trade-history-stats {
	background: transparent;
}

html:not(.dark) .trade-stat-value {
	color: #111827 !important; /* Gray-900, high contrast */
}

html:not(.dark) .trade-stat-label {
	color: #6b7280 !important; /* Gray-500 */
}

html:not(.dark) .trade-stat-total .trade-stat-value {
	color: #3b82f6 !important; /* Blue-500, mantiene brand */
}

/* OLD: Removed duplicate styles (now handled above with .trade-history-pagination specificity) */

/* ==========================================================================
   Comparison Chart Legend - Compact Premium Style
   ========================================================================== */

.comparison-legend-compact {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.legend-item-compact {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--text-secondary);
}

.legend-item-compact .legend-icon {
	flex-shrink: 0;
	display: block;
}

.legend-item-compact .legend-label {
	font-family: var(--font-mono, monospace);
	letter-spacing: 0.02em;
}

/* AI Legend - Green */
.legend-item-compact.legend-ai .legend-label {
	color: #10b981;
}

/* B&H Legend - Gray */
.legend-item-compact.legend-bh .legend-label {
	color: #6b7280;
}

/* Hover effect (subtle) */
.legend-item-compact:hover .legend-label {
	opacity: 0.8;
}

