.footer-cookie-settings {
  padding: 0;
  border: 0;
  background: none;
  color: #5c5364;
  font: inherit;
  font-size: .8rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.footer-cookie-settings:hover,
.footer-cookie-settings:focus-visible { color: var(--plum, #4b2169); }

.cookie-consent.is-hidden,
.cookie-consent-preferences.is-hidden,
.cookie-consent-actions.is-hidden { display: none !important; }

/* Keep cookie settings reachable even if the consent script fails to load. */
#cookie-consent:target { display: grid !important; }
#cookie-consent:target [data-cookie-preferences] { display: grid !important; }
#cookie-consent:target [data-cookie-actions] { display: none !important; }

.cookie-consent {
  position: fixed;
  z-index: 12000;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  display: grid;
  width: min(960px, calc(100% - 32px));
  max-height: min(86vh, 720px);
  gap: 18px;
  margin-inline: auto;
  overflow: auto;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid #e5d9eb;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 70px rgb(32 15 43 / 28%);
  color: #30223b;
}

.cookie-consent h2 { margin: 2px 0 8px; color: #3d1b58; font-size: 1.3rem; }
.cookie-consent p { margin: 0; color: #5d5365; line-height: 1.65; }
.cookie-consent-copy > a { display: inline-block; margin-top: 8px; color: #4d2267; font-weight: 700; text-underline-offset: 3px; }
.cookie-consent-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-consent-actions .button { min-height: 44px; }
.cookie-consent-actions [data-cookie-accept],
.cookie-consent-actions [data-cookie-reject] {
  border-color: #4b2169;
  background: #4b2169;
  color: #fff;
  font-weight: 700;
}
.cookie-consent-actions [data-cookie-accept]:hover,
.cookie-consent-actions [data-cookie-reject]:hover { background: #37154f; }
.cookie-consent-preferences { display: grid; gap: 12px; }
.cookie-category { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: start; gap: 12px; padding: 14px; border: 1px solid #e8deed; border-radius: 14px; cursor: pointer; }
.cookie-category input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: #542471; }
.cookie-category strong, .cookie-category small { display: block; }
.cookie-category small { margin-top: 4px; color: #62566c; font-size: .9rem; line-height: 1.55; }

@media (max-width: 640px) {
  .cookie-consent { right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); left: 8px; width: calc(100% - 16px); gap: 14px; padding: 18px; border-radius: 18px; }
  .cookie-consent-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .cookie-consent-actions [data-cookie-customize] { grid-column: 1 / -1; }
  .cookie-consent-preferences .cookie-consent-actions { grid-template-columns: 1fr; }
  .cookie-consent-preferences .cookie-consent-actions button { width: 100%; }
  .footer-cookie-settings { text-align: left; }
}

/* The anchor fallback must outrank the closed-state rule in every browser. */
html body #cookie-consent.cookie-consent.is-hidden:target { display: grid !important; }
