:root {
  --stami-consent-green: #168515;
  --stami-consent-dark: #18331f;
  --stami-consent-soft: #f5faf5;
  --stami-consent-line: #d9e6da;
  --stami-consent-muted: #667269;
}

.stami-consent[hidden],
.stami-consent-modal[hidden] {
  display: none !important;
}

.stami-consent {
  position: fixed;
  inset: auto 0 0;
  z-index: 999998;
  padding: 14px;
  pointer-events: none;
}

.stami-consent__panel {
  width: min(100%, 980px);
  margin: 0 auto;
  background: #fff;
  color: var(--stami-consent-dark);
  border: 1px solid var(--stami-consent-line);
  border-radius: 20px;
  box-shadow: 0 14px 50px rgba(16, 60, 25, .18);
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  pointer-events: auto;
}

.stami-consent__copy h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  line-height: 1.25;
}

.stami-consent__copy p {
  margin: 0;
  color: var(--stami-consent-muted);
  line-height: 1.55;
  font-size: .95rem;
}

.stami-consent__privacy,
.stami-consent-modal a {
  display: inline-block;
  margin-top: 8px;
  color: var(--stami-consent-green);
  font-weight: 650;
  text-underline-offset: 3px;
}

.stami-consent__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
  min-width: 330px;
}

.stami-consent__btn {
  appearance: none;
  border: 1px solid var(--stami-consent-green);
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}

.stami-consent__btn:hover {
  transform: translateY(-1px);
}

.stami-consent__btn--choice {
  background: var(--stami-consent-green);
  color: #fff;
}

.stami-consent__btn--settings {
  grid-column: 1 / -1;
  background: #fff;
  color: var(--stami-consent-dark);
  border-color: var(--stami-consent-line);
}

.stami-consent__btn--save {
  background: var(--stami-consent-green);
  color: #fff;
}

.stami-consent-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 18px;
}

.stami-consent-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 28, 16, .55);
}

.stami-consent-modal__panel {
  position: relative;
  width: min(100%, 680px);
  max-height: min(86vh, 760px);
  overflow: auto;
  background: #fff;
  color: var(--stami-consent-dark);
  border-radius: 22px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, .28);
  padding: 22px;
}

.stami-consent-modal__head,
.stami-consent-modal__footer,
.stami-consent-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.stami-consent-modal__head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--stami-consent-line);
}

.stami-consent-modal__head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.stami-consent-modal__close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--stami-consent-line);
  border-radius: 50%;
  background: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.stami-consent-category {
  padding: 18px 0;
  border-bottom: 1px solid var(--stami-consent-line);
}

.stami-consent-category strong {
  display: block;
  margin-bottom: 4px;
}

.stami-consent-category p {
  margin: 0;
  color: var(--stami-consent-muted);
  font-size: .93rem;
  line-height: 1.5;
}

.stami-consent-switch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--stami-consent-muted);
  font-size: .9rem;
}

.stami-consent-switch input {
  width: 20px;
  height: 20px;
  accent-color: var(--stami-consent-green);
}

.stami-consent-modal__footer {
  padding-top: 18px;
}

.stami-consent-reopen {
  position: fixed;
  left: 12px;
  bottom: 10px;
  z-index: 99990;
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, .92);
  color: var(--stami-consent-dark);
  border-radius: 999px;
  padding: 7px 10px;
  box-shadow: 0 4px 14px rgba(10, 40, 16, .10);
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}

.stami-consent-inline-link {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (max-width: 760px) {
  .stami-consent {
    padding: 9px;
  }

  .stami-consent__panel {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 17px;
    border-radius: 17px;
  }

  .stami-consent__actions {
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .stami-consent__btn--settings {
    grid-column: auto;
  }

  .stami-consent-category,
  .stami-consent-modal__footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .stami-consent-modal__panel {
    padding: 18px;
    border-radius: 18px;
  }
}
