:root{--bg: #f6f5f1;--surface: #ffffff;--surface-2: #efede7;--text: #1c1b19;--muted: #6b6860;--border: #e2dfd7;--brand: #0f766e;--brand-ink: #ffffff;--brand-soft: #e3f2ef;--owed: #b45309;--owed-soft: #fdf1e3;--paid: #15803d;--danger: #b91c1c;--danger-soft: #fdeaea;--shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 16px rgb(0 0 0 / .06);--radius: 14px;--tabbar-h: 64px;color-scheme:light}@media (prefers-color-scheme: dark){:root:not([data-theme=light]){--bg: #141413;--surface: #1e1e1c;--surface-2: #2a2a27;--text: #f1efe9;--muted: #a19e95;--border: #34332f;--brand: #2dd4bf;--brand-ink: #062b27;--brand-soft: #123a35;--owed: #f59e0b;--owed-soft: #3a2a10;--paid: #4ade80;--danger: #f87171;--danger-soft: #3b1616;--shadow: 0 1px 2px rgb(0 0 0 / .4);color-scheme:dark}}:root[data-theme=dark]{--bg: #141413;--surface: #1e1e1c;--surface-2: #2a2a27;--text: #f1efe9;--muted: #a19e95;--border: #34332f;--brand: #2dd4bf;--brand-ink: #062b27;--brand-soft: #123a35;--owed: #f59e0b;--owed-soft: #3a2a10;--paid: #4ade80;--danger: #f87171;--danger-soft: #3b1616;--shadow: 0 1px 2px rgb(0 0 0 / .4);color-scheme:dark}*{box-sizing:border-box}html{-webkit-text-size-adjust:100%}body{margin:0;background:var(--bg);color:var(--text);font:16px/1.4 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;-webkit-tap-highlight-color:transparent}h1,h2,h3{margin:0;line-height:1.2}h3{font-size:1rem;margin:20px 0 8px}section>h3:first-child,.card>h3:first-child{margin-top:0}button,input,select{font:inherit;color:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}:focus-visible{outline:2px solid var(--brand);outline-offset:2px}.num{font-variant-numeric:tabular-nums;white-space:nowrap}.muted{color:var(--muted)}.small{font-size:.875rem}.center{text-align:center}.grow{flex:1;min-width:0}.owed{color:var(--owed)}.paid{color:var(--paid)}.warn-text{color:var(--owed)}.app-head{position:sticky;top:0;z-index:5;background:var(--bg);padding:calc(env(safe-area-inset-top) + 12px) 16px 10px;border-bottom:1px solid var(--border)}.app-head .brand{font-size:.75rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--brand)}.app-head h1{font-size:1.375rem}.app-main{max-width:720px;margin:0 auto;padding:12px 16px calc(var(--tabbar-h) + 96px + env(safe-area-inset-bottom))}.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:10;display:grid;grid-template-columns:repeat(5,1fr);height:calc(var(--tabbar-h) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);background:var(--surface);border-top:1px solid var(--border)}.tabbar button{border:0;background:none;color:var(--muted);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:.75rem;font-weight:500}.tabbar svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.tabbar button.on{color:var(--brand)}.tabbar button.on svg{stroke-width:2.2}.primary,.secondary,.ghost{min-height:48px;padding:0 18px;border-radius:12px;font-weight:600;display:inline-flex;align-items:center;justify-content:center;gap:6px}.primary{background:var(--brand);color:var(--brand-ink);border:0}.secondary{background:var(--brand-soft);color:var(--brand);border:0}.ghost{background:transparent;border:1px solid var(--border)}.block{display:flex;width:100%;margin-top:10px}.link{background:none;border:0;padding:0;color:var(--brand);font-weight:600;text-decoration:underline;text-underline-offset:2px}.icon-btn{width:44px;height:44px;border-radius:12px;border:0;background:var(--surface-2);font-size:1.25rem}.toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:12px}.chips{display:flex;gap:8px;overflow-x:auto;margin:0 -16px 12px;padding:0 16px;scrollbar-width:none}.chip{min-height:40px;padding:0 14px;border-radius:999px;white-space:nowrap;border:1px solid var(--border);background:var(--surface);font-weight:500}.chip.on{background:var(--text);color:var(--bg);border-color:var(--text)}input,select{width:100%;min-height:48px;padding:0 14px;border:1px solid var(--border);border-radius:12px;background:var(--surface)}input:focus,select:focus{outline:2px solid var(--brand);outline-offset:-1px;border-color:transparent}.search{flex:1}.field{display:flex;flex-direction:column;gap:6px;margin-top:12px}.field-label{font-size:.875rem;font-weight:600}.field-hint{font-size:.8125rem;color:var(--muted)}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}.grid2>.field:only-child{grid-column:1 / -1}.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px}.tile{position:relative;text-align:left;display:flex;flex-direction:column;gap:4px;min-height:104px;padding:12px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);transition:transform .08s}.tile:active{transform:scale(.97)}.tile.picked{border-color:var(--brand);box-shadow:0 0 0 1px var(--brand)}.tile-name{font-weight:600;line-height:1.25}.tile-price{font-variant-numeric:tabular-nums;font-size:1.0625rem;margin-top:auto}.tile-qty{font-size:.8125rem;color:var(--muted)}.tile-qty.low{color:var(--owed);font-weight:600}.tile-qty.out{color:var(--danger);font-weight:600}.tile-badge{position:absolute;top:8px;right:8px;min-width:26px;height:26px;padding:0 6px;border-radius:13px;background:var(--brand);color:var(--brand-ink);font-weight:700;font-size:.875rem;display:flex;align-items:center;justify-content:center}.cart-bar{position:fixed;left:0;right:0;z-index:9;bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom));display:flex;gap:10px;padding:10px 16px;background:color-mix(in srgb,var(--bg) 92%,transparent);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border-top:1px solid var(--border)}.cart-bar .primary{font-size:1.0625rem}.rows{list-style:none;margin:0;padding:0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}.rows li+li{border-top:1px solid var(--border)}.row{width:100%;display:flex;align-items:center;gap:12px;padding:12px 14px;min-height:60px;border:0;background:none;text-align:left}.row-title{display:block;font-weight:600}.row-sub{display:block;font-size:.8125rem;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row .num{font-weight:600}.tag{font-size:.6875rem;font-weight:600;text-transform:uppercase;padding:1px 6px;border-radius:6px;background:var(--surface-2);color:var(--muted);vertical-align:middle}.qty-pill{min-width:44px;padding:4px 10px;border-radius:999px;text-align:center;font-weight:700;font-variant-numeric:tabular-nums;background:var(--surface-2)}.qty-pill.low{background:var(--owed-soft);color:var(--owed)}.qty-pill.out{background:var(--danger-soft);color:var(--danger)}.history{list-style:none;margin:0;padding:0}.history li{display:flex;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--border)}.history li>.grow{display:flex;flex-direction:column}.history small{font-size:.8125rem}.lines{list-style:none;margin:0;padding:0}.lines li{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--border)}.stepper{display:inline-flex;align-items:center;gap:4px}.stepper button{width:36px;height:36px;border-radius:10px;border:0;background:var(--surface-2);font-size:1.125rem;font-weight:600}.stepper span{min-width:24px;text-align:center;font-weight:600;font-variant-numeric:tabular-nums}.total-row{display:flex;justify-content:space-between;align-items:baseline;padding:12px 0;font-size:1.125rem}.total-row strong{font-size:1.5rem}.change{font-weight:700;color:var(--paid);font-size:1.0625rem}.change.neg{color:var(--danger)}.segmented{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;background:var(--surface-2);border-radius:14px}.segmented button{min-height:44px;border:0;border-radius:10px;background:none;font-weight:600;color:var(--muted)}.segmented button.on{background:var(--surface);color:var(--text);box-shadow:var(--shadow)}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px;margin-bottom:14px}.card.accent{background:var(--brand-soft);border-color:transparent}.card p{margin:4px 0 0}.stat-hero{display:flex;flex-direction:column;gap:2px;padding:16px;margin-bottom:14px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius)}.stat-hero strong{font-size:2rem;letter-spacing:-.01em}.stat-hero.compact{border:0;padding:0 0 12px;background:none}.stats{display:grid;grid-template-columns:1fr 1fr;gap:10px}.stat{display:flex;flex-direction:column;gap:2px;padding:14px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius)}.stat>span{font-size:.8125rem;color:var(--muted)}.stat strong{font-size:1.25rem}.app-main>div>section:not(.card){margin-top:24px}.day-nav{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.pay-row{display:flex;gap:8px;margin-top:10px}.pay-row .primary{flex:none}.empty{text-align:center;padding:48px 16px;color:var(--muted)}.empty strong{display:block;color:var(--text);font-size:1.125rem;margin-bottom:6px}.empty p{margin:0}.sheet-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:20;background:#00000073;display:flex;align-items:flex-end;justify-content:center;animation:fade .15s}.sheet{width:100%;max-width:560px;max-height:92dvh;display:flex;flex-direction:column;background:var(--bg);border-radius:20px 20px 0 0;animation:up .2s ease-out}.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid var(--border)}.sheet-head h2{font-size:1.125rem}.sheet-body{overflow-y:auto;padding:16px 16px calc(24px + env(safe-area-inset-bottom))}.sheet-body>section+section{margin-top:18px}@media (min-width: 640px){.sheet-backdrop{align-items:center}.sheet{border-radius:20px}}@keyframes up{0%{transform:translateY(24px);opacity:0}}@keyframes fade{0%{opacity:0}}.toasts{position:fixed;left:16px;right:16px;top:calc(env(safe-area-inset-top) + 12px);z-index:30;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none}.toast{max-width:480px;padding:12px 16px;border-radius:12px;background:var(--text);color:var(--bg);font-weight:500;box-shadow:var(--shadow);animation:up .2s}.toast-error{background:var(--danger);color:#fff}@media (prefers-reduced-motion: reduce){*{animation:none!important;transition:none!important}}
