/* Stage 1 Part A: cookie banner + preferences. Self-contained (marketing and portal pages both load it). */
.pmc {
  position: fixed; left: 24px; bottom: 24px; z-index: 950; width: min(440px, calc(100vw - 48px));
  color: #123b5d; font: inherit; line-height: 1.5;
}
.pmc[hidden], .pmc-toast[hidden], .pmc [hidden] { display: none !important; }
.pmc-card {
  position: relative; background: #fff; border-radius: 18px; padding: 22px 22px 18px;
  box-shadow: 0 30px 70px -24px rgba(18, 59, 93, .45), 0 0 0 1px rgba(18, 59, 93, .08);
  max-height: calc(100vh - 48px); overflow: auto; overscroll-behavior: contain;
  animation: pmc-in .32s cubic-bezier(.2, .8, .2, 1);
}
.pmc-card:focus { outline: none; }
.pmc-card:focus-visible { outline: 3px solid #45b5e6; outline-offset: 3px; }
/* Transform only, never opacity: axe (and real users) must read full-contrast text from frame one. */
@keyframes pmc-in { from { transform: translateY(14px) scale(.985); } to { transform: none; } }
.pmc.is-leaving .pmc-card { animation: pmc-out .2s ease-in forwards; }
@keyframes pmc-out { to { transform: translateY(10px); } }
.pmc.is-leaving { pointer-events: none; }

.pmc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.pmc-ico {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e6f3fa, #eef5ee); color: #2f5d8a;
}
.pmc-title { margin: 0; font-size: 1.125rem; font-weight: 700; letter-spacing: -.01em; color: #123b5d; line-height: 1.3; flex: 1; }
.pmc-x {
  flex: none; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: #4d6c86;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s, color .15s;
}
.pmc-x:hover { background: #f1f3f5; color: #123b5d; }
.pmc-desc { margin: 0 0 16px; font-size: .9375rem; color: #4d6c86; }
.pmc-desc a { color: #2f5d8a; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.pmc-desc a:hover { color: #123b5d; }

.pmc-prefs { margin: 0 0 16px; animation: pmc-fade .22s ease-out; }
@keyframes pmc-fade { from { transform: translateY(-4px); } to { transform: none; } }
.pmc-prefs fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.pmc-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pmc-row {
  display: flex; align-items: flex-start; gap: 16px; padding: 14px 16px; border: 1px solid #e3e7ec; border-radius: 14px; background: #fbfcfd;
}
.pmc-row + .pmc-row { margin-top: 8px; }
.pmc-row:has(input:checked) { border-color: #b9dcef; background: #f4fafd; }
.pmc-row-text { flex: 1; min-width: 0; }
.pmc-row-title { display: block; font-weight: 700; font-size: .9375rem; color: #123b5d; cursor: default; }
label.pmc-row-title { cursor: pointer; }
.pmc-row-desc { display: block; margin-top: 2px; font-size: .8125rem; color: #4d6c86; }
.pmc-always {
  flex: none; display: inline-flex; align-items: center; gap: 4px; margin-top: 1px; padding: 4px 10px; border-radius: 999px;
  background: #e5f3ec; color: #296e4a; font-size: .75rem; font-weight: 700; white-space: nowrap;
}

/* Switch: a real checkbox (role=switch) under a custom track, so keyboard and screen readers get the native control. */
.pmc-switch { position: relative; flex: none; display: inline-flex; flex-direction: column; align-items: center; gap: 3px; margin-top: 1px; }
.pmc-switch input { position: absolute; inset: 0 0 auto 0; width: 46px; height: 28px; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.pmc-track {
  position: relative; display: block; width: 46px; height: 28px; border-radius: 999px; background: #d0d8df;
  box-shadow: inset 0 0 0 1px rgba(18, 59, 93, .08); transition: background .2s;
}
.pmc-thumb {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(18, 59, 93, .3); transition: transform .22s cubic-bezier(.3, .7, .3, 1);
}
.pmc-switch input:checked + .pmc-track { background: #2f5d8a; }
.pmc-switch input:checked + .pmc-track .pmc-thumb { transform: translateX(18px); }
.pmc-switch input:focus-visible + .pmc-track { outline: 3px solid #45b5e6; outline-offset: 2px; }
.pmc-switch input:hover + .pmc-track { box-shadow: inset 0 0 0 1px rgba(18, 59, 93, .2); }
.pmc-state { font-size: .6875rem; font-weight: 700; color: #4d6c86; text-transform: uppercase; letter-spacing: .04em; }
.pmc--bn .pmc-state { text-transform: none; letter-spacing: 0; font-size: .75rem; }

.pmc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pmc-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 16px; border-radius: 12px;
  font: inherit; font-size: .9375rem; font-weight: 700; cursor: pointer; line-height: 1.2; text-align: center;
  transition: background .15s, border-color .15s, transform .12s, box-shadow .15s;
}
.pmc-btn:active { transform: translateY(1px); }
.pmc-btn--solid { border: 1px solid #123b5d; background: #123b5d; color: #fff; box-shadow: 0 8px 18px -10px rgba(18, 59, 93, .7); }
.pmc-btn--solid:hover { background: #2f5d8a; border-color: #2f5d8a; }
.pmc-btn--quiet { border: 1px solid #c4ced8; background: #fff; color: #123b5d; }
.pmc-btn--quiet:hover { border-color: #123b5d; background: #f5f8fa; }
.pmc-btn:focus-visible, .pmc-choose:focus-visible, .pmc-x:focus-visible, .pmc-desc a:focus-visible { outline: 3px solid #45b5e6; outline-offset: 2px; }
.pmc-save { grid-column: 1 / -1; }
.pmc-choose {
  grid-column: 1 / -1; justify-self: center; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 6px 12px;
  border: 0; border-radius: 10px; background: none; color: #2f5d8a; font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer;
}
.pmc-choose:hover { color: #123b5d; background: #f1f3f5; }
.pmc-choose[aria-expanded="true"] svg { transform: rotate(180deg); }
.pmc-choose svg { transition: transform .2s; }

.pmc-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 960; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  max-width: min(520px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 14px; background: #123b5d; color: #fff;
  font-size: .9375rem; line-height: 1.4; box-shadow: 0 20px 44px -16px rgba(18, 59, 93, .7); animation: pmc-toast .3s ease-out;
}
.pmc-toast svg { flex: none; color: #8fe0b5; }
.pmc-toast.is-warn svg { color: #ffd479; }
@keyframes pmc-toast { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Phones: a bottom sheet across the full width. The help button steps aside while it is open. */
@media (max-width: 640px) {
  .pmc { left: 0; right: 0; bottom: 0; width: 100%; }
  .pmc-card {
    border-radius: 20px 20px 0 0; padding: 18px 16px calc(14px + env(safe-area-inset-bottom)); max-height: 88vh;
    box-shadow: 0 -18px 50px -20px rgba(18, 59, 93, .5), 0 0 0 1px rgba(18, 59, 93, .08);
    animation-name: pmc-up;
  }
  .pmc-card::before { content: ""; display: block; width: 40px; height: 4px; margin: -6px auto 12px; border-radius: 4px; background: #d0d8df; }
  @keyframes pmc-up { from { transform: translateY(100%); } to { transform: none; } }
  .pmc-desc { font-size: .875rem; margin-bottom: 14px; }
  .pmc-row { padding: 12px; gap: 12px; }
  body.pmc-open .pm-help { display: none; }
  .pmc-toast { bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .pmc-card, .pmc-prefs, .pmc-toast, .pmc.is-leaving .pmc-card { animation: none !important; }
  .pmc-thumb, .pmc-track, .pmc-choose svg { transition: none; }
}
@media print { .pmc, .pmc-toast { display: none !important; } }
