:host {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 12px;
  color: #253044;
  color-scheme: light dark;
}

* {
  box-sizing: border-box;
}

.banner {
  position: fixed;
  z-index: 10000;
  right: 22px;
  bottom: max(22px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  width: 390px;
  max-width: calc(100vw - 44px);
  padding: 8px 0 8px 12px;
  border: 1px solid #e4e8ef;
  border-radius: 10px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 4px 18px rgb(31 41 55 / 8%);
}

@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .banner {
    opacity: 0.4;
  }

  .banner:hover,
  .banner:focus-within {
    opacity: 1;
  }
}

p {
  grid-column: 1;
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

a {
  color: #4954c9;
  text-underline-offset: 3px;
}

button {
  min-width: 44px;
  min-height: 44px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  color: inherit;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}

.accept {
  grid-column: 2;
  justify-self: center;
  color: #4f56d9;
  font-weight: 650;
  background: transparent;
}

.close {
  position: absolute;
  top: -11px;
  right: -11px;
  min-width: 20px;
  min-height: 20px;
  width: 20px;
  height: 20px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  opacity: 0.65;
}

.details-link {
  display: inline;
  min-width: 0;
  min-height: 0;
  padding: 0;
  color: #4954c9;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-dialog {
  width: 540px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  padding: 24px;
  border: 1px solid #e4e8ef;
  border-radius: 12px;
  color: inherit;
  background: #fff;
  font-size: 14px;
  overflow: auto;
}

.privacy-dialog::backdrop {
  background: rgb(0 0 0 / 45%);
}

.privacy-dialog h2 {
  margin: 0 32px 16px 0;
  font-size: 20px;
}

.privacy-dialog p {
  margin: 12px 0;
  line-height: 1.5;
}

.privacy-dialog nav {
  display: grid;
  gap: 10px;
}

.dialog-close {
  position: absolute;
  right: 8px;
  top: 8px;
  font-size: 24px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.dialog-actions button {
  white-space: normal;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid #8590ef;
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

@media (prefers-color-scheme: dark) {
  .banner,
  .privacy-dialog {
    color: #d7dae3;
    background: rgb(27 29 36 / 94%);
    border-color: #343a49;
    box-shadow: 0 4px 18px rgb(0 0 0 / 14%);
  }

  a,
  .accept,
  .details-link {
    color: #b2b8ff;
  }
}

@media print {
  .banner,
  .privacy-dialog {
    display: none;
  }
}
