/* Terms popup scroll aid (Claude 2026-12-05). Only applies once terms-scroll.js finds the popup taller than the
   screen (class .ts-box). Ids in the selectors outrank the sites' older !important popup rules. */
#modalDisclaimer .ts-box, #popupOverlay .ts-box {
    display: flex !important; flex-direction: column !important;
    max-height: calc(100vh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
    overflow: hidden !important; box-sizing: border-box !important;
    margin: 0 auto !important;
    padding: 0 !important; gap: 0 !important;
    --ts-accent: #8f63e9;
}
#popupOverlay .ts-box { --ts-accent: #ff7a1a; }
/* the overlay supplies the 12px edge + safe areas, the box takes the rest of the screen */
#modalDisclaimer:has(.ts-box), #popupOverlay:has(.ts-box) {
    padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important;
}
#popupOverlay:has(.ts-box) { place-items: start center; }
.ts-box .ts-head {
    flex: none; margin: 0 !important; padding: 10px 16px; display: flex; align-items: center; gap: 8px;
    font-size: 0.88rem !important; font-weight: 700; line-height: 1.3 !important;
    border-bottom: 1px solid rgba(127, 127, 127, 0.25); color: inherit;
}
.ts-box .ts-head .ts-ico { flex: none; color: var(--ts-accent); }
.ts-box .ts-head:not(.is-done) .ts-ico { animation: ts-nudge 1.4s ease-in-out infinite; }
.ts-box .ts-head.is-done .ts-ico { color: #1f9d55; }
.ts-box .ts-wrap { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.ts-box .ts-body {
    flex: 1 1 auto; min-height: 0; overflow-y: auto !important; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch; padding: 8px 16px 12px; padding-inline-end: 26px;
    scrollbar-width: none;
}
.ts-box .ts-body::-webkit-scrollbar { display: none; }
.ts-box .ts-body:focus-visible { outline: 2px solid var(--ts-accent); outline-offset: -2px; }
.ts-box .ts-track {
    position: absolute; top: 8px; bottom: 8px; inset-inline-end: 6px; width: 8px; border-radius: 8px;
    background: rgba(127, 127, 127, 0.28); touch-action: none; cursor: pointer;
}
.ts-box .ts-thumb { width: 100%; border-radius: 8px; background: var(--ts-accent); cursor: grab; touch-action: none; }
.ts-box .ts-wrap::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 44px; pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--ts-bg, #f7f7fb)); opacity: 0; transition: opacity 0.2s;
}
.ts-box .ts-wrap.ts-more::after { opacity: 1; }
.ts-box .ts-foot {
    flex: none; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(127, 127, 127, 0.25);
}
.ts-box .ts-foot > button, .ts-box .ts-foot > .popup-btn { width: 100%; margin: 0 !important; }
.ts-box.ts-fits .ts-head, .ts-box.ts-fits .ts-track { display: none; }
@keyframes ts-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .ts-box .ts-head .ts-ico { animation: none !important; } }
/* cwifdex.com: the EU analytics consent card (z-index 2147482000) sat on top of the terms popup (Gemini audit 12-06).
   The terms popup goes first; the consent card is still there once the terms are accepted. */
#modalDisclaimer { z-index: 2147482500 !important; }
