:root{--bg:#f6f7f9;--surface:#fff;--ink:#202b39;--muted:#596777;--green:#18846b;--green-dark:#146953;--tint:#eaf5f0;--line:#dce3e8;--radius:14px;--sidebar:232px;--editor:408px;color-scheme:light;font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;background:var(--bg);color:var(--ink)}button,input,select,summary{font:inherit}button,select,summary{cursor:pointer}button{transition:background .16s ease-out,color .16s ease-out}button:disabled{opacity:.6;cursor:wait}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,a:focus-visible{outline:3px solid #18846b77;outline-offset:3px}::selection{background:#c1e8dc;color:#173a30}input{caret-color:var(--green)}input::placeholder{color:#626f7d}*{scrollbar-color:#a6bbb4 var(--bg);scrollbar-width:thin}a{color:var(--green-dark);text-underline-offset:3px}svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}h1,h2,p{margin:0}h1{font-size:32px;line-height:1.2;letter-spacing:-.035em;font-weight:750}h2{font-size:19px;line-height:1.3;letter-spacing:-.02em}p{color:var(--muted);margin-top:10px;max-width:70ch}small{font-size:13px}.brand{display:flex;gap:7px;align-items:center;font-size:25px;font-weight:780;letter-spacing:-.04em;color:var(--ink);text-decoration:none;white-space:nowrap}.brand svg{color:var(--green);width:25px;height:25px}#sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar);padding:32px 20px;background:var(--surface);border-right:1px solid var(--line);display:flex;flex-direction:column;z-index:10}nav{display:grid;gap:8px;margin-top:42px}nav button{display:flex;gap:15px;align-items:center;border:0;background:none;text-align:left;padding:14px 16px;border-radius:9px;color:var(--muted);min-height:50px;font-weight:600}nav button:hover{background:#f1f5f3}nav button.active{color:var(--green-dark);background:var(--tint)}.profile{margin-top:auto;display:flex;align-items:center;gap:9px;border:0;background:none;text-align:left;min-width:0;padding:10px 0}.profile strong{display:block;font-size:13px}.profile small{display:block;color:var(--muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;max-width:150px}.avatar{display:grid;place-items:center;background:var(--tint);color:var(--green-dark);border-radius:50%;width:34px;height:34px;flex-shrink:0}main{margin-left:var(--sidebar);padding:36px;max-width:1650px;transition:none}body.editor-open main{margin-right:var(--editor)}.page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:24px}.page-header p{font-size:14px}.period{display:flex;gap:8px;align-items:center;flex-shrink:0}.period input{width:168px}.period select{width:80px}.period input,.period select,.home-tools select{background:white;border:1px solid var(--line);padding:10px;border-radius:8px;min-height:44px;color:var(--ink)}.home-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:16px}.home-tools select{max-width:240px;font-weight:600}.home-tools span{font-size:13px;color:var(--muted)}.page-actions{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:22px}.page-actions span{font-size:13px;color:var(--muted)}.primary,.ghost,.text-button,.icon-button{border-radius:8px;min-height:44px;padding:11px 17px;font-weight:600;border:1px solid transparent}.primary{background:var(--green);color:white;border:0}.primary:hover{background:var(--green-dark)}.ghost{background:white;border-color:var(--line);color:var(--ink)}.ghost:hover{background:#f1f5f3}.text-button{background:none;color:var(--green-dark);padding:8px 10px;font-size:13px}.text-button:hover{background:var(--tint)}.icon-button{background:none;color:var(--muted);font-size:27px;line-height:1;padding:4px 12px}.danger{color:#a82f3a}.danger:hover{background:#fff0f0}.cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:24px}.card{background:white;border:1px solid var(--line);border-radius:var(--radius);padding:20px}.card:first-child,.card:last-child{background:#f0f8f5}.card small{color:var(--muted);font-size:14px}.value{font-size:clamp(23px,2.1vw,32px);font-weight:750;letter-spacing:-.03em;line-height:1.25;margin:7px 0;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.card:first-child .value,.card:last-child .value{color:var(--green-dark)}.hint{font-size:12px;color:var(--muted)}.panel{border:1px solid var(--line);border-radius:var(--radius);background:white;padding:22px;margin-bottom:22px}.panel-head{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:15px}.list-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.search{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:8px;padding:0 12px;max-width:330px;flex:1;color:var(--muted);margin:0}.search input{border:0;min-width:0;width:100%;padding:11px 0;background:none}.search svg{width:18px;height:18px}#resultCount{font-size:12px;color:var(--muted);white-space:nowrap}table{width:100%;border-collapse:collapse;table-layout:fixed}th{font-size:12px;text-align:left;font-weight:500;color:var(--muted);padding:12px 8px;border-bottom:1px solid var(--line)}th:nth-child(1){width:35%}th:nth-child(2){width:28%}th:nth-child(3){width:25%}th:nth-child(4){width:12%}td{padding:16px 8px;border-bottom:1px solid #edf0f3;font-size:13px;vertical-align:middle;overflow-wrap:anywhere}tr:last-child td{border:0}.movement-name{display:flex;gap:9px;align-items:flex-start}.movement-name .emoji{font-size:20px;line-height:1.4}.movement-name strong{display:block;font-weight:600}.movement-name small,td small{display:block;color:var(--muted);font-size:12px;margin-top:3px}.destination{color:var(--green-dark);font-size:12px;font-weight:500;display:block}.amount{text-align:right;font-variant-numeric:tabular-nums;font-weight:650}.positive{color:var(--green-dark)}.edit{border:0;background:none;color:var(--green-dark);font-size:12px;min-height:44px;padding:8px 4px}.edit:hover{text-decoration:underline}.empty{text-align:center;padding:35px 15px;color:var(--muted)}.empty strong{display:block;color:var(--ink);margin-bottom:7px}.bar-row{display:grid;grid-template-columns:minmax(110px,1fr) minmax(80px,2fr) minmax(85px,1fr);gap:16px;align-items:center;margin-top:18px;font-size:13px}.bar-row strong{text-align:right;font-variant-numeric:tabular-nums}.track{height:8px;border-radius:6px;background:#edf0f3;overflow:hidden}.fill{height:100%;background:#51a58b;border-radius:6px}.note{font-size:12px;color:var(--muted);line-height:1.7;margin-top:18px}.settings-section{max-width:840px}.settings-item{padding:16px 0;border-bottom:1px solid #edf0f3;display:flex;justify-content:space-between;align-items:center;gap:12px}.settings-item:last-child{border:0}.settings-item small{display:block;color:var(--muted)}.badge{display:inline-block;padding:8px 10px;border-radius:6px;background:#f0f4f3;font-size:13px;margin:4px}.actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-top:24px}label{display:block;font-size:14px;font-weight:500;color:var(--ink);margin:20px 0 7px}input,select{max-width:100%}form input,form select,dialog input,#defaultCurrency{width:100%;border:1px solid var(--line);border-radius:8px;padding:12px;color:var(--ink);background:white;min-height:47px}#defaultCurrency{max-width:180px}.editor{position:fixed;right:0;top:0;height:100dvh;width:var(--editor);background:white;border-left:1px solid var(--line);z-index:30}.editor form{height:100%;display:flex;flex-direction:column}.editor-header{display:flex;justify-content:space-between;align-items:center;padding:25px 28px 16px}.editor-header h2{font-size:24px}.editor-body{flex:1;overflow:auto;padding:0 28px 24px}.editor-body>label:first-child{margin-top:8px}.privacy-note{font-size:12px;margin:7px 0 18px}.money-input{display:flex;gap:8px}.money-input input{font-size:28px;font-weight:650;min-width:0;flex:1;font-variant-numeric:tabular-nums}.money-input select{width:82px}.editor-footer{display:grid;gap:8px;padding:16px 28px 22px;background:white;border-top:1px solid #edf0f3}.editor-footer .primary{width:100%}.editor details{margin-top:22px;border:1px solid var(--line);border-radius:8px;padding:12px}.editor summary{font-size:14px;font-weight:500;color:var(--muted);min-height:24px}.emoji-picker{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}.emoji-picker button{padding:8px 10px;font-size:20px}#error,#householdError,#recoveryStatus{color:#a82f3a;font-size:13px}#feedback{display:flex;align-items:center;gap:10px;min-height:20px;margin-bottom:12px;font-size:12px;color:var(--muted)}#feedback.error{background:#fff0f0;color:#96212d;border-radius:8px;padding:12px}#feedback.success{color:var(--green-dark)}dialog{border:0;border-radius:16px;padding:30px;width:440px;max-width:calc(100vw - 32px);max-height:90dvh;overflow:auto;box-shadow:0 20px 60px #182c3433}dialog::backdrop{background:#14282070}.auth-page{width:440px;max-width:100%;margin:8vh auto;padding:24px}.auth-page>.brand{justify-content:center;margin-bottom:28px}.auth-page form{background:white;border:1px solid var(--line);border-radius:16px;padding:30px}.auth-page h1{font-size:25px}.auth-page p{font-size:14px}.google{display:flex;justify-content:center;align-items:center;gap:12px;width:100%;margin-top:26px}.google svg{stroke:none}.or-divider{position:relative;text-align:center;margin:22px 0;color:var(--muted);font-size:12px}.or-divider:before{content:"";position:absolute;left:0;right:0;top:50%;height:1px;background:var(--line)}.or-divider span{position:relative;background:white;padding:0 12px}.auth-page #signin{width:100%;margin-top:20px}.auth-links{display:flex;justify-content:space-between;gap:8px;margin-top:12px}.auth-links button{font-size:12px;padding:8px 0}.auth-page #authCancel{display:block;margin:12px auto 0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(min-width:1600px){:root{--editor:440px}body.editor-open main{max-width:1150px}}
@media(max-width:1250px){:root{--sidebar:192px;--editor:370px}main{padding:28px 24px}.page-header{flex-wrap:wrap}.period{margin-left:0}.card{padding:16px}.panel{padding:18px}body.editor-open th:nth-child(2){width:26%}body.editor-open td{font-size:12px}.editor-header{padding:22px}.editor-body{padding:0 22px 20px}.editor-footer{padding:14px 22px 20px}}
@media(max-width:1000px){:root{--sidebar:176px}body.editor-open main{margin-right:0}.editor{width:min(440px,100vw);box-shadow:-12px 0 50px #182c3422}.editor-open:before{content:"";position:fixed;inset:0;background:#14282055;z-index:25}.page-header{gap:16px}.cards{gap:10px}.profile small{max-width:110px}}
@media(max-width:650px){#sidebar{position:fixed;inset:auto 0 0 0;width:100%;height:auto;padding:6px 10px calc(6px + env(safe-area-inset-bottom));border:0;border-top:1px solid var(--line);z-index:20}#sidebar>.brand,.profile{display:none}nav{margin:0;display:grid;grid-template-columns:repeat(4,1fr);gap:4px}nav button{padding:8px 4px;min-height:55px;display:flex;flex-direction:column;gap:4px;font-size:12px}nav svg{height:20px;width:20px}main{margin-left:0;padding:22px 16px 100px}.page-header{margin-bottom:18px;gap:16px}h1{font-size:28px}.period{width:100%}.period input{flex:1}.period select{width:90px}.page-actions{align-items:flex-start}.page-actions span{max-width:42%;font-size:12px}.primary{font-size:14px;padding:11px 15px}.cards{gap:8px;margin-bottom:18px}.card{padding:14px 10px}.value{font-size:21px}.hint{font-size:12px}.card small{font-size:12px}.panel{padding:17px 14px;margin-bottom:18px}h2{font-size:18px}.panel-head{gap:8px}.panel-head .text-button{font-size:12px;padding:8px 2px}table,tbody,tr,td{display:block}thead{display:none}tbody tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;padding:15px 0;border-bottom:1px solid #edf0f3}td{border:0;padding:0!important;min-width:0}td:nth-child(1){grid-area:1/1}td:nth-child(2){grid-area:2/1;padding-left:29px!important}td:nth-child(3){grid-area:1/2;align-self:center;max-width:140px;overflow-wrap:anywhere;font-size:14px}td:nth-child(4){grid-area:2/2;text-align:right}.edit{min-height:36px}.movement-name small{font-size:12px}.destination{font-size:12px}td:nth-child(2)>small{display:none}.search{max-width:100%}.list-tools{flex-wrap:wrap}#resultCount{width:100%}.bar-row{gap:10px;grid-template-columns:minmax(90px,1fr) 1fr minmax(80px,1fr);font-size:12px}.editor{inset:0;width:100%;box-shadow:none;border:0}.editor-header{padding:20px 22px 12px}.editor-body{padding:0 22px 20px}.editor-footer{padding:14px 22px calc(14px + env(safe-area-inset-bottom))}.auth-page{margin:3vh auto;padding:18px}.auth-page form{padding:24px}.auth-page h1{font-size:24px}.home-tools{gap:8px}.home-tools select{max-width:100%;flex:1}.settings-item{align-items:flex-start}.settings-item .actions{margin-top:0}.settings-item .actions button{font-size:12px;padding:8px}.note{font-size:12px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
@media(max-width:650px){.cards{grid-template-columns:repeat(2,minmax(0,1fr))}.cards .card:first-child{grid-column:1/-1}.cards .card:first-child .value{font-size:28px}.cards .value{font-size:20px;white-space:nowrap;overflow-wrap:normal}.cards .card{min-width:0}.cards .card:first-child .hint{font-size:12px}}

.value.compact-money{font-size:18px}@media(max-width:650px){.cards .value.compact-money{font-size:14px}}

.category-composer{display:flex;border:1px solid var(--line);border-radius:8px;background:var(--surface);margin-top:6px;overflow:hidden;align-items:stretch}.category-composer:focus-within{outline:3px solid #18846b44;border-color:var(--green)}.category-composer input,.category-composer select{margin:0;border:0;border-radius:0;box-shadow:none;outline:none;min-height:46px}.category-composer .category-emoji{width:54px;flex:0 0 54px;text-align:center;padding:8px 4px;font-size:24px;border-right:1px solid var(--line);cursor:pointer}.category-name{flex:1;min-width:0}.category-name select{width:100%}#newCategoryFields{display:flex;align-items:center}#newCategoryFields[hidden]{display:none}#newCategory{width:100%;min-width:0}#newCategory::placeholder{color:#7c8793;opacity:1}#cancelNewCategory{border:0;background:transparent;min-width:44px;min-height:46px;color:var(--muted);font-size:22px}#emojiChoices{padding-top:10px}#emojiChoices .emoji-picker{margin:0 0 8px}.category-composer input:focus-visible,.category-composer select:focus-visible,#cancelNewCategory:focus-visible{outline:2px solid var(--green);outline-offset:-3px}
.chat-launcher{position:fixed;right:24px;bottom:24px;z-index:24;width:56px;height:56px;border:0;border-radius:50%;background:var(--green-dark);color:white;display:grid;place-items:center;cursor:pointer;box-shadow:0 6px 18px #143a2929}.chat-launcher svg{width:26px;height:26px}.chat-launcher:hover{background:#105642}.expense-chat{position:fixed;right:24px;bottom:92px;width:min(390px,calc(100vw - 32px));max-height:min(620px,calc(100dvh - 130px));z-index:24;background:white;border:1px solid var(--line);border-radius:16px;display:flex;flex-direction:column;box-shadow:0 12px 35px #14282022;overflow:hidden}.expense-chat[hidden],.chat-launcher[hidden]{display:none}.expense-chat header{padding:16px 18px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line)}.expense-chat header small{display:block;margin-top:4px;color:var(--muted);font-size:12px}.chat-messages{padding:16px;overflow:auto;min-height:140px;overscroll-behavior:contain}.chat-message{max-width:95%;padding:10px 12px;margin:0 0 12px;border-radius:10px;background:var(--bg);font-size:14px;overflow-wrap:anywhere}.chat-message p{margin:0;line-height:1.5}.chat-message.human{margin-left:auto;background:var(--tint)}.chat-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}.chat-actions button{font-size:12px;min-height:44px;padding:7px 10px}.expense-chat form{display:flex;gap:8px;padding:12px 16px 4px}.expense-chat form input{min-width:0;flex:1;margin:0}.expense-chat form button{padding:10px;font-size:13px}.chat-footnote{padding:4px 16px 12px;color:var(--muted);font-size:12px}body.editor-open .chat-launcher,body.editor-open .expense-chat{visibility:hidden}@media(max-width:650px){.chat-launcher{right:16px;bottom:calc(86px + env(safe-area-inset-bottom))}.expense-chat{right:16px;bottom:calc(150px + env(safe-area-inset-bottom));max-height:calc(100dvh - 175px);width:calc(100vw - 32px)}}
/* Keep the chat above the demo notice and app navigation. */
.chat-launcher,.expense-chat{z-index:110}
/* Desktop shell: reserve comfortable navigation space and allow a compact rail. */
@media(min-width:651px){:root{--sidebar:240px}#sidebar{padding:26px 18px;overflow-y:auto;overflow-x:hidden}.brand{font-size:24px;gap:8px}#sidebar nav{margin-top:24px}#sidebar nav button{padding:12px;gap:12px;white-space:nowrap}#sidebar .profile{padding-top:22px}#sidebar .profile>span:last-child{min-width:0}#sidebar .profile small{max-width:155px;white-space:nowrap}main{container-type:inline-size;container-name:workspace;min-width:0;padding:32px;max-width:none}.sidebar-toggle{display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 10px;margin-top:16px;border:0;border-radius:8px;background:none;color:var(--muted);font-size:12px;text-align:left}.sidebar-toggle:hover{background:var(--tint)}.sidebar-toggle svg{width:20px;height:20px}body.sidebar-collapsed{--sidebar:76px}body.sidebar-collapsed #sidebar{padding:26px 12px}body.sidebar-collapsed #sidebar .brand{justify-content:center}body.sidebar-collapsed .brand-label,body.sidebar-collapsed #sidebar nav button span,body.sidebar-collapsed #sidebar .profile>span:last-child,body.sidebar-collapsed .sidebar-toggle span{display:none}body.sidebar-collapsed #sidebar nav button{justify-content:center;padding:12px 0}body.sidebar-collapsed .sidebar-toggle{justify-content:center;padding:8px 0;width:100%}body.sidebar-collapsed .sidebar-toggle svg{transform:rotate(180deg)}body.sidebar-collapsed #sidebar .profile{justify-content:center;width:100%}.table-scroll{overflow-x:auto;overscroll-behavior-x:contain}table{min-width:620px;table-layout:auto}th:nth-child(1){width:34%}th:nth-child(2){width:26%}th:nth-child(3){width:28%}th:nth-child(4){width:12%}td.amount,.edit{white-space:nowrap;overflow-wrap:normal}td.amount{min-width:150px}td:last-child{min-width:64px}.value{white-space:nowrap;overflow-wrap:normal;font-size:clamp(18px,2.8cqi,32px)}.list-tools{flex-wrap:wrap}.page-actions{flex-wrap:wrap}.page-actions .primary{white-space:nowrap}.panel-head{flex-wrap:wrap}.period{flex-wrap:wrap}.page-header{flex-wrap:wrap}.page-header>div:first-child{min-width:0}.page-header h1{overflow-wrap:anywhere}}
@container workspace (max-width:600px){.cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.cards .card:first-child{grid-column:1/-1}.cards .card:first-child .value{font-size:28px}.cards .card .value{font-size:clamp(17px,4cqi,23px)}.card{padding:16px}.panel{padding:16px}.list-tools .search{max-width:none;flex-basis:100%}.page-actions{align-items:flex-start}.page-actions>span{flex-basis:100%}}
@media(max-width:650px){#sidebarToggle{display:none}.brand-label{display:none}.table-scroll{overflow:visible}table{min-width:0}.value{white-space:nowrap}td.amount{min-width:0}.edit{white-space:nowrap}}

@media(min-width:651px){#sidebar{top:var(--demo-notice-height,0px)}}
/* Editing owns scrolling; reaching either edge never scrolls the dashboard. */
html{scrollbar-gutter:stable}
html:has(body.editor-open),body.editor-open{overflow:hidden;overscroll-behavior:none}
.editor{overscroll-behavior:contain}
.editor-body{min-height:0;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.editor-header,.editor-footer{flex-shrink:0}
