.cky-consent-container {
  left: 24px !important;
  right: auto !important;
  bottom: 24px !important;
  width: min(560px, calc(100% - 48px)) !important;
  max-width: calc(100% - 48px) !important;
}

.cky-consent-bar,
.cky-modal,
.cky-preference-center {
  border-radius: 0 !important;
  border: 1px solid rgba(17, 17, 17, 0.16) !important;
  background: rgba(250, 250, 248, 0.96) !important;
  color: #111111 !important;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.2) !important;
  font-family: Inter, Switzer, "Neue Haas Grotesk Display Pro", Arial, sans-serif !important;
}

.cky-consent-bar {
  padding: 18px !important;
}

.cky-title {
  margin: 0 0 8px !important;
  color: #111111 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em !important;
  line-height: 1.2 !important;
  text-transform: uppercase !important;
}

.cky-notice-group {
  display: grid !important;
  gap: 14px !important;
}

.cky-notice-des,
.cky-notice-des * {
  color: rgba(17, 17, 17, 0.72) !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

.cky-notice-btn-wrapper {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-top: 0 !important;
}

.cky-btn {
  min-height: 38px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
}

.cky-btn-accept,
.cky-btn-preferences {
  background: #111111 !important;
  border-color: #111111 !important;
  color: #ffffff !important;
}

.cky-btn-reject {
  background: rgba(17, 17, 17, 0.08) !important;
  border-color: rgba(17, 17, 17, 0.18) !important;
  color: #111111 !important;
}

.cky-btn-customize {
  background: transparent !important;
  border-color: rgba(17, 17, 17, 0.18) !important;
  color: #111111 !important;
}

.cky-btn-accept:hover,
.cky-btn-preferences:hover,
.cky-btn-reject:hover,
.cky-btn-customize:hover {
  background: #000000 !important;
  border-color: #000000 !important;
  color: #ffffff !important;
}

.cky-switch input:checked {
  background: #111111 !important;
  border-color: #111111 !important;
}

.cky-preference-header .cky-btn-close:hover {
  background: #111111 !important;
  border-color: #111111 !important;
}

.cky-accordion-btn:hover,
.cky-footer-wrapper a,
.cky-show-desc-btn,
.cky-always-active {
  color: #111111 !important;
}

.cky-btn-revisit-wrapper {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 640px) {
  .cky-consent-container {
    left: 12px !important;
    bottom: 12px !important;
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
  }

  .cky-consent-bar {
    padding: 14px !important;
  }

  .cky-notice-btn-wrapper {
    grid-template-columns: 1fr !important;
  }

  .cky-btn {
    width: 100% !important;
  }

}

/* The consent gate (see installConsentGate in src/consent.ts): while
   the banner is up and unanswered, the page behind it is dimmed and locked and
   the banner sits in the middle as a modal. The attribute comes and goes with
   the banner itself, so none of this applies once a choice is made — or on a
   page where CookieYes never showed a banner. */
html[data-consent-gate="pending"],
html[data-consent-gate="pending"] body {
  overflow: hidden !important;
}

html[data-consent-gate="pending"]::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.7);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 2147483000;
}

/* Before the delay has run (see CONSENT_GATE_DELAY_MS in src/consent.ts) the
   banner CookieYes already rendered is kept out of sight and out of reach; the
   page underneath stays fully usable. */
html[data-consent-gate="waiting"] .cky-consent-container {
  visibility: hidden !important;
  pointer-events: none !important;
}

html[data-consent-gate="pending"] .cky-consent-container {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  width: min(560px, calc(100% - 32px)) !important;
  max-width: calc(100% - 32px) !important;
  max-height: calc(100% - 32px) !important;
  overflow: auto !important;
  z-index: 2147483600 !important;
  animation: shift-consent-gate-in 220ms ease-out both;
}

/* Big and plain, the same as joinshift.uk. "Solo necessari" (CookieYes's reject
   button, renamed in public/cookieyes-text.js) is greyer than "Accetta tutto" but
   never smaller: rejecting must be as easy as accepting. */
html[data-consent-gate="pending"] .cky-consent-bar {
  padding: 32px 28px 8px !important;
}

html[data-consent-gate="pending"] .cky-title {
  margin: 0 0 12px !important;
  font-size: 26px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  line-height: 1.15 !important;
  text-transform: none !important;
}

html[data-consent-gate="pending"] .cky-notice-des,
html[data-consent-gate="pending"] .cky-notice-des * {
  font-size: 14px !important;
  line-height: 1.55 !important;
}

html[data-consent-gate="pending"] .cky-notice-btn-wrapper {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

html[data-consent-gate="pending"] .cky-btn-accept,
html[data-consent-gate="pending"] .cky-btn-reject {
  min-height: 52px !important;
  font-size: 12px !important;
}

html[data-consent-gate="pending"] .cky-btn-accept {
  order: 1 !important;
}

html[data-consent-gate="pending"] .cky-btn-reject {
  order: 2 !important;
}

html[data-consent-gate="pending"] .cky-btn-customize,
html[data-consent-gate="pending"] .cky-btn-customize:hover {
  order: 3 !important;
  grid-column: 1 / -1 !important;
  min-height: 32px !important;
  font-size: 13px !important;
  background: transparent !important;
  border-color: transparent !important;
  color: rgba(17, 17, 17, 0.6) !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  text-decoration: underline !important;
}

/* The close X (added by public/cookieyes-text.js) rejects, per the Garante. */
.cky-consent-bar {
  position: relative !important;
}

.cky-consent-bar .cky-title {
  padding-right: 36px !important;
}

.cky-consent-bar .shift-cky-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #111111;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.cky-consent-bar .shift-cky-close:hover {
  color: #E9531F;
}

.cky-notice-des a {
  color: #111111 !important;
  text-decoration: underline !important;
}

@media (max-width: 640px) {
  html[data-consent-gate="pending"] .cky-consent-bar {
    padding: 24px 18px 8px !important;
  }

  html[data-consent-gate="pending"] .cky-title {
    font-size: 22px !important;
  }

  html[data-consent-gate="pending"] .cky-notice-btn-wrapper {
    grid-template-columns: 1fr !important;
  }
}

html[data-consent-gate="pending"]::after {
  animation: shift-consent-backdrop-in 220ms ease-out both;
}

@keyframes shift-consent-gate-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shift-consent-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* The preference centre ("Customize") opens above the same backdrop. */
html[data-consent-gate="pending"] .cky-overlay {
  z-index: 2147483500 !important;
}

html[data-consent-gate="pending"] .cky-modal {
  z-index: 2147483600 !important;
}
