.vg-consent,
.vg-consent-dialog,
.vg-consent-reopen {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.vg-consent {
  position: fixed;
  z-index: 60;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  width: min(1104px, calc(100vw - 32px));
  margin: 0 auto;
  color: #f8fafc;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 14px;
  box-shadow: 0 12px 34px rgb(2 6 23 / 28%);
}

.vg-consent__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 14px;
}

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

.vg-consent__title {
  margin: 0 0 2px;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.vg-consent__text {
  max-width: 680px;
  margin: 0;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.45;
}

.vg-consent__link,
.vg-consent-reopen {
  color: #a5b4fc;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.vg-consent__link:hover,
.vg-consent-reopen:hover {
  color: #c7d2fe;
}

.vg-consent__actions,
.vg-consent-dialog__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  flex: 0 0 auto;
}

.vg-consent__button,
.vg-consent-dialog__close,
.vg-consent-reopen {
  appearance: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.vg-consent__button {
  min-width: 122px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #475569;
  border-radius: 9px;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
  white-space: normal;
  hyphens: auto;
}

.vg-consent__button--decision {
  background: #334155;
}

.vg-consent__button--decision:hover {
  background: #475569;
}

.vg-consent__button--settings {
  background: transparent;
}

.vg-consent__button--settings:hover {
  background: #1e293b;
}

.vg-consent__button:focus-visible,
.vg-consent-dialog__close:focus-visible,
.vg-consent-switch input:focus-visible + span,
.vg-consent-reopen:focus-visible,
.vg-consent__link:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.vg-consent-dialog {
  z-index: 70;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  color: #f8fafc;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgb(2 6 23 / 48%);
}

.vg-consent-dialog::backdrop {
  background: rgb(2 6 23 / 58%);
}

.vg-consent-dialog__panel {
  overflow: auto;
  max-height: calc(100dvh - 34px);
  padding: 20px;
}

.vg-consent-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.vg-consent-dialog__header h2 {
  margin: 0 0 4px;
  color: #f8fafc;
  font-size: 21px;
  line-height: 1.3;
}

.vg-consent-dialog__header p {
  margin: 0;
  color: #cbd5e1;
  font-size: 13.5px;
  line-height: 1.45;
}

.vg-consent-dialog__close {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #cbd5e1;
  background: transparent;
  border-radius: 9px;
  font-size: 28px;
  line-height: 1;
}

.vg-consent-dialog__close:hover {
  color: #fff;
  background: #1e293b;
}

.vg-consent-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid #334155;
}

.vg-consent-option h3 {
  margin: 0 0 3px;
  color: #f8fafc;
  font-size: 15px;
  line-height: 1.3;
}

.vg-consent-option p {
  margin: 0;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.4;
}

.vg-consent-option__badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: #cbd5e1;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}

.vg-consent-switch {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 44px;
  cursor: pointer;
}

.vg-consent-switch input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.vg-consent-switch span {
  position: absolute;
  top: 10px;
  right: 0;
  left: 0;
  height: 24px;
  background: #475569;
  border: 1px solid #64748b;
  border-radius: 999px;
}

.vg-consent-switch span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  content: "";
  background: #f8fafc;
  border-radius: 50%;
  transition: transform 140ms ease;
}

.vg-consent-switch input:checked + span {
  background: #4f46e5;
  border-color: #818cf8;
}

.vg-consent-switch input:checked + span::after {
  transform: translateX(23px);
}

.vg-consent-dialog__actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #334155;
}

.vg-consent-dialog__actions .vg-consent__button--settings {
  background: #334155;
}

.vg-consent-dialog__actions .vg-consent__button--settings:hover {
  background: #475569;
}

.vg-consent-footer {
  width: 100%;
  margin: 14px auto 0;
  text-align: center;
}

.vg-consent-standalone-host {
  width: 100%;
  padding: 8px 0 18px;
}

.vg-consent-reopen {
  min-height: 44px;
  padding: 8px 10px;
  background: transparent;
  font-size: 12px;
}

.vg-consent-spacer {
  width: 100%;
  pointer-events: none;
}

@media (max-width: 820px) {
  .vg-consent {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    width: calc(100vw - 16px);
  }

  .vg-consent__inner {
    display: block;
    padding: 11px;
  }

  .vg-consent__title {
    display: inline;
    margin-right: 4px;
    font-size: 13px;
  }

  .vg-consent__text {
    display: inline;
    font-size: 12.5px;
    line-height: 1.35;
  }

  .vg-consent__actions {
    width: 100%;
    margin-top: 9px;
    gap: 6px;
  }

  .vg-consent__button {
    min-width: 0;
    min-height: 44px;
    padding: 7px 6px;
    font-size: 12px;
  }
}

@media (max-width: 560px) {
  .vg-consent-dialog {
    width: calc(100vw - 16px);
    max-height: 85dvh;
    margin: auto 8px max(8px, env(safe-area-inset-bottom));
  }

  .vg-consent-dialog__panel {
    max-height: 85dvh;
    padding: 16px;
  }

  .vg-consent-dialog__actions {
    gap: 6px;
  }

  .vg-consent-dialog__actions .vg-consent__button {
    min-width: 0;
    padding-right: 5px;
    padding-left: 5px;
    font-size: 11.5px;
  }
}

@media (max-width: 380px) {
  .vg-consent__actions,
  .vg-consent-dialog__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vg-consent__actions .vg-consent__button:nth-child(1),
  .vg-consent-dialog__actions .vg-consent__button:nth-child(1) {
    grid-area: 1 / 1;
  }

  .vg-consent__actions .vg-consent__button:nth-child(2),
  .vg-consent-dialog__actions .vg-consent__button:nth-child(2) {
    grid-area: 2 / 1 / 3 / 3;
  }

  .vg-consent__actions .vg-consent__button:nth-child(3),
  .vg-consent-dialog__actions .vg-consent__button:nth-child(3) {
    grid-area: 1 / 2;
  }
}

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

@media (forced-colors: active) {
  .vg-consent,
  .vg-consent-dialog,
  .vg-consent__button,
  .vg-consent-option__badge,
  .vg-consent-switch span {
    border: 1px solid CanvasText;
  }
}
