/**
 * Cookie Consent CMP — cc- プレフィックス（テーマ非依存）.
 */
:root {
  --cc-bg: var(--white, #fff);
  --cc-ink: var(--ink, #0d0d0b);
  --cc-mid: var(--mid, #6b7280);
  --cc-line: var(--line, #e5e7eb);
  --cc-accent: var(--grad-purple, #8b5ce8);
  --cc-accent-hover: var(--grad-blue, #6b8ae0);
  --cc-sans: var(--sans, system-ui, sans-serif);
  --cc-ease: var(--ease, cubic-bezier(0.4, 0, 0.2, 1));
  --cc-z-banner: 120;
  --cc-z-modal: 130;
}

body.cc-modal-open {
  overflow: hidden;
}

/* ── Banner ── */
.cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--cc-z-banner);
  padding: 16px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s var(--cc-ease), transform 0.35s var(--cc-ease);
}

.cc-banner.is-visible {
  pointer-events: auto;
  opacity: 1;
  transform: none;
}

.cc-banner[hidden] { display: block; }
.cc-banner:not(.is-visible)[hidden] { display: none; }

.cc-banner__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 28px;
  padding: 18px 22px;
  background: var(--cc-bg);
  border: 1px solid var(--cc-line);
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(10, 22, 40, 0.12);
}

.cc-banner__body { flex: 1; min-width: 0; }

.cc-banner__title {
  font-family: var(--cc-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--cc-ink);
  margin: 0 0 6px;
}

.cc-banner__desc {
  font-family: var(--cc-sans);
  font-size: 12px;
  line-height: 1.7;
  color: var(--cc-mid);
  margin: 0;
}

.cc-banner__link {
  color: var(--cc-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: 0.35em;
}

.cc-banner__link:hover { color: var(--cc-accent-hover); }

.cc-banner__actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* EU: 拒否を同等の視覚重量に */
body.cc-region-eu .cc-banner__actions .cc-btn--ghost,
body.cc-region-eu .cc-modal__actions .cc-btn--ghost {
  color: var(--cc-ink);
  border-color: var(--cc-mid);
  font-weight: 700;
}

/* ── Buttons ── */
.cc-btn {
  font-family: var(--cc-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 11px 18px;
  border-radius: 2px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s var(--cc-ease), color 0.25s var(--cc-ease), border-color 0.25s var(--cc-ease);
}

.cc-btn--primary { color: #fff; background: var(--cc-accent); }
.cc-btn--primary:hover { background: var(--cc-accent-hover); }

.cc-btn--ghost {
  color: var(--cc-mid);
  background: transparent;
  border: 1px solid var(--cc-line);
}

.cc-btn--ghost:hover {
  color: var(--cc-ink);
  border-color: var(--cc-mid);
}

/* ── Modal ── */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: var(--cc-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--cc-ease);
}

.cc-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.cc-modal[hidden] { display: none; }

.cc-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 40, 0.55);
}

.cc-modal__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(85vh, 720px);
  overflow: auto;
  background: var(--cc-bg);
  border: 1px solid var(--cc-line);
  border-radius: 4px;
  padding: 28px 24px 22px;
  box-shadow: 0 20px 60px rgba(10, 22, 40, 0.2);
}

.cc-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--cc-mid);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.cc-modal__close:hover { color: var(--cc-ink); }

.cc-modal__title {
  font-family: var(--cc-sans);
  font-size: 18px;
  font-weight: 700;
  color: var(--cc-ink);
  margin: 0 0 10px;
  padding-right: 36px;
}

.cc-modal__desc {
  font-family: var(--cc-sans);
  font-size: 13px;
  line-height: 1.7;
  color: var(--cc-mid);
  margin: 0 0 18px;
}

.cc-modal__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 16px 0 20px;
  font-size: 12px;
}

.cc-modal__links a {
  color: var(--cc-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-modal__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Categories ── */
.cc-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cc-cat {
  border: 1px solid var(--cc-line);
  border-radius: 4px;
  padding: 14px 16px;
}

.cc-cat__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cc-cat__label {
  display: block;
  font-family: var(--cc-sans);
  font-size: 14px;
  color: var(--cc-ink);
  margin-bottom: 4px;
}

.cc-cat__desc {
  font-family: var(--cc-sans);
  font-size: 12px;
  line-height: 1.6;
  color: var(--cc-mid);
  margin: 0;
}

.cc-cat__badge {
  flex-shrink: 0;
  font-family: var(--cc-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--cc-mid);
  background: #f3f4f6;
  padding: 6px 10px;
  border-radius: 2px;
  white-space: nowrap;
}

/* ── Toggle ── */
.cc-switch {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  cursor: pointer;
}

.cc-switch__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cc-switch__track {
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 999px;
  transition: background 0.25s var(--cc-ease);
  position: relative;
}

.cc-switch__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s var(--cc-ease);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.cc-switch__input:checked + .cc-switch__track {
  background: var(--cc-accent);
}

.cc-switch__input:checked + .cc-switch__track::after {
  transform: translateX(20px);
}

.cc-switch__input:focus-visible + .cc-switch__track {
  outline: 2px solid var(--cc-accent-hover);
  outline-offset: 2px;
}

/* ── Footer link ── */
.ft-cookie-settings {
  font: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  transition: color 0.25s var(--cc-ease);
}

.ft-cookie-settings:hover { color: var(--cc-accent); }

@media (max-width: 768px) {
  .cc-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cc-banner__actions,
  .cc-modal__actions {
    justify-content: stretch;
  }

  .cc-banner__actions .cc-btn,
  .cc-modal__actions .cc-btn {
    flex: 1 1 auto;
  }
}
