/* The money screens, on top of prepper's app.css. From the approved mockup (build_all.py). */

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.m0 { margin: 0; }
.m-top { margin-top: var(--s3); }
.head-spacer { width: 40px; flex: none; }
.panel + .panel, .panel + form.panel, form.panel + .panel { margin-top: var(--s3); }
.flush { padding: 0; }
.section-head { margin-top: var(--s5); }
.empty { text-align: center; }
.empty .btn { margin-top: var(--s2); }
.btn-small { min-height: 36px; padding: 2px var(--s3); font-size: 14px; }
.left-label { font-weight: 600; color: var(--muted); }
.big { font: 700 32px/1.15 var(--body); font-variant-numeric: tabular-nums; white-space: nowrap; margin: var(--s1) 0 var(--s2); }
.in { color: var(--fresh); } .out { color: var(--expired); } .debt { color: var(--muted); }
.big.out { color: var(--expired); }
.tag { font-size: 12px; font-weight: 600; color: var(--muted); background: #f3ecdf; border-radius: 999px; padding: 0 8px; white-space: nowrap; }
.tag-sync { color: var(--soon); background: var(--soon-bg); }
.tag-err { color: var(--expired); background: var(--expired-bg); }
.tag-ok { color: var(--fresh); background: var(--fresh-bg); }
.clip .px-icon { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }
.row-detail.late { color: var(--expired); font-weight: 600; }

/* Top bar and the wallet menu (a <details>, so it works without JS) */
.top { display: flex; gap: var(--s2); align-items: center; margin-bottom: var(--s3); position: relative; z-index: 30; }
.wallet-pick { flex: 1; position: relative; }
.wallet-btn { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 6px var(--s3); background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: var(--r-card); box-shadow: var(--shadow-press); color: var(--text); cursor: pointer;
  list-style: none; transition: transform .08s ease-out, box-shadow .08s; -webkit-tap-highlight-color: transparent; }
.wallet-btn::-webkit-details-marker { display: none; }
.wallet-btn:active { transform: translateY(2px); box-shadow: none; }
.w-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--slot); border: 1.5px solid var(--line-strong); flex: none; }
.w-ic .px-icon { width: 24px; height: 24px; }
.w-text { flex: 1; display: grid; line-height: 1.2; } .w-text .num { font-size: 14px; color: var(--muted); }
.chev { color: var(--muted); transition: transform .18s ease-out; }
.wallet-pick[open] .chev, details[open] > summary .chev { transform: rotate(180deg); }
.wallet-menu { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: var(--r-panel); box-shadow: var(--shadow-float); padding: 6px; transform-origin: top center; }
.wallet-pick[open] .wallet-menu { animation: menu-in .18s cubic-bezier(.2,.9,.3,1.2); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.wallet-menu ul { list-style: none; margin: 0; padding: 0; }
.wallet-menu li a { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 4px var(--s2); border-radius: var(--r-btn); color: var(--text); text-decoration: none; }
.wallet-menu li a:hover { background: var(--slot-hover); }
.wallet-menu li a[aria-current] { background: var(--tint); }
.w-name { flex: 1; font-weight: 600; } .w-bal { font-weight: 700; font-variant-numeric: tabular-nums; }
.w-tick { color: var(--leaf); font-weight: 800; width: 16px; }
.w-foot { display: flex; gap: var(--s2); border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.w-foot a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border-radius: var(--r-btn); font-weight: 600; font-size: 14px; text-decoration: none; }
.w-foot a:hover { background: var(--slot-hover); }
.w-foot .px-icon { width: 18px; height: 18px; }

/* Days */
.safe { background: var(--fresh-bg); border-color: #cfe4c7; margin-bottom: var(--s3); }
.safe .big { color: var(--fresh); }
.safe p { margin: 0; }
.tabs .tab { padding: var(--s1) var(--s3); }
.tabs-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs-scroll .tab { flex: none; }
.tab-more { margin-left: auto; }
.row-text .row-bar { display: block; margin-top: 6px; }
.overview { display: grid; grid-template-columns: 1fr auto; gap: var(--s1) 0; margin: 0; }
.overview dt { color: var(--muted); }
.overview dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; padding-left: var(--s3); }
.overview .end { border-top: 1px solid var(--line); padding-top: var(--s2); margin-top: var(--s1); font-weight: 700; color: var(--text); }
.report-link { margin-top: var(--s3); }
.day { margin-top: var(--s3); }
.day-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.day-num { font: 700 30px/1 var(--body); min-width: 38px; font-variant-numeric: tabular-nums; }
.day-when { flex: 1; display: grid; line-height: 1.25; } .day-when b { font-weight: 600; } .day-when span { font-size: 13px; color: var(--muted); }
.day-net, .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pending-box { margin-bottom: var(--s3); }
.pending-box .section-head { margin-top: 0; }
li.pending { opacity: .9; }
li.pending.is-failed { background: var(--expired-bg); }
.pending .row-end, .just .row-end { display: flex; gap: var(--s1); align-items: center; }

/* Log */
.amount-field { display: flex; align-items: baseline; gap: var(--s2); padding: 0 var(--s3); background: var(--field); border: 1px solid var(--line-strong); border-radius: var(--r-field); }
.amount-field:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.amount-field span { font: 700 26px/1 var(--body); color: var(--muted); }
.amount-field input { border: 0; padding: 0; min-height: 56px; font: 700 36px/1 var(--body); background: transparent; width: 100%; min-width: 0; }
.amount-field input:focus-visible { outline: none; box-shadow: none; }
.small-amount span { font-size: 18px; } .small-amount input { font-size: 20px; min-height: 44px; }
.hint .px-icon { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }
.cat-pick { border: 0; padding: 0; margin: 0 0 var(--s4); min-width: 0; }
.cat-pick legend { font: var(--label); margin-bottom: var(--s2); padding: 0; }
.slots-pick { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3) var(--s2); }
.slots-pick .slot-link { cursor: pointer; display: block; text-align: center; }
.slots-pick .slot { border-width: 2px; border-radius: var(--r-btn); }
.slots-pick .slot-name { margin: var(--s1) -6px 0; font-size: 12.5px; overflow-wrap: normal; hyphens: none; }
.slot-link:has(input:checked) .slot { border-color: var(--leaf); background: var(--tint); }
.slot-link:has(input:checked) .slot-name { font-weight: 700; }
.slot-link:has(input:focus-visible) .slot { outline: 3px solid var(--focus); outline-offset: 2px; }
.sub-legend { font: var(--label); margin: var(--s3) 0 var(--s1); }
.subs { margin-top: var(--s1); }
.subs .chip, .chips .chip-toggle { min-height: 40px; font: 600 14px/1.2 var(--body); padding: 2px var(--s3); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip-toggle:has(input:checked) { background: var(--tint); border-color: var(--line-strong); }
.chip-toggle:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip-add { color: var(--link); border-style: dashed; background: transparent; text-decoration: none; }
.chip .px-icon { width: 18px; height: 18px; }
.suggest-wrap { position: relative; }
.suggest { list-style: none; margin: 4px 0 0; padding: 4px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-card); box-shadow: var(--shadow-float);
  position: absolute; left: 0; right: 0; z-index: 15; }
.suggest li { display: flex; gap: var(--s3); align-items: center; min-height: 48px; padding: 4px var(--s2); border-radius: var(--r-btn); cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--tint); }
.suggest .px-icon { width: 24px; height: 24px; flex: none; }
.suggest mark { background: none; color: var(--text); font-weight: 800; }
.iw-slot { width: 56px; height: 56px; aspect-ratio: auto; display: grid; place-items: center; }
.iw-slot .px-icon { width: 34px; height: 34px; }
.panel-title { display: flex; gap: var(--s3); align-items: center; margin-bottom: var(--s3); }
.panel-title h1 { margin: 0; font-size: 22px; }
.danger { border-color: #efc7c1; }
.atts { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s2); }
.atts:empty { display: none; }
.att-wrap { position: relative; display: inline-block; }
.att { width: 72px; height: 72px; border-radius: var(--r-card); border: 1px solid var(--line-strong); background: var(--field); display: grid; place-items: center; overflow: hidden; text-decoration: none; color: var(--text); }
.att img { width: 100%; height: 100%; object-fit: cover; }
.att-file { width: auto; padding: 0 var(--s3); display: flex; gap: var(--s2); font-size: 13px; font-weight: 600; line-height: 1.2; }
.att-file .px-icon { width: 24px; height: 24px; } .att-file small { color: var(--muted); font-weight: 400; }
.att-x { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--panel); font: 700 16px/1 var(--body); cursor: pointer; color: var(--text); }
.att-buttons { display: flex; gap: var(--s2); flex-wrap: wrap; }
.att-buttons .btn { cursor: pointer; }
.just { margin-bottom: var(--s3); }
.just .section-head { margin-top: 0; }

/* Month and report */
.month-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); }
.month-head h1 { margin: 0; font-size: 22px; flex: 1; text-align: center; }
.bar-legend { display: flex; justify-content: space-between; gap: var(--s2); font-size: 13px; color: var(--muted); margin-top: var(--s2); flex-wrap: wrap; }
.money .bar-fill { fill: var(--leaf); }
.money.over .bar-fill { fill: var(--expired); }
.goal { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s2); gap: var(--s2); }
.goal .px-icon { width: 20px; height: 20px; display: inline-block; vertical-align: -4px; }
.row-bar.paid rect { fill: var(--fresh); }
.donut-panel { padding: var(--s4) 0 var(--s2); }
.donut-panel .spent { padding: 0 var(--s4); }
.donut { display: block; width: 100%; max-width: 420px; height: auto; margin: var(--s2) auto 0; }
.donut .lbl polyline { fill: none; stroke: #b9a27a; stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.donut .ln { font: 600 13px var(--body); }
.donut .lv { font: 700 12px var(--body); font-variant-numeric: tabular-nums; }
.empty-chart { padding: var(--s5) var(--s4); text-align: center; margin: 0; }
.swatch { width: 12px; height: 12px; flex: none; }
.cat-hero { display: flex; gap: var(--s4); align-items: center; }
.cat-hero .big { margin: 0; }
.spark { display: block; width: 100%; height: 72px; margin-top: var(--s2); }
.custom-range .btn { margin-top: var(--s1); }
.extra-form { display: flex; gap: var(--s2); align-items: end; flex-wrap: wrap; margin: var(--s2) 0 var(--s3); }
.extra-form label { width: 100%; color: var(--muted); }
.extra-form .amount-field { flex: 1; min-width: 120px; }

/* Settings */
.cat + .cat { margin-top: var(--s2); }
.cat > summary { display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: 0 var(--s4); cursor: pointer; list-style: none; }
.cat > summary::-webkit-details-marker { display: none; }
.cat > summary .px-icon { width: 28px; height: 28px; }
.cat > summary .row-name { flex: 1; font-weight: 600; }
.cat-body { padding: 0 var(--s4) var(--s4); display: grid; gap: var(--s2); }
.cat-row { display: grid; grid-template-columns: auto 1fr; gap: var(--s1) var(--s2); align-items: center; padding: var(--s2) 0; border-top: 1px solid var(--line); }
.cat-row.is-hidden { opacity: .6; }
.cat-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--slot); border: 2px solid var(--line); }
.cat-ic .px-icon { width: 28px; height: 28px; }
.cat-name { display: flex; gap: var(--s1); }
.cat-name input { min-width: 0; }
.cat-acts { grid-column: 1 / -1; display: flex; gap: var(--s1); flex-wrap: wrap; }
.btn-del { color: var(--danger); }
.cat-add { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.cat-add input { flex: 1; min-width: 160px; }
#add-top label { width: 100%; font: var(--label); }
#add-top .row { display: flex; gap: var(--s2); width: 100%; }
.check { display: flex; gap: var(--s2); align-items: center; font-weight: 400; }
.sound-row, .logout-row { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.copy-row { display: flex; gap: var(--s2); } .copy-row input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: 13px; }
.pk-search { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }
.pk-search .px-icon { width: 20px; height: 20px; flex: none; }
.pg h3 { font-size: 14px; margin: var(--s4) 0 var(--s2); color: var(--muted); }
.pick { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.pk { width: 100%; aspect-ratio: 1; display: grid; place-items: center; background: var(--slot); border: 2px solid var(--line); border-radius: 10px; cursor: pointer; padding: 0;
  transition: transform .08s ease-out, border-color .12s; }
.pk:hover { border-color: var(--line-strong); }
.pk:active { transform: translateY(1px); }
.pk .px-icon { width: 60%; height: 60%; }
.pk.is-picked { border-color: var(--leaf); background: var(--tint); }
.icon-dialog .modal-body { max-height: 85dvh; overflow-y: auto; }

/* Motion. Snappy: 120 to 250 ms, ease-out. Nothing waits on any of it. */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fill { from { transform: scaleX(0); } }
@keyframes sweep { from { stroke-dashoffset: 0; } }   /* rest is swept away, so with no motion the ring shows */
@keyframes grow { from { transform: scaleY(0); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes lblin { from { opacity: 0; } }
.donut .wipe { stroke: var(--panel); stroke-dasharray: 100 100; stroke-dashoffset: 100; pointer-events: none; }
.coin { position: fixed; z-index: 60; width: 10px; height: 10px; border-radius: 50%; background: var(--honey); box-shadow: inset -2px -2px 0 #c9971f; pointer-events: none; }
.slot-link .slot, .row-main, .tab, .btn { transition: transform .08s ease-out, background-color .12s; }
.row-main:active { transform: scale(.985); }
@media (prefers-reduced-motion: no-preference) {
  main > * { animation: rise .2s ease-out both; }
  main > *:nth-child(2) { animation-delay: .02s; } main > *:nth-child(3) { animation-delay: .04s; }
  main > *:nth-child(4) { animation-delay: .06s; } main > *:nth-child(n+5) { animation-delay: .08s; }
  .bar-track .bar-fill rect, .row-bar rect { transform-box: fill-box; transform-origin: left; animation: fill .45s cubic-bezier(.2,.8,.2,1) .1s both; }
  .donut .wipe { animation: sweep .6s cubic-bezier(.3,.7,.2,1) .05s both; }
  .donut .lbl { animation: lblin .2s ease-out .45s both; }
  .spark rect { transform-box: fill-box; transform-origin: bottom; animation: grow .3s ease-out both; }
  .status.is-new, .att-wrap.is-new, .flash.is-new { animation: pop .3s cubic-bezier(.2,.9,.3,1.3) both; }
}
