/* COUNTER surface: the dead-simple, big-button daily driver. Full-screen overlay,
   theme-aware through the shared design tokens. All classes are prefixed .ctr- and live
   under #counter so nothing here touches the office shell. */

#counter{position:fixed;inset:0;z-index:60;background:var(--bg);display:none;flex-direction:column;
         font-family:var(--font);color:var(--text)}
#counter.show{display:flex}
.ctr-scroll{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch}
.ctr-wrap{max-width:520px;margin:0 auto;width:100%}

/* top bar */
.ctr-top{background:linear-gradient(150deg,var(--brand),var(--brand-2));color:#fff;
         padding:14px 16px;display:flex;align-items:center;gap:12px;position:sticky;top:0;z-index:5}
.ctr-brand{display:flex;align-items:center;gap:11px;min-width:0}
.ctr-mark{width:40px;height:40px;border-radius:11px;background:#fff;overflow:hidden;
          display:grid;place-items:center;flex:none}
.ctr-mark svg{width:24px;height:24px}
.ctr-markimg{width:100%;height:100%;object-fit:contain}
.ctr-bname{font-weight:800;font-size:18px;letter-spacing:-.01em;line-height:1.05;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ctr-bsub{font-size:11px;color:rgba(255,255,255,.75);letter-spacing:.08em;text-transform:uppercase}
.ctr-top-actions{margin-left:auto;display:flex;gap:8px;flex:none}
.ctr-tbtn{height:40px;padding:0 12px;border-radius:11px;border:1px solid rgba(255,255,255,.25);
          background:rgba(255,255,255,.12);color:#fff;font-weight:700;font-size:13px;display:flex;align-items:center;gap:7px}
.ctr-tbtn svg{width:18px;height:18px}
.ctr-iconbtn{width:40px;height:40px;padding:0;justify-content:center}

/* screens */
.ctr-screen{display:none;flex-direction:column}
.ctr-screen.active{display:flex}
.ctr-head{display:flex;align-items:center;gap:12px;padding:16px 16px 4px}
.ctr-back{width:48px;height:48px;flex:none;border-radius:14px;border:1px solid var(--border);
          background:var(--surface);color:var(--text);display:grid;place-items:center;box-shadow:var(--shadow)}
.ctr-back svg{width:26px;height:26px}
.ctr-htitle{font-size:22px;font-weight:800;letter-spacing:-.02em}
.ctr-hsub{font-size:13px;color:var(--text-dim);margin-top:1px}

/* home */
.ctr-hello{padding:18px 18px 2px}
.ctr-hello .g{font-size:26px;font-weight:800;letter-spacing:-.02em}
.ctr-hello .d{font-size:13.5px;color:var(--text-dim);margin-top:3px}
.ctr-today{margin:14px 16px 2px;background:var(--surface);border:1px solid var(--border);
           border-radius:var(--radius);box-shadow:var(--shadow);display:grid;grid-template-columns:1fr 1fr 1fr;overflow:hidden}
.ctr-tcell{padding:14px 8px;text-align:center;border-left:1px solid var(--border-soft)}
.ctr-tcell:first-child{border-left:0}
.ctr-tcell .l{font-size:12px;color:var(--text-dim);font-weight:500}
.ctr-tcell .v{font-size:19px;font-weight:800;margin-top:5px;letter-spacing:-.01em}
.ctr-tcell .v.in{color:var(--green)} .ctr-tcell .v.out{color:var(--red)}

.ctr-hero{margin:14px 16px 0;border:0;border-radius:22px;color:#fff;
          background:linear-gradient(140deg,var(--brand),var(--brand-2));
          box-shadow:0 12px 30px color-mix(in srgb,var(--brand) 35%,transparent);
          padding:20px;display:flex;align-items:center;gap:16px;width:calc(100% - 32px);text-align:left}
.ctr-hero:active{transform:scale(.99)}
.ctr-hero .hic{width:60px;height:60px;border-radius:17px;background:rgba(255,255,255,.18);display:grid;place-items:center;flex:none}
.ctr-hero .hic svg{width:34px;height:34px}
.ctr-hero .hero-txt{display:flex;flex-direction:column;align-items:flex-start;min-width:0}
.ctr-hero .ht{display:block;font-size:24px;font-weight:800;letter-spacing:-.02em;line-height:1.1}
.ctr-hero .hs{display:block;font-size:14px;color:rgba(255,255,255,.82);margin-top:3px}
.ctr-hero .harr{margin-left:auto}
.ctr-hero .harr svg{width:28px;height:28px}

.ctr-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:12px 16px 20px}
.ctr-tile{--c:var(--brand);--cb:var(--surface-3);background:var(--surface);border:1px solid var(--border);
          border-radius:20px;padding:16px 15px;text-align:left;box-shadow:var(--shadow);
          display:flex;flex-direction:column;gap:11px;min-height:130px;transition:transform .12s,box-shadow .12s}
.ctr-tile:hover{box-shadow:var(--shadow-lg)} .ctr-tile:active{transform:scale(.97)}
.ctr-disc{width:52px;height:52px;border-radius:15px;background:var(--cb);color:var(--c);display:grid;place-items:center}
.ctr-disc svg{width:29px;height:29px}
.ctr-tile .t{font-weight:800;font-size:18px;letter-spacing:-.01em;color:var(--text);line-height:1.15}
.ctr-tile .s{font-size:12.5px;color:var(--text-faint);margin-top:-5px}
.ctr-foot{text-align:center;font-size:12px;color:var(--text-faint);padding:2px 20px 24px}

/* ---- desktop-first counter home: New Sale dominant + accounts always visible ---- */
.ctr-home{max-width:1360px;margin:0 auto;width:100%;padding:8px 16px 26px}
.ctr-home .ctr-hello{padding:12px 2px 2px}
.ctr-home .ctr-today{margin:10px 0 2px}
.ctr-homegrid{display:grid;grid-template-columns:1fr;gap:16px;margin-top:14px}
@media(min-width:920px){ .ctr-homegrid{grid-template-columns:1.55fr 1fr;align-items:start} }
.ctr-home-left{display:flex;flex-direction:column;gap:14px;min-width:0}
.ctr-home .ctr-hero{margin:0;width:100%}
@media(min-width:920px){
  .ctr-home .ctr-hero{padding:32px 28px}
  .ctr-home .ctr-hero .ht{font-size:30px}
  .ctr-home .ctr-hero .hs{font-size:15px}
  .ctr-home .ctr-hero .hic{width:72px;height:72px}
  .ctr-home .ctr-hero .hic svg{width:40px;height:40px}
}
.ctr-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(min-width:1180px){ .ctr-actions{grid-template-columns:repeat(4,1fr)} }
.ctr-actions .ctr-tile{min-height:120px}
.ctr-owe{background:var(--surface);border:1px solid var(--border);border-radius:20px;box-shadow:var(--shadow);display:flex;flex-direction:column;overflow:hidden}
@media(min-width:920px){ .ctr-owe{position:sticky;top:8px;max-height:calc(100vh - 96px)} }
.ctr-owetop{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:15px 18px;border-bottom:1px solid var(--border-soft)}
.ctr-owetop .k{font-size:12.5px;color:var(--text-dim);font-weight:600}
.ctr-owetop .v{font-size:23px;font-weight:800;color:var(--red);letter-spacing:-.01em;margin-top:2px}
.ctr-oweall{border:0;background:transparent;color:var(--brand);font-weight:700;font-size:13px;display:inline-flex;align-items:center;gap:2px;cursor:pointer;white-space:nowrap}
.ctr-oweall svg{width:15px;height:15px}
.ctr-owelist{overflow-y:auto;padding:6px;display:flex;flex-direction:column;gap:2px}
.ctr-owerow{display:flex;align-items:center;gap:12px;width:100%;background:transparent;border:0;border-radius:12px;padding:9px 10px;cursor:pointer;text-align:left;transition:.1s}
.ctr-owerow:hover{background:var(--surface-2)}
.ctr-owerow .ow-who{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.ow-who .n{font-weight:700;font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ow-who .r{font-size:11.5px;color:var(--text-faint)}
.ow-amt{font-weight:800;color:var(--red);font-size:15px;flex:none}
.ctr-av.sm{width:38px;height:38px;font-size:15px;border-radius:11px}
.ctr-oweempty{display:flex;flex-direction:column;align-items:center;gap:8px;color:var(--text-faint);padding:40px 16px;text-align:center;font-size:13.5px}
.ctr-oweempty svg{width:32px;height:32px;color:var(--brand)}
/* ---- privacy: blur money figures so people at the counter can't read them ---- */
#counter.private .ctr-tcell .v,
#counter.private .ctr-bal .a,
#counter.private .ow-amt,
#counter.private .ctr-owetop .v,
#counter.private .ctr-bigstat .v,
#counter.private .ctr-dstat .v,
#counter.private .ctr-chancell .v,
#counter.private .sold-row .sr-amt{
  filter:blur(9px);-webkit-filter:blur(9px);transition:filter .15s;user-select:none;pointer-events:none;
}
.ctr-top-actions .ctr-iconbtn.on{background:rgba(255,255,255,.22)}

/* search + rows */
.ctr-search{display:flex;align-items:center;gap:10px;background:var(--surface);border:1px solid var(--border);
            border-radius:15px;padding:13px 15px;margin:10px 16px 4px;box-shadow:var(--shadow)}
.ctr-search svg{width:20px;height:20px;color:var(--text-faint);flex:none}
.ctr-search input{border:0;background:transparent;outline:none;font-family:var(--font);font-size:16px;color:var(--text);width:100%}
.ctr-rows{display:flex;flex-direction:column;gap:10px;padding:10px 16px 24px}
/* on a shop laptop, lists become multi-column so you see many shops/products at once */
@media(min-width:900px){
  .ctr-wrap{max-width:1160px}
  .ctr-wrap .ctr-search{margin-left:16px;margin-right:16px;width:auto}
  .ctr-rows{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:12px;align-items:start}
}
.ctr-row{display:flex;align-items:center;gap:13px;background:var(--surface);border:1px solid var(--border);
         border-radius:16px;padding:14px;box-shadow:var(--shadow);text-align:left;width:100%;color:var(--text);
         cursor:pointer;transition:transform .1s,box-shadow .12s,border-color .12s}
.ctr-row:hover{box-shadow:var(--shadow-lg);border-color:var(--brand)}
.ctr-row:active{background:var(--surface-2);transform:scale(.99)}
.ctr-av{width:48px;height:48px;flex:none;border-radius:13px;background:var(--brand-soft);color:var(--brand);
        display:grid;place-items:center;font-weight:800;font-size:20px}
.ctr-who{display:flex;flex-direction:column;gap:2px;min-width:0}
.ctr-who .n{font-weight:700;font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ctr-who .r{font-size:12.5px;color:var(--text-dim)}
.ctr-bal{margin-left:auto;text-align:right;flex:none;padding-left:8px}
.ctr-bal .a{font-size:17px;font-weight:800}
.ctr-bal .a.out{color:var(--red)} .ctr-bal .a.clear{color:var(--green)}
.ctr-bal .t{font-size:11px;color:var(--text-faint)}
.ctr-row.cash .ctr-av{background:var(--green-soft);color:var(--green)}
/* walk-in / cash sale = the priority action, a bold card above the shop list */
.ctr-cashcard{display:flex;align-items:center;gap:14px;width:calc(100% - 32px);margin:8px 16px 4px;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#fff;border:0;border-radius:18px;
  box-shadow:0 10px 26px var(--brand-glow);padding:17px 20px;cursor:pointer;text-align:left;
  transition:transform .1s,box-shadow .12s}
.ctr-cashcard:hover{box-shadow:0 14px 32px var(--brand-glow)}
.ctr-cashcard:active{transform:scale(.99)}
.cc-ic{width:52px;height:52px;border-radius:15px;background:rgba(255,255,255,.2);display:grid;place-items:center;flex:none}
.cc-ic svg{width:29px;height:29px}
.cc-txt{display:flex;flex-direction:column;min-width:0}
.cc-t{font-size:20px;font-weight:800;letter-spacing:-.01em}
.cc-s{font-size:13px;color:rgba(255,255,255,.85);margin-top:1px}
.cc-arr{margin-left:auto}.cc-arr svg{width:26px;height:26px}
.ctr-orsep{display:flex;align-items:center;gap:12px;color:var(--text-faint);font-size:12px;font-weight:600;margin:12px 16px 4px}
.ctr-orsep::before,.ctr-orsep::after{content:"";height:1px;background:var(--border);flex:1}

/* product grid: 2-up on a phone, but fills a wide shop screen with many columns
   so more stock shows in one frame */
.ctr-wide{max-width:1280px;margin:0 auto;width:100%}
.ctr-pgrid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;padding:14px 18px 160px}
@media(min-width:700px){ .ctr-pgrid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))} }
.ctr-pcard{background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:12px;
           box-shadow:var(--shadow);display:flex;flex-direction:column;align-items:center;gap:6px}
.ctr-pcard.has{border-color:var(--brand);box-shadow:0 0 0 2px var(--brand-soft),var(--shadow)}
.ctr-pmedia{position:relative;height:98px;display:grid;place-items:center;width:100%;background:#fff;border-radius:12px;padding:5px}
.ctr-pmedia svg{height:88px;width:auto}
.ctr-psize{position:absolute;top:0;right:0;background:var(--text);color:var(--bg);font-size:11px;font-weight:700;padding:2px 7px;border-radius:20px}
.ctr-pn{font-weight:700;font-size:16px;text-align:center;line-height:1.2}
.ctr-pn small{display:block;font-weight:500;color:var(--text-faint);font-size:11px}
.ctr-pprice{font-size:18px;font-weight:800}
.ctr-step{display:flex;align-items:center;gap:6px;width:100%;margin-top:2px}
.ctr-stp{flex:1;height:46px;border-radius:12px;border:1.5px solid var(--border);background:var(--surface-2);
         color:var(--text);font-size:26px;font-weight:700;line-height:1;display:grid;place-items:center}
.ctr-stp.plus{background:var(--brand);border-color:var(--brand);color:#fff}
.ctr-qv{min-width:34px;text-align:center;font-size:20px;font-weight:800}

/* sticky action bar */
.ctr-actbar{position:sticky;bottom:0;background:var(--surface);border-top:1px solid var(--border);
            padding:12px 16px calc(12px + env(safe-area-inset-bottom));display:flex;align-items:center;gap:12px;
            box-shadow:0 -8px 24px rgba(0,0,0,.10)}
.ctr-sum .k{font-size:12px;color:var(--text-dim)}
.ctr-sum .v{font-size:23px;font-weight:800}
.ctr-go{margin-left:auto;background:var(--brand);color:#fff;border:0;border-radius:15px;padding:0 22px;height:56px;
        display:flex;align-items:center;gap:9px;font-weight:700;font-size:18px;box-shadow:var(--shadow)}
.ctr-go:disabled{opacity:.4}
.ctr-go svg{width:22px;height:22px}
.ctr-go.block{width:calc(100% - 32px);margin:12px 16px 22px;justify-content:center}

/* pay screen */
.ctr-pay{padding:18px;display:flex;flex-direction:column;gap:16px;max-width:520px;margin:0 auto;width:100%}
.ctr-total{background:var(--surface);border:1px solid var(--border);border-radius:22px;box-shadow:var(--shadow);padding:24px;text-align:center}
.ctr-total .k{font-size:14px;color:var(--text-dim)}
.ctr-total .v{font-size:46px;font-weight:800;letter-spacing:-.03em;margin-top:6px}
.ctr-chip{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:13px 15px;box-shadow:var(--shadow)}
.ctr-chip .n{font-weight:800;font-size:17px}
.ctr-chip .b{font-size:12.5px;color:var(--text-dim)}
.ctr-paylabel{text-align:center;font-size:14.5px;color:var(--text-dim)}
.ctr-paybtns,.ctr-paygrid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px}
.ctr-paygrid.one{grid-template-columns:1fr}
.ctr-paybtn{border:1.5px solid var(--border);border-radius:20px;padding:18px 12px;background:var(--surface);
            display:flex;flex-direction:column;align-items:center;gap:9px;box-shadow:var(--shadow);color:var(--text);cursor:pointer;transition:transform .1s,box-shadow .12s,border-color .12s}
.ctr-paybtn:hover{box-shadow:var(--shadow-lg);border-color:var(--brand)}
.ctr-paybtn:active{transform:scale(.98)}
.ctr-paybtn .ic{width:54px;height:54px;border-radius:16px;display:grid;place-items:center;background:var(--brand-soft);color:var(--brand)}
.ctr-paybtn .ic svg{width:28px;height:28px}
.ctr-paybtn .t{font-weight:800;font-size:17px}
.ctr-paybtn .s{font-size:11px;color:var(--text-faint);letter-spacing:.04em;text-transform:uppercase}
.ctr-paybtn.cash .ic{background:var(--green-soft);color:var(--green)}
.ctr-paybtn.credit{grid-column:1/-1;flex-direction:row;justify-content:center;gap:14px}
.ctr-paybtn.credit .ic{background:var(--brand-soft);color:var(--brand)}
.ctr-newbal{background:var(--brand-soft);border:1px solid var(--brand);border-radius:14px;padding:12px 15px;font-size:14px;color:var(--brand);text-align:center;font-weight:600}
/* recovery channel chips */
.ctr-paychips{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}
.ctr-paychip{display:inline-flex;align-items:center;gap:7px;border:1.5px solid var(--border);background:var(--surface);border-radius:14px;padding:11px 16px;font-weight:700;font-size:14px;color:var(--text-dim);cursor:pointer;transition:.12s}
.ctr-paychip svg{width:19px;height:19px}
.ctr-paychip.on{border-color:var(--brand);background:var(--brand-soft);color:var(--brand)}
/* Today: collected-by-channel */
.ctr-chan .ctr-chanrow{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
@media(max-width:560px){ .ctr-chan .ctr-chanrow{grid-template-columns:1fr} }
.ctr-chancell{display:flex;align-items:center;gap:11px}
.ctr-chancell .ci{width:42px;height:42px;flex:none;border-radius:12px;background:var(--brand-soft);color:var(--brand);display:grid;place-items:center}
.ctr-chancell .ci svg{width:22px;height:22px}
.ctr-chancell .k{font-size:12.5px;color:var(--text-dim)}
.ctr-chancell .v{font-size:19px;font-weight:800;margin-top:1px}
/* payment channels shown as real, full-colour brand badges (self-contained SVG) */
.ctr-paybtn[data-m="cash"] .ic,
.ctr-paybtn[data-m="bank"] .ic,
.ctr-paybtn[data-m="jazzcash"] .ic{background:transparent;box-shadow:none;padding:0}
.ctr-payimg{display:block;object-fit:contain}
.ctr-paybtn[data-m="cash"] .ic svg,
.ctr-paybtn[data-m="bank"] .ic svg,
.ctr-paybtn[data-m="jazzcash"] .ic svg,
.ctr-paybtn[data-m] .ic .ctr-payimg{width:54px;height:54px}
.ctr-paychip[data-m="cash"] svg,
.ctr-paychip[data-m="bank"] svg,
.ctr-paychip[data-m="jazzcash"] svg,
.ctr-paychip[data-m] .ctr-payimg{width:24px;height:24px}
.ctr-paychip[data-m="cash"].on{border-color:var(--green);background:var(--green-soft);color:var(--green)}
.ctr-paychip[data-m="bank"].on{border-color:#2563c9;background:rgba(37,99,201,.12);color:#2563c9}
.ctr-paychip[data-m="jazzcash"].on{border-color:#f26522;background:rgba(242,101,34,.14);color:#f26522}
.ctr-chancell[data-ch="cash"] .ci,
.ctr-chancell[data-ch="bank"] .ci,
.ctr-chancell[data-ch="jazzcash"] .ci{background:transparent}
.ctr-chancell[data-ch="cash"] .ci svg,
.ctr-chancell[data-ch="bank"] .ci svg,
.ctr-chancell[data-ch="jazzcash"] .ci svg,
.ctr-chancell[data-ch] .ci .ctr-payimg{width:42px;height:42px}

/* keypad */
.ctr-key-wrap{padding:14px 18px 22px;display:flex;flex-direction:column;gap:13px;max-width:520px;margin:0 auto;width:100%}
.ctr-amt{background:var(--surface);border:1px solid var(--border);border-radius:20px;box-shadow:var(--shadow);padding:20px;text-align:center}
.ctr-amt .k{font-size:13.5px;color:var(--text-dim)}
.ctr-amt .v{font-size:46px;font-weight:800;letter-spacing:-.03em;margin-top:4px}
.ctr-balline{display:flex;justify-content:space-between;font-size:14px;color:var(--text-dim);padding:0 4px}
.ctr-balline b{color:var(--red)} .ctr-balline.new b{color:var(--green)}
.ctr-presets{display:flex;gap:8px}
.ctr-preset{flex:1;border:1.5px solid var(--border);background:var(--surface);border-radius:13px;padding:12px 4px;font-weight:800;font-size:15px;color:var(--brand);box-shadow:var(--shadow)}
.ctr-keys{display:grid;grid-template-columns:1fr 1fr 1fr;gap:9px}
.ctr-k{height:58px;border-radius:15px;border:1px solid var(--border);background:var(--surface);font-size:26px;font-weight:700;color:var(--text);box-shadow:var(--shadow)}
.ctr-k.util{background:var(--surface-2);color:var(--text-dim);font-size:20px}
.ctr-k svg{width:26px;height:26px}

/* big stat (khata) */
.ctr-bigstat{margin:12px 16px 2px;background:var(--red-soft);border:1px solid var(--red);border-radius:18px;padding:17px;text-align:center}
.ctr-bigstat .k{font-size:13.5px;color:var(--red);font-weight:600}
.ctr-bigstat .v{font-size:34px;font-weight:800;color:var(--red);margin-top:3px;letter-spacing:-.02em}

/* stock rows */
.ctr-stockrow .ctr-av{background:transparent;width:54px;height:54px}
.ctr-stockrow .ctr-av svg{height:52px}
.ctr-stk{margin-left:auto;text-align:right}
.ctr-stk .q{font-size:22px;font-weight:800}
.ctr-stk .u{font-size:11.5px;color:var(--text-faint)}
.ctr-low{font-size:11px;font-weight:700;color:var(--red);background:var(--red-soft);padding:2px 8px;border-radius:20px;display:inline-block;margin-top:3px}

/* day / denom */
.ctr-day{padding:14px 16px 26px;display:flex;flex-direction:column;gap:14px;max-width:1100px;margin:0 auto;width:100%}
.ctr-d3{display:grid;grid-template-columns:1fr 1fr;gap:11px}
@media(min-width:820px){ .ctr-d3{grid-template-columns:repeat(4,1fr)} }
.ctr-daygrid{display:grid;grid-template-columns:1fr;gap:14px;align-items:start}
@media(min-width:820px){ .ctr-daygrid{grid-template-columns:1.3fr 1fr} }
.ctr-card{background:var(--surface);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow);padding:16px}
.ctr-sec-h{margin:0 0 8px;font-size:16px;font-weight:800;display:flex;justify-content:space-between;align-items:center}
.ctr-sec-h .e{font-size:11.5px;color:var(--text-faint);letter-spacing:.04em;font-weight:600}
.ctr-sold{display:flex;flex-direction:column}
.sold-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 2px;border-top:1px solid var(--border-soft)}
.sold-row:first-child{border-top:0}
.sr-info{min-width:0;display:flex;flex-direction:column;gap:1px}
.sr-info .n{font-weight:700;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sr-info .n b{font-weight:500;color:var(--text-faint)}
.sr-info .q{font-size:12px;color:var(--text-dim);font-weight:600}
.sr-amt{font-weight:800;font-size:15px;flex:none}
.ctr-dstat{background:var(--surface);border:1px solid var(--border);border-radius:17px;padding:15px;box-shadow:var(--shadow)}
.ctr-dstat .k{font-size:12.5px;color:var(--text-dim)}
.ctr-dstat .v{font-size:24px;font-weight:800;margin-top:5px}
.ctr-dstat.in .v{color:var(--green)} .ctr-dstat.out .v{color:var(--red)}
.ctr-denom{background:var(--surface);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow);padding:16px}
.ctr-denom h3{margin:0 0 8px;font-size:16px;font-weight:800;display:flex;justify-content:space-between;align-items:center}
.ctr-denom h3 .e{font-size:11px;color:var(--text-faint);letter-spacing:.06em;text-transform:uppercase;font-weight:600}
.ctr-drow{display:flex;align-items:center;gap:10px;padding:7px 0;border-top:1px solid var(--border-soft)}
.ctr-drow .note{width:64px;font-weight:800;font-size:15px}
.ctr-drow .x{color:var(--text-faint);font-weight:700}
.ctr-drow input{width:66px;height:44px;border:1.5px solid var(--border);border-radius:11px;background:var(--surface-2);text-align:center;font-family:var(--font);font-size:17px;font-weight:700;color:var(--text);outline:none}
.ctr-drow input:focus{border-color:var(--brand)}
.ctr-drow .eq{margin-left:auto;font-weight:800;font-size:16px;color:var(--text-dim);min-width:80px;text-align:right}
.ctr-denom .tot{display:flex;justify-content:space-between;align-items:center;border-top:2px solid var(--border);margin-top:8px;padding-top:12px}
.ctr-denom .tot .k{font-size:16px;font-weight:800}
.ctr-denom .tot .v{font-size:26px;font-weight:800;color:var(--green)}

/* done */
.ctr-done{min-height:calc(100vh - 150px);display:grid;place-items:center;padding:26px 22px}
.ctr-done-grid{display:grid;grid-template-columns:1fr;gap:24px;width:100%;max-width:940px;align-items:center}
@media(min-width:900px){ .ctr-done-grid{grid-template-columns:1fr 1fr} }
.ctr-done-main{display:flex;flex-direction:column;align-items:center;text-align:center;min-width:0}
.ctr-check{width:104px;height:104px;border-radius:50%;background:var(--green-soft);color:var(--green);display:grid;place-items:center;margin-bottom:10px;animation:ctrpop .35s ease}
.ctr-check svg{width:56px;height:56px}
@keyframes ctrpop{0%{transform:scale(.4);opacity:0}60%{transform:scale(1.08)}100%{transform:scale(1);opacity:1}}
.ctr-done .dt{font-size:29px;font-weight:800;letter-spacing:-.02em}
.ctr-done .da{font-size:44px;font-weight:800;letter-spacing:-.03em;margin:8px 0 4px}
.ctr-done .ds{font-size:15px;color:var(--text-dim);max-width:300px}
.ctr-donebtns{display:flex;flex-direction:column;gap:11px;width:100%;max-width:360px;margin-top:26px}
.ctr-dbl{display:flex;gap:11px}
/* done-screen buttons fill their row edge-to-edge (no side-margin gap where clicks miss) */
.ctr-donebtns .ctr-go.block,.ctr-donebtns .ctr-ghost.block{width:100%;margin:0}
.ctr-donebtns .ctr-dbl .ctr-ghost{flex:1;margin:0}
.ctr-go svg,.ctr-ghost svg{pointer-events:none}
.ctr-go.ctr-wabtn{background:linear-gradient(135deg,#25d366,#128c7e);box-shadow:0 10px 24px rgba(18,140,126,.32)}
.ctr-ghost{flex:1;justify-content:center;height:52px;border-radius:14px;display:flex;align-items:center;gap:8px;font-weight:700;font-size:15px;box-shadow:var(--shadow);background:var(--surface);color:var(--text);border:1px solid var(--border)}
.ctr-ghost svg{width:20px;height:20px}

/* ledger sheet */
.ctr-sheet{position:fixed;inset:0;background:rgba(4,10,8,.5);display:none;align-items:flex-end;justify-content:center;z-index:70}
.ctr-sheet.open{display:flex}
.ctr-sheetcard{background:var(--surface);width:100%;max-width:520px;border-radius:24px 24px 0 0;padding:8px 18px 26px;max-height:80vh;overflow:auto;animation:ctrup .25s ease}
@keyframes ctrup{from{transform:translateY(30px)}to{transform:translateY(0)}}
.ctr-grab{width:44px;height:5px;border-radius:5px;background:var(--border);margin:8px auto 12px}
.ctr-sheetcard h3{margin:0;font-size:20px;font-weight:800}
.ctr-sheetcard .sub{font-size:13px;color:var(--text-dim);margin:2px 0 12px}
/* desktop: the ledger becomes a centered modal, and focused screens get breathing room */
@media(min-width:900px){
  .ctr-sheet{align-items:center}
  .ctr-sheetcard{border-radius:22px;max-height:82vh;max-width:560px}
  .ctr-key-wrap,.ctr-pay{margin-top:26px;margin-bottom:26px}
}
.ctr-led{display:flex;align-items:center;gap:12px;padding:11px 0;border-top:1px solid var(--border-soft)}
.ctr-led .d{flex:1;font-size:14.5px;font-weight:500}
.ctr-led .d small{display:block;color:var(--text-faint);font-size:11.5px;font-weight:400}
.ctr-led .m{font-weight:800;font-size:15px}
.ctr-led .m.plus{color:var(--red)} .ctr-led .m.minus{color:var(--green)}

@media (max-width:400px){
  .ctr-hero .ht{font-size:21px}
  .ctr-tile{min-height:118px}
}

/* real product photos (fall back to the drawing) */
.ctr-pmedia .prodimg{height:88px;width:auto;max-width:100%;object-fit:contain}
.ctr-av .prodimg{height:48px;width:auto;object-fit:contain}
.ctr-stockrow .ctr-av .prodimg{height:50px;width:auto;object-fit:contain}

/* receipt on the sale/payment done screen */
.ctr-rc{background:var(--surface);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow);padding:16px 18px;max-width:420px;width:100%;margin:0 auto;text-align:left;justify-self:center}
.ctr-ghost.block{width:100%;justify-content:center}
.ctr-rc .rc-head{text-align:center;border-bottom:1px dashed var(--border);padding-bottom:10px;margin-bottom:10px}
.ctr-rc .rc-biz{font-weight:800;font-size:16px}
.ctr-rc .rc-sub{font-size:11.5px;color:var(--text-dim)}
.ctr-rc .rc-meta{display:flex;justify-content:space-between;font-size:12px;color:var(--text-dim);margin-top:6px}
.ctr-rc .rc-cust{font-weight:700;font-size:14.5px;margin:2px 0 10px}
.ctr-rc .rc-line{display:flex;justify-content:space-between;gap:10px;font-size:13.5px;padding:3px 0}
.ctr-rc .rc-line .q{color:var(--text-faint);font-weight:500}
.ctr-rc .rc-tot{display:flex;justify-content:space-between;border-top:1px dashed var(--border);margin-top:8px;padding-top:8px;font-weight:800;font-size:16px}
.ctr-rc .rc-bal{display:flex;justify-content:space-between;font-size:13.5px;margin-top:4px;color:var(--red);font-weight:700}
.ctr-rc .rc-foot{text-align:center;font-size:11.5px;color:var(--text-faint);margin-top:10px;border-top:1px dashed var(--border);padding-top:8px}
@media print{
  body *{visibility:hidden!important}
  #ctr-receipt,#ctr-receipt *{visibility:visible!important}
  #ctr-receipt{position:absolute;left:0;top:0;width:340px;box-shadow:none;border:none;margin:0}
}

/* ===== world-class selling screen: product grid + live bill ===== */
.ctr-sale{display:grid;grid-template-columns:1fr 344px;align-items:start;max-width:1460px;margin:0 auto}
.ctr-sale-main{min-width:0}
.ctr-sale .ctr-pgrid{padding-bottom:48px}
.ctr-saletools{position:sticky;top:0;z-index:4;background:linear-gradient(var(--bg),var(--bg) 72%,transparent);padding:8px 18px 10px;display:flex;gap:10px;align-items:center}
.ctr-chips{display:flex;gap:8px;overflow-x:auto;flex:1;min-width:0;padding-bottom:2px;-webkit-overflow-scrolling:touch}
/* search is a small corner icon that expands only when tapped */
.ctr-searchbtn{flex:none;width:44px;height:44px;border-radius:12px;border:1.5px solid var(--border);background:var(--surface);display:grid;place-items:center;color:var(--text-dim);cursor:pointer;transition:.12s}
.ctr-searchbtn:hover{border-color:var(--brand);color:var(--brand)}
.ctr-searchbtn svg{width:20px;height:20px}
.ctr-searchbox{flex:1;min-width:0;display:flex;align-items:center;gap:10px;height:44px;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:0 8px 0 12px;box-shadow:var(--shadow)}
.ctr-searchbox[hidden]{display:none}
.ctr-searchbox svg{width:18px;height:18px;color:var(--text-faint);flex:none}
.ctr-searchbox input{flex:1;min-width:0;border:0;background:transparent;outline:none;font-family:var(--font);font-size:15px;font-weight:500;color:var(--text)}
.ctr-searchclose{flex:none;border:0;background:transparent;font-size:23px;line-height:1;color:var(--text-faint);cursor:pointer;width:30px;height:30px;border-radius:8px}
.ctr-searchclose:hover{background:var(--surface-2);color:var(--text)}
.ctr-saletools.searching .ctr-chips,.ctr-saletools.searching .ctr-searchbtn{display:none}
.ctr-chip-b{flex:none;border:1.5px solid var(--border);background:var(--surface);border-radius:22px;padding:9px 16px;font-weight:700;font-size:13.5px;color:var(--text-dim);white-space:nowrap;transition:.12s}
.ctr-chip-b.active{background:var(--brand);border-color:var(--brand);color:#fff}
.ctr-pstock{font-size:11px;color:var(--text-faint);font-weight:600}
.ctr-pstock.low{color:var(--red)}
.ctr-pcard{cursor:pointer;transition:transform .1s,box-shadow .12s,border-color .12s}
.ctr-pcard:hover{box-shadow:var(--shadow-lg);transform:translateY(-2px)}
.ctr-step .ctr-stp{flex:0 0 46px}
.ctr-qin{flex:1;min-width:0;height:46px;border:1.5px solid var(--border);border-radius:12px;background:var(--surface-2);text-align:center;font-family:var(--font);font-size:19px;font-weight:800;color:var(--text);outline:none}
.ctr-qin:focus{border-color:var(--brand);background:var(--surface)}
/* ---- brand picker (level 1): pick a drink, grouped by company ---- */
.ctr-pgrid.brands{display:block;padding:6px 18px 60px}
.ctr-brandsec{margin-top:12px}
.ctr-cohead{font-size:12px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--text-faint);margin:8px 2px 10px}
.ctr-brandgrid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
@media(min-width:700px){ .ctr-brandgrid{grid-template-columns:repeat(auto-fill,minmax(184px,1fr))} }
.ctr-brandcard{position:relative;background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:14px 12px 15px;display:flex;flex-direction:column;align-items:center;gap:5px;cursor:pointer;text-align:center;transition:transform .1s,box-shadow .12s,border-color .12s}
.ctr-brandcard:hover{box-shadow:var(--shadow-lg);transform:translateY(-2px)}
.ctr-brandcard.has{border-color:var(--brand);box-shadow:0 0 0 2px var(--brand-soft),var(--shadow)}
.ctr-bc-media{position:relative;height:112px;display:grid;place-items:center;width:100%;background:#fff;border-radius:14px;padding:6px}
.ctr-bc-media .prodimg,.ctr-bc-media svg{height:100px;width:auto;max-width:100%;object-fit:contain}
.ctr-bc-badge{position:absolute;top:-4px;right:6px;min-width:23px;height:23px;padding:0 6px;border-radius:20px;background:var(--brand);color:#fff;font-size:12px;font-weight:800;display:grid;place-items:center;box-shadow:var(--shadow)}
.ctr-bc-name{font-weight:800;font-size:16.5px;line-height:1.15;margin-top:2px}
.ctr-bc-meta{font-size:12px;color:var(--text-dim);font-weight:600}
/* ---- size picker (level 2): pick a clearly-labelled size ---- */
.ctr-sizebar{grid-column:1/-1;display:flex;align-items:center;gap:12px;padding:2px 0 6px}
.ctr-allbtn{display:inline-flex;align-items:center;gap:3px;border:1.5px solid var(--border);background:var(--surface);border-radius:22px;padding:8px 15px 8px 9px;font-weight:700;font-size:13.5px;color:var(--text-dim);cursor:pointer;transition:.12s}
.ctr-allbtn svg{width:18px;height:18px}
.ctr-allbtn:hover{border-color:var(--brand);color:var(--brand)}
.ctr-sizetitle{display:flex;align-items:center;gap:10px;font-weight:800;font-size:18px;min-width:0}
.ctr-sizethumb{display:grid;place-items:center;flex:none}
.ctr-sizethumb .prodimg,.ctr-sizethumb svg{height:36px;width:auto;max-width:34px;object-fit:contain}
.ctr-scname{font-weight:700;font-size:12.5px;color:var(--text-dim);text-align:center;line-height:1.1}
.ctr-scsize{font-weight:800;font-size:20px;text-align:center;line-height:1.15}
.ctr-punit{font-size:11.5px;color:var(--text-faint);font-weight:600;margin-top:-2px}
/* ---- Update Rates screen ---- */
.ctr-rates{display:flex;flex-direction:column;gap:8px;padding-bottom:40px}
.ctr-rates .ctr-cohead{margin:12px 2px 2px}
.rate-row{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:9px 12px}
.rr-art{width:38px;height:46px;flex:none;display:grid;place-items:center;background:#fff;border-radius:8px}
.rr-art .prodimg,.rr-art svg{max-height:44px;max-width:34px;width:auto;object-fit:contain}
.rr-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.rr-n{font-weight:700;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rr-u{font-size:12px;color:var(--text-faint);font-weight:600}
.rr-price{flex:none;display:flex;align-items:center;gap:7px}
.rr-cur{color:var(--text-faint);font-weight:700;font-size:14px}
.rr-in{width:108px;height:48px;border:1.5px solid var(--border);border-radius:12px;background:var(--surface-2);text-align:right;padding:0 12px;font-family:var(--font);font-size:20px;font-weight:800;color:var(--text);outline:none}
.rr-in:focus{border-color:var(--brand);background:var(--surface);box-shadow:0 0 0 3px var(--brand-soft)}
.rr-status{width:22px;height:22px;display:grid;place-items:center;color:var(--brand);flex:none}
.rr-status svg{width:20px;height:20px}
.rr-status.ok{color:var(--brand)}
.rr-status.err{color:var(--red);font-weight:800}
/* live bill panel */
.ctr-cart{position:sticky;top:0;max-height:calc(100vh - 78px);display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow);margin:8px 12px 0 6px;overflow:hidden}
.cart-head{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:15px 18px;border-bottom:1px solid var(--border-soft)}
.cart-head .ch-t{font-size:18px;font-weight:800}
.cart-head .ch-s{font-size:12.5px;color:var(--text-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}
.cart-head .ch-owes{color:var(--red);font-weight:700;font-size:12.5px;margin-top:1px}
.cart-head .ch-n{font-size:13px;color:var(--text-dim);font-weight:600;flex:none}
.cart-lines{flex:1;overflow-y:auto;padding:6px 12px}
.cart-empty{display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--text-faint);padding:48px 16px;text-align:center;font-size:13.5px}
.cart-empty svg{width:34px;height:34px}
.cart-line{display:flex;flex-direction:column;gap:7px;padding:10px 4px;border-bottom:1px solid var(--border-soft)}
.cl-top{display:flex;align-items:center;gap:10px}
.cl-art{width:34px;height:40px;flex:none;display:grid;place-items:center;overflow:hidden}
.cl-art svg,.cl-art .prodimg{max-height:40px;max-width:34px;width:auto;height:auto;object-fit:contain}
.cl-name{flex:1;min-width:0;font-weight:700;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cl-name .q{color:var(--text-faint);font-weight:500;font-size:12px}
.cl-bot{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-left:44px}
.cl-price{font-size:12.5px;color:var(--text-dim)}
.cl-price b{color:var(--text);font-weight:800}
.cl-step{display:flex;align-items:center;gap:6px;flex:none}
.cl-step .ctr-stp{flex:none;width:32px;height:32px;font-size:19px}
.cl-step span{min-width:26px;text-align:center;font-weight:800;font-size:15px}
.cl-rm{border:0;background:transparent;color:var(--text-faint);font-size:22px;line-height:1;width:28px;height:28px;flex:none;border-radius:8px}
.cl-rm:hover{background:var(--surface-2);color:var(--red)}
.cart-foot{border-top:1px solid var(--border);padding:14px 16px;display:flex;flex-direction:column;gap:10px}
.cart-total{display:flex;justify-content:space-between;align-items:baseline;font-weight:800;font-size:16px}
.cart-total .v{font-size:22px}
.ctr-only-mobile{display:none}
@media(max-width:900px){
  .ctr-sale{grid-template-columns:1fr}
  .ctr-cart{display:none}
  .ctr-only-mobile{display:flex}
  .ctr-sale .ctr-pgrid{padding-bottom:150px}
}
