/* RetailCore — indigo ledger ink + marigold counter. Mobile-first, touch-first. */
@font-face {
  font-family: "Anek";
  src: url("../fonts/anek-latin.woff") format("woff");
  font-weight: 100 800;
  font-stretch: 75% 125%;
  font-display: swap;
}

:root {
  --ink: #1b1f3b;
  --ink-2: #4a5078;
  --ink-3: #666b8d;   /* 4.5:1 or more on every light surface (WCAG AA) */
  --indigo: #2b3a8c;
  --indigo-2: #3d4fb3;
  --indigo-soft: #e8ebf8;
  --marigold: #f4a300;
  --marigold-press: #d98f00;
  --paper: #f5f6fa;
  --surface: #ffffff;
  --line: #e1e4ee;
  --line-2: #cdd2e3;
  --paid: #157a55;
  --paid-soft: #e3f4ec;
  --due: #b45309;
  --due-soft: #fdf0e1;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ret: #6b3fbf; --ret-soft: #efe8fb; --info: #0f7a7a; --info-soft: #e0f3f2;
  --focus: #3d4fb3;
  --must: #fff6db;          /* background of boxes that must be filled */
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 20px;
  --tap: 48px;
  --shadow-sheet: 0 -8px 32px rgba(27, 31, 59, .18);
  --font: "Anek", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #eceefa; --ink-2: #b9bddb; --ink-3: #959abd; --indigo: #8e9cf2; --indigo-2: #a9b4f6; --indigo-soft: #262c56;
    --paper: #12152a; --surface: #1b1f3b; --line: #2c3160; --line-2: #3a4078; --paid: #4cc38a; --paid-soft: #16352c;
    --due: #f0a656; --due-soft: #3a2a16; --danger: #f2877d; --danger-soft: #3b1c1c; --focus: #a9b4f6; color-scheme: dark;
    --ret: #c4a8ff; --ret-soft: #2e2550; --info: #6fd6d0; --info-soft: #173634;
  }
}
:root[data-theme="dark"] {
  --ink: #eceefa; --ink-2: #b9bddb; --ink-3: #959abd; --indigo: #8e9cf2; --indigo-2: #a9b4f6; --indigo-soft: #262c56;
  --paper: #12152a; --surface: #1b1f3b; --line: #2c3160; --line-2: #3a4078; --paid: #4cc38a; --paid-soft: #16352c;
  --due: #f0a656; --due-soft: #3a2a16; --danger: #f2877d; --danger-soft: #3b1c1c; --focus: #a9b4f6; color-scheme: dark;
    --ret: #c4a8ff; --ret-soft: #2e2550; --info: #6fd6d0; --info-soft: #173634;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45;
  font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
h1, h2, h3 { margin: 0; line-height: 1.15; font-stretch: 88%; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .75em; }
a { color: var(--indigo); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.money { font-stretch: 80%; font-weight: 650; white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.right { text-align: right; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top)); background: var(--indigo); color: #fff; min-height: 56px;
}
:root[data-theme="dark"] .topbar, .topbar { background: #23306f; }
.topbar h1 { font-size: 1.15rem; font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .iconbtn { color: #fff; }
.brandmark { width: 28px; height: 28px; border-radius: 7px; background: var(--marigold); color: #1b1f3b; display: grid; place-items: center;
  font-weight: 800; font-stretch: 75%; font-size: 15px; flex: none; }
.loc-pill { background: rgba(255, 255, 255, .14); border: 0; color: #fff; border-radius: 999px; padding: 6px 12px; min-height: 36px; max-width: 40vw; flex: none; min-width: 64px; }
main { padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(88px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left, 0px)); width: 100%; max-width: 1100px; margin: 0 auto; }
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  display: grid; justify-items: center; gap: 2px; padding: 8px 2px 6px; min-height: 58px; color: var(--ink-3); text-decoration: none; font-size: .78rem;
}
.bottomnav a svg { width: 24px; height: 24px; }
.bottomnav a[aria-current="page"] { color: var(--indigo); font-weight: 650; }
.bottomnav a[aria-current="page"] svg { stroke-width: 2.4; }
.bottomnav .more-only { display: none; }
@media (min-width: 900px) {
  /* "More" stays in the side menu on computers: transfers, audits, write-offs, import… live there */
  .bottomnav .more-btn { display: flex; margin-top: 4px; border-top: 1px solid var(--line); }
  .shell { grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; }
  .bottomnav {
    position: sticky; top: 56px; grid-row: 2; height: calc(100dvh - 56px); display: flex; flex-direction: column; gap: 2px;
    border-top: 0; border-right: 1px solid var(--line); padding: 12px 8px;
  }
  .bottomnav a { display: flex; gap: 12px; align-items: center; justify-items: start; padding: 10px 12px; border-radius: var(--r-s); font-size: .95rem; min-height: 44px; }
  .bottomnav a[aria-current="page"] { background: var(--indigo-soft); }
  .bottomnav .more-only { display: flex; }
  main { padding: 24px 32px 48px; }
}

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px; border-radius: var(--r-m);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none;
  touch-action: manipulation; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--indigo); border-color: var(--indigo); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #12152a; }
.btn.go { background: var(--marigold); border-color: var(--marigold); color: #1b1f3b; }
.btn.go:active { background: var(--marigold-press); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--indigo); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .9rem; border-radius: var(--r-s); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.iconbtn {
  width: var(--tap); height: var(--tap); display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: transparent;
  color: var(--ink-2); cursor: pointer; flex: none;
}
.iconbtn svg, .btn svg { width: 22px; height: 22px; }
svg.i { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* every icon has a sensible size by default (zero specificity, so any rule for a place still wins) */
:where(svg.i) { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.22em; }

.field { display: grid; gap: 6px; align-content: start; }   /* side-by-side boxes line up at the top, even when one has a hint under it */
.field > span { font-size: .875rem; color: var(--ink-2); font-weight: 550; }
.field .hint { font-size: .8rem; color: var(--ink-3); }
.field .err { font-size: .85rem; color: var(--danger); }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]), select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface);
  font-size: 1rem;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grid3 { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 520px) { .grid3 { grid-template-columns: 1fr 1fr; } }
.full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 12px; min-height: var(--tap); cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--indigo); flex: none; }

.seg { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; border-radius: 9px; min-height: 40px; padding: 0 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--indigo); box-shadow: 0 1px 2px rgba(27, 31, 59, .15); }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; }
.panel + .panel { margin-top: 12px; }
.panel h2 { margin-bottom: 12px; }
.pagehead { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.pagehead h1 { flex: 1; }
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list .item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 64px; color: inherit; text-decoration: none; width: 100%;
  background: none; border: 0; text-align: left; cursor: pointer; }
.list .item:active { background: var(--paper); }
.list .title { font-weight: 600; }
.list .sub { font-size: .85rem; color: var(--ink-3); }
.empty { text-align: center; padding: 40px 16px; color: var(--ink-2); }
.empty p { max-width: 36ch; margin: 8px auto 16px; }
.tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 600; background: var(--indigo-soft); color: var(--indigo); white-space: nowrap; }
.tag.paid { background: var(--paid-soft); color: var(--paid); }
.tag.due, .tag.partial, .tag.unpaid, .tag.low, .tag.expiring { background: var(--due-soft); color: var(--due); }
.tag.cancelled, .tag.out, .tag.expired, .tag.missing { background: var(--danger-soft); color: var(--danger); }
/* one colour per kind of word, the same everywhere: returns purple, money due amber, done green, problems red, notes teal/grey */
.tag.return { background: var(--ret-soft); color: var(--ret); }
.tag.received { background: var(--paid-soft); color: var(--paid); }
.tag.opening, .tag.info { background: var(--info-soft); color: var(--info); }
.tag.draft, .tag.held, .tag.off { background: var(--paper); color: var(--ink-3); border: 1px solid var(--line); }
.title .tag, .pagehead .tag { font-size: .75rem; padding: 1px 8px; }
/* figures that need the owner: coloured edge and figure when not zero */
.kpi.attn-collect { box-shadow: inset 4px 0 0 var(--due); }
.kpi.attn-collect .v { color: var(--due); }
.kpi.attn-pay { box-shadow: inset 4px 0 0 var(--danger); }
.kpi.attn-pay .v { color: var(--danger); }
/* Important messages: one look everywhere. A coloured bar on the left, a round sign (i, !, ✓, ×) and a tinted panel,
   so they stand apart from ordinary text. Kinds: info (default), warn, bad, good. .plain drops the sign. */
.notice { --nc: var(--indigo); position: relative; border-radius: var(--r-m); padding: 12px 14px 12px 46px; background: var(--indigo-soft);
  color: var(--ink); font-size: .97rem; line-height: 1.45; border: 1px solid color-mix(in srgb, var(--nc) 22%, transparent); border-left: 5px solid var(--nc); }
.notice::before { content: 'i'; position: absolute; left: 12px; top: 11px; width: 22px; height: 22px; border-radius: 50%; background: var(--nc); color: var(--surface);
  font: 800 .85rem/22px var(--font, system-ui); text-align: center; }
.notice.warn { --nc: var(--due); background: var(--due-soft); }
.notice.warn::before { content: '!'; }
.notice.bad { --nc: var(--danger); background: var(--danger-soft); }
.notice.bad::before { content: '×'; font-size: 1rem; }
.notice.good { --nc: var(--paid); background: var(--paid-soft); }
.notice.good::before { content: '✓'; }
.notice.plain { padding-left: 14px; }
.notice.plain::before { content: none; }
.notice.small { padding-top: 9px; padding-bottom: 9px; padding-left: 42px; }
.notice.small::before { top: 8px; left: 10px; width: 20px; height: 20px; line-height: 20px; font-size: .78rem; }
.notice .nt { display: block; font-weight: 750; margin-bottom: 2px; }

.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th, table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.t th { font-weight: 600; color: var(--ink-2); background: var(--paper); position: sticky; top: 0; }
table.t td.n, table.t th.n { text-align: right; }
table.t tr:last-child td { border-bottom: 0; }
table.t tfoot td { font-weight: 700; background: var(--paper); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } .kpis.kpis3 { grid-template-columns: repeat(3, 1fr); } }
/* an odd number of figures on a phone: the last one takes the full row (no empty grey box) */
@media (max-width: 759px) { .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.kpi { background: var(--surface); padding: 14px 16px; min-width: 0; }
.kpi .v { overflow-wrap: anywhere; }
.kpi .v { font-size: 1.6rem; font-stretch: 78%; font-weight: 700; line-height: 1.1; }
.kpi .l { font-size: .85rem; color: var(--ink-3); }
.kpi .d { font-size: .8rem; font-weight: 600; }
.kpi .d.up { color: var(--paid); }
.kpi .d.down { color: var(--danger); }
.chartwrap { position: relative; padding-top: 4px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 8px; }
.bars.dense { gap: 1px; }
.bars > div, .bars > button { flex: 1; min-width: 0; background: var(--indigo); border: 0; padding: 0; border-radius: 4px 4px 0 0; min-height: 2px; opacity: .8; cursor: pointer; transition: opacity .12s; }
.bars > button:hover, .bars > button.on, .bars > button:focus-visible { opacity: 1; outline: 2px solid var(--marigold); outline-offset: 1px; }
.bars > div.today, .bars > button.today { background: var(--marigold); opacity: 1; }
.bartip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--ink, #1b1f3b); color: var(--surface); padding: 8px 12px; border-radius: 10px; pointer-events: none; z-index: 5; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.25); text-align: center; }
.bartip .money { color: inherit; }
.rangepicker { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.rangepicker .rangechips button { min-height: 36px; padding: 0 11px; }
.rangedates { display: grid; grid-template-columns: repeat(2, minmax(0, 168px)); gap: 8px; }
@media (max-width: 380px) { .rangedates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rangedates label { display: grid; gap: 2px; min-width: 0; font-size: .78rem; color: var(--ink-3); }
.rangedates input { min-height: 40px; }
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.cardgrid.small { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.acard { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "ic n" "t t"; gap: 4px 10px; align-items: center; padding: 14px 16px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--indigo); color: inherit; text-decoration: none; text-align: left; cursor: pointer; font: inherit; }
.acard:hover { box-shadow: 0 4px 14px rgba(27,31,59,.12); }
.acard.bad { border-left-color: var(--danger); } .acard.warn { border-left-color: var(--marigold); } .acard.info { border-left-color: var(--indigo-2); }
.acard.sel { outline: 3px solid var(--indigo); }
.acard-ic { grid-area: ic; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--indigo-soft); color: var(--indigo); }
.acard.bad .acard-ic { background: var(--danger-soft); color: var(--danger); } .acard.warn .acard-ic { background: var(--due-soft); color: var(--due); }
.acard-n { grid-area: n; font-size: 1.7rem; font-weight: 800; line-height: 1; }
.acard-t { grid-area: t; font-weight: 600; color: var(--ink-2); font-size: .92rem; }
.icard { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--r-m, 14px); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--indigo); color: inherit; text-decoration: none; min-width: 0; }
.icard:hover { box-shadow: 0 4px 14px rgba(27,31,59,.12); }
.icard.bad { border-top-color: var(--danger); } .icard.warn { border-top-color: var(--marigold); }
.icard-t { font-weight: 700; overflow-wrap: anywhere; } .icard-s { font-size: .85rem; color: var(--ink-3); }
.icard .tag { align-self: flex-start; }
.acard.good { border-left-color: var(--paid); } .acard.good .acard-ic { background: var(--paid-soft); color: var(--paid); } .icard.good { border-top-color: var(--paid); }

/* ---------- WhatsApp: a template's text to copy into the provider */
.tplbox { padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--line-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- support inbox: one line per conversation, unread in bold with a dot, like email ---------- */
.inbox { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); overflow: hidden; }
.inrow { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.inrow:last-child { border-bottom: 0; }
.inrow:hover, .inrow:focus-visible { background: var(--indigo-soft); }
.inrow .dot { width: 9px; height: 9px; border-radius: 50%; background: transparent; }
.inrow.unread .dot { background: var(--indigo); }
.inrow.unread .in-s { font-weight: 800; color: var(--ink); }
.in-s { font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-p { grid-column: 2 / 4; font-size: .85rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-d { font-size: .78rem; color: var(--ink-3); white-space: nowrap; }
.thread { display: grid; gap: 10px; }
.msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.shop { justify-self: end; background: var(--indigo-soft); border-bottom-right-radius: 4px; }
.msg.rc { justify-self: start; background: var(--paid-soft); border-bottom-left-radius: 4px; }
.msg .who { display: block; font-size: .75rem; color: var(--ink-3); margin-bottom: 3px; white-space: normal; }
.barlabels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--ink-3); margin-top: 4px; }

/* ---------- billing (POS) ---------- */
.pos { display: grid; gap: 12px; padding-bottom: 80px; }
@media (min-width: 900px) { .pos { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; padding-bottom: 0; } .poscol { position: sticky; top: 76px; display: grid; gap: 12px; } }
.scanbar { display: flex; gap: 8px; position: sticky; top: 64px; z-index: 5; }
.scanbar input { font-size: 1.05rem; }
.scanbtn { width: 56px; min-width: 56px; height: var(--tap); border-radius: var(--r-m); border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; }
:root[data-theme="dark"] .scanbtn { background: var(--indigo); color: #12152a; }
.suggest { position: absolute; left: 0; right: 64px; top: calc(var(--tap) + 4px); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-m);
  box-shadow: 0 12px 32px rgba(27, 31, 59, .16); max-height: 50vh; overflow: auto; z-index: 10; }
.suggest button { display: flex; width: 100%; gap: 8px; padding: 12px 14px; border: 0; background: none; text-align: left; border-top: 1px solid var(--line); cursor: pointer; min-height: 52px; align-items: center; }
.suggest button:first-child { border-top: 0; }
.suggest button.active, .suggest button:hover { background: var(--indigo-soft); }
.lines { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); margin-bottom: 8px; }
.line.flash { animation: flash .6s ease-out; }
@keyframes flash { from { background: var(--indigo-soft); } to { background: var(--surface); } }
@media (prefers-reduced-motion: reduce) { .line.flash { animation: none; } }
.line .nm { font-weight: 600; }
.line .meta { font-size: .82rem; color: var(--ink-3); }
.line .amt { text-align: right; font-size: 1.05rem; }
.line .ctl { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-m); overflow: hidden; }
.qty button { width: 44px; height: 44px; border: 0; background: var(--paper); font-size: 1.3rem; cursor: pointer; }
.qty input { width: 64px !important; min-height: 44px !important; border: 0 !important; border-radius: 0 !important; text-align: center; padding: 0 !important; box-shadow: none !important; }
.discount-chip { border: 1px dashed var(--line-2); background: none; border-radius: 999px; padding: 6px 12px; font-size: .85rem; cursor: pointer; color: var(--ink-2); min-height: 36px; }
.discount-chip.on { border-style: solid; border-color: var(--paid); color: var(--paid); background: var(--paid-soft); }
.discount-chip.coupon-no { border-style: solid; border-color: var(--due); color: var(--due); background: var(--due-soft); }
.discount-chip.coupon-checking { opacity: .7; }
.coupon-why { grid-column: 1 / -1; font-size: .8rem; color: var(--due); margin: -2px 0 4px; }

/* The memorable element: the marigold pay bar with the condensed rupee figure */
.paybar {
  position: fixed; left: 12px; right: 12px; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 25; display: flex; align-items: center; gap: 12px;
  background: var(--marigold); color: #1b1f3b; border: 0; border-radius: var(--r-l); padding: 10px 12px 10px 18px; min-height: 68px;
  box-shadow: 0 10px 28px rgba(180, 110, 0, .35); cursor: pointer; text-align: left; width: auto;
}
.paybar .big { font-size: 2.1rem; font-stretch: 75%; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.paybar .count { font-size: .85rem; font-weight: 600; }
.paybar .cta { margin-left: auto; background: #1b1f3b; color: #fff; border-radius: var(--r-m); padding: 12px 16px; font-weight: 700; white-space: nowrap; }
.paybar[disabled] { opacity: .55; }
@media (min-width: 900px) {
  .paybar { position: static; width: 100%; }
}
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: .95rem; }
.totals .grand { font-size: 1.4rem; font-weight: 700; font-stretch: 80%; padding-top: 6px; border-top: 1px solid var(--line); }

/* ---------- sheets & dialogs ---------- */
/* --vvh / --vvtop: the part of the screen not covered by the phone keyboard (set in ui.js), so a pop-up sits above it */
.scrim { position: fixed; left: 0; right: 0; top: var(--vvtop, 0px); height: var(--vvh, 100dvh); background: rgba(18, 21, 42, .5); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--surface); width: 100%; max-height: calc(var(--vvh, 100dvh) * .92); overflow: auto; overscroll-behavior: contain; border-radius: var(--r-l) var(--r-l) 0 0; box-shadow: var(--shadow-sheet);
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); animation: up .22s ease-out;
}
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 4px auto 12px; }
.sheet header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.sheet header h2 { flex: 1; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
/* keyboard open on a phone: the pop-up uses all the space above the keyboard, its heading stays in view */
html.kb-open .sheet { max-height: calc(var(--vvh, 100dvh) - 8px); border-radius: var(--r-l) var(--r-l) 0 0; padding-bottom: 10px; }
html.kb-open .sheet::before { margin: 0 auto 6px; }
html.kb-open .sheet header { position: sticky; top: -8px; z-index: 2; background: var(--surface); margin: -8px -16px 8px; padding: 8px 16px 6px; }
@media (min-width: 700px) {
  .scrim { align-items: center; }
  .sheet { max-width: 560px; border-radius: var(--r-l); }
  .sheet.wide { max-width: 860px; }
  .sheet::before { display: none; }
}
.paymodes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.paymodes button { display: grid; justify-items: center; gap: 4px; padding: 12px 4px; border-radius: var(--r-m); border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; min-height: 72px; cursor: pointer; }
.paymodes button[aria-pressed="true"] { border-color: var(--indigo); background: var(--indigo-soft); color: var(--indigo); box-shadow: inset 0 0 0 1px var(--indigo); }
.qrbox { display: grid; justify-items: center; gap: 8px; padding: 16px; border-radius: var(--r-l); background: #fff; color: #1b1f3b; border: 1px solid var(--line); }
.qrbox canvas, .qrbox img { width: min(260px, 70vw); height: auto; image-rendering: pixelated; }
.qrbox .amt { font-size: 2rem; font-weight: 800; font-stretch: 75%; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { min-height: 52px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--paper); font-size: 1.25rem; font-weight: 600; cursor: pointer; }
.quickcash { display: flex; gap: 8px; flex-wrap: wrap; }

/* camera scanner */
.scanner { position: fixed; inset: 0; z-index: 80; background: #000; display: grid; grid-template-rows: 1fr auto; }
.scanner video, .scanner #rc-reader { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; left: 14%; right: 14%; top: 32%; height: 16%; border: 3px solid var(--marigold); border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); pointer-events: none; }
.scanner .bar { display: flex; gap: 8px; padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); background: #000; }
.scanner .msg { position: absolute; left: 0; right: 0; top: calc(30% - 48px); text-align: center; color: #fff; font-weight: 600; text-shadow: 0 1px 3px #000; }

/* toasts */
.toasts { position: fixed; left: 12px; right: 12px; top: calc(64px + env(safe-area-inset-top)); z-index: 90; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: var(--r-m); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); max-width: 480px; pointer-events: auto; font-weight: 550; }
.toast.bad { background: var(--danger); color: #fff; }
.toast.good { background: var(--paid); color: #fff; }
.toast.warn { background: var(--due); color: #fff; }

/* auth */
.auth { min-height: 100dvh; display: grid; align-content: center; justify-items: center; padding: 24px 16px;
  background: #0b2a6b url(/app/img/auth-bg.svg) left center / cover no-repeat fixed; }
.auth > .stack:not(.panel) { color: #dfe8ff; }
.auth > .stack:not(.panel) .muted { color: #c9d6f5; }
/* links under the login / sign-up box: a clear white button-like link on the dark background, never blending in */
.auth > .stack:not(.panel) a:not(.btn) { display: inline-block; justify-self: center; color: #fff; font-weight: 650; text-decoration: underline; text-underline-offset: 3px;
  padding: 10px 18px; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .45); }
.auth > .stack:not(.panel) a:not(.btn):hover, .auth > .stack:not(.panel) a:not(.btn):focus-visible { background: #fff; color: #0b2a6b; text-decoration: none; outline: none; }
.auth .panel { width: 100%; max-width: 420px; padding: 24px; }
.auth .logo { display: flex; align-items: center; gap: 10px; color: #fff; margin-bottom: 20px; font-size: 1.4rem; font-weight: 700; font-stretch: 85%; }
.auth .logo { background: #fff; border-radius: 16px; padding: 16px 22px; justify-content: center; flex-wrap: wrap; width: 100%; max-width: 420px; box-sizing: border-box;
  box-shadow: 0 10px 30px rgba(3, 12, 40, .35); }
.auth .logo img { display: block; width: min(260px, 100%); height: auto; }
.auth .panel { box-shadow: 0 18px 50px rgba(3, 12, 40, .4); border: 0; }
.auth .logo .adminbadge { width: 100%; text-align: center; font-size: .85rem; font-weight: 700; color: #1b1f3b; letter-spacing: .08em; text-transform: uppercase; }
.logolink { display: inline-flex; flex: none; border-radius: 50%; }
.logolink:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }
.logomark { width: 30px; height: 30px; border-radius: 50%; background: #fff; padding: 1px; flex: none; }

/* label studio */
.studio { display: grid; gap: 12px; }
@media (min-width: 900px) { .studio { grid-template-columns: 1fr 300px; } }
.canvaswrap { background: repeating-conic-gradient(var(--paper) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; border: 1px solid var(--line); border-radius: var(--r-l); padding: 24px; overflow: auto; display: grid; place-items: center; min-height: 260px; }
.labelcanvas { position: relative; background: #fff; color: #000; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); touch-action: none; }
.labelcanvas .el { position: absolute; outline: 1px dashed rgba(43, 58, 140, .35); cursor: move; overflow: hidden; display: flex; align-items: center; line-height: 1; }
.labelcanvas .el.sel { outline: 2px solid var(--marigold); z-index: 2; }
.labelcanvas .el .handle { position: absolute; right: -1px; bottom: -1px; width: 14px; height: 14px; background: var(--marigold); cursor: nwse-resize; }
.labelcanvas .el svg { width: 100%; height: 100%; }

/* printing */
#print-root { display: none; }
@media print {
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  body { background: #fff; color: #000; }
}
.inv { font-family: var(--font); color: #000; background: #fff; }
.inv.thermal { width: 72mm; font-size: 11px; line-height: 1.3; }
.inv.thermal58 { width: 48mm; font-size: 10px; }
.inv.a4, .inv.a5 { width: 100%; font-size: 12px; }
.inv h1 { font-size: 1.4em; text-align: center; font-stretch: 85%; }
.inv .c { text-align: center; }
.inv table { width: 100%; border-collapse: collapse; }
.inv th, .inv td { padding: 2px 0; text-align: left; vertical-align: top; }
.inv .n { text-align: right; }
.inv hr { border: 0; border-top: 1px dashed #000; margin: 4px 0; }
.inv .slipcode { margin: 6px auto 2px; width: 92%; height: 52px; }
.inv .slipcode svg { width: 100%; height: 100%; display: block; }
.inv.a4 th, .inv.a4 td, .inv.a5 th, .inv.a5 td { border: 1px solid #555; padding: 4px 6px; }
.inv .tot td { font-weight: 700; font-size: 1.15em; }
.inv .qr { display: block; margin: 6px auto; width: 30mm; }
.inv .logo { max-height: 18mm; max-width: 50mm; display: block; margin: 0 auto 4px; }
.labelsheet { display: flex; flex-wrap: wrap; align-content: flex-start; }
.labelsheet .lbl { position: relative; overflow: hidden; background: #fff; color: #000; break-inside: avoid; page-break-inside: avoid; }
.labelsheet .lbl > div { position: absolute; display: flex; align-items: center; overflow: hidden; line-height: 1; }
.labelsheet .lbl svg { width: 100%; height: 100%; }
.flip { transform: scaleX(-1); }
.paymodes svg { width: 26px; height: 26px; }
.list .item > svg, .row > svg { width: 22px; height: 22px; flex: none; color: var(--ink-3); }
.toasts { top: calc(8px + env(safe-area-inset-top)); }

.canvaswrap .labelsheet { width: auto !important; }
main { overflow-x: clip; }
@media (max-width: 899px) { .pagehead h1.dup { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .pagehead:has(h1.dup) { justify-content: flex-end; } }
.grid2 > *, .grid3 > * { min-width: 0; }

/* purchase inward: spreadsheet-style bill */
.gridstats { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); font-size: .95rem; }
.gridstats b { font-size: 1.1rem; }
table.pgrid { border-collapse: separate; border-spacing: 0; }
table.pgrid th, table.pgrid td { border-right: 1px solid var(--line); padding: 0; }
table.pgrid th { padding: 8px 8px; font-size: .8rem; }
table.pgrid td.sn, table.pgrid td.amt, table.pgrid td.it { padding: 6px 8px; }
table.pgrid td.sn { color: var(--ink-2); text-align: center; background: var(--paper); }
table.pgrid td.it { min-width: 170px; max-width: 220px; white-space: normal; }
table.pgrid td.it .nm { font-weight: 600; }
table.pgrid td.amt { font-weight: 600; }
table.pgrid tfoot td { padding: 8px; }
table.pgrid input.gi, table.pgrid select.gi { width: 72px !important; min-width: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; padding: 0 8px !important; text-align: right; min-height: 0 !important; height: 44px !important; box-shadow: none !important; }
table.pgrid select.gi { width: 78px !important; text-align: left; }
table.pgrid input.gi.w { width: 118px !important; text-align: left; }
table.pgrid .gi:focus { outline: 2px solid var(--indigo) !important; outline-offset: -2px; background: var(--surface) !important; color: var(--ink) !important; }
.emptyrow { padding: 22px !important; text-align: center !important; white-space: normal !important; }
.xlrow .btn.small { min-height: 40px; padding: 0 14px; }
table.t thead tr.tot th { background: var(--indigo-soft, #e8ebff); color: var(--ink, #1b2250); font-weight: 700; border-bottom: 2px solid var(--line); }
table.t th .sorter { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: inherit; white-space: nowrap; }
table.t th .sorter:hover, table.t th .sorter.on { color: var(--indigo); }
table.t th .sorter:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; border-radius: 4px; }
table.t th .sorter .arr { font-size: .7em; opacity: .55; }
table.t th .sorter.on .arr { opacity: 1; }
table.t th.n .sorter { flex-direction: row-reverse; }

/* high contrast, on top of whichever theme is active */
:root[data-contrast="high"] { --ink: #000; --ink-2: #1a1a1a; --ink-3: #333; --line: #6b6f85; --line-2: #3d4057; --indigo: #14206b; --indigo-2: #14206b; --paid: #0b5c3f; --due: #8a3d00; --danger: #8f1a10; --focus: #000; --paper: #fff; --surface: #fff; }
:root[data-contrast="high"][data-theme="dark"] { --ink: #fff; --ink-2: #f2f2f2; --ink-3: #d6d6d6; --line: #a2a8d8; --line-2: #c4c9ee; --indigo: #c9d1ff; --indigo-2: #dfe4ff; --paid: #7ee0b0; --due: #ffc27a; --danger: #ffa79f; --focus: #fff; --paper: #000; --surface: #0b0d1c; }
:root[data-contrast="high"] .btn, :root[data-contrast="high"] input, :root[data-contrast="high"] select, :root[data-contrast="high"] .panel { border-color: var(--ink-2); }
.themebtn { color: #fff; font-size: 1.25rem; line-height: 1; }

/* ---- item pictures ---- */
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--paper); flex: none; border: 1px solid var(--line); }
.thumb.none { display: inline-grid; place-items: center; color: var(--ink-3); }
.thumb.none svg { width: 18px; height: 18px; }
.picbox { display: grid; gap: 10px; }
.picview { width: 180px; height: 180px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); padding: 0; cursor: zoom-in; display: grid; place-items: center; }
.picview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.picview.empty { cursor: default; color: var(--ink-3); gap: 4px; align-content: center; justify-items: center; }
.picfull { width: 100%; max-height: 75vh; object-fit: contain; border-radius: 10px; background: #fff; }
.line .thumb { width: 40px; height: 40px; }

/* ---- split payment: one compact row per way of paying ---- */
.splitrows { display: grid; gap: 8px; }
.splitrow { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto minmax(0, .9fr) auto; gap: 6px; align-items: center; }
.splitrow > .btn[style*='none'] + input { grid-column: span 2; }
@media (max-width: 520px) { .splitrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; } .splitrow > input[aria-label='Reference'] { grid-column: 1 / 3; } }
.splitrow select, .splitrow input { min-width: 0; }
.small.warn { color: var(--due); font-weight: 600; }
.line.withpic { grid-template-columns: auto 1fr auto; }
.line.withpic > .thumb { grid-row: span 2; align-self: start; }
.line.withpic > .ctl { grid-column: 2 / -1; }
.suggest button .thumb { margin-right: 8px; }
/* scanner: always a way out */
.scanner .close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 2; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.scanner .close svg { width: 26px; height: 26px; stroke: #fff; }
.scanner .sound { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 12px; z-index: 2; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.scanner .sound svg { width: 24px; height: 24px; stroke: #fff; }
.scanner .sound[aria-pressed="false"] { background: rgba(0,0,0,.35); opacity: .8; }
.scanner .soundtip { position: absolute; top: calc(66px + env(safe-area-inset-top)); left: 12px; right: 72px; z-index: 2; background: rgba(0,0,0,.7); color: #fff; font-size: .82rem; line-height: 1.35; padding: 8px 10px; border-radius: 10px; }

/* ---- company setup tabs ---- */
.settabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0 0 14px; scrollbar-width: thin; }
.settabs button { flex: none; border: 0; background: none; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--ink-3); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.settabs button[aria-selected="true"] { color: var(--indigo); border-bottom-color: var(--indigo); }
.setrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; }
.setrow select { width: auto; min-width: 120px; }

/* ---- progress for big uploads ---- */
.progress { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; width: 2%; background: var(--indigo); transition: width .3s; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--indigo); animation: rcspin .8s linear infinite; flex: none; }
@keyframes rcspin { to { transform: rotate(360deg); } }
.spinner.small { width: 16px; height: 16px; border-width: 2px; vertical-align: -3px; display: inline-block; border-color: currentColor; border-top-color: transparent; }
button[aria-busy="true"] { cursor: progress; }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.scrollbox { max-height: 45vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-m); }
/* which MRP? picker on the bill (also above the camera scanner) */
.scrim:has(.pricepick) { z-index: 85; }
.pricepick { display: grid; gap: 8px; }
.pricepick .btn { display: flex; align-items: center; gap: 12px; text-align: left; min-height: 56px; justify-content: flex-start; flex-wrap: wrap; }
.pricepick .key { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 700; flex: none; }
.pricepick .grow { flex: 1 1 auto; }

/* Boxes that must be filled get their own background instead of a "*", so the eye finds them at once */
input.must, select.must, textarea.must, input:required:not([type=checkbox]):not([type=radio]):not([type=search]), select:required, textarea:required { background-color: var(--must); }
.must-legend::before { content: ''; display: inline-block; width: 14px; height: 14px; border-radius: 4px; background: var(--must); border: 1px solid var(--line-2); vertical-align: -2px; margin-right: 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) { --must: #2f2a14; } }
:root[data-theme=dark] { --must: #2f2a14; }
.toast.withaction { display: flex; gap: 12px; align-items: center; pointer-events: auto; }
.toastbtn { background: none; border: 1px solid currentColor; color: inherit; border-radius: 999px; padding: 4px 12px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; min-height: 36px; }
.words { margin-top: 2px; }
.trail { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); flex: none; }
.dot.on { background: var(--paid); box-shadow: 0 0 0 3px var(--paid-soft); }
/* a save is on its way: save buttons wait (see api.js) */
html[data-saving] button[type=submit], html[data-saving] .btn.go, html[data-saving] .btn.primary, html[data-saving] .paybar { pointer-events: none; opacity: .65; cursor: progress; }
html[data-saving] body { cursor: progress; }
.guide-steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; font-size: 1.02rem; line-height: 1.45; }
.guide-steps li::marker { font-weight: 700; color: var(--indigo); }
.findlist { max-height: min(60vh, 520px); overflow: auto; }
.findlist .item.on { background: var(--indigo-soft); }
.findlist .tag { min-width: 64px; justify-content: center; }
.scanner .camtools { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 12px; z-index: 2; display: flex; gap: 8px; }
.scanner .camtool { min-width: 56px; height: 48px; border-radius: 24px; border: 0; background: rgba(0,0,0,.6); color: #fff; font: inherit; font-weight: 700; padding: 0 14px; }
.scanner .camtool[aria-pressed="true"] { background: var(--marigold); color: #1b1f3b; }
.scanner .bar .btn[hidden] { display: none; }
.scanner .camstatus { position: absolute; left: 0; right: 0; top: calc(48% + 12px); text-align: center; color: #fff; font-size: .85rem; opacity: .85; text-shadow: 0 1px 3px #000; padding: 0 12px; }
.datebox { position: relative; display: inline-flex; align-items: center; width: 100%; }
.datebox > input[type=text] { width: 100%; padding-right: 40px; }
.datebox > input[type=date] { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; padding: 0; border: 0; }
.datebox .datebtn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; border-radius: 8px; }
.datebox .datebtn:hover { background: var(--indigo-soft); }
.datebox > input[aria-invalid=true] { border-color: var(--danger); }
table.pgrid .datebox { width: 140px; }

/* ---------- jump bar: chips to each section of a long page ---------- */
.jumpbar { position: sticky; top: calc(56px + env(safe-area-inset-top, 0px)); z-index: 15; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: -4px -4px 12px; padding: 8px 4px; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px); }
.jumpbar::-webkit-scrollbar { display: none; }
.jumpchip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.jumpchip:hover { border-color: var(--indigo); color: var(--ink); }
.jumpchip.on { background: var(--indigo-soft); border-color: var(--indigo); color: var(--indigo); }
.jumpchip:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
.jumpdot { display: none; width: 8px; height: 8px; border-radius: 50%; }
.jumpchip.dirty .jumpdot { display: inline-block; background: var(--due, #c77700); }
.jumpchip.bad .jumpdot { display: inline-block; background: var(--danger); }
.jump-target { scroll-margin-top: calc(56px + 64px + env(safe-area-inset-top, 0px)); }
.linkrow { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 3fr) auto; gap: 10px; align-items: start; }
.linkrow .iconbtn { margin-top: 30px; }
@media (max-width: 520px) { .linkrow { grid-template-columns: minmax(0, 1fr) auto; } .linkrow > .field:first-child { grid-column: 1 / -1; } }
.reviewqr { width: min(300px, 70vw); height: auto; image-rendering: pixelated; background: #fff; padding: 8px; border-radius: 12px; }
.reviewqr-inline { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-m, 12px); cursor: pointer; text-align: left; }
.reviewqr-inline img { width: 96px; height: 96px; image-rendering: pixelated; background: #fff; border-radius: 6px; flex: none; }
/* report printed or saved as PDF */
.repprint { font-family: var(--font); color: #000; font-size: 11px; }
.repprint h1 { font-size: 18px; margin: 0 0 2px; }
.repprint h2 { font-size: 13px; margin: 14px 0 4px; }
.repprint p { margin: 0 0 8px; color: #333; }
.repprint table { width: 100%; border-collapse: collapse; page-break-inside: auto; }
.repprint tr { page-break-inside: avoid; }
.repprint thead { display: table-header-group; }
.repprint th, .repprint td { border: 1px solid #999; padding: 3px 5px; text-align: left; vertical-align: top; }
.repprint th { background: #eef0f8; }
.repprint tfoot td { font-weight: 700; background: #f6f6f6; }
.repprint .n { text-align: right; white-space: nowrap; }
.repprint .foot { margin-top: 10px; color: #666; font-size: 9px; }
/* bell: red count of new customer feedback */
.iconbtn.bell { position: relative; }
.bellbadge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e5484d; color: #fff;
  font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--indigo, #23306f); pointer-events: none; }
.bellbadge[hidden] { display: none; }
.bellbadge.inline { position: static; display: inline-grid; place-items: center; vertical-align: 1px; }
/* feedback list: unread like email */
.fb.unread .title { font-weight: 800; }
.fb.unread { box-shadow: inset 3px 0 0 var(--indigo); }
.fb .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--indigo); margin-right: 6px; vertical-align: middle; }

/* ---------- rows under the mouse: one standard everywhere (lists, report tables, inboxes, bill lines, Control Panel, AuditCore) ----------
   Mouse: a soft tint and a thin accent on the left. Keyboard: the same tint plus a clear outline. Phones (no hover) are not affected. */
:root { --row-hover: var(--indigo-soft); }
@supports (background: color-mix(in srgb, red 10%, white)) { :root { --row-hover: color-mix(in srgb, var(--indigo) 10%, var(--surface)); } }
.list .item, table.t tbody td, .inrow, .line, .icard, .acard { transition: background-color .12s ease, box-shadow .12s ease; }
@media (hover: hover) and (pointer: fine) {
  .list .item:hover, .inrow:hover { background: var(--row-hover); box-shadow: inset 3px 0 0 var(--indigo); }
  table.t tbody tr:hover > td { background: var(--row-hover); }
  table.t tbody tr:hover > td:first-child { box-shadow: inset 3px 0 0 var(--indigo); }
  table.pgrid tbody tr:hover > td { background: var(--row-hover); }
  .line:hover { background: var(--row-hover); border-color: var(--line-2); }
  .icard:hover, .acard:hover { border-color: var(--line-2); }
}
.list .item:focus-visible, .inrow:focus-visible { background: var(--row-hover); outline: 2px solid var(--focus, var(--indigo)); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) { .list .item, table.t tbody td, .inrow, .line, .icard, .acard { transition: none; } }

/* Sales list: how customers paid (stage 3.8) */
.kpis .paymix { grid-column: 1 / -1; background: var(--surface); padding: 12px 16px 14px; display: grid; gap: 10px; }
.paymix-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .78rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-3); }
.paymix-head .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.mixbar { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; background: var(--line); }
.mixbar > span { min-width: 6px; flex-basis: 0; }
.mixbar > span.due, .mdot.due { background: repeating-linear-gradient(135deg, var(--due) 0 3px, color-mix(in srgb, var(--due) 45%, var(--surface)) 3px 6px); }
.paychips { display: flex; flex-wrap: wrap; gap: 8px; }
.paychip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: .9rem; line-height: 1.2; }
.paychip .n { color: var(--ink-2); }
.paychip strong { font-weight: 700; }
.paychip .p { color: var(--ink-3); font-size: .8rem; font-variant-numeric: tabular-nums; padding-left: 7px; border-left: 1px solid var(--line); }
.paychip.is-due { border-color: color-mix(in srgb, var(--due) 40%, var(--line)); }
.paychip.is-due strong { color: var(--due); }
.mdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.rowmodes { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px 10px; font-size: .8rem; color: var(--ink-3); margin-top: 2px; }
.rowmodes .pm { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.rowmodes .mdot { width: 7px; height: 7px; }
@media (max-width: 600px) {
  .paychips { display: grid; gap: 0; }
  .paychip { border: 0; border-radius: 0; background: none; padding: 7px 0; font-size: .92rem; }
  .paychip + .paychip { border-top: 1px solid var(--line); }
  .paychip .n { flex: 1; }
  .paychip .p { min-width: 44px; text-align: right; }
}
/* Coupon card on the bill (stage 3.8): code + state, the offer, each condition ticked against this bill */
.ccard { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); overflow: hidden; }
.cc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px dashed var(--line-2); background: var(--paper); }
.cc-code { font-weight: 800; letter-spacing: .08em; font-size: 1rem; padding: 3px 10px; border: 1.5px dashed var(--ink-3); border-radius: 6px; }
.cc-badge { font-size: .82rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.cc-ok .cc-badge { background: var(--paid-soft); color: var(--paid); }
.cc-wait .cc-badge { background: var(--due-soft); color: var(--due); }
.cc-bad .cc-badge { background: var(--danger-soft); color: var(--danger); }
.cc-checking .cc-badge { background: var(--line); color: var(--ink-3); }
.cc-ok { border-color: color-mix(in srgb, var(--paid) 45%, var(--line)); }
.cc-wait { border-color: color-mix(in srgb, var(--due) 45%, var(--line)); }
.cc-bad { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.cc-offer { padding: 12px 14px 4px; font-size: 1.25rem; font-weight: 700; line-height: 1.25; }
.cc-reason { padding: 10px 14px; }
.cc-terms { padding: 4px 14px 12px; margin: 0; color: var(--ink-2); }
.cc-list { list-style: none; margin: 0; padding: 6px 14px 12px; display: grid; gap: 2px; }
.cc-list li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; padding: 5px 0; line-height: 1.35; }
.cc-list li.off > div > div:first-child { font-weight: 600; }
.cc-note { font-size: .86rem; color: var(--due); margin-top: 1px; }
.cc-bad .cc-note { color: var(--danger); }
.cc-mark { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: .72rem; font-weight: 800; margin-top: 1px; }
.cc-mark.ok { background: var(--paid-soft); color: var(--paid); }
.cc-mark.no { background: var(--due-soft); color: var(--due); }
.cc-mark.bad { background: var(--danger-soft); color: var(--danger); }
.cc-mark.na { color: var(--ink-3); }
.ccard > .btn { margin: 0 14px 12px; }
/* Activity log: sealed-log bar (staff safety 10) */
.sealbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); font-size: .92rem; }
.sealbar .grow { flex: 1 1 260px; }
/* Sign-up and other password boxes with a Show button */
.pwrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.pwrow .pwshow { min-width: 64px; min-height: 44px; }
/* boxes that show what is typed in capitals (GSTIN, codes) keep their hint in normal letters */
input[style*="uppercase"]::placeholder { text-transform: none; }
/* Control Panel: trial card and plan picker (move to a paid plan) */
.trialcard { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-color: color-mix(in srgb, var(--due) 45%, var(--line)); background: color-mix(in srgb, var(--due) 7%, var(--surface)); }
.trialcard .grow { flex: 1 1 260px; }
.plancards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.plancard { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-l); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 44px; font: inherit; }
.plancard.on { border-color: var(--indigo); box-shadow: 0 0 0 3px color-mix(in srgb, var(--indigo) 18%, transparent); }
.plancard:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
/* touch screens: choice buttons are at least 44 px tall (WCAG 2.5.5) */
@media (pointer: coarse) { .seg button { min-height: 44px; } }
/* a pop-up title with a link beside it (e.g. "Customer   ⌕ Search customer") */
.sheet header:has(.sheethead-extra) h2 { flex: 0 1 auto; }
.sheethead-extra { flex: 1; display: flex; align-items: center; min-width: 0; }
.linkbtn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--indigo); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; padding: 8px 6px; min-height: 44px; border-radius: 8px; }
.linkbtn svg { width: 18px; height: 18px; }
.linkbtn:hover { background: var(--indigo-soft); }
.linkbtn:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
/* "or …" divider between two ways of doing one thing */
.ordiv { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .85rem; }
.ordiv::before, .ordiv::after { content: ''; flex: 1; height: 1px; background: var(--line); }
/* Start fresh after the trial */
.fresh-presets { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.freshlist { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.freshcols h3 { margin: 0; color: var(--ink-2); }
.freshtable td { vertical-align: middle; }
/* sign-up steps: 1 About you — 2 Your shop */
.steps { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; counter-reset: none; }
.steps li { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--paper); color: var(--ink-3); font-weight: 600; font-size: .9rem; }
.steps li .n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--line); color: var(--ink-2); font-size: .8rem; flex: none; }
.steps li.on { background: var(--indigo-soft); color: var(--indigo); }
.steps li.on .n { background: var(--indigo); color: #fff; }
.steps li.done .n { background: var(--paid); color: #fff; }
/* two boxes side by side that need full width on small phones */
@media (max-width: 440px) { .grid2.narrow-stack { grid-template-columns: 1fr; } }

/* ===== Hover on everything you can click (standard practice, owner 18 Nov) =====
   With a mouse, every button, link-button, tab, choice and menu entry shows it can be clicked: a tint, a stronger edge,
   a small lift on the main buttons. Keyboard users get a clear ring. Phones (no hover) are not affected; nothing moves
   for people who ask for less motion. */
.btn, .iconbtn, .seg button, .linkbtn, .jumpchip, .plancard, .loc-pill, .bottomnav a, .chip, button.tag, .datebox .datebtn {
  transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, color .12s ease, filter .12s ease;
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: var(--indigo); background: var(--row-hover); box-shadow: 0 2px 8px rgba(27, 31, 59, .12); }
  .btn.primary:hover { background: var(--indigo); filter: brightness(1.12); box-shadow: 0 4px 12px rgba(35, 48, 111, .30); }
  .btn.go:hover { background: var(--marigold); border-color: var(--marigold-press); filter: brightness(1.04); box-shadow: 0 4px 12px rgba(217, 143, 0, .35); }
  .btn.ghost:hover { background: var(--indigo-soft); border-color: transparent; box-shadow: none; }
  .btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
  /* round icon buttons: a soft circle in their own colour, so it works on the dark top bar and on white */
  .iconbtn:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
  .seg button:not([aria-pressed="true"]):hover { background: color-mix(in srgb, var(--indigo) 9%, transparent); color: var(--ink); }
  .loc-pill:hover { background: rgba(255, 255, 255, .24); }
  .bottomnav a:hover { color: var(--indigo); background: var(--row-hover); }
  .plancard:hover { border-color: var(--indigo); }
  .chip:hover, button.tag:hover { filter: brightness(.96); }
  a:not(.btn):not([class]):hover { text-decoration-thickness: 2px; }
}
.btn:focus-visible, .seg button:focus-visible, .iconbtn:focus-visible, .bottomnav a:focus-visible { outline: 3px solid var(--focus, var(--indigo)); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .btn, .iconbtn, .seg button, .linkbtn, .jumpchip, .plancard, .bottomnav a { transition: none; }
  .btn:active { transform: none; }
}
/* Bill → payment, receipt style: name · dotted line · amount */
.payblock h2 { margin-bottom: 2px; }
.payline { display: flex; align-items: baseline; gap: 10px; font-size: 1.12rem; line-height: 1.4; padding: 4px 0; }
.payline .mdot { width: 12px; height: 12px; align-self: center; }
.payline .pname { font-weight: 600; color: var(--ink); white-space: nowrap; }
.payline .psub { display: inline-block; margin-left: 8px; font-size: .85rem; font-weight: 500; color: var(--ink-3); padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; vertical-align: 2px; }
.payline .lead { flex: 1; min-width: 24px; border-bottom: 2px dotted var(--line-2); transform: translateY(-5px); }
.payline .pamt { font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.payline.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }
.payline.total .pname, .payline.total .pamt { font-weight: 800; }
.payline.due .pname, .payline.due .pamt { color: var(--due); }
@media (max-width: 480px) { .payline { font-size: 1.05rem; } .payline .psub { display: block; margin: 2px 0 0; width: max-content; } .payline .pname { white-space: normal; } }
@media (max-width: 480px) { .payline .mdot { align-self: flex-start; margin-top: 7px; } }
/* sign-up: the robot trap is off-screen (not display:none, which some robots skip); the person check sits centred */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.tsbox { display: flex; justify-content: center; min-height: 65px; }
/* staff safety 6, 7, 13: counting lists, cost-rise hint, margin column */
/* counting lists (blind goods count, daily quick count): number, item, a compact stepper; counted rows turn green */
.countlist .countrow { display: grid; grid-template-columns: auto auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; }
.countlist .countrow .cn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line); font-weight: 700; font-size: .85rem; color: var(--ink-3); }
.countlist .countrow.counted .cn { background: var(--paid); border-color: var(--paid); color: #fff; }
.countlist .countrow .title { font-weight: 700; line-height: 1.3; }
.countlist .countrow .chips { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; }
.countlist .countrow .chip { font-size: .78rem; padding: 1px 8px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); }
.countlist .countrow.counted { background: color-mix(in srgb, var(--paid) 7%, transparent); }
.countlist .countrow.extra { border-left: 4px solid var(--due); }
.countlist .stepper { display: flex; gap: 6px; align-items: center; }
.countlist .stepper input { width: 88px !important; min-width: 0; text-align: center; font-size: 1.2rem; font-weight: 700; }
.countlist .stepper .btn { min-width: 44px; min-height: 44px; font-size: 1.3rem; padding: 0; }
.countprog { display: grid; gap: 6px; }
.countprog .bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.countprog .bar i { display: block; height: 100%; background: var(--paid); transition: width .25s ease; }
@media (max-width: 560px) {
  .countlist .countrow { grid-template-columns: auto 1fr; }
  .countlist .countrow .thumb { display: none; }
  .countlist .stepper { grid-column: 1 / -1; justify-content: flex-end; }
}
.costjump { font-size: .75rem; font-weight: 700; color: var(--warn, #b8730f); white-space: nowrap; margin-top: 2px; }
.pgrid td.margin { font-weight: 600; white-space: nowrap; }
.pgrid td.margin.low { color: var(--bad, #c0392b); }
.qccard { text-decoration: none; color: inherit; border-left: 5px solid var(--indigo); }
.qccard .qcic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--indigo-soft); color: var(--indigo); flex: none; }
.qccard .qcic svg { width: 24px; height: 24px; }
.qccard.done .qcic { background: var(--paid-soft); color: var(--paid); }
.qccard.done { border-left-color: var(--good, #1e8e5a); }
.warnpanel { border-left: 5px solid var(--bad, #c0392b); }
.countdiff.neg, td .neg, span.neg, b.neg { color: var(--bad, #c0392b); }
b.gain { color: var(--good, #1e8e5a); }
.qcresult .countrow.off { border-left: 4px solid var(--bad, #c0392b); }
.qcresult .right { text-align: right; }

/* gift voucher / credit note code: big, spaced, easy to read out at the counter */
.vcode { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 14px 12px; border: 2px dashed var(--line-2); border-radius: var(--r-m); background: var(--surface); }
.bigcode { font-size: clamp(1.7rem, 7vw, 2.4rem); font-weight: 800; letter-spacing: .14em; color: var(--ink); line-height: 1.1; word-break: break-all; }

/* feedback & reviews: asked → opened → answered, then stars and review-site visits */
.fbstats { display: grid; gap: 10px; }
.fbfunnel { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 6px; }
.fbfunnel .arrow { align-self: center; font-size: 1.6rem; color: var(--ink-3); }
.fbside { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fbstep { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 12px 14px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.fbstep .v { font-size: 1.7rem; font-weight: 750; line-height: 1.1; }
.fbstep .l { font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.fbstep .bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.fbstep .bar i { display: block; height: 100%; border-radius: 4px; }
.fbstep .stars { font-size: 1.25rem; letter-spacing: 2px; color: var(--line-2); line-height: 1; }
.fbstep .stars .on { color: #e3a008; }
.fbstep .stars .half { background: linear-gradient(90deg, #e3a008 50%, var(--line-2) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 560px) {
  .fbfunnel { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .fbfunnel .arrow { display: none; }
  .fbstep { padding: 10px; }
  .fbstep .v { font-size: 1.4rem; }
  .fbstep .l { font-size: .82rem; }
}
@media (min-width: 900px) { .fbstats { grid-template-columns: 3fr 2fr; } }
.vfacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.vfacts > div { background: var(--surface); padding: 10px 12px; display: grid; gap: 2px; }
.vfacts b { font-size: 1.15rem; }
.vfacts span { font-size: .82rem; color: var(--ink-3); }
.fbstats { margin-top: 10px; }
@media (max-width: 560px) { .payblock .payline .pname { white-space: normal; } .payblock .payline .psub { display: block; margin: 2px 0 0; width: max-content; } }
/* payment methods: name, kind, on, save, remove on one line */
.pmrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 200px) auto auto auto; gap: 8px; align-items: center; }
@media (max-width: 560px) { .pmrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
/* page controls under long lists and tables */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.pager select { min-height: 36px; width: auto; }
/* the shop logo, shown as it prints: on white, centred, never stretched */
.logobox { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: center; }
.logoframe { height: 110px; border-radius: var(--r-m); background: #fff; border: 1px solid var(--line); display: grid; place-items: center; padding: 10px; }
.logoframe img { max-width: 100%; max-height: 100%; object-fit: contain; }
@media (max-width: 520px) { .logobox { grid-template-columns: 1fr; } }
.pmrow { grid-template-columns: auto minmax(0, 1fr) minmax(0, 200px) auto auto auto auto; }
.draghandle { cursor: grab; color: var(--ink-3); font-weight: 800; letter-spacing: -2px; padding: 0 4px; user-select: none; }
.pmcard.dragging { opacity: .5; }
.pmcard.dropat { box-shadow: 0 -3px 0 var(--indigo) inset, 0 3px 0 var(--indigo); }
@media (max-width: 560px) { .pmrow { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); } }

/* ---- calm, premium chrome (5.9) ---- */
.topbar .iconbtn { transition: background .12s; }
.topbar .iconbtn:hover { background: rgba(255, 255, 255, .14); }
@media (max-width: 560px) {
  /* phones: theme and log out live under More, so the branch name gets the room */
  .topbar .themebtn, .topbar .logoutbtn { display: none; }
  .topbar { gap: 2px; }
  .topbar .iconbtn { width: 42px; }
  .loc-pill { max-width: 34vw; }
}
@media (min-width: 900px) {
  .bottomnav { padding: 14px 10px; }
  .bottomnav a { border-radius: 10px; font-weight: 550; transition: background .12s, color .12s; }
  .bottomnav a svg { width: 20px; height: 20px; opacity: .8; }
  .bottomnav a[aria-current="page"] { color: var(--indigo); }
  .bottomnav a[aria-current="page"] svg { opacity: 1; }
}
/* keyboard shortcuts list */
.keygroup h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin: 0 0 6px; }
.keylist { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 16px; margin: 0; align-items: baseline; }
.keylist dt { white-space: nowrap; }
.keylist dd { margin: 0; color: var(--ink-2); }
kbd { display: inline-block; min-width: 1.6em; padding: 2px 7px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; background: var(--paper);
  font: 600 .85rem ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; color: var(--ink); }
@media (max-width: 480px) { .keylist { grid-template-columns: 1fr; gap: 2px; } .keylist dd { margin-bottom: 8px; } }
/* supplier bill copy */
.filechips { display: flex; flex-wrap: wrap; gap: 6px; }
.filechips:empty { display: none; }
.filechip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 4px 4px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); font-size: .88rem; }
.filechip .ellip { max-width: 220px; }
.billpanel { margin-bottom: 12px; }
.billthumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.billthumb { display: grid; gap: 4px; align-content: start; min-width: 0; }
.billopen { display: grid; place-items: center; height: 150px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--paper); overflow: hidden; cursor: zoom-in; padding: 0; transition: border-color .12s, box-shadow .12s; }
.billopen:hover { border-color: var(--indigo); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.billopen img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pdfmark { font: 800 1.1rem/1 var(--font, inherit); color: #fff; background: #c62828; padding: 10px 14px; border-radius: 8px; letter-spacing: .05em; }
.billimg { width: 100%; height: auto; border-radius: var(--r-m); border: 1px solid var(--line); background: #fff; }
.answerlive { margin: 0; padding: 12px 14px; border-radius: var(--r-m); background: var(--indigo-soft); color: var(--indigo); font-weight: 700; font-size: 1.15rem; line-height: 1.35; }
.findlist .tag:where(:not(.paid)) { min-width: 64px; text-align: center; }
/* pictures that enlarge, and the item card */
img.thumb.zoomable { cursor: zoom-in; transition: transform .12s, box-shadow .12s; }
img.thumb.zoomable:hover { transform: scale(1.06); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.zoombox { display: grid; place-items: center; cursor: zoom-out; }
.zoombox img.zoomed { max-width: 100%; max-height: 72vh; object-fit: contain; border-radius: var(--r-m); background: #fff; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.linkbtn:hover { color: var(--indigo); text-decoration-color: currentColor; }
.itemcard .itemtop { display: flex; gap: 14px; align-items: flex-start; }
.itemcard .itempic { flex: none; width: 96px; height: 96px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); padding: 0; overflow: hidden; cursor: zoom-in; display: grid; place-items: center; }
.itemcard .itempic img { width: 100%; height: 100%; object-fit: cover; }
.itemcard .itempic.none { cursor: default; color: var(--ink-3); }
.itemcard .itemname { font-weight: 700; font-size: 1.1rem; line-height: 1.3; }
.itemcard .itemprices { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.itemcard .itemprices small { color: var(--ink-3); }
.itemcard .kvgrid { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: .92rem; }
.itemcard .kvgrid dt { color: var(--ink-3); }
.itemcard .kvgrid dd { margin: 0; }
.itemcard ul.mini { margin: 0; padding-left: 18px; font-size: .9rem; }
.itemcell { display: inline-flex; align-items: center; gap: 8px; }

/* estimates, proforma invoices, sales orders: status chips with colour dots, document trail */
button.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font: inherit; font-size: .9rem; cursor: pointer; }
button.chip:hover { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-soft); }
button.chip.on { border-color: var(--indigo); background: var(--indigo); color: #fff; }
button.chip .n { font-weight: 700; font-size: .8rem; opacity: .85; }
button.chip .dot { width: 9px; height: 9px; }
.dot.st-open { background: var(--indigo); } .dot.draft { background: var(--ink-3); } .dot.due { background: var(--due); } .dot.info { background: var(--info); }
.dot.paid { background: var(--paid); } .dot.cancelled, .dot.expired { background: var(--danger); }
.tag.st-open { background: var(--indigo-soft); color: var(--indigo); }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; }
.chain .arrow { color: var(--ink-3); }
.chain a { color: var(--indigo); text-decoration: underline; text-underline-offset: 2px; }
.chain a:hover { color: var(--indigo-2); }
.money.bad { color: var(--danger); }
.totals-mini { padding: 10px 12px; }
.ordtable { width: 100%; border-collapse: collapse; font-size: .95rem; }
.ordtable th, .ordtable td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ordtable th { font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.ordtable .n { text-align: right; white-space: nowrap; }
.ordtable tbody tr:hover { background: var(--indigo-soft); }
.ordtable tfoot td { font-weight: 600; border-bottom: 0; }
/* estimates and orders on the billing layout */
.docbanner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; padding: 8px 12px; border: 1px solid var(--line); border-left: 4px solid var(--indigo); border-radius: var(--r-m); background: var(--surface); }
.stocknote { color: var(--ink-3); }
.stocknote.short { color: var(--due); font-weight: 600; }
/* payment ways in pop-ups: the chosen one stands out clearly (indigo with a tick), not only a white pill */
.seg.paymodes button[aria-pressed="true"] { background: var(--indigo); color: #fff; box-shadow: none; }
.seg.paymodes button[aria-pressed="true"] { font-weight: 700; outline: 2px solid var(--indigo); outline-offset: 1px; }

/* wide tables: the first column stays put while scrolling sideways; a row opens its details */
table.t th:first-child, table.t td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
table.t thead th:first-child { z-index: 3; background: var(--paper); }
table.t tfoot td:first-child { background: var(--paper); }
table.t tr.rowtap { cursor: pointer; }
table.t tr.rowtap:focus-visible > td { background: var(--row-hover); outline: none; }
table.t tr.rowtap:focus-visible > td:first-child { box-shadow: inset 3px 0 0 var(--indigo), 1px 0 0 var(--line); }
@media (max-width: 759px) { table.t td:first-child { max-width: 42vw; white-space: normal; } }
.rowdetail { display: grid; grid-template-columns: minmax(110px, 45%) 1fr; margin: 0; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.rowdetail dt, .rowdetail dd { margin: 0; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.rowdetail dt { color: var(--ink-3); font-size: .88rem; background: var(--paper); }
.rowdetail dd { font-weight: 600; }
.rowdetail dt:last-of-type, .rowdetail dd:last-of-type { border-bottom: 0; }
/* watch list: ranking and comparisons */
.watchrank .wr { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wrow, .wcmp { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 34px 1fr minmax(80px, 22%) auto; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); cursor: pointer; }
.wcmp { grid-template-columns: minmax(90px, 26%) 1fr auto; padding: 8px 12px; }
.wrow:hover, .wcmp:hover, .wrow:focus-visible, .wcmp:focus-visible { background: var(--row-hover); box-shadow: inset 3px 0 0 var(--indigo); }
.wrank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--paper); border: 1px solid var(--line); }
.wrank.bad { background: var(--danger); color: #fff; border-color: var(--danger); }
.wwho { min-width: 0; } .wwho .wsub { display: block; margin-top: 2px; }
.wbar { position: relative; height: 10px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); overflow: visible; }
.wbar.big { height: 14px; }
.wbar > span { display: block; height: 100%; border-radius: 99px; background: var(--indigo); }
.wbar > span.warn { background: var(--due); } .wbar > span.bad { background: var(--danger); }
.wbar > i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: .7; }
.wscore { display: flex; align-items: center; gap: 8px; justify-content: flex-end; white-space: nowrap; }
.wval { white-space: nowrap; font-size: .9rem; font-weight: 600; text-align: right; }
@media (max-width: 759px) {
  .wrow { grid-template-columns: 30px 1fr auto; }
  .wrow .wbar { grid-column: 2 / -1; grid-row: 2; }
  .wcmp { grid-template-columns: 1fr auto; } .wcmp .wbar { grid-column: 1 / -1; }
}
table.t tr.rowtap:focus { outline: none; }
/* a long row of choice chips scrolls sideways on a phone instead of filling the screen */
@media (max-width: 759px) { .chiprow { flex-wrap: nowrap !important; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; } .chiprow .chip { flex: none; } }

/* help panel: beside the screen on a computer (the screen moves aside), along the bottom on a phone; never blocks work */
.helppanel { position: fixed; z-index: 60; background: var(--surface); color: var(--ink); display: flex; flex-direction: column;
  right: 0; top: 0; bottom: 0; width: 340px; border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(10, 20, 60, .12); }
.helphead { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
.helphead h2 { margin: 0; font-size: 1.1rem; flex: 1; }
.helphead .helpkeys kbd { font-size: .75rem; }
.helpbody { overflow-y: auto; padding: 14px; flex: 1; overscroll-behavior: contain; }
.helpful { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 10px; border-top: 1px dashed var(--line); }
@media (min-width: 900px) { body.helpopen { padding-right: 340px; } body.helpopen .pos { grid-template-columns: minmax(0, 1fr) 300px; } }
/* not enough room for two columns beside the help: the bill and its total one under the other, nothing cut off */
@media (min-width: 900px) and (max-width: 1239px) { body.helpopen .pos { grid-template-columns: minmax(0, 1fr); } body.helpopen .poscol { position: static; } }
.helpfind { padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
.helpfind .helpsearch { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--surface); color: var(--ink); font-size: 1rem; }
.helpfind .helpsearch:focus { outline: 2px solid var(--indigo); outline-offset: 1px; }
@media (max-width: 899px) {
  .helppanel { top: auto; left: 0; width: auto; height: 40vh; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px rgba(10, 20, 60, .18); }
  body.helpopen { padding-bottom: 40vh; }
  body.helpopen .paybar { bottom: calc(40vh + 10px); }
  .helphead .helpkeys { display: none; }
}
@media print { .helppanel { display: none; } }
/* Home: get your shop ready */
.readycard .readysteps .item { gap: 12px; }
.readycard .readysteps .item.done { opacity: .7; }
.readycard .readysteps .item.done .title { text-decoration: line-through; text-decoration-color: var(--line-2); }
.readytick { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; }
.item.done .readytick { background: var(--good, #1b7f4b); border-color: var(--good, #1b7f4b); color: #fff; }
.readytick svg { width: 16px; height: 16px; }
.readysample { background: var(--paper); border: 1px dashed var(--line-2); border-radius: var(--r-m); padding: 10px 12px; }
.readycard .readysteps .btn { white-space: nowrap; flex: 0 0 auto; }
/* Search: calm and light — a softer dim, short groups, room to breathe */
body.findopen .scrim { background: rgba(18, 21, 42, .28); }
.findsheet .findhint { margin: -4px 2px 0; }
.findsheet input[type=search] { min-height: 52px; font-size: 1.08rem; }
.findlist { display: grid; gap: 14px; }
.findgroup { display: grid; gap: 2px; }
.findgh { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2, #5b6078); padding: 0 4px 4px; }
.findlist .item { min-height: 56px; gap: 12px; border-radius: var(--r-m); }
.findlist .item .title { font-size: 1.02rem; }
.findicon { flex: 0 0 34px; height: 34px; border-radius: 10px; background: var(--paper); display: inline-flex; align-items: center; justify-content: center; color: var(--indigo); }
.findicon svg { width: 18px; height: 18px; }
.findrecent { display: flex; flex-wrap: wrap; gap: 8px; }
.findmore { justify-self: start; }
.findempty { padding: 14px 6px; }
@media (max-width: 899px) {
  .scrim:has(.findsheet) { align-items: stretch; }
  .sheet.findsheet { max-height: none; height: 100%; width: 100%; border-radius: 0; }
  .findsheet .findlist { max-height: none; }
}
/* help panel: folded extras */
.helpfold { border-top: 1px solid var(--line); padding-top: 8px; }
.helpfold > summary { cursor: pointer; font-weight: 650; padding: 6px 0; min-height: 36px; }
.helpfold > summary:hover { color: var(--indigo); }
.findlist .item { display: flex; align-items: center; width: 100%; text-align: left; background: transparent; border: 1px solid transparent; padding: 8px 10px; color: var(--ink); font: inherit; cursor: pointer; }
.findlist .item:hover, .findlist .item.on { background: var(--indigo-soft); border-color: transparent; }
.findlist .item .sub { color: var(--ink-2, #5b6078); font-size: .86rem; }
.findlist, .findgroup, .findlist .item, .findlist .item .grow { min-width: 0; }
.findlist .item .title { white-space: normal; overflow-wrap: anywhere; }
/* idle logout warning: bottom of the screen, above everything, big enough to tap */
.idlewarn { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 90; width: min(560px, calc(100% - 24px)); display: flex; gap: 10px; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
/* price builder: cost, extra charges and margin; ₹ / % switches sit beside their box */
.pbuild .seg { flex: 0 0 auto; }
.pbuild .seg button { min-width: 40px; padding: 0 10px; }
.pbout { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.pbout .good { color: var(--good, #1b7f4b); } .pbout .bad { color: var(--bad, #b3261e); }
@media (max-width: 640px) { .pbuild .grid3 { grid-template-columns: 1fr; } }

/* price builder: the ₹ / % switch is as tall as its box */
.pbuild .field .row { align-items: stretch; }
.pbuild .field .row .seg { display: flex; }
.pbuild .field .row .seg button { min-height: 0; }
