/* A slim bar. The copy stays short so it does not push the page around. */
#tg-cookie-banner {
  position: fixed;
  z-index: 10001;
  inset-inline: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  width: auto;
  max-width: 900px;
  max-height: calc(100dvh - 24px);
  margin-inline: auto;
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  border: 1px solid oklch(0.86 0.01 255);
  border-radius: 12px;
  color: oklch(0.22 0.012 260);
  background: oklch(0.992 0.004 255);
  box-shadow: 0 4px 20px oklch(0.22 0.012 260 / 0.14);
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: normal;
  text-align: start;
  color-scheme: light;
}

#tg-cookie-banner [hidden],
#tg-cookie-banner[hidden],
.tg-cookie-settings[hidden] {
  display: none !important;
}

.tg-cookie-copy {
  flex: 1 1 360px;
  min-width: 0;
}

#tg-cookie-banner p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  text-wrap: pretty;
}

#tg-cookie-banner #tg-cookie-note {
  margin-top: 4px;
  color: oklch(0.43 0.014 260);
}

#tg-cookie-banner a {
  color: oklch(0.48 0.18 255);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tg-cookie-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}

.tg-cookie-actions button {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid oklch(0.78 0.035 255);
  border-radius: 8px;
  color: oklch(0.43 0.18 255);
  background: oklch(0.965 0.012 255);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.tg-cookie-actions button:hover:not(:disabled) {
  background: oklch(0.925 0.025 255);
}

.tg-cookie-actions button:disabled {
  color: oklch(0.48 0.014 260);
  background: oklch(0.965 0.008 255);
  cursor: not-allowed;
}

/* Close only appears when the banner is reopened from the footer. */
#tg-cookie-close {
  padding-inline: 6px;
  border: 0;
  color: oklch(0.48 0.18 255);
  background: none;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

#tg-cookie-close:hover:not(:disabled) {
  background: none;
}

.tg-cookie-settings {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-block: -10px;
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  font: inherit;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

#tg-cookie-banner :focus-visible,
.tg-cookie-settings:focus-visible {
  outline: 3px solid oklch(0.53 0.19 255);
  outline-offset: 2px;
}

#tg-cookie-space {
  width: 100%;
  height: var(--tg-cookie-space, 0px);
  flex-shrink: 0;
  pointer-events: none;
}

html:has(#tg-cookie-banner:not([hidden])) {
  scroll-padding-bottom: var(--tg-cookie-space, 0px);
}

.tg-cookie-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 640px) {
  #tg-cookie-banner {
    padding: 10px 12px;
    gap: 8px;
    font-size: 14px;
  }

  #tg-cookie-banner p {
    font-size: 14px;
  }

  .tg-cookie-copy {
    flex-basis: 100%;
  }

  .tg-cookie-actions {
    width: 100%;
    margin-inline-start: 0;
  }

  .tg-cookie-actions button {
    flex: 1;
    min-height: 42px;
  }

  #tg-cookie-close {
    flex: 0 0 auto;
  }
}

@media (forced-colors: active) {
  #tg-cookie-banner,
  .tg-cookie-actions button {
    border: 1px solid CanvasText;
  }
}

@media print {
  #tg-cookie-banner,
  #tg-cookie-space,
  .tg-cookie-settings {
    display: none !important;
  }
}
