/* ===== Envelope Budget — styles ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #23304a;
  /* warm kraft-paper "desk" so the colorful envelopes look laid out on a mail table */
  background-color: #ece3d1;
  background-image:
    radial-gradient(1100px 520px at 50% -8%, rgba(255,253,247,.7), transparent 72%),
    linear-gradient(180deg, rgba(255,252,244,.5), rgba(228,217,196,.5)),
    repeating-linear-gradient(45deg, rgba(120,92,48,.030) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(-45deg, rgba(120,92,48,.022) 0 1px, transparent 1px 6px);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#app { max-width: 1080px; margin: 0 auto; padding: 18px 16px 70px; }

/* ----- Top bar ----- */
.top { display: flex; align-items: center; gap: 12px; margin: 6px 0 16px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.3rem; display: flex; align-items: center; gap: 9px; color: #2a3a59; }
.monthnav {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.78); border: 1px solid #fff;
  box-shadow: 0 2px 10px rgba(40,80,140,.09); border-radius: 999px; padding: 4px 6px;
}
.month { font-weight: 700; min-width: 132px; text-align: center; }
.icon {
  border: 0; background: transparent; font-size: 1.35rem; line-height: 1;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; color: #3a4a66;
}
.icon:hover { background: #eef4fc; }
.ghost {
  border: 1px solid #d6e3f3; background: #fff; border-radius: 999px;
  padding: 8px 15px; font-weight: 600; color: #3a4a66; cursor: pointer;
}
.ghost:hover { background: #f3f8ff; }

/* ----- Summary chips ----- */
.summary { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.chip {
  background: rgba(255,255,255,.8); border: 1px solid #fff;
  box-shadow: 0 2px 10px rgba(40,80,140,.08); border-radius: 14px;
  padding: 8px 15px; display: flex; flex-direction: column; min-width: 112px; flex: 1 1 auto;
}
.chip__l { font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; color: #7488a6; font-weight: 700; }
.chip__v { font-size: 1.12rem; font-weight: 800; }
.chip.neg .chip__v { color: #e0392f; }
.chip.pos .chip__v { color: #1f9d57; }

/* ----- Income hero ----- */
.income {
  position: relative; text-align: center;
  background: linear-gradient(160deg, #f7b955, #ef9320);
  border-radius: 22px; padding: 22px 18px 24px; color: #fff;
  box-shadow: 0 14px 32px rgba(225,150,40,.34); cursor: pointer;
  margin: 0 auto 24px; max-width: 460px;
  transition: transform .15s, box-shadow .15s;
}
.income:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(225,150,40,.42); }
.income:focus-visible { outline: 3px solid #ffffffaa; outline-offset: 3px; }
.income__label { font-weight: 800; letter-spacing: 1.2px; font-size: .82rem; opacity: .95; text-shadow: 0 1px 2px rgba(0,0,0,.12); }
.income__amt { font-size: 2.7rem; font-weight: 900; line-height: 1.08; margin: 6px 0 8px; text-shadow: 0 2px 5px rgba(0,0,0,.16); }
.income__sub {
  font-weight: 700; font-size: .9rem; opacity: .98;
  background: rgba(255,255,255,.24); display: inline-block; padding: 4px 13px; border-radius: 999px;
}
.income__sub.over { background: rgba(110,20,10,.28); }

/* ----- Envelope grid ----- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 880px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.env {
  position: relative; border-radius: 16px; min-height: 170px;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 1px, transparent 1px 4px),
    radial-gradient(140px 82px at 50% 47%, rgba(255,255,255,.16), transparent 62%),
    linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: 0 8px 18px rgba(30,60,110,.16);
  border: 1px solid rgba(255,255,255,.38);
  cursor: pointer; overflow: hidden; isolation: isolate;
  transition: transform .15s, box-shadow .15s;
}
.env:hover { transform: translateY(-3px); box-shadow: 0 15px 28px rgba(30,60,110,.24); }
.env--full { box-shadow: 0 0 0 3px #34c759, 0 0 0 8px rgba(52,199,89,.12), 0 8px 18px rgba(30,60,110,.16); }
.env--over { box-shadow: 0 0 0 3px #ff3b30, 0 0 0 8px rgba(255,59,48,.12), 0 8px 18px rgba(30,60,110,.16); }
.env--debt { box-shadow: 0 0 0 3px #7d52b8, 0 0 0 8px rgba(125,82,184,.12), 0 8px 18px rgba(30,60,110,.16); }
.env--full:hover { box-shadow: 0 0 0 3px #34c759, 0 0 0 8px rgba(52,199,89,.18), 0 15px 28px rgba(30,60,110,.24); }
.env--over:hover { box-shadow: 0 0 0 3px #ff3b30, 0 0 0 8px rgba(255,59,48,.18), 0 15px 28px rgba(30,60,110,.24); }
.env--debt:hover { box-shadow: 0 0 0 3px #7d52b8, 0 0 0 8px rgba(125,82,184,.18), 0 15px 28px rgba(30,60,110,.24); }
.env:focus-visible { outline: 3px solid #ffffffcc; outline-offset: 2px; }
.env:not(.add)::before {
  content: ""; position: absolute; inset: 0; z-index: 4; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(33deg, transparent 48.9%, rgba(0,0,0,.10) 49.4%, rgba(255,255,255,.22) 50%, transparent 50.8%) left bottom / 51% 66% no-repeat,
    linear-gradient(-33deg, transparent 48.9%, rgba(0,0,0,.10) 49.4%, rgba(255,255,255,.22) 50%, transparent 50.8%) right bottom / 51% 66% no-repeat,
    linear-gradient(146deg, transparent 43%, rgba(255,255,255,.14) 44%, transparent 45%) left top / 50% 45% no-repeat,
    linear-gradient(-146deg, transparent 43%, rgba(255,255,255,.14) 44%, transparent 45%) right top / 50% 45% no-repeat,
    linear-gradient(180deg, rgba(255,255,255,.14), transparent 38%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.24), inset 0 -10px 18px rgba(0,0,0,.07);
  opacity: .95;
}
.env:not(.add)::after {
  content: ""; position: absolute; left: -1px; right: -1px; bottom: -1px; height: 62%; z-index: 2; pointer-events: none;
  clip-path: polygon(0 28%, 50% 62%, 100% 28%, 100% 100%, 0 100%);
  background:
    linear-gradient(90deg, rgba(255,255,255,.18), transparent 28%, transparent 72%, rgba(0,0,0,.08)),
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(0,0,0,.08));
}
/* the open lid (back flap) — a downward triangle from the top edge */
.env__flap {
  position: absolute; left: -1px; right: -1px; top: -1px; height: 61%; z-index: 1;
  clip-path: polygon(0 0, 100% 0, 50% 94%);
  background:
    linear-gradient(180deg, rgba(255,255,255,.26), rgba(0,0,0,.22)),
    linear-gradient(180deg, var(--c2), var(--c1));
  filter: drop-shadow(0 4px 5px rgba(0,0,0,.18));
}
.env__flap::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, transparent 0%, transparent 18%, rgba(255,255,255,.2) 50%, transparent 82%, transparent 100%),
    linear-gradient(180deg, rgba(255,255,255,.16), transparent 38%);
}
.env__name {
  position: absolute; top: 15px; left: 10px; right: 10px; text-align: center;
  color: #fff; font-weight: 800; font-size: 1.02rem; z-index: 5;
  text-shadow: 0 1px 2px rgba(0,0,0,.22); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.env--full .env__name, .env--over .env__name, .env--debt .env__name { left: 14px; right: 58px; text-align: left; }
.env__stamp {
  --stamp: #34c759; --stamp-bg: #f5fff7;
  position: absolute; top: 10px; right: 11px; z-index: 8;
  width: 38px; height: 42px; display: grid; place-items: center;
  background: var(--stamp-bg); border: 2px dashed var(--stamp); border-radius: 6px;
  box-shadow: 0 3px 7px rgba(20,40,70,.24), inset 0 0 0 2px rgba(255,255,255,.8);
  transform: rotate(5deg);
}
.env__stamp::before {
  content: ""; position: absolute; inset: 4px; border: 1px solid var(--stamp);
  border-radius: 3px; opacity: .34;
}
.env__stamp span {
  position: relative; z-index: 1; font-size: 1.16rem; line-height: 1;
  filter:
    drop-shadow(0 1px 0 #fff)
    drop-shadow(1px 0 0 #fff)
    drop-shadow(0 -1px 0 #fff)
    drop-shadow(-1px 0 0 #fff);
}
.env__stamp--full { --stamp: #34c759; --stamp-bg: #f3fff6; }
.env__stamp--over { --stamp: #ff3b30; --stamp-bg: #fff6f5; transform: rotate(-4deg); }
.env__stamp--debt { --stamp: #7d52b8; --stamp-bg: #faf6ff; }
/* the front pocket — an upward peak, sitting in front of the flap */
.env__pocket {
  position: absolute; left: -1px; right: -1px; bottom: -1px; height: 64%; z-index: 3;
  background:
    linear-gradient(100deg, rgba(255,255,255,.12), transparent 42%),
    linear-gradient(165deg, var(--c2), var(--c1));
  clip-path: polygon(0 31%, 50% 0, 100% 31%, 100% 100%, 0 100%);
  filter: drop-shadow(0 -3px 4px rgba(0,0,0,.2));
}
.env__pocket::after {
  content: ""; position: absolute; inset: 0;
  clip-path: polygon(0 31%, 50% 0, 100% 31%, 100% 100%, 0 100%);
  background:
    linear-gradient(30deg, transparent 38%, rgba(255,255,255,.22) 39%, transparent 40%) left top / 50% 100% no-repeat,
    linear-gradient(-30deg, transparent 38%, rgba(255,255,255,.22) 39%, transparent 40%) right top / 50% 100% no-repeat,
    linear-gradient(180deg, rgba(255,255,255,.24), transparent 24%);
}
/* the letter peeking out of the pocket */
.env__slip {
  position: absolute; left: 11px; right: 11px; bottom: 14px; z-index: 6;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,250,253,.96));
  border: 1px solid rgba(205,217,232,.72); border-radius: 9px; padding: 8px 8px 9px;
  box-shadow: 0 3px 9px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.95), inset 0 8px 7px -8px rgba(40,60,90,.10);
}
.env__amt { text-align: center; font-weight: 900; color: #222831; font-size: 1.2rem; line-height: 1.1; white-space: nowrap; letter-spacing: 0; }
.env__amt .muted { color: #9aa3b0; font-weight: 700; }
.env__amt .over { color: #e0392f; font-weight: 800; }
.env__bar { height: 7px; border-radius: 999px; background: #e7eaf0; margin-top: 7px; overflow: hidden; }
.env__bar i { display: block; height: 100%; border-radius: 999px; transition: width .55s ease; }

/* ----- Add card ----- */
.env.add {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255,255,255,.55); border: 2px dashed #b7cde9; color: #5a76a3; box-shadow: none;
}
.env.add:hover { background: rgba(255,255,255,.85); transform: translateY(-3px); box-shadow: 0 10px 20px rgba(30,60,110,.12); }
.add__plus { font-size: 2rem; font-weight: 800; line-height: 1; }
.add__t { font-weight: 700; margin-top: 6px; }

/* ----- Empty state ----- */
.empty {
  text-align: center; background: rgba(255,255,255,.72); border: 1px solid #fff;
  border-radius: 20px; padding: 42px 20px; box-shadow: 0 8px 22px rgba(40,80,140,.1);
}
.empty__emoji { font-size: 3rem; }
.empty h2 { margin: 10px 0 4px; }
.empty p { color: #5d6b85; margin: 0 0 18px; }
.empty__btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.foot { text-align: center; color: #8194b0; font-size: .82rem; margin-top: 28px; }

/* ----- Buttons ----- */
.btn {
  border: 1px solid #d3e0f1; background: #fff; color: #2c3a57; font-weight: 700;
  border-radius: 11px; padding: 10px 16px; cursor: pointer; font-size: .95rem;
}
.btn:hover { background: #f4f8ff; }
.btn.primary { background: linear-gradient(160deg, #4f97e6, #3f7fd0); border-color: transparent; color: #fff; box-shadow: 0 6px 14px rgba(63,127,208,.3); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: #d2392f; border-color: #f3c6c2; background: #fff; }
.btn.danger:hover { background: #fff3f2; }

/* ----- Modal ----- */
#modal { position: fixed; inset: 0; display: none; z-index: 1000; }
#modal.open { display: block; }
.backdrop {
  position: absolute; inset: 0; background: rgba(22,40,70,.42);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: #fff; width: 100%; max-width: 440px; border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,.25); max-height: 92vh; overflow: auto;
  animation: slideup .26s ease;
}
@media (min-width: 560px) { .backdrop { align-items: center; } .sheet { border-radius: 22px; } }
@keyframes slideup { from { transform: translateY(34px); opacity: .5; } to { transform: none; opacity: 1; } }
.sheet__h { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 6px; gap: 10px; }
.sheet__h h3 { margin: 0; font-size: 1.2rem; }
.x { border: 0; background: #eef2f8; color: #5a6b86; width: 34px; height: 34px; border-radius: 50%; font-size: 1.35rem; line-height: 1; cursor: pointer; flex: 0 0 auto; }
.x:hover { background: #e2e8f2; }
.x.light { background: rgba(255,255,255,.25); color: #fff; }

.frm { padding: 8px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.frm > label { font-weight: 700; font-size: .9rem; color: #3a4866; display: block; }
.labelhint { color: #8a98ad; font-weight: 700; font-size: .78rem; }
.inp { margin-top: 6px; display: flex; align-items: center; border: 1.5px solid #dde6f2; border-radius: 12px; padding: 0 12px; background: #fff; transition: border-color .15s; }
.inp:focus-within { border-color: #4f97e6; }
.inp input { border: 0; outline: 0; padding: 11px 0; font-size: 1rem; width: 100%; background: transparent; color: #23304a; }
.inp.money span { color: #8a98ad; font-weight: 800; margin-right: 4px; }
.inp.search span { color: #8a98ad; font-weight: 900; margin-right: 8px; font-size: 1.05rem; }
.inp input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.frm__actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.warn { color: #7a4a12; background: #fff6e6; border: 1px solid #ffe3b0; padding: 12px; border-radius: 12px; font-size: .92rem; margin: 0; }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.sw {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; position: relative;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: 0 2px 6px rgba(0,0,0,.18); border: 3px solid transparent; transition: transform .12s, border-color .12s;
}
.sw input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.sw.on { border-color: #23304a; transform: scale(1.08); }
.sw:has(input:checked) { border-color: #23304a; transform: scale(1.08); }

/* emoji / icon picker */
.iconpick { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.iconopt { position: relative; width: 40px; height: 40px; display: grid; place-items: center; font-size: 1.2rem; line-height: 1; border: 1.5px solid #dde6f2; border-radius: 10px; cursor: pointer; background: #fff; user-select: none; }
.iconopt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.iconopt:has(input:checked) { border-color: #3f7fd0; box-shadow: 0 0 0 3px rgba(63,127,208,.18); }
.iconopt--auto { width: auto; padding: 0 14px; font-size: .82rem; font-weight: 800; color: #3a4866; }

/* segmented in/out toggle */
.seg { display: flex; gap: 6px; background: #eef2f8; padding: 4px; border-radius: 13px; }
.seg--repeat .seg__opt { font-size: .84rem; padding-left: 4px; padding-right: 4px; }
.seg__opt { flex: 1; position: relative; text-align: center; border-radius: 10px; padding: 9px 6px; font-weight: 700; color: #66758e; cursor: pointer; font-size: .92rem; user-select: none; }
.seg__opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.seg__opt:has(input:checked) { background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.seg__opt.out.on, .seg__opt.out:has(input:checked) { color: #d2392f; }
.seg__opt.in.on, .seg__opt.in:has(input:checked) { color: #1f9d57; }

/* block (full-width) buttons, used in the menu */
.btn.block { width: 100%; justify-content: center; text-align: center; display: block; }
.menu-stack { display: flex; flex-direction: column; gap: 10px; }
.menu-hint { color: #7488a6; font-size: .85rem; margin: 2px 0 0; }

/* ----- Detail modal ----- */
.det { background: linear-gradient(160deg, var(--c1), var(--c2)); color: #fff; border-radius: 22px 22px 0 0; padding: 20px 18px; }
@media (min-width: 560px) { .det { border-radius: 22px 22px 0 0; } }
.det__name { font-size: 1.4rem; font-weight: 900; text-shadow: 0 1px 2px rgba(0,0,0,.2); }
.det__sub { opacity: .9; font-weight: 600; font-size: .85rem; }
.det__body { padding: 16px 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.det__stats { display: flex; gap: 10px; }
.stat { flex: 1; background: #f5f8fc; border-radius: 14px; padding: 10px; text-align: center; }
.stat__l { font-size: .7rem; text-transform: uppercase; letter-spacing: .4px; color: #7488a6; font-weight: 700; }
.stat__v { font-size: 1.2rem; font-weight: 900; margin-top: 2px; }
.stat.neg .stat__v { color: #e0392f; }
.stat.owe .stat__v { color: #7d52b8; }
.det__bar { height: 10px; border-radius: 999px; background: #e7eaf0; overflow: hidden; }
.det__bar i { display: block; height: 100%; border-radius: 999px; transition: width .55s; }
.txform { display: flex; flex-direction: column; gap: 10px; }
.txadd { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.txadd .inp.money { margin-top: 0; flex: 1 1 120px; }
.txnote { flex: 2 1 140px; border: 1.5px solid #dde6f2; border-radius: 12px; padding: 0 12px; font-size: 1rem; outline: 0; }
.txnote:focus { border-color: #4f97e6; }
.txlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 230px; overflow: auto; }
.txlist li { display: flex; align-items: center; gap: 10px; background: #f6f8fc; border-radius: 10px; padding: 9px 12px; }
.tx__note { flex: 1; font-weight: 600; color: #33415e; }
.tx__date { color: #97a3b6; font-weight: 500; font-size: .8rem; margin-left: 4px; }
.tx__amt { font-weight: 800; }
.tx__amt.in { color: #1f9d57; }
.tx__amt.out { color: #d2392f; }
.tx__edit,
.tx__post {
  border: 1px solid #dce5f1; background: #fff; color: #40516f; font-weight: 900;
  border-radius: 999px; padding: 5px 9px; cursor: pointer; font-size: .78rem;
}
.tx__post { border-color: #b8ddc1; background: #edf8ef; color: #23633b; }
.tx__edit:hover { border-color: #aabbd2; }
.tx__post:hover { border-color: #7bc38f; }
.tx__x { border: 0; background: transparent; color: #aab3c2; font-size: 1.2rem; cursor: pointer; line-height: 1; padding: 0 2px; }
.tx__x:hover { color: #e0392f; }
.tx__empty { justify-content: center; color: #8a98ad; font-weight: 600; }
.activitysheet { display: flex; flex-direction: column; gap: 12px; }
.activityactions { display: flex; gap: 8px; flex-wrap: wrap; }
.activityactions .btn { flex: 1 1 180px; }
.schedlist .schedrow { background: #fffaf0; border: 1px solid #f1dfbd; }
.schedlist .schedrow--due { background: #fff4f1; border-color: #f0c3ba; }
.hist { border: 1px solid #e5ebf4; background: #fbfcff; border-radius: 14px; padding: 12px; max-height: 300px; overflow: auto; }
.hist__title { font-weight: 900; color: #2d3b59; margin-bottom: 10px; }
.hist__empty { color: #8a98ad; background: #f6f8fc; border-radius: 10px; padding: 12px; text-align: center; font-weight: 700; }
.hist__month + .hist__month { margin-top: 12px; }
.hist__mhead {
  position: sticky; top: -12px; z-index: 1; background: #fbfcff; color: #7488a6;
  font-size: .74rem; text-transform: uppercase; font-weight: 900; padding: 3px 0 7px;
}
.hist__list { max-height: none; overflow: visible; }
.hist__list li { align-items: flex-start; }
.hist__list .tx__date { display: block; margin: 2px 0 0; }
.goalguide {
  background: #eef8ef; border: 1px solid #cfe9d1; border-radius: 12px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 3px; margin: 9px 0; color: #315d38;
}
.goalguide b { font-size: .95rem; }
.goalguide span { color: #5e775f; font-weight: 700; font-size: .84rem; line-height: 1.25; }
.goalguide.done { background: #f1fbf3; }
.det__foot { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* ----- Flying coin ----- */
.coin-fly {
  position: fixed; z-index: 2000; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 900; color: #8a5a00;
  background: radial-gradient(circle at 35% 30%, #ffe48a, #f4b21f 70%);
  box-shadow: 0 4px 10px rgba(200,150,20,.5), inset 0 0 0 2px #ffcf52; pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===== v2: accounts + ready-to-assign + assigning ===== */

/* Accounts row */
.accounts { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 0 0 18px; }
.acct {
  display: flex; align-items: center; gap: 11px; text-align: left; font: inherit; color: inherit;
  background: rgba(255,255,255,.85); border: 1px solid #fff; box-shadow: 0 4px 12px rgba(40,80,140,.1);
  border-radius: 16px; padding: 11px 16px; cursor: pointer; min-width: 168px; transition: transform .15s, box-shadow .15s;
}
.acct:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(40,80,140,.16); }
.acct--owe {
  background: linear-gradient(160deg, #fbf7ff, #f0e7fb);
  border-color: #decdf3;
  box-shadow: 0 4px 14px rgba(125,82,184,.16);
}
.acct--owe:hover { box-shadow: 0 8px 20px rgba(125,82,184,.22); }
.acct__ic { font-size: 1.5rem; line-height: 1; }
.acct__body { display: flex; flex-direction: column; align-items: flex-start; }
.acct__name { font-weight: 700; color: #41506b; font-size: .82rem; }
.acct__tag {
  display: inline-block; margin-left: 5px; padding: 1px 5px; border-radius: 999px;
  background: #7d52b8; color: #fff; font-size: .58rem; font-weight: 900; text-transform: uppercase; letter-spacing: .3px;
  vertical-align: 1px;
}
.acct__bal { font-weight: 900; font-size: 1.25rem; color: #23304a; }
.acct.add { color: #5a76a3; border: 2px dashed #b7cde9; background: rgba(255,255,255,.5); justify-content: center; min-width: 150px; font-weight: 700; box-shadow: none; }
.acct.add:hover { background: rgba(255,255,255,.82); }
.acct__plus { font-size: 1.25rem; font-weight: 800; margin-right: 6px; }

.copyrow { text-align: center; margin: -10px 0 18px; }

.mhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 6px 2px 12px; }
.mhead__t { font-weight: 800; font-size: 1.05rem; color: #2a3a59; }
.mhead__s { color: #7488a6; font-weight: 700; font-size: .85rem; }

/* small line under the envelope amount */
.env__sub { text-align: center; font-size: .72rem; color: #8b94a2; font-weight: 700; margin-top: 1px; line-height: 1.1; }

/* assign control inside envelope detail */
.assignbox { background: #f5f8fc; border-radius: 14px; padding: 12px; }
.assignbox__top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: .85rem; color: #3a4866; margin-bottom: 8px; }
.assignbox__ready { color: #1f9d57; }
.assignbox__ready.neg { color: #e0392f; }
.assignrow { display: flex; gap: 8px; }
.assignrow .inp.money { margin-top: 0; flex: 1; }

.bignum { text-align: center; font-size: 2.4rem; font-weight: 900; margin: 6px 0 8px; }
.bignum.neg { color: #e0392f; }

.seglabel { font-weight: 700; font-size: .82rem; color: #3a4866; }
.soon { font-size: .62rem; background: #e7eaf0; color: #7488a6; border-radius: 6px; padding: 1px 6px; margin-left: 5px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; vertical-align: middle; }
.seg__opt.is-disabled { opacity: .5; cursor: not-allowed; }

.acct__foot { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.txacct { border: 1.5px solid #dde6f2; border-radius: 12px; padding: 0 10px; font-size: .95rem; outline: 0; background: #fff; flex: 1 1 120px; }
.txacct:focus { border-color: #4f97e6; }

/* ===== v3: debt accounts, transactions, legend ===== */
.acct__bal.owe { color: #7d52b8; }
.legend { display: flex; align-items: center; justify-content: center; gap: 6px; color: #7488a6; font-size: .8rem; font-weight: 700; margin: -8px 0 16px; }
.legend__sw { width: 12px; height: 12px; border-radius: 3px; background: linear-gradient(160deg, #9d72d6, #7d52b8); display: inline-block; }

.txbtn-wrap { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 18px; }
.txbtn { border: 0; background: linear-gradient(160deg, #4f97e6, #3f7fd0); color: #fff; font-weight: 800; font-size: 1rem; padding: 13px 24px; border-radius: 14px; cursor: pointer; box-shadow: 0 8px 18px rgba(63,127,208,.32); transition: transform .12s, filter .12s; }
.txbtn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.coverbtn { border: 0; background: linear-gradient(160deg, #ff6f61, #ff3b30); color: #fff; font-weight: 800; font-size: 1rem; padding: 13px 20px; border-radius: 14px; cursor: pointer; box-shadow: 0 8px 18px rgba(255,59,48,.24); transition: transform .12s, filter .12s; }
.coverbtn:hover { filter: brightness(1.04); transform: translateY(-1px); }

.sel { width: 100%; margin-top: 6px; border: 1.5px solid #dde6f2; border-radius: 12px; padding: 11px 12px; font-size: 1rem; background: #fff; color: #23304a; outline: 0; }
.sel:focus { border-color: #4f97e6; }
.txadd .sel { width: auto; flex: 1 1 110px; margin-top: 0; }

.frm.flush { padding: 0; }
.menu-hint.center { text-align: center; }

.coverlist { border: 1.5px solid #ffd0cb; background: #fff7f6; border-radius: 14px; padding: 12px; }
.coverlist__title { color: #a43d35; font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.coverrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #23304a; font-size: .96rem; }
.coverrow span { color: #df514a; font-weight: 900; white-space: nowrap; }
.stat.owe .stat__v { color: #7d52b8; }
.seg.seg3 .seg__opt { font-size: .82rem; padding: 9px 4px; }
.env--pay .env__name { font-size: .95rem; }

/* Ready to Assign styled as an open envelope (same size, envelope folds behind the content) */
.income.ready { overflow: hidden; isolation: isolate; }
.ready__flap { position: absolute; left: -1px; right: -1px; top: -1px; height: 52%; z-index: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); background: linear-gradient(180deg, rgba(255,255,255,.20), rgba(0,0,0,.10)); }
.ready__pocket { position: absolute; left: -1px; right: -1px; bottom: -1px; height: 60%; z-index: 1; clip-path: polygon(0 30%, 50% 0, 100% 30%, 100% 100%, 0 100%); background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 44%); filter: drop-shadow(0 -2px 3px rgba(150,90,10,.25)); }
.ready__content { position: relative; z-index: 2; }
.ready__bill { display: inline-block; background: linear-gradient(180deg, #dcf2de, #bfe6c4); color: #2f6b3a; font-weight: 800; letter-spacing: 1px; font-size: .76rem; padding: 6px 18px; border-radius: 7px; margin-bottom: 10px; box-shadow: 0 2px 5px rgba(0,0,0,.14), inset 0 0 0 1px rgba(47,107,58,.28); }
.goalnote { color: #7488a6; font-weight: 700; font-size: .82rem; }
.assignmsg { border-radius: 11px; padding: 10px 12px; font-weight: 700; font-size: .88rem; text-align: center; }
.assignmsg.ok { background: #e7f6ec; color: #1f7a44; border: 1px solid #bfe6c4; }
.assignmsg.warn { background: #fff6e6; color: #7a4a12; border: 1px solid #ffe3b0; }

/* First-run tutorial */
.tour__h { padding-bottom: 10px; }
.tour__step { color: #7d52b8; font-weight: 900; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.tour__lead { margin: 0; color: #3a4866; font-weight: 650; line-height: 1.45; }
.tour__points { display: grid; gap: 8px; }
.tour__points div { background: #f5f8fc; border: 1px solid #e6edf7; border-radius: 12px; padding: 10px 12px; }
.tour__points b { display: block; color: #263753; margin-bottom: 2px; }
.tour__points span { display: block; color: #687993; font-size: .88rem; line-height: 1.35; }
.tour__status div { border-width: 2px; box-shadow: 0 8px 18px rgba(30,60,110,.08); }
.tour__status .tour__status--funded { background: #effaf2; border-color: #34c759; }
.tour__status .tour__status--funded b { color: #1f7a44; }
.tour__status .tour__status--over { background: #fff2f0; border-color: #ff3b30; }
.tour__status .tour__status--over b { color: #b42318; }
.tour__status .tour__status--payment { background: #f5effd; border-color: #7d52b8; }
.tour__status .tour__status--payment b { color: #6a3fa0; }

/* tutorial skip link */
.tour__skip { display: block; width: 100%; margin: 8px 0 0; border: 0; background: transparent; color: #7488a6; font-weight: 700; font-size: .9rem; cursor: pointer; padding: 6px; }
.tour__skip:hover { color: #3a4866; text-decoration: underline; }

/* confetti celebration when an envelope hits its goal */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 3000; overflow: hidden; }
.confetti i { position: absolute; top: -16px; width: 9px; height: 14px; border-radius: 2px; opacity: .95; animation: confettiFall 1.25s cubic-bezier(.3,.6,.5,1) forwards; }
@keyframes confettiFall { to { transform: translateY(108vh) rotate(620deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }

/* gentle backup-reminder banner */
.nudge { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #fff8e8; border: 1px solid #ffe3b0; border-radius: 14px; padding: 10px 14px; margin: 0 0 14px; }
.nudge__t { color: #7a5a16; font-weight: 700; font-size: .9rem; }
.nudge__btns { display: flex; gap: 8px; }
.nudge .btn { padding: 7px 14px; }

/* desktop: put accounts and Ready to Assign side by side (mobile stays stacked) */
@media (min-width: 900px) {
  .topband { display: flex; gap: 20px; align-items: stretch; margin-bottom: 18px; }
  .topband .accounts-col { flex: 1 1 auto; min-width: 0; }
  .topband .accounts { justify-content: flex-start; margin-bottom: 8px; }
  .topband .income.ready, .topband .cash { width: 360px; max-width: 360px; margin: 0; flex: 0 0 auto; }
}

/* envelope "money just landed" bounce (plays when you return to the grid after assigning) */
@keyframes envReceive {
  0% { transform: translateY(0) scale(1); }
  26% { transform: translateY(-10px) scale(1.04); }
  50% { transform: translateY(0) scale(1); }
  68% { transform: translateY(-4px) scale(1.015); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes slipPop { 0%, 100% { transform: translateY(0); } 42% { transform: translateY(-3px); } }
.env--received { animation: envReceive .64s cubic-bezier(.3,.7,.4,1) .18s both; z-index: 1; }
.env--received .env__slip { animation: slipPop .64s ease .18s both; }
@media (prefers-reduced-motion: reduce) { .env--received, .env--received .env__slip { animation: none; } }

/* floating "+$X" money chip — immediate assign feedback, shows over modals */
.moneypop {
  position: fixed; left: 50%; top: 24%; z-index: 3200; pointer-events: none; white-space: nowrap;
  background: linear-gradient(180deg, #36c95f, #1f9d57); color: #fff; font-weight: 900; font-size: 1.1rem;
  padding: 9px 18px; border-radius: 999px;
  box-shadow: 0 10px 24px rgba(20,120,60,.42), inset 0 1px 0 rgba(255,255,255,.4);
  animation: moneyPopUp 1.05s ease forwards;
}
@keyframes moneyPopUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.82); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1.03); }
  30% { transform: translate(-50%, 0) scale(1); }
  72% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -36px) scale(1); }
}

/* ===== Ready to Assign, styled as cash / a banknote ===== */
.cash {
  position: relative; overflow: hidden; isolation: isolate; cursor: pointer;
  max-width: 460px; margin: 0 auto 24px; padding: 18px 26px 20px; text-align: center;
  color: #163e2a; border-radius: 14px;
  background:
    repeating-linear-gradient(63deg, rgba(22,62,42,.045) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-63deg, rgba(22,62,42,.04) 0 1px, transparent 1px 7px),
    radial-gradient(140% 135% at 50% -12%, #ddf0e2 0%, #aad6b8 52%, #8abf9c 100%);
  border: 1px solid #4d8a67;
  box-shadow: 0 14px 32px rgba(36,84,58,.32),
    inset 0 0 0 2px rgba(255,255,255,.55), inset 0 0 0 4px #57a076, inset 0 0 0 5px rgba(255,255,255,.3);
  transition: transform .15s, box-shadow .15s;
}
.cash:hover { transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(36,84,58,.4), inset 0 0 0 2px rgba(255,255,255,.55), inset 0 0 0 4px #57a076, inset 0 0 0 5px rgba(255,255,255,.3); }
.cash:focus-visible { outline: 3px solid #2f6b4a; outline-offset: 3px; }
.cash::before { content: ""; position: absolute; inset: 9px; border-radius: 9px; border: 1.5px solid rgba(22,62,42,.4); pointer-events: none; z-index: 0; }
.cash::after { content: "$"; position: absolute; right: 8px; bottom: -18px; z-index: 0; pointer-events: none;
  font: 900 6.5rem/1 Georgia, "Times New Roman", serif; color: rgba(22,62,42,.06); }
.cash__corner { position: absolute; z-index: 2; width: 26px; height: 26px; display: grid; place-items: center;
  font: 800 .9rem/1 Georgia, "Times New Roman", serif; color: #1f5a3c; border: 1.5px solid rgba(31,90,60,.5);
  border-radius: 50%; background: rgba(255,255,255,.45); }
.cash__corner--tl { top: 13px; left: 13px; }
.cash__corner--br { bottom: 13px; right: 13px; }
.cash__label { position: relative; z-index: 2; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase; font-size: .7rem; color: #246b48; }
.cash__label::after { content: ""; display: block; width: 54px; height: 2px; margin: 6px auto 2px; background: rgba(31,90,60,.45); }
.cash__amt { position: relative; z-index: 2; font-family: Georgia, "Times New Roman", serif; font-weight: 800;
  font-size: 2.8rem; line-height: 1.06; color: #133a27; text-shadow: 0 1px 0 rgba(255,255,255,.6); margin: 2px 0 6px; }
.cash__sub { position: relative; z-index: 2; font-weight: 700; font-size: .85rem; color: #2f6b4a; }
.cash--over .cash__amt, .cash--over .cash__sub { color: #9a2a22; }

/* =====================================================================
   THEME: "pouch" — soft fabric zippered pouches on a mint background
   Everything here is scoped to [data-theme="pouch"] so the paper theme
   is untouched. Shared modal helpers (theme picker, list rows) are below.
   ===================================================================== */
[data-theme="pouch"] body {
  background-color: #e9f3ed;
  background-image:
    radial-gradient(1200px 600px at 50% -12%, #f6fbf7, transparent 70%),
    linear-gradient(180deg, #eef7f1, #e1ede7);
  background-attachment: fixed;
}
[data-theme="pouch"] #app { padding-bottom: 96px; }
/* pouches are roomier than paper cards — cap at 3 wide like the reference */
@media (min-width: 880px) { [data-theme="pouch"] .grid--pouch { grid-template-columns: repeat(3, 1fr); } }

/* ----- pouch header ----- */
.ptop { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 4px 0 14px; }
.ptop__left { justify-self: start; }
.ptop__actions { justify-self: end; display: flex; gap: 6px; }
.ptop__month { display: flex; align-items: center; gap: 2px; background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.9); border-radius: 999px; padding: 3px 5px; box-shadow: 0 2px 8px rgba(40,90,70,.08); }
.ptop__mlabel { font-weight: 800; font-size: .82rem; letter-spacing: .4px; text-transform: uppercase; color: #2c4a3c; padding: 0 4px; white-space: nowrap; }
.ptop__brand { justify-self: center; font-weight: 900; font-size: 1.2rem; color: #28433a; display: flex; align-items: center; gap: 7px; }
.ptop .icon { background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.9); box-shadow: 0 2px 8px rgba(40,90,70,.08); color: #2c4a3c; font-size: 1.2rem; }
.ptop .icon:hover { background: #fff; }
@media (max-width: 430px) {
  .ptop { grid-template-columns: 1fr auto; grid-template-areas: "brand actions" "month month"; row-gap: 8px; }
  .ptop__brand { grid-area: brand; justify-self: start; font-size: 1.08rem; }
  .ptop__actions { grid-area: actions; }
  .ptop__left { grid-area: month; justify-self: center; }
  .ptop__mlabel { font-size: .76rem; }
  .ptop .icon { width: 32px; height: 32px; }
}

/* ----- ready / total budgeted row ----- */
.pbudget { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 4px 16px; }
.pbudget__ready { border: 0; background: transparent; font: inherit; cursor: pointer; color: #3a4a44; font-weight: 700; font-size: .96rem; padding: 7px 12px; border-radius: 10px; transition: background .12s; }
.pbudget__ready:hover { background: rgba(255,255,255,.7); }
.pbudget__ready b { color: #1f8a4c; font-weight: 900; }
.pbudget__ready.neg b { color: #d2392f; }
.pbudget__total { color: #5d6f64; font-weight: 700; font-size: .92rem; padding-right: 6px; }
.pbudget__total b { color: #28433a; font-weight: 900; }

/* ----- pouch palette (fabric body + zipper band + bar) ----- */
[data-theme="pouch"] .pouch--blue  { --band: #6fa0d8; --bg1: #d7e6f6; --bg2: #bfd5ee; --ink: #284a6b; --bar: #4f8fd8; }
[data-theme="pouch"] .pouch--teal  { --band: #5cab73; --bg1: #d4ecdb; --bg2: #bbe1c7; --ink: #2c6b43; --bar: #54b06d; }
[data-theme="pouch"] .pouch--amber { --band: #dcae45; --bg1: #f8ecd2; --bg2: #f1ddb0; --ink: #6e571a; --bar: #e3b13c; }
[data-theme="pouch"] .pouch--pink  { --band: #e08a6a; --bg1: #f8ddd2; --bg2: #f1c9b9; --ink: #7b3f2c; --bar: #e8825e; }
[data-theme="pouch"] .pouch--slate { --band: #8a96a4; --bg1: #e2e6eb; --bg2: #cfd5dc; --ink: #3f4a57; --bar: #8b97a5; }
[data-theme="pouch"] .pouch--debt  { --band: #9576c8; --bg1: #e7ddf5; --bg2: #d7c8ee; --ink: #4a3570; --bar: #9d72d6; }

/* ----- pouch card ----- */
[data-theme="pouch"] .pouch {
  position: relative; border-radius: 18px; min-height: 148px; cursor: pointer; overflow: hidden; isolation: isolate;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.10) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.022) 0 2px, transparent 2px 5px),
    linear-gradient(165deg, var(--bg1), var(--bg2));
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: 0 8px 18px rgba(40,70,90,.14), inset 0 1px 0 rgba(255,255,255,.6);
  padding: 0 0 11px; transition: transform .15s, box-shadow .15s;
}
[data-theme="pouch"] .pouch:hover { transform: translateY(-3px); box-shadow: 0 15px 28px rgba(40,70,90,.2), inset 0 1px 0 rgba(255,255,255,.6); }
[data-theme="pouch"] .pouch:focus-visible { outline: 3px solid rgba(255,255,255,.95); outline-offset: 2px; }
[data-theme="pouch"] .pouch.is-full { box-shadow: 0 0 0 2.5px #34c759, 0 8px 18px rgba(40,70,90,.16); }
[data-theme="pouch"] .pouch.is-over { box-shadow: 0 0 0 2.5px #ff3b30, 0 8px 18px rgba(40,70,90,.16); }
[data-theme="pouch"] .pouch.is-debt { box-shadow: 0 0 0 2.5px #9d72d6, 0 8px 18px rgba(40,70,90,.16); }

/* zipper band + teeth */
[data-theme="pouch"] .pouch__top { position: relative; display: flex; align-items: center; gap: 8px; padding: 9px 11px 12px; background: linear-gradient(180deg, rgba(255,255,255,.20), rgba(0,0,0,.07)), var(--band); }
[data-theme="pouch"] .pouch__top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background-color: rgba(0,0,0,.16); background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.85) 0 2px, transparent 2px 5px); box-shadow: inset 0 1px 1px rgba(255,255,255,.35), inset 0 -1px 1px rgba(0,0,0,.18); }
[data-theme="pouch"] .pouch__ic { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.94); font-size: 1rem; line-height: 1; flex: 0 0 auto; box-shadow: 0 1px 2px rgba(0,0,0,.22), inset 0 0 0 1px rgba(0,0,0,.04); }
[data-theme="pouch"] .pouch__name { flex: 1; min-width: 0; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; font-size: .85rem; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.28); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="pouch"] .pouch__pull { position: relative; width: 11px; height: 15px; border-radius: 3px; background: linear-gradient(180deg, #fbfdff, #cdd5de); box-shadow: 0 1px 2px rgba(0,0,0,.3); flex: 0 0 auto; }
[data-theme="pouch"] .pouch__pull::before { content: ""; position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 9px; height: 9px; border: 2px solid #d7dde4; border-radius: 50%; }
[data-theme="pouch"] .pouch__stat { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.95); font-size: .92rem; line-height: 1; flex: 0 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,.28); }

/* pouch body */
[data-theme="pouch"] .pouch__body { padding: 11px 13px 0; }
[data-theme="pouch"] .pouch__row1 { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
[data-theme="pouch"] .pouch__amt { font-weight: 900; font-size: clamp(1.02rem, 5vw, 1.32rem); color: var(--ink); letter-spacing: 0; line-height: 1.05; }
[data-theme="pouch"] .pouch__amt.over { color: #c0392b; }
[data-theme="pouch"] .pouch__avail { font-size: .72rem; font-weight: 700; color: rgba(20,40,30,.5); }
[data-theme="pouch"] .pouch__target { margin-left: auto; font-weight: 800; font-size: .9rem; color: rgba(20,40,30,.46); white-space: nowrap; }
/* on phones the big amount alone fills a 2-col card — drop the redundant word, let the goal reflow */
@media (max-width: 520px) { [data-theme="pouch"] .pouch__avail { display: none; } }
[data-theme="pouch"] .pouch__bar { height: 9px; border-radius: 999px; background: rgba(255,255,255,.65); margin: 9px 0 7px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.12); }
[data-theme="pouch"] .pouch__bar i { display: block; height: 100%; border-radius: 999px; background: var(--bar); transition: width .55s ease; }
[data-theme="pouch"] .pouch__row2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .76rem; font-weight: 700; color: rgba(20,40,30,.55); }
[data-theme="pouch"] .pouch__spent { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="pouch"] .pouch__pct { font-weight: 900; color: var(--ink); flex: 0 0 auto; }
[data-theme="pouch"] .pouch--received { animation: envReceive .64s cubic-bezier(.3,.7,.4,1) .18s both; z-index: 1; }

/* pouch add tile */
[data-theme="pouch"] .pouch.add { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 148px; background: rgba(255,255,255,.55); border: 2px dashed #b6cabb; color: #5a7064; box-shadow: none; padding: 0; }
[data-theme="pouch"] .pouch.add:hover { background: rgba(255,255,255,.85); transform: translateY(-3px); box-shadow: 0 10px 20px rgba(40,70,90,.12); }

/* ----- bottom tab bar ----- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; justify-content: space-around; align-items: stretch; background: rgba(255,255,255,.97); border-top: 1px solid #d9e7df; box-shadow: 0 -6px 20px rgba(40,90,70,.1); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.tab { position: relative; flex: 1; border: 0; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 700; font-size: .68rem; color: #8194a0; padding: 6px 4px; border-radius: 12px; }
.tab__ic { font-size: 1.2rem; line-height: 1; }
.tab__badge {
  position: absolute; top: 2px; right: calc(50% - 24px); min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 999px; display: grid; place-items: center; background: #e5483f; color: #fff;
  font-size: .66rem; font-weight: 950; box-shadow: 0 2px 6px rgba(150,30,20,.28);
}
.tab--on { color: #2f8d57; }
.tab:hover { background: #f1f8f3; }
@media (prefers-reduced-motion: reduce) { [data-theme="pouch"] .pouch--received { animation: none; } }

/* =====================================================================
   THEME: "modern" — frosted-glass finance shell with real envelope stacks.
   Keeps the envelope metaphor without the vintage desk treatment.
   ===================================================================== */
[data-theme="modern"] body {
  color: #1e2633;
  background-color: #eef3f5;
  background-image:
    linear-gradient(135deg, rgba(232,241,249,.96), rgba(249,246,238,.96) 44%, rgba(235,246,240,.96)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.32) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(180deg, rgba(38,57,73,.035) 0 1px, transparent 1px 42px),
    linear-gradient(90deg, rgba(73,126,162,.10), transparent 32%, rgba(93,143,91,.10) 72%, rgba(220,145,78,.09));
  background-attachment: fixed;
}
[data-theme="modern"] #app { max-width: 1180px; padding: 18px 14px 96px; }
[data-theme="modern"] .modernapp { max-width: 1140px; margin: 0 auto; }

[data-theme="modern"] .modernbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 2px 0 16px;
}
[data-theme="modern"] .modernbar__brand { display: flex; align-items: center; gap: 9px; font-weight: 900; color: #202a38; }
[data-theme="modern"] .modernbar__mark {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px;
  background: rgba(255,255,255,.48); border: 1px solid rgba(255,255,255,.70);
  -webkit-backdrop-filter: blur(18px) saturate(1.35); backdrop-filter: blur(18px) saturate(1.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78), 0 9px 22px rgba(31,43,55,.08);
}
[data-theme="modern"] .modernbar__month {
  display: flex; align-items: center; justify-content: center; gap: 7px; padding: 5px;
  background: rgba(255,255,255,.46); border: 1px solid rgba(255,255,255,.70); border-radius: 8px;
  -webkit-backdrop-filter: blur(18px) saturate(1.35); backdrop-filter: blur(18px) saturate(1.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78), 0 10px 24px rgba(31,43,55,.07);
}
[data-theme="modern"] .modernbar__month b { min-width: 136px; text-align: center; font-size: .95rem; }
[data-theme="modern"] .modernbar__actions { justify-self: end; display: flex; gap: 8px; }
[data-theme="modern"] .modernbar .icon {
  width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,.48);
  border: 1px solid rgba(255,255,255,.72); color: #263241;
  -webkit-backdrop-filter: blur(18px) saturate(1.35); backdrop-filter: blur(18px) saturate(1.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78), 0 8px 20px rgba(31,43,55,.07);
}
[data-theme="modern"] .modernbar .icon:hover { background: rgba(255,255,255,.68); }

[data-theme="modern"] .modernhero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr); gap: 12px;
  margin-bottom: 14px;
}
[data-theme="modern"] .modernready {
  position: relative; min-height: 138px; width: 100%; text-align: left; cursor: pointer; border: 1px solid rgba(255,255,255,.42); border-radius: 8px;
  padding: 20px; color: #f7fbf7; background:
    linear-gradient(135deg, rgba(255,255,255,.22), transparent 36%),
    linear-gradient(28deg, transparent 0 49%, rgba(255,255,255,.10) 49.5%, transparent 50.5%) left bottom / 58% 76% no-repeat,
    linear-gradient(-28deg, transparent 0 49%, rgba(15,30,26,.24) 49.5%, transparent 50.5%) right bottom / 58% 76% no-repeat,
    linear-gradient(180deg, rgba(33,54,49,.88), rgba(18,31,28,.92));
  -webkit-backdrop-filter: blur(22px) saturate(1.25); backdrop-filter: blur(22px) saturate(1.25);
  box-shadow: 0 18px 36px rgba(26,39,35,.18), inset 0 1px 0 rgba(255,255,255,.30);
  overflow: hidden; isolation: isolate;
}
[data-theme="modern"] .modernready::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 15px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.36), transparent); pointer-events: none;
}
[data-theme="modern"] .modernready:hover { transform: translateY(-1px); box-shadow: 0 20px 38px rgba(26,39,35,.21), inset 0 1px 0 rgba(255,255,255,.20); }
[data-theme="modern"] .modernready span,
[data-theme="modern"] .modernstat span,
[data-theme="modern"] .modernhead span,
[data-theme="modern"] .modernpanel__head span {
  display: block; color: #708078; font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0;
}
[data-theme="modern"] .modernready span { color: #b9d5c5; }
[data-theme="modern"] .modernready b { display: block; margin: 8px 0 6px; font-size: 2.25rem; line-height: 1; }
[data-theme="modern"] .modernready em { color: #d8e7dd; font-style: normal; font-weight: 800; }
[data-theme="modern"] .modernready.neg { background: linear-gradient(180deg, #3a2425, #251617); }
[data-theme="modern"] .modernready.neg span,
[data-theme="modern"] .modernready.neg em { color: #ffd5d1; }

[data-theme="modern"] .modernstats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
[data-theme="modern"] .modernstat {
  min-height: 138px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
  padding: 16px; border-radius: 8px; background: rgba(255,255,255,.48); border: 1px solid rgba(255,255,255,.68);
  -webkit-backdrop-filter: blur(20px) saturate(1.32); backdrop-filter: blur(20px) saturate(1.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 14px 28px rgba(31,43,55,.07);
}
[data-theme="modern"] .modernstat b { color: #223040; font-size: 1.18rem; }

[data-theme="modern"] .modernalert {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px;
  padding: 10px 12px; border-radius: 8px; color: #8b2822; background: rgba(255,241,239,.68); border: 1px solid rgba(255,255,255,.68);
  -webkit-backdrop-filter: blur(18px) saturate(1.35); backdrop-filter: blur(18px) saturate(1.35);
  font-weight: 850;
}
[data-theme="modern"] .modernlayout { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 16px; align-items: start; }
[data-theme="modern"] .modernmain { min-width: 0; }
[data-theme="modern"] .modernhead {
  display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 4px 0 12px;
}
[data-theme="modern"] .modernhead h2 { margin: 2px 0 0; color: #1f2936; font-size: 1.65rem; line-height: 1.08; }

[data-theme="modern"] .modernboard {
  position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px;
  padding: 16px; border-radius: 14px; background:
    radial-gradient(520px 180px at 50% 0, rgba(255,255,255,.46), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.38), rgba(245,249,250,.24));
  border: 1px solid rgba(255,255,255,.62);
  -webkit-backdrop-filter: blur(20px) saturate(1.25); backdrop-filter: blur(20px) saturate(1.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.66), 0 18px 38px rgba(31,43,55,.08);
}
[data-theme="modern"] .modernboard::before {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 12px; height: 28px; border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(70,88,96,.08)); pointer-events: none;
}
[data-theme="modern"] .modernsection {
  position: relative; min-width: 0; padding: 0; border-radius: 10px; background: transparent; border: 0;
  box-shadow: none;
}
[data-theme="modern"] .modernsection__head {
  position: relative; z-index: 2; display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
  max-width: calc(100% - 18px); margin-left: 10px; padding: 8px 12px 7px;
  border-radius: 9px 9px 0 0; background: rgba(255,255,255,.52); border: 1px solid rgba(255,255,255,.66); border-bottom: 0;
  -webkit-backdrop-filter: blur(16px) saturate(1.25); backdrop-filter: blur(16px) saturate(1.25);
  color: #273341; font-weight: 900;
}
[data-theme="modern"] .modernsection__head em { color: #7b8791; font-style: normal; font-size: .8rem; font-weight: 800; }
[data-theme="modern"] .modernlist {
  position: relative; display: flex; flex-direction: column; gap: 0; padding: 9px 9px 12px; border-radius: 9px;
  background:
    linear-gradient(90deg, rgba(55,70,82,.08), transparent 8%, transparent 92%, rgba(55,70,82,.08)),
    linear-gradient(180deg, rgba(92,108,119,.10), rgba(255,255,255,.10) 24%, rgba(92,108,119,.07));
  box-shadow: inset 0 10px 18px rgba(45,59,70,.08), inset 0 -8px 18px rgba(255,255,255,.16);
}

[data-theme="modern"] .modernenv {
  position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  min-height: 88px; padding: 13px 14px 13px 17px; overflow: hidden; cursor: pointer; isolation: isolate;
  color: #223040; background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.48));
  border: 1px solid rgba(255,255,255,.72); border-radius: 8px;
  -webkit-backdrop-filter: blur(22px) saturate(1.35); backdrop-filter: blur(22px) saturate(1.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.86), 0 9px 24px rgba(31,43,55,.075);
}
[data-theme="modern"] .modernenv + .modernenv { margin-top: -8px; }
[data-theme="modern"] .modernenv:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.88), 0 13px 28px rgba(31,43,55,.11); }
[data-theme="modern"] .modernenv:focus-visible { outline: 3px solid rgba(78,132,210,.35); outline-offset: 2px; }
[data-theme="modern"] .modernenv::before {
  content: ""; position: absolute; right: 0; top: 0; z-index: 4; width: 24px; height: 24px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.86) 0 50%, rgba(255,255,255,.12) 51%);
  border-left: 1px solid rgba(255,255,255,.62); border-bottom: 1px solid rgba(34,51,65,.07);
}
[data-theme="modern"] .modernenv::after {
  content: ""; position: absolute; z-index: 1; left: 66px; right: 106px; bottom: 20px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(34,51,65,.10), transparent);
}
[data-theme="modern"] .modernenv__flap,
[data-theme="modern"] .modernenv__pocket {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
}
[data-theme="modern"] .modernenv__flap {
  background:
    linear-gradient(31deg, transparent 49%, rgba(48,64,78,.12) 49.7%, rgba(255,255,255,.42) 50.4%, transparent 51.2%) left bottom / 52% 70% no-repeat,
    linear-gradient(-31deg, transparent 49%, rgba(48,64,78,.10) 49.7%, rgba(255,255,255,.38) 50.4%, transparent 51.2%) right bottom / 52% 70% no-repeat,
    linear-gradient(146deg, transparent 44%, rgba(255,255,255,.42) 44.8%, rgba(48,64,78,.08) 45.5%, transparent 46.2%) left top / 52% 52% no-repeat,
    linear-gradient(-146deg, transparent 44%, rgba(255,255,255,.42) 44.8%, rgba(48,64,78,.08) 45.5%, transparent 46.2%) right top / 52% 52% no-repeat;
}
[data-theme="modern"] .modernenv__pocket {
  top: auto; height: 58%; border-radius: 0 0 8px 8px; clip-path: polygon(0 28%, 50% 0, 100% 28%, 100% 100%, 0 100%);
  background:
    linear-gradient(90deg, rgba(255,255,255,.22), transparent 34%, transparent 66%, rgba(48,64,78,.045)),
    linear-gradient(180deg, rgba(255,255,255,.30), rgba(255,255,255,.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.36);
}
[data-theme="modern"] .modernenv__accent {
  position: absolute; left: 0; top: 0; bottom: 0; z-index: 3; width: 7px; border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, var(--c1), var(--c2)); box-shadow: 0 0 18px rgba(48,96,138,.13);
}
[data-theme="modern"] .modernenv__ic {
  position: relative; z-index: 2;
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 8px; font-size: 1.15rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.76)),
    linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: inset 0 0 0 1px rgba(34,51,65,.07);
}
[data-theme="modern"] .modernenv__main { position: relative; z-index: 2; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
[data-theme="modern"] .modernenv__top,
[data-theme="modern"] .modernenv__meta { display: flex; align-items: center; gap: 9px; min-width: 0; }
[data-theme="modern"] .modernenv__name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #1f2936; font-weight: 900;
}
[data-theme="modern"] .modernenv__meta {
  color: #77828c; font-size: .82rem; font-weight: 750; justify-content: space-between;
}
[data-theme="modern"] .modernenv__meta span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="modern"] .modernenv__guide { flex: 0 0 auto; color: #3f7f52; font-weight: 900; }
[data-theme="modern"] .modernenv__stamp {
  flex: 0 0 auto; color: var(--stamp, #2f8f57); background: var(--stamp-bg, #eefaf2);
  border: 1.5px dashed currentColor; border-radius: 6px;
  padding: 3px 7px; font-size: .66rem; font-weight: 900; text-transform: uppercase; line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.54);
}
[data-theme="modern"] .modernenv__stamp--full { --stamp: #2f8f57; --stamp-bg: rgba(238,250,242,.72); }
[data-theme="modern"] .modernenv__stamp--pay { --stamp: #7657a8; --stamp-bg: rgba(243,239,250,.74); }
[data-theme="modern"] .modernenv__stamp--over { --stamp: #c83f36; --stamp-bg: rgba(255,240,238,.78); }
[data-theme="modern"] .modernenv__bar { height: 5px; border-radius: 999px; background: rgba(232,237,240,.76); overflow: hidden; }
[data-theme="modern"] .modernenv__bar i { display: block; height: 100%; border-radius: inherit; }
[data-theme="modern"] .modernenv__money { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
[data-theme="modern"] .modernenv__money b { color: #182230; font-size: 1.05rem; }
[data-theme="modern"] .modernenv__money b.neg { color: #c83f36; }
[data-theme="modern"] .modernenv__money em { color: #8a949d; font-style: normal; font-size: .7rem; font-weight: 850; text-transform: uppercase; }
[data-theme="modern"] .modernenv.is-full { border-color: rgba(47,143,87,.28); }
[data-theme="modern"] .modernenv.is-over { border-color: rgba(200,63,54,.34); background: linear-gradient(180deg, rgba(255,255,255,.76), rgba(255,247,245,.62)); }
[data-theme="modern"] .modernenv.is-pay { border-color: rgba(118,87,168,.28); }
[data-theme="modern"] .modernenv--received { animation: envReceive .64s cubic-bezier(.3,.7,.4,1) .18s both; }

[data-theme="modern"] .modernside { display: flex; flex-direction: column; gap: 12px; }
[data-theme="modern"] .modernpanel {
  padding: 14px; border-radius: 8px; background: rgba(255,255,255,.46); border: 1px solid rgba(255,255,255,.68);
  -webkit-backdrop-filter: blur(20px) saturate(1.32); backdrop-filter: blur(20px) saturate(1.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 14px 28px rgba(31,43,55,.07);
}
[data-theme="modern"] .modernpanel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
[data-theme="modern"] .modernpanel__big { color: #2f8f57; font-size: 1.65rem; font-weight: 950; }
[data-theme="modern"] .modernpanel__big.neg { color: #c83f36; }
[data-theme="modern"] .modernpanel__rows { display: flex; flex-direction: column; gap: 7px; margin: 12px 0; color: #6e7a83; font-weight: 800; }
[data-theme="modern"] .modernpanel__rows span { display: flex; justify-content: space-between; gap: 12px; }
[data-theme="modern"] .modernpanel p { margin: 10px 0 0; color: #66727b; font-weight: 750; line-height: 1.35; }
[data-theme="modern"] .mini {
  border: 1px solid rgba(34,51,65,.12); border-radius: 7px; background: #f8faf8; color: #293546;
  font-weight: 900; cursor: pointer; min-width: 30px; min-height: 30px;
}
[data-theme="modern"] .modernacct {
  width: 100%; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 9px 0; border: 0; border-top: 1px solid rgba(34,51,65,.08); background: transparent; color: #283443;
  text-align: left; cursor: pointer;
}
[data-theme="modern"] .modernacct:hover { color: #0f5f86; }
[data-theme="modern"] .modernacct em { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; font-weight: 850; }
[data-theme="modern"] .modernacct b { font-size: .86rem; }
[data-theme="modern"] .modernacct.owe b { color: #7657a8; }
[data-theme="modern"] .modernacct--empty {
  display: block; border: 1px dashed rgba(34,51,65,.18); border-radius: 8px; padding: 12px; text-align: center; font-weight: 850;
}
[data-theme="modern"] .modernpanel__link {
  width: 100%; margin-top: 8px; border: 1px solid rgba(255,255,255,.62); border-radius: 7px; background: rgba(237,245,240,.58); color: #24573b;
  padding: 9px 10px; font-weight: 900; cursor: pointer;
}

[data-theme="modern"] .tabbar {
  background: rgba(255,255,255,.58); border-top-color: rgba(255,255,255,.68); box-shadow: 0 -10px 28px rgba(31,43,55,.10);
  -webkit-backdrop-filter: blur(24px) saturate(1.35); backdrop-filter: blur(24px) saturate(1.35);
}
[data-theme="modern"] .tab { color: #7a858d; }
[data-theme="modern"] .tab:hover { background: #f2f6f4; }
[data-theme="modern"] .tab--on { color: #1f75a8; }

/* Modern tablet-board direction: real envelope cards, not list rows. */
[data-theme="modern"] .modernapp {
  max-width: 1160px; margin: 0 auto; padding: 18px; border-radius: 28px;
  color: #eaf7f5; background:
    radial-gradient(540px 260px at 52% 7%, rgba(45,226,178,.24), transparent 68%),
    radial-gradient(520px 280px at 12% 80%, rgba(49,193,156,.20), transparent 70%),
    linear-gradient(165deg, #08213a 0%, #073b4a 46%, #08645e 100%);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 28px 70px rgba(7,23,37,.28), inset 0 1px 0 rgba(255,255,255,.18);
}
[data-theme="modern"] .modernbar__brand,
[data-theme="modern"] .modernhead h2 { color: #f4fbf9; }
[data-theme="modern"] .modernbar__mark,
[data-theme="modern"] .modernbar__month,
[data-theme="modern"] .modernbar .icon {
  background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.22); color: #f2fbfa;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 8px 18px rgba(2,17,29,.18);
}
[data-theme="modern"] .modernbar .icon:hover { background: rgba(255,255,255,.16); }
[data-theme="modern"] .modernhero {
  grid-template-columns: minmax(280px, 430px) minmax(0, 1fr); align-items: stretch; margin-bottom: 16px;
}
[data-theme="modern"] .modernready {
  min-height: 170px; text-align: center; padding: 16px 18px 18px; border-color: rgba(153,245,219,.30);
  background:
    radial-gradient(260px 86px at 50% 78%, rgba(64,231,190,.30), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 18px 38px rgba(0,12,23,.22);
}
[data-theme="modern"] .modernready span { color: #d8fff2; }
[data-theme="modern"] .modernready b { margin: 2px 0 2px; color: #94ef9d; font-size: 2.42rem; text-shadow: 0 0 18px rgba(113,234,144,.22); }
[data-theme="modern"] .modernready em { color: #d8fff2; }
[data-theme="modern"] .modernready__tray {
  position: relative; display: block; width: min(270px, 86%); height: 62px; margin: 4px auto 7px; border-radius: 18px 18px 24px 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.50), rgba(255,255,255,.14)),
    linear-gradient(90deg, rgba(64,229,189,.28), rgba(255,255,255,.08), rgba(64,229,189,.20));
  border: 1px solid rgba(202,255,244,.42);
  -webkit-backdrop-filter: blur(18px) saturate(1.45); backdrop-filter: blur(18px) saturate(1.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.48), 0 16px 24px rgba(1,20,28,.24);
}
[data-theme="modern"] .modernready__tray i {
  position: absolute; width: 24px; height: 24px; border-radius: 50%; background:
    radial-gradient(circle at 38% 32%, #fff1a8 0 18%, #f0bd39 19% 64%, #d8951f 65%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.28), 0 4px 9px rgba(0,0,0,.18);
}
[data-theme="modern"] .modernready__tray i:nth-child(1) { left: 54px; top: 16px; }
[data-theme="modern"] .modernready__tray i:nth-child(2) { left: 104px; top: 7px; transform: rotate(-12deg); }
[data-theme="modern"] .modernready__tray i:nth-child(3) { right: 86px; top: 19px; }
[data-theme="modern"] .modernready__tray i:nth-child(4) { right: 42px; top: 12px; transform: rotate(16deg); }
[data-theme="modern"] .modernready__tray em {
  position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); padding: 6px 22px; border-radius: 999px;
  color: #e9fffb; background: linear-gradient(180deg, rgba(83,203,220,.92), rgba(42,137,181,.96));
  border: 1px solid rgba(255,255,255,.32); font-size: .72rem; font-weight: 900; text-transform: uppercase;
  box-shadow: 0 8px 16px rgba(1,22,35,.25);
}
[data-theme="modern"] .modernready__art {
  position: relative; display: block; width: min(292px, 92%); height: 96px; margin: -2px auto 0;
}
[data-theme="modern"] .modernready__svg {
  display: block; width: 100%; height: 100%; overflow: visible;
}
[data-theme="modern"] .modernready__glow {
  fill: rgba(70,246,199,.24); filter: blur(16px);
}
[data-theme="modern"] .modernready__bills { filter: drop-shadow(0 8px 9px rgba(0,20,21,.22)); }
[data-theme="modern"] .modernready__bill {
  fill: #9bd8a3; stroke: rgba(236,255,232,.42); stroke-width: 1.2;
}
[data-theme="modern"] .modernready__bill--two { fill: #7fc895; }
[data-theme="modern"] .modernready__billmark {
  fill: rgba(62,128,72,.20); stroke: rgba(62,128,72,.26); stroke-width: 2; stroke-linecap: round;
}
[data-theme="modern"] .modernready__coins circle {
  fill: #efbd3e; stroke: #ffd978; stroke-width: 4;
  filter: drop-shadow(0 5px 5px rgba(0,18,31,.22));
}
[data-theme="modern"] .modernready__trayglass {
  fill: rgba(194,255,246,.34); stroke: rgba(225,255,251,.72); stroke-width: 1.4;
  filter: drop-shadow(0 14px 15px rgba(0,20,28,.30));
}
[data-theme="modern"] .modernready__trayedge,
[data-theme="modern"] .modernready__trayshine {
  fill: none; stroke: rgba(235,255,252,.72); stroke-width: 2; stroke-linecap: round;
}
[data-theme="modern"] .modernready__trayshine { opacity: .58; }
[data-theme="modern"] .modernready__fundpill rect {
  fill: rgba(54,172,205,.92); stroke: rgba(226,255,252,.42); stroke-width: 1;
  filter: drop-shadow(0 7px 9px rgba(0,22,33,.26));
}
[data-theme="modern"] .modernready__fundpill text {
  fill: #eaffff; font: 900 12px system-ui, -apple-system, Segoe UI, sans-serif; text-anchor: middle; letter-spacing: .08em;
}
[data-theme="modern"] .modernstats { grid-template-columns: repeat(3, minmax(0, 1fr)); align-self: end; }
[data-theme="modern"] .modernstat {
  min-height: 92px; background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 24px rgba(1,16,29,.17);
}
[data-theme="modern"] .modernstat span,
[data-theme="modern"] .modernhead span,
[data-theme="modern"] .modernpanel__head span { color: rgba(223,248,244,.74); }
[data-theme="modern"] .modernstat b { color: #f6fffb; }
[data-theme="modern"] .modernlayout { grid-template-columns: minmax(0, 1fr) 250px; }
[data-theme="modern"] .modernhead { margin-top: 2px; color: #eaf7f5; }
[data-theme="modern"] .modernhead .btn.primary {
  background: rgba(76,205,178,.20); border: 1px solid rgba(194,255,240,.26); color: #eafff9; box-shadow: none;
}
[data-theme="modern"] .modernboard {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px; border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(23,133,131,.54), rgba(10,86,91,.56)),
    radial-gradient(520px 180px at 50% 0, rgba(100,249,211,.16), transparent 72%);
  border: 1px solid rgba(193,255,244,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 18px 38px rgba(0,16,27,.24);
}
[data-theme="modern"] .modernboard::before { display: none; }
[data-theme="modern"] .modernsection {
  min-height: 0; padding-top: 22px;
}
[data-theme="modern"] .modernsection__head {
  position: absolute; left: 6px; top: 0; max-width: calc(100% - 12px); margin: 0; padding: 0;
  color: rgba(238,255,252,.9); background: transparent; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  font-size: .58rem; text-transform: uppercase;
}
[data-theme="modern"] .modernsection__head em { display: none; }
[data-theme="modern"] .modernlist {
  display: grid; grid-template-columns: 1fr; gap: 9px; padding: 0; background: transparent; box-shadow: none;
}
[data-theme="modern"] .modernenv {
  display: block; min-height: 132px; padding: 0; overflow: visible; border: 0; border-radius: 17px;
  color: #24313b; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: none;
}
[data-theme="modern"] .modernenv + .modernenv { margin-top: 0; }
[data-theme="modern"] .modernenv:hover { transform: translateY(-2px); box-shadow: none; }
[data-theme="modern"] .modernenv__flap {
  z-index: 1; left: 21px; right: 21px; top: 4px; bottom: auto; height: 49px; border-radius: 13px 13px 7px 7px;
  clip-path: polygon(0 100%, 9% 18%, 50% 0, 91% 18%, 100% 100%);
  background: linear-gradient(180deg, var(--c2), var(--c1));
  background: linear-gradient(180deg, color-mix(in srgb, var(--c2) 58%, #fff), color-mix(in srgb, var(--c1) 72%, #fff));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 8px 12px rgba(0,18,31,.18);
}
[data-theme="modern"] .modernenv__flap::before {
  content: ""; position: absolute; inset: 0; clip-path: inherit;
  background:
    linear-gradient(135deg, transparent 49%, rgba(255,255,255,.36) 50%, transparent 51%) left top / 50% 100% no-repeat,
    linear-gradient(-135deg, transparent 49%, rgba(0,34,42,.14) 50%, transparent 51%) right top / 50% 100% no-repeat;
  opacity: .7;
}
[data-theme="modern"] .modernenv__pocket {
  z-index: 3; left: 8px; right: 8px; top: 28px; bottom: 8px; height: auto; border-radius: 13px;
  clip-path: none; border: 1px solid rgba(108,79,46,.30);
  background:
    radial-gradient(140px 64px at 50% 40%, rgba(255,255,255,.74), transparent 72%),
    linear-gradient(180deg, #fffaf0 0%, #f8efdd 56%, #efe1c9 100%);
  box-shadow: 0 13px 20px rgba(0,18,31,.22), inset 0 1px 0 rgba(255,255,255,.82), inset 0 -1px 0 rgba(112,80,46,.14);
}
[data-theme="modern"] .modernenv__pocket::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 48px; border-radius: 12px 12px 0 0; pointer-events: none;
  background:
    linear-gradient(147deg, transparent 47%, rgba(121,89,58,.16) 48%, rgba(255,255,255,.64) 49%, transparent 50%) left top / 50% 100% no-repeat,
    linear-gradient(-147deg, transparent 47%, rgba(121,89,58,.16) 48%, rgba(255,255,255,.62) 49%, transparent 50%) right top / 50% 100% no-repeat,
    linear-gradient(180deg, rgba(255,255,255,.34), transparent 76%);
}
[data-theme="modern"] .modernenv__pocket::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(29deg, transparent 48%, rgba(121,89,58,.17) 49%, rgba(255,255,255,.55) 50%, transparent 51%) left bottom / 50% 60% no-repeat,
    linear-gradient(-29deg, transparent 48%, rgba(121,89,58,.17) 49%, rgba(255,255,255,.48) 50%, transparent 51%) right bottom / 50% 60% no-repeat;
}
[data-theme="modern"] .modernenv::before {
  content: ""; position: absolute; left: 20px; right: 20px; bottom: 3px; z-index: 0; height: 15px; width: auto; pointer-events: none;
  top: auto; border: 0;
  background: rgba(0,18,31,.22); filter: blur(11px); border-radius: 999px;
}
[data-theme="modern"] .modernenv::after {
  z-index: 4; left: 20px; right: 20px; top: 31px; bottom: auto; height: 5px; background: linear-gradient(90deg, var(--c1), var(--c2)); border-radius: 999px;
  box-shadow: 0 1px 0 rgba(255,255,255,.34);
}
[data-theme="modern"] .modernenv__accent {
  display: none;
}
[data-theme="modern"] .modernenv__ic { display: none; }
[data-theme="modern"] .modernenv__main {
  position: absolute; inset: 29px 14px 12px; z-index: 6; display: block;
}
[data-theme="modern"] .modernenv__top {
  display: flex; align-items: flex-start; justify-content: center; gap: 8px; min-height: 28px; padding: 8px 78px 0 18px;
}
[data-theme="modern"] .modernenv__name {
  color: #25313a; font-size: .78rem; text-align: center; white-space: normal; line-height: 1.08; flex: 1;
  max-height: 2.18em; overflow: hidden;
}
[data-theme="modern"] .modernenv__hero {
  position: absolute; left: 50%; top: 30px; transform: translateX(-50%); width: 46px; height: 31px; display: grid; place-items: center;
  border-radius: 11px; font-size: 1.24rem; background: rgba(255,255,255,.24); box-shadow: none;
}
[data-theme="modern"] .modernenv__meta {
  display: none;
}
[data-theme="modern"] .modernenv__guide { color: #2f8f57; text-align: center; font-size: .61rem; white-space: nowrap; }
[data-theme="modern"] .modernenv__bar { position: absolute; left: 26px; right: 26px; bottom: 9px; height: 5px; background: rgba(214,202,183,.74); }
[data-theme="modern"] .modernenv__money {
  position: absolute; left: 21px; right: 21px; bottom: 20px; z-index: 7; align-items: baseline; justify-content: center; text-align: center;
  flex-direction: row; gap: 4px; padding: 4px 7px 3px; border-radius: 8px; background: rgba(255,255,255,.48); border: 1px solid rgba(255,255,255,.52);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}
[data-theme="modern"] .modernenv__money b { font-size: .72rem; color: #26323a; line-height: 1; }
[data-theme="modern"] .modernenv__money em { display: inline; color: #46515c; font-style: normal; font-size: .58rem; font-weight: 850; }
[data-theme="modern"] .modernenv__stamp {
  position: absolute; right: 12px; top: 36px; z-index: 8; font-size: .49rem; transform: rotate(-4deg); background: rgba(255,250,239,.91);
}
[data-theme="modern"] .modernenv.is-over .modernenv__pocket { background: linear-gradient(180deg, #fff4f0, #f1dace); border-color: rgba(223,67,56,.82); box-shadow: 0 0 0 2px rgba(223,67,56,.76), 0 13px 20px rgba(0,18,31,.22), inset 0 1px 0 rgba(255,255,255,.82); }
[data-theme="modern"] .modernenv::before,
[data-theme="modern"] .modernenv::after { display: none; }
[data-theme="modern"] .modernenv__shell {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; display: block;
}
[data-theme="modern"] .modernenv__svg {
  display: block; width: 100%; height: 100%; overflow: visible;
}
[data-theme="modern"] .modernenv__svg-shadow {
  fill: rgba(0,18,31,.25); filter: blur(7px);
}
[data-theme="modern"] .modernenv__svg-back {
  fill: #ead7b9; opacity: .76;
}
[data-theme="modern"] .modernenv__svg-backflap {
  fill: #f4dfbd; opacity: .96;
  filter: drop-shadow(0 4px 5px rgba(0,18,31,.16));
}
[data-theme="modern"] .modernenv__svg-backshine {
  fill: rgba(255,255,255,.28);
}
[data-theme="modern"] .modernenv__svg-front {
  fill: #fff7e7; stroke: rgba(102,75,45,.34); stroke-width: 1.2px;
  filter: drop-shadow(0 10px 13px rgba(0,18,31,.18));
}
[data-theme="modern"] .modernenv__svg-lip {
  fill: var(--c2); opacity: .22;
}
[data-theme="modern"] .modernenv__svg--closed .modernenv__svg-lip {
  opacity: .48;
}
[data-theme="modern"] .modernenv__svg-topfold {
  fill: rgba(255,249,236,.92);
}
[data-theme="modern"] .modernenv__svg-sealflap {
  fill: rgba(255,249,236,.94);
  stroke: rgba(114,82,48,.18);
  stroke-width: .9px;
}
[data-theme="modern"] .modernenv__svg-leftfold {
  fill: rgba(244,229,205,.82);
}
[data-theme="modern"] .modernenv__svg-rightfold {
  fill: rgba(237,219,188,.78);
}
[data-theme="modern"] .modernenv__svg-bottomfold {
  fill: rgba(246,233,210,.86);
}
[data-theme="modern"] .modernenv__svg-frontglow {
  fill: rgba(255,255,255,.22);
}
[data-theme="modern"] .modernenv__svg-seam {
  fill: none; stroke: rgba(114,82,48,.28); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round;
}
[data-theme="modern"] .modernenv__svg-seam--b { stroke: rgba(114,82,48,.20); }
[data-theme="modern"] .modernenv__svg-seam--seal { stroke: rgba(114,82,48,.24); }
[data-theme="modern"] .modernenv__svg--closed .modernenv__svg-front {
  fill: #fff8eb;
}
[data-theme="modern"] .modernenv__svg--closed .modernenv__svg-frontglow {
  fill: rgba(255,255,255,.18);
}
[data-theme="modern"] .modernenv.is-full .modernenv__svg-front { stroke: rgba(47,143,87,.64); }
[data-theme="modern"] .modernenv.is-pay .modernenv__svg-front { stroke: rgba(118,87,168,.62); }
[data-theme="modern"] .modernenv.is-over .modernenv__svg-front {
  fill: #fff1ec; stroke: rgba(223,67,56,.86); stroke-width: 2.4px;
}
[data-theme="modern"] .modernenv.is-over .modernenv__svg-lip { fill: #df514a; opacity: .34; }
[data-theme="modern"] .modernenv.is-closed .modernenv__stamp {
  top: 34px;
}

/* ===== Modern paper envelope (rebuilt 2026-06-02): real open / closed paper envelopes ===== */
[data-theme="modern"] .modernenv {
  position: relative; display: block; min-height: 156px; padding: 0; overflow: hidden; cursor: pointer; isolation: isolate;
  border-radius: 16px; color: #24313b;
  background:
    linear-gradient(40deg, transparent 49.2%, rgba(120,92,52,.13) 49.7%, transparent 50.3%) left bottom / 50% 62% no-repeat,
    linear-gradient(-40deg, transparent 49.2%, rgba(120,92,52,.13) 49.7%, transparent 50.3%) right bottom / 50% 62% no-repeat,
    radial-gradient(190px 78px at 50% 62%, rgba(255,255,255,.34), transparent 74%),
    repeating-linear-gradient(48deg, rgba(120,92,52,.022) 0 1.5px, transparent 1.5px 5px),
    linear-gradient(180deg, #fffdf6, #f1e7d4);
  border: 1px solid rgba(120,92,52,.3);
  box-shadow: 0 16px 28px rgba(0,18,31,.22), inset 0 1px 0 rgba(255,255,255,.92), inset 0 -1px 0 rgba(120,92,52,.12);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  --tint: color-mix(in srgb, var(--c1) 24%, #fff);
  --tint2: color-mix(in srgb, var(--c1) 11%, #fff8ec);
}
[data-theme="modern"] .modernenv + .modernenv { margin-top: 0; }
[data-theme="modern"] .modernenv::before {
  content: ""; display: block; position: absolute; left: 14px; right: 14px; top: 10px; height: 4px; z-index: 4; border-radius: 999px;
  background: linear-gradient(90deg, var(--c1), var(--c2));
  box-shadow: 0 1px 0 rgba(255,255,255,.48);
}
[data-theme="modern"] .modernenv::after { display: none; content: none; }
[data-theme="modern"] .modernenv:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 34px rgba(0,18,31,.28), inset 0 1px 0 rgba(255,255,255,.92), inset 0 -1px 0 rgba(120,92,52,.12);
}
[data-theme="modern"] .modernenv:focus-visible { outline: 3px solid rgba(120,205,184,.6); outline-offset: 3px; }

/* the paper FRONT (just holds the content; the card itself is the paper) */
[data-theme="modern"] .modernenv__face {
  position: relative; z-index: 3; margin-top: 58px; padding: 6px 16px 16px; display: flex; flex-direction: column; gap: 8px;
  background: transparent; border: 0; box-shadow: none;
}
[data-theme="modern"] .modernenv__face::after { content: none; }

/* the flap. A thin colored strip across the very top = category identity. */
[data-theme="modern"] .modernenv__lid { position: absolute; left: 0; right: 0; top: 0; height: 58px; z-index: 1; pointer-events: none; }
[data-theme="modern"] .modernenv__lid::before { content: none; }
/* CLOSED = sealed flap folded down over the front (tinted triangle on the cream paper) */
[data-theme="modern"] .modernenv.is-closed .modernenv__lid {
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(165deg, #fffdf7 0%, #f6eddb 56%, #e8d8bd 100%);
  filter: drop-shadow(0 6px 5px rgba(46,32,14,.22));
}
[data-theme="modern"] .modernenv.is-closed .modernenv__lid::after {
  content: ""; position: absolute; inset: 0; clip-path: inherit; z-index: 2;
  background:
    linear-gradient(39deg, transparent 48.3%, rgba(108,82,46,.32) 49.5%, transparent 50.7%) left top / 50% 100% no-repeat,
    linear-gradient(-39deg, transparent 48.3%, rgba(108,82,46,.32) 49.5%, transparent 50.7%) right top / 50% 100% no-repeat;
}
/* a colored wax seal at the flap tip (closed) = sealed look + category identity */
[data-theme="modern"] .modernenv.is-closed .modernenv__note {
  display: block; position: absolute; left: 50%; top: 34px; transform: translateX(-50%); width: 20px; height: 20px; z-index: 5; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 36% 30%, color-mix(in srgb, var(--c1) 52%, #fff), var(--c1) 58%, color-mix(in srgb, var(--c1) 64%, #000));
  border: 1px solid color-mix(in srgb, var(--c1) 58%, #000);
  box-shadow: 0 2px 5px rgba(0,0,0,.32), inset 0 1px 2px rgba(255,255,255,.5);
}
/* OPEN = the flap is raised (apex UP) and a white letter rises out of the envelope */
[data-theme="modern"] .modernenv.is-open .modernenv__lid {
  clip-path: polygon(0 100%, 50% 5%, 100% 100%);
  background: linear-gradient(180deg, #fcf6e9 0%, #f0e4ce 60%, #ddccaf 100%);
  filter: drop-shadow(0 3px 3px rgba(46,32,14,.16));
}
[data-theme="modern"] .modernenv.is-open .modernenv__lid::after {
  content: ""; position: absolute; inset: 0; clip-path: inherit; z-index: 1;
  background:
    linear-gradient(141deg, transparent 48.6%, rgba(120,92,52,.20) 49.5%, transparent 50.4%) left top / 50% 100% no-repeat,
    linear-gradient(-141deg, transparent 48.6%, rgba(120,92,52,.20) 49.5%, transparent 50.4%) right top / 50% 100% no-repeat;
}
[data-theme="modern"] .modernenv__note { display: none; }
[data-theme="modern"] .modernenv.is-open .modernenv__note {
  display: block; position: absolute; left: 46px; right: 46px; top: 14px; height: 52px; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, #ffffff, #eef0f3); border: 1px solid rgba(120,92,52,.24); border-radius: 4px;
  box-shadow: 0 6px 11px rgba(0,18,31,.24);
}
[data-theme="modern"] .modernenv.is-open .modernenv__note::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; border-radius: 4px 4px 0 0;
  background: linear-gradient(90deg, var(--c1), var(--c2)); opacity: .7;
}
[data-theme="modern"] .modernenv.is-open .modernenv__note::after {
  content: ""; position: absolute; left: 15%; right: 15%; top: 18px; height: 1px;
  background: rgba(120,92,52,.18);
  box-shadow: 0 9px 0 rgba(120,92,52,.12);
}

/* content (overrides the old absolute/list styles) */
[data-theme="modern"] .modernenv__top { position: static; display: flex; align-items: center; gap: 9px; min-height: 0; padding: 0; }
[data-theme="modern"] .modernenv__ic {
  display: grid; position: static; flex: 0 0 auto; width: 30px; height: 30px; place-items: center; border-radius: 9px; font-size: 1rem;
  background: linear-gradient(180deg, rgba(255,255,255,.88), color-mix(in srgb, var(--c1) 18%, #fff));
  border: 1px solid color-mix(in srgb, var(--c1) 28%, rgba(120,92,52,.22));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 2px 5px rgba(0,18,31,.16);
}
[data-theme="modern"] .modernenv__name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; max-height: none;
  color: #2a241b; font-weight: 900; font-size: .98rem; line-height: 1.15;
}
[data-theme="modern"] .modernenv__money {
  position: static; left: auto; right: auto; bottom: auto; display: flex; flex-direction: row; align-items: baseline; gap: 6px;
  padding: 0; border: 0; background: none; box-shadow: none; text-align: left;
}
[data-theme="modern"] .modernenv__money em { display: inline; font-style: normal; color: #8a7f6c; font-size: .72rem; font-weight: 850; text-transform: uppercase; letter-spacing: .02em; }
[data-theme="modern"] .modernenv__money b { color: #1f2a16; font-size: 1.4rem; font-weight: 950; letter-spacing: -.01em; }
[data-theme="modern"] .modernenv__money b.neg { color: #c83f36; }
[data-theme="modern"] .modernenv__bar { position: static; left: auto; right: auto; bottom: auto; height: 6px; border-radius: 999px; background: rgba(120,92,52,.16); overflow: hidden; margin-top: 2px; }
[data-theme="modern"] .modernenv__bar i { display: block; height: 100%; border-radius: inherit; transition: width .5s ease; }
[data-theme="modern"] .modernenv__stamp {
  position: static; right: auto; top: auto; transform: rotate(-4deg); flex: 0 0 auto;
  color: var(--stamp, #2f8f57); background: var(--stamp-bg, #eefaf2); border: 1.5px dashed currentColor; border-radius: 6px;
  padding: 3px 6px; font-size: .58rem; font-weight: 900; text-transform: uppercase; line-height: 1;
}
[data-theme="modern"] .modernenv.is-over .modernenv__face { border-color: rgba(200,63,54,.6); background: linear-gradient(180deg, #fff6f3, #f1ddd4); }
[data-theme="modern"] .modernenv.is-full .modernenv__face { border-color: rgba(47,143,87,.5); }
[data-theme="modern"] .modernenv.is-pay .modernenv__face { border-color: rgba(118,87,168,.5); }
[data-theme="modern"] .modernpanel {
  background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); color: #edfefa;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 12px 24px rgba(1,16,29,.17);
}
[data-theme="modern"] .modernpanel__big,
[data-theme="modern"] .modernpanel__rows,
[data-theme="modern"] .modernpanel p,
[data-theme="modern"] .modernacct { color: #edfefa; }
[data-theme="modern"] .modernacct { border-top-color: rgba(255,255,255,.16); }
[data-theme="modern"] .modernpanel__link { color: #eafff9; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.20); }

@media (max-width: 940px) {
  [data-theme="modern"] .modernlayout { grid-template-columns: 1fr; }
  [data-theme="modern"] .modernside { display: none; }
}
@media (max-width: 720px) {
  [data-theme="modern"] #app { padding: 14px 10px 96px; }
  [data-theme="modern"] .modernbar { grid-template-columns: 1fr auto; grid-template-areas: "brand actions" "month month"; }
  [data-theme="modern"] .modernbar__brand { grid-area: brand; }
  [data-theme="modern"] .modernbar__month { grid-area: month; }
  [data-theme="modern"] .modernbar__actions { grid-area: actions; }
  [data-theme="modern"] .modernhero { grid-template-columns: minmax(250px, 1fr) 150px; }
  [data-theme="modern"] .modernready { min-height: 148px; }
  [data-theme="modern"] .modernready b { font-size: 2rem; }
  [data-theme="modern"] .modernready__art { height: 76px; margin-top: -3px; }
  [data-theme="modern"] .modernready__tray { height: 50px; margin-bottom: 4px; }
  [data-theme="modern"] .modernready__tray i { width: 19px; height: 19px; }
  [data-theme="modern"] .modernready__tray em { bottom: -9px; padding: 5px 17px; }
  [data-theme="modern"] .modernstats { grid-template-columns: 1fr; gap: 7px; }
  [data-theme="modern"] .modernstat { min-height: 44px; padding: 9px 11px; }
  [data-theme="modern"] .modernstat b { font-size: .95rem; }
  [data-theme="modern"] .modernhead { align-items: center; }
  [data-theme="modern"] .modernhead h2 { font-size: 1.35rem; }
  [data-theme="modern"] .modernboard { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; gap: 12px; }
}
@media (max-width: 520px) {
  [data-theme="modern"] .modernhero { grid-template-columns: 1fr; }
  [data-theme="modern"] .modernstats { grid-template-columns: repeat(3, 1fr); }
  [data-theme="modern"] .modernbar__month b { min-width: 0; flex: 1; }
  [data-theme="modern"] .modernready b { font-size: 1.95rem; }
  [data-theme="modern"] .modernready__art { width: min(260px, 94%); height: 72px; }
  [data-theme="modern"] .modernstat { min-height: 68px; padding: 10px; }
  [data-theme="modern"] .modernstat span { font-size: .66rem; }
  [data-theme="modern"] .modernalert { align-items: stretch; flex-direction: column; }
  [data-theme="modern"] .modernalert .coverbtn { width: 100%; }
  [data-theme="modern"] .modernhead .btn { padding: 9px 11px; }
}
@media (max-width: 420px) {
  [data-theme="modern"] .modernboard { grid-template-columns: 1fr; }
  [data-theme="modern"] .modernenv {
    display: block; min-height: 150px; padding: 0;
  }
  [data-theme="modern"] .modernenv__money { grid-column: auto; align-items: center; }
  [data-theme="modern"] .modernenv::after { left: 20px; right: 20px; top: 31px; bottom: auto; }
}
@media (prefers-reduced-motion: reduce) { [data-theme="modern"] .modernenv--received { animation: none; } }

/* ----- shared modal helpers ----- */
.listrows { display: flex; flex-direction: column; gap: 8px; }
.listrow { display: flex; align-items: center; gap: 11px; text-align: left; font: inherit; color: inherit; background: #f6f8fc; border: 1px solid #e7edf6; border-radius: 12px; padding: 11px 13px; cursor: pointer; }
.listrow:hover { background: #eef4fd; }
.listrow.owe { background: linear-gradient(160deg, #fbf7ff, #f1e9fb); border-color: #e0d2f3; }
.listrow__ic { font-size: 1.4rem; line-height: 1; flex: 0 0 auto; }
.listrow__nm { font-weight: 800; color: #33415e; flex: 1; min-width: 0; }
.listrow__amt { font-weight: 900; color: #23304a; white-space: nowrap; }
.listrow__amt.owe { color: #7d52b8; }

.acctdrawer { display: flex; flex-direction: column; gap: 13px; }
.acctsect {
  position: relative; padding: 14px 10px 10px; border-radius: 13px;
  background: linear-gradient(180deg, #fbfcff, #f1f5fb);
  border: 1px solid #e2e9f3; box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.acctsect__tab {
  position: absolute; left: 12px; top: -9px; padding: 4px 10px; border-radius: 8px 8px 0 0;
  color: #263854; font-size: .72rem; font-weight: 900; background: #d8e6f7; border: 1px solid #c8d8ea; border-bottom: 0;
}
.acctsect--bank .acctsect__tab { background: #d8eacb; border-color: #c4ddb4; color: #2f5738; }
.acctsect--credit .acctsect__tab,
.acctsect--loan .acctsect__tab { background: #eadbf6; border-color: #dcc7ef; color: #674091; }
.acctsect__rows { display: flex; flex-direction: column; gap: 7px; }
.acctsect__empty { color: #8a98ad; font-weight: 700; font-size: .86rem; padding: 8px 10px; }
.acctdrawer .listrow { background: rgba(255,255,255,.78); }
.acctdrawer .listrow--bank { border-color: #d7e8cf; }
.acctdrawer .listrow--credit,
.acctdrawer .listrow--loan { border-color: #e0d2f3; }

.goallist { display: flex; flex-direction: column; gap: 10px; }
.goalline { display: flex; flex-direction: column; gap: 7px; text-align: left; font: inherit; color: inherit; background: #f6f8fc; border: 1px solid #e7edf6; border-radius: 12px; padding: 11px 13px; cursor: pointer; }
.goalline:hover { background: #eef4fd; }
.goalline.done { background: #eefaf1; border-color: #bfe6c4; }
.goalline__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.goalline__nm { font-weight: 800; color: #33415e; }
.goalline__amt { font-weight: 800; color: #5d6b85; white-space: nowrap; font-size: .9rem; }
.goalline__bar { height: 8px; border-radius: 999px; background: #e7eaf0; overflow: hidden; }
.goalline__bar i { display: block; height: 100%; border-radius: 999px; background: #ffb020; }
.goalline.done .goalline__bar i { background: #34c759; }
.sheet--budgetcheck { width: min(980px, calc(100vw - 28px)); max-width: 980px; }
.budgetcheck { gap: 12px; }
.budgetsummary {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
.budgetsummary span {
  border: 1px solid #e2e8f0; border-radius: 13px; background: #fbfcff; padding: 10px 12px;
}
.budgetsummary em {
  display: block; color: #748197; font-style: normal; font-size: .7rem; text-transform: uppercase; font-weight: 900;
}
.budgetsummary b { display: block; color: #26344a; font-size: 1.08rem; margin-top: 3px; }
.budgetcheck__cols,
.budgetgroup__head,
.budgetrow {
  display: grid; grid-template-columns: minmax(220px, 1fr) 92px 92px 104px; align-items: center; gap: 10px;
}
.budgetcheck__cols {
  color: #748197; font-weight: 900; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em;
  padding: 0 12px;
}
.budgetcheck__cols span:not(:first-child) { text-align: right; }
.budgetgroup {
  overflow: hidden; border: 1px solid #e2e8f0; border-radius: 15px; background: #fbfcff;
  box-shadow: 0 8px 18px rgba(35,65,76,.05);
}
.budgetgroup__head {
  padding: 10px 12px; background: linear-gradient(180deg, #f8f5ef, #eee5d6);
  color: #26344a; border-bottom: 1px solid #e1d6c4; font-weight: 900;
}
.budgetgroup__head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.budgetgroup__head b { color: #405169; text-align: right; font-size: .84rem; }
.budgetrow {
  width: 100%; border: 0; border-top: 1px solid #edf1f6; background: #fff; color: #26344a;
  padding: 10px 12px; text-align: left; cursor: pointer; font: inherit;
}
.budgetrow:hover { background: #f6fafb; }
.budgetrow__cat { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.budgetrow__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 900; }
.budgetrow__note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #748197; font-weight: 700; font-size: .76rem; }
.budgetrow__bar { display: block; height: 5px; max-width: 260px; border-radius: 999px; background: #ebe7dc; overflow: hidden; }
.budgetrow__bar i { display: block; height: 100%; border-radius: inherit; background: #ffb020; }
.budgetrow--full .budgetrow__bar i { background: #34c759; }
.budgetrow--over .budgetrow__bar i { background: #ff3b30; }
.budgetrow--pay .budgetrow__bar i { background: #8e68c6; }
.budgetrow__money { text-align: right; font-weight: 800; color: #405169; white-space: nowrap; font-size: .84rem; }
.budgetrow__money.neg,
.budgetgroup__head b.neg { color: #b43c34; }
.budgetrow__money.pos,
.budgetgroup__head b.pos { color: #2d8a58; }
.budgetrow__avail {
  justify-self: end; min-width: 78px; text-align: right; padding: 4px 8px; border-radius: 999px;
  font-weight: 900; font-size: .82rem; color: #405169; background: #ebe7dc;
}
.budgetrow__avail--full { color: #205c37; background: #c9edcf; }
.budgetrow__avail--under { color: #5d4700; background: #ffe071; }
.budgetrow__avail--over { color: #9c3028; background: #ffd0c9; }
.budgetrow__avail--pay { color: #5a3584; background: #eadbfb; }
.actlist { max-height: 62vh; }

.sheet--wide { max-width: 860px; }
.sheet--calendar {
  width: min(1280px, calc(100vw - 16px));
  max-width: 1280px;
  height: min(980px, calc(100vh - 16px));
  max-height: 98vh;
  overscroll-behavior: contain;
}
.calview { gap: 16px; }
.sheet--calendar .calview { padding: 12px 26px 28px; gap: 20px; }
.calnav {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; align-items: center; gap: 10px;
  padding: 12px; border-radius: 16px;
  background: linear-gradient(180deg, #fbf7ef, #efe4d3);
  border: 1px solid #e2d2bd; box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}
.calnav .icon { background: rgba(255,255,255,.62); color: #3b4a5f; border: 1px solid rgba(80,62,40,.12); }
.calnav__title { min-width: 0; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.calnav__title b { color: #26344a; font-size: 1.08rem; }
.calnav__title span { color: #738094; font-weight: 800; font-size: .78rem; }
.sheet--calendar .calnav__title b { font-size: 1.18rem; }
.calactions {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  color: #6d7c8f; font-weight: 800; font-size: .82rem;
}
.calactions .btn { flex: 0 0 auto; padding: 9px 13px; }
.calgrid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px;
  padding: 10px; border-radius: 17px;
  background:
    radial-gradient(500px 180px at 50% 0, rgba(255,255,255,.7), transparent 72%),
    linear-gradient(180deg, #f7efe4, #eadcc9);
  border: 1px solid #dfcfba; box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}
.sheet--calendar .calgrid { gap: 10px; padding: 14px; }
.caldow {
  color: #80684e; font-size: .68rem; font-weight: 900; text-align: center; text-transform: uppercase;
  padding: 2px 0 4px;
}
.calday {
  min-height: 78px; border-radius: 12px; padding: 7px 6px; position: relative; overflow: hidden;
  background: rgba(255,252,244,.74); border: 1px solid rgba(115,91,62,.13);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
  cursor: pointer;
}
.sheet--calendar .calday { min-height: 122px; padding: 9px 8px; }
.calday:hover { background: #fffaf0; border-color: rgba(35,118,138,.26); }
.calday:focus-visible { outline: 3px solid rgba(35,118,138,.35); outline-offset: 2px; }
.calday--blank { background: rgba(255,255,255,.26); border-style: dashed; cursor: default; }
.calday:not(.has-bills):not(.calday--blank)::after {
  content: "+ Bill"; position: absolute; left: 6px; right: 6px; bottom: 6px; opacity: 0;
  color: #176781; font-weight: 900; font-size: .66rem; text-align: center;
  border-radius: 8px; padding: 3px 2px; background: rgba(35,118,138,.08);
  transition: opacity .15s;
}
.calday:not(.has-bills):not(.calday--blank):hover::after,
.calday:not(.has-bills):not(.calday--blank):focus-visible::after { opacity: 1; }
.calday.has-bills { background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(248,240,226,.92)); border-color: rgba(35,118,138,.28); }
.calday.is-today { box-shadow: inset 0 0 0 2px rgba(35,118,138,.42), inset 0 1px 0 rgba(255,255,255,.72); }
.calday__num { display: block; color: #5c6880; font-weight: 900; font-size: .76rem; margin-bottom: 5px; }
.calbill {
  width: 100%; min-width: 0; margin: 3px 0 0; padding: 4px 5px; border: 1px solid rgba(35,118,138,.14);
  border-radius: 8px; display: flex; align-items: center; gap: 4px; text-align: left; cursor: pointer;
  background: #eef8f7; color: #24344d; font: inherit; font-size: .68rem; font-weight: 900;
}
.sheet--calendar .calbill { padding: 6px 7px; font-size: .76rem; }
.calbill:hover { filter: brightness(.98); }
.calbill span { flex: 0 0 auto; line-height: 1; }
.calbill b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calbill--partial { background: #fff4c2; border-color: #e5bb35; color: #6e5200; box-shadow: inset 3px 0 0 #d99b16; }
.calbill--full { background: #e7f7e6; border-color: #7fcd89; color: #1f6536; box-shadow: inset 3px 0 0 #35a852; }
.calbill--over { background: #fff0ed; border-color: #e99285; color: #9c3028; box-shadow: inset 3px 0 0 #df514a; }
.calbill--pay { background: #f5edff; border-color: #c6a8e8; color: #674091; box-shadow: inset 3px 0 0 #8e68c6; }
.calday__more { display: block; margin-top: 3px; color: #738094; font-size: .65rem; font-weight: 900; }
.calagenda { display: flex; flex-direction: column; gap: 9px; }
.calagenda__row {
  display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  text-align: left; border: 1px solid #e4edf2; background: #fbfcff; border-radius: 14px; padding: 10px 12px;
  color: #26344a; cursor: pointer; font: inherit; box-shadow: 0 6px 16px rgba(35,65,76,.06);
}
.calagenda__row:hover { background: #f4f9fb; }
.calagenda__row--partial { border-color: #e8c752; background: linear-gradient(90deg, #fff4c2, #fffdf4 38%, #fff); box-shadow: inset 5px 0 0 #d99b16, 0 6px 16px rgba(35,65,76,.06); }
.calagenda__row--full { border-color: #9bd8a2; background: linear-gradient(90deg, #e7f7e6, #f8fff8 38%, #fff); box-shadow: inset 5px 0 0 #35a852, 0 6px 16px rgba(35,65,76,.06); }
.calagenda__row--over { border-color: #efb9b1; background: linear-gradient(90deg, #fff0ed, #fff9f8 38%, #fff); box-shadow: inset 5px 0 0 #df514a, 0 6px 16px rgba(35,65,76,.06); }
.calagenda__row--pay { border-color: #dfcff2; background: linear-gradient(90deg, #f5edff, #fdfaff 38%, #fff); box-shadow: inset 5px 0 0 #8e68c6, 0 6px 16px rgba(35,65,76,.06); }
.calagenda__date { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; background: #eef4f7; padding: 7px 5px; }
.calagenda__row--partial .calagenda__date { background: #f8dc76; }
.calagenda__row--full .calagenda__date { background: #c9edcf; }
.calagenda__row--over .calagenda__date { background: #ffd7d1; }
.calagenda__row--pay .calagenda__date { background: #eadbfb; }
.calagenda__date b { font-size: 1.1rem; line-height: 1; color: #176781; }
.calagenda__date em { font-style: normal; color: #6c7c90; font-weight: 800; font-size: .66rem; white-space: nowrap; }
.calagenda__main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.calagenda__main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calagenda__main em { font-style: normal; color: #748197; font-weight: 700; font-size: .78rem; }
.calagenda__amt { color: #405169; font-weight: 900; white-space: nowrap; font-size: .84rem; }
.calempty {
  display: flex; flex-direction: column; gap: 4px; text-align: center; padding: 22px 16px; border-radius: 16px;
  background: #f6f8fc; border: 1px dashed #d8e2ef; color: #65758e;
}
.calempty b { color: #33415e; }
.billpeek__hero {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px;
  background: linear-gradient(180deg, #fbf7ef, #efe4d3);
  border: 1px solid #e2d2bd;
}
.billpeek__ic {
  width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center;
  background: rgba(255,255,255,.68); font-size: 1.55rem; box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
  flex: 0 0 auto;
}
.billpeek__hero div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.billpeek__hero b { color: #26344a; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billpeek__hero span { color: #6c7c90; font-weight: 800; font-size: .84rem; }
.billpeek__stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.billpeek__note {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 13px; border-radius: 14px;
  background: #f6f8fc; border: 1px solid #e3eaf4; color: #65758e;
}
.billpeek__note b { color: #33415e; }
.billpeek__actions { flex-wrap: wrap; justify-content: flex-end; }
.billpeek__actions .btn { flex: 0 1 auto; }
@media (max-width: 620px) {
  .sheet--wide { max-width: 100%; }
  .sheet.sheet--budgetcheck {
    width: 100%; max-width: 100%; height: calc(100vh - 10px); max-height: calc(100vh - 10px);
    height: calc(100dvh - 10px); max-height: calc(100dvh - 10px); border-radius: 18px 18px 0 0;
  }
  .sheet--budgetcheck .frm { padding-left: 10px; padding-right: 10px; }
  .budgetsummary { grid-template-columns: 1fr; }
  .budgetcheck__cols { display: none; }
  .budgetgroup__head,
  .budgetrow { grid-template-columns: minmax(0, 1fr) 76px; gap: 8px; }
  .budgetgroup__head b:nth-of-type(1),
  .budgetgroup__head b:nth-of-type(2) { display: none; }
  .budgetrow__money { display: none; }
  .budgetrow__avail { min-width: 74px; font-size: .78rem; padding: 4px 7px; }
  .budgetrow__note { font-size: .72rem; }
  .budgetrow__bar { max-width: 100%; }
  .sheet.sheet--calendar {
    width: 100%;
    max-width: 100%;
    height: calc(100vh - 2px);
    max-height: calc(100vh - 2px);
    height: calc(100dvh - 2px);
    max-height: calc(100dvh - 2px);
    margin-top: auto;
    border-radius: 14px 14px 0 0;
  }
  .sheet--calendar .sheet__h { padding: 15px 14px 5px; }
  .sheet--calendar .calview { padding: 8px 8px 20px; gap: 12px; }
  .sheet--calendar .calnav { padding: 10px; border-radius: 14px; }
  .sheet--calendar .calnav__title b { font-size: 1.08rem; }
  .calactions { align-items: stretch; flex-direction: column; }
  .calactions .btn { width: 100%; }
  .calgrid { gap: 4px; padding: 7px; }
  .sheet--calendar .calgrid { gap: 5px; padding: 8px; border-radius: 14px; }
  .calday { min-height: 56px; padding: 5px 4px; border-radius: 10px; }
  .sheet--calendar .calday { min-height: 76px; padding: 6px 4px; }
  .calbill { padding: 3px 4px; font-size: .62rem; }
  .sheet--calendar .calbill { font-size: .6rem; }
  .calbill span { display: none; }
  .sheet--calendar .calagenda__row { padding: 10px; }
  .calagenda__row { grid-template-columns: 58px minmax(0, 1fr); gap: 9px; }
  .calagenda__amt { grid-column: 2; margin-top: -6px; }
  .billpeek__stats { grid-template-columns: 1fr; }
  .billpeek__actions .btn { flex: 1 1 100%; }
}
@media (max-width: 420px) {
  .caldow { font-size: .58rem; }
  .calday { min-height: 48px; }
  .sheet--calendar .calday { min-height: 70px; }
  .calbill { font-size: .58rem; }
  .calday__more { display: none; }
}

/* =====================================================================
   THEME: "open" — open mail envelopes with cash peeking + wax/rubber stamps.
   Shares the tabbed chrome (.ptop/.pbudget/.tabbar); cards are .oe (scoped here).
   ===================================================================== */
[data-theme="open"] body {
  background-color: #dbe7f4;
  background-image:
    radial-gradient(1200px 600px at 50% -12%, #eef5fc, transparent 70%),
    linear-gradient(180deg, #e6eff9, #cfe0f2);
  background-attachment: fixed;
}
[data-theme="open"] #app { padding-bottom: 96px; }
[data-theme="open"] .grid--open { grid-template-columns: 1fr; gap: 26px 18px; }
@media (min-width: 640px) { [data-theme="open"] .grid--open { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { [data-theme="open"] .grid--open { grid-template-columns: 1fr 1fr 1fr; } }

/* the envelope body */
[data-theme="open"] .oe {
  position: relative; border-radius: 20px 20px 18px 18px; min-height: 204px; margin-top: 34px; cursor: pointer; overflow: visible; isolation: isolate;
  background:
    radial-gradient(180px 120px at 55% 35%, rgba(255,255,255,.22), transparent 64%),
    linear-gradient(160deg, var(--c2), var(--c1));
  border: 1px solid rgba(255,255,255,.58);
  box-shadow: 0 13px 26px rgba(30,60,110,.20), inset 0 1px 0 rgba(255,255,255,.34);
  transition: transform .15s, box-shadow .15s;
}
[data-theme="open"] .oe:hover { transform: translateY(-3px); box-shadow: 0 18px 34px rgba(30,60,110,.27), inset 0 1px 0 rgba(255,255,255,.42); }
[data-theme="open"] .oe:focus-visible { outline: 3px solid rgba(255,255,255,.95); outline-offset: 2px; }
[data-theme="open"] .oe::before {
  content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 42%; z-index: 2; pointer-events: none;
  clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%);
  background:
    linear-gradient(90deg, rgba(0,0,0,.20), transparent 33%, transparent 66%, rgba(255,255,255,.14)),
    linear-gradient(180deg, rgba(0,0,0,.30), rgba(0,0,0,.08));
  opacity: .84;
}
[data-theme="open"] .oe::after {
  content: ""; position: absolute; left: -1px; right: -1px; bottom: -1px; height: 66%; z-index: 4; pointer-events: none;
  clip-path: polygon(0 24%, 50% 0, 100% 24%, 100% 100%, 0 100%);
  background:
    linear-gradient(34deg, transparent 39%, rgba(255,255,255,.20) 40%, transparent 41%) left top / 50% 100% no-repeat,
    linear-gradient(-34deg, transparent 39%, rgba(0,0,0,.13) 40%, transparent 41%) right top / 50% 100% no-repeat,
    linear-gradient(90deg, rgba(255,255,255,.13), transparent 30%, transparent 72%, rgba(0,0,0,.10)),
    linear-gradient(180deg, rgba(255,255,255,.22), rgba(0,0,0,.10));
  filter: drop-shadow(0 -4px 5px rgba(0,0,0,.16));
}

/* the lid/flap — OPEN rises behind the card; SEALED folds down over the front. */
[data-theme="open"] .oe__flap { position: absolute; left: -1px; right: -1px; pointer-events: none; }
[data-theme="open"] .oe.is-open .oe__flap {
  top: -44px; height: 96px; z-index: 1; clip-path: polygon(50% 0, 100% 60%, 100% 100%, 0 100%, 0 60%);
  background:
    linear-gradient(180deg, rgba(255,255,255,.28), rgba(0,0,0,.18)),
    linear-gradient(160deg, var(--c2), var(--c1));
  filter: drop-shadow(0 -2px 2px rgba(255,255,255,.20)) drop-shadow(0 7px 8px rgba(0,0,0,.22));
}
[data-theme="open"] .oe.is-sealed .oe__flap {
  top: -1px; height: 62%; z-index: 5; clip-path: polygon(0 0, 100% 0, 50% 88%);
  background:
    linear-gradient(180deg, rgba(255,255,255,.30), rgba(0,0,0,.18)),
    linear-gradient(160deg, var(--c2), var(--c1));
  filter: drop-shadow(0 5px 8px rgba(0,0,0,.24));
}
[data-theme="open"] .oe.is-sealed::before { display: none; }
[data-theme="open"] .oe.is-sealed::after { height: 70%; z-index: 3; }

/* envelope name + icon, written on the colored top */
[data-theme="open"] .oe__title { position: absolute; top: 14px; left: 16px; right: 102px; z-index: 7; display: flex; align-items: center; gap: 8px; }
[data-theme="open"] .oe:not(.is-full):not(.is-over):not(.is-pay) .oe__title { right: 16px; }
[data-theme="open"] .oe__ic { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.94); font-size: 1rem; line-height: 1; flex: 0 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,.24), inset 0 0 0 1px rgba(0,0,0,.04); }
[data-theme="open"] .oe__name { flex: 1; min-width: 0; font-weight: 900; color: #fff; font-size: 1.02rem; text-shadow: 0 1px 3px rgba(0,0,0,.42); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="open"] .oe__lock { font-size: .9rem; line-height: 1; flex: 0 0 auto; }

/* green cash peeking up from behind the letter (only when it holds money and isn't sealed) */
[data-theme="open"] .oe__cash { display: none; position: absolute; top: 30%; left: 50%; transform: translateX(-50%); width: min(64%, 220px); height: 42px; z-index: 3; }
[data-theme="open"] .oe.is-open.has-cash .oe__cash { display: block; }
[data-theme="open"] .oe__cash i { position: absolute; left: 0; right: 0; top: 0; height: 34px; border-radius: 5px;
  background:
    radial-gradient(circle at 50% 50%, rgba(47,107,58,.18) 0 12px, transparent 13px),
    linear-gradient(180deg, #e5f5df, #a9d8ad);
  box-shadow: 0 4px 8px rgba(0,0,0,.28), inset 0 0 0 1px rgba(47,107,58,.55), inset 0 0 0 5px rgba(255,255,255,.18); }
[data-theme="open"] .oe__cash i:first-child { transform: rotate(-7deg) translateX(-5px); }
[data-theme="open"] .oe__cash i:last-child { transform: rotate(6deg) translateX(5px) translateY(-3px); }
[data-theme="open"] .oe__cash::after { content: "$"; position: absolute; left: 50%; top: 7px; transform: translateX(-50%); z-index: 1; font: 900 1rem/1 Georgia, serif; color: rgba(31,90,60,.74); }

/* the letter — a white card tucked into the lower pocket, with the numbers */
[data-theme="open"] .oe__slip {
  position: absolute; left: 15px; right: 15px; top: 51%; bottom: 15px; z-index: 6;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(245,248,252,.96));
  border: 1px solid rgba(200,212,228,.76); border-radius: 10px;
  box-shadow: 0 7px 17px rgba(20,40,70,.24), inset 0 1px 0 rgba(255,255,255,.98);
  padding: 9px 12px 10px; display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
[data-theme="open"] .oe__amt { font-weight: 900; font-size: clamp(1.18rem, 5vw, 1.5rem); color: #1f2937; line-height: 1.05; letter-spacing: 0; }
[data-theme="open"] .oe__left { font-size: .7rem; font-weight: 700; color: #94a0b2; letter-spacing: .02em; }
[data-theme="open"] .oe__neg { color: #d2392f; }
[data-theme="open"] .oe__sub { font-size: .73rem; font-weight: 600; color: #7a8699; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="open"] .oe__bar { height: 8px; border-radius: 999px; background: #e7eaf0; overflow: hidden; margin-top: 4px; }
[data-theme="open"] .oe__bar i { display: block; height: 100%; border-radius: 999px; transition: width .55s ease; }

/* postal / rubber status stamp */
[data-theme="open"] .oe__stamp {
  --stamp: #1f8a4c; --stamp-bg: #f6fff8;
  position: absolute; top: 11px; right: 12px; z-index: 8; min-width: 78px; min-height: 38px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  color: var(--stamp); background:
    radial-gradient(circle at 0 50%, transparent 0 3px, var(--stamp-bg) 3.5px) left / 8px 8px repeat-y,
    radial-gradient(circle at 100% 50%, transparent 0 3px, var(--stamp-bg) 3.5px) right / 8px 8px repeat-y,
    var(--stamp-bg);
  border: 2px dashed var(--stamp); border-radius: 8px; padding: 5px 7px;
  box-shadow: 0 4px 9px rgba(20,40,70,.24), inset 0 0 0 2px rgba(255,255,255,.75);
  transform: rotate(7deg);
}
[data-theme="open"] .oe__stamp::before { content: ""; position: absolute; inset: 4px; border: 1px solid currentColor; border-radius: 4px; opacity: .25; pointer-events: none; }
[data-theme="open"] .oe__stamp span { position: relative; z-index: 1; font-size: 1.08rem; line-height: 1; filter: drop-shadow(0 1px 0 #fff); }
[data-theme="open"] .oe__stamp b { position: relative; z-index: 1; font-size: .54rem; line-height: 1; letter-spacing: .09em; text-transform: uppercase; }
[data-theme="open"] .oe__stamp--paid { --stamp: #1f8a4c; --stamp-bg: #f3fff6; }
[data-theme="open"] .oe__stamp--pay { --stamp: #7d52b8; --stamp-bg: #faf6ff; }
[data-theme="open"] .oe__stamp--over { --stamp: #d2392f; --stamp-bg: #fff6f4; transform: rotate(-7deg); }
[data-theme="open"] .oe.is-sealed .oe__stamp { top: 16px; right: 14px; z-index: 9; transform: rotate(9deg); }

/* status rings (kept after :hover so they persist) */
[data-theme="open"] .oe.is-full { box-shadow: 0 0 0 3px #34c759, 0 0 0 8px rgba(52,199,89,.12), 0 13px 26px rgba(30,60,110,.20); }
[data-theme="open"] .oe.is-over { box-shadow: 0 0 0 3px #ff3b30, 0 0 0 8px rgba(255,59,48,.12), 0 13px 26px rgba(30,60,110,.20); }
[data-theme="open"] .oe.is-pay  { box-shadow: 0 0 0 3px #7d52b8, 0 0 0 8px rgba(125,82,184,.12), 0 13px 26px rgba(30,60,110,.20); }
[data-theme="open"] .oe--received { animation: envReceive .64s cubic-bezier(.3,.7,.4,1) .18s both; z-index: 1; }

/* add tile */
[data-theme="open"] .oe.add { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 168px; margin-top: 0; overflow: hidden; background: rgba(255,255,255,.5); border: 2px dashed #aebfd6; color: #5a6f93; box-shadow: none; }
[data-theme="open"] .oe.add::before,
[data-theme="open"] .oe.add::after { display: none; }
[data-theme="open"] .oe.add:hover { background: rgba(255,255,255,.82); transform: translateY(-3px); box-shadow: 0 10px 20px rgba(30,60,110,.14); }
@media (prefers-reduced-motion: reduce) { [data-theme="open"] .oe--received { animation: none; } }

/* =====================================================================
   THEME: "open" revamp — desktop tray / stacked envelope rows.
   This overrides the older .oe card version above; .oe is kept only for
   historical compatibility. The active Open renderer uses .desk* + .tray*.
   ===================================================================== */
[data-theme="open"] body {
  color: #2d261d;
  background-color: #5a351f;
  background-image:
    radial-gradient(900px 500px at 50% -12%, rgba(255,236,190,.28), transparent 72%),
    radial-gradient(520px 420px at 100% 8%, rgba(18,24,35,.24), transparent 70%),
    repeating-linear-gradient(92deg, rgba(255,255,255,.025) 0 2px, transparent 2px 34px),
    repeating-linear-gradient(7deg, rgba(36,18,8,.23) 0 1px, transparent 1px 18px),
    linear-gradient(90deg, #3b2112, #6d4124 18%, #8a552f 48%, #5a321c 78%, #2f190e);
  background-attachment: fixed;
}
[data-theme="open"] #app { max-width: 1240px; padding: 18px 14px 96px; }
[data-theme="open"] .deskapp { position: relative; max-width: 1200px; margin: 0 auto; }

[data-theme="open"] .desktop {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 2px 0 12px; color: #f4ead8;
}
[data-theme="open"] .desktop__brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.15rem; text-shadow: 0 2px 3px rgba(0,0,0,.32); }
[data-theme="open"] .desktop__actions { display: flex; gap: 8px; }
[data-theme="open"] .desktop .icon {
  background: rgba(31,35,39,.72); color: #fff7e8; border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 6px 16px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.16);
}
[data-theme="open"] .desktop .icon:hover { background: rgba(48,54,60,.86); }

[data-theme="open"] .deskhero {
  position: relative; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 17px 18px; margin-bottom: 12px; border-radius: 13px;
  background:
    linear-gradient(135deg, transparent 0 88%, rgba(96,67,44,.28) 88% 92%, rgba(255,255,255,.45) 92% 100%),
    radial-gradient(600px 140px at 50% 0, rgba(255,255,255,.72), transparent 70%),
    linear-gradient(180deg, #f7eddc, #e9d7bc);
  border: 1px solid rgba(73,49,28,.42);
  box-shadow: 0 12px 22px rgba(24,13,7,.28), inset 0 0 0 2px rgba(255,255,255,.30);
}
[data-theme="open"] .deskhero::after {
  content: ""; position: absolute; inset: 8px; border: 1px dashed rgba(90,65,40,.25); border-radius: 10px; pointer-events: none;
}
[data-theme="open"] .deskhero__date { position: relative; z-index: 1; min-width: 0; }
[data-theme="open"] .deskhero__month { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.24rem; color: #243246; }
[data-theme="open"] .deskhero__month .icon {
  width: 30px; height: 30px; color: #4f3c2a; background: rgba(255,255,255,.42);
}
[data-theme="open"] .deskhero__month .icon:hover { background: rgba(255,255,255,.72); }
[data-theme="open"] .deskhero p { margin: 3px 0 0 40px; color: #6f5940; font-weight: 700; }
[data-theme="open"] .deskhero__ready {
  position: relative; z-index: 1; flex: 0 0 auto; min-width: 210px; border: 2px solid rgba(79,125,62,.66);
  background: rgba(246,242,222,.78); color: #54783f; border-radius: 8px; padding: 10px 15px;
  display: flex; flex-direction: column; align-items: center; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
[data-theme="open"] .deskhero__ready b { font-size: 1.5rem; line-height: 1.05; }
[data-theme="open"] .deskhero__ready span { text-transform: uppercase; font-size: .77rem; font-weight: 900; }
[data-theme="open"] .deskhero__ready.neg { border-color: rgba(187,58,47,.72); color: #b43c34; }

[data-theme="open"] .deskmeta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px;
  color: #f1dfc5; margin: 8px 0 14px; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.32);
}
[data-theme="open"] .deskmeta b { color: #cce7b8; }
[data-theme="open"] .deskmeta .coverbtn { margin-left: 4px; }

[data-theme="open"] .desklayout {
  display: grid; grid-template-columns: 168px minmax(0, 1fr) 236px; gap: 14px; align-items: start;
}
[data-theme="open"] .deskmain { min-width: 0; }

[data-theme="open"] .deskrail {
  background:
    radial-gradient(180px 120px at 30% 0, rgba(110,154,190,.14), transparent 70%),
    linear-gradient(180deg, #263446, #172231);
  color: #e5edf4; border-radius: 11px; padding: 14px 12px;
  box-shadow: 0 12px 24px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.08);
}
[data-theme="open"] .deskrail__logo { font-weight: 900; margin-bottom: 12px; color: #d8e9f5; }
[data-theme="open"] .deskrail__nav {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; border: 0; border-radius: 8px; padding: 8px 10px;
  margin: 3px 0; background: transparent; color: #c7d3de; font-weight: 800; cursor: pointer;
}
.navbadge {
  min-width: 19px; height: 19px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: #e5483f; color: #fff; font-size: .7rem; font-weight: 950; box-shadow: 0 3px 10px rgba(150,30,20,.25);
}
[data-theme="open"] .deskrail__nav:hover,
[data-theme="open"] .deskrail__nav.is-on { background: rgba(118,168,211,.18); color: #fff; }
[data-theme="open"] .deskrail__ready {
  margin: 14px 0 10px; padding: 10px; border-top: 1px solid rgba(255,255,255,.10);
  border-bottom: 1px solid rgba(255,255,255,.10);
}
[data-theme="open"] .deskrail__ready span { display: block; font-size: .72rem; text-transform: uppercase; color: #9fb2c3; font-weight: 900; }
[data-theme="open"] .deskrail__ready b { display: block; color: #8ed07c; font-size: 1.1rem; }
[data-theme="open"] .deskrail__accounts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
[data-theme="open"] .deskacct {
  border: 0; background: rgba(255,255,255,.06); color: #edf5fb; border-radius: 8px; padding: 8px;
  display: grid; grid-template-columns: auto 1fr; gap: 2px 7px; text-align: left; cursor: pointer;
}
[data-theme="open"] .deskacct:hover { background: rgba(255,255,255,.11); }
[data-theme="open"] .deskacct span { grid-row: span 2; }
[data-theme="open"] .deskacct em { font-style: normal; font-size: .74rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="open"] .deskacct b { font-size: .74rem; color: #d3e5ef; }
[data-theme="open"] .deskacct.owe b { color: #e5c8ff; }

[data-theme="open"] .trayboard {
  position: relative; padding: 22px 18px 74px; border-radius: 14px 14px 8px 8px;
  background:
    radial-gradient(700px 220px at 50% 8%, rgba(255,221,151,.22), transparent 72%),
    linear-gradient(90deg, rgba(40,21,10,.40), transparent 8%, transparent 92%, rgba(35,18,8,.46)),
    linear-gradient(180deg, rgba(255,244,220,.13), transparent 24%),
    linear-gradient(90deg, #3e2414, #8b613d 12%, #5d3a22 50%, #9a7048 88%, #352011);
  border: 1px solid rgba(31,17,9,.74);
  box-shadow:
    0 22px 36px rgba(0,0,0,.42),
    inset 0 0 0 8px rgba(67,39,20,.86),
    inset 0 0 0 11px rgba(210,154,91,.28),
    inset 0 22px 34px rgba(255,225,170,.10),
    inset 0 -28px 34px rgba(22,11,5,.34);
}
[data-theme="open"] .trayboard::before {
  content: ""; position: absolute; left: 20px; right: 20px; bottom: 52px; height: 26px; border-radius: 0 0 12px 12px;
  background:
    linear-gradient(180deg, rgba(24,13,7,.62), rgba(255,222,160,.08));
  box-shadow: 0 -10px 22px rgba(12,6,2,.30); pointer-events: none;
}
[data-theme="open"] .trayboard::after {
  content: ""; position: absolute; left: 9px; right: 9px; bottom: 8px; height: 44px; border-radius: 9px 9px 4px 4px;
  background:
    linear-gradient(180deg, rgba(127,83,45,.96), rgba(65,38,21,.98));
  border: 1px solid rgba(30,16,7,.72);
  box-shadow: inset 0 2px 0 rgba(255,220,166,.18), inset 0 0 0 2px rgba(38,20,9,.26);
  pointer-events: none;
}
[data-theme="open"] .trayboard__inner {
  position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px;
}
[data-theme="open"] .traygroup { min-width: 0; position: relative; }
[data-theme="open"] .traygroup__tab {
  position: relative; display: inline-flex; align-items: center; min-height: 28px; max-width: calc(100% - 22px);
  padding: 6px 13px 5px; margin-left: 12px; border-radius: 8px 8px 0 0;
  color: #413023; font-size: .78rem; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--tab, #d8c394); border: 1px solid rgba(72,50,29,.24); border-bottom: 0;
  box-shadow: 0 3px 7px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.38);
}
[data-theme="open"] .traygroup--monthly { --tab: #d8b069; }
[data-theme="open"] .traygroup--quality { --tab: #9fb9cf; }
[data-theme="open"] .traygroup--savings { --tab: #c7a5c4; }
[data-theme="open"] .traygroup--debt { --tab: #c9858e; }
[data-theme="open"] .traygroup--other { --tab: #a7be90; }
[data-theme="open"] .traygroup__stack {
  position: relative; padding: 8px 8px 12px; border-radius: 4px 4px 12px 12px;
  border-top: 9px solid rgba(58,35,19,.64);
  background:
    linear-gradient(90deg, rgba(31,16,7,.38), transparent 8%, transparent 92%, rgba(31,16,7,.38)),
    linear-gradient(180deg, rgba(22,11,5,.34), rgba(255,221,158,.07) 20%, rgba(28,14,6,.24));
  box-shadow:
    inset 0 9px 14px rgba(13,7,3,.46),
    inset 0 -8px 16px rgba(255,212,142,.08),
    0 1px 0 rgba(255,220,160,.10);
}
[data-theme="open"] .traygroup__stack::before {
  content: ""; position: absolute; left: 8px; right: 8px; top: -8px; height: 9px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(10,5,2,.62), rgba(255,235,190,.10));
  box-shadow: 0 8px 13px rgba(0,0,0,.22);
  pointer-events: none;
}

[data-theme="open"] .trayenv {
  position: relative; min-height: 80px; margin: 0; padding: 13px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 12px; overflow: hidden; isolation: isolate;
  color: #302820; background:
    radial-gradient(360px 90px at 50% 0, rgba(255,255,255,.52), transparent 72%),
    repeating-linear-gradient(9deg, rgba(87,62,37,.035) 0 1px, transparent 1px 7px),
    linear-gradient(90deg, rgba(255,255,255,.18), transparent 38%, rgba(98,67,40,.10)),
    linear-gradient(180deg, #fbf0dc, #e5cfac);
  border: 1px solid rgba(99,72,43,.38); border-radius: 4px 4px 10px 10px;
  box-shadow:
    0 9px 15px rgba(15,8,3,.30),
    0 -4px 9px rgba(255,230,190,.12),
    inset 0 1px 0 rgba(255,255,255,.64),
    inset 0 -1px 0 rgba(89,62,37,.14);
}
[data-theme="open"] .trayenv + .trayenv { margin-top: -13px; }
[data-theme="open"] .trayenv:hover { transform: translateY(-2px); box-shadow: 0 10px 17px rgba(24,13,7,.30), inset 0 1px 0 rgba(255,255,255,.68); }
[data-theme="open"] .trayenv:focus-visible { outline: 3px solid rgba(255,255,255,.9); outline-offset: 2px; }
[data-theme="open"] .trayenv::before,
[data-theme="open"] .trayenv::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 52%; z-index: -1; pointer-events: none; opacity: .72;
}
[data-theme="open"] .trayenv::before {
  left: 0; background: linear-gradient(32deg, transparent 49%, rgba(117,84,52,.22) 50%, transparent 52%);
}
[data-theme="open"] .trayenv::after {
  right: 0; background: linear-gradient(-32deg, transparent 49%, rgba(255,255,255,.38) 50%, transparent 52%);
}
[data-theme="open"] .trayenv__ic {
  flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; font-size: 1.05rem;
  border-radius: 8px; background: rgba(255,255,255,.55); box-shadow: inset 0 0 0 1px rgba(80,58,35,.10);
}
[data-theme="open"] .trayenv__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
[data-theme="open"] .trayenv__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
[data-theme="open"] .trayenv__low { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 13px; }
[data-theme="open"] .trayenv__side { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; }
[data-theme="open"] .trayenv__name {
  flex: 1; min-width: 0; font-weight: 900; color: #2c261f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
[data-theme="open"] .trayenv__sub {
  flex: 1; min-width: 0; font-size: .72rem; color: #7e6b55; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
[data-theme="open"] .trayenv__guide {
  flex: 0 0 auto; max-width: 150px; overflow: hidden; text-overflow: ellipsis;
  color: #2f7043; font-size: .69rem; font-weight: 900; white-space: nowrap;
  padding: 3px 7px; border-radius: 999px;
  background: rgba(55,150,86,.10); border: 1px solid rgba(55,150,86,.18);
}
[data-theme="open"] .trayenv__amt {
  flex: 0 0 auto; color: #2e2822; font-weight: 900; font-size: 1.06rem; white-space: nowrap;
}
[data-theme="open"] .trayenv__amt.neg { color: #c43e34; }
[data-theme="open"] .trayenv__bar {
  height: 4px; border-radius: 999px; background: rgba(85,62,38,.13); overflow: hidden; margin-top: 1px;
}
[data-theme="open"] .trayenv__bar i { display: block; height: 100%; border-radius: inherit; }
[data-theme="open"] .trayenv__stamp {
  flex: 0 0 auto; white-space: nowrap; color: var(--stamp, #2d8350); font-size: .54rem; font-weight: 900;
  text-transform: uppercase; padding: 3px 6px; border: 1.5px solid currentColor; border-radius: 4px;
  background: rgba(255,250,239,.72); transform: rotate(-4deg); box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
[data-theme="open"] .trayenv__stamp--full { --stamp: #2b8950; }
[data-theme="open"] .trayenv__stamp--pay { --stamp: #7b56ad; }
[data-theme="open"] .trayenv__stamp--over { --stamp: #c43e34; }
[data-theme="open"] .trayenv.is-full { box-shadow: 0 0 0 2px rgba(53,166,87,.75), 0 7px 13px rgba(24,13,7,.24), inset 0 1px 0 rgba(255,255,255,.58); }
[data-theme="open"] .trayenv.is-over { box-shadow: 0 0 0 2px rgba(196,62,52,.82), 0 7px 13px rgba(24,13,7,.24), inset 0 1px 0 rgba(255,255,255,.58); }
[data-theme="open"] .trayenv.is-pay { box-shadow: 0 0 0 2px rgba(123,86,173,.76), 0 7px 13px rgba(24,13,7,.24), inset 0 1px 0 rgba(255,255,255,.58); }
[data-theme="open"] .trayenv--received { animation: envReceive .64s cubic-bezier(.3,.7,.4,1) .18s both; z-index: 2; }

/* drag-to-reorder handle + dragging state */
[data-theme="open"] .trayenv__grip {
  display: none; flex: 0 0 auto; align-self: stretch; width: 22px; margin: -13px -8px -13px 0; cursor: grab; touch-action: none;
  color: rgba(80,58,35,.34);
  background-image: radial-gradient(currentColor 1.3px, transparent 1.5px);
  background-size: 7px 7px; background-position: center;
}
[data-theme="open"] .trayenv__grip:hover { color: rgba(80,58,35,.6); }
[data-theme="open"] .trayenv__grip:active { cursor: grabbing; }
[data-theme="open"] .trayenv.dragging { z-index: 50; transform: scale(1.015); box-shadow: 0 16px 26px rgba(15,8,3,.42), inset 0 1px 0 rgba(255,255,255,.7); }
[data-theme="open"] .traygroup__stack.reordering .trayenv { transition: none; }
[data-theme="open"] .traygroup__stack.reordering .trayenv + .trayenv { margin-top: 6px; }
[data-theme="open"] .trayboard.is-editing .trayenv__grip { display: block; }
[data-theme="open"] .deskmeta__edit { margin-left: 8px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.10); color: #f0e2c8; font-weight: 800; border-radius: 9px; padding: 6px 12px; cursor: pointer; }
[data-theme="open"] .deskmeta__edit.on { background: #e9d4ad; color: #4a3414; border-color: transparent; }
[data-theme="open"] .traygroup__tab--edit { border: 0; font: inherit; cursor: pointer; }
[data-theme="open"] .traygroup { position: relative; }
[data-theme="open"] .traygroup__moves { position: absolute; top: -2px; right: 10px; z-index: 6; display: flex; gap: 5px; }
[data-theme="open"] .traygroup__mv { width: 30px; height: 26px; border-radius: 7px; border: 1px solid rgba(120,92,52,.4); background: rgba(255,255,255,.9); color: #5a4a32; font-size: .68rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,.14); }
[data-theme="open"] .traygroup__mv:hover { background: #fff; }
[data-theme="open"] .traygroup__empty { color: #8a99a6; font-size: .8rem; font-weight: 700; padding: 8px 4px 2px; text-align: center; }
[data-theme="open"] .traygroup__add { display: block; width: fit-content; margin: 8px auto 70px; border: 1.5px dashed rgba(236,209,170,.5); background: rgba(255,255,255,.06); color: #ecd1aa; font-weight: 800; border-radius: 10px; padding: 10px 18px; cursor: pointer; }
[data-theme="open"] .traygroup__add:hover { background: rgba(255,255,255,.12); }

[data-theme="open"] .trayadd {
  position: absolute; left: 50%; bottom: 13px; z-index: 2; transform: translateX(-50%);
  min-width: 220px; border: 1px solid rgba(210,162,102,.34); border-radius: 10px 10px 0 0;
  padding: 13px 20px; color: #ecd1aa; background:
    linear-gradient(180deg, rgba(118,80,44,.96), rgba(77,48,27,.98));
  box-shadow: inset 0 0 0 2px rgba(43,24,12,.32), 0 -4px 11px rgba(0,0,0,.18);
  font-weight: 900; cursor: pointer;
}
[data-theme="open"] .trayadd:hover { color: #fff2db; background: linear-gradient(180deg, #865a34, #5b3920); }

[data-theme="open"] .desknote {
  position: relative; color: #443323; padding: 22px 16px 16px; border-radius: 8px;
  background:
    radial-gradient(260px 120px at 50% 0, rgba(255,255,255,.58), transparent 70%),
    linear-gradient(180deg, #f6ead4, #e6d1ae);
  border: 1px solid rgba(73,49,28,.35);
  box-shadow: 0 11px 23px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.34);
}
[data-theme="open"] .desknote__clip {
  position: absolute; right: 18px; top: -10px; width: 38px; height: 18px; border: 3px solid #b68b53; border-bottom: 0; border-radius: 12px 12px 0 0; transform: rotate(-8deg);
}
[data-theme="open"] .desknote__label {
  display: inline-block; max-width: 100%; padding: 7px 12px; margin-bottom: 12px; border-radius: 4px;
  background: #9eb5ca; color: #29384a; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
[data-theme="open"] .desknote__amt { text-align: center; color: #57813e; font-weight: 900; font-size: 1.7rem; }
[data-theme="open"] .desknote__amt.neg { color: #bb3a2f; }
[data-theme="open"] .desknote__line {
  display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid rgba(101,74,46,.24); padding: 10px 0 0; margin-top: 10px; font-weight: 800;
}
[data-theme="open"] .desknote__line span { color: #765e44; }
[data-theme="open"] .desknote p { color: #75614a; font-weight: 700; line-height: 1.35; }
[data-theme="open"] .desknote .btn { width: 100%; }

[data-theme="open"] .copyrow .btn,
[data-theme="open"] .deskmeta .coverbtn { box-shadow: 0 7px 16px rgba(0,0,0,.22); }
[data-theme="open"] .tabbar {
  background:
    linear-gradient(180deg, rgba(48,54,60,.98), rgba(24,27,31,.98));
  border-top-color: rgba(255,255,255,.10); box-shadow: 0 -8px 24px rgba(0,0,0,.34);
}
[data-theme="open"] .tab { color: #a8adb4; }
[data-theme="open"] .tab:hover { background: rgba(255,255,255,.06); }
[data-theme="open"] .tab--on { color: #73c8ff; }

@media (max-width: 980px) {
  [data-theme="open"] .desklayout { grid-template-columns: 1fr; }
  [data-theme="open"] .deskrail,
  [data-theme="open"] .desknote { display: none; }
}
@media (max-width: 720px) {
  [data-theme="open"] #app { padding: 16px 12px 96px; }
  [data-theme="open"] .desktop { margin-bottom: 10px; }
  [data-theme="open"] .deskhero { align-items: stretch; flex-direction: column; padding: 15px; }
  [data-theme="open"] .deskhero__month { justify-content: center; font-size: 1.08rem; }
  [data-theme="open"] .deskhero p { margin-left: 0; text-align: center; }
  [data-theme="open"] .deskhero__ready { min-width: 0; width: 100%; }
  [data-theme="open"] .trayboard { padding: 15px 12px 68px; }
  [data-theme="open"] .trayboard__inner { grid-template-columns: 1fr; gap: 15px; }
  [data-theme="open"] .trayenv { min-height: 76px; }
}
@media (max-width: 420px) {
  [data-theme="open"] .desktop__brand { font-size: 1.04rem; }
  [data-theme="open"] .desktop .icon { width: 32px; height: 32px; }
  [data-theme="open"] .deskmeta { justify-content: flex-start; font-size: .92rem; }
  [data-theme="open"] .deskmeta .coverbtn { width: 100%; }
  [data-theme="open"] .trayenv { padding: 12px 13px; gap: 10px; }
  [data-theme="open"] .trayenv__ic { width: 26px; height: 26px; }
  [data-theme="open"] .trayenv__amt { font-size: .98rem; }
  [data-theme="open"] .trayenv__stamp { font-size: .48rem; padding: 2px 5px; }
  [data-theme="open"] .trayenv__guide { font-size: .62rem; }
  [data-theme="open"] .trayadd { min-width: 190px; }
}
@media (prefers-reduced-motion: reduce) { [data-theme="open"] .trayenv--received { animation: none; } }

/* =====================================================================
   DESK TRAY REFRESH (2026-06-03)
   Keeps the physical tray metaphor, but moves it away from heavy old-mobile
   skeuomorphism: lighter desk, softer material depth, cleaner paper envelopes.
   ===================================================================== */
[data-theme="open"] body {
  color: #183142;
  background-color: #e8eef0;
  background-image:
    radial-gradient(900px 520px at 18% -12%, rgba(127, 190, 185, .28), transparent 70%),
    radial-gradient(760px 480px at 100% 0, rgba(88, 132, 184, .18), transparent 68%),
    linear-gradient(90deg, rgba(255,255,255,.42), transparent 26%, rgba(255,255,255,.20) 62%, transparent),
    repeating-linear-gradient(88deg, rgba(96, 73, 50, .035) 0 1px, transparent 1px 34px),
    linear-gradient(180deg, #f7f1e7 0%, #e7edf0 48%, #dfe8e7 100%);
  background-attachment: fixed;
}
[data-theme="open"] #app { max-width: 1260px; padding: 18px 14px 96px; }
[data-theme="open"] .deskapp { max-width: 1220px; }

[data-theme="open"] .desktop { margin: 2px 0 14px; color: #173041; }
[data-theme="open"] .desktop__brand {
  text-shadow: none; font-size: 1.1rem; color: #173041;
}
[data-theme="open"] .desktop__brand span {
  padding: 7px 12px; border-radius: 999px;
  background: rgba(255,255,255,.58); border: 1px solid rgba(40,74,88,.10);
  box-shadow: 0 8px 18px rgba(35,65,76,.10), inset 0 1px 0 rgba(255,255,255,.78);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
[data-theme="open"] .desktop .icon {
  background: rgba(255,255,255,.72); color: #173041; border: 1px solid rgba(40,74,88,.14);
  box-shadow: 0 8px 20px rgba(35,65,76,.12), inset 0 1px 0 rgba(255,255,255,.80);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
[data-theme="open"] .desktop .icon:hover { background: rgba(255,255,255,.92); }

[data-theme="open"] .deskhero {
  overflow: hidden; padding: 18px 20px; margin-bottom: 12px; border-radius: 22px;
  background:
    radial-gradient(520px 150px at 50% 0, rgba(255,255,255,.82), transparent 76%),
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(244,235,219,.92) 62%, rgba(229,219,201,.90));
  border: 1px solid rgba(88,102,102,.18);
  box-shadow:
    0 18px 38px rgba(42,75,83,.14),
    0 1px 0 rgba(255,255,255,.8) inset,
    0 -1px 0 rgba(104,84,60,.10) inset;
}
[data-theme="open"] .deskhero::before {
  content: ""; position: absolute; right: 18px; top: 16px; width: 58px; height: 48px; border-radius: 4px 16px 4px 16px;
  background: linear-gradient(135deg, rgba(255,255,255,.84), rgba(207,192,166,.48));
  border-left: 1px solid rgba(105,87,60,.14); border-bottom: 1px solid rgba(105,87,60,.12);
  transform: rotate(1deg); pointer-events: none;
}
[data-theme="open"] .deskhero::after {
  inset: 11px; border: 1px solid rgba(89,108,110,.12); border-radius: 17px; opacity: 1;
}
[data-theme="open"] .deskhero__month { color: #173041; font-size: 1.18rem; }
[data-theme="open"] .deskhero__month .icon {
  color: #244153; background: rgba(255,255,255,.58); border: 1px solid rgba(36,65,83,.10);
}
[data-theme="open"] .deskhero__month .icon:hover { background: rgba(255,255,255,.86); }
[data-theme="open"] .deskhero p { color: #5f7380; font-weight: 750; }
[data-theme="open"] .deskhero__ready {
  min-width: 216px; border: 1px solid rgba(62,130,93,.26);
  background:
    radial-gradient(180px 70px at 50% 0, rgba(255,255,255,.70), transparent 76%),
    linear-gradient(180deg, rgba(238,250,238,.94), rgba(219,239,220,.88));
  color: #2e7a4c; border-radius: 16px; padding: 12px 16px;
  box-shadow: 0 10px 22px rgba(57,104,78,.12), inset 0 1px 0 rgba(255,255,255,.86);
}
[data-theme="open"] .deskhero__ready:hover { transform: translateY(-1px); }
[data-theme="open"] .deskhero__ready b { font-size: 1.48rem; }
[data-theme="open"] .deskhero__ready span { color: #3b7d56; font-size: .74rem; }
[data-theme="open"] .deskhero__ready.neg {
  border-color: rgba(187,58,47,.32); color: #b43c34;
  background: linear-gradient(180deg, rgba(255,247,245,.96), rgba(250,226,221,.90));
}

[data-theme="open"] .deskmeta {
  justify-content: flex-start; gap: 10px; margin: 10px 0 16px; color: #365263; text-shadow: none; font-weight: 800;
}
[data-theme="open"] .deskmeta > span,
[data-theme="open"] .deskmeta__edit,
[data-theme="open"] .deskmeta .coverbtn {
  border-radius: 999px; border: 1px solid rgba(38,77,95,.12);
  background: rgba(255,255,255,.62); color: #365263;
  box-shadow: 0 8px 18px rgba(35,65,76,.08), inset 0 1px 0 rgba(255,255,255,.76);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
[data-theme="open"] .deskmeta > span { padding: 7px 11px; }
[data-theme="open"] .deskmeta b { color: #2d8a58; }
[data-theme="open"] .deskmeta__edit { margin-left: 0; padding: 8px 12px; }
[data-theme="open"] .deskmeta__edit.on { background: #173041; color: #fff; border-color: transparent; }
[data-theme="open"] .deskmeta .coverbtn { color: #b43c34; box-shadow: 0 8px 18px rgba(147,58,47,.12); }

[data-theme="open"] .desklayout { grid-template-columns: 176px minmax(0, 1fr) 238px; gap: 18px; }
[data-theme="open"] .deskrail {
  color: #1f3a4b; border-radius: 22px; padding: 14px 12px;
  background:
    radial-gradient(220px 130px at 25% 0, rgba(255,255,255,.86), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,.66), rgba(237,245,245,.50));
  border: 1px solid rgba(38,77,95,.12);
  box-shadow: 0 18px 34px rgba(35,65,76,.12), inset 0 1px 0 rgba(255,255,255,.78);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
[data-theme="open"] .deskrail__logo { color: #173041; margin-bottom: 14px; }
[data-theme="open"] .deskrail__nav {
  color: #516b7a; border: 1px solid transparent; border-radius: 12px; padding: 9px 10px;
}
[data-theme="open"] .deskrail__nav:hover,
[data-theme="open"] .deskrail__nav.is-on {
  background: rgba(35,118,138,.10); color: #17475a; border-color: rgba(35,118,138,.08);
}
[data-theme="open"] .deskrail__ready {
  margin: 14px 0 10px; padding: 12px 10px; border: 1px solid rgba(52,137,85,.14); border-radius: 14px;
  background: rgba(237,249,237,.68);
}
[data-theme="open"] .deskrail__ready span { color: #5a7782; }
[data-theme="open"] .deskrail__ready b { color: #2d8a58; }
[data-theme="open"] .deskacct {
  background: rgba(255,255,255,.58); color: #243f50; border-radius: 13px; padding: 9px;
  border: 1px solid rgba(40,74,88,.08);
}
[data-theme="open"] .deskacct:hover { background: rgba(255,255,255,.86); }
[data-theme="open"] .deskacct b { color: #244153; }
[data-theme="open"] .deskacct.owe b { color: #7b56ad; }

[data-theme="open"] .trayboard {
  padding: 24px 20px 82px; border-radius: 28px 28px 20px 20px;
  background:
    radial-gradient(760px 260px at 50% 4%, rgba(255,255,255,.42), transparent 72%),
    linear-gradient(90deg, rgba(33,78,88,.12), transparent 8%, transparent 92%, rgba(33,78,88,.14)),
    linear-gradient(180deg, rgba(236,245,242,.72), rgba(191,214,208,.64));
  border: 1px solid rgba(38,77,95,.16);
  box-shadow:
    0 24px 52px rgba(35,65,76,.22),
    inset 0 1px 0 rgba(255,255,255,.74),
    inset 0 -20px 30px rgba(63,94,95,.12);
}
[data-theme="open"] .trayboard::before {
  left: 22px; right: 22px; bottom: 57px; height: 26px; border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, rgba(60,96,98,.18), rgba(255,255,255,.20));
  box-shadow: 0 -10px 24px rgba(42,75,83,.12);
}
[data-theme="open"] .trayboard::after {
  left: 13px; right: 13px; bottom: 11px; height: 52px; border-radius: 18px 18px 12px 12px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.24), transparent 24%, rgba(255,255,255,.18) 72%, transparent),
    linear-gradient(180deg, #c9ad7a, #a98251);
  border: 1px solid rgba(102,78,49,.18);
  box-shadow: inset 0 2px 0 rgba(255,244,220,.42), inset 0 -1px 0 rgba(79,55,29,.22);
}
[data-theme="open"] .trayboard__inner { gap: 22px 22px; }

[data-theme="open"] .traygroup__tab {
  min-height: 30px; padding: 7px 14px 6px; margin-left: 14px; border-radius: 12px 12px 0 0;
  color: #233d4d; font-size: .76rem; background: color-mix(in srgb, var(--tab, #d8c394) 62%, #fff);
  border: 1px solid rgba(54,78,87,.14); border-bottom: 0;
  box-shadow: 0 8px 16px rgba(42,75,83,.10), inset 0 1px 0 rgba(255,255,255,.70);
}
[data-theme="open"] .traygroup--monthly { --tab: #e2bd74; }
[data-theme="open"] .traygroup--quality { --tab: #8fc5d3; }
[data-theme="open"] .traygroup--savings { --tab: #b8d79b; }
[data-theme="open"] .traygroup--debt { --tab: #dca0b5; }
[data-theme="open"] .traygroup--other { --tab: #b9b0df; }
[data-theme="open"] .traygroup__stack {
  padding: 10px 10px 14px; border-radius: 12px 12px 18px 18px; border-top: 0;
  background:
    linear-gradient(90deg, rgba(43,79,88,.12), transparent 9%, transparent 91%, rgba(43,79,88,.12)),
    linear-gradient(180deg, rgba(72,101,104,.18), rgba(255,255,255,.22) 32%, rgba(83,111,111,.10));
  border: 1px solid rgba(40,74,88,.12);
  box-shadow: inset 0 10px 20px rgba(38,70,79,.10), 0 1px 0 rgba(255,255,255,.46);
}
[data-theme="open"] .traygroup__stack::before {
  left: 12px; right: 12px; top: 0; height: 8px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(30,63,74,.16), rgba(255,255,255,.20));
  box-shadow: 0 7px 14px rgba(42,75,83,.10);
}

[data-theme="open"] .trayenv {
  min-height: 92px; padding: 15px 17px 14px; gap: 13px; border-radius: 14px;
  color: #20313b;
  background:
    linear-gradient(31deg, transparent 49.4%, rgba(112,83,52,.18) 49.8%, transparent 50.6%) left bottom / 50% 68% no-repeat,
    linear-gradient(-31deg, transparent 49.4%, rgba(255,255,255,.38) 49.8%, transparent 50.6%) right bottom / 50% 68% no-repeat,
    radial-gradient(360px 100px at 50% 0, rgba(255,255,255,.62), transparent 74%),
    repeating-linear-gradient(8deg, rgba(112,83,52,.028) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, #fff8ec, #ead9bd);
  border: 1px solid rgba(112,83,52,.24);
  box-shadow:
    0 14px 24px rgba(42,75,83,.16),
    0 -3px 10px rgba(255,255,255,.16),
    inset 0 1px 0 rgba(255,255,255,.72),
    inset 0 -1px 0 rgba(112,83,52,.12);
}
[data-theme="open"] .trayenv + .trayenv { margin-top: -8px; }
[data-theme="open"] .trayenv:hover {
  transform: translateY(-2px);
  box-shadow:
    0 18px 30px rgba(42,75,83,.20),
    inset 0 1px 0 rgba(255,255,255,.78),
    inset 0 -1px 0 rgba(112,83,52,.12);
}
[data-theme="open"] .trayenv:focus-visible { outline: 3px solid rgba(57,146,168,.35); outline-offset: 3px; }
[data-theme="open"] .trayenv::before {
  content: ""; position: absolute; left: 16px; right: 16px; top: 10px; bottom: auto; width: auto; height: 1px; z-index: 1; opacity: .55;
  border-radius: 999px; background: linear-gradient(90deg, transparent, rgba(112,83,52,.24), transparent);
  box-shadow: 0 1px 0 rgba(255,255,255,.58);
  pointer-events: none;
}
[data-theme="open"] .trayenv::after {
  content: ""; position: absolute; left: 0; right: 0; top: 25px; bottom: 0; width: auto; z-index: 0; opacity: .64;
  background:
    linear-gradient(34deg, transparent 49.2%, rgba(112,83,52,.16) 49.8%, transparent 50.8%) left bottom / 50% 78% no-repeat,
    linear-gradient(-34deg, transparent 49.2%, rgba(112,83,52,.12) 49.8%, transparent 50.8%) right bottom / 50% 78% no-repeat;
  pointer-events: none;
}
[data-theme="open"] .trayenv__ic,
[data-theme="open"] .trayenv__main,
[data-theme="open"] .trayenv__grip { position: relative; z-index: 2; }
[data-theme="open"] .trayenv__ic {
  width: 32px; height: 32px; border-radius: 11px; background:
    linear-gradient(180deg, rgba(255,255,255,.90), #f5ead6);
  border: 1px solid rgba(112,83,52,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.70), 0 4px 9px rgba(42,75,83,.10);
}
[data-theme="open"] .trayenv__main { gap: 6px; }
[data-theme="open"] .trayenv__top { align-items: baseline; gap: 12px; }
[data-theme="open"] .trayenv__low { align-items: center; gap: 10px; }
[data-theme="open"] .trayenv__side { min-width: 0; gap: 6px; }
[data-theme="open"] .trayenv__name { color: #20313b; font-size: .96rem; }
[data-theme="open"] .trayenv__sub { color: #6f7e83; font-size: .72rem; }
[data-theme="open"] .trayenv__guide {
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; color: #2d8a58; font-size: .68rem;
  background: rgba(45,138,88,.10); border-color: rgba(45,138,88,.18);
}
[data-theme="open"] .trayenv__amt { color: #20313b; font-size: 1.08rem; }
[data-theme="open"] .trayenv__amt.neg { color: #c43e34; }
[data-theme="open"] .trayenv__bar {
  position: relative; height: 6px; background: rgba(112,83,52,.13); margin-top: 0;
  box-shadow: inset 0 1px 2px rgba(88,67,44,.12);
}
[data-theme="open"] .trayenv__bar i { transition: width .5s ease; }
[data-theme="open"] .trayenv.has-goal:not(.is-full):not(.is-over) .trayenv__bar {
  background: rgba(112,83,52,.13);
}
[data-theme="open"] .trayenv.has-goal:not(.is-full):not(.is-over) .trayenv__bar::after {
  content: none;
}
[data-theme="open"] .trayenv__stamp {
  color: var(--stamp, #2d8350); font-size: .55rem; padding: 4px 7px; border: 1.5px dashed currentColor;
  border-radius: 7px; background: rgba(255,252,244,.80); transform: rotate(-3deg);
  box-shadow: 0 3px 7px rgba(42,75,83,.10), inset 0 0 0 1px rgba(255,255,255,.52);
}
[data-theme="open"] .trayenv.is-full,
[data-theme="open"] .trayenv.is-over,
[data-theme="open"] .trayenv.is-pay {
  box-shadow:
    0 14px 24px rgba(42,75,83,.17),
    0 0 0 1px color-mix(in srgb, var(--status-ring, #2b8950) 46%, transparent),
    inset 0 1px 0 rgba(255,255,255,.72),
    inset 0 -1px 0 rgba(112,83,52,.12);
}
[data-theme="open"] .trayenv.is-full { --status-ring: #2b8950; }
[data-theme="open"] .trayenv.is-over { --status-ring: #c43e34; }
[data-theme="open"] .trayenv.is-pay { --status-ring: #7b56ad; }

[data-theme="open"] .trayenv__grip {
  margin: -15px -8px -14px 0; color: rgba(39,65,78,.28);
}
[data-theme="open"] .trayenv__grip:hover { color: rgba(39,65,78,.52); }
[data-theme="open"] .trayenv.dragging { box-shadow: 0 22px 36px rgba(42,75,83,.26), inset 0 1px 0 rgba(255,255,255,.78); }
[data-theme="open"] .traygroup__stack.reordering .trayenv + .trayenv { margin-top: 8px; }
[data-theme="open"] .traygroup__empty { color: #60767f; }
[data-theme="open"] .traygroup__add {
  border-color: rgba(40,74,88,.20); background: rgba(255,255,255,.46); color: #365263; border-radius: 14px;
}
[data-theme="open"] .traygroup__add:hover { background: rgba(255,255,255,.70); }

[data-theme="open"] .trayadd {
  bottom: 15px; min-width: 216px; border-radius: 999px; border: 1px solid rgba(40,74,88,.12);
  color: #173041; background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(235,245,243,.70));
  box-shadow: 0 12px 24px rgba(42,75,83,.16), inset 0 1px 0 rgba(255,255,255,.82);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
[data-theme="open"] .trayadd:hover { color: #173041; background: rgba(255,255,255,.90); }

[data-theme="open"] .desknote {
  color: #243f50; padding: 20px 16px 16px; border-radius: 22px;
  background:
    radial-gradient(280px 130px at 50% 0, rgba(255,255,255,.82), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.70), rgba(244,236,222,.58));
  border: 1px solid rgba(40,74,88,.12);
  box-shadow: 0 18px 34px rgba(35,65,76,.12), inset 0 1px 0 rgba(255,255,255,.76);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
[data-theme="open"] .desknote__clip {
  right: 20px; top: -8px; width: 34px; height: 16px; border-color: #8fa6a8; transform: rotate(-6deg);
}
[data-theme="open"] .desknote__label {
  border-radius: 999px; background: rgba(35,118,138,.12); color: #17475a;
}
[data-theme="open"] .desknote__amt { color: #2d8a58; }
[data-theme="open"] .desknote__amt.neg { color: #bb3a2f; }
[data-theme="open"] .desknote__line { border-top-color: rgba(40,74,88,.12); }
[data-theme="open"] .desknote__line span,
[data-theme="open"] .desknote p { color: #60767f; }

[data-theme="open"] .copyrow .btn { box-shadow: 0 8px 18px rgba(35,65,76,.10); }
[data-theme="open"] .tabbar {
  background: rgba(255,255,255,.80);
  border-top-color: rgba(40,74,88,.10);
  box-shadow: 0 -10px 28px rgba(35,65,76,.12);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
[data-theme="open"] .tab { color: #667b86; }
[data-theme="open"] .tab:hover { background: rgba(35,118,138,.08); }
[data-theme="open"] .tab--on { color: #176781; }

@media (max-width: 980px) {
  [data-theme="open"] .desklayout { grid-template-columns: 1fr; }
  [data-theme="open"] .deskrail,
  [data-theme="open"] .desknote { display: none; }
}
@media (max-width: 720px) {
  [data-theme="open"] #app { padding: 14px 10px 96px; }
  [data-theme="open"] .desktop { margin-bottom: 10px; }
  [data-theme="open"] .desktop__brand span { padding: 6px 10px; }
  [data-theme="open"] .deskhero { flex-direction: column; align-items: stretch; padding: 16px; border-radius: 20px; }
  [data-theme="open"] .deskhero__month { justify-content: center; font-size: 1.06rem; }
  [data-theme="open"] .deskhero p { margin-left: 0; text-align: center; }
  [data-theme="open"] .deskhero__ready { min-width: 0; width: 100%; }
  [data-theme="open"] .deskmeta { justify-content: flex-start; }
  [data-theme="open"] .trayboard { padding: 18px 13px 74px; border-radius: 22px; }
  [data-theme="open"] .trayboard__inner { grid-template-columns: 1fr; gap: 18px; }
  [data-theme="open"] .trayenv { min-height: 90px; }
}
@media (max-width: 420px) {
  [data-theme="open"] .desktop__brand { font-size: 1rem; }
  [data-theme="open"] .desktop .icon { width: 34px; height: 34px; }
  [data-theme="open"] .deskmeta > span { flex: 1 1 42%; text-align: center; }
  [data-theme="open"] .deskmeta__edit,
  [data-theme="open"] .deskmeta .coverbtn { flex: 1 1 auto; }
  [data-theme="open"] .deskmeta .coverbtn { width: 100%; }
  [data-theme="open"] .trayenv { padding: 14px 13px 13px; gap: 10px; }
  [data-theme="open"] .trayenv__ic { width: 29px; height: 29px; }
  [data-theme="open"] .trayenv__top { gap: 8px; }
  [data-theme="open"] .trayenv__amt { font-size: .98rem; }
  [data-theme="open"] .trayenv__guide { display: inline-block; max-width: 116px; font-size: .58rem; padding: 3px 6px; }
  [data-theme="open"] .trayenv__stamp { font-size: .50rem; padding: 3px 6px; }
  [data-theme="open"] .trayadd { min-width: 190px; }
}
