/* Cookie-баннер Safe22 - нейоморфизм, компакт внизу слева.
   Самодостаточен: токены с фолбэками, зависимостей от system.css нет. */

.s22-cc {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 180; /* ниже таб-бара кабинета (200) - не перехватывает его тапы */
  max-width: 400px;
  font-family: 'Rubik', system-ui, sans-serif;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .45s ease, transform .45s ease;
  pointer-events: none;
}
.s22-cc.s22-cc--show { opacity: 1; transform: none; pointer-events: auto; }

.s22-cc-card {
  background: var(--color-surface, #ecf0f3);
  border-radius: 24px;
  padding: 18px 20px;
  box-shadow: 10px 10px 24px rgba(163, 177, 198, .55),
              -10px -10px 24px rgba(255, 255, 255, .85);
}

.s22-cc-row { display: flex; gap: 12px; align-items: flex-start; }
.s22-cc-emoji {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  border-radius: 50%;
  background: var(--color-surface, #ecf0f3);
  box-shadow: inset 3px 3px 7px rgba(163, 177, 198, .5),
              inset -3px -3px 7px rgba(255, 255, 255, .9);
}
.s22-cc-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--color-text, #4a5568);
}
.s22-cc-text a { color: var(--color-accent, #ff4136); text-decoration: none; }
.s22-cc-text a:hover { text-decoration: underline; }

.s22-cc-actions { display: flex; gap: 10px; margin-top: 14px; align-items: center; }
.s22-cc-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 22px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.s22-cc-btn:active { transform: scale(.97); }

.s22-cc-btn--accept {
  color: #fff;
  background: var(--color-accent, #ff4136);
  box-shadow: 4px 4px 12px rgba(255, 65, 54, .35),
              -2px -2px 8px rgba(255, 255, 255, .7);
}
.s22-cc-btn--accept:hover { background: var(--color-accent-hover, #ff6d63); }

.s22-cc-btn--tune {
  color: var(--color-text-muted, #7b8794);
  background: var(--color-surface, #ecf0f3);
  box-shadow: 4px 4px 10px rgba(163, 177, 198, .5),
              -4px -4px 10px rgba(255, 255, 255, .85);
}
.s22-cc-btn--tune:hover { color: var(--color-text-strong, #2d3748); }

/* ---- панель «Настроить» ---- */
.s22-cc-panel { margin-top: 14px; }
.s22-cc-panel[hidden] { display: none; }
.s22-cc-opt {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--color-surface, #ecf0f3);
  box-shadow: inset 3px 3px 7px rgba(163, 177, 198, .45),
              inset -3px -3px 7px rgba(255, 255, 255, .9);
}
.s22-cc-opt + .s22-cc-opt { margin-top: 8px; }
.s22-cc-opt-name { font-size: 13px; font-weight: 500; color: var(--color-text-strong, #2d3748); }
.s22-cc-opt-hint { font-size: 11.5px; color: var(--color-text-muted, #7b8794); margin-top: 2px; }
.s22-cc-always { font-size: 12px; font-weight: 600; color: var(--color-accent, #ff4136); white-space: nowrap; }

/* тумблер */
.s22-cc-switch { position: relative; flex: 0 0 auto; width: 46px; height: 26px; }
.s22-cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.s22-cc-track {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: var(--color-surface, #ecf0f3);
  box-shadow: inset 3px 3px 6px rgba(163, 177, 198, .55),
              inset -3px -3px 6px rgba(255, 255, 255, .9);
  transition: background .2s ease;
  pointer-events: none;
}
.s22-cc-track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 2px 2px 5px rgba(163, 177, 198, .6);
  transition: transform .2s ease;
}
.s22-cc-switch input:checked + .s22-cc-track { background: var(--color-accent, #ff4136); }
.s22-cc-switch input:checked + .s22-cc-track::after { transform: translateX(20px); }

/* мобила: во всю ширину, ПОДНЯТ над нижней пилюлей-меню (~66px + отступ 12px),
   чтобы не перекрывать её кнопки (грабля fixed-оверлеев, frontend-architecture.md) */
@media (max-width: 560px) {
  .s22-cc {
    left: 10px; right: 10px; max-width: none;
    bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }
  .s22-cc-card { padding: 16px; }
  .s22-cc-actions { flex-wrap: wrap; }
  .s22-cc-btn { flex: 1 1 auto; text-align: center; }
}
