.cookie-banner,
.cookie-banner *,
.cookie-banner *::before,
.cookie-banner *::after {
  box-sizing: border-box;
}

.cookie-banner {
  position: fixed;
  z-index: 1000;
  right: 16px;
  bottom: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 16px;
  width: calc(100% - 32px);
  max-width: 1100px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-bottom, 0px));
  margin-inline: auto;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line, #d7dfe2);
  border-top: 3px solid var(--blue, #00b4ec);
  border-radius: 10px;
  background: var(--paper, #ffffff);
  color: var(--ink, #111111);
  box-shadow: 0 8px 28px rgb(0 0 0 / 16%);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.cookie-banner[hidden],
.cookie-settings[hidden],
.cookie-current-choice[hidden] {
  display: none;
}

.cookie-banner-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 280px);
  align-items: center;
  gap: 16px;
  padding: 14px;
}

.cookie-banner-copy {
  min-width: 0;
  min-height: 0;
  /* Seul le texte défile : les deux choix restent hors de cette zone. */
  max-height: calc(60vh - 32px);
  max-height: calc(60dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cookie-banner-title {
  margin: 0 0 6px;
  color: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}

.cookie-banner-copy p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
}

.cookie-banner-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  flex-shrink: 0;
}

.cookie-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  appearance: none;
  border: 1px solid var(--blue, #00b4ec);
  border-radius: 5px;
  background: var(--blue, #00b4ec);
  color: var(--ink, #111111);
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  cursor: pointer;
}

.cookie-choice:hover {
  border-color: var(--blue-hover, #30c3f1);
  background: var(--blue-hover, #30c3f1);
}

.cookie-banner-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
  font-size: .875rem;
  line-height: 1.4;
}

.cookie-banner-links a {
  text-decoration: underline;
  text-underline-offset: .2em;
}

.cookie-banner .cookie-current-choice {
  margin-top: 8px;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
}

.cookie-settings {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 0;
  padding: 0;
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .875rem;
  line-height: 1.5;
  text-align: start;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}

.cookie-choice:focus-visible,
.cookie-settings:focus-visible,
.cookie-banner a:focus-visible {
  outline: 3px solid var(--focus, #007299);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .cookie-banner-inner {
    display: block;
    padding: 12px;
  }

  .cookie-banner-copy {
    max-height: calc(60vh - 82px);
    max-height: calc(60dvh - 82px);
  }

  .cookie-banner-actions {
    margin-top: 10px;
  }
}

@media (max-width: 440px) {
  .cookie-choice {
    padding-inline: 6px;
  }
}
