/*
 * Phones and tablets. The pages are designed for desktop with sizes written on
 * each element; below 768px these rules take over (hence !important), so the
 * desktop look never changes. Checked at 320, 360, 390, 414 and 768px.
 */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{overflow-wrap:break-word}
a,button,input,select,label{-webkit-tap-highlight-color:rgba(0,96,57,.15)}
:focus-visible{outline:3px solid #E8B21A;outline-offset:2px}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}*{animation-duration:.01ms!important;transition-duration:.01ms!important}}

@media (max-width:768px){
  /* Headings: big but never wider than the screen. */
  h1{font-size:clamp(30px,8.4vw,44px)!important;line-height:1.22!important;letter-spacing:0!important}
  h2{font-size:clamp(24px,6.6vw,32px)!important;line-height:1.3!important}
  h3{font-size:clamp(18px,5vw,20px)!important}
  /* Display numbers and words written outside headings. */
  [style*="font-size: 64px"],[style*="font-size: 62px"]{font-size:clamp(40px,12vw,52px)!important}
  [style*="font-size: 48px"]{font-size:clamp(32px,9vw,40px)!important}
  [style*="font-size: 40px"]:not(h1):not(h2){font-size:clamp(28px,8vw,34px)!important}
  [style*="font-size: 36px"]:not(h1):not(h2){font-size:clamp(26px,7.4vw,32px)!important}
  /* Body text a touch smaller than desktop's 20px lead lines; never under 16px. */
  p[style*="font-size: 20px"],span[style*="font-size: 20px"]{font-size:17px!important}
  p[style*="font-size: 18px"],span[style*="font-size: 18px"]{font-size:16.5px!important}

  /* Section spacing: desktop's 72–96px becomes 48px; sides 18px. */
  [style*="padding: 96px 24px"],[style*="padding: 88px 24px"],[style*="padding: 72px 24px"],[style*="padding: 80px 24px"]{padding:48px 18px!important}
  [style*="padding: 88px 24px 56px"]{padding:44px 18px 36px!important}
  [style*="padding: 40px 24px 96px"]{padding:24px 18px 48px!important}
  [style*="padding: 88px 24px 0"]{padding:48px 18px 0!important}
  [style*="padding: 48px 24px 36px"],[style*="padding: 80px 24px 40px"]{padding:40px 18px 32px!important}
  /* Section gaps. */
  [style*="gap: 56px"],[style*="gap: 48px"]{gap:28px!important}
  [style*="gap: 40px"]{gap:24px!important}
  /* Big cards: less inner space. */
  [style*="padding: 44px"],[style*="padding: 40px"]{padding:24px 20px!important}
  [style*="border-radius: 28px"]{border-radius:22px!important}
  [style*="padding: 36px"]{padding:24px 18px!important}

  /* Wide grids: one column on phones. */
  [style*="minmax(320px, 1fr)"],[style*="minmax(280px, 1fr)"]{grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr))!important}

  /* Phone screenshots: never wider than the screen. */
  [style*="width: 300px"],[style*="width: 280px"],[style*="width: 260px"],[style*="width: 340px"]{max-width:100%!important}

  /* SSC hero: the two phones side by side, smaller, no empty space above. */
  .hero-visual{min-height:0!important;padding-top:8px;align-items:flex-end!important}
  .hero-phone.back{width:44%!important;max-width:200px!important;transform:translateY(-18px) rotate(-3deg)!important;margin-right:-8%!important;border-radius:26px!important;padding:6px!important}
  .hero-phone.front{width:50%!important;max-width:220px!important;border-radius:28px!important;padding:6px!important}
  .hero-phone img{border-radius:21px!important}

  /* Comparison table: two short columns fit a phone, no sideways scrolling. */
  table.compare{min-width:0!important;font-size:15px!important}
  table.compare th,table.compare td{padding:12px 12px!important;vertical-align:top}

  /* Footer links and phone numbers: big enough to tap. */
  footer nav a{display:inline-flex;align-items:center;min-height:44px}
  footer nav{gap:4px 20px!important}
  a[href^="tel:"]{display:inline-flex;align-items:center;min-height:44px}
  .crumb a,nav[aria-label="অবস্থান"] a{display:inline-flex;align-items:center;min-height:44px}
  a[href*="affiliate.brainbridge"]{display:inline-flex;align-items:center;min-height:44px}
  .nav-cta{min-height:44px!important;box-sizing:border-box;display:inline-flex!important;align-items:center}
}

@media (max-width:480px){
  /* Main buttons: full width, easy to hit with a thumb. */
  section a[style*="border-radius: 14px"],footer a[style*="border-radius: 14px"]{width:100%;justify-content:center;text-align:center;box-sizing:border-box}
  section div[style*="flex-wrap: wrap"]:has(> a[style*="border-radius: 14px"]){width:100%}
  /* The how-to-buy steps' number tiles keep their size. */
  [style*="width: 40px; height: 40px"]{flex:none!important}
}

/* Smallest phones (320–359px): the header must fit on one line. */
@media (max-width:359px){
  .hdr{padding:10px 12px!important;gap:8px!important}
  .hdr-logo-text{display:none}
  .nav-cta{padding:9px 12px!important;font-size:14px!important}
  .menu-toggle{width:42px!important;height:42px!important}
}
