/**
 * Supply Explorer — /supply/ pages.
 *
 * Theme tokens first (var(--wp--preset--…)) with fallbacks, so the pages sit
 * inside TOE Classic and still render on any theme. Dark variant follows the
 * dashboard's color_scheme setting via [data-scheme="dark"].
 */

.toe-supply {
	--s-ground:  var(--wp--preset--color--base, #ffffff);
	--s-surface: #ffffff;
	--s-raise:   #f4f6fa;
	--s-line:    #dfe4ee;
	--s-ink:     var(--wp--preset--color--contrast, #0b1220);
	--s-ink-2:   var(--wp--preset--color--secondary, #3a4456);
	--s-muted:   var(--wp--preset--color--tertiary, #6b7385);
	--s-accent:  var(--wp--preset--color--primary, #296DEB);
	--s-accent-ink: #ffffff;
	--s-accent-soft: rgba(41, 109, 235, 0.10);
	--s-amber:   #9a6400;
	--s-amber-soft: rgba(240, 165, 0, 0.16);
	--s-heat-lo: #eaf1fe;
	--s-green:   #0f8a4b;
	--s-scroll:  #9cc0f7;
	--s-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--s-display: Orbitron, 'Segoe UI', sans-serif;
	--s-body: Manrope, system-ui, -apple-system, 'Segoe UI', sans-serif;

	background: var(--s-ground);
	color: var(--s-ink);
	font-family: var(--s-body);
	font-weight: 500;
	letter-spacing: -0.005em;
	line-height: 1.45;
	padding-block: var(--wp--preset--spacing--40, 1rem) var(--wp--preset--spacing--60, 3rem);
}

.toe-supply[data-scheme="dark"] {
	--s-ground:  #0a0e17;
	--s-surface: #111827;
	--s-raise:   #172033;
	--s-line:    #243049;
	--s-ink:     #e8edf6;
	--s-ink-2:   #b6c0d4;
	--s-muted:   #8a94a8;
	--s-accent:  #5b8ff0;
	--s-accent-ink: #0a0e17;
	--s-accent-soft: rgba(91, 143, 240, 0.16);
	--s-amber:   #f0a500;
	--s-amber-soft: rgba(240, 165, 0, 0.14);
	--s-heat-lo: #15213a;
	--s-green:   #34c77b;
	--s-scroll:  #7fa8f5;
	color-scheme: dark;
}

.toe-supply *,
.toe-supply *::before,
.toe-supply *::after { box-sizing: border-box; }

.toe-supply__wrap {
	max-width: var(--wp--style--global--wide-size, 1332px);
	margin: 0 auto;
	padding-inline: var(--wp--preset--spacing--40, 1rem);
}

.toe-supply a { color: var(--s-accent); }
.toe-supply :focus-visible { outline: 2px solid var(--s-accent); outline-offset: 2px; }

/* ── Consolidated header row (inside each page's header card) ─────────── */
.toe-supply__head-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	margin: -4px 0 16px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--s-line);
}
.toe-supply__head--compact { padding-block: 14px; margin-bottom: 18px; }
.toe-supply__head--compact .toe-supply__head-top { margin: 0; padding: 0; border: 0; }
.toe-supply__brand {
	font-family: var(--s-display);
	font-weight: 800;
	font-size: 15px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--s-ink) !important;
	white-space: nowrap;
}
.toe-supply__brand span { color: var(--s-accent); }

.toe-supply__search { position: relative; flex: 1 1 280px; max-width: 560px; margin: 0 0 0 auto; }
.toe-supply__search input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--s-line);
	border-radius: 10px;
	background: var(--s-surface);
	color: var(--s-ink);
	font: inherit;
}
.toe-supply__suggest {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	z-index: 50;
	background: var(--s-surface);
	border: 1px solid var(--s-line);
	border-radius: 10px;
	box-shadow: 0 10px 28px rgba(11, 18, 32, 0.14);
	overflow: hidden;
}
.toe-supply__suggest a {
	display: grid;
	grid-template-columns: 76px 1fr;
	gap: 10px;
	padding: 9px 12px;
	color: var(--s-ink);
	text-decoration: none;
}
.toe-supply__suggest a:hover,
.toe-supply__suggest a:focus-visible,
.toe-supply__suggest a[aria-selected="true"] { background: var(--s-raise); }
.toe-supply__suggest small { display: block; color: var(--s-muted); }
.toe-supply__suggest p { margin: 0; padding: 10px 12px; color: var(--s-muted); }

.toe-supply__copy {
	border: 1px solid var(--s-line);
	background: var(--s-surface);
	color: var(--s-ink-2);
	border-radius: 8px;
	padding: 9px 12px;
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
	cursor: pointer;
}
.toe-supply__copy:hover { border-color: var(--s-accent); color: var(--s-ink); }

/* ── Chips & badges ────────────────────────────────────────────────────── */
.toe-supply__type {
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	color: var(--s-muted);
}
.toe-supply__chip {
	display: inline-flex;
	align-items: center;
	font-size: 11px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 9999px;
	background: var(--s-raise);
	color: var(--s-ink-2);
	white-space: nowrap;
	border: 1px solid transparent;
}
.toe-supply__chip--confirmed { background: var(--s-accent-soft); color: var(--s-accent); }
.toe-supply__chip--same_city,
.toe-supply__chip--inferred { background: transparent; color: var(--s-amber); border: 1px dashed var(--s-amber); }
.toe-supply__prod {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 4px;
	background: var(--s-amber-soft);
	color: var(--s-amber);
	white-space: nowrap;
	text-transform: capitalize;
}
.toe-supply__prod--inferred { background: transparent; border: 1px dashed var(--s-amber); font-style: italic; }

/* ── Layout ────────────────────────────────────────────────────────────── */
.toe-supply__page {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 20px;
}
@media (max-width: 980px) {
	.toe-supply__page { grid-template-columns: 1fr; }
}
.toe-supply__main { min-width: 0; }
.toe-supply__head {
	background: var(--s-surface);
	border: 1px solid var(--s-line);
	border-radius: 14px;
	padding: 20px 22px;
}
.toe-supply__title,
.toe-supply__h1 {
	font-family: var(--s-display);
	font-weight: 800;
	font-size: var(--wp--preset--font-size--x-large, clamp(1.5rem, 2.4vw, 1.8rem));
	line-height: 1.2;
	margin: 6px 0 4px;
	text-wrap: balance;
	color: var(--s-ink);
}
.toe-supply__h2 {
	font-family: var(--s-body);
	font-weight: 800;
	font-size: var(--wp--preset--font-size--medium, 1.1rem);
	margin: 0 0 10px;
	color: var(--s-ink);
}
.toe-supply__sub { color: var(--s-ink-2); margin: 0; }
.toe-supply__lede { max-width: 68ch; color: var(--s-ink-2); }
.toe-supply__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.toe-supply__stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
	gap: 1px;
	background: var(--s-line);
	border: 1px solid var(--s-line);
	border-radius: 10px;
	overflow: hidden;
	margin: 16px 0 0;
}
.toe-supply__stats > div { background: var(--s-surface); padding: 12px 14px; display: flex; flex-direction: column-reverse; }
.toe-supply__stats dt { font-size: 12px; color: var(--s-muted); font-weight: 600; }
.toe-supply__stats dd {
	margin: 0;
	font-family: var(--s-display);
	font-size: 1.25rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	color: var(--s-accent);
}

/* ── Tabs (enhanced by JS; stacked sections without it) ───────────────── */
.toe-supply__tablist {
	display: flex;
	gap: 2px;
	margin-top: 18px;
	border-bottom: 1px solid var(--s-line);
	overflow-x: auto;
}
.toe-supply__tablist button {
	border: 0;
	background: none;
	padding: 10px 14px;
	color: var(--s-muted);
	font-family: var(--s-body);
	/* Pinned: the theme's button styles otherwise size these like CTAs. */
	font-size: var(--wp--preset--font-size--small, 15px);
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	font-weight: 700;
	border-bottom: 2px solid transparent;
	white-space: nowrap;
	cursor: pointer;
}
.toe-supply__tablist button[aria-selected="true"] { color: var(--s-ink); border-bottom-color: var(--s-accent); }
.toe-supply__section {
	background: var(--s-surface);
	border: 1px solid var(--s-line);
	border-radius: 14px;
	padding: 16px 18px;
	margin-top: 16px;
}
.toe-supply__tabs.is-tabbed .toe-supply__section { margin-top: 0; border-top: 0; border-radius: 0 0 14px 14px; }
.toe-supply__tabs.is-tabbed .toe-supply__section > .toe-supply__h2 { display: none; }

.toe-supply__toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}
.toe-supply__toolbar-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.toe-supply select {
	font: inherit;
	font-size: 13px;
	padding: 6px 9px;
	border: 1px solid var(--s-line);
	border-radius: 8px;
	background: var(--s-surface);
	color: var(--s-ink);
}
.toe-supply__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid var(--s-line);
	background: var(--s-surface);
	color: var(--s-ink) !important;
	border-radius: 8px;
	padding: 6px 11px;
	font-size: 12px;
	font-weight: 700;
	text-decoration: none;
}
.toe-supply__btn:hover { border-color: var(--s-accent); }
.toe-supply__btn--primary { background: var(--s-accent); border-color: var(--s-accent); color: var(--s-accent-ink) !important; }
.toe-supply__btn--locked { color: var(--s-muted) !important; border-style: dashed; }
.toe-supply__note { font-size: 12.5px; color: var(--s-muted); margin: 0 0 8px; }

/* ── Tables ────────────────────────────────────────────────────────────── */
.toe-supply__scroll {
	overflow-x: auto;
	border: 1px solid var(--s-line);
	border-radius: 10px;
	/* Light-blue scrollbars — the default was near-invisible on the dark ground. */
	scrollbar-color: var(--s-scroll) transparent;
	scrollbar-width: thin;
}
.toe-supply__scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.toe-supply__scroll::-webkit-scrollbar-track { background: transparent; }
.toe-supply__scroll::-webkit-scrollbar-thumb { background: var(--s-scroll); border-radius: 999px; border: 2px solid var(--s-surface); }
.toe-supply__scroll::-webkit-scrollbar-thumb:hover { background: var(--s-accent); }
.toe-supply__scroll--tall { max-height: 560px; overflow-y: auto; }
.toe-supply__table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 0; }
.toe-supply__table th,
.toe-supply__table td {
	padding: 8px 10px;
	text-align: left;
	border-bottom: 1px solid var(--s-line);
	vertical-align: top;
}
.toe-supply__table th {
	position: sticky;
	top: 0;
	z-index: 1;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--s-muted);
	font-weight: 800;
	background: var(--s-raise);
}
.toe-supply__table tr:last-child td,
.toe-supply__table tr:last-child th { border-bottom: 0; }

/* Rate matrix axes: origins across in amber, delivery points down in blue —
   the same colours as the map's origin diamonds and delivery-point circles. */
.toe-supply__corner { vertical-align: bottom !important; min-width: 190px; }
.toe-supply__axis { display: block; white-space: nowrap; line-height: 1.5; }
.toe-supply__axis--origin { color: var(--s-amber); text-align: right; }
.toe-supply__axis--dest { color: var(--s-accent); }
.toe-supply__axis span { font-size: 13px; margin-left: 2px; }
.toe-supply__table .toe-supply__col-origin {
	color: var(--s-amber);
	vertical-align: bottom;
	/* Long origin names ("Baton Rouge Dock Facility") wrap instead of pushing
	   the Tariff column off the edge. */
	white-space: normal;
	max-width: 96px;
	line-height: 1.3;
}
/* Row labels are <th scope="row"> for accessibility; undo the column-header
   styling (uppercase, grey, sticky-top) they would otherwise inherit. */
.toe-supply__table .toe-supply__row-dest {
	position: static;
	text-transform: none;
	letter-spacing: 0;
	font-size: 13px;
	font-weight: 700;
	color: var(--s-accent);
	background: transparent;
	border-bottom: 1px solid var(--s-line);
}
.toe-supply__num { text-align: right !important; font-family: var(--s-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.toe-supply__mono { font-family: var(--s-mono); }
.toe-supply__dim { color: var(--s-muted); }
.toe-supply__nowrap { white-space: nowrap; }
.toe-supply__group td {
	background: var(--s-raise);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--s-ink-2);
}
.toe-supply__table tr[hidden] { display: none; }

/* Rate heat: ten steps from the low-rate tint to the accent. */
.toe-supply__cell { display: inline-block; min-width: 64px; padding: 3px 7px; border-radius: 5px; }
.toe-supply__heat-0 { background: color-mix(in srgb, var(--s-accent) 10%, var(--s-heat-lo)); }
.toe-supply__heat-1 { background: color-mix(in srgb, var(--s-accent) 17%, var(--s-heat-lo)); }
.toe-supply__heat-2 { background: color-mix(in srgb, var(--s-accent) 24%, var(--s-heat-lo)); }
.toe-supply__heat-3 { background: color-mix(in srgb, var(--s-accent) 31%, var(--s-heat-lo)); }
.toe-supply__heat-4 { background: color-mix(in srgb, var(--s-accent) 39%, var(--s-heat-lo)); }
.toe-supply__heat-5 { background: color-mix(in srgb, var(--s-accent) 47%, var(--s-heat-lo)); }
.toe-supply__heat-6 { background: color-mix(in srgb, var(--s-accent) 56%, var(--s-heat-lo)); color: var(--s-accent-ink); }
.toe-supply__heat-7 { background: color-mix(in srgb, var(--s-accent) 65%, var(--s-heat-lo)); color: var(--s-accent-ink); }
.toe-supply__heat-8 { background: color-mix(in srgb, var(--s-accent) 74%, var(--s-heat-lo)); color: var(--s-accent-ink); }
.toe-supply__heat-9 { background: color-mix(in srgb, var(--s-accent) 84%, var(--s-heat-lo)); color: var(--s-accent-ink); }

/* Fees: Applies takes the room; the rest wrap inside fixed tracks. */
.toe-supply__fees { table-layout: fixed; min-width: 640px; }
.toe-supply__col-charge { width: 118px; }
.toe-supply__col-amount { width: 170px; }
.toe-supply__col-source { width: 120px; }
.toe-supply__fees td { overflow-wrap: anywhere; }
.toe-supply__amount strong { display: block; font-family: var(--s-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.toe-supply__amount span { display: block; font-size: 11.5px; color: var(--s-muted); }
.toe-supply__applies { color: var(--s-ink-2); line-height: 1.5; }
.toe-supply__fees .toe-supply__mono { font-size: 11.5px; line-height: 1.5; }

.toe-supply__kv {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: 8px 16px;
	font-size: 13px;
	margin: 0 0 16px;
}
.toe-supply__kv dt { color: var(--s-muted); font-weight: 700; }
.toe-supply__kv dd { margin: 0; max-width: 72ch; color: var(--s-ink-2); }
@media (max-width: 560px) { .toe-supply__kv { grid-template-columns: 1fr; } }

.toe-supply__grades { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.toe-supply__grades > div { border: 1px solid var(--s-line); border-radius: 10px; padding: 12px; }
.toe-supply__grades h3 { margin: 0 0 6px; font-size: 13px; text-transform: capitalize; color: var(--s-ink); }
.toe-supply__grades ul { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--s-ink-2); }

/* ── Side column ───────────────────────────────────────────────────────── */
.toe-supply__side { display: flex; flex-direction: column; gap: 16px; }
.toe-supply__card { background: var(--s-surface); border: 1px solid var(--s-line); border-radius: 14px; padding: 14px 16px; }
.toe-supply__card p { margin: 10px 0 0; }
.toe-supply__card-title {
	margin: 0 0 10px;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	color: var(--s-muted);
	font-weight: 800;
}
/* Direct child only: Leaflet draws its markers and attribution flag in nested
   SVGs, and stretching those to 100% broke the live map. */
.toe-supply__map > svg { display: block; width: 100%; height: auto; border-radius: 10px; background: var(--s-raise); }
.toe-supply__grid { stroke: var(--s-line); stroke-width: 0.6; }
.toe-supply__pt--origin { fill: var(--s-amber); }
.toe-supply__pt--dest { fill: var(--s-accent); fill-opacity: 0.75; }
.toe-supply__pt--focus { fill: var(--s-accent); stroke: var(--s-surface); stroke-width: 2.5; }
.toe-supply__legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--s-muted); }
.toe-supply__legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; vertical-align: -1px; }
.toe-supply__key--origin { background: var(--s-amber); transform: rotate(45deg); }
.toe-supply__key--dest { background: var(--s-accent); opacity: 0.7; border-radius: 50%; }
.toe-supply__key--near { background: var(--s-green); border-radius: 50%; }
.toe-supply__key--focus { background: var(--s-accent); border-radius: 50%; }

/* ── Search page ───────────────────────────────────────────────────────── */
.toe-supply__search-page { margin-top: 0; }
.toe-supply__results { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; }
.toe-supply__result {
	display: grid;
	grid-template-columns: 96px 1fr;
	gap: 14px;
	align-items: center;
	background: var(--s-surface);
	border: 1px solid var(--s-line);
	border-radius: 12px;
	padding: 14px 16px;
	text-decoration: none;
	color: var(--s-ink) !important;
}
.toe-supply__result:hover { border-color: var(--s-accent); }
.toe-supply__result strong { display: block; }
.toe-supply__result small { color: var(--s-muted); }
.toe-supply__hero { margin: 0 0 20px; }
.toe-supply__hero .toe-supply__h1 { font-size: var(--wp--preset--font-size--xx-large, clamp(1.8rem, 3vw, 2.6rem)); }

/* KPI cards — the dashboard card anatomy: source · title · value · byline. */
.toe-supply__kpis {
	list-style: none;
	margin: 0 0 var(--wp--preset--spacing--50, 2rem);
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40, 1rem);
}
@media (max-width: 1100px) { .toe-supply__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px)  { .toe-supply__kpis { grid-template-columns: 1fr; } }
.toe-supply__kpi { --kpi: var(--s-accent); }
.toe-supply__kpi--refinery { --kpi: #e8590c; }
.toe-supply__kpi--terminal { --kpi: var(--s-accent); }
.toe-supply__kpi--pipeline { --kpi: #7c4dff; }
.toe-supply__kpi--rate     { --kpi: #0f9d58; }
.toe-supply__kpi--market   { --kpi: var(--s-amber); }
.toe-supply__kpi-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	height: 100%;
	padding: 16px 18px;
	background: var(--s-surface);
	border: 1px solid var(--s-line);
	border-top: 2px solid var(--kpi);
	border-radius: 12px;
	color: var(--s-ink) !important;
	text-decoration: none;
}
a.toe-supply__kpi-body:hover { border-color: var(--kpi); }
.toe-supply__kpi-source {
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--s-muted);
}
.toe-supply__kpi-title { font-weight: 800; font-size: var(--wp--preset--font-size--small, 1rem); }
.toe-supply__kpi-value {
	font-family: var(--s-display);
	font-size: 1.6rem;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
	color: var(--s-ink);
	margin: 2px 0;
}
.toe-supply[data-scheme="dark"] .toe-supply__kpi-value { color: var(--kpi); }
.toe-supply__kpi-units {
	font-family: var(--s-body);
	font-size: var(--wp--preset--font-size--x-small, 0.868rem);
	font-weight: 600;
	letter-spacing: 0;
	color: var(--s-muted);
	margin-left: 0.35em;
}
.toe-supply__kpi-byline { font-size: 12px; color: var(--s-muted); margin-top: auto; line-height: 1.4; }

.toe-supply__systems { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.toe-supply__systems a {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	height: 100%;
	padding: 12px 14px;
	border: 1px solid var(--s-line);
	border-radius: 12px;
	background: var(--s-surface);
	text-decoration: none;
	color: var(--s-ink) !important;
}
.toe-supply__systems a:hover { border-color: var(--s-accent); }
.toe-supply__system-name { font-weight: 800; }
.toe-supply__system-meta { font-size: 12px; color: var(--s-muted); }

/* Mini map (Leaflet) — the sketch stays as the no-script fallback. */
.toe-supply__map.is-live { height: 260px; border-radius: 10px; overflow: hidden; background: var(--s-raise); }
.toe-supply__map.is-live .leaflet-container { font-family: var(--s-body); }
.toe-supply__popup .leaflet-popup-content { font-size: 12.5px; line-height: 1.45; margin: 10px 12px; }
.toe-supply__popup .leaflet-popup-content span { color: #5b6477; }

.toe-supply__footnote { margin-top: 24px; font-size: 12px; color: var(--s-muted); max-width: 90ch; }

.toe-supply__toast {
	position: fixed;
	left: 50%;
	bottom: calc(20px + env(safe-area-inset-bottom, 0px));
	transform: translateX(-50%);
	z-index: 100;
	background: var(--s-ink);
	color: var(--s-ground);
	padding: 10px 16px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 700;
}

@media (max-width: 560px) {
	.toe-supply__result { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
	.toe-supply__btn, .toe-supply__result, .toe-supply__systems a { transition: border-color 0.15s ease; }
}

/* ── Refinery page ─────────────────────────────────────────────────────── */
.toe-supply__chip--status-operating { background: color-mix(in srgb, var(--s-green) 16%, transparent); color: var(--s-green); }
.toe-supply__chip--status-closed,
.toe-supply__chip--status-converted { background: rgba(229, 72, 77, 0.16); color: #e5484d; }
.toe-supply__chip--status-idled,
.toe-supply__chip--status-idle,
.toe-supply__chip--status-closing { background: var(--s-amber-soft); color: var(--s-amber); }
.toe-supply__chip--in  { background: var(--s-amber-soft); color: var(--s-amber); }
.toe-supply__chip--out { background: var(--s-accent-soft); color: var(--s-accent); }
.toe-supply__chip--verdict-supported    { background: color-mix(in srgb, var(--s-green) 16%, transparent); color: var(--s-green); }
.toe-supply__chip--verdict-contradicted { background: rgba(229, 72, 77, 0.16); color: #e5484d; }
.toe-supply__chip--verdict-no_evidence  { background: transparent; color: var(--s-muted); border: 1px dashed var(--s-line); }
.toe-supply__alert {
	margin: 12px 0 0;
	padding: 10px 12px;
	border-radius: 8px;
	background: rgba(229, 72, 77, 0.10);
	border: 1px solid rgba(229, 72, 77, 0.35);
	color: var(--s-ink-2);
	font-size: 13px;
}
.toe-supply__h3 { font-size: 13px; font-weight: 800; margin: 16px 0 8px; color: var(--s-ink); }
.toe-supply__units { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.toe-supply__units h3 { font-size: 12px; font-weight: 800; color: var(--s-muted); margin: 0 0 6px; }
.toe-supply__units .toe-supply__table td { padding: 6px 8px; }
.toe-supply__subs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.toe-supply__subs > div { border: 1px solid var(--s-line); border-radius: 10px; padding: 12px 14px; }
.toe-supply__subs h3 { margin: 0 0 8px; font-size: 13px; color: var(--s-ink); }
.toe-supply__subs ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; }
.toe-supply__timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--s-line); display: grid; gap: 14px; }
.toe-supply__event { position: relative; }
.toe-supply__event::before {
	content: '';
	position: absolute;
	left: -21px;
	top: 4px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--s-muted);
	border: 2px solid var(--s-surface);
}
.toe-supply__event--outage::before,
.toe-supply__event--fire::before { background: #e5484d; }
.toe-supply__event--closure::before,
.toe-supply__event--conversion::before { background: var(--s-amber); }
.toe-supply__event--expansion::before,
.toe-supply__event--sale::before { background: var(--s-accent); }
.toe-supply__event-date { font-family: var(--s-mono); font-size: 12px; color: var(--s-muted); margin-right: 8px; }
.toe-supply__event p { margin: 4px 0 0; font-size: 13px; color: var(--s-ink-2); max-width: 80ch; }
.toe-supply__map:empty { min-height: 260px; background: var(--s-raise); border-radius: 10px; }

/* Landing directory (Refineries / Pipelines / Terminals tabs). */
.toe-supply__directory { margin-top: 8px; }
.toe-supply__find {
	font: inherit;
	font-size: 13px;
	padding: 6px 9px;
	border: 1px solid var(--s-line);
	border-radius: 8px;
	background: var(--s-surface);
	color: var(--s-ink);
	min-width: 240px;
}

/* Directory card names: body face at card size — the theme was sizing them like headings. */
.toe-supply__system-name {
	font-family: var(--s-body);
	font-size: var(--wp--preset--font-size--small, 15px);
	line-height: 1.3;
	letter-spacing: -0.005em;
	text-transform: none;
}

/* Refinery header: text + visual (photo or USGS aerial). */
.toe-supply__head-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 340px); gap: 20px; align-items: start; }
@media (max-width: 760px) { .toe-supply__head-body { grid-template-columns: 1fr; } }
.toe-supply__media { margin: 0; }
/* Direct child only: the aerial's Leaflet tiles are imgs too, and borders on them drew seams. */
.toe-supply__media > img,
.toe-supply__aerial {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 10px;
	border: 1px solid var(--s-line);
	background: var(--s-raise);
}
.toe-supply__media figcaption { margin-top: 6px; font-size: 12px; color: var(--s-ink-2); line-height: 1.4; }
.toe-supply__credit { display: block; font-size: 11px; color: var(--s-muted); margin-top: 2px; }

/* ── Embeds (shortcodes) ────────────────────────────────────────────────
   Inside a page the Explorer sits in the content column, so layout follows
   the embed's own width (container queries), not the viewport's. */
.toe-supply--embed {
	container-type: inline-size;
	padding-block: 0;
	margin-block: var(--wp--preset--spacing--40, 1rem);
	border-radius: 14px;
}
.toe-supply--embed .toe-supply__wrap { max-width: none; padding-inline: 0; }
/* Theme content styles (.entry-content h1/h2, ul, a) outrank single classes. */
.toe-supply.toe-supply--embed h2.toe-supply__h2 {
	font-family: var(--s-body);
	font-weight: 800;
	font-size: var(--wp--preset--font-size--medium, 1.1rem);
	line-height: 1.3;
	margin: 0 0 10px;
	color: var(--s-ink);
}
.toe-supply.toe-supply--embed a { color: var(--s-accent); }
.toe-supply--embed ul.toe-supply__systems,
.toe-supply--embed ul.toe-supply__kpis { padding-left: 0; list-style: none; }
@container (max-width: 980px) { .toe-supply__page { grid-template-columns: 1fr; } }
@container (max-width: 1100px) { .toe-supply__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 520px) { .toe-supply__kpis { grid-template-columns: 1fr; } }
@container (max-width: 760px) { .toe-supply__head-body { grid-template-columns: 1fr; } }
@container (max-width: 560px) { .toe-supply__kv { grid-template-columns: 1fr; } }
