/* NicoWeb Cookie Consent banner. Colours come from CSS variables set in the settings. */
.nwcc-root {
	--nwcc-bg: #fff;
	--nwcc-text: #1f2937;
	--nwcc-button: #047857;
	--nwcc-button-text: #fff;
	--nwcc-link: #065f46;
	--nwcc-radius: 12px;
	font-size: 15px;
	line-height: 1.5;
}

.nwcc-root [hidden] {
	display: none !important;
}

.nwcc-banner,
.nwcc-prefs {
	position: fixed;
	z-index: 2147483000;
	box-sizing: border-box;
	background: var(--nwcc-bg);
	color: var(--nwcc-text);
	border-radius: var(--nwcc-radius);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
	padding: 24px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
}

.nwcc-layout-box .nwcc-banner {
	bottom: 16px;
	width: calc(100% - 32px);
	max-width: 440px;
}

.nwcc-layout-box.nwcc-pos-left .nwcc-banner {
	left: 16px;
}

.nwcc-layout-box.nwcc-pos-right .nwcc-banner {
	right: 16px;
}

.nwcc-layout-bar .nwcc-banner {
	left: 0;
	right: 0;
	bottom: 0;
	border-radius: var(--nwcc-radius) var(--nwcc-radius) 0 0;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px 24px;
	align-items: center;
}

.nwcc-layout-bar .nwcc-banner > * {
	grid-column: 1;
}

.nwcc-layout-bar .nwcc-banner .nwcc-buttons {
	grid-column: 2;
	grid-row: 1 / span 3;
	margin-top: 0;
}

.nwcc-layout-modal .nwcc-banner,
.nwcc-prefs {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: calc(100% - 32px);
	max-width: 560px;
}

.nwcc-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147482999;
	background: rgba(0, 0, 0, 0.45);
}

.nwcc-title {
	margin: 0 0 8px;
	font-size: 1.15em;
	font-weight: 700;
	color: var(--nwcc-text);
}

.nwcc-message {
	margin: 0;
}

.nwcc-message p {
	margin: 0 0 8px;
}

.nwcc-root a {
	color: var(--nwcc-link);
	text-decoration: underline;
}

.nwcc-links {
	margin: 8px 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	font-size: 0.9em;
}

.nwcc-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}

/* Every button looks the same: accepting must not be easier or more prominent than rejecting. */
.nwcc-btn {
	flex: 1 1 auto;
	min-height: 44px;
	padding: 10px 18px;
	border: 2px solid var(--nwcc-button);
	border-radius: calc(var(--nwcc-radius) * 0.75);
	background: var(--nwcc-button);
	color: var(--nwcc-button-text);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.nwcc-btn:hover {
	filter: brightness(0.92);
}

.nwcc-btn:focus-visible,
.nwcc-settings-button:focus-visible,
.nwcc-switch input:focus-visible + .nwcc-switch-track {
	outline: 3px solid var(--nwcc-link);
	outline-offset: 2px;
}

.nwcc-categories {
	margin-top: 16px;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.nwcc-category {
	padding: 12px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nwcc-category-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
}

.nwcc-category-name {
	font-weight: 600;
}

.nwcc-category-desc {
	margin: 4px 0 0;
	font-size: 0.9em;
	opacity: 0.85;
}

.nwcc-always {
	font-size: 0.85em;
	font-weight: 600;
	color: var(--nwcc-link);
}

.nwcc-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex: none;
}

.nwcc-switch input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

.nwcc-switch-track {
	position: absolute;
	inset: 0;
	border-radius: 12px;
	background: #9ca3af;
	transition: background 0.15s;
}

.nwcc-switch-track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.15s;
}

.nwcc-switch input:checked + .nwcc-switch-track {
	background: var(--nwcc-button);
}

.nwcc-switch input:checked + .nwcc-switch-track::after {
	transform: translateX(20px);
}

.nwcc-consent-id {
	margin: 12px 0 0;
	font-size: 0.8em;
	opacity: 0.8;
	word-break: break-all;
}

.nwcc-settings-button {
	position: fixed;
	bottom: 16px;
	z-index: 2147482998;
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 50%;
	background: var(--nwcc-button);
	color: var(--nwcc-button-text);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.nwcc-settings-button.nwcc-side-left {
	left: 16px;
}

.nwcc-settings-button.nwcc-side-right {
	right: 16px;
}

.nwcc-link-button {
	background: none;
	border: 0;
	padding: 0;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.nwcc-placeholder {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	min-height: 200px;
	padding: 24px;
	background: #f3f4f6;
	color: #1f2937;
	border-radius: 8px;
	text-align: center;
	--nwcc-button: #047857;
	--nwcc-button-text: #fff;
	--nwcc-radius: 12px;
}

.nwcc-placeholder p {
	margin: 0;
}

.nwcc-placeholder .nwcc-btn {
	flex: none;
}

@media (max-width: 600px) {
	.nwcc-layout-bar .nwcc-banner {
		display: block;
	}

	.nwcc-layout-bar .nwcc-banner .nwcc-buttons {
		margin-top: 16px;
	}

	.nwcc-btn {
		flex-basis: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nwcc-switch-track,
	.nwcc-switch-track::after {
		transition: none;
	}
}
