.brl-consent-root {
  --brl-consent-success: #16a34a;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
  color: var(--brl-consent-text);
  font: 400 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.brl-consent-overlay {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--brl-consent-overlay) 62%, transparent);
  pointer-events: auto;
}

.brl-consent-banner,
.brl-consent-preferences {
  position: absolute;
  background: var(--brl-consent-bg);
  border: 1px solid var(--brl-consent-border);
  border-radius: var(--brl-consent-radius);
  box-shadow: 0 18px 55px rgba(15, 23, 42, .24);
  pointer-events: auto;
}

.brl-consent-banner {
  left: 20px;
  right: 20px;
  bottom: 20px;
  max-width: var(--brl-consent-width);
  margin: auto;
  padding: 22px;
  display: flex;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
}

.brl-consent-banner.is-top {
  top: 20px;
  bottom: auto;
}

.brl-consent-banner.is-popup,
.brl-consent-banner.is-center {
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  width: min(520px, calc(100% - 32px));
  transform: translate(-50%, -50%);
  display: block;
}

.brl-consent-copy {
  max-width: 760px;
}

.brl-consent-copy h2,
.brl-consent-preferences h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  color: var(--brl-consent-text);
}

.brl-consent-copy h2 {
  margin-bottom: 7px;
}

.brl-consent-copy p {
  margin: 0 0 5px;
  color: var(--brl-consent-muted);
}

.brl-consent-copy a {
  color: var(--brl-consent-accent);
}

.brl-consent-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.brl-consent-button,
.brl-consent-reopen,
.brl-consent-shortcode,
.brl-consent-embed button {
  appearance: none;
  min-height: 42px;
  border: 1px solid var(--brl-consent-border, #e2e8f0);
  border-radius: var(--brl-consent-button-radius, 7px);
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s;
}

.brl-consent-button:hover,
.brl-consent-reopen:hover,
.brl-consent-shortcode:hover,
.brl-consent-embed button:hover {
  transform: translateY(-1px);
}

.brl-consent-button:focus-visible,
.brl-consent-reopen:focus-visible,
.brl-consent-shortcode:focus-visible,
.brl-consent-embed button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brl-consent-accent) 24%, transparent);
}

.brl-consent-button.is-primary {
  background: var(--brl-consent-accent);
  border-color: var(--brl-consent-accent);
  color: var(--brl-consent-accent-text);
}

.brl-consent-button.is-secondary {
  background: var(--brl-consent-bg);
  color: var(--brl-consent-text);
}

.brl-consent-preferences {
  left: 50%;
  top: 50%;
  width: min(620px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
}

.brl-consent-preferences-header,
.brl-consent-preferences-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: var(--brl-consent-bg);
}

.brl-consent-preferences-header {
  border-bottom: 1px solid var(--brl-consent-border);
}

.brl-consent-preferences-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--brl-consent-border);
  box-shadow: 0 -8px 22px rgba(15, 23, 42, .045);
}

.brl-consent-preferences-footer .brl-consent-button {
  min-width: 190px;
}

.brl-consent-preferences-header > button {
  appearance: none;
  width: 36px;
  height: 36px;
  margin: -6px -7px -6px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--brl-consent-text);
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.brl-consent-preferences-header > button:hover,
.brl-consent-preferences-header > button:focus-visible {
  background: color-mix(in srgb, var(--brl-consent-border) 55%, transparent);
  outline: none;
}

.brl-consent-categories {
  min-height: 0;
  padding: 4px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brl-consent-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--brl-consent-border);
}

.brl-consent-category:last-child {
  border-bottom: 0;
}

.brl-consent-category-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.brl-consent-category-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.25;
}

.brl-consent-category small {
  color: var(--brl-consent-muted);
}

.brl-consent-category-control {
  display: flex;
  flex: 0 0 128px;
  align-items: center;
  justify-content: flex-end;
}

.brl-consent-category em {
  color: var(--brl-consent-muted);
  font-size: 12px;
  white-space: nowrap;
}

.brl-consent-choice {
  position: relative;
  display: inline-flex;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

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

.brl-consent-choice i {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  border: 2px solid color-mix(in srgb, var(--brl-consent-muted) 48%, var(--brl-consent-border));
  border-radius: 6px;
  background: var(--brl-consent-bg);
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}

.brl-consent-choice i::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: rotate(45deg) scale(.7);
  transition: opacity .15s, transform .15s;
}

.brl-consent-choice input:checked + i {
  border-color: var(--brl-consent-success);
  background: var(--brl-consent-success);
}

.brl-consent-choice input:checked + i::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.brl-consent-choice input:focus-visible + i {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brl-consent-success) 24%, transparent);
}

.brl-consent-root button.brl-consent-category-tip {
  appearance: none !important;
  position: relative !important;
  display: inline-grid !important;
  box-sizing: border-box !important;
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
  flex: 0 0 18px !important;
  place-items: center !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  border: 1px solid var(--brl-consent-border) !important;
  border-radius: 50% !important;
  background: var(--brl-consent-bg) !important;
  background-image: none !important;
  color: var(--brl-consent-muted) !important;
  box-shadow: none !important;
  font-family: inherit !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 16px !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  text-transform: none !important;
  vertical-align: middle !important;
  transform: none !important;
  cursor: help;
}

.brl-consent-root button.brl-consent-category-tip > span[aria-hidden="true"] {
  display: block !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  font: inherit !important;
  line-height: 16px !important;
}

.brl-consent-category-tip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brl-consent-accent) 22%, transparent);
}

.brl-consent-category-tooltip {
  position: absolute;
  left: -9px;
  bottom: calc(100% + 9px);
  z-index: 5;
  width: 290px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #111827;
  color: #f8fafc;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .28);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .15s, transform .15s;
}

.brl-consent-category-tip.is-below .brl-consent-category-tooltip {
  top: calc(100% + 9px);
  bottom: auto;
  transform: translateY(-4px);
}

.brl-consent-category-tip:hover .brl-consent-category-tooltip,
.brl-consent-category-tip:focus .brl-consent-category-tooltip,
.brl-consent-category-tip.is-open .brl-consent-category-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.brl-consent-root .brl-consent-preferences-footer button.brl-consent-button.is-primary {
  border: 1px solid var(--brl-consent-accent) !important;
  border-radius: var(--brl-consent-button-radius, 7px) !important;
  background: var(--brl-consent-accent) !important;
  background-image: none !important;
  color: var(--brl-consent-accent-text) !important;
  box-shadow: none !important;
}

.brl-consent-root .brl-consent-preferences-footer button.brl-consent-button.is-primary:hover {
  border-color: color-mix(in srgb, var(--brl-consent-accent) 84%, #000) !important;
  background: color-mix(in srgb, var(--brl-consent-accent) 88%, #000) !important;
  color: var(--brl-consent-accent-text) !important;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--brl-consent-accent) 24%, transparent) !important;
  transform: translateY(-1px);
}

.brl-consent-root .brl-consent-preferences-footer button.brl-consent-button.is-primary:active {
  box-shadow: none !important;
  transform: translateY(0);
}

.brl-consent-root > .brl-consent-reopen {
  position: fixed;
  top: auto !important;
  right: auto !important;
  bottom: 16px !important;
  left: 16px !important;
  z-index: 2147483001 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: calc(100vw - 32px);
  margin: 0 !important;
  background: var(--brl-consent-bg) !important;
  color: var(--brl-consent-text) !important;
  pointer-events: auto;
}

.brl-consent-root > .brl-consent-reopen.is-right {
  left: auto !important;
  right: 16px !important;
}

/* The icon form. Deliberately quiet: it sits over the shop for the whole visit,
   so it stays a small ring at 60% until the pointer or the keyboard reaches it,
   and only then takes its full colour. */
.brl-consent-root > .brl-consent-reopen.is-icon {
  width: 42px;
  height: 42px;
  padding: 0 !important;
  border-radius: 999px;
  opacity: .6;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .12);
  transition: opacity .18s, transform .18s;
}

.brl-consent-root > .brl-consent-reopen.is-icon:hover,
.brl-consent-root > .brl-consent-reopen.is-icon:focus-visible {
  opacity: 1;
  transform: translateY(-1px);
}

.brl-consent-root > .brl-consent-reopen.is-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .brl-consent-root > .brl-consent-reopen.is-icon {
    transition: none;
  }
  .brl-consent-root > .brl-consent-reopen.is-icon:hover {
    transform: none;
  }
}

.brl-consent-embed {
  padding: 28px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  text-align: center;
}

.brl-consent-embed p {
  margin: 0 0 12px;
}

@media (max-width: 720px) {
  .brl-consent-banner {
    display: block;
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 18px;
  }

  .brl-consent-actions {
    margin-top: 16px;
    justify-content: stretch;
  }

  .brl-consent-actions button {
    flex: 1 1 140px;
  }

  .brl-consent-preferences {
    width: calc(100% - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }

  .brl-consent-preferences-header,
  .brl-consent-preferences-footer {
    padding: 16px;
  }

  .brl-consent-categories {
    padding: 2px 16px;
  }

  .brl-consent-category {
    gap: 14px;
  }

  .brl-consent-category-control {
    flex-basis: 112px;
  }

  .brl-consent-category-tooltip {
    width: min(250px, calc(100vw - 74px));
  }

  .brl-consent-preferences-footer .brl-consent-button {
    width: 100%;
  }
}


/* --- Looks chosen in the admin ------------------------------------------------
   One class per choice on the root, so a look never needs a second stylesheet:
   the button fill, the secondary buttons, the category toggles and the depth. */

.brl-consent-root {
  font-size: var(--brl-consent-font-size, 15px);
}

.brl-consent-root .brl-consent-button,
.brl-consent-root .brl-consent-reopen.is-label {
  font-size: calc(var(--brl-consent-font-size, 15px) - 1px);
}

/* Main button as an outline: the accent draws the frame and the text. */
.brl-consent-primary-outline .brl-consent-button.is-primary,
.brl-consent-root.brl-consent-primary-outline .brl-consent-preferences-footer button.brl-consent-button.is-primary {
  background: transparent !important;
  border-color: var(--brl-consent-accent) !important;
  color: var(--brl-consent-accent) !important;
}

.brl-consent-primary-outline .brl-consent-button.is-primary:hover,
.brl-consent-root.brl-consent-primary-outline .brl-consent-preferences-footer button.brl-consent-button.is-primary:hover {
  background: color-mix(in srgb, var(--brl-consent-accent) 10%, transparent) !important;
  color: var(--brl-consent-accent) !important;
}

/* Secondary buttons: a tinted fill, or plain underlined text. */
.brl-consent-secondary-fill .brl-consent-button.is-secondary {
  background: color-mix(in srgb, var(--brl-consent-accent) 12%, var(--brl-consent-bg));
  border-color: transparent;
  color: var(--brl-consent-text);
}

.brl-consent-secondary-text .brl-consent-button.is-secondary {
  padding-inline: 8px;
  background: transparent;
  border-color: transparent;
  color: var(--brl-consent-text);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--brl-consent-text) 35%, transparent);
  text-underline-offset: 4px;
}

.brl-consent-secondary-text .brl-consent-button.is-secondary:hover {
  transform: none;
  text-decoration-color: currentColor;
}

/* Depth of the banner and the preferences window. */
.brl-consent-shadow-none .brl-consent-banner,
.brl-consent-shadow-none .brl-consent-preferences {
  box-shadow: none;
}

.brl-consent-shadow-strong .brl-consent-banner,
.brl-consent-shadow-strong .brl-consent-preferences {
  box-shadow: 0 30px 80px rgba(15, 23, 42, .38);
}

/* Category toggles: a switch, or a round check. The square check is the default. */
.brl-consent-toggle-switch .brl-consent-choice,
.brl-consent-toggle-switch .brl-consent-choice i {
  width: 42px;
  height: 24px;
}

.brl-consent-toggle-switch .brl-consent-choice i {
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brl-consent-muted) 32%, var(--brl-consent-border));
}

.brl-consent-toggle-switch .brl-consent-choice i::after {
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
  opacity: 1;
  transform: none;
  transition: transform .18s;
}

.brl-consent-toggle-switch .brl-consent-choice input:checked + i {
  background: var(--brl-consent-success);
}

.brl-consent-toggle-switch .brl-consent-choice input:checked + i::after {
  transform: translateX(18px);
}

.brl-consent-toggle-round .brl-consent-choice i {
  border-radius: 50%;
}

/* The data request form from [brl_privacy_request]. It takes the theme's form
   styling and only lays out the parts. */
.brl-privacy-request { display: grid; gap: 4px; max-width: 520px; }
.brl-privacy-request fieldset { margin: 0; padding: 0; border: 0; }
.brl-privacy-request fieldset label { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.brl-privacy-request label[for] { display: block; margin-bottom: 4px; font-weight: 600; }
.brl-privacy-request input[type="email"] { width: 100%; }
.brl-privacy-request-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.brl-privacy-request-note { padding: 10px 12px; border: 1px solid currentColor; border-radius: 6px; }
