/* TapBum Stage 41 | public mobile & tablet consistency. Loaded last. */
:root { --tb41-gutter:clamp(14px,3.6vw,28px); --tb41-bottom:env(safe-area-inset-bottom,0px) }
html { max-width:100%; scroll-padding-top:90px; -webkit-text-size-adjust:100% }
body { min-width:0; max-width:100%; overflow-x:clip }
body, body * { box-sizing:border-box }
body :is(main, article, section, aside, form, nav, header, footer, .tb24-main, .tb29-home-center, .tb33-panel, .tb33-shell, .tb35-info, .tb37-container) { min-width:0 }
body :is(img,svg,video,canvas,iframe) { max-width:100% }
body img,body video { height:auto }
body :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { max-width:100%; min-width:0 }
body :is(h1,h2,h3,p,a,strong,small,span) { overflow-wrap:break-word }
body :is(a,button,input,select,textarea) { -webkit-tap-highlight-color:transparent }
body :is(a,button,input,select,textarea):focus-visible { outline:3px solid #ffcf52; outline-offset:3px }
/* Shared fixed header remains above content; older headers are suppressed only on Stage40 pages. */
body.tb40-has-header { padding-top:76px!important }
body.tb40-has-header :is(.tb35-header,.tb24-header,.tb27-head,.tb33-header,.tb37-header,.tb25-mobile-top,.tb35-bottom-nav,.tb25-mobile-nav) { display:none!important }
body.tb40-has-header #tb40-header { display:block!important }
#tb40-header .tb40-header-inner { min-width:0 }
#tb40-header .tb40-search { min-width:0 }
#tb40-header .tb40-search input { min-width:0!important }
#tb40-header .tb40-menu-button { flex-shrink:0 }
/* Page width and text scale; no unwanted sideways scrolling. */
body :is(.tb24-main,.tb33-shell,.tb37-container,.tb35-info,.tb24-account,.tb27-table,.tb27-auth-wrap,.tb35-footer) { max-width:100% }
body .tb37-container { width:min(1160px,100%); margin-inline:auto }
body .tb37-sales-hero { max-width:100%; overflow:hidden }
body .tb37-sales-hero h1 { font-size:clamp(30px,6.3vw,54px)!important; line-height:1.13!important; overflow-wrap:normal }
body .tb37-sales-hero p { font-size:clamp(16px,2.5vw,19px)!important; line-height:1.65 }
body .tb37-package-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr)) }
body .tb37-package-grid article { overflow:hidden }
body .tb37-sales-cta { max-width:100%; text-align:center }
body .tb37-empty { line-height:1.65; max-width:100% }
/* Shared cards, audio lists and forms */
body :is(.tb24-sound-grid,.tb38-fav-grid,.tb24-favorites-grid,.tb37-package-grid,.tb35-card-grid,.tb27-linkgrid) { min-width:0; max-width:100% }
body .tb24-sound-card { min-width:0; overflow:hidden }
body .tb24-title { overflow-wrap:anywhere }
body :is(.tb35-form,.tb37-form,.tb26-form,.tb27-auth) :is(input,textarea,select) { width:100%; min-width:0 }
body .tb35-footer nav { max-width:100% }
/* Sponsored content always stays within the viewport and preserves all inventory. */
body :is(.tb33-columns,.tb29-home-wrap,.tb37-ad-stack,.tb29-home-rail,.tb29-home-ads,.tb33-side,.tb33-ad-region) { min-width:0; max-width:100% }
body .tb37-ad-house,body .tb37-ad-creative { max-width:100%; overflow:hidden }
body .tb37-ad-creative img { width:auto; max-width:100%; max-height:220px; height:auto; object-fit:contain }
body :is(.tb33-panel,.tb33-side,.tb33-ad-region,.tb37-ad-house) { overflow-wrap:anywhere }
/* Tablets / landscape phones */
@media(max-width:1024px){
  body .tb29-home-wrap { display:flex!important; flex-direction:column!important; gap:16px!important }
  body .tb29-home-center { width:100%!important; order:1 }
  body .tb29-home-rail { width:100%!important; position:static!important }
  body .tb29-home-rail:first-child { order:0 }
  body .tb29-home-rail:last-child { order:2 }
  body .tb33-columns { display:grid!important; grid-template-columns:minmax(0,1fr)!important; gap:16px!important }
  body .tb33-columns>.tb33-side { display:block!important; width:100%!important; min-height:0!important; position:static!important }
  body .tb33-columns>.tb33-panel { width:100%!important; max-width:100%!important }
  body .tb33-side .tb37-ad-house { min-height:110px!important }
  body .tb37-container { padding-inline:var(--tb41-gutter) }
  body .tb37-sales-hero { margin-bottom:30px }
}
@media(max-width:700px){
  html{scroll-padding-top:76px}
  body.tb40-has-header { padding-top:65px!important; padding-bottom:calc(83px + var(--tb41-bottom))!important }
  #tb40-header { height:65px!important }
  #tb40-header .tb40-header-inner { gap:8px; padding:0 12px }
  #tb40-header .tb40-logo { font-size:clamp(21px,5vw,26px)!important; letter-spacing:-1.2px }
  #tb40-header .tb40-search { flex:1; height:39px; gap:6px; padding:3px 4px 3px 9px }
  #tb40-header .tb40-search input { font-size:16px!important; padding:3px 0!important }
  #tb40-header .tb40-search button { min-width:37px; height:31px }
  #tb40-header .tb40-menu-button { display:flex!important; width:40px; height:40px }
  .tb40-mobile-bottom { display:flex!important; height:calc(66px + var(--tb41-bottom))!important; padding-bottom:var(--tb41-bottom)!important }
  .tb40-mobile-bottom a { min-width:0!important; min-height:51px!important; font-size:11px!important }
  .tb40-mobile-bottom a span { font-size:21px!important }
  body.tb40-has-header :is(.tb24-main,.tb24-account,.tb33-shell,.tb35-info,.tb37-container,.tb27-table,.tb27-auth-wrap) { box-sizing:border-box; width:100%!important; max-width:100%!important; padding-left:var(--tb41-gutter)!important; padding-right:var(--tb41-gutter)!important; margin-left:auto!important; margin-right:auto!important }
  body .tb37-container { padding-top:24px!important; padding-bottom:42px!important }
  body .tb37-sales-hero { padding:clamp(22px,5vw,32px)!important; border-radius:20px; margin-bottom:32px }
  body .tb37-sales-hero h1 { font-size:clamp(31px,7.6vw,42px)!important }
  body .tb37-sales-hero p { font-size:17px!important; line-height:1.58!important }
  body .tb37-sales-cta { display:inline-flex; align-items:center; justify-content:center; min-height:48px; padding:12px 23px }
  body .tb37-container>h2,body .tb37-container h2 { font-size:clamp(23px,6vw,30px); line-height:1.22 }
  body .tb37-package-grid { grid-template-columns:1fr!important; gap:14px!important; margin:18px 0 27px }
  body .tb37-package-grid article { padding:21px!important }
  body .tb37-empty { padding:20px!important }
  body .tb37-footer { padding:26px 16px calc(25px + var(--tb41-bottom)) }
  body .tb33-columns { display:flex!important; flex-direction:column!important; gap:14px!important }
  body .tb33-panel { padding:clamp(16px,4.5vw,26px)!important }
  body .tb33-panel :is(h1,h2) { overflow-wrap:anywhere; line-height:1.2 }
  body .tb33-side .tb37-ad-stack { grid-template-columns:1fr!important }
  body .tb33-side .tb37-ad-creative img { max-height:170px!important }
  body :is(.tb33-primary,.tb33-download-link,.tb37-sales-cta) { max-width:100% }
  body .tb24-sound-grid,body .tb38-fav-grid { grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:12px!important }
  body .tb24-sound-card { padding:clamp(9px,2.6vw,16px)!important }
  body .tb24-title { font-size:clamp(12px,3.2vw,15px)!important }
  body .tb24-actions { flex-wrap:wrap; justify-content:center; gap:6px }
  body .tb35-card-grid,body .tb27-linkgrid { grid-template-columns:1fr!important }
  body .tb35-hero,body .tb35-article,body .tb27-auth,body .tb35-form { max-width:100%; min-width:0 }
  body.tb35-active .tb27-table,body.tb35-active .tb24-account { width:100%!important; max-width:100%!important; padding-inline:var(--tb41-gutter)!important }
  body .tb35-footer { margin-top:30px!important; padding:26px var(--tb41-gutter) calc(35px + var(--tb41-bottom))!important }
  body .tb35-foot-top { display:block!important }
  body .tb35-footer nav { grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:14px!important }
  body .tb37-ad-house { padding:14px!important; min-height:100px!important }
  body .tb37-ad-house strong { font-size:clamp(17px,4.3vw,23px)!important }
  body .tb37-ad-house b { padding:10px 15px }
  body .tb24-player { max-width:calc(100vw - 24px)!important }
}
@media(max-width:410px){
 #tb40-header .tb40-header-inner { gap:6px; padding-inline:9px }
 #tb40-header .tb40-logo { font-size:21px!important; letter-spacing:-1.3px }
 #tb40-header .tb40-logo i { display:none }
 #tb40-header .tb40-search { padding-left:7px }
 #tb40-header .tb40-search svg { display:none }
 #tb40-header .tb40-search input { font-size:16px!important }
 #tb40-header .tb40-search button { min-width:32px; padding:0 3px }
 #tb40-header .tb40-menu-button { width:36px; height:38px }
 body .tb24-sound-grid,body .tb38-fav-grid { gap:8px!important }
 body .tb24-sound-card { padding:9px!important }
 body .tb24-sound-button { max-width:100% }
 body .tb24-sound-card .tb24-button-top { max-width:100% }
 body .tb33-sound-button { max-width:100% }
 body .tb37-sales-hero { padding:22px!important }
 body .tb37-sales-hero h1 { font-size:31px!important }
}
@media(max-width:340px){
 /* Avoid crushed header controls on very narrow phones. */
 body.tb40-has-header { padding-top:99px!important }
 #tb40-header { height:99px!important }
 #tb40-header .tb40-header-inner { flex-wrap:wrap; align-content:center; justify-content:space-between; gap:5px 8px; padding-block:5px }
 #tb40-header .tb40-logo { order:0 }
 #tb40-header .tb40-menu-button { order:1 }
 #tb40-header .tb40-search { order:2; flex-basis:100%; height:36px }
 #tb40-header .tb40-search svg { display:block }
 #tb40-header .tb40-search button { min-width:39px }
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}.tb40-drawer,.tb37-ad-creative,.tb37-ad-house{transition:none!important}}
