/* VSO Consent. Contrast is fixed by construction: text #1a1a1a on #fff = 17.4:1; --vso-accent is
 * darkened server-side until white on it is >= 7:1 (VSO_Consent::colors()), which also makes it
 * >= 7:1 as link text on white. px units on purpose: themes that set html{font-size:62.5%} would
 * otherwise shrink the banner below readable size. */
/* Banner and dialog take the top z-index slots: chat bubbles (AI Engine, tawk, Tidio) ship at
 * 2147483000+ and sat on the Accept button on phones. The icon stays below them. */
#vso-cc, #vso-cc-prefs, #vso-cc-icon { --vso-text: #1a1a1a; --vso-bg: #ffffff; --vso-line: #6b6f76; }
#vso-cc, #vso-cc *, #vso-cc-prefs, #vso-cc-prefs * { box-sizing: border-box; letter-spacing: normal; text-transform: none; }

#vso-cc {
	position: fixed; z-index: 2147483646; top: auto; right: auto; left: 16px; bottom: 16px; height: auto; width: 440px; max-width: calc(100vw - 32px);
	max-height: calc(100vh - 32px); overflow: auto; background: var(--vso-bg); color: var(--vso-text);
	border-radius: 10px; box-shadow: 0 6px 28px rgba(0, 0, 0, .28); padding: 20px 20px 14px;
	font-size: 15px; line-height: 1.5; font-family: inherit; text-align: start;
}
#vso-cc .vso-cc-sub { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 10px; }
#vso-cc .vso-cc-sub .vso-cc-lang { justify-self: center; max-width: 100%; }

/* language picker: a pill (flag, name, chevron) opening a search box over a scrolling list (ui.js).
 * #1a1a1a on #fff = 17.4:1, on hover/active #eceef1 = 15.0:1; #45484e on #fff = 9.2:1, on #eceef1 = 7.9:1;
 * border #6b6f76 = 5.05:1 (>= 3:1 for a control edge) */
#vso-cc .vso-cc-lang, #vso-cc-prefs .vso-cc-lang {
	display: inline-flex; align-items: center; gap: 8px; flex: 0 1 auto; width: auto; min-width: 0; max-width: 12em; height: 44px; min-height: 44px;
	margin: 0; padding: 0 14px 0 12px; border: 1px solid var(--vso-line); border-radius: 22px; cursor: pointer; box-shadow: none;
	background: var(--vso-bg); color: var(--vso-text); font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; text-align: start;
}
#vso-cc .vso-cc-lang:hover, #vso-cc-prefs .vso-cc-lang:hover, .vso-cc-lang[aria-expanded="true"] { background: #eceef1; color: var(--vso-text); border-color: var(--vso-text); }
.vso-cc-lang::after {
	content: ""; flex: 0 0 auto; width: 7px; height: 7px; margin-inline-start: 2px; border: solid currentColor; border-width: 0 2px 2px 0;
	transform: translateY(-2px) rotate(45deg);
}
.vso-cc-lang[aria-expanded="true"]::after { transform: translateY(2px) rotate(225deg); }
.vso-cc-lname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#vso-cc .vso-cc-flag, #vso-cc-prefs .vso-cc-flag {
	display: block; flex: 0 0 20px; width: 20px; height: 15px; max-width: none; margin: 0; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
}
.vso-cc-lpop {
	position: fixed; z-index: 1; display: flex; flex-direction: column; padding: 8px; background: var(--vso-bg); color: var(--vso-text);
	border: 1px solid var(--vso-line); border-radius: 10px; box-shadow: 0 10px 32px rgba(0, 0, 0, .3); font-size: 15px; line-height: 1.3; text-align: start;
}
#vso-cc .vso-cc-q, #vso-cc-prefs .vso-cc-q {
	-webkit-appearance: none; appearance: none; flex: 0 0 auto; width: 100%; height: 44px; margin: 0 0 6px; padding: 0 10px 0 36px;
	border: 1px solid var(--vso-line); border-radius: 6px; box-shadow: none; color: var(--vso-text); font-family: inherit; font-size: 15px;
	background: var(--vso-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='6.5' cy='6.5' r='5' fill='none' stroke='%231a1a1a' stroke-width='2'/%3E%3Cpath d='M10.3 10.3L15 15' stroke='%231a1a1a' stroke-width='2'/%3E%3C/svg%3E") no-repeat 12px center;
}
#vso-cc[dir="rtl"] .vso-cc-q, #vso-cc-prefs[dir="rtl"] .vso-cc-q { padding: 0 36px 0 10px; background-position: right 12px center; }
.vso-cc-q::placeholder { color: #45484e; opacity: 1; }
#vso-cc .vso-cc-opts, #vso-cc-prefs .vso-cc-opts {
	position: relative; flex: 1 1 auto; min-height: 0; margin: 0; padding: 0; list-style: none; overflow-y: auto; overscroll-behavior: contain;
}
#vso-cc .vso-cc-opts li, #vso-cc-prefs .vso-cc-opts li {
	display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; padding: 6px 10px; border: 0; border-radius: 6px; cursor: pointer; list-style: none;
}
.vso-cc-opts li[hidden] { display: none !important; }
.vso-cc-opts li.vso-cc-on { background: #eceef1; }
.vso-cc-opts li[aria-selected="true"] { font-weight: 700; box-shadow: inset 3px 0 0 var(--vso-accent); }
[dir="rtl"] .vso-cc-opts li[aria-selected="true"] { box-shadow: inset -3px 0 0 var(--vso-accent); }
.vso-cc-opts li small { margin-inline-start: auto; font-size: 12px; font-weight: 400; color: #45484e; }
#vso-cc .vso-cc-none, #vso-cc-prefs .vso-cc-none { margin: 10px; font-size: 14px; color: #45484e; }
.vso-cc-none[hidden] { display: none; }
#vso-cc h2, #vso-cc-prefs h2 { font-weight: 700 ; font-size: 18px; line-height: 1.3; font-family: inherit; color: var(--vso-text); margin: 0 0 8px; padding: 0; }
#vso-cc p, #vso-cc-prefs p { margin: 0 0 12px; font-size: 15px; line-height: 1.5; color: var(--vso-text); }
#vso-cc a, #vso-cc-prefs a { color: var(--vso-accent); font-weight: 600; text-decoration: underline; }
#vso-cc .vso-cc-note { font-size: 14px; }

.vso-cc-row { display: flex; gap: 10px; margin: 0 0 8px; }
.vso-cc-row > * { flex: 1 1 0; }
#vso-cc .vso-cc-btn, #vso-cc-prefs .vso-cc-btn {
	min-height: 44px; padding: 10px 14px; border: 2px solid var(--vso-accent); border-radius: 6px; cursor: pointer;
	background: var(--vso-accent); color: var(--vso-on); font-weight: 600 ; font-size: 15px; line-height: 1.25; font-family: inherit; text-align: center; margin: 0;
}
#vso-cc .vso-cc-alt, #vso-cc-prefs .vso-cc-alt { background: var(--vso-bg); color: var(--vso-accent); }
#vso-cc .vso-cc-link {
	display: block; width: 100%; min-height: 44px; background: none; border: 0; padding: 8px; margin: 0; cursor: pointer;
	color: var(--vso-accent); font-weight: 600 ; font-size: 15px; line-height: 1.25; font-family: inherit; text-decoration: underline;
}
#vso-cc button:focus-visible, #vso-cc a:focus-visible, #vso-cc-prefs button:focus-visible, #vso-cc-prefs a:focus-visible,
#vso-cc-prefs input:focus-visible, #vso-cc-icon:focus-visible, #vso-cc input:focus-visible {
	outline: 3px solid var(--vso-text); outline-offset: 2px; box-shadow: 0 0 0 2px #fff;
}

/* popover (top layer, see lift() in ui.js): undo the UA [popover] box so our geometry holds */
#vso-cc[popover], #vso-cc-prefs[popover] { margin: 0; border: 0; }
#vso-cc.vso-cc-right { left: auto; right: 16px; }
#vso-cc-prefs[popover] { inset: 0; width: auto; height: auto; max-width: none; max-height: none; color: inherit; }

/* preferences */
#vso-cc-prefs {
	position: fixed; inset: 0; z-index: 2147483647; background: rgba(0, 0, 0, .55);
	display: flex; align-items: center; justify-content: center; padding: 16px; font-family: inherit;
}
html.vso-cc-lock { overflow: hidden; }
/* Head and foot stay fixed; only .vso-cc-body scrolls. */
#vso-cc-prefs .vso-cc-box {
	position: relative; display: flex; flex-direction: column; background: var(--vso-bg); color: var(--vso-text);
	border-radius: 10px; width: 560px; max-width: 100%;
	max-height: calc(100vh - 32px); padding: 0; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .35));
}
/* title, pill and X share one centre line; the X's 44px box ends 12px from the edge, so the glyph
 * lines up with the 20px text inset */
.vso-cc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 8px 8px 20px; flex: 0 0 auto; }
#vso-cc-prefs[dir="rtl"] .vso-cc-head { padding: 12px 20px 8px 8px; }
#vso-cc-prefs .vso-cc-head h2 { flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; }
.vso-cc-tools { display: flex; align-items: center; gap: 4px; flex: 0 1 auto; min-width: 0; margin: 0; }
.vso-cc-mid { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#vso-cc-prefs .vso-cc-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px; }
#vso-cc-prefs .vso-cc-foot { flex: 0 0 auto; padding: 12px 20px 8px; border-top: 1px solid var(--vso-line); text-align: center; }
#vso-cc-prefs .vso-cc-foot p { margin: 0 0 8px; }

/* "more" cue: a fade plus a pill while the list continues below the fold */
.vso-cc-more {
	position: absolute; left: 0; right: 0; bottom: 0; height: 72px; display: flex; align-items: flex-end; justify-content: center;
	padding-bottom: 8px; pointer-events: none; background: linear-gradient(rgba(255, 255, 255, 0), var(--vso-bg) 50%);
}
.vso-cc-more[hidden] { display: none; }
#vso-cc-prefs .vso-cc-pill {
	pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 14px; margin: 0;
	border: 1px solid var(--vso-accent); border-radius: 999px; background: var(--vso-bg); color: var(--vso-accent);
	font-weight: 600; font-size: 13px; line-height: 1.2; font-family: inherit; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
#vso-cc-prefs .vso-cc-pill::after {
	content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg);
}

/* unbranded: the dialog ends in two centred links, the cookie policy and a small maker line */
#vso-cc-prefs .vso-cc-links { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 0; }
#vso-cc-prefs .vso-cc-links a { font-size: 14px; }
/* #505359 on #fff = 7.9:1 */
#vso-cc-prefs .vso-cc-links .vso-cc-by { font-size: 12px; color: #505359; text-decoration: none; }
#vso-cc-prefs .vso-cc-links .vso-cc-by:hover { text-decoration: underline; }
#vso-cc-prefs .vso-cc-x {
	width: 44px; height: 44px; flex: 0 0 44px; border: 0; background: none; cursor: pointer; font-size: 28px; line-height: 1;
	color: var(--vso-text); border-radius: 6px; margin: 0; padding: 0;
}
#vso-cc-prefs .vso-cc-cats { list-style: none; margin: 0 0 12px; padding: 0; }
#vso-cc-prefs .vso-cc-cats li { border-top: 1px solid var(--vso-line); padding: 12px 0 0; margin: 0; }
#vso-cc-prefs .vso-cc-cats li p { font-size: 14px; }
.vso-cc-cat { display: flex; align-items: center; gap: 10px; min-height: 44px; }
#vso-cc-prefs .vso-cc-cat label { flex: 1 1 auto; font-weight: 700; font-size: 16px; cursor: pointer; margin: 0; color: var(--vso-text); }
.vso-cc-always { font-size: 14px; font-weight: 600; }

/* switch: a real checkbox, restyled; 44x26 visual inside a 44px touch row */
#vso-cc-prefs input[role="switch"] {
	-webkit-appearance: none; appearance: none; position: relative; flex: 0 0 48px; width: 48px; height: 28px; margin: 0;
	border-radius: 14px; background: #6b6f76; border: 2px solid #6b6f76; cursor: pointer;
}
#vso-cc-prefs input[role="switch"]::after {
	content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
}
#vso-cc-prefs input[role="switch"]:checked { background: var(--vso-accent); border-color: var(--vso-accent); }
#vso-cc-prefs input[role="switch"]:checked::after { left: 22px; }
#vso-cc-prefs input[role="switch"]:disabled { opacity: 1; cursor: not-allowed; background: var(--vso-accent); border-color: var(--vso-accent); }
#vso-cc-prefs input[role="switch"]:disabled::after { left: 22px; }

/* cookie icon: thin white ring, site-colour disc, then the cookie (its own white border is in the
 * SVG). Draggable with corner snap like the VSO chat launcher (ui.js). */
#vso-cc-icon {
	position: fixed; z-index: 2147482999; width: 56px; height: 56px; border-radius: 50%; border: 2px solid #fff;
	background: var(--vso-accent); display: flex; bottom: calc(16px + var(--vso-lift, 0px)); align-items: center; justify-content: center;
	cursor: grab; box-shadow: 0 2px 12px rgba(0, 0, 0, .3); padding: 0; margin: 0; touch-action: none;
	user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
}
#vso-cc-icon.vso-cc-top { bottom: auto; top: calc(16px + var(--vso-lift, 0px)); }
#vso-cc-icon.vso-cc-free { inset: auto !important; left: var(--vso-x) !important; top: var(--vso-y) !important; }
#vso-cc-icon.vso-cc-drag { cursor: grabbing; transform: scale(1.08); box-shadow: 0 10px 28px rgba(0, 0, 0, .4); }
#vso-cc-icon.vso-cc-snap { transition: left .56s cubic-bezier(.5, .05, .25, 1.1), top .56s cubic-bezier(.5, .05, .25, 1.1) !important; }
/* the white bubble is 39/48 of the svg: 52px leaves a ~5px site-colour ring inside the white border */
#vso-cc-icon svg { pointer-events: none; width: 52px; height: 52px; flex: 0 0 auto; }
#vso-cc-icon[hidden] { display: none; }
#vso-cc-icon.vso-cc-left { left: calc(16px + var(--vso-shift, 0px)); }
#vso-cc-icon.vso-cc-right { right: calc(16px + var(--vso-shift, 0px)); }

/* phones: a compact bottom sheet, never the 48-77% of the viewport ConsentMagic took (debt 6128) */
@media (max-width: 600px) {
	#vso-cc, #vso-cc.vso-cc-right { left: 0; right: 0; bottom: 0; width: 100%; max-width: 100%; border-radius: 12px 12px 0 0; padding: 16px 16px 8px; max-height: 60vh; }
	#vso-cc h2 { font-size: 17px; margin-bottom: 6px; }
	#vso-cc .vso-cc-lang, #vso-cc-prefs .vso-cc-lang { max-width: 10em; padding: 0 12px 0 10px; font-size: 13px; }
	#vso-cc p { font-size: 14px; margin-bottom: 10px; }
	#vso-cc-prefs { padding: 0; align-items: flex-end; }
	#vso-cc-prefs .vso-cc-box { border-radius: 12px 12px 0 0; max-height: 92vh; margin: 0; }
	#vso-cc-icon { width: 52px; height: 52px; bottom: calc(12px + var(--vso-lift, 0px)); }
	#vso-cc-icon svg { width: 49px; height: 49px; }
	#vso-cc-icon.vso-cc-top { top: calc(12px + var(--vso-lift, 0px)); }
	#vso-cc-icon.vso-cc-left { left: calc(12px + var(--vso-shift, 0px)); }
	#vso-cc-icon.vso-cc-right { right: calc(12px + var(--vso-shift, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
	#vso-cc-icon.vso-cc-snap { transition: left .22s linear, top .22s linear !important; }
}
@media (prefers-reduced-motion: no-preference) {
	#vso-cc { animation: vso-cc-in .2s ease-out; }
	@keyframes vso-cc-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
}
/* [vso_consent_settings style="button"]: in-line text with a thin pill outline. It takes the
 * surrounding text colour, so it has the contrast the site's own text has. */
a.vso-consent-open--btn {
	display: inline-block; padding: 2px 10px; border: 1px solid currentColor; border-radius: 999px; color: inherit;
	font-size: .9em; line-height: 1.6; text-decoration: none; vertical-align: baseline; cursor: pointer; white-space: nowrap;
}
a.vso-consent-open--btn:hover { text-decoration: underline; color: inherit; }
a.vso-consent-open--btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media print { #vso-cc, #vso-cc-icon, #vso-cc-prefs { display: none !important; } }
