.ccb {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	color: var(--ccb-fg);
	font-size: 14px;
	line-height: 1.45;
	transform: translateY(100%);
	transition: transform .25s ease;
}
.ccb[hidden] { display: none; }
.ccb--in { transform: none; }
.ccb *, .ccb *::before, .ccb *::after { box-sizing: border-box; }

.ccb__bar {
	display: flex;
	align-items: center;
	gap: 16px 24px;
	padding: 12px max(20px, calc((100% - 1200px) / 2));
	padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	background: var(--ccb-bg);
	box-shadow: 0 -4px 20px rgba(0, 0, 0, .2);
}

.ccb__text { flex: 1; margin: 0; }
.ccb__text strong { margin-right: 4px; }
.ccb a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.ccb__sep { margin: 0 6px; opacity: .6; }
.ccb__btns { display: flex; gap: 8px; flex-shrink: 0; }
.ccb__split { display: inline-flex; }

.ccb__btn {
	margin: 0;
	padding: 10px 18px;
	border: 1px solid var(--ccb-accent);
	border-radius: 6px;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
}
.ccb__btn:focus-visible { outline: 2px solid var(--ccb-fg); outline-offset: 2px; }
.ccb__btn--main { background: var(--ccb-accent); color: var(--ccb-accent-fg); }
.ccb__btn--ghost { background: transparent; color: var(--ccb-fg); border-color: currentColor; }
.ccb__btn--link {
	padding-left: 6px;
	padding-right: 6px;
	background: transparent;
	color: var(--ccb-fg);
	border-color: transparent;
	font-weight: 400;
	text-decoration: underline;
	text-underline-offset: 2px;
	opacity: .85;
}
.ccb__btn:hover { filter: brightness(1.1); }

.ccb__split .ccb__btn:first-child { border-radius: 6px 0 0 6px; }
.ccb__arrow {
	display: inline-flex;
	align-items: center;
	padding: 10px 12px;
	border-radius: 0 6px 6px 0;
	border-left-color: rgba(0, 0, 0, .2);
}
.ccb__arrow svg { transition: transform .2s ease; }
.ccb--open .ccb__arrow svg { transform: rotate(180deg); }

.ccb__panel {
	max-width: 420px;
	margin: 0 max(20px, calc((100% - 1200px) / 2)) 8px auto;
	padding: 14px 16px;
	background: var(--ccb-bg);
	border-radius: 8px;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, .25);
}
.ccb__panel[hidden] { display: none; }

.ccb__opt {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 8px 0;
	border-bottom: 1px solid rgba(127, 127, 127, .25);
	cursor: pointer;
}
.ccb__opt small { display: block; opacity: .75; font-size: 12px; }

.ccb__opt input {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	flex-shrink: 0;
	width: 40px;
	height: 22px;
	margin: 0;
	border-radius: 22px;
	background: rgba(127, 127, 127, .5);
	cursor: pointer;
	transition: background .2s;
}
.ccb__opt input::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	transition: transform .2s;
}
.ccb__opt input:checked { background: var(--ccb-accent); }
.ccb__opt input:checked::after { transform: translateX(18px); }
.ccb__opt input:disabled { opacity: .6; cursor: default; }
.ccb__opt input:focus-visible { outline: 2px solid var(--ccb-fg); outline-offset: 2px; }

.ccb__panel-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 12px;
}
.ccb__panel-btns { display: flex; gap: 8px; }

@media (max-width: 760px) {
	.ccb { font-size: 13px; }
	.ccb__bar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); }
	.ccb__btns { margin-right: var(--ccb-gap, 0px); }
	.ccb__btns > .ccb__btn--ghost, .ccb__split { flex: 1; }
	.ccb__split .ccb__btn:first-child { flex: 1; }
	.ccb__panel { max-width: none; margin: 0 8px 8px; }
}

@media (prefers-reduced-motion: reduce) {
	.ccb, .ccb__arrow svg, .ccb__opt input, .ccb__opt input::after { transition: none; }
}
