.co2nw-root {
	position: fixed;
	right: 0;
	top: 50%;
	z-index: 99999;
	transform: translateY(-50%);
	pointer-events: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	-webkit-font-smoothing: antialiased;
}

.co2nw-inner {
	position: relative;
	pointer-events: auto;
}

/* Panel */
.co2nw-panel {
	position: absolute;
	right: 100%;
	top: 50%;
	width: min(calc(100vw - 4rem), 20rem);
	overflow: hidden;
	border-radius: 1rem 0 0 1rem;
	border: 1px solid #c8e6c9;
	border-right: none;
	background: #fff;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
		opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1),
		visibility 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.co2nw-panel-open {
	opacity: 1;
	transform: translateY(-50%) translateX(0);
	visibility: visible;
	pointer-events: auto;
}

.co2nw-panel-closed {
	opacity: 0;
	transform: translateY(-50%) translateX(0.75rem);
	visibility: hidden;
	pointer-events: none;
}

/* Header */
.co2nw-header {
	background: #3d8b40;
	padding: 1.5rem 1.25rem 1.25rem;
	text-align: center;
	color: #fff;
}

.co2nw-icon-tree {
	display: block;
	margin: 0 auto;
	opacity: 0.9;
}

.co2nw-trees-count {
	margin-top: 0.75rem;
	font-size: 2.25rem;
	font-weight: 800;
	line-height: 1;
}

.co2nw-trees-label {
	margin-top: 0.25rem;
	font-size: 0.875rem;
	font-weight: 500;
	opacity: 0.95;
}

.co2nw-badge {
	display: inline-block;
	margin-top: 1rem;
	padding: 0.375rem 1rem;
	border-radius: 9999px;
	background: #2d6a30;
	font-size: 0.75rem;
	font-weight: 600;
}

/* Metrics */
.co2nw-metrics {
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.co2nw-metric-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 0.75rem;
}

.co2nw-metric-label {
	font-weight: 500;
	color: #1a1a1a;
}

.co2nw-metric-value {
	font-weight: 700;
	color: #3d8b40;
}

.co2nw-progress-track {
	margin-top: 0.375rem;
	height: 0.5rem;
	overflow: hidden;
	border-radius: 9999px;
	background: #e8f5e9;
}

.co2nw-progress-bar {
	height: 100%;
	border-radius: 9999px;
	background: #4caf50;
	transition: width 0.4s ease;
}

/* Footprint */
.co2nw-footprint {
	margin: 0 1.25rem 1.25rem;
	padding: 1rem;
	border-radius: 0.75rem;
	border: 1px solid #e5e5e5;
	background: rgba(245, 245, 245, 0.5);
}

.co2nw-footprint-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: #1a1a1a;
}

.co2nw-icon-leaf-sm {
	color: #4caf50;
	flex-shrink: 0;
}

.co2nw-gradient-track {
	position: relative;
	margin-top: 0.75rem;
	height: 0.5rem;
	overflow: hidden;
	border-radius: 9999px;
}

.co2nw-gradient-bar {
	position: absolute;
	inset: 0;
	background: linear-gradient(to right, #4caf50, #cddc39 50%, #ff9800);
}

.co2nw-gradient-marker {
	position: absolute;
	left: 8%;
	top: 50%;
	width: 0.75rem;
	height: 0.75rem;
	transform: translateY(-50%);
	border-radius: 9999px;
	border: 2px solid #fff;
	background: #4caf50;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.co2nw-gradient-labels {
	margin-top: 0.5rem;
	display: flex;
	justify-content: space-between;
	font-size: 10px;
	color: #737373;
}

/* Footer */
.co2nw-footer {
	border-top: 1px solid #e5e5e5;
	padding: 1rem 1.25rem;
	text-align: center;
}

.co2nw-cert {
	margin: 0;
	font-size: 10px;
	line-height: 1.625;
	color: #737373;
}

.co2nw-link {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	margin-top: 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: #3d8b40;
	text-decoration: none;
}

.co2nw-link:hover {
	text-decoration: underline;
}

.co2nw-icon-external {
	flex-shrink: 0;
}

/* Tab button */
.co2nw-tab {
	position: relative;
	z-index: 10;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	width: 3rem;
	padding: 1.5rem 0;
	border: none;
	border-radius: 0.75rem 0 0 0.75rem;
	background: #4caf50;
	color: #fff;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
	cursor: pointer;
	transition: transform 0.2s ease-out, background-color 0.2s ease-out;
}

.co2nw-tab:hover {
	background: #43a047;
}

.co2nw-tab:active {
	transform: scale(0.98);
}

.co2nw-tab-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	writing-mode: vertical-rl;
	text-orientation: mixed;
}

@media (prefers-reduced-motion: reduce) {
	.co2nw-panel,
	.co2nw-tab,
	.co2nw-progress-bar {
		transition: none;
	}
}

@media (max-width: 480px) {
	.co2nw-panel {
		width: min(calc(100vw - 3.5rem), 18rem);
	}
}

/*
 * Theme buttons and svg rules must not restyle the widget.
 * Higher specificity plus !important keeps the green tab and the tree icon intact.
 */
.co2nw-root button.co2nw-tab,
.co2nw-root button.co2nw-tab:hover,
.co2nw-root button.co2nw-tab:focus,
.co2nw-root button.co2nw-tab:focus-visible,
.co2nw-root button.co2nw-tab:active {
	appearance: none !important;
	-webkit-appearance: none !important;
	position: relative !important;
	z-index: 10 !important;
	display: flex !important;
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 0.75rem !important;
	box-sizing: border-box !important;
	width: 3rem !important;
	min-width: 3rem !important;
	max-width: 3rem !important;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 1.5rem 0 !important;
	border: 0 !important;
	border-radius: 0.75rem 0 0 0.75rem !important;
	background: #4caf50 !important;
	background-color: #4caf50 !important;
	background-image: none !important;
	color: #fff !important;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-decoration: none !important;
	cursor: pointer !important;
	overflow: visible !important;
}

.co2nw-root button.co2nw-tab:hover {
	background: #43a047 !important;
	background-color: #43a047 !important;
}

.co2nw-root .co2nw-tab-label {
	display: block !important;
	color: #fff !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	letter-spacing: 0.2em !important;
	text-transform: uppercase !important;
	writing-mode: vertical-rl !important;
	text-orientation: mixed !important;
	white-space: nowrap !important;
}

.co2nw-root .co2nw-header {
	background: #3d8b40 !important;
	background-color: #3d8b40 !important;
	background-image: none !important;
	color: #fff !important;
}

.co2nw-root .co2nw-badge {
	background: #2d6a30 !important;
	background-color: #2d6a30 !important;
	color: #fff !important;
}

.co2nw-root svg.co2nw-icon {
	display: block !important;
	flex: 0 0 auto !important;
	box-sizing: content-box !important;
	overflow: visible !important;
	max-width: none !important;
	max-height: none !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

.co2nw-root svg.co2nw-icon-tree {
	width: 36px !important;
	height: 36px !important;
	min-width: 36px !important;
	min-height: 36px !important;
	color: #fff !important;
}

.co2nw-root svg.co2nw-icon-tree path {
	fill: currentColor !important;
	stroke: none !important;
}

.co2nw-root svg.co2nw-icon-leaf,
.co2nw-root svg.co2nw-icon-leaf-sm,
.co2nw-root svg.co2nw-icon-external {
	fill: none !important;
	stroke: currentColor !important;
}

.co2nw-root svg.co2nw-icon-leaf {
	width: 20px !important;
	height: 20px !important;
	min-width: 20px !important;
	min-height: 20px !important;
	color: #fff !important;
}

.co2nw-root svg.co2nw-icon-leaf-sm {
	width: 14px !important;
	height: 14px !important;
	min-width: 14px !important;
	min-height: 14px !important;
	margin: 0 !important;
	color: #4caf50 !important;
}

.co2nw-root svg.co2nw-icon-external {
	width: 12px !important;
	height: 12px !important;
	min-width: 12px !important;
	min-height: 12px !important;
	margin: 0 !important;
	color: #3d8b40 !important;
}

.co2nw-root svg.co2nw-icon-leaf path,
.co2nw-root svg.co2nw-icon-leaf-sm path,
.co2nw-root svg.co2nw-icon-external path {
	fill: none !important;
	stroke: currentColor !important;
	stroke-width: 2 !important;
	stroke-linecap: round !important;
	stroke-linejoin: round !important;
}
