:root{color-scheme:light;--background:#f5f6f8;--surface:#fff;--ink:#19212b;--muted:#76808e;--line:#e8ebef;--blue:#1675ed;--blue-soft:#eaf3ff;--danger:#bb3741;--danger-soft:#fff0f0;--radius:10px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:16px;-webkit-text-size-adjust:100%;font-weight:400;color:var(--ink);background:var(--background)}
*{box-sizing:border-box}html{height:100%;overflow:hidden;overscroll-behavior:none}body{position:fixed;inset:0;width:100%;height:100%;overflow:hidden;margin:0;overscroll-behavior:none;touch-action:pan-x pan-y;-webkit-tap-highlight-color:transparent}button,input,textarea{font:inherit}button,a,input,textarea,summary{touch-action:manipulation}button{cursor:pointer;-webkit-user-select:none;user-select:none}button:disabled{cursor:default;opacity:.45}button:focus-visible,a:focus-visible,textarea:focus-visible,input:focus-visible{outline:3px solid #9ec7fc;outline-offset:3px}svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}p{margin:0}h1,h2,h3{margin:0;font-weight:650}h1{font-size:21px;letter-spacing:-.4px}h2{font-size:21px;letter-spacing:-.4px}h3{font-size:17px}a{color:inherit}button{border:0}button,input,textarea{font-size:16px}input,textarea{width:100%;color:var(--ink);background:var(--background);border:1px solid var(--line);border-radius:10px;padding:10px;min-height:46px}textarea{resize:vertical;max-height:220px;line-height:1.5;display:block}textarea::placeholder,input::placeholder{color:#9199a5}label{display:block;font-size:14px;font-weight:550;margin-bottom:8px}input[type=date]{font-size:16px}input[type=number]{max-width:180px}button.primary,button.secondary{padding:10px 10px;min-height:46px;border-radius:10px;font-weight:600;white-space:nowrap}.primary{background:var(--blue);color:#fff}.secondary{background:var(--blue-soft);color:var(--blue)}.small{font-size:13px;line-height:1.55}.muted{color:var(--muted)}[hidden]{display:none!important}.app{display:flex;flex-direction:column;width:100%;height:100%;max-width:520px;margin:0 auto;padding:0;overflow:hidden}.app-content{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:none;-webkit-overflow-scrolling:touch;padding:15px 15px calc(15px + env(safe-area-inset-bottom));scrollbar-width:none}.app-content::-webkit-scrollbar{display:none;width:0;height:0}.topbar{position:relative;z-index:5;flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding:calc(15px + env(safe-area-inset-top)) 15px 15px;margin:0;background:var(--background)}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;font-weight:700;font-size:23px;letter-spacing:-.7px}.brand-icon{display:block;width:34px;height:34px;border-radius:10px;flex-shrink:0}.icon-button{width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;background:transparent;color:var(--muted);flex-shrink:0;font-size:28px;line-height:1}.icon-button:hover{background:#e9edf3;color:var(--ink)}.summary{text-align:center;padding:0 10px 10px}.week-summary{margin-top:8px;font-size:13px;line-height:1.5;color:var(--muted)}.week-summary strong{color:var(--ink);font-weight:600;font-variant-numeric:tabular-nums}.day-navigation{display:flex;justify-content:center;align-items:center;gap:10px;margin-bottom:10px}.day-picker{position:relative;display:inline-block;font-size:16px;font-weight:550;margin:0;min-width:140px}.day-picker input{position:absolute;inset:0;opacity:0;cursor:pointer;min-height:0;padding:0;width:100%}.day-number{display:flex;align-items:baseline;justify-content:center;gap:9px;font-variant-numeric:tabular-nums}.day-number>span:first-child{font-size:68px;line-height:1.15;letter-spacing:-3.5px;font-weight:700}.unit{font-size:19px;color:var(--muted)}.section-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.entry{background:var(--surface);border-radius:10px;margin-bottom:10px;padding:0}.entry-open{display:flex;gap:10px;align-items:center;width:100%;padding:10px;background:transparent;text-align:left;color:inherit;border-radius:inherit}.entry-failure{padding:0 10px 10px}.entry-failure .entry-error{margin-top:0}.entry-photo{height:56px;width:56px;object-fit:cover;border-radius:10px;flex-shrink:0;background:var(--background)}.entry-symbol{height:56px;width:56px;display:grid;place-items:center;flex-shrink:0;border-radius:10px;background:var(--background);color:var(--muted)}.entry-content{min-width:0;flex:1}.entry-title{font-size:15px;font-weight:550;overflow-wrap:anywhere;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.entry-meta{display:flex;gap:9px;align-items:center;margin-top:6px;flex-wrap:wrap}.entry-calories{font-size:17px;font-weight:650;letter-spacing:-.3px}.entry-error{color:var(--danger);font-size:12px;line-height:1.5;margin-top:4px}.pending-label{color:var(--muted);font-size:13px}.spinner{display:inline-block;width:12px;height:12px;border:2px solid var(--line);border-top-color:var(--blue);border-radius:50%;animation:spin 1s linear infinite;margin-right:5px;vertical-align:-1px}@keyframes spin{to{transform:rotate(360deg)}}.empty-state{padding:10px 10px 10px;text-align:center}.empty-icon{display:grid;place-items:center;width:60px;height:60px;margin:0 auto 10px;border-radius:10px;background:#eaf0f7;color:#a8b9cd}.empty-icon svg{width:35px;height:35px;stroke-width:2}.empty-state p{font-size:16px;font-weight:550;margin-bottom:6px}.empty-state>span{font-size:13px;line-height:1.65}.composer{margin-top:8px}.composer-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}.composer-heading label{font-size:15px;margin:0}.connection-status{font-size:11px;padding:5px 0;background:none;color:var(--muted);text-align:right}.connection-status.ready{color:#4f8968}.composer textarea{border:1px solid var(--line);border-radius:10px; background-color: var(--surface); padding:10px 10px;height:70px;min-height:70px;resize:none;overflow-y:auto}.composer textarea:focus{border-color:var(--blue);box-shadow:0 0 0 1px var(--blue);outline:none}.composer-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:10px}.photo-actions{display:flex;gap:1px;align-items:center}.photo-button{display:flex;gap:7px;align-items:center;color:var(--blue);background:var(--blue-soft);padding:10px 10px;border-radius:10px;font-size:14px;min-height:44px}.photo-button svg{width:21px;height:21px}.photo-actions>.icon-button{width:38px;color:var(--muted)}.photo-previews{display:flex;gap:10px;padding:10px 0 0;overflow-x:auto}.preview{position:relative;flex-shrink:0}.preview img{display:block;height:70px;width:70px;object-fit:cover;border-radius:10px}.remove-photo{position:absolute;right:-5px;top:-5px;width:24px;height:24px;background:var(--ink);color:#fff;border:2px solid white;border-radius:10px;font-size:17px;line-height:18px}.notice{border-radius:10px;padding:10px 10px;font-size:14px;line-height:1.6;margin-bottom:10px}.danger{background:var(--danger-soft);color:var(--danger)}dialog{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;border-radius:0;box-shadow:none;background:var(--surface);color:var(--ink);overflow:hidden;overscroll-behavior:none}dialog::backdrop{background:transparent;backdrop-filter:none}.dialog-screen{display:flex;flex-direction:column;width:100%;height:100%;max-width:520px;margin:0 auto;overflow:hidden}.dialog-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:none;-webkit-overflow-scrolling:touch;padding:15px 15px calc(15px + env(safe-area-inset-bottom));scrollbar-width:none}.dialog-body::-webkit-scrollbar{display:none;width:0;height:0}.dialog-screen:focus,dialog [data-close]:focus{outline:none;box-shadow:none}.screen-title{margin-bottom:10px}.settings-section+ .settings-section{margin-top:10px;padding-top:10px}.settings-section h3{margin-bottom:10px}.settings-section p{margin:10px 0}.inline-form{display:flex;gap:8px}.inline-form input{min-width:0}.inline-form .primary{padding:10px;font-size:14px}.text-button{color:var(--blue);background:none;padding:10px 0;min-height:44px;text-align:left;font-size:14px}.button-row{display:flex;gap:8px;flex-wrap:wrap}.button-row button{font-size:14px}.version{text-align:center;color:var(--muted);font-size:11px;margin-top:10px}.toast{position:fixed;bottom:calc(10px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);padding:10px 10px;border-radius:10px;background:#273342;color:#fff;font-size:14px;max-width:calc(100% - 32px);width:max-content;box-shadow:0 6px 30px #19212b22;z-index:10;line-height:1.5}.detail-total{font-size:38px;letter-spacing:-1px;font-weight:650;margin:8px 0 5px}.detail-date{font-size:13px;color:var(--muted);margin-bottom:10px}.detail-photos{display:flex;gap:8px;overflow-x:auto;margin:10px 0}.detail-photos img{max-width:85%;max-height:260px;object-fit:contain;border-radius:10px;background:var(--background)}.source-text{white-space:pre-wrap;overflow-wrap:anywhere;padding:10px;background:var(--background);border-radius:10px;font-size:14px;line-height:1.6;margin:10px 0}.detail-items{list-style:none;padding:0;margin:10px 0}.detail-items li{display:flex;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid var(--line);font-size:14px;line-height:1.4}.detail-items li span:last-child{white-space:nowrap;font-weight:550}.detail-assumptions{padding-left:10px;margin:10px 0 10px;font-size:13px;color:var(--muted);line-height:1.65}.detail-form{border-top:1px solid var(--line);padding-top:10px;margin-top:10px}.detail-form h3{margin-bottom:10px}.detail-form label{margin-top:10px}.detail-form .primary{margin-top:10px;width:100%}.manual-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:10px}.manual-row label{margin-top:0}.manual-row input{min-width:0;max-width:none}.delete-button{background:none;color:var(--danger);padding:10px 0;min-height:44px;font-size:14px;width:100%;margin-top:8px}.retry-button{background:var(--blue-soft);color:var(--blue);border-radius:10px;font-size:12px;padding:7px 10px;margin-top:8px}.question{padding:10px;background:var(--blue-soft);color:#2e6099;border-radius:10px;line-height:1.6;font-size:14px}.update-button{background:var(--blue-soft);color:var(--blue);border-radius:10px;padding:10px;width:100%;font-size:13px;margin-bottom:10px}
@media(max-width:360px){.composer-actions{flex-wrap:wrap}.composer-actions>.primary{flex:1;min-width:120px}.day-picker{min-width:110px}.day-number>span:first-child{font-size:60px}.inline-form{flex-direction:column}}
@media(prefers-reduced-motion:reduce){.spinner{animation:none}}
.key-save{margin-top:10px;width:100%}
/* Inventory surfaces follow the same tokens, spacing and full-screen dialogs as Calories. */
.header-actions{display:flex;gap:1px}.header-actions .icon-button{width:40px}.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}.full-width{width:100%}select{font:inherit;font-size:16px;min-height:46px;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:10px;width:100%;min-width:0}select:focus-visible,summary:focus-visible{outline:3px solid #9ec7fc;outline-offset:3px}.scope-row{display:flex;gap:6px;align-items:center;margin-bottom:10px}.scope-row select{flex:1;font-weight:550}.scope-row>.icon-button{color:var(--blue);background:var(--blue-soft)}.place-caption{display:flex;align-items:center;gap:7px;justify-content:space-between;line-height:1.5;font-size:13px;color:var(--muted);margin:0 0 10px;overflow-wrap:anywhere}.place-caption a{color:var(--blue);display:inline-flex;gap:4px;align-items:center;flex-shrink:0;text-decoration:none;min-height:32px}.place-caption svg{width:16px;height:16px}.search-form{display:flex;align-items:center;gap:8px}.search-input{display:flex;gap:8px;align-items:center;flex:1;min-width:0;background:var(--surface);border-radius:10px;border:1px solid var(--line);padding:0 10px}.search-input>svg{width:20px;height:20px;color:var(--muted)}.search-input input{background:transparent;border:0;padding:10px 0;min-width:0}.search-input input:focus-visible{outline:0;box-shadow:none}.search-input:focus-within{border-color:var(--blue);box-shadow:0 0 0 1px var(--blue)}.search-status{font-size:12px;color:var(--muted);line-height:1.5;min-height:28px;padding:6px 0 10px}.search-status .spinner{margin-right:4px}.search-form .secondary{min-width:46px}.search-form .secondary:disabled{opacity:.45}.inventory-heading{margin-top:8px}.heading-actions{display:flex;align-items:center;gap:10px}.heading-actions .text-button{font-size:12px;padding:0;min-height:32px}.category{border-radius:10px;background:var(--surface);margin:0 0 10px}.category>summary{list-style:none;display:flex;align-items:center;gap:9px;padding:10px;min-height:48px;font-size:15px;font-weight:600;cursor:pointer;overflow-wrap:anywhere}.category>summary::-webkit-details-marker{display:none}.category>summary>.category-symbol{width:20px;height:20px;color:var(--muted)}.category-number{font-size:12px;font-weight:400;color:var(--muted);margin-left:2px}.category-chevron{width:16px;height:16px;color:var(--muted);margin-left:auto;transition:transform .15s}.category[open] .category-chevron{transform:rotate(90deg)}.item-row{width:100%;display:flex;align-items:center;gap:10px;background:transparent;color:inherit;text-align:left;padding:10px;border-radius:10px}.item-row:hover{background:var(--blue-soft)}.item-thumbnail{width:52px;height:52px;object-fit:cover;flex-shrink:0;border-radius:10px;background:var(--background)}.item-symbol{width:52px;height:52px;display:grid;place-items:center;border-radius:10px;background:var(--background);color:var(--muted);flex-shrink:0}.item-symbol svg{width:25px;height:25px}.item-copy{flex:1;min-width:0}.item-name{font-size:15px;line-height:1.4;font-weight:550;overflow-wrap:anywhere;display:block}.item-meta{font-size:12px;line-height:1.55;color:var(--muted);margin-top:4px;display:block;overflow-wrap:anywhere}.item-arrow{width:15px;height:15px;color:var(--muted)}.item-flags{display:flex;gap:6px;flex-wrap:wrap;font-size:11px;color:var(--muted);margin-top:4px}.item-flags span{padding:2px 5px;border-radius:5px;background:var(--background)}.item-flags .uncertain{color:#8b650f;background:#fff6dd}.add-bar{flex:0 0 auto;background:var(--background);padding:10px 15px calc(10px + env(safe-area-inset-bottom))}.add-main{display:flex;gap:8px;align-items:center;justify-content:center;width:100%}.add-main svg{width:21px;height:21px}.welcome{text-align:center;padding:36px 0 24px}.welcome-icon{margin-bottom:18px}.welcome-icon img{border-radius:17px}.welcome h1{font-size:21px;line-height:1.4}.welcome p{font-size:14px;color:var(--muted);line-height:1.7;margin:10px 0 22px}.welcome .primary{width:100%;max-width:300px}.stack-form{display:flex;flex-direction:column;gap:16px}.stack-form>label{font-size:14px;margin:0}.stack-form>label>input,.stack-form>label>textarea,.stack-form>label>select{margin-top:7px}.stack-form textarea{background:var(--background)}.stack-form>p{margin:0}.stack-form>.text-button{padding:0}.field-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:-8px}.field-heading h3{font-size:16px}.field-heading .text-button{padding:0}.two-columns{display:grid;grid-template-columns:1fr 1fr;gap:10px}.two-columns label{margin:0}.two-columns input{margin-top:7px;max-width:none;min-width:0}.photo-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.photo-tools .secondary{font-size:14px;min-height:44px}.photo-previews{padding:6px 0;gap:10px}.preview .preview-open{padding:0;border:0;background:transparent;border-radius:10px}.preview img{width:78px;height:78px}.remove-photo{border-radius:50%;cursor:pointer}.queue-card{background:var(--surface);padding:10px;border-radius:10px;margin-bottom:10px}.queue-top{display:flex;align-items:center;gap:10px}.queue-top .item-copy{min-width:0}.queue-status{font-size:12px;color:var(--muted);line-height:1.6;margin-top:5px}.queue-actions{display:flex;gap:14px;align-items:center;margin-top:5px;flex-wrap:wrap}.queue-actions .text-button{font-size:12px;padding:0;min-height:34px}.queue-actions .delete-job{color:var(--muted)}.queue-photo{background:transparent;border-radius:10px;padding:0;display:flex}.place-card{background:var(--background);border-radius:10px;margin-bottom:10px}.place-card button{display:flex;align-items:center;gap:10px;padding:12px;width:100%;color:var(--ink);background:transparent;text-align:left;border-radius:10px;min-height:72px}.place-card .item-symbol{background:var(--surface)}.place-card strong{display:block;font-size:16px;line-height:1.5;font-weight:600}.place-card small{display:block;font-size:12px;color:var(--muted);line-height:1.6;overflow-wrap:anywhere}.places-empty{font-size:14px;line-height:1.7;color:var(--muted);padding:10px 0 20px}.item-photos{display:flex;gap:10px;overflow-x:auto;padding:5px 0 10px;margin-bottom:10px}.item-photo-wrap{position:relative;flex-shrink:0}.item-photo-wrap>button:first-child{padding:0;background:var(--background);border-radius:10px;display:block}.item-photo-wrap img{height:160px;width:180px;object-fit:cover;display:block;border-radius:10px}.item-photo-wrap .remove-photo{right:3px;top:3px;border-color:var(--surface)}.photo-add-label{display:flex;gap:6px;align-items:center;color:var(--blue);font-size:14px;min-height:44px;margin-bottom:10px;font-weight:400;cursor:pointer}.photo-add-label svg{width:20px}.item-status-action{background:var(--blue-soft);color:var(--blue);padding:10px;border-radius:10px;min-height:44px;width:100%;margin-top:16px}.item-date{font-size:12px;color:var(--muted);margin-top:16px}.duplicate-notice{padding:10px;border-radius:10px;background:var(--blue-soft);font-size:13px;line-height:1.6;margin:12px 0}.duplicate-notice p{margin-bottom:6px}.duplicate-notice button{display:block;text-align:left;min-height:38px;color:var(--blue);background:transparent;padding:5px 0}.uncertain-notice{background:#fff6dd;color:#8b650f;padding:10px;border-radius:10px;font-size:13px;line-height:1.6;margin-bottom:16px}.photo-viewer{flex:1;min-height:0;overflow:auto;display:flex;align-items:center;justify-content:center;padding:0 10px}.photo-viewer img{display:block;max-width:100%;max-height:100%;object-fit:contain}.photo-navigation{display:flex;justify-content:space-between;gap:10px;padding:15px 15px calc(15px + env(safe-area-inset-bottom))}.confirm-message{font-size:15px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;margin-bottom:20px}.confirm-message+.button-row button{white-space:normal}.danger-button{background:var(--danger)!important;color:#fff!important}.status-taken{color:var(--muted)}.version{margin-top:24px}.settings-section+.settings-section{margin-top:20px;padding-top:0}.detail-form{border-top:0;padding-top:0;margin-top:12px}
@media(max-width:360px){.brand{font-size:21px}.header-actions .icon-button{width:36px}.topbar{padding-left:12px;padding-right:12px}.app-content,.dialog-body{padding-left:12px;padding-right:12px}.two-columns{gap:8px}.photo-tools{gap:6px}.item-meta{font-size:11px}.category>summary{gap:6px}.add-bar{padding-left:12px;padding-right:12px}.welcome{padding-top:24px}}
@media(prefers-reduced-motion:reduce){.category-chevron{transition:none}}
