/* CE Market Dashboard 1.0 — scoped to .cemd, same visual language as the converter and mining calculator. */
.cemd {
	--ink: #1f2328; --ink-2: #575760; --ink-3: #6b7079; --line: #e3e6ea; --soft: #f6f7f9;
	--bar: #444; --green: #4c9150; --green-ink: #2f6e33; --red: #b3261e; --r: 6px;
	--z0: #b3261e; --z1: #e0786e; --z2: #9aa0a6; --z3: #6fae74; --z4: #2f6e33;
	--h-4: #a8261d; --h-3: #c9453b; --h-2: #e4877f; --h-1: #f3c9c4; --h0: #dfe2e6;
	--h1: #c9e4cb; --h2: #8fc494; --h3: #3f8a46; --h4: #2a6430;
	--d-btc: #444; --d-eth: #4c9150; --d-stb: #8fa3b8; --d-oth: #d5d9de;
	font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--ink); font-size: 15px; line-height: 1.45; margin: 8px 0 28px; text-align: left;
	font-variant-numeric: tabular-nums;
}
.cemd *, .cemd *::before, .cemd *::after { box-sizing: border-box; }
.cemd [hidden] { display: none !important; }
.cemd-label { display: block; font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 6px; }
.cemd [data-sign="pos"] { color: var(--green-ink); }
.cemd [data-sign="neg"] { color: var(--red); }
.cemd a { color: inherit; }
.cemd .cemd-h {
	font: 700 15px/1.25 Roboto, system-ui, sans-serif; text-transform: uppercase; letter-spacing: .03em;
	color: #fff; background: var(--bar); border-bottom: 3px solid var(--green); padding: 9px 14px; margin: 0 0 12px;
}
.cemd .cemd-h3 { font: 700 14px/1.3 Roboto, system-ui, sans-serif; text-transform: uppercase; letter-spacing: .03em; color: var(--ink); margin: 0 0 6px; padding-bottom: 6px; border-bottom: 2px solid var(--green); }
.cemd-sec { margin: 26px 0 0; }
.cemd-note, .cemd-foot { font-size: 12.5px; color: var(--ink-3); margin: 8px 0 0; }
.cemd-foot a { color: var(--green-ink); }
.cemd-empty { color: var(--ink-3); margin: 0; }

/* Zone dot */
.cemd-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; background: var(--z2); }
.cemd [data-zone="0"].cemd-dot, .cemd-scale__bar i[data-zone="0"] { background: var(--z0); }
.cemd [data-zone="1"].cemd-dot, .cemd-scale__bar i[data-zone="1"] { background: var(--z1); }
.cemd [data-zone="2"].cemd-dot, .cemd-scale__bar i[data-zone="2"] { background: var(--z2); }
.cemd [data-zone="3"].cemd-dot, .cemd-scale__bar i[data-zone="3"] { background: var(--z3); }
.cemd [data-zone="4"].cemd-dot, .cemd-scale__bar i[data-zone="4"] { background: var(--z4); }

/* Top: F&G hero + KPIs */
.cemd-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 14px; }
.cemd-card { background: var(--soft); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; min-width: 0; }
.cemd-fng__now { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.cemd-fng__v { font: 700 56px/1 Roboto, system-ui, sans-serif; letter-spacing: -.02em; }
.cemd-fng__cls { font-size: 20px; font-weight: 500; }
.cemd-scale { position: relative; display: block; margin: 16px 0 6px; }
.cemd-scale__bar { display: grid; grid-template-columns: 25.5fr 21fr 8fr 21fr 24.5fr; gap: 2px; height: 10px; }
.cemd-scale__bar i { display: block; border-radius: 2px; }
.cemd-scale__bar i:first-child { border-radius: 5px 2px 2px 5px; }
.cemd-scale__bar i:last-child { border-radius: 2px 5px 5px 2px; }
.cemd-scale__mark { position: absolute; top: -5px; width: 4px; height: 20px; margin-left: -2px; background: var(--ink); border-radius: 2px; box-shadow: 0 0 0 2px var(--soft); }
.cemd-scale__ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.cemd-fng__cmp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.cemd-fng__cmp div { min-width: 0; }
.cemd-fng__cmp dt { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin: 0; font-weight: 500; }
.cemd-fng__cmp dd { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.cemd-fng__cmp dd strong { font-size: 18px; color: var(--ink); margin-right: 2px; }
.cemd-fng__cmp dd span { white-space: nowrap; }

.cemd-kpis {
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; align-content: stretch;
	background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.cemd-kpi { background: #fff; padding: 14px 16px; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.cemd-kpi .cemd-label { font-size: 11.5px; color: var(--ink-3); margin-bottom: 4px; }
.cemd-kpi__v { font-size: 22px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.cemd-kpi__sub { font-size: 13px; color: var(--ink-2); margin-top: 3px; }

/* F&G chart */
.cemd-chart { position: relative; padding: 4px 34px 0 30px; outline: none; }
.cemd-chart:focus-visible { box-shadow: 0 0 0 2px var(--green); border-radius: var(--r); }
.cemd-chart__plot { position: relative; height: 220px; color: var(--bar); touch-action: pan-y; }
.cemd-chart__plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cemd-chart__band { position: absolute; left: 0; right: 0; opacity: .08; }
.cemd-chart__band[data-zone="0"] { background: var(--z0); }
.cemd-chart__band[data-zone="4"] { background: var(--z4); }
.cemd-chart__grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.cemd-chart__grid em { position: absolute; left: -30px; top: -8px; width: 24px; text-align: right; font: normal 11px/1 Roboto, sans-serif; color: var(--ink-3); }
.cemd-chart__dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--bar); box-shadow: 0 0 0 2px #fff; pointer-events: none; }
.cemd-chart__lab { position: absolute; margin: -9px 0 0 8px; font: 700 13px/1 Roboto, sans-serif; color: var(--ink); pointer-events: none; }
.cemd-chart__guide { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--ink-3); pointer-events: none; }
.cemd-chart__x { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.cemd-tip {
	position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none; white-space: nowrap;
	background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
	padding: 6px 9px; font-size: 12.5px; color: var(--ink-2);
}
.cemd-tip strong { color: var(--ink); font-size: 14px; }
.cemd-details { margin: 10px 0 0; font-size: 13.5px; }
.cemd-details summary { cursor: pointer; color: var(--green-ink); font-weight: 500; }
.cemd-details .cemd-table { margin-top: 8px; max-width: 420px; }

/* Tables */
.cemd .cemd-table { width: 100%; border-collapse: collapse; margin: 0; border: 0; font-size: 13.5px; }
.cemd .cemd-table th, .cemd .cemd-table td { border: 0; border-bottom: 1px solid var(--line); padding: 7px 6px; background: none; text-align: left; vertical-align: middle; }
.cemd .cemd-table thead th { font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.cemd .cemd-table--movers th:not(:first-child), .cemd .cemd-table--movers td { text-align: right; white-space: nowrap; }
.cemd .cemd-table--movers td { font-weight: 500; }
.cemd .cemd-table--movers tbody th { font-weight: 500; max-width: 0; width: 52%; }
.cemd .cemd-table--movers tbody th a { display: flex; align-items: center; gap: 8px; text-decoration: none; min-width: 0; }
.cemd .cemd-table--movers tbody th a:hover span { color: var(--green-ink); text-decoration: underline; }
.cemd .cemd-table--movers img { width: 20px; height: 20px; border-radius: 50%; flex: 0 0 20px; margin: 0; }
.cemd .cemd-table--movers tbody th span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cemd .cemd-table--movers tbody th small { color: var(--ink-3); font-size: 11.5px; flex: 0 0 auto; }
.cemd-movers { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }

/* Dominance */
.cemd-dom { display: flex; gap: 2px; height: 28px; border-radius: 4px; overflow: hidden; }
.cemd-dom__seg { flex-basis: 0; min-width: 2px; }
.cemd [data-k="btc"] { background: var(--d-btc); }
.cemd [data-k="eth"] { background: var(--d-eth); }
.cemd [data-k="stb"] { background: var(--d-stb); }
.cemd [data-k="oth"] { background: var(--d-oth); }
.cemd .cemd-legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; color: var(--ink-2); }
.cemd .cemd-legend li { margin: 0; display: flex; align-items: center; gap: 7px; }
.cemd .cemd-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cemd .cemd-legend strong { color: var(--ink); }

/* Heatmap */
.cemd-heat { position: relative; width: 100%; background: #fff; }
.cemd-heat--tall { display: none; }
.cemd-tile {
	position: absolute; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center;
	border: 1px solid #fff; text-decoration: none !important; color: var(--ink) !important; text-align: center; line-height: 1.15; padding: 2px;
	background: var(--h0);
}
.cemd-tile:hover, .cemd-tile:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; z-index: 2; }
.cemd-tile b { font-weight: 700; font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cemd-tile span { font-size: 11px; font-weight: 500; }
.cemd-tile small { font-size: 11px; opacity: .85; }
.cemd-tile[data-s="m"] b { font-size: 13px; }
.cemd-tile[data-s="m"] span { font-size: 11.5px; }
.cemd-tile[data-s="l"] b { font-size: 20px; }
.cemd-tile[data-s="l"] span { font-size: 15px; }
.cemd-tile[data-s="l"] small { font-size: 12px; }
.cemd [data-h="-4"] { background: var(--h-4); }
.cemd [data-h="-3"] { background: var(--h-3); }
.cemd [data-h="-2"] { background: var(--h-2); }
.cemd [data-h="-1"] { background: var(--h-1); }
.cemd [data-h="0"] { background: var(--h0); }
.cemd [data-h="1"] { background: var(--h1); }
.cemd [data-h="2"] { background: var(--h2); }
.cemd [data-h="3"] { background: var(--h3); }
.cemd [data-h="4"] { background: var(--h4); }
.cemd-tile[data-h="-4"], .cemd-tile[data-h="-3"], .cemd-tile[data-h="3"], .cemd-tile[data-h="4"] { color: #fff !important; }
.cemd-heat__legend { display: flex; align-items: center; gap: 2px; margin: 10px 0 0; font-size: 12px; color: var(--ink-3); }
.cemd-heat__legend i { display: block; width: 26px; height: 10px; }
.cemd-heat__legend span:first-child { margin-right: 6px; }
.cemd-heat__legend span:last-child { margin-left: 6px; }

/* Tools */
.cemd-tools { margin: 14px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cemd-tools .cemd-label { margin: 0 6px 0 0; }
.cemd-tools a {
	display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--r);
	text-decoration: none; font-weight: 500; font-size: 14px; background: #fff;
}
.cemd-tools a:hover { border-color: var(--green); color: var(--green-ink); }

/* Strip [ce_market_strip] */
.cemd--strip {
	display: flex; align-items: stretch; flex-wrap: wrap; gap: 0; margin: 12px 0; font-size: 13.5px;
	border: 1px solid var(--line); border-radius: var(--r); background: #fff; overflow: hidden;
}
.cemd--strip .cemd-strip__title {
	display: flex; align-items: center; padding: 8px 14px; background: var(--bar); color: #fff !important; border-bottom: 3px solid var(--green);
	font-weight: 700; text-transform: uppercase; letter-spacing: .03em; font-size: 13px; text-decoration: none;
}
.cemd--strip .cemd-strip__items { list-style: none; margin: 0; padding: 0; display: flex; flex: 1 1 auto; flex-wrap: wrap; min-width: 0; }
.cemd--strip .cemd-strip__items li { margin: 0; padding: 7px 14px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); min-width: 0; }
.cemd--strip .cemd-strip__items li > span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); white-space: nowrap; }
.cemd--strip .cemd-strip__items strong { font-weight: 700; white-space: nowrap; }
.cemd--strip .cemd-strip__items strong a { text-decoration: none; }
.cemd--strip em { font-style: normal; font-weight: 500; }
.cemd--strip .cemd-strip__more { display: flex; align-items: center; padding: 8px 14px; margin-left: auto; color: var(--green-ink); font-weight: 500; text-decoration: none; white-space: nowrap; }
.cemd--strip .cemd-strip__more:hover { text-decoration: underline; }

@media (max-width: 900px) {
	.cemd-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
	.cemd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cemd-kpi { padding: 12px; }
	.cemd-kpi__v { font-size: 19px; }
	.cemd-card { padding: 14px; }
	.cemd-fng__v { font-size: 48px; }
	.cemd-chart__plot { height: 180px; }
	.cemd-chart { padding-right: 26px; }
	.cemd-heat--wide { display: none; }
	.cemd-heat--tall { display: block; }
	.cemd-movers { grid-template-columns: minmax(0, 1fr); gap: 18px; }
	.cemd-heat__legend i { flex: 1 1 0; width: auto; }
	.cemd--strip .cemd-strip__title { width: 100%; }
	.cemd--strip .cemd-strip__items li { flex: 1 1 50%; border-bottom: 1px solid var(--line); }
	.cemd--strip .cemd-strip__more { width: 100%; justify-content: center; }
}

/* Links keep the ink colour so green/red stay reserved for the 24h sign. */
.cemd .cemd-table--movers tbody th a, .cemd--strip .cemd-strip__items strong a { color: var(--ink) !important; }
.cemd--strip .cemd-strip__items strong a:hover { color: var(--green-ink) !important; text-decoration: underline; }
