/* Cookie consent banner — self-contained layout (title + copy + actions).
   Avoid multi-column grids on the root that scatter title/body/buttons. */

.usedocs-consent {
	position: fixed;
	left: max(16px, env(safe-area-inset-left, 0px));
	right: auto;
	bottom: max(16px, env(safe-area-inset-bottom, 0px));
	z-index: 99999;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 14px;
	width: min(calc(100% - 32px), 420px);
	max-width: 420px;
	margin: 0;
	padding: 16px 18px;
	border: 1px solid var(--line, #e4e4e7);
	border-radius: 16px;
	background: var(--surface, #fff);
	box-shadow:
		0 1px 2px rgba(24, 24, 27, 0.04),
		0 16px 48px rgba(24, 24, 27, 0.14);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: var(--ink, #18181b);
}

.usedocs-consent *,
.usedocs-consent *::before,
.usedocs-consent *::after {
	box-sizing: border-box;
}

.usedocs-consent[hidden] {
	display: none !important;
}

.usedocs-consent-body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.usedocs-consent-title {
	margin: 0;
	padding: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
	color: var(--ink, #18181b);
}

.usedocs-consent-text {
	margin: 0;
	padding: 0;
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--ink-soft, #52525b);
}

.usedocs-consent-text a {
	color: var(--brand, #5249e8);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.usedocs-consent-text a:focus-visible {
	outline: 2px solid #71717a;
	outline-offset: 2px;
	border-radius: 2px;
}

.usedocs-consent-actions {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
}

.usedocs-consent-actions button {
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	margin: 0;
	padding: 8px 16px;
	border-radius: 10px;
	border: 1px solid transparent;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	touch-action: manipulation;
	transition:
		background-color 0.12s ease,
		border-color 0.12s ease,
		color 0.12s ease;
}

.usedocs-consent-actions button:focus-visible {
	outline: 2px solid #71717a;
	outline-offset: 2px;
}

.usedocs-consent-accept {
	background: var(--ink, #0a0a0a);
	color: #fff;
	border-color: var(--brand, #5249e8);
}

.usedocs-consent-accept:hover {
	background: var(--brand, #5b54f5);
	border-color: var(--brand-hover, #4338ca);
}

.usedocs-consent-reject {
	background: #fff;
	color: var(--ink, #18181b);
	border-color: var(--line, #d4d4d8);
}

.usedocs-consent-reject:hover {
	background: var(--line-soft, #f4f4f5);
}

/* Desktop: body left, Accept + Reject as a horizontal pair on the right */
@media (min-width: 640px) {
	.usedocs-consent {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 20px;
		width: min(calc(100% - 32px), 560px);
		max-width: 560px;
	}

	.usedocs-consent-body {
		flex: 1 1 auto;
		min-width: 0;
	}

	.usedocs-consent-actions {
		flex: 0 0 auto;
		flex-wrap: nowrap;
	}
}

/* System dark preference */
@media (prefers-color-scheme: dark) {
	.usedocs-consent {
		border-color: rgba(255, 255, 255, 0.12);
		background: #18181b;
		color: #fafafa;
		box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
	}

	.usedocs-consent-title {
		color: #fafafa;
	}

	.usedocs-consent-text {
		color: #a1a1aa;
	}

	.usedocs-consent-reject {
		background: transparent;
		color: #fafafa;
		border-color: rgba(255, 255, 255, 0.18);
	}

	.usedocs-consent-reject:hover {
		background: rgba(255, 255, 255, 0.08);
	}
}

/* Explicit dark class (dashboard theme) */
html.dark .usedocs-consent,
.dark .usedocs-consent {
	border-color: rgba(255, 255, 255, 0.12);
	background: #18181b;
	color: #fafafa;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

html.dark .usedocs-consent-title,
.dark .usedocs-consent-title {
	color: #fafafa;
}

html.dark .usedocs-consent-text,
.dark .usedocs-consent-text {
	color: #a1a1aa;
}

html.dark .usedocs-consent-reject,
.dark .usedocs-consent-reject {
	background: transparent;
	color: #fafafa;
	border-color: rgba(255, 255, 255, 0.18);
}

html.dark .usedocs-consent-reject:hover,
.dark .usedocs-consent-reject:hover {
	background: rgba(255, 255, 255, 0.08);
}
