/* NewTide Energy Dashboard — Data Explorer (/data/). Builds on toe-supply-explorer.css. */

.toe-data .toe-supply__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 12px;
}

.toe-data .toe-supply__filters select {
	font: inherit;
	font-size: 13px;
	padding: 6px 10px;
	border: 1px solid var(--s-line);
	border-radius: 8px;
	background: var(--s-surface);
	color: var(--s-ink);
}

/* Sortable headers. */
.toe-data__table th[data-sort-type] { cursor: pointer; user-select: none; white-space: nowrap; }
.toe-data__table th[data-sort-type]::after { content: ""; margin-left: 4px; opacity: 0.5; }
.toe-data__table th[aria-sort="ascending"]::after { content: "▲"; font-size: 9px; }
.toe-data__table th[aria-sort="descending"]::after { content: "▼"; font-size: 9px; }

/* Direction colours. */
.toe-data__up { color: var(--s-green); }
.toe-data__down { color: #e5484d; }
.toe-data__stale { color: var(--s-amber); }

/* Sparklines. */
.toe-data__spark { width: 100px; height: 24px; display: block; }
.toe-data__spark polyline { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.toe-data__spark--up polyline { stroke: var(--s-green); }
.toe-data__spark--down polyline { stroke: #e5484d; }

/* Series page headline. */
.toe-data__title { font-size: clamp(1.4rem, 3vw, 2rem); }
.toe-data__headline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 28px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--s-line);
}
.toe-data__latest { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.toe-data__latest-value {
	font-family: var(--s-display);
	font-size: 2.1rem;
	font-weight: 800;
	line-height: 1;
	color: var(--s-ink);
	font-variant-numeric: tabular-nums;
}
.toe-supply[data-scheme="dark"] .toe-data__latest-value { color: var(--s-accent); }
.toe-data__latest-units { font-weight: 700; color: var(--s-muted); }
.toe-data__changes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.toe-data__changes li { margin: 0; }
.toe-data__actions { margin-left: auto; }

/* Charts. */
.toe-data__chart-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.toe-data__range {
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	padding: 4px 10px;
	border: 1px solid var(--s-line);
	border-radius: 999px;
	background: var(--s-surface);
	color: var(--s-ink);
	cursor: pointer;
}
.toe-data__range.is-active { background: var(--s-accent); border-color: var(--s-accent); color: var(--s-accent-ink); }
.toe-data__log { margin-left: auto; font-size: 12px; color: var(--s-muted); }
.toe-data__chart { position: relative; height: 380px; }
@media (max-width: 640px) { .toe-data__chart { height: 280px; } }

/* Statistics tables. */
.toe-data__stats th { width: 34%; text-align: left; font-weight: 700; color: var(--s-ink); }

/* 52-week range bar (sidebar). */
.toe-data__range-bar { width: 100%; height: 10px; margin: 6px 0 4px; }
.toe-data__range-bar::-webkit-meter-bar { background: var(--s-raise); border: 0; border-radius: 999px; }
.toe-data__range-bar::-webkit-meter-optimum-value { background: var(--s-accent); border-radius: 999px; }
.toe-data__range-bar::-moz-meter-bar { background: var(--s-accent); border-radius: 999px; }
.toe-data__range-ends { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: 12px; color: var(--s-muted); font-variant-numeric: tabular-nums; }

.toe-data__related { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.toe-data__related li { padding: 6px 0; border-top: 1px solid var(--s-line); }
.toe-data__related li:first-child { border-top: 0; }

/* Analysis workspace (/data/compare/). */
.toe-data__cta { margin: 0 0 10px; }
.toe-dc__presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; font-size: 13px; }
.toe-dc__preset {
	font: inherit; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; cursor: pointer;
	border: 1px solid var(--s-line); background: var(--s-surface); color: var(--s-ink);
}
.toe-dc__preset:hover { border-color: var(--s-accent); color: var(--s-accent); }
.toe-dc { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; margin-top: 16px; align-items: start; }
@media (max-width: 980px) { .toe-dc { grid-template-columns: 1fr; } }
.toe-dc__panel, .toe-dc__main { background: var(--s-surface); border: 1px solid var(--s-line); border-radius: 12px; padding: 16px; }
.toe-dc__block { margin-bottom: 16px; }
.toe-dc__label { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--s-muted); margin-bottom: 6px; }
.toe-dc input[type="search"], .toe-dc input[type="text"], .toe-dc input[type="date"], .toe-dc select {
	width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 7px 10px;
	border: 1px solid var(--s-line); border-radius: 8px; background: var(--s-ground); color: var(--s-ink);
}
.toe-dc__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toe-dc__chosen { list-style: none; margin: 10px 0 0; padding: 0; }
.toe-dc__chosen li { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; border-top: 1px solid var(--s-line); font-size: 13px; }
.toe-dc__letter { flex: 0 0 22px; height: 22px; border-radius: 6px; color: #fff; font-weight: 800; font-size: 12px; text-align: center; line-height: 22px; }
.toe-dc__name { flex: 1; min-width: 0; }
.toe-dc__name small { display: block; color: var(--s-muted); font-size: 11px; }
.toe-dc__remove { border: 0; background: none; color: var(--s-muted); font-size: 18px; line-height: 1; cursor: pointer; }
.toe-dc__remove:hover { color: #e5484d; }
.toe-dc__formula { display: grid; grid-template-columns: 1fr; gap: 6px; }
.toe-dc__formula #toe-dc-formula { font-family: var(--s-mono); }
.toe-dc__check { font-size: 13px; }
.toe-dc__error { color: #e5484d; font-size: 12px; margin: 6px 0 0; }
.toe-dc__chart { position: relative; height: 440px; }
@media (max-width: 640px) { .toe-dc__chart { height: 300px; } }
.toe-dc__actions { margin: 6px 0 14px; }
.toe-dc__swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.toe-dc__strong { font-weight: 800; color: var(--s-accent); }
.toe-dc [hidden] { display: none !important; }

/* Retail by geography (/data/retail/). */
.toe-rg__controls { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.toe-rg__controls label { min-width: 220px; }
.toe-rg__controls select {
	width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 8px 10px;
	border: 1px solid var(--s-line); border-radius: 8px; background: var(--s-surface); color: var(--s-ink);
}
.toe-rg__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.toe-rg__barcol { width: 22%; min-width: 90px; }
.toe-rg__bar { width: 100%; height: 10px; display: block; }
.toe-rg__bar rect { fill: var(--s-accent); opacity: 0.75; }
.toe-rg__us td { background: var(--s-raise); font-weight: 700; }
