/* Consenso Chiaro — stile del banner */
#cch-root {
	--cch-primary: #111;
	--cch-bg: #fff;
	--cch-text: #222;
	--cch-radius: 10px;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--cch-text);
}
#cch-root *, #cch-root *::before, #cch-root *::after { box-sizing: border-box; }
#cch-root [hidden] { display: none !important; }

#cch-root .cch-banner {
	position: fixed;
	z-index: 2147483000;
	background: var(--cch-bg);
	color: var(--cch-text);
	box-shadow: 0 8px 40px rgba(0, 0, 0, .22);
	padding: 22px 24px 20px;
}
#cch-root.cch-pos-bottom .cch-banner {
	left: 16px; right: 16px; bottom: 16px;
	max-width: 1100px; margin: 0 auto;
	border-radius: var(--cch-radius);
}
#cch-root.cch-pos-bottom-left .cch-banner {
	left: 16px; bottom: 16px; width: 420px; max-width: calc(100vw - 32px);
	border-radius: var(--cch-radius);
}
#cch-root.cch-pos-center .cch-banner {
	left: 50%; top: 50%; transform: translate(-50%, -50%);
	width: 560px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow: auto;
	border-radius: var(--cch-radius);
}
#cch-root.cch-pos-center.cch-open::before {
	content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 2147482999;
}

#cch-root .cch-title { margin: 0 32px 8px 0; font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--cch-text); }
#cch-root .cch-msg p { margin: 0 0 8px; color: var(--cch-text); font-size: 14px; }
#cch-root .cch-links { font-size: 13px; margin: 6px 0 0; }
#cch-root a { color: var(--cch-primary); text-decoration: underline; }

#cch-root .cch-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 14px; }
#cch-root.cch-pos-bottom-left .cch-actions,
#cch-root.cch-pos-center .cch-actions { justify-content: stretch; }
#cch-root.cch-pos-bottom-left .cch-btn,
#cch-root.cch-pos-center .cch-btn { flex: 1 1 auto; }

#cch-root .cch-btn {
	appearance: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600;
	padding: 11px 20px; border-radius: 8px; border: 2px solid var(--cch-primary);
	background: var(--cch-primary); color: var(--cch-bg); line-height: 1.2; min-width: 120px;
	transition: opacity .15s;
}
#cch-root .cch-btn:hover { opacity: .85; }
#cch-root .cch-btn-ghost { background: transparent; color: var(--cch-primary); }
#cch-root .cch-btn:focus-visible, #cch-root .cch-x:focus-visible, #cch-root .cch-float:focus-visible { outline: 3px solid var(--cch-primary); outline-offset: 2px; }

#cch-root .cch-x {
	position: absolute; top: 10px; right: 12px; width: 32px; height: 32px;
	border: 0; background: transparent; color: var(--cch-text); font-size: 26px; line-height: 1; cursor: pointer; padding: 0;
}

/* Pannello preferenze */
#cch-root .cch-modal {
	position: fixed; inset: 0; z-index: 2147483001; background: rgba(0, 0, 0, .5);
	display: flex; align-items: center; justify-content: center; padding: 16px;
}
#cch-root .cch-modal-box {
	position: relative; background: var(--cch-bg); color: var(--cch-text);
	width: 620px; max-width: 100%; max-height: calc(100vh - 32px); overflow: auto;
	border-radius: var(--cch-radius); padding: 24px; box-shadow: 0 10px 50px rgba(0, 0, 0, .3);
}
#cch-root .cch-cat { border-top: 1px solid rgba(127, 127, 127, .25); padding: 14px 0; }
#cch-root .cch-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#cch-root .cch-cat-name { font-weight: 700; }
#cch-root .cch-cat-desc { margin: 6px 0 0; font-size: 13px; opacity: .85; }
#cch-root .cch-cat-svc { margin: 4px 0 0; font-size: 12px; opacity: .7; }

#cch-root .cch-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
#cch-root .cch-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
#cch-root .cch-slider { position: absolute; inset: 0; background: #bbb; border-radius: 26px; cursor: pointer; transition: background .2s; }
#cch-root .cch-slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; }
#cch-root .cch-switch input:checked + .cch-slider { background: var(--cch-primary); }
#cch-root .cch-switch input:checked + .cch-slider::before { transform: translateX(20px); }
#cch-root .cch-switch input:disabled + .cch-slider { opacity: .55; cursor: not-allowed; }
#cch-root .cch-switch input:focus-visible + .cch-slider { outline: 3px solid var(--cch-primary); outline-offset: 2px; }

/* Icona per riaprire le preferenze */
#cch-root .cch-float {
	position: fixed; left: 16px; bottom: 16px; z-index: 2147482990;
	width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--cch-primary); color: var(--cch-bg); box-shadow: 0 3px 12px rgba(0, 0, 0, .25);
	display: flex; align-items: center; justify-content: center; padding: 0;
}
#cch-root.cch-open .cch-float { display: none; }

#cch-root .cch-preview-badge {
	position: fixed; top: 40px; right: 12px; z-index: 2147483002;
	background: #d63638; color: #fff; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 6px;
	pointer-events: none;
}

/* Segnaposto per i contenuti bloccati */
.cch-ph {
	display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
	background: #f2f2f2; color: #333; border: 1px dashed #bbb; border-radius: 8px; padding: 20px; width: 100%;
	font-size: 14px; line-height: 1.5;
}
.cch-ph p { margin: 0 0 8px; }
.cch-ph-btn, .cch-sc-btn {
	cursor: pointer; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 6px;
	border: 0; background: #111; color: #fff;
}
.cch-ph-link { cursor: pointer; font: inherit; background: none; border: 0; text-decoration: underline; color: inherit; padding: 9px 6px; }
.cch-sc-btn { margin: 4px 8px 4px 0; }
.cch-sc-del { background: #8a1f1f; }

/* Tabelle generate nelle policy */
.cch-table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; font-size: .92em; }
.cch-table th, .cch-table td { border: 1px solid rgba(127, 127, 127, .35); padding: 8px 10px; text-align: left; vertical-align: top; }
.cch-table th { background: rgba(127, 127, 127, .1); }

@media (max-width: 640px) {
	#cch-root .cch-banner { padding: 18px 16px 16px; }
	#cch-root.cch-pos-bottom .cch-banner, #cch-root.cch-pos-bottom-left .cch-banner { left: 8px; right: 8px; bottom: 8px; width: auto; }
	#cch-root .cch-actions { flex-direction: column-reverse; }
	#cch-root .cch-btn { width: 100%; }
}
