.kc-banner,
.kc-dialog {
  --kc-brand: var(--brand, #1a5f4a);
  --kc-on-brand: var(--on-brand, #fff);
  --kc-ink: #101916;
  --kc-ink-2: #3d4a44;
  --kc-line: rgb(16 24 22 / 0.14);
  font-family: "Source Sans 3", "Manrope", ui-sans-serif, system-ui, sans-serif;
  color: var(--kc-ink);
}

.kc-banner[hidden],
.kc-dialog[hidden] {
  display: none !important;
}

.kc-banner {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(42rem, calc(100% - 1.5rem));
  display: grid;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--kc-line);
  box-shadow: 0 18px 48px rgb(16 24 22 / 0.18);
  animation: kc-rise 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.kc-banner__title {
  margin: 0 0 0.25rem;
  font-family: "Manrope", "Source Sans 3", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kc-banner__body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--kc-ink-2);
}

.kc-banner a,
.kc-dialog a {
  color: var(--kc-ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.kc-banner__actions,
.kc-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.kc-btn {
  appearance: none;
  flex: 1 1 8rem;
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--kc-ink);
  background: #fff;
  color: var(--kc-ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.kc-btn:hover {
  background: #f1f4f2;
}

.kc-btn--primary {
  background: var(--kc-ink);
  color: #fff;
}

.kc-btn--primary:hover {
  background: #26332e;
}

.kc-btn:focus-visible,
.kc-dialog__close:focus-visible,
.kc-banner a:focus-visible,
.kc-dialog a:focus-visible,
.kc-switch input:focus-visible + .kc-switch__track {
  outline: 3px solid var(--kc-brand);
  outline-offset: 2px;
}

.kc-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.kc-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(8 14 12 / 0.55);
}

.kc-dialog__panel {
  position: relative;
  width: min(34rem, 100%);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: 1.25rem;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.25);
  animation: kc-rise 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.kc-dialog__panel:focus {
  outline: none;
}

.kc-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.kc-dialog__title {
  margin: 0;
  font-family: "Manrope", "Source Sans 3", sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kc-dialog__close {
  appearance: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--kc-line);
  border-radius: 999px;
  background: #fff;
  color: var(--kc-ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.kc-dialog__desc,
.kc-dialog__policy {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--kc-ink-2);
}

.kc-cats {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.kc-cat {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--kc-line);
  border-radius: 14px;
}

.kc-cat__name {
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
}

.kc-cat__desc {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--kc-ink-2);
}

.kc-switch {
  position: relative;
  flex: 0 0 auto;
  width: 3rem;
  height: 1.75rem;
}

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

.kc-switch input:disabled {
  cursor: not-allowed;
}

.kc-switch__track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #8a9690;
  transition: background 160ms ease;
}

.kc-switch__track::after {
  content: "";
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
  transition: transform 160ms ease;
}

.kc-switch input:checked + .kc-switch__track {
  background: var(--kc-ink);
}

.kc-switch input:checked + .kc-switch__track::after {
  transform: translateX(1.25rem);
}

.kc-switch input:disabled + .kc-switch__track {
  opacity: 0.6;
}

[dir="rtl"] .kc-switch__track::after {
  left: auto;
  right: 0.2rem;
}

[dir="rtl"] .kc-switch input:checked + .kc-switch__track::after {
  transform: translateX(-1.25rem);
}

.kc-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
}

.kc-footer-links a,
.kc-footer-links button {
  appearance: none;
  border: 0;
  background: none;
  padding: 0.25rem 0;
  min-height: 1.5rem;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

@keyframes kc-rise {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.kc-dialog__panel {
  animation-name: kc-pop;
}

@keyframes kc-pop {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 640px) {
  .kc-banner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .kc-banner__actions {
    flex-wrap: nowrap;
  }

  .kc-banner__actions .kc-btn {
    flex: 0 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kc-banner,
  .kc-dialog__panel {
    animation: none;
  }

  .kc-btn,
  .kc-switch__track,
  .kc-switch__track::after {
    transition: none;
  }
}
