/* =====================================================================
   ss-responsive.css: shared touch and phone rules
   Loaded last on every public page (Index, sitepage, PrivacyPolicy).
   Nothing here applies to a desktop mouse at any width, so the laptop
   and big-screen layouts are untouched. See docs/RESPONSIVE-QA.md.
   ===================================================================== */

/* ---------- iOS safe area on the fixed bottom bars ---------- */
.ss-sticky .inner{padding-bottom:max(14px,env(safe-area-inset-bottom))}
.pg-stickybar-in{padding-bottom:max(10px,env(safe-area-inset-bottom))}
/* keep the end of the page clear of a sticky bar once it is showing */
body:has(.ss-sticky.show),
body:has(.pg-stickybar.is-on){padding-bottom:76px}

/* ---------- long addresses never break mid-word ---------- */
a[href^="mailto:"]{overflow-wrap:anywhere;word-break:normal}

/* =====================================================================
   Tap targets: 44x44 on touch screens (phones and tablets)
   Where the layout must not move, the hit area grows with padding and
   the same negative margin, so the box gets bigger but nothing shifts.
   ===================================================================== */
@media (pointer:coarse){
  /* header */
  .ss-logo{padding-block:11px;margin-block:-11px}
  .ss-util-link,.ss-util-phone{display:inline-flex;align-items:center;min-height:44px;margin-block:-14px}

  /* breadcrumbs and inline meta links */
  .cp-crumb a,.pg-crumb a,.ab-crumb a,
  .pmeta a,.pg-elig-name,.pg-elig-link,.legal p > a{
    display:inline-flex;align-items:center;min-height:44px;margin-block:-14px;
    padding-inline:4px;margin-inline:-4px}
  .cp-crumb a,.pg-crumb a,.ab-crumb a{min-width:44px;justify-content:center}
  .cp-paper-t{display:block;padding-block:11px;margin-block:-11px}
  td > a.cp-table-link{display:inline-flex;align-items:center;min-height:44px}

  /* buttons, tabs and toggles */
  .ss-btn,.pg-btn,.pg-contact,.sf-apply,
  .cp-papers-tab,.ss-switch-cat,.pg-po-tab,.pg-elig-tab,.cp-price-toggle button,
  .dir-play,.cp-profile-li,.cp-links > a{min-height:44px}
  .fac-toplink{display:inline-flex;align-items:center;min-height:44px;margin-block:-8px}
  .hero-rot__dot{min-height:44px;margin-block:-8px}
  .hero-rot__pause{width:44px;height:44px;margin:-6px}
  .cp-track-nav button,.alr-sound,.alr-sound-ready .alr-sound,.dir-soc,.sf-social a,.cp-li-ico,
  .cp-links a.cp-li-ico{width:44px;height:44px}
  .ab-scrollcue{min-width:44px}

  /* footer */
  .sf-col a{display:flex;align-items:center;min-height:44px;padding-block:0}
  .sf-contact a{display:inline-flex;align-items:center;min-height:44px;margin-block:-13px}
}

/* =====================================================================
   Type on phones (portrait, and phones held sideways)
   Running copy is at least 16px. Notes, captions, legends and consent
   lines are secondary text with a 14px floor.
   ===================================================================== */
@media (max-width:600px),(pointer:coarse) and (max-height:500px){
  /* running copy */
  .cp-li > p,.pg-card > p,.cp-tl-body > p,.cp-sublead,.b-desc,.cp-step > p,
  .pg-po-list > li,.cp-profile-list > li,.b-tracks > li,.pg-bcell-text,.why6-t,
  .pg-elig-item > p,.pg-enquiry > p:not(.pg-consent),.pg-sticky-t,.allstar-hero__card-desc,
  .cbody > p,.ss-rlab-card > p,.ab-vm-txt,.ab-plan-x,.cp-kit-txt,.alr-lead,.alr-sub > p,
  details > p,.ab-cred-lead,.cp-price-note > p,.dir-bio,.pg-report-t,.pg-elig-routelead,
  .pg-elig-detail,.cp-score-note,.ss-faq2-list details p,.pg-elig-steps p,.cp-partner li{font-size:16px;line-height:1.55}
  table td,.cp-table tbody td,.pg-otable td{font-size:16px}

  /* secondary text: 14px floor */
  .cp-paper-j,.cp-profile-qual,.ss-fork-note,.pg-note,.pg-elig-note,.pg-po-note,
  .ss-stack-legend,.ss-stack-note,.sk-ladder-note,.pg-otable-cap,.pg-rf-consent,
  .allstar-hero__eyebrow,.allstar-hero__note{font-size:14px;line-height:1.5}
}

/* =====================================================================
   Phone shell (900px and below)
   One compact header row, no section tabs, and one bottom bar per page
   that never stacks and carries the chat. Desktop is untouched.
   ===================================================================== */
.ss-mbar{display:none}
@media (max-width:900px){
  /* the top bar's phone line and SIU link live at the top of the menu drawer */
  .ss-util{display:none}
  /* header: 64px at rest, 56px once the page moves (nav-mega.js: .is-compact) */
  .ss-nav-inner{height:64px;transition:height .25s var(--ease)}
  .ss-nav.is-compact .ss-nav-inner{height:56px}
  /* "on this page" tabs: on a phone they only covered the content */
  .ss-secnav{display:none!important}

  /* ---- home lead bar: one row, equal buttons ---- */
  .ss-sticky .inner{padding:10px 16px max(10px,env(safe-area-inset-bottom));justify-content:stretch}
  .ss-sticky .acts{flex-wrap:nowrap;width:100%;gap:10px}
  .ss-sticky .acts > *{flex:1 1 0;min-width:0}
  .ss-sticky .acts .ss-btn{justify-content:center;min-height:48px;padding:0 14px;font-size:15px;font-weight:600;white-space:nowrap}
  /* Apply sits at the top of the menu drawer on phones, not in this bar */
  .ss-sticky .acts .ss-btn-primary{display:none}

  /* ---- programme apply bar ---- */
  .pg-stickybar-in{gap:12px;padding:8px 16px max(8px,env(safe-area-inset-bottom))}
  .pg-stickybar-cta{flex:1 1 auto;justify-content:flex-end;gap:8px;min-width:0}
  .pg-stickybar .pg-btn-primary{min-height:46px;justify-content:center;white-space:nowrap}

  /* ---- shared call bar (pages without a bar of their own) ---- */
  .ss-mbar{display:block;position:fixed;left:0;right:0;bottom:0;z-index:115;
    background:rgba(255,255,255,.94);-webkit-backdrop-filter:blur(14px) saturate(160%);backdrop-filter:blur(14px) saturate(160%);
    border-top:1px solid var(--line);box-shadow:0 -12px 34px -20px rgba(19,24,41,.4);
    transform:translateY(120%);transition:transform .4s var(--ease)}
  .ss-mbar.is-on{transform:none}
  body:has(.ss-sticky) .ss-mbar,body:has(.pg-stickybar) .ss-mbar{display:none}
  .ss-mbar-in{display:flex;gap:10px;padding:10px 16px max(10px,env(safe-area-inset-bottom))}
  .ss-mbar-in > *{flex:1 1 0;min-width:0}
  .ss-mbar-call{justify-content:center;gap:8px;min-height:48px;padding:0 14px;background:var(--ink);color:#fff;font-size:15px;font-weight:600;white-space:nowrap}
  .ss-mbar-call svg{width:18px;height:18px;flex:none}

  /* the end of the page always clears whichever bar is up; the room is
     added inside the dark footer so no white band shows under it */
  body:has(.ss-sticky.show) .sf-bottom,
  body:has(.pg-stickybar.is-on) .sf-bottom,
  body:has(.ss-mbar.is-on) .sf-bottom{padding-bottom:calc(98px + env(safe-area-inset-bottom))}
  body:has(.ss-sticky.show):not(:has(.sf-bottom)),
  body:has(.pg-stickybar.is-on):not(:has(.sf-bottom)),
  body:has(.ss-mbar.is-on):not(:has(.sf-bottom)){padding-bottom:calc(76px + env(safe-area-inset-bottom))}

  /* bars step aside while the menu is open or the keyboard is up */
  html.ss-menu-lock .ss-sticky,html.ss-menu-lock .pg-stickybar,html.ss-menu-lock .ss-mbar,
  html.ss-typing .ss-sticky,html.ss-typing .pg-stickybar,html.ss-typing .ss-mbar{transform:translateY(130%)!important}
}
@media (max-width:400px){
  /* narrowest phones: the bar is just the two actions */
  .pg-stickybar-id{display:none}
  .pg-stickybar-cta{width:100%}
  .pg-stickybar .pg-btn-primary{flex:1 1 auto}
}
@media (max-width:360px){
  .ss-sticky .acts .ss-btn,.ss-mbar-call{font-size:14px;padding:0 10px}
}
@media (max-width:600px){
  /* section rhythm on a phone: two white sections back to back were stacking
     152px of empty space between them */
  .ss-section{padding:56px 0}
}
@media (max-width:900px),(hover:none) and (pointer:coarse){
  /* phones and touch screens: no scroll-tied fades, so a fling, PageDown or
     anchor jump never lands on half-faded content */
  .rv{opacity:1!important;transform:none!important;transition:none!important}
  .cp-anim .cp-head{opacity:1;transform:none;transition:none}
  .cp-anim [data-words] .cp-w{opacity:1}
  /* page headers paint at once: a held entrance left the band showing only
     the breadcrumb until the title animation ran */
  .cp-crumb,.cp-eyebrow,.cp-title,.cp-lead,.cp-profile-card,.cp-profile-body{animation:none}
}

/* ---------- phone list clamp (nav-mega.js adds the button) ---------- */
.m-clamp-btn{display:none}
@media (max-width:600px){
  .m-clamp:not(.is-open) > .m-clamp-x{display:none!important}
  .m-clamp-btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:48px;
    margin-top:14px;padding:0 18px;border:1px solid var(--line);border-radius:999px;background:#fff;
    color:var(--ink);font:inherit;font-size:15px;font-weight:600;cursor:pointer}
  .m-clamp-btn svg{width:18px;height:18px;flex:none;transition:transform .25s var(--ease)}
  .m-clamp-btn[aria-expanded="true"] svg{transform:rotate(180deg)}
  .m-clamp-btn:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
  /* on the dark credential tiles the button reads as a light outline */
  .b-dark .m-clamp-btn,.is-logowall .m-clamp-btn{background:transparent;color:inherit;border-color:rgba(255,255,255,.35)}
}
