/* Kolhu dealer app - a counter-side tool on a cheap Android.
   Layout: docs/ui-redesign-plan.md. Colours: the Kolhu colours board
   (docs/brand/Kolhu · colours@1x.png) on the owner's page colours - warm cream
   page, pale sand cards with thin borders. Calm and flat: edges, not shadows,
   and generous space. Light only. 17px base, 48px+ tap targets, every text
   colour at least WCAG AA on its background. */

/* Mukta (SIL Open Font Licence, fonts/OFL.txt): Devanagari and Latin, self-hosted
   so it works offline and nothing is fetched from Google. */
@font-face { font-family: "Mukta"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/mukta-400-devanagari.woff2") format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF4, U+1CF7-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B0A; }
@font-face { font-family: "Mukta"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/mukta-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Mukta"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/mukta-600-devanagari.woff2") format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF4, U+1CF7-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B0A; }
@font-face { font-family: "Mukta"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/mukta-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Mukta"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/mukta-700-devanagari.woff2") format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF4, U+1CF7-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B0A; }
@font-face { font-family: "Mukta"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/mukta-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  /* The board's colours, each for the use the board gives it. */
  --ganna: #1F5A2E;          /* गन्ना हरा: logo, wordmark, app icon */
  --brand: #2F3D9C;          /* नील: buttons, active tab, links; white on it 9.3:1 */
  --brand-strong: #1E2766;   /* गहरा नील: Home money card; white on it 13.7:1 */
  --brand-ink: #2F3D9C;      /* नील as text: 8.2 on the page, 7.1 on sand */
  --gold: #F59E0B;           /* केसर: बोलो / voice */
  --gold-ink: #22241D;       /* स्याही on केसर 7.3:1 */
  --jama: #15803D;           /* जमा: money received only (fills, icons) */
  --jama-ink: #116532;       /* जमा as text: the board's 3.9 on sand fails AA; 5.5 */
  --danger: #C0262D;         /* उधार: money owed, expired; 4.5 on sand, 5.2 on page */
  --ink: #22241D;            /* स्याही */

  /* The owner's page colours. */
  --bg: #F5F1E8;             /* warm cream page */
  --surface: #E7E1D5;        /* pale sand cards; स्याही on it 12.3 */
  --raised: #FBF9F4;         /* fields, secondary buttons, chips: lighter than sand */

  /* Solid tints of the board colours - no other hues. Solid, not see-through,
     so a tint looks the same on a card and on the page. Every text pair is
     WCAG AA (ratios beside each). */
  --brand-soft: #eceef6;     /* नील 9% on white - on cream it turns grey: nav pill, wells; नील on it 8.0 */
  --brand-soft-2: #e0e2f0;   /* नील 15%: pressed; नील on it 7.2 */
  --gold-soft: #f5e0bc;      /* केसर 20% on cream: warnings, बोलो wells; स्याही on it 12.2 */
  --jama-soft: #dfe6d7;      /* जमा 10% on cream; जमा-ink on it 5.6 */
  --danger-soft: #f0dfd7;    /* उधार 9% on cream; उधार on it 4.6 */
  --field: var(--raised);    /* text 14.9, hint 6.3 */
  --surface-2: var(--raised);
  --line: #d6cdbc;           /* thin borders: card edges, dividers */
  --line-strong: #948a77;    /* field borders: 3.2 on a field (WCAG 3:1 for inputs) */
  --ink-2: #4a4b46;          /* secondary text; 6.8 on sand, 7.8 on page */
  --ink-3: #5c5d58;          /* hints; 5.1 on sand, 5.9 on page */
  /* Low stock / near expiry: स्याही on the केसर tint (solid केसर stays बोलो's). */
  --warn: #22241D; --warn-soft: var(--gold-soft);
  --info: var(--brand); --info-soft: var(--brand-soft);
  --wa: var(--brand);        /* WhatsApp actions are buttons too: नील */

  --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  /* Calm and flat: thin borders do the separating. A see-through shadow, not
     "none", so lists like "inset 4px 0 0 केसर, var(--shadow)" stay valid. */
  --shadow: 0 0 0 0 transparent;
  --shadow-2: 0 10px 28px rgba(30, 39, 102, .18);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Mukta", "Noto Sans Devanagari", system-ui, sans-serif;

  /* Old names, still used by a few screens. */
  --green-700: var(--brand); --green-600: var(--brand-ink); --green-100: var(--brand-soft);
  --amber: var(--warn); --amber-bg: var(--warn-soft); --red: var(--danger); --red-bg: var(--danger-soft);
  --ink-soft: var(--ink-2); --radius: var(--r-md);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font: 17px/1.45 var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-ink); }
.num, .amount, .value, .code-big { font-variant-numeric: tabular-nums; }

/* Line icons from the sprite in index.html */
svg.i { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
svg.i.sm { width: 18px; height: 18px; }
svg.i.lg { width: 28px; height: 28px; }

/* ---------- Top bar: light, the shop up front ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.topbar .titles { flex: 1; min-width: 0; line-height: 1.2; }
.topbar h1 { font-size: 20px; font-weight: 700; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar small { display: block; color: var(--ink-3); font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { background: none; border: 0; color: var(--ink); min-width: 40px; min-height: 44px;
  padding: 0; display: grid; place-items: center; border-radius: 12px; }
.topbar .icon-btn { position: relative; width: 44px; height: 44px; border-radius: 14px; flex: none;
  display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; border: 1px solid var(--line); }
.avatar { width: 44px; height: 44px; border-radius: 14px; flex: none; overflow: hidden;
  display: grid; place-items: center; background: var(--brand); color: #fff;
  font-weight: 700; font-size: 17px; text-decoration: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.inbox-btn .dot {
  position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--bg);
}

main { padding: 8px 20px calc(116px + var(--safe-b)); max-width: 720px; margin: 0 auto; }

/* ---------- Bottom nav: four tabs and the sale button ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding: 8px 6px calc(10px + var(--safe-b));
  background: var(--bg); border-top: 1px solid var(--line);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; color: var(--ink-3); font-size: 13.5px; font-weight: 600;
}
.nav a .pillw { width: 56px; height: 32px; border-radius: 16px; display: grid; place-items: center; }
.nav a.on { color: var(--brand-ink); }
.nav a.on .pillw { background: var(--brand-soft); }
.nav a.sell { color: var(--brand-ink); }
.nav a.sell .pillw { width: 58px; height: 58px; border-radius: 20px; margin-top: -26px;
  background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(47, 61, 156, .22); }

/* ---------- Building blocks ---------- */
/* Sand cards on cream, a thin border each, room to breathe inside and between. */
.card {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow);
  border: 1px solid var(--line); padding: 20px; margin-bottom: 16px;
}
.card h2, .card h3 { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.card.warn { box-shadow: inset 4px 0 0 var(--gold), var(--shadow); }
.card.bad { box-shadow: inset 4px 0 0 var(--danger), var(--shadow); }
.card.flat { box-shadow: none; border-color: transparent; }

.section-t { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 2px 12px; }
.section-t h2 { margin: 0; font-size: 18px; font-weight: 700; }
.section-t a, .section-t .muted { font-size: 15px; font-weight: 600; text-decoration: none; }

/* KPI tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: 16px 18px; text-decoration: none; color: inherit; display: block; }
.tile .label { font-size: 14px; color: var(--ink-3); }
.tile .value { font-size: 23px; font-weight: 700; }
.tile .sub { font-size: 14px; color: var(--ink-3); }
.tile.alert .value { color: var(--danger); }

/* Today card on Home */
.hero { background: var(--brand-strong); color: #fff;
  border-radius: 24px; padding: 22px 22px 20px; }
.hero .lbl { opacity: .85; font-size: 15px; }
.hero .big { font-size: 38px; font-weight: 700; line-height: 1.1; margin: 2px 0; font-variant-numeric: tabular-nums; }
.hero .sub { opacity: .85; font-size: 15px; }
.hero .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.hero .cell { background: rgba(255, 255, 255, .14); border-radius: 14px; padding: 10px 12px;
  color: #fff; text-decoration: none; display: block; }
.hero .cell b { display: block; font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero .cell span { font-size: 14px; opacity: .9; }

/* The four things done all day, one tap each */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 22px 0 6px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--ink);
  font-size: 14.5px; font-weight: 600; text-align: center; line-height: 1.15; background: none; border: 0;
  padding: 0; cursor: pointer; }
.qa .well { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--brand-ink); }
.qa.primary .well { background: var(--brand); border-color: var(--brand); color: #fff; }
.qa.gold .well { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.qa:active .well { transform: scale(.96); }
.qa.wa .well { color: var(--wa); }

/* Icon rows: to-do list, menus, lists */
.rows { list-style: none; margin: 0; padding: 0; }
.rowi { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line);
  text-decoration: none; color: inherit; width: 100%; background: none; border-left: 0; border-right: 0;
  border-bottom: 0; text-align: left; cursor: pointer; font: inherit; }
.rows > :first-child > .rowi, .rows > .rowi:first-child { border-top: 0; padding-top: 2px; }
.rows > :last-child > .rowi, .rows > .rowi:last-child { padding-bottom: 2px; }
.rowi.solo { border-top: 0; padding: 0; }
/* Icon wells: one look (नील tint) for everything you can open; colour only
   where it means something - उधार red, जमा green, बोलो and warnings केसर. */
.ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 16px; }
.ic.red { background: var(--danger-soft); color: var(--danger); }
.ic.amber { background: var(--warn-soft); color: var(--warn); }
.ic.green, .ic.blue { background: var(--brand-soft); color: var(--brand-ink); }
.ic.gold { background: var(--gold-soft); color: var(--ink); }
.rowi .tx { flex: 1; min-width: 0; line-height: 1.25; }
.rowi .tx b { display: block; font-weight: 600; font-size: 16.5px; }
.rowi .tx small { color: var(--ink-3); font-size: 14px; }
.rowi .end { text-align: right; line-height: 1.25; }
.chev { color: var(--ink-3); display: grid; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.red { background: var(--danger-soft); color: var(--danger); }
.pill.amber { background: var(--warn-soft); color: var(--warn); }
.pill.green { background: var(--jama-soft); color: var(--jama-ink); }
/* जमा: money received, and nothing else */
.pill.jama, .badge.jama, .ic.jama { background: var(--jama-soft); color: var(--jama-ink); }
.amount.jama, .jama-text { color: var(--jama-ink); }
.pill.big { font-size: 15px; padding: 4px 12px; }

/* "और" hub tiles */
.hub { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hub a { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); padding: 16px 6px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 14.5px;
  font-weight: 600; line-height: 1.2; color: var(--ink); text-decoration: none; position: relative; }
.hub a .ic { width: 46px; height: 46px; border-radius: 15px; }
.hub a .pill { position: absolute; top: 8px; right: 8px; }

/* Buttons: solid नील for the main action; every other one light with a thin
   border and नील text - never grey, which reads as disabled; केसर only for voice. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--raised); color: var(--brand-ink); font-weight: 600; text-decoration: none;
  cursor: pointer; line-height: 1.15; text-align: center; white-space: nowrap;
}
.btn:active { background: var(--brand-soft); }
.btn.primary, .btn.wa, .btn.gold, .btn.danger, .btn.ghost { border-color: transparent; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:active, .btn.wa:active { background: var(--brand-strong); }
.btn.gold { background: var(--gold); color: var(--gold-ink); }
.btn.wa { background: var(--wa); color: #fff; }
.btn.danger { color: var(--danger); background: var(--danger-soft); }
.btn.ghost { background: transparent; color: var(--brand-ink); }
.btn.block { width: 100%; }
.btn.big { min-height: 58px; font-size: 18px; border-radius: 16px; }
.btn.small { min-height: 40px; padding: 0 12px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .45; box-shadow: none; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
/* Equal halves whatever the label length; on a narrow phone a long label wraps. */
.row-btns .btn { flex: 1 1 0; min-width: 0; padding: 0 12px; white-space: normal; }
.row-btns .btn.block { flex-basis: 100%; }

label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-size: 14px; color: var(--ink-3); margin-bottom: 6px; font-weight: 600; }
input[type=text], input[type=tel], input[type=number], input[type=search], input[type=month],
input[type=date], input[type=password], select, textarea {
  width: 100%; min-height: 50px; padding: 10px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--field);
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px;
  border-color: var(--brand); background: #fff; }
.uncertain input, .uncertain select, input.uncertain, select.uncertain {
  background: var(--warn-soft); border-color: var(--warn);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }

/* Search box with a mic, at the top of lists */
.searchbar { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 6px 0 14px;
  border-radius: 16px; background: var(--raised); border: 1px solid var(--line-strong);
  color: var(--ink-3); margin-bottom: 16px; }
.searchbar input { flex: 1; min-width: 0; background: transparent; border: 0; padding: 0; min-height: 50px; }
.searchbar input:focus { outline: 0; background: transparent; }
.searchbar:focus-within { outline: 2px solid var(--brand); }
.searchbar .mic-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--ink); border: 0; flex: none; }
.searchbar .mic-btn.on { background: var(--danger); color: #fff; animation: pulse 1s infinite; }

/* Segmented control and tabs: a sand track, the chosen one light with नील text */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 16px; gap: 2px; }
.seg a, .seg button { text-align: center; padding: 8px 4px; border-radius: 11px; font-weight: 600;
  color: var(--ink-2); font-size: 15.5px; text-decoration: none; background: none; border: 0; cursor: pointer; }
.seg .on { background: var(--raised); color: var(--brand-ink); box-shadow: 0 0 0 1px var(--line); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list a, .list .item {
  display: flex; align-items: center; gap: 14px; padding: 14px 0; min-height: 56px;
  text-decoration: none; color: inherit;
}
.list .main { flex: 1; min-width: 0; }
.list .title { font-weight: 600; }
.list .meta { font-size: 14px; color: var(--ink-3); }
.amount { font-weight: 700; white-space: nowrap; }
.amount.owe { color: var(--danger); }

.badge { display: inline-block; font-size: 12.5px; font-weight: 700; border-radius: 999px;
  padding: 2px 9px; background: var(--brand-soft); color: var(--brand-ink); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.green { background: var(--jama-soft); color: var(--jama-ink); }

/* Chips: one scrolling row */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px 16px; padding: 2px 20px 4px;
  scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.card .chips { margin: 0 0 12px; padding: 2px 0 4px; flex-wrap: wrap; overflow: visible; }
.chip { flex: none; border: 1px solid var(--line); background: var(--raised); box-shadow: none; border-radius: 999px;
  padding: 7px 14px; min-height: 38px; font-size: 15px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
a.chip { text-decoration: none; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .n { color: var(--danger); }
.chip.on .n { color: #fff; opacity: .85; }
.chip.missing { background: transparent; box-shadow: inset 0 0 0 1.5px var(--warn); color: var(--warn); }

/* Tabs inside a screen (a farmer's खाता / खरीद / फसल / सलाह) */
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin: 20px 0 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 8px 6px; min-height: 42px; border-radius: 11px;
  color: var(--ink-2); white-space: nowrap; font-weight: 600; cursor: pointer; }
.tabs button.on { background: var(--raised); color: var(--brand-ink); box-shadow: 0 0 0 1px var(--line); }

.muted { color: var(--ink-3); font-size: 14px; }
.warn-text { color: var(--warn); font-size: 14px; }
.err-text { color: var(--danger); font-size: 14px; }
.right { text-align: right; }
.center { text-align: center; }
.total-line { display: flex; justify-content: space-between; padding: 4px 0; }
.total-line.big { font-size: 20px; font-weight: 700; }

.line-item { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; margin-bottom: 12px; }
.line-item input, .line-item select, .line-item .picker { background: var(--raised); }
.line-item .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
/* A sale's items are cards of their own, straight on the page */
.line-item.sale-line { background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; margin-bottom: 16px; }
.line-item.sale-line input, .line-item.sale-line .picker, .line-item.sale-line .stepper { background: var(--surface-2); }
.line-item.sale-line .stepper input { background: transparent; }
.stepper:focus-within { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.stepper input:focus { outline: 0; }
.x { background: none; border: 0; font-size: 20px; color: var(--ink-3); min-width: 40px; min-height: 40px;
  display: grid; place-items: center; cursor: pointer; }

/* − 2 + */
.stepper { display: flex; align-items: center; background: var(--raised); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); min-height: 50px; }
.stepper button { width: 46px; min-height: 50px; border: 0; background: none; color: var(--brand-ink);
  display: grid; place-items: center; cursor: pointer; }
.stepper input { flex: 1; min-width: 0; text-align: center; background: transparent; border: 0; padding: 0;
  font-weight: 700; font-size: 18px; }

/* Total and the save button, fixed above the keyboard line */
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 22; display: flex; align-items: center;
  gap: 14px; padding: 14px 20px calc(16px + var(--safe-b)); background: var(--surface);
  border-top: 1px solid var(--line); }
.actionbar .tot { line-height: 1.1; flex: none; }
.actionbar .tot small { color: var(--ink-3); font-size: 14px; display: block; }
.actionbar .tot b { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.actionbar .btn { flex: 1; min-height: 56px; font-size: 18px; border-radius: 16px; }
body.has-actionbar .nav { display: none; }
body.has-actionbar main { padding-bottom: calc(120px + var(--safe-b)); }

table.simple { width: 100%; border-collapse: collapse; font-size: 15px; }
table.simple th, table.simple td { padding: 9px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.simple th { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.scroll-x { overflow-x: auto; }

/* ---------- Quick Entry (बोलो) ---------- */
.bolo-box { display: flex; gap: 8px; align-items: stretch; }
.bolo-box textarea { flex: 1; }
.mic { min-width: 64px; border-radius: var(--r-md); border: 0; background: var(--gold); color: var(--gold-ink);
  font-size: 26px; display: grid; place-items: center; cursor: pointer; }
.mic.on { background: var(--danger); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.qcard h3 { display: flex; justify-content: space-between; align-items: center; }

.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid currentColor;
  border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Product picker ---------- */
.picker {
  width: 100%; min-height: 50px; padding: 8px 14px; border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--field); display: flex; justify-content: space-between; align-items: center; gap: 8px;
  text-align: left; cursor: pointer;
}
.picker.uncertain { background: var(--warn-soft); border-color: var(--warn); }
.picker-sheet { min-height: 70dvh; padding-top: 12px; }
.picker-head { display: flex; gap: 8px; align-items: center; position: sticky; top: -12px;
  background: var(--bg); padding: 4px 0 8px; z-index: 1; }
.picker-head input { flex: 1; font-size: 18px; }
.small-mic { min-width: 48px; min-height: 48px; font-size: 20px; }
.pick-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 0; min-height: 56px;
  background: none; border: 0; text-align: left; cursor: pointer; }
.pick-row.off { opacity: .5; cursor: not-allowed; }
.picker-list li { border-bottom: 1px solid var(--line); }
.line-item .head .picker { flex: 1; }

/* ---------- Returns ---------- */
.returned { text-decoration: line-through; color: var(--ink-3); }
.cancelled-banner { border: 2px solid var(--danger); color: var(--danger); font-weight: 700; text-align: center;
  border-radius: var(--r-md); padding: 8px; margin-bottom: 12px; }

/* ---------- Advice inbox ---------- */
.shop-photo { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface); }
.shop-photo.big { width: 96px; height: 96px; border-radius: 24px; box-shadow: var(--shadow); }
.timer { font-size: 13px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.timer.soon { color: var(--danger); }

.thread { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.bubble { max-width: 85%; padding: 8px 12px; border-radius: 16px; box-shadow: var(--shadow);
  white-space: pre-wrap; word-wrap: break-word; }
.bubble.in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--brand-soft); border: 1px solid var(--brand-soft-2); border-bottom-right-radius: 4px; }
.bubble .who { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 2px; }
.bubble .when { font-size: 11.5px; color: var(--ink-3); text-align: right; margin-top: 2px; }
.bubble img { max-width: 100%; max-height: 260px; border-radius: 12px; display: block; }
.bubble audio { width: 230px; max-width: 100%; }
.bubble .heard { font-style: italic; }
.ticks.read { color: var(--info); }
.ticks.failed { color: var(--danger); }

.draft { box-shadow: inset 0 0 0 2px var(--gold), var(--shadow); }
.draft textarea { min-height: 140px; background: var(--surface-2); }
.flag { display: inline-block; font-size: 13px; border-radius: 8px; padding: 3px 8px; margin: 0 6px 6px 0; }
.flag.dose, .flag.banned { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.flag.price, .flag.no_stock, .flag.stock_note, .flag.scrubbed { background: var(--warn-soft); color: var(--warn); }
.flag.product { background: var(--brand-soft); color: var(--brand-ink); }
.flag.seen { background: var(--surface-2); color: var(--ink-3); }
.diag { font-size: 14px; background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px; margin-bottom: 8px; }
.inbox-alert { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.inbox-alert .big { font-size: 28px; }
.plain-link { color: inherit; text-decoration: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(110px + var(--safe-b)); z-index: 40;
  max-width: 560px; margin: 0 auto; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: var(--shadow-2);
}
.toast.err { background: var(--danger); color: #fff; }

/* ---------- Sheet (modal) ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 720px; max-height: 90dvh; overflow-y: auto;
  border-radius: 24px 24px 0 0; padding: 24px 20px calc(20px + var(--safe-b)); }
.sheet h2 { margin: 0 0 16px; font-size: 20px; }

/* ---------- Login ---------- */
.login { max-width: 420px; margin: 0 auto; padding: 32px 20px 44px; }
.login h1 { color: var(--ink); margin: 18px 0 4px; font-size: 22px; }
/* The brand block: the mark as the file is, कोल्हू, the board's line and sub-line */
.brand-block { text-align: center; }
.brand-block img { display: block; margin: 0 auto; width: 230px; max-width: 70%; height: auto; }
.brand-block.small img { width: 120px; }
.wordmark { font-size: 54px; font-weight: 700; color: var(--ganna); line-height: 1; margin-top: 6px; }
.brand-block.small .wordmark { font-size: 34px; }
.bline { font-size: 19px; font-weight: 700; margin-top: 10px; color: var(--ink); }
.brand-block.small .bline { font-size: 16px; margin-top: 6px; }
.bsub { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px;
  font-size: 15px; font-weight: 600; color: var(--brand-ink); }
.bsub:before, .bsub:after { content: ""; width: 30px; height: 2px; background: var(--gold); border-radius: 2px; }
.login .card { margin-top: 22px; }
.login a { text-decoration: none; }
/* "Powered by" at the foot of Home and और */
.powered { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 28px 0 4px;
  font-size: 13px; color: var(--ink-3); }
.powered img { width: 34px; height: auto; }
.powered .notranslate { font-weight: 700; color: var(--ganna); }
/* The four verticals, as on the board */
.vert { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.vert > div { text-align: center; line-height: 1.2; padding: 0 4px; }
.vert > div + div { border-left: 1px solid var(--line); }
.vert svg { display: block; margin: 0 auto 6px; width: 34px; height: 34px; }
.vert b { display: block; font-size: 13.5px; font-weight: 700; color: var(--ganna); }
.vert small { display: block; font-size: 12px; color: var(--ink); margin-top: 2px; }
.vhead { display: flex; align-items: center; gap: 10px; margin: 22px 2px 10px; }
.vhead svg { width: 30px; height: 30px; flex: none; }
.vhead b { font-size: 18px; color: var(--ganna); white-space: nowrap; }
.vhead small { color: var(--ink-3); font-size: 14px; }
.pin { letter-spacing: 8px; font-size: 24px; text-align: center; }
.login .center { text-align: center; margin-top: 18px; }
.ok { color: var(--brand-ink); font-weight: 600; }
.code-big { font-size: 32px; font-weight: 700; letter-spacing: 3px; text-align: center; margin: 12px 0;
  user-select: all; }

/* ---------- Subscription ---------- */
.sub-banner { display: block; margin: 0 20px 8px; padding: 12px 16px; border-radius: var(--r-md);
  font-weight: 600; font-size: 15px; text-decoration: none; background: var(--surface); color: var(--brand-ink);
  border: 1px solid var(--line); }
.sub-banner.bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.sub-banner[hidden] { display: none; }
.qr { display: block; width: 220px; max-width: 100%; margin: 8px auto; background: #fff; border-radius: 12px; }
/* प्लान tab: price, what's included, how the month works, questions */
.hero .price { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; }
.hero .price b { font-size: 44px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.hero .price span { opacity: .85; }
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { display: flex; gap: 10px; padding: 7px 0; line-height: 1.3; }
.ticks .tk { flex: none; width: 24px; height: 24px; border-radius: 50%; margin-top: 1px;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.ticks b, .steps b { display: block; font-weight: 600; }
.ticks small, .steps small { display: block; color: var(--ink-3); font-size: 14px; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.steps li:last-child { padding-bottom: 0; }
.steps .dot { flex: none; width: 28px; height: 28px; border-radius: 50%; z-index: 1;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--brand); color: #fff; }
.steps .dot.gold { background: var(--gold); color: var(--gold-ink); }
.steps .dot.grey { background: var(--surface-2); color: var(--ink-2); }
.steps li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0;
  width: 2px; background: var(--line); }
.faq { background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line); padding: 4px 20px; margin-bottom: 16px; }
.faq details { border-top: 1px solid var(--line); padding: 14px 0; }
.faq details:first-child { border-top: 0; }
.faq summary { font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] summary .chev { transform: rotate(90deg); }
.faq details p { margin: 8px 0 0; color: var(--ink-2); font-size: 15.5px; }
.upi-id { font-weight: 700; user-select: all; word-break: break-all; }

@media (min-width: 640px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .hub { grid-template-columns: repeat(4, 1fr); }
}
