:root{color-scheme:light;--paper:#f6f7f2;--ink:#293d34;--muted:#68756c;--sage:#dce6d8;--line:#dde2d9;--visible-height:100dvh;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}
*{box-sizing:border-box}body{margin:0}button,a{-webkit-tap-highlight-color:transparent;touch-action:manipulation}button{font:inherit;color:inherit;cursor:pointer}a{color:inherit;text-decoration:none}svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.symbols{display:none}[hidden]{display:none!important}:focus-visible{outline:3px solid #41634e;outline-offset:5px}.shell{min-height:var(--visible-height);display:flex;flex-direction:column;padding:0 clamp(24px,5.5vw,80px);max-width:1440px;margin:auto}header{display:flex;align-items:center;justify-content:space-between;min-height:112px;border-bottom:1px solid var(--line);gap:16px}.brand{display:flex;align-items:center;gap:12px;font-size:23px;font-weight:650;letter-spacing:-1px;min-height:56px}.brand-icon{background:#e5ebdf;width:43px;height:43px;display:grid;place-items:center;border-radius:14px}.brand-icon svg{width:23px;height:23px}.brand-light{font-weight:400}.header-actions{display:flex;align-items:center;gap:12px}.icon-button{display:grid;place-items:center;border:1px solid var(--line);background:transparent;width:56px;height:56px;border-radius:50%}.home-button{display:flex;align-items:center;gap:9px;min-height:56px;padding:0 16px;border-radius:28px;background:#e5ebdf;font-size:15px}main{flex:1;padding:54px 0 44px}main:focus{outline:none}.welcome{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:53px}.eyebrow{font-size:10px;letter-spacing:2px;font-weight:650;color:var(--muted);margin:0 0 13px}h1{font-weight:450;font-size:clamp(28px,3.8vw,44px);letter-spacing:-1.8px;line-height:1.15;margin:0}h1>span{color:#8ca785}.clock-block{text-align:right;flex-shrink:0}#clock{font-size:38px;letter-spacing:-1.5px;font-weight:350;font-variant-numeric:tabular-nums}#date{font-size:12px;color:var(--muted);margin:5px 0 0;text-transform:capitalize}.section-label{display:flex;align-items:center;gap:12px;font-size:12px;color:var(--muted);margin-bottom:17px}.count{font-size:10px;border:1px solid var(--line);border-radius:12px;padding:2px 7px}.tiles{display:grid;grid-template-columns:1fr 1fr;gap:22px}.tile{min-height:263px;padding:30px;border-radius:24px;display:flex;flex-direction:column;justify-content:space-between;border:1px solid #d1ddcc;transition:transform .15s,background .15s}.tile-sage{background:var(--sage)}.tile-white{background:#fff;border-color:#e4e8df}.tile-top,.tile-bottom{display:flex;justify-content:space-between;align-items:center;gap:12px}.app-icon{width:62px;height:62px;border:1px solid #bdceba;border-radius:19px;display:grid;place-items:center}.app-icon svg{width:32px;height:32px}.tile-white .app-icon{background:#f2f5ed;border-color:#e7ecdf}.tile-number{font-size:11px;align-self:flex-start;color:#6d7f6a}.tile-title{display:block;font-size:29px;letter-spacing:-1px;font-weight:500}.tile-description{display:block;font-size:12px;color:#5c6f5c;margin-top:7px}.tile-arrow{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:#f7faf16e}.tile-white .tile-arrow{background:#f3f6ef}.tile:active,.icon-button:active,.home-button:active{transform:scale(.98)}footer{min-height:73px;border-top:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:18px;color:var(--muted);font-size:11px}.footer-mark{display:flex;align-items:center;gap:9px}.footer-mark>span{width:6px;height:6px;background:#91a88b;border-radius:50%}.version{color:#788872;margin-left:8px}.app-screen{min-height:340px;display:flex;align-items:center;justify-content:center;text-align:center;flex-direction:column}.placeholder-icon{padding:24px;background:var(--sage);border-radius:24px;margin-bottom:28px}.placeholder-icon svg{width:40px;height:40px}.app-screen h1{font-size:36px}.app-screen>p:not(.eyebrow){color:var(--muted);font-size:15px;max-width:340px;line-height:1.7}.development-label{font-size:11px;color:#5b7058;border:1px solid #d3dfce;border-radius:20px;padding:7px 14px;margin-top:10px}dialog{border:1px solid var(--line);border-radius:24px;padding:24px;color:var(--ink);background:var(--paper);width:min(400px,calc(100% - 32px));max-height:calc(var(--visible-height) - 32px);overflow:auto}dialog::backdrop{background:#24392e40;backdrop-filter:blur(4px)}.dialog-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}.dialog-heading h2{font-size:24px;font-weight:500;margin:0}.menu-item{display:flex;align-items:center;gap:16px;min-height:60px;width:100%;border:1px solid var(--line);background:white;border-radius:14px;padding:16px;text-align:left;font-size:15px}#fullscreen-status,#kiosk-status{font-size:13px;line-height:1.5}.about{border-top:1px solid var(--line);margin-top:24px;padding-top:12px;font-size:13px}.about p:first-child{display:flex;justify-content:space-between}.about p:last-child{color:var(--muted);font-size:12px;line-height:1.6}
/* Keep document scrolling available when a system keyboard reduces the viewport. */
input,textarea,select{font-size:18px;scroll-margin-block:24px}html{scroll-padding-block:24px}
@media(hover:hover){.tile:hover{transform:translateY(-3px)}.icon-button:hover{background:#e9eee3}}
@media(max-width:600px){header{min-height:88px}.shell{padding:0 24px}main{padding:32px 0}.welcome{align-items:flex-start;margin-bottom:32px;flex-direction:column}.clock-block{text-align:left}#clock{font-size:28px}.tiles{grid-template-columns:1fr;gap:16px}.tile{min-height:210px;padding:24px}.tile-title{font-size:26px}footer{min-height:72px;font-size:10px}.brand{font-size:21px}}
@media(max-height:520px) and (min-width:601px){header{min-height:80px}main{padding:24px 0}.welcome{margin-bottom:24px}.tile{min-height:200px;padding:24px}footer{min-height:56px}.app-screen{min-height:240px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

.menu-item:disabled{opacity:.6;cursor:wait}

/* Overlay keyboards may leave the browser viewport unchanged. Keep a scrollable
   lower margin while editing, so fields can move above the system keyboard. */
html:has(input:not([type="range"]):focus,textarea:focus,select:focus,[contenteditable="true"]:focus){padding-bottom:50dvh;scroll-padding-bottom:50dvh}

.brightness-control{margin-bottom:20px}.brightness-heading{display:flex;align-items:center;justify-content:space-between;font-size:15px}.brightness-heading output{font-variant-numeric:tabular-nums;color:var(--muted)}#brightness-slider{display:block;width:100%;height:48px;margin:4px 0;accent-color:#557653;touch-action:pan-y}#brightness-slider:disabled{opacity:.45}#brightness-status{font-size:13px;line-height:1.5;color:var(--muted);margin:0}

/* A pointer-transparent veil dims the page, while the modal menu stays above it. */
body::after{content:"";position:fixed;inset:0;z-index:1000;background:#000;opacity:var(--app-dim,0);pointer-events:none;user-select:none}
#brightness-help{font-size:12px;line-height:1.5;color:var(--muted);margin:0}
#brightness-slider{-webkit-appearance:none;appearance:none;background:transparent}
#brightness-slider::-webkit-slider-runnable-track{height:6px;background:#c9d8c4;border-radius:3px}
#brightness-slider::-webkit-slider-thumb{-webkit-appearance:none;width:28px;height:28px;margin-top:-11px;border-radius:50%;background:#557653;border:3px solid var(--paper)}
#brightness-slider::-moz-range-track{height:6px;background:#c9d8c4;border-radius:3px}
#brightness-slider::-moz-range-thumb{width:22px;height:22px;border-radius:50%;background:#557653;border:3px solid var(--paper)}

/* Household expense register: normal document flow leaves room for the OSK. */
.expense-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:28px}.expense-heading h1{font-size:36px}.button{display:inline-flex;align-items:center;justify-content:center;min-height:52px;padding:12px 20px;gap:8px;border:1px solid var(--line);border-radius:14px;background:#fff;font:inherit;font-size:15px;cursor:pointer}.button-primary{background:#4f6e50;color:#fff;border-color:#4f6e50}.button-danger{color:#8a3e34;border-color:#dbc6be;background:#fff}.button:disabled,.small-button:disabled{opacity:.55;cursor:wait}.quiet-button{min-height:48px;padding:12px;border:0;background:transparent;color:#496349;font:inherit;font-size:14px;display:inline-flex;align-items:center;justify-content:center}.month-navigation{display:flex;align-items:center;gap:16px;margin-bottom:20px}.month-navigation h2{font-size:20px;font-weight:500;min-width:170px;text-align:center;margin:0;text-transform:capitalize}.small-button{min-width:48px;min-height:48px;border:1px solid var(--line);border-radius:50%;background:transparent;font-size:26px}.expense-overview{display:grid;grid-template-columns:1fr 1fr;gap:32px;align-items:start;padding:26px 30px;background:#e5ebdf;border:1px solid #d5dfce;border-radius:22px;margin:0 0 30px}.expense-total{display:flex;flex-direction:column;gap:8px;font-size:13px;color:#52674f}.expense-total strong{font-size:40px;line-height:1.2;letter-spacing:-1.5px;font-weight:500;color:var(--ink);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.summary-label{font-size:12px;font-weight:500;margin:0 0 12px;color:#52674f}.category-summary{list-style:none;padding:0;margin:0;display:grid;gap:9px;font-size:13px}.category-summary li{display:flex;align-items:baseline;justify-content:space-between;gap:16px}.category-summary strong{font-weight:500;white-space:nowrap;font-variant-numeric:tabular-nums}.empty-category{color:var(--muted)}.expense-list{list-style:none;padding:0;margin:0}.expense-row{display:flex;align-items:center;gap:18px;min-height:88px;padding:18px 4px;border-bottom:1px solid var(--line)}.expense-row-details{flex:1;min-width:0;display:grid;gap:6px}.expense-row-details>strong{font-size:16px;font-weight:500}.expense-row-subtitle{display:flex;gap:14px;color:var(--muted);font-size:13px;line-height:1.5;overflow-wrap:anywhere}.expense-row-subtitle time{flex-shrink:0}.expense-row-amount{font-weight:500;font-size:20px;white-space:nowrap;font-variant-numeric:tabular-nums}.expense-row-arrow{font-size:25px;color:#72816e}.expense-empty{text-align:center;padding:32px;color:var(--muted);border:1px dashed var(--line);border-radius:18px;font-size:15px}.load-more{margin:24px auto 0;display:flex}.expense-message{font-size:14px;line-height:1.6;color:#52674f;margin:0 0 18px}.expense-message:empty{display:none}.expense-form{max-width:560px}.expense-form fieldset{padding:0;margin:0;border:0;min-width:0;display:grid;grid-template-columns:1fr}.expense-form label{font-size:14px;font-weight:500;margin:0 0 9px}.optional{font-size:12px;font-weight:400;color:var(--muted);margin-left:6px}.expense-form input,.expense-form select,.expense-form textarea{display:block;width:100%;min-width:0;min-height:54px;padding:13px 16px;border:1px solid #cbd5c5;border-radius:12px;background:white;color:var(--ink);font:inherit;font-size:18px;margin:0 0 24px}.expense-form textarea{resize:vertical;line-height:1.5}.expense-form input#expense-amount{font-size:28px;font-variant-numeric:tabular-nums}.expense-form-actions{display:flex;gap:16px;flex-wrap:wrap;padding-bottom:16px}.confirmation-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}#expense-delete-dialog h2{font-size:23px;font-weight:500;line-height:1.35;margin-top:0}#expense-delete-summary,#expense-delete-error,#expense-export-status{font-size:13px;line-height:1.6}#expense-delete-error{color:#8a3e34}#expense-menu-actions{margin-bottom:16px}
@media(max-width:600px){.expense-heading{align-items:flex-start;flex-wrap:wrap}.expense-heading h1{font-size:30px}.expense-overview{grid-template-columns:1fr;gap:24px;padding:24px}.expense-total strong{font-size:34px}.month-navigation{gap:8px;flex-wrap:wrap}.month-navigation h2{min-width:150px;font-size:18px}.expense-row{gap:12px}.expense-row-subtitle{flex-direction:column;gap:2px}.expense-row-amount{font-size:18px}.expense-form-actions .button{flex:1}}

#expense-type-other label{display:block}.expense-row-details>strong{line-height:1.4;overflow-wrap:anywhere}

.sync-state-button{border:0;background:#e5ebdf;color:#496349;padding:8px 12px;min-height:44px;border-radius:22px;font:inherit;font-size:12px;max-width:220px}.expense-sync-label{font-size:12px;color:#76572e}#cloud-menu{border-top:1px solid var(--line);padding-top:16px;margin:24px 0}#cloud-menu h3{font-size:17px;font-weight:500}#cloud-menu p{font-size:13px;line-height:1.5}.cloud-login{display:grid;gap:10px}.cloud-login input{width:100%;min-height:52px;padding:12px;border:1px solid var(--line);border-radius:12px;background:white;font:inherit;font-size:18px}#cloud-menu .button{margin:4px 0}#cloud-login-message{color:#76572e}.sync-conflict{padding:16px 0;border-top:1px solid var(--line)}.sync-conflict p{font-size:14px;line-height:1.5;overflow-wrap:anywhere}.sync-conflict .button{width:100%;margin-top:10px}#cloud-conflict-dialog{width:min(600px,calc(100% - 32px))}dialog:has(input:not([type="range"]):focus,textarea:focus){max-height:min(45dvh,calc(var(--visible-height) - 32px));margin-top:16px;scroll-padding-block:20px}@media(max-width:600px){.header-actions{gap:8px;flex-wrap:wrap;justify-content:flex-end}.sync-state-button{font-size:11px;max-width:140px}.brand{flex-shrink:0}}
/* Keep the login dialog geometry stable when focus moves to Accedi. Otherwise
   shrinking only on input focus moves the button between touch down/up. */
dialog:has(#cloud-menu:not([hidden]) #cloud-login:not([hidden])){max-height:min(45dvh,calc(var(--visible-height) - 32px));margin-top:16px;scroll-padding-block:20px}
/* Preserve keyboard clearance through the button focus transition as well. */
html:has(#expense-editor:not([hidden]):focus-within){padding-bottom:50dvh;scroll-padding-bottom:50dvh}
@media(max-width:600px){header{display:grid;grid-template-columns:minmax(0,1fr) auto auto;column-gap:8px;row-gap:8px;padding:16px 0}.header-actions{display:contents}.brand{grid-column:1;grid-row:1}.home-button{grid-column:2;grid-row:1;min-height:48px;width:48px;padding:0;justify-content:center}.home-button span{display:none}#menu-button{grid-column:3;grid-row:1}#cloud-state-button{grid-column:1 / 4;grid-row:2;justify-self:start;max-width:100%;min-height:36px}}

.web-account-screen{max-width:560px;margin:0 auto}.web-account-screen h1,#web-admin-screen h1{font-size:clamp(28px,4vw,40px);font-weight:500;letter-spacing:-1px;margin:0 0 18px}.web-intro{font-size:16px;color:var(--muted);line-height:1.6;margin-bottom:28px}.web-form{display:grid;gap:12px;max-width:520px}.web-form label{font-size:14px;margin-top:8px}.web-form input,.web-form select{width:100%;min-width:0;min-height:54px;padding:13px 16px;border:1px solid #cbd5c5;border-radius:12px;background:#fff;color:var(--ink);font:inherit;font-size:18px}.web-form small{font-size:12px;line-height:1.5;color:var(--muted)}.web-form p{font-size:14px;line-height:1.5;color:#76572e}.web-form p:empty{display:none}.web-form .button{margin-top:12px}.web-admin-grid{display:grid;grid-template-columns:1fr 1fr;gap:60px;margin-top:32px}.web-admin-grid h2{font-size:22px;font-weight:500}.web-users-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.web-user-list{list-style:none;padding:0;margin:0}.web-user-row{display:grid;grid-template-columns:1fr auto;gap:8px;padding:20px 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}.web-user-row strong{font-weight:500}.web-user-row span,.web-user-row small{font-size:13px;color:var(--muted)}.web-user-row small{grid-column:1 / -1}.web-account-button{min-height:48px;padding:10px 18px;border-radius:24px;display:inline-flex;align-items:center;background:#4f6e50;color:white;font-size:14px}.web-edition #device-menu-controls,.web-edition #cloud-menu,.web-edition #cloud-state-button,.web-edition .brightness-control{display:none!important}.web-edition header{padding-block:16px}.web-edition #web-account-button{order:3}.web-edition .header-actions{gap:10px}.web-edition #web-logout-message{font-size:13px;color:#76572e}html:has(.web-form:focus-within){padding-bottom:50dvh;scroll-padding-bottom:50dvh}@media(max-width:600px){.web-admin-grid{grid-template-columns:1fr;gap:32px}.web-edition header{grid-template-columns:minmax(0,1fr) auto auto}.web-edition #web-account-button{grid-column:2;grid-row:1}.web-edition #home-button{grid-column:2;grid-row:2;justify-self:end}.web-edition #menu-button{grid-column:3;grid-row:1}.web-edition header:has(#home-button:not([hidden])) #web-account-button{grid-column:1 / 3;grid-row:2;justify-self:start}.web-edition header:has(#home-button:not([hidden])) #home-button{grid-column:3;grid-row:2}}
