/* The cookie choice: one slim, centred bar at the bottom. On phones it becomes a short sheet along the bottom edge.
   It slides away as soon as someone answers. */
.nx-cookie {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 2147483000;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: calc(100vw - 32px);
  padding: 7px 7px 7px 18px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  background: #111114;
  box-shadow: 0 12px 32px -10px rgba(0, 0, 0, .7);
  color: #d4d4d8;
  font: 400 13.5px/1.4 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity .3s ease, transform .4s cubic-bezier(.22, 1, .36, 1);
}
.nx-cookie *, .nx-cookie *::before, .nx-cookie *::after { box-sizing: border-box; }
.nx-cookie.is-open { opacity: 1; transform: translate(-50%, 0); }

.nx-cookie-text { margin: 0; }
.nx-cookie-text a { margin-left: 6px; color: #8b8b94; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .25); text-underline-offset: 3px; }
.nx-cookie-text a:hover { color: #fff; text-decoration-color: currentColor; }

.nx-cookie-buttons { display: flex; gap: 6px; }
.nx-cookie-btn {
  height: 32px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 9px;
  background: transparent;
  color: #f4f4f5;
  font: 600 13px/1 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s ease, border-color .15s ease;
}
.nx-cookie-btn:hover { border-color: rgba(255, 255, 255, .24); background: rgba(255, 255, 255, .05); }
.nx-cookie-btn.is-primary { border-color: #f4f4f5; background: #f4f4f5; color: #0a0a0b; }
.nx-cookie-btn.is-primary:hover { border-color: #fff; background: #fff; }
.nx-cookie-btn:focus-visible, .nx-cookie-text a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 9px; }

/* Phones: a short, centred sheet along the bottom edge with two equal buttons. */
@media (max-width: 760px) {
  .nx-cookie {
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    max-width: none;
    padding: 14px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border-width: 1px 0 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 28px -12px rgba(0, 0, 0, .7);
    white-space: normal;
    text-align: center;
    transform: translateY(100%);
  }
  .nx-cookie.is-open { transform: none; }
  /* Some pages lift the sheet above their own bottom bar: keep it a rounded card there. */
  .nx-cookie.is-floating { left: 12px; right: 12px; border-width: 1px; border-radius: 14px; padding-bottom: 12px; }
  .nx-cookie-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .nx-cookie-btn { height: 44px; border-radius: 11px; font-size: 14.5px; }
  /* The Ask Nexus bubble waits above the sheet until a choice is made. */
  html[data-nx-cookie-up] .nxa { bottom: calc(14px + env(safe-area-inset-bottom) + var(--nxc-lift, 0px)) !important; }
}

@media (prefers-reduced-motion: reduce) {
  .nx-cookie, .nx-cookie.is-open { transition: opacity .01ms; }
  .nx-cookie { transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) and (max-width: 760px) {
  .nx-cookie { transform: none; }
}
