/* Pathlume Peedika — counter app. Layout: phone = one column with sticky pay button;
   tablet / PC (≥ 820px) = items on the left, bill on the right. */
:root {
  --bg: #F4F6F1; --surface: #FFFFFF; --sunk: #EBF0E8; --ink: #15231B; --muted: #5C6A61; --line: #D9E1D6;
  --leaf: #1F6B45; --leaf-ink: #FFFFFF; --leaf-soft: #E1EFE6; --turmeric: #E0A00A; --turmeric-soft: #FBF0D2;
  --due: #B23A1E; --due-soft: #F9E5DF; --okc: #1F6B45; --chart: #1A7A4A; --bar: #1F6B45; --bar-name: #FFD166; --bar-sub: #CFE6D8;
  --f-display: "Noto Sans Malayalam", "Noto Sans Kannada", "Noto Sans", system-ui, sans-serif;
  --f-body: "Noto Sans Malayalam", "Noto Sans Kannada", "Noto Sans", system-ui, sans-serif;
  --f-num: "Noto Sans", system-ui, sans-serif;
  --r: 12px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0E1611; --surface: #16211A; --sunk: #1B2920; --ink: #E4EDE6; --muted: #98A89E; --line: #2A3A30;
  --leaf: #5BC38B; --leaf-ink: #0B1A11; --leaf-soft: #1B3326; --turmeric: #F0B536; --turmeric-soft: #36290F;
  --due: #F08A70; --due-soft: #3A1E18; --okc: #5BC38B; --chart: #3FA872; --bar: #12402A; --bar-name: #F4C95D; --bar-sub: #A9CBB7; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0E1611; --surface: #16211A; --sunk: #1B2920; --ink: #E4EDE6; --muted: #98A89E; --line: #2A3A30;
  --leaf: #5BC38B; --leaf-ink: #0B1A11; --leaf-soft: #1B3326; --turmeric: #F0B536; --turmeric-soft: #36290F;
  --due: #F08A70; --due-soft: #3A1E18; --okc: #5BC38B; --chart: #3FA872; --bar: #12402A; --bar-name: #F4C95D; --bar-sub: #A9CBB7; color-scheme: dark }

* { box-sizing: border-box }
html, body { margin: 0 }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.15; margin: 0; text-wrap: balance }
h2 { font-size: 24px; margin: 16px 0 10px }
h3 { font-size: 18px; margin: 18px 0 8px }
h3 small { font-family: var(--f-body); font-size: 13px; color: var(--muted); font-weight: 400 }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px }
input:disabled, select:disabled, textarea:disabled { background: var(--sunk); color: var(--muted) }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted) }
label > input, label > select, label > textarea { color: var(--ink); font-size: 15px }
button, .btn { font: inherit; cursor: pointer; border: none; border-radius: var(--r) }
:focus-visible { outline: 3px solid var(--turmeric); outline-offset: 2px }
a { color: var(--leaf) }

.btn { background: var(--leaf); color: var(--leaf-ink); font-weight: 600; padding: 12px 16px; min-height: 48px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; text-decoration: none; gap: 2px }
.btn small { font-weight: 400; font-size: 12px; opacity: .85 }
.btn.alt { background: var(--leaf-soft); color: var(--leaf) }
.btn.small { min-height: 38px; padding: 7px 12px; font-size: 14px }
.btn.danger { background: var(--due); color: #fff }
.btn.alt.danger { background: var(--due-soft); color: var(--due) }
.btn:disabled { opacity: .45; cursor: not-allowed }
.link { background: none; color: var(--leaf); text-decoration: underline; padding: 8px; font-size: 14px }
.iconbtn { width: 42px; height: 42px; display: grid; place-items: center; background: transparent; color: var(--ink); border-radius: 50% }
.iconbtn svg, .tabs svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }
.iconbtn.solid { background: var(--leaf); color: var(--leaf-ink); border-radius: 10px; width: 48px; height: 48px; flex: none }
.filebtn { position: relative; overflow: hidden }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer }
.stack { display: flex; flex-direction: column; gap: 10px }
.row-wrap { flex-direction: row; flex-wrap: wrap }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.fine { font-size: 12.5px; color: var(--muted); margin: 6px 0 }
.center { text-align: center }
.err { color: var(--due); font-size: 14px; margin: 0 }
.empty { color: var(--muted); font-size: 14px; padding: 14px 4px; margin: 0 }
.note { background: var(--turmeric-soft); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; margin: 0 }
.due { color: var(--due) } .okc { color: var(--okc) } .muted { color: var(--muted) }
.strike { text-decoration: line-through; color: var(--muted) }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px }
.check { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-size: 15px }
.check input { width: 22px; min-height: 22px; height: 22px }

/* header */
header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 8; background: var(--bg); border-bottom: 1px solid var(--line) }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg) }
.top-in { display: flex; align-items: center; gap: 6px; padding-block: 8px }
.brand { flex: 1; min-width: 0; display: flex; flex-direction: column }
.brand b { font-family: var(--f-display); font-size: 21px; line-height: 1.1; color: var(--leaf); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.brand span { font-size: 12px; color: var(--muted) }
.syncchip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted) }
.dot.ok { background: var(--okc) } .dot.wait { background: var(--turmeric) } .dot.bad { background: var(--due) } .dot.local { background: var(--line) }
@media (max-width: 420px) { .syncchip { font-size: 0; padding: 8px } .syncchip .dot { width: 10px; height: 10px } }

/* bottom tabs */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 4px max(6px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)) }
nav.tabs button { background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; font-size: 12.5px; min-height: 54px }
nav.tabs button[aria-current="page"] { color: var(--leaf); font-weight: 600 }
nav.tabs button[aria-current="page"] svg { stroke-width: 2.4 }

/* billing */
.bill { display: flex; flex-direction: column; gap: 12px; padding-top: 12px }
.searchrow { display: flex; gap: 8px }
.searchrow input { font-size: 16px; min-height: 48px }
.cats { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: none }
.cat { background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: 6px 12px; white-space: nowrap; font-size: 14px; min-height: 36px }
.cat[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink) }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 6px }
.tile { position: relative; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-align: left; padding: 9px 10px; min-height: 84px; display: flex; flex-direction: column; gap: 1px; border-radius: 12px }
.tile b { font-size: 15px; line-height: 1.25; font-weight: 600 }
.tile small { font-size: 11px; color: var(--muted); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.tile span { margin-top: auto; font-size: 13px; color: var(--leaf); font-weight: 600 }
.tile em { position: absolute; top: 6px; right: 6px; font-style: normal; font-size: 10.5px; background: var(--due-soft); color: var(--due); border-radius: 999px; padding: 0 6px }
.tile em.low { background: var(--turmeric-soft); color: var(--ink) }
.tile.out { opacity: .55 }
.pane-cart { display: flex; flex-direction: column; gap: 10px }
.cart { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden }
.cline { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: none; color: var(--ink); text-align: left; border-top: 1px solid var(--line); border-radius: 0; min-height: 52px }
.cline:first-child { border-top: none }
.cn { flex: 1; min-width: 0; display: flex; flex-direction: column }
.cn b { font-weight: 600 } .cn small { color: var(--muted); font-size: 12.5px }
.cv { font-weight: 600 }
.billmeta { display: flex; gap: 6px; flex-wrap: wrap }
.chipbtn { background: var(--sunk); color: var(--ink); border-radius: 999px; padding: 7px 14px; font-size: 14px; min-height: 38px }
.chipbtn.wide { border-radius: 12px; min-height: 48px; text-align: left; padding: 10px 14px }
.totals div { display: flex; justify-content: space-between; font-size: 14px }
.btn.pay { flex-direction: row; justify-content: space-between; font-size: 17px; min-height: 58px; padding: 10px 18px; position: sticky; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); z-index: 4; box-shadow: 0 6px 18px rgb(0 0 0 / .18) }
.btn.pay b { font-size: 24px }
@media (min-width: 820px) {
  .bill { display: grid; grid-template-columns: minmax(0, 1fr) 380px; align-items: start; gap: 18px }
  .pane-cart { position: sticky; top: 76px; max-height: calc(100vh - 160px); overflow: auto; padding-bottom: 8px }
  .grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)) }
  .btn.pay { position: static; box-shadow: none }
}

/* lists */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px }
.filters > * { flex: 1 1 140px; width: auto }
.filters .btn { flex: 0 0 auto }
.sum { margin: 4px 0 10px; color: var(--muted); font-size: 14px }
.sum b { color: var(--ink) }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 12px }
.row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); background: none; color: var(--ink); text-align: left; border-radius: 0; min-height: 52px }
.list > .row:first-child, .list > .empty:first-child { border-top: none }
.row .main { flex: 1; min-width: 0; display: flex; flex-direction: column }
.row .main b { font-weight: 600 } .row .main small { color: var(--muted); font-size: 12.5px }
.as-btn { background: none; border: none; color: inherit; text-align: left; padding: 0; font: inherit; cursor: pointer }
.amt { text-align: right; font-weight: 600; white-space: nowrap }
.amt small { font-weight: 400; color: var(--muted) }
.row.tot { background: var(--sunk) }
.pill { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 8px; white-space: nowrap; font-family: var(--f-body) }
.pill.bad { background: var(--due-soft); color: var(--due) } .pill.warn { background: var(--turmeric-soft); color: var(--ink) } .pill.ok { background: var(--leaf-soft); color: var(--leaf) }
.numin { width: 120px; text-align: right; font-family: var(--f-num) }
.hero { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; background: var(--leaf-soft); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px }
.hero b { font-size: 26px; color: var(--leaf) } .hero b.due { color: var(--due) }
.hero.ok { background: var(--leaf); color: var(--leaf-ink) } .hero.ok b { color: var(--leaf-ink); font-size: 20px }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column }
.stat span { font-size: 12.5px; color: var(--muted) } .stat b { font-size: 20px } .stat small { font-size: 12px; color: var(--muted) }
.stat.big { grid-column: 1 / -1; background: var(--leaf-soft); border-color: transparent } .stat.big b { font-size: 30px; color: var(--leaf) }
@media (min-width: 820px) { .grid2:has(.stat) { grid-template-columns: repeat(4, 1fr) } }
.tablewrap { overflow-x: auto; margin-bottom: 6px }
table.t { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 12px; overflow: hidden; font-size: 14px }
table.t th, table.t td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line) }
table.t th:first-child, table.t td:first-child { text-align: left }
table.t th { font-size: 12px; color: var(--muted); font-weight: 600 }
table.t tr.tot td { font-weight: 700; background: var(--sunk) }

/* sheets */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgb(0 0 0 / .45); display: flex; align-items: flex-end; justify-content: center }
.sh { position: relative; width: 100%; max-width: 560px; margin: 0; border-radius: 20px 20px 0 0; max-height: 92vh; overflow: auto; display: flex; flex-direction: column; gap: 10px;
  padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)) }
.sh h3 { margin: 0; padding-right: 44px }
.shx { position: absolute; top: 8px; right: 8px }
@media (min-width: 820px) { .sheet { align-items: center } .sh { border-radius: 20px } }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px }
.seg button { background: var(--surface); border: 1px solid var(--line); color: var(--ink); padding: 10px 4px; min-height: 46px; font-weight: 600 }
.seg button[aria-pressed="true"] { background: var(--leaf); color: var(--leaf-ink); border-color: var(--leaf) }
.upiamt { text-align: center; font-size: 34px; font-weight: 700; color: var(--leaf); margin: 0 }
.qrbox { align-self: center; background: #fff; padding: 10px; border-radius: 14px; border: 1px solid var(--line); width: 220px; max-width: 100% }
.qrbox svg { display: block; width: 100%; height: auto }
.qtyrow { display: flex; gap: 8px }
.qtyrow input { text-align: center; font-size: 20px; font-family: var(--f-num) }
.qb { width: 52px; flex: none; background: var(--leaf-soft); color: var(--leaf); font-size: 24px; font-weight: 600 }
fieldset.pick { border: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px }
fieldset.pick legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 4px }
.opt { flex-direction: row; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 15px; cursor: pointer }
.opt input { width: 20px; min-height: 20px; height: 20px; margin-top: 2px; flex: none }
.opt span { display: flex; flex-direction: column } .opt small { color: var(--muted); font-size: 12.5px }
.opt:has(input:checked) { border-color: var(--leaf); background: var(--leaf-soft) }
.warnbox { background: var(--due-soft); border-color: transparent }
#scanV { width: 100%; border-radius: 12px; background: #000; aspect-ratio: 4/3; object-fit: cover; max-width: 100% }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(140px + env(safe-area-inset-bottom, 0px)); z-index: 30; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; max-width: 90vw; text-align: center }
.toast.bad { background: var(--due); color: #fff }

/* setup */
.setup { max-width: 440px; padding-block: 8vh 24px; display: flex; flex-direction: column; gap: 12px }
.logo-full { width: min(240px, 70vw); height: auto; display: block; align-self: center; background: #fff; border-radius: 20px; padding: 8px }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.grid > .empty { grid-column: 1 / -1 }
.setup h1 { font-size: 34px; color: var(--leaf) }
.lede { margin: 0; color: var(--muted) }
.setup > .lede { text-align: center }
.shopname { font-family: var(--f-display); font-size: 22px; margin: 0 }
details summary { cursor: pointer; color: var(--muted); font-size: 13px }

/* receipt (screen preview + print) */
.rcwrap { background: #fff; color: #000; border-radius: 8px; padding: 10px; border: 1px dashed var(--line); align-self: center; width: 100%; max-width: 320px }
.rc { font: 12px/1.35 "Noto Sans Malayalam", "Noto Sans Kannada", "Noto Sans", sans-serif; color: #000 }
.rc .r { display: flex; justify-content: space-between; gap: 8px }
.rc .r.big { font-size: 15px; font-weight: 700; margin-top: 2px }
.rc-h { text-align: center } .rc-h b { font-size: 15px }
.rc-t { text-align: center; font-weight: 700; margin: 4px 0; letter-spacing: .05em }
.rc-line { border-top: 1px dashed #000; margin: 4px 0 }
.rc-i small { color: #333 }
.rc-tax { width: 100%; font-size: 11px; border-collapse: collapse } .rc-tax th, .rc-tax td { text-align: right; padding: 1px 2px } .rc-tax th:first-child, .rc-tax td:first-child { text-align: left }
.rc-legend { text-align: center; font-size: 11px; margin-top: 4px; font-style: italic }
.rc-f { text-align: center; font-weight: 700; margin-top: 6px } .rc-p { text-align: center; font-size: 10px; color: #444 }
.rc-x { text-align: center; font-weight: 700; border: 2px solid #000; margin-bottom: 4px }
#printArea { display: none }
@media print {
  @page { margin: 0 }
  body { background: #fff; padding: 0 }
  body > *:not(#printArea) { display: none !important }
  body::before { display: none }
  #printArea { display: block; padding: 2mm }
  #printArea.paper58 { width: 48mm } #printArea.paper80 { width: 72mm; } #printArea.paper80 .rc { font-size: 13px }
}
@media (prefers-reduced-motion: no-preference) { .tile, .btn, .cat, .chipbtn { transition: transform .08s } .tile:active, .btn:active, .cat:active { transform: scale(.97) } }

/* WhatsApp: image / text choice */
.seg.two { grid-template-columns: 1fr 1fr }
.seg .segopt { display: flex; position: relative }
.seg .segopt input { position: absolute; opacity: 0; pointer-events: none }
.seg .segopt span { flex: 1; text-align: center; padding: 10px 4px; min-height: 46px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-weight: 600; cursor: pointer }
.seg .segopt input:checked + span { background: var(--leaf); color: var(--leaf-ink); border-color: var(--leaf) }
.seg .segopt input:focus-visible + span { outline: 2px solid var(--turmeric); outline-offset: 2px }

/* plan and demo banners */
.banner { padding: 9px max(16px, env(safe-area-inset-left, 0px)); font-size: 13.5px; line-height: 1.45; text-align: center }
.banner.warn { background: var(--turmeric-soft); color: var(--ink) }
.banner.bad { background: var(--due); color: #fff; font-weight: 600 }
.banner.demo { background: var(--leaf-soft); color: var(--ink) }

/* saved-customer suggestions on the WhatsApp screen */
.sugg { display: flex; flex-wrap: wrap; gap: 8px } .sugg:empty { display: none }
.sugg .chipbtn { display: inline-flex; gap: 8px; align-items: baseline; min-height: 44px }

/* phone: feedback when an item is tapped, and a bill bar that is always in view */
.tile { position: relative }
.tile.incart { border-color: var(--leaf); box-shadow: inset 0 0 0 1.5px var(--leaf) }
.tile .qbadge { position: absolute; top: -7px; left: -7px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--leaf); color: var(--leaf-ink); font-style: normal; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgb(0 0 0 / .2) }
.tile.pulse { animation: tilepulse .45s ease-out }
@keyframes tilepulse { 0% { transform: scale(.94); background: var(--leaf-soft) } 100% { transform: scale(1) } }
@media (prefers-reduced-motion: reduce) { .tile.pulse { animation: none; background: var(--leaf-soft) } }
.tile:active { background: var(--leaf-soft) }
.billbar { display: none }
@media (max-width: 819px) {
  .billbar { display: flex; gap: 8px; position: fixed; left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); bottom: calc(70px + env(safe-area-inset-bottom, 0px)); z-index: 7 }
  .billbar button { min-height: 54px; border-radius: 14px; box-shadow: 0 6px 18px rgb(0 0 0 / .22); font-weight: 600 }
  .billbar .bb-cart { flex: 0 0 auto; padding: 0 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line) }
  .billbar .bb-pay { flex: 1; display: flex; justify-content: space-between; align-items: center; padding: 0 16px; background: var(--leaf); color: var(--leaf-ink); font-size: 16px }
  .billbar .bb-pay b { font-size: 22px }
  .pane-cart .btn.pay { display: none }
  .bill { padding-bottom: 76px }
}

/* − on a tile that is already on the bill */
.tw { position: relative; display: flex; min-width: 0 }
.tw > .tile { flex: 1; min-width: 0 }
.tminus { position: absolute; bottom: -6px; right: -6px; width: 36px; height: 36px; border-radius: 50%; padding: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; line-height: 1; background: var(--surface); color: var(--due); border: 1.5px solid var(--due); box-shadow: 0 2px 6px rgb(0 0 0 / .18); z-index: 1 }
.tminus:active { background: var(--due-soft) }
.tw .tile.incart span { padding-right: 30px }

/* Add from photo (Plus) */
.phwait { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 0; color: var(--muted) }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--leaf-soft); border-top-color: var(--leaf); animation: spin .9s linear infinite }
@keyframes spin { to { transform: rotate(360deg) } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s } }
.phmeter { background: var(--sunk); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; margin: 6px 0 }
.phmeter small { color: var(--muted) }
.phbar { height: 8px; border-radius: 99px; background: var(--surface); overflow: hidden }
.phbar i { display: block; height: 100%; background: var(--leaf); border-radius: 99px }
.phbar i.low { background: var(--turmeric) }
.phnote { border-radius: var(--r); padding: 9px 12px; background: var(--leaf-soft); margin: 6px 0 }
.phnote.warn { background: var(--turmeric-soft) } .phnote.bad { background: var(--due-soft); color: var(--due) }
.eco { font-size: 13.5px; background: var(--leaf-soft); color: var(--ink); border-radius: var(--r); padding: 8px 12px; margin: 6px 0 }
.ok-note { font-weight: 600; margin: 4px 0 }
.phlist { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; margin: 8px 0; padding-right: 2px }
.phrow { display: grid; grid-template-columns: auto minmax(0, 1fr) 118px; gap: 8px; align-items: start; border: 1px solid var(--line); border-radius: var(--r); padding: 8px }
.phrow.off { opacity: .6 }
.phrow input[type=checkbox] { width: 22px; height: 22px; min-height: 0; margin-top: 8px }
.phnames, .phprice { display: flex; flex-direction: column; gap: 4px; min-width: 0 }
.phrow input:not([type=checkbox]), .phrow select { width: 100%; min-width: 0; padding: 7px 8px; font-size: 15px }
.phnames input + input { font-size: 13px; color: var(--muted) }
.phprice input.need { border-color: var(--turmeric); background: var(--turmeric-soft) }
.phnames .pill { align-self: flex-start }

/* install as an app */
.installbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--leaf-soft); color: var(--ink); padding: 8px max(16px, env(safe-area-inset-left, 0px)); font-size: 14px }
.installbar span { flex: 1 1 200px }
.installbar .btn.small { min-height: 36px }
.fine.ok { color: var(--leaf); font-weight: 600 }

/* dashboard */
.rtabs { display: flex; gap: 6px; margin: 4px 0 8px }
.dash .card { margin-bottom: 12px }
.dash h3 { margin: 0 0 6px; font-size: 16px }
.dash h3 small { font-weight: 400; color: var(--muted); font-size: 12.5px }
.kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px }
.kpi .stat b { font-size: 19px }
.kpi .hero2 { grid-column: 1 / -1; background: var(--leaf-soft); border-color: transparent }
.kpi .hero2 b { font-size: 34px; color: var(--leaf) }
.delta { font-size: 12.5px; font-weight: 600 } .delta.up { color: var(--okc) } .delta.down { color: var(--due) } .delta.flat { color: var(--muted) }
@media (min-width: 820px) { .kpi { grid-template-columns: repeat(4, 1fr) } }
.chart svg { width: 100%; height: auto; display: block; overflow: visible }
.chart .grid line { stroke: var(--line); stroke-width: 1 }
.chart .ax { fill: var(--muted); font: 11px var(--f-num) }
.chart svg { max-width: 560px }
.chart .val { fill: var(--ink); font: 600 11px var(--f-num) }
.chart .bar { fill: var(--chart) }
.chart g.cb { cursor: pointer; outline: none }
.chart g.cb .hit { fill: transparent }
.chart g.cb:hover .bar, .chart g.cb:focus .bar, .chart g.cb.on .bar { fill: var(--leaf) }
.chart g.cb:focus-visible .hit { stroke: var(--ink); stroke-width: 1 }
.readout { font-size: 13px; color: var(--muted); min-height: 18px; margin-top: 4px }
.readout b { color: var(--ink) }
.pl { width: 100%; border-collapse: collapse; font-size: 14px }
.pl td { padding: 6px 0; border-bottom: 1px solid var(--line) } .pl td.num { text-align: right }
.pl tr.sub td { color: var(--muted) } .pl tr.tot td { font-weight: 700; border-bottom: none; font-size: 16px }
.pl tr.tot td.num.neg { color: var(--due) } .pl tr.tot td.num.pos { color: var(--okc) }
.blist { display: flex; flex-direction: column; gap: 9px }
.brow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline }
.brow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.brow .nm small { color: var(--muted); margin-left: 4px }
.brow .v { font-weight: 600 }
.brow .track { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--leaf-soft); overflow: hidden }
.brow .track i { display: block; height: 100%; background: var(--chart); border-radius: 99px }
.alerts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px }
.alert { border-radius: 12px; padding: 9px 11px; background: var(--sunk); display: flex; flex-direction: column; gap: 1px; text-align: left; border: 0; font: inherit; color: inherit; cursor: pointer }
.alert b { font-size: 20px } .alert span { font-size: 12.5px; color: var(--muted) }
.alert.warn { background: var(--turmeric-soft) } .alert.bad { background: var(--due-soft) } .alert.bad b { color: var(--due) }
.dl .row { padding: 9px 0 }
.dl .row .main small { display: block }
.pill.exp { background: var(--due-soft); color: var(--due) }
.dnote { font-size: 12.5px; color: var(--muted); background: var(--turmeric-soft); border-radius: 10px; padding: 7px 10px; margin: 6px 0 }
.dash .tabs2 { display: flex; gap: 6px; margin: 2px 0 10px; flex-wrap: wrap }

/* top bar: brand band with the shop name in gold */
header.top { background: var(--bar); border-bottom: 0; box-shadow: 0 1px 0 rgba(0,0,0,.12) }
header.top .brand b { font-family: Poppins, var(--f-display); font-weight: 700; font-size: 22px; letter-spacing: .2px; color: var(--bar-name) }
header.top .brand span { color: var(--bar-sub) }
header.top .iconbtn { color: #FFFFFF }
header.top .syncchip { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.28); color: #FFFFFF }
header.top .dot.local { background: rgba(255,255,255,.5) }

/* customer rank and flags */
.cbadges { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; margin-left: 6px }
.cb-rank { font: 600 11px var(--f-num); border-radius: 999px; padding: 1px 7px; background: var(--leaf-soft); color: var(--leaf); white-space: nowrap }
.cb-rank.top { background: var(--turmeric-soft); color: var(--ink) }
.cb-flag { font: 600 11px var(--f-body); border-radius: 999px; padding: 1px 7px; background: var(--due-soft); color: var(--due); white-space: nowrap }
.cb-new { font: 600 11px var(--f-body); border-radius: 999px; padding: 1px 7px; background: var(--sunk); color: var(--muted); white-space: nowrap }
.custcard { background: var(--sunk); border-radius: 12px; padding: 8px 12px; margin: 0 0 10px; font-size: 13.5px; display: flex; flex-direction: column; gap: 3px }
.custcard .flag { color: var(--due); font-weight: 600 }

/* brands */
.tile small.brand { color: var(--leaf); font-weight: 600 }
.tile.group { border-style: dashed }
.tile.group small.brand { text-decoration: underline dotted; text-underline-offset: 3px }
.tile.group span { font-size: 12.5px }
.brandtag { font: 600 11px var(--f-body); background: var(--leaf-soft); color: var(--leaf); border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: middle }
.brandrow.out { opacity: .6 }
/* 1.7.4 WhatsApp quick send */
.waquick .who { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 0 }
.waquick .who .num { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap }
.waquick .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px }
.wachips { margin-bottom: 4px }
.waquick .grid2 .btn { white-space: nowrap }
.waquick .link { padding: 4px 0 }
/* 1.7.5 existing names while adding an item */
.nmsugg:empty { display: none }
.nmsugg { display: grid; gap: 6px }
.nmsugg .nmhit { width: 100%; text-align: left; border: 1px solid var(--line, #ddd); border-radius: 10px; background: var(--card, #fff) }
/* 1.8.0 new phones wait for the owner's approval */
.waitbox { text-align: center }
.waitbox h2 { font-size: 20px; margin: 4px 0 }
.checkno { font-size: 44px; font-weight: 800; letter-spacing: 10px; color: var(--leaf); margin: 6px 0 }
.checkno.small { font-size: 18px; letter-spacing: 3px; margin: 0 }
.banner.phonealert { background: var(--turmeric-soft); color: var(--ink); text-align: left; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--turmeric, #d9a400) }
.banner.phonealert > div:first-child { display: flex; flex-direction: column; gap: 2px; flex: 1 1 220px }
.banner.phonealert .row-wrap { gap: 8px }
.phonerow .row-wrap { gap: 6px; flex-wrap: nowrap }
.setup:has(.waitbox) .logo-full, .setup:has(.waitbox) .lede { display: none }
.banner.phonealert .row-wrap { display: flex; gap: 10px }
.hero.bad { background: var(--due-soft); color: var(--due) } .hero.bad b { color: var(--due); font-size: 20px }
/* 1.8.3 − in the brand picker */
.row.brandwrap { padding: 0; gap: 0 }
.brandwrap .brandrow { border-top: 0; flex: 1 }
.bminus { flex: none; width: 44px; height: 44px; margin-right: 10px; border-radius: 50%; padding: 0; font-size: 22px; font-weight: 700; line-height: 1; background: var(--surface); color: var(--due); border: 1.5px solid var(--due) }
.bminus:active { background: var(--due-soft) }
/* 1.8.4 − / + on each bill line */
.cline { padding: 6px 8px 6px 0 }
.cline .cmain { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 12px; background: none; color: var(--ink); text-align: left; border-radius: 0; min-height: 44px }
.cstep { display: flex; align-items: center; gap: 4px; flex: none }
.cstep b { min-width: 30px; text-align: center; font-size: 15px }
.cq { width: 38px; height: 38px; padding: 0; border-radius: 50%; font-size: 20px; font-weight: 700; line-height: 1; background: var(--surface); color: var(--due); border: 1.5px solid var(--due); display: flex; align-items: center; justify-content: center }
.cq.plus { color: var(--leaf); border-color: var(--leaf) }
.cq:active { transform: scale(.94) }
