.sz-consent {
  position: fixed;
  z-index: 10000;
  right: 1.5rem;
  bottom: 1.5rem;
  left: 1.5rem;
  display: flex;
  justify-content: flex-end;
  font: 0.9375rem/1.55 "Neutral Face", "SZ Sans", "Helvetica Neue", Arial, sans-serif;
  color: #f4f2f5;
}
/* The wrapper spans the whole bottom edge; only the card may take clicks, so
   page links underneath (footer legal links) stay usable. */
.sz-consent { pointer-events: none; }
.sz-consent__card { pointer-events: auto; }
.sz-consent[hidden] { display: none !important; }
.sz-consent [hidden] { display: none !important; }

.sz-consent__card {
  position: relative;
  width: 100%;
  max-width: 27rem;
  padding: 1.75rem 1.75rem 1.5rem;
  border: 1px solid rgba(140, 170, 235, 0.3);
  border-radius: 1.25rem;
  background: linear-gradient(180deg, #123675 0%, #0a295f 100%);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.5);
}

.sz-consent__close {
  position: absolute;
  top: .85rem;
  right: .85rem;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid rgba(140, 170, 235, 0.3);
  border-radius: 62.4375rem;
  background: transparent;
  color: #9aa8bf;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .18s ease, color .18s ease;
}
.sz-consent__close::before,
.sz-consent__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.875rem;
  height: 1.5px;
  margin: -.75px 0 0 -0.4375rem;
  border-radius: 1px;
  background: currentColor;
  transform: rotate(45deg);
}
.sz-consent__close::after { transform: rotate(-45deg); }
.sz-consent__close:hover { border-color: #079bff; color: #f4f2f5; }

.sz-consent__title {
  letter-spacing: .01em;
  margin: 0 0 .7rem;
  padding-right: 2.5rem;
  font: 400 1.25rem/1.3 "Canela Thin", "Times New Roman", serif;
  color: #f4f2f5;
}

.sz-consent__text {
  margin: 0;
  font-family: "SZ Sans", "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
  letter-spacing: .01em;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #9aa8bf;
}

/* "Настроить" sits on the card's left edge, in line with the text above it. */
.sz-consent__meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  margin-top: .75rem;
}
.sz-consent__link {
  display: inline-block;
  font-size: 0.8125rem;
  color: #079bff;
  text-decoration: underline;
  text-underline-offset: 0.1875rem;
}
.sz-consent__link:hover { opacity: .8; }
.sz-consent__inline-link {
  color: #079bff;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.1875rem;
  white-space: nowrap;
}
.sz-consent__inline-link:hover { opacity: .8; }
.sz-consent__inline-link:focus-visible { outline: 2px solid #079bff; outline-offset: 2px; border-radius: 2px; }

.sz-consent__panel {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(140, 170, 235, 0.3);
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

.sz-consent__option { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sz-consent__option-title { margin: 0; font-size: 0.875rem; color: #f4f2f5; }
.sz-consent__option-desc { margin: .2rem 0 0; font-size: 0.7812rem; line-height: 1.5; color: #9aa8bf; }

.sz-consent__switch {
  flex-shrink: 0;
  width: 2.625rem;
  height: 1.5rem;
  padding: 0.1875rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(140, 170, 235, 0.3);
  border-radius: 62.4375rem;
  background: #050f20;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease;
}
.sz-consent__switch.is-locked { cursor: default; opacity: .7; }
.sz-consent__switch.is-on { background: #079bff; border-color: #079bff; }
.sz-consent__switch-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 62.4375rem;
  background: #f4f2f5;
  transform: translateX(0);
  transition: transform .18s ease;
}
.sz-consent__switch.is-on .sz-consent__switch-dot { transform: translateX(1.125rem); }

.sz-consent__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
  margin-top: 1rem;
}
.sz-consent__btn--wide { grid-column: 1 / -1; }

.sz-consent__btn {
  padding: .75rem 1.15rem;
  border: 1px solid rgba(140, 170, 235, 0.3);
  border-radius: 62.4375rem;
  background: transparent;
  color: #f4f2f5;
  font: inherit;
  font-size: 0.8438rem;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
}
.sz-consent__btn--text { border-color: transparent; padding: .5rem 0; margin-left: 0; text-align: left; color: #9aa8bf; text-decoration: underline; text-underline-offset: 0.1875rem; }
.sz-consent__btn--text:hover { color: #f4f2f5; }
.sz-consent__btn--primary { background: #079bff; border-color: #079bff; color: #03101f; font-weight: 500; }
.sz-consent__btn--primary:hover { background: #2badff; border-color: #2badff; }
.sz-consent__btn--outline:hover { border-color: #079bff; color: #f4f2f5; }

.sz-consent__close:focus-visible,
.sz-consent__switch:focus-visible,
.sz-consent__btn:focus-visible,
.sz-consent__link:focus-visible { outline: 2px solid #079bff; outline-offset: 2px; }

@media (prefers-reduced-motion: no-preference) {
  .sz-consent__card { animation: sz-consent-in .35s ease; }
}
@keyframes sz-consent-in {
  from { opacity: 0; transform: translateY(1rem); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .sz-consent {
    left: 0;
    right: 0;
    bottom: 0;
    justify-content: stretch;
    padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
  }
  .sz-consent__card {
    max-width: none;
    max-height: min(78vh, 78dvh);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.1rem 1.1rem calc(1rem + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 1.25rem 1.25rem 0 0;
    box-shadow: 0 -1rem 3rem rgba(0, 0, 0, .55);
  }
  .sz-consent__title { margin-bottom: .45rem; font-size: 1.1rem; padding-right: 2.6rem; }
  .sz-consent__text { font-size: 0.8125rem; line-height: 1.5; }
  .sz-consent__panel { margin-top: .8rem; padding-top: .8rem; gap: .75rem; }
  .sz-consent__actions { margin-top: .75rem; }
  .sz-consent__btn { min-height: 2.875rem; padding: .6rem .5rem; font-size: 0.8125rem; }
  .sz-consent__btn--text { min-height: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sz-consent__card { animation: none; }
}
