.cookie-preferences {
  --cookie-orange: #ff7115;
  --cookie-orange-dark: #d94f00;
  --cookie-ink: #241f20;
  --cookie-muted: #68615d;
  --cookie-line: #e5e0dc;
  position: fixed;
  z-index: 10000;
  left: max(20px, env(safe-area-inset-left));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: min(400px, calc(100vw - 40px));
  color: var(--cookie-ink);
  font-family: Mulish, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.cookie-preferences *,
.cookie-preferences *::before,
.cookie-preferences *::after {
  box-sizing: border-box;
}

.cookie-preferences__card {
  overflow: hidden;
  border: 1px solid var(--cookie-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(36, 31, 32, .16);
}

.cookie-preferences__accent {
  height: 4px;
  background: var(--cookie-orange);
}

.cookie-preferences__content {
  padding: 20px;
}

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

.cookie-preferences__title {
  margin: 0;
  color: var(--cookie-ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0;
}

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

.cookie-preferences__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.cookie-preferences__button {
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--cookie-ink);
  border-radius: 999px;
  background: var(--cookie-ink);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: center;
}

.cookie-preferences__button--accent {
  border-color: var(--cookie-orange);
  background: var(--cookie-orange);
}

.cookie-preferences__button--quiet {
  border-color: var(--cookie-line);
  background: #fff;
  color: var(--cookie-ink);
}

.cookie-preferences__button:hover,
.cookie-preferences__button:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 113, 21, .18);
  outline: none;
}

.cookie-preferences__manage {
  display: block;
  margin: 13px auto 0;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: var(--cookie-orange-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-preferences__manage:focus-visible,
.cookie-preferences__close:focus-visible {
  border-radius: 4px;
  outline: 3px solid rgba(255, 113, 21, .24);
  outline-offset: 2px;
}

.cookie-preferences__close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--cookie-line);
  border-radius: 50%;
  background: #fff;
  color: var(--cookie-ink);
  cursor: pointer;
  font: inherit;
  font-size: 21px;
  line-height: 1;
}

.cookie-preferences__options {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.cookie-preferences__option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--cookie-line);
  border-radius: 12px;
  background: #fcfaf6;
}

.cookie-preferences__option-title {
  display: block;
  font-weight: 900;
}

.cookie-preferences__option-copy {
  display: block;
  margin-top: 3px;
  color: var(--cookie-muted);
  font-size: 12px;
  line-height: 1.45;
}

.cookie-preferences__required {
  color: var(--cookie-muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.cookie-preferences__switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}

.cookie-preferences__switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.cookie-preferences__switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #bbb5b1;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.cookie-preferences__switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(36, 31, 32, .2);
  content: "";
  transition: transform 160ms ease;
}

.cookie-preferences__switch input:checked + .cookie-preferences__switch-track {
  background: var(--cookie-orange);
}

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

.cookie-preferences__switch input:focus-visible + .cookie-preferences__switch-track {
  outline: 3px solid rgba(255, 113, 21, .24);
  outline-offset: 2px;
}

.cookie-preferences__save {
  width: 100%;
  margin-top: 16px;
}

.cookie-preferences-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-preferences-link:hover,
.cookie-preferences-link:focus-visible {
  color: #ff7115;
}

@media (max-width: 520px) {
  .cookie-preferences {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    width: auto;
  }

  .cookie-preferences__content {
    padding: 18px;
  }

  .cookie-preferences__actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-preferences__switch-track,
  .cookie-preferences__switch-track::after {
    transition: none;
  }
}
