/* ThinkConsent — stile ThinkClouds */
.tc-root, .tc-ph, .thinkconsent-policy, .thinkconsent-open {
	--tc-accent: #111111;
	--tc-ink: #ffffff;
	--tc-accent-dk: #f2f2f2;
	--tc-ink-dk: #111111;
	--tc-radius: 14px;
	--tc-size: 15px;
	--tc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--tc-font-title: var(--tc-font);
}
.tc-root {
	--tc-bg: #ffffff;
	--tc-fg: #1a1a1a;
	--tc-muted: #555555;
	--tc-line: #e3e3e3;
	--tc-shadow: 0 12px 40px rgba(0, 0, 0, .18);
	font-family: var(--tc-font);
	font-size: var(--tc-size);
	font-weight: 400;
	line-height: 1.5;
	color: var(--tc-fg);
}
.tc-root *, .tc-root *::before, .tc-root *::after { box-sizing: border-box; }
.tc-theme-dark, .tc-root .tc-theme-dark {
	--tc-bg: #161616;
	--tc-fg: #f2f2f2;
	--tc-muted: #b8b8b8;
	--tc-line: #333333;
	--tc-shadow: 0 12px 40px rgba(0, 0, 0, .55);
}

/* ---------- banner ---------- */
.tc-banner {
	position: fixed;
	z-index: 2147483000;
	background: var(--tc-bg);
	color: var(--tc-fg);
	box-shadow: var(--tc-shadow);
	padding: 22px 24px 20px;
	animation: tc-in .25s ease-out;
}
.tc-layout-box { bottom: 20px; width: min(440px, calc(100vw - 32px)); border-radius: var(--tc-radius); border: 1px solid var(--tc-line); }
.tc-layout-box.tc-pos-left { left: 20px; }
.tc-layout-box.tc-pos-right { right: 20px; }
.tc-layout-box.tc-pos-center { left: 50%; transform: translateX(-50%); width: min(620px, calc(100vw - 32px)); }
.tc-layout-bar { left: 0; right: 0; bottom: 0; border-top: 1px solid var(--tc-line); padding: 20px max(24px, calc((100vw - 1180px) / 2)); }
.tc-layout-bar .tc-actions { justify-content: flex-start; }

.tc-title { margin: 0 34px 8px 0; font-family: var(--tc-font-title); font-size: 1.13em; font-weight: 700; line-height: 1.3; color: inherit; letter-spacing: 0; text-transform: none; }
.tc-msg { margin: 0 0 10px; color: var(--tc-fg); font-size: .93em; }
.tc-links { margin: 0 0 14px; font-size: .87em; display: flex; gap: 16px; flex-wrap: wrap; }
.tc-links a { color: var(--tc-fg); text-decoration: underline; text-underline-offset: 2px; }

.tc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tc-btn {
	flex: 1 1 auto;
	min-height: 44px;
	padding: 10px 18px;
	border: 2px solid var(--tc-accent);
	border-radius: calc(var(--tc-radius) * .6);
	background: var(--tc-accent);
	color: var(--tc-ink);
	font-family: inherit;
	font-size: .93em;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-transform: none;
	letter-spacing: 0;
}
.tc-btn:hover { filter: brightness(1.12); }
.tc-btn-alt { background: transparent; color: var(--tc-fg); border-color: var(--tc-fg); }
.tc-btn:focus-visible, .tc-x:focus-visible, .tc-revoke:focus-visible, .tc-links a:focus-visible, .tc-switch input:focus-visible + .tc-slider {
	outline: 3px solid #2f6fed;
	outline-offset: 2px;
}

.tc-x {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--tc-fg);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}
.tc-x:hover { background: var(--tc-line); }

/* ---------- preferenze ---------- */
.tc-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	background: rgba(0, 0, 0, .45);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	animation: tc-fade .2s ease-out;
}
.tc-modal {
	position: relative;
	background: var(--tc-bg);
	color: var(--tc-fg);
	width: min(640px, 100%);
	max-height: calc(100vh - 32px);
	display: flex;
	flex-direction: column;
	border-radius: var(--tc-radius);
	box-shadow: var(--tc-shadow);
	overflow: hidden;
}
.tc-modal-head { position: relative; padding: 20px 24px 8px; }
.tc-modal-body { padding: 4px 24px 8px; overflow-y: auto; }
.tc-modal-foot { padding: 14px 24px 20px; border-top: 1px solid var(--tc-line); }
.tc-modal-foot .tc-links { margin-bottom: 12px; }

.tc-cat { border-top: 1px solid var(--tc-line); padding: 14px 0; }
.tc-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tc-cat h3 { margin: 0; font-family: var(--tc-font-title); font-size: 1em; font-weight: 700; color: inherit; }
.tc-cat h3 label { cursor: pointer; }
.tc-cat-desc { margin: 4px 0 0; color: var(--tc-muted); font-size: .87em; }
.tc-always { font-size: .8em; font-weight: 600; color: var(--tc-muted); }
.tc-svc-list { list-style: none; margin: 10px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--tc-line); }
.tc-svc-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: .93em; margin: 0; }

.tc-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.tc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.tc-slider { position: absolute; inset: 0; border-radius: 26px; background: #8a8a8a; transition: background .15s; }
.tc-slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .15s; }
.tc-switch input:checked + .tc-slider { background: var(--tc-accent); }
.tc-switch input:checked + .tc-slider::before { transform: translateX(20px); }
.tc-switch input:indeterminate + .tc-slider::before { transform: translateX(10px); }

/* ---------- segnaposto contenuti bloccati ---------- */
.tc-ph {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 12px;
	width: 100%;
	min-height: 200px;
	aspect-ratio: 16 / 9;
	padding: 20px;
	border-radius: 10px;
	background: #f1f1f1;
	color: #1a1a1a;
	font-family: var(--tc-font);
	font-size: calc(var(--tc-size) * .93);
	line-height: 1.5;
	text-align: center;
	--tc-fg: #1a1a1a;
}
.tc-ph.tc-theme-dark { background: #1f1f1f; color: #f2f2f2; --tc-fg: #f2f2f2; }
.tc-theme-dark .tc-btn:not(.tc-btn-alt) { background: var(--tc-accent-dk); border-color: var(--tc-accent-dk); color: var(--tc-ink-dk); }
.tc-theme-dark .tc-switch input:checked + .tc-slider { background: var(--tc-accent-dk); }
.tc-theme-dark .tc-switch input:checked + .tc-slider::before { background: var(--tc-ink-dk); }
.tc-ph p { margin: 0 auto; max-width: 46ch; }
.tc-ph-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tc-ph .tc-btn { flex: 0 0 auto; }

/* ---------- pulsante di revoca ---------- */
.tc-revoke {
	position: fixed;
	bottom: 16px;
	z-index: 2147482999;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var(--tc-line);
	background: var(--tc-bg);
	color: var(--tc-fg);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.tc-revoke-left { left: 16px; }
.tc-revoke-right { right: 16px; }

html.tc-noscroll { overflow: hidden; }

@keyframes tc-in { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes tc-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 600px) {
	.tc-layout-box, .tc-layout-box.tc-pos-left, .tc-layout-box.tc-pos-right, .tc-layout-box.tc-pos-center {
		left: 8px; right: 8px; bottom: 8px; width: auto; transform: none;
	}
	.tc-btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
	.tc-banner, .tc-overlay { animation: none; }
	.tc-slider, .tc-slider::before { transition: none; }
}
@media print { .tc-root { display: none !important; } }

/* ---------- widget / shortcode "Preferenze cookie" ---------- */
.tc-el-wrap { display: block; }
a.tc-el-open, button.tc-el-open { cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .5em; }
.tc-el-open.tc-el-button {
	padding: .7em 1.2em;
	border-radius: calc(var(--tc-radius) * .6);
	background: var(--tc-accent);
	color: var(--tc-ink);
	font-weight: 600;
	line-height: 1.2;
	border: 0;
}
.tc-el-open.tc-el-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.tc-el-open svg { width: 1.1em; height: 1.1em; flex: 0 0 auto; }
.tc-el-open:focus-visible { outline: 3px solid #2f6fed; outline-offset: 2px; }
