:root {
	--bg: #f5f7ff;
	--card: #ffffff;
	--text: #09130b;
	--muted: #475569;
	--brand: #46e561;
	--brand-2: #7c3aed;
	--success: #16a34a;
	--danger: #dc2626;
	--line: #e2e8f0;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
	color: var(--text);
	background: linear-gradient(160deg, #eef2ff, #f8fafc);
}

.install-toast {
	position: fixed;
	top: 14px;
	right: 14px;
	z-index: 1000;
	background: #14532d;
	color: #ecfdf5;
	padding: 0.65rem 0.9rem;
	border-radius: 10px;
	border: 1px solid #166534;
	box-shadow: 0 10px 22px rgba(20, 83, 45, 0.24);
	font-weight: 600;
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.install-toast.show {
	opacity: 1;
	transform: translateY(0);
}

.app {
	max-width: 900px;
	margin: 0 auto;
	padding: 1rem;
}

.app-footer {
	text-align: center;
	color: var(--muted);
	font-size: 0.85rem;
	padding: 0.6rem 0 0.2rem;
}

.install-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.8rem;
	background: linear-gradient(120deg, var(--brand), var(--brand-2));
	color: white;
	border-radius: 14px;
	padding: 0.8rem 1rem;
	margin-bottom: 0.9rem;
}

.install-bar p {
	margin: 0.3rem 0 0;
	opacity: 0.9;
	font-size: 0.88rem;
}

.install-bar button {
	width: auto;
	min-width: 140px;
	border: 1px solid rgba(255, 255, 255, 0.4);
	background: rgba(255, 255, 255, 0.16);
	color: white;
}

.install-bar button:disabled {
	opacity: 0.75;
	cursor: not-allowed;
}

.app-header {
	text-align: center;
	margin-bottom: 1rem;
}

.header-top-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.lang-switch {
	display: flex;
	align-items: center;
	gap: 0.45rem;
}

.lang-switch label {
	margin: 0;
	font-size: 0.85rem;
}

.lang-switch select {
	width: auto;
	min-width: 175px;
	padding: 0.45rem 0.55rem;
}

.app-header h1 {
	margin: 0;
}

.app-header p {
	margin: 0.5rem 0 0;
	color: var(--muted);
}

.card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: 1rem;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
	margin-bottom: 1rem;
}

h2 {
	margin-top: 0;
}

label {
	display: block;
	font-size: 0.9rem;
	margin-bottom: 0.25rem;
	color: var(--muted);
}

input,
select,
button {
	width: 100%;
	border-radius: 10px;
	border: 1px solid var(--line);
	padding: 0.65rem 0.75rem;
	font-size: 0.95rem;
}

button {
	cursor: pointer;
	font-weight: 600;
}

button:hover {
	filter: brightness(0.98);
}

button.primary,
.budget-row button {
	background: linear-gradient(120deg, var(--brand), var(--brand-2));
	color: white;
	border: none;
}

button.ghost {
	background: white;
	border: 1px solid var(--line);
}

.budget-row {
	display: grid;
	grid-template-columns: 1fr 160px;
	gap: 0.75rem;
}

.stats {
	margin-top: 0.8rem;
	display: grid;
	gap: 0.45rem;
}

.stats div {
	display: flex;
	justify-content: space-between;
}

.over-budget-banner {
	margin-top: 0.75rem;
	padding: 0.6rem 0.75rem;
	border-radius: 10px;
	background: #fee2e2;
	color: #991b1b;
	font-weight: 600;
	border: 1px solid #fecaca;
}

.progress-track {
	margin-top: 0.9rem;
	width: 100%;
	height: 10px;
	border-radius: 99px;
	background: #e2e8f0;
	overflow: hidden;
}

.progress-fill {
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, var(--success), #22c55e);
	transition: width 0.25s ease;
}

.progress-fill.warning {
	background: linear-gradient(90deg, #f59e0b, #f97316);
}

.progress-fill.over {
	background: linear-gradient(90deg, #ef4444, #dc2626);
}

.grid {
	display: grid;
	gap: 0.75rem;
	margin-bottom: 0.8rem;
}

.grid.two {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem;
}

.form-actions {
	display: flex;
	gap: 0.6rem;
}

.form-actions button {
	width: auto;
	min-width: 130px;
}

.filters {
	display: grid;
	grid-template-columns: 1fr 90px 200px;
	align-items: center;
	gap: 0.6rem;
	margin: 0.6rem 0 0.9rem;
}

.check-inline {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	margin: 0;
}

.check-inline input {
	width: auto;
	margin: 0;
}

.shopping-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.65rem;
}

.item {
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 0.75rem;
	display: grid;
	gap: 0.4rem;
}

.item-top {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	align-items: center;
}

.item-title {
	font-weight: 600;
}

.item-meta {
	color: var(--muted);
	font-size: 0.9rem;
}

.item-actions {
	display: flex;
	gap: 0.4rem;
}

.item-actions button {
	width: auto;
}

.item.done {
	opacity: 0.66;
}

.item.done .item-title {
	text-decoration: line-through;
}

.pill {
	display: inline-block;
	padding: 0.15rem 0.45rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
	border: 1px solid transparent;
}

.pill.High {
	color: #991b1b;
	background: #fee2e2;
}

.pill.Medium {
	color: #92400e;
	background: #fef3c7;
}

.pill.Low {
	color: #065f46;
	background: #d1fae5;
}

@media (max-width: 680px) {
	.grid.two,
	.grid.three,
	.budget-row {
		grid-template-columns: 1fr;
	}

	.form-actions {
		flex-direction: column;
	}

	.form-actions button {
		width: 100%;
	}

	.filters {
		grid-template-columns: 1fr;
	}

	.install-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.install-bar button {
		width: 100%;
	}

	.header-top-row {
		flex-direction: column;
		align-items: stretch;
	}

	.lang-switch {
		justify-content: space-between;
	}

	.lang-switch select {
		min-width: 0;
		width: 60%;
	}

	.section-head {
		flex-direction: column;
		align-items: stretch;
	}
}
