/* AlphaDiv mobile-first finishing layer. Shared spacing, legibility and touch targets.
 * App-specific colors/behaviour stay in each page; this is presentation-only.
 */

/* Shared customer-facing typography and footer components. */
body.ui-join,body.ui-deals,body.ui-history{
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
body.ui-join :is(h1,h2,h3,button,a,small,p,input,textarea,select,strong),
body.ui-deals :is(h1,h2,h3,button,a,small,p,input,textarea,select,strong),
body.ui-history :is(h1,h2,h3,button,a,small,p,input,textarea,select,strong){
  font-family:inherit;
}
body.ui-join :is(h1,h2,h3),body.ui-deals :is(h1,h2,h3),body.ui-history :is(h1,h2,h3){font-weight:800;letter-spacing:-.035em}
body.ui-join .eyebrow,body.ui-join .badge,body.ui-join .nav-guide-amount small,
body.ui-deals .rank-eyebrow{font-size:11px;font-weight:750;letter-spacing:.03em;line-height:1.45}
/* One footer layout for Home, Join, Deals, History, Cases and Member.
 * Explicit classes prevent page-specific .footer / .nav collisions. */
.ad-site-footer{
  width:100%;margin:30px 0 0;padding:26px 0 27px;
  display:grid;grid-template-columns:minmax(0,1fr) auto;
  align-items:start;column-gap:32px;row-gap:19px;
  border-top:1px solid #cbd8e3;
  color:#63758a;background:transparent;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:12px;line-height:1.55;box-sizing:border-box;
}
.ad-site-footer :is(a,span,strong,p){font-family:inherit}
.ad-site-footer .ad-footer-logo{
  display:inline-flex;align-items:center;min-height:35px;
  margin:0;color:#173c6e;font-size:27px;line-height:1.15;
  font-weight:950;letter-spacing:-1.5px;text-decoration:none;
}
.ad-site-footer .ad-footer-logo b{color:#ec9713;font-weight:950}
.ad-site-footer .ad-footer-logo:hover{opacity:.86}
.ad-site-footer .ad-footer-brand p{margin:10px 0 0;color:#52657a;font-size:13px;line-height:1.6}
.ad-site-footer .ad-footer-links{
  display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;
  gap:6px 24px;margin:0;padding:0;border:0;
}
.ad-site-footer .ad-footer-links a{
  display:inline-flex;align-items:center;min-height:44px;
  padding:0;color:#173c6e;text-decoration:none;
  font-size:13px;line-height:1.4;font-weight:750;white-space:nowrap;
}
.ad-site-footer .ad-footer-links a:hover{text-decoration:underline;text-underline-offset:4px}
.ad-site-footer .ad-footer-bottom{
  grid-column:1/-1;display:flex;justify-content:space-between;
  gap:9px 26px;flex-wrap:wrap;margin:0;padding:17px 0 0;
  border-top:1px solid #cbd8e3;color:#52657a;font-size:11px;line-height:1.6;
}
body.ui-deals .ad-site-footer,body.ui-history .ad-site-footer{
  max-width:1120px;width:calc(100% - 32px);margin:30px auto 0;
}
body.ui-cases .ad-site-footer{
  max-width:1100px;width:calc(100% - 28px);margin:24px auto;
  padding:24px 22px;border:1px solid #cbd8e3;border-radius:16px;background:#e9eef3;
}
body.ui-history[data-scope="admin"] .ad-site-footer{display:none}
@media(max-width:760px){
  /* Deliberate two-column navigation instead of unpredictable flex wrapping. */
  .ad-site-footer{
    grid-template-columns:minmax(0,1fr);column-gap:0;row-gap:14px;
    margin-top:26px;padding-top:22px;padding-bottom:24px;
    min-width:0;overflow-wrap:anywhere;
  }
  .ad-site-footer .ad-footer-logo{font-size:27px}
  .ad-site-footer .ad-footer-brand p{margin-top:6px;font-size:13px}
  .ad-site-footer .ad-footer-links{
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
    justify-content:stretch;align-items:stretch;gap:4px 12px;
    width:100%;min-width:0;
  }
  .ad-site-footer .ad-footer-links a{
    display:flex;align-items:center;justify-content:flex-start;
    min-width:0;min-height:44px;white-space:normal;
    padding:6px 0;font-size:14px;line-height:1.4;
  }
  .ad-site-footer .ad-footer-bottom{
    flex-direction:column;align-items:flex-start;gap:7px;
    min-width:0;padding-top:14px;font-size:12px;line-height:1.65;
  }
  body.ui-cases .ad-site-footer{padding:22px 16px 24px}
  /* Fixed four-item Member bottom navigation must not cover footer content. */
  body.ui-member:has(#member-app:not([hidden])) .ad-site-footer{
    margin-bottom:calc(92px + env(safe-area-inset-bottom, 0px));
  }
}

:root{--ux-tap:44px;--ux-gap:12px;--ux-radius:14px}
body.ui-home,body.ui-join,body.ui-member,body.ui-performance,body.ui-deals,body.ui-history{font-family:Manrope,Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
body.ui-home :is(a,button,summary,input,select,textarea):focus-visible,
body.ui-join :is(a,button,summary,input,select,textarea):focus-visible,
body.ui-member :is(a,button,summary,input,select,textarea):focus-visible,
body.ui-performance :is(a,button,summary,input,select,textarea):focus-visible,
body.ui-deals :is(a,button,summary,input,select,textarea):focus-visible,
body.ui-history :is(a,button,summary,input,select,textarea):focus-visible{outline:3px solid #d39a23;outline-offset:3px}
body.ui-home .home-mobile-menu{display:none}
html{scroll-padding-top:75px}
@media(max-width:760px){
  /* Home: one predictable single-row header, expandable accessible nav. */
  body.ui-home>.shell>.top{position:sticky;top:0;z-index:80;display:flex;flex-direction:row;align-items:center;justify-content:space-between;min-height:66px;gap:10px;padding:10px 0;background:var(--bg,var(--surface));border-bottom:1px solid var(--line)}
  body.ui-home>.shell>.top>.nav{display:none}
  body.ui-home .home-mobile-menu{display:block;position:relative;flex:none}
  body.ui-home .home-mobile-menu>summary{list-style:none;display:flex;align-items:center;justify-content:center;gap:9px;min-height:44px;min-width:90px;padding:8px 13px;border:1px solid var(--line-strong);border-radius:11px;background:var(--surface);color:var(--navy);font-weight:850;font-size:14px;cursor:pointer}
  body.ui-home .home-mobile-menu>summary::-webkit-details-marker{display:none}
  body.ui-home .home-mobile-menu[open]>summary{border-color:#8fa8c2}
  body.ui-home .home-mobile-links{position:absolute;top:calc(100% + 10px);right:0;z-index:90;width:min(290px,calc(100vw - 32px));padding:9px;background:var(--surface);border:1px solid var(--line-strong);border-radius:15px;box-shadow:0 22px 44px rgba(20,37,58,.18);display:grid;gap:3px}
  body.ui-home .home-mobile-links>a{display:flex;align-items:center;padding:11px 13px;min-height:44px;border-radius:9px;color:var(--navy);text-decoration:none;font-size:14px;font-weight:750}
  body.ui-home .home-mobile-links>a:hover,body.ui-home .home-mobile-links>a:focus-visible{background:var(--surface2,var(--surface))}
  body.ui-home .home-mobile-links>a[data-member-guest-only]{background:#153b6d;color:#fff}
  body.ui-home>.shell .hero{padding:35px 0 25px;gap:19px}
  body.ui-home>.shell .hero h1{font-size:clamp(28px,8.2vw,42px);line-height:1.1;letter-spacing:-.058em;margin:12px 0 16px}
  body.ui-home .hero-copy{font-size:15px;line-height:1.65}
  body.ui-home .hero-note{font-size:12px}
  body.ui-home .hero-card{padding:20px;border-radius:16px}
  body.ui-home .live-count strong{font-size:clamp(58px,18vw,78px)}
  body.ui-home .screening-value{padding:27px 0 30px}
  body.ui-home .screening-intro{margin-bottom:18px}
  /* Keep the three-stage explanation scannable rather than 3 full-size cards. */
  body.ui-home .funnel-stage{min-height:0;padding:15px 16px 15px}
  body.ui-home .funnel-dots,body.ui-home .funnel-filter-mark,body.ui-home .funnel-short-lines{display:none}
  body.ui-home .funnel-connector{height:14px;font-size:16px}
  body.ui-home .funnel-stage>p{font-size:13px}
  body.ui-home .funnel-stage>span{font-size:11px}
  body.ui-home .funnel-connector{height:19px;font-size:19px}
  body.ui-home .steps{gap:10px}
  body.ui-home .step,body.ui-home .join-route{padding:18px}
  body.ui-home .step p,body.ui-home .join-route p,body.ui-home .deal-copy p,body.ui-home .evidence-main>p{font-size:13px;line-height:1.65}
  body.ui-home .join{margin:18px 0 0;padding:27px 17px 32px;border-radius:18px}
  body.ui-home .join-route{min-width:0}
  body.ui-home .evidence-num span{font-size:11px}
  body.ui-home .evidence-num small,body.ui-home .evidence-disclaimer{font-size:11px}
  body.ui-home :is(.btn,.join-route-link,.join-login,.evidence-link,.screening-foot a,.hero-live-link){min-height:44px;display:inline-flex;align-items:center}
  /* Public enrollment: no 12px mobile form inputs, 44px+ controls, short cards. */
  body.ui-join .shell{padding-inline:16px}
  body.ui-join .top{gap:10px;min-height:65px}
  body.ui-join .top .join-header-links{gap:8px}
  body.ui-join .top .back{display:inline-flex;align-items:center;min-height:44px;font-size:13px}
  body.ui-join .hero{padding:34px 0 22px;gap:17px}
  body.ui-join .hero h1{font-size:clamp(35px,9vw,46px);line-height:1.05}
  body.ui-join .hero p{font-size:15px}
  body.ui-join .hero-note{padding:17px}
  body.ui-join .hero-note span,body.ui-join .nav-guide p,body.ui-join .nav-guide-amount span,body.ui-join .choice p,body.ui-join .benefit-card li,body.ui-join .careby-alternative p{font-size:13px;line-height:1.65}
  body.ui-join .benefit-section,body.ui-join .choice,body.ui-join .payment-info,body.ui-join .qr-card{padding:17px}
  body.ui-join .section{padding:31px 0}
  body.ui-join .section-head{gap:10px}
  body.ui-join .section-head h2{font-size:clamp(28px,7.5vw,39px)}
  body.ui-join .route-grid{margin-bottom:28px}
  body.ui-join .route{padding:20px;min-height:0}
  body.ui-join .route h2{margin-top:16px;font-size:25px}
  body.ui-join .plans{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  body.ui-join .plan{min-height:110px;padding:13px 11px}
  body.ui-join .plan small,body.ui-join .plan span,body.ui-join .plan em,body.ui-join .field label{font-size:12px;line-height:1.5}
  body.ui-join .plan strong{font-size:clamp(17px,5vw,23px);overflow-wrap:anywhere}
  body.ui-join .cta,body.ui-join .copy-btn,body.ui-join .nav-guide-amount a,body.ui-join .support a{min-height:44px;display:inline-flex;align-items:center;justify-content:center;font-size:14px}
  body.ui-join .field input,body.ui-join .field textarea{font-size:16px;line-height:1.35;min-height:48px}
  body.ui-join .field textarea{min-height:92px}
  body.ui-join .form-actions .cta,body.ui-join .payment-actions .cta{width:100%}
  body.ui-join .bank-row span,body.ui-join .bank-row b{font-size:13px;overflow-wrap:anywhere}
  body.ui-join .nav-guide-amount strong{overflow-wrap:anywhere;font-size:clamp(28px,8vw,37px)}
  body.ui-join .careby-alternative{flex-wrap:wrap;gap:12px}
  body.ui-join .careby-alternative a{white-space:normal}
  body.ui-join .decision-note{flex-wrap:wrap}
  /* Member: readable live data and fast access to frequently used screens. */
  body.ui-member .ad-top{min-height:62px;flex-direction:row;align-items:center;gap:9px;padding:10px 0}
  body.ui-member .ad-nav{width:auto;gap:9px;justify-content:flex-end;min-width:0}
  body.ui-member .ad-nav>#history-link,body.ui-member .ad-nav>#header-support-link,body.ui-member .ad-nav>a[href="/"]{display:none}
  body.ui-member .ad-nav .ad-btn{min-height:44px;font-size:12px;padding:8px 10px}
  body.ui-member .bell-btn{min-height:44px;min-width:44px}
  body.ui-member .member-hero{padding:20px 0 13px}
  body.ui-member .member-hero h1{font-size:clamp(27px,7.5vw,34px);line-height:1.14}
  /* Footer provides the scroll clearance; avoid a second 116px blank spacer. */
  body.ui-member .member-app{padding-bottom:26px}
  body.ui-member .member-jump{padding:11px 12px;gap:9px}
  body.ui-member .member-jump strong{font-size:11px}
  body.ui-member .member-jump .links{display:flex;flex-wrap:nowrap;overflow-x:auto;width:100%;scrollbar-width:thin;gap:7px;-webkit-overflow-scrolling:touch}
  body.ui-member .member-jump a{white-space:nowrap;min-height:44px;display:inline-flex;align-items:center;font-size:13px;padding:9px 13px}
  body.ui-member .member-app .section{margin-top:25px}
  body.ui-member .member-app .section-head h2{font-size:clamp(23px,6vw,28px)}
  body.ui-member .member-app .section-head p,body.ui-member .membership-advice p{font-size:13px;line-height:1.6}
  body.ui-member .position{padding:16px}
  body.ui-member .member-app .mini span{font-size:12px}
  body.ui-member .member-app .mini b{font-size:14px}
  body.ui-member .member-app .position-title span,body.ui-member .member-app .position-perf span,body.ui-member .member-app .event,body.ui-member .member-app .signal .kind,body.ui-member .member-app .signal .day,body.ui-member .member-app .signal .value{font-size:13px}
  body.ui-member .member-app .news-info,body.ui-member .member-app .news-insight,body.ui-member .member-app .benefit p{font-size:13px}
  /* Fixed to the VISUAL viewport, not the bell's small header box.
     The former negative right offset caused clipping on iOS Safari. */
  body.ui-member .notification-panel{
    position:fixed;
    left:max(12px,env(safe-area-inset-left,0px));
    right:max(12px,env(safe-area-inset-right,0px));
    top:max(12px,env(safe-area-inset-top,0px));
    bottom:auto;
    width:auto;
    min-width:0;
    max-width:none;
    max-height:calc(100vh - 114px);
    max-height:min(70dvh,calc(100dvh - 112px - env(safe-area-inset-bottom,0px)));
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    z-index:120;
    padding:12px;
    border-radius:16px;
    box-sizing:border-box;
  }
  body.ui-member .notification-head{
    position:sticky;
    top:0;
    z-index:1;
    min-width:0;
    background:var(--ad-surface);
    border-bottom:1px solid #dce4eb;
    padding:8px 2px 11px;
  }
  body.ui-member .notification-head strong{font-size:15px;line-height:1.4;min-width:0}
  body.ui-member #notification-close{min-width:58px;min-height:44px;flex-shrink:0}
  body.ui-member .notification-pref{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px 9px;
    padding:8px 0;
    min-width:0;
  }
  body.ui-member .notification-pref label{
    min-width:0;
    overflow-wrap:anywhere;
    font-size:12px;
    line-height:1.4;
    gap:7px;
  }
  body.ui-member .notification-pref input{flex:none}
  body.ui-member .notification-item{
    grid-template-columns:50px minmax(0,1fr);
    gap:3px 9px;
    min-width:0;
    padding:9px 2px;
    font-size:12px;
  }
  body.ui-member .notification-item .n-ticker{font-size:12px}
  body.ui-member .notification-item .n-main{font-size:12px;line-height:1.45;overflow-wrap:anywhere}
  body.ui-member .notification-item .n-time{
    grid-column:2;
    font-size:11px;
    justify-self:start;
    line-height:1.3;
    color:#62758a;
  }
  body.ui-member .notification-news strong{font-size:12px;overflow-wrap:anywhere}
  body.ui-member .notification-news span{font-size:11px}
  body.ui-member .notification-section h4{font-size:11px}
  body.ui-member .notification-empty{font-size:12px}
  body.ui-member .ad-field input,body.ui-member .ad-field select,body.ui-member .ad-field textarea{font-size:16px;min-height:48px}
  body.ui-member .auth-card p,body.ui-member .ad-field label{font-size:13px;line-height:1.6}
  body.ui-member .ad-btn{min-height:44px}
  body.ui-member .member-footer{font-size:12px;line-height:1.65}
  body.ui-member .membership-advice{margin-top:20px}
  body.ui-member .membership-advice-actions .ad-btn{font-size:13px}
  body.ui-member .member-bottom-nav{position:fixed;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:center;left:0;right:0;bottom:0;z-index:100;gap:2px;padding:8px max(9px,env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(9px,env(safe-area-inset-right));background:rgba(247,249,252,.97);border-top:1px solid #c9d6e3;box-shadow:0 -10px 25px rgba(15,33,56,.09);backdrop-filter:blur(10px)}
  body.ui-member .member-bottom-nav a{min-height:52px;display:flex;flex-direction:column;gap:3px;align-items:center;justify-content:center;border-radius:10px;text-decoration:none;font-size:12px;color:#294d72;font-weight:800}
  body.ui-member .member-bottom-nav a:focus-visible,body.ui-member .member-bottom-nav a:hover{background:#e8f1fa}
  body.ui-member .member-bottom-nav a span{font-size:18px;line-height:1}
  /* Detailed performance, archive and historical proof remain readable. */
  body.ui-performance .nav{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:12px;max-width:100%;-webkit-overflow-scrolling:touch}
  body.ui-performance .nav a{white-space:nowrap;min-height:44px;display:inline-flex;align-items:center;font-size:13px}
  body.ui-performance .year-lens{scrollbar-width:thin;max-width:100%}
  body.ui-performance .year-pill,body.ui-performance .fast-sort{min-height:44px;display:inline-flex;align-items:center;justify-content:center;font-size:13px}
  body.ui-performance :is(.kpi small,.fact small,.upside-card p,.entry-stats small,.entry-stats span,.downside-number small,.method-card p,.foot,.scope-note){font-size:12px;line-height:1.6}
  body.ui-performance .entry-disclosure,body.ui-performance .fast-deals-footer{font-size:12px;line-height:1.65}
  body.ui-deals .filter input{min-width:0;width:min(250px,100%);font-size:16px}
  body.ui-deals .filter button,body.ui-deals #more,body.ui-deals .segmented button{min-height:44px}
  body.ui-deals .nav-links a{min-height:44px;display:inline-flex;align-items:center;font-size:13px}
  body.ui-deals .deal .dates,body.ui-deals .deal .counts,body.ui-deals .deal .day,body.ui-deals .deal .value{font-size:13px;line-height:1.55}
  body.ui-history .scroll{max-width:100%;-webkit-overflow-scrolling:touch}
  body.ui-history :is(input,button,select){font-size:16px;min-height:44px}
}
@media(min-width:761px){body.ui-member .member-bottom-nav{display:none}}
@media(max-width:350px){
 body.ui-home .home-mobile-menu>summary{min-width:74px;padding:8px}
 body.ui-join .plans{grid-template-columns:1fr}
 body.ui-join .join-header-links .back{font-size:12px}
 body.ui-member .member-bottom-nav a{font-size:11px}
}
@media(prefers-reduced-motion:reduce){body.ui-home .home-mobile-links,body.ui-member .member-bottom-nav{scroll-behavior:auto}}
