:root{--bg:#f3f5f2;--surface:#fff;--ink:#1a2320;--muted:#5d6b65;--line:#d5dcd7;--accent:#0f6b4f;--accent-ink:#fff;--danger:#c0392b;--paper:#e9fbf1}
@media (prefers-color-scheme:dark){:root{--bg:#121715;--surface:#1b2420;--ink:#e8efeb;--muted:#9aa9a1;--line:#2e3b35;--accent:#3fbf93;--accent-ink:#06231a;--paper:#e9fbf1}}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
main{max-width:900px;margin:0 auto;padding:14px}
h1{font-size:20px;margin:6px 0 12px}h2{font-size:16px;margin:0 0 8px}
.top{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:10px}
.top a{color:var(--accent);font-weight:600;margin-right:10px}
nav{display:flex;gap:6px;margin-bottom:12px;flex-wrap:wrap}
nav button{flex:1;min-width:90px;padding:10px;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:10px;font:inherit;font-weight:600}
nav button[aria-selected="true"]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.card{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:14px;margin-bottom:12px}
label{display:block;font-size:13px;color:var(--muted);margin:10px 0 4px}
input,textarea,select{width:100%;padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink);font:inherit}
.row{display:flex;gap:8px;flex-wrap:wrap}.row>*{flex:1;min-width:120px}
.btn{padding:11px 14px;border-radius:10px;border:1px solid var(--accent);background:var(--accent);color:var(--accent-ink);font:inherit;font-weight:700;margin-top:12px;cursor:pointer}
.btn.alt{background:transparent;color:var(--accent)}.btn.sm{padding:6px 10px;margin:0;font-size:14px}.btn.full{width:100%}
button:disabled{opacity:.6}
.hide{display:none!important}
.err{color:var(--danger);font-size:14px;min-height:20px;margin-top:8px}
.kpi{display:flex;gap:10px;margin-bottom:12px}.kpi .card{flex:1;margin:0;text-align:center}.kpi b{display:block;font-size:24px}
table.t{width:100%;border-collapse:collapse;font-size:14px}
table.t th,table.t td{padding:8px 6px;border-top:1px solid var(--line);text-align:left;vertical-align:top}
table.t th:last-child,table.t td:last-child{text-align:right}
.scroll{overflow-x:auto}
.item{display:flex;justify-content:space-between;gap:8px;padding:8px 0;border-top:1px solid var(--line);font-size:14px}
.item button{border:0;background:none;color:var(--danger);font-size:20px}
.total{font-weight:700;font-size:18px;text-align:right;margin-top:8px}
.login{max-width:360px;margin:12vh auto 0}
#receipt-wrap{overflow-x:auto}
#receipt{width:302px;margin:0 auto;background:var(--paper);color:#000;padding:16px 12px 20px;font:13px/1.35 Arial,Helvetica,sans-serif;box-shadow:0 1px 6px rgba(0,0,0,.25)}
#receipt .c{text-align:center}#receipt .b{font-weight:700}
#receipt .two{display:flex;justify-content:space-between;gap:6px}
#receipt table{width:100%;border-collapse:collapse;font-size:12px;margin-top:6px}
#receipt th{text-align:left;border-bottom:1px dotted #000;padding:2px 0}
#receipt th:nth-child(n+2),#receipt td:nth-child(n+2){text-align:right;white-space:nowrap;padding-left:6px}
#receipt td{padding:2px 0;vertical-align:top}#receipt td:first-child{padding-right:4px}
#receipt hr{border:0;border-top:1px dotted #000;margin:6px 0}
#receipt .gap{margin-top:10px}
#receipt svg{width:100%;height:56px;margin-top:8px}
#receipt.mono{font-family:"Courier New",Courier,monospace;font-size:12px}
#receipt.mono hr{border-top:1px dashed #000}
#receipt.mono .big{font-size:1.2em}#receipt.mono .big2{font-size:1.35em}
#receipt.mono table{font-size:11px}
#receipt.mono th:nth-child(2),#receipt.mono td:nth-child(2){text-align:left;white-space:normal}
#receipt.mono th:first-child,#receipt.mono td:first-child{text-align:left;padding-right:4px}
@media print{
 @page{size:80mm auto;margin:0}
 .noprint{display:none!important}
 body{background:#fff}html,body{margin:0;padding:0;width:100%}
 main{max-width:none;margin:0;padding:0}
 #rc{border:0;padding:0;margin:0;background:none}
 #receipt{box-shadow:none;background:#fff;width:100%;margin:0;padding:2mm 3mm 6mm;font-size:13pt;line-height:1.3;color:#000;-webkit-text-stroke:.5px #000;text-rendering:geometricPrecision}
 #receipt table{font-size:10.5pt}#receipt svg{height:14mm}
 #receipt.mono{font-size:10.5pt}#receipt.mono table{font-size:10pt}
}
body::before{content:"";position:fixed;inset:0;background:url(/logo.png) center/min(75vw,520px) no-repeat;opacity:.1;pointer-events:none;z-index:-1}
.logo{display:block;width:130px;height:130px;margin:0 auto 6px;border-radius:50%}
@media print{body::before{display:none}}
.shops{display:grid;gap:8px;margin-top:4px}
.shop{padding:12px;border:2px solid var(--line);border-radius:10px;background:var(--bg);color:var(--ink);font:inherit;font-weight:700;text-align:left;cursor:pointer}
.shop small{font-weight:400;opacity:.8}
.shop[aria-checked="true"]{border-color:var(--accent);background:var(--accent);color:var(--accent-ink)}
#receipt .rlogo{display:block;max-width:75%;height:auto;margin:0 auto 6px}
.shop{display:flex;align-items:center;gap:12px}.shop img{width:46px;height:46px;object-fit:contain;border-radius:8px;background:#fff;flex:none}
#receipt.mono .rlogo{max-width:58%}
#receipt.mono th{border-bottom:1px dashed #000}
#receipt.mono .nw{white-space:nowrap}
#receipt.mono{background:#fff;font-size:13px;line-height:1.4;font-weight:600;-webkit-text-stroke:.2px #000}
#receipt.mono .b{font-weight:800}
#receipt.mono table{font-size:12.5px}
#receipt.mono .big{font-size:1.25em}
@media print{#receipt.mono{font-weight:700;-webkit-text-stroke:.5px #000}}
.shop img,.shop .ph{width:64px;height:64px;border-radius:50%;flex:none}
.shop img{object-fit:contain;background:#fff;padding:3px;border:2px solid var(--line)}
.shop .ph{display:flex;align-items:center;justify-content:center;font-style:normal;font-size:22px;font-weight:800;background:var(--line);color:var(--ink)}
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
.shop img,.shop .ph{animation:float 3.2s ease-in-out infinite;box-shadow:0 10px 14px -6px rgba(0,0,0,.55);padding:5px}
.shop:nth-child(2) img,.shop:nth-child(2) .ph{animation-delay:-1.6s}
.shop:nth-child(3) img,.shop:nth-child(3) .ph{animation-delay:-.8s}
@media (prefers-reduced-motion:reduce){.shop img,.shop .ph{animation:none}}
/* sharper receipt text */
#receipt:not(.mono){font-weight:600}
@media print{
 #receipt:not(.mono){font-family:Arial,"Liberation Sans",Roboto,Helvetica,sans-serif;font-size:13.5pt;font-weight:700;line-height:1.35;-webkit-text-stroke:0;text-rendering:optimizeLegibility}
 #receipt:not(.mono) table{font-size:11.5pt}
 #receipt:not(.mono) .b,#receipt:not(.mono) th{font-weight:900}
 #receipt th{border-bottom:1.5px solid #000}
 #receipt hr{border-top:1.5px solid #000}
 #receipt svg,#receipt svg *{shape-rendering:crispEdges}
 #receipt.mono{font-weight:700;-webkit-text-stroke:0}
}
