/* Additions for the live app (on top of styles.css from the prototype) */
[hidden] { display: none !important; }
body { margin: 0; }
img { max-width: 100%; }
html, body { min-height: 100%; }
body { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.login form { gap: 14px; }
.login h1 { color: var(--fg); }
.login .row2 .link { padding: 4px 0; }
.cell[readonly] { background: transparent; border-color: transparent; box-shadow: none; }

/* print only the bill that is open — copied into #printroot and shrunk to fit one page */
#printroot{display:none}
#printroot.measure{display:block;position:fixed;left:-20000px;top:0;visibility:hidden;background:#fff}
#printroot .coform{border:0;padding:0;gap:10px}
#printroot .coform .scroll{overflow:visible}
#printroot .coform table{min-width:0;font-size:12px}
#printroot .coform th,#printroot .coform td{padding:5px 6px}
#printroot .receipt{background:#fff;padding:0}
#printroot.bw{filter:grayscale(1)}
#printroot.bw .coform .mn,#printroot.bw .tile.acc .v{color:#000}
/* A4 grid of person bills */
#printroot .a4sheet{width:200mm;display:grid;break-after:page;page-break-after:always}
#printroot .a4sheet:last-child{break-after:auto;page-break-after:auto}
#printroot .a4cell{border:1px dashed #BDBDC2;margin:-.5px;padding:2.5mm;box-sizing:border-box;overflow:hidden}
#printroot .a4cell .receipt{width:100%}
/* receipt printer strip */
#printroot.slip .receipt{padding:0;background:#fff;color:#000;font-size:12px}
#printroot.slip .receipt *{color:#000 !important}
#printroot.slip .receipt h2{font-size:15px}
#printroot.slip .receipt th,#printroot.slip .receipt td{padding:2px 0;border-color:#000}
#printroot.slip .tear{border-top:1.5px dashed #000;margin:5mm 0}
#printroot.slip .tail{height:3mm}
#printroot table{break-inside:auto}
#printroot tr{break-inside:avoid}
@media print {
  body.printing > *:not(#printroot){display:none !important}
  body.printing #printroot{display:block;position:static;visibility:visible}
  body{background:#fff !important}
}
/* payment channel */
.payqr{width:132px;height:132px;flex:none;object-fit:contain;border-radius:12px;background:#fff;border:1px solid var(--sep)}
.payno{display:flex;align-items:center;gap:10px;font-weight:600;font-size:1.05rem;font-variant-numeric:tabular-nums}
.qrset{display:flex;gap:16px;align-items:flex-start;flex-wrap:wrap}
.qrbox{width:160px;height:160px;flex:none;display:flex;align-items:center;justify-content:center;border:1.5px dashed #B9CFEA;border-radius:14px;background:#F7FAFE;color:var(--accent);cursor:pointer;text-align:center;padding:8px;overflow:hidden}
.qrbox img{max-width:100%;max-height:100%;object-fit:contain}
.qrfields{flex:1;min-width:220px;display:flex;flex-direction:column;gap:12px}
.qrfields .pf .inp{text-align:left}
@media (max-width:520px){.paybox{flex-direction:column;align-items:flex-start}}
.locbox{display:flex;justify-content:space-between;align-items:center;gap:12px;background:var(--fill);border-radius:12px;padding:12px}
.locbox b{font-variant-numeric:tabular-nums}
.locinfo{display:flex;flex-direction:column;gap:2px;min-width:0}
.locinfo .maplink{align-self:flex-start}
.locbox .spin{width:24px;height:24px;margin-right:8px}
.alist .lrow:first-child{border-top:0;padding-top:0}
.alist{display:flex;flex-direction:column;gap:10px}

/* price rows with their own QR */
.prow2{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;border-top:1px solid var(--sep);padding-top:14px}
.group .gh+.prow2{border-top:0;padding-top:0}
.ptxt{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}
.ptxt .pin{margin-top:4px}
.qrbox.sm{width:112px;height:112px;font-size:.85rem}
.qrbox.stale{border-color:#FF9500;opacity:.6}
.warnline{font-size:.8rem;color:#A85B00;background:#FFF4E0;border-radius:8px;padding:6px 8px}
.qrfields.two{flex-direction:row;flex-wrap:wrap;border-top:1px solid var(--sep);padding-top:14px}
.qrfields.two .pf{flex:1;min-width:200px}

/* plan comparison */
.plancmp{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.plancmp .pc{border:1px solid var(--sep);border-radius:14px;padding:12px 14px;display:flex;flex-direction:column;gap:2px;background:var(--card)}
.plancmp .pc.best{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset}
.plancmp .k{font-size:.8rem;color:var(--muted);font-weight:600;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.plancmp .pv{font-size:1.35rem;font-weight:700;font-variant-numeric:tabular-nums}
.plancmp .pv small{font-size:.8rem;color:var(--muted);font-weight:500}
.savebdg{background:#E8F7EE;color:#1E7B3C;border-radius:980px;padding:1px 8px;font-size:.72rem}
.cmpwrap{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--sep);padding-top:14px}
.cmpwrap>.k{font-size:.8rem;color:var(--muted);font-weight:500}
@media (max-width:420px){.plancmp{grid-template-columns:1fr}}

/* trial switch */
.trialrow{display:flex;align-items:center;gap:14px;border-top:1px solid var(--sep);padding-top:14px}
.switch{position:relative;width:51px;height:31px;flex:none;cursor:pointer}
.switch input{position:absolute;opacity:0;width:100%;height:100%;margin:0;cursor:pointer}
.switch .sl{position:absolute;inset:0;background:#E9E9EB;border-radius:999px;transition:background .2s}
.switch .sl::after{content:"";position:absolute;top:2px;left:2px;width:27px;height:27px;border-radius:50%;background:#fff;box-shadow:0 2px 4px rgba(0,0,0,.2);transition:transform .2s}
.switch input:checked+.sl{background:#34C759}
.switch input:checked+.sl::after{transform:translateX(20px)}
.switch input:focus-visible+.sl{outline:3px solid rgba(0,113,227,.4);outline-offset:2px}
.trialrow .pin .inp{width:80px}
.trialrow .inp:disabled{opacity:.4}
.pill.del{background:#EDEDF0;color:#8E8E93;text-decoration:line-through}
.purgelink{display:flex;align-items:center;gap:8px;border-top:1px solid var(--sep);padding-top:10px}

.plancmp.pick .pc{cursor:pointer;text-align:left;font:inherit;color:inherit;transition:border-color .15s,box-shadow .15s}
.plancmp.pick .pc:hover{border-color:#B9CFEA}
.plancmp.pick .pc.sel{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent) inset;background:var(--accent-soft)}
.plancmp .chk{color:var(--accent);font-size:.75rem}

.bspin{display:inline-block;width:16px;height:16px;margin-right:8px;vertical-align:-3px;border-radius:50%;border:2.5px solid rgba(255,255,255,.4);border-top-color:#fff;animation:sp .8s linear infinite}
.btn.solid:disabled{opacity:.85}
@media (prefers-reduced-motion:reduce){.bspin{animation:none}}

/* sent / done states */
.donebox{display:flex;gap:12px;align-items:center;background:#E8F7EE;border-radius:14px;padding:14px}
.okmark{width:26px;height:26px;flex:none;border-radius:50%;background:#34C759;position:relative;animation:okpop .35s ease-out}
.okmark::after{content:"";position:absolute;left:9px;top:5px;width:6px;height:12px;border:solid #fff;border-width:0 3px 3px 0;transform:rotate(45deg)}
.sentok{display:flex;gap:10px;align-items:center;justify-content:center;background:#E8F7EE;color:#1E7B3C;border-radius:980px;padding:12px}
@keyframes okpop{0%{transform:scale(.4);opacity:0}70%{transform:scale(1.12)}100%{transform:scale(1);opacity:1}}
@media (prefers-reduced-motion:reduce){.okmark{animation:none}}

/* fullscreen corner */
.fszone{position:fixed;right:0;bottom:0;width:120px;height:120px;z-index:60;display:flex;align-items:flex-end;justify-content:flex-end;padding:0 16px 16px 0;box-sizing:border-box;pointer-events:auto}
.fsbtn{width:44px;height:44px;border-radius:50%;border:0;background:rgba(29,29,31,.72);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 14px rgba(0,0,0,.18);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);opacity:0;transform:scale(.85);transition:opacity .2s,transform .2s}
.fszone:hover .fsbtn,.fsbtn:focus-visible{opacity:1;transform:scale(1)}
.fsbtn:focus-visible{outline:3px solid rgba(0,113,227,.5);outline-offset:2px}
@media (hover:none){.fszone{display:none}}
@media print{.fszone{display:none}}

/* expiry chip (next to the week tab) */
.tabrow{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:0}
.expchip{display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;font:inherit;font-size:.85rem;color:#B3261E;cursor:pointer;padding:6px 8px;border-radius:980px;white-space:nowrap}
.expchip b{font-weight:600;color:var(--accent);margin-left:2px}
.expchip:hover{background:rgba(255,59,48,.08)}
.expchip:focus-visible{outline:3px solid rgba(0,113,227,.4);outline-offset:1px}
.rdot{width:8px;height:8px;border-radius:50%;background:#FF3B30;flex:none;animation:rblink 1.1s ease-in-out infinite}
@keyframes rblink{0%,100%{opacity:1}50%{opacity:.15}}
@media (prefers-reduced-motion:reduce){.rdot{animation:none}}

/* bill picture */
.imgshot{position:fixed;left:-20000px;top:0}
.imgcard{width:380px;background:#ECECF0;padding:20px;box-sizing:border-box;font-family:inherit}
.imgcard.wide{width:max-content;min-width:760px}
.imgcard *{white-space:nowrap}
.imgcard .cohead,.imgcard .cofoot{flex-wrap:nowrap}
.imgcard .cofoot .co{padding-bottom:6px}
.imgcard .printable{background:#fff;border-radius:18px;padding:22px;box-shadow:0 1px 3px rgba(0,0,0,.06);border:0}
.imgcard .coform .scroll{overflow:visible}
.imgcard .coform table{min-width:0}
.imgfoot{text-align:center;font-size:11px;color:#86868B;margin-top:10px;letter-spacing:.3px}
.bspin.dark{border-color:rgba(0,113,227,.25);border-top-color:var(--accent)}
.okmark.sm{width:16px;height:16px;margin-right:6px;vertical-align:-3px;display:inline-block}
.okmark.sm::after{left:5px;top:2px;width:4px;height:8px;border-width:0 2px 2px 0}

/* print-all row and wide setting pills */
.printall{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin:12px 0 4px;flex-wrap:wrap}
.days.opt{display:flex;width:fit-content;max-width:100%}
.days.opt .dpill{padding:9px 16px}

/* small brand line at the bottom of every bill */
.printable .brand{text-align:center;font-size:10px;color:#AEAEB2;letter-spacing:.4px;margin-top:10px;font-weight:500}
.coform .brand{margin-top:0}
#printroot.slip .printable .brand{color:#000 !important;font-size:9px}
/* keep DoMyBill at the very bottom of each bill box when bills are laid out on A4 */
#printroot .a4cell{display:flex;flex-direction:column}
#printroot .a4cell > .printable{flex:1;display:flex;flex-direction:column}
#printroot .a4cell > .printable .brand{margin-top:auto;padding-top:6px}

/* legal pages */
.legal{max-width:720px;margin:0 auto;padding-block:32px 48px;display:flex;flex-direction:column;gap:16px}
.legal .back{align-self:flex-start;text-decoration:none}
.legal .paper{padding:28px 28px 32px;line-height:1.75}
.legal h1{font-size:1.7rem;margin:0 0 2px;letter-spacing:-.01em}
.legal h2{font-size:1.08rem;margin:26px 0 6px}
.legal p{margin:6px 0}
.legal ul{margin:6px 0;padding-left:1.3em}
.legal li{margin:4px 0}
.legal .contact{list-style:none;padding:0}
.legal a{color:var(--accent)}
.lfoot{text-align:center}
.lfoot a{color:inherit}
.legalnote{font-size:.8rem;color:var(--muted);text-align:center;margin:0}
.legalnote a{color:var(--muted)}
.agree{display:flex;gap:10px;align-items:flex-start;font-size:.88rem;color:var(--muted);line-height:1.5}
.agree input{width:18px;height:18px;margin:2px 0 0;flex:none;accent-color:var(--accent)}
.agree a{color:var(--accent)}
@media (max-width:520px){.legal .paper{padding:20px}}

/* ---------- live chat ---------- */
.haschat .fszone{right:76px}
#chatw{position:fixed;right:20px;bottom:20px;z-index:70;display:flex;flex-direction:column;align-items:flex-end;gap:12px}
.chatfab{position:relative;width:56px;height:56px;border-radius:50%;border:0;background:var(--accent);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 8px 24px rgba(0,113,227,.35);transition:transform .15s}
.chatfab:hover{transform:scale(1.05)}
.chatfab.on{background:#1D1D1F;box-shadow:0 8px 24px rgba(0,0,0,.25)}
.chatfab:focus-visible{outline:3px solid rgba(0,113,227,.45);outline-offset:3px}
.rdot.big{position:absolute;top:2px;right:2px;width:14px;height:14px;border:2px solid #fff}
.chatbox{width:min(380px,calc(100vw - 32px));height:min(560px,calc(100vh - 120px));background:var(--card);border-radius:20px;box-shadow:0 20px 60px rgba(0,0,0,.22);overflow:hidden;display:flex}
.chpane{position:relative;display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;background:var(--card)}
.chhead{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;border-bottom:1px solid var(--sep)}
.chwho{display:flex;flex-direction:column;min-width:0}
.chwho b{font-size:1rem}
.chwho span{font-size:.78rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chx{border:0;background:var(--fill);color:var(--muted);width:30px;height:30px;border-radius:50%;cursor:pointer;font:inherit;line-height:1}
.chx.big{font-weight:700}
.chlist{flex:1;overflow-y:auto;padding:12px 12px 6px;display:flex;flex-direction:column;gap:2px;overscroll-behavior:contain}
.chday{align-self:center;font-size:.72rem;color:var(--muted);margin:10px 0 6px}
.chrow{display:flex}
.chrow.me{justify-content:flex-end}
.chrow.tail{margin-bottom:6px}
.chb{max-width:78%;padding:8px 12px;border-radius:18px;background:var(--fill);color:var(--fg);font-size:.95rem;line-height:1.45;overflow-wrap:anywhere;white-space:pre-wrap}
.chrow.me .chb{background:var(--accent);color:#fff}
.chrow.them.tail .chb{border-bottom-left-radius:6px}
.chrow.me.tail .chb{border-bottom-right-radius:6px}
.chb.fail{background:#FFECEA;color:#B3261E;cursor:pointer}
.chpic{display:block;max-width:100%;max-height:260px;border-radius:12px;margin:-2px -6px 4px;cursor:zoom-in;background:rgba(0,0,0,.05);min-width:80px;min-height:60px;object-fit:cover}
.chb .chpic:last-child{margin-bottom:-2px}
.chstat{align-self:flex-end;font-size:.72rem;color:var(--muted);margin:-2px 4px 6px;display:flex;align-items:center;gap:4px}
.chfail{color:#B3261E}
.bspin.sm{width:11px;height:11px;border-width:2px;margin:0}
.chb.typing{display:flex;gap:4px;padding:12px 14px}
.chb.typing i{width:7px;height:7px;border-radius:50%;background:#8E8E93;animation:chdot 1.2s infinite ease-in-out}
.chb.typing i:nth-child(2){animation-delay:.15s}.chb.typing i:nth-child(3){animation-delay:.3s}
@keyframes chdot{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
.chempty{margin:auto;text-align:center;color:var(--muted);font-size:.9rem;padding:24px;line-height:1.6}
.chempty .note{margin-top:6px}
.chcomp{border-top:1px solid var(--sep);padding:10px;display:flex;flex-direction:column;gap:8px}
.chprev{position:relative;align-self:flex-start}
.chprev img{display:block;max-height:120px;max-width:200px;border-radius:12px}
.chprev .chx{position:absolute;top:-8px;right:-8px;background:#1D1D1F;color:#fff;width:24px;height:24px;font-size:.75rem}
.chin{display:flex;align-items:flex-end;gap:8px}
.chin textarea{flex:1;resize:none;border:1px solid var(--boxline);border-radius:20px;padding:9px 14px;font:inherit;font-size:.95rem;line-height:1.4;max-height:140px;background:var(--box);color:var(--fg);outline:none}
.chin textarea:focus{border-color:var(--accent);background:#fff}
.chbtn,.chsend{width:38px;height:38px;flex:none;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;border:0}
.chbtn{background:transparent;color:var(--accent)}
.chbtn:hover{background:var(--accent-soft)}
.chsend{background:var(--accent);color:#fff}
.chdrop{position:absolute;inset:8px;border:2px dashed var(--accent);border-radius:16px;background:rgba(234,243,254,.94);display:none;align-items:center;justify-content:center;text-align:center;color:var(--accent);z-index:5;pointer-events:none}
.chdrop div{display:flex;flex-direction:column;align-items:center;gap:6px}
.chdrop svg{width:40px;height:40px}
.chdrop span{font-size:.8rem;color:var(--muted)}
.chpane.dragging .chdrop{display:flex}
.chzoom{position:fixed;inset:0;z-index:200;background:rgba(0,0,0,.85);display:flex;align-items:center;justify-content:center;cursor:zoom-out;padding:20px}
.chzoom img{max-width:100%;max-height:100%;border-radius:8px}
/* admin chat page */
.achat{display:grid;grid-template-columns:300px 1fr;height:calc(100vh - 220px);min-height:460px;background:var(--card);border-radius:20px;box-shadow:var(--shadow);overflow:hidden}
.convs{border-right:1px solid var(--sep);overflow-y:auto;display:flex;flex-direction:column}
.convh{padding:16px;font-weight:700;border-bottom:1px solid var(--sep)}
.conv{display:flex;align-items:center;gap:10px;padding:12px 14px;border:0;background:transparent;text-align:left;font:inherit;color:inherit;cursor:pointer;border-bottom:1px solid var(--sep)}
.conv:hover{background:var(--box)}
.conv.on{background:var(--accent-soft)}
.cava{position:relative;width:40px;height:40px;flex:none;border-radius:50%;background:var(--fill);display:flex;align-items:center;justify-content:center;font-weight:700;color:var(--accent)}
.cava .con{position:absolute;right:0;bottom:0;width:11px;height:11px;border-radius:50%;background:#34C759;border:2px solid #fff}
.cmid{flex:1;min-width:0;display:flex;flex-direction:column}
.cmid span{font-size:.82rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.conv.new .cmid b,.conv.new .cmid span{color:var(--fg);font-weight:700}
.cmid em{color:var(--accent);font-style:normal}
.cend{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.cend small{color:var(--muted);font-size:.72rem}
.cn{background:#FF3B30;color:#fff;border-radius:980px;font-size:.7rem;padding:1px 7px;font-weight:700}
.convpane{display:flex;flex-direction:column;min-width:0;min-height:0}
.chback{display:none;padding:10px 14px}
.tab .rdot{display:inline-block;width:8px;height:8px;margin-left:4px;vertical-align:1px}
@media (max-width:760px){
  .achat{grid-template-columns:1fr;height:calc(100vh - 200px)}
  .achat.has .convs{display:none}
  .achat:not(.has) .convpane{display:none}
  .chback{display:block}
}
@media print{#chatw{display:none}}

/* full-size slip */
img[data-slip]{cursor:zoom-in}
.slipzoom{flex-direction:column;gap:14px}
.slipzoom img{max-height:calc(100% - 70px)}
.zbar{display:flex;gap:10px}

/* weekly cut: names centred */
.book .name.ctr,.book .name.ctr .calc{text-align:center;justify-content:center}

.legal a.quiet{color:inherit;text-decoration:none}
.legal a.quiet:hover{text-decoration:underline}

/* login: centred on screen, about links tucked away */
.login{min-height:100vh;min-height:100dvh;padding-block:40px;box-sizing:border-box}
.aboutbtn{align-self:center;border:0;background:none;font:inherit;font-size:.78rem;color:var(--faint);cursor:pointer;padding:6px 12px;border-radius:980px}
.aboutbtn:hover{color:var(--muted)}
.aboutbtn:focus-visible{outline:2px solid rgba(0,113,227,.4)}
/* about popup */
.aboutdlg{border:0;padding:28px 28px 22px;width:min(420px,calc(100vw - 40px));border-radius:22px;background:var(--card);color:var(--fg);box-shadow:0 30px 80px rgba(0,0,0,.22);animation:abIn .22s ease-out}
.aboutdlg::backdrop{background:rgba(0,0,0,.32);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);animation:abFade .22s}
.aboutdlg.closing{animation:abOut .22s ease-in forwards}
.aboutdlg.closing::backdrop{animation:abFadeOut .22s forwards}
.aboutdlg .grab{display:none}
.aboutdlg h2{margin:0;font-size:1.5rem;letter-spacing:-.01em}
.aboutdlg .lead{margin:4px 0 18px;color:var(--muted)}
.aboutdlg .feat{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px;border-top:1px solid var(--sep);padding-top:16px}
.aboutdlg .feat li{display:flex;flex-direction:column}
.aboutdlg .feat b{font-size:.95rem}
.aboutdlg .feat span{font-size:.88rem;color:var(--muted)}
.aboutdlg .links{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}
.aboutdlg .links a{font-size:.85rem;color:var(--fg);background:var(--fill);padding:7px 14px;border-radius:980px;text-decoration:none}
.aboutdlg .links a:hover{background:var(--sep)}
.aboutdlg .by{margin:18px 0 0;font-size:.8rem;color:var(--muted)}
.aboutdlg .by a{color:inherit;text-decoration:none}
.aboutdlg .by a:hover{text-decoration:underline}
.aboutdlg form{display:flex;justify-content:flex-end;margin-top:14px}
@keyframes abIn{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}
@keyframes abOut{to{opacity:0;transform:translateY(8px) scale(.98)}}
@keyframes abFade{from{opacity:0}}
@keyframes abFadeOut{to{opacity:0}}
@media (max-width:560px){
  .aboutdlg{margin:auto 0 0;width:100%;max-width:100%;border-radius:22px 22px 0 0;padding:12px 22px calc(20px + env(safe-area-inset-bottom,0px));animation:abUp .3s cubic-bezier(.2,.8,.2,1)}
  .aboutdlg.closing{animation:abDown .22s ease-in forwards}
  .aboutdlg .grab{display:block;width:40px;height:5px;border-radius:3px;background:var(--sep);margin:0 auto 16px}
  .aboutdlg form .btn{width:100%}
}
@keyframes abUp{from{transform:translateY(100%)}to{transform:none}}
@keyframes abDown{to{transform:translateY(100%)}}
@media (prefers-reduced-motion:reduce){.aboutdlg,.aboutdlg.closing,.aboutdlg::backdrop{animation:none}}

/* offline / retry pill */
#netbar{position:fixed;top:12px;left:50%;transform:translateX(-50%);z-index:150;padding:7px 16px;border-radius:980px;font-size:.85rem;font-weight:600;box-shadow:0 6px 20px rgba(0,0,0,.15);white-space:nowrap;max-width:calc(100vw - 32px);overflow:hidden;text-overflow:ellipsis}
#netbar.off{background:#1D1D1F;color:#fff}
#netbar.retry{background:#FFF4E0;color:#8A4B00}
@media print{#netbar{display:none}}
.aboutdlg h2:focus{outline:none}
.rlist{margin:6px 0 6px;padding-left:1.2em}
.rlist li{margin:2px 0}

/* keep the chat button out of the way of popups and page content */
.sheetopen #chatw,.dlgopen #chatw,body:has(.chzoom) #chatw,body:has(dialog[open]) #chatw{display:none}
.sheetopen .fszone,.dlgopen .fszone{display:none}
.haschat .app{padding-bottom:96px}
#chatw{z-index:40}

/* phone popups: grab handle, no pull-to-refresh while a popup is open */
html:has(.sheetopen),body.sheetopen,body.dlgopen{overscroll-behavior-y:none}
.veil .sheet,.aboutdlg{overscroll-behavior:contain;will-change:transform}
@media (max-width:599px){
  .veil .sheet{padding-top:28px;position:relative}
  .veil .sheet::before{content:"";position:absolute;top:10px;left:50%;width:40px;height:5px;margin-left:-20px;border-radius:3px;background:var(--sep)}
}

/* chat on phones: full-width sheet that slides up */
.chatbox .grab,.chatdim{display:none}
@media (max-width:599px){
  #chatw{right:16px;bottom:16px}
  #chatw.open{inset:0;right:0;bottom:0;align-items:stretch;justify-content:flex-end;gap:0}
  #chatw.open .chatfab{display:none}
  .chatdim{display:block;position:absolute;inset:0;background:rgba(0,0,0,.3);animation:abFade .2s}
  .chatbox{position:relative;width:100%;max-width:100vw;height:88vh;height:88dvh;border-radius:22px 22px 0 0;flex-direction:column;padding-bottom:env(safe-area-inset-bottom,0px);animation:abUp .3s cubic-bezier(.2,.8,.2,1);will-change:transform;overscroll-behavior:contain}
  .chatbox .grab{display:block;flex:none;width:40px;height:5px;border-radius:3px;background:var(--sep);margin:8px auto 0}
  .chatbox .chhead{padding-top:8px;touch-action:none}
  .chb{max-width:82%}
  .chin textarea{font-size:16px} /* stops iPhone from zooming in when typing */
  body.chatopen{overflow:hidden;overscroll-behavior-y:none}
}
.chatbox,.chpane,.chlist,.chcomp{min-width:0;max-width:100%}
.chcomp{box-sizing:border-box}
.chin{min-width:0}
.chin textarea{min-width:0;width:100%;box-sizing:border-box}

/* ---------- phone polish ---------- */
.legallinks a{color:var(--muted);text-decoration:none}
.legallinks a:hover{text-decoration:underline}
@media (max-width:599px){
  .app.wrap{padding-left:14px;padding-right:14px}
  .top{gap:10px}
  .tabrow .tabs{flex:1}
  .stats{margin-bottom:12px}
  .stat .k{font-size:.72rem}
  /* ledger: the date is already in the header, so the name column takes its place and stays put */
  .book th.stick.date,.book td.stick.date{width:0;min-width:0;max-width:0;padding:0 !important;border:0 !important;font-size:0;overflow:hidden}
  .book .name{width:112px;min-width:112px}
  .book td.name,.book th.name,.book tr.total td:nth-child(2){position:sticky;left:0;z-index:2;background:var(--card);box-shadow:1px 0 0 var(--sep)}
  .book thead th.name{background:var(--head)}
  .book tr.total td:nth-child(2){background:#F4F4F7;text-align:center}
  .book tr:focus-within td.name{background:var(--focus)}
  .cell.nm{padding-left:8px}
  .book .stick.name{box-shadow:1px 0 0 var(--sep);width:112px;min-width:112px}
  .paper.scroll{border-radius:16px}
  .printall{justify-content:space-between;gap:8px}
  .printall .note{font-size:.75rem}
  .group{padding:16px}
  .lrow label{font-size:.92rem}
  /* iPhone zooms into any text box smaller than 16px — keep them at 16px */
  input.inp,input.cell,textarea,select{font-size:16px}
}

/* date pill: blinking yellow when you are NOT on today */
.dp.notnow{background:#FFE58A;color:#5C4400;animation:notnow 1.1s ease-in-out infinite}
.dp.notnow svg{color:#8A6500}
@keyframes notnow{0%,100%{background:#FFE58A;box-shadow:0 0 0 0 rgba(255,204,0,.55)}50%{background:#FFF6CC;box-shadow:0 0 0 6px rgba(255,204,0,0)}}
@media (prefers-reduced-motion:reduce){.dp.notnow{animation:none}}
.topbtns{display:flex;gap:8px;align-items:center}
@media (max-width:420px){.topbtns .gear span{display:none}.topbtns .gear{padding:9px 11px}}

/* ---------- statistics ---------- */
.sttools{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin:4px 0 6px}
.stfrom{margin:8px 0 12px}
.stload{display:flex;justify-content:center;padding:80px 0}
.sttiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.stile{background:var(--card);border-radius:16px;padding:14px 16px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:2px;min-width:0}
.stile .k{font-size:.78rem;color:var(--muted)}
.stile .v{font-size:1.45rem;font-weight:700;letter-spacing:-.01em;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stile .v small{font-size:.75rem;font-weight:500;color:var(--muted)}
.stile .sub{font-size:.78rem;color:var(--muted)}
.chg{font-size:.78rem;font-weight:600;font-variant-numeric:tabular-nums}
.chg.up{color:#1E7B3C}.chg.dn{color:#B3261E}
.stcmp{margin:6px 0 0;font-size:.75rem}
.stcard{background:var(--card);border-radius:18px;box-shadow:var(--shadow);padding:18px 18px 16px;margin-top:14px;min-width:0}
.sth{display:flex;justify-content:space-between;align-items:baseline;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.sth h2{margin:0;font-size:1.05rem;font-weight:600}
.sth .note{font-size:.8rem}
.st2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.st2 .stcard{margin-top:14px}
.stempty{color:var(--muted);font-size:.9rem;padding:28px 0;text-align:center}
.bars{display:flex;align-items:stretch;justify-content:center;gap:4px;height:180px}
.bars.dense{gap:2px}
.bcol{flex:1;min-width:0;max-width:56px;display:flex;flex-direction:column;cursor:default}
.bwrap{flex:1;display:flex;align-items:flex-end;border-bottom:1px solid var(--sep)}
.bar{position:relative;width:100%;background:#9CC3F5;border-radius:4px 4px 0 0;transition:background .15s}
.bcol:hover .bar{background:var(--accent)}
.bar.hi{background:var(--accent)}
.bar.lo{background:#C7C7CC}
.flag{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:4px;font-size:.65rem;font-weight:700;color:var(--accent);white-space:nowrap}
.flag.lo{color:var(--muted)}
.bl{height:18px;margin-top:4px;font-size:.66rem;color:var(--muted);text-align:center;white-space:nowrap;overflow:visible}
.hbars{display:flex;flex-direction:column;gap:9px}
.hrow{display:grid;grid-template-columns:64px 1fr 52px;align-items:center;gap:10px;font-size:.88rem}
.hn{white-space:nowrap}
.ht{height:10px;background:var(--fill);border-radius:5px;overflow:hidden}
.hb{display:block;height:100%;background:var(--accent);border-radius:5px}
.hv{text-align:right;font-variant-numeric:tabular-nums;color:var(--muted)}
.gpick{display:flex;gap:6px;flex-wrap:wrap;margin:-4px 0 12px}
.gpick button{border:1px solid var(--sep);background:none;border-radius:980px;padding:4px 12px;font:inherit;font-size:.82rem;color:var(--muted);cursor:pointer}
.gpick button.on{background:var(--fg);border-color:var(--fg);color:#fff}
.pline{display:grid;grid-template-columns:40px 1fr;grid-template-rows:160px auto;gap:4px 8px}
.pline svg{width:100%;height:160px;overflow:visible}
.py{display:flex;flex-direction:column;justify-content:space-between;font-size:.7rem;color:var(--muted);text-align:right;padding:2px 0 6px;font-variant-numeric:tabular-nums}
.px{grid-column:2;display:flex;justify-content:space-between;font-size:.7rem;color:var(--muted)}
.pp{fill:none;stroke:var(--accent);stroke-width:2;vector-effect:non-scaling-stroke;stroke-linejoin:round}
.pbase{stroke:var(--sep);stroke-width:1;vector-effect:non-scaling-stroke}
.pdot{fill:var(--accent);stroke:var(--card);stroke-width:2;vector-effect:non-scaling-stroke}
.plist{margin-top:14px;border-top:1px solid var(--sep)}
.prow3{display:grid;grid-template-columns:1fr auto 72px;gap:10px;padding:9px 0;border-bottom:1px solid var(--sep);font-size:.88rem;font-variant-numeric:tabular-nums}
.prow3 .chg{text-align:right}
.sttab{width:100%;border-collapse:collapse;font-size:.88rem;font-variant-numeric:tabular-nums}
.sttab th{font-size:.72rem;color:var(--muted);font-weight:600;text-align:right;padding:6px 8px;border-bottom:1px solid var(--sep)}
.sttab td{text-align:right;padding:9px 8px;border-bottom:1px solid var(--sep)}
.sttab .nm{text-align:left}
.sttab .rk{color:var(--muted);width:24px;text-align:center}
.gone{display:inline-block;font-size:.68rem;color:#A85B00;background:#FFF4E0;border-radius:980px;padding:1px 7px;margin-left:4px;white-space:nowrap}
.sttip{position:fixed;z-index:120;background:#1D1D1F;color:#fff;font-size:.78rem;padding:6px 10px;border-radius:8px;pointer-events:none;max-width:260px;box-shadow:0 6px 18px rgba(0,0,0,.2)}
@media (max-width:820px){.sttiles{grid-template-columns:repeat(2,minmax(0,1fr))}.st2{grid-template-columns:1fr}}
@media (max-width:599px){.stcard{padding:16px 14px 14px}.bars{height:150px}.stile .v{font-size:1.2rem}.sttools .btn{flex:1}}
@media print{.sttip{display:none}}
/* admin filters on phones: one scrollable row instead of spilling off the screen */
.toolbar{min-width:0;max-width:100%}
.toolbar .tabs{max-width:100%;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.toolbar .tabs::-webkit-scrollbar{display:none}
.toolbar .tab{white-space:nowrap;flex:none}
@media (max-width:599px){.anav{width:100%}.anav .tab{flex:1}}
