/* Market Overview — minimal styles that inherit the theme's fonts and colors. */
.mktov {
	--mktov-up: #0a8a3e;
	--mktov-down: #c8102e;
	--mktov-muted: rgba(127, 127, 127, 0.85);
	--mktov-line: rgba(127, 127, 127, 0.22);
	--mktov-gap: 1.5rem;

	display: grid;
	gap: var(--mktov-gap);
	font-variant-numeric: tabular-nums;
	font-size: 0.9rem;
	line-height: 1.35;
}

/* Wide containers: three sections side by side. Narrow ones stack automatically. */
.mktov--auto {
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.mktov__title {
	margin: 0 0 0.4rem;
	font-size: 1.05rem;
}

.mktov__head,
.mktov__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 5.4rem 4.4rem 4.4rem;
	gap: 0.5rem;
	align-items: baseline;
	padding: 0.35rem 0;
	border-bottom: 1px solid var(--mktov-line);
}

.mktov__head {
	color: var(--mktov-muted);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.mktov__head span:nth-child(n + 2),
.mktov__price,
.mktov__chg,
.mktov__pct {
	text-align: right;
}

.mktov__sym {
	font-weight: 600;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.mktov__sym:hover { text-decoration: underline; }

.mktov__row--up .mktov__chg,
.mktov__row--up .mktov__pct { color: var(--mktov-up); }
.mktov__row--down .mktov__chg,
.mktov__row--down .mktov__pct { color: var(--mktov-down); }

.mktov__msg {
	padding: 0.6rem 0;
	color: var(--mktov-muted);
}

.mktov__foot {
	grid-column: 1 / -1;
	margin: 0;
	font-size: 0.75rem;
	color: var(--mktov-muted);
}

/* Narrow spaces (sidebars, phones): tighten the number columns. */
.mktov__section { container-type: inline-size; }

@container (max-width: 340px) {
	.mktov__head, .mktov__row { grid-template-columns: minmax(0, 1fr) 5rem 4rem 4rem; }
}
@media (max-width: 420px) {
	.mktov__head, .mktov__row { grid-template-columns: minmax(0, 1fr) 5rem 4rem 4rem; }
}

/* Horizontal scrolling per section */
.mktov__section {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain; /* stops a sideways swipe from scrolling the page */
}

/* Rows need a minimum width; otherwise they shrink to fit and never overflow. */
.mktov__head,
.mktov__row {
	min-width: 22rem; /* raise this to give the Name column more room before scrolling kicks in */
}

/* Keep the section heading in place while the rows scroll. */
.mktov__title {
	position: sticky;
	left: 0;
}
