/* PG Cookie Consent – banner */
#pgpc-root, #pgpc-root *, .pgpc-placeholder, .pgpc-placeholder * { box-sizing: border-box; }
#pgpc-root {
	--pgpc-bg: #fff; --pgpc-text: #1f2328; --pgpc-link: #1a56db;
	--pgpc-btn-bg: #1a56db; --pgpc-btn-text: #fff; --pgpc-radius: 8px; --pgpc-font: 14px;
	font-family: inherit; font-size: var(--pgpc-font); line-height: 1.5; color: var(--pgpc-text);
}
#pgpc-root [hidden], .pgpc-placeholder [hidden] { display: none !important; }
#pgpc-root a { color: var(--pgpc-link); text-decoration: underline; }
#pgpc-root p { margin: 0 0 .6em; font-size: inherit; color: inherit; }

/* Banner */
.pgpc-banner {
	display: none; position: fixed; z-index: 2147483640; background: var(--pgpc-bg); color: var(--pgpc-text);
	box-shadow: 0 -2px 24px rgba(0,0,0,.15); padding: 20px 24px; gap: 16px 24px; align-items: center; max-height: 85vh; overflow-y: auto;
}
.pgpc-show-banner .pgpc-banner { display: flex; }
.pgpc-pos-bottom .pgpc-banner, .pgpc-pos-top .pgpc-banner { left: 0; right: 0; }
.pgpc-pos-bottom .pgpc-banner { bottom: 0; }
.pgpc-pos-top .pgpc-banner { top: 0; box-shadow: 0 2px 24px rgba(0,0,0,.15); }
.pgpc-pos-box-left .pgpc-banner, .pgpc-pos-box-right .pgpc-banner, .pgpc-pos-center .pgpc-banner {
	flex-direction: column; align-items: stretch; width: 420px; max-width: calc(100vw - 32px);
	border-radius: var(--pgpc-radius); box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.pgpc-pos-box-left .pgpc-banner { left: 16px; bottom: 16px; }
.pgpc-pos-box-right .pgpc-banner { right: 16px; bottom: 16px; }
.pgpc-pos-center .pgpc-banner { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 560px; max-height: calc(100vh - 32px); overflow: auto; }
.pgpc-content { flex: 1 1 auto; min-width: 0; padding-right: 20px; }
.pgpc-title { font-weight: 700; font-size: 1.12em !important; margin-bottom: .35em !important; }
.pgpc-text { margin: 0; }
.pgpc-links { white-space: nowrap; }
.pgpc-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; justify-content: flex-end; }
.pgpc-pos-box-left .pgpc-actions, .pgpc-pos-box-right .pgpc-actions, .pgpc-pos-center .pgpc-actions { justify-content: stretch; }
.pgpc-pos-box-left .pgpc-actions .pgpc-btn, .pgpc-pos-box-right .pgpc-actions .pgpc-btn, .pgpc-pos-center .pgpc-actions .pgpc-btn { flex: 1 1 auto; }

/* Pulsanti: Accetta e Rifiuta hanno lo stesso peso visivo */
#pgpc-root .pgpc-btn, .pgpc-placeholder .pgpc-btn {
	appearance: none; cursor: pointer; font: inherit; font-weight: 600; line-height: 1.2; text-transform: none; letter-spacing: normal;
	padding: 11px 18px; border-radius: var(--pgpc-radius); border: 2px solid var(--pgpc-btn-bg, #1a56db);
	background: var(--pgpc-btn-bg, #1a56db); color: var(--pgpc-btn-text, #fff); min-height: 44px; margin: 0; box-shadow: none;
}
#pgpc-root .pgpc-btn:hover, .pgpc-placeholder .pgpc-btn:hover { filter: brightness(1.08); }
#pgpc-root .pgpc-btn-ghost { background: transparent; color: var(--pgpc-btn-bg); }
#pgpc-root button:focus-visible, #pgpc-root input:focus-visible + span, #pgpc-root a:focus-visible { outline: 3px solid var(--pgpc-link); outline-offset: 2px; }

#pgpc-root .pgpc-x {
	position: absolute; top: 6px; right: 8px; width: 36px; height: 36px; padding: 0; border: 0; background: transparent;
	color: var(--pgpc-text); font-size: 26px; line-height: 1; cursor: pointer; opacity: .7; border-radius: 50%; box-shadow: none;
}
#pgpc-root .pgpc-x:hover { opacity: 1; }

.pgpc-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 2147483639; }
.pgpc-show-banner .pgpc-overlay { display: block; }

/* Modale preferenze */
.pgpc-modal-wrap { position: fixed; inset: 0; z-index: 2147483646; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.pgpc-modal {
	background: var(--pgpc-bg); color: var(--pgpc-text); width: 640px; max-width: 100%; max-height: calc(100vh - 32px);
	display: flex; flex-direction: column; border-radius: var(--pgpc-radius); box-shadow: 0 12px 48px rgba(0,0,0,.3); overflow: hidden;
}
.pgpc-mhead { position: relative; padding: 18px 56px 10px 22px; border-bottom: 1px solid rgba(127,127,127,.2); }
.pgpc-mhead .pgpc-title { margin: 0 !important; }
.pgpc-mbody { padding: 16px 22px; overflow-y: auto; flex: 1 1 auto; }
.pgpc-mfoot { padding: 14px 22px; border-top: 1px solid rgba(127,127,127,.2); display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pgpc-mfoot .pgpc-btn { flex: 1 1 auto; }

.pgpc-cat { border: 1px solid rgba(127,127,127,.25); border-radius: var(--pgpc-radius); margin: 0 0 10px; }
.pgpc-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
#pgpc-root .pgpc-cat-toggle {
	flex: 1; text-align: left; background: transparent; border: 0; padding: 4px 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; box-shadow: none;
}
#pgpc-root .pgpc-cat-toggle::before { content: '▸'; display: inline-block; width: 1.1em; transition: transform .15s; }
#pgpc-root .pgpc-cat-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.pgpc-cat-body { padding: 0 14px 12px; }
.pgpc-always { font-size: .85em; font-weight: 600; opacity: .75; white-space: nowrap; }
.pgpc-svc-title { font-weight: 600; margin-top: .8em !important; }
.pgpc-svcs { list-style: none; margin: 0; padding: 0; }
.pgpc-svc { padding: 8px 0; border-top: 1px dashed rgba(127,127,127,.25); }
.pgpc-muted { opacity: .75; font-size: .92em; }
.pgpc-cookies { width: 100%; border-collapse: collapse; margin: 6px 0 0; font-size: .9em; }
.pgpc-cookies th, .pgpc-cookies td { text-align: left; padding: 4px 6px; border-bottom: 1px solid rgba(127,127,127,.15); vertical-align: top; }
.pgpc-cookies code { font-size: .95em; background: rgba(127,127,127,.12); padding: 1px 4px; border-radius: 3px; }

/* Interruttore */
.pgpc-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; margin: 0; }
.pgpc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.pgpc-switch span { position: absolute; inset: 0; background: #9aa1a9; border-radius: 26px; transition: background .15s; }
.pgpc-switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .15s; }
.pgpc-switch input:checked + span { background: var(--pgpc-btn-bg); }
.pgpc-switch input:checked + span::after { transform: translateX(20px); }

/* Pulsante flottante per riaprire le preferenze */
#pgpc-root .pgpc-float {
	position: fixed; bottom: 16px; z-index: 2147483630; width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0;
	background: var(--pgpc-btn-bg); color: var(--pgpc-btn-text); box-shadow: 0 4px 16px rgba(0,0,0,.25); cursor: pointer;
	display: flex; align-items: center; justify-content: center;
}
.pgpc-float-left { left: 16px; }
.pgpc-float-right { right: 16px; }
.pgpc-show-banner .pgpc-float { display: none !important; }

/* Segnaposto contenuti bloccati */
.pgpc-placeholder {
	display: flex; align-items: center; justify-content: center; text-align: center; width: 100%;
	background: #f1f3f5; color: #1f2328; border: 1px dashed #adb5bd; border-radius: var(--pgpc-radius, 8px); padding: 20px; font-size: 15px; line-height: 1.5;
}
.pgpc-placeholder p { margin: 0 0 12px; }

@media (max-width: 782px) {
	.pgpc-banner { flex-direction: column; align-items: stretch; padding: 18px 16px 16px; }
	.pgpc-content { padding-right: 24px; }
	.pgpc-actions { justify-content: stretch; }
	#pgpc-root .pgpc-actions .pgpc-btn { flex: 1 1 auto; }
	.pgpc-pos-box-left .pgpc-banner, .pgpc-pos-box-right .pgpc-banner { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; }
	.pgpc-links { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
	#pgpc-root * { transition: none !important; }
}

/* Barra del rilevamento tracker (solo amministratore) */
#pgpc-root .pgpc-audit {
	position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 2147483646; background: #1d2327; color: #fff;
	padding: 10px 14px; border-radius: 8px; font-size: 13px; line-height: 1.4; box-shadow: 0 6px 24px rgba(0,0,0,.3);
	display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
}
#pgpc-root .pgpc-audit a { color: #8ab4ff; }
#pgpc-root .pgpc-audit button { margin-left: auto; background: #fff; color: #1d2327; border: 0; border-radius: 6px; padding: 6px 12px; font: inherit; font-weight: 600; cursor: pointer; }
