/* ARGUS PAYMENTS — responsive UI foundation (2026-11-19).
   Loaded after legacy styles so fixes work across Admin, Seller, Docs, Install.
   CSS-only layout rules never change payment, auth or KYC logic. */
:root{--argus-layout-gap:clamp(10px,2.5vw,24px)}
html{max-width:100%;scroll-padding-top:88px;-webkit-text-size-adjust:100%}
body{max-width:100%;min-width:0;overflow-x:clip}
body *{box-sizing:border-box}
body :where(main,.page,.panel,.card,.sheet,.wrap,.content,.main-content,.dashboard,.modal-card,.modal-content,.table-container,
 .argus-seller-root,.seller-panel,.seller-columns,.seller-balances,.merchant-admin-page,
 #argus-merchant-docs,#argus-admin-keys-console,#page-kyc-studio,.kyc-studio-root,
 .kyc-workbench,.kyc-review-details,.kyc-review-doc,.argus-review-account,
 .argus-fee-studio,.argus-fee-panel,.argus-fee-operations-panel,
 #page-charge-create,.charge-result,.argus-pix-modal-card,.kyc-viewer-card){
 min-width:0;max-width:100%;
}
body :where(h1,h2,h3,h4,p,li,dt,dd,strong,small,span,label,.muted,.notice,.key-row,.seller-item,.argus-review-file){
 overflow-wrap:break-word;
}
body :where(code,kbd,pre,.mono,.identifier,[class*="secret"],[class*="api-key"],[class*="transaction-id"]){
 overflow-wrap:anywhere;
}
body :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
 max-width:100%;min-width:0;
}
body :where(textarea){white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}
body :where(button,.btn,[role="button"]){max-width:100%;white-space:normal;line-height:1.3;overflow-wrap:break-word}
body :where(img,video,canvas,svg){max-width:100%}
body :where(.actions,.section-top,.panel-header,.dash-top,.seller-head,.seller-item,
 .argus-fee-top,.argus-fee-top-actions,.kyc-studio-top,.kyc-viewer-head,
 .argus-pix-recent-heading,.modal-actions,.seller-admin-buttons){
 flex-wrap:wrap;min-width:0;
}
body :where(.section-top,.panel-header,.dash-top,.seller-head)>*{min-width:0}
body :where(.grid,.cards,.kyc-cards,.seller-columns,.seller-balances,.kyc-stat-grid,.kyc-workbench,
 .argus-fee-grid,.argus-doc-grid){min-width:0}
body :where(.grid,.seller-columns,.seller-balances,.kyc-stat-grid,.kyc-workbench,
 .argus-fee-grid,.argus-doc-grid)>*{min-width:0}
body :where(pre){box-sizing:border-box;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
body :where(pre code){white-space:pre;overflow-wrap:normal}
body :where(.table-container,.table-responsive,.table-wrap,.data-table-wrapper){
 width:100%;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;
}
body :where(.table-container,.table-responsive,.table-wrap,.data-table-wrapper) table{
 border-collapse:collapse;max-width:none;
}
body table :where(th,td){vertical-align:middle;overflow-wrap:anywhere}
body :where(.panel,.sheet,.seller-panel,.argus-review-account){isolation:isolate}
body :where(.modal-card,.modal-content,.modal-dialog,.dialog-card,.kyc-review-dialog,.kyc-viewer-card,
 .argus-pix-modal-card,.argus-pix-success-card){
 max-width:calc(100vw - 24px);max-height:calc(100dvh - 30px);overflow-y:auto;overscroll-behavior:contain;
}
body :where(.modal,.modal-overlay,.argus-pix-overlay,.kyc-document-viewer,.argus-face-backdrop){
 overscroll-behavior:contain;
}
body :where(.modal,.modal-overlay,.argus-pix-overlay,.kyc-document-viewer,.argus-face-backdrop)
 :where(input,select,textarea,button){max-width:100%}
body :where(.seller-item,.seller-admin-line,.key-row,.argus-api-row){
 min-width:0;overflow-wrap:anywhere;
}
body :where(.seller-item,.seller-admin-line,.key-row,.argus-api-row) :where(code,small,span,b,strong){
 min-width:0;overflow-wrap:anywhere;
}
#argus-merchant-docs pre,#argus-merchant-docs table,.doc pre,.doc table{max-width:100%}
#argus-merchant-docs :where(code,pre),.doc :where(code,pre){overflow-wrap:anywhere}
#seller-active-pix .seller-qr-visual{width:min(206px,calc(100% - 28px));height:auto;aspect-ratio:1;max-width:100%}
#seller-active-pix .seller-qr-visual :where(canvas,img){display:block;max-width:100%;height:auto}
#seller-active-pix :where(textarea,button,small){max-width:100%}
#page-charge-create .charge-result :where(#charge-code,#charge-receipt-id){min-width:0;max-width:100%}
#page-fees :where(input,select,textarea),#page-merchant-wallet :where(input,select,textarea){min-width:0;max-width:100%}
#page-applications .argus-review-account :where(button,small,span){min-width:0;max-width:100%}

/* Tables with 3+ columns are annotated by layout-quality.js.
   Keep DOM/table semantics and event handlers unchanged, but render each row
   as a readable labeled card on narrow screens. */
@media(max-width:720px){
 table.argus-layout-cards,
 table.argus-layout-cards tbody{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important}
 table.argus-layout-cards thead{position:absolute!important;width:1px!important;height:1px!important;
  clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;overflow:hidden!important;white-space:nowrap!important}
 table.argus-layout-cards tbody tr{display:block!important;max-width:100%!important;min-width:0!important;
  margin:0 0 12px!important;padding:8px 12px!important;border-radius:12px!important;
  border:1px solid rgba(160,171,190,.28)!important;background:rgba(24,31,43,.82)!important}
 table.argus-layout-cards tbody tr[hidden]{display:none!important}
 table.argus-layout-cards tbody td{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;
  border:none!important;border-bottom:1px solid rgba(140,151,169,.15)!important;
  padding:9px 0!important;white-space:normal!important;overflow-wrap:anywhere!important;text-align:left!important}
 table.argus-layout-cards tbody td:last-child{border-bottom:0!important}
 table.argus-layout-cards tbody td::before{content:attr(data-argus-label);display:block;
  margin:0 0 5px;font-size:11px;letter-spacing:.04em;font-weight:750;color:#dbc39b!important;
  white-space:normal;overflow-wrap:anywhere}
 table.argus-layout-cards tbody td :where(button,.btn,input,select,a){max-width:100%;min-width:0}
 table.argus-layout-cards tbody td :where(button,.btn){margin:2px 5px 2px 0}
 table.argus-layout-cards tbody td :where(code,small,span){max-width:100%;overflow-wrap:anywhere}
}
@media(max-width:980px){
 body :where(.wrap,.content,.main-content,.dashboard){min-width:0}
 #dashboard>.grid,.seller-columns{grid-template-columns:minmax(0,1fr)!important}
 .auth{grid-template-columns:minmax(0,1fr)!important}
 #argus-merchant-docs .argus-doc-grid{grid-template-columns:minmax(0,1fr)!important}
}
@media(max-width:760px){
 body :where(.wrap,.content,.main-content,.dashboard,.page){max-width:100%;min-width:0}
 .top{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:9px;padding:12px 15px}
 .top .brand{display:flex;align-items:center;max-width:100%;min-width:0}
 .top .brand img{width:min(160px,44vw);height:auto;max-width:100%;object-fit:contain}
 .top nav{display:flex;flex:1 1 100%;width:100%;max-width:100%;min-width:0;
  gap:7px;flex-wrap:wrap;align-items:center;justify-content:flex-start}
 .top nav a{display:inline-flex!important;align-items:center;justify-content:center;
  min-height:36px;max-width:100%;padding:7px 10px;border:1px solid rgba(210,177,121,.24);
  border-radius:9px;background:rgba(27,34,45,.72);text-align:center;
  overflow-wrap:anywhere;white-space:normal;font-size:12px}
 .dash-top{align-items:flex-start}
 .dash-top h1,.section-top h1,.kyc-studio-top h1{font-size:clamp(24px,6vw,34px);line-height:1.18}
 .dash-top #logout{margin-left:auto}
 .panel,.sheet{padding:clamp(12px,3.6vw,19px)}
 .seller-balances{grid-template-columns:repeat(2,minmax(0,1fr))}
 .kyc-workbench{grid-template-columns:minmax(0,1fr)!important}
 .kyc-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .merchant-admin-page .panel,.argus-fee-operations-panel{padding:13px}
 .merchant-admin-page .seller-admin-line>div{min-width:0}
 .merchant-admin-page .seller-admin-buttons{flex-wrap:wrap}
 .charge-result #charge-receipt.argus-pix-receipt #argus-pix-receipt-actions{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
 }
}
@media(max-width:540px){
 html{scroll-padding-top:110px}
 .wrap{padding:15px 12px 25px}
 .top{padding:10px 12px}
 .top nav a{flex:1 1 auto;min-width:0;font-size:12px}
 .auth{gap:16px;min-height:0}
 .intro h1{font-size:clamp(28px,9vw,38px);line-height:1.15}
 .sheet,.panel,.seller-panel{padding:13px!important;border-radius:13px}
 .tabs button{min-width:0;padding:9px 6px;white-space:normal}
 .dash-top,.panel-header,.section-top{gap:10px}
 .dash-top #logout{min-height:40px;flex:0 0 auto}
 .seller-balances,.kyc-stat-grid{grid-template-columns:minmax(0,1fr)!important}
 .seller-balance strong{font-size:clamp(20px,6vw,27px)}
 .seller-quote,.seller-key-status,.notice{overflow-wrap:anywhere}
 .argus-seller-root .seller-item{align-items:flex-start}
 .argus-fee-top-actions>*{flex:1 1 155px}
 .argus-pix-recent-heading{flex-wrap:wrap}
 .argus-pix-modal-card{width:100%!important;max-width:calc(100vw - 18px)!important;
  max-height:calc(100dvh - 18px)!important;padding:12px!important}
 .charge-result #charge-receipt.argus-pix-receipt #argus-pix-receipt-actions{
  grid-template-columns:minmax(0,1fr)!important;
 }
 .charge-result #charge-receipt.argus-pix-receipt #argus-pix-receipt-actions>.btn{
  min-height:44px!important;height:auto!important;padding:9px!important;
  overflow-wrap:break-word!important;white-space:normal!important;font-size:13px!important
 }
 .kyc-viewer-card{width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}
 .kyc-pdf-controls{flex-wrap:wrap}
 .kyc-pdf-controls button{flex:1 1 120px}
 #argus-merchant-docs{padding:13px;margin:12px auto}
 #argus-merchant-docs pre,.doc pre{font-size:11px;padding:13px}
 .doc{min-width:0;padding:20px 12px 50px!important}
 .doc table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
 .argus-face-sheet{width:100%;max-height:95dvh}
 .argus-face-actions button{width:100%}
}
@media(max-width:360px){
 .top nav a{flex:1 1 45%}
 .sheet,.panel,.seller-panel{padding:11px!important}
 .charge-result .argus-pix-code-row{gap:6px}
 #an-box{width:calc(100vw - 12px)}
}
@media(prefers-reduced-motion:reduce){
 html{scroll-behavior:auto!important}
}

/* Legacy documents panel is hidden by the active KYC flow; do not reserve
   its former 50% dashboard width for an empty column. */
#dashboard>.grid.argus-kyc-legacy-hidden{grid-template-columns:minmax(0,1fr)!important}
#dashboard>.grid.argus-kyc-legacy-hidden>article:not([hidden]){width:100%;max-width:100%}
@media(max-width:760px){
 body :where(input:not([type="checkbox"]):not([type="radio"]),textarea,select){
  font-size:16px; /* avoid involuntary Safari zoom */
 }
}
