.cookie-consent {
  position: fixed;
  right: clamp(14px, 3vw, 26px);
  bottom: clamp(14px, 3vw, 26px);
  z-index: calc(var(--z-toast, 9999) + 1);
  width: min(440px, calc(100vw - 28px));
  color: var(--text-strong);
  pointer-events: none;
}

.cookie-consent[hidden] {
  display: none;
}

.cookie-consent__panel {
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: rgba(var(--glass-bg), 0.78);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  pointer-events: auto;
}

.cookie-consent__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.cookie-consent__title {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.cookie-consent__close {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
}

.cookie-consent__close:hover,
.cookie-consent__close:focus-visible {
  color: #fff;
  border-color: rgba(var(--btn-primary-1), 0.38);
}

.cookie-consent__text {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.cookie-consent__prefs {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.cookie-consent.is-preferences-open .cookie-consent__prefs {
  display: grid;
  gap: 12px;
}

.cookie-consent__option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.cookie-consent__option-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.cookie-consent__option-text {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.cookie-consent__switch {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 28px;
}

.cookie-consent__switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.cookie-consent__slider {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  transition: background var(--transition-fast);
}

.cookie-consent__slider::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--transition-fast);
}

.cookie-consent__switch input:checked + .cookie-consent__slider {
  background: rgb(var(--btn-primary-1));
}

.cookie-consent__switch input:checked + .cookie-consent__slider::after {
  transform: translateX(20px);
}

.cookie-consent__link {
  color: rgb(var(--btn-primary-1));
  font-weight: 700;
  text-decoration: none;
}

.cookie-consent__link:hover,
.cookie-consent__link:focus-visible {
  color: #fff;
}

@media (max-width: 520px) {
  .cookie-consent {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  .cookie-consent__actions,
  .cookie-consent__button {
    width: 100%;
  }
}
