/*
 * <markets-cmc>: the CoinMarketCap-style markets list (Woochain > Design > Markets page).
 * Every color, font and size comes from the active skin's --ys-* variables; the fallbacks make it look right
 * under the Classic skin too.
 */
.ys-cmc {
	--c-primary: var(--ys-primary, #3861fb);
	--c-text: var(--ys-text, #0d1421);
	--c-muted: var(--ys-muted, #58667e);
	--c-border: var(--ys-border, #eff2f5);
	--c-surface: var(--ys-surface, #ffffff);
	--c-alt: var(--ys-surface-alt, #f1f4f9);
	--c-hover: var(--ys-row-hover, #f8fafd);
	--c-up: var(--ys-success, #16c784);
	--c-down: var(--ys-danger, #ea3943);
	--c-warn: var(--ys-warning, #f5a623);
	--c-radius: var(--ys-radius, 12px);
	--c-shadow: var(--ys-shadow, 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.06));
	--c-cell-y: var(--ys-cell-y, 14px);
	--c-cell-x: var(--ys-cell-x, 14px);
	color: var(--c-text);
	font-family: var(--ys-font-body, inherit);
	font-size: var(--ys-font-size, 14px);
	width: 100%;
	container-type: inline-size;
	container-name: yscmc;
}
.ys-cmc * { box-sizing: border-box; }
.ys-cmc a { color: inherit; text-decoration: none; }
.ys-cmc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 18px; }
.ys-cmc-title { font-family: var(--ys-font-heading, inherit); font-size: 1.6em; font-weight: 700; margin: 0 0 4px; color: var(--c-text); letter-spacing: -.01em; }
.ys-cmc-sub { margin: 0; color: var(--c-muted); }
.ys-cmc-sub strong { color: var(--c-text); }
.ys-cmc-search { position: relative; min-width: 240px; }
.ys-cmc-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--c-muted); font-size: .9em; }
.ys-cmc-search input { width: 100%; height: 40px; padding: 0 14px 0 34px; border: 1px solid var(--c-border); border-radius: 999px; background: var(--c-alt); color: var(--c-text); outline: none; }
.ys-cmc-search input:focus { border-color: var(--c-primary); background: var(--c-surface); }

.ys-cmc-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 20px; }
.ys-cmc-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--c-radius); box-shadow: var(--c-shadow); padding: 14px 16px; }
.ys-cmc-card-title { font-weight: 700; margin: 0 0 8px; }
.ys-cmc-card-title i { color: var(--c-primary); margin-right: 4px; }
.ys-cmc-card-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.ys-cmc-card-rank { color: var(--c-muted); width: 14px; font-size: .9em; }
.ys-cmc-card-name { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ys-cmc-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.ys-cmc-chips, .ys-cmc-bases, .ys-pager { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ys-chip { border: 1px solid transparent; background: var(--c-alt); color: var(--c-text); border-radius: 8px; padding: 6px 12px; font-weight: 600; font-size: .92em; cursor: pointer; line-height: 1.2; }
.ys-chip:hover { border-color: var(--c-border); }
.ys-chip.active { background: var(--c-primary); color: var(--ys-primary-contrast, #fff); }
.ys-chip:disabled { opacity: .4; cursor: default; }
.ys-chip-count { opacity: .65; font-weight: 500; margin-left: 2px; }
.ys-chip-base { font-size: .82em; padding: 4px 10px; }

.ys-cmc-table-wrap { width: 100%; overflow-x: auto; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--c-radius); box-shadow: var(--c-shadow); }
.ys-cmc-table { width: 100%; border-collapse: collapse; margin: 0; }
.ys-cmc-table th { position: sticky; top: 0; background: var(--c-surface); color: var(--c-text); font-size: .82em; font-weight: 700; text-align: left; padding: 12px var(--c-cell-x); border-bottom: 1px solid var(--c-border); white-space: nowrap; }
.ys-cmc-table td { padding: var(--c-cell-y) var(--c-cell-x); border-bottom: 1px solid var(--c-border); vertical-align: middle; white-space: nowrap; }
.ys-cmc-table tbody tr:hover { background: var(--c-hover); }
.ys-cmc-table tbody tr:last-child td { border-bottom: 0; }
.ys-cmc-table .ys-num { text-align: right; font-variant-numeric: tabular-nums; }
.ys-sortable { cursor: pointer; user-select: none; }
.ys-sort-idle { opacity: .25; }
.ys-col-star { width: 32px; padding-right: 0 !important; }
.ys-col-rank { width: 44px; color: var(--c-muted); }
.ys-col-actions { text-align: right; }
.ys-strong { font-weight: 700; }
.ys-star { background: none; border: 0; padding: 0; color: var(--c-muted); cursor: pointer; }
.ys-star.on { color: var(--c-warn); }

.ys-token { display: inline-flex; align-items: center; gap: 10px; max-width: 320px; min-width: 0; }
.ys-col-name { max-width: 320px; overflow: hidden; }
.ys-btn-icon { padding: 5px 9px; }
.ys-token-img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: 0 0 26px; background: var(--c-alt); vertical-align: middle; }
.ys-cmc-card .ys-token-img { width: 22px; height: 22px; flex-basis: 22px; }
.ys-token-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.ys-token-symbol { color: var(--c-muted); font-weight: 500; font-size: .9em; }
.ys-verified { color: var(--c-primary); font-size: .85em; }
.ys-badge { background: var(--c-alt); color: var(--c-muted); border-radius: 6px; padding: 1px 6px; font-size: .75em; font-weight: 600; }
.ys-row-unpublished { opacity: .6; }

.ys-up { color: var(--c-up); font-weight: 600; }
.ys-down { color: var(--c-down); font-weight: 600; }
.ys-flat { color: var(--c-muted); }
.ys-cmc-muted { color: var(--c-muted); font-size: .9em; }
.ys-cmc-empty { color: var(--c-muted); text-align: center; padding: 18px; font-size: .9em; }

.ys-spark { width: 120px; height: 36px; display: inline-block; vertical-align: middle; }
.ys-spark-up { stroke: var(--c-up); }
.ys-spark-down { stroke: var(--c-down); }
.ys-spark-flat { stroke: var(--c-border); }

.ys-btn { display: inline-block; border-radius: 8px; padding: 5px 12px; font-size: .85em; font-weight: 600; line-height: 1.4; border: 1px solid transparent; margin-left: 4px; cursor: pointer; }
/* Scoped and !important: theme link styles (background: none) would otherwise win on the <a> buttons. */
.ys-cmc .ys-btn-buy { background: var(--c-up) !important; color: var(--ys-on-color, #fff) !important; }
.ys-cmc .ys-btn-sell { background: var(--c-down) !important; color: var(--ys-on-color, #fff) !important; }
.ys-cmc .ys-btn-ghost { background: var(--c-alt) !important; color: var(--c-text) !important; }
.ys-cmc .ys-btn-warn { background: var(--c-warn) !important; color: var(--ys-on-color, #fff) !important; }
.ys-btn:hover { filter: brightness(.95); }
.ys-btn:disabled { opacity: .5; }

.ys-cmc-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 0; }

/* Responsive to the list's own width (the theme decides how wide the content column is), not the window. */
@container yscmc (max-width: 1180px) {
	.ys-hide-md { display: none; }
	.ys-btn-trade { display: none; }
	.ys-token, .ys-col-name { max-width: 220px; }
	.ys-cmc-table td, .ys-cmc-table th { padding-left: 10px; padding-right: 10px; }
	.ys-spark { width: 84px; }
	.ys-col-rank { width: 36px; }
	.ys-btn { padding: 4px 9px; margin-left: 2px; }
	.ys-btn-icon { padding: 4px 7px; }
	.ys-token { gap: 8px; }
}
@container yscmc (max-width: 860px) {
	.ys-cmc-cards { grid-template-columns: 1fr; }
	.ys-spark { width: 84px; }
}
@container yscmc (max-width: 680px) {
	.ys-hide-sm { display: none; }
	.ys-cmc-search { min-width: 100%; }
	.ys-token-symbol { display: none; }
	.ys-cmc-table td, .ys-cmc-table th { padding-left: 8px; padding-right: 8px; }
}
/* Browsers without container queries: the same steps by window width. */
@supports not (container-type: inline-size) {
	@media (max-width: 1280px) { .ys-hide-md, .ys-btn-trade { display: none; } }
	@media (max-width: 991px) { .ys-cmc-cards { grid-template-columns: 1fr; } }
	@media (max-width: 640px) { .ys-hide-sm, .ys-token-symbol { display: none; } .ys-cmc-search { min-width: 100%; } }
}
/* The classic tables' optional image (Design > Token images: both layouts). */
.markets .ys-token-img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; margin-right: 6px; vertical-align: middle; }

/* Administrators: publish filter, selection column and bulk actions. */
.ys-cmc-admin { padding: 8px 10px; border: 1px dashed var(--c-border); border-radius: 10px; }
.ys-col-select { width: 32px; text-align: center; }
.ys-col-select input { cursor: pointer; }
.ys-chip:disabled { opacity: .5; cursor: default; }
