/* Баннер согласия на аналитику: карточка внизу экрана, в стиле плашки. На телефоне во всю ширину, на компьютере слева.
   При прокрутке без ответа сворачивается в круглую кнопку с печенькой в левом нижнем углу; нажатие разворачивает обратно. */
.consent { position: fixed; z-index: 46; left: var(--space-lg); bottom: var(--space-lg); width: min(420px, calc(100% - 2 * var(--space-lg))); display: grid; gap: var(--space-sm); padding: var(--space-md); border-radius: calc(var(--r-btn) + var(--space-xs)); background: color-mix(in oklab, var(--lav-2) 72%, transparent); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); box-shadow: var(--shadow-float); color: var(--ink); transform-origin: 28px calc(100% - 28px); transition: transform 380ms var(--spring), opacity 200ms ease, visibility 0s; animation: consent-in var(--spring-dur) var(--spring) both; }
.consent__t { margin: 0; max-width: none; font-size: var(--text-sm); line-height: 1.45; }
.consent__t a { color: inherit; }
.consent__b { display: flex; justify-content: flex-end; gap: var(--space-xs); }
.consent__b .btn { flex: 1 1 0; }
.consent__b .ck-gear { flex: none; }
.ck-gear { display: grid; place-items: center; width: 40px; min-height: 40px; padding: 0; border: 0; border-radius: var(--r-btn); background: none; color: var(--ink-2); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--dur) var(--ease), transform var(--spring-fast-dur) var(--spring-fast); }
.ck-gear:hover { background: color-mix(in oklab, var(--ink) 8%, transparent); color: var(--ink); }
.ck-gear:active { transform: scale(0.94); }
.ck-gear svg, .ck-x svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:is(.ck-gear, .ck-x, .ck-more, .ck-sw):focus-visible { outline: 2px solid var(--check); outline-offset: 2px; }

/* настройки по категориям: та же карточка, только выше */
.consent--prefs { max-height: calc(100dvh - 2 * var(--space-lg)); overflow: auto; overscroll-behavior: contain; gap: var(--space-md); padding: var(--space-lg); }
.ck-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.ck-title { margin: 0; font: 700 var(--text-xl)/1.2 var(--font-display); }
.ck-x { display: grid; place-items: center; width: 40px; height: 40px; margin: -8px -8px -8px 0; padding: 0; border: 0; border-radius: var(--r-btn); background: none; color: var(--ink); cursor: pointer; }
.ck-cats { list-style: none; margin: 0; padding: var(--space-2xs) var(--space-md); border-radius: var(--r-inner); background: var(--panel); }
.ck-cat + .ck-cat { border-top: 1px solid var(--rule); }
.ck-row { display: flex; align-items: center; gap: var(--space-sm); min-height: 56px; }
.ck-more { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) 0; border: 0; background: none; color: var(--ink); font: 600 var(--text-md)/1.3 var(--font-body); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ck-pm { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid currentColor; border-radius: 50%; font-weight: 500; line-height: 1; }
.ck-req { margin-left: var(--space-2xs); font-size: var(--text-xs); font-weight: 500; color: var(--check); }
.ck-desc { margin: 0 0 var(--space-md) 36px; max-width: none; font-size: var(--text-sm); line-height: 1.45; color: var(--ink-2); }
/* переключатель */
.ck-sw { flex: none; position: relative; width: 48px; height: 28px; padding: 0; border: 0; border-radius: 14px; background: var(--rule-2); cursor: pointer; transition: background-color var(--dur) var(--ease); -webkit-tap-highlight-color: transparent; }
.ck-sw i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--panel); box-shadow: 0 1px 3px var(--line-shade); transition: transform 260ms var(--spring); }
.ck-sw[aria-checked="true"] { background: var(--check); }
.ck-sw[aria-checked="true"] i { transform: translateX(20px); }
.ck-sw:disabled { cursor: default; opacity: 0.55; }

/* свёрнут: карточка сжимается в угол, где появляется кнопка */
.consent[data-open="false"] { opacity: 0; visibility: hidden; transform: scale(0.15); pointer-events: none; transition: transform 300ms cubic-bezier(0.4, 0, 0.6, 1), opacity 220ms ease 60ms, visibility 0s 300ms; }
@keyframes consent-in { from { opacity: 0; transform: translateY(16px); } }

.consent-mini { position: fixed; z-index: 46; left: var(--space-lg); bottom: var(--space-lg); width: 56px; height: 56px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: var(--panel); box-shadow: var(--shadow-float); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform 380ms var(--spring) 120ms, opacity 200ms ease 120ms, visibility 0s 120ms, bottom 320ms var(--ease); }
.consent-mini .ck-ico { width: 28px; height: 28px; fill: currentColor; }
.consent-mini .ck-ico path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.consent-mini:hover { transform: scale(1.06); }
.consent-mini:active { transform: scale(0.94); transition-duration: 120ms; transition-delay: 0s; }
.consent-mini:focus-visible { outline: 2px solid var(--check); outline-offset: 3px; }
.consent-mini[data-show="false"] { opacity: 0; visibility: hidden; transform: scale(0.5); pointer-events: none; transition: transform 200ms ease, opacity 150ms ease, visibility 0s 200ms; }

/* на телефоне и небольших экранах развёрнутый баннер и плашка внизу экрана стоят в одном месте: пока он развёрнут, плашки нет */
@media (max-width: 72rem) { body.has-consent .floater { visibility: hidden; } }
@media (max-width: 40rem) {
  .consent { left: 10px; right: 10px; width: auto; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .consent-mini { left: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  /* плашка во всю ширину — кнопка встаёт над ней */
  body:has(.floater.is-on) .consent-mini { bottom: calc(16px + env(safe-area-inset-bottom) + 88px); }
}
@media (prefers-reduced-motion: reduce) {
  .ck-sw i { transition: none; }
  .consent, .consent[data-open="false"], .consent-mini, .consent-mini[data-show="false"] { animation: none; transform: none; transition: opacity 150ms ease, visibility 0s 150ms; }
}
@media (prefers-reduced-transparency: reduce) { .consent { background: var(--lav-2); -webkit-backdrop-filter: none; backdrop-filter: none; } }
