/* Electricity Cost Map. Scoped to .ecm so theme styles are left alone. */
.ecm {
	--ecm-surface: #ffffff;
	--ecm-text: #191919;
	--ecm-muted: #666666;
	--ecm-line: #e2e2e2;
	--ecm-soft: #f6f7f9;
	--ecm-accent: #1b64be;
	--ecm-you: #f47230;
	color: var(--ecm-text);
	font-size: 16px;
	line-height: 1.5;
	max-width: 1100px;
	margin: 0 auto;
}
.ecm *, .ecm *::before, .ecm *::after { box-sizing: border-box; }
.ecm [hidden] { display: none !important; }
.ecm-lead { font-size: 1.15em; margin: 0 0 1em; }
.ecm-h { font-size: 1.3em; line-height: 1.25; margin: 0 0 .4em; }
.ecm-h3 { font-size: 1em; margin: 1.1em 0 .4em; }
.ecm-muted { color: var(--ecm-muted); }
.ecm-small { font-size: .85em; }
.ecm-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.ecm-card {
	background: var(--ecm-surface);
	border: 1px solid var(--ecm-line);
	border-radius: 10px;
	padding: 20px;
	margin: 0 0 20px;
}

/* Bill calculator */
.ecm-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 12px 0 8px; }
.ecm-fields label, .ecm-controls label { display: flex; flex-direction: column; gap: 4px; font-size: .85em; font-weight: 600; color: var(--ecm-muted); }
.ecm-in { display: flex; align-items: center; border: 1px solid #c9c9c9; border-radius: 6px; background: #fff; overflow: hidden; }
.ecm-in:focus-within { outline: 2px solid var(--ecm-accent); outline-offset: 1px; }
.ecm-in span { padding: 0 8px; color: var(--ecm-muted); font-weight: 400; font-size: 1rem; }
.ecm-in input { border: 0 !important; outline: 0; box-shadow: none !important; padding: 8px 6px; width: 100%; min-width: 0; font-size: 1.05rem; background: transparent; color: var(--ecm-text); margin: 0; }
.ecm-in-pre input { padding-left: 0; }
.ecm-in-post input { padding-left: 10px; }
.ecm-verdict { font-size: 1.15em; font-weight: 600; margin: 12px 0; }
.ecm-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.ecm-stats div { background: var(--ecm-soft); border-radius: 8px; padding: 10px 14px; min-width: 120px; }
.ecm-stats b { display: block; font-size: 1.35em; font-variant-numeric: tabular-nums; }
.ecm-stats span { font-size: .85em; color: var(--ecm-muted); }
.ecm-cmps { display: grid; gap: 6px; max-width: 640px; }
.ecm-cmp { display: grid; grid-template-columns: minmax(120px, 34%) 1fr 64px; align-items: center; gap: 10px; font-size: .92em; }
.ecm-cmp-bar { height: 14px; display: block; }
.ecm-cmp-bar i { display: block; height: 100%; background: #84b9f3; border-radius: 0 4px 4px 0; min-width: 2px; }
.ecm-cmp.is-you .ecm-cmp-bar i { background: var(--ecm-you); }
.ecm-cmp.is-you .ecm-cmp-l { font-weight: 700; }
.ecm-cmp-v { text-align: right; font-variant-numeric: tabular-nums; }

/* Filters */
.ecm-controls { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 14px; }
.ecm-controls select { padding: 6px 8px; border: 1px solid #c9c9c9; border-radius: 6px; background: #fff; font-size: .95rem; color: var(--ecm-text); max-width: 220px; height: auto; }
.ecm-pair { display: flex; gap: 6px; }
.ecm-pair select:last-child { width: 80px; }

/* Map + panel */
.ecm-mapgrid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.ecm-mapbox { position: relative; }
.ecm-map { width: 100%; height: auto; display: block; }
.ecm-st { stroke: #ffffff; stroke-width: 1; cursor: pointer; transition: opacity .15s; }
.ecm-st:hover { stroke: #191919; stroke-width: 1.5; }
.ecm-st:focus { outline: none; stroke: #191919; stroke-width: 2; }
.ecm-st.is-sel { stroke: #191919; stroke-width: 2.5; }
.ecm-st.is-dim { fill: #f1f1f1 !important; stroke: #d6d6d6; }
.ecm-st.is-dim.is-sel { stroke: #191919; }
.ecm-labels text { font-size: 11px; font-weight: 600; fill: #191919; text-anchor: middle; pointer-events: none; }
.ecm-labels text.on-dark { fill: #ffffff; }
.ecm-labels text.is-dim, .ecm-labels text.on-dark.is-dim { fill: #9c9c9c; }
.ecm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .82em; color: var(--ecm-muted); margin-top: 6px; }
.ecm-legend-t { width: 100%; font-weight: 600; color: var(--ecm-text); }
.ecm-key { display: inline-flex; align-items: center; gap: 5px; }
.ecm-key i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.ecm-key i.is-dim-key { background: #f1f1f1; border: 1px solid #d6d6d6; }
.ecm-tip {
	position: absolute; z-index: 5; pointer-events: none;
	background: #191919; color: #fff; font-size: .82em; line-height: 1.4;
	padding: 6px 9px; border-radius: 6px; max-width: 240px; box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.ecm-panel { border-left: 1px solid var(--ecm-line); padding-left: 20px; }
.ecm-panel-h { margin: 0; font-size: 1.15em; }
.ecm-big { font-size: 2.2em; font-weight: 700; margin: 0; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ecm-big span { display: block; font-size: .38em; font-weight: 400; color: var(--ecm-muted); margin-top: 4px; }
.ecm-facts { margin: 8px 0; font-size: .92em; }
.ecm-mini { width: 100%; border-collapse: collapse; font-size: .9em; margin: 0; }
.ecm-mini th, .ecm-mini td { padding: 3px 0; border: 0; border-bottom: 1px solid var(--ecm-line); text-align: left; font-weight: 400; background: none; }
.ecm-mini td { text-align: right; }
.ecm-mini tr.is-cur th, .ecm-mini tr.is-cur td { font-weight: 700; }
.ecm-mix { display: flex; height: 16px; gap: 2px; border-radius: 4px; overflow: hidden; }
.ecm-seg { display: block; height: 100%; min-width: 2px; }
.ecm-mixkey { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: .85em; }
.ecm-mixkey li { display: flex; align-items: center; gap: 5px; margin: 0; }
.ecm-mixkey i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.ecm-mixkey b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.ecm-sparkbox { position: relative; }
.ecm-spark { width: 100%; height: auto; display: block; overflow: visible; }
.ecm-spark text { font-size: 9px; fill: var(--ecm-muted); }
.ecm-spark .ecm-spark-lab { font-size: 10px; font-weight: 700; fill: var(--ecm-text); }
.ecm-spark .ecm-spark-lab.is-us { fill: var(--ecm-muted); font-weight: 400; }
.ecm-spark-grid { stroke: #ececec; stroke-width: 1; }
.ecm-spark-line { fill: none; stroke: #257de0; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ecm-spark-us { fill: none; stroke: #9c9c9c; stroke-width: 1.5; stroke-dasharray: 3 3; }
.ecm-spark-x { stroke: #9c9c9c; stroke-width: 1; }
.ecm-spark-tip { top: 0; }

/* Share */
.ecm-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ecm-line); }
.ecm-btn { background: var(--ecm-accent); color: #fff; border: 0; border-radius: 6px; padding: 9px 16px; font-size: .95rem; font-weight: 600; cursor: pointer; }
.ecm-btn:hover, .ecm-btn:focus { background: #0f4a96; color: #fff; }
.ecm-check { font-size: .88em; display: inline-flex; gap: 6px; align-items: center; }
.ecm-share-links { display: inline-flex; gap: 12px; font-size: .9em; }

/* Tables */
.ecm-table-wrap { overflow-x: auto; margin-bottom: 12px; }
.ecm-table { width: 100%; border-collapse: collapse; font-size: .92em; margin: 0; }
.ecm-table th, .ecm-table td { padding: 6px 8px; border: 0; border-bottom: 1px solid var(--ecm-line); text-align: left; background: none; }
.ecm-table thead th { font-weight: 600; color: var(--ecm-muted); white-space: nowrap; }
.ecm-table th.ecm-num, .ecm-table td.ecm-num { text-align: right; }
.ecm-sortable { cursor: pointer; user-select: none; }
.ecm-sortable::after { content: " \2195"; opacity: .35; }
.ecm-sortable[aria-sort="ascending"]::after { content: " \2191"; opacity: 1; }
.ecm-sortable[aria-sort="descending"]::after { content: " \2193"; opacity: 1; }
.ecm-table tr.is-sel td { background: #eef5fe; font-weight: 600; }
.ecm-table tr[data-dim] td { opacity: .45; }
.ecm-source { font-size: .82em; color: var(--ecm-muted); }
.ecm-xlink { font-weight: 600; }

@media (max-width: 860px) {
	.ecm-fields { grid-template-columns: 1fr 1fr; }
	.ecm-mapgrid { grid-template-columns: 1fr; }
	.ecm-panel { border-left: 0; padding-left: 0; border-top: 1px solid var(--ecm-line); padding-top: 14px; }
}
@media (max-width: 480px) {
	.ecm-card { padding: 14px; }
	.ecm-fields { grid-template-columns: 1fr; }
	.ecm-cmp { grid-template-columns: 110px 1fr 56px; }
	.ecm-labels text { font-size: 13px; }
}

/* 1.1: search, drill-down, utilities, rankings, scatter, ads */
.ecm-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ecm-search { position: relative; max-width: 420px; margin: 4px 0 10px; }
.ecm-search input { width: 100%; padding: 10px 12px; border: 1px solid #c9c9c9; border-radius: 8px; font-size: 1rem; background: #fff; color: var(--ecm-text); }
.ecm-search input:focus { outline: 2px solid var(--ecm-accent); outline-offset: 1px; }
.ecm-q-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid #c9c9c9; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.ecm-q-list li { padding: 7px 12px; cursor: pointer; margin: 0; display: flex; justify-content: space-between; gap: 10px; }
.ecm-q-list li[aria-selected="true"], .ecm-q-list li:hover { background: #eef5fe; }
.ecm-controls label[hidden] { display: none !important; }
.ecm-back { position: absolute; z-index: 4; top: 0; left: 0; background: #fff; border: 1px solid #c9c9c9; border-radius: 6px; padding: 5px 10px; font-size: .88rem; cursor: pointer; color: var(--ecm-text); }
.ecm-back:hover, .ecm-back:focus { border-color: var(--ecm-accent); color: var(--ecm-accent); }
.ecm-map .ecm-st, .ecm-co, .ecm-zip, .ecm-zip-bg { vector-effect: non-scaling-stroke; }
.ecm-map.is-zoomed .ecm-st.is-dim { fill: #f4f4f4 !important; stroke: #e0e0e0; }
.ecm-co { stroke: #ffffff; stroke-width: .75; cursor: pointer; }
.ecm-co:hover { stroke: #191919; stroke-width: 1.5; }
.ecm-co.is-dim { fill: #efefef !important; }
.ecm-co.is-sel { stroke: #191919; stroke-width: 2.5; }
.ecm-zip-bg { fill: #f6f7f9; stroke: #c9c9c9; stroke-width: 1; }
.ecm-zip { stroke: #ffffff; stroke-width: .5; cursor: pointer; }
.ecm-zip:hover { stroke: #191919; stroke-width: 1.5; }
.ecm-zip.is-dim { fill: #e4e4e4 !important; opacity: .5; }
.ecm-zip.is-sel { stroke: #191919; stroke-width: 2; }
.ecm-zipcard { background: #eef5fe; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.ecm-zipcard .ecm-h3 { margin-top: 0; }
.ecm-zu, .ecm-own, .ecm-utils, .ecm-rank { list-style: none; margin: 0; padding: 0; }
.ecm-zu li, .ecm-own li, .ecm-rank li { display: flex; justify-content: space-between; gap: 8px; margin: 0; padding: 3px 0; border-bottom: 1px solid var(--ecm-line); font-size: .9em; }
.ecm-zu b, .ecm-own b, .ecm-rank b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ecm-utils { max-height: 260px; overflow-y: auto; border: 1px solid var(--ecm-line); border-radius: 6px; }
.ecm-utils li { margin: 0; }
.ecm-ubtn { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--ecm-line); padding: 6px 8px; cursor: pointer; font: inherit; font-size: .88em; color: var(--ecm-text); }
.ecm-ubtn small { display: block; color: var(--ecm-muted); font-size: .85em; }
.ecm-ubtn:hover, .ecm-ubtn:focus { background: #f6f7f9; }
.ecm-ubtn.is-on { background: #eef5fe; box-shadow: inset 3px 0 0 var(--ecm-accent); }
.ecm-link { background: none; border: 0; padding: 0; font: inherit; color: var(--ecm-accent); cursor: pointer; text-align: left; text-decoration: underline; }
.ecm-hrow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; }
.ecm-inline { font-size: .9em; color: var(--ecm-muted); display: inline-flex; gap: 6px; align-items: center; }
.ecm-inline select { padding: 5px 8px; border: 1px solid #c9c9c9; border-radius: 6px; background: #fff; color: var(--ecm-text); max-width: 340px; }
.ecm-ranks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
.ecm-rank .ecm-link { text-decoration: none; color: var(--ecm-text); }
.ecm-rank .ecm-link:hover { color: var(--ecm-accent); text-decoration: underline; }
.ecm-scatterbox { position: relative; }
.ecm-scatter { width: 100%; height: auto; display: block; }
.ecm-scatter .ecm-grid { stroke: #ececec; }
.ecm-scatter .ecm-ax { font-size: 11px; fill: var(--ecm-muted); }
.ecm-scatter .ecm-ax-t { font-size: 12px; fill: var(--ecm-text); }
.ecm-scatter .ecm-fit { stroke: #9c9c9c; stroke-width: 1.5; stroke-dasharray: 5 4; }
.ecm-pt { cursor: pointer; }
.ecm-pt circle { fill: #257de0; fill-opacity: .8; stroke: #fff; stroke-width: 2; }
.ecm-pt:hover circle { fill: #0f4a96; fill-opacity: 1; }
.ecm-pt.is-sel circle { fill: #f47230; fill-opacity: 1; }
.ecm-pt text { font-size: 11px; font-weight: 600; fill: var(--ecm-text); pointer-events: none; }
.ecm-ads { margin: 0 0 20px; }
.ecm-ads-label { font-size: .75em; text-transform: uppercase; letter-spacing: .06em; color: var(--ecm-muted); margin: 0 0 6px; }
.ecm-ads-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ecm-ad { display: block; border: 1px solid var(--ecm-line); border-radius: 10px; overflow: hidden; background: var(--ecm-surface); color: var(--ecm-text); text-decoration: none; }
.ecm-ad:hover, .ecm-ad:focus { border-color: var(--ecm-accent); }
.ecm-ad-text { padding: 14px 16px; }
.ecm-ad-text strong { display: block; font-size: 1.02em; margin-bottom: 4px; }
.ecm-ad-text span { display: block; font-size: .9em; color: var(--ecm-muted); }
.ecm-ad-text em { display: inline-block; margin-top: 8px; font-style: normal; font-weight: 600; color: var(--ecm-accent); font-size: .9em; }
.ecm-ad-img { display: flex; align-items: center; justify-content: center; aspect-ratio: 2 / 1; max-height: 220px; background: var(--ecm-surface); }
.ecm-ad-img img { display: block; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 860px) {
	.ecm-ads-row { grid-template-columns: 1fr; }
	.ecm-ranks { grid-template-columns: 1fr; }
}

/* Compare two places */
.ecm-cmp-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
.ecm-cmp-side { max-width: none; margin: 0; }
.ecm-cmp-side label { display: block; font-size: .85em; color: var(--ecm-muted); margin-bottom: 3px; }
.ecm-cmp-quick { font-size: .88em; color: var(--ecm-muted); margin: 8px 0 4px; }
.ecm-cmp-bars { margin: 10px 0 14px; }
.ecm-cmp.is-a .ecm-cmp-bar i { background: #1b64be; }
.ecm-cmp.is-b .ecm-cmp-bar i { background: #f47230; }
.ecm-cmp-table th small { display: block; font-weight: 400; color: var(--ecm-muted); font-size: .8em; }
.ecm-cmp-table thead th.ecm-num { width: 32%; vertical-align: bottom; }
.ecm-cmp-table td.is-best { font-weight: 700; color: #00733e; }
@media (max-width: 600px) {
	.ecm-cmp-pick { grid-template-columns: 1fr; }
}

/* Power plants (state view) */
.ecm-co.is-base { fill: #f2f2f2; stroke: #d4d4d4; cursor: default; }
.ecm-co.is-base:hover { stroke: #d4d4d4; stroke-width: .75; }
.ecm-plant { fill-opacity: .78; stroke: #ffffff; stroke-width: .6; vector-effect: non-scaling-stroke; cursor: default; }
.ecm-plant:hover { fill-opacity: 1; stroke: #191919; stroke-width: 1.2; }
.ecm-keys { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ecm-usort { display: flex; align-items: center; gap: 6px; font-size: .88em; margin: 0 0 6px; }
.ecm-usort select { font-size: inherit; padding: 2px 4px; }
