/* FINAL v2 gate - 1708:311 (1440), 1708:573 (390).
 * Existing research-use copy and Enter/Leave behaviour remain pending owner input. */

/* Preserve the page's existing short-page flex layout through the inert wrapper. */
body > [data-usr-age-background] > #usr-main { flex: 1 0 auto; }
body > [data-usr-age-background] > #usr-main:has(> .usr-trust-strip:last-child) { display: flex; flex-direction: column; }
body > [data-usr-age-background] > #usr-main > .usr-trust-strip:last-child { margin-top: auto; }

.usr-gate {
  position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  padding: 24px; overflow-y: auto; overscroll-behavior: contain; background: transparent; color: #191919;
}
html[data-usr-age-required]:not(.usr-age-ok),
html[data-usr-age-required]:not(.usr-age-ok) body { overflow: hidden; }
html.usr-age-ok .usr-gate, .usr-gate[hidden] { display: none; }
.usr-gate__card {
  position: relative; z-index: 2; flex: 0 0 auto; box-sizing: border-box; width: 520px; max-width: 100%; margin: max(0px, calc(50dvh - 220px)) auto auto; padding: 40px 44px 36px; border-radius: 22px; background: #fdf8f0; outline: none;
}
.usr-gate__scrim { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: rgba(19, 38, 107, .72); }
.usr-gate__card * { min-width: 0; overflow-wrap: anywhere; }
.usr-gate__card:focus, .usr-gate__card:focus-visible { outline: none !important; box-shadow: none !important; }
.usr-gate__brand { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 24px; text-align: center; }
.usr-gate__logo { width: 190px; height: 34px; max-width: 100%; }
.usr-gate__logo img { display: block; width: 190px; height: 34px; max-width: 100%; object-fit: contain; }
.usr-gate .usr-gate__tagline { color: #4a4a4a; font-size: 18px; font-weight: 400; line-height: 27px; letter-spacing: 0; }
.usr-gate__state { display: flex; flex-direction: column; gap: 16px; }
.usr-gate__state[hidden] { display: none; }
.usr-gate :is(p, h2) { margin: 0; }
.usr-gate__title { color: #13266b; font-size: 24px; font-weight: 500; line-height: 30px; letter-spacing: 0; text-wrap: balance; outline: none; }
.usr-gate__desc { color: #4a4a4a; font-size: 15px; font-weight: 400; line-height: 23px; }
.usr-gate__confirm { color: #191919; font-size: 15px; line-height: 23px; }
.usr-gate__actions { display: flex; gap: 12px; }
.usr-gate__btn {
  display: inline-flex; flex: 1 1 0; align-items: center; justify-content: center; box-sizing: border-box; min-height: 48px; margin: 0; padding: 9px 24px;
  border: 1px solid #13266b; border-radius: 999px; background: #13266b; color: #fff; font-family: inherit; font-size: 18px; font-weight: 500; line-height: 27px; cursor: pointer;
}
.usr-gate__btn:hover { background: #0e1d52; }
.usr-gate__btn--ghost { background: transparent; color: #13266b; }
.usr-gate__btn--ghost:hover { background: #f1f5ff; }
.usr-gate :is(button, a):focus-visible { outline: 2px solid #264bd0; outline-offset: 3px; }
.usr-gate__links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; line-height: 20px; }
.usr-gate__links a { display: inline-flex; align-items: center; min-height: 44px; color: #13266b; text-decoration: underline; text-underline-offset: 2px; }
.usr-gate__back {
  display: inline-flex; align-items: center; align-self: flex-start; min-height: 44px; gap: 8px; margin: 0; padding: 0; border: 0; background: none;
  color: #13266b; font-family: inherit; font-size: 15px; line-height: 23px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.usr-gate__back svg { flex: 0 0 16px; }

@media (max-width: 520px) {
  .usr-gate { padding: 20px; }
  .usr-gate__card { width: 350px; margin-top: max(0px, min(calc(50dvh - 205px), calc(100dvh - 577px))); padding: 28px 22px 26px; }
  .usr-gate__actions { flex-direction: column; gap: 10px; }
  .usr-gate__btn { flex: none; width: 100%; }
  .usr-gate__links { justify-content: center; gap: 8px 16px; }
}

/* Same local gradient and drawn pack as the catalog fallback, fitted to the logo slot. */
.usr-gate__logo-placeholder { display: flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box; width: 190px; max-width: 100%; height: 34px; padding: 0 8px; border-radius: 6px; background: linear-gradient(145deg, #fff 10%, #ecf3ff 100%); color: #4a4a4a; }
.usr-gate__logo-placeholder::before { content: ""; flex: 0 0 auto; box-sizing: border-box; width: 20px; height: 26px; border: 1px solid #b5c0dd; border-radius: 4px; background: linear-gradient(#b5c0dd, #b5c0dd) center 9px / 12px 1px no-repeat, linear-gradient(#b5c0dd, #b5c0dd) center 13px / 8px 1px no-repeat, #fff; }
.usr-gate__logo-placeholder__note { min-width: 0; max-width: 144px; color: #4a4a4a; font-size: 12px; font-weight: 400; line-height: 15px; letter-spacing: 0; text-align: left; overflow-wrap: anywhere; }
