/* 152-FZ cookie consent — standalone sheet (cache-bust via ?v= query) */
.cookie-consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10000;
  padding: 0.75rem clamp(0.85rem, 3vw, 1.5rem);
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  /* Opacity-only show — avoid transform slide (scores as CLS on the banner). */
  transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}

.cookie-consent.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.28s ease, visibility 0s linear 0s;
}

.cookie-consent__panel {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
  border: 1px solid rgba(126, 211, 164, 0.46);
  border-radius: 4px;
  background: #0a0c10;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
  overflow: hidden;
}

.cookie-consent.is-expanded .cookie-consent__panel {
  align-items: stretch;
  border-color: rgba(126, 211, 164, 0.62);
  box-shadow:
    0 -18px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(126, 211, 164, 0.08) inset;
}

.cookie-consent__body {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 1.15rem 1.35rem;
  box-sizing: border-box;
}

.cookie-consent.is-expanded .cookie-consent__body {
  padding: 1.35rem 1.5rem 1rem;
}

.cookie-consent__kicker {
  margin: 0 0 0.4rem;
  font-family: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7ed3a4;
}

.cookie-consent__title {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: #e4e2d8;
}

.cookie-consent__text {
  margin: 0;
  width: 100%;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #c4c2ca;
}

.cookie-consent__toggle {
  display: inline;
  margin: 0.35rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: #9fdfb8;
  font: inherit;
  font-size: 0.8rem;
  line-height: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.cookie-consent__toggle:hover {
  color: #64dfdf;
}

.cookie-consent__expandable {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.cookie-consent.is-expanded .cookie-consent__expandable {
  grid-template-rows: 1fr;
}

.cookie-consent__expandable[hidden] {
  display: none;
}

.cookie-consent.is-expanded .cookie-consent__expandable[hidden] {
  display: grid;
}

.cookie-consent__expandable-inner {
  overflow: hidden;
  min-height: 0;
}

.cookie-consent__legal {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(126, 211, 164, 0.22);
  max-height: min(42vh, 24rem);
  overflow: auto;
  color: #c8c6ce;
  font-size: 0.78rem;
  line-height: 1.6;
  opacity: 0;
  transition: opacity 0.32s ease 0.08s;
  -webkit-overflow-scrolling: touch;
}

.cookie-consent.is-expanded .cookie-consent__legal {
  opacity: 1;
}

.cookie-consent__legal-title {
  margin: 0 0 0.85rem;
  color: #e4e2d8;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
}

.cookie-consent__legal p {
  margin: 0 0 0.75rem;
}

.cookie-consent__legal ul {
  margin: 0 0 0.85rem;
  padding-left: 1.1rem;
}

.cookie-consent__legal li + li {
  margin-top: 0.35rem;
}

.cookie-consent__actions {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 0.5rem;
  padding: 0.85rem 1.35rem 1.15rem;
  background: #0a0c10;
  border-top: 1px solid rgba(126, 211, 164, 0.18);
  box-sizing: border-box;
}

.cookie-consent__accept,
.cookie-consent__decline,
.cookie-consent__collapse {
  min-width: 7.5rem;
  min-height: 2.5rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.8rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
}

.cookie-consent__accept {
  border: 1px solid rgba(126, 211, 164, 0.55);
  background: #143024;
  color: #b8e8c8;
}

.cookie-consent__decline,
.cookie-consent .btn.ghost.cookie-consent__decline {
  color: #e4e2d8;
  border: 1px solid rgba(228, 226, 216, 0.28);
  background: #12141a;
}

.cookie-consent__decline:hover,
.cookie-consent__decline:focus-visible,
.cookie-consent .btn.ghost.cookie-consent__decline:hover,
.cookie-consent .btn.ghost.cookie-consent__decline:focus-visible {
  color: #ff9b9b;
  border-color: rgba(255, 107, 107, 0.45);
  background: #1a1214;
}

.cookie-consent__collapse,
.cookie-consent .btn.ghost.cookie-consent__collapse {
  display: none;
  border: 1px solid rgba(228, 226, 216, 0.28);
  background: #12141a;
  color: #e4e2d8;
}

.cookie-consent.is-expanded .cookie-consent__collapse {
  display: inline-flex;
}

.cookie-consent__collapse[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .cookie-consent {
    padding: 0.65rem 0.75rem;
    padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
  }

  .cookie-consent__panel {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: min(78vh, 36rem);
  }

  /* Only the body scrolls — actions stay pinned below with opaque fill. */
  .cookie-consent.is-expanded .cookie-consent__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 1rem 1.05rem 0.75rem;
    -webkit-overflow-scrolling: touch;
  }

  .cookie-consent:not(.is-expanded) .cookie-consent__body {
    padding: 1rem 1.05rem 0.75rem;
  }

  .cookie-consent.is-expanded .cookie-consent__legal {
    /* Body scrolls the whole expanded copy; avoid nested scroll under buttons. */
    max-height: none;
    overflow: visible;
  }

  .cookie-consent__actions {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 0.75rem 1.05rem 1rem;
    background: #0a0c10;
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.55);
  }

  .cookie-consent__accept,
  .cookie-consent__decline,
  .cookie-consent__collapse {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent,
  .cookie-consent__expandable,
  .cookie-consent__legal {
    transition: none;
  }
}
