:root{
  --bg:#0e0f12;--s1:#17181d;--s2:#1f2128;--line:#262830;
  --tx:#f4f5f7;--mut:#a3a7b3;--dim:#8a8f9c;
  --acc:#7c8cff;--in:#7ee0a6;--due:#ff8a80;--wait:#e6b866;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--tx);
  font-family:Onest,system-ui,sans-serif;font-variant-numeric:tabular-nums;-webkit-text-size-adjust:100%}
[hidden]{display:none!important}
.app{max-width:520px;margin:0 auto;min-height:100%;display:flex;flex-direction:column}
.center{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:24px;text-align:center}
.center h1{margin:4px 0 0;font-size:28px;letter-spacing:-.02em}
.muted{color:var(--mut);margin:0}
.err{color:var(--due);margin:0;max-width:320px}
.btn{min-height:52px;padding:0 22px;border:0;border-radius:14px;font:inherit;font-size:16px;font-weight:600;cursor:pointer}
.btn.primary{background:var(--acc);color:var(--bg)}
.btn.ghost{background:var(--s2);color:var(--tx);font-weight:500}
#v-main{flex:1;display:flex;flex-direction:column;min-height:100dvh}
.top{display:flex;align-items:center;justify-content:space-between;padding:calc(16px + env(safe-area-inset-top)) 20px 8px}
.top h1{margin:0;font-size:26px;letter-spacing:-.02em}
.avatar{width:38px;height:38px;border-radius:50%;border:0;background:var(--acc);color:var(--bg);font:inherit;font-weight:700;font-size:14px;cursor:pointer}
.screen{flex:1;padding:6px 16px 16px;display:flex;flex-direction:column;gap:14px}
.card{background:var(--s1);border-radius:18px;padding:16px;display:flex;flex-direction:column;gap:6px}
.card h2{margin:0;font-size:17px}
.nav{position:sticky;bottom:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:8px 8px calc(12px + env(safe-area-inset-bottom));background:var(--bg);border-top:1px solid var(--s2)}
.nav a{display:flex;flex-direction:column;align-items:center;gap:4px;min-height:48px;justify-content:center;text-decoration:none;color:var(--dim);font-size:12px;font-weight:500}
.nav svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.nav a[aria-current=page]{color:var(--tx);font-weight:600}
.nav a[aria-current=page] svg{stroke:var(--acc)}

/* ---------- wspólne elementy ekranów */
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.top .back{color:var(--mut);text-decoration:none;font-size:15px;min-height:40px;display:flex;align-items:center}
.top-l{display:flex;flex-direction:column;gap:2px;min-width:0}
.top-r{display:flex;gap:8px;align-items:center}
.iconbtn{width:42px;height:42px;border-radius:12px;border:0;background:var(--s2);color:var(--tx);display:grid;place-items:center;cursor:pointer}
.iconbtn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.btn.sm{min-height:40px;padding:0 14px;font-size:14px;border-radius:12px}
.btn.wide{width:100%}
.btn:disabled{opacity:.5;cursor:default}
a.btn{display:flex;align-items:center;justify-content:center;text-decoration:none}
.row{display:flex;gap:8px;align-items:center}
.row>.grow{flex:1;min-width:0}
.sec{display:flex;flex-direction:column;gap:8px}
.sec>h2{margin:4px 4px 0;font-size:15px;font-weight:600}
.big{font-size:34px;font-weight:700;letter-spacing:-.02em}
.mid{font-size:20px;font-weight:700;line-height:1.25}
.small{font-size:13px;color:var(--mut)}
.in{color:var(--in)}.due{color:var(--due)}.wait{color:var(--wait)}
.list{background:var(--s1);border-radius:16px;display:flex;flex-direction:column;overflow:hidden}
.li{display:flex;align-items:center;gap:12px;min-height:60px;padding:8px 16px;color:var(--tx);text-decoration:none;border:0;background:none;font:inherit;text-align:left;width:100%;cursor:pointer}
.li+.li{border-top:1px solid var(--line)}
.li .t{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.li .t b{font-weight:500;font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.li .t span{font-size:13px;color:var(--mut)}
.li .r{flex:none;font-size:15px;font-weight:600;text-align:right}
.li .chev{color:var(--mut)}
.ico{width:40px;height:40px;border-radius:12px;background:#23252d;display:grid;place-items:center;flex:none}
.ico svg{width:20px;height:20px;fill:none;stroke:#c3c7d1;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.thumb{width:48px;height:48px;border-radius:10px;background:var(--s2);object-fit:cover;flex:none}
.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.tile{background:var(--s1);border-radius:16px;padding:14px;min-height:84px;display:flex;flex-direction:column;justify-content:space-between;gap:8px;color:var(--tx);text-decoration:none;border:0;font:inherit;text-align:left;cursor:pointer}
.tile svg{width:22px;height:22px;fill:none;stroke:var(--acc);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.tile b{font-size:15px;font-weight:600}
.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.stat{background:var(--s1);border-radius:14px;padding:12px;display:flex;flex-direction:column;gap:2px}
.stat span{font-size:13px;color:var(--mut)}.stat b{font-size:22px}
.kv{display:flex;justify-content:space-between;gap:10px;font-size:15px}
.kv>span:first-child{color:var(--mut);min-width:0}
.kv>b{flex:none;white-space:nowrap}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{min-height:44px;border:0;border-radius:999px;padding:0 14px;font:inherit;font-size:14px;background:var(--s2);color:var(--tx);font-weight:500;cursor:pointer}
.chip[aria-pressed=true]{background:var(--tx);color:var(--bg);font-weight:600}
.field{display:flex;flex-direction:column;gap:6px;font-size:14px;color:var(--mut)}
.input,textarea.input{min-height:48px;border:0;border-radius:12px;background:var(--s2);color:var(--tx);font:inherit;font-size:16px;padding:12px 14px;outline:none;width:100%}
textarea.input{min-height:120px;resize:vertical;line-height:1.4}
.input:focus{box-shadow:0 0 0 2px var(--acc)}
.stepper{display:flex;align-items:center;background:var(--s2);border-radius:14px;width:max-content}
.stepper button{width:52px;height:52px;border:0;background:none;color:var(--tx);font:inherit;font-size:24px;cursor:pointer}
.stepper b{min-width:36px;text-align:center;font-size:18px}
.grid5{display:grid;grid-template-columns:28px repeat(5,minmax(0,1fr));gap:6px;align-items:center}
.grid5 .L{font-weight:700;color:var(--mut);text-align:center}
.cell{min-height:44px;border:0;border-radius:10px;background:var(--s2);color:var(--tx);font:inherit;font-size:15px;cursor:pointer;position:relative}
.cell[aria-pressed=true]{background:var(--acc);color:var(--bg);font-weight:700}
.cell.done::after{content:'';position:absolute;top:6px;right:6px;width:6px;height:6px;border-radius:50%;background:var(--in)}
.now{background:var(--acc);color:var(--bg);border-radius:18px;padding:14px 16px;display:flex;flex-direction:column;gap:2px}
.now b{font-size:28px}
.photos{display:flex;gap:8px;overflow-x:auto}
.photos img,.photos .add{width:96px;height:96px;border-radius:14px;object-fit:cover;flex:none;background:var(--s2)}
.photos .add{display:grid;place-items:center;color:var(--mut);font-size:13px;border:2px dashed #3a3d47;cursor:pointer;text-align:center;padding:6px}
.hero{width:100%;aspect-ratio:4/3;border-radius:18px;background:var(--s2);object-fit:cover;display:grid;place-items:center;color:var(--dim);font-size:14px}
.sticky-foot{position:sticky;bottom:calc(68px + env(safe-area-inset-bottom));background:var(--bg);padding:10px 0 4px;display:flex;flex-direction:column;gap:8px}
.empty{color:var(--mut);text-align:center;padding:24px 8px;font-size:14px}
.heat{display:grid;grid-template-columns:28px repeat(5,minmax(0,1fr)) 1fr;gap:4px;align-items:center}
.heat i{display:block;height:18px;border-radius:4px}
.heat .L{font-weight:700;color:var(--mut);text-align:center;font-size:14px}
.heat .d{font-size:12px;color:var(--mut);padding-left:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sheet{position:fixed;inset:0;background:rgba(0,0,0,.6);display:flex;align-items:flex-end;justify-content:center;z-index:40}
.sheet>div{background:var(--s1);border-radius:20px 20px 0 0;padding:16px 16px calc(16px + env(safe-area-inset-bottom));width:100%;max-width:520px;max-height:88dvh;overflow:auto;display:flex;flex-direction:column;gap:12px}
.toast{position:fixed;left:50%;bottom:96px;transform:translate(-50%,20px);background:var(--tx);color:var(--bg);padding:12px 16px;border-radius:12px;font-weight:600;opacity:0;pointer-events:none;transition:.2s;z-index:60;max-width:90vw}
.toast.show{opacity:1;transform:translate(-50%,0)}
.toast.err{background:var(--due)}
.scan{position:fixed;inset:0;background:#000;z-index:50;display:flex;flex-direction:column}
.scan-top{display:flex;justify-content:space-between;align-items:center;padding:calc(12px + env(safe-area-inset-top)) 16px 12px}
.scan-t{font-weight:600}
.scan-view{position:relative;flex:1;overflow:hidden}
.scan-view video{width:100%;height:100%;object-fit:cover}
.scan-frame{position:absolute;left:50%;top:45%;width:62vmin;height:62vmin;transform:translate(-50%,-50%);border:3px solid var(--acc);border-radius:20px;box-shadow:0 0 0 100vmax rgba(0,0,0,.35)}
.scan-msg{position:absolute;left:0;right:0;bottom:16px;text-align:center;margin:0;font-weight:600;text-shadow:0 1px 4px #000}
.scan-hand{display:flex;gap:8px;padding:12px 16px calc(16px + env(safe-area-inset-bottom));background:var(--bg)}
.scan-hand input{flex:1;min-height:44px;border:0;border-radius:12px;background:var(--s2);color:var(--tx);font:inherit;font-size:16px;padding:0 12px}
.pill{font-size:12px;font-weight:600;padding:3px 8px;border-radius:999px;background:var(--s2);color:var(--mut)}
.pill.wait{background:rgba(230,184,102,.14);color:var(--wait)}
.pill.ok{background:rgba(124,140,255,.16);color:#a9b4ff}
