/* Калькулятор гран ↔ грами — стиль під hubert.com.ua (білий + #820000) */
/* Селектори навмисно «важкі» (.hgc-calc ...) + !important на критичних    */
/* властивостях, щоб стилі теми не ламали вигляд калькулятора.            */

.hgc-calc,
.hgc-calc * {
	box-sizing: border-box;
}

.hgc-calc {
	--hgc-accent: #820000;
	--hgc-ink: #1c1c1c;
	--hgc-muted: #7a7a7a;
	--hgc-line: #e3e3e3;

	position: relative;
	overflow: hidden;
	max-width: 520px;
	margin: 0 auto;
	padding: 26px;
	background: #ffffff;
	color: var(--hgc-ink);
	border: 1px solid var(--hgc-line);
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.4;
}

/* Верхня акцентна смуга окремим шаром — не ламає радіус кутів. */
.hgc-calc::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: var(--hgc-accent);
}

.hgc-head {
	margin: 0 0 20px;
}

.hgc-calc .hgc-title {
	margin: 0 0 4px !important;
	padding: 0 !important;
	border: 0 !important;
	font-size: 21px;
	line-height: 1.2;
	font-weight: 700;
	color: var(--hgc-accent);
	letter-spacing: 0.2px;
}

.hgc-calc .hgc-sub {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 14px;
	line-height: 1.4;
	color: var(--hgc-muted);
}

.hgc-grid {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: end;
	gap: 14px;
}

.hgc-calc .hgc-label {
	display: block;
	margin: 0 0 8px !important;
	padding: 0 !important;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: var(--hgc-ink);
}

.hgc-control {
	display: flex;
	align-items: stretch;
	overflow: hidden;
	background: #fff;
	border: 1.5px solid var(--hgc-line);
	border-radius: 6px;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hgc-control:focus-within {
	border-color: var(--hgc-accent);
	box-shadow: 0 0 0 3px rgba(130, 0, 0, 0.12);
}

/* Жорсткий ресет полів вводу — перебиває input[type="text"] теми. */
.hgc-calc .hgc-input {
	flex: 1 1 auto !important;
	width: 100% !important;
	min-width: 0 !important;
	height: auto !important;
	min-height: 0 !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 13px 14px !important;
	border: 0 !important;
	border-radius: 0 !important;
	outline: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: textfield !important;
	appearance: none !important;
	font-family: inherit !important;
	font-size: 18px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	color: var(--hgc-ink) !important;
}

.hgc-calc .hgc-input:focus {
	border: 0 !important;
	outline: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
}

.hgc-calc .hgc-input::placeholder {
	color: #bdbdbd;
	opacity: 1;
	font-weight: 500;
}

.hgc-unit {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	padding: 0 14px;
	background: var(--hgc-accent);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.3px;
	white-space: nowrap;
}

.hgc-eq {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 49px;
	font-size: 22px;
	font-weight: 700;
	color: var(--hgc-accent);
}

.hgc-calc .hgc-note {
	margin: 18px 0 0 !important;
	padding: 14px 0 0 !important;
	border: 0;
	border-top: 1px dashed var(--hgc-line);
	font-size: 13px;
	line-height: 1.5;
	color: var(--hgc-muted);
	text-align: center;
}

@media (max-width: 480px) {
	.hgc-grid {
		grid-template-columns: 1fr;
	}

	.hgc-eq {
		height: auto;
		margin: 2px 0;
		transform: rotate(90deg);
	}
}
