.ld-bs-summary,
.ld-bs-recap,
.ld-bs-history {
	--ld-bs-border: var(--e-global-color-8740bdc, #d4d6dd);
	--ld-bs-surface: var(--e-global-color-fd3684d, #fff);
	--ld-bs-surface-soft: var(--e-global-color-9ba614a, #f3f1f8);
	--ld-bs-text: var(--e-global-color-text, #26212c);
	--ld-bs-muted: var(--e-global-color-b10888f, #5f5f5f);
	--ld-bs-accent: var(--e-global-color-accent, #6920b0);
	--ld-bs-primary: var(--e-global-color-primary, #2330a4);
	--ld-bs-code: var(--ld-bs-primary);
	--ld-bs-offer: var(--ld-bs-accent);
	--ld-bs-focus: var(--e-global-color-primary, #2330a4);
	--ld-bs-warm: #d63664;
	color: var(--ld-bs-text);
	font: inherit;
}

.ld-bs-summary {
	border-radius: 14px;
	background: transparent;
}

.ld-bs-summary__title {
	margin: 0 0 .85rem;
	color: var(--ld-bs-primary);
	font: inherit;
	font-size: clamp(.92rem, 1.6vw, 1.05rem);
	font-weight: 700;
	line-height: 1.3;
}

.ld-bs-history__title {
	margin: 0 0 1rem;
	font: inherit;
	font-size: clamp(1.15rem, 2vw, 1.45rem);
	font-weight: 700;
}

.ld-bs-summary__stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(.55rem, 1vw, .8rem);
	margin: 0;
}

.ld-bs-summary__stat {
	display: grid;
	grid-template-columns: 2rem minmax(0, 1fr);
	grid-template-rows: auto 1fr;
	gap: .65rem .7rem;
	align-content: start;
	min-width: 0;
	min-height: 136px;
	padding: clamp(1.05rem, 1.8vw, 1.3rem);
	border: 1px solid var(--ld-bs-border);
	border-radius: 11px;
	background: var(--ld-bs-surface);
	box-shadow: 0 3px 12px rgb(35 48 164 / 5%);
}

.ld-bs-summary__stat dt {
	display: contents;
}

.ld-bs-summary__icon {
	grid-column: 1;
	grid-row: 1;
	width: 2rem;
	height: 2rem;
	align-self: center;
}

.ld-bs-summary__icon--codes,
.ld-bs-summary__icon--best {
	color: var(--ld-bs-primary);
}

.ld-bs-summary__icon--offers {
	color: var(--ld-bs-accent);
}

.ld-bs-summary__icon--expiring {
	color: var(--ld-bs-warm);
}

.ld-bs-summary__label {
	grid-column: 1 / -1;
	grid-row: 2;
	align-self: start;
	color: var(--ld-bs-muted);
	font-size: clamp(.78rem, 1.1vw, .86rem);
	font-weight: 500;
	line-height: 1.4;
}

.ld-bs-summary__stat dd {
	grid-column: 2;
	grid-row: 1;
	align-self: center;
	margin: 0;
	color: var(--ld-bs-text);
	font-size: clamp(1.45rem, 2.4vw, 1.7rem);
	font-weight: 700;
	line-height: 1;
}

.ld-bs-recap {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: clamp(1.25rem, 3vw, 2rem);
	align-items: stretch;
	padding: clamp(1.1rem, 2.5vw, 1.5rem);
	border: 1px solid var(--ld-bs-border);
	border-radius: 14px;
	background: var(--ld-bs-surface-soft);
}

.ld-bs-recap--with-insight {
	grid-template-columns: minmax(0, 7fr) minmax(205px, 3fr);
}

.ld-bs-recap__main {
	min-width: 0;
}

.ld-bs-recap__title {
	display: flex;
	gap: .65rem;
	align-items: center;
	margin: 0 0 .75rem;
	color: var(--ld-bs-primary);
	font: inherit;
	font-size: clamp(1rem, 1.8vw, 1.18rem);
	font-weight: 700;
	line-height: 1.3;
}

.ld-bs-recap__title-icon {
	display: inline-flex;
	flex: 0 0 auto;
	color: var(--ld-bs-accent);
}

.ld-bs-recap__title-icon svg {
	width: 1.65rem;
	height: 1.65rem;
}

.ld-bs-recap__current,
.ld-bs-recap__comparison {
	max-width: 76ch;
	margin: 0;
	color: var(--ld-bs-text);
	font-size: clamp(.82rem, 1.3vw, .92rem);
	line-height: 1.58;
}

.ld-bs-recap__comparison {
	margin-top: .65rem;
	color: var(--ld-bs-muted);
}

.ld-bs-recap__insight {
	display: flex;
	flex-direction: column;
	gap: .75rem;
	align-items: center;
	justify-content: center;
	min-width: 0;
	padding-left: clamp(1.1rem, 2.5vw, 1.7rem);
	border-left: 1px solid var(--ld-bs-border);
	color: var(--ld-bs-primary);
	text-align: center;
}

.ld-bs-recap__insight-icon {
	display: grid;
	width: 3.4rem;
	height: 3.4rem;
	place-items: center;
	border: 1px solid var(--ld-bs-border);
	border-radius: 50%;
	background: var(--ld-bs-surface);
	color: var(--ld-bs-accent);
}

.ld-bs-recap__insight-icon svg {
	width: 1.75rem;
	height: 1.75rem;
}

.ld-bs-recap__insight strong {
	max-width: 24ch;
	font-size: .8rem;
	font-weight: 700;
	line-height: 1.45;
}

.ld-bs-history {
	position: relative;
	contain: layout style;
}

.ld-bs-history__description {
	max-width: 72ch;
	margin: -.5rem 0 0;
	color: var(--ld-bs-muted);
	font-size: .9rem;
}

.ld-bs-history__ranges {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin-top: 1.5rem;
	margin-bottom: 1rem;
}

.ld-bs-history__range {
	appearance: none;
	padding: .5rem .8rem;
	border: 1px solid var(--ld-bs-border);
	border-radius: 999px;
	background: var(--ld-bs-surface-soft);
	color: inherit;
	font: inherit;
	font-size: .85rem;
	cursor: pointer;
	transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.ld-bs-history__range:hover {
	border-color: var(--ld-bs-accent);
	color: var(--ld-bs-accent);
}

.ld-bs-history__range:active {
	transform: scale(.98);
}

.ld-bs-history__range[aria-pressed="true"] {
	border-color: var(--ld-bs-accent);
	background: var(--ld-bs-accent);
	color: #fff;
}

.ld-bs-history__range[aria-pressed="true"]:hover {
	color: #fff;
}

.ld-bs-history__range:focus-visible,
.ld-bs-history__series-toggle:focus-visible,
.ld-bs-history__chart:focus-visible,
.ld-bs-history__tooltip-close:focus-visible,
.ld-bs-history__table-wrap summary:focus-visible {
	outline: 3px solid var(--ld-bs-focus);
	outline: 3px solid color-mix(in srgb, var(--ld-bs-focus) 45%, transparent);
	outline-offset: 2px;
}

.ld-bs-history__chart {
	position: relative;
	width: 100%;
	min-height: 320px;
	aspect-ratio: 16 / 7;
	overflow: hidden;
	border: 1px solid var(--ld-bs-border);
	border-radius: 14px;
	background: var(--ld-bs-surface);
	box-shadow: 0 8px 24px rgb(35 48 164 / 7%);
	touch-action: pan-y;
}

.ld-bs-history__chart-wrap {
	position: relative;
}

.ld-bs-history__legend {
	display: flex;
	flex-wrap: wrap;
	gap: .65rem 1rem;
	align-items: center;
	justify-content: flex-end;
	padding: 0;
	margin: 0 0 .75rem;
	color: var(--ld-bs-text);
	font-size: .82rem;
}

.ld-bs-history__series-toggle {
	appearance: none;
	display: inline-flex;
	gap: .4rem;
	align-items: center;
	min-height: 40px;
	padding: .4rem .6rem;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
	transition: background-color 150ms ease, opacity 150ms ease;
}

.ld-bs-history__series-toggle:hover {
	background: var(--ld-bs-surface-soft);
}

.ld-bs-history__series-toggle[aria-pressed="false"] {
	opacity: .48;
}

.ld-bs-history__legend-swatch,
.ld-bs-history__tooltip-swatch {
	width: .7rem;
	height: .7rem;
	flex: 0 0 auto;
	border-radius: 50%;
}

.ld-bs-history__legend-swatch--code,
.ld-bs-history__tooltip-swatch--code {
	background: var(--ld-bs-code);
}

.ld-bs-history__legend-swatch--offer,
.ld-bs-history__tooltip-swatch--offer {
	background: var(--ld-bs-offer);
}

.ld-bs-history__svg {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 320px;
}

.ld-bs-history__grid {
	stroke: var(--ld-bs-border);
	stroke-width: 1;
	stroke-opacity: .72;
}

.ld-bs-history__axis-label {
	fill: var(--ld-bs-muted);
	font-size: 12px;
}

.ld-bs-history__line {
	fill: none;
	stroke-width: 3.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ld-bs-history__line--code {
	stroke: var(--ld-bs-code);
}

.ld-bs-history__line--offer {
	stroke: var(--ld-bs-offer);
}

.ld-bs-history__point {
	stroke: var(--ld-bs-surface);
	stroke-width: 1;
}

.ld-bs-history__point--zero {
	fill: var(--ld-bs-surface);
	stroke-width: 2;
}

.ld-bs-history__point--code {
	fill: var(--ld-bs-code);
}

.ld-bs-history__point--offer {
	fill: var(--ld-bs-offer);
}

.ld-bs-history__guide {
	stroke: var(--ld-bs-muted);
	stroke-width: 1;
	stroke-dasharray: 4 4;
}

.ld-bs-history__marker {
	fill: var(--ld-bs-surface);
	stroke-width: 3;
}

.ld-bs-history__marker--code {
	stroke: var(--ld-bs-code);
}

.ld-bs-history__marker--offer {
	stroke: var(--ld-bs-offer);
}

.ld-bs-history__tooltip {
	position: absolute;
	z-index: 2;
	box-sizing: border-box;
	max-width: min(340px, calc(100% - 24px));
	padding: .7rem .8rem;
	border: 1px solid var(--ld-bs-border);
	border-radius: 10px;
	background: var(--ld-bs-surface);
	color: var(--ld-bs-text);
	font-size: .82rem;
	line-height: 1.4;
	max-height: calc(100% - 24px);
	overflow-y: auto;
	overscroll-behavior: contain;
	pointer-events: none;
	box-shadow: 0 10px 30px rgb(0 0 0 / 16%);
}

.ld-bs-history__tooltip-content {
	display: grid;
	gap: .65rem;
}

.ld-bs-history__tooltip-date {
	display: block;
	padding-bottom: .45rem;
	border-bottom: 1px solid var(--ld-bs-border);
	font-size: .86rem;
}

.ld-bs-history__tooltip-row {
	display: grid;
	grid-template-columns: .7rem minmax(0, 1fr);
	gap: .55rem;
	align-items: start;
}

.ld-bs-history__tooltip-swatch {
	margin-top: .25rem;
}

.ld-bs-history__tooltip-headline,
.ld-bs-history__tooltip-detail,
.ld-bs-history__tooltip-events {
	display: block;
}

.ld-bs-history__tooltip-headline {
	font-weight: 600;
}

.ld-bs-history__tooltip-detail,
.ld-bs-history__tooltip-events {
	margin-top: .15rem;
	color: var(--ld-bs-muted);
	font-size: .76rem;
}

.ld-bs-history__tooltip[hidden],
.ld-bs-history__guide[hidden],
.ld-bs-history__marker[hidden] {
	display: none;
}

.ld-bs-history__tooltip-close {
	display: none;
	float: right;
	margin: -.25rem -.25rem .25rem .5rem;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
	pointer-events: auto;
}

.ld-bs-history__tooltip--pinned .ld-bs-history__tooltip-close {
	display: block;
}

.ld-bs-history__tooltip--pinned {
	pointer-events: auto;
}

.ld-bs-history__empty-chart {
	display: grid;
	min-height: 320px;
	place-items: center;
	padding: 1rem;
	color: var(--ld-bs-muted);
	text-align: center;
}

.ld-bs-history__empty {
	padding: 1rem;
	border: 1px solid var(--ld-bs-border);
	border-radius: 12px;
	background: var(--ld-bs-surface-soft);
	color: var(--ld-bs-muted);
}

.ld-bs-history__live {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ld-bs-history__events {
	margin-top: 1rem;
}

.ld-bs-history__events-title {
	margin: 0 0 .5rem;
	font-size: .95rem;
}

.ld-bs-history__events ul {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	padding: 0;
	margin: 0;
	list-style: none;
}

.ld-bs-history__events li {
	display: flex;
	gap: .4rem;
	padding: .4rem .65rem;
	border: 1px solid var(--ld-bs-border);
	border-radius: 8px;
	background: var(--ld-bs-surface-soft);
	color: var(--ld-bs-text);
	font-size: .8rem;
}

.ld-bs-history__events time {
	color: var(--ld-bs-muted);
}

.ld-bs-history__table-wrap {
	margin-top: 1rem;
}

.ld-bs-history__table-wrap summary {
	color: var(--ld-bs-text);
	cursor: pointer;
	font-weight: 600;
}

.ld-bs-history__table {
	width: 100%;
	margin-top: .75rem;
	border-collapse: collapse;
	font-size: .85rem;
}

.ld-bs-history__table th,
.ld-bs-history__table td {
	padding: .65rem;
	border-bottom: 1px solid var(--ld-bs-border);
	text-align: left;
	vertical-align: top;
}

.ld-bs-history__table td {
	color: var(--ld-bs-text);
}

.ld-bs-history__table th {
	color: var(--ld-bs-muted);
	font-weight: 600;
}

@media (max-width: 767px) {
	.ld-bs-summary__stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ld-bs-recap--with-insight {
		grid-template-columns: minmax(0, 1fr);
		gap: 1rem;
	}

	.ld-bs-recap__insight {
		flex-direction: row;
		justify-content: flex-start;
		padding-top: 1rem;
		padding-left: 0;
		border-top: 1px solid var(--ld-bs-border);
		border-left: 0;
		text-align: left;
	}

	.ld-bs-recap__insight-icon {
		width: 3rem;
		height: 3rem;
		flex: 0 0 auto;
	}

	.ld-bs-recap__insight strong {
		max-width: 34ch;
	}
}

@media (max-width: 600px) {
	.ld-bs-history__tooltip {
		max-width: min(280px, calc(100% - 24px));
		padding: .6rem .65rem;
		font-size: .74rem;
		line-height: 1.32;
	}

	.ld-bs-history__tooltip-content {
		gap: .45rem;
	}

	.ld-bs-history__tooltip-date {
		padding-bottom: .35rem;
		font-size: .8rem;
	}

	.ld-bs-history__tooltip-row {
		gap: .4rem;
	}

	.ld-bs-history__tooltip-close {
		width: 32px;
		height: 32px;
		margin: -.3rem -.3rem 0 .35rem;
	}

	.ld-bs-history__range {
		min-height: 44px;
	}

	.ld-bs-history__legend {
		gap: .35rem;
		justify-content: flex-start;
	}

	.ld-bs-history__series-toggle {
		min-height: 44px;
		padding-inline: .5rem;
	}

	.ld-bs-history__chart,
	.ld-bs-history__svg,
	.ld-bs-history__empty-chart {
		min-height: 280px;
		aspect-ratio: auto;
	}

	.ld-bs-history__table-wrap {
		overflow-x: auto;
	}

	.ld-bs-history__table {
		min-width: 720px;
	}
}

@media (max-width: 360px) {
	.ld-bs-summary__stats {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ld-bs-history *,
	.ld-bs-history *::before,
	.ld-bs-history *::after {
		scroll-behavior: auto;
		transition-duration: .01ms;
	}
}
