.ccw-root {
  --ccw-text: #3f495b;
  --ccw-muted: #6e7689;
  --ccw-border: #d3d7de;
  --ccw-soft: #f9fafb;
  --ccw-primary: #000;
  --ccw-primary-hover: #1a1a1a;
  --ccw-secondary: #ebedf0;
  --ccw-secondary-hover: #dfe3e8;
  --ccw-shadow: rgba(16, 24, 40, 0.18);
  color: var(--ccw-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ccw-root *,
.ccw-root *::before,
.ccw-root *::after {
  box-sizing: border-box;
}

.ccw-root [hidden] {
  display: none !important;
}

.ccw-surface {
  position: fixed;
  z-index: 2147483000;
  top: auto;
  right: 24px;
  bottom: 24px;
  left: auto;
  width: min(460px, calc(100% - 48px));
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  transform: none;
  border: 1px solid var(--ccw-border);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 46px var(--ccw-shadow);
  color: var(--ccw-text);
}

.ccw-surface button,
.ccw-surface input,
.ccw-saved button {
  font: inherit;
}

.ccw-banner {
  padding: 36px 38px 30px;
}

.ccw-intro {
  display: block;
}

.ccw-icon-box {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 22px;
  border-radius: 16px;
  background: var(--ccw-secondary);
  color: var(--ccw-text);
}

.ccw-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.ccw-icon-box .ccw-icon {
  width: 26px;
  height: 26px;
}

.ccw-banner-copy {
  text-align: center;
}

.ccw-banner h2,
.ccw-preferences h3 {
  margin: 0;
  color: var(--ccw-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ccw-banner h2 {
  margin-bottom: 10px;
  font-size: 22px;
}

.ccw-banner p,
.ccw-preferences p {
  margin: 0;
  color: var(--ccw-muted);
}

.ccw-banner p {
  font-size: 13px;
  line-height: 1.65;
}

.ccw-banner .ccw-revisit {
  margin-top: 12px;
}

.ccw-preferences > .ccw-policy {
  margin: 12px 0 0;
  text-align: center;
}

.ccw-policy a {
  color: var(--ccw-text);
  font-size: 10.5px;
  font-weight: 550;
  text-underline-offset: 3px;
}

.ccw-policy a:hover,
.ccw-policy a:focus-visible {
  color: var(--ccw-primary-hover);
}

.ccw-text-button {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.ccw-text-button:hover,
.ccw-text-button:focus-visible {
  color: var(--ccw-text);
}

.ccw-collapse {
  position: absolute;
  z-index: 4;
  top: 18px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ccw-muted);
  cursor: pointer;
}

.ccw-collapse {
  left: 18px;
  display: none;
}

.ccw-collapse:hover,
.ccw-collapse:focus-visible,
.ccw-chevron:hover,
.ccw-chevron:focus-visible {
  background: var(--ccw-soft);
  color: var(--ccw-text);
}

.ccw-surface.is-preferences-open {
  overflow-y: auto;
}

.ccw-surface.is-preferences-open .ccw-collapse {
  display: grid;
}

.ccw-surface.is-preferences-open .ccw-banner {
  display: none;
}

.ccw-preferences {
  padding: 0 28px 18px;
}

.ccw-preferences-intro {
  padding: 0 42px 18px;
  text-align: center;
}

.ccw-preferences-intro h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.ccw-preferences-intro p {
  font-size: 12.5px;
  line-height: 1.55;
}

.ccw-surface.is-preferences-open .ccw-preferences {
  padding-top: 30px;
}

.ccw-list {
  display: grid;
  gap: 9px;
}

.ccw-category {
  overflow: hidden;
  border: 1px solid var(--ccw-border);
  border-radius: 12px;
  background: #f9fafb;
}

.ccw-category-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 22px;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 11px 14px;
}

.ccw-category-head > .ccw-icon {
  width: 21px;
  height: 21px;
}

.ccw-category strong {
  font-size: 12px;
  font-weight: 700;
}

.ccw-always {
  color: var(--ccw-muted);
  font-size: 11px;
  font-weight: 600;
}

.ccw-chevron {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ccw-muted);
  cursor: pointer;
}

.ccw-chevron .ccw-icon {
  width: 17px;
  height: 17px;
  transition: transform 160ms ease;
}

.ccw-category.is-open .ccw-chevron .ccw-icon {
  transform: rotate(180deg);
}

.ccw-category.is-open .ccw-category-head {
  min-height: 54px;
  padding-bottom: 6px;
}

.ccw-category-description {
  display: none;
  padding: 0 14px 16px 60px;
  color: var(--ccw-muted);
  font-size: 11px;
  line-height: 1.55;
}

.ccw-category.is-open .ccw-category-description {
  display: block;
}

.ccw-category-description p {
  margin: 0;
}

.ccw-cookie-details {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
}

.ccw-cookie-detail {
  display: grid;
  grid-template-columns: minmax(80px, 0.65fr) minmax(0, 1.35fr);
  gap: 4px 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ccw-border);
}

.ccw-cookie-detail dt {
  color: var(--ccw-text);
  font-weight: 650;
}

.ccw-cookie-detail dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.ccw-switch {
  position: relative;
  width: 42px;
  height: 24px;
  margin: 0;
  appearance: none;
  border: 1px solid var(--ccw-border);
  border-radius: 999px;
  background: #eaecf0;
  cursor: pointer;
}

.ccw-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.2);
  transition: transform 160ms ease;
}

.ccw-switch:checked {
  border-color: var(--ccw-primary);
  background: var(--ccw-primary);
}

.ccw-switch:checked::after {
  transform: translateX(18px);
}

.ccw-switch:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ccw-primary) 28%, transparent);
  outline-offset: 2px;
}

.ccw-footer {
  padding: 0;
  border-top: 1px solid var(--ccw-secondary);
  background: #fff;
}

.ccw-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border-radius: 0 0 21px 21px;
}

.ccw-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 62px;
  padding: 12px 10px;
  border: 0;
  border-radius: 0;
  background: var(--ccw-secondary);
  color: var(--ccw-text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.ccw-action .ccw-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.ccw-action-customize {
  background: #fff;
  color: var(--ccw-text);
}

.ccw-action-customize:hover,
.ccw-action-customize:focus-visible {
  background: var(--ccw-primary);
  color: #fff;
}

.ccw-action-customize:active {
  background: var(--ccw-primary-hover);
  color: #fff;
}

/* Accepter et refuser gardent exactement le même poids visuel. */
.ccw-action-choice {
  background: #fff;
  color: var(--ccw-text);
  font-weight: 650;
  letter-spacing: -0.01em;
  box-shadow: inset 1px 0 var(--ccw-border);
}

.ccw-action-choice:hover,
.ccw-action-choice:focus-visible {
  background: var(--ccw-primary-hover);
  color: #fff;
  box-shadow: none;
  transform: none;
}

.ccw-action-choice:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ccw-primary) 24%, transparent);
  outline-offset: 2px;
}

.ccw-action-choice:active {
  background: var(--ccw-primary-hover);
  color: #fff;
  box-shadow: none;
}

.ccw-surface.is-preferences-open .ccw-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.ccw-saved {
  position: fixed;
  z-index: 2147483000;
  right: 14px;
  bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--ccw-border);
  border-radius: 12px;
  background: #fff;
  color: var(--ccw-text);
  font-size: 11px;
  box-shadow: 0 14px 30px var(--ccw-shadow);
}

.ccw-saved button {
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ccw-text);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.ccw-saved [data-withdraw] {
  color: var(--ccw-primary-hover);
}

@media (max-width: 700px) {
  .ccw-surface {
    right: 20px;
    bottom: 20px;
    width: min(460px, calc(100% - 40px));
    border-radius: 20px;
  }

  .ccw-banner {
    padding: 32px 32px 26px;
  }

  .ccw-icon-box {
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    border-radius: 15px;
  }

  .ccw-banner h2 {
    margin-bottom: 9px;
    font-size: 20px;
  }

  .ccw-banner p {
    font-size: 12.5px;
    line-height: 1.6;
  }

  .ccw-footer {
    padding: 0;
  }

  .ccw-action {
    min-height: 58px;
    padding-right: 8px;
    padding-left: 8px;
  }
}

@media (max-width: 480px) {
  .ccw-surface,
  .ccw-surface.is-preferences-open {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: calc(100dvh - 24px);
    transform: none;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -14px 38px var(--ccw-shadow);
  }

  .ccw-surface.is-preferences-open {
    max-height: 100dvh;
  }

  .ccw-banner {
    padding: 20px 16px 14px;
  }

  .ccw-intro {
    display: block;
  }

  .ccw-icon-box {
    width: 36px;
    height: 36px;
    margin: 0 auto 12px;
    border-radius: 12px;
  }

  .ccw-icon-box .ccw-icon {
    width: 22px;
    height: 22px;
  }

  .ccw-banner-copy {
    display: block;
    text-align: center;
  }

  .ccw-banner h2 {
    margin: 0;
    font-size: 16px;
  }

  .ccw-banner p {
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.45;
  }

  .ccw-banner .ccw-revisit {
    margin-top: 8px;
  }

  .ccw-collapse {
    top: 10px;
    left: 10px;
  }

  .ccw-preferences {
    padding: 2px 16px 14px;
  }

  .ccw-surface.is-preferences-open .ccw-preferences {
    padding-top: 48px;
  }

  .ccw-preferences-intro {
    padding: 0 12px 16px;
  }

  .ccw-preferences-intro h3 {
    font-size: 18px;
  }

  .ccw-category-head {
    grid-template-columns: 28px minmax(0, 1fr) auto 18px;
    gap: 9px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .ccw-category-description {
    padding-right: 14px;
    padding-left: 49px;
  }

  .ccw-footer {
    position: sticky;
    z-index: 3;
    bottom: 0;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  }

  .ccw-actions {
    gap: 0;
    border-radius: 0;
  }

  .ccw-action {
    min-height: 44px;
    padding: 8px 9px;
    font-size: 11px;
  }

  .ccw-action-choice {
    background: color-mix(in srgb, var(--ccw-primary) 3%, #fff);
  }

}

@media (max-width: 360px) {
  .ccw-actions,
  .ccw-surface.is-preferences-open .ccw-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ccw-action {
    padding-right: 5px;
    padding-left: 5px;
    font-size: 10px;
    white-space: nowrap;
  }

  .ccw-action-customize .ccw-icon {
    display: none;
  }

  .ccw-category-head {
    grid-template-columns: 24px minmax(0, 1fr) auto 18px;
    gap: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ccw-root *,
  .ccw-root *::before,
  .ccw-root *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
