.cookie-consent-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cookie-consent-overlay.is-visible {
  display: flex;
  opacity: 1;
}

.cookie-consent-dialog {
  width: min(640px, 100%);
  border-radius: 18px;
  background: linear-gradient(145deg, #f8fafc 0%, #eef2ff 100%);
  box-shadow: 0 24px 55px rgba(15, 23, 42, 0.22);
  padding: 2.5rem 2.25rem;
  font-family: 'Kaisei Opti', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.cookie-consent-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.75rem;
}

.cookie-consent-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: linear-gradient(135deg, #0ea5e9 0%, #22d3ee 100%);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(14, 165, 233, 0.35);
}

.cookie-consent-headings h2 {
  font-size: clamp(1.3rem, 2vw + 0.8rem, 1.6rem);
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.cookie-consent-headings p {
  margin: 0;
  line-height: 1.7;
  color: #334155;
}

.cookie-consent-subtext {
  margin: 0 0 1.5rem;
  color: #475569;
  line-height: 1.7;
}

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

.cookie-consent-settings {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.cookie-consent-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.cookie-consent-setting h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: #0f172a;
}

.cookie-consent-setting p {
  margin: 0;
  color: #556375;
  font-size: 0.95rem;
  line-height: 1.6;
}

.cookie-consent-setting-state {
  font-weight: 600;
  color: #0ea5e9;
  white-space: nowrap;
}

.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.cookie-consent-actions--settings {
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.cookie-consent-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  padding: 0.75rem 1.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  text-decoration: none;
  border: 2px solid transparent;
  font-size: 0.98rem;
}

.cookie-consent-button--primary {
  background: linear-gradient(135deg, #0284c7 0%, #22d3ee 100%);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.35);
}

.cookie-consent-button--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(14, 165, 233, 0.4);
}

.cookie-consent-button--secondary {
  background: #ffffff;
  color: #0284c7;
  border-color: rgba(2, 132, 199, 0.25);
}

.cookie-consent-button--secondary:hover {
  background: rgba(125, 211, 252, 0.16);
}

.cookie-consent-button--ghost {
  background: transparent;
  color: #0284c7;
}

.cookie-consent-button--ghost:hover {
  background: rgba(125, 211, 252, 0.14);
}

.cookie-consent-button:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.45);
  outline-offset: 3px;
}

.cookie-consent-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.4);
  padding: 4px;
  transition: background 0.2s ease;
}

.cookie-consent-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.cookie-consent-toggle-slider {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.cookie-consent-toggle-slider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 4px;
  transform: translate(0, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}

.cookie-consent-toggle input:checked + .cookie-consent-toggle-slider::before {
  transform: translate(22px, -50%);
}

.cookie-consent-toggle input:checked ~ .cookie-consent-toggle-slider,
.cookie-consent-toggle input:checked + .cookie-consent-toggle-slider {
  background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
}

.cookie-consent-toggle input:focus-visible + .cookie-consent-toggle-slider {
  outline: 3px solid rgba(14, 165, 233, 0.45);
  outline-offset: 3px;
}

.cookie-consent-policy-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #0284c7;
  font-weight: 600;
  text-decoration: none;
  margin-top: 1.25rem;
}

.cookie-consent-policy-link::after {
  content: '↗';
  font-size: 0.85em;
  transition: transform 0.2s ease;
}

.cookie-consent-policy-link:hover::after {
  transform: translate3d(2px, -2px, 0);
}

.cookie-consent-policy-link:hover {
  text-decoration: underline;
}

.cookie-consent-policy-link:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.35);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .cookie-consent-dialog {
    padding: 2rem 1.5rem;
  }

  .cookie-consent-header {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .cookie-consent-icon {
    width: 48px;
    height: 48px;
    font-size: 1.75rem;
  }

  .cookie-consent-setting {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-consent-setting-state,
  .cookie-consent-toggle {
    align-self: stretch;
  }

  .cookie-consent-actions,
  .cookie-consent-actions--settings {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-consent-button {
    width: 100%;
  }
}
