:root {
	--bg: #ffffff;
	--text: #000000;
	--border: #cccccc;
	--card-bg: #ffffff;
	--hover: #f0f0f0;
	--chip-bg: #aaaaaa;
	--chip-active: #555555;
	--segment-bg: #aaaaaa;
	--segment-active: #cccccc;
	--segment-track: #555555;
}

body.dark {
	--bg: #1e1e1e;
	--text: #eaeaea;
	--border: #444444;
	--card-bg: #2a2a2a;
	--hover: #333333;
	--chip-bg: #444444;
	--chip-active: #888888;
	--segment-bg: #444444;
	--segment-active: #2a2a2a;
	--segment-track: #888888;
}

.segmented {
	display: flex;
	position: relative;
	background: var(--segment-bg);
	border-radius: 999px;
	padding: 4px;
	width: 320px;
}

.segmented button {
	flex: 1;
	text-align: center;
	position: relative;
	z-index: 2;
	border: none;
	background: transparent;
	color: var(--text);
	padding: 6px 12px;
	margin: 0;
	border-radius: 999px;
	cursor: pointer;
	font-size: 0.9rem;
}

.segmented button.active {
	font-weight: 500;
	color: #fff;
}

.segmented-track {
	position: absolute;
	top: 4px;
	left: 0;
	height: calc(100% - 8px);
	background: var(--segment-track);
	border-radius: 999px;
	transition: transform 0.25s ease, width 0.25s ease;
	z-index: 1;
}

body {
	font-family: sans-serif;
	display: flex;
	height: 100vh;
	margin: 0;
	background: var(--bg);
	color: var(--text);
}


#sidebar {
	width: 260px;
	border-right: 1px solid var(--border);
	overflow: visible;
	padding: 10px;
	top: 0;
	left: 0;
	z-index: 1;
}

#main {
	flex: 1;
	padding: 10px;
	overflow: visible;
}

.deck {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 5px;
	cursor: pointer;
	border-bottom: 1px solid #eee;
}

.deck-name {
	flex: 1;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.deck:hover {
	background: var(--hover);
}

.deck-actions {
	display: flex;
	gap: 4px;
}

.deck-actions button {
	padding: 2px 6px;
	font-size: 12px;
	cursor: pointer;
}

.section {
	margin-top: 15px;
}

.section h3 {
	display: flex;
	justify-content: space-between;
}

.zone {
	min-height: 140px;
	border: 1px dashed var(--border);
	padding: 5px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.card-tile {
	width: 110px;
	border: 1px solid var(--border);
	background: var(--card-bg);
	padding: 4px;
	cursor: pointer;
	position: relative;
}

.card-tile img {
	width: 100%;
	position: relative;
	transition: transform 0.15s ease;
	transform-origin: center center;
}

.card-tile.zoom img {
	transform: scale(3);
	z-index: 10;
	position: relative;
}

.card-count {
	position: absolute;
	top: 2px;
	left: 4px;
	background: #000;
	color: #fff;
	font-size: 12px;
	padding: 2px 4px;
	z-index: 2;
}

.card-controls {
	position: absolute;
	bottom: 2px;
	right: 2px;
	z-index: 2;
}

.card-controls button {
	margin-left: 2px;
}

#searchResults {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

#filters {
	display: grid;
	gap: 6px;
	margin-top: 10px;
}

.stats-container {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 4px;
}

.stats-container input {
	width: 99%;
	box-sizing: border-box;
	padding: 2px 4px;
	font-size: 0.9em;
}

#textInputs {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 4px;
}
#textInputs input {
	width: 99%;
	box-sizing: border-box;
	padding: 2px 4px;
	font-size: 0.9em;
}

.filter-group {
	flex-wrap: wrap;
	gap: 4px 4px;
	align-items: flex-start;
	justify-content: flex-start;
}

.chip {
	display: inline-block;
	padding: 8px 8px;
	border-radius: 12px;
	cursor: pointer;
	background: var(--chip-bg);
	white-space: nowrap;
	flex: 0 0 auto;
	margin-right: 8px;
	margin-bottom: 8px;
}

.chip.active {
	background: var(--chip-active);
	color: #fff;
}

.filter-group.scrollable {
	max-height: 100px;
	overflow-y: auto;
}

.filter-container {
	margin-bottom: 8px;
}

.filter-title {
	font-weight: bold;
	margin-bottom: 2px;
	font-size: 1.2em;
	height: 1.8em;
}