#cbcz-root {
	/* Zero-size anchor pinned to the chosen corner; both the box and the
	   reopen bubble are positioned absolutely against this exact point so
	   they always share the same corner regardless of the box's width. */
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 0;
	height: 0;
	z-index: 999999;
	font-family: var(--cbcz-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);
}

#cbcz-root[data-cbcz-position="bottom-left"] {
	right: auto;
	left: 20px;
}

#cbcz-root * {
	box-sizing: border-box;
}

.cbcz-box {
	--cbcz-bg: #ffffff;
	--cbcz-fg: #1a1a1a;
	--cbcz-fg-muted: #5c5c5c;
	--cbcz-border: rgba(0, 0, 0, .08);

	position: absolute;
	bottom: 0;
	right: 0;
	width: 360px;
	max-width: calc(100vw - 40px);
	background: var(--cbcz-bg);
	color: var(--cbcz-fg);
	border: 1px solid var(--cbcz-border);
	border-radius: var(--cbcz-radius, 14px);
	padding: 20px 22px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .18);

	/* Vysunutí z ikonky: box roste ze spodního rohu, kde sedí bublina. */
	transform-origin: bottom right;
	transform: scale(0.35) translateY(10px);
	opacity: 0;
	pointer-events: none;
	transition: transform .32s cubic-bezier(.34, 1.56, .64, 1), opacity .2s ease;
}

#cbcz-root[data-cbcz-position="bottom-left"] .cbcz-box {
	right: auto;
	left: 0;
	transform-origin: bottom left;
}

.cbcz-box.cbcz-visible {
	transform: scale(1) translateY(0);
	opacity: 1;
	pointer-events: auto;
}

@media (prefers-color-scheme: dark) {
	#cbcz-root:not([data-cbcz-theme="light"]) .cbcz-box {
		--cbcz-bg: #1f2125;
		--cbcz-fg: #f3f3f3;
		--cbcz-fg-muted: #b7b7b7;
		--cbcz-border: rgba(255, 255, 255, .1);
	}
}

#cbcz-root[data-cbcz-theme="dark"] .cbcz-box {
	--cbcz-bg: #1f2125;
	--cbcz-fg: #f3f3f3;
	--cbcz-fg-muted: #b7b7b7;
	--cbcz-border: rgba(255, 255, 255, .1);
}

.cbcz-title {
	display: block;
	font-size: 16px;
	margin-bottom: 8px;
}

.cbcz-desc {
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--cbcz-fg-muted);
	margin: 0 0 14px;
}

.cbcz-desc a {
	color: var(--cbcz-primary, #2563eb);
	text-decoration: underline;
}

.cbcz-close {
	position: absolute;
	top: 10px;
	right: 12px;
	background: none;
	border: none;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: var(--cbcz-fg-muted);
}

.cbcz-categories {
	margin: 4px 0 16px;
	border-top: 1px solid var(--cbcz-border);
	padding-top: 12px;
}

.cbcz-cat {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 0;
	cursor: default;
}

.cbcz-cat span {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.cbcz-cat strong {
	font-size: 13px;
}

.cbcz-cat small {
	font-size: 12px;
	color: var(--cbcz-fg-muted);
}

.cbcz-cat input[type="checkbox"] {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	accent-color: var(--cbcz-primary, #2563eb);
}

.cbcz-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.cbcz-btn {
	appearance: none;
	border: 1px solid var(--cbcz-border);
	background: transparent;
	color: var(--cbcz-fg);
	border-radius: var(--cbcz-radius, 14px);
	padding: 9px 16px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: filter .15s ease;
}

.cbcz-btn:hover {
	filter: brightness(0.95);
}

.cbcz-btn-primary {
	background: var(--cbcz-primary, #2563eb);
	border-color: var(--cbcz-primary, #2563eb);
	color: #fff;
}

.cbcz-btn-link {
	border-color: transparent;
	padding-left: 4px;
	padding-right: 4px;
	text-decoration: underline;
}

.cbcz-reopen {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	background: var(--cbcz-primary, #2563eb);
	color: #fff;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
	cursor: pointer;
	font-size: 20px;
	display: flex;
	align-items: center;
	justify-content: center;

	transform: scale(0.5);
	opacity: 0;
	pointer-events: none;
	transition: transform .2s ease, opacity .2s ease;
}

#cbcz-root[data-cbcz-position="bottom-left"] .cbcz-reopen {
	right: auto;
	left: 0;
}

.cbcz-reopen.cbcz-visible {
	transform: scale(1);
	opacity: 1;
	pointer-events: auto;
}

.cbcz-inline-settings-link {
	background: none;
	border: none;
	padding: 0;
	color: var(--cbcz-primary, #2563eb);
	text-decoration: underline;
	cursor: pointer;
	font: inherit;
}

@media (max-width: 480px) {
	#cbcz-root {
		left: 10px !important;
		right: 10px !important;
		bottom: 10px;
	}
	.cbcz-box {
		left: 0 !important;
		right: 0 !important;
		width: auto;
		transform-origin: bottom center;
	}
}
