/* SPD YAPI V9 — consolidated mobile/legal/intro refinements */
/* Opening: disable all floating overlays while the intro is present, INCLUDING its first paint. */
html.spd-intro-active body .spd-contact-dock,
html.spd-intro-active body #spd-offer-popup,
html.spd-intro-active body #spd-offer-tab,
body:has(#spd-first-intro:not(.spd-intro-hide)) .spd-contact-dock,
body:has(#spd-first-intro:not(.spd-intro-hide)) #spd-offer-tab,
body:has(#spd-first-intro:not(.spd-intro-hide)) #spd-offer-popup{
  opacity:0!important;visibility:hidden!important;pointer-events:none!important;
}
/* The original high-resolution logo is used without raster upscaling or image effects. */
#spd-first-intro .spd-intro-logo{
  display:block!important;width:min(82vw,720px)!important;
  max-width:100%!important;max-height:none!important;height:auto!important;
  object-fit:contain!important;image-rendering:auto!important;
  filter:drop-shadow(0 5px 17px rgba(174,220,194,.11))!important;
  opacity:1!important;
}
#spd-first-intro .spd-intro-inner{gap:11px!important}
#spd-first-intro .spd-intro-rule{margin-top:-7px!important}
#spd-first-intro .spd-intro-caption{margin-top:-5px!important;line-height:1.35!important}
@media(max-width:650px){
  #spd-first-intro .spd-intro-logo{width:min(90vw,540px)!important}
  #spd-first-intro .spd-intro-inner{gap:8px!important}
}

/* Legal pages: enforce spacing INSIDE the reading container, not only on main.
   This also accounts for the sticky site header overlapping the first eyebrow. */
body.legal-page main{padding-top:clamp(80px,7vw,120px)!important}
body.legal-page main :is(.legal-page-wrap,.legal-content,.page-content,.legal-article,.policy-article,.legal-section,.section):first-child{scroll-margin-top:150px!important}
@media(max-width:900px){
  body.legal-page main{padding-top:120px!important}
  body.legal-page main > :first-child{margin-top:0!important}
}
@media(max-width:650px){
  body.legal-page main{padding-top:126px!important}
  body.legal-page main :is(.legal-intro,.article-header,.page-heading,.section-eyebrow):first-child{margin-top:0!important}
}

/* Popup: dock closer to the mobile bottom-right, instead of obscuring hero centre. */
@media(max-width:650px){
  body #spd-offer-popup{
    right:7px!important;
    bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;
    width:min(304px,calc(100vw - 20px))!important;
    max-width:calc(100vw - 20px)!important;
    box-sizing:border-box!important;
  }
  body #spd-offer-popup .spd-offer-popup-close{top:10px!important;right:10px!important}
  body #spd-offer-tab{right:0!important;bottom:calc(110px + env(safe-area-inset-bottom,0px))!important}
}

/* 'YUKARI': on small screens use a clean borderless text+arrow, leave policy links intact. */
@media(max-width:650px){
  body .site-footer .footer-toplink,
  body .site-footer a.footer-toplink{
    border:0!important;outline:0!important;border-radius:0!important;
    box-shadow:none!important;background:transparent!important;
    padding:8px 12px!important;min-height:30px!important;
  }
}
