.goldapi-widget {
	box-sizing: border-box;
	max-width: 100%;
	color: inherit;
	font: inherit;
}

.goldapi-widget *,
.goldapi-widget *::before,
.goldapi-widget *::after {
	box-sizing: border-box;
}

.goldapi-layout-card {
	border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
	border-radius: 8px;
	padding: 16px;
	background: color-mix(in srgb, Canvas 96%, currentColor 4%);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.goldapi-metal {
	font-size: 0.875rem;
	font-weight: 600;
	opacity: 0.78;
}

.goldapi-main {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: baseline;
}

.goldapi-layout-card .goldapi-main {
	margin-top: 0.35rem;
}

.goldapi-symbol {
	font-weight: 700;
}

.goldapi-price-value {
	font-size: 1.65rem;
	font-weight: 700;
	line-height: 1.15;
}

.goldapi-total-value {
	font-size: 1.65rem;
	font-weight: 700;
	line-height: 1.15;
}

.goldapi-currency {
	font-size: 0.875rem;
	opacity: 0.75;
}

.goldapi-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 0.4rem;
	font-size: 0.8125rem;
	opacity: 0.72;
}

.goldapi-layout-inline {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	align-items: baseline;
}

.goldapi-layout-inline .goldapi-price-value {
	font-size: 1em;
}

.goldapi-layout-inline .goldapi-meta,
.goldapi-layout-inline .goldapi-branding {
	display: none;
}

.goldapi-layout-ticker {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	padding: 0.6rem 0.75rem;
	border-block: 1px solid color-mix(in srgb, currentColor 14%, transparent);
}

.goldapi-layout-ticker .goldapi-metal {
	display: none;
}

.goldapi-layout-ticker .goldapi-price-value {
	font-size: 1.1rem;
}

.goldapi-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.goldapi-table th,
.goldapi-table td {
	padding: 0.65rem 0.75rem;
	border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent);
	text-align: left;
	vertical-align: middle;
}

.goldapi-table th {
	font-weight: 700;
	background: color-mix(in srgb, Canvas 94%, currentColor 6%);
}

.goldapi-table .goldapi-price-value {
	font-size: 1rem;
}

.goldapi-layout-karat {
	border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
	border-radius: 8px;
	padding: 16px;
	background: color-mix(in srgb, Canvas 96%, currentColor 4%);
}

.goldapi-value-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
	margin-top: 0.85rem;
}

.goldapi-value-grid > div {
	min-width: 0;
	padding: 0.65rem;
	border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
	border-radius: 6px;
}

.goldapi-value-label {
	display: block;
	margin-bottom: 0.2rem;
	font-size: 0.75rem;
	font-weight: 600;
	opacity: 0.68;
}

.goldapi-value-text,
.goldapi-unit-price-value,
.goldapi-gram-price-value {
	font-weight: 700;
}

.goldapi-tile-currency {
	margin-left: 0.25rem;
	font-size: 0.75rem;
	opacity: 0.72;
}

.goldapi-weight-control {
	display: flex;
	gap: 0.4rem;
	align-items: center;
}

.goldapi-weight-input {
	width: 7rem;
	max-width: 100%;
	min-height: 2rem;
	padding: 0.25rem 0.4rem;
	border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
	border-radius: 4px;
	background: Canvas;
	color: inherit;
	font: inherit;
}

.goldapi-weight-unit {
	font-weight: 700;
}

.goldapi-updated-small {
	font-size: 0.75rem;
	line-height: 1.35;
	opacity: 0.74;
}

.goldapi-layout-scrap-calculator {
	padding: 16px;
	border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
	border-radius: 8px;
	background: color-mix(in srgb, Canvas 96%, currentColor 4%);
	color: inherit;
}

.goldapi-calculator-kicker {
	margin-bottom: 0.6rem;
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: uppercase;
	opacity: 0.78;
}

.goldapi-calculator-title {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	margin-bottom: 1rem;
}

.goldapi-calculator-title h3 {
	margin: 0;
	font-size: 1.35rem;
	line-height: 1.2;
}

.goldapi-calculator-logo {
	flex: 0 0 2rem;
	width: 2rem;
	height: 2rem;
	object-fit: contain;
}

.goldapi-calculator-note {
	margin: 0 0 1rem;
	padding: 0.65rem;
	border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
	border-radius: 6px;
	font-size: 0.8125rem;
	line-height: 1.45;
	opacity: 0.82;
}

.goldapi-calculator-grid,
.goldapi-calculator-results,
.goldapi-calculator-rates {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
}

.goldapi-calculator-field label {
	display: block;
	margin-bottom: 0.25rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: inherit;
	opacity: 0.68;
}

.goldapi-calculator-field > span {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.8125rem;
	color: inherit;
	opacity: 0.68;
}

.goldapi-calculator-field input,
.goldapi-calculator-field select {
	width: 100%;
	min-height: 2.5rem;
	padding: 0.35rem 0.5rem;
	border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
	border-radius: 4px;
	background: Canvas;
	color: inherit;
	font: inherit;
	font-size: 1rem;
}

.goldapi-calculator-field input[readonly] {
	background: color-mix(in srgb, Canvas 92%, currentColor 8%);
}

.goldapi-calculator-results,
.goldapi-calculator-rates {
	margin-top: 1rem;
}

.goldapi-calculator-rates {
	padding-top: 1rem;
	border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent);
}

.goldapi-calculator-tile {
	min-width: 0;
	padding: 0.65rem;
	border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
	border-radius: 6px;
	background: transparent;
}

.goldapi-calculator-tile span {
	display: block;
	margin-bottom: 0.2rem;
	color: inherit;
	font-size: 0.75rem;
	font-weight: 600;
	opacity: 0.68;
}

.goldapi-calculator-tile strong {
	display: block;
	color: inherit;
	font-size: 1rem;
	line-height: 1.2;
}

.goldapi-calculator-tile-strong strong {
	font-size: 1.35rem;
}

.goldapi-branding {
	margin-top: 0.55rem;
	font-size: 0.75rem;
	opacity: 0.7;
}

.goldapi-branding a {
	display: inline-flex;
	gap: 0.25rem;
	align-items: center;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.goldapi-branding img {
	display: inline-block;
	width: 0.95em;
	height: 0.95em;
	object-fit: contain;
	vertical-align: -0.12em;
}

.goldapi-status {
	display: inline-flex;
	flex: 0 0 1em;
	width: 1em;
	height: 1em;
	margin-left: 0.25rem;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	line-height: 1;
	vertical-align: -0.125em;
	opacity: 0;
}

.goldapi-is-loading .goldapi-status {
	opacity: 0.72;
}

.goldapi-is-loading .goldapi-status::before {
	content: "";
	display: block;
	width: 0.85em;
	height: 0.85em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: goldapi-spin 0.7s linear infinite;
}

.goldapi-has-error .goldapi-status {
	opacity: 0.72;
}

.goldapi-has-error .goldapi-status::before {
	content: "!";
	display: inline-flex;
	width: 1em;
	height: 1em;
	align-items: center;
	justify-content: center;
	border: 1px solid currentColor;
	border-radius: 50%;
	font-size: 0.72em;
	font-weight: 700;
}

@keyframes goldapi-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (max-width: 600px) {
	.goldapi-layout-card {
		padding: 14px;
	}

	.goldapi-price-value {
		font-size: 1.35rem;
	}

	.goldapi-total-value {
		font-size: 1.35rem;
	}

	.goldapi-value-grid {
		grid-template-columns: 1fr;
	}

	.goldapi-layout-scrap-calculator {
		padding: 16px;
	}

	.goldapi-calculator-grid,
	.goldapi-calculator-results,
	.goldapi-calculator-rates {
		grid-template-columns: 1fr;
	}

	.goldapi-calculator-field input,
	.goldapi-calculator-field select {
		min-height: 3.2rem;
		font-size: 1rem;
	}

	.goldapi-table {
		font-size: 0.875rem;
	}

	.goldapi-table th,
	.goldapi-table td {
		padding: 0.5rem;
	}
}
