.tsgpd-wrap {
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(249, 249, 246, 0.94)),
		radial-gradient(circle at top left, rgba(20, 72, 116, 0.08), transparent 35%);
	border-radius: 32px;
	color: #0b0f14;
	padding: 48px 28px;
}

.tsgpd-hero {
	background: rgba(255, 255, 255, 0.78);
	border-radius: 28px;
	margin-bottom: 28px;
	padding: 42px 28px;
	text-align: center;
}

.tsgpd-brand {
	color: #194d7b;
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(52px, 10vw, 120px);
	letter-spacing: 0.08em;
	line-height: 1;
}

.tsgpd-title {
	font-size: clamp(30px, 4vw, 54px);
	font-weight: 500;
	margin-top: 8px;
}

.tsgpd-hero-grid {
	align-items: center;
	display: grid;
	gap: 24px;
	grid-template-columns: minmax(220px, 320px) 1fr;
	margin-top: 30px;
}

.tsgpd-date-pill {
	background: #194d7b;
	border-radius: 999px;
	color: #fff;
	font-size: clamp(22px, 3vw, 38px);
	font-weight: 500;
	padding: 20px 24px;
}

.tsgpd-hero-prices {
	display: grid;
	gap: 24px;
	grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.tsgpd-hero-label {
	font-size: clamp(22px, 3vw, 36px);
	margin-bottom: 4px;
}

.tsgpd-hero-value {
	color: #194d7b;
	font-size: clamp(44px, 6vw, 84px);
	font-weight: 700;
	line-height: 1;
}

.tsgpd-card {
	background: rgba(255, 255, 255, 0.86);
	border-radius: 28px;
	margin-bottom: 24px;
	padding: 28px 24px;
}

.tsgpd-card-head,
.tsgpd-row {
	align-items: center;
	column-gap: 20px;
	display: grid;
	grid-template-columns: minmax(260px, 1.6fr) repeat(3, minmax(100px, 0.34fr));
}

.tsgpd-card-head {
	color: #8b8b8b;
	font-size: clamp(18px, 2.5vw, 34px);
	margin-bottom: 18px;
}

.tsgpd-card-body {
	display: grid;
	gap: 16px;
}

.tsgpd-row {
	font-size: clamp(24px, 3vw, 58px);
	line-height: 1.1;
}

.tsgpd-col-price {
	text-align: center;
}

.tsgpd-error {
	background: #fff4f1;
	border: 1px solid #e8b5aa;
	border-radius: 16px;
	color: #8b1e00;
	padding: 16px 18px;
}

.tsgpd-empty {
	background: rgba(255, 255, 255, 0.86);
	border-radius: 20px;
	color: #52606d;
	padding: 24px;
	text-align: center;
}

.tsgpd-brand-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 20px;
}

.tsgpd-brand-filter a {
	border: 1px solid rgba(25, 77, 123, 0.18);
	border-radius: 999px;
	color: #194d7b;
	padding: 10px 16px;
	text-decoration: none;
	transition: all 0.18s ease;
}

.tsgpd-brand-filter a.active,
.tsgpd-brand-filter a:hover {
	background: #194d7b;
	border-color: #194d7b;
	color: #fff;
}

.tsgpd-grid-refresh {
	position: relative;
}

.tsgpd-grid-refresh__header {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 14px;
}

.tsgpd-grid-refresh__status {
	background: rgba(25, 77, 123, 0.1);
	border: 1px solid rgba(25, 77, 123, 0.12);
	border-radius: 999px;
	color: #194d7b;
	font-size: 14px;
	font-weight: 600;
	padding: 8px 14px;
}

.tsgpd-grid-refresh__status span {
	display: inline-block;
	font-variant-numeric: tabular-nums;
	margin-left: 6px;
	min-width: 40px;
}

.tsgpd-grid {
	display: grid;
	gap: 22px;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tsgpd-grid-card {
	overflow: hidden;
}

.tsgpd-grid-card__link {
	color: inherit;
	display: block;
	height: 100%;
	text-decoration: none;
}

.tsgpd-grid-card__link:focus-visible {
	outline: 2px solid rgba(25, 77, 123, 0.4);
	outline-offset: 6px;
}

.tsgpd-grid-card__image {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	margin-bottom: 16px;
	overflow: hidden;

	/* IMPORTANT: prevents flex blur scaling */
	position: relative;
}

/* FRAME */
.tsgpd-grid-card__image-frame {
	width: 100%;
	height: 100%;
}

/* FLIP ENABLED */
.tsgpd-grid-card__image-frame.has-rear-image {
	perspective: 1200px;
	width: 100%;
	height: 100%;
}

/* INNER FLIP WRAPPER */
.tsgpd-grid-card__image-frame.has-rear-image .flip-inner {
	width: 100%;
	height: 100%;
	position: relative;
	transform-style: preserve-3d;
	transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);

	/* helps reduce blur during transform */
	will-change: transform;
}

/* FRONT + BACK */
.tsgpd-grid-card__image-frame.has-rear-image .front,
.tsgpd-grid-card__image-frame.has-rear-image .back {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;

	/* 🔥 KEY FIX: sharper rendering */
	object-fit: cover;
	transform: translateZ(0);
	backface-visibility: hidden;

	display: block;
}

/* BACK FACE */
.tsgpd-grid-card__image-frame.has-rear-image .back {
	transform: rotateY(180deg) translateZ(0);
	background-size: cover;
	background-position: center;
}

/* HOVER FLIP */
.tsgpd-grid-card__image-frame.has-rear-image:hover .flip-inner {
	transform: rotateY(180deg);
}
.tsgpd-grid-card__title {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
	margin-bottom: 12px;
}

.tsgpd-grid-card__prices {
	display: grid;
	gap: 8px;
}

.tsgpd-grid-card__prices div {
	color: #334155;
	font-size: 15px;
}

.tsgpd-gold-calculator {
	max-width: 760px;
}

.tsgpd-gold-calculator-open {
	overflow: hidden;
}

.tsgpd-gold-calculator__trigger,
.tsgpd-gold-calculator__close,
.tsgpd-gold-calculator__choice,
.tsgpd-gold-calculator__button,
.tsgpd-gold-calculator__input {
	font: inherit;
}

.tsgpd-gold-calculator__trigger {
	background: transparent;
	border: 1px solid currentColor;
	border-radius: 6px;
	cursor: pointer;
	padding: 10px 16px;
}

.tsgpd-gold-calculator__panel[hidden] {
	display: none;
}

.tsgpd-gold-calculator__panel {
	align-items: center;
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 24px;
	position: fixed;
	z-index: 9999;
}

.tsgpd-gold-calculator__backdrop {
	background: rgba(15, 23, 42, 0.45);
	inset: 0;
	position: absolute;
}

.tsgpd-gold-calculator__shell {
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 250, 252, 0.96)),
		radial-gradient(circle at top right, rgba(177, 20, 20, 0.08), transparent 30%);
	border: 1px solid rgba(148, 163, 184, 0.2);
	border-radius: 28px;
	box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
	max-height: min(90vh, 820px);
	max-width: 760px;
	overflow: hidden;
	position: relative;
	width: 100%;
	z-index: 1;
}

.tsgpd-gold-calculator__header {
	align-items: start;
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	justify-content: space-between;
	padding: 22px 24px 0;
}

.tsgpd-gold-calculator__eyebrow {
	color: #8b1e00;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	margin-bottom: 6px;
	text-transform: uppercase;
}

.tsgpd-gold-calculator__header h3 {
	color: #0f172a;
	font-size: clamp(26px, 4vw, 34px);
	line-height: 1.1;
	margin: 0;
}

.tsgpd-gold-calculator__header-actions {
	align-items: start;
	display: flex;
	gap: 12px;
}

.tsgpd-gold-calculator__sync {
	color: #475569;
	font-size: 13px;
	line-height: 1.6;
	text-align: right;
}

.tsgpd-gold-calculator__close {
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid rgba(148, 163, 184, 0.28);
	border-radius: 999px;
	cursor: pointer;
	font-size: 24px;
	height: 40px;
	line-height: 1;
	padding: 0;
	width: 40px;
}

.tsgpd-gold-calculator__result {
	background: linear-gradient(135deg, #7f1010, #b11616);
	color: #fff;
	margin: 20px 24px 0;
	padding: 24px;
}

.tsgpd-gold-calculator__mode-label {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	margin-bottom: 10px;
	opacity: 0.86;
	text-transform: uppercase;
}

.tsgpd-gold-calculator__summary {
	font-size: clamp(24px, 5vw, 36px);
	line-height: 1.15;
}

.tsgpd-gold-calculator__total {
	font-size: clamp(38px, 7vw, 60px);
	font-weight: 700;
	line-height: 1;
	margin-top: 10px;
}

.tsgpd-gold-calculator__note {
	font-size: 14px;
	margin-top: 12px;
	opacity: 0.9;
}

.tsgpd-gold-calculator__section {
	padding: 22px 24px 0;
}

.tsgpd-gold-calculator__label {
	color: #64748b;
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 10px;
}

.tsgpd-gold-calculator__choices {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.tsgpd-gold-calculator__choice,
.tsgpd-gold-calculator__button {
	appearance: none;
	border-radius: 16px;
	cursor: pointer;
	transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.tsgpd-gold-calculator__choice {
	background: #fff;
	border: 1px solid rgba(148, 163, 184, 0.32);
	color: #0f172a;
	font-size: 17px;
	font-weight: 600;
	min-height: 56px;
	padding: 14px 16px;
}

.tsgpd-gold-calculator__choice.is-active {
	background: rgba(127, 16, 16, 0.08);
	border-color: #991b1b;
	box-shadow: 0 10px 24px rgba(153, 27, 27, 0.12);
	color: #7f1010;
	transform: translateY(-1px);
}

.tsgpd-gold-calculator__input {
	background: #fff;
	border: 1px solid rgba(148, 163, 184, 0.32);
	border-radius: 16px;
	color: #0f172a;
	font-size: 24px;
	font-weight: 600;
	min-height: 62px;
	padding: 0 18px;
	width: 100%;
}

.tsgpd-gold-calculator__actions {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	padding: 24px;
}

.tsgpd-gold-calculator__button {
	border: 1px solid #991b1b;
	font-size: 16px;
	font-weight: 700;
	min-height: 56px;
	padding: 0 18px;
}

.tsgpd-gold-calculator__button--secondary {
	background: #fff;
	color: #991b1b;
}

.tsgpd-gold-calculator__button:not(.tsgpd-gold-calculator__button--secondary) {
	background: #991b1b;
	color: #fff;
}

.tsgpd-gold-calculator__choice:hover,
.tsgpd-gold-calculator__button:hover {
	transform: translateY(-1px);
}

@media (max-width: 900px) {
	.tsgpd-wrap {
		padding: 24px 16px;
	}

	.tsgpd-hero-grid {
		grid-template-columns: 1fr;
	}

	.tsgpd-hero-prices {
		grid-template-columns: 1fr;
	}

	.tsgpd-card-head,
	.tsgpd-row {
		grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(72px, 0.5fr));
	}

	.tsgpd-grid-refresh__header {
		justify-content: flex-start;
	}

	.tsgpd-gold-calculator__panel {
		padding: 16px;
	}

	.tsgpd-gold-calculator__header {
		padding: 20px 18px 0;
	}

	.tsgpd-gold-calculator__sync {
		text-align: left;
	}

	.tsgpd-gold-calculator__result,
	.tsgpd-gold-calculator__section {
		margin-left: 18px;
		margin-right: 18px;
		padding-left: 0;
		padding-right: 0;
	}

	.tsgpd-gold-calculator__result {
		padding: 22px 18px;
		margin-left: 18px;
		margin-right: 18px;
	}

	.tsgpd-gold-calculator__actions {
		grid-template-columns: 1fr;
		padding: 20px 18px 24px;
	}
}
