.analytics-consent {
  position: fixed;
  z-index: 200;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  display: grid;
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 22px;
  border: 1px solid rgba(18, 24, 32, .16);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(18, 24, 32, .24);
  color: #121820;
  font-family: "Pretendard", AppleSDGothicNeo-Regular, sans-serif;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.analytics-consent[hidden],
.analytics-settings[hidden] {
  display: none;
}

.analytics-consent strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.analytics-consent p {
  margin: 0;
  color: #506373;
  font-size: 13px;
  line-height: 1.65;
  word-break: keep-all;
}

/* Japanese has no word spaces, so keep-all would prevent line breaks. */
html:lang(ja) .analytics-consent p {
  word-break: normal;
}

.analytics-consent a {
  color: inherit;
  font-weight: 700;
  text-underline-offset: 3px;
}

.analytics-consent__actions {
  display: flex;
  gap: 8px;
}

.analytics-consent button,
.analytics-settings {
  min-height: 44px;
  border: 1px solid #152532;
  border-radius: 999px;
  padding: 0 18px;
  font: 700 13px/1 "Pretendard", AppleSDGothicNeo-Regular, sans-serif;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, scale 180ms ease;
}

.analytics-consent__reject {
  background: #fff;
  color: #152532;
}

.analytics-consent__accept {
  background: #152532;
  color: #fff;
}

.analytics-consent button:focus-visible,
.analytics-settings:focus-visible {
  outline: 3px solid rgba(47, 107, 94, .4);
  outline-offset: 2px;
}

.analytics-consent button:active,
.analytics-settings:active {
  scale: .96;
}

.analytics-settings {
  position: fixed;
  z-index: 80;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  min-height: 40px;
  border-color: rgba(255, 255, 255, .34);
  padding: 0 15px;
  background: #152532;
  box-shadow: 0 8px 24px rgba(18, 24, 32, .2);
  color: #fff;
  font-size: 12px;
}

@media (max-width: 640px) {
  .analytics-consent {
    padding: 14px;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .analytics-consent strong {
    margin-bottom: 4px;
    font-size: 14px;
  }

  .analytics-consent p {
    font-size: 12px;
    line-height: 1.5;
  }

  .analytics-consent__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

body.nav-open .analytics-consent,
body.nav-open .analytics-settings {
  display: none !important;
}

