/* Shared hierarchy: dates are neutral, totals green, pending payments amber. */
:root{--muted:#63766d;--surface-soft:#f5f8f6;--pending-ink:#8b5d1d;--pending-bg:#fff6e6;--panel-radius:20px}
[hidden]{display:none!important}
body{font-size:var(--text-body);line-height:1.85;text-rendering:optimizeLegibility}
.money-value{font-variant-numeric:tabular-nums;unicode-bidi:isolate;white-space:nowrap;letter-spacing:-.2px}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
button:focus-visible,a:focus-visible{outline:3px solid #75a596;outline-offset:3px}
.main{padding:30px clamp(18px,3vw,42px) 38px}
.topbar{padding-bottom:16px;border-bottom:1px solid var(--line);margin-bottom:24px}
.topbar h2{font-size:var(--text-display);line-height:1.5}
.eyebrow{color:#687f73;font-size:var(--text-small)}
.user-chip{padding:6px 10px 6px 6px;border:1px solid var(--line);border-radius:999px;background:white}
.panel,.stat-card,.setup-panel{border-radius:var(--panel-radius);box-shadow:0 5px 20px #183c3205}
.panel{border:1px solid var(--line)}
.panel-head h3,.section-toolbar h3{margin:0 0 4px;line-height:1.6}
.panel-head p,.section-toolbar p{line-height:1.85;color:var(--muted);margin-top:3px}
.panel-head,.section-toolbar{gap:16px}
.btn,.mini-btn,.text-btn,.icon-btn{transition:background .15s,box-shadow .15s,transform .15s}
.btn,.mini-btn{min-height:40px;font-weight:700}
.btn.primary,.mini-btn.pay{background:#1c5148;color:white;border:1px solid #1c5148;box-shadow:0 3px 8px #1c514812}
.btn.primary:hover,.mini-btn.pay:hover{background:#143f37}
.btn.secondary{background:#edf3ef;color:#29584a;border:1px solid #dce7df}
.mini-btn{font-size:var(--text-small);padding:8px 13px;background:#fff;color:#35554a;border-color:#dfe8e2}
.mini-btn:hover{background:#f2f7f3;border-color:#b7cfbf}
.mini-btn.danger-action,.danger-action{color:#9d4b43;border-color:#eededb;background:#fffaf9}
.text-btn{font-size:var(--text-small);min-height:38px;padding:7px 10px;border-radius:9px}
.text-btn:hover{background:#edf4ef}
.icon-btn{min-width:40px;min-height:40px;display:grid;place-items:center}
button:disabled{cursor:default;opacity:.65}
.overview-stats{gap:16px;margin:0 0 20px}
.overview-stats .stat-card{padding:22px;min-height:145px}
.overview-stats .stat-card span{font-size:var(--text-small);font-weight:600;color:#536d60}
.overview-stats .stat-card strong{font-size:var(--text-display);font-variant-numeric:tabular-nums;margin:12px 0 5px}
.overview-stats .stat-card small{font-size:var(--text-small);line-height:1.8;color:#60766b}
.salary-deduction-overview{margin-bottom:20px}
.salary-deduction-head h3{font-size:var(--text-body)}
.salary-deduction-head p{color:var(--muted);line-height:1.8}
.salary-deduction-head>strong{padding:8px 14px;background:#eff5f1;border-radius:12px;white-space:nowrap}
.monthly-panel-head{align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:18px}
.monthly-panel-head #overviewMonthLabel{display:inline-flex;color:#426354;background:#edf3ef;padding:3px 10px;border-radius:7px;font-weight:700;font-size:var(--text-small)}
.month-navigation{display:flex;gap:8px;align-items:center}
.monthly-totals{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:20px}
.monthly-totals span{background:transparent;padding:0;border-radius:0;font-size:inherit}
.monthly-metric{display:grid;grid-template-columns:40px minmax(0,1fr);gap:4px 12px;align-items:center;padding:18px;border:1px solid transparent;border-radius:16px}
.monthly-metric-total{background:#edf5f0;border-color:#dce9df;color:#245643}
.monthly-metric-unpaid{background:#fff6e8;border-color:#efe0c3;color:#80561e}
.monthly-metric .summary-icon{grid-row:1/3;width:38px;height:38px;border-radius:11px;display:grid;place-items:center;background:#fff9;font-size:var(--text-heading)}
.monthly-totals .metric-label{display:block;font-size:var(--text-small);font-weight:700;color:inherit;line-height:1.8}
.monthly-totals b{display:block;margin:3px 0 0;font-size:var(--text-display);line-height:1.6;color:inherit}
.monthly-metric>small{grid-column:2;font-size:var(--text-small);opacity:.8}
.incoming-note{background:#f9f5e9;border:1px solid #eee5cd;padding:12px 16px;border-radius:12px;color:#7e612e}
.monthly-debts-list{display:grid;gap:11px}
.monthly-debt-row{border-radius:16px;padding:16px 18px;gap:16px;transition:border-color .15s,box-shadow .15s}
.monthly-debt-row:hover{border-color:#c9dbcf;box-shadow:0 4px 12px #183c3207}
.monthly-debt-company b{font-size:var(--text-body);color:#254438}
.monthly-debt-company small{font-size:var(--text-small);color:#6b7e73;line-height:1.8;margin-top:3px}
.monthly-debt-amount{font-size:var(--text-title);font-variant-numeric:tabular-nums;white-space:nowrap;unicode-bidi:isolate}
.monthly-company-icon{border-radius:12px;background:#eff5f1;color:#466958}
.monthly-debt-actions{gap:8px}
.creditor-group{border:1px solid #dfe9e2;border-radius:20px;background:#f8fbf9;margin-bottom:20px;overflow:hidden}
.creditor-heading{padding:16px 18px;gap:12px}
.creditor-name{font-size:var(--text-title);font-weight:800}
.creditor-heading>strong{background:#e2eee7;border:1px solid #d0e2d5;padding:10px 16px;border-radius:13px;font-size:var(--text-title);line-height:1.7;font-variant-numeric:tabular-nums;white-space:normal;max-width:46%;text-wrap:balance}
.creditor-content{padding:0 10px 10px}
.debt-card{border-radius:16px;box-shadow:none;border-color:#e4ece6}
.debt-card-head{gap:16px}
.debt-heading-copy h4{line-height:1.8;overflow-wrap:anywhere}
.debt-heading-copy p,.debt-note{line-height:1.9;color:#687b70}
.debt-info-grid{gap:10px}
.debt-info-item{background:#f7faf8;border-radius:10px;padding:11px}
.debt-info-item span{font-size:var(--text-small);color:#687b70}
.debt-info-item strong{font-size:var(--text-body);font-variant-numeric:tabular-nums}
.debt-balance{background:#eff5f1;border:1px solid #e2ebe5;border-radius:13px;padding:12px 16px}
.card-actions{gap:9px;border-top:1px solid #edf1ee;padding-top:14px;margin-top:14px}
.installment-row{padding:13px 0;gap:12px}
.installment-check{gap:10px;align-items:flex-start}
.installment-check input,.salary-installment-row input{accent-color:var(--green);width:18px;height:18px}
.installment-check small{line-height:1.8;color:#6a7c72}
.association-receipt{padding:18px 0;gap:16px}
.association-receipt>strong{background:#f4eedf;color:#7b5f27;padding:8px 13px;border-radius:10px;white-space:nowrap}
.setup-grid{gap:18px}
.setup-row{padding:14px 0;gap:12px}
.setup-panel .panel-head{align-items:flex-start}
.stack input,.modal-form input,.modal-form select,.modal-form textarea,.salary-form input{min-height:44px;border-color:#dce6df;background:#fafcfb;border-radius:11px}
.stack label,.modal-form label,.salary-form label{line-height:1.8;color:#466251}
.auth-card{padding:34px;border-radius:26px;box-shadow:0 18px 60px #183c3210}
.auth-tabs{padding:5px}
.auth-sub{color:#63776b;line-height:1.9}
.nav-link{border:1px solid transparent;border-radius:12px}
.nav-link.active{border-color:#dfe9e2;background:#eaf3ed;color:#1e5543}
.footer-note{color:#637468;line-height:1.9}

/* Modal headers and footers stay readable; only the contents scroll. */
body:has(.modal-layer:not(.hidden)),body:has(.confirm-layer:not(.hidden)){overflow:hidden}
.modal-layer{background:#142c2673;backdrop-filter:blur(5px);padding:24px}
.modal{width:min(100%,720px);max-height:calc(100dvh - 48px);padding:0;display:flex;flex-direction:column;overflow:hidden;border:1px solid #e1e9e3;border-radius:24px;box-shadow:0 28px 90px #102a2433}
.modal-head{padding:22px 25px 18px;margin:0;flex-shrink:0;border-bottom:1px solid #e6ede8;background:#fff;gap:16px}
.modal-head h3{font-size:var(--text-heading);line-height:1.5;margin:0;color:#264638}
.modal-head .eyebrow{font-size:var(--text-small);margin-bottom:5px}
.modal-navigation{display:flex;align-items:center;gap:8px;flex-shrink:0}
.modal-navigation .icon-btn{background:#f2f6f3;color:#6a7c71;border-radius:11px;border:0;font-size:var(--text-heading)}
.modal-navigation .btn{font-size:var(--text-small);min-height:39px;padding:7px 12px}
.modal-form{padding:22px 25px 0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#c4d5c9 transparent;min-height:0;gap:16px}
.modal-form .form-actions{position:sticky;bottom:0;padding:16px 0;margin:6px 0 0;background:white;z-index:1;border-top:1px solid #e6ede8;box-shadow:0 -8px 12px #fff9;gap:10px}
.modal-form .form-actions .btn{min-width:108px}
.modal-form>label:last-of-type{margin-bottom:4px}
.modal-form>.wide>p,.modal-form>p{line-height:1.9}
.details-modal-form{display:block}
.detail-heading{margin-bottom:18px}
.detail-kicker{font-size:var(--text-small);color:#637468}
.detail-heading h4{font-size:var(--text-title);margin:2px 0 0;color:#254b3a}
.detail-summary-grid{gap:10px;margin-bottom:24px;grid-template-columns:repeat(3,minmax(0,1fr))}
.detail-summary-grid .detail-metric{border:1px solid transparent;border-radius:13px;padding:14px;min-width:0}
.detail-summary-grid .detail-metric-identity{background:#f5f7f6;border-color:#e7ece8}
.detail-summary-grid .detail-metric-principal{background:#f0f4f7;border-color:#e0e7ee}
.detail-summary-grid .detail-metric-remaining{background:#edf5ef;border-color:#d6e6d9}
.detail-summary-grid span{display:block;font-size:var(--text-small);color:#637468;margin-bottom:7px}
.detail-summary-grid b{display:block;font-size:var(--text-body);color:#2e5541;overflow-wrap:anywhere}
.detail-section{padding:19px 0;border-top:1px solid #e7ede9}
.detail-section h4{margin:0 0 11px;font-size:var(--text-body);color:#375d49}
.detail-line{padding:11px 0;gap:18px;color:#5f7467;line-height:1.85;font-size:var(--text-small)}
.detail-line b{color:#315b45;white-space:nowrap;font-variant-numeric:tabular-nums}
.schedule-detail{align-items:center}
.schedule-detail>div{min-width:0}
.schedule-frequency{font-weight:700;color:#526f5d}
.schedule-detail small{display:block;color:#637468;font-size:var(--text-small);line-height:1.9}
.schedule-amount{padding:6px 10px;border-radius:8px;background:#f1f6f2;border:1px solid #e5ece7}
.detail-notes{background:#f7f9f7;padding:16px;border:1px solid #e6ede7;border-radius:12px;margin:10px 0 18px}
.detail-notes p{line-height:2;color:#65796a;font-size:var(--text-small);margin:0}
.monthly-dialog-summary{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;margin-bottom:6px}
.dialog-period{display:flex;align-items:center;gap:10px;padding:16px;background:#f4f7f5;border:1px solid #e4ebe6;border-radius:14px;flex-wrap:wrap}
.dialog-period .summary-icon{font-size:var(--text-heading);color:#5b7965}
.dialog-period .metric-label,.dialog-total .metric-label{display:block;font-size:var(--text-small);line-height:1.8}
.dialog-period b{display:block;font-size:var(--text-body);color:#4c6955;margin-top:3px}
.item-count{font-size:var(--text-small);color:#637468;border:1px solid #e1e9e3;padding:2px 8px;background:white;border-radius:99px;margin-inline-start:auto}
.dialog-total{padding:16px 19px;border:1px solid #cddfd2;border-radius:14px;background:#eaf3ed;color:#28523a;display:flex;flex-direction:column;justify-content:center}
.dialog-total strong{display:block;font-size:var(--text-display);line-height:1.7;margin-top:4px;color:#1f503b}
.monthly-group-details{gap:12px;margin-top:4px}
.monthly-group-detail{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:13px;padding:17px;border:1px solid #e2ebe4;border-radius:15px;background:white;align-items:start}
.monthly-group-detail .group-detail-copy{min-width:0;flex:initial}
.group-detail-copy>b{display:block;font-size:var(--text-body);line-height:1.9;color:#2c4c3a;overflow-wrap:anywhere}
.group-detail-copy small{font-size:var(--text-small);line-height:1.9;color:#637468;display:block;margin-top:5px}
.monthly-group-detail .group-detail-amount{align-self:start;background:#eff5f0;border:1px solid #e0ebe2;border-radius:10px;padding:7px 11px;font-size:var(--text-body);color:#2c5b40}
.group-detail-actions{grid-column:1/-1;display:flex;align-items:center;justify-content:flex-end;gap:8px;padding-top:11px;border-top:1px solid #edf1ee}
.payment-status{display:inline-block;font-size:var(--text-small);font-weight:700;border-radius:99px;padding:2px 8px;margin-top:8px}
.status-pending{color:#8b652d;background:#fff4df}
.status-paid{color:#397454;background:#e8f4eb}
.monthly-group-detail.is-paid{background:#fcfefc;border-color:#d9e9dc}

/* Confirmation: period, individual amounts, and the final sum are separate. */
.confirm-dialog{width:min(100%,510px);max-height:calc(100dvh - 48px);overflow:auto;overscroll-behavior:contain;padding:26px;border-radius:24px;scrollbar-width:thin}
.confirm-dialog h3{font-size:var(--text-heading);line-height:1.65;margin-bottom:8px}
.confirm-dialog>p{font-size:var(--text-small);line-height:1.95;color:#677b6d;margin-bottom:20px;max-width:420px}
.confirm-icon{width:48px;height:48px;border-radius:16px;font-size:var(--text-display);margin-bottom:12px}
.confirm-payment-details{background:transparent;border:0;padding:0;gap:12px;margin-bottom:20px}
.confirm-payment-details>.confirm-period{display:flex;align-items:center;justify-content:flex-start;background:#f2f5f3;border:1px solid #e3eae5;border-radius:11px;padding:11px 13px;gap:8px}
.confirm-period span{font-size:var(--text-small);color:#637468}
.confirm-payment-details .confirm-period b{margin-inline-start:auto;color:#4d6957;font-size:var(--text-small)}
.confirm-payment-details>.confirm-items{display:grid;gap:0;padding:3px 14px;border:1px solid #e4ebe6;background:#fff;border-radius:13px;max-height:240px;overflow-y:auto;scrollbar-width:thin}
.confirm-line{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:12px 0;border-bottom:1px solid #edf1ee}
.confirm-line:last-child{border-bottom:0}
.confirm-line span{color:#5f7565;font-size:var(--text-small);line-height:1.9;overflow-wrap:anywhere}
.confirm-line strong{font-size:var(--text-body);color:#385d45;flex-shrink:0}
.confirm-payment-details>.confirm-total{display:flex;flex-direction:column;align-items:flex-start;gap:3px;background:#1e5144;border:1px solid #1e5144;border-radius:14px;padding:16px 18px;color:#fff}
.confirm-payment-details .confirm-total>span{font-size:var(--text-small);color:#d4e6db}
.confirm-payment-details .confirm-total>strong{font-size:var(--text-display);color:white;text-align:start;line-height:1.7}
.confirm-meta{font-size:var(--text-small);color:#637468;margin:0;text-align:center}
.confirm-actions{gap:10px}
.confirm-actions .btn{border-radius:11px;font-size:var(--text-small);min-height:45px}
.toast{background:#1d4234;color:white;border-radius:12px;padding:12px 18px;line-height:1.8;max-width:min(90vw,460px)}

@media(max-width:760px){
 .main{padding:20px 16px calc(100px + env(safe-area-inset-bottom))}
 .topbar{margin-bottom:18px;padding-bottom:14px}
 .overview-stats .stat-card{padding:17px;min-height:128px}
 .monthly-debt-row{padding:14px;gap:12px}
 .monthly-debt-company b{font-size:var(--text-body)}
 .monthly-debt-amount{font-size:var(--text-title)}
 .creditor-heading{flex-wrap:wrap;padding:14px;gap:9px}
 .creditor-heading>strong{font-size:var(--text-body);padding:8px 12px;max-width:55%}
 .modal-layer{padding:12px}
 .modal{max-height:calc(100dvh - 24px);border-radius:20px}
 .modal-head{padding:18px 18px 15px;gap:10px}
 .modal-head h3{font-size:var(--text-heading)}
 .modal-form{padding:18px 18px 0;gap:13px}
 .detail-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .detail-summary-grid .detail-metric-identity{grid-column:1/-1;display:flex;align-items:center;gap:15px}
 .detail-summary-grid .detail-metric-identity span{margin:0}
 .detail-summary-grid .detail-metric-identity b{margin-inline-start:auto}
 .modal-navigation .btn{font-size:var(--text-small);padding:6px 9px}
 .monthly-metric{padding:14px;gap:3px 9px;grid-template-columns:32px minmax(0,1fr)}
 .monthly-metric .summary-icon{width:30px;height:32px;font-size:var(--text-title);border-radius:9px}
 .monthly-totals b{font-size:var(--text-heading)}
 .monthly-totals .metric-label{font-size:var(--text-small)}
 .monthly-metric>small{font-size:var(--text-small)}
 .mobile-nav{padding-bottom:max(8px,env(safe-area-inset-bottom));box-shadow:0 -5px 24px #183c3209;border-top:1px solid #dfe8e1}
 .mobile-nav button{min-height:48px}
}
@media(max-width:480px){
 .overview-stats{grid-template-columns:1fr;gap:12px}
 .overview-stats .stat-card{min-height:0;display:flex;flex-direction:column;align-items:flex-start;padding:18px}
 .overview-stats .stat-card strong{font-size:var(--text-display);margin:7px 0 2px}
 .monthly-totals{grid-template-columns:1fr;gap:10px}
 .monthly-metric{grid-template-columns:34px minmax(0,1fr);padding:13px 15px}
 .monthly-totals b{font-size:var(--text-heading)}
 .monthly-metric>small{font-size:var(--text-small)}
 .monthly-debt-row{grid-template-columns:minmax(0,1fr) auto;gap:13px}
 .monthly-debt-company{grid-column:1/-1}
 .monthly-debt-actions{justify-content:flex-end;grid-column:2;grid-row:2}
 .monthly-debt-amount{grid-column:1;grid-row:2;padding-inline-start:2px}
 .monthly-debt-actions .mini-btn{font-size:var(--text-small);min-height:39px;padding:7px 12px}
 .monthly-dialog-summary{grid-template-columns:1fr;gap:9px}
 .dialog-period{padding:12px 14px;flex-wrap:nowrap}
 .dialog-period b{font-size:var(--text-small)}
 .dialog-total{padding:14px 17px;flex-direction:row;align-items:center;justify-content:space-between;gap:12px}
 .dialog-total strong{font-size:var(--text-heading);margin:0}
 .dialog-total .metric-label{max-width:100px}
 .monthly-group-detail{padding:14px;gap:11px}
 .monthly-group-detail .group-detail-amount{padding:6px 9px;font-size:var(--text-body)}
 .group-detail-copy>b{font-size:var(--text-small)}
 .group-detail-actions{justify-content:stretch}
 .group-detail-actions .mini-btn{flex:1;font-size:var(--text-small)}
 .modal-form .form-actions .btn{min-width:0;flex:1;font-size:var(--text-small)}
 .modal-head h3{font-size:var(--text-title)}
 .modal-navigation .icon-btn{min-width:34px;min-height:36px}
 .confirm-layer{padding:12px;align-items:center}
 .confirm-dialog{padding:22px 17px;border-radius:22px;max-height:calc(100dvh - 24px)}
 .confirm-dialog h3{font-size:var(--text-heading)}
 .confirm-payment-details>.confirm-items{max-height:200px}
 .confirm-payment-details .confirm-total>strong{font-size:var(--text-display)}
 .confirm-actions{flex-direction:row}
 .confirm-actions .btn{font-size:var(--text-small);padding:9px 11px}
 .creditor-name{font-size:var(--text-body)}
 .creditor-heading>strong{max-width:100%;min-width:0;line-height:1.8}
 .auth-card{padding:26px 22px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}


/* One type scale on every screen; hierarchy comes from weight, colour and spacing. */
:root{--text-small:13px;--text-body:14px;--text-title:16px;--text-heading:20px;--text-display:24px}
body{font-size:var(--text-body);line-height:1.8}
h1,h2,h3,h4,p{overflow-wrap:anywhere}
button,input,select,textarea{font-family:inherit}
:is(.auth-card h1,.topbar h2,.welcome h3){font-size:var(--text-display);line-height:1.5;font-weight:700}
:is(.panel-head h3,.section-toolbar h3,.modal-head h3,.confirm-dialog h3,#resetPasswordTitle){font-size:var(--text-heading);line-height:1.6;font-weight:700}
:is(.creditor-name,.debt-title h4,.debt-heading-copy h4,.deduction-card h4,.form-section h4,.detail-heading h4,.detail-section h4,.brand b){font-size:var(--text-title);line-height:1.7;font-weight:700;letter-spacing:normal}
:is(.user-chip,.user-chip span,.user-chip b,.user-chip strong){font-size:var(--text-body);line-height:1.7}
.user-chip{gap:8px;padding:6px 10px;max-width:55%;overflow-wrap:anywhere}
.user-chip .avatar{font-size:var(--text-body);width:32px;height:32px;flex:0 0 32px}
:is(.stack label,.salary-form label,.modal-form label,.tab,.btn,.mini-btn,.text-btn,.logout,.setup-row b,.preview-row b,.break-row,.detail-line,.confirm-line span,.association-receipt b,.note-panel b){font-size:var(--text-body);line-height:1.8}
:is(.stack input,.salary-form input,.modal-form input,.modal-form select,.modal-form textarea,.custom-select-trigger,.custom-date-trigger,.custom-select-option){font-size:var(--text-body);line-height:1.8}
.repeat-row label{font-size:var(--text-body)!important}
.repeat-row input,.repeat-row select{font-size:var(--text-body)!important}
:is(.tiny,.muted,.eyebrow,.auth-sub,.welcome-kicker,.welcome p:last-child,.brand small,.footer-note,.sync-state,.error,.nav-link span,.mobile-nav button small,.debt-note,.debt-meta,.debt-heading-copy p,.debt-title p,.debt-balance small,.debt-info-item>span,.debt-info-item>strong small,.debt-progress-heading,.debt-progress-heading strong small,.debt-progress-foot,.debt-extra-line,.next-installment,.next-installment small,.installment-count-badge,.creditor-count,.installment-check small,.salary-installment-main small,.salary-installment-status,.salary-hint,.salary-deduction-head p,.salary-deduction-foot,.salary-deduction-foot b,.salary-summary-item,.month-chip,.form-section p,.setup-row small,.association-receipt p,.association-receipt small,.detail-summary-grid span,.detail-section p,.detail-kicker,.detail-notes p,.schedule-detail small,.group-detail-copy small,.payment-status,.confirm-dialog>p,.confirm-period span,.confirm-meta,.recovery-hint,.payment-help,.note-panel p,.attachment-links a,.detail-attachment,.custom-file-status,.custom-file-names,.custom-file-clear,.custom-file-button,.calendar-weekdays,.calendar-day,.calendar-foot button){font-size:var(--text-small);line-height:1.85}
:is(.monthly-totals .metric-label,.monthly-metric>small,.dialog-period .metric-label,.dialog-total .metric-label,.item-count,.confirm-payment-details .confirm-total>span,.monthly-debt-company small,.overview-stats .stat-card span,.overview-stats .stat-card small,.net-panel span,.net-panel small){font-size:var(--text-small);line-height:1.8}
:is(.monthly-debt-company b,.group-detail-copy>b,.installment-check b,.salary-installment-main b,.manual-payments>b,.debt-info-item>strong,.dialog-period b,.confirm-payment-details .confirm-period b){font-size:var(--text-body);line-height:1.8}
:is(.creditor-heading>strong,.debt-balance strong,.debt-remaining strong,.monthly-debt-amount,.monthly-group-detail .group-detail-amount,.detail-summary-grid b,.detail-line b,.next-installment strong,.deduction-amount,.preview-row strong,.salary-summary-item strong,.salary-installment-row>strong,.salary-deduction-head>strong,.association-receipt>strong,.confirm-line strong){font-size:var(--text-title);line-height:1.7;font-weight:700;letter-spacing:normal;font-variant-numeric:tabular-nums}
:is(.overview-stats .stat-card strong,.stat-card strong,.net-panel strong,.monthly-totals b,.dialog-total strong,.confirm-payment-details .confirm-total>strong){font-size:var(--text-display);line-height:1.6;font-weight:700;letter-spacing:normal}
.debt-card .card-actions .mini-btn,.installment-actions .mini-btn,.modal-navigation .btn,.month-navigation .btn,.group-detail-actions .mini-btn,.modal-form .form-actions .btn,.confirm-actions .btn,.monthly-debt-actions .mini-btn{font-size:var(--text-body);line-height:1.7}
.creditor-heading{min-height:68px;padding:14px 18px;gap:12px}
.creditor-heading>strong{padding:7px 12px;min-width:112px;max-width:55%;border-radius:10px;box-shadow:none}
.creditor-count{padding:3px 9px}
.creditor-group{margin-bottom:16px;border-radius:16px}
.creditor-content:has(>.debt-card):not(.collapsed){padding:0 12px 12px}
.creditor-content.collapsed{padding:0}
.overview-stats .stat-card{min-height:124px;padding:20px}
.overview-stats .stat-card strong{margin:8px 0 4px}
.panel,.setup-panel{border-radius:16px}
.monthly-debt-row{padding:15px 16px}
.debt-balance{padding:9px 12px}
.money-value{letter-spacing:normal}
.manual-payments>div,.attachment-existing,.recovery-result label,#recoveryStatus,.custom-file-status,.custom-file-names{font-size:var(--text-small);line-height:1.85}
.debt-progress-heading strong{font-size:var(--text-small)}
.monthly-panel-head #overviewMonthLabel,.toast{font-size:var(--text-body)}
.recovery-result input{font-size:var(--text-body)}
#resetPasswordForm [name=code]{font-size:var(--text-small)}
@media(max-width:600px){
 .topbar{gap:12px;align-items:center}
 .topbar h2{font-size:var(--text-heading)}
 .user-chip{padding:5px 8px;gap:6px;max-width:56%}
 .creditor-heading{padding:12px;gap:8px;min-height:64px}
 .creditor-heading>strong{min-width:0;padding:7px 10px}
 .creditor-name{flex:1;min-width:0}
 .creditor-content:has(>.debt-card):not(.collapsed){padding:0 8px 8px}
 .overview-stats .stat-card{padding:17px;min-height:0}
 .mobile-nav button small{font-size:var(--text-small)}
 .modal-head{align-items:flex-start}
 .confirm-actions,.group-detail-actions{flex-wrap:wrap}
}

/* Dialog controls belong in the header flow, never over its title. */
.modal-head{display:flex;align-items:center;padding:18px 22px;min-height:76px;position:static}
.modal-head>div:first-child{min-width:0;flex:1}
.modal-head .modal-navigation{position:static;display:flex;align-items:center;gap:8px;flex:none}
.modal-head .icon-btn{position:static;inset:auto;margin:0;width:40px;height:40px;min-width:40px;flex:0 0 40px;border:1px solid #e2e9e5;border-radius:12px}
.modal-navigation .btn{white-space:nowrap}
.modal-head .eyebrow{margin:0 0 3px}
.modal-head h3{margin:0}
.user-chip{border-radius:14px;background:#fff;box-shadow:0 3px 12px #183c3205;padding:8px 12px;gap:10px;border-color:#dee8e1}
.user-chip .avatar{width:36px;height:36px;flex-basis:36px;border-radius:11px;background:#e6f0ea;font-weight:700}
#userName{color:#294b3e;font-weight:600;line-height:1.6}
.debt-list{gap:12px}
.creditor-group{margin-bottom:0}
.creditor-heading{min-height:64px;padding:12px 16px}
.sidebar{padding:24px 16px 18px;background:linear-gradient(180deg,#fff,#f8fbf9);border-inline-start:1px solid #e0e9e3;box-shadow:-5px 0 24px #183c3204;overflow-y:auto}
.sidebar .brand{padding:0 10px 24px;gap:12px;margin-bottom:14px;border-bottom:1px solid #e5ece7}
.side-nav{gap:8px}
.sidebar .nav-link{min-height:48px;border-radius:13px;padding:12px 14px;color:#5c7265;border:1px solid transparent;transition:background .15s,color .15s}
.sidebar .nav-link span{font-size:var(--text-body);font-weight:600}
.sidebar .nav-link:hover{background:#edf4ef;color:#245541}
.sidebar .nav-link.active{background:#1f5144;color:#fff;border-color:#1f5144;box-shadow:0 4px 10px #1f514414}
.side-bottom{padding-top:24px}
.sync-state{padding:12px;background:#eef5f0;border:1px solid #e0eae3;border-radius:12px;gap:10px}
.logout{width:100%;text-align:start;margin-top:8px;border-radius:10px;min-height:44px}
.logout:hover{background:#faf0ed}
.date-format-setting{display:grid;gap:8px;font-size:var(--text-body);color:#466251}
.date-format-setting select{width:100%;max-width:100%;min-height:46px;padding:10px 12px;border:1px solid #dce6df;border-radius:11px;background:#fafcfb;color:var(--ink);font-size:var(--text-body)}
.main,.panel,.debt-card,.monthly-group-detail,.setup-panel{min-width:0}
@media(max-width:700px){
 .modal-head{padding:16px;gap:12px;align-items:center}
 .modal-head h3{font-size:var(--text-title)}
 .modal-navigation{gap:6px}
 .modal-navigation .btn{padding:7px 9px;min-width:0}
 .modal-head .icon-btn{width:36px;height:36px;min-width:36px;flex-basis:36px}
 .modal-form{grid-template-columns:minmax(0,1fr)}
 .modal-form .wide,.modal-form .form-actions{grid-column:1/-1}
 .setup-grid{grid-template-columns:minmax(0,1fr)}
 .section-toolbar,.panel-head{flex-wrap:wrap}
 .toolbar-actions{display:flex;flex-wrap:wrap;gap:8px}
 .salary-summary,.debt-info-grid{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:650px){
 .sidebar{display:none}
 .main{margin-inline:0}
 .mobile-nav{gap:4px;padding-inline:8px;background:#fffffffa}
 .mobile-nav button{border-radius:12px;gap:4px;min-height:52px}
 .mobile-nav button.active{background:#e8f2ec;color:#1f5144}
 .user-chip{padding:6px 9px;max-width:55%;gap:7px}
 .user-chip .avatar{width:32px;height:32px;flex-basis:32px}
 #userName{font-size:var(--text-small)}
}
@media(max-width:380px){
 .modal-head{flex-wrap:wrap}
 .modal-head>div:first-child{flex-basis:100%}
 .modal-head .modal-navigation{margin-inline-start:auto}
 .monthly-group-detail{grid-template-columns:minmax(0,1fr)}
 .monthly-group-detail .group-detail-amount{justify-self:start}
 .detail-summary-grid{grid-template-columns:minmax(0,1fr)}
}

.nav-icon{width:21px;height:21px;flex:0 0 21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

.monthly-title-row{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;min-width:0}
.monthly-title-row h3{margin:0;flex-shrink:0}
.monthly-panel-head .monthly-title-row #overviewMonthLabel{margin:0;white-space:nowrap;font-size:var(--text-small);padding:3px 8px}
@media(max-width:380px){.monthly-title-row{gap:6px}.monthly-title-row h3{font-size:var(--text-title)}}
.group-detail-actions:empty{display:none}

.account-menu{position:relative;max-width:56%;min-width:0;flex-shrink:0}
.account-menu .user-chip{max-width:100%;text-align:start;cursor:pointer;color:var(--ink)}
.account-menu #userName{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.account-chevron{color:#63766d;flex:none;transition:transform .15s}
.user-chip[aria-expanded=true]{background:#edf5ef;border-color:#b8cfc0}
.user-chip[aria-expanded=true] .account-chevron{transform:rotate(180deg)}
.account-dropdown{position:absolute;inset-inline-end:0;top:calc(100% + 8px);z-index:15;width:190px;max-width:calc(100vw - 32px);padding:6px;border:1px solid #dfe8e2;border-radius:14px;background:white;box-shadow:0 10px 28px #183c3218}
.account-dropdown .logout{margin:0;padding:10px 12px;border:0;background:transparent;font-size:var(--text-body);min-height:44px;color:#9a4e45}
.account-dropdown .logout:hover{background:#faf0ed}

/* Calm, focused account entry. */
.auth-wrap{padding:32px 20px;min-height:100dvh;background:radial-gradient(ellipse at 85% 10%,#e0eee5 0,transparent 46%),radial-gradient(ellipse at 10% 90%,#f2eadb 0,transparent 42%),#f5f8f6}
.auth-card{width:min(100%,440px);padding:32px;border-radius:24px;border:1px solid #dfe9e2;box-shadow:0 16px 48px #254a3a0c}
.auth-card .brand-image{width:72px;height:72px;margin:0 auto 6px}
.auth-card h1{font-size:24px;line-height:1.6;margin:0;color:#214d3f}
.auth-card .auth-sub{font-size:14px;line-height:1.8;margin:7px 0 26px;color:#61766a}
.auth-tabs{display:flex;gap:4px;border:1px solid #e4ece6;border-radius:13px;padding:4px;background:#f1f5f2;margin-bottom:24px}
.auth-tabs .tab{min-height:44px;font-size:14px;font-weight:600;border-radius:9px;color:#607568}
.auth-tabs .tab.active{background:#fff;color:#214f40;box-shadow:0 2px 6px #204b3a0a}
.auth-card .stack{gap:10px}
.auth-card .stack label{gap:8px;font-weight:600;font-size:14px;color:#3c594a;margin-top:4px}
.auth-card .stack input{min-height:48px;font-size:14px;border-radius:11px;border:1px solid #dbe6de;background:#fbfdfb;padding:11px 13px}
.auth-card input::placeholder{color:#83958a;opacity:1;font-weight:400}
.auth-password-field{position:relative;display:flex;align-items:center;margin-bottom:8px}
.auth-card .auth-password-field input{padding-inline-end:70px;width:100%;min-width:0}
.auth-password-field button{position:absolute;inset-inline-end:6px;top:5px;bottom:5px;min-width:54px;border:0;background:#edf4ef;color:#2c5e47;border-radius:8px;font-size:13px;font-weight:600;padding:5px 9px}
.auth-password-field button:hover{background:#e1eee5}
.auth-card .btn.full{min-height:48px;margin-top:5px;border-radius:11px;font-size:14px}
.auth-card .forgot-password{margin:10px 0 18px;min-height:40px;font-size:13px;text-decoration:underline;text-underline-offset:4px}
.auth-card>.tiny{padding-top:18px;margin:0;border-top:1px solid #e6ede8;font-size:13px;line-height:1.85;color:#64796b}
.auth-card .error:empty{display:none}
.auth-card .error:not(:empty){background:#fff2ef;border:1px solid #efd7d0;border-radius:10px;padding:10px 12px;margin:4px 0 0;font-size:13px;line-height:1.85;text-align:start}
@media(max-width:480px){.auth-wrap{padding:20px 16px}.auth-card{padding:26px 22px;border-radius:20px}.auth-card .auth-sub{margin-bottom:22px}.auth-card .brand-image{width:64px;height:64px}}
@media(max-height:700px){.auth-wrap{align-items:start;padding-block:20px}.auth-card .brand-image{width:56px;height:56px}}

.custom-select-menu{padding:7px;border-radius:13px;max-height:min(280px,42dvh);overscroll-behavior:contain}
.custom-select-option{position:relative;min-height:44px;padding:10px 13px;padding-inline-end:36px;border-radius:9px;line-height:1.8}
.custom-select-option.selected{background:#e8f2ec;color:#24583f;font-weight:700}
.custom-select-option.selected:after{content:'✓';position:absolute;inset-inline-end:12px;top:50%;transform:translateY(-50%);font-size:15px;color:#2e7552}
.custom-select-option:hover,.custom-select-option:focus-visible{background:#f0f6f2;outline:2px solid #8db5a0;outline-offset:-2px}
.account-dropdown .logout{display:flex;align-items:center;gap:9px;text-align:start;border-radius:9px}
.account-dropdown .logout:focus-visible{outline:2px solid #d5aaa0;outline-offset:-2px;background:#faf0ed}

/* Compact account action with a clear, full-width target. */
.account-menu .user-chip{border-radius:13px;border:1px solid #dce7e0;background:#fff;box-shadow:0 2px 8px #214b3b06;padding:7px 10px;gap:9px}
.account-menu .user-chip:hover{background:#f5f9f6;border-color:#b5cfbf}
.account-menu .user-chip[aria-expanded=true]{background:#eaf3ed;border-color:#8fb59f;box-shadow:0 0 0 3px #dfece480}
.account-menu .avatar{background:#e4eee7;color:#285a44;border-radius:10px}
.account-menu .account-chevron{width:17px;height:17px;stroke:#5e7d6a;stroke-width:1.8;fill:none;stroke-linecap:round;stroke-linejoin:round;flex:0 0 17px}
.account-menu .account-dropdown{width:212px;padding:8px;top:calc(100% + 10px);border-radius:16px;border:1px solid #dce7e0;box-shadow:0 12px 32px #1d41361c;background:#fff}
.account-menu .account-dropdown .logout{width:100%;display:flex;align-items:center;justify-content:flex-start;gap:11px;padding:9px 10px;margin:0;min-height:54px;background:#fff5f2;border:1px solid #f2e0db;border-radius:11px;color:#984f43;font-size:14px;font-weight:600;text-align:start;line-height:1.7}
.account-menu .account-dropdown .logout:hover{background:#fbe8e2;border-color:#e7bdb1;color:#853e33}
.account-menu .account-dropdown .logout:focus-visible{outline:2px solid #bd8070;outline-offset:2px;background:#fff5f2}
.logout-icon{width:32px;height:32px;flex:0 0 32px;display:grid;place-items:center;border-radius:9px;background:#f5e2db;color:#a05b49}
.logout-icon svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:380px){.account-menu .account-dropdown{width:196px}.account-menu .user-chip{gap:6px;padding:6px 8px}}

/* Intrinsic account width; the menu shares its exact edges. */
.account-menu{display:inline-block;width:max-content;max-width:56%;min-width:0}
.account-menu .user-chip{width:max-content;max-width:100%;min-width:0;white-space:nowrap}
.account-menu .account-dropdown{inset-inline:0;width:100%;min-width:0;max-width:none;padding:5px;top:calc(100% + 8px);border-radius:13px;box-sizing:border-box}
.account-menu .account-dropdown .logout{gap:7px;padding:8px 7px;font-size:13px;min-height:44px;justify-content:center;white-space:nowrap}
.account-menu .logout-icon{width:26px;height:28px;flex-basis:26px;border-radius:7px}
.account-menu .logout-icon svg{width:17px;height:17px}

@media(display-mode:standalone){html{overscroll-behavior-y:none}}
.pull-refresh{position:fixed;top:calc(env(safe-area-inset-top) + 8px);left:50%;transform:translate(-50%,calc(var(--pull,40px) - 25px));z-index:18;padding:9px 17px;max-width:90vw;border:1px solid #d1e3d7;border-radius:99px;background:#fff;color:#285942;box-shadow:0 5px 20px #183c3218;font-size:14px;text-align:center;pointer-events:none}
.pull-refresh.is-refreshing{background:#eaf3ed}

/* Installed app gestures: allow scrolling, prevent pinch and double-tap zoom. */
html.installed-app,html.installed-app body{touch-action:pan-x pan-y}
html.installed-app :is(button,a,input,select,textarea,label){touch-action:pan-x pan-y}
@media(max-width:760px){html.installed-app input,html.installed-app select,html.installed-app textarea,html.installed-app .stack input,html.installed-app .modal-form input,html.installed-app .modal-form select,html.installed-app .modal-form textarea,html.installed-app .salary-form input,html.installed-app #resetPasswordForm [name=code],html.installed-app .repeat-row input,html.installed-app .repeat-row select{font-size:16px!important}}

.prior-payment-section{padding:16px;border:1px solid #dce8df;border-radius:13px;background:#f5f9f6}
.modal-form .prior-payment-toggle{display:flex;align-items:center;gap:10px;cursor:pointer;margin:0}
.modal-form .prior-payment-toggle input{width:18px;height:18px;min-height:18px;flex:0 0 18px;accent-color:var(--green);padding:0}
.prior-payment-dates{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:16px}
.prior-payment-dates p{margin:0;grid-column:1/-1}
@media(max-width:480px){.prior-payment-dates{grid-template-columns:minmax(0,1fr)}}

/* Keep creditor identity, count and totals independent at narrow widths. */
.creditor-heading{display:grid;grid-template-columns:24px minmax(0,1fr) auto;align-items:center;gap:10px 12px;text-align:start}
.creditor-heading-copy{display:grid;gap:5px;min-width:0}
.creditor-identity{display:flex;align-items:center;flex-wrap:wrap;gap:6px 9px;min-width:0}
.creditor-identity .creditor-name{flex:initial;min-width:0;overflow-wrap:anywhere;line-height:1.7}
.creditor-identity .creditor-count{flex:none;white-space:nowrap;margin:0;font-size:12px;padding:2px 8px;line-height:1.8}
.creditor-recurring-note{display:block;font-size:12px;line-height:1.8;color:#627a69;font-weight:500}
.creditor-heading>strong{margin:0;min-width:0;max-width:none;white-space:nowrap;text-wrap:initial;font-size:16px;line-height:1.8;padding:7px 11px}
@media(max-width:480px){
 .creditor-heading{grid-template-columns:24px minmax(0,1fr);gap:9px;padding:13px}
 .creditor-heading>.creditor-chevron{grid-row:1;align-self:start;margin-top:3px}
 .creditor-heading-copy{grid-column:2}
 .creditor-heading>strong{grid-column:2;justify-self:start;max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:start;font-size:15px}
 .creditor-identity .creditor-name{font-size:16px}
 .creditor-recurring-note{line-height:1.8}
}

@media(max-width:480px){
 .creditor-heading{grid-template-columns:24px minmax(0,1fr) auto;gap:9px}
 .creditor-heading-copy{grid-column:2;grid-row:1}
 .creditor-heading>strong{grid-column:3;grid-row:1;justify-self:end;align-self:center;max-width:100%;white-space:nowrap;font-size:14px;padding:7px 9px}
 .creditor-identity{gap:5px;align-items:flex-start}
 .creditor-identity .creditor-count{font-size:12px}
 .creditor-recurring-note{font-size:12px;overflow-wrap:anywhere}
}
@media(max-width:360px){
 .creditor-heading{grid-template-columns:22px minmax(0,1fr) auto;gap:6px;padding:11px 9px}
 .creditor-heading>strong{font-size:13px;padding:6px 7px}
 .creditor-identity .creditor-name{font-size:14px}
}

.number-format-setting{margin-top:18px}
.modal.setup-entry-modal{min-height:min(580px,calc(100dvh - 48px))}
.setup-entry-form{flex:1;align-content:start}
.setup-entry-form .custom-select-menu{position:static;margin-top:8px;max-height:190px;box-shadow:none}
.add-provider-type{justify-self:start;padding:5px 0;min-height:36px}
.setup-row{padding:14px 16px;gap:16px;align-items:center;flex-direction:row}
.setup-row>div:first-child{min-width:0;flex:1}
.setup-row b{overflow-wrap:anywhere}
.setup-row>div:last-child{width:auto;display:flex;gap:8px;flex:none;flex-wrap:wrap;align-items:center}
.setup-row .mini-btn{min-height:38px;padding:7px 13px}
.setup-list{gap:10px}
@media(max-width:480px){.setup-row{padding:13px;gap:12px;flex-wrap:wrap}.setup-row>div:last-child{gap:8px;margin-inline-start:auto}.modal.setup-entry-modal{min-height:min(560px,calc(100dvh - 24px))}}

.display-preferences{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}
.display-preferences .date-format-setting{margin:0;min-width:0}
.display-preferences .custom-select-trigger{padding:10px;gap:7px;min-width:0}
.display-preferences .custom-select-trigger span{min-width:0;overflow-wrap:anywhere}
.display-preferences .custom-select-option{white-space:normal;overflow-wrap:anywhere}
.add-provider-type{padding:8px 12px;border-radius:9px;line-height:1.8;margin-top:3px;min-height:40px}
.add-provider-type:hover{background:#edf4ef}
@media(max-width:480px){.display-preferences{gap:10px}.display-preferences .custom-select-trigger{font-size:13px}}

.account-dropdown .account-settings{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;min-height:44px;padding:8px 7px;margin:0 0 6px;border:1px solid transparent;border-radius:11px;background:transparent;color:#345b47;font-size:13px;font-weight:600;line-height:1.7;white-space:nowrap;text-align:start}
.account-dropdown .account-settings:hover,.account-dropdown .account-settings:focus-visible{background:#edf4ef;border-color:#dce8df}
.account-settings-icon{width:26px;height:28px;flex:0 0 26px;display:grid;place-items:center;border-radius:7px;background:#e8f1eb}
.account-settings-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

.provider-group{border:1px solid #e0e9e3;border-radius:13px;overflow:hidden;background:#fff}
.provider-group>summary{display:flex;align-items:center;gap:10px;cursor:pointer;list-style:none;padding:14px;font-size:14px;font-weight:700;background:#f5f9f6}
.provider-group>summary::-webkit-details-marker{display:none}
.provider-group>summary small{font-size:12px;color:#63776a;font-weight:500;margin-inline-start:auto}
.provider-group-arrow{transition:transform .15s}.provider-group[open] .provider-group-arrow{transform:rotate(180deg)}
.provider-group-items{padding:10px;display:grid;gap:9px}.provider-group-items p{padding:5px;margin:0}
.account-menu .account-dropdown{width:max(100%,172px);inset-inline-start:auto;inset-inline-end:0;padding:6px;display:grid;gap:5px}
.account-menu .account-dropdown[hidden]{display:none}
.account-dropdown .account-settings,.account-menu .account-dropdown .logout{display:flex;justify-content:flex-start;gap:10px;text-align:start;margin:0;padding:9px 11px;min-height:44px;border:1px solid transparent;background:transparent;border-radius:9px}
.account-menu .account-dropdown .logout{color:#984f43}
.account-menu .account-dropdown .logout:hover{background:#fff0eb;border-color:#efd5cc}
.account-dropdown .account-settings:hover{background:#edf4ef;border-color:#dce8df}
.account-dropdown .account-settings:focus-visible,.account-menu .account-dropdown .logout:focus-visible{outline:2px solid #92b59f;outline-offset:-2px}
.account-settings-icon,.account-menu .logout-icon{width:28px;height:28px;flex-basis:28px}

.calculated-total{padding:14px;background:#edf5ef;border:1px solid #d7e7dc;border-radius:12px;display:grid;gap:4px}
.calculated-total>span{font-size:13px;color:#526e5d}.calculated-total output{font-size:20px;font-weight:700;color:#28563e}.calculated-total small{font-size:12px;color:#657b6b}
.installment-date-group{border:1px solid #e3eae5;border-radius:12px;margin:10px 0;overflow:hidden}
.installment-date-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;background:#f2f7f3;font-size:13px;color:#52705d}
.installment-date-heading strong{font-size:15px;color:#28563e;white-space:nowrap}
.installment-date-group .installment-row{margin:0;padding:12px}
.installment-parts>summary{padding:11px 12px;cursor:pointer;color:#54735e;font-size:13px}
.installment-parts>summary span{margin-inline-start:10px;color:#2d5b43}
.debt-card-summary{cursor:pointer;list-style:none;margin:0}.debt-card-summary::-webkit-details-marker{display:none}
.debt-card-summary:after{content:'⌄';color:#54735e;flex:none;margin-inline-start:8px;transition:transform .15s}
.debt-card[open]>.debt-card-summary:after{transform:rotate(180deg)}
.debt-card-body{margin-top:16px}
.overview-deductions-panel{margin-top:18px}
.overview-deductions-panel .panel-head>strong{color:#8b652d;background:#faf1e2;padding:7px 12px;border-radius:9px;white-space:nowrap}
.overview-deduction-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 0;border-top:1px solid #edf1ee}
.overview-deduction-row small{display:block;color:#6b7d71;font-size:12px;margin-top:3px}
.overview-deduction-row b{font-size:14px}.overview-deduction-row>strong{color:#375f49;white-space:nowrap;font-size:15px}
@media(max-width:480px){.debt-card-summary{flex-wrap:wrap}.debt-card-summary .debt-balance{margin-inline-start:auto}.installment-date-heading{flex-wrap:wrap}}

.debt-card-summary{display:grid;grid-template-columns:minmax(0,1fr) auto 28px;align-items:center;gap:14px}
.debt-card-summary .debt-title{min-width:0}.debt-card-summary .debt-heading-copy{min-width:0}
.debt-card-summary .debt-balance{margin:0;justify-self:end}
.debt-card-summary:after{content:'⌄';width:28px;height:28px;margin:0;border-radius:9px;background:#eaf3ed;display:grid;place-items:center;font-size:23px;line-height:1;color:#42715b}
.provider-group-arrow{display:grid;place-items:center;width:26px;height:26px;flex:0 0 26px;border-radius:8px;background:#e6f0e9;color:#42715b;font-size:20px;line-height:1}
.display-settings-panel{grid-column:1/-1}
.schedule-estimate{grid-column:1/-1;margin:0;padding:9px 12px;border-radius:9px;background:#edf5ef;color:#315e45;font-size:13px;line-height:1.8}
.association-panel .panel-head{gap:14px;align-items:center;flex-wrap:wrap}
.association-panel .panel-head .btn{white-space:normal}
.association-receipt .receipt-status{display:inline-block;padding:3px 9px;border-radius:99px;background:#edf5ef;color:#3b6c51;font-size:12px;margin-top:4px}
.recovery-panel .recovery-hint{margin:0;line-height:1.9}
@media(max-width:480px){.debt-card-summary{grid-template-columns:minmax(0,1fr) auto 24px;gap:8px}.debt-card-summary:after{width:24px;height:24px;font-size:20px}.debt-card-summary .debt-balance{padding:8px;min-width:0}.debt-card-summary .debt-balance strong{font-size:14px}.debt-card-summary .debt-balance small{font-size:12px}.association-panel .panel-head .btn{width:100%}}

/* Draw chevrons consistently, independent of Arabic font glyphs. */
.provider-group-arrow svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.debt-card-summary:after{content:'';background:#eaf3ed url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%2342715b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px 16px no-repeat}
details.debt-card{padding:12px 16px}
.debt-card-summary .debt-balance{padding:6px 12px}
.debt-card-summary .debt-balance small{line-height:1.5;margin:0}
.debt-card-summary .debt-balance strong{line-height:1.5}
.calendar-weekdays{gap:4px;margin:10px 0 7px;align-items:center}
.calendar-weekdays>span{min-width:0;display:grid;place-items:center;padding:4px 0;line-height:1.4;color:#516b5b}
.calendar-weekdays abbr{font-size:11px;line-height:1.4;white-space:nowrap;text-decoration:none;cursor:default;font-weight:700}
.monthly-debts-list.empty-state{color:#3c5f4d;background:#f0f6f2;border:1px dashed #c7dace;border-radius:12px;padding:22px 16px;font-size:14px;font-weight:600;line-height:1.9}
.deduction-payment-actions{display:flex;gap:8px;align-items:center}
.overview-deduction-row>div:first-child{flex:1;min-width:0}.overview-deduction-row{flex-wrap:wrap}
.deduction-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
@media(max-width:480px){details.debt-card{padding:11px 12px}.deduction-payment-actions{margin-inline-start:auto}.calendar-weekdays abbr{font-size:10px}}
/* Quiet, consistent scrolling across pages, menus and dialogs. */
*{scrollbar-width:thin;scrollbar-color:#a9c2b7 transparent}
*::-webkit-scrollbar{width:6px;height:6px}
*::-webkit-scrollbar-track{background:transparent}
*::-webkit-scrollbar-thumb{background:#b5cbc1;border-radius:99px;border:1px solid transparent;background-clip:padding-box}
*::-webkit-scrollbar-thumb:hover{background:#87aa99}
.setup-grid{align-items:start}
.settings-scroll-card{height:380px;min-height:0;display:flex;flex-direction:column;gap:16px;padding:22px}
.settings-scroll-card>.panel-head{flex:0 0 auto;margin:0;align-items:flex-start;gap:12px}
.settings-scroll-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:2px 4px 6px;align-content:start}
.settings-scroll-body:focus-visible{outline:2px solid #91b7a6;outline-offset:4px;border-radius:10px}
.settings-scroll-body .setup-row{padding:12px 14px;gap:14px}
.trash-count{flex-shrink:0;background:#edf4f0;color:#527463;border-radius:99px;padding:4px 10px;font-size:12px}
.trash-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px;background:#f7faf8;border:1px solid #e3ece6;border-radius:14px}
.trash-row>div{min-width:0;display:grid;gap:5px}.trash-row b{font-size:14px;overflow-wrap:anywhere}.trash-row small{font-size:12px;color:#6c8076;line-height:1.6}
.restore-action{flex-shrink:0;background:#eaf3ed;color:#205e4b;border-color:#d8e8de}
.trash-empty{height:100%;min-height:180px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;gap:10px;padding:24px;color:#547264}
.trash-empty>span{display:grid;place-items:center;background:#eaf2ed;border-radius:50%;width:46px;height:46px;font-size:25px}.trash-empty p{margin:0;font-size:13px;line-height:1.8}.trash-empty b{font-size:15px}
@keyframes soft-enter{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:no-preference){.page:not(.hidden){animation:soft-enter .22s ease-out}.modal-dialog,.confirm-dialog{animation:soft-enter .18s ease-out}.provider-group[open]>.provider-group-items,details.debt-card[open]>.debt-card-body{animation:soft-enter .18s ease-out}.btn,.mini-btn,.nav-link,.provider-group-arrow,.creditor-chevron{transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease,transform .16s ease}.btn:active,.mini-btn:active{transform:translateY(1px)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media(max-width:600px){.settings-scroll-card{height:340px;padding:17px;gap:13px}.trash-row{padding:13px;gap:10px}.settings-scroll-card>.panel-head .btn{flex-shrink:0}}
/* Keep each group at its natural height inside the bounded list. */
.settings-scroll-card:not(.trash-panel){height:430px}
.setup-list.settings-scroll-body{display:flex;flex-direction:column;gap:10px}
.settings-scroll-body>.provider-group,.settings-scroll-body>.setup-row,.settings-scroll-body>.trash-row{flex:0 0 auto;min-height:min-content}
.settings-scroll-body>.provider-group>summary{min-height:56px;padding:12px 14px}
.trash-row>.trash-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end;flex-shrink:0}
.trash-row>div:first-child{flex:1;min-width:0}
@media(max-width:600px){.settings-scroll-card:not(.trash-panel){height:390px}.trash-row{flex-wrap:wrap}.trash-row>.trash-actions{width:100%;justify-content:flex-start;padding-top:4px}.trash-actions .mini-btn{padding:8px 11px}}
.trash-panel{grid-column:1/-1}
.trash-detail-content{min-width:0;max-width:100%;overflow-wrap:anywhere}
.trash-detail-content .detail-line{display:grid;grid-template-columns:minmax(90px,1fr) minmax(0,2fr);gap:12px;align-items:start}
.trash-detail-content .detail-line>b{min-width:0;white-space:normal;overflow-wrap:anywhere;text-align:end;font-size:14px;line-height:1.8}
.trash-detail-content .detail-line>span{min-width:0;white-space:normal;line-height:1.8}
.trash-detail-notes{margin:18px 0;padding:15px 17px;background:#f5f9f6;border:1px solid #e4ece7;border-radius:12px}
.trash-detail-notes h4{margin:0 0 8px;font-size:14px}.trash-detail-notes p{margin:0;font-size:13px;line-height:1.9;white-space:pre-wrap;overflow-wrap:anywhere;font-weight:400;color:#526f61}
@media(max-width:480px){.trash-detail-content .detail-line{grid-template-columns:minmax(80px,1fr) minmax(0,1.5fr);gap:10px}.trash-detail-notes{padding:13px}}
.trash-delete-confirm{text-align:center;padding:6px 0 14px;min-width:0}
.trash-delete-icon{display:grid;place-items:center;width:50px;height:50px;margin:0 auto 16px;border-radius:16px;background:#fbeeea;color:#ae5546;font-size:30px;line-height:1}
.trash-delete-confirm h4{font-size:17px;line-height:1.8;margin:0 0 12px;overflow-wrap:anywhere}
.trash-delete-confirm p{font-size:14px;line-height:1.9;color:#6d7e76;margin:0;overflow-wrap:anywhere}
.btn.danger-solid{background:#ad5147;border:1px solid #ad5147;color:#fff}.btn.danger-solid:hover{background:#944339;border-color:#944339}
/* All dialogs share centered positioning, including mobile and installed mode. */
.modal-layer,.confirm-layer{position:fixed;inset:0;display:grid;place-items:center;align-items:center;justify-items:center;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right));overflow:hidden;overscroll-behavior:contain}
.modal-layer>.modal,.confirm-layer>.confirm-dialog{margin:0;align-self:center;justify-self:center;min-height:0;max-height:calc(100dvh - max(16px,env(safe-area-inset-top)) - max(16px,env(safe-area-inset-bottom)));max-width:100%;border-radius:22px}
.modal-layer>.modal.setup-entry-modal{min-height:min(560px,calc(100dvh - max(16px,env(safe-area-inset-top)) - max(16px,env(safe-area-inset-bottom))))}
.modal-layer .modal-form{min-width:0;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch}
.confirm-layer>.confirm-dialog{overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch}
html.installed-app{min-height:100%;-webkit-tap-highlight-color:transparent}
html.installed-app .main{padding-top:max(20px,env(safe-area-inset-top))}
@media(max-width:600px){.modal-layer,.confirm-layer{padding:12px;padding-top:max(12px,env(safe-area-inset-top));padding-bottom:max(12px,env(safe-area-inset-bottom));padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}.modal-layer>.modal,.confirm-layer>.confirm-dialog{max-height:calc(100dvh - max(12px,env(safe-area-inset-top)) - max(12px,env(safe-area-inset-bottom)));border-radius:20px}.modal-layer>.modal.setup-entry-modal{min-height:min(520px,calc(100dvh - max(12px,env(safe-area-inset-top)) - max(12px,env(safe-area-inset-bottom))))}}
.monthly-group-detail.single-obligation{grid-template-columns:minmax(0,1fr)}
.monthly-group-detail.single-obligation .group-detail-copy{grid-column:1/-1}
.calendar-head button{min-width:44px;min-height:44px;touch-action:manipulation;user-select:none;-webkit-user-select:none}
.calendar-day,.calendar-foot button,.custom-date-trigger{touch-action:manipulation}
.modal-form .open-ended-toggle{display:flex;align-items:center;gap:10px;cursor:pointer;padding:10px 12px;border-radius:11px;background:#edf5ef}
.modal-form .open-ended-toggle input{width:19px;height:19px;min-height:19px;flex:0 0 19px;accent-color:var(--green);padding:0}
.open-plan-summary .detail-line{gap:12px;flex-wrap:wrap}.open-plan-summary .detail-line b{white-space:nowrap}
/* Keep explanatory text out of the amount badge and reserve space for names. */
.creditor-heading>strong{max-width:100%;overflow-wrap:normal;white-space:normal}
.creditor-identity .creditor-name{word-break:normal;overflow-wrap:normal}
@media(max-width:600px){.creditor-heading{grid-template-columns:22px minmax(0,1fr) minmax(0,43%);align-items:center}.creditor-heading-copy{min-width:0}.creditor-heading>strong{white-space:normal;overflow-wrap:anywhere;font-size:14px;line-height:1.7;justify-self:end;text-align:center}.creditor-identity{display:flex;flex-direction:column;align-items:flex-start;gap:6px}.creditor-identity .creditor-name{font-size:14px;line-height:1.8;max-width:100%}.creditor-recurring-note{font-size:11px;line-height:1.8;overflow-wrap:normal}}
.calendar-months{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.calendar-month{min-height:44px;border:0;border-radius:10px;background:#f5f9f6;color:#365c4a;font-size:12px;touch-action:manipulation}
.calendar-month:hover{background:#e8f2ec}.calendar-month.selected{background:#1c5148;color:#fff;font-weight:700}
.association-receipt .association-receipt-note{display:block;margin:10px 0 0;padding:8px 11px;border-inline-start:3px solid #c8ddd0;border-radius:7px;background:#f5f9f6;color:#526c5d;line-height:1.9;font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%}
.association-receipt>div{min-width:0;flex-basis:180px}
.association-receipt>.association-receipt-actions{display:flex;flex:0 0 auto;gap:8px;align-items:center}
.calendar-head .calendar-year-trigger{font-size:13px;line-height:1.7;min-width:0;padding:5px 4px;display:flex;align-items:center;justify-content:center;gap:5px}
.calendar-year-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;gap:12px;font-size:14px}
.calendar-year-head button{border:0;border-radius:9px;background:#edf4ef;color:#285a49;padding:6px 10px;min-height:38px;font-size:12px;touch-action:manipulation}
.calendar-years{position:relative;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;max-height:238px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:3px}
.calendar-year{min-height:42px;min-width:0;border:0;border-radius:9px;background:#f5f9f6;color:#365c4a;font-size:13px;touch-action:manipulation}
.calendar-year:hover{background:#e8f2ec}.calendar-year.selected{background:#1c5148;color:white;font-weight:700}
.schedule-row .schedule-date-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;min-width:0}
.schedule-date-pair>label{min-width:0}.schedule-date-pair .custom-date-trigger{min-width:0;padding:9px 10px;gap:6px}.schedule-date-pair .custom-date-label{white-space:normal;line-height:1.6}
.schedule-row .open-ended-toggle{margin:0;padding:8px 11px;font-weight:600;font-size:13px}
.schedule-row .schedule-estimate{margin:0;padding:10px 12px;font-size:12px;line-height:1.8}
@media(max-width:380px){.schedule-date-pair .custom-date-trigger{padding:8px 6px;font-size:12px}.schedule-date-pair>label{font-size:12px}.schedule-row .schedule-date-pair{gap:7px}}
.calendar-title-chevron{width:8px;height:8px;display:inline-block;border:solid currentColor;border-width:0 1.8px 1.8px 0;transform:rotate(45deg);margin-inline-start:3px;margin-top:-4px;flex:0 0 8px}
.schedule-options-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:end;min-width:0}
.schedule-options-pair>label{min-width:0}.schedule-options-pair .open-ended-toggle{min-height:46px;align-items:center;align-self:end;line-height:1.7}
.schedule-estimate:empty{display:none}
@media(max-width:600px){.schedule-row .schedule-date-pair{grid-template-columns:minmax(0,1fr)}.schedule-options-pair{gap:8px}.schedule-options-pair .open-ended-toggle{font-size:12px;padding:8px;gap:7px}.schedule-options-pair>label{font-size:12px}.schedule-options-pair .custom-select-trigger{padding:9px 8px;font-size:12px}.custom-date-popup{position:fixed;inset:0;width:min(330px,calc(100vw - 32px));height:max-content;max-height:calc(100dvh - 48px);margin:auto;overflow-y:auto;overscroll-behavior:contain;padding:14px;z-index:100;border-radius:18px;box-shadow:0 15px 65px #153d3a45}.calendar-head{grid-template-columns:42px minmax(0,1fr) 42px;gap:6px}.calendar-years{max-height:min(238px,calc(100dvh - 150px))}}
.calendar-period-controls{display:flex;gap:5px;min-width:0;align-items:center;justify-content:center}.calendar-period-controls .calendar-year-trigger{flex:1;font-size:12px;padding:5px 4px;gap:4px}
.calendar-year-head{flex-wrap:wrap}.calendar-year-head>b{margin-inline-end:auto}.calendar-year-head button{font-size:11px;padding:6px 8px}
@media(max-width:600px){.schedule-options-pair{grid-template-columns:minmax(0,1fr)}.schedule-options-pair .open-ended-toggle{min-height:44px;justify-content:flex-start}.schedule-options-pair>label{font-size:13px}.schedule-options-pair .custom-select-trigger{font-size:13px}.calendar-period-controls .calendar-year-trigger{min-height:42px}}
/* Date pickers stay inside the visible overlay at every screen size. */
.custom-date-popup{position:fixed;inset:0;width:min(330px,calc(100vw - 32px));height:max-content;max-height:calc(100dvh - 48px);margin:auto;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding:14px;z-index:100;border-radius:18px;box-shadow:0 15px 65px #153d3a45}
.calendar-head{grid-template-columns:42px minmax(0,1fr) 42px;gap:6px}
.installment-list{gap:7px}
.installment-list>.installment-date-group{margin:0}
.installment-date-group .installment-date-heading{padding:7px 11px;gap:8px;line-height:1.7}
.installment-date-group .installment-row{padding:8px 11px;gap:9px}
.installment-date-group .installment-check{gap:8px}.installment-date-group .installment-check small{line-height:1.5}
/* Keep row removal in the row layout, below the sticky dialog footer. */
.modal-form .repeat-row{padding-top:12px;isolation:isolate}
.modal-form .repeat-row>.remove-row{position:static;inset:auto;grid-column:1/-1;order:-1;justify-self:start;align-self:start;z-index:auto;margin:0;width:30px;height:30px;min-height:30px}
.modal-form .form-actions{z-index:10;isolation:isolate}
.debt-info-grid.debt-total-grid{grid-template-columns:minmax(0,1fr)}
.debt-info-grid.debt-total-grid.has-extras{grid-template-columns:repeat(2,minmax(0,1fr))}
.debt-total-grid>.debt-info-item:last-child{grid-column:auto}
.debt-payment-period{margin-top:9px;background:#f7faf8}
.debt-progress-foot{align-items:center;flex-wrap:wrap;gap:8px 16px}
.debt-progress-foot .debt-paid-count{margin-inline-start:auto;text-align:end;white-space:nowrap}
@media(max-width:480px){.debt-total-grid>.debt-info-item{padding:9px}.debt-payment-period strong{line-height:1.9}.debt-progress-foot .debt-paid-count{font-size:12px}}
.debt-type-group{margin-bottom:16px;border:1px solid #dce8e0;border-radius:18px;background:#fff;overflow:hidden}
.debt-type-group>summary{display:flex;align-items:center;gap:12px;padding:18px 20px;cursor:pointer;list-style:none;background:#eef5f0;min-height:64px;color:#285742}
.debt-type-group>summary::-webkit-details-marker{display:none}.debt-type-group>summary b{font-size:16px}.debt-type-group>summary small{margin-inline-start:auto;font-size:12px;color:#617c6a}
.debt-type-arrow{width:9px;height:9px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg);flex:0 0 9px;margin:0 3px 4px}.debt-type-group[open]>summary .debt-type-arrow{transform:rotate(225deg);margin-top:5px}
.debt-type-content{padding:14px;display:grid;gap:12px}.debt-type-content>.creditor-group{margin-bottom:0}
@media(max-width:600px){.debt-type-group>summary{padding:14px;min-height:58px}.debt-type-content{padding:9px;gap:10px}}
.debt-type-group{margin-bottom:6px}
.debt-type-group>summary{min-height:60px;padding:14px 18px}
.debt-type-meta{margin-inline-start:auto;display:flex;align-items:center;justify-content:flex-end;gap:12px;min-width:0}
.debt-type-group>summary .debt-type-meta small{margin:0;white-space:nowrap}
.debt-type-total{font-size:14px;font-weight:700;color:#285b49;font-variant-numeric:tabular-nums;line-height:1.7;overflow-wrap:anywhere}
@media(max-width:600px){.debt-type-group>summary{min-height:56px;padding:12px;gap:9px}.debt-type-meta{flex-wrap:wrap;gap:3px 8px;max-width:55%}.debt-type-total{font-size:13px}.debt-type-group>summary b{font-size:14px}}
#debtsList.debt-list{gap:6px}
#debtsList>.debt-type-group{margin-bottom:2px}
