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

.cookie-banner {
  position: fixed;
  z-index: 1100;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  width: min(960px, calc(100% - 32px));
  margin-inline: auto;
  padding: 20px 22px 16px;
  border: 1px solid #dedede;
  border-radius: 22px;
  background: var(--white, #fff);
  box-shadow: 0 12px 38px rgb(31 41 55 / 0.16);
  color: var(--midnight, #1f2937);
}

.cookie-banner-heading { display: flex; align-items: center; gap: 12px; }
.cookie-shield { flex: 0 0 24px; width: 24px; height: 24px; color: var(--everest-green, #2e7d32); }
.cookie-banner-heading > :last-child { margin: 0; color: #171717; font-size: clamp(1.15rem, 2vw, 1.55rem); line-height: 1.25; }
.cookie-banner-copy { margin: 16px 0 10px; font-size: 1rem; line-height: 1.55; }
.cookie-privacy-link { color: #202020; font-weight: 600; text-underline-offset: 3px; }
.cookie-privacy-link:focus-visible, .cookie-settings-link:focus-visible, .cookie-button:focus-visible, .cookie-close:focus-visible, .cookie-switch > :first-child:focus-visible + .cookie-switch-track { outline: 3px solid var(--sky-blue, #38b6f0); outline-offset: 3px; }

.cookie-actions, .cookie-dialog-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; gap: 12px; margin-top: 16px; }
.cookie-button { min-height: 54px; padding: 11px 18px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: #151515; font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; }
.cookie-button-outline { border-color: var(--everest-blue, #084ea2); background: #fff; }
.cookie-button-quiet { border-color: #d1d5db; background: #fff; }
.cookie-button-primary { border-color: var(--everest-green, #2e7d32); background: var(--everest-green, #2e7d32); color: #fff; }
.cookie-button:hover { filter: brightness(.96); }

.cookie-dialog { width: min(560px, calc(100% - 32px)); max-height: min(90vh, 760px); padding: 26px; border: 1px solid #d8dee7; border-radius: 18px; color: var(--midnight, #1f2937); box-shadow: 0 24px 72px rgb(3 26 57 / .28); }
.cookie-dialog::backdrop { background: rgb(3 26 57 / .55); }
.cookie-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cookie-dialog-eyebrow { margin: 0 0 5px; color: var(--everest-blue, #084ea2); font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.cookie-dialog-heading > :first-child > :last-child { margin: 0; font-size: 1.35rem; line-height: 1.3; }
.cookie-dialog-copy { margin: 14px 0 20px; color: #374151; font-size: .92rem; }
.cookie-close { flex: 0 0 40px; width: 40px; height: 40px; border: 1px solid #d1d5db; border-radius: 50%; background: #fff; color: #1f2937; font-size: 1.7rem; line-height: 1; cursor: pointer; }
.cookie-category-list { border-top: 1px solid #dfe4ea; }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; border-bottom: 1px solid #dfe4ea; }
.cookie-category > :first-child > :first-child { margin: 0 0 3px; font-size: .98rem; }
.cookie-category > :first-child > :nth-child(2) { margin: 0; color: #4b5563; font-size: .81rem; line-height: 1.45; }
.cookie-switch { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; }
.cookie-switch > :first-child { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cookie-switch-track { position: relative; display: inline-block; width: 48px; height: 28px; border: 1px solid #64748b; border-radius: 18px; background: #e5e7eb; pointer-events: none; transition: background .16s ease; }
.cookie-switch-track::after { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); content: ''; transition: transform .16s ease; }
.cookie-switch > :first-child:checked + .cookie-switch-track { border-color: var(--everest-green, #2e7d32); background: var(--everest-green, #2e7d32); }
.cookie-switch > :first-child:checked + .cookie-switch-track::after { transform: translateX(20px); }
.cookie-switch > :first-child:disabled { position: static; width: auto; height: auto; opacity: 1; accent-color: var(--everest-green, #2e7d32); }
.cookie-switch > :first-child:disabled + :nth-child(2) { color: #1f2937; }
.cookie-switch > :first-child:focus-visible + .cookie-switch-track { outline-offset: 4px; }
.cookie-dialog-actions { grid-template-columns: 1fr 1.2fr 1fr; gap: 8px; margin-top: 20px; }
.cookie-dialog-actions .cookie-button { min-height: 48px; padding: 9px; font-size: .83rem; }
.cookie-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.cookie-settings-link { display: inline; min-height: 0; padding: 0; border: 0; background: transparent; color: rgb(255 255 255 / .78); font: inherit; font-size: 12px; line-height: 1.65; text-decoration: none; cursor: pointer; transition: color 200ms ease; }
@media (hover: hover) { .cookie-settings-link:hover, .cookie-settings-link:focus-visible { color: #38b6f0; } }
@media (max-width: 760px) { .cookie-settings-link { font-size: 13px; } }

@media (max-width: 640px) {
  .cookie-banner { right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); left: 8px; width: calc(100% - 16px); padding: 17px 16px 13px; border-radius: 18px; }
  .cookie-banner-copy { margin-top: 12px; font-size: .9rem; }
  .cookie-actions { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
  .cookie-button { min-height: 48px; padding: 9px 10px; font-size: .88rem; }
  .cookie-actions .cookie-button-outline { grid-column: 1 / -1; }
  .cookie-dialog { padding: 21px 17px; }
  .cookie-dialog-actions { grid-template-columns: 1fr 1fr; }
  .cookie-dialog-actions [data-cookie-save] { grid-column: 1 / -1; grid-row: 2; }
  .cookie-category { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-switch-track, .cookie-switch-track::after { transition: none; }
}
