/* Баннер согласия на cookie.
   Требование РКН — заметность, а не навязчивость: баннер не перекрывает
   контент модальным слоем, но и не прячется в углу серым текстом. */

.egerpro-cc {
	position: fixed;
	left: 16px;
	right: 16px;
	z-index: 99999;
	display: flex;
	justify-content: center;
	pointer-events: none;
}

.egerpro-cc--bottom { bottom: 16px; }
.egerpro-cc--top { top: 16px; }

.egerpro-cc[hidden] { display: none; }

.egerpro-cc__box {
	pointer-events: auto;
	max-width: 720px;
	width: 100%;
	background: #fff;
	color: #16181c;
	border-radius: 14px;
	box-shadow: 0 18px 48px rgba(16, 20, 30, .22);
	padding: 20px 22px;
	font-size: 14px;
	line-height: 1.55;
}

.egerpro-cc__title {
	margin: 0 0 6px;
	font-size: 17px;
	line-height: 1.3;
	font-weight: 700;
}

.egerpro-cc__text {
	margin: 0 0 14px;
	color: #3c4149;
}

.egerpro-cc__text a {
	color: #1c5ed6;
	text-decoration: underline;
}

/* Категории: заголовок с переключателем и раскрываемая опись */

.egerpro-cc__options {
	display: grid;
	gap: 8px;
	margin-bottom: 16px;
	max-height: 46vh;
	overflow-y: auto;
}

.egerpro-cc__options[hidden] { display: none; }

.egerpro-cc__group {
	border: 1px solid #e3e5e9;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}

.egerpro-cc__group-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
}

.egerpro-cc__group-toggle {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-width: 0;
	appearance: none;
	border: 0;
	background: none;
	padding: 0;
	font: inherit;
	text-align: left;
	cursor: pointer;
	color: inherit;
}

.egerpro-cc__group-toggle[disabled] {
	cursor: default;
}

.egerpro-cc__group-title {
	min-width: 0;
}

.egerpro-cc__group-title strong {
	display: block;
	font-size: 14px;
}

.egerpro-cc__group-title span {
	display: block;
	font-size: 12.5px;
	color: #5a616b;
	line-height: 1.45;
}

.egerpro-cc__group-count {
	flex: 0 0 auto;
	font-size: 11px;
	color: #5a616b;
	background: #f0f2f5;
	border-radius: 999px;
	padding: 3px 9px;
	white-space: nowrap;
}

.egerpro-cc__group-toggle[aria-expanded="true"] .egerpro-cc__group-count::after {
	content: " ▲";
}

.egerpro-cc__group-toggle[aria-expanded="false"] .egerpro-cc__group-count::after {
	content: " ▼";
}

/* Переключатель категории */

.egerpro-cc__switch {
	flex: 0 0 auto;
	position: relative;
	display: inline-flex;
	align-items: center;
	width: 44px;
	height: 24px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 999px;
	background: #c9ced6;
	cursor: pointer;
	transition: background .18s ease;
}

.egerpro-cc__switch span {
	position: absolute;
	left: 0;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
	transition: transform .18s ease;
}

.egerpro-cc__switch[aria-checked="true"] {
	background: #1c5ed6;
}

.egerpro-cc__switch[aria-checked="true"] span {
	transform: translateX(20px);
}

.egerpro-cc__switch--locked {
	background: #1c5ed6;
	opacity: .45;
	cursor: not-allowed;
}

.egerpro-cc__switch--locked::after {
	content: "";
	position: absolute;
	left: 20px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
}

/* Опись хранилищ */

.egerpro-cc__table-wrap {
	border-top: 1px solid #e3e5e9;
	overflow-x: auto;
}

.egerpro-cc__table-wrap[hidden] { display: none; }

.egerpro-cc__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
}

.egerpro-cc__table th {
	text-align: left;
	font-weight: 600;
	color: #3c4149;
	background: #f6f7f9;
	padding: 8px 10px;
	white-space: nowrap;
}

.egerpro-cc__table td {
	padding: 8px 10px;
	border-top: 1px solid #eef0f3;
	color: #4a5058;
	vertical-align: top;
}

.egerpro-cc__table code {
	font-size: 11.5px;
	background: #f0f2f5;
	border-radius: 4px;
	padding: 1px 5px;
	word-break: break-all;
}

/* Кнопки: отказ выглядит так же, как согласие, — этого требует РКН. */

.egerpro-cc__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.egerpro-cc__btn {
	appearance: none;
	border: 1px solid #d4d7dd;
	background: #fff;
	color: #16181c;
	border-radius: 9px;
	padding: 10px 16px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}

.egerpro-cc__btn:hover {
	background: #f2f4f7;
}

.egerpro-cc__btn--primary {
	background: #1c5ed6;
	border-color: #1c5ed6;
	color: #fff;
}

.egerpro-cc__btn--primary:hover {
	background: #174fb4;
}

.egerpro-cc__btn--ghost {
	border-color: transparent;
	text-decoration: underline;
}

.egerpro-cc__btn[hidden] { display: none; }

.egerpro-cc__btn:focus-visible,
.egerpro-cc__recall:focus-visible {
	outline: 2px solid #1c5ed6;
	outline-offset: 2px;
}

/* Кнопка возврата к настройкам: согласие должно отзываться так же
   легко, как даётся. */

.egerpro-cc__recall {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 99998;
	appearance: none;
	border: 1px solid #d4d7dd;
	background: #fff;
	color: #4a5058;
	border-radius: 999px;
	padding: 7px 14px;
	font-size: 12px;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(16, 20, 30, .12);
}

.egerpro-cc__recall[hidden] { display: none; }

@media (max-width: 600px) {
	.egerpro-cc__box { padding: 16px; }
	.egerpro-cc__actions .egerpro-cc__btn { flex: 1 1 100%; }
}

@media (prefers-color-scheme: dark) {
	.egerpro-cc__box { background: #1b1e24; color: #f2f3f5; }
	.egerpro-cc__text { color: #c3c7cf; }
	/* Синий #1c5ed6 на светлом фоне читается, на тёмном даёт 2,87:1 —
	   ниже порога 4,5:1. Ссылка на правила обработки данных обязана
	   быть читаемой: с неё человек уходит смотреть, на что соглашается. */
	.egerpro-cc__text a { color: #8ab4f8; }
	.egerpro-cc__group { background: #23272f; border-color: #363b45; }
	.egerpro-cc__group-title span { color: #b6bbc4; }
	.egerpro-cc__group-count { background: #2b303a; color: #b6bbc4; }
	.egerpro-cc__switch { background: #444b57; }
	.egerpro-cc__table th { background: #2b303a; color: #d7dae0; }
	.egerpro-cc__table td { color: #b6bbc4; border-color: #363b45; }
	.egerpro-cc__table-wrap { border-color: #363b45; }
	.egerpro-cc__table code { background: #2b303a; }
	.egerpro-cc__btn { background: #23272f; border-color: #363b45; color: #f2f3f5; }
	.egerpro-cc__btn:hover { background: #2b303a; }
	.egerpro-cc__recall { background: #23272f; border-color: #363b45; color: #c3c7cf; }
}

/* Решение уже есть в cookie (страница из кеша): баннер не показываем ни на миг. */
.egerpro-cc-decided .egerpro-cc[data-egerpro-cc] {
	display: none;
}
