/* RailsとInertiaで、同じ二段階の同意UIを表示する。 */
.cookie-consent-banner,
.cookie-consent-dialog { color: #111827; font-size: 14px; line-height: 1.7; background: #fff; }
.cookie-consent-banner {
  position: fixed;
  inset: auto 16px calc(16px + env(safe-area-inset-bottom));
  max-width: 1328px;
  margin-inline: auto;
  z-index: 1000;
  padding: 24px;
  background: var(--color-v2-primary-700, #15803d);
  color: #fff;
  border: 1px solid var(--color-v2-primary-700, #15803d);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgb(17 24 39 / 20%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
.cookie-consent-banner-inner { max-width: 1280px; margin-inline: auto; display: flex; align-items: center; gap: 32px; }
.cookie-consent-banner h2 { margin: 0 0 8px; font-size: 20px; font-weight: 700; line-height: 1.5; }
.cookie-consent-banner p { margin: 0; color: #fff; }
.cookie-consent-banner a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.cookie-consent-dialog a { color: var(--color-v2-primary-700, #15803d); text-decoration: underline; text-underline-offset: 3px; }
.cookie-consent-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cookie-consent-banner .cookie-consent-actions { flex: 0 0 408px; }
.cookie-consent-actions button { min-height: 44px; white-space: nowrap; }
.cookie-consent-actions .cookie-consent-choice { background: #fff; border: 1px solid #15803d; color: #15803d; }
.cookie-consent-actions .cookie-consent-choice:hover { background: #f0fdf4; }
.cookie-consent-banner .cookie-consent-choice { border-color: #d1d5db; }
.cookie-consent-banner .cookie-consent-choice:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.cookie-consent-actions .cookie-consent-save { background: #15803d; color: #fff; }
.cookie-consent-actions .cookie-consent-save:hover { background: #166534; }
.cookie-consent-dialog {
  width: min(42rem, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgb(17 24 39 / 20%);
}
.cookie-consent-dialog[open] { display: flex; flex-direction: column; }
.cookie-consent-dialog::backdrop { background: rgb(17 24 39 / 45%); }
.cookie-consent-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 28px; border-bottom: 1px solid #e5e7eb; flex-shrink: 0; }
.cookie-consent-header h2 { margin: 0; font-size: 20px; font-weight: 700; }
.cookie-consent-header button { min-height: 44px; color: #4b5563; }
.cookie-consent-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 28px; }
.cookie-consent-body > p:first-child { margin: 0 0 20px; color: #4b5563; }
.cookie-consent-category { border-top: 1px solid #e5e7eb; padding: 18px 0; }
.cookie-consent-category-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 36px; }
.cookie-consent-category h3 { margin: 0; font-size: 16px; font-weight: 700; }
.cookie-consent-category p { margin: 6px 0 0; color: #4b5563; }
.cookie-consent-always { color: #15803d; font-size: 13px; font-weight: 700; white-space: nowrap; }
.cookie-consent-switch { position: relative; display: inline-flex; align-items: center; min-height: 44px; flex-shrink: 0; cursor: pointer; }
.cookie-consent-switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.cookie-consent-switch span { display: block; width: 46px; height: 26px; background: #6b7280; border-radius: 99px; pointer-events: none; }
.cookie-consent-switch span::after { content: ""; display: block; width: 20px; height: 20px; margin: 3px; background: #fff; border-radius: 50%; }
.cookie-consent-switch input:checked + span { background: #15803d; }
.cookie-consent-switch input:checked + span::after { transform: translateX(20px); }
.cookie-consent-switch input:focus-visible + span { outline: 2px solid #15803d; outline-offset: 4px; }
.cookie-consent-category details { margin-top: 10px; font-size: 13px; }
.cookie-consent-category summary { color: #374151; cursor: pointer; padding-block: 4px; }
.cookie-consent-category details p { margin-top: 8px; }
.cookie-consent-body .cookie-consent-note { margin: 14px 0 0; color: #6b7280; font-size: 12px; }
.cookie-consent-footer { flex-shrink: 0; padding: 16px 28px 24px; border-top: 1px solid #e5e7eb; background: #fff; }
.cookie-consent-footer > p { margin: 0 0 12px; color: #6b7280; font-size: 12px; }
@media (max-width: 900px) {
  .cookie-consent-banner-inner { display: block; }
  .cookie-consent-banner .cookie-consent-actions { margin-top: 18px; }
}
@media (max-width: 479px) {
  .cookie-consent-banner { inset: auto 12px calc(12px + env(safe-area-inset-bottom)); padding: 20px; max-height: calc(100dvh - 24px); }
  .cookie-consent-banner h2 { font-size: 18px; }
  .cookie-consent-banner .cookie-consent-actions { grid-template-columns: 1fr; gap: 8px; }
  .cookie-consent-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
  .cookie-consent-header { padding: 12px 20px; }
  .cookie-consent-body { padding: 20px; }
  .cookie-consent-footer { padding: 14px 20px calc(20px + env(safe-area-inset-bottom)); }
  .cookie-consent-footer .cookie-consent-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cookie-consent-save { grid-column: 1 / -1; grid-row: 2; }
}

body:has(#cookie-consent-preferences[open]) { overflow: hidden; }
