.cookie-consent {
  position: fixed;
  z-index: 1000;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(42rem, calc(100vw - 2rem));
  max-height: min(90vh, 42rem);
  overflow: auto;
  padding: 1.25rem;
  border: 1px solid rgba(0, 33, 71, 0.2);
  border-top: 3px solid var(--gold, #be9a41);
  border-radius: 0.5rem;
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 8px 32px rgba(0, 21, 46, 0.24);
  font: 400 0.95rem/1.55 var(--sans, system-ui, sans-serif);
}

.cookie-consent[hidden] { display: none; }
.cookie-consent h2 { margin: 0 0 0.5rem; color: var(--oxford, #002147); font: 600 1.15rem/1.3 var(--serif, Georgia, serif); }
.cookie-consent p { margin: 0 0 0.8rem; }
.cookie-consent a { color: var(--oxford-mid, #003366); text-decoration: underline; text-underline-offset: 0.15em; }
.cookie-consent__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.8rem; }
.cookie-consent__button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border: 2px solid var(--oxford, #002147);
  border-radius: 0.25rem;
  background: var(--oxford, #002147);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-align: center;
}
.cookie-consent__button:hover { background: var(--oxford-mid, #003366); }
.cookie-consent__button--secondary { background: #fff; color: var(--oxford, #002147); }
.cookie-consent__button--secondary:hover { background: #f0f2f5; color: var(--oxford, #002147); }
.cookie-consent__button:focus-visible,
.cookie-settings-link:focus-visible,
.cookie-embed__button:focus-visible {
  outline: 3px solid var(--gold-dark, #9b7c2e);
  outline-offset: 3px;
}
.cookie-consent__preferences { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #d0d5db; }
.cookie-consent__preferences[hidden] { display: none; }
.cookie-consent__category { display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; align-items: start; }
.cookie-consent__category input { width: 1.2rem; height: 1.2rem; margin: 0.15rem 0 0; accent-color: var(--oxford, #002147); }
.cookie-consent__category strong { display: block; color: var(--oxford, #002147); }
.cookie-consent__status { margin-top: 0.75rem !important; color: #7a271a; font-weight: 600; }
.cookie-settings-link { color: inherit; text-decoration: underline; text-underline-offset: 0.15em; }

.cookie-embed {
  display: grid;
  min-height: 14rem;
  align-content: center;
  justify-items: center;
  gap: 0.7rem;
  padding: 1.5rem;
  border: 1px solid var(--rule, #d0d5db);
  background: var(--bg-tint, #f7f8fa);
  color: var(--text-mid, #3d4147);
  text-align: center;
}
.cookie-embed__button { min-height: 2.75rem; padding: 0.6rem 1rem; border: 0; border-radius: 0.25rem; background: var(--oxford, #002147); color: #fff; cursor: pointer; font: inherit; font-weight: 600; }
.cookie-embed__link { color: var(--oxford-mid, #003366); }
.cookie-embed iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }

@media (max-width: 600px) {
  .cookie-consent {
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: min(88vh, 42rem);
    padding: 1rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0.5rem 0.5rem 0 0;
  }
  .cookie-consent__actions { display: grid; grid-template-columns: 1fr; }
  .cookie-consent__button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent *, .cookie-embed * { scroll-behavior: auto !important; }
}
