/* Adsrek Pay v49 — consolidated responsive layer.
   Loaded last so mobile rules are predictable across legacy page styles. */

html,body{max-width:100%;overflow-x:hidden}
.pc-app,.pc-workspace,.pc-content,.pc-content-card,.pc-page-head,.pc-page-heading{min-width:0}
.pc-content img,.pc-content svg,.pc-content video,.pc-content canvas{max-width:100%;height:auto}
.pc-content input,.pc-content select,.pc-content textarea{max-width:100%;box-sizing:border-box}

/* Scrollable data areas instead of widening the whole page. */
.p2m-table-wrap,.wallet-table-wrap,.hist-table-wrap,.merchant-table-wrap,.integration-delivery-wrap,.rf38-table-wrap,.rfa39-table-wrap,.wn48-table-wrap,
.api3-usage-list,.invoice-list{max-width:100%}

@media (max-width:900px){
  body.paycore-sidebar-open{overflow:hidden}
  .pc-header{width:calc(100% - 20px)!important;max-width:none!important;margin:10px auto 0!important;padding:8px 10px!important;gap:8px!important}
  .pc-header__left{min-width:0!important;flex:1 1 auto!important}
  .pc-header__right{flex:0 0 auto!important;min-width:0!important}
  .pc-brand{min-width:0!important}
  .pc-brand__text{min-width:0!important}
  .pc-workspace{width:100%!important;max-width:100%!important;padding:12px 10px 24px!important;gap:12px!important}
  .pc-content{width:100%!important;max-width:100%!important}
  .pc-sidebar{width:min(320px,90vw)!important;padding:10px!important}
  .pc-sidebar__inner{max-height:100%!important;overflow-y:auto!important;overscroll-behavior:contain}
  .pc-sidebar-backdrop{inset:0!important}

  .pc-public-docs-layout,.pc-public-page-layout,.pc-help-layout,.pc-auth-layout{width:100%!important;max-width:100%!important;padding-left:12px!important;padding-right:12px!important}

  .p2m-columns,.p2m-form-grid,.p2m-offer-grid,.p2m-deadline-grid,.p2m-collateral-grid,
  .wallet-columns,.wallet-columns--v149,.fx-layout,.api4-board,.api4-network-grid,.az-settings-grid,
  .merchant-split,.integration-grid,.merchant-shop-grid,.sites-overview-grid,.payments-kpi-grid,.paylinks-layout,.paylinks-grid,
  .api-doc-layout,.api-doc-grid,.ap-sec-grid,.rf38-grid,.ap-support__layout{grid-template-columns:1fr!important}

  .p2m-overview{grid-template-columns:1fr!important}
  .p2m-overview__actions{justify-content:flex-start!important}
  .p2m-selector-grid{grid-template-columns:1fr!important}
  .p2m-selector-swap,.p2m-selector-arrow{margin:0 auto!important;transform:rotate(90deg)}
  .p2m-pairs-grid{grid-template-columns:1fr 1fr!important}
  .p2m-rate-grid{grid-template-columns:1fr 1fr!important}

  .wallet-grid,.wallet-grid--primary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .fx-flow,.fx-confirm__flow{grid-template-columns:1fr!important}
  .fx-swap{width:100%!important;max-width:none!important}

  .p2m-table-wrap,.wallet-table-wrap,.hist-table-wrap,.merchant-table-wrap,.integration-delivery-wrap,.rf38-table-wrap,.rfa39-table-wrap,.wn48-table-wrap,
  .api-doc-table-wrap{overflow-x:auto!important;-webkit-overflow-scrolling:touch;scrollbar-width:thin}

  .p2-modal-box,.p2m-modal__box,.az-num-dialog{width:min(100%,720px)!important;max-width:100%!important;max-height:calc(100dvh - 24px)!important}

  /* Landing/public content */
  .ap-header,.ap-hero,.ap-features,.ap-security,.ap-footer,.apx-header,.apx-hero,.apx-section,.apx-footer{max-width:100%!important}
  .ap-hero,.apx-hero{grid-template-columns:1fr!important}
  .ap-product,.apx-visual{max-width:100%!important;margin-left:0!important}
}

@media (max-width:768px){
  .pc-page-head{display:block!important;margin-bottom:12px!important}
  .pc-page-heading h1{font-size:24px!important;line-height:1.16!important;overflow-wrap:anywhere}
  .pc-page-subtitle{font-size:11px!important;line-height:1.45!important}
  .pc-content-card:not(.pc-content-card--plain){padding:14px!important;border-radius:16px!important}

  .p2m{gap:12px!important}
  .p2m-card{padding:14px!important;border-radius:16px!important}
  .p2m-tabs,.az-tabs{max-width:100%!important;overflow-x:auto!important;flex-wrap:nowrap!important;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  .p2m-tabs::-webkit-scrollbar,.az-tabs::-webkit-scrollbar{display:none}
  .p2m-tab,.az-tabs a{flex:0 0 auto!important;white-space:nowrap!important}
  .p2m-stats{grid-template-columns:1fr 1fr!important}
  .p2m-methods{grid-template-columns:1fr!important}
  .p2m-modal{padding:10px!important;align-items:flex-end!important}
  .p2m-modal__box{border-radius:18px 18px 12px 12px!important;max-height:92dvh!important}
  .p2m-modal__head,.p2m-modal__search,.p2m-modal__foot{padding-left:13px!important;padding-right:13px!important}
  .p2m-methods{padding-left:13px!important;padding-right:13px!important}

  .invoice-stats{grid-template-columns:1fr 1fr!important}
  .invoice-item{min-width:0!important}
  .invoice-item__body,.invoice-item__details{min-width:0!important}

  .api3-top,.api3-card,.api4-board{min-width:0!important}
  .api3-key{min-width:0!important;overflow-wrap:anywhere}
  .api3-secret code,.api3-key code{white-space:normal!important;word-break:break-all!important}

  .ap-support{padding-left:0!important;padding-right:0!important}
  .ap-support__layout{gap:12px!important}

  .ap-landing .ap-header,.apx-header{padding-left:14px!important;padding-right:14px!important}
  .ap-landing .ap-hero,.apx-hero{padding-left:14px!important;padding-right:14px!important}
  .ap-landing .ap-hero h1,.apx-hero h1{font-size:clamp(38px,11vw,54px)!important;line-height:1.02!important}
  .ap-landing .ap-hero-copy>p,.apx-hero-copy>p{font-size:15px!important;line-height:1.55!important}
}

@media (max-width:520px){
  .pc-header{width:calc(100% - 12px)!important;margin-top:6px!important;padding:7px 8px!important;border-radius:16px!important}
  .pc-menu-btn{width:36px!important;height:36px!important;min-width:36px!important}
  .pc-brand__mark{width:34px!important;height:34px!important;flex-basis:34px!important}
  .pc-header__right{gap:4px!important}
  .pc-logout,.pc-login,.pc-register,.pc-admin-link{min-height:36px!important;padding:0 9px!important;font-size:10px!important}
  .adsrek-theme-toggle--cabinet{width:36px!important;height:36px!important;min-width:36px!important}
  .pc-workspace{padding:9px 7px 20px!important}
  .pc-page-heading h1{font-size:22px!important}

  .wallet-grid,.wallet-grid--primary,.invoice-stats{grid-template-columns:1fr!important}
  .p2m-stats,.p2m-rate-grid,.p2m-pairs-grid{grid-template-columns:1fr!important}
  .p2m-overview__actions,.p2m-form-actions,.wallet-overview__actions,.wallet-actionbar,.p2-actions{display:grid!important;grid-template-columns:1fr!important;width:100%!important}
  .p2m-overview__actions .p2m-btn,.p2m-form-actions .p2m-btn,.wallet-actionbar .ap-btn,.wallet-overview__actions .ap-btn,.p2-actions .p2-btn{width:100%!important}
  .p2m-section-head,.p2m-title-row{align-items:flex-start!important}
  .p2m-section-head{flex-direction:column!important}

  .invoice-item{grid-template-columns:38px minmax(0,1fr)!important;padding:13px 10px!important}
  .invoice-item__right{grid-column:1/-1!important;justify-content:flex-start!important}
  .invoice-item__details{grid-template-columns:1fr!important}

  .pc-auth-layout,.pc-public-docs-layout,.pc-public-page-layout,.pc-help-layout{padding-left:8px!important;padding-right:8px!important}
  .ap-auth__form-card,.ap-register__card{padding-left:14px!important;padding-right:14px!important}
}

@media (max-width:430px){
  .pc-brand__text{display:none!important}
  .pc-header__left{gap:6px!important}
  .pc-header__right{gap:3px!important}
  .ap-lang-switch{display:none!important}
  .pc-logout,.pc-login,.pc-register{padding:0 8px!important}
  .pc-page-heading h1{font-size:21px!important}
  .p2m-card{padding:12px!important}
  .p2m-tab{min-height:38px!important;padding:0 11px!important;font-size:11px!important}
  .p2m-selector{min-height:62px!important;padding:9px 10px!important}
  .p2m-form input,.p2m-form select,.p2m-form textarea{font-size:16px!important} /* avoids iOS auto-zoom */
  .wallet-form input,.wallet-form select,.wallet-form textarea,.fx-form input,.fx-form select,.az-form input,.az-form select,.az-form textarea{font-size:16px!important}
}

@media (max-width:390px){
  .pc-workspace{padding-left:5px!important;padding-right:5px!important}
  .pc-content-card:not(.pc-content-card--plain),.p2m-card{border-radius:14px!important}
  .pc-sidebar{width:92vw!important}
  .pc-side-balances{grid-template-columns:1fr!important}
  .pc-side-balance{min-width:0!important}
}
