/* BY Cookie Consent */
#bycc-root {
	--bycc-primary: #1f5fbf;
	--bycc-bg: #ffffff;
	--bycc-text: #1b1f24;
	--bycc-radius: 10px;
	--bycc-muted: color-mix(in srgb, var(--bycc-text) 65%, var(--bycc-bg));
	--bycc-line: color-mix(in srgb, var(--bycc-text) 14%, var(--bycc-bg));
	--bycc-soft: color-mix(in srgb, var(--bycc-text) 5%, var(--bycc-bg));
	font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	color: var(--bycc-text);
}
#bycc-root *, #bycc-root *::before, #bycc-root *::after { box-sizing: border-box; }
#bycc-root [hidden] { display: none !important; }
#bycc-root h2 { font: inherit; font-weight: 700; margin: 0; color: inherit; letter-spacing: 0; text-transform: none; }
#bycc-root p { margin: 0 0 .5em; }
#bycc-root p:last-child { margin-bottom: 0; }
.bycc-link, #bycc-root a { color: var(--bycc-primary); text-decoration: underline; }

/* Кнопки: «Принять» и «Отклонить» одинаковы по виду и весу.
   Селекторы с #bycc-root / .bycc-ph — чтобы стили темы (button, [type=button], :hover) их не перебивали. */
#bycc-root .bycc-btn, .bycc-ph .bycc-btn {
	appearance: none; display: inline-flex; align-items: center; justify-content: center;
	min-height: 44px; padding: 10px 18px; margin: 0; white-space: normal; text-transform: none; letter-spacing: normal;
	font: inherit; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; box-shadow: none;
	border-radius: calc(var(--bycc-radius) * .7); border: 2px solid var(--bycc-primary);
	cursor: pointer; transition: filter .15s, background-color .15s;
}
#bycc-root .bycc-btn--primary, #bycc-root .bycc-btn--primary:hover, #bycc-root .bycc-btn--primary:focus, #bycc-root .bycc-btn--primary:active,
.bycc-ph .bycc-btn--primary, .bycc-ph .bycc-btn--primary:hover, .bycc-ph .bycc-btn--primary:focus, .bycc-ph .bycc-btn--primary:active {
	background: var(--bycc-primary); color: #fff; border-color: var(--bycc-primary);
}
#bycc-root .bycc-btn--primary:hover, .bycc-ph .bycc-btn--primary:hover { filter: brightness(1.08); }
#bycc-root .bycc-btn--ghost, #bycc-root .bycc-btn--ghost:focus, #bycc-root .bycc-btn--ghost:active,
.bycc-ph .bycc-btn--ghost, .bycc-ph .bycc-btn--ghost:focus, .bycc-ph .bycc-btn--ghost:active {
	background: transparent; color: var(--bycc-primary); border-color: var(--bycc-primary);
}
#bycc-root .bycc-btn--ghost:hover, .bycc-ph .bycc-btn--ghost:hover { background: color-mix(in srgb, var(--bycc-primary) 8%, transparent); color: var(--bycc-primary); border-color: var(--bycc-primary); }
#bycc-root .bycc-btn:focus-visible, .bycc-ph .bycc-btn:focus-visible, #bycc-root .bycc-fab:focus-visible, #bycc-root .bycc-close:focus-visible, #bycc-root summary:focus-visible, #bycc-root .bycc-switch:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--bycc-primary) 55%, transparent); outline-offset: 2px;
}

/* ---------- Баннер ---------- */
.bycc-banner {
	position: fixed; z-index: 2147483000; background: var(--bycc-bg); color: var(--bycc-text);
	box-shadow: 0 -2px 24px rgba(0,0,0,.14); animation: bycc-in .25s ease-out;
}
.bycc-banner__title { font-size: 1.05em !important; margin-bottom: .35em !important; }
.bycc-banner__text { font-size: .93em; color: var(--bycc-muted); }
.bycc-banner__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.bycc--bar .bycc-banner { left: 0; right: 0; bottom: 0; border-top: 1px solid var(--bycc-line); }
.bycc--bar .bycc-banner__inner { max-width: 1200px; margin: 0 auto; padding: 18px 20px; display: flex; gap: 24px; align-items: center; }
.bycc--bar .bycc-banner__body { flex: 1 1 auto; }
.bycc--bar .bycc-banner__actions { flex: 0 0 auto; max-width: 480px; justify-content: flex-end; }

.bycc--box .bycc-banner { left: 16px; bottom: 16px; width: min(420px, calc(100vw - 32px)); border-radius: var(--bycc-radius); border: 1px solid var(--bycc-line); box-shadow: 0 8px 40px rgba(0,0,0,.18); }
.bycc--box .bycc-banner__inner { padding: 20px; }
.bycc--box .bycc-banner__actions { margin-top: 14px; }
.bycc--box .bycc-banner__actions .bycc-btn { flex: 1 1 140px; }

.bycc--center .bycc-banner { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); border-radius: var(--bycc-radius); box-shadow: 0 0 0 100vmax rgba(0,0,0,.35), 0 12px 48px rgba(0,0,0,.25); animation: none; }
.bycc--center .bycc-banner__inner { padding: 24px; }
.bycc--center .bycc-banner__actions { margin-top: 16px; }
.bycc--center .bycc-banner__actions .bycc-btn { flex: 1 1 150px; }

@media (max-width: 782px) {
	.bycc--bar .bycc-banner__inner { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px; }
	.bycc--bar .bycc-banner__actions { max-width: none; }
	.bycc-banner__actions .bycc-btn { flex: 1 1 100%; }
	.bycc-banner { max-height: 85vh; overflow-y: auto; }
}

/* ---------- Центр настроек ---------- */
html.bycc-lock { overflow: hidden; }
.bycc-modal { position: fixed; inset: 0; z-index: 2147483001; display: flex; align-items: center; justify-content: center; padding: 16px; }
.bycc-modal__backdrop { position: absolute; inset: 0; background: rgba(10, 14, 20, .55); }
.bycc-modal__dialog {
	position: relative; display: flex; flex-direction: column; width: min(720px, 100%); max-height: min(90vh, 900px);
	background: var(--bycc-bg); color: var(--bycc-text); border-radius: var(--bycc-radius);
	box-shadow: 0 20px 60px rgba(0,0,0,.3); outline: none; animation: bycc-pop .2s ease-out;
}
.bycc-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--bycc-line); }
.bycc-modal__head h2 { font-size: 1.2em !important; }
#bycc-root .bycc-close, #bycc-root .bycc-close:focus { appearance: none; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: inherit; font-size: 28px; line-height: 1; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; }
#bycc-root .bycc-close:hover { background: var(--bycc-soft); color: var(--bycc-text); border: 0; }
.bycc-modal__body { padding: 18px 22px; overflow-y: auto; overscroll-behavior: contain; }
.bycc-modal__foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 22px; border-top: 1px solid var(--bycc-line); }
.bycc-modal__foot .bycc-btn { flex: 1 1 160px; }
.bycc-intro { font-size: .93em; color: var(--bycc-muted); margin-bottom: 14px; }

.bycc-cats { list-style: none; margin: 0 0 14px; padding: 0; }
.bycc-cat { border: 1px solid var(--bycc-line); border-radius: calc(var(--bycc-radius) * .8); padding: 14px 16px; margin: 0 0 10px; }
.bycc-cat__head { display: flex; align-items: center; gap: 12px; }
.bycc-cat__label { flex: 1 1 auto; font-weight: 700; cursor: pointer; }
.bycc-cat__always { font-size: .85em; color: var(--bycc-muted); }
.bycc-cat__desc { font-size: .9em; color: var(--bycc-muted); margin-top: 6px; }
.bycc-cat__cookies { margin-top: 8px; font-size: .88em; }
#bycc-root summary { cursor: pointer; color: var(--bycc-primary); font-weight: 600; padding: 4px 0; }

/* Переключатель */
.bycc-switch {
	appearance: none; -webkit-appearance: none; position: relative; flex: 0 0 auto;
	width: 46px; height: 26px; margin: 0; border-radius: 26px; cursor: pointer;
	background: color-mix(in srgb, var(--bycc-text) 25%, var(--bycc-bg)); transition: background-color .2s;
}
.bycc-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.bycc-switch:checked { background: var(--bycc-primary); }
.bycc-switch:checked::after { transform: translateX(20px); }
.bycc-switch:disabled { opacity: .55; cursor: not-allowed; }

.bycc-risk { margin-top: 10px; padding: 10px 12px; font-size: .86em; border-left: 4px solid #d97706; background: color-mix(in srgb, #d97706 10%, var(--bycc-bg)); border-radius: 4px; }
.bycc-info { border-top: 1px solid var(--bycc-line); padding: 10px 0; font-size: .9em; }
.bycc-info > :not(summary) { margin-top: 8px; }
.bycc-dl { display: grid; grid-template-columns: minmax(140px, 35%) 1fr; gap: 6px 14px; margin: 8px 0 0; }
.bycc-dl dt { font-weight: 600; }
.bycc-dl dd { margin: 0; color: var(--bycc-muted); }
.bycc-policy-link { margin-top: 10px !important; font-size: .9em; }
.bycc-meta { font-size: .78em; color: var(--bycc-muted); margin-top: 10px !important; word-break: break-all; }
@media (max-width: 560px) { .bycc-dl { grid-template-columns: 1fr; } .bycc-dl dd { margin-bottom: 6px; } }

/* Таблица cookie (центр настроек и политика) */
.bycc-table-wrap { overflow-x: auto; margin: 8px 0 14px; }
.bycc-table { width: 100%; border-collapse: collapse; font-size: .9em; }
.bycc-table th, .bycc-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(127,127,127,.25); vertical-align: top; }
.bycc-table th { font-weight: 600; white-space: nowrap; }
.bycc-table code { font-size: .95em; white-space: nowrap; }
.bycc-flag { color: #d97706; cursor: help; }

/* Плавающая кнопка */
#bycc-root .bycc-fab, #bycc-root .bycc-fab:focus {
	position: fixed; bottom: 16px; z-index: 2147482999; width: 44px; height: 44px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
	background: var(--bycc-bg); color: var(--bycc-primary); border: 1px solid var(--bycc-line);
	box-shadow: 0 3px 14px rgba(0,0,0,.18); opacity: .85; transition: opacity .15s, transform .15s;
}
#bycc-root .bycc-fab:hover { opacity: 1; transform: scale(1.06); background: var(--bycc-bg); color: var(--bycc-primary); border: 1px solid var(--bycc-line); }
#bycc-root .bycc-fab--left { left: 16px; }
#bycc-root .bycc-fab--right { right: 16px; }

/* Заглушка заблокированного iframe */
iframe[data-bycc-src] { display: none !important; }
.bycc-ph {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
	width: 100%; min-height: 200px; padding: 20px; margin: 0 0 1em; text-align: center;
	background: #f3f4f6; color: #1b1f24; border: 1px dashed #c3c7cd; border-radius: 8px;
	font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.bycc-ph p { margin: 0; max-width: 460px; }
.bycc-ph { --bycc-primary: #1f5fbf; --bycc-radius: 10px; }
.bycc-ph .bycc-btn { min-height: 38px; padding: 8px 14px; }

@keyframes bycc-in { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bycc-pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bycc-banner, .bycc-modal__dialog { animation: none !important; } }
@media print { #bycc-root { display: none !important; } }
