.refo-consent {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 2147483000;
  display: flex;
  justify-content: center;
  color: var(--refo-text-primary);
  font-size: 15px;
  line-height: 1.4;
}

/* The sheet is the last thing in the document, after the scripts. A frame painted
   while it is half parsed would show an empty box that then jumps to full height
   (a layout shift of 0.08), so it stays unrendered until its end marker is parsed. */
.refo-consent:not(:has([data-refo-consent-end])) {
  display: none;
}

.refo-consent-settings-footer {
  display: flex;
  justify-content: flex-start;
  padding-top: 8px;
}

.refo-consent-settings-footer__button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  line-height: 1.3;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  cursor: pointer;
  opacity: 0.86;
}

.refo-consent-settings-footer__button:hover,
.refo-consent-settings-footer__button:focus-visible {
  color: inherit;
  opacity: 1;
}

.refo-consent-settings-footer__button:focus-visible {
  outline: 3px solid var(--refo-signal-ring);
  outline-offset: 3px;
}

.refo-consent-settings-footer__icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--refo-signal);
}

.refo-consent,
.refo-consent *,
.refo-consent *::before,
.refo-consent *::after {
  box-sizing: border-box;
}

.refo-consent[hidden],
.refo-consent [hidden] {
  display: none !important;
}

.refo-consent__body {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(100%, 1120px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--refo-border-blue-muted);
  border-radius: var(--refo-radius-card);
  background:
    linear-gradient(135deg, var(--refo-signal-subtle), var(--refo-bg-surface) 42%),
    var(--refo-bg-surface);
  box-shadow: var(--refo-shadow-popover);
}

.refo-consent__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 820px;
  padding-right: 48px;
}

.refo-consent__eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 4px 9px;
  border: 1px solid var(--refo-signal-border);
  border-radius: 999px;
  background: var(--refo-bg-surface);
  color: var(--refo-signal-hover);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}

.refo-consent__text strong {
  color: var(--refo-text-primary);
  font-size: 18px;
  line-height: 1.2;
}

.refo-consent__text > span:not(.refo-consent__eyebrow) {
  color: var(--refo-text-secondary);
  line-height: 1.47;
}

.refo-consent__text small {
  color: var(--refo-text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.refo-consent__choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.refo-consent__choices-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.refo-consent__choice {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--refo-border-subtle);
  border-radius: var(--refo-radius-card);
  background: var(--refo-bg-surface);
  box-shadow: var(--refo-shadow-xs);
}

.refo-consent__choices label {
  cursor: pointer;
}

.refo-consent__choices label:hover {
  border-color: var(--refo-primary-border-hover);
  background: var(--refo-bg-surface-hover);
}

.refo-consent__choices label:has(input:checked) {
  border-color: var(--refo-signal);
  background: var(--refo-signal-subtle);
}

.refo-consent__choices label:focus-within {
  outline: 3px solid var(--refo-signal-ring);
  outline-offset: 2px;
}

.refo-consent__choice--locked {
  border-color: var(--refo-border-subtle);
  background: var(--refo-bg-surface-raised);
}

.refo-consent__choice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  align-self: flex-start;
  width: 44px;
  height: 44px;
  border-radius: var(--refo-radius-card);
  background: var(--refo-bg-blue-subtle);
  color: var(--refo-primary);
}

.refo-consent__choice-icon--necessary {
  background: var(--refo-bg-muted);
  color: var(--refo-text-secondary);
}

.refo-consent__choice-icon--marketing {
  background: var(--refo-status-success-bg);
  color: var(--refo-status-success-text);
}

.refo-consent__choice-icon-svg {
  width: 24px;
  height: 24px;
}

.refo-consent__choice-copy {
  display: grid;
  gap: 5px;
}

.refo-consent__choice-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.refo-consent__choices strong {
  color: var(--refo-text-primary);
  font-size: 15px;
}

.refo-consent__choices small {
  color: var(--refo-text-muted);
  font-size: 13px;
  line-height: 1.35;
}

.refo-consent__choice-status {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--refo-border-default);
  border-radius: 999px;
  background: var(--refo-bg-muted);
  color: var(--refo-text-secondary);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}

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

.refo-consent__choice-toggle {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 48px;
  height: 26px;
  border: 1px solid var(--refo-border-default);
  border-radius: 999px;
  background: var(--refo-bg-muted);
  box-shadow: inset 0 1px 2px oklch(0.263 0.068 259.1 / 0.1);
  transition:
    background-color var(--refo-duration-fast) var(--refo-ease-standard),
    border-color var(--refo-duration-fast) var(--refo-ease-standard);
}

.refo-consent__choice-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--refo-bg-surface);
  box-shadow: var(--refo-shadow-sm);
  transition: transform var(--refo-duration-fast) var(--refo-ease-standard);
}

.refo-consent__choice input:checked + .refo-consent__choice-toggle {
  border-color: var(--refo-signal-border);
  background: var(--refo-signal);
}

.refo-consent__choice input:checked + .refo-consent__choice-toggle::after,
.refo-consent__choice-toggle--locked::after {
  transform: translateX(22px);
}

.refo-consent__choice-toggle--locked {
  border-color: var(--refo-border-default);
  background: var(--refo-border-default);
}

.refo-consent__actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.refo-consent__button,
.refo-consent__close {
  border: 1px solid var(--refo-border-default);
  border-radius: var(--refo-radius-control);
  background: var(--refo-bg-surface);
  color: var(--refo-text-primary);
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color var(--refo-duration-fast) var(--refo-ease-standard),
    border-color var(--refo-duration-fast) var(--refo-ease-standard),
    box-shadow var(--refo-duration-fast) var(--refo-ease-standard),
    color var(--refo-duration-fast) var(--refo-ease-standard);
}

.refo-consent__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 16px;
}

.refo-consent__button:hover,
.refo-consent__close:hover {
  border-color: var(--refo-primary-border-hover);
  background: var(--refo-bg-surface-hover);
}

.refo-consent__button--primary {
  border-color: var(--refo-signal);
  background: var(--refo-signal);
  color: var(--refo-on-signal);
  box-shadow: 0 10px 24px var(--refo-signal-ring);
}

.refo-consent__button--primary:hover {
  border-color: var(--refo-signal-hover);
  background: var(--refo-signal-hover);
  color: var(--refo-on-signal);
}

.refo-consent__button:focus-visible,
.refo-consent__close:focus-visible {
  outline: 3px solid var(--refo-signal-ring);
  outline-offset: 2px;
}

.refo-consent__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
}

.refo-consent__thanks {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 12px 4px;
  color: var(--refo-text-primary);
  font-weight: 700;
}

.refo-consent__thanks-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--refo-signal);
}

.refo-consent--thanks .refo-consent__text,
.refo-consent--thanks .refo-consent__choices,
.refo-consent--thanks .refo-consent__actions,
.refo-consent--thanks .refo-consent__close {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  .refo-consent__body {
    animation: refo-consent-enter 0.4s var(--refo-ease-standard) both;
  }

  .refo-consent__button--primary {
    animation: refo-consent-nudge 1.4s var(--refo-ease-standard) 1.6s 2;
  }
}

@keyframes refo-consent-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes refo-consent-nudge {
  0%,
  100% {
    box-shadow: 0 10px 24px var(--refo-signal-ring);
  }

  50% {
    box-shadow: 0 12px 30px var(--refo-signal-ring), 0 0 0 6px var(--refo-signal-ring);
  }
}

@media (max-width: 900px) {
  .refo-consent__choices {
    grid-template-columns: 1fr;
  }

  .refo-consent__actions {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .refo-consent__button {
    flex: 1 1 150px;
  }
}

@media (max-width: 760px) {
  .refo-consent {
    right: 8px;
    bottom: 8px;
    left: 8px;
  }

  .refo-consent__body {
    gap: 12px;
    max-height: calc(100dvh - 16px);
    padding: 14px;
  }

  .refo-consent__text {
    padding-right: 44px;
  }

  .refo-consent__choice {
    padding: 10px;
  }

  .refo-consent__choice-icon {
    width: 38px;
    height: 38px;
  }

  .refo-consent__choice-icon-svg {
    width: 21px;
    height: 21px;
  }

  .refo-consent__close {
    top: 10px;
    right: 10px;
  }

  .refo-consent__button {
    flex: 1 1 140px;
  }
}

@media (max-width: 520px) {
  .refo-consent__button--primary {
    flex: 1 1 100%;
    order: 1;
  }
}
