/* PersonalOS 21 Phase 5 — Debt Ledger responsive presentation */
.p21-debt-intro{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:18px 0 14px;padding:22px 24px;border:1px solid var(--border-color,rgba(100,116,139,.18));border-radius:18px;background:var(--surface-card,rgba(255,255,255,.76));box-shadow:var(--shadow-sm,0 8px 26px rgba(15,23,42,.045))}
.p21-debt-intro h2{margin:5px 0 6px;font-size:clamp(19px,2vw,24px);letter-spacing:-.025em}
.p21-debt-intro p{max-width:760px;margin:0;color:var(--text-secondary,#64748b);line-height:1.55}
.p21-debt-count{display:grid;min-width:105px;place-items:center;padding:12px 16px;border-radius:14px;background:var(--surface-muted,#f1f5f9)}
.p21-debt-count strong{font-size:28px;line-height:1.1;font-variant-numeric:tabular-nums}.p21-debt-count span{font-size:12px;color:var(--text-secondary,#64748b)}
.p21-debt-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:16px}
.p21-debt-toolbar{display:flex;gap:12px;align-items:center;margin:14px 0 16px}.p21-debt-toolbar .p4-search{flex:1;min-width:180px}.p21-debt-toolbar select{min-width:190px}
.p21-debt-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.p21-debt-card{min-width:0;padding:18px;overflow:hidden}
.p21-debt-card-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.p21-debt-labels{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}
.p21-debt-type,.p21-debt-status,.p21-linked-tag{display:inline-flex;align-items:center;border-radius:999px;padding:4px 9px;font-size:11px;font-weight:700;line-height:1.3}
.p21-debt-type.income{color:#087a58;background:rgba(16,185,129,.11)}.p21-debt-type.expense{color:#b45309;background:rgba(245,158,11,.13)}
.p21-debt-status.open{color:#475569;background:rgba(100,116,139,.12)}.p21-debt-status.partial{color:#1d4ed8;background:rgba(59,130,246,.12)}.p21-debt-status.settled{color:#087a58;background:rgba(16,185,129,.12)}
.p21-debt-card h3{margin:0 0 4px;font-size:17px;line-height:1.35;overflow-wrap:anywhere}.p21-debt-card-top p{margin:0;color:var(--text-secondary,#64748b);font-size:12px;line-height:1.5}
.p21-debt-outstanding{display:grid;text-align:right;gap:3px;flex-shrink:0}.p21-debt-outstanding small{color:var(--text-secondary,#64748b);font-size:11px}.p21-debt-outstanding strong{font-size:18px;line-height:1.25;font-variant-numeric:tabular-nums}
.p21-debt-progress{height:7px;margin:16px 0 10px;border-radius:999px;background:var(--surface-muted,#e2e8f0);overflow:hidden}.p21-debt-progress span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#0f9f78,#38bdf8)}
.p21-debt-values{display:flex;flex-wrap:wrap;gap:6px 15px;color:var(--text-secondary,#64748b);font-size:12px}.p21-debt-values b{color:var(--text-primary,#0f172a);font-variant-numeric:tabular-nums}
.p21-debt-accounts{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:12px 0 0;padding-top:10px;border-top:1px solid var(--border-color,rgba(100,116,139,.14));color:var(--text-secondary,#64748b);font-size:11px;overflow-wrap:anywhere}
.p21-debt-notes{margin:10px 0 0;color:var(--text-secondary,#64748b);font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere}
.p21-debt-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}.p21-debt-actions button{min-height:36px}
.p21-debt-payments{margin-top:14px;border-top:1px solid var(--border-color,rgba(100,116,139,.14));padding-top:10px}.p21-debt-payments summary{cursor:pointer;font-size:12px;font-weight:700;color:var(--text-secondary,#475569);padding:5px 0}.p21-payment-list{display:grid;gap:8px;margin-top:8px}
.p21-payment-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:11px 12px;border:1px solid var(--border-color,rgba(100,116,139,.13));border-radius:12px;background:var(--surface-muted,rgba(148,163,184,.07))}
.p21-payment-main{display:grid;gap:3px;min-width:0}.p21-payment-main strong{font-size:14px;font-variant-numeric:tabular-nums}.p21-payment-main span,.p21-payment-main small{font-size:11px;color:var(--text-secondary,#64748b);overflow-wrap:anywhere}
.p21-payment-meta{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:7px}.p21-linked-tag{color:#087a58;background:rgba(16,185,129,.10);white-space:nowrap}.p21-no-evidence{font-size:11px;color:var(--text-secondary,#94a3b8)}
.p21-debt-empty-payments{padding:12px 0;color:var(--text-secondary,#64748b);font-size:12px}.p21-debt-footnote{margin:14px 0;color:var(--text-secondary,#64748b);font-size:11px;line-height:1.55}
.p21-payment-context{display:grid;gap:4px;padding:12px 14px;border-radius:12px;background:var(--surface-muted,#f1f5f9);margin-bottom:12px}.p21-payment-context span{color:var(--text-secondary,#64748b);font-size:12px}
.p21-evidence-field input{max-width:100%;padding:9px;border:1px dashed var(--border-color,#94a3b8);border-radius:10px;background:var(--surface-muted,rgba(148,163,184,.08))}
.p21-evidence-modal{max-height:min(92dvh,900px);overflow:auto}.p21-evidence-preview{display:grid;place-items:center;max-height:68dvh;min-height:160px;padding:16px;background:var(--surface-muted,#e2e8f0);overflow:auto}.p21-evidence-preview img{display:block;max-width:100%;max-height:62dvh;object-fit:contain;border-radius:8px}
@media(max-width:900px){.p21-debt-list{grid-template-columns:1fr}.p21-debt-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.p21-debt-kpis>*:last-child{grid-column:1/-1}}
@media(max-width:640px){.p21-debt-intro{align-items:flex-start;padding:16px}.p21-debt-count{min-width:74px;padding:10px}.p21-debt-count strong{font-size:22px}.p21-debt-toolbar{align-items:stretch;flex-direction:column}.p21-debt-toolbar select{width:100%;min-width:0}.p21-debt-kpis{grid-template-columns:1fr}.p21-debt-kpis>*:last-child{grid-column:auto}.p21-debt-card{padding:14px}.p21-debt-card-top{display:grid;grid-template-columns:1fr}.p21-debt-outstanding{text-align:left}.p21-debt-accounts{grid-template-columns:1fr}.p21-debt-actions{display:grid;grid-template-columns:1fr 1fr}.p21-debt-actions button:first-child{grid-column:1/-1}.p21-payment-row{align-items:flex-start;flex-direction:column}.p21-payment-meta{justify-content:flex-start}.p21-evidence-modal{width:calc(100vw - 20px);max-width:none}.p21-evidence-preview{padding:8px}}
@media(prefers-reduced-motion:reduce){.p21-debt-progress span{transition:none!important}}

.p21-managed-transaction{display:inline-flex;align-items:center;padding:6px 9px;border-radius:8px;background:var(--surface-muted,#f1f5f9);color:var(--text-secondary,#64748b);font-size:11px;font-weight:700;white-space:nowrap}


