/* Tanshar Home shared popup and responsive consistency layer. */
body[data-signed="1"] .modal-dialog:not(.modal-xl):not(.modal-lg){max-width:560px}
body[data-signed="1"] .modal-dialog.modal-lg{max-width:760px}
body[data-signed="1"] .modal-content{overflow:hidden;border:1px solid rgba(224,173,88,.5)!important;border-top:3px solid #dcae58!important;border-radius:14px!important;background:#0e1a33!important;box-shadow:0 26px 70px rgba(0,0,0,.55)!important}
body[data-signed="1"] .modal-header{min-height:58px;padding:13px 18px!important;border:0!important;background:#82c8b5!important;color:#fff!important}
body[data-signed="1"] .modal-header h1,body[data-signed="1"] .modal-header h2,body[data-signed="1"] .modal-header h3,body[data-signed="1"] .modal-header p{color:#fff!important;margin-top:0}
body[data-signed="1"] .modal-header .text-secondary{color:rgba(255,255,255,.82)!important}
body[data-signed="1"] .modal-header .btn-close{filter:brightness(0) invert(1)!important;opacity:.95}
body[data-signed="1"] .modal-body{padding:18px!important;max-height:min(68dvh,690px);overflow-y:auto;overscroll-behavior:contain}
body[data-signed="1"] .modal-footer{padding:12px 18px 14px!important;border-color:rgba(176,193,225,.14)!important;background:#0e1a33!important;gap:8px}
body[data-signed="1"] .modal-footer .btn{min-width:98px;min-height:40px;border-radius:9px}
body[data-signed="1"] .modal-footer .btn-primary{background:#63bd9c!important;border-color:#63bd9c!important;color:#fff!important}
body[data-signed="1"] .modal-footer .btn-primary:hover{background:#52aa8a!important;border-color:#52aa8a!important}
body[data-signed="1"] .modal-footer .btn-light{background:#172541!important;border-color:#344362!important;color:#e9eef9!important}
body[data-signed="1"] .modal-footer .btn-danger{background:#cc5b67!important;border-color:#cc5b67!important}
body[data-signed="1"] .modal .form-control,body[data-signed="1"] .modal .form-select{min-height:42px;border-color:#31415f!important;background:#101d37!important;color:#edf2fb!important}
body[data-signed="1"] .modal textarea.form-control{min-height:84px}
body[data-signed="1"] .modal .form-label{margin-bottom:5px;color:#c9d2e3!important;font-size:12px;font-weight:700}
body[data-signed="1"] .modal .row.g-3{--bs-gutter-x:12px;--bs-gutter-y:12px}
body[data-signed="1"] .modal ::placeholder{color:#8491aa!important}
body[data-signed="1"] .modal .segmented{background:#111f3b!important}
body[data-signed="1"] .modal .segmented .btn-check:checked+.btn{background:#8066f2!important;color:#fff!important}
body[data-signed="1"] .modal-dialog-scrollable .modal-body{max-height:none}

/* Keep wide data-review tasks wide; ordinary create/edit forms remain compact. */
body[data-signed="1"] #importModal .modal-dialog,body[data-signed="1"] .statement-modal .modal-dialog,body[data-signed="1"] .report-modal .modal-dialog{max-width:min(1180px,calc(100vw - 32px))}

/* Consistent content cards across desktop widths; Transactions intentionally excluded. */
@media (min-width:1280px){
 body[data-signed="1"] #view:not(.module-transactions) .settings-organized-grid,
 body[data-signed="1"] #view:not(.module-transactions) .account-card-grid.account-flat-layout,
 body[data-signed="1"] #view:not(.module-transactions) .pantry-workspace-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}
@media (min-width:769px) and (max-width:1279px){
 body[data-signed="1"] #view:not(.module-transactions) .settings-organized-grid,
 body[data-signed="1"] #view:not(.module-transactions) .account-card-grid.account-flat-layout,
 body[data-signed="1"] #view:not(.module-transactions) .pantry-workspace-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media (max-width:768px){
 body[data-signed="1"] .modal{padding:0!important}
 body[data-signed="1"] .modal-dialog,body[data-signed="1"] .modal-dialog.modal-lg,body[data-signed="1"] .modal-dialog.modal-xl{width:calc(100vw - 16px)!important;max-width:none!important;margin:8px auto!important;min-height:calc(100dvh - 16px)!important}
 body[data-signed="1"] .modal-dialog-centered{align-items:center}
 body[data-signed="1"] .modal-content{max-height:calc(100dvh - 16px)!important;border-radius:13px!important}
 body[data-signed="1"] .modal-header{min-height:56px;padding:12px 15px!important}
 body[data-signed="1"] .modal-body{padding:15px!important;max-height:none;overflow-y:auto}
 body[data-signed="1"] .modal-footer{position:sticky;bottom:0;padding:10px 15px calc(10px + env(safe-area-inset-bottom))!important}
 body[data-signed="1"] .modal-footer .btn{flex:1 1 0;min-width:0;min-height:44px}
 body[data-signed="1"] .modal .row>[class*="col-"]{width:100%}
 body[data-signed="1"] #view:not(.module-transactions) .settings-organized-grid,
 body[data-signed="1"] #view:not(.module-transactions) .account-card-grid.account-flat-layout,
 body[data-signed="1"] #view:not(.module-transactions) .pantry-workspace-grid{grid-template-columns:1fr!important}
}
