[hidden]{display:none!important}
:root{
  --bg:#f6f1e7; --card:#fffdf8; --ink:#1d2420; --muted:#6c736e; --line:#e7dfcf;
  --brand:#1f4d3a; --brand-2:#2f6b52; --accent:#f2a541; --good:#2a8a5c; --bad:#c8463d;
  --r:18px; --shadow:0 1px 0 rgba(0,0,0,.04),0 6px 20px -10px rgba(31,77,58,.25);
  --font:"Plus Jakarta Sans",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --ur:"Noto Nastaliq Urdu","Jameel Noori Nastaleeq",serif;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);font-size:17px}
body{padding-bottom:calc(84px + env(safe-area-inset-bottom))}
[dir=rtl] body,[dir=rtl] input,[dir=rtl] button,[dir=rtl] select{font-family:var(--ur),var(--font)}
[dir=rtl] body{line-height:2;font-size:16px}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none}
input,select{font:inherit;color:inherit}
.boot{display:grid;place-items:center;height:100vh;font-size:48px}
.wrap{max-width:560px;margin:0 auto;padding:16px 16px 24px}

/* header */
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 2px 14px}
.top h1{font-size:22px;margin:0;font-weight:800;letter-spacing:-.02em}
.top small{color:var(--muted);display:block;font-size:13px}
.chip{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:999px;background:var(--card);border:1px solid var(--line);font-weight:600;font-size:14px}
.chip.on{background:var(--brand);color:#fff;border-color:var(--brand)}
.chips{display:flex;gap:8px;overflow-x:auto;padding:2px 0 12px;scrollbar-width:none}

/* cards */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:16px;box-shadow:var(--shadow);margin-bottom:14px}
.card h3{margin:0 0 10px;font-size:15px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.04em}
[dir=rtl] .card h3{text-transform:none;letter-spacing:0;font-size:16px}
.hero{background:linear-gradient(145deg,var(--brand),var(--brand-2));color:#fff;border:0;position:relative;overflow:hidden}
.hero h3{color:#cfe3d8}
.hero::after{content:"";position:absolute;right:-40px;top:-40px;width:160px;height:160px;border-radius:50%;background:rgba(255,255,255,.07)}
.big{font-size:38px;font-weight:800;letter-spacing:-.03em;margin:2px 0}
.hero .sub{color:#d9eadf;font-size:15px}
.row{display:flex;align-items:center;gap:12px}
.between{justify-content:space-between}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.stat{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:14px}
.stat b{display:block;font-size:22px;font-weight:800}
.stat span{color:var(--muted);font-size:13px}
.muted{color:var(--muted)}
.good{color:var(--good)} .bad{color:var(--bad)}
.banner{background:#fff4dc;border:1px solid #f3d79c;color:#7a5413;border-radius:14px;padding:12px 14px;margin-bottom:14px;display:flex;gap:10px;align-items:center;font-weight:600;font-size:15px}

/* buttons */
.btn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;padding:16px;border-radius:16px;background:var(--brand);color:#fff;font-weight:700;font-size:18px;box-shadow:0 8px 20px -10px var(--brand)}
.btn:active{transform:scale(.98)}
.btn.add{background:var(--accent);color:#3d2600;font-size:20px;padding:20px;box-shadow:0 10px 24px -12px #c47a12}
.btn.ghost{background:transparent;color:var(--brand);box-shadow:none;border:2px solid var(--line)}
.btn.danger{background:#fbe9e7;color:var(--bad);box-shadow:none}
.btn.sm{padding:10px 14px;font-size:15px;width:auto;border-radius:12px}
.btn.wa{background:#25d366;color:#053d1c}
.btn[disabled]{opacity:.5}
.icon-btn{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:var(--card);border:1px solid var(--line);font-size:20px}

/* avatar */
.av{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;color:#fff;font-weight:800;flex:none;font-family:var(--font)}
.av.lg{width:64px;height:64px;font-size:24px}

/* list */
.list{list-style:none;margin:0;padding:0}
.item{display:flex;align-items:center;gap:12px;padding:12px 2px;border-bottom:1px solid var(--line)}
.item:last-child{border-bottom:0}
.item .ico{width:44px;height:44px;border-radius:14px;background:#f1ebdd;display:grid;place-items:center;font-size:22px;flex:none}
.item .mid{flex:1;min-width:0}
.item .mid b{display:block;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.item .mid small{color:var(--muted);font-size:13px}
.item .amt{font-weight:800;font-size:17px;white-space:nowrap}
.day{font-size:13px;font-weight:700;color:var(--muted);margin:14px 2px 2px}

/* notebook table */
.nb{width:100%;border-collapse:collapse;font-size:15px}
.nb th{font-size:12px;color:var(--muted);text-align:start;font-weight:700;padding:6px 4px;border-bottom:2px solid var(--line)}
.nb td{padding:10px 4px;border-bottom:1px dashed var(--line)}
.nb td.n{text-align:end;font-weight:700;white-space:nowrap}
.nb th.n{text-align:end}
.transfer{display:flex;align-items:center;gap:10px;padding:12px;border-radius:14px;background:#f4efe3;margin-bottom:10px;flex-wrap:wrap}
.transfer .arrow{font-size:20px;color:var(--muted)}
[dir=rtl] .transfer .arrow{transform:scaleX(-1)}
.bar{height:12px;border-radius:6px;background:#eee6d6;overflow:hidden;margin-top:6px}
.bar i{display:block;height:100%;border-radius:6px;background:var(--brand-2)}
.trend{display:flex;align-items:flex-end;gap:8px;height:140px;padding-top:10px}
.trend div{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:6px;font-size:11px;color:var(--muted)}
.trend i{display:block;width:100%;border-radius:8px 8px 4px 4px;background:var(--accent);min-height:4px}
.trend div.cur i{background:var(--brand)}

/* forms */
label.f{display:block;margin-bottom:14px}
label.f>span{display:block;font-size:14px;font-weight:700;margin-bottom:6px;color:var(--muted)}
.in{width:100%;padding:14px;border-radius:14px;border:2px solid var(--line);background:#fff;font-size:17px;outline:none}
.in:focus{border-color:var(--brand-2)}
.amount-in{font-size:40px;font-weight:800;text-align:center;padding:12px;letter-spacing:-.02em}
.cat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.cat{display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 4px;border-radius:14px;border:2px solid var(--line);background:#fff;font-size:12px;font-weight:600;text-align:center;line-height:1.25}
[dir=rtl] .cat{font-size:12px;line-height:1.8}
.cat em{font-style:normal;font-size:26px}
.cat.on{border-color:var(--brand);background:#e8f2ec}
.who{display:flex;gap:10px;overflow-x:auto;padding-bottom:4px}
.who button{display:flex;flex-direction:column;align-items:center;gap:4px;font-size:13px;font-weight:600;padding:6px;border-radius:14px;border:2px solid transparent;min-width:70px}
.who button.on{border-color:var(--brand);background:#e8f2ec}

/* login */
.login{min-height:100vh;display:flex;flex-direction:column;justify-content:center}
.logo{font-size:56px;text-align:center}
.names{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:18px 0}
.names button{display:flex;flex-direction:column;align-items:center;gap:6px;padding:14px 6px;border-radius:18px;background:var(--card);border:2px solid var(--line);font-weight:700}
.pin-dots{display:flex;justify-content:center;gap:14px;margin:18px 0}
.pin-dots i{width:16px;height:16px;border-radius:50%;border:2px solid var(--brand)}
.pin-dots i.on{background:var(--brand)}
.pad{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;max-width:320px;margin:0 auto}
.pad button{height:68px;border-radius:20px;background:var(--card);border:1px solid var(--line);font-size:28px;font-weight:700;font-family:var(--font)}
.pad button:active{background:#e8f2ec}

/* bottom nav */
.nav{position:fixed;left:0;right:0;bottom:0;background:rgba(255,253,248,.96);backdrop-filter:blur(10px);border-top:1px solid var(--line);display:flex;justify-content:space-around;padding:8px 6px calc(8px + env(safe-area-inset-bottom));z-index:10}
.nav button{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:12px;font-weight:600;color:var(--muted);padding:4px 8px;border-radius:12px;min-width:60px}
[dir=rtl] .nav button{font-size:12px;line-height:1.6}
.nav button em{font-style:normal;font-size:24px;filter:grayscale(1);opacity:.7}
.nav button.on{color:var(--brand)}
.nav button.on em{filter:none;opacity:1}

/* sheet */
.sheet-wrap{position:fixed;inset:0;background:rgba(20,30,25,.45);z-index:20;display:flex;align-items:flex-end;justify-content:center;animation:fade .15s}
.sheet{background:var(--bg);width:100%;max-width:560px;max-height:92vh;overflow:auto;border-radius:24px 24px 0 0;padding:10px 16px calc(20px + env(safe-area-inset-bottom));animation:up .2s ease-out}
.sheet .grab{width:44px;height:5px;border-radius:3px;background:#d5ccb9;margin:4px auto 12px}
.sheet h2{margin:0 0 14px;font-size:20px}
@keyframes up{from{transform:translateY(40px);opacity:.6}}
@keyframes fade{from{opacity:0}}
.toast{position:fixed;left:50%;bottom:100px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:12px 18px;border-radius:14px;font-weight:600;z-index:30;max-width:90vw;text-align:center}
.empty{text-align:center;padding:30px 10px;color:var(--muted)}
.empty em{display:block;font-style:normal;font-size:44px;margin-bottom:6px}
.month-sw{display:flex;align-items:center;gap:8px}
.month-sw b{min-width:120px;text-align:center}
.shop-item{display:flex;align-items:center;gap:12px;padding:12px 2px;border-bottom:1px solid var(--line)}
.shop-item .ck{width:32px;height:32px;border-radius:10px;border:2px solid var(--brand);display:grid;place-items:center;font-size:18px;flex:none}
.shop-item.done .ck{background:var(--brand);color:#fff}
.shop-item.done b{text-decoration:line-through;color:var(--muted)}
.lang-switch{display:flex;background:var(--card);border:1px solid var(--line);border-radius:999px;padding:3px}
.lang-switch button{padding:6px 12px;border-radius:999px;font-weight:700;font-size:14px}
.lang-switch button.on{background:var(--brand);color:#fff}

/* ---- v2: media, detail, analytics ---- */
.lbl{display:block;font-size:14px;font-weight:700;margin-bottom:6px;color:var(--muted)}
.f{margin-bottom:14px}
.media-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.media-btn{display:flex;flex-direction:column;align-items:center;gap:2px;padding:12px 4px;border-radius:14px;border:2px dashed var(--line);background:#fff;font-size:26px;cursor:pointer;text-align:center}
.media-btn span{font-size:12px;font-weight:700;color:var(--muted);line-height:1.3}
.media-btn.rec-on{border-style:solid;border-color:var(--bad);background:#fdecea;animation:pulse 1s infinite}
.media-btn.rec-on span{color:var(--bad)}
@keyframes pulse{50%{box-shadow:0 0 0 6px rgba(200,70,61,.15)}}
.thumbs{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.thumb{position:relative}
.thumb img{width:72px;height:72px;object-fit:cover;border-radius:12px;border:1px solid var(--line)}
.thumb.voice{flex:1 1 100%}
.thumb.voice audio{width:100%;height:40px}
.thumb button{position:absolute;top:-6px;right:-6px;width:24px;height:24px;border-radius:50%;background:var(--ink);color:#fff;font-size:12px}
.photos{display:grid;grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:8px;margin-bottom:14px}
.photos img{width:100%;aspect-ratio:3/4;object-fit:cover;border-radius:14px;border:1px solid var(--line);cursor:zoom-in;background:#eee}
.timeline{list-style:none;margin:0;padding:0}
.timeline li{display:flex;gap:10px;padding:8px 0;border-bottom:1px dashed var(--line);font-size:14px}
.timeline li:last-child{border-bottom:0}
.timeline .ti{width:28px;height:28px;border-radius:50%;background:#f1ebdd;display:grid;place-items:center;flex:none;font-size:14px}
.diff{font-size:13px;margin-top:3px;background:#f7f2e7;border-radius:8px;padding:3px 8px;display:inline-block;margin-inline-end:4px}
.diff span{color:var(--muted)} .diff s{color:var(--bad)} .diff b{color:var(--good)}
.calc{background:#f4efe3;border-radius:12px;padding:10px 12px;font-weight:700;margin-bottom:10px;text-align:center}
.hero .transfer.hero-t{background:rgba(255,255,255,.1);color:#fff}
.hero .transfer .arrow{color:#cfe3d8}
.hero .btn.sm{background:var(--accent);color:#3d2600}
.stat small{display:block;font-size:12px;margin-top:2px}
.donut-wrap{display:grid;place-items:center;margin:4px 0 14px}
.donut{width:180px;height:180px;border-radius:50%;display:grid;place-items:center}
.donut>div{width:110px;height:110px;border-radius:50%;background:var(--card);display:grid;place-items:center;text-align:center;font-size:15px}
.legend{display:grid;grid-template-columns:12px 1fr auto 38px 54px;gap:8px;align-items:center;padding:6px 0;font-size:14px;border-bottom:1px dashed var(--line)}
.legend:last-child{border-bottom:0}
.legend i{width:12px;height:12px;border-radius:4px}
.legend small{text-align:end;font-size:12px}
.daily{display:flex;align-items:flex-end;gap:2px;height:110px}
.daily div{flex:1;height:100%;display:flex;flex-direction:column;justify-content:flex-end;position:relative}
.daily i{display:block;background:var(--brand-2);border-radius:3px 3px 1px 1px;min-height:2px}
.daily span{position:absolute;bottom:-18px;left:50%;transform:translateX(-50%);font-size:10px;color:var(--muted)}
.daily{margin-bottom:18px}
.hbar{display:grid;grid-template-columns:44px 1fr 80px;gap:8px;align-items:center;font-size:13px;margin-bottom:6px}
.hbar .bar{margin:0}
.hbar b{text-align:end}
.mx td,.mx th{font-size:13px;padding:8px 4px}
.mx th{font-size:18px}
.av.sm{width:30px;height:30px;font-size:12px}
.nb small.tag{display:block;font-size:11px;font-weight:600;opacity:.85}
.nb td{vertical-align:middle}
.wrap{overflow-x:hidden}
.diff b,.diff s{display:inline!important;font-size:13px!important;white-space:normal!important}

/* ---- notebook page ---- */
.wrap.wide{max-width:1100px}
.seg{display:flex;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:3px}
.seg button{padding:6px 12px;border-radius:9px;font-size:18px}
.seg button.on{background:var(--brand);color:#fff}
.nbk-scroll{overflow:auto;max-height:calc(100vh - 250px);border:1px solid #d9cfba;border-radius:16px;background:#fffef9;box-shadow:var(--shadow);margin-bottom:14px;-webkit-overflow-scrolling:touch}
.nbk{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed;font-family:var(--font)}
.nbk th,.nbk td{border-inline-end:1.5px solid #cdbfa3;padding:0;vertical-align:top}
.nbk th:last-child,.nbk td:last-child{border-inline-end:0}
.nbk thead th{position:sticky;top:0;z-index:2;background:#f3ead6;border-bottom:3px double #b9a882}
.nbk-head{display:flex;flex-direction:column;align-items:center;gap:3px;width:100%;padding:10px 4px 8px;font-weight:800;font-size:15px}
.nbk-head:active{background:#e8dcc0}
.nbk tbody td{height:62px;background-image:linear-gradient(to bottom,transparent 61px,#dfe8f1 61px);background-size:100% 62px}
.nbk-cell{display:flex;flex-direction:column;align-items:flex-start;width:100%;height:62px;padding:6px 8px;text-align:start;gap:1px;overflow:hidden}
.nbk-cell:hover,.nbk-cell:focus-visible{background:#eef6f0;outline:none}
.nbk-cell:active{background:#e1efe5}
.nbk-cell b{font-size:16px;font-weight:800;color:#1b3a6b;white-space:nowrap}
.nbk-cell small{font-size:11px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.nbk tfoot td{position:sticky;background:#f3ead6;padding:6px 8px;text-align:start}
.nbk tfoot tr.f-total td{bottom:84px;border-top:3px double #b9a882}
.nbk tfoot tr.f-share td{bottom:42px}
.nbk tfoot tr.f-bal td{bottom:0}
.nbk tfoot td{height:42px}
.nbk tfoot small{display:block;font-size:10px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.03em}
[dir=rtl] .nbk tfoot small{text-transform:none;letter-spacing:0}
.nbk tfoot b{font-size:15px;white-space:nowrap}
.nbk tfoot td.good b{color:var(--good)} .nbk tfoot td.bad b{color:var(--bad)}
.nbk-sum{text-align:center;font-weight:700}
.nbk-tr{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:8px;font-weight:600}
.nbk-tr span{background:#f4efe3;border-radius:10px;padding:6px 10px;font-size:14px}
[dir=rtl] .nbk-cell b,[dir=rtl] .nbk tfoot b{direction:ltr;unicode-bidi:isolate}

/* drawer: bottom sheet on phones, side drawer on wide screens */
@media (min-width:900px){
  .sheet-wrap{justify-content:flex-end;align-items:stretch}
  .sheet{max-width:440px;max-height:100vh;height:100vh;border-radius:24px 0 0 24px;animation:side .2s ease-out}
  [dir=rtl] .sheet-wrap{justify-content:flex-start}
  [dir=rtl] .sheet{border-radius:0 24px 24px 0}
  .sheet .grab{display:none}
}
@keyframes side{from{transform:translateX(40px);opacity:.6}}
@media (max-width:600px){
  .wrap.wide{padding-left:8px;padding-right:8px}
  .nbk-head{font-size:12px;padding:8px 2px 6px}
  .nbk-head .av.sm{width:26px;height:26px;font-size:11px}
  .nbk tbody td{height:54px;background-image:linear-gradient(to bottom,transparent 53px,#dfe8f1 53px);background-size:100% 54px}
  .nbk-cell{height:54px;padding:5px 4px}
  .nbk-cell b{font-size:13px;letter-spacing:-.02em}
  .nbk-cell small{font-size:10px}
  .nbk tfoot td{padding:4px}
  .nbk tfoot b{font-size:12px;letter-spacing:-.02em}
  .nbk tfoot small{font-size:8.5px;letter-spacing:0}
  .nbk tfoot td{height:36px}
  .nbk tfoot tr.f-total td{bottom:72px} .nbk tfoot tr.f-share td{bottom:36px}
}
[dir=rtl] .nbk{line-height:1.3}
[dir=rtl] .nbk b{font-family:var(--font)}
[dir=rtl] .nbk-cell small{font-family:var(--font),var(--ur);line-height:1.35}
[dir=rtl] .nbk tfoot small{line-height:1.5;font-size:10px}
[dir=rtl] .nbk tfoot b{line-height:1.2;display:block}
[dir=rtl] .nbk-head span{line-height:1.6}
[dir=rtl] .nbk tfoot b{text-align:right}
.nbk-totals{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:14px}
.nbk-tot{border-radius:var(--r);padding:14px 16px;background:linear-gradient(145deg,var(--brand),var(--brand-2));color:#fff;box-shadow:var(--shadow)}
.nbk-tot.ph{background:linear-gradient(145deg,#d98b1c,var(--accent));color:#3d2600}
.nbk-tot small{display:block;font-size:12px;font-weight:700;opacity:.9}
.nbk-tot b{display:block;font-size:26px;font-weight:800;letter-spacing:-.02em;margin:2px 0;font-family:var(--font);direction:ltr;unicode-bidi:isolate}
.nbk-tot span{font-size:12px;opacity:.85;font-family:var(--font)}
[dir=rtl] .nbk-tot b{text-align:right}
@media (max-width:380px){.nbk-tot b{font-size:21px}}
