.newsletter-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 26, 72, .58);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .18s ease;
}
.newsletter-overlay[hidden] { display: none; }
.newsletter-overlay.open { opacity: 1; }
body.newsletter-open { overflow: hidden; }

.newsletter-window {
  width: min(610px, 100%);
  max-height: min(760px, calc(100vh - 28px));
  overflow: hidden;
  color: #153f67;
  border: 1px solid rgba(255,255,255,.96);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(249,253,255,.98), rgba(218,240,250,.97));
  box-shadow: 0 30px 85px rgba(0,29,78,.48), inset 0 1px #fff;
  transform: translateY(14px) scale(.985);
  transition: transform .18s ease;
}
.newsletter-overlay.open .newsletter-window { transform: none; }

.newsletter-titlebar {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 14px;
  color: white;
  background:
    linear-gradient(180deg, rgba(91,177,235,.96), rgba(15,94,165,.98) 49%, rgba(10,72,139,.99) 51%, rgba(24,106,178,.98));
  border-bottom: 1px solid #174f8c;
  box-shadow: inset 0 1px rgba(255,255,255,.8), inset 0 -1px rgba(0,30,89,.55);
  text-shadow: 0 1px 2px #003a74;
}
.newsletter-titlebar > span { display: flex; align-items: center; gap: 9px; }
.newsletter-title-icon { width: 24px; height: 24px; }
.newsletter-close {
  position: relative;
  width: 50px;
  align-self: stretch;
  border: 0;
  border-left: 1px solid rgba(255,255,255,.3);
  border-radius: 0 9px 0 0;
  cursor: pointer;
  background: linear-gradient(#ef817c, #b72f2a 52%, #d74f48 53%, #9d211f);
  box-shadow: inset 0 1px rgba(255,255,255,.78);
}
.newsletter-close::before,
.newsletter-close::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 20px;
  width: 16px;
  height: 2px;
  background: white;
  border-radius: 2px;
  box-shadow: 0 1px #6f1111;
}
.newsletter-close::before { transform: rotate(45deg); }
.newsletter-close::after { transform: rotate(-45deg); }

.newsletter-body {
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 25px 28px 27px;
}
.newsletter-intro {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}
.newsletter-intro img { width: 58px; height: 58px; }
.newsletter-intro p { margin: 0; color: #315d7d; }

#newsletter-form label:not(.newsletter-consent):not(.newsletter-honeypot) {
  display: grid;
  gap: 6px;
  color: #173f69;
  font-size: .8rem;
  font-weight: 800;
}
#newsletter-form input[type="email"],
#newsletter-form input[type="text"] {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  color: #143d63;
  background: rgba(255,255,255,.94);
  border: 1px solid #8baec8;
  border-radius: 4px;
  box-shadow: inset 0 1px 3px rgba(0,52,96,.1), 0 1px #fff;
}
#newsletter-form input:focus {
  border-color: #1689d4;
  outline: 2px solid rgba(32,164,231,.28);
  outline-offset: 1px;
}
.newsletter-name-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-top: 14px;
}
.newsletter-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin: 18px 0 15px;
  color: #315b79;
  font-size: .78rem;
  line-height: 1.45;
}
.newsletter-consent input { width: 18px; height: 18px; margin: 1px 0 0; }
.newsletter-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
.newsletter-turnstile {
  min-height: 65px;
  display: grid;
  place-items: center;
  margin: 6px 0 9px;
  color: #657c8e;
  font-size: .75rem;
}
.newsletter-feedback {
  min-height: 25px;
  margin: 8px 0 3px;
  color: #38617f;
  font-size: .8rem;
}
.newsletter-feedback[data-kind="error"] { color: #a42520; }
.newsletter-feedback[data-kind="loading"] { color: #075f9c; }
.newsletter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 13px;
  padding-top: 8px;
}
.newsletter-actions .button { min-width: 124px; min-height: 43px; padding-block: 7px; }
.newsletter-actions .button.is-loading::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: white;
  border-radius: 50%;
  animation: newsletter-spin .7s linear infinite;
}
.newsletter-cancel {
  min-width: 83px;
  min-height: 38px;
  color: #214f73;
  border: 1px solid #819eb8;
  border-radius: 5px;
  cursor: pointer;
  background: linear-gradient(#fff,#e6eef4 48%,#d8e5ee 52%,#f8fbfd);
  box-shadow: inset 0 1px #fff, 0 1px 2px rgba(0,51,91,.14);
}
.newsletter-success { padding: 15px 10px 7px; text-align: center; }
.newsletter-success > img { width: 68px; height: 68px; }
.newsletter-success h2 { margin: 9px 0; font-size: 2rem; }
.newsletter-success p { max-width: 430px; margin: 8px auto; color: #315d7d; }
.newsletter-success strong {
  display: inline-block;
  margin: 5px 0 8px;
  padding: 7px 13px;
  color: #075d9b;
  border: 1px solid #9dd6ee;
  border-radius: 6px;
  background: #eefbff;
}
.newsletter-success .button { margin-top: 14px; }
.newsletter-confirmed-card { max-width: 720px; margin: auto; padding: 42px; border-radius: 24px; text-align: center; }
.newsletter-confirmed-card > img { width: 90px; }
.newsletter-confirmed-card h1 { font-size: clamp(2.5rem, 7vw, 4.8rem); }
.github-link-outage { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; max-width: 100%; }
.github-action-disabled { color: #8a9eac !important; cursor: not-allowed; filter: grayscale(.45); text-decoration: none !important; }
.github-outage-message {
  color: #805d18;
  font-size: .66rem;
  font-weight: 650;
  line-height: 1.3;
}
.nav-links .github-link-outage { justify-content: center; }
.nav-links .github-outage-message { max-width: 175px; color: #fff2bd; text-align: left; }
.markdown .github-link-outage { vertical-align: middle; }
.markdown .github-outage-message { display: inline; }
.github-login-disabled { opacity: .58; cursor: not-allowed; }
@keyframes newsletter-spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .newsletter-overlay { padding: 8px; align-items: end; }
  .newsletter-window { max-height: calc(100vh - 12px); border-radius: 9px 9px 0 0; }
  .newsletter-body { padding: 20px 17px 23px; }
  .newsletter-name-grid { grid-template-columns: 1fr; }
  .newsletter-intro { grid-template-columns: 46px 1fr; }
  .newsletter-intro img { width: 46px; height: 46px; }
  .newsletter-actions { align-items: stretch; flex-direction: column; }
  .newsletter-actions .button,
  .newsletter-cancel { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .newsletter-overlay,
  .newsletter-window { transition: none; }
  .newsletter-actions .button.is-loading::before { animation-duration: 1.2s !important; }
}

