:root{--bg:#0b1220;--surface:#131c2e;--surface-2:#1b2740;--border:#26344f;--text:#e8eefc;--muted:#93a2c2;--accent:#4aa8ff;--accent-ink:#04121f;--warn:#f2b53c;--danger:#ff6b6b;--ok:#46c38a;--radius:14px;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}*{box-sizing:border-box}body{background:var(--bg);color:var(--text);-webkit-text-size-adjust:100%;margin:0;font-family:system-ui,-apple-system,Segoe UI,sans-serif}h1,h2,h3{margin:0;line-height:1.2}.app{max-width:720px;margin:0 auto;padding:20px 16px 64px}.topbar-main{z-index:20;background:var(--bg);border-bottom:1px solid var(--border);align-items:center;gap:10px;margin:-20px -16px 14px;padding:14px 16px;display:flex;position:sticky;top:0}.topbar-main h1{flex:1;min-width:0}.topbar-actions{gap:8px;margin-bottom:14px;display:flex}.back-button{background:var(--surface-2);border:1px solid var(--border);color:var(--accent);white-space:nowrap;border-radius:999px;flex-shrink:0;align-items:center;gap:6px;padding:9px 14px 9px 11px;font-size:14px;font-weight:600;display:flex}.back-button .ui-icon{width:18px;height:18px}.profile{position:relative}.avatar{background:var(--surface-2);border:1px solid var(--border);width:38px;height:38px;color:var(--text);border-radius:50%;flex-shrink:0;place-items:center;padding:0;font-weight:700;display:grid}.profile-menu{background:var(--surface);border:1px solid var(--border);z-index:40;border-radius:12px;flex-direction:column;gap:10px;min-width:220px;padding:12px;display:flex;position:absolute;top:calc(100% + 8px);right:0;box-shadow:0 12px 30px #00000073}.profile-email{color:var(--muted);word-break:break-all;margin:0;font-size:13px}.app.gate{flex-direction:column;align-items:stretch;gap:14px;max-width:420px;padding-top:64px;display:flex}.gate-form{flex-direction:column;gap:12px;display:flex}.gate-form label{color:var(--muted);flex-direction:column;gap:6px;font-size:13px;display:flex}.topbar-main h1{letter-spacing:-.02em;font-size:22px}.subtitle{color:var(--muted);margin:0 0 14px;font-size:14px}button{font:inherit;cursor:pointer;border:1px solid #0000;border-radius:10px;padding:10px 14px;transition:filter .15s,background .15s}button:disabled{opacity:.45;cursor:not-allowed}button:not(:disabled):hover{filter:brightness(1.12)}.primary{background:var(--accent);color:var(--accent-ink);font-weight:600}.secondary{background:var(--surface-2);color:var(--text);border-color:var(--border)}.ghost{color:var(--muted);background:0 0}.small{padding:7px 11px;font-size:13px}.icon-button{color:var(--muted);background:0 0;padding:6px 10px;font-size:16px}.tile-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.tile{aspect-ratio:1;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);width:100%;color:var(--text);flex-direction:column;justify-content:center;align-items:center;gap:14px;font-size:16px;font-weight:600;display:flex}.tile-icon{width:46px;height:46px;color:var(--accent);fill:none}.app.with-bottombar{padding-bottom:100px}.bottombar{z-index:10;padding:8px max(8px, calc((100% - 720px) / 2)) calc(8px + env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--border);grid-template-columns:repeat(4,1fr);gap:4px;display:grid;position:fixed;bottom:0;left:0;right:0}.nav-button{color:var(--muted);background:0 0;border:none;flex-direction:column;align-items:center;gap:4px;padding:6px 2px;font-size:11px;display:flex}.nav-button.active{color:var(--accent);font-weight:600}.nav-button .ui-icon{width:24px;height:24px}.toolbar{gap:8px;margin-bottom:14px;display:flex}input,select{font:inherit;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:10px;width:100%;padding:10px 12px}input:focus,select:focus{outline:2px solid var(--accent);outline-offset:-1px}.toolbar .search{flex:1}.toolbar select{width:auto}.empty{color:var(--muted);background:var(--surface);border:1px dashed var(--border);border-radius:var(--radius);text-align:center;padding:24px;line-height:1.5}.card-list,.history{flex-direction:column;gap:10px;margin:0;padding:0;list-style:none;display:flex}.card-shell{border-radius:var(--radius);background:var(--surface-2);position:relative;overflow:hidden}.swipe-hint{color:var(--muted);align-items:center;gap:8px;font-size:14px;font-weight:600;display:flex;position:absolute;inset:0}.swipe-hint.start{justify-content:flex-start;padding-left:18px}.swipe-hint.end{justify-content:flex-end;padding-right:18px}.swipe-hint.start{color:var(--danger)}.swipe-hint.end{color:var(--ok)}.swipe-hint.start.armed{background:color-mix(in srgb, var(--danger) 22%, transparent)}.swipe-hint.end.armed{background:color-mix(in srgb, var(--ok) 22%, transparent)}.swipe-hint .ui-icon{width:20px;height:20px}.card{touch-action:pan-y;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);flex-direction:column;gap:12px;padding:14px;display:flex;position:relative}.card-main{align-items:stretch;gap:12px;display:flex}.card-text{flex:1;min-width:0}.card-photo{background:var(--surface-2);border:1px solid var(--border);cursor:pointer;border-radius:10px;flex-shrink:0;align-self:stretch;width:72px;padding:0;position:relative;overflow:hidden}.card-photo.placeholder{color:var(--muted);border-style:dashed;place-items:center;display:grid}.toast-undo{color:var(--accent);background:0 0;border:none;padding:0;font-size:14px;font-weight:700}.card-photo.placeholder .ui-icon{width:26px;height:26px}.card-photo img{object-fit:cover;object-position:top;width:100%;height:100%;position:absolute;inset:0}.card-title{justify-content:space-between;align-items:baseline;gap:10px;display:flex}.card-title h3{flex:1;font-size:17px}.card-thumb{object-fit:cover;background:var(--surface-2);border-radius:8px;align-self:center;width:34px;height:34px}.field-label{color:var(--muted);font-size:13px}.field-block{flex-direction:column;gap:8px;display:flex}.input-with-button{gap:8px;display:flex}.input-with-button button{white-space:nowrap}.chip-button{cursor:pointer;font:inherit;padding:5px 11px;font-size:12px}.chip-button.active{background:var(--accent);color:var(--accent-ink);border-color:var(--accent);font-weight:600}.scan-list{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.scan-row{background:var(--surface-2);border:1px solid var(--border);border-radius:12px;align-items:center;gap:10px;padding:10px 12px;display:flex}.scan-body{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.scan-actions{flex-wrap:wrap;gap:8px;display:flex}.scan-actions button{flex:1}.photo-row{flex-direction:column;gap:8px;display:flex}.photo-controls{align-items:center;gap:10px;display:flex}.photo-preview{object-fit:cover;background:var(--surface-2);border-radius:10px;flex-shrink:0;width:56px;height:56px}.lookup-hit{align-items:center;gap:10px;display:flex}.product-thumb{object-fit:cover;background:var(--surface);border-radius:8px;flex-shrink:0;width:40px;height:40px}.quantity{font-variant-numeric:tabular-nums;color:var(--accent);white-space:nowrap;font-weight:600}.icon-action{color:var(--muted);background:0 0;margin-left:auto;padding:7px}.icon-action .ui-icon{width:19px;height:19px}.icon-action:hover{color:var(--danger)}.card-meta{color:var(--muted);margin:6px 0 0;font-size:13px}.chips,.quick-picks{flex-wrap:wrap;align-items:center;gap:6px;display:flex}.chips{margin-top:10px}.chip{background:var(--surface-2);border:1px solid var(--border);color:var(--text);border-radius:999px;padding:3px 9px;font-size:12px}.chip.muted{color:var(--muted)}.chip.age-fresh{color:var(--ok);border-color:color-mix(in srgb, var(--ok) 45%, transparent)}.chip.age-aging{color:var(--warn);border-color:color-mix(in srgb, var(--warn) 45%, transparent)}.chip.age-old{color:var(--danger);border-color:color-mix(in srgb, var(--danger) 45%, transparent)}.card-buttons{flex-direction:column;flex-shrink:0;justify-content:center;gap:8px;display:flex}.round-button{background:var(--surface-2);border:1px solid var(--border);width:38px;height:38px;color:var(--text);border-radius:50%;place-items:center;padding:0;display:grid}.round-button .ui-icon{width:18px;height:18px}.history-row{background:var(--surface);border:1px solid var(--border);border-radius:12px;align-items:center;gap:12px;padding:12px 14px;display:flex}.history-sign{text-align:center;width:20px;font-size:18px;font-weight:700}.history-row.add .history-sign{color:var(--ok)}.history-row.remove .history-sign{color:var(--danger)}.history-body{flex-direction:column;gap:2px;display:flex}.history-meta{color:var(--muted);font-size:13px}.sheet-backdrop{z-index:20;background:#040810b8;justify-content:center;align-items:flex-end;padding:12px;display:flex;position:fixed;inset:0}.sheet{background:var(--surface);border:1px solid var(--border);border-radius:18px;flex-direction:column;gap:12px;width:100%;max-width:520px;max-height:92vh;padding:16px;display:flex;overflow-y:auto}.sheet-header{justify-content:space-between;align-items:center;display:flex}.sheet-header h2{font-size:18px}.sheet label{color:var(--muted);flex-direction:column;gap:6px;font-size:13px;display:flex}.field-row{gap:10px;display:flex}.field-row label{flex:1}.dialog-lead{color:var(--muted);margin:0;line-height:1.5}.dialog-lead strong{color:var(--text)}.notice{background:var(--surface-2);border:1px solid var(--border);border-left:3px solid var(--warn);border-radius:8px;margin:0;padding:10px 12px;font-size:14px;line-height:1.45}.notice.success{border-left-color:var(--ok)}.hint{color:var(--muted);margin:0;font-size:13px}.manual-row{gap:8px;display:flex}.scanner-status{color:var(--muted);font-variant-numeric:tabular-nums;margin:0;font-size:12px}.scanner-controls{align-items:center;gap:8px;display:flex}.scanner-controls select{flex:1;width:auto}.scanner-frame{aspect-ratio:4/3;background:#000;border-radius:12px;position:relative;overflow:hidden}.scanner-frame video{object-fit:cover;width:100%;height:100%}.scanner-reticle{border:2px solid var(--accent);pointer-events:none;border-radius:10px;position:absolute;inset:22% 10%;box-shadow:0 0 0 9999px #00000040}.capture-frame{aspect-ratio:3/4;border:2px solid var(--accent);background:#000;border-radius:12px;width:min(100%,42vh);margin:0 auto;overflow:hidden}.capture-frame video{object-fit:cover;width:100%;height:100%;display:block}.capture-actions{gap:8px;display:flex}.capture-actions button{flex:1}.toast{left:50%;bottom:calc(104px + env(safe-area-inset-bottom));background:var(--surface-2);border:1px solid var(--border);z-index:30;border-radius:999px;align-items:center;gap:14px;padding:10px 18px;font-size:14px;display:flex;position:fixed;transform:translate(-50%);box-shadow:0 10px 30px #0006}@media (width<=480px){.topbar-actions button{flex:1}}
