:root{color-scheme:light;--ink:#253b34;--muted:#758079;--green:#2b6553;--line:#e5e9e3;--paper:#fff;--bg:#f6f7f2}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.5 "Segoe UI",Arial,sans-serif}button,input,select,textarea{font:inherit}button,a,input,select,textarea,summary{-webkit-tap-highlight-color:transparent}button,a,summary{touch-action:manipulation}button{cursor:pointer}a{color:var(--green);text-decoration:none}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #bd9245;outline-offset:4px}input:focus,select:focus,textarea:focus{outline:2px solid #84a997;outline-offset:1px}.shell{max-width:1056px;margin:auto;padding:0 28px}.topbar{display:flex;justify-content:space-between;align-items:center;min-height:100px;border-bottom:1px solid var(--line);margin-bottom:38px}.brand{display:flex;align-items:center;gap:10px;color:var(--ink);font-size:24px;font-weight:750;letter-spacing:-1px}.brand-mark{display:inline-grid;place-items:center;background:var(--green);color:#fff;border-radius:12px;width:35px;height:35px;font:italic 30px Georgia,serif}.brand-caption{border-left:1px solid #d4dbd2;padding-left:16px;margin-left:10px;color:var(--muted);font-size:12px;font-weight:400;letter-spacing:0}.button{border:1px solid var(--green);background:var(--green);color:white;padding:12px 22px;border-radius:10px;font-weight:600;min-height:46px;display:inline-flex;align-items:center;justify-content:center;gap:9px}.button:hover{background:#204f40}.button.secondary{background:white;color:var(--green)}.text-button{border:0;background:none;color:var(--green);padding:8px 4px;min-height:40px;font-size:13px;font-weight:600;display:inline-flex;align-items:center}.text-button:hover{text-decoration:underline}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:25px}.eyebrow{font-size:10px;letter-spacing:1.8px;font-weight:700}.page-heading h1{font-family:Georgia,serif;font-size:36px;letter-spacing:-1px;font-weight:400;margin:8px 0}.greeting-dot{color:#b59a62;font-size:27px;margin-left:7px}h1,h2,h3,p{margin-top:0}h2{font-size:21px;letter-spacing:-.4px;margin-bottom:4px}h3{font-size:16px;margin:0}.muted{color:var(--muted)}p.muted{font-size:13px;margin-bottom:0}.add-button{min-width:112px}.add-button span{font-size:24px;line-height:1}.balance-card{display:flex;align-items:center;justify-content:space-between;gap:25px;background:#e6eee2;border:1px solid #d9e4d4;border-radius:18px;padding:32px 36px;position:relative;overflow:hidden}.balance-card .eyebrow{color:#5c765b}.balance{font-size:52px;font-weight:600;letter-spacing:-2px;line-height:1.4}.balance-card p{font-size:12px;color:#668063;margin:2px 0 0}.next-topup{display:flex;align-items:center;gap:12px;padding:17px 20px;border:1px solid #d0ddc9;border-radius:12px;background:#f1f5ed}.next-topup strong{font-size:13px;display:block}.next-topup div>span{display:block;font-size:11px;color:#6f7c68;margin-top:3px}.topup-icon{display:grid;place-items:center;border-radius:50%;width:33px;height:33px;background:#dae6d3;font-size:23px}.weekly{margin-top:34px}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}.weekly>.section-heading h2{margin-top:4px}.week-navigation{display:flex;gap:8px;align-items:center}.icon-button{display:inline-grid;place-items:center;width:40px;height:40px;flex-shrink:0;background:white;border:1px solid var(--line);border-radius:9px;color:var(--ink);font-size:21px}.card{background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:25px}.stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.stat{display:flex;flex-direction:column;gap:8px;padding:21px 24px}.stat>.muted{font-size:12px}.stat>strong{font-size:27px;font-weight:600;letter-spacing:-.7px}.stat small{font-size:11px;color:var(--muted)}.green{color:var(--green)}.negative,.danger{color:#ab4944}.breakdown{margin-top:16px}.breakdown .section-heading>.muted{font-size:11px}.category-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:28px}.category{display:grid;grid-template-columns:39px 1fr auto;align-items:center;gap:12px}.category-icon{width:39px;height:39px;display:grid;place-items:center;border-radius:12px;font-size:25px}.home{background:#e9eee4;color:#63845b}.self{background:#f5e9e3;color:#b18370}.other{background:#eeecf6;color:#8b7bac}.category>div>span{display:block;font-size:12px;color:var(--muted)}.category strong{font-size:16px}.share{font-size:11px;color:var(--muted)}progress{appearance:none;border:0;height:6px;width:100%;background:#f0f2ed;border-radius:8px;overflow:hidden}progress::-webkit-progress-bar{background:#f0f2ed;border-radius:8px}progress::-webkit-progress-value{background:#97ae85;border-radius:8px}progress::-moz-progress-bar{background:#97ae85;border-radius:8px}.category progress{grid-column:1/-1}.reminder-section,.activity,.history,.monthly{margin-top:24px}.count{font-size:11px;background:#f0eadb;color:#9a834b;border-radius:20px;padding:3px 7px;vertical-align:middle;margin-left:6px}.empty{display:flex;align-items:center;gap:18px;background:#fafbf7;border:1px dashed #e2e7dc;padding:22px;border-radius:10px;color:var(--muted);font-size:13px}.empty>span{border:1px solid #d7e0ce;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;color:#7c916d}.empty p{margin:0;color:var(--ink)}.empty small{display:block;color:var(--muted);margin-top:3px}.reminder-row{border-top:1px solid var(--line);padding:18px 0}.row-main{display:flex;justify-content:space-between;gap:20px}.row-main>div{min-width:0}.row-main>strong{white-space:nowrap}.row-main small{color:var(--muted);font-size:11px}.details-text{font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere;margin:7px 0;color:#667368}strong[dir]{overflow-wrap:anywhere}.settle{margin-top:12px}summary{cursor:pointer;font-weight:600;font-size:13px;padding:9px 0}.compact{background:#f8faf6;padding:16px;border-radius:10px;max-width:580px}.history-row{padding:14px 0;border-top:1px solid var(--line);display:flex;gap:15px;justify-content:space-between}.settled-history{margin-top:10px}.activity-row{display:flex;align-items:flex-start;gap:14px;padding:19px 0;border-top:1px solid #eff1ec}.activity-icon{width:35px;height:35px;border-radius:10px;display:grid;place-items:center;flex-shrink:0;font-size:20px}.expense-icon{background:#f4eee5;color:#a28c69}.income-icon{background:#eaf1e7;color:#6c8b5f}.activity-content{flex:1;min-width:0}.activity-content>strong{font-size:14px}.activity-content p.muted{font-size:11px;margin-top:3px}.activity-amount{text-align:right;white-space:nowrap}.activity-amount>strong{font-size:14px}.row-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px}.row-actions .text-button{font-size:11px;min-height:32px;padding:4px 0}.trend{margin:20px 0}.trend-row{display:grid;grid-template-columns:65px 1fr 85px;align-items:center;gap:20px;margin:13px 0;font-size:12px}.trend-row>span{color:var(--muted)}.trend-row>strong{text-align:right;font-size:12px}.trend-row progress{height:9px}.monthly>summary{font-size:16px}.monthly>summary span{font-weight:400;font-size:12px;margin-left:12px}.month-filter{display:flex;align-items:flex-end;gap:12px;margin-top:20px}.month-filter label{flex:1;max-width:240px}.monthly-categories{display:flex;flex-wrap:wrap;gap:25px;padding-top:16px;border-top:1px solid var(--line);font-size:13px}.monthly-categories strong{margin-left:12px}footer{display:flex;justify-content:space-between;gap:16px;margin:30px 0;font-size:11px;color:var(--muted)}.welcome{max-width:480px;margin:60px auto;padding:36px}.welcome h1{font:34px/1.2 Georgia,serif;margin:15px 0}.welcome form{margin-top:24px}.stack{display:flex;flex-direction:column;gap:17px}label{display:flex;flex-direction:column;gap:7px;font-size:13px;font-weight:600}label>span.muted{font-size:11px}input:not([type=radio]),select,textarea{width:100%;border:1px solid #dce3d8;border-radius:8px;padding:11px 12px;background:white;color:var(--ink);min-height:44px}textarea{resize:vertical}.hint{padding:13px 16px;background:#f0f4eb;border-radius:9px;font-size:12px;color:#61735b;line-height:1.7}.notice{border:1px solid #cddcc4;background:#edf4e8;color:#3e6631;padding:13px 18px;border-radius:10px;margin-bottom:20px;font-size:13px}.error{background:#fcf0ed;border-color:#edc6bb;color:#9c4537}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.form-grid>*{min-width:0}dialog{width:calc(100% - 32px);max-width:500px;max-height:90dvh;border:1px solid var(--line);border-radius:18px;padding:27px;color:var(--ink);background:#fff;box-shadow:0 20px 80px #142d3426}dialog::backdrop{background:#20372d70;backdrop-filter:blur(3px)}.dialog-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.dialog-header h2{font-size:23px}.dialog-header .icon-button{border:0;background:#f4f6f0}.add-choices{display:flex;flex-direction:column;gap:12px;margin-top:25px}.add-choices>button{display:grid;grid-template-columns:40px 1fr 20px;column-gap:14px;row-gap:2px;text-align:left;background:white;border:1px solid var(--line);padding:20px 16px;border-radius:12px;color:var(--ink)}.add-choices>button:hover{background:#f5f8f1}.add-choices .category-icon{grid-row:1/3}.add-choices strong{font-size:16px}.add-choices small{grid-column:2;font-size:12px;color:var(--muted)}.add-choices>button>span:last-child{grid-column:3;grid-row:1/3;align-self:center}fieldset{border:0;padding:0;margin:0}legend{font-size:13px;font-weight:600;margin-bottom:8px}.category-options{display:flex;gap:10px}.category-options label{flex:1;position:relative}.category-options input{position:absolute;opacity:0}.category-options span{border:1px solid var(--line);border-radius:8px;padding:10px;text-align:center;font-size:13px}.category-options input:checked+span{background:#e9f0e3;border-color:#739567;color:#456a38}.category-options input:focus-visible+span{outline:2px solid #739567;outline-offset:2px}
@media(max-width:700px){.shell{padding:0 18px}.topbar{min-height:78px;margin-bottom:27px}.brand-caption{display:none}.page-heading h1{font-size:30px}.page-heading p{max-width:235px}.balance-card{padding:25px;flex-direction:column;align-items:flex-start;gap:20px}.balance{font-size:47px}.next-topup{width:100%;padding:12px 14px}.stat-grid{gap:8px}.stat{padding:16px 12px;gap:6px}.stat>.muted{font-size:11px;min-height:33px}.stat>strong{font-size:22px}.stat small{font-size:10px}.card{padding:20px}.stat.card{padding:16px 12px}.category-grid{grid-template-columns:1fr;gap:20px}.category{grid-template-columns:39px 1fr auto}.category progress{grid-column:2/-1;margin-top:-4px}.category>div{display:flex;align-items:center;justify-content:space-between;gap:8px}.category>div>span{font-size:13px}.section-heading{gap:10px}.section-heading h2{font-size:18px}.reminder-section .section-heading{align-items:flex-start}.reminder-section .text-button{white-space:nowrap;font-size:12px}.monthly>summary span{display:block;margin:7px 0 0}.monthly .stat-grid{grid-template-columns:1fr}.monthly .stat{flex-direction:row;justify-content:space-between;padding:10px 0;align-items:center}.monthly .stat>.muted{min-height:0}.monthly .stat>strong{font-size:20px}.monthly-categories{gap:15px}.activity-row{gap:10px}.activity-icon{width:30px;height:30px}.activity-content>strong{font-size:13px}.activity-amount>strong{font-size:13px}footer{flex-direction:column;gap:5px}.welcome{padding:25px;margin:25px auto}.welcome h1{font-size:30px}.breakdown .section-heading>.muted{font-size:10px}.form-grid{gap:10px}.trend-row{gap:12px}input:not([type=radio]),select,textarea{font-size:16px}dialog{padding:22px}.row-main{gap:10px}.add-button{min-width:90px;padding:10px 15px}}

/* Arabic layout: retain the existing palette and components. */
html[dir="rtl"] body{font-family:Tahoma,"Segoe UI",Arial,sans-serif;line-height:1.8}
html[dir="rtl"] .brand,html[dir="rtl"] .eyebrow,html[dir="rtl"] h1,html[dir="rtl"] h2{letter-spacing:0}
html[dir="rtl"] .page-heading h1,html[dir="rtl"] .welcome h1{font-family:inherit;font-weight:600}
html[dir="rtl"] .brand-caption{border-left:0;border-right:1px solid #d4dbd2;padding-left:0;padding-right:16px;margin-left:0;margin-right:10px}
html[dir="rtl"] .greeting-dot,html[dir="rtl"] .count{margin-left:0;margin-right:7px}
html[dir="rtl"] .monthly>summary span{margin-left:0;margin-right:12px}
html[dir="rtl"] .monthly-categories strong{margin-left:0;margin-right:12px}
html[dir="rtl"] .activity-amount,html[dir="rtl"] .trend-row>strong{text-align:left}
html[dir="rtl"] .balance,html[dir="rtl"] .stat>strong,html[dir="rtl"] .category strong,html[dir="rtl"] .activity-amount>strong,html[dir="rtl"] .row-main>strong,html[dir="rtl"] .trend-row>strong,html[dir="rtl"] .monthly-categories strong{direction:ltr;unicode-bidi:isolate}
html[dir="rtl"] input[type="number"],html[dir="rtl"] input[type="date"],html[dir="rtl"] input[type="month"]{direction:ltr;text-align:right}
.add-actions{display:flex;gap:10px;flex-shrink:0}
.add-actions .add-button{white-space:nowrap}
html[dir="rtl"] .page-heading>div:first-child{min-width:0}
html[dir="rtl"] .trend-row{grid-template-columns:110px 1fr 85px}
@media(max-width:700px){
    html[dir="rtl"] .page-heading{flex-direction:column;align-items:stretch}
    html[dir="rtl"] .page-heading p{max-width:none}
    .add-actions .add-button{flex:1;padding:11px 9px;font-size:13px;min-width:0}
    html[dir="rtl"] .stat>strong{font-size:21px}
    html[dir="rtl"] .monthly>summary span{margin-right:0}
    html[dir="rtl"] .trend-row{grid-template-columns:85px 1fr 75px;gap:10px}
    html[dir="rtl"] .balance{font-size:clamp(28px,10vw,47px);overflow-wrap:anywhere}
}
