.ph-consent {
  position: fixed;
  z-index: 2147483000;
  bottom: 24px;
  left: 24px;
  box-sizing: border-box;
  width: min(600px, calc(100vw - 48px));
  max-height: calc(var(--ph-consent-viewport-height, 100dvh) - 48px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 30px;
  border: 1px solid rgba(255, 240, 210, 0.2);
  border-radius: 22px;
  background: linear-gradient(150deg, #231f1c, #11100f);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 240, 210, 0.1);
  color: var(--fg, #f2f0eb);
  overflow-y: auto;
  animation: ph-consent-in 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ph-consent[hidden] {
  display: none;
}

@keyframes ph-consent-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.ph-consent__copy {
  min-width: 0;
}

.ph-consent__head {
  margin-bottom: 10px;
}

.ph-consent__title {
  margin: 0;
  color: var(--gold-2, #f7eddd);
  font-family: var(--f-display, "PP Museum", "Cormorant Garamond", "Times New Roman", serif);
  font-size: 27px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.005em;
}

.ph-consent__title:focus-visible {
  outline: 2px solid rgba(221, 183, 123, 0.8);
  outline-offset: 4px;
}

.ph-consent__text {
  margin: 0;
  color: var(--fg-2, #b5b0a6);
  font-family: var(--f-sans, "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.01em;
  text-wrap: pretty;
}

.ph-consent__close-note[hidden] {
  display: none;
}

.ph-consent__policy {
  color: var(--gold-hot, #d5b484);
  font-family: var(--f-sans, "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 160ms ease;
}

.ph-consent__policy:hover {
  color: var(--gold-3, #eedbbc);
}

.ph-consent__policy:focus-visible {
  outline: 2px solid rgba(221, 183, 123, 0.8);
  outline-offset: 2px;
  border-radius: 2px;
}

.ph-consent__categories {
  display: grid;
  border: 1px solid rgba(255, 240, 210, 0.09);
  border-radius: 12px;
  background: rgba(8, 8, 8, 0.28);
  overflow: hidden;
}

.ph-consent__categories[hidden] {
  display: none;
}

.ph-consent__category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 0;
  cursor: pointer;
}

.ph-consent__category + .ph-consent__category {
  border-top: 1px solid rgba(255, 240, 210, 0.09);
}

.ph-consent__policy-row {
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(255, 240, 210, 0.09);
}

.ph-consent__category-copy {
  min-width: 0;
}

.ph-consent__category-name {
  font-family: var(--f-sans, "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif);
  color: var(--fg, #f2f0eb);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ph-consent__toggle {
  appearance: none;
  flex: none;
  position: relative;
  width: 38px;
  height: 22px;
  margin: 0;
  border: 1px solid rgba(255, 240, 210, 0.18);
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.66);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.ph-consent__toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--fg-3, #8a857d);
  transition: transform 160ms ease, background 160ms ease;
}

.ph-consent__toggle:checked {
  border-color: rgba(214, 168, 96, 0.55);
  background: rgba(214, 168, 96, 0.18);
}

.ph-consent__toggle:checked::after {
  background: var(--gold-hot, #d5b484);
  transform: translateX(16px);
}

.ph-consent__toggle:focus-visible {
  outline: 2px solid rgba(221, 183, 123, 0.8);
  outline-offset: 2px;
}

.ph-consent__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ph-consent__choice {
  appearance: none;
  min-width: 0;
  margin: 0;
  height: 56px;
  padding: 0 20px;
  line-height: 1.4;
  border: 1px solid rgba(255, 240, 210, 0.14);
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.5);
  color: var(--fg-2, #b5b0a6);
  font-family: var(--f-sans, "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease,
    transform 120ms ease;
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  backdrop-filter: blur(12px) saturate(1.15);
}

.ph-consent__choice--primary,
.ph-consent__choice[data-ph-consent="save"] {
  border-color: #293d6f;
  background: #293d6f;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.ph-consent__choice--primary {
  grid-column: 1 / -1;
}

.ph-consent__choice:hover {
  border-color: rgba(214, 168, 96, 0.4);
  color: var(--fg, #f2f0eb);
}

.ph-consent__choice--primary:hover,
.ph-consent__choice[data-ph-consent="save"]:hover {
  border-color: #3a5289;
  background: #3a5289;
  color: #fff;
}

.ph-consent__choice:focus-visible {
  outline: 2px solid rgba(221, 183, 123, 0.8);
  outline-offset: 2px;
}

.ph-consent__choice:active {
  background: rgba(214, 168, 96, 0.08);
  transform: scale(0.96);
}

.ph-consent__choice--primary:active,
.ph-consent__choice[data-ph-consent="save"]:active {
  background: #23355f;
}

.ph-consent__choice[hidden] {
  display: none;
}

/* This button behaves like an inline legal-page link, but the gold treatment keeps the
   consent control from disappearing into the surrounding policy copy. */
.ph-cookie-settings {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold-hot, #d5b484);
  font-family: var(--f-sans, "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.75;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  cursor: pointer;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.ph-cookie-settings:hover {
  color: var(--gold-2, #f7eddd);
}

.ph-cookie-settings:focus-visible {
  outline: 2px solid rgba(221, 183, 123, 0.8);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (max-width: 520px) {
  .ph-consent {
    bottom: 16px;
    left: 16px;
    width: calc(100vw - 32px);
    max-height: calc(var(--ph-consent-viewport-height, 100dvh) - 32px);
    gap: 18px;
    padding: 22px;
  }

  .ph-consent__title {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ph-consent {
    animation: none;
  }

  .ph-consent__choice,
  .ph-consent__toggle,
  .ph-consent__toggle::after,
  .ph-consent__policy,
  .ph-cookie-settings {
    transition: none;
  }

  .ph-consent__choice:active {
    transform: none;
  }
}
