/**
 * Calccc Lab data stories.
 * Scoped styles for the data-story template, the /fun/data/ index, and the
 * five cards added to /fun/. No external chart library.
 */

/* -------------------------------------------------------------------------
   Shell
   ------------------------------------------------------------------------- */
.data-story-page,
.data-stories-index {
	--ds-read: 820px;
	--ds-shell: var(--shell-wide);
	--ds-hero: 880px;
	--ds-accent: #0d6b52;
	--ds-soft: #e7f5ee;
	padding-bottom: 48px;
}

.ds-accent-water { --ds-accent: #1f6f8b; --ds-soft: #e8f3f5; }
.ds-accent-carbon { --ds-accent: #a96312; --ds-soft: #fbf1e3; }
.ds-accent-tax { --ds-accent: #5b4aa0; --ds-soft: #f0edfa; }
.ds-accent-life { --ds-accent: #b23b50; --ds-soft: #fbe9ed; }
.ds-accent-world { --ds-accent: #4c6b23; --ds-soft: #eef5e4; }

.data-story-page .breadcrumbs,
.data-stories-index .breadcrumbs {
	max-width: var(--ds-shell);
}

.ds-hero {
	position: relative;
	max-width: var(--ds-hero);
	margin: 6px 0 24px;
	padding: 32px 34px;
	border: 1px solid var(--border);
	border-radius: 24px;
	background:
		radial-gradient(640px 260px at 92% -30%, var(--ds-soft), transparent 62%),
		linear-gradient(135deg, #f4faf6, #fffdf8);
	overflow: hidden;
}
.ds-hero::after {
	content: "";
	position: absolute;
	pointer-events: none;
	right: -80px;
	bottom: -130px;
	width: 240px;
	height: 240px;
	border-radius: 50%;
	border: 32px solid rgba(13, 107, 82, .06);
}
.ds-hero .ds-kicker { position: relative; }
.ds-hero h1 {
	position: relative;
	max-width: 880px;
	margin: 0 0 12px;
	font-size: clamp(2.1rem, 4.4vw, 3.3rem);
	line-height: 1.06;
	letter-spacing: -.045em;
}
.ds-dek {
	position: relative;
	max-width: 760px;
	margin: 0;
	color: var(--muted);
	font-size: 17px;
	line-height: 1.6;
}
.ds-hero-meta {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin-top: 18px;
	color: var(--muted-2);
	font-size: 12px;
	font-weight: 700;
}
.ds-hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ds-hero-meta span + span::before {
	content: "";
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: var(--border);
}

.ds-kicker {
	margin: 0 0 8px;
	color: var(--ds-accent);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .13em;
	text-transform: uppercase;
}

.ds-takeaway {
	max-width: var(--ds-read);
	margin: 0 auto 26px;
	padding: 20px 24px;
	border: 1px solid #cfe4d9;
	border-left: 4px solid var(--ds-accent);
	border-radius: 0 16px 16px 0;
	background: #f3faf6;
}
.ds-takeaway p:last-child {
	margin: 0;
	color: #24463a;
	font-size: 16px;
	line-height: 1.7;
}
.ds-takeaway .ds-kicker { color: var(--brand-dark); }

.ds-prose {
	max-width: var(--ds-read);
	margin: 0 auto;
}
.ds-prose p {
	margin: 0 0 16px;
	color: #3f4f47;
	font-size: 16px;
	line-height: 1.75;
}
.ds-prose p:last-child { margin-bottom: 0; }
.ds-prose a { text-decoration: underline; text-underline-offset: 2px; }
.ds-intro { margin-bottom: 26px; }
.ds-section { margin: 34px 0 0; }
.ds-section h2,
.ds-method h2,
.ds-sources h2,
.ds-faq h2,
.ds-related h2 {
	margin: 0 0 12px;
	color: var(--navy);
	font-family: var(--font-display);
	font-size: 27px;
	line-height: 1.18;
	letter-spacing: -.03em;
}

/* -------------------------------------------------------------------------
   Interactive chart cards
   ------------------------------------------------------------------------- */
.ds-interactive {
	position: relative;
	max-width: var(--ds-shell);
	margin: 30px auto;
	padding: 24px 26px 22px;
	border: 1px solid var(--border);
	border-radius: 22px;
	background: #fff;
	box-shadow: var(--shadow-sm);
}
.ds-chart-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}
.ds-chart-head h2 {
	margin: 0;
	color: var(--navy);
	font-family: var(--font-display);
	font-size: 24px;
	line-height: 1.2;
	letter-spacing: -.025em;
}
.ds-chart-head .ds-kicker { margin-bottom: 3px; }

.ds-tab,
.ds-btn-ghost {
	min-height: 36px;
	padding: 0 13px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: #fff;
	color: var(--ink);
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.ds-tab:hover,
.ds-btn-ghost:hover { border-color: var(--ds-accent); color: var(--ds-accent); }
.ds-tab.is-active {
	border-color: var(--ds-accent);
	background: var(--ds-soft);
	color: var(--ds-accent);
}
.ds-water-tabs,
.ds-status-tabs { display: flex; flex-wrap: wrap; gap: 6px; }

.ds-controls {
	margin: 10px 0 18px;
	padding: 14px 16px;
	border: 1px solid var(--border-soft);
	border-radius: 14px;
	background: #fbfaf7;
}
.ds-control-label {
	display: block;
	margin-bottom: 8px;
	color: var(--navy);
	font-size: 12px;
	font-weight: 800;
}
.ds-control-row {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}
.ds-range {
	flex: 1 1 320px;
	min-width: 0;
	accent-color: var(--ds-accent);
}
.ds-number-input {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: #fff;
	font-size: 12px;
	font-weight: 700;
	color: var(--muted);
}
.ds-number-input input {
	width: 92px;
	min-width: 0;
	border: 0;
	background: transparent;
	color: var(--navy);
	font: inherit;
	font-size: 14px;
	font-weight: 800;
	text-align: right;
}
.ds-number-input input:focus { outline: 2px solid var(--ds-accent); outline-offset: 2px; border-radius: 4px; }
.ds-currency-input input { width: 112px; text-align: left; }
.ds-control-help {
	margin: 8px 0 0;
	color: var(--muted-2);
	font-size: 11.5px;
	line-height: 1.5;
}
.ds-unit-note {
	margin: 12px 0 0;
	color: var(--muted-2);
	font-size: 11.5px;
	line-height: 1.55;
}

/* Tooltip */
.ds-tooltip {
	position: absolute;
	z-index: 20;
	max-width: 250px;
	padding: 8px 11px;
	border-radius: 10px;
	background: var(--navy);
	color: #fff;
	font-size: 12px;
	line-height: 1.45;
	box-shadow: 0 10px 26px rgba(15, 42, 67, .2);
	pointer-events: none;
	transform: translate(-50%, -110%);
}
.ds-tooltip strong { display: block; font-size: 12.5px; }

/* -------------------------------------------------------------------------
   Water chart
   ------------------------------------------------------------------------- */
.ds-water-views { display: flex; flex-direction: column; gap: 10px; }
.ds-water-view {
	display: none;
	grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
	gap: 22px;
	align-items: center;
}
.ds-water-view.is-active { display: grid; }
.ds-water.is-enhanced .ds-water-view { display: none; }
.ds-water.is-enhanced .ds-water-view.is-active { display: grid; }
.ds-water.is-enhanced .ds-water-view[data-water-group="total"].is-active { display: grid; }
.ds-water.is-enhanced .ds-water-view[data-water-group="fresh"].is-active { display: grid; }

.ds-donut-wrap { width: 100%; max-width: 220px; }
.ds-donut { display: block; width: 100%; height: auto; }
.ds-donut-track { fill: none; stroke: #f1ede3; stroke-width: 30; }
.ds-donut-seg {
	cursor: pointer;
	transition: stroke-width .15s var(--ease), opacity .15s var(--ease);
}
.ds-donut-seg:hover,
.ds-donut-seg:focus { stroke-width: 34; outline: none; }
.ds-donut-value {
	fill: var(--navy);
	font-family: var(--font-display);
	font-size: 24px;
	font-weight: 800;
}
.ds-donut-caption { fill: var(--muted-2); font-size: 8.5px; font-weight: 600; }

.ds-legend {
	display: grid;
	gap: 8px;
	max-width: 460px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ds-legend li {
	display: flex;
	align-items: center;
	gap: 9px;
	color: var(--muted);
	font-size: 12.5px;
	line-height: 1.4;
}
.ds-swatch {
	flex: 0 0 auto;
	width: 12px;
	height: 12px;
	border-radius: 4px;
}
.ds-legend-label { min-width: 0; }
.ds-legend-value {
	margin-left: auto;
	color: var(--navy);
	font-weight: 800;
	white-space: nowrap;
}

.ds-scale100 {
	margin-top: 18px;
	padding-top: 18px;
	border-top: 1px solid var(--border-soft);
}
.ds-scale100 h3 {
	margin: 0 0 10px;
	color: var(--navy);
	font-size: 16px;
}
.ds-scale-bar {
	display: flex;
	height: 24px;
	border-radius: 8px;
	overflow: hidden;
	background: #f1ede3;
}
.ds-scale-bar-fresh { height: 30px; margin-top: 8px; }
.ds-scale-seg { display: block; min-width: 3px; height: 100%; }
.ds-scale-seg + .ds-scale-seg { box-shadow: inset 1px 0 rgba(255, 255, 255, .7); }
.ds-scale-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin-top: 8px;
	color: var(--muted);
	font-size: 11.5px;
}
.ds-scale-legend strong { color: var(--navy); }
.ds-scale-note {
	margin: 10px 0 0;
	color: var(--muted-2);
	font-size: 11px;
	line-height: 1.5;
}
.ds-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

/* -------------------------------------------------------------------------
   Carbon chart
   ------------------------------------------------------------------------- */
.ds-carbon-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin: 4px 0 18px;
}
.ds-carbon-stats > div {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 13px 15px;
	border: 1px solid var(--border);
	border-radius: 13px;
	background: #fbfaf7;
}
.ds-stat-label {
	color: var(--muted-2);
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
}
.ds-carbon-stats strong {
	color: var(--navy);
	font-family: var(--font-display);
	font-size: 23px;
	line-height: 1.15;
}
.ds-carbon-stats small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.ds-carbon-years-card strong { color: var(--ds-accent); }

.ds-chart-figure { margin: 6px 0 0; }
.ds-chart { display: block; width: 100%; height: auto; }
.ds-chart figure,
.ds-chart-figure figcaption {
	margin: 6px 0 0;
	color: var(--muted-2);
	font-size: 11.5px;
	line-height: 1.5;
}
.ds-chart-figure figcaption { margin-top: 10px; }

.ds-chart-grid line { stroke: #ece7dc; stroke-width: 1; }
.ds-chart-grid line.ds-grid-vertical { stroke: #f2eee5; }
.ds-axis-label { fill: var(--muted-2); font-size: 11px; font-weight: 600; }
.ds-axis-title { fill: var(--muted); font-size: 11px; font-weight: 700; }
.ds-carbon-line {
	fill: none;
	stroke: var(--ds-accent);
	stroke-width: 3.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.ds-carbon-area { fill: rgba(169, 99, 18, .1); stroke: none; }
.ds-carbon-exhaust {
	stroke: var(--red);
	stroke-width: 2;
	stroke-dasharray: 5 5;
}
.ds-carbon-dot { fill: var(--red); stroke: #fff; stroke-width: 2; }
.ds-carbon-label { fill: var(--red); font-size: 11px; font-weight: 800; }
.ds-carbon-start { fill: var(--muted); font-size: 11px; font-weight: 700; }

.ds-ar6 {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--border-soft);
}
.ds-ar6 h3 { margin: 0 0 5px; color: var(--navy); font-size: 15px; }
.ds-ar6 p { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.ds-ar6-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ds-ar6-list li {
	display: inline-flex;
	align-items: baseline;
	gap: 7px;
	padding: 7px 11px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: #fbfaf7;
	color: var(--muted);
	font-size: 11.5px;
}
.ds-ar6-list strong { color: var(--navy); }

/* -------------------------------------------------------------------------
   Tax chart
   ------------------------------------------------------------------------- */
.ds-tax-summary {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 10px;
	margin: 4px 0 18px;
}
.ds-tax-summary > div {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 12px 13px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: #fbfaf7;
}
.ds-tax-summary span {
	color: var(--muted-2);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
	line-height: 1.3;
}
.ds-tax-summary strong {
	color: var(--navy);
	font-family: var(--font-display);
	font-size: 20px;
	line-height: 1.15;
}
.ds-tax-summary > div:nth-child(3) strong { color: var(--ds-accent); }
.ds-tax-summary > div:nth-child(5) strong { color: var(--brand-dark); }

.ds-bracket-visual { margin: 8px 0 16px; }
.ds-bracket-bar {
	display: flex;
	height: 52px;
	border-radius: 12px;
	overflow: hidden;
	background: #f1ede3;
	border: 1px solid var(--border);
}
.ds-bracket-seg {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 3px;
	overflow: hidden;
	font-size: 11px;
	font-weight: 800;
	color: #123;
	white-space: nowrap;
	transition: flex-basis .18s var(--ease);
}
.ds-bracket-seg span { padding: 0 3px; }
.ds-bracket-seg.is-tiny span { display: none; }
.ds-bracket-hint { margin: 8px 0 0; color: var(--muted-2); font-size: 11.5px; }

.ds-table-wrap { overflow-x: auto; margin-top: 4px; }
.ds-bracket-table {
	width: 100%;
	min-width: 520px;
	margin: 0;
	border-collapse: collapse;
	font-size: 12.5px;
}
.ds-bracket-table caption {
	caption-side: top;
	padding: 0 0 8px;
	color: var(--muted);
	font-size: 11px;
	text-align: left;
}
.ds-bracket-table th,
.ds-bracket-table td {
	padding: 9px 11px;
	border-bottom: 1px solid var(--border-soft);
	text-align: left;
	vertical-align: middle;
}
.ds-bracket-table thead th {
	background: #f6f8f7;
	color: var(--muted);
	font-size: 10px;
	letter-spacing: .05em;
	text-transform: uppercase;
}
.ds-bracket-table tbody tr:last-child th,
.ds-bracket-table tbody tr:last-child td { border-bottom: 0; }
.ds-bracket-table tbody th { display: flex; align-items: center; gap: 7px; color: var(--navy); font-weight: 700; }
.ds-bracket-table tbody td { color: var(--muted); }
.ds-bracket-table tr.is-active td { color: var(--navy); font-weight: 600; }
.ds-bracket-table tr.is-active { background: #fbfdfb; }
.ds-bracket-table tr.is-marginal { background: var(--ds-soft); }
.ds-bracket-table tr.is-marginal td,
.ds-bracket-table tr.is-marginal th { color: var(--navy); font-weight: 800; }
.ds-rate-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 3px;
}

/* Shared bracket palette (light to dark). */
.ds-rate-10 { background: #d7efe3; color: #123; }
.ds-rate-12 { background: #b3e0c8; color: #123; }
.ds-rate-22 { background: #86c9a7; color: #123; }
.ds-rate-24 { background: #58ad86; color: #fff; }
.ds-rate-32 { background: #2f8a64; color: #fff; }
.ds-rate-35 { background: #16704f; color: #fff; }
.ds-rate-37 { background: #094d3b; color: #fff; }
.ds-bracket-table .ds-rate-dot { border: 1px solid rgba(18, 35, 29, .12); }

/* -------------------------------------------------------------------------
   Life expectancy chart
   ------------------------------------------------------------------------- */
.ds-life-toolbar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 14px;
	margin: 2px 0 12px;
}
.ds-life-toolbar label { color: var(--navy); font-size: 12px; font-weight: 800; }
.ds-life-toolbar select {
	min-height: 38px;
	padding: 6px 32px 6px 11px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: #fff;
	color: var(--ink);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
}
.ds-life-toolbar select:focus { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.ds-life-hint { margin: 0; color: var(--muted-2); font-size: 11.5px; }

.ds-dot { cursor: pointer; outline: none; }
.ds-dot-halo { fill: transparent; transition: fill .15s var(--ease); }
.ds-dot-core { fill: var(--ds-accent); stroke: #fff; stroke-width: 2; transition: r .15s var(--ease); }
.ds-dot:hover .ds-dot-halo,
.ds-dot:focus-visible .ds-dot-halo,
.ds-dot.is-selected .ds-dot-halo { fill: rgba(178, 59, 80, .18); }
.ds-dot:hover .ds-dot-core,
.ds-dot:focus-visible .ds-dot-core,
.ds-dot.is-selected .ds-dot-core { r: 8; }
.ds-dot-label {
	fill: var(--navy);
	font-size: 10.5px;
	font-weight: 800;
	opacity: 0;
	pointer-events: none;
	paint-order: stroke;
	stroke: #fff;
	stroke-width: 3px;
	transition: opacity .15s var(--ease);
}
.ds-dot:hover .ds-dot-label,
.ds-dot:focus-visible .ds-dot-label,
.ds-dot.is-selected .ds-dot-label { opacity: 1; }

.ds-life-detail {
	margin-top: 16px;
	padding: 16px 18px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: #fbfaf7;
}
.ds-detail-name { margin: 0 0 10px; color: var(--navy); font-size: 15px; font-weight: 800; }
.ds-detail-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}
.ds-detail-grid > div { display: flex; flex-direction: column; gap: 2px; }
.ds-detail-grid span { color: var(--muted-2); font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.ds-detail-grid strong { color: var(--navy); font-family: var(--font-display); font-size: 19px; }
.ds-detail-note { margin: 12px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.5; }

/* -------------------------------------------------------------------------
   Method, sources, FAQ, related, disclaimer
   ------------------------------------------------------------------------- */
.ds-method,
.ds-sources {
	max-width: var(--ds-read);
	margin: 34px auto 0;
	padding: 22px 24px;
	border: 1px solid var(--border);
	border-radius: 18px;
	background: #fff;
}
.ds-method { border-left: 4px solid var(--ds-accent); background: #fbfdfb; }
.ds-data-note { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.ds-method ul { margin: 0; padding-left: 20px; }
.ds-method li { margin: 0 0 9px; color: #3f4f47; font-size: 13.5px; line-height: 1.6; }
.ds-sources ol { margin: 0; padding-left: 20px; }
.ds-sources li { margin: 0 0 11px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.ds-sources a { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.ds-source-note { display: block; color: var(--muted-2); font-size: 11.5px; }
.ds-source-meta { margin: 12px 0 0; color: var(--muted-2); font-size: 11px; }

.ds-faq {
	max-width: var(--ds-read);
	margin: 34px auto 0;
	padding: 22px 24px;
	border: 1px solid #cfe2d5;
	border-left: 4px solid var(--brand);
	border-radius: 14px;
	background: #f4faf6;
}
.ds-faq-item {
	border-top: 1px solid #d7e7dc;
}
.ds-faq-item:first-of-type { border-top: 0; }
.ds-faq-item summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 0;
	cursor: pointer;
	list-style: none;
}
.ds-faq-item summary::-webkit-details-marker { display: none; }
.ds-faq-item summary::after {
	content: "+";
	flex: 0 0 auto;
	color: var(--brand);
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
}
.ds-faq-item[open] summary::after { content: "−"; }
.ds-faq-item h3 { margin: 0; color: var(--navy); font-size: 15.5px; line-height: 1.45; }
.ds-faq-item p { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.7; }

.ds-related {
	max-width: var(--ds-shell);
	margin: 38px auto 0;
}
.ds-related-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}
.ds-related-card {
	display: flex;
	flex-direction: column;
	gap: 5px;
	padding: 16px 17px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: #fff;
	color: var(--ink);
	text-decoration: none;
	transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.ds-related-card:hover { border-color: var(--ds-accent); transform: translateY(-2px); }
.ds-related-type {
	color: var(--ds-accent);
	font-size: 9.5px;
	font-weight: 800;
	letter-spacing: .09em;
	text-transform: uppercase;
}
.ds-related-card strong { color: var(--navy); font-size: 15px; line-height: 1.3; }
.ds-related-card > span:last-child { color: var(--muted); font-size: 12px; line-height: 1.5; }
.ds-related-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 22px;
	margin: 16px 0 0;
	font-size: 12.5px;
	font-weight: 800;
}
.ds-related-links a { color: var(--brand-dark); }

.ds-disclaimer {
	max-width: var(--ds-read);
	margin: 26px auto 0;
	padding-top: 14px;
	border-top: 1px solid var(--border);
	color: var(--muted-2);
	font-size: 11px;
	line-height: 1.6;
}

/* -------------------------------------------------------------------------
   Index page
   ------------------------------------------------------------------------- */
.ds-hero-index { margin-bottom: 26px; }
.ds-story-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	max-width: var(--ds-shell);
}
.ds-story-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 250px;
	padding: 22px;
	border: 1px solid var(--border);
	border-radius: 20px;
	background: #fff;
	color: var(--ink);
	text-decoration: none;
	overflow: hidden;
	transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.ds-story-card::after {
	content: "";
	position: absolute;
	right: -52px;
	top: -62px;
	width: 160px;
	height: 160px;
	border-radius: 50%;
	background: var(--ds-soft);
	opacity: .9;
}
.ds-story-card:hover {
	border-color: var(--ds-accent);
	transform: translateY(-3px);
	box-shadow: 0 16px 34px rgba(18, 35, 29, .09);
}
.ds-story-top {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}
.ds-story-number {
	color: var(--ds-accent);
	font-family: var(--font-display);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: .08em;
}
.ds-story-tag {
	padding: 4px 9px;
	border-radius: 999px;
	background: var(--ds-soft);
	color: var(--ds-accent);
	font-size: 9px;
	font-weight: 800;
	letter-spacing: .08em;
}
.ds-story-title {
	position: relative;
	z-index: 1;
	margin: 22px 0 0;
	color: var(--navy);
	font-family: var(--font-display);
	font-size: 22px;
	line-height: 1.22;
	letter-spacing: -.03em;
}
.ds-story-desc {
	position: relative;
	z-index: 1;
	display: block;
	margin: 9px 0 18px;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.55;
}
.ds-story-source {
	position: relative;
	z-index: 1;
	margin-top: auto;
	color: var(--muted-2);
	font-size: 10.5px;
	font-weight: 700;
}
.ds-story-link {
	position: relative;
	z-index: 1;
	margin-top: 8px;
	color: var(--ds-accent);
	font-size: 12px;
	font-weight: 800;
}
.ds-index-note {
	max-width: var(--ds-shell);
	margin: 26px 0 0;
	padding: 22px 24px;
	border: 1px solid var(--border);
	border-radius: 18px;
	background: #fff;
}
.ds-index-note h2 { margin: 0 0 8px; color: var(--navy); font-size: 21px; }
.ds-index-note p { max-width: 780px; margin: 0 0 10px; color: var(--muted); font-size: 13.5px; line-height: 1.65; }
.ds-index-note p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------------------
   /fun/ data-stories cards section
   ------------------------------------------------------------------------- */
.lab-data-section {
	max-width: var(--ds-shell);
	margin: 36px 0 0;
	padding: 24px 26px 26px;
	border: 1px solid var(--border);
	border-radius: 22px;
	background: linear-gradient(135deg, #fbfdfb, #f6f1e9);
}
.lab-data-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 18px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}
.lab-data-head .lab-kicker { margin-bottom: 5px; }
.lab-data-head h2 {
	margin: 0 0 5px;
	color: var(--navy);
	font-family: var(--font-display);
	font-size: 26px;
	letter-spacing: -.03em;
}
.lab-data-head p { max-width: 660px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.lab-data-link {
	flex: 0 0 auto;
	color: var(--brand-dark);
	font-size: 12px;
	font-weight: 800;
	text-decoration: none;
	padding-bottom: 3px;
	border-bottom: 1px solid rgba(13, 107, 82, .3);
}
.lab-data-link:hover { border-bottom-color: var(--brand); }
.lab-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lab-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.lab-data-section .lab-card { min-height: 235px; }

/* -------------------------------------------------------------------------
   World in 100 people: stacked bar + region selector
   ------------------------------------------------------------------------- */
.ds-world-intro {
	max-width: 760px;
	margin: 0 0 4px;
	color: var(--muted);
	font-size: 13.5px;
	line-height: 1.6;
}
.ds-world-chart { margin-top: 6px; }
.ds-world-track { fill: #f0ebe2; }
.ds-world-seg {
	cursor: pointer;
	stroke: #fff;
	stroke-width: 1.5;
	transition: opacity .15s var(--ease), stroke .15s var(--ease);
}
.ds-world-seg:hover { opacity: .86; }
.ds-world-seg.is-selected { stroke: var(--navy); stroke-width: 2.5; }
.ds-world-seg:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.ds-world-seg-label {
	fill: #fff;
	font-family: var(--font-body);
	font-size: 15px;
	font-weight: 800;
	pointer-events: none;
}
.ds-world-axis line { stroke: #d9d3c7; stroke-width: 1; }
.ds-world-axis text { fill: var(--muted-2); font-family: var(--font-body); font-size: 11px; font-weight: 700; }
.ds-world-legend {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	margin: 14px 0 0;
}
.ds-world-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 42px;
	padding: 7px 10px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: #fff;
	color: var(--ink);
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	text-align: left;
	cursor: pointer;
	transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.ds-world-btn:hover { border-color: var(--ds-accent); }
.ds-world-btn.is-active { border-color: var(--ds-accent); background: var(--ds-soft); color: var(--navy); }
.ds-world-swatch { flex: 0 0 auto; width: 11px; height: 11px; border-radius: 3px; }
.ds-world-btn-label { flex: 1 1 auto; line-height: 1.25; }
.ds-world-btn-share { flex: 0 0 auto; color: var(--muted); font-size: 11px; font-weight: 800; }
.ds-world-btn.is-active .ds-world-btn-share { color: var(--ds-accent); }
.ds-world-detail {
	margin: 14px 0 0;
	padding: 16px 18px;
	border: 1px solid var(--border-soft);
	border-radius: 16px;
	background: #fbfaf7;
}
.ds-world-detail .ds-kicker { margin-bottom: 6px; }
.ds-world-detail-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 12px;
}
.ds-world-detail-head strong {
	color: var(--navy);
	font-family: var(--font-display);
	font-size: 22px;
	line-height: 1.2;
	letter-spacing: -.02em;
}
.ds-world-detail-head span { color: var(--muted); font-size: 12px; font-weight: 700; }
.ds-world-stats { display: flex; flex-wrap: wrap; gap: 14px 34px; margin: 10px 0 0; }
.ds-world-stats div { min-width: 96px; }
.ds-world-stats dt {
	margin: 0;
	color: var(--muted-2);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.ds-world-stats dd {
	margin: 2px 0 0;
	color: var(--navy);
	font-family: var(--font-display);
	font-size: 19px;
	font-weight: 800;
}
.ds-world-detail > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 1080px) {
	.ds-tax-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.lab-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.lab-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
	.ds-hero { padding: 26px 24px; }
	.ds-water-view { grid-template-columns: minmax(150px, 180px) minmax(0, 1fr); gap: 16px; }
	.ds-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ds-carbon-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.ds-carbon-stats strong { font-size: 20px; }
	.ds-story-grid { grid-template-columns: 1fr; }
	.lab-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
	.ds-interactive { padding: 18px 16px; border-radius: 18px; }
	.ds-hero { padding: 22px 18px; border-radius: 20px; }
	.ds-dek { font-size: 15.5px; }
	.ds-water-view { grid-template-columns: 1fr; }
	.ds-donut-wrap { max-width: 190px; margin: 0 auto; }
	.ds-donut-value { font-size: 22px; }
	.ds-carbon-stats { grid-template-columns: 1fr; }
	.ds-tax-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ds-chart-head { align-items: flex-start; }
	.ds-bracket-bar { height: 44px; }
	.ds-detail-grid { grid-template-columns: 1fr; }
	.ds-related-grid { grid-template-columns: 1fr; }
	.lab-data-section { padding: 18px; }
	.lab-data-section .lab-card { min-height: 0; }
	.lab-grid-4 { grid-template-columns: 1fr; }
	.lab-grid-5 { grid-template-columns: 1fr; }
	.ds-world-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ds-world-axis,
	.ds-world-seg-label { display: none; }
	.ds-method,
	.ds-sources,
	.ds-faq,
	.ds-index-note { padding: 18px; }
	.ds-section h2,
	.ds-method h2,
	.ds-sources h2,
	.ds-faq h2,
	.ds-related h2 { font-size: 23px; }
}

@media (max-width: 420px) {
	.ds-hero h1 { font-size: 1.85rem; }
	.ds-takeaway { padding: 16px 18px; }
	.ds-carbon-stats strong { font-size: 19px; }
	.ds-control-row { gap: 10px; }
	.ds-number-input input { width: 74px; }
}

@media (prefers-reduced-motion: reduce) {
	.ds-tab,
	.ds-btn-ghost,
	.ds-donut-seg,
	.ds-bracket-seg,
	.ds-story-card,
	.ds-related-card,
	.ds-dot-core,
	.ds-dot-halo,
	.ds-dot-label { transition: none; }
	.ds-story-card:hover,
	.ds-related-card:hover { transform: none; }
}

.ds-download{margin-left:auto;border:1px solid var(--border);border-radius:999px;background:#fff;color:var(--brand-dark);font:inherit;font-size:11px;font-weight:800;padding:6px 10px;cursor:pointer}
.ds-download:hover{border-color:var(--brand);background:#f6fbf8}

@media(max-width:640px){.ds-axis-label{font-size:25px}.ds-axis-title{font-size:23px}.ds-carbon-label,.ds-carbon-start{font-size:22px}}

/* Align data stories with the global shell */
.ds-story-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: var(--ds-shell); }
@media (max-width: 1080px) { .ds-story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .ds-story-grid { grid-template-columns: 1fr; } }
