.cookie-consent-banner {
  position: fixed;
  left: max(16px, calc(16px + var(--safe-left, 0px)));
  right: max(16px, calc(16px + var(--safe-right, 0px)));
  bottom: max(16px, calc(16px + var(--safe-bottom, 0px)));
  z-index: 80;
  margin: 0 auto;
  width: min(920px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(16, 16, 20, 0.94);
  color: #f5f5f7;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  padding: 16px 18px;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.cookie-consent-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cookie-consent-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cookie-consent-copy {
  flex: 1;
  min-width: 0;
}

.cookie-consent-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.cookie-consent-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #b5becb;
}

.cookie-consent-text a {
  color: #7fc2ff;
  text-underline-offset: 3px;
}

.cookie-consent-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 10px 14px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.cookie-btn:focus-visible {
  outline: 2px solid #2997ff;
  outline-offset: 2px;
}

.cookie-btn:hover {
  transform: translateY(-1px);
}

.cookie-btn-essential {
  background: transparent;
  color: #f5f5f7;
  border-color: rgba(255, 255, 255, 0.22);
}

.cookie-btn-essential:hover {
  background: rgba(255, 255, 255, 0.08);
}

.cookie-btn-accept {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.cookie-btn-accept:hover {
  background: #ebedf0;
}

html.theme-light .cookie-consent-banner {
  border-color: #d8e0ea;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
}

html.theme-light .cookie-consent-text {
  color: #556273;
}

html.theme-light .cookie-consent-text a {
  color: #0b75d7;
}

html.theme-light .cookie-btn-essential {
  color: #0f172a;
  border-color: #c9d4e2;
}

html.theme-light .cookie-btn-essential:hover {
  background: #eef3f9;
}

html.theme-light .cookie-btn-accept {
  background: #0f172a;
  color: #f8fbff;
  border-color: #0f172a;
}

html.theme-light .cookie-btn-accept:hover {
  background: #1f2937;
}

@media (max-width: 900px) {
  .cookie-consent-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-consent-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .cookie-consent-banner {
    left: max(10px, calc(10px + var(--safe-left, 0px)));
    right: max(10px, calc(10px + var(--safe-right, 0px)));
    bottom: max(10px, calc(10px + var(--safe-bottom, 0px)));
    width: auto;
    padding: 14px;
  }

  .cookie-consent-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-btn {
    width: 100%;
    text-align: center;
  }
}
