:root{color-scheme:light dark;--bg: #f2f4f7;--surface: #ffffff;--surface-2: #eef1f5;--text: #1a2029;--text-muted: #6b7280;--border: #e2e6ec;--accent: #2563eb;--accent-text: #ffffff;--danger: #dc2626;--success: #16a34a;--qty-badge: #f2b705;--qty-badge-text: #1a2029;--radius: 14px;--shadow: 0 1px 3px rgba(20, 25, 35, .08), 0 1px 2px rgba(20, 25, 35, .06)}@media (prefers-color-scheme: dark){:root{--bg: #11151c;--surface: #1a2029;--surface-2: #222a35;--text: #f1f3f6;--text-muted: #9aa4b2;--border: #2b3543;--shadow: 0 1px 3px rgba(0, 0, 0, .4)}}*{box-sizing:border-box}html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;-webkit-tap-highlight-color:transparent;overflow-x:hidden;height:100%;overflow-y:hidden}button,input{font-family:inherit;font-size:inherit;color:inherit}#app{max-width:560px;margin:0 auto;height:100vh;height:100dvh;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior-y:contain;display:flex;flex-direction:column;padding-bottom:env(safe-area-inset-bottom)}.topbar{position:sticky;top:0;z-index:10;display:flex;align-items:center;gap:10px;padding:14px 16px calc(14px + env(safe-area-inset-top)) 16px;padding-top:max(14px,env(safe-area-inset-top));background:var(--surface);border-bottom:1px solid var(--border)}.topbar h1{font-size:18px;margin:0;flex:1;font-weight:600}.icon-btn{border:none;background:var(--surface-2);color:var(--text);width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;padding:0}.icon-btn:active{transform:scale(.94)}.icon-btn svg{width:20px;height:20px}.back-btn{display:flex;align-items:center;gap:4px;border:none;background:var(--surface-2);color:var(--text);padding:10px 14px 10px 10px;min-height:44px;border-radius:999px;font-weight:700;font-size:14px;cursor:pointer;flex-shrink:0}.back-btn:active{transform:scale(.96)}.back-btn svg{width:20px;height:20px;flex-shrink:0}.user-chip{background:var(--surface-2);color:var(--text-muted);font-size:12px;font-weight:700;padding:6px 10px;border-radius:999px;flex-shrink:0;white-space:nowrap;margin-right:8px}.header-meta{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex-shrink:0;margin-left:auto}.header-meta .me{font-size:11px;font-weight:700;color:var(--text-muted);white-space:nowrap}.presence-pill{background:#f59e0b22;color:#b45309;font-size:10px;font-weight:700;padding:3px 8px;border-radius:999px;white-space:nowrap;max-width:140px;overflow:hidden;text-overflow:ellipsis}@media (prefers-color-scheme: dark){.presence-pill{color:#fbbf24}}.tabs{display:flex;gap:4px;padding:8px 16px;background:var(--surface);border-bottom:1px solid var(--border)}.tab{flex:1;border:none;background:transparent;padding:10px 8px;border-radius:10px;font-weight:600;color:var(--text-muted);cursor:pointer}.tab.active{background:var(--surface-2);color:var(--text)}.content{flex:1;padding:16px 16px 100px}.section-title{font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted);margin:4px 0 10px}.store-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:24px}.store-chip{border:none;border-radius:var(--radius);padding:18px 14px;font-weight:700;font-size:15px;cursor:pointer;box-shadow:var(--shadow);display:flex;align-items:center;gap:10px;min-height:64px;text-align:left}.store-chip:active{transform:scale(.97)}.store-logo{width:34px;height:34px;border-radius:8px;flex-shrink:0;object-fit:contain;background:#fff;padding:4px;box-shadow:0 0 0 1px #0000000f}.list-card{display:flex;align-items:center;gap:12px;background:var(--surface);border-radius:var(--radius);padding:14px;margin-bottom:10px;box-shadow:var(--shadow);cursor:pointer}.list-card:active{transform:scale(.98)}.list-card .store-logo{width:44px;height:44px;font-size:15px}.list-card-info{flex:1;min-width:0}.list-card-info .name{font-weight:700;font-size:15px}.list-card-info .meta{font-size:13px;color:var(--text-muted);margin-top:2px}.empty-state{text-align:center;color:var(--text-muted);padding:40px 20px;font-size:14px}.catalog-list{display:flex;flex-direction:column;gap:8px}.catalog-row{display:flex;align-items:center;gap:10px;background:var(--surface);border-radius:var(--radius);padding:12px 14px;box-shadow:var(--shadow)}.catalog-name{flex:1;min-width:0;font-size:14px;font-weight:600;overflow-wrap:anywhere}.catalog-inuse-hint{flex-shrink:0;font-size:11px;font-weight:700;color:var(--text-muted)}.catalog-error{color:var(--danger);font-size:13px;font-weight:600;margin-top:12px;text-align:center}.list-header{display:flex;align-items:center;gap:10px;padding:14px 16px;padding-top:max(14px,env(safe-area-inset-top));background:var(--surface);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:10}.list-header .store-logo{width:36px;height:36px;font-size:13px}.list-header .title{flex:1;min-width:0;font-weight:700;font-size:16px}.list-header .subtitle{font-size:12px;color:var(--text-muted);font-weight:400}.header-actions{position:relative;flex-shrink:0}.popover-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:15;background:transparent}.complete-popover{position:absolute;top:calc(100% + 8px);right:0;z-index:16;width:220px;background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);padding:12px;display:flex;flex-direction:column;gap:10px;font-size:13px;font-weight:600}.popover-actions{display:flex;gap:8px}.popover-actions .confirm-yes,.popover-actions .confirm-no{flex:1;border:none;border-radius:8px;padding:9px 10px;font-weight:700;cursor:pointer;font-size:13px}.popover-actions .confirm-yes{background:var(--success);color:#fff}.popover-actions .confirm-no{background:var(--surface-2);color:var(--text)}#items-list-unchecked{margin-top:10px}.section-divider{font-size:12px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em;margin:16px 2px 8px}.item-row{display:flex;align-items:center;gap:10px;background:var(--surface);border-radius:var(--radius);padding:10px 12px;margin-bottom:8px;box-shadow:var(--shadow)}.item-check{width:26px;height:26px;border-radius:50%;border:2px solid var(--border);flex-shrink:0;cursor:pointer;display:flex;align-items:center;justify-content:center;background:transparent}.item-check.checked{background:var(--success);border-color:var(--success);color:#fff}.item-name-row{display:flex;align-items:center;gap:6px;min-width:0;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.qty-circle{flex-shrink:0;align-self:flex-start;margin-top:-3px;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:var(--qty-badge);color:var(--qty-badge-text);font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center}.item-name{flex:1;font-size:15px;font-weight:600;min-width:0;overflow-wrap:anywhere}.item-row.checked .item-name{text-decoration:line-through;color:var(--text-muted)}.stepper{display:flex;align-items:center;gap:4px;background:var(--surface-2);border-radius:12px;flex-shrink:0;padding:2px}.stepper button{width:44px;height:44px;border:none;background:transparent;font-size:22px;font-weight:700;cursor:pointer;color:var(--text);border-radius:10px}.stepper button:active{opacity:.6;background:var(--surface)}.remove-btn{width:34px;height:34px;border:none;background:transparent;color:var(--text-muted);cursor:pointer;flex-shrink:0;display:flex;align-items:center;justify-content:center}.remove-btn:active{color:var(--danger)}.item-name-col{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}.item-name-input{width:100%;border:1px solid var(--accent);background:var(--surface-2);border-radius:8px;padding:6px 8px;font-size:15px;font-weight:600}.item-name-input:focus{outline:none}.item-row-editing{border:2px dashed var(--accent);align-items:center}.lidl-badge{align-self:flex-start;border:1px solid var(--border);background:var(--surface-2);color:var(--text-muted);font-size:11px;font-weight:700;padding:3px 8px;border-radius:999px;cursor:pointer}.lidl-badge.adam{background:#2563eb22;color:#1d4ed8;border-color:transparent}.lidl-badge.adka{background:#db277722;color:#be185d;border-color:transparent}@media (prefers-color-scheme: dark){.lidl-badge.adam{color:#60a5fa}.lidl-badge.adka{color:#f472b6}}.cancel-add{font-size:18px;font-weight:700}.confirm-add{background:var(--success);color:#fff}.cancel-add{background:var(--surface-2);color:var(--text-muted)}.fab-add{position:fixed;right:max(20px,calc(env(safe-area-inset-right) + 20px));bottom:max(20px,calc(env(safe-area-inset-bottom) + 20px));width:56px;height:56px;border-radius:50%;border:none;background:var(--accent);color:var(--accent-text);box-shadow:0 4px 14px #00000040;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:30}.fab-add svg{width:26px;height:26px}.fab-add:active{transform:scale(.94)}.autocomplete-wrap{position:relative}.add-item-input{width:100%;border:1.5px solid transparent;background:var(--surface-2);border-radius:12px;padding:12px 14px;font-size:15px;font-weight:500;min-width:0;transition:border-color .15s ease,background-color .15s ease}.add-item-input::placeholder{color:var(--text-muted);font-weight:400}.add-item-input:focus{outline:none;border-color:var(--accent);background:var(--surface)}.qty-picker{display:flex;align-items:center;gap:6px;background:var(--surface-2);border-radius:10px;padding:4px}.qty-picker button{width:30px;height:30px;border:none;background:var(--surface);border-radius:8px;font-weight:700;font-size:16px;cursor:pointer}.qty-picker .qty{min-width:20px;text-align:center;font-weight:700}.suggestions{position:absolute;top:100%;left:0;right:0;margin-top:6px;background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:var(--shadow);max-height:220px;overflow-y:auto;z-index:20}.suggestion-item{padding:12px 14px;cursor:pointer;font-size:14px;border-bottom:1px solid var(--border)}.suggestion-item:last-child{border-bottom:none}.suggestion-item:active,.suggestion-item.highlighted{background:var(--surface-2)}.drag-handle{width:34px;height:34px;border:none;background:transparent;color:var(--text-muted);border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0;padding:0;cursor:grab;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.drag-handle:active{cursor:grabbing;background:var(--surface-2)}.remove-confirm-popover{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:16;width:260px;max-width:calc(100vw - 40px);background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);padding:16px;display:flex;flex-direction:column;gap:12px;font-size:14px;font-weight:600;text-align:center}.list-header{cursor:pointer}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;display:flex;align-items:flex-end;justify-content:center;z-index:100}@media (min-width: 560px){.modal-overlay{align-items:center}}.modal-card{width:100%;max-width:560px;max-height:85vh;background:var(--surface);border-radius:18px 18px 0 0;display:flex;flex-direction:column;overflow:hidden}@media (min-width: 560px){.modal-card{border-radius:18px;max-height:80vh}}.modal-header{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--border);flex-shrink:0}.modal-title{flex:1;font-weight:700;font-size:15px}.modal-body{padding:16px;overflow-y:auto}.card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:12px;margin-bottom:16px}.card-thumb{position:relative;border-radius:12px;overflow:hidden;background:var(--surface-2);box-shadow:var(--shadow)}.card-thumb img{width:100%;aspect-ratio:4 / 3;object-fit:cover;display:block;cursor:pointer}.card-thumb-name{padding:6px 8px;font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.card-thumb-remove{position:absolute;top:6px;right:6px;width:24px;height:24px;border:none;border-radius:50%;background:#0000008c;color:#fff;cursor:pointer;font-size:12px}.card-upload{display:flex;flex-direction:column;gap:8px;padding-top:12px;border-top:1px solid var(--border)}.card-upload input[type=text]{border:1px solid var(--border);background:var(--surface-2);border-radius:10px;padding:11px 13px;font-size:14px}.fullscreen-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000e6;display:flex;align-items:center;justify-content:center;z-index:200;padding:20px}.fullscreen-overlay img{max-width:100%;max-height:100%;object-fit:contain;border-radius:8px}.login-screen{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;gap:20px}.login-card{width:100%;max-width:340px;background:var(--surface);border-radius:var(--radius);padding:24px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:12px}.login-card h1{font-size:20px;margin:0 0 6px;text-align:center}.login-card form{display:flex;flex-direction:column;gap:12px}.login-card input{border:1px solid var(--border);background:var(--surface-2);border-radius:10px;padding:12px 14px;font-size:15px}.login-card button{border:none;background:var(--accent);color:var(--accent-text);padding:13px;border-radius:10px;font-weight:700;cursor:pointer;margin-top:4px}.login-error{color:var(--danger);font-size:13px;text-align:center;min-height:18px}.history-item-row{display:flex;align-items:center;gap:10px;background:var(--surface);border-radius:var(--radius);padding:10px 12px;margin-bottom:8px;box-shadow:var(--shadow)}.history-item-row .item-name{font-size:14px}.history-item-row .qty-badge{background:var(--surface-2);border-radius:8px;padding:4px 8px;font-weight:700;font-size:13px;flex-shrink:0}.spinner-wrap{display:flex;justify-content:center;padding:40px;color:var(--text-muted)}.swipe-row{position:relative}.swipe-row-bg-delete{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:var(--radius);background:var(--danger);color:#fff;display:flex;align-items:center;padding-left:22px;font-size:20px;z-index:0}.swipe-row-content{position:relative;z-index:1;touch-action:pan-y}.file-picker-row{display:flex;align-items:center;gap:10px}.file-picker-input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.file-picker-label{flex-shrink:0;display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);border-radius:var(--radius);padding:10px 14px;font-size:13px;font-weight:700;cursor:pointer;white-space:nowrap}.file-picker-input:focus-visible+.file-picker-label{outline:2px solid var(--accent);outline-offset:2px}.file-picker-filename{flex:1;min-width:0;font-size:12px;color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.upload-submit-btn{border:none;background:var(--accent);color:var(--accent-text);border-radius:var(--radius);padding:11px 14px;font-weight:700;font-size:14px;cursor:pointer}.upload-submit-btn:disabled{opacity:.6;cursor:default}
