.site-cookie-notice,
.site-cookie-preferences-ui {
  color: #222;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0;
  text-align: left;
}

.site-cookie-notice {
  position: fixed;
  inset: auto 0 0;
  z-index: 100;
  margin: 0;
  padding: 12px 20px;
  border-top: 1px solid #b7bec2;
  background: #fff;
  box-shadow: 0 -2px 8px #0000000a;
}

.site-cookie-notice[hidden],
.site-consent-space[hidden],
.site-consent-status[hidden] {
  display: none;
}

.site-consent-space {
  height: 100px;
}

.site-consent-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  max-width: 1120px;
  margin: 0 auto;
}

.site-cookie-notice p,
.site-cookie-preferences-ui p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.site-consent-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}

.site-consent-actions button {
  box-sizing: border-box;
  min-width: 112px;
  min-height: 44px;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid #65727a;
  border-radius: 4px;
  background: #fff;
  color: #202a30;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  box-shadow: none;
}

.site-consent-actions button:hover:not(:disabled) {
  background: #eef3f1;
}

.site-consent-actions button:focus-visible {
  outline: 3px solid #24644b;
  outline-offset: 2px;
}

.site-consent-actions button:disabled {
  cursor: default;
  opacity: 0.6;
}

.site-cookie-notice .site-consent-status {
  flex-basis: 100%;
  color: #4a5155;
  font-size: 13px;
}

.site-cookie-preferences-ui {
  margin: 16px 0 0;
}

.site-cookie-preferences-ui h2 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: 0;
}

.site-cookie-preferences-ui .site-consent-actions {
  margin-top: 12px;
}

#cookie-preferences,
#google-ads-measurement,
#book-metrics,
#anonymous-counts {
  scroll-margin-top: 128px;
}

.legal-page :is(#cookie-preferences, #google-ads-measurement, #book-metrics, #anonymous-counts) code {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.site-policy-footer {
  padding: 20px 16px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0;
}

.site-policy-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.site-policy-footer a {
  color: #284f43;
  white-space: normal;
  overflow-wrap: anywhere;
}

footer:not(.site-policy-footer) > nav[aria-label="サイト情報"] {
  box-sizing: border-box;
  width: 100%;
  max-width: 1152px;
  margin: 16px auto 0;
  padding: 0 16px;
}

@media (max-width: 600px) {
  .site-cookie-notice {
    padding: 12px 16px;
  }

  .site-consent-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .site-cookie-notice .site-consent-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-consent-actions button {
    min-width: 0;
  }

  .site-consent-space {
    height: 184px;
  }
}
