/* Accounts tab and settings sheet. */

/* net worth */
.net { margin: 0 var(--sp-4); padding: 14px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-card); }
.net small { color: var(--text-2); font-size: var(--fs-small); }
.nb { margin: 2px 0 8px; font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.nb small { margin-right: 4px; color: var(--text); font-size: .42em; font-weight: 700; }
.own { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--fill); }
.own .a { background: var(--income); } .own .b { background: var(--wine-400); }
.owl { display: flex; justify-content: space-between; margin: 6px 0 0; color: var(--text-2); font-size: var(--fs-small); }
.owl b { color: var(--text); font-variant-numeric: tabular-nums; }
.alab { display: flex; justify-content: space-between; margin: var(--sp-4) var(--sp-5) var(--sp-2); color: var(--text-2); font-size: var(--fs-small); font-weight: 600; }

/* the wallet: one stack of account cards */
.stk { position: relative; margin: 0 var(--sp-4); transition: height .45s var(--ease-out); }
.ac { position: absolute; left: 0; right: 0; width: 100%; height: 140px; display: flex; flex-direction: column; align-items: stretch; padding: 13px 16px; border-radius: 18px; text-align: left;
  box-shadow: 0 -3px 10px rgba(40, 5, 15, .18); transition: top .45s var(--ease-out), transform .45s var(--ease-out), opacity .3s; }
.ac.pile { transform: scale(.94); }
.ac.hid { opacity: .65; }
.ac:focus-visible { outline: 3px solid var(--tint); outline-offset: 2px; }
.a1 { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); }
.a1 b { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--fs-body); }
.a1 .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a1 .v { flex: none; font-size: var(--fs-sheet); font-weight: 700; font-variant-numeric: tabular-nums; }
.a1 .v small { margin-right: 3px; font-size: .6em; opacity: .85; }
.ab { display: flex; justify-content: space-between; gap: var(--sp-2); margin-top: auto; font-size: var(--fs-small); opacity: .9; }
.ab .num { letter-spacing: .5px; }
.mk { flex: none; display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 5px; border-radius: 8px; background: #fff; color: var(--mk); font-size: var(--fs-tiny); font-weight: 800; object-fit: cover; }
.mk[data-dark] { background: var(--ink); }
img.mk { width: 28px; padding: 0; }
.htag { padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .22); font-size: var(--fs-tiny); font-weight: 600; }

/* details of the lifted card */
.accd { position: absolute; left: 0; right: 0; top: 152px; padding: 14px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-card); visibility: hidden; opacity: 0; transition: opacity .3s; }
.accd.show { visibility: visible; opacity: 1; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.g3 p { margin: 0; color: var(--text-2); font-size: var(--fs-small); }
.g3 b { display: block; margin-top: 2px; color: var(--text); font-size: var(--fs-body); font-variant-numeric: tabular-nums; }
.due { margin-top: var(--sp-3); padding: 10px 12px; border-radius: 12px; background: var(--fill); }
.d1 { display: flex; justify-content: space-between; gap: var(--sp-2); margin: 0; font-size: var(--fs-head); }
.d1 b { color: var(--tint); }
.d1.small { flex-wrap: wrap; color: var(--text-2); font-size: var(--fs-small); }
.d1 span { white-space: nowrap; }
.lim { height: 6px; margin: 8px 0 4px; border-radius: 3px; overflow: hidden; background: color-mix(in srgb, var(--wine-500) 18%, transparent); }
.lim i { display: block; height: 100%; border-radius: 3px; background: var(--primary); }
.accd .lab { margin: var(--sp-3) 0 var(--sp-1); }
.le { margin: 0; padding: 0; list-style: none; }
.le li { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); min-height: 40px; border-top: 1px solid var(--separator); font-size: var(--fs-head); }
.le li:first-child { border-top: 0; }
.le small { display: block; color: var(--text-2); font-size: var(--fs-small); }
.le b { font-variant-numeric: tabular-nums; }
.le b.inc { color: var(--income); }
.abtn { display: flex; gap: 6px; margin-top: var(--sp-3); }
.abtn button { flex: 1 1 auto; min-height: var(--tap); padding: 0 10px; white-space: nowrap; border-radius: 12px; background: var(--fill); color: var(--tint); font-size: var(--fs-head); font-weight: 600; }
.abtn .pri { background: var(--primary); color: #fff; }

.addacc { display: flex; align-items: center; justify-content: center; gap: 6px; width: calc(100% - 2 * var(--sp-4)); min-height: 52px; margin: var(--sp-4) var(--sp-4) 0;
  border: 1.5px dashed color-mix(in srgb, var(--tint) 45%, transparent); border-radius: 16px; color: var(--tint); font-size: var(--fs-body); font-weight: 600; }
.addacc .ic { width: 18px; height: 18px; }
.hidt { display: block; margin: var(--sp-2) auto 0; min-height: var(--tap); }

/* new / edit account sheet */
.as-prev { margin: var(--sp-3) var(--sp-4) 0; }
.as-prev .ac { position: relative; height: 120px; box-shadow: var(--shadow-float); }
.bgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-2) 4px; margin: 0 var(--sp-3); }
.bgrid button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: var(--tap); padding: 2px 0; color: var(--text-2); font-size: var(--fs-tiny); text-align: center; }
.dotb { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-size: var(--fs-tiny); font-weight: 800; }
.bgrid [aria-pressed="true"] { color: var(--text); font-weight: 700; }
.bgrid [aria-pressed="true"] .dotb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
[data-credit] { margin-top: var(--sp-3); }
.logo-act { display: flex; align-items: center; gap: var(--sp-3); white-space: nowrap; }
.file-btn { position: relative; display: inline-flex; align-items: center; min-height: var(--tap); }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:has(input:focus-visible) { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) { .stk, .ac, .accd { transition: none; } }

.confirm { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-1) var(--sp-2); margin: var(--sp-4) var(--sp-3) 0; padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); background: var(--surface); border-radius: var(--r-row); }
.confirm p { flex: 1 1 100%; margin: 0; padding-top: var(--sp-1); }

.field .switch { appearance: none; -webkit-appearance: none; flex: none; width: 51px; min-height: 31px; height: 31px; border-radius: 16px; background: var(--fill); position: relative; transition: background .2s; }
.field .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .25s var(--spring); }
.field .switch:not(:checked) { box-shadow: inset 0 0 0 1.5px var(--switch-edge); } /* an off switch needs a visible edge */
.field .switch:checked { background: var(--income); }
.field .switch:checked::after { transform: translateX(20px); }
.field:has(.switch) label { flex: 1; }

.hint.ok { color: var(--income); font-weight: 600; }
.icon-btn { display: grid; place-items: center; padding: 0; color: var(--text-2); }
.icon-btn .ic { width: 18px; height: 18px; }

/* Money Manager import report */
.imp-sum { margin: var(--sp-1) var(--sp-5) 0; font-size: var(--fs-head); font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; }
.chk summary { list-style: none; }
.chk summary::-webkit-details-marker { display: none; }
.chk summary .ic { width: 18px; height: 18px; color: var(--text-2); transition: transform .2s var(--ease-out); }
.chk[open] summary .ic { transform: rotate(180deg); }
.chk summary .row-text strong { display: block; font-weight: 500; } /* no 2-line clamp: the whole check must be readable */
.chk summary:focus-visible { outline-offset: -2px; }
.chk:not(:last-child) { border-bottom: .5px solid var(--separator); }
.chk .row-body { border-bottom: 0; }
.chk .le { padding: 0 var(--sp-3) var(--sp-2) var(--sp-5); }
.chk .le li > span, .bal li > .nm { min-width: 0; overflow-wrap: anywhere; }
.bal { padding: 0 var(--sp-3); }
.due .st-next { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: .5px solid var(--separator); }
.due .st-next .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.loans { margin: var(--sp-3) var(--sp-4) 0; }
.loans .amount { font-weight: 600; font-variant-numeric: tabular-nums; }
