:root {
	--gray: #E5E7EB;
	--gray-light: #F3F4F6;
	--gray-dark: #9CA3AF;
	--gray-border: #D1D5DB;
	--red: #EF4444;
	--red-light: #F87171;
	--red-dark: #DC2626;
	--red-border: #B91C1C;
	--green: #10B981;
	--green-light: #34D399;
	--green-dark: #059669;
	--green-border: #047857;
}

/* Lists */
.lists-toolbar {
	display: flex;
	align-items: end;
	gap: 10px;
}

	.lists-toolbar .fw-input-field {
		flex: 1;
		min-width: 0;
	}

#createListButton {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	padding: 0;
	font-size: 24px;
}

.list-uncategorized {
	margin-bottom: 12px;
}

	.list-uncategorized .bucket-list-entry {
		display: block;
		width: calc(100% - 24px);
		margin: 10px 12px;
	}

/* Category container */
#bucketListPanel > div:not(#rearrangeArea) {
	margin-bottom: 10px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: var(--surface);
	overflow: hidden;
}

/* Category header */
.bucket-list-category {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	margin: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

	/* Category title */
	.bucket-list-category h2 {
		flex: 1;
		margin: 0;
		padding: 0;
		font-size: 18px;
		font-weight: 600;
		line-height: 1.4;
		color: var(--header);
	}

	/* Edit button */
	.bucket-list-category button {
		flex-shrink: 0;
		margin: 0;
	}

/* Collapse arrow */
.bucket-list-category-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	margin: 0;
	color: var(--header);
	transition: transform 250ms ease;
}

	.bucket-list-category-arrow::before {
		content: "";
		display: block;
		width: 9px;
		height: 9px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: rotate(45deg);
	}

.collapsed .bucket-list-category-arrow {
	transform: rotate(-90deg);
}

/* Divider */
#bucketListPanel > div:not(#rearrangeArea):not(.collapsed) > .bucket-list-category {
	border-bottom: 1px solid var(--border);
}

.bucket-list-category-content {
	display: grid;
	grid-template-rows: 1fr;
	opacity: 1;
	transition: grid-template-rows 250ms ease, opacity 250ms ease;
}

.bucket-list-category-entries {
	min-height: 0;
	overflow: hidden;
	padding: 0;
}

	.bucket-list-category-entries .bucket-list-entry {
		margin: 10px 12px;
	}

.collapsed .bucket-list-category-content {
	grid-template-rows: 0fr;
	opacity: 0;
}

.bucket-list-category button {
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	font-size: 18px;
	cursor: pointer;
}

	.bucket-list-category button:hover {
		background: var(--accent);
	}

.bucket-list-category {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 0;
	height: auto;
	padding: 10px 16px;
	margin: 0;
	box-sizing: border-box;
}

	.bucket-list-category h2 {
		flex: 1;
		margin: 0;
		padding: 0;
		font-size: 18px;
		line-height: 24px;
	}

	.bucket-list-category button {
		width: 28px;
		height: 28px;
		min-width: 28px;
		min-height: 0;
		padding: 0;
		margin: 0;
		line-height: 1;
		font-size: 16px;
	}

/* default to red */
.bucket-list-entry {
	height: 52px;
	width: 100%;
	box-sizing: border-box;
	background: var(--red);
	border: 2px solid var(--red-border);
	border-radius: 8px;
	padding: 4px;
	align-items: center;
	cursor: pointer;
	color: black;
	text-align: left;
	font-family: "Emilys Candy", serif;
	font-size: clamp(1rem, 2rem, 2rem);
	font-weight: 800;
}

	.bucket-list-entry:hover {
		background: var(--red-light);
	}

	.bucket-list-entry:active {
		transform: translateY(2px);
		transition: ease 50ms;
	}

/* turn green if done */
.bl-done {
	background: var(--green);
	border: 2px solid var(--green-border);
}

	.bl-done:hover {
		background: var(--green-light);
	}

/* category rearranging */
.sortable-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.sortable-item {
	display: flex;
	height: 52px;
	min-width: 0;
	width: 100%;
	background: var(--pink);
	border: 2px solid var(--border);
	border-radius: 8px;
	padding: 4px;
	align-items: center;
	align-content: center;
	overflow: hidden;
	user-select: none;
	touch-action: none;
	color: black;
	text-align: left;
	font-family: "Emilys Candy", serif;
	font-size: 2rem;
	font-weight: 800;
}

.fit-text {
	display: block;
	min-width: 0;
	white-space: nowrap;
	flex-shrink: 1;
}

.handle {
	cursor: grab;
	touch-action: none;
	user-select: none;
}

.sortable-ghost {
	opacity: 0.4;
}

/* margin */
.bl-margin {
	margin-bottom: 8px;
}

/* other */
#rearrangeErrorMessage {
	margin: 16px 0 0;
	color: #d43c63;
}

#addButton,
#rearrangeCategoriesButton {
	max-height: 52px;
}
/* Draft rearranging controls */
.sortable-item { gap: 8px; }
.sortable-item .draft-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sortable-item .draft-category-select { width: min(42%, 175px); min-width: 90px; font-family: inherit; font-size: 14px; }
.sortable-item .draft-delete { flex-shrink: 0; border: 0; border-radius: 7px; padding: 7px; cursor: pointer; background: transparent; font-size: 17px; }
.sortable-item .draft-delete:hover { background: rgba(0,0,0,.12); }
#uncategorizedEntries:has(> .bucket-list-category:only-child) { opacity: .85; }
#uncategorizedEntries > .bucket-list-category { border-bottom: 1px solid var(--border); }

/* Keep entries inside category boxes */
.bucket-list-category-entries .bucket-list-entry {
	display: block;
	width: calc(100% - 24px);
	margin: 10px 12px;
	box-sizing: border-box;
}

#shareListButton {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	padding: 0;
	font-size: 22px;
}