* {
	box-sizing: border-box;
}

body {
	display: grid;
	place-items: center;
	min-height: 100vh;
	margin: 0;
	padding: 1.5rem;
	background: #f4f4f6;
	font-family: system-ui, sans-serif;
	color: #1c1c22;
}

.tracker {
	width: min(34rem, 100%);
	padding: 2rem;
	border-radius: 1.5rem;
	background: #ffffff;
	box-shadow: 0 10px 30px -15px rgb(0 0 0 / 0.25);
}

.tracker-title {
	margin: 0 0 1.25rem;
	font-size: 1.5rem;
}

.summary {
	padding: 1.25rem;
	border-radius: 1rem;
	background: #1c1c22;
	color: #ffffff;
}

.total-label {
	margin: 0;
	font-size: 0.875rem;
	color: #a5a5b0;
}

/* Every digit the same width, so totals line up and don't jump. */
.total {
	margin: 0.25rem 0 0.75rem;
	font-size: 2rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.categories {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.categories li {
	padding: 0.25rem 0.75rem;
	border-radius: 999px;
	background: #3a3a44;
	font-size: 0.8125rem;
	font-variant-numeric: tabular-nums;
}

/* A two-column grid: the description spans both, the rest share a row. */
.expense-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

.field-wide {
	grid-column: 1 / -1;
}

.field label {
	display: block;
	margin-bottom: 0.375rem;
	font-size: 0.875rem;
	font-weight: 600;
}

.field input,
.field select {
	width: 100%;
	padding: 0.625rem 0.75rem;
	border: 2px solid #c8c8d0;
	border-radius: 0.75rem;
	background: #ffffff;
	font: inherit;
}

.add-button {
	grid-column: 1 / -1;
	padding: 0.75rem;
	border: 0;
	border-radius: 999px;
	background: #1c1c22;
	font: inherit;
	font-weight: 600;
	color: #ffffff;
	cursor: pointer;
}

.add-button:hover {
	background: #3a3a44;
}

.field input:focus-visible,
.field select:focus-visible,
.add-button:focus-visible,
.delete-button:focus-visible {
	outline: 3px solid #2563eb;
	outline-offset: 2px;
}

.list-title {
	margin: 1.75rem 0 0.5rem;
	font-size: 1rem;
}

.expenses {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Description and details on the left, amount and Delete on the right. */
.expense {
	display: grid;
	grid-template-columns: 1fr auto auto;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 0;
	border-top: 1px solid #e4e4e8;
}

.expense-name {
	display: block;
	font-weight: 600;
	overflow-wrap: anywhere;
}

.expense-details {
	font-size: 0.8125rem;
	color: #6b6b76;
}

.expense-amount {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.delete-button {
	padding: 0.25rem 0.75rem;
	border: 1px solid #e4e4e8;
	border-radius: 999px;
	background: none;
	font: inherit;
	font-size: 0.8125rem;
	color: #6b6b76;
	cursor: pointer;
}

.delete-button:hover {
	border-color: #b91c1c;
	color: #b91c1c;
}

.empty {
	margin: 0.5rem 0 0;
	color: #6b6b76;
}
