/* Assisting AI — Cookie Consent. Uses site tokens when present, with standalone fallbacks. */
.aai-cc, .aai-cc-dialog {
	--cc-ink: var(--ink, #0D0E0C); --cc-muted: var(--muted, #5C6059); --cc-line: var(--line, #E2DED5);
	--cc-card: var(--card, #fff); --cc-paper: var(--paper, #F5F3EE); --cc-accent: var(--accent, #3D5AFE);
	font-family: var(--f-sans, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
	color: var(--cc-ink); letter-spacing: -.005em; box-sizing: border-box;
}
.aai-cc *, .aai-cc-dialog * { box-sizing: border-box; }
.aai-cc [hidden], .aai-cc-dialog [hidden] { display: none !important; }

/* Compact strip in the bottom corner: one short sentence + three equal choices, so it doesn't pull attention from the page. */
.aai-cc {
	position: fixed; z-index: 9999; left: 16px; bottom: 16px; width: max-content; max-width: min(760px, calc(100vw - 32px));
	display: flex; flex-wrap: nowrap; align-items: center; gap: 8px 14px;
	background: var(--cc-card); border-radius: 14px; padding: 10px 10px 10px 16px;
	box-shadow: 0 0 0 1px var(--cc-line), 0 12px 32px -12px rgba(13, 14, 12, .28);
	animation: aai-cc-in .3s cubic-bezier(.2, .7, .2, 1);
}
.aai-cc .aai-cc__text { flex: 1 1 auto; min-width: 200px; margin: 0; font-size: 13px; line-height: 1.45; }
.aai-cc__more { padding: 0; border: 0; background: none; font: inherit; color: var(--cc-ink); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; cursor: pointer; }
.aai-cc__more:focus-visible { outline: 2px solid var(--cc-accent); outline-offset: 2px; border-radius: 3px; }
.aai-cc.is-leaving { opacity: 0; transform: translateY(12px); transition: opacity .3s, transform .3s; }
@media (prefers-reduced-motion: reduce) { .aai-cc.is-leaving { transform: none; } }
.aai-cc .aai-cc__actions { flex: 0 1 auto; flex-wrap: nowrap; gap: 6px; }
.aai-cc .aai-cc__btn { flex: none; min-width: 0; height: 32px; padding: 0 14px; font-size: 13px; white-space: nowrap; }
.aai-cc .aai-cc__link { flex: none; height: 32px; padding: 0 6px; font-size: 13px; white-space: nowrap; }
@keyframes aai-cc-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .aai-cc { animation: none; } }

.aai-cc__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.aai-cc__title { margin: 0; margin-inline-end: auto; font-family: var(--f-display, inherit); font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; color: var(--cc-ink); }
/* Language menu: a native <select> (keyboard and screen-reader friendly) styled as a small pill. */
.aai-cc__lang { flex: none; position: relative; display: inline-flex; align-items: center; height: 30px; border-radius: 999px; border: 1px solid var(--cc-line); background: var(--cc-paper); color: var(--cc-ink); }
.aai-cc__lang svg { position: absolute; inset-inline-start: 9px; pointer-events: none; color: var(--cc-muted); }
.aai-cc__lang select { appearance: none; -webkit-appearance: none; height: 100%; max-width: 150px; margin: 0; padding-block: 0; padding-inline: 28px 24px; border: 0; border-radius: 999px; background: transparent url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2710%27 height=%2710%27 viewBox=%270 0 10 10%27%3E%3Cpath fill=%27none%27 stroke=%27%235C6059%27 stroke-width=%271.5%27 d=%27M2 3.5l3 3 3-3%27/%3E%3C/svg%3E") no-repeat; background-position: right 9px center; color: inherit; font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1; cursor: pointer; text-overflow: ellipsis; }
[dir="rtl"] .aai-cc__lang select { background-position: left 9px center; }
.aai-cc__lang:focus-within { outline: 2px solid var(--cc-accent); outline-offset: 2px; }
/* Banner: a tiny "EN" pill; the real <select> covers it invisibly, so tapping it opens the native language list. */
.aai-cc__lang--mini { height: 32px; }
.aai-cc__lang--mini svg { inset-inline-start: 8px; }
.aai-cc__lang-code { padding-inline: 26px 10px; font-size: 12px; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.aai-cc__lang--mini select { position: absolute; inset: 0; width: 100%; max-width: none; padding: 0; opacity: 0; }
.aai-cc__sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.aai-cc__x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--cc-muted); font-size: 22px; line-height: 1; cursor: pointer; }
.aai-cc__x:hover { background: var(--cc-paper); color: var(--cc-ink); }
.aai-cc__text, .aai-cc-dialog p { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: var(--cc-muted); }
.aai-cc__gpc { font-size: 13px !important; color: #0E6B47 !important; background: #DDF3E9; border-radius: 10px; padding: 8px 10px; }

.aai-cc__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* Accept and Reject share identical styling — no nudging towards "accept". */
.aai-cc__btn { flex: 1 1 0; min-width: 120px; height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--cc-ink); background: var(--cc-ink); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity .2s; }
.aai-cc__btn:hover { opacity: .88; }
.aai-cc__btn--ghost { background: transparent; color: var(--cc-ink); }
.aai-cc__link { flex-basis: 100%; height: 32px; border: 0; background: none; color: var(--cc-ink); font: inherit; font-size: 13.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.aai-cc__btn:focus-visible, .aai-cc__link:focus-visible, .aai-cc__x:focus-visible, .aai-cc__switch:focus-visible { outline: 2px solid var(--cc-accent); outline-offset: 2px; }
.aai-cc__links, .aai-cc__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 0 !important; font-size: 12.5px !important; }
.aai-cc__links a, .aai-cc__meta a { color: var(--cc-muted); text-decoration: underline; text-underline-offset: 2px; }
.aai-cc__meta code { font-size: 11.5px; }

/* ---------- Preferences dialog ---------- */
.aai-cc-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 20px; background: var(--cc-card); box-shadow: 0 30px 80px -20px rgba(13, 14, 12, .45); overflow: auto; }
.aai-cc-dialog::backdrop { background: rgba(13, 14, 12, .45); }
.aai-cc-dialog__inner { padding: 22px; margin: 0; }
.aai-cc__cat { border-top: 1px solid var(--cc-line); padding: 14px 0 4px; }
.aai-cc__cat p { margin-bottom: 8px !important; }
.aai-cc__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 15px; cursor: pointer; }
.aai-cc__always { font-size: 12.5px; font-weight: 600; color: #0E6B47; }
.aai-cc__tools { margin: 0 0 10px; padding: 0; list-style: none; font-size: 12.5px !important; color: var(--cc-muted); }
.aai-cc__tools code { font-size: 11.5px; background: var(--cc-paper); padding: 1px 5px; border-radius: 4px; }
.aai-cc__switch { appearance: none; -webkit-appearance: none; flex: none; width: 42px; height: 24px; margin: 0; border-radius: 999px; background: #C9C6BD; position: relative; cursor: pointer; transition: background-color .2s; }
.aai-cc__switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.aai-cc__switch:checked { background: var(--cc-accent); }
.aai-cc__switch:checked::after { transform: translateX(18px); }
.aai-cc__switch:disabled { opacity: .5; cursor: not-allowed; }
.aai-cc-dialog .aai-cc__actions { border-top: 1px solid var(--cc-line); padding-top: 16px; margin-top: 6px; }

/* ---------- Small screens: full-width sheet ---------- */
@media (max-width: 520px) {
	/* Phones: a slim strip along the bottom — sentence on top, the three choices in one row below. */
	.aai-cc { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; flex-wrap: wrap; gap: 8px; padding: 10px 10px 10px 12px; border-radius: 12px; }
	.aai-cc .aai-cc__text { flex-basis: 100%; font-size: 12.5px; }
	.aai-cc .aai-cc__actions { flex: 1 1 100%; }
	.aai-cc .aai-cc__btn { flex: 1 1 0; padding: 0 10px; }
	.aai-cc .aai-cc__link { padding: 0 4px; }
	.aai-cc__btn { min-width: 0; }
	.aai-cc-dialog__inner { padding: 18px 16px; }
}

/* ---------- Right-to-left languages (Arabic) ---------- */
.aai-cc[dir="rtl"], .aai-cc-dialog[dir="rtl"] { text-align: right; letter-spacing: 0; }
.aai-cc[dir="rtl"] .aai-cc__title, .aai-cc-dialog[dir="rtl"] .aai-cc__title { letter-spacing: 0; }
.aai-cc-dialog[dir="rtl"] .aai-cc__switch::after { left: auto; right: 3px; }
.aai-cc-dialog[dir="rtl"] .aai-cc__switch:checked::after { transform: translateX(-18px); }
.aai-cc__tools code, .aai-cc__meta code { direction: ltr; unicode-bidi: isolate; }
