:root{--brown:#54210e;--deep:#32110b;--gold:#ffcc52;--line:#e6d5c8;--paper:#fffaf6;--ink:#25130e;--shadow:0 4px 9px #54210e16;--gradient:linear-gradient(145deg,#a45722 0%,#71350f 62%,#451c0b)}
body{background:radial-gradient(ellipse at 50% 100%,#f9eee3,transparent 65%),#fcf8f5;color:var(--ink);font-family:"Segoe UI",system-ui,sans-serif}
header{position:relative;display:grid;grid-template-columns:42px auto auto 42px;justify-content:center;align-items:center;gap:10px;min-height:76px;padding:8px 10px 9px;border-radius:0 0 17px 17px;background:radial-gradient(ellipse at 35% -70%,#8a451c 0,transparent 68%),linear-gradient(110deg,#502013,#290d08);box-shadow:0 10px 24px #49210d55}
header img{width:58px;height:58px;object-fit:contain;filter:drop-shadow(0 3px 2px #130704)}
header strong{font-size:clamp(12px,4vw,25px);font-weight:850;letter-spacing:.015em;line-height:1.05}
header small{display:flex;align-items:center;gap:7px;color:#ffd152;font-size:clamp(8px,2.35vw,13px);letter-spacing:.18em;font-weight:800;margin-top:6px}
header small::before,header small::after{content:"";width:clamp(8px,4vw,24px);height:1px;background:#ffce55}
header .header-button{width:42px;min-width:0;min-height:42px;padding:0;background:none;box-shadow:none;color:#fff9f2;font-size:25px;border:0}
header .header-button svg{width:21px;height:21px}
#appMenu{position:absolute;z-index:6;top:67px;left:12px;padding:8px;background:var(--paper);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:14px}
#appMenu button{display:flex;gap:8px;align-items:center;background:none;color:var(--ink);width:100%}
#appMenu svg{width:18px;height:18px}
main{max-width:760px;padding:14px 12px 112px}
main[data-screen=reports]{max-width:1180px}
main[data-screen=export],main[data-screen=settings]{max-width:760px}
h1,h2,h3,p{margin:0}
h1{font-size:clamp(20px,5vw,33px);font-weight:850;letter-spacing:-.035em;line-height:1.1}
h2{font-size:clamp(15px,4vw,21px);line-height:1.15;font-weight:820}
h3{font-size:15px;font-weight:800}
.page-title,.stage-heading{display:flex;gap:12px;align-items:center;margin:6px 0 14px}
.page-title p,.stage-heading p{font-size:clamp(11px,3.2vw,15px);color:#4b3830;margin-top:4px}
.tile-icon{display:grid;place-items:center;flex:none;width:48px;height:47px;border-radius:14px;background:var(--gradient);color:#fffdf9;box-shadow:inset 0 1px #ffc4815e}
.tile-icon svg{width:26px;height:26px}
.page-title .tile-icon{width:52px;height:52px}
.calendar-center,.date-controls{display:flex;justify-content:center;align-items:center;gap:9px;margin:1px 0 13px}
.date-pill{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:43px;padding:8px 14px;background:#fffcf9;border:1px solid #e9d9ce;border-radius:20px;color:var(--ink);box-shadow:var(--shadow);font-size:14px;font-weight:800;margin:0;white-space:nowrap}
.date-pill svg{width:20px;height:20px}
.date-pill input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;margin:0}
.date-pill input::-webkit-calendar-picker-indicator{position:absolute;inset:0;width:auto;height:auto;margin:0;cursor:pointer}
.date-pill:focus-within{outline:2px solid #a65423}
.date-pill:has(input[type=number]):focus-within input{opacity:1;background:white}
.round-button{border-radius:50%;width:42px;min-height:42px;padding:0;background:#fffcf9;border:1px solid var(--line);box-shadow:var(--shadow);color:var(--ink);font-size:24px}
.stage-list,.link-list,.settings-list{display:grid;gap:8px;margin-bottom:12px}
button.stage-card,button.link-card{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:linear-gradient(115deg,#fffcfa,#fbf2ea);color:var(--ink);border:1px solid var(--line);border-radius:14px;padding:9px;box-shadow:var(--shadow);font-weight:600}
.stage-card .tile-icon{width:42px;height:42px;border-radius:11px}
.stage-card .tile-icon svg{width:24px;height:24px}
.stage-copy{flex:1;min-width:0}
.stage-copy strong,.link-card strong,.setting-label strong{display:block;font-size:clamp(12px,3.6vw,19px);font-weight:850;line-height:1.13}
.stage-copy small,.link-card small,.setting-label small{display:block;line-height:1.2;margin-top:3px;font-size:clamp(10px,2.65vw,13px);color:#513c33}
.stage-result{padding-left:8px;border-left:1px solid var(--line);min-width:76px}
.stage-result small{display:block;line-height:1.15;font-size:10px;color:#442c20}
.stage-result b{font-size:clamp(13px,3.7vw,21px);white-space:nowrap}
.result-2 b,.red{color:#bb251e}.result-4 b,.green{color:#216b0a}
.edit-stage{background:#f8eadc;border:1px solid var(--line);border-radius:8px;display:grid;place-items:center;width:27px;height:27px;flex:none}
.edit-stage svg{width:15px;height:15px}
.stage-check,.stage-bar button>span{width:22px;height:22px;display:grid;place-items:center;flex:none;border-radius:50%;background:#eaddd3;color:#73442b;font-weight:900}
.stage-check.checked,.stage-bar button>span.checked{color:white;background:linear-gradient(#438e16,#176608)}
button.primary-action{display:flex;align-items:center;justify-content:center;gap:10px;min-height:50px;margin:12px 0;border-radius:13px;font-size:clamp(14px,4vw,19px);font-weight:850;background:linear-gradient(115deg,#713715,#391408);box-shadow:inset 0 1px #ce905e70}
.primary-action svg{width:20px;height:20px}
.design-box{background:#fffcf9;border:1px solid var(--line);border-radius:15px;overflow:hidden;box-shadow:var(--shadow);margin:0 0 12px;min-width:0}
.box-band{display:flex;align-items:center;gap:8px;background:var(--gradient);color:#fffaf4;padding:10px 12px}
.box-band svg,.expense-block h3 svg{width:21px;height:21px;flex:none}
.box-inner{padding:10px}
.stage-heading{padding:12px 11px;background:#fcf0e4;border-bottom:1px solid var(--line);margin:0}
.stage-detail .box-inner{padding:12px}
.entry-grid,.review-grid,.report-pair,.report-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.entry-grid{margin:3px 0 8px}
.stage-bar{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;padding:6px;border:1px solid var(--line);border-radius:14px;background:#fffaf5;box-shadow:var(--shadow);margin:10px 0}
.stage-bar button{display:grid;justify-items:center;align-content:center;gap:5px;background:transparent;color:var(--ink);padding:6px 1px;font-size:clamp(9px,2.65vw,13px);white-space:nowrap}
.stage-bar button.current{background:#fae9c9;color:#502510}
.stage-bar button.current>span:not(.checked){background:#683010;color:white}
.total-band{display:flex;align-items:center;justify-content:space-between;gap:7px;padding:10px;border-radius:10px;font-weight:800;margin-top:8px}
.total-band strong{white-space:nowrap;font-size:clamp(14px,4vw,20px)}
.gold{background:#fff0d0}.sage{background:#eaf5df;color:#215d13}.rose,.negative{background:#fce8e4;color:#a9261d}.lilac{background:#f3e6fb;color:#54297d}.blue{background:#e5f2fc;color:#164e7d}
.profit-overview{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:stretch}
.profit-main{display:flex;gap:8px;align-items:center;min-width:0;padding:10px;background:#ebf7e1;border-radius:12px;color:#1d640d}
.negative .profit-main{background:#fbe5df;color:#a9261d}
.profit-main>span svg{width:22px;height:22px}
.profit-main small,.profit-main strong,.profit-details span>strong{display:block}
.profit-main strong{font-size:clamp(16px,4.7vw,31px);overflow-wrap:anywhere}
.profit-details{font-size:clamp(9px,2.7vw,14px);padding-left:8px;border-left:1px solid var(--line)}
.profit-details>div{display:flex;justify-content:space-between;gap:6px;align-items:center;padding:4px 0}
.profit-details>div+div{border-top:1px solid var(--line)}
.profit-details b,.gas-price,.last-backup{background:#e5f4d8;color:#246b13;border-radius:8px;padding:4px 6px;white-space:nowrap}
.overview-totals{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-bottom:8px}
.value-card{display:flex;gap:7px;align-items:center;min-width:0;padding:10px 8px;border-radius:12px;border:1px solid #552c1710}
.value-card small{display:block;font-size:clamp(9px,2.7vw,14px);font-weight:750;color:#362016;line-height:1.1}
.value-card strong{display:block;font-size:clamp(13px,3.7vw,21px);line-height:1.14;overflow-wrap:anywhere;margin-top:3px}
.value-icon svg{width:23px;height:23px}
.overview-totals .value-icon{display:none}
.formula{display:flex;align-items:stretch;justify-content:space-between;gap:4px;text-align:center;font-size:clamp(8px,2.45vw,13px)}
.formula span{display:grid;place-content:center;min-width:0;padding:5px 3px;border-radius:8px}
.formula b{display:block;overflow-wrap:anywhere}
.formula i{align-self:center;font-size:16px;font-style:normal}
.green-band .box-band{background:#e5f3d8;color:#215713}
.expense-block{padding:8px;border:1px solid var(--line);border-radius:11px;margin-bottom:9px}
.expense-block h3{display:flex;align-items:center;gap:6px;padding:7px;background:#f8ece0;border-radius:8px;margin-bottom:4px}
.expense-block h3 small{margin-left:auto}
.fixed-row,.icon-field{display:grid;grid-template-columns:26px minmax(0,1fr) auto;gap:7px;align-items:center;padding:7px 2px}
.fixed-row+.fixed-row{border-top:1px solid var(--line)}
.fixed-row small,.icon-field small{display:block;font-size:11px}
.fixed-row strong{padding:5px;background:#eaf4df;border-radius:7px;font-size:13px;white-space:nowrap}
.field-emblem{color:#853e18}.field-emblem svg{width:22px;height:22px}.cash .field-emblem{color:#367b20}.upi .field-emblem{color:#68329d}
.icon-field{padding:8px;background:#fff8f1;border:1px solid var(--line);border-radius:10px;margin-bottom:8px}
.amount-field{display:flex;align-items:center;gap:4px;margin:0;padding:0 5px;background:#fff;border:1px solid var(--line);border-radius:8px;max-width:126px}
.amount-field input{min-width:0;border:0;background:transparent;padding:3px;min-height:40px}
.entry-note,.empty-note{padding:9px;color:#614539}
.track-row{padding:2px 0;border-bottom:1px solid var(--line)}
.segment{display:flex;gap:4px;padding:4px;border:1px solid var(--line);border-radius:13px;background:#fbf0e6;box-shadow:var(--shadow);margin-bottom:10px}
.segment button{flex:1;min-width:0;background:transparent;color:var(--ink);padding:5px 1px;font-size:clamp(10px,3.1vw,14px);font-weight:800;white-space:nowrap}
.segment button.chosen{background:var(--gradient);color:white}
.periods button{display:grid;justify-items:center;align-content:center;gap:4px;min-height:50px}
.periods svg{width:19px;height:19px}
.report-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.quick-exports{display:flex;gap:4px}
.quick-exports button{padding:6px 8px;font-size:11px}
.report-hero{display:flex;align-items:center;justify-content:space-between;gap:8px;border-radius:15px;background:radial-gradient(ellipse at 2% 100%,#9d541f 0,transparent 68%),linear-gradient(120deg,#8d461e,#421908);color:white;padding:13px;margin-bottom:10px;box-shadow:var(--shadow)}
.report-hero small,.report-hero span,.report-hero strong,.report-hero aside b{display:block}
.report-hero small{color:#ffedce;font-weight:750;margin-bottom:5px}
.report-hero strong{color:#a9ec82;font-size:clamp(22px,6vw,40px);line-height:1.12}
.report-hero strong.negative{background:none;color:#ffb5a9}
.report-hero aside{text-align:center;border:1px solid #f6c18b88;border-radius:11px;padding:6px;font-size:11px}
.report-hero aside b{background:#286c0a;padding:3px 7px;border-radius:7px;font-size:15px;margin-top:3px}
.report-metrics{margin-bottom:12px}
.report-pair .design-box{margin-bottom:0}
.report-pair{margin-bottom:10px}
.trend-chart{display:block;width:100%;height:auto}
.trend-chart text{font-size:14px;fill:#50372a}
.chart-legend{display:flex;justify-content:flex-end;gap:10px;font-size:11px;font-weight:800}
.chart-legend span:first-child{color:#236dc5}.chart-legend span:last-child{color:#307915}
.cost-layout{display:grid;grid-template-columns:minmax(85px,1fr) 2fr;gap:8px;align-items:center}
.cost-donut{width:100%;aspect-ratio:1;max-width:160px;border-radius:50%;display:grid;place-items:center;justify-self:center}
.cost-donut span{width:73%;aspect-ratio:1;border-radius:50%;background:#fffaf5;display:grid;place-content:center;text-align:center}
.cost-donut strong{font-size:clamp(9px,2.9vw,15px);overflow-wrap:anywhere}
.cost-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:4px}
.table-scroll{overflow:auto}
table{width:100%;border-collapse:collapse;font-size:12px;text-align:right;white-space:nowrap}
th,td{padding:6px;border-bottom:1px solid var(--line)}
thead{background:#f9eadb}
tr th:first-child{text-align:left}
td button{min-height:32px;padding:3px 6px}
.export-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;margin:6px 0 12px;border:1px solid var(--line);padding:6px;border-radius:11px}
.export-options label{display:flex;align-items:center;gap:5px;min-height:33px;margin:0;padding:3px;border-radius:6px;font-size:clamp(10px,2.8vw,14px);font-weight:730}
.export-options input{accent-color:#238311;width:16px;height:16px;flex:none}
.export-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.export-buttons button{display:flex;justify-content:center;align-items:center;text-align:left;gap:6px;font-size:clamp(11px,3.2vw,16px);min-height:50px}
.export-buttons button svg{width:21px;height:21px}
.export-buttons small{display:block;color:white}
button.exportexcel{background:linear-gradient(#40a728,#0a6506);color:white}
button.exportpdf{background:linear-gradient(#fb6054,#ba1218);color:white}
.link-card>span:nth-child(2),.setting-label{flex:1;min-width:0}
.link-card .tile-icon{width:42px;height:42px}.sheet-link .tile-icon{background:#159843}.backup-link .tile-icon{background:#147ed4}.restore-link .tile-icon{background:#7654ae}
.link-card>b{font-size:20px}.link-card .last-backup{font-size:9px;text-align:center;white-space:normal}
.setting-card{margin:0;border:1px solid var(--line);border-radius:13px;background:#fffcf9;box-shadow:var(--shadow)}
.setting-card summary{padding:8px;gap:9px;min-height:59px}
.setting-card .tile-icon{width:39px;height:39px;border-radius:11px}
.setting-card .tile-icon svg{width:22px;height:22px}
.shop-card{background:#edf7e1}
#connection{padding:0;margin:0 0 8px;max-width:none}
#connection[hidden]{display:none}
nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;left:50%;right:auto;transform:translateX(-50%);width:min(100% - 14px,760px);bottom:max(6px,env(safe-area-inset-bottom));padding:4px;background:#fff9f3;border:1px solid var(--line);border-radius:15px;box-shadow:0 3px 14px #54210e36}
nav button{display:grid;align-content:center;justify-items:center;gap:4px;background:#fbf0e7;border:1px solid #ecdbcf;color:#32190d;padding:4px 0;border-radius:10px;min-height:48px;font-size:11px}
nav button svg{width:21px;height:21px;margin:0}
nav button.active{background:var(--gradient);color:white;border-color:#8e461a}
nav button.active svg{color:#ffcc40}
@media(max-width:670px){.report-pair{grid-template-columns:1fr}}
@media(max-width:375px){header{grid-template-columns:34px auto minmax(0,1fr) 34px;gap:5px}header .header-button{width:34px}.stage-card .edit-stage{display:none}.stage-card{gap:7px!important}.stage-card .tile-icon{width:36px;height:36px}.stage-result{min-width:66px}.value-icon svg{width:18px;height:18px}.icon-field{grid-template-columns:20px minmax(0,1fr) minmax(74px,95px)}}
@media(min-width:800px){main[data-screen=today],main[data-screen=export],main[data-screen=settings]{max-width:820px}.report-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.stage-card .tile-icon{width:52px;height:52px}.stage-card .stage-result{min-width:157px}.stage-list button.stage-card{padding:10px 15px;gap:14px}.box-inner{padding:13px}.stage-card .edit-stage{width:32px;height:32px}.report-pair{gap:12px}}
nav{grid-template-columns:repeat(5,minmax(0,1fr))}
nav button span{font-size:11px;line-height:1.12;font-weight:750}
nav button{min-width:0;overflow:hidden}
.rank-number{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#f2e5d7;font-weight:850}
.red-band .box-band{background:#fce1d9;color:#9a291b}
.day-rankings{grid-template-columns:repeat(2,minmax(0,1fr))}
.day-rankings .row{gap:4px;font-size:clamp(9px,2.8vw,14px)}
.day-rankings .rank-number{width:16px;height:16px}
@media(min-width:800px){.year-metrics{grid-template-columns:repeat(4,minmax(0,1fr))}}
.save-strip{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin:0 0 10px;padding:4px 9px;background:#fff9f1;border:1px solid var(--line);border-radius:10px;font-size:12px;font-weight:700}
.save-strip button{background:transparent;color:#71350f;padding:5px;min-height:36px}
.coverage{margin:0 0 10px;color:#614539;font-size:12px}
