#tcs-consent,
#tcs-consent-settings {
  --tcs-consent-accent: var(--tcs-brand-red, #c50f0f);
  --tcs-consent-accent-strong: var(--tcs-brand-red-strong, #a80c0c);
  --tcs-consent-surface: #121212;
  --tcs-consent-ink: #f5f5f5;
  --tcs-consent-muted: #c4c4c4;
  -webkit-tap-highlight-color: transparent;
}

#tcs-consent[hidden],
#tcs-consent-settings[hidden],
#tcs-consent .tcs-consent__options[hidden] {
  display: none;
}

#tcs-consent {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 20px;
  z-index: 2147483000;
  box-sizing: border-box;
  width: min(400px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 20px;
  border-radius: 12px;
  background: var(--tcs-consent-surface);
  color: var(--tcs-consent-ink);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1), 0 16px 40px rgb(0 0 0 / 0.45);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

#tcs-consent *,
#tcs-consent *::before {
  box-sizing: border-box;
}

#tcs-consent p {
  max-width: none;
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

#tcs-consent .tcs-consent__title {
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 700;
}

#tcs-consent .tcs-consent__text {
  color: var(--tcs-consent-muted);
}

#tcs-consent .tcs-consent__text a {
  color: var(--tcs-consent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

#tcs-consent .tcs-consent__options {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgb(255 255 255 / 0.12);
}

#tcs-consent .tcs-consent__switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  margin: 0;
  color: var(--tcs-consent-ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#tcs-consent .tcs-consent__hint {
  margin-top: -4px;
  color: var(--tcs-consent-muted);
}

#tcs-consent input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 44px;
  height: 24px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: #707070;
  cursor: pointer;
  transition: background-color 160ms cubic-bezier(0.2, 0, 0, 1);
}

#tcs-consent input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms cubic-bezier(0.2, 0, 0, 1);
}

#tcs-consent input[type="checkbox"]:checked {
  background: var(--tcs-consent-accent);
}

#tcs-consent input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}

#tcs-consent .tcs-consent__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

#tcs-consent button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: background-color 160ms cubic-bezier(0.2, 0, 0, 1), transform 160ms cubic-bezier(0.2, 0, 0, 1);
}

#tcs-consent .tcs-consent__button {
  background: var(--tcs-consent-accent);
  color: #fff;
}

#tcs-consent .tcs-consent__options .tcs-consent__button {
  width: 100%;
}

#tcs-consent .tcs-consent__customize {
  grid-column: 1 / -1;
  min-height: 40px;
  background: transparent;
  color: var(--tcs-consent-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

#tcs-consent button:active,
#tcs-consent-settings:active {
  transform: scale(0.97);
}

#tcs-consent :focus-visible,
#tcs-consent:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

#tcs-consent-settings:focus-visible {
  outline: 2px solid var(--tcs-consent-surface);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #fff;
}

#tcs-consent-settings {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 16px;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--tcs-consent-accent);
  border-radius: 50%;
  background: var(--tcs-consent-surface);
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.3);
  color: var(--tcs-consent-accent);
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 200ms cubic-bezier(0.2, 0, 0, 1), visibility 200ms, transform 160ms cubic-bezier(0.2, 0, 0, 1);
}

#tcs-consent-settings svg {
  display: block;
  width: 22px;
  height: 22px;
}

#tcs-consent-settings.is-scrolling {
  opacity: 0;
  visibility: hidden;
}

@media (hover: hover) and (pointer: fine) {
  #tcs-consent .tcs-consent__button:hover {
    background: var(--tcs-consent-accent-strong);
  }

  #tcs-consent .tcs-consent__customize:hover {
    color: #fff;
    text-decoration-thickness: 2px;
  }

  #tcs-consent-settings:hover {
    background: var(--tcs-consent-accent);
    color: #fff;
  }
}

@media (max-width: 600px) {
  #tcs-consent {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    width: auto;
    max-height: calc(100dvh - 24px);
    padding: 16px;
  }

  #tcs-consent-settings {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 12px;
  }
}

@media (forced-colors: active) {
  #tcs-consent input[type="checkbox"] {
    -webkit-appearance: auto;
    appearance: auto;
    width: 24px;
  }

  #tcs-consent input[type="checkbox"]::before {
    content: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  #tcs-consent:not([hidden]) {
    animation: tcs-consent-in 200ms cubic-bezier(0.2, 0, 0, 1);
  }
}

@keyframes tcs-consent-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
