.cg-root {
	--cg-accent: #0c7ee9;
	--cg-bg: #fff;
	--cg-fg: #1a1a1a;
	--cg-muted: #5a5a5a;
	--cg-border: #e1e3e8;

	position: fixed;
	inset: 0;
	display: flex;
	pointer-events: none; /* let clicks through to the page; banner re-enables them */

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.45;
	color: var(--cg-fg);
	z-index: 999999;
}
.cg-root[hidden] { display: none; } /* hidden attribute beats display:flex without this */

.cg-banner {
	pointer-events: auto;
	background: var(--cg-bg);
	padding: 16px 20px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
}

/* Vertical placement (applies to both layouts) */
.cg-root[data-position="top"]    { align-items: flex-start; }
.cg-root[data-position="bottom"] { align-items: flex-end; }

/* --- Bar layout: full-width strip --- */
.cg-root[data-layout="bar"] .cg-banner {
	width: 100%;
	border-top: 1px solid var(--cg-border);
	box-shadow: 0 -8px 24px rgba(0,0,0,0.08);
}
.cg-root[data-layout="bar"][data-position="top"] .cg-banner {
	border-top: 0;
	border-bottom: 1px solid var(--cg-border);
	box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* --- Box layout: floating card, aligned via justify-content --- */
.cg-root[data-layout="box"] {
	padding: 16px;
}
.cg-root[data-layout="box"] .cg-banner {
	max-width: 420px;
	border: 1px solid var(--cg-border);
	border-radius: 12px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.cg-root[data-layout="box"][data-box-align="left"]   { justify-content: flex-start; }
.cg-root[data-layout="box"][data-box-align="center"] { justify-content: center; }
.cg-root[data-layout="box"][data-box-align="right"]  { justify-content: flex-end; }

.cg-body { flex: 1 1 320px; }
.cg-title { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.cg-message { margin: 0; color: var(--cg-muted); }
.cg-links { margin: 8px 0 0; }
.cg-links a { color: var(--cg-accent); display: inline-block; }
.cg-links__sep { color: var(--cg-muted); margin: 0 2px; }
button.cg-link { text-decoration: none}

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

/* BUTTON RESET - Elementor Reset */
button, button:hover {
	border: inherit;
}


.cg-btn, button.cg-btn {
	border: 1px solid var(--cg-border);
	background: #fff;
	color: var(--cg-fg);
	padding: 4px 14px !important;
	border-radius: 8px;
	font: inherit;
	cursor: pointer;
	font-size:1.1em !important;
	line-height:1.2em !important;
}
.cg-btn:hover { border-color: var(--cg-accent); }
.cg-btn--primary {
	background: var(--cg-accent);
	color: #fff;
	border-color: var(--cg-accent);
}
.cg-btn--ghost { background: transparent; }
.cg-link {
	background: none;
	border: 0;
	color: var(--cg-accent);
	cursor: pointer;
	text-decoration: underline;
	font: inherit;
	padding: 0;
}

/* Preferences modal */
.cg-prefs {
	position: fixed;
	inset: 0;
	background: rgba(15,20,28,0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	z-index: 1000000;
	pointer-events: auto; /* re-enable: parent .cg-root sets pointer-events:none */
}
.cg-prefs__inner {
	background: var(--cg-bg);
	border-radius: 12px;
	max-width: 560px;
	width: 100%;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
}
.cg-prefs__head, .cg-prefs__foot {
	padding: 16px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid var(--cg-border);
}
.cg-prefs__foot {
	border-top: 1px solid var(--cg-border);
	border-bottom: 0;
	gap: 8px;
	justify-content: flex-end;
}
.cg-prefs__head h2 { margin: 0; font-size: 16px; }
.cg-iconbtn,button.cg-iconbtn {
	background: none; border: 0; font-size: 2em !important;
	line-height: 1em; cursor: pointer; color: var(--cg-muted);
	border-radius: 999px;
	padding: 7px !important;
	width: 45px;
	height: 45px;
	align-self: start;
	border: inherit;
}
.cg-prefs__body { padding: 8px 20px 20px; overflow: auto; }

.cg-category {
	display: flex; align-items: flex-start; justify-content: space-between;
	gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--cg-border);
}
.cg-category:last-of-type { border-bottom: 0; }
.cg-category__label { flex: 1; }
.cg-category__desc { display: block; color: var(--cg-muted); font-size: 13px; margin-top: 2px; }

.cg-switch { position: relative; width: 40px; height: 22px; flex: 0 0 40px; }
.cg-switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cg-switch__slider {
	position: absolute; inset: 0;
	background: #c8ccd2;
	border-radius: 999px;
	transition: background 120ms ease;
	pointer-events: none;
}
.cg-switch__slider::before {
	content: '';
	position: absolute;
	top: 2px; left: 2px;
	width: 18px; height: 18px;
	background: #fff;
	border-radius: 50%;
	transition: transform 120ms ease;
}
.cg-switch input:checked ~ .cg-switch__slider { background: var(--cg-accent); }
.cg-switch input:checked ~ .cg-switch__slider::before { transform: translateX(18px); }
.cg-switch input:disabled ~ .cg-switch__slider { opacity: 0.6; }

.cg-detected { margin-top: 16px; }
.cg-detected__group { margin-top: 12px; letter-spacing: 0;}
.cg-detected__group h4 { margin: 0 0 4px; font-size: 13px!important; text-transform: uppercase; color: var(--cg-muted); }
.cg-detected__group ul { margin: 0; padding-left: 0; list-style-type: none; }
.cg-detected__group li { margin-bottom: 6px; font-size: 13px; }
.cg-detected__data { color: var(--cg-muted); }

@media (max-width: 600px) {
	.cg-banner { flex-direction: column; align-items: stretch; }
	.cg-actions { justify-content: stretch; }
	.cg-btn { flex: 1; }
	.cg-body { flex: 1 1 auto}
	.cg-title{font-size:1.4em}
	.cg-prefs-title{font-size:2em}
}
