.cookie-banner[hidden],
.cookie-banner [hidden],
[data-cookie-preferences][hidden] {
  display: none !important;
}

.cookie-banner {
  position: fixed;
  z-index: 10000;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  gap: 16px;
  max-height: 100dvh;
  margin: 0;
  padding: 10px max(36px, calc((100% - 1280px) / 2));
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border: 0;
  border-top: 1px solid #20455a;
  border-radius: 0;
  background: #061326;
  color: #f5f9ff;
  box-shadow: 0 -6px 24px rgb(0 0 0 / 18%);
  font-family: Manrope, Arial, sans-serif;
  line-height: 1.6;
}

.cookie-banner-copy {
  flex: 1;
  min-width: 0;
}

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

.cookie-banner p {
  margin: 0;
  color: #a9bbd0;
  font-size: 13px;
  line-height: 1.5;
}

.cookie-banner a {
  color: #00d0fa;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-banner-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.cookie-banner [data-cookie-accept] { white-space: nowrap; }

.cookie-button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #456078;
  border-radius: 4px;
  background: #0b1d31;
  color: #f5f9ff;
  font: 700 13px/1.4 Manrope, Arial, sans-serif;
  cursor: pointer;
}

.cookie-button:hover { border-color: #00d0fa; background: #102a40; }
.cookie-button-accept {
  border-color: rgb(129 239 255 / 74%);
  background: linear-gradient(135deg, #00d0fa, #3d9bff);
  color: #03101d;
  box-shadow: inset 0 1px rgb(255 255 255 / 34%);
}
.cookie-button-accept:hover {
  border-color: #fff;
  background: linear-gradient(135deg, #35dcff, #58aaff);
}

.cookie-config-button {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #a9bbd0;
  cursor: pointer;
}

.cookie-config-button:hover { color: #00d0fa; background: #0b1d31; }
.cookie-config-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.cookie-preferences-dialog {
  width: min(420px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  overflow-y: auto;
  border: 1px solid #20455a;
  border-radius: 8px;
  background: #061326;
  color: #f5f9ff;
  box-shadow: 0 16px 60px rgb(0 0 0 / 30%);
  font: 13px/1.5 Manrope, Arial, sans-serif;
  color-scheme: dark;
}

.cookie-preferences-dialog::backdrop { background: rgb(3 10 20 / 55%); }
.cookie-preferences-dialog h2 {
  margin: 0 24px 22px 0;
  color: #f5f9ff;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -.02em;
}

.cookie-preference-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid #20455a;
}

.cookie-preference-row strong { display: block; color: #f5f9ff; font-weight: 700; }
.cookie-preference-row p,
#cookie-analytics-description { display: block; margin: 4px 0 0; color: #a9bbd0; font-size: 12px; line-height: 1.5; }
.cookie-required-label { flex-shrink: 0; color: #a9bbd0; font-size: 11px; }
label.cookie-preference-row { cursor: pointer; }
.cookie-preference-row input {
  appearance: none;
  flex: 0 0 38px;
  width: 38px;
  height: 22px;
  margin: 0;
  border: 1px solid #456078;
  border-radius: 20px;
  background: #22364a;
  cursor: pointer;
}
.cookie-preference-row input::before { content: ""; display: block; width: 16px; height: 16px; margin: 2px; border-radius: 50%; background: #f5f9ff; }
.cookie-preference-row input:checked { border-color: #00d0fa; background: #00d0fa; }
.cookie-preference-row input:checked::before { transform: translateX(16px); background: #03101d; }
.cookie-preferences-actions { display: grid; grid-template-columns: 1fr; margin-top: 12px; }
.cookie-preferences-actions .cookie-button { padding-inline: 8px; font-size: 12px; }

.cookie-dialog-close {
  position: absolute;
  inset: 5px 5px auto auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 7px;
  border: 0;
  background: transparent;
  color: #a9bbd0;
  cursor: pointer;
}

.cookie-dialog-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.cookie-banner :focus-visible,
.cookie-preferences-dialog :focus-visible { outline: 2px solid #00d0fa; outline-offset: 3px; }
.cookie-banner h2:focus,
.cookie-preferences-dialog h2:focus { outline: none; }

.cookie-settings-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@keyframes cookie-banner-appear {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .cookie-banner:not([hidden]) {
    animation: cookie-banner-appear 1s cubic-bezier(.25, .1, .25, 1) both;
  }
}

@media (max-width: 760px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  }

  .cookie-banner p { font-size: 12px; line-height: 1.5; text-wrap: pretty; }
  .cookie-banner a { white-space: nowrap; }
  .cookie-banner-actions {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
  }
  .cookie-banner .cookie-config-button {
    border: 1px solid #25495f;
    background: #0b1d31;
    color: #00d0fa;
  }
  .cookie-banner .cookie-config-button:hover { border-color: #00d0fa; background: #102a40; }
  .cookie-button { padding-inline: 8px; }
  .cookie-preferences-dialog { padding: 20px; }
}
