:root {
  --pwb-consent-ink: #171a18;
  --pwb-consent-muted: #5f6661;
  --pwb-consent-line: #d8ded9;
  --pwb-consent-soft: #f2f8f3;
  --pwb-consent-accent: #168548;
  --pwb-consent-focus: #0a63c9;
}

#pwb-consent-root,
#pwb-consent-root * {
  box-sizing: border-box;
}

#pwb-consent-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: rgb(18 24 20 / 52%);
  backdrop-filter: blur(3px);
}

#pwb-consent-dialog {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 2147483001;
  width: min(900px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  transform: translateX(-50%);
  border: 1px solid var(--pwb-consent-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(18 24 20 / 28%);
  color: var(--pwb-consent-ink);
  font: 400 16px/1.5 Poppins, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pwb-consent__inner {
  padding: 24px;
}

.pwb-consent__eyebrow {
  margin: 0 0 4px;
  color: var(--pwb-consent-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

#pwb-consent-title {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.15;
}

#pwb-consent-description {
  max-width: 76ch;
  margin: 10px 0 18px;
  color: var(--pwb-consent-muted);
}

.pwb-consent__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.pwb-consent__category {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--pwb-consent-line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.pwb-consent__category--necessary {
  background: var(--pwb-consent-soft);
  cursor: default;
}

.pwb-consent__category input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--pwb-consent-accent);
}

.pwb-consent__category strong,
.pwb-consent__category small {
  display: block;
}

.pwb-consent__category strong {
  font-size: 15px;
}

.pwb-consent__category small {
  margin-top: 3px;
  color: var(--pwb-consent-muted);
  font-size: 12px;
  line-height: 1.4;
}

.pwb-consent__always {
  display: inline-block;
  margin-left: 6px;
  color: var(--pwb-consent-accent);
  font-size: 11px;
  font-weight: 700;
}

.pwb-consent__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pwb-consent__button {
  min-height: 48px;
  padding: 11px 14px;
  border: 2px solid var(--pwb-consent-accent);
  border-radius: 999px;
  background: #fff;
  color: var(--pwb-consent-accent);
  font: inherit;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.pwb-consent__button--save {
  background: var(--pwb-consent-accent);
  color: #fff;
}

.pwb-consent__button:hover {
  box-shadow: 0 7px 20px rgb(22 133 72 / 20%);
  transform: translateY(-1px);
}

.pwb-consent__button:focus-visible,
.pwb-consent__category input:focus-visible,
#pwb-consent-manage:focus-visible,
.pwb-consent__privacy:focus-visible {
  outline: 3px solid var(--pwb-consent-focus);
  outline-offset: 3px;
}

.pwb-consent__footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  color: var(--pwb-consent-muted);
  font-size: 12px;
}

.pwb-consent__privacy {
  color: var(--pwb-consent-accent);
  font-weight: 700;
}

#pwb-consent-manage {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2147482999;
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid var(--pwb-consent-line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 28px rgb(18 24 20 / 18%);
  color: var(--pwb-consent-ink);
  font: 700 13px/1.2 Poppins, system-ui, sans-serif;
  cursor: pointer;
}

#pwb-consent-root [hidden] {
  display: none !important;
}

@media (max-width: 700px) {
  #pwb-consent-dialog {
    bottom: 8px;
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 16px;
  }

  .pwb-consent__inner {
    padding: 18px;
  }

  .pwb-consent__grid,
  .pwb-consent__actions {
    grid-template-columns: 1fr;
  }

  .pwb-consent__footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pwb-consent__button {
    transition: none;
  }
}
