.tf-consent-settings,
.tf-consent-status,
.tf-consent-dialog,
.tf-consent-dialog *,
.tf-consent-dialog *::before,
.tf-consent-dialog *::after {
  box-sizing: border-box;
}

.tf-consent-settings {
  position: fixed;
  inset: auto auto 1rem 1rem;
  z-index: 9990;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid #0c0c0c;
  border-radius: 50%;
  padding: 0;
  background: #0c0c0c;
  color: #ffffff;
  font-family: "Garet Variable", "Garet", sans-serif;
  cursor: pointer;
  box-shadow: 0 .3rem 1rem rgb(0 0 0 / .18);
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.tf-consent-settings::after {
  content: attr(data-label);
  position: absolute;
  top: 50%;
  left: calc(100% + .65rem);
  width: max-content;
  max-width: calc(100vw - 5.3rem);
  border: 1px solid #0c0c0c;
  border-radius: .25rem;
  padding: .4rem .55rem;
  background: #ffffff;
  color: #0c0c0c;
  font-size: .875rem;
  line-height: 1.2;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-.25rem);
  transition: opacity 120ms ease, transform 120ms ease;
}

.tf-consent-settings:hover::after,
.tf-consent-settings:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.tf-consent-settings-icon {
  display: block;
  width: 2rem;
  height: 2rem;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tf-consent-dialog {
  width: min(42rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  border: 1px solid #0c0c0c;
  border-radius: .35rem;
  padding: 0;
  background: #ffffff;
  color: #0c0c0c;
  font-family: "Garet Variable", "Garet", sans-serif;
  box-shadow: 0 1rem 3rem rgb(0 0 0 / .2);
  animation: tf-consent-dialog-enter 150ms ease-out both;
}

.tf-consent-dialog::backdrop {
  background: rgb(0 0 0 / .62);
  animation: tf-consent-backdrop-enter 150ms ease-out both;
}

.tf-consent-dialog ::selection {
  background: #0c0c0c;
  color: #ffffff;
}

.tf-consent-dialog ::-moz-selection {
  background: #0c0c0c;
  color: #ffffff;
}

@keyframes tf-consent-dialog-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tf-consent-backdrop-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tf-consent-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow: auto;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  padding: clamp(1rem, 4vw, 2rem);
  overflow-wrap: anywhere;
  font-family: inherit;
  line-height: 1.5;
}

.tf-consent-opening {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tf-consent-intro {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.tf-consent-panel h2 {
  max-width: calc(100% - 3rem);
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.6rem);
  line-height: 1.05;
}

.tf-consent-panel h2:focus {
  outline: none;
}

.tf-consent-panel p {
  margin: 0;
  max-width: 62ch;
}

.tf-consent-dialog [hidden] {
  display: none !important;
}

.tf-consent-close {
  --close-btn-size: 40px;
  --close-icon-width: 20px;
  --close-thickness: 2px;

  position: absolute;
  inset: 1rem 1rem auto auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--close-btn-size);
  height: var(--close-btn-size);
  border: 2px solid #0c0c0c;
  border-radius: 50%;
  padding: 0;
  background: #ffffff;
  color: #0c0c0c;
  cursor: pointer;
  transition: background-color .4s cubic-bezier(.16, 1, .3, 1), transform .4s cubic-bezier(.16, 1, .3, 1);
}

.tf-consent-close::before,
.tf-consent-close::after {
  position: absolute;
  width: var(--close-icon-width);
  height: var(--close-thickness);
  background: currentColor;
  content: "";
}

.tf-consent-close::before {
  transform: rotate(45deg);
}

.tf-consent-close::after {
  transform: rotate(-45deg);
}

.tf-consent-close:hover,
.tf-consent-close:focus-visible {
  background: #0c0c0c;
  color: #ffffff;
  outline: none;
  transform: rotate(90deg);
}

.tf-consent-first {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.tf-consent-first button,
.tf-consent-custom > button {
  min-height: 2.75rem;
  border: 2px solid #0c0c0c;
  border-radius: .25rem;
  padding: .55rem .85rem;
  background: #ffffff;
  color: #0c0c0c;
  font: inherit;
  font-weight: 600;
}

.tf-consent-first [data-action="accept"],
.tf-consent-first [data-action="reject"] {
  flex: 1 1 calc(50% - .375rem);
  background: #0c0c0c;
  color: #ffffff;
}

.tf-consent-first [data-action="customise"] {
  flex: 1 0 100%;
}

.tf-consent-custom > button {
  background: #0c0c0c;
  color: #ffffff;
}

.tf-consent-custom {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tf-consent-optional {
  min-inline-size: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.tf-consent-optional legend {
  padding: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}

.tf-consent-section-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .75rem;
}

.tf-consent-section-row h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}

.tf-consent-section-row small,
.tf-consent-purpose-copy small {
  color: #242424;
  font-size: .8125rem;
  line-height: 1.4;
}

.tf-consent-purpose-copy strong {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.tf-consent-purpose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  border-block-start: 1px solid #242424;
  padding-block: 1rem;
}

.tf-consent-optional .tf-consent-purpose {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.tf-consent-purpose--necessary > div,
.tf-consent-purpose-copy {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.tf-consent-purpose-description {
  display: block;
}

.tf-consent-switch-target {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
}

.tf-consent-purpose input[role="switch"] {
  position: relative;
  width: 56px;
  height: 30px;
  margin: 0;
  border: 2px solid #0c0c0c;
  border-radius: 999px;
  background: #ebeaea;
  color: #0c0c0c;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background-color 120ms ease-in-out;
}

.tf-consent-purpose input[role="switch"]::before {
  position: absolute;
  inset: 2px auto auto 2px;
  width: 22px;
  height: 22px;
  border: 2px solid #0c0c0c;
  border-radius: 50%;
  background: #ffffff;
  content: "";
  transition: transform 120ms ease-in-out, border-color 120ms ease-in-out;
}

.tf-consent-purpose input[role="switch"]:checked {
  background: #0c0c0c;
}

.tf-consent-purpose input[role="switch"]:checked::before {
  border-color: #ffffff;
  transform: translateX(26px);
}

.tf-consent-advanced {
  border-block-start: 1px solid #0c0c0c;
  padding-block-start: 1rem;
}

.tf-consent-advanced summary {
  min-height: 2.75rem;
  cursor: pointer;
  font-weight: 600;
  line-height: 2.75rem;
}

.tf-consent-receipts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-block: .25rem 1rem;
}

.tf-consent-receipt-output {
  margin: 0;
}

.tf-consent-receipt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.tf-consent-receipt-actions button {
  min-height: 2.75rem;
  border: 1px solid #0c0c0c;
  border-radius: .25rem;
  padding: .55rem .85rem;
  background: #ffffff;
  color: #0c0c0c;
  font: inherit;
}

.tf-consent-receipt-output {
  overflow: auto;
  max-height: 14rem;
  border: 1px solid #242424;
  padding: .75rem;
  background: #ffffff;
  color: #0c0c0c;
  white-space: pre-wrap;
}

.tf-consent-dialog .tf-consent-links {
  position: static;
  inset: auto;
  z-index: auto;
  display: block;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  border: 0;
  border-block-start: 1px solid #242424;
  padding: 1rem 0 0;
  background: transparent;
  box-shadow: none;
}

.tf-consent-links a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: .1em;
  text-underline-offset: .15em;
}

.tf-consent-settings:hover,
.tf-consent-first [data-action="customise"]:hover,
.tf-consent-receipt-actions button:hover {
  background: #ebeaea;
}

.tf-consent-settings:hover {
  color: #0c0c0c;
  transform: translateY(-1px);
}

.tf-consent-first [data-action="accept"]:hover,
.tf-consent-first [data-action="reject"]:hover,
.tf-consent-custom > button:hover {
  background: #242424;
}

.tf-consent-status {
  position: fixed;
  inset: auto auto 4.75rem 1rem;
  z-index: 9990;
  max-width: min(24rem, calc(100% - 2rem));
  border: 1px solid #0c0c0c;
  border-radius: .25rem;
  padding: .65rem .85rem;
  background: #ffffff;
  color: #0c0c0c;
  font-family: "Garet Variable", "Garet", sans-serif;
  opacity: 1;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.tf-consent-status--fading {
  opacity: 0;
}

.tf-consent-status:empty,
.tf-consent-dialog-status:empty {
  display: none;
}

.tf-consent-dialog-status {
  border: 1px solid #242424;
  padding: .75rem;
  background: #ebeaea;
}

body:has(dialog[open]:not(.tf-consent-dialog), [aria-modal="true"]:not(.tf-consent-dialog):not([aria-hidden="true"]):not([aria-hidden="true"] *):not([inert] *):not([hidden] *)) > .tf-consent-settings,
body:has(dialog[open]:not(.tf-consent-dialog), [aria-modal="true"]:not(.tf-consent-dialog):not([aria-hidden="true"]):not([aria-hidden="true"] *):not([inert] *):not([hidden] *)) > .tf-consent-status {
  visibility: hidden;
  pointer-events: none;
}

.tf-sr-only {
  position: fixed;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.tf-consent-dialog button:not(.tf-consent-close):focus-visible,
.tf-consent-dialog a:focus-visible,
.tf-consent-dialog input:focus-visible,
.tf-consent-dialog summary:focus-visible,
.tf-consent-settings:focus-visible {
  outline: 4px solid #0c0c0c;
  outline-offset: 3px;
}

@media (max-width: 30rem) {
  .tf-consent-first {
    display: grid;
  }

  .tf-consent-first button {
    width: 100%;
  }

  .tf-consent-purpose {
    grid-template-columns: minmax(0, 1fr);
  }

  .tf-consent-switch-target {
    justify-self: start;
  }

  .tf-consent-receipt-actions {
    display: grid;
  }

  .tf-consent-receipt-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tf-consent-dialog,
  .tf-consent-dialog::backdrop,
  .tf-consent-dialog *,
  .tf-consent-dialog *::before,
  .tf-consent-dialog *::after,
  .tf-consent-settings,
  .tf-consent-status {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media (forced-colors: active) {
  .tf-consent-settings {
    border-color: ButtonText;
    background: ButtonFace;
    color: ButtonText;
    forced-color-adjust: none;
  }

  .tf-consent-settings::after {
    border-color: ButtonText;
    background: ButtonFace;
    color: ButtonText;
  }

  .tf-consent-close {
    border-color: ButtonText;
    background: ButtonFace;
    color: ButtonText;
  }

  .tf-consent-close:hover,
  .tf-consent-close:focus-visible {
    background: Highlight;
    color: HighlightText;
  }

  .tf-consent-purpose input[role="switch"] {
    border-color: ButtonText;
    background: ButtonFace;
    forced-color-adjust: none;
  }

  .tf-consent-purpose input[role="switch"]::before {
    border-color: ButtonText;
    background: ButtonFace;
  }

  .tf-consent-purpose input[role="switch"]:checked {
    background: ButtonText;
  }

  .tf-consent-purpose input[role="switch"]:checked::before {
    border-color: ButtonFace;
  }
}
