.sa-consent[hidden] {
  display: none !important;
}

.sa-consent {
  position: fixed;
  z-index: 100000;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: center;
  box-sizing: border-box;
  max-width: 72rem;
  max-height: 75vh;
  max-height: 75dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-inline: auto;
  padding: 1.25rem;
  color: #fff;
  background: var(--sa-night-deep, #102532);
  border: 1px solid #41555d;
  border-top: 3px solid var(--sa-amber, #edb447);
  border-radius: var(--sa-radius, 8px);
  box-shadow: 0 8px 30px rgb(16 37 50 / 20%);
}

.sa-consent__copy strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #fff;
  font-size: 1rem;
  line-height: 1.45;
}

.sa-consent__copy p {
  margin: 0;
  color: #e0e7e8;
  font-size: 0.88rem;
  line-height: 1.6;
}

.sa-consent__copy a {
  display: inline-block;
  margin-top: 0.45rem;
  color: var(--sa-amber, #edb447);
  font-size: 0.86rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.sa-consent__actions {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 27rem;
}

.sa-consent__actions button,
.sa-consent-manage {
  min-height: 2.75rem;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  border-radius: var(--sa-radius-sm, 4px);
  cursor: pointer;
}

.sa-consent__actions .sa-consent__reject,
.sa-consent__actions .sa-consent__accept {
  color: var(--sa-night, #142d3e);
  background: #f8f8f4;
  border: 1px solid #f8f8f4;
}

.sa-consent__actions button:hover {
  background: #e3eee8;
  border-color: #e3eee8;
}

.sa-consent__actions button:focus-visible,
.sa-consent__copy a:focus-visible {
  outline: 3px solid var(--sa-amber, #edb447);
  outline-offset: 3px;
}

.sa-consent-manage {
  position: fixed;
  z-index: 99999;
  right: 0.8rem;
  bottom: max(0.8rem, env(safe-area-inset-bottom));
  min-height: 44px;
  max-width: calc(100vw - 1.6rem);
  padding: 0.55rem 0.8rem;
  color: var(--sa-night, #142d3e);
  background: #fff;
  border: 1px solid #85958f;
  box-shadow: 0 3px 12px rgb(16 37 50 / 10%);
  font-size: 0.75rem;
}

.sa-consent-manage:hover {
  color: var(--sa-night, #142d3e);
  background: var(--sa-teal-soft, #eaf3ef);
}

.sa-consent-manage:focus-visible {
  outline: 3px solid var(--sa-teal, #176f65);
  outline-offset: 3px;
}

.sa-consent:not([hidden]) ~ .sa-consent-manage {
  visibility: hidden;
}

@media (max-width: 900px) {
  .sa-consent {
    right: 0.75rem;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    left: 0.75rem;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .sa-consent__actions {
    max-width: none;
  }
}

@media (max-width: 380px) {
  .sa-consent__actions {
    grid-template-columns: 1fr;
  }
}
