/* DALA APPS CORE – cookie consent. Uses theme tokens when present, with fallbacks. */
.dala-cc[hidden] { display: none !important; }
.dala-cc {
	position: fixed;
	z-index: 9990;
	left: max(16px, env(safe-area-inset-left));
	bottom: max(16px, env(safe-area-inset-bottom));
	width: min(440px, calc(100vw - 32px));
	color: var(--text, #e8eefa);
	font-family: var(--font-sans, system-ui, sans-serif);
}
.dala-cc__card,
.dala-cc-dialog__inner {
	background: var(--surface-strong, rgba(20, 44, 86, 0.92));
	border: 1px solid var(--line-strong, rgba(140, 180, 255, 0.28));
	border-radius: 18px;
	box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(18px) saturate(140%);
	-webkit-backdrop-filter: blur(18px) saturate(140%);
}
.dala-cc__card { padding: 1.25rem 1.35rem 1.35rem; }
@media (prefers-reduced-motion: no-preference) {
	.dala-cc:not([hidden]) .dala-cc__card { animation: dala-cc-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both 0.4s; }
}
@keyframes dala-cc-in { from { opacity: 0; transform: translateY(12px); } }
.dala-cc__title { font-size: 1.05rem; margin: 0 0 0.4rem; color: var(--heading, #fff); letter-spacing: -0.01em; }
.dala-cc__text { font-size: 0.93rem; line-height: 1.55; margin: 0 0 1rem; color: var(--text-muted, #a3b5d4); }
.dala-cc__text a { color: var(--accent, #7fb0ff); }
:root:not([data-theme="light"]) .dala-cc__text a { color: #9cc2ff; }
.dala-cc__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.dala-cc__btn {
	min-height: 44px;
	padding: 0.55rem 0.9rem;
	border-radius: 12px;
	border: 1px solid var(--line-strong, rgba(140, 180, 255, 0.35));
	background: var(--bg-raised, #0b1b36);
	color: var(--heading, #fff);
	font: 600 0.93rem/1.2 var(--font-sans, system-ui, sans-serif);
	cursor: pointer;
	transition: border-color 0.2s, background-color 0.2s;
}
.dala-cc__btn:hover { border-color: var(--accent, #2e7bff); }
.dala-cc__btn:focus-visible { outline: 2px solid var(--focus, #8ab8ff); outline-offset: 2px; }
.dala-cc__btn--link {
	grid-column: 1 / -1;
	background: transparent;
	border-color: transparent;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	color: var(--text, #e8eefa);
}
.dala-cc__btn--link:hover { border-color: transparent; color: var(--heading, #fff); }

@media (max-width: 560px) {
	.dala-cc { left: 0; right: 0; bottom: 0; width: 100%; }
	.dala-cc__card { border-radius: 18px 18px 0 0; padding-bottom: max(1.25rem, env(safe-area-inset-bottom)); border-bottom: 0; }
}

/* Preferences dialog */
.dala-cc-dialog {
	padding: 0;
	border: 0;
	background: transparent;
	width: min(600px, calc(100vw - 24px));
	max-height: calc(100dvh - 24px);
	color: var(--text, #e8eefa);
	font-family: var(--font-sans, system-ui, sans-serif);
}
.dala-cc-dialog::backdrop { background: rgba(3, 8, 20, 0.6); backdrop-filter: blur(3px); }
.dala-cc-dialog[open]:not(:modal) { position: fixed; inset: 12px; margin: auto; z-index: 9995; }
.dala-cc-dialog__inner { position: relative; padding: 1.5rem; max-height: calc(100dvh - 24px); overflow-y: auto; background: var(--bg-raised, #0b1b36); }
.dala-cc-dialog h2 { margin: 0 2.5rem 0.5rem 0; font-size: 1.3rem; color: var(--heading, #fff); }
.dala-cc-dialog__intro { color: var(--text-muted, #a3b5d4); font-size: 0.95rem; margin: 0 0 1rem; }
.dala-cc-dialog__meta { font-size: 0.85rem; color: var(--text-muted, #a3b5d4); margin: 0.75rem 0 1rem; min-height: 1em; }
.dala-cc-dialog .dala-cc__actions { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .dala-cc-dialog .dala-cc__actions { grid-template-columns: 1fr; } }
.dala-cc-dialog__close {
	position: absolute; top: 0.9rem; right: 0.9rem;
	width: 44px; height: 44px; border-radius: 12px;
	border: 1px solid var(--line, rgba(140, 180, 255, 0.2));
	background: transparent; color: var(--heading, #fff);
	font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.dala-cc-cat { padding: 0.9rem 0; border-top: 1px solid var(--line, rgba(140, 180, 255, 0.16)); }
.dala-cc-cat.is-unused .dala-cc-cat__name { color: var(--text-muted, #a3b5d4); }
.dala-cc-cat__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.dala-cc-cat__name { font-weight: 650; color: var(--heading, #fff); }
.dala-cc-cat__desc { margin: 0.35rem 0 0; font-size: 0.9rem; line-height: 1.5; color: var(--text-muted, #a3b5d4); }
.dala-cc-cat__desc strong { color: var(--text, #e8eefa); font-weight: 600; }

/* Accessible switch: a real checkbox with a styled track */
.dala-cc-switch { position: relative; display: inline-block; width: 48px; height: 28px; flex: none; }
.dala-cc-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.dala-cc-switch input:disabled { cursor: not-allowed; }
.dala-cc-switch span {
	position: absolute; inset: 0; border-radius: 999px;
	background: var(--line-strong, rgba(140, 180, 255, 0.3));
	transition: background-color 0.2s;
}
.dala-cc-switch span::after {
	content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
	background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s;
}
.dala-cc-switch input:checked + span { background: var(--accent, #2e7bff); }
.dala-cc-switch input:checked + span::after { transform: translateX(20px); }
.dala-cc-switch input:disabled + span { opacity: 0.55; }
.dala-cc-switch input:focus-visible + span { outline: 2px solid var(--focus, #8ab8ff); outline-offset: 2px; }

@media print { .dala-cc, .dala-cc-dialog { display: none !important; } }
