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

.consent-banner {
  position: fixed;
  z-index: 100;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  width: min(1160px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  color: var(--ink, #171412);
  border: 1px solid rgba(23, 20, 18, 0.16);
  border-radius: 12px;
  background: rgba(255, 248, 239, 0.98);
  box-shadow: 0 20px 65px rgba(35, 26, 14, 0.2);
  backdrop-filter: blur(18px);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.consent-banner[hidden],
.consent-backdrop[hidden] {
  display: none;
}

.consent-banner-copy {
  display: grid;
  gap: 0.35rem;
  max-width: 720px;
}

.consent-banner h2,
.consent-modal h2,
.consent-category h3 {
  margin: 0;
  color: var(--ink, #171412);
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.2;
}

.consent-banner h2,
.consent-modal h2 {
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.consent-banner p,
.consent-modal p,
.consent-category small {
  margin: 0;
  color: var(--muted, #5d554c);
  font-size: 0.92rem;
  line-height: 1.55;
}

.consent-banner a,
.consent-policy-links a {
  color: var(--teal-dim, #06718a);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.consent-kicker {
  color: var(--teal-dim, #06718a) !important;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem !important;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.consent-gpc {
  color: var(--teal-dim, #06718a) !important;
  font-size: 0.8rem !important;
  font-weight: 600;
}

.consent-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  min-width: min(100%, 390px);
}

.consent-button {
  min-width: 0;
  min-height: 46px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--teal, #0991b3);
  border-radius: 999px;
  background: transparent;
  color: var(--teal-dim, #06718a);
  cursor: pointer;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
}

.consent-button:hover {
  background: rgba(9, 145, 179, 0.12);
}

.consent-manage {
  grid-column: 1 / -1;
  justify-self: center;
  border: 0;
  padding: 0.2rem;
  background: transparent;
  color: var(--muted, #5d554c);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.consent-backdrop {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(23, 20, 18, 0.5);
  backdrop-filter: blur(8px);
}

.consent-modal-open {
  overflow: hidden;
}

.consent-modal {
  width: min(100%, 620px);
  max-height: min(760px, calc(100vh - 2rem));
  overflow-y: auto;
  display: grid;
  gap: 1rem;
  padding: 1.4rem;
  color: var(--ink, #171412);
  border: 1px solid rgba(23, 20, 18, 0.16);
  border-radius: 12px;
  background: var(--raised, #fff8ef);
  box-shadow: 0 24px 70px rgba(35, 26, 14, 0.18);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.consent-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.consent-modal-header > div {
  display: grid;
  gap: 0.35rem;
}

.consent-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line, rgba(23, 20, 18, 0.12));
  border-radius: 50%;
  background: var(--surface, #fffaf4);
  color: var(--ink, #171412);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.consent-category {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line, rgba(23, 20, 18, 0.12));
  border-radius: 8px;
  background: var(--surface, rgba(255, 251, 244, 0.84));
}

.consent-category > div,
.consent-category > span:first-child {
  display: grid;
  gap: 0.3rem;
}

.consent-category h3,
.consent-category strong {
  color: var(--ink, #171412);
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.consent-status {
  flex: 0 0 auto;
  color: var(--teal-dim, #06718a);
  font-size: 0.78rem;
  font-weight: 700;
}

.consent-category-toggle {
  position: relative;
  cursor: pointer;
}

.consent-category-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.consent-switch {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  border: 1px solid rgba(23, 20, 18, 0.2);
  border-radius: 999px;
  background: #d8d0c5;
  transition: background-color 160ms ease;
}

.consent-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(23, 20, 18, 0.2);
  transition: transform 160ms ease;
}

.consent-category-toggle input:checked + .consent-switch {
  background: var(--teal, #0991b3);
}

.consent-category-toggle input:checked + .consent-switch::after {
  transform: translateX(20px);
}

.consent-category-toggle input:focus-visible + .consent-switch,
.consent-button:focus-visible,
.consent-manage:focus-visible,
.consent-close:focus-visible,
.consent-policy-links a:focus-visible,
.cookie-settings-link:focus-visible {
  outline: 2px solid var(--teal, #0991b3);
  outline-offset: 3px;
}

.consent-policy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
}

.consent-modal-actions {
  display: flex;
  justify-content: flex-end;
}

.cookie-settings-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 720px) {
  .consent-banner {
    grid-template-columns: 1fr;
    right: 0.5rem;
    bottom: 0.5rem;
    left: 0.5rem;
    width: auto;
    max-width: calc(100vw - 1rem);
    min-width: 0;
    padding: 1rem;
    border-radius: 8px;
    overflow: hidden;
  }

  .consent-actions {
    grid-template-columns: 1fr;
    min-width: 0;
    width: 100%;
  }

  .consent-manage {
    grid-column: 1;
  }

  .consent-category {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .consent-switch,
  .consent-switch::after {
    transition: none;
  }
}
