/* ===== COOKIE同意ポップアップ（PC / SP） ===== */
html.is-cookie-gate-open {
  overflow: hidden;
}

/* 直接アクセス時、ポップアップが開くまでページ本文を隠す */
html.cookie-gate-pending body {
  visibility: hidden;
}

.cookie-gate {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 24px;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-family: inherit;
  letter-spacing: normal;
  overflow-wrap: anywhere;
  overflow-y: auto;
  overscroll-behavior: contain;
  visibility: visible;
}

.cookie-gate[open] {
  display: flex;
}

.cookie-gate::backdrop {
  background: rgba(17, 17, 17, 0.6);
}

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

.cookie-gate__panel {
  width: 100%;
  max-width: 640px;
  margin: auto;
  padding: 32px 28px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  text-align: left;
  animation: cookie-gate-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cookie-gate__title {
  margin: 0 0 20px;
  color: #1f2937;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.5;
}

.cookie-gate__description {
  color: #4b5563;
  font-size: 13px;
  line-height: 1.8;
}

.cookie-gate__description p {
  margin: 0;
}

.cookie-gate__description p + p {
  margin-top: 18px;
}

.cookie-gate__note {
  color: #6b7280;
}

.cookie-gate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.cookie-gate__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 128px;
  min-height: 44px;
  margin: 0;
  padding: 10px 32px;
  border: 0;
  border-radius: 6px;
  background: #f0f2f4;
  color: #374151;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}

.cookie-gate__button--primary {
  background: #3442ec;
  color: #fff;
}

@media (hover: hover) {
  .cookie-gate__button:hover {
    background: #e2e5e9;
  }

  .cookie-gate__button--primary:hover {
    background: #2433d6;
  }
}

.cookie-gate__button:focus-visible {
  outline: 3px solid #9aa2f6;
  outline-offset: 2px;
}

.cookie-gate__button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.cookie-gate__status {
  margin: 12px 0 0;
  color: #b42318;
  font-size: 13px;
  line-height: 1.75;
}

@keyframes cookie-gate-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-gate__panel {
    animation: none;
  }
}

@media screen and (max-width: 560px) {
  .cookie-gate {
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .cookie-gate__panel {
    padding: 26px 20px 22px;
  }

  .cookie-gate__title {
    margin-bottom: 16px;
    font-size: 17px;
  }

  .cookie-gate__button {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 12px;
  }
}
