/* PeraFlow / Studio edition
   A restrained design language for day-to-day money management.
   Typography: IBM Plex Sans, IBM Plex Mono for ledger numbers.
   No gradients, floating glass cards, neon surfaces, or decorative gimmicks.
*/
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;450;500;600;700&display=swap');
:root{
  --bg:#f7f8f5;
  --panel:#fff;
  --text:#243027;
  --muted:#738078;
  --line:#e2e7df;
  --accent:#285c4b;
  --accent-light:#e8f1eb;
  --red:#b2524e;
  --sidebar:#f9faf7;
  --subtle:#f6f8f5;
  --shadow:none;
  --soft-line:#edf0ea;
  --ink:#1e302a;
  --quiet:#f2f5f0;
  --mono:'IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
}
html{scroll-behavior:smooth}
body{background:var(--bg);color:var(--text);font:400 14px/1.5 'IBM Plex Sans',system-ui,-apple-system,sans-serif;letter-spacing:-.005em}
button,input,select,textarea{font-family:inherit}
button{transition:background-color .13s ease,border-color .13s ease,color .13s ease}
a{transition:color .15s ease}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #4d947a;outline-offset:3px}
::selection{background:#b6d7c6;color:#15271d}
.app-shell{background:var(--bg)}
.sidebar{width:242px;flex-basis:242px;background:var(--sidebar);border-right:1px solid var(--line);padding:24px 12px 15px;color:var(--text);gap:0;box-shadow:none;scrollbar-color:#cbd4cb transparent}
.brand{display:flex;gap:10px;align-items:center;padding:0 10px 22px;font-size:20px;font-family:'IBM Plex Sans',sans-serif;font-weight:700;color:var(--text);letter-spacing:-.85px}
.brand-mark{width:37px;height:37px;background:#294b41;border-radius:9px;display:grid;place-items:center;color:#fff;flex-shrink:0}
.brand-mark svg{width:31px;height:31px}
.brand-text{white-space:nowrap}
.brand small{font:500 9px 'IBM Plex Sans',sans-serif;color:#829087;letter-spacing:1.15px;margin-top:-1px}
.workspace-chip{margin:5px 5px 26px;border:1px solid var(--line);border-radius:8px;box-shadow:0 1px 1px #1e302a08;padding:10px;gap:9px;background:var(--panel)}
.workspace-chip .avatar{width:34px;height:34px;border-radius:6px;background:#dce7de;color:#315c48;font-size:13px;font-weight:700}
.workspace-text b{font-size:12px;color:#303d35;font-weight:700}
.workspace-text small{font-size:11px;color:#89968b;margin-top:2px}
.workspace-chevron{width:17px;height:17px;color:#9aa59d;flex-shrink:0}
.nav-section-title,.nav-section-bottom{font:700 10px 'IBM Plex Sans',sans-serif;letter-spacing:1.18px;color:#99a39b;padding:0 13px;margin:0 0 9px}
.nav-section-title:not(:first-of-type){margin-top:16px}
.nav-section-bottom{margin-top:16px}
.sidebar nav{gap:2px}
.sidebar nav a{gap:12px;min-height:36px;padding:8px 12px;margin:0 0 1px;border-radius:7px;font-size:12.5px;font-weight:500;color:#5e6d63;line-height:1.3}
.sidebar nav a:hover{background:#edf2eb;color:#253e31}
.sidebar nav a.active{background:#e5ede5;color:#225944;font-weight:700}
.sidebar nav a.active::after{content:"";width:4px;height:4px;border-radius:50%;background:#2a684f;margin-left:auto}
.nav-svg{width:17px;height:17px;flex:0 0 17px;opacity:.82}
.sidebar nav a.active .nav-svg{opacity:1}
.sidebar-footer{margin:auto 5px 2px;border:1px solid var(--line);border-radius:8px;background:#f0f3ee;padding:11px 10px;gap:9px}
.sidebar-footer .shield{width:17px;height:17px;display:grid;place-items:center;border-radius:50%;background:#d5e8d7;color:#3e815d;font-size:8px;padding:0}
.sidebar-footer b{font-size:11px;color:#405348;font-weight:600}
.sidebar-footer small{font-size:10.5px;color:#89978c;margin-top:4px}
.main-frame{min-width:0}
.topbar{height:68px;background:var(--panel);border-bottom:1px solid var(--line);padding:0 clamp(22px,3vw,48px)}
.top-left,.top-right{gap:13px}
.breadcrumb{display:flex;align-items:center;gap:11px;color:#929c94;font-size:12px;letter-spacing:0;font-weight:500}
.breadcrumb .breadcrumb-root{color:#858f86}
.breadcrumb svg{height:13px;width:13px;color:#adb6ad}
.breadcrumb strong{font-size:12px;font-weight:600;color:#334139}
.status-pill{background:#f3f6f2;border:1px solid #e5ebe4;padding:7px 10px;color:#607568;border-radius:6px;font-size:11px;font-weight:600;gap:7px}
.live-dot{background:#5a9b74;width:6px;height:6px}
.icon-btn{height:34px;width:34px;background:transparent;border:1px solid var(--line);border-radius:7px;color:#5e6a60;display:grid;place-items:center;font-size:15px}
.icon-btn:hover{background:#f4f6f3;border-color:#ccd7cc}
.top-avatar{width:33px;height:33px;border-radius:9px;background:#e4eee6;color:#3d664e;font-weight:700;font-size:12px}
main{max-width:1550px;margin:0 auto;padding:38px clamp(22px,3vw,50px) 88px}
.page-heading{align-items:center;margin:0 0 28px;gap:22px}
.eyebrow{font:600 10px 'IBM Plex Sans',sans-serif;letter-spacing:1.1px;color:#788a7b;margin:0 0 8px;text-transform:uppercase}
.page-heading h1{font:600 clamp(24px,2.4vw,31px)/1.2 'IBM Plex Sans',sans-serif;letter-spacing:-1.12px;color:var(--text)}
.page-heading p{font-size:13px;color:#78857b;margin-top:9px;line-height:1.5;letter-spacing:0}
.heading-actions{gap:8px;align-items:center}
.btn{border:1px solid #d7dfd6;background:var(--panel);color:#33443a;border-radius:7px;min-height:36px;padding:8px 13px;font-size:12px;font-weight:600;gap:7px;letter-spacing:0;line-height:1.4;box-shadow:none}
.btn:hover{border-color:#a9b9ab;background:#f8faf8}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn.primary:hover{background:#194c3b;border-color:#194c3b}
.btn.soft{color:#2e6550;background:#eef4ef;border-color:#dde8dd}
.btn.soft:hover{background:#e0eee3}
.btn.danger{background:#fff7f5;color:#a34a43;border-color:#edd7d1}
.btn.small{padding:7px 10px;font-size:11px;border-radius:6px}
.icon-text{font-size:14px}
.pill,.pill.gray,.status-pill,.flash,.badge{border-radius:6px;font-size:11px;font-weight:600;letter-spacing:0}
.pill{background:#eaf1eb;color:#446550}
.pill.gray{background:#f1f3f0;color:#68776b}
.pill.red{background:#f9ebe9;color:#a34c49}
.notice{margin-bottom:18px;background:#f5f2e9;border:1px solid #e8e0ca;border-radius:8px;color:#746248;padding:11px 15px;font-size:12px;line-height:1.6}
.notice a,.notice button{color:#6b5b43;text-decoration:underline;text-underline-offset:3px}
.data-hint{background:#edf3ed;border:1px solid #dde8de;border-radius:7px;color:#3d6651;font-size:12px;padding:11px 13px}
.hint{font-size:11px;line-height:1.6;color:#879289}
.banner{background:#eaf0e9;border:1px solid #dae5d9;border-radius:9px;padding:16px 20px;color:#294737}
.banner strong{font:600 13px 'IBM Plex Sans',sans-serif}
.banner p{font-size:12px;color:#688075;margin-top:5px}
.banner .btn{background:#fff;color:#345a46}
.metric-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 18px}
.metric{border:1px solid var(--line);border-radius:10px;box-shadow:none;background:var(--panel);padding:18px 19px;min-height:126px}
.metric-caption{font-size:12px;font-weight:500;color:#6c7c71}
.metric-icon{background:#f0f4ef;color:#4d7b60;height:26px;width:26px;border-radius:7px;font-size:13px}
.metric-icon.blue{background:#edf1f7;color:#6d8399}
.metric-icon.red{background:#f9efed;color:#ba7369}
.metric-icon.purple{background:#f2eff4;color:#8c809d}
.metric-value{font:600 clamp(17px,1.8vw,24px)/1.25 'IBM Plex Sans',sans-serif;letter-spacing:-.7px;margin:16px 0 8px;color:var(--text);font-variant-numeric:tabular-nums}
.metric-desc{font-size:11px;color:#91a096}
.card{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:20px 21px;box-shadow:none}
.section-header{align-items:center;margin-bottom:19px;min-height:20px}
.section-header h2{font:600 14px 'IBM Plex Sans',sans-serif;letter-spacing:-.18px;color:var(--text)}
.section-header small{font-size:11px}
.section-link{color:#2e7256;font-size:12px;font-weight:600}
.section-link:hover{text-decoration:underline;text-underline-offset:3px}
.dashboard-grid{grid-template-columns:minmax(0,1.4fr) minmax(300px,1fr);gap:14px;margin-bottom:14px}
.secondary-grid{grid-template-columns:minmax(0,1.2fr) minmax(280px,1fr);gap:14px}
.chart-legend{font-size:11px;color:#78887b;font-weight:500}
.legend-dot{background:#2f7058;width:7px;height:7px}
.legend-dot.expense{background:#c78d73}
.line-chart{height:228px}
.chart-foot{color:#9da89e;font-size:10px}
.donut-hole strong{font:600 15px 'IBM Plex Sans',sans-serif}
.legend-line{color:#69796d;font-size:11px}
.legend-line b{font-size:11px}
.tx-row{border-color:var(--soft-line);padding:12px 0;gap:11px}
.tx-symbol{background:#f1f4f0;border-radius:7px;width:36px;height:36px;flex-basis:36px;font-size:15px;color:#5a7561}
.tx-details b{font-size:12px;font-weight:600;color:var(--text)}
.tx-details small{font-size:11px;color:#909b91;margin-top:4px}
.tx-amount{font-size:12px;font-weight:600;font-variant-numeric:tabular-nums;color:var(--text)}
.tx-amount.income{color:#278057}
.progress-group{margin:16px 0 18px}
.progress-top{font-size:12px;margin-bottom:8px}
.progress-top b{font-weight:600}
.progress-top span{font-size:11px;color:#7d897f}
.track{height:6px;background:#e9eee8}
.track i{background:#4b9076}
.track i.warning{background:#ca9b4a}
.track i.over{background:#bd6b63}
.filters{display:grid;grid-template-columns:minmax(0,2fr) repeat(2,minmax(0,1fr));align-items:center;gap:8px;margin-bottom:20px}
.filters .search-input{min-width:0;width:100%;height:38px;min-height:38px;padding:8px 11px}
.filters .search-input:first-child{grid-column:span 1}
.filters .btn{justify-self:start}
.search-input,.field input,.field select,.field textarea{background:var(--panel);color:var(--text);border:1px solid #dce4db;border-radius:7px;font-size:12px;padding:9px 11px;min-height:38px;box-shadow:none}
.field{gap:6px}
.field label{font-size:12px;font-weight:600;color:#485b4c}
.field textarea{min-height:80px}
.field input:focus,.field select:focus,.field textarea:focus,.search-input:focus{border-color:#709983;box-shadow:0 0 0 3px #285c4b1a;outline:none}
.data-table{font-size:12px;min-width:650px}
.data-table th{text-transform:uppercase;font-size:10px;font-weight:600;letter-spacing:.85px;color:#88968a;padding:12px 10px;background:#fafbf9;border-block:1px solid var(--line)}
.data-table td{border-color:var(--soft-line);padding:14px 10px;color:#65766a}
.data-table td strong{font-weight:600;color:var(--text)}
.data-table tr:hover td{background:#fafbf9}
.data-table tr:last-child td{border-bottom:none}
.ghost-btn{font-size:14px;color:#8d9990;padding:6px;border-radius:5px}
.ghost-btn:hover{background:#eef2ed;color:#36604d}
.table-actions{text-align:right;min-width:85px}
.table-actions .ghost-btn{margin-left:1px}
.empty{padding:38px 16px;color:#88968a;font-size:12px}
.empty h3{font-weight:600;color:var(--text)}
.empty-icon{color:#adb7ae;font-size:25px}
.account-grid,.card-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.account-tile,.budget-tile{border:1px solid var(--line);background:var(--panel);border-radius:9px;padding:19px;box-shadow:none}
.account-tile .acc-icon{background:#ecf3ed;border-radius:7px;color:#3b7860;width:34px;height:34px;font-size:16px;margin-bottom:17px}
.account-tile h3{font-size:13px;font-weight:600}
.account-tile small{font-size:11px}
.account-tile .amount{font:600 22px/1.25 'IBM Plex Sans',sans-serif;letter-spacing:-.5px;margin-top:13px}
.account-tile .card-actions{margin-top:17px}
.budget-grid{gap:12px}
.budget-tile{padding:19px}
.budget-tile .progress-top b{font-size:13px}
.grocery-layout{grid-template-columns:minmax(0,1.5fr) minmax(280px,.8fr);gap:14px}
.grocery-item{padding:13px 1px;border-color:var(--soft-line)}
.grocery-item b{font-size:12px}
.grocery-item small{font-size:11px}
.grocery-item .grocery-price{font-size:12px}
.grocery-total{background:#f3f6f1;border:1px solid #e5ece1;padding:20px;border-radius:9px}
.grocery-total small{font-size:11px;color:#7b8b7b}
.grocery-total strong{font:600 25px 'IBM Plex Sans',sans-serif;color:#2c4f3e}
.grocery-summary{border-color:#dfe7db;color:#768575}
.grocery-summary b{color:#294938}
.credit-card,.credit-card:nth-child(3n+2),.credit-card:nth-child(3n+3){background:#29473f;border-radius:10px;box-shadow:none;color:#fff;min-height:165px}
.credit-card .cc-top b{font:600 15px 'IBM Plex Sans',sans-serif}
.credit-card .cc-bottom strong{font:600 17px 'IBM Plex Sans',sans-serif}
.card-issuer-tile{border-color:var(--line);border-radius:10px;padding:13px;box-shadow:none}
.card-stats .card-stat{border-color:var(--soft-line)}
.card-stat{font-size:12px;color:#768579}
.card-stat b{font-weight:600}
.art-gallery{gap:12px}
.art-gallery-item{border-radius:9px}
.auth-card-visual,.art-thumbnail{border-radius:9px}
.card-catalog-info{background:#f4f6f1;color:#728072;border:1px solid #e7ebe4;border-radius:7px}
.art-gallery-caption b{font-weight:600}
.report-grid{gap:14px}
.bar-line .bar-label{color:#6c7e70}
.bar-line .bar-track{height:9px;background:#edf1ec}
.bar-line .bar-track i{background:#4b9076}
.settings-grid{gap:14px}
.setting-line{border-color:var(--soft-line)}
.setting-line b,.mini-card strong{font-size:12px;font-weight:600}
.mini-card{border-color:var(--line);border-radius:8px;padding:13px}
.modal-overlay{background:#101d1899;backdrop-filter:blur(1.5px)}
.modal{border-radius:12px;box-shadow:0 22px 70px #14201930;border:1px solid var(--line);padding:25px}
.modal-title{border-bottom:1px solid var(--line);margin:-3px -1px 20px;padding:0 0 17px}
.modal-title h2{font:600 20px 'IBM Plex Sans',sans-serif;letter-spacing:-.45px}
.modal-close{background:#f1f4ef;border-radius:6px;color:#6b776d}
.form-grid{gap:14px}
.form-actions{margin-top:24px}
.type-switch{border-radius:7px;background:#f2f4ef}
.type-switch button{font-size:12px;border-radius:5px}
.type-switch button.active{color:var(--accent)}
.toast{border-radius:8px;background:#243c31;color:#fff;box-shadow:0 8px 25px #263a2c25;font-size:12px}
.split-section{background:#fafbf9;border:1px solid var(--line);border-radius:9px}
.split-total{background:#edf3ed;border:1px solid #dce8dd;border-radius:7px;color:#305b43}
.tx-detail-top{background:#29483b;border-radius:9px}
.tx-detail-top h2{font-family:'IBM Plex Sans',sans-serif;font-weight:600}
.tx-detail-top strong{font-family:'IBM Plex Sans',sans-serif;font-weight:600}
.directory-pager{border-color:var(--line)}
.checkbox-row input,.grocery-item input[type=checkbox]{accent-color:var(--accent)}
/* Overview has an intentional hero-to-ledger hierarchy, not four interchangeable KPI tiles. */
.overview-top{display:grid;grid-template-columns:minmax(0,1.14fr) minmax(0,1fr);gap:14px;margin-bottom:14px}
.overview-hero{background:#29483b;color:#fff;border:1px solid #29483b;border-radius:10px;padding:25px 28px;display:flex;flex-direction:column;min-height:281px;overflow:hidden}
.overview-hero-top{display:flex;justify-content:space-between;align-items:center;gap:12px}
.hero-kicker,.hero-period{font-size:10px;letter-spacing:1.2px;font-weight:600;color:#bed4c5}
.hero-period{color:#a7c2af;font-size:10px;text-transform:uppercase}
.hero-primary-money{margin:13px 0 9px;font:600 clamp(31px,3.4vw,46px)/1.18 'IBM Plex Sans',sans-serif;letter-spacing:-2.1px;font-variant-numeric:tabular-nums;white-space:nowrap}
.hero-under{color:#c3d5c8;font-size:12px;line-height:1.6}
.hero-bottom{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:auto;padding-top:20px;border-top:1px solid #496b58}
.hero-bottom small{font-size:10px;color:#a6c6b0;display:block;margin-bottom:5px;letter-spacing:.1px}
.hero-bottom strong{font-size:14px;font-weight:600;font-variant-numeric:tabular-nums}
.overview-metrics{display:grid;grid-template-rows:repeat(3,1fr);gap:9px}
.overview-metrics .metric{min-height:0;padding:15px 20px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.overview-metrics .metric-caption{font-size:12px;color:#748477;font-weight:600}
.overview-metrics .metric-value{font-size:20px;margin:0;text-align:right;white-space:nowrap;overflow:visible}
.overview-metrics .metric-desc{margin-top:4px;display:block;line-height:1.4;font-size:11px}
.overview-metrics .metric-icon{display:none}
.cashflow-summary{border-left:3px solid #498d68;background:#f0f5ee;border-radius:0 7px 7px 0;padding:9px 13px;margin-bottom:15px;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;color:#536c58}
.cashflow-summary strong{font-weight:600;color:#304a36}
.cashflow-summary.negative{border-left-color:#bc7365;background:#fbf0ec;color:#856c65}
.cashflow-summary.negative strong{color:#884a41}
/* A consistent light and dark appearance, rather than inverting random cards. */
body.dark{
 --bg:#161e1a;
 --panel:#202924;
 --text:#e6eee5;
 --muted:#a1b0a2;
 --line:#39473c;
 --accent:#81b497;
 --accent-light:#2b4032;
 --red:#d98980;
 --sidebar:#1b241f;
 --subtle:#212d25;
 --soft-line:#303d34;
 --quiet:#233328;
 color:var(--text)
}
body.dark .sidebar,body.dark .topbar,body.dark .icon-btn{background:var(--sidebar)}
body.dark .brand{color:#e7efe5}
body.dark .brand-mark{background:#82b59a;color:#1a3525}
body.dark .brand small,body.dark .nav-section-title{color:#8fa496}
body.dark .workspace-chip{background:#263329;border-color:#425043}
body.dark .workspace-chip .avatar{background:#3d5243;color:#d5eadc}
body.dark .workspace-text b,body.dark .sidebar-footer b{color:#dceadd}
body.dark .sidebar nav a{color:#acbcae}
body.dark .sidebar nav a:hover{background:#2a392e;color:#f1f6ef}
body.dark .sidebar nav a.active{background:#314b3a;color:#d9f3df}
body.dark .sidebar-footer{background:#25342a;border-color:#405444}
body.dark .top-avatar{background:#345343;color:#c0e4cb}
body.dark .breadcrumb strong,body.dark .page-heading h1,body.dark .section-header h2{color:#ecf2ea}
body.dark .status-pill,body.dark .pill.gray{background:#2c3830;border-color:#3a4d3f;color:#b2c5b7}
body.dark .btn{background:#28362d;color:#d6e9dc;border-color:#4a5b4d}
body.dark .btn.primary{background:#73a78a;border-color:#73a78a;color:#142c1e}
body.dark .btn.soft{background:#284735;color:#bce1c8}
body.dark .metric-value,body.dark .account-tile .amount,body.dark .data-table td strong{color:#eff5ee}
body.dark .metric-icon,body.dark .tx-symbol{background:#2b3b30;color:#aed0b6}
body.dark .data-table th,body.dark .data-table tr:hover td{background:#222e26;color:#9eb2a2}
body.dark .cashflow-summary{background:#2d4433;color:#bbd0bd}
body.dark .cashflow-summary strong{color:#d9f2df}
body.dark .cashflow-summary.negative{background:#533b35;color:#e5b4aa}
body.dark .cashflow-summary.negative strong{color:#f8ded9}
body.dark .overview-hero{background:#335742;border-color:#466952}
body.dark .hero-bottom{border-top-color:#5b7965}
body.dark .grocery-total,body.dark .card-catalog-info{background:#293b2e;border-color:#425444;color:#bed2c2}
body.dark .grocery-total strong{color:#d9f1e0}
body.dark .field input,body.dark .field select,body.dark .field textarea,body.dark .search-input{background:#27342a;border-color:#465747;color:#e3ede4}
body.dark .modal,body.dark .card,body.dark .metric,body.dark .account-tile{background:var(--panel)}
body.dark .modal-close{background:#33453a;color:#d9e5d9}
body.dark .split-section{background:#253329}
body.dark .notice{background:#3a362a;border-color:#574f38;color:#d9ccb2}
body.dark .notice a{color:#ead7b5}
body.dark .data-hint{background:#2a4132;color:#bed8c3;border-color:#3d5d45}
body.dark .track,body.dark .bar-line .bar-track{background:#354638}
body.dark .pill{background:#2b4032;color:#cae3cf}
body.dark .mini-card{background:#253329}
body.dark .card-stat b,body.dark .tx-details b{color:#e2ebe2}
body.dark .auth-card-visual,body.dark .art-thumbnail{background:#314039}
body.dark .sidebar-footer .shield{background:#38624a}
body.dark .credit-card{background:#365545}
body.dark .split-total{background:#2b4632;color:#bfe2c3;border-color:#47664b}
@media (min-width:1440px){
 .filters{grid-template-columns:minmax(0,2fr) repeat(3,minmax(0,1fr))}
 .overview-hero{min-height:300px}
}
@media (max-width:1300px){
 .sidebar{width:232px;flex-basis:232px}
 .metric-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
 .overview-top{grid-template-columns:minmax(0,1fr) minmax(0,.87fr)}
 .metric-value{font-size:21px}
 .card-grid,.account-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:1100px){
 .overview-top{grid-template-columns:1fr}
 .overview-hero{min-height:235px}
 .overview-metrics{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:auto;gap:10px}
 .overview-metrics .metric{display:block;padding:16px;min-height:116px}
 .overview-metrics .metric-value{font-size:18px;margin-top:12px;text-align:left}
 .dashboard-grid,.secondary-grid{grid-template-columns:minmax(0,1fr)}
 .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:980px){
 .sidebar{width:242px;flex-basis:242px;box-shadow:5px 0 30px #18271c21;transform:translateX(-102%)}
 .sidebar.open{transform:translateX(0)}
 .menu-btn{display:grid}
 main{padding:28px 24px 90px}
 .topbar{padding:0 24px}
 .dashboard-grid{grid-template-columns:1fr}
 .grocery-layout{grid-template-columns:1fr}
}
@media(max-width:640px){
 .topbar{height:60px;padding:0 17px}
 .status-pill{display:none}
 .top-avatar{display:grid;width:30px;height:30px}
 .breadcrumb{font-size:11px;gap:7px}
 main{padding:25px 15px 104px}
 .page-heading{display:flex;align-items:flex-start;gap:15px;margin-bottom:21px;flex-wrap:wrap}
 .page-heading h1{font-size:25px;letter-spacing:-.8px}
 .page-heading p{font-size:12px;line-height:1.5;margin-top:7px}
 .page-heading .heading-actions{width:100%;justify-content:flex-start}
 .page-heading .heading-actions .btn.primary{flex:1}
 .btn{min-height:37px}
 .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .metric{padding:14px;min-height:117px}
 .metric-value{font-size:18px;margin:12px 0 5px}
 .metric-caption{font-size:11px}
 .card{padding:17px}
 .overview-hero{padding:23px 22px;min-height:235px}
 .hero-primary-money{font-size:34px;letter-spacing:-1.3px}
 .overview-metrics{grid-template-columns:1fr 1fr;gap:9px}
 .overview-metrics .metric{min-height:105px}
 .overview-metrics .metric:first-child{grid-column:1/-1}
 .overview-metrics .metric-value{font-size:19px}
 .hero-bottom{gap:10px}
 .hero-bottom strong{font-size:13px}
 .cashflow-summary{align-items:flex-start;flex-direction:column;gap:4px}
 .dashboard-grid,.secondary-grid,.grocery-layout,.report-grid,.settings-grid,.budget-grid,.two-col{grid-template-columns:1fr;gap:12px}
 .filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:13px}
 .filters #tx-search{grid-column:1/-1}
 .filters .search-input{height:38px;min-height:38px;padding:8px 9px;font-size:11px}
 .filters .btn{grid-column:1/-1;justify-self:start}
 .account-grid,.card-grid{grid-template-columns:1fr}
 .data-table{min-width:660px}
 .form-grid{grid-template-columns:1fr}
 .mobile-tabs{display:grid;grid-template-columns:repeat(5,1fr);background:var(--panel);border-top:1px solid var(--line);box-shadow:0 -4px 20px #2031260c;padding:9px 5px calc(8px + env(safe-area-inset-bottom))}
 .mobile-tabs a,.mobile-tabs button{font-size:10px;gap:4px;font-weight:500;color:#819084}
 .mobile-tabs svg{width:18px;height:18px}
 .mobile-tabs a.active{color:var(--accent);font-weight:700}
 .mobile-tabs button{position:relative;color:#4c6155}
 .mobile-tabs button svg{width:40px;height:39px;padding:10px;background:#2f6650;color:#fff;border-radius:9px;position:relative;margin-top:-19px;box-shadow:0 3px 8px #163a2830}
 .mobile-tabs button span{font:600 10px 'IBM Plex Sans',sans-serif;margin-top:0;width:auto;height:auto;background:none;border-radius:0;box-shadow:none;color:#5b7060}
 .donut-wrap{flex-direction:row;gap:10px}
 .donut{width:144px;height:144px}
 .donut-hole{width:102px;height:102px}
 .legend-line{font-size:10px}
 .modal{padding:19px}
 .modal-title{margin-bottom:17px}
 .modal-title h2{font-size:18px}
 #toast-root{bottom:88px}
}
@media (max-width:385px){
 .overview-metrics{grid-template-columns:1fr}
 .overview-metrics .metric:first-child{grid-column:auto}
 .overview-hero{padding:20px 18px}
 .hero-primary-money{font-size:29px}
 .donut-wrap{flex-direction:column}
 .topbar{padding:0 13px}
 .page-heading h1{font-size:23px}
}
@media(prefers-reduced-motion:reduce){
 *,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important}
}

/* Last-mile refinements after browser review */
.menu-btn{display:none}
.sidebar{overflow-x:hidden}
.brand{min-width:0}
.brand-text{min-width:0;overflow:hidden;text-overflow:ellipsis}
.brand small{letter-spacing:.95px}
.table-actions .ghost-btn{height:29px;width:29px;display:inline-flex;align-items:center;justify-content:center}
.table-actions .ghost-btn svg{height:15px;width:15px;display:block}
.tx-symbol svg,.acc-icon svg{height:19px;width:19px;display:block}
.ghost-btn svg{pointer-events:none}
@media(max-width:980px){.menu-btn{display:grid}}
@media(max-width:640px){.top-avatar{display:grid}.menu-btn{display:grid}}

@media(max-width:640px){
 .filters .search-input{grid-column:auto;min-width:0}
 .filters #tx-search{grid-column:1/-1}
 .table-scroll-hint{display:flex}
}
.table-scroll-hint{display:none;align-items:center;justify-content:flex-end;gap:6px;margin:-4px 0 9px;color:#849186;font-size:10px;font-weight:500}

/* Small-screen table affordance */
.table-scroll-hint{display:none}
@media(max-width:640px){.table-scroll-hint{display:flex}}
.modal-open{overflow:hidden}
.modal-overlay .modal{overscroll-behavior:contain}

body.dark .section-link{color:#a7d1b5}
body.dark .section-link:hover{color:#c5e5ce}
body.dark .page-heading p{color:#aebbb0}
body.dark .metric-desc,body.dark .tx-details small,body.dark .hint{color:#a0afa2}
body.dark .eyebrow{color:#9aad9e}

/* Financial transaction funding and source matching */
.payment-line-labels,.payment-line{display:grid;grid-template-columns:minmax(140px,1.4fr) minmax(100px,.8fr) 30px;gap:9px;align-items:center}
.payment-line-labels{font-size:10px;color:var(--muted);font-weight:600;letter-spacing:.03em;margin-bottom:7px}
.payment-line{margin:0 0 9px}
.payment-line .search-input{width:100%;min-width:0;height:39px;min-height:39px}
.payment-line .ghost-btn{font-size:18px;height:34px;width:30px;display:grid;place-items:center}
#payment-choice .checkbox-row{display:flex;align-items:center;gap:10px;color:var(--text);font-size:12px;font-weight:700;justify-content:flex-start}
#payment-choice .checkbox-row input[type=checkbox]{width:17px;height:17px;min-width:17px;max-width:17px;flex:0 0 17px;margin:0;padding:0;accent-color:var(--accent)}
#payment-details[hidden],#payment-choice[hidden],#transfer-fees[hidden]{display:none}
#payment-details{margin:0 0 12px}
#bank-import-preview .data-table select{width:100%;min-width:225px;max-width:460px}
#bank-import-preview .data-table{min-width:860px}
@media(max-width:640px){.payment-line-labels{display:none}.payment-line{grid-template-columns:minmax(0,1fr) minmax(90px,.65fr) 26px;gap:6px}.payment-line .search-input{font-size:11px;padding:8px 5px}#bank-import-preview .data-table{min-width:820px}}

/* Phase 2 finance workspace */
.phase2-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.phase2-record{min-width:0}
.phase2-record .table-wrap{margin-top:15px}
.phase2-record .data-table{min-width:570px}
.phase2-record .section-header{gap:10px;align-items:flex-start}
.phase2-record .section-header h2{line-height:1.3;overflow-wrap:anywhere}
.phase2-record .card-stat{padding:9px 0}
.phase2-record .heading-actions{flex-wrap:wrap}
.phase2-record .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.phase2-record .metric{min-height:100px}
.phase2-record .metric-value{font-size:19px}
.phase2-list>.card{align-self:start}
@media(max-width:1200px){.phase2-list{grid-template-columns:1fr}.phase2-record .metric-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:640px){.phase2-list{gap:12px}.phase2-record{padding:16px}.phase2-record .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.phase2-record .metric{min-height:95px;padding:12px}.phase2-record .metric-value{font-size:16px}.phase2-record .card-stat{gap:10px}.phase2-record .card-stat b{max-width:52%;text-align:right;overflow-wrap:anywhere}}

/* Phase 3: shared household money and grocery intelligence */
.household-members{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:24px}
.household-share{padding:15px 0 17px;border-top:1px solid var(--soft-line)}
.household-share:first-of-type{border-top:0;padding-top:4px}
.household-share .section-header{margin-bottom:7px}
.household-share .section-header h2{font-size:13px;overflow-wrap:anywhere}
.household-share .section-header small{font-size:11px;color:var(--muted)}
.household-share .card-stat{padding:8px 0}
.household-share .heading-actions{margin-top:10px;flex-wrap:wrap}
.household-controls{display:flex;gap:9px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
#household-share-lines{display:grid;gap:8px}
#household-share-lines .payment-line{margin:0}
#household-share-summary{margin-top:12px;font-weight:600}
#price-product-select,#price-unit-select{width:100%;margin-bottom:10px}
.phase2-list>.card{min-width:0}
@media(max-width:640px){
.household-members{grid-template-columns:1fr}
.household-share .section-header{align-items:flex-start}
.household-share .card-stat{align-items:flex-start}
.household-controls{max-width:53%}
#household-share-lines .payment-line{grid-template-columns:minmax(0,1fr) minmax(92px,.6fr) 26px;gap:7px}
}

.preview-banner{padding:9px 18px;text-align:center;background:#e8eee7;color:#435f4a;border-bottom:1px solid #d8e2d7;font-size:11px;line-height:1.6}.preview-banner strong{font-weight:700}body.dark .preview-banner{background:#2a3e31;color:#c6decc;border-color:#405646}@media(max-width:640px){.preview-banner{padding:8px 12px;font-size:10px}}

.preview-banner{background:#eef2e6;color:#4b644b}body.dark .preview-banner{background:#293c2f;color:#c8e0cb}
