/* Баннер cookie. Цвета, скругление, шрифт, ширина, тень и длительность анимации задаются
   переменными в атрибуте style элемента #cookie-note (из настроек модуля). */
#cookie-note{position:fixed;z-index:99999;left:0;right:0;top:0;bottom:0;margin:auto;height:max-content;width:min(var(--cn-width,460px),calc(100% - 32px));max-width:none;
  box-sizing:border-box;background:var(--cn-bg,#FFFFFF);color:var(--cn-text,#10161D);border-radius:var(--cn-radius,14px);padding:16px 18px;
  font:var(--cn-font,15px)/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;text-align:left;
  box-shadow:var(--cn-shadow,0 8px 28px rgba(0,0,0,.25))}
#cookie-note[hidden],#cookie-note [hidden]{display:none!important}
#cookie-note .cn-title{display:block;font-size:16px;font-weight:700;margin-bottom:4px;padding-right:22px}
#cookie-note .cn-text{white-space:pre-line}
#cookie-note a{color:var(--cn-btn,#1F5FD0);text-decoration:underline}
#cookie-note .cn-actions{display:flex;gap:9px;margin:14px 0 0}
#cookie-note button{font:inherit;cursor:pointer;border-radius:10px;padding:9px 18px;margin:0;line-height:1.3}
/* Кнопки баннера и окна с политикой — одни правила, окно наследует все настройки кнопок */
#cookie-note .cn-accept,#cookie-note-policy .cn-accept{background:var(--cn-btn,#1F5FD0);color:var(--cn-btn-text,#FFFFFF);
  border:1px solid var(--cn-accept-border,#1F5FD0);font-weight:600}
#cookie-note .cn-decline,#cookie-note-policy .cn-decline{background:transparent;color:var(--cn-text,#10161D);
  border:1px solid var(--cn-decline-border,#10161D);opacity:.85}
/* Интерактивные кнопки: плавная смена цвета при наведении, «нажатие» при клике.
   Общие для баннера и окна с политикой. */
#cookie-note .cn-accept,#cookie-note .cn-decline,#cookie-note-policy .cn-accept,#cookie-note-policy .cn-decline{
  transition:background-color .2s,color .2s,border-color .2s,opacity .2s,transform .1s}
#cookie-note .cn-accept:hover,#cookie-note-policy .cn-accept:hover{background:var(--cn-accept-hover,#1A4FB0);color:var(--cn-accept-hover-text,#FFFFFF);
  border-color:var(--cn-accept-hover-border,#1A4FB0)}
#cookie-note .cn-decline:hover,#cookie-note-policy .cn-decline:hover{background:var(--cn-decline-hover,#E4ECF9);color:var(--cn-decline-hover-text,#1F5FD0);
  border-color:var(--cn-decline-hover-border,#1F5FD0);opacity:1}
#cookie-note button:active,#cookie-note-policy button:active{transform:scale(.97)}
#cookie-note button:focus-visible,#cookie-note-policy button:focus-visible,#cookie-note a:focus-visible{outline:2px solid var(--cn-btn,#1F5FD0);outline-offset:2px}
#cookie-note .cn-close:hover{opacity:1}
#cookie-note .cn-close{position:absolute;top:6px;right:8px;background:none;border:0;color:var(--cn-text,#10161D);font-size:20px;line-height:1;padding:2px 6px;opacity:.6}
/* Выбор категорий: раскрывается внутри баннера вместо текста и основных кнопок */
#cookie-note .cn-settings{background:none;border:0;padding:9px 4px;color:var(--cn-btn,#1F5FD0);text-decoration:underline;margin-right:auto}
#cookie-note:not(.cn-mode-cats) .cn-cats,#cookie-note:not(.cn-mode-cats) .cn-cats-actions,
#cookie-note.cn-mode-cats .cn-text,#cookie-note.cn-mode-cats .cn-link,#cookie-note.cn-mode-cats .cn-main-actions{display:none!important}
#cookie-note.cn-banner.cn-mode-cats .cn-body{display:block}
#cookie-note.cn-banner.cn-mode-cats .cn-cats-actions{margin:14px 0 0}
#cookie-note.cn-pos-bottom.cn-mode-cats .cn-cats{max-width:640px}
#cookie-note.cn-mode-cats:not(.cn-pos-bottom){width:min(440px,calc(100% - 32px))}
#cookie-note .cn-cats{margin:10px 0 0;border-top:1px solid rgba(0,0,0,.08);max-height:60vh;overflow:auto;-webkit-overflow-scrolling:touch}
#cookie-note .cn-cat{display:flex;gap:12px;align-items:flex-start;padding:9px 0;border-bottom:1px solid rgba(0,0,0,.08);cursor:pointer}
#cookie-note .cn-cat-text{flex:1}
#cookie-note .cn-cat b{display:block;font-size:14px}
#cookie-note .cn-cat small{display:block;font-size:12px;opacity:.75;line-height:1.35}
#cookie-note .cn-sw{flex:none;width:38px;height:22px;position:relative;margin-top:2px}
#cookie-note .cn-sw input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;z-index:1}
#cookie-note .cn-sw i{position:absolute;inset:0;border-radius:11px;background:#c9ced4;transition:background-color .2s}
#cookie-note .cn-sw i:after{content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.3);transition:left .2s}
#cookie-note .cn-sw input:checked+i{background:var(--cn-btn,#1F5FD0)}
#cookie-note .cn-sw input:checked+i:after{left:19px}
#cookie-note .cn-sw input:disabled+i{opacity:.5}
#cookie-note .cn-sw input:disabled{cursor:default}
#cookie-note .cn-sw input:focus-visible+i{outline:2px solid var(--cn-btn,#1F5FD0);outline-offset:2px}

/* Кнопка «Настройки cookie» в углу после ответа */
#cookie-note-fab{position:fixed;z-index:99997;bottom:14px;width:40px;height:40px;box-sizing:border-box;border-radius:50%;padding:0;margin:0;cursor:pointer;
  background:var(--cn-bg,#FFFFFF);color:var(--cn-btn,#1F5FD0);border:1px solid rgba(0,0,0,.06);box-shadow:0 3px 12px rgba(0,0,0,.25);
  display:flex;align-items:center;justify-content:center;line-height:1;animation:cn-fade .3s ease-out}
/* Иконка: стандартная — линейный SVG, своя SVG — маска в цвете кнопок, PNG/WebP — картинка как есть */
#cookie-note-fab .cn-fab-icon{display:block;width:22px;height:22px;pointer-events:none}
#cookie-note-fab .cn-fab-svg,#cookie-note-fab .cn-fab-img,#cookie-note-fab .cn-fab-mask{display:block;width:100%;height:100%;max-width:none;margin:0;border:0}
#cookie-note-fab .cn-fab-svg{fill:none;stroke:currentColor}
#cookie-note-fab .cn-fab-img{object-fit:contain}
#cookie-note-fab .cn-fab-mask{background:currentColor;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;
  -webkit-mask-position:center;mask-position:center;-webkit-mask-size:contain;mask-size:contain}
#cookie-note-fab[hidden]{display:none!important}
#cookie-note-fab.cn-fab-left{left:14px}
#cookie-note-fab.cn-fab-right{right:14px}
#cookie-note-fab .cn-fab-tip{position:absolute;bottom:8px;background:#10161D;color:#fff;
  font:12px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;padding:4px 8px;border-radius:4px;white-space:nowrap;
  opacity:0;pointer-events:none;transition:opacity .2s}
#cookie-note-fab.cn-fab-left .cn-fab-tip{left:48px}
#cookie-note-fab.cn-fab-right .cn-fab-tip{right:48px}
#cookie-note-fab:hover .cn-fab-tip,#cookie-note-fab:focus-visible .cn-fab-tip{opacity:1}
#cookie-note-fab:focus-visible{outline:2px solid var(--cn-btn,#1F5FD0);outline-offset:2px}
@media(max-width:640px){#cookie-note-fab{width:34px;height:34px}#cookie-note-fab .cn-fab-icon{width:19px;height:19px}#cookie-note-fab .cn-fab-tip{bottom:5px}
  #cookie-note-fab.cn-fab-left .cn-fab-tip{left:42px}#cookie-note-fab.cn-fab-right .cn-fab-tip{right:42px}}
#cookie-note-fab.cn-preview{position:absolute;animation:none}
#cookie-note-fab.cn-preview .cn-fab-tip{opacity:1}

/* Фон страницы при появлении: затемнение или размытие; сила задаётся из cookie-banner.js */
#cookie-note-dim{position:fixed;inset:0;z-index:99998;opacity:0;transition:opacity var(--cn-dur,.8s) ease-out}
#cookie-note-dim.cn-dim-on{opacity:1}

/* Расположение */
#cookie-note.cn-pos-bottom{top:auto;bottom:0;left:0;right:0;width:auto;max-width:none;height:auto;margin:0;
  border-radius:var(--cn-radius,14px) var(--cn-radius,14px) 0 0;padding:14px 48px 14px 24px}
#cookie-note.cn-pos-bottom .cn-body{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
#cookie-note.cn-pos-bottom .cn-content{flex:1 1 320px}
#cookie-note.cn-pos-bottom .cn-actions{flex:none;margin:0 0 0 auto}
#cookie-note.cn-pos-bottom-left,#cookie-note.cn-pos-bottom-right{top:auto;bottom:20px;height:auto;margin:0;width:min(var(--cn-width,400px),calc(100% - 40px))}
#cookie-note.cn-pos-bottom-left{left:20px;right:auto}
#cookie-note.cn-pos-bottom-right{right:20px;left:auto}

/* Анимация появления (срабатывает, когда баннер перестаёт быть hidden) */
#cookie-note.cn-anim-zoom{animation:cn-zoom var(--cn-dur,.8s) ease-out}
#cookie-note.cn-anim-slide{animation:cn-slide var(--cn-dur,.8s) ease-out}
#cookie-note.cn-anim-fade{animation:cn-fade var(--cn-dur,.8s) ease-out}
#cookie-note.cn-anim-none{animation:none}
@keyframes cn-zoom{from{opacity:0;transform:scale(.92)}to{opacity:1;transform:none}}
@keyframes cn-slide{from{opacity:0;transform:translateY(40px)}to{opacity:1;transform:none}}
@keyframes cn-fade{from{opacity:0}to{opacity:1}}

/* Телефон: баннер прижимается к низу. .cn-mobile — то же для предпросмотра в админке. */
@media(max-width:640px){
  #cookie-note.cn-banner{left:10px;right:10px;bottom:10px;top:auto;margin:0;width:auto;height:auto;max-width:none;
    border-radius:var(--cn-radius,14px);padding:16px 18px}
  #cookie-note.cn-banner .cn-body{display:block}
  #cookie-note.cn-banner .cn-actions{display:grid;margin:14px 0 0}
  #cookie-note.cn-banner.cn-mode-cats{width:auto}
}
#cookie-note.cn-mobile{left:10px;right:10px;bottom:10px;top:auto;margin:0;width:auto;height:auto;max-width:none;
  border-radius:var(--cn-radius,14px);padding:16px 18px}
#cookie-note.cn-mobile .cn-body{display:block}
#cookie-note.cn-mobile .cn-actions{display:grid;margin:14px 0 0}
#cookie-note.cn-mobile.cn-mode-cats{width:auto}

/* Предпросмотр в админке: баннер внутри окна, а не поверх страницы */
#cookie-note.cn-preview{position:absolute;z-index:2}

/* Окно с политикой (режим ссылки «Текст во всплывающем окне») */
#cookie-note-policy{position:fixed;inset:0;z-index:100000;display:flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,.5);animation:cn-fade .25s ease-out;
  font:var(--cn-font,15px)/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;text-align:left}
#cookie-note-policy[hidden],#cookie-note-policy [hidden]{display:none!important}
#cookie-note-policy .cn-policy-box{display:flex;flex-direction:column;box-sizing:border-box;width:calc(100% - 32px);max-width:720px;max-height:calc(100% - 64px);
  background:var(--cn-bg,#FFFFFF);color:var(--cn-text,#10161D);border-radius:var(--cn-radius,14px);box-shadow:0 12px 40px rgba(0,0,0,.3);
  animation:cn-zoom .25s ease-out}
#cookie-note-policy .cn-policy-head{display:flex;align-items:center;gap:12px;padding:14px 18px;border-bottom:1px solid rgba(127,127,127,.25)}
#cookie-note-policy .cn-policy-title{flex:1;font-size:1.1em;font-weight:700}
#cookie-note-policy .cn-policy-close{margin-left:auto;background:none;border:0;color:inherit;font-size:24px;line-height:1;padding:2px 6px;cursor:pointer;opacity:.6}
#cookie-note-policy .cn-policy-close:hover{opacity:1}
/* Текст политики — строгое оформление: заголовок документа прописными по центру, под ним дата,
   разделы с тонкой линией, таблицы на всю ширину с серой шапкой, имена cookie моноширинным. */
#cookie-note-policy .cn-policy-body{flex:1;overflow:auto;padding:14px 22px 18px;line-height:1.55;-webkit-overflow-scrolling:touch}
#cookie-note-policy .cn-policy-body h1,#cookie-note-policy .cn-policy-body h2,#cookie-note-policy .cn-policy-body h3{line-height:1.3;color:inherit;font-weight:700}
#cookie-note-policy .cn-policy-body h1,#cookie-note-policy .cn-policy-body h2{margin:.2em 0 .25em;font-size:1.05em;text-transform:uppercase;letter-spacing:.04em;text-align:center}
#cookie-note-policy .cn-policy-body h1 + p,#cookie-note-policy .cn-policy-body h2 + p{margin:0 0 1.2em;padding-bottom:.9em;border-bottom:1px solid rgba(127,127,127,.25);text-align:center;font-size:.88em;opacity:.7}
#cookie-note-policy .cn-policy-body h3{margin:1.3em 0 .5em;padding-bottom:.3em;border-bottom:1px solid rgba(127,127,127,.25);font-size:1em}
#cookie-note-policy .cn-policy-body p{margin:0 0 .6em}
#cookie-note-policy .cn-policy-body ul,#cookie-note-policy .cn-policy-body ol{margin:0 0 .7em;padding-left:1.4em}
#cookie-note-policy .cn-policy-body li{margin:.2em 0}
#cookie-note-policy .cn-policy-body li ul,#cookie-note-policy .cn-policy-body li ol{margin:.3em 0 .2em}
#cookie-note-policy .cn-policy-body a{color:var(--cn-btn,#1F5FD0)}
#cookie-note-policy .cn-policy-body table{width:100%;border-collapse:collapse;margin:.3em 0 .9em;font-size:.88em;line-height:1.4}
#cookie-note-policy .cn-policy-body td,#cookie-note-policy .cn-policy-body th{border:1px solid rgba(127,127,127,.35);padding:6px 8px;text-align:left;vertical-align:top}
#cookie-note-policy .cn-policy-body th{background:rgba(127,127,127,.1);font-weight:600}
#cookie-note-policy .cn-policy-body code{font-family:Menlo,Consolas,monospace;font-size:.92em;white-space:nowrap}
#cookie-note-policy .cn-policy-foot{display:flex;justify-content:flex-end;gap:9px;padding:12px 18px;border-top:1px solid rgba(127,127,127,.25)}
#cookie-note-policy .cn-policy-foot button{font:inherit;cursor:pointer;border-radius:10px;padding:9px 18px;margin:0;line-height:1.3}
@media(max-width:640px){
  #cookie-note-policy .cn-policy-box{width:calc(100% - 20px);max-height:calc(100% - 20px)}
  #cookie-note-policy .cn-policy-foot{display:grid}
  #cookie-note-policy .cn-policy-body{padding:10px 14px 14px}
  #cookie-note-policy .cn-policy-body table{font-size:.8em}
  #cookie-note-policy .cn-policy-body td,#cookie-note-policy .cn-policy-body th{padding:4px 5px;word-break:break-word}
  #cookie-note-policy .cn-policy-body code{white-space:normal}
}
/* Предпросмотр окна в админке */
#cookie-note-policy.cn-preview{position:absolute;z-index:3;animation:none}
#cookie-note-policy.cn-preview .cn-policy-box{width:calc(100% - 32px);max-height:calc(100% - 32px);animation:none}
