/* APX Global Markets — front-end styles */

.agm-widget {
	--agm-bg: #ffffff;
	--agm-border: #e3e6ea;
	--agm-text: #1c2430;
	--agm-muted: #6b7684;
	--agm-up: #0e8a4d;
	--agm-down: #cf3341;
	--agm-accent: #16324f;

	background: var(--agm-bg);
	border: 1px solid var(--agm-border);
	border-radius: 12px;
	color: var(--agm-text);
	margin: 0 0 24px;
	padding: 20px;
	box-shadow: 0 1px 3px rgba(20, 30, 45, 0.06);
	font-size: 15px;
	line-height: 1.5;
}

.agm-widget.agm-refreshing {
	opacity: 0.65;
	transition: opacity 0.2s ease;
}

.agm-title {
	font-size: 1.2em;
	font-weight: 700;
	margin: 0 0 14px;
	color: var(--agm-accent);
}

.agm-subtitle {
	font-size: 1em;
	font-weight: 600;
	margin: 0 0 10px;
}

/* Tables */
.agm-table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.agm-table {
	border-collapse: collapse;
	width: 100%;
	margin: 0;
}

.agm-table th,
.agm-table td {
	border: 0;
	border-bottom: 1px solid var(--agm-border);
	padding: 9px 10px;
	text-align: left;
	white-space: nowrap;
}

.agm-table thead th {
	color: var(--agm-muted);
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.agm-table tbody tr:last-child td {
	border-bottom: 0;
}

.agm-num {
	text-align: right !important;
	font-variant-numeric: tabular-nums;
}

.agm-name {
	font-weight: 600;
}

.agm-region {
	color: var(--agm-muted);
	font-size: 0.9em;
}

/* Change badge */
.agm-change {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.agm-change--up {
	color: var(--agm-up);
}

.agm-change--down {
	color: var(--agm-down);
}

/* Gainers / losers */
.agm-movers {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

@media (max-width: 640px) {
	.agm-movers {
		grid-template-columns: 1fr;
	}
}

.agm-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.agm-list__item {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid var(--agm-border);
}

.agm-list__item:last-child {
	border-bottom: 0;
}

.agm-list__id small {
	color: var(--agm-muted);
	display: block;
	font-size: 0.82em;
	max-width: 180px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.agm-list__price {
	text-align: right;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* Per-market movers section */
.agm-market {
	margin: 0 0 18px;
}

.agm-market:last-of-type {
	margin-bottom: 0;
}

.agm-market__label {
	background: #f3f5f8;
	border-radius: 8px;
	color: var(--agm-accent);
	font-size: 0.95em;
	font-weight: 700;
	margin: 0 0 12px;
	padding: 7px 12px;
}

/* Currencies */
.agm-fx {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.agm-fx--board {
	grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
	.agm-fx--board {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.agm-fx {
		grid-template-columns: 1fr;
	}
}

/* Meta */
.agm-updated,
.agm-note {
	color: var(--agm-muted);
	font-size: 0.8em;
	margin: 10px 0 0;
}

.agm-error {
	background: #fbf3f3;
	border: 1px solid #ead4d6;
	border-radius: 8px;
	color: #8a3038;
	margin: 0;
	padding: 10px 14px;
}

/* Dashboard layout */
.agm-dashboard {
	display: block;
}

/* TradingView embeds */
.agm-widget--tv {
	padding: 16px;
}

.agm-tv {
	border-radius: 8px;
	overflow: hidden;
}
