/* Goldrechner Pro – Frontend. Farben über die Variablen anpassbar. */
.grp {
	--grp-accent: #b8892c;
	--grp-accent-strong: #8f6a1f;
	--grp-accent-soft: #f6efe0;
	--grp-ink: #1d1b18;
	--grp-muted: #6e685f;
	--grp-line: #e6e0d4;
	--grp-surface: #ffffff;
	--grp-panel: #1d1b18;
	--grp-radius: 16px;
	max-width: 100%;
	margin: 2.5rem auto;
	container-type: inline-size;
	color: var(--grp-ink);
	font-family: inherit;
	line-height: 1.5;
}
.grp *, .grp *::before, .grp *::after { box-sizing: border-box; }
.grp button { -webkit-tap-highlight-color: transparent; }
/* Ochrona przed globalnymi stylami motywu i innych wtyczek (np. button { float: right }) */
.grp button { float: none !important; }
.grp .grp-list, .grp .grp-total, .grp .grp-foot, .grp .grp-note { clear: both; }
.grp .grp-foot > * { float: none !important; flex: 0 1 auto; min-width: 0; width: auto; word-break: normal; overflow-wrap: normal; }
.grp .grp-cta { white-space: nowrap; }

.grp .grp-card {
	background: var(--grp-surface);
	border: 1px solid var(--grp-line);
	border-radius: var(--grp-radius);
	box-shadow: 0 1px 2px rgba(29, 27, 24, .04), 0 12px 32px -12px rgba(29, 27, 24, .16);
	padding: 32px;
}

.grp .grp-head { margin-bottom: 24px; }
.grp .grp-eyebrow {
	display: inline-block;
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--grp-accent-strong);
	margin-bottom: 6px;
}
.grp .grp-title { margin: 0 0 6px; font-size: 1.6rem; line-height: 1.25; color: var(--grp-ink); }
.grp .grp-sub { margin: 0; color: var(--grp-muted); font-size: .95rem; }

/* Metall */
.grp .grp-tabs {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	gap: 4px;
	padding: 4px;
	margin-bottom: 22px;
	background: var(--grp-accent-soft);
	border-radius: 12px;
}
.grp .grp-tab {
	appearance: none;
	margin: 0;
	padding: 10px 8px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--grp-muted);
	font: inherit;
	font-size: .95rem;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	cursor: pointer;
	transition: background .15s, color .15s, box-shadow .15s;
}
@media (hover: hover) {
	.grp .grp-tab:hover { color: var(--grp-ink); background: rgba(255, 255, 255, .5); }
}
.grp .grp-tab.is-active {
	background: var(--grp-surface);
	color: var(--grp-ink);
	box-shadow: 0 1px 3px rgba(29, 27, 24, .14);
}

/* Felder */
.grp .grp-field { margin-bottom: 20px; }
.grp .grp-label {
	display: block;
	margin-bottom: 8px;
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--grp-muted);
}

.grp .grp-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.grp .grp-chip {
	appearance: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	flex: 1 1 80px;
	min-height: 64px;
	margin: 0;
	padding: 10px 6px;
	border: 1.5px solid var(--grp-line);
	border-radius: 12px;
	background: var(--grp-surface);
	color: var(--grp-ink);
	font: inherit;
	line-height: 1.15;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	cursor: pointer;
	transition: border-color .15s, background .15s;
}
.grp .grp-chip strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.grp .grp-chip small { font-size: .75rem; color: var(--grp-muted); }
@media (hover: hover) {
	.grp .grp-chip:hover { border-color: var(--grp-accent); color: var(--grp-ink); }
}
.grp .grp-chip.is-active { border-color: var(--grp-accent); background: var(--grp-accent-soft); }
.grp .grp-chip.is-active small { color: var(--grp-accent-strong); }

.grp .grp-tab:focus-visible,
.grp .grp-chip:focus-visible,
.grp .grp-add:focus-visible,
.grp .grp-item-remove:focus-visible,
.grp .grp-cta:focus-visible {
	outline: 2px solid var(--grp-accent);
	outline-offset: 2px;
}

.grp .grp-weight {
	display: flex;
	align-items: center;
	border: 1.5px solid var(--grp-line);
	border-radius: 12px;
	background: var(--grp-surface);
	transition: border-color .15s, box-shadow .15s;
}
.grp .grp-weight:focus-within { border-color: var(--grp-accent); box-shadow: 0 0 0 3px var(--grp-accent-soft); }
.grp .grp-weight input {
	flex: 1;
	min-width: 0;
	margin: 0;
	padding: 14px 16px;
	border: 0;
	background: transparent;
	color: var(--grp-ink);
	font: inherit;
	font-size: 1.35rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	box-shadow: none;
	outline: none;
}
.grp .grp-unit { padding: 0 16px; color: var(--grp-muted); font-weight: 600; }

/* Ergebnis */
.grp .grp-result {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 22px 24px;
	margin: 4px 0 14px;
	border-radius: 14px;
	background: var(--grp-panel);
	color: #f4efe6;
}
.grp .grp-result-label { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.grp .grp-result-value {
	display: block;
	font-size: 2.6rem;
	font-weight: 700;
	line-height: 1.15;
	color: #e3bf6f;
	font-variant-numeric: tabular-nums;
	word-break: break-word;
}
.grp .grp-result-meta { font-size: .9rem; opacity: .8; }
.grp.grp-unavailable .grp-result-value { color: #f4efe6; }

/* Positionen */
.grp .grp-add {
	appearance: none;
	display: block;
	width: 100%;
	margin: 0;
	padding: 12px;
	border: 1.5px dashed var(--grp-line);
	border-radius: 12px;
	background: transparent;
	color: var(--grp-accent-strong);
	font: inherit;
	font-weight: 600;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	cursor: pointer;
	transition: border-color .15s, background .15s;
}
.grp .grp-add:hover:not(:disabled) { border-color: var(--grp-accent); background: var(--grp-accent-soft); color: var(--grp-accent-strong); }
.grp .grp-add:disabled { opacity: .45; cursor: not-allowed; }

.grp .grp-list { list-style: none; margin: 14px 0 0; padding: 0; }
.grp .grp-list:empty { display: none; }
.grp .grp-item {
	display: grid;
	grid-template-columns: 1fr auto auto 32px;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 10px 0;
	border-bottom: 1px solid var(--grp-line);
	font-variant-numeric: tabular-nums;
}
.grp .grp-item-name { font-weight: 600; }
.grp .grp-item-weight { color: var(--grp-muted); }
.grp .grp-item-value { font-weight: 600; text-align: right; }
.grp .grp-item-remove {
	appearance: none;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--grp-muted);
	font-size: 1.3rem;
	line-height: 1;
	box-shadow: none;
	cursor: pointer;
}
.grp .grp-item-remove:hover { background: var(--grp-accent-soft); color: var(--grp-ink); }

.grp .grp-total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 14px 0 0;
	font-weight: 600;
}
.grp .grp-total strong { font-size: 1.4rem; color: var(--grp-accent-strong); font-variant-numeric: tabular-nums; }
.grp .grp-total[hidden] { display: none; }

/* Fuß */
.grp .grp-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var(--grp-line);
}
.grp .grp-updated { font-size: .85rem; color: var(--grp-muted); }
.grp .grp-cta {
	display: inline-block;
	padding: 11px 18px;
	border-radius: 10px;
	background: var(--grp-accent);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	transition: background .15s;
}
.grp .grp-cta:hover, .grp .grp-cta:focus { background: var(--grp-accent-strong); color: #fff; text-decoration: none; }
.grp .grp-note { margin: 14px 0 0; font-size: .8rem; color: var(--grp-muted); }

.grp .grp-noscript { width: 100%; border-collapse: collapse; }
.grp .grp-noscript th, .grp .grp-noscript td { padding: 8px; border-bottom: 1px solid var(--grp-line); text-align: left; }

/* Szeroki układ: wybór i waga po lewej, wynik po prawej */
@container (min-width: 820px) {
	.grp .grp-card {
		display: grid;
		grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
		grid-template-areas:
			"head   head"
			"tabs   result"
			"fine   result"
			"weight add"
			"list   list"
			"total  total"
			"foot   foot"
			"note   note";
		column-gap: 40px;
		align-items: start;
		padding: 40px;
	}
	.grp .grp-head { grid-area: head; }
	.grp .grp-tabs { grid-area: tabs; }
	.grp .grp-field-fine { grid-area: fine; }
	.grp .grp-field-weight { grid-area: weight; }
	.grp .grp-result {
		grid-area: result;
		align-self: stretch;
		justify-content: center;
		margin: 0 0 20px;
		padding: 28px 32px;
	}
	.grp .grp-result-value { font-size: 3.2rem; }
	.grp .grp-add { grid-area: add; align-self: end; margin-bottom: 20px; padding: 18px 12px; }
	.grp .grp-list { grid-area: list; }
	.grp .grp-total { grid-area: total; }
	.grp .grp-foot { grid-area: foot; }
	.grp .grp-note { grid-area: note; }
}

@media (max-width: 560px) {
	.grp { margin: 1.5rem auto; }
	.grp .grp-card { padding: 20px 16px; border-radius: 14px; }
	.grp .grp-title { font-size: 1.35rem; }
	.grp .grp-tab { font-size: .85rem; padding: 10px 4px; }
	.grp .grp-chips { gap: 6px; }
	.grp .grp-chip { flex-basis: 52px; min-height: 58px; padding: 8px 2px; }
	.grp .grp-chip strong { font-size: 1.05rem; }
	.grp .grp-chip small { font-size: .7rem; }
	.grp .grp-result { padding: 18px; }
	.grp .grp-result-value { font-size: 2.1rem; }
	.grp .grp-item { grid-template-columns: 1fr auto 32px; gap: 8px; }
	.grp .grp-item-weight { display: none; }
	.grp .grp-cta { width: 100%; text-align: center; }
}
